@vinaverse/react-native 0.1.0-alpha.8 → 0.1.0-alpha.9

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 CHANGED
@@ -101,8 +101,9 @@ const imagePolicy = { hosts: ['images.example.com'], aspectRatio: 1.6, Placehold
101
101
  - **Policies and adapters:** `imagePolicy` (photo hosts, frame, the stand-in for a missing photo, given the card's `title` and `kind`) applies to every card
102
102
  and every fetch ahead; `announce` reads finished replies and the greeting your way; `onChip` hears a tapped chip.
103
103
  Card renderers get the card read once (`read`). A listing with no rating draws `copy.ratingNone` in the rating's place (empty by default; "New", say).
104
- - **Hooks** for your own parts: `useAgentConversation`, `useAgentStatus`, `useAgentFeatures`, `useAgentProfile`,
105
- `useAgentName`, `useAgentLauncher`, `useAgentRuntime`.
104
+ - **Hooks** for your own parts: `useAgentConversation`, `useAgentStatus`, `useAgentStatusState` (`{ status, reading,
105
+ failed }`: "still reading" apart from "could not read"), `useAgentFeatures`, `useAgentProfile`, `useAgentName`,
106
+ `useAgentLauncher`, `useAgentRuntime`.
106
107
  - **Events** for analytics through `onEvent`: sessions, ratings, chips, targets and links opened, the launcher shown,
107
108
  opened, greeted and its greeting closed.
108
109
  - **StrictMode, in development only:** React mounts, unmounts and mounts again, so a conversation still opening is let
@@ -258,8 +259,13 @@ part as `Default`. With neither, the kit draws both as before.
258
259
 
259
260
  - **Professionals and spaces** draw as photo cards: the hero photo (through your `Image` slot, so `expo-image`'s cache
260
261
  applies), the name's monogram when there is none or it fails, rating with its count, "From $45" and the next open
261
- time.
262
- - **A carousel** for the cards a turn draws together: add the kit's `CardCarousel`. Without it they draw one under
262
+ time, said as people say it ("Next: tomorrow, 10:00 AM"; `copy.today` and `copy.tomorrow`, else the date). The
263
+ photo frame is `imagePolicy.aspectRatio` (default 1.6); `'natural'` draws a card on its own in its photo's own
264
+ shape, held within `naturalAspect` (square to 2:1 by default), while a card in a carousel keeps the fixed frame.
265
+ - **Bookings, services and every other card** show their `status` (a booking's "Confirmed") first among the badges,
266
+ and a tap opens what the card is about (its `ref`) through `onOpenTarget`, as a listing does.
267
+ - **A carousel** for the cards a turn draws together: add the kit's `CardCarousel`. A turn's cards of one carousel
268
+ group join one row where the first of them is, even with another card between them. Without it they draw one under
263
269
  another; it is opt-in so an app that does not use it does not ship it.
264
270
 
265
271
  ```tsx
package/dist/chat.cjs CHANGED
@@ -1,241 +1,245 @@
1
1
  'use strict';
2
2
 
3
- var chunkEXN5TNLU_cjs = require('./chunk-EXN5TNLU.cjs');
3
+ var chunkV7XYOLLT_cjs = require('./chunk-V7XYOLLT.cjs');
4
4
  var chunk6QYDPGRS_cjs = require('./chunk-6QYDPGRS.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "ActivityLine", {
9
9
  enumerable: true,
10
- get: function () { return chunkEXN5TNLU_cjs.ActivityLine; }
10
+ get: function () { return chunkV7XYOLLT_cjs.ActivityLine; }
11
11
  });
12
12
  Object.defineProperty(exports, "AgentChat", {
13
13
  enumerable: true,
14
- get: function () { return chunkEXN5TNLU_cjs.AgentChat; }
14
+ get: function () { return chunkV7XYOLLT_cjs.AgentChat; }
15
15
  });
16
16
  Object.defineProperty(exports, "AgentFooter", {
17
17
  enumerable: true,
18
- get: function () { return chunkEXN5TNLU_cjs.AgentFooter; }
18
+ get: function () { return chunkV7XYOLLT_cjs.AgentFooter; }
19
19
  });
20
20
  Object.defineProperty(exports, "AgentRuntimeProvider", {
21
21
  enumerable: true,
22
- get: function () { return chunkEXN5TNLU_cjs.AgentRuntimeProvider; }
22
+ get: function () { return chunkV7XYOLLT_cjs.AgentRuntimeProvider; }
23
23
  });
24
24
  Object.defineProperty(exports, "Avatar", {
25
25
  enumerable: true,
26
- get: function () { return chunkEXN5TNLU_cjs.Avatar; }
26
+ get: function () { return chunkV7XYOLLT_cjs.Avatar; }
27
27
  });
28
28
  Object.defineProperty(exports, "Button", {
29
29
  enumerable: true,
30
- get: function () { return chunkEXN5TNLU_cjs.Button; }
30
+ get: function () { return chunkV7XYOLLT_cjs.Button; }
31
31
  });
32
32
  Object.defineProperty(exports, "CardActions", {
33
33
  enumerable: true,
34
- get: function () { return chunkEXN5TNLU_cjs.CardActions; }
34
+ get: function () { return chunkV7XYOLLT_cjs.CardActions; }
35
35
  });
36
36
  Object.defineProperty(exports, "CardCarousel", {
37
37
  enumerable: true,
38
- get: function () { return chunkEXN5TNLU_cjs.CardCarousel; }
38
+ get: function () { return chunkV7XYOLLT_cjs.CardCarousel; }
39
39
  });
40
40
  Object.defineProperty(exports, "CardFrame", {
41
41
  enumerable: true,
42
- get: function () { return chunkEXN5TNLU_cjs.CardFrame; }
42
+ get: function () { return chunkV7XYOLLT_cjs.CardFrame; }
43
43
  });
44
44
  Object.defineProperty(exports, "CardView", {
45
45
  enumerable: true,
46
- get: function () { return chunkEXN5TNLU_cjs.CardView; }
46
+ get: function () { return chunkV7XYOLLT_cjs.CardView; }
47
47
  });
48
48
  Object.defineProperty(exports, "ChatHeader", {
49
49
  enumerable: true,
50
- get: function () { return chunkEXN5TNLU_cjs.ChatHeader; }
50
+ get: function () { return chunkV7XYOLLT_cjs.ChatHeader; }
51
51
  });
52
52
  Object.defineProperty(exports, "ChatSkeleton", {
53
53
  enumerable: true,
54
- get: function () { return chunkEXN5TNLU_cjs.ChatSkeleton; }
54
+ get: function () { return chunkV7XYOLLT_cjs.ChatSkeleton; }
55
55
  });
56
56
  Object.defineProperty(exports, "Composer", {
57
57
  enumerable: true,
58
- get: function () { return chunkEXN5TNLU_cjs.Composer; }
58
+ get: function () { return chunkV7XYOLLT_cjs.Composer; }
59
59
  });
60
60
  Object.defineProperty(exports, "DefaultBubble", {
61
61
  enumerable: true,
62
- get: function () { return chunkEXN5TNLU_cjs.DefaultBubble; }
62
+ get: function () { return chunkV7XYOLLT_cjs.DefaultBubble; }
63
63
  });
64
64
  Object.defineProperty(exports, "DefaultComposer", {
65
65
  enumerable: true,
66
- get: function () { return chunkEXN5TNLU_cjs.DefaultComposer; }
66
+ get: function () { return chunkV7XYOLLT_cjs.DefaultComposer; }
67
67
  });
68
68
  Object.defineProperty(exports, "DefaultEnded", {
69
69
  enumerable: true,
70
- get: function () { return chunkEXN5TNLU_cjs.DefaultEnded; }
70
+ get: function () { return chunkV7XYOLLT_cjs.DefaultEnded; }
71
71
  });
72
72
  Object.defineProperty(exports, "DefaultHeader", {
73
73
  enumerable: true,
74
- get: function () { return chunkEXN5TNLU_cjs.DefaultHeader; }
74
+ get: function () { return chunkV7XYOLLT_cjs.DefaultHeader; }
75
75
  });
76
76
  Object.defineProperty(exports, "DefaultTurnFailed", {
77
77
  enumerable: true,
78
- get: function () { return chunkEXN5TNLU_cjs.DefaultTurnFailed; }
78
+ get: function () { return chunkV7XYOLLT_cjs.DefaultTurnFailed; }
79
79
  });
80
80
  Object.defineProperty(exports, "DefaultUnavailable", {
81
81
  enumerable: true,
82
- get: function () { return chunkEXN5TNLU_cjs.DefaultUnavailable; }
82
+ get: function () { return chunkV7XYOLLT_cjs.DefaultUnavailable; }
83
83
  });
84
84
  Object.defineProperty(exports, "DefaultUnavailableScreen", {
85
85
  enumerable: true,
86
- get: function () { return chunkEXN5TNLU_cjs.DefaultUnavailableScreen; }
86
+ get: function () { return chunkV7XYOLLT_cjs.DefaultUnavailableScreen; }
87
87
  });
88
88
  Object.defineProperty(exports, "DefaultUnreachable", {
89
89
  enumerable: true,
90
- get: function () { return chunkEXN5TNLU_cjs.DefaultUnreachable; }
90
+ get: function () { return chunkV7XYOLLT_cjs.DefaultUnreachable; }
91
91
  });
92
92
  Object.defineProperty(exports, "DisclosureBar", {
93
93
  enumerable: true,
94
- get: function () { return chunkEXN5TNLU_cjs.DisclosureBar; }
94
+ get: function () { return chunkV7XYOLLT_cjs.DisclosureBar; }
95
95
  });
96
96
  Object.defineProperty(exports, "FailureActionButton", {
97
97
  enumerable: true,
98
- get: function () { return chunkEXN5TNLU_cjs.FailureActionButton; }
98
+ get: function () { return chunkV7XYOLLT_cjs.FailureActionButton; }
99
99
  });
100
100
  Object.defineProperty(exports, "InfoCard", {
101
101
  enumerable: true,
102
- get: function () { return chunkEXN5TNLU_cjs.InfoCard; }
102
+ get: function () { return chunkV7XYOLLT_cjs.InfoCard; }
103
103
  });
104
104
  Object.defineProperty(exports, "LinksCard", {
105
105
  enumerable: true,
106
- get: function () { return chunkEXN5TNLU_cjs.LinksCard; }
106
+ get: function () { return chunkV7XYOLLT_cjs.LinksCard; }
107
107
  });
108
108
  Object.defineProperty(exports, "ListingCard", {
109
109
  enumerable: true,
110
- get: function () { return chunkEXN5TNLU_cjs.ListingCard; }
110
+ get: function () { return chunkV7XYOLLT_cjs.ListingCard; }
111
111
  });
112
112
  Object.defineProperty(exports, "MessageBubble", {
113
113
  enumerable: true,
114
- get: function () { return chunkEXN5TNLU_cjs.MessageBubble; }
114
+ get: function () { return chunkV7XYOLLT_cjs.MessageBubble; }
115
115
  });
116
116
  Object.defineProperty(exports, "MessageList", {
117
117
  enumerable: true,
118
- get: function () { return chunkEXN5TNLU_cjs.MessageList; }
118
+ get: function () { return chunkV7XYOLLT_cjs.MessageList; }
119
119
  });
120
120
  Object.defineProperty(exports, "NextStepCard", {
121
121
  enumerable: true,
122
- get: function () { return chunkEXN5TNLU_cjs.NextStepCard; }
122
+ get: function () { return chunkV7XYOLLT_cjs.NextStepCard; }
123
123
  });
124
124
  Object.defineProperty(exports, "ProposalCard", {
125
125
  enumerable: true,
126
- get: function () { return chunkEXN5TNLU_cjs.ProposalCard; }
126
+ get: function () { return chunkV7XYOLLT_cjs.ProposalCard; }
127
127
  });
128
128
  Object.defineProperty(exports, "QuestionCard", {
129
129
  enumerable: true,
130
- get: function () { return chunkEXN5TNLU_cjs.QuestionCard; }
130
+ get: function () { return chunkV7XYOLLT_cjs.QuestionCard; }
131
131
  });
132
132
  Object.defineProperty(exports, "Row", {
133
133
  enumerable: true,
134
- get: function () { return chunkEXN5TNLU_cjs.Row; }
134
+ get: function () { return chunkV7XYOLLT_cjs.Row; }
135
135
  });
136
136
  Object.defineProperty(exports, "StatusBanner", {
137
137
  enumerable: true,
138
- get: function () { return chunkEXN5TNLU_cjs.StatusBanner; }
138
+ get: function () { return chunkV7XYOLLT_cjs.StatusBanner; }
139
139
  });
140
140
  Object.defineProperty(exports, "StreamingBubble", {
141
141
  enumerable: true,
142
- get: function () { return chunkEXN5TNLU_cjs.StreamingBubble; }
142
+ get: function () { return chunkV7XYOLLT_cjs.StreamingBubble; }
143
143
  });
144
144
  Object.defineProperty(exports, "SystemRow", {
145
145
  enumerable: true,
146
- get: function () { return chunkEXN5TNLU_cjs.SystemRow; }
146
+ get: function () { return chunkV7XYOLLT_cjs.SystemRow; }
147
147
  });
148
148
  Object.defineProperty(exports, "TimeSlotsCard", {
149
149
  enumerable: true,
150
- get: function () { return chunkEXN5TNLU_cjs.TimeSlotsCard; }
150
+ get: function () { return chunkV7XYOLLT_cjs.TimeSlotsCard; }
151
151
  });
152
152
  Object.defineProperty(exports, "VinaverseChat", {
153
153
  enumerable: true,
154
- get: function () { return chunkEXN5TNLU_cjs.VinaverseChat; }
154
+ get: function () { return chunkV7XYOLLT_cjs.VinaverseChat; }
155
155
  });
156
156
  Object.defineProperty(exports, "VinaverseChatProvider", {
157
157
  enumerable: true,
158
- get: function () { return chunkEXN5TNLU_cjs.VinaverseChatProvider; }
158
+ get: function () { return chunkV7XYOLLT_cjs.VinaverseChatProvider; }
159
159
  });
160
160
  Object.defineProperty(exports, "Welcome", {
161
161
  enumerable: true,
162
- get: function () { return chunkEXN5TNLU_cjs.Welcome; }
162
+ get: function () { return chunkV7XYOLLT_cjs.Welcome; }
163
163
  });
164
164
  Object.defineProperty(exports, "allowedImage", {
165
165
  enumerable: true,
166
- get: function () { return chunkEXN5TNLU_cjs.allowedImage; }
166
+ get: function () { return chunkV7XYOLLT_cjs.allowedImage; }
167
167
  });
168
168
  Object.defineProperty(exports, "answerText", {
169
169
  enumerable: true,
170
- get: function () { return chunkEXN5TNLU_cjs.answerText; }
170
+ get: function () { return chunkV7XYOLLT_cjs.answerText; }
171
171
  });
172
172
  Object.defineProperty(exports, "carousels", {
173
173
  enumerable: true,
174
- get: function () { return chunkEXN5TNLU_cjs.carousels; }
174
+ get: function () { return chunkV7XYOLLT_cjs.carousels; }
175
175
  });
176
176
  Object.defineProperty(exports, "defaultCard", {
177
177
  enumerable: true,
178
- get: function () { return chunkEXN5TNLU_cjs.defaultCard; }
178
+ get: function () { return chunkV7XYOLLT_cjs.defaultCard; }
179
179
  });
180
180
  Object.defineProperty(exports, "fieldText", {
181
181
  enumerable: true,
182
- get: function () { return chunkEXN5TNLU_cjs.fieldText; }
182
+ get: function () { return chunkV7XYOLLT_cjs.fieldText; }
183
183
  });
184
184
  Object.defineProperty(exports, "forgetGreeting", {
185
185
  enumerable: true,
186
- get: function () { return chunkEXN5TNLU_cjs.forgetGreeting; }
186
+ get: function () { return chunkV7XYOLLT_cjs.forgetGreeting; }
187
187
  });
188
188
  Object.defineProperty(exports, "greetedKey", {
189
189
  enumerable: true,
190
- get: function () { return chunkEXN5TNLU_cjs.greetedKey; }
190
+ get: function () { return chunkV7XYOLLT_cjs.greetedKey; }
191
191
  });
192
192
  Object.defineProperty(exports, "itemType", {
193
193
  enumerable: true,
194
- get: function () { return chunkEXN5TNLU_cjs.itemType; }
194
+ get: function () { return chunkV7XYOLLT_cjs.itemType; }
195
195
  });
196
196
  Object.defineProperty(exports, "monogram", {
197
197
  enumerable: true,
198
- get: function () { return chunkEXN5TNLU_cjs.monogram; }
198
+ get: function () { return chunkV7XYOLLT_cjs.monogram; }
199
199
  });
200
200
  Object.defineProperty(exports, "newestWholeReply", {
201
201
  enumerable: true,
202
- get: function () { return chunkEXN5TNLU_cjs.newestWholeReply; }
202
+ get: function () { return chunkV7XYOLLT_cjs.newestWholeReply; }
203
203
  });
204
204
  Object.defineProperty(exports, "ratingText", {
205
205
  enumerable: true,
206
- get: function () { return chunkEXN5TNLU_cjs.ratingText; }
206
+ get: function () { return chunkV7XYOLLT_cjs.ratingText; }
207
207
  });
208
208
  Object.defineProperty(exports, "useAgentConversation", {
209
209
  enumerable: true,
210
- get: function () { return chunkEXN5TNLU_cjs.useAgentConversation; }
210
+ get: function () { return chunkV7XYOLLT_cjs.useAgentConversation; }
211
211
  });
212
212
  Object.defineProperty(exports, "useAgentFeatures", {
213
213
  enumerable: true,
214
- get: function () { return chunkEXN5TNLU_cjs.useAgentFeatures; }
214
+ get: function () { return chunkV7XYOLLT_cjs.useAgentFeatures; }
215
215
  });
216
216
  Object.defineProperty(exports, "useAgentLauncher", {
217
217
  enumerable: true,
218
- get: function () { return chunkEXN5TNLU_cjs.useAgentLauncher; }
218
+ get: function () { return chunkV7XYOLLT_cjs.useAgentLauncher; }
219
219
  });
220
220
  Object.defineProperty(exports, "useAgentName", {
221
221
  enumerable: true,
222
- get: function () { return chunkEXN5TNLU_cjs.useAgentName; }
222
+ get: function () { return chunkV7XYOLLT_cjs.useAgentName; }
223
223
  });
224
224
  Object.defineProperty(exports, "useAgentProfile", {
225
225
  enumerable: true,
226
- get: function () { return chunkEXN5TNLU_cjs.useAgentProfile; }
226
+ get: function () { return chunkV7XYOLLT_cjs.useAgentProfile; }
227
227
  });
228
228
  Object.defineProperty(exports, "useAgentRuntime", {
229
229
  enumerable: true,
230
- get: function () { return chunkEXN5TNLU_cjs.useAgentRuntime; }
230
+ get: function () { return chunkV7XYOLLT_cjs.useAgentRuntime; }
231
231
  });
232
232
  Object.defineProperty(exports, "useAgentStatus", {
233
233
  enumerable: true,
234
- get: function () { return chunkEXN5TNLU_cjs.useAgentStatus; }
234
+ get: function () { return chunkV7XYOLLT_cjs.useAgentStatus; }
235
+ });
236
+ Object.defineProperty(exports, "useAgentStatusState", {
237
+ enumerable: true,
238
+ get: function () { return chunkV7XYOLLT_cjs.useAgentStatusState; }
235
239
  });
236
240
  Object.defineProperty(exports, "useChat", {
237
241
  enumerable: true,
238
- get: function () { return chunkEXN5TNLU_cjs.useChat; }
242
+ get: function () { return chunkV7XYOLLT_cjs.useChat; }
239
243
  });
240
244
  Object.defineProperty(exports, "ThemeProvider", {
241
245
  enumerable: true,
package/dist/chat.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, forgetGreeting, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
1
+ export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, forgetGreeting, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus, useAgentStatusState } from '@vinaverse/react/agent';
2
2
  import * as react from 'react';
3
3
  import { ComponentType, ReactElement, ReactNode, RefObject } from 'react';
4
4
  import * as _vinaverse_client_conversation from '@vinaverse/client/conversation';
@@ -106,6 +106,8 @@ interface CardProps {
106
106
  readonly busy: boolean;
107
107
  /** Restored after a restart: draw it as it was, taking no answer or action. */
108
108
  readonly restored: boolean;
109
+ /** Drawn inside a carousel with its group: a photo keeps the policy's fixed frame, so the row stays even. */
110
+ readonly grouped?: boolean;
109
111
  /** The kit's own renderer for this kind, to wrap rather than rewrite. */
110
112
  readonly Default: ComponentType<Omit<CardProps, 'Default'>>;
111
113
  }
@@ -114,6 +116,8 @@ interface CardProps {
114
116
  declare function defaultCard(kind: string): ComponentType<Omit<CardProps, 'Default'>>;
115
117
  declare const CardView: react.NamedExoticComponent<{
116
118
  readonly item: CardItem;
119
+ /** Inside a carousel (`CardCarousel`). */
120
+ readonly grouped?: boolean;
117
121
  }>;
118
122
 
119
123
  declare function InfoCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
@@ -189,8 +193,17 @@ interface ChatHandlers {
189
193
  interface ImagePolicy {
190
194
  /** Hosts a photo may come from (exact names); default any https host. */
191
195
  readonly hosts?: readonly string[];
192
- /** Width / height of a listing's photo frame. Default 1.6 (16:10). */
193
- readonly aspectRatio?: number;
196
+ /**
197
+ * Width / height of a listing's photo frame. Default 1.6 (16:10). `natural`: a card on its own takes its photo's
198
+ * own shape (its `width` and `height`), held within `naturalAspect`; a card in a carousel keeps 1.6, so the row
199
+ * stays even, and a photo without its size too.
200
+ */
201
+ readonly aspectRatio?: number | 'natural';
202
+ /** The shapes a `natural` photo is held within. Default square to 2:1 (`{ min: 1, max: 2 }`). */
203
+ readonly naturalAspect?: {
204
+ readonly min: number;
205
+ readonly max: number;
206
+ };
194
207
  /**
195
208
  * What stands in for a missing, refused or failed photo, by the card's `kind` (a person's tile, a space's tile).
196
209
  * Default the name's monogram.
@@ -421,9 +434,10 @@ declare const StreamingBubble: react.NamedExoticComponent<{
421
434
  /** Rows of one kind recycle together. */
422
435
  declare function itemType(item: TimelineItem): string;
423
436
  /**
424
- * Runs of two or more consecutive cards with one carousel group (`group.layout: carousel`, the same `group.id`): by
425
- * 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
426
- * same array, so its row does not render again.
437
+ * Carousel groups of two or more cards (`group.layout: carousel`, the same `group.id` in the same turn), wherever in
438
+ * the turn they arrive, another card or a message between them included: drawn as one row where the group's first
439
+ * card is, by that card's key, with the keys of the cards the row draws after it. A row equal to the previous one is
440
+ * the same array, so it does not render again.
427
441
  */
428
442
  declare function carousels(items: readonly TimelineItem[], previous: ReadonlyMap<string, readonly CardItem[]>): {
429
443
  runs: Map<string, readonly CardItem[]>;
package/dist/chat.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, forgetGreeting, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
1
+ export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, forgetGreeting, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus, useAgentStatusState } from '@vinaverse/react/agent';
2
2
  import * as react from 'react';
3
3
  import { ComponentType, ReactElement, ReactNode, RefObject } from 'react';
4
4
  import * as _vinaverse_client_conversation from '@vinaverse/client/conversation';
@@ -106,6 +106,8 @@ interface CardProps {
106
106
  readonly busy: boolean;
107
107
  /** Restored after a restart: draw it as it was, taking no answer or action. */
108
108
  readonly restored: boolean;
109
+ /** Drawn inside a carousel with its group: a photo keeps the policy's fixed frame, so the row stays even. */
110
+ readonly grouped?: boolean;
109
111
  /** The kit's own renderer for this kind, to wrap rather than rewrite. */
110
112
  readonly Default: ComponentType<Omit<CardProps, 'Default'>>;
111
113
  }
@@ -114,6 +116,8 @@ interface CardProps {
114
116
  declare function defaultCard(kind: string): ComponentType<Omit<CardProps, 'Default'>>;
115
117
  declare const CardView: react.NamedExoticComponent<{
116
118
  readonly item: CardItem;
119
+ /** Inside a carousel (`CardCarousel`). */
120
+ readonly grouped?: boolean;
117
121
  }>;
118
122
 
119
123
  declare function InfoCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
@@ -189,8 +193,17 @@ interface ChatHandlers {
189
193
  interface ImagePolicy {
190
194
  /** Hosts a photo may come from (exact names); default any https host. */
191
195
  readonly hosts?: readonly string[];
192
- /** Width / height of a listing's photo frame. Default 1.6 (16:10). */
193
- readonly aspectRatio?: number;
196
+ /**
197
+ * Width / height of a listing's photo frame. Default 1.6 (16:10). `natural`: a card on its own takes its photo's
198
+ * own shape (its `width` and `height`), held within `naturalAspect`; a card in a carousel keeps 1.6, so the row
199
+ * stays even, and a photo without its size too.
200
+ */
201
+ readonly aspectRatio?: number | 'natural';
202
+ /** The shapes a `natural` photo is held within. Default square to 2:1 (`{ min: 1, max: 2 }`). */
203
+ readonly naturalAspect?: {
204
+ readonly min: number;
205
+ readonly max: number;
206
+ };
194
207
  /**
195
208
  * What stands in for a missing, refused or failed photo, by the card's `kind` (a person's tile, a space's tile).
196
209
  * Default the name's monogram.
@@ -421,9 +434,10 @@ declare const StreamingBubble: react.NamedExoticComponent<{
421
434
  /** Rows of one kind recycle together. */
422
435
  declare function itemType(item: TimelineItem): string;
423
436
  /**
424
- * Runs of two or more consecutive cards with one carousel group (`group.layout: carousel`, the same `group.id`): by
425
- * 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
426
- * same array, so its row does not render again.
437
+ * Carousel groups of two or more cards (`group.layout: carousel`, the same `group.id` in the same turn), wherever in
438
+ * the turn they arrive, another card or a message between them included: drawn as one row where the group's first
439
+ * card is, by that card's key, with the keys of the cards the row draws after it. A row equal to the previous one is
440
+ * the same array, so it does not render again.
427
441
  */
428
442
  declare function carousels(items: readonly TimelineItem[], previous: ReadonlyMap<string, readonly CardItem[]>): {
429
443
  runs: Map<string, readonly CardItem[]>;
package/dist/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- export { ActivityLine, AgentChat, AgentFooter, AgentRuntimeProvider, Avatar, Button, CardActions, CardCarousel, CardFrame, CardView, ChatHeader, ChatSkeleton, Composer, DefaultBubble, DefaultComposer, DefaultEnded, DefaultHeader, DefaultTurnFailed, DefaultUnavailable, DefaultUnavailableScreen, DefaultUnreachable, DisclosureBar, FailureActionButton, InfoCard, LinksCard, ListingCard, MessageBubble, MessageList, NextStepCard, ProposalCard, QuestionCard, Row, StatusBanner, StreamingBubble, SystemRow, TimeSlotsCard, VinaverseChat, VinaverseChatProvider, Welcome, allowedImage, answerText, carousels, defaultCard, fieldText, forgetGreeting, greetedKey, itemType, monogram, newestWholeReply, ratingText, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus, useChat } from './chunk-NXGLI4Y7.js';
1
+ export { ActivityLine, AgentChat, AgentFooter, AgentRuntimeProvider, Avatar, Button, CardActions, CardCarousel, CardFrame, CardView, ChatHeader, ChatSkeleton, Composer, DefaultBubble, DefaultComposer, DefaultEnded, DefaultHeader, DefaultTurnFailed, DefaultUnavailable, DefaultUnavailableScreen, DefaultUnreachable, DisclosureBar, FailureActionButton, InfoCard, LinksCard, ListingCard, MessageBubble, MessageList, NextStepCard, ProposalCard, QuestionCard, Row, StatusBanner, StreamingBubble, SystemRow, TimeSlotsCard, VinaverseChat, VinaverseChatProvider, Welcome, allowedImage, answerText, carousels, defaultCard, fieldText, forgetGreeting, greetedKey, itemType, monogram, newestWholeReply, ratingText, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus, useAgentStatusState, useChat } from './chunk-GIQYOTNH.js';
2
2
  export { ThemeProvider, announce, createTheme, themeProblems, useNativeLifecycle, useReducedMotion, useTheme } from './chunk-EFEXTVIT.js';
3
3
  //# sourceMappingURL=chat.js.map
4
4
  //# sourceMappingURL=chat.js.map