@progress/kendo-react-conversational-ui 12.0.1 → 12.0.2-develop.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
- package/index.d.mts +182 -172
- package/index.d.ts +182 -172
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -11
package/index.d.mts
CHANGED
|
@@ -21,34 +21,32 @@ import { UploadProps } from '@progress/kendo-react-upload';
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Defines a quick action for a message.
|
|
24
|
-
* The value is interpreted
|
|
24
|
+
* The `value` is interpreted by the action `type`.
|
|
25
25
|
*/
|
|
26
26
|
export declare interface Action {
|
|
27
27
|
/**
|
|
28
|
-
* A predefined or custom
|
|
28
|
+
* A predefined or custom `string` type for the action.
|
|
29
29
|
*/
|
|
30
30
|
type: ActionType;
|
|
31
31
|
/**
|
|
32
|
-
* The value
|
|
32
|
+
* The value associated with the action.
|
|
33
33
|
*/
|
|
34
34
|
value: any;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
* If
|
|
36
|
+
* Optional title for the quick action.
|
|
37
|
+
* If not set, the Chat displays `value`.
|
|
38
38
|
*/
|
|
39
39
|
title?: string;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
* ([see examples]({% slug quick_actions_suggested_actions_chat %})).
|
|
43
|
+
* Specifies the button type of a quick action ([see examples]({% slug quick_actions_suggested_actions_chat %})).
|
|
45
44
|
*
|
|
46
45
|
* * `openUrl`—Opens a new browser window with the specified URL.
|
|
47
46
|
* * `reply`—Sends the action value as a reply in the Chat.
|
|
48
47
|
* * `call`—Treats a value as a phone number.
|
|
49
|
-
*
|
|
50
|
-
* * other—
|
|
51
|
-
* Handled by user code in the [`ExecuteActionEvent`]({% slug api_conversational-ui_chatactionexecuteevent %}).
|
|
48
|
+
* Similar to clicking a [telephone link](https://css-tricks.com/the-current-state-of-telephone-links/).
|
|
49
|
+
* * other—Handled in your code in the [`ExecuteActionEvent`]({% slug api_conversational-ui_chatactionexecuteevent %}).
|
|
52
50
|
*/
|
|
53
51
|
export declare type ActionType = 'openUrl' | 'reply' | 'call' | any;
|
|
54
52
|
|
|
@@ -154,7 +152,7 @@ declare interface AIPromptHeaderProps {
|
|
|
154
152
|
|
|
155
153
|
export declare interface AIPromptOutputInterface {
|
|
156
154
|
/**
|
|
157
|
-
*
|
|
155
|
+
* EUnique identifier of the output item.
|
|
158
156
|
* ```jsx
|
|
159
157
|
* const output = { id: 1, responseContent: 'Generated content' };
|
|
160
158
|
* ```
|
|
@@ -168,42 +166,42 @@ export declare interface AIPromptOutputInterface {
|
|
|
168
166
|
*/
|
|
169
167
|
title?: default_2.ReactNode;
|
|
170
168
|
/**
|
|
171
|
-
*
|
|
169
|
+
* Optional `subTitle` content.
|
|
172
170
|
* ```jsx
|
|
173
171
|
* const output = { subTitle: 'Generated Subtitle', responseContent: 'Generated content' };
|
|
174
172
|
* ```
|
|
175
173
|
*/
|
|
176
174
|
subTitle?: default_2.ReactNode;
|
|
177
175
|
/**
|
|
178
|
-
*
|
|
176
|
+
* Prompt that produced this output.
|
|
179
177
|
* ```jsx
|
|
180
178
|
* const output = { prompt: 'User prompt', responseContent: 'Generated content' };
|
|
181
179
|
* ```
|
|
182
180
|
*/
|
|
183
181
|
prompt?: string;
|
|
184
182
|
/**
|
|
185
|
-
*
|
|
183
|
+
* Generated response content.
|
|
186
184
|
* ```jsx
|
|
187
185
|
* const output = { responseContent: 'Generated content' };
|
|
188
186
|
* ```
|
|
189
187
|
*/
|
|
190
188
|
responseContent: string;
|
|
191
189
|
/**
|
|
192
|
-
*
|
|
190
|
+
* Indicates if this output is a retry.
|
|
193
191
|
* ```jsx
|
|
194
192
|
* const output = { isRetry: true, responseContent: 'Generated content' };
|
|
195
193
|
* ```
|
|
196
194
|
*/
|
|
197
195
|
isRetry?: boolean;
|
|
198
196
|
/**
|
|
199
|
-
*
|
|
197
|
+
* Rating type applied to the output.
|
|
200
198
|
* ```jsx
|
|
201
199
|
* const output = { ratingType: 'positive', responseContent: 'Generated content' };
|
|
202
200
|
* ```
|
|
203
201
|
*/
|
|
204
202
|
ratingType?: string;
|
|
205
203
|
/**
|
|
206
|
-
*
|
|
204
|
+
* Command that triggered the prompt generation.
|
|
207
205
|
* ```jsx
|
|
208
206
|
* const output = { command: { name: 'Retry' }, responseContent: 'Generated content' };
|
|
209
207
|
* ```
|
|
@@ -250,39 +248,40 @@ declare interface AIPromptOutputViewProps {
|
|
|
250
248
|
}
|
|
251
249
|
|
|
252
250
|
/**
|
|
253
|
-
*
|
|
251
|
+
* Props of the AIPrompt component.
|
|
254
252
|
*/
|
|
255
253
|
export declare interface AIPromptProps extends default_2.HTMLAttributes<HTMLElement> {
|
|
256
254
|
/**
|
|
257
|
-
*
|
|
255
|
+
* Inline styles for the root element.
|
|
258
256
|
* ```jsx
|
|
259
257
|
* <AIPrompt style={{ backgroundColor: 'lightblue' }} />
|
|
260
258
|
* ```
|
|
261
259
|
*/
|
|
262
260
|
style?: default_2.CSSProperties;
|
|
263
261
|
/**
|
|
264
|
-
*
|
|
262
|
+
* Sets the name of the `activeView` property:
|
|
265
263
|
* ```jsx
|
|
266
264
|
* <AIPrompt activeView="promptView" />
|
|
267
265
|
* ```
|
|
268
266
|
*/
|
|
269
267
|
activeView: typeof promptViewDefaults.name | typeof outputViewDefaults.name | typeof commandsViewDefaults.name | string;
|
|
270
268
|
/**
|
|
271
|
-
*
|
|
269
|
+
* Items rendered in the toolbar.
|
|
270
|
+
* The items rendered in the toolbar. the `toolbarItems` property:
|
|
272
271
|
* ```jsx
|
|
273
272
|
* <AIPrompt toolbarItems={[<CustomToolbarItem />]} />
|
|
274
273
|
* ```
|
|
275
274
|
*/
|
|
276
275
|
toolbarItems?: (AIPromptToolbarItemInterface | default_2.ReactNode)[];
|
|
277
276
|
/**
|
|
278
|
-
*
|
|
277
|
+
* Output items generated from prompts.
|
|
279
278
|
* ```jsx
|
|
280
279
|
* <AIPrompt outputs={[{ id: 1, responseContent: 'Generated content' }]} />
|
|
281
280
|
* ```
|
|
282
281
|
*/
|
|
283
282
|
outputs?: AIPromptOutputInterface[];
|
|
284
283
|
/**
|
|
285
|
-
*
|
|
284
|
+
* Custom content rendered inside the component.
|
|
286
285
|
* ```jsx
|
|
287
286
|
* <AIPrompt>
|
|
288
287
|
* <div>Custom content</div>
|
|
@@ -291,56 +290,56 @@ export declare interface AIPromptProps extends default_2.HTMLAttributes<HTMLElem
|
|
|
291
290
|
*/
|
|
292
291
|
children?: default_2.ReactNode;
|
|
293
292
|
/**
|
|
294
|
-
*
|
|
293
|
+
* Placeholder text for the prompt input.
|
|
295
294
|
* ```jsx
|
|
296
295
|
* <AIPrompt promptPlaceholder="Type your prompt here..." />
|
|
297
296
|
* ```
|
|
298
297
|
*/
|
|
299
298
|
promptPlaceholder?: string;
|
|
300
299
|
/**
|
|
301
|
-
*
|
|
300
|
+
* Text direction of the component.
|
|
302
301
|
* ```jsx
|
|
303
302
|
* <AIPrompt dir="rtl" />
|
|
304
303
|
* ```
|
|
305
304
|
*/
|
|
306
305
|
dir?: string;
|
|
307
306
|
/**
|
|
308
|
-
*
|
|
307
|
+
* Fires when the active view changes. Provides the new view name.
|
|
309
308
|
* ```jsx
|
|
310
309
|
* <AIPrompt onActiveViewChange={(name) => console.log('Active view changed to:', name)} />
|
|
311
310
|
* ```
|
|
312
311
|
*/
|
|
313
312
|
onActiveViewChange?: (name: string) => void;
|
|
314
313
|
/**
|
|
315
|
-
*
|
|
314
|
+
* Fires when a command is executed.
|
|
316
315
|
* ```jsx
|
|
317
316
|
* <AIPrompt onCommandExecute={(command) => console.log('Command executed:', command)} />
|
|
318
317
|
* ```
|
|
319
318
|
*/
|
|
320
319
|
onCommandExecute?: (command: CommandInterface) => void;
|
|
321
320
|
/**
|
|
322
|
-
*
|
|
321
|
+
* Fires when a prompt is requested. Provides the prompt and optional target output.
|
|
323
322
|
* ```jsx
|
|
324
323
|
* <AIPrompt onPromptRequest={(prompt) => console.log('Prompt requested:', prompt)} />
|
|
325
324
|
* ```
|
|
326
325
|
*/
|
|
327
326
|
onPromptRequest?: (prompt?: string, outputItem?: AIPromptOutputInterface) => void;
|
|
328
327
|
/**
|
|
329
|
-
*
|
|
328
|
+
* Fires when the prompt is canceled.
|
|
330
329
|
* ```jsx
|
|
331
330
|
* <AIPrompt onCancel={() => console.log('Prompt cancelled')} />
|
|
332
331
|
* ```
|
|
333
332
|
*/
|
|
334
333
|
onCancel?: () => void;
|
|
335
334
|
/**
|
|
336
|
-
*
|
|
335
|
+
* Indicates streaming state of the prompt.
|
|
337
336
|
* ```jsx
|
|
338
337
|
* <AIPrompt streaming={true} />
|
|
339
338
|
* ```
|
|
340
339
|
*/
|
|
341
340
|
streaming?: boolean;
|
|
342
341
|
/**
|
|
343
|
-
*
|
|
342
|
+
* Indicates loading state of the prompt.
|
|
344
343
|
* ```jsx
|
|
345
344
|
* <AIPrompt loading={true} />
|
|
346
345
|
* ```
|
|
@@ -424,32 +423,30 @@ declare interface AIPromptViewRenderProps {
|
|
|
424
423
|
}
|
|
425
424
|
|
|
426
425
|
/**
|
|
427
|
-
* Represents a message attachment
|
|
428
|
-
* ([see examples]({% slug attachments_chat %})).
|
|
429
|
-
*
|
|
426
|
+
* Represents a message attachment ([see examples]({% slug attachments_chat %})).
|
|
430
427
|
*/
|
|
431
428
|
export declare interface Attachment {
|
|
432
429
|
/**
|
|
433
|
-
*
|
|
434
|
-
* Typically a MIME type. Can
|
|
430
|
+
* Content type identifier for the attachment.
|
|
431
|
+
* Typically a MIME type. Can be any string.
|
|
435
432
|
*/
|
|
436
433
|
contentType: string;
|
|
437
434
|
/**
|
|
438
|
-
*
|
|
435
|
+
* Content of the attachment.
|
|
439
436
|
*/
|
|
440
437
|
content: any;
|
|
441
438
|
/**
|
|
442
|
-
*
|
|
439
|
+
* Optional title of the attachment.
|
|
443
440
|
*/
|
|
444
441
|
title?: string;
|
|
445
442
|
/**
|
|
446
|
-
*
|
|
443
|
+
* Optional subtitle of the attachment.
|
|
447
444
|
*/
|
|
448
445
|
subtitle?: string;
|
|
449
446
|
}
|
|
450
447
|
|
|
451
448
|
/**
|
|
452
|
-
* Specifies the layout for
|
|
449
|
+
* Specifies the layout for message attachments.
|
|
453
450
|
*
|
|
454
451
|
* The supported values are:
|
|
455
452
|
* * `"list"`—A vertical list.
|
|
@@ -463,7 +460,7 @@ export declare type AttachmentLayout = 'list' | 'carousel';
|
|
|
463
460
|
export declare const Chat: React_2.ForwardRefExoticComponent<ChatProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
464
461
|
|
|
465
462
|
/**
|
|
466
|
-
*
|
|
463
|
+
* Arguments for the `actionexecute` event of the Chat.
|
|
467
464
|
*/
|
|
468
465
|
export declare interface ChatActionExecuteEvent extends Omit<BaseEvent<React_2.Component>, 'target'> {
|
|
469
466
|
/**
|
|
@@ -485,19 +482,19 @@ export declare interface ChatFile {
|
|
|
485
482
|
*/
|
|
486
483
|
id: string;
|
|
487
484
|
/**
|
|
488
|
-
*
|
|
485
|
+
* Name of the file.
|
|
489
486
|
*/
|
|
490
487
|
name: string;
|
|
491
488
|
/**
|
|
492
|
-
*
|
|
489
|
+
* Size of the file in bytes.
|
|
493
490
|
*/
|
|
494
491
|
size: number;
|
|
495
492
|
/**
|
|
496
|
-
* MIME type of the file (
|
|
493
|
+
* MIME type of the file (for example, `application/pdf`).
|
|
497
494
|
*/
|
|
498
495
|
type: string;
|
|
499
496
|
/**
|
|
500
|
-
* Optional URL to download
|
|
497
|
+
* Optional URL to download or view the file.
|
|
501
498
|
*/
|
|
502
499
|
url?: string;
|
|
503
500
|
/**
|
|
@@ -516,17 +513,17 @@ export declare const ChatMessage: React_2.FC<ChatMessageProps>;
|
|
|
516
513
|
*/
|
|
517
514
|
export declare interface ChatMessageBoxProps {
|
|
518
515
|
/**
|
|
519
|
-
*
|
|
516
|
+
* Input message element of the Chat.
|
|
520
517
|
*/
|
|
521
518
|
messageInput: React.ReactElement;
|
|
522
519
|
/**
|
|
523
|
-
*
|
|
520
|
+
* Send button element of the Chat.
|
|
524
521
|
*/
|
|
525
522
|
sendButton: React.ReactElement;
|
|
526
523
|
}
|
|
527
524
|
|
|
528
525
|
/**
|
|
529
|
-
* Represents the properties of
|
|
526
|
+
* Represents the properties of `ChatMessage` component.
|
|
530
527
|
*/
|
|
531
528
|
export declare interface ChatMessageProps {
|
|
532
529
|
/**
|
|
@@ -554,15 +551,17 @@ export declare interface ChatMessageProps {
|
|
|
554
551
|
*/
|
|
555
552
|
selected: boolean;
|
|
556
553
|
/**
|
|
557
|
-
*
|
|
554
|
+
* Determines whether messages can be collapsed/expanded when multiple consecutive messages are from the same author.
|
|
558
555
|
*/
|
|
559
556
|
allowMessageCollapse?: boolean;
|
|
560
557
|
/**
|
|
558
|
+
* @hidden
|
|
561
559
|
* Defines the actions that will be displayed in the message toolbar.
|
|
562
560
|
* This can include buttons for actions like reply, edit, delete, etc.
|
|
563
561
|
*/
|
|
564
562
|
messageToolbarActions?: MessageAction[];
|
|
565
563
|
/**
|
|
564
|
+
* @hidden
|
|
566
565
|
* Defines the actions that will be displayed in the message context menu.
|
|
567
566
|
* This can include buttons for actions like reply, edit, delete, etc.
|
|
568
567
|
*/
|
|
@@ -579,64 +578,66 @@ export declare interface ChatMessageProps {
|
|
|
579
578
|
* For more information, refer to the [Message Template]({% slug customization_message_templates_chat %}) article.
|
|
580
579
|
*/
|
|
581
580
|
export declare interface ChatMessageTemplateProps {
|
|
581
|
+
/**
|
|
582
|
+
* The message data object containing all information about the message to be rendered.
|
|
583
|
+
*/
|
|
582
584
|
item: MessageModel;
|
|
583
585
|
}
|
|
584
586
|
|
|
585
587
|
export declare interface ChatProps extends FieldMappingConfig {
|
|
586
588
|
/**
|
|
587
|
-
*
|
|
589
|
+
* CSS class of the Chat DOM element.
|
|
588
590
|
*/
|
|
589
591
|
className?: string;
|
|
590
592
|
/**
|
|
591
|
-
*
|
|
593
|
+
* ID of the Chat component.
|
|
592
594
|
*/
|
|
593
595
|
id?: string;
|
|
594
596
|
/**
|
|
595
|
-
*
|
|
596
|
-
* that
|
|
597
|
+
* Messages of the Chat. Can be an array of `Message` objects or raw data objects
|
|
598
|
+
* that map using the field mapping configuration.
|
|
597
599
|
*/
|
|
598
600
|
messages: Message[] | any[];
|
|
599
601
|
/**
|
|
600
|
-
*
|
|
602
|
+
* ID of the local user. Identifies messages authored by the local user.
|
|
601
603
|
*/
|
|
602
604
|
authorId: number | string;
|
|
603
605
|
/**
|
|
604
|
-
*
|
|
606
|
+
* React functional or class component used as a message template. The corresponding [`message`]({% slug api_conversational-ui_message %}) is passed as an `item` property.
|
|
605
607
|
*/
|
|
606
608
|
messageTemplate?: React.ComponentType<ChatMessageTemplateProps>;
|
|
607
609
|
/**
|
|
608
|
-
*
|
|
610
|
+
* React functional or class component used as an attachment template ([see example]({% slug attachments_chat %}#toc-attachment-templates)). The corresponding [`attachment`]({% slug api_conversational-ui_attachment %}) is passed as an `item` property.
|
|
609
611
|
*/
|
|
610
612
|
attachmentTemplate?: any;
|
|
611
613
|
/**
|
|
612
|
-
*
|
|
614
|
+
* Width of the Chat.
|
|
613
615
|
*/
|
|
614
616
|
width?: string | number;
|
|
615
617
|
/**
|
|
616
|
-
*
|
|
618
|
+
* Height of the Chat.
|
|
617
619
|
*/
|
|
618
620
|
height?: string | number;
|
|
619
621
|
/**
|
|
620
|
-
* Fires when the user types a message and clicks
|
|
622
|
+
* Fires when the user types a message and clicks **Send** or presses **Enter**. Emits [`SendMessageEvent`]({% slug api_conversational-ui_ChatSendMessageEvent %}).
|
|
621
623
|
*
|
|
622
|
-
* > The Chat
|
|
624
|
+
* > The Chat does not automatically update with the new message.
|
|
623
625
|
*/
|
|
624
626
|
onSendMessage?: (event: ChatSendMessageEvent) => void;
|
|
625
627
|
/**
|
|
626
|
-
* Fires when the user clicks a quick action button. The Chat internally handles the `reply`, `openUrl`, and `call` [known actions]({% slug api_conversational-ui_actiontype %}). Emits
|
|
628
|
+
* Fires when the user clicks a quick action button. The Chat internally handles the `reply`, `openUrl`, and `call` [known actions]({% slug api_conversational-ui_actiontype %}). Emits [`ExecuteActionEvent`]({% slug api_conversational-ui_chatactionexecuteevent %}). The event is preventable. If you call `preventDefault`, the built-in action is suppressed.
|
|
627
629
|
*/
|
|
628
630
|
onActionExecute?: (event: ChatActionExecuteEvent) => void;
|
|
629
631
|
/**
|
|
630
|
-
*
|
|
632
|
+
* Direction of the Chat component.
|
|
631
633
|
*/
|
|
632
634
|
dir?: string;
|
|
633
635
|
/**
|
|
634
|
-
*
|
|
636
|
+
* Text displayed inside the new message input when empty.
|
|
635
637
|
*/
|
|
636
638
|
placeholder?: string;
|
|
637
639
|
/**
|
|
638
|
-
* Enables
|
|
639
|
-
* ([see example]({% slug customization_messagebox_templates_chat %})).
|
|
640
|
+
* Enables customization or override of the default message box item ([see example]({% slug customization_messagebox_templates_chat %})).
|
|
640
641
|
*/
|
|
641
642
|
messageBox?: React.ComponentType<ChatMessageBoxProps>;
|
|
642
643
|
/**
|
|
@@ -644,55 +645,57 @@ export declare interface ChatProps extends FieldMappingConfig {
|
|
|
644
645
|
*/
|
|
645
646
|
message?: React.ComponentType<ChatMessageProps>;
|
|
646
647
|
/**
|
|
647
|
-
*
|
|
648
|
+
* List of message suggestions displayed above the message input.
|
|
648
649
|
*/
|
|
649
650
|
suggestions?: ChatSuggestion[];
|
|
650
651
|
/**
|
|
651
|
-
*
|
|
652
|
+
* Template for suggestion items displayed above the message input.
|
|
652
653
|
*/
|
|
653
654
|
suggestionTemplate?: React.ComponentType<SuggestionTemplateProps>;
|
|
654
655
|
/**
|
|
655
|
-
* Fires when a suggestion is clicked.
|
|
656
|
+
* Fires when a suggestion is clicked. Provides the clicked suggestion.
|
|
656
657
|
*/
|
|
657
658
|
onSuggestionClick?: (suggestion: ChatSuggestion) => void;
|
|
658
659
|
/**
|
|
659
|
-
*
|
|
660
|
+
* Template for the header of the Chat component.
|
|
660
661
|
*/
|
|
661
662
|
headerTemplate?: React.ReactElement | (() => React.ReactElement);
|
|
662
663
|
/**
|
|
663
|
-
*
|
|
664
|
+
* Template for the timestamp of the message.
|
|
664
665
|
*/
|
|
665
666
|
timestampTemplate?: React.ComponentType<{
|
|
666
667
|
item: DateMarker;
|
|
667
668
|
}>;
|
|
668
669
|
/**
|
|
669
|
-
*
|
|
670
|
+
* Template for status items below each message.
|
|
670
671
|
*/
|
|
671
672
|
statusTemplate?: React.ComponentType<StatusTemplateProps>;
|
|
672
673
|
/**
|
|
673
|
-
* Enables
|
|
674
|
-
* This allows users to collapse or expand messages to save space in the chat window.
|
|
674
|
+
* Enables expand or collapse for messages to save space.
|
|
675
675
|
*/
|
|
676
676
|
allowMessageCollapse?: boolean;
|
|
677
677
|
/**
|
|
678
|
-
*
|
|
679
|
-
* This can include buttons for actions like reply, edit, delete, etc.
|
|
678
|
+
* Actions displayed in the message toolbar.
|
|
680
679
|
*/
|
|
681
680
|
messageToolbarActions?: MessageAction[];
|
|
682
681
|
/**
|
|
683
|
-
*
|
|
682
|
+
* Actions displayed in the message context menu.
|
|
684
683
|
*/
|
|
685
684
|
messageContextMenuActions?: MessageAction[];
|
|
685
|
+
/**
|
|
686
|
+
* Actions displayed for files in the message.
|
|
687
|
+
*/
|
|
686
688
|
fileActions?: MessageAction[];
|
|
687
689
|
/**
|
|
688
|
-
* Fires when a message
|
|
689
|
-
* The event contains the message that was unpinned.
|
|
690
|
+
* Fires when a message is unpinned. Provides the message.
|
|
690
691
|
*/
|
|
691
692
|
onUnpin?: (message: Message) => void;
|
|
692
693
|
/**
|
|
693
|
-
* Sets the message width mode.
|
|
694
|
-
* - `full`—
|
|
695
|
-
* - `standard`—
|
|
694
|
+
* Sets the message width mode.
|
|
695
|
+
* - `full`—Message occupies the full width of the Chat.
|
|
696
|
+
* - `standard`—Message occupies a standard width for a compact display.
|
|
697
|
+
*
|
|
698
|
+
* @default 'standard'
|
|
696
699
|
*/
|
|
697
700
|
messageWidthMode?: 'full' | 'standard';
|
|
698
701
|
/**
|
|
@@ -710,38 +713,33 @@ export declare interface ChatProps extends FieldMappingConfig {
|
|
|
710
713
|
*/
|
|
711
714
|
sendButtonConfig?: ButtonProps;
|
|
712
715
|
/**
|
|
713
|
-
* Fires when a toolbar action is executed on a message.
|
|
714
|
-
* The event contains the action that was executed and the target message.
|
|
716
|
+
* Fires when a toolbar action is executed on a message. Provides the action and target message.
|
|
715
717
|
*/
|
|
716
718
|
onToolbarAction?: (action: MessageAction, event: React.SyntheticEvent<any>, target: Message) => void;
|
|
717
719
|
/**
|
|
718
|
-
* Fires when a context menu action is executed on a message.
|
|
719
|
-
* The event contains the action that was executed and the target message.
|
|
720
|
+
* Fires when a context menu action is executed on a message. Provides the action and target message.
|
|
720
721
|
*/
|
|
721
722
|
onContextMenuAction?: (action: MessageAction, event: React.SyntheticEvent<any>, target: Message) => void;
|
|
722
723
|
/**
|
|
723
|
-
* Fires when a file action is executed on a message.
|
|
724
|
-
* The event contains the action that was executed and the target file.
|
|
724
|
+
* Fires when a file action is executed on a message. Provides the action and target file.
|
|
725
725
|
*/
|
|
726
726
|
onFileAction?: (action: FileAction, event: React.SyntheticEvent<any>, target: ChatFile) => void;
|
|
727
727
|
/**
|
|
728
|
-
* Fires when a download action is executed on a message.
|
|
729
|
-
* The event contains the action that was executed and the target file.
|
|
728
|
+
* Fires when a download action is executed on a message. Provides the selected files and parent message.
|
|
730
729
|
*/
|
|
731
730
|
onDownload?: (files: ChatFile[], message: Message) => void;
|
|
732
731
|
/**
|
|
733
|
-
* Fires when the input value changes.
|
|
734
|
-
* The event contains the new input value.
|
|
732
|
+
* Fires when the input value changes. Provides the new input value.
|
|
735
733
|
*/
|
|
736
734
|
onInputValueChange?: (value: string) => void;
|
|
737
735
|
/**
|
|
738
|
-
*
|
|
736
|
+
* Input value of the Chat component.
|
|
739
737
|
*/
|
|
740
738
|
inputValue?: string;
|
|
741
739
|
}
|
|
742
740
|
|
|
743
741
|
/**
|
|
744
|
-
*
|
|
742
|
+
* Arguments for the `messagesend` event of the Chat.
|
|
745
743
|
*/
|
|
746
744
|
export declare interface ChatSendMessageEvent extends BaseEvent<React_2.Component> {
|
|
747
745
|
/**
|
|
@@ -763,15 +761,30 @@ export declare interface ChatState {
|
|
|
763
761
|
* @interface ChatSuggestion
|
|
764
762
|
*/
|
|
765
763
|
export declare interface ChatSuggestion {
|
|
764
|
+
/**
|
|
765
|
+
* The unique identifier for the suggestion.
|
|
766
|
+
*/
|
|
766
767
|
id: string | number;
|
|
768
|
+
/**
|
|
769
|
+
* The text content of the suggestion that will be displayed to the user.
|
|
770
|
+
*/
|
|
767
771
|
text: string;
|
|
772
|
+
/**
|
|
773
|
+
* An optional description that provides additional context for the suggestion.
|
|
774
|
+
*/
|
|
768
775
|
description?: string;
|
|
776
|
+
/**
|
|
777
|
+
* Determines whether the suggestion is disabled and cannot be clicked.
|
|
778
|
+
*/
|
|
769
779
|
disabled?: boolean;
|
|
780
|
+
/**
|
|
781
|
+
* The visual style for displaying the suggestion. Can be 'classic' for rectangular styling or 'modern' for chip-like styling.
|
|
782
|
+
*/
|
|
770
783
|
suggestionsView?: SuggestionsView;
|
|
771
784
|
}
|
|
772
785
|
|
|
773
786
|
/**
|
|
774
|
-
*
|
|
787
|
+
* Arguments for the `toolbaractionexecute` event of the Chat.
|
|
775
788
|
*/
|
|
776
789
|
export declare interface ChatToolbarActionExecuteEvent extends BaseEvent<React_2.Component> {
|
|
777
790
|
/**
|
|
@@ -844,9 +857,9 @@ export declare const DEFAULT_FIELD_MAPPING: Required<FieldMappingConfig>;
|
|
|
844
857
|
export declare const extractFieldMappingFromProps: (props: any) => FieldMappingConfig;
|
|
845
858
|
|
|
846
859
|
/**
|
|
847
|
-
* Configuration
|
|
848
|
-
*
|
|
849
|
-
*
|
|
860
|
+
* Configuration for mapping custom data fields to Chat properties.
|
|
861
|
+
* Lets the Chat work with various data source formats by mapping
|
|
862
|
+
* your field names to expected Chat interface properties.
|
|
850
863
|
*/
|
|
851
864
|
export declare interface FieldMappingConfig {
|
|
852
865
|
/**
|
|
@@ -868,19 +881,19 @@ export declare interface FieldMappingConfig {
|
|
|
868
881
|
*/
|
|
869
882
|
authorIdField?: string;
|
|
870
883
|
/**
|
|
871
|
-
* Field name for message author name (when flattened
|
|
884
|
+
* Field name for message author name (when flattened).
|
|
872
885
|
*
|
|
873
886
|
* @default 'authorName'
|
|
874
887
|
*/
|
|
875
888
|
authorNameField?: string;
|
|
876
889
|
/**
|
|
877
|
-
* Field name for message author avatar URL (when flattened
|
|
890
|
+
* Field name for message author avatar URL (when flattened).
|
|
878
891
|
*
|
|
879
892
|
* @default 'authorImageUrl'
|
|
880
893
|
*/
|
|
881
894
|
authorImageUrlField?: string;
|
|
882
895
|
/**
|
|
883
|
-
* Field name for alt text of the author's avatar (when flattened
|
|
896
|
+
* Field name for alt text of the author's avatar (when flattened).
|
|
884
897
|
*
|
|
885
898
|
* @default 'authorImageAltText'
|
|
886
899
|
*/
|
|
@@ -928,13 +941,13 @@ export declare interface FieldMappingConfig {
|
|
|
928
941
|
*/
|
|
929
942
|
isPinnedField?: string;
|
|
930
943
|
/**
|
|
931
|
-
* Field name for the typing
|
|
944
|
+
* Field name for the `typing` property of a message.
|
|
932
945
|
*
|
|
933
946
|
* @default 'typing'
|
|
934
947
|
*/
|
|
935
948
|
typingField?: string;
|
|
936
949
|
/**
|
|
937
|
-
* Field name for the suggestedActions
|
|
950
|
+
* Field name for the `suggestedActions` property of a message.
|
|
938
951
|
*
|
|
939
952
|
* @default 'suggestedActions'
|
|
940
953
|
*/
|
|
@@ -953,7 +966,7 @@ export declare interface FileAction extends MessageAction {
|
|
|
953
966
|
export declare const HeroCard: React_2.FC<HeroCardProps>;
|
|
954
967
|
|
|
955
968
|
/**
|
|
956
|
-
*
|
|
969
|
+
* Arguments for the `actionexecute` event of the hero card.
|
|
957
970
|
*/
|
|
958
971
|
export declare interface HeroCardActionExecuteEvent extends BaseEvent<React_2.Component> {
|
|
959
972
|
/**
|
|
@@ -1069,80 +1082,77 @@ declare interface InlineAIPromptPopupProps {
|
|
|
1069
1082
|
|
|
1070
1083
|
export declare interface InlineAIPromptProps extends Omit<default_2.HTMLAttributes<HTMLElement>, 'onCopy'>, InlineAIPromptPopupProps {
|
|
1071
1084
|
/**
|
|
1072
|
-
*
|
|
1085
|
+
* Inline styles for the root element.
|
|
1073
1086
|
* ```jsx
|
|
1074
1087
|
* <InlineAIPrompt style={{ backgroundColor: 'lightblue' }} />
|
|
1075
1088
|
* ```
|
|
1076
1089
|
*/
|
|
1077
1090
|
style?: default_2.CSSProperties;
|
|
1078
1091
|
/**
|
|
1079
|
-
*
|
|
1092
|
+
* Collection of outputs to display as cards.
|
|
1080
1093
|
*/
|
|
1081
1094
|
outputs?: InlineAIPromptOutputInterface[];
|
|
1082
1095
|
/**
|
|
1083
|
-
*
|
|
1084
|
-
* header, body, actions
|
|
1085
|
-
* The custom fields will override the default one.
|
|
1096
|
+
* Template that lets you define custom Card fields for header, body, and actions. Overrides defaults.
|
|
1086
1097
|
*/
|
|
1087
1098
|
outputCard?: AIPromptCardInterface_2;
|
|
1088
1099
|
/**
|
|
1089
|
-
* Placeholder text for the prompt input
|
|
1100
|
+
* Placeholder text for the prompt input.
|
|
1090
1101
|
*/
|
|
1091
1102
|
promptPlaceholder?: string;
|
|
1092
1103
|
/**
|
|
1093
|
-
*
|
|
1104
|
+
* Initial value of the prompt input.
|
|
1094
1105
|
*/
|
|
1095
1106
|
promptValue?: string;
|
|
1096
1107
|
/**
|
|
1097
|
-
*
|
|
1108
|
+
* Fires when the user submits a prompt.
|
|
1098
1109
|
*/
|
|
1099
1110
|
onPromptRequest?: (prompt: string, outputItem?: InlineAIPromptOutputInterface) => void;
|
|
1100
1111
|
/**
|
|
1101
|
-
*
|
|
1112
|
+
* Fires when the cancel action occurs.
|
|
1102
1113
|
*/
|
|
1103
1114
|
onPromptCancel?: () => void;
|
|
1104
1115
|
/**
|
|
1105
|
-
* Fires
|
|
1116
|
+
* Fires when the user clicks the Copy button.
|
|
1106
1117
|
*/
|
|
1107
1118
|
onCopy?: (output: InlineAIPromptOutputInterface) => void;
|
|
1108
1119
|
/**
|
|
1109
|
-
* Fires
|
|
1120
|
+
* Fires when the user clicks the Discard button.
|
|
1110
1121
|
*/
|
|
1111
1122
|
onDiscard?: (output: InlineAIPromptOutputInterface) => void;
|
|
1112
1123
|
/**
|
|
1113
|
-
*
|
|
1114
|
-
* If not
|
|
1115
|
-
* You can override built-in actions.
|
|
1124
|
+
* Collection of output actions rendered in the card actions.
|
|
1125
|
+
* If not set, default actions (`copy`, `discard`) are used. You can override built-ins.
|
|
1116
1126
|
*/
|
|
1117
1127
|
outputActions?: OutputActionInterface[];
|
|
1118
1128
|
/**
|
|
1119
|
-
* Fires when an action command
|
|
1120
|
-
* Built-in
|
|
1121
|
-
* All other actions
|
|
1129
|
+
* Fires when an action command executes.
|
|
1130
|
+
* Built-in `copy` and `discard` actions are handled internally.
|
|
1131
|
+
* All other actions call this handler.
|
|
1122
1132
|
*/
|
|
1123
1133
|
onOutputAction?: (command: OutputActionInterface, output: InlineAIPromptOutputInterface) => void;
|
|
1124
1134
|
/**
|
|
1125
|
-
*
|
|
1135
|
+
* Custom component used to render the prompt input.
|
|
1126
1136
|
*/
|
|
1127
1137
|
promptInput?: CustomComponent<TextAreaProps>;
|
|
1128
1138
|
/**
|
|
1129
|
-
*
|
|
1139
|
+
* Custom component used to render the generate button.
|
|
1130
1140
|
*/
|
|
1131
1141
|
generateButton?: CustomComponent<ButtonProps>;
|
|
1132
1142
|
/**
|
|
1133
|
-
*
|
|
1134
|
-
* When an object
|
|
1143
|
+
* Shows speech-to-text button in the input. When `true`, shows the button with default settings.
|
|
1144
|
+
* When you pass an object, forwards its props to the `SpeechToTextButton` component.
|
|
1135
1145
|
*
|
|
1136
1146
|
* @default false
|
|
1137
1147
|
*/
|
|
1138
1148
|
enableSpeechToText?: boolean | SpeechToTextButtonProps;
|
|
1139
1149
|
/**
|
|
1140
|
-
*
|
|
1150
|
+
* Indicates if the content is streaming.
|
|
1141
1151
|
*/
|
|
1142
1152
|
streaming?: boolean;
|
|
1143
1153
|
/**
|
|
1144
|
-
*
|
|
1145
|
-
* If not
|
|
1154
|
+
* Collection of commands rendered in the context menu.
|
|
1155
|
+
* If not set, default AI text editing commands are used.
|
|
1146
1156
|
*/
|
|
1147
1157
|
commands?: CommandInterface[];
|
|
1148
1158
|
/**
|
|
@@ -1154,8 +1164,7 @@ export declare interface InlineAIPromptProps extends Omit<default_2.HTMLAttribut
|
|
|
1154
1164
|
*/
|
|
1155
1165
|
height?: number | string;
|
|
1156
1166
|
/**
|
|
1157
|
-
* Fires when a command from the context menu
|
|
1158
|
-
* Exposes the selected command and current prompt value as event data.
|
|
1167
|
+
* Fires when a command from the context menu executes. Provides the selected command and current prompt value.
|
|
1159
1168
|
*/
|
|
1160
1169
|
onCommandExecute?: (command: CommandItemInterface) => void;
|
|
1161
1170
|
}
|
|
@@ -1200,88 +1209,84 @@ export declare const mapMessageToCustomFormat: (message: Message, fieldMapping?:
|
|
|
1200
1209
|
/**
|
|
1201
1210
|
* Represents a Chat message.
|
|
1202
1211
|
*
|
|
1203
|
-
* > *
|
|
1204
|
-
* > * [Local users]({% slug api_conversational-ui_chatprops %}#toc-user)
|
|
1205
|
-
*
|
|
1206
|
-
* > * If `typing` is set to `true`, the Chat displays a typing indicator instead of text.
|
|
1212
|
+
* > * Provide the `author` field.
|
|
1213
|
+
* > * [Local users]({% slug api_conversational-ui_chatprops %}#toc-user) display to the right in left-to-right languages and to the left in right-to-left languages.
|
|
1214
|
+
* > * If `typing` is `true`, the Chat displays a typing indicator instead of text.
|
|
1207
1215
|
*/
|
|
1208
1216
|
export declare interface Message {
|
|
1209
1217
|
/**
|
|
1210
|
-
*
|
|
1218
|
+
* Unique identifier of the message.
|
|
1211
1219
|
*/
|
|
1212
1220
|
id: number | string;
|
|
1213
1221
|
/**
|
|
1214
|
-
*
|
|
1222
|
+
* Author of the message.
|
|
1215
1223
|
*/
|
|
1216
1224
|
author: User;
|
|
1217
1225
|
/**
|
|
1218
|
-
*
|
|
1219
|
-
* ([see example]({% slug attachments_chat %}#toc-display-modes)).
|
|
1226
|
+
* Layout used for displaying message attachments, if any ([see example]({% slug attachments_chat %}#toc-display-modes)).
|
|
1220
1227
|
*/
|
|
1221
1228
|
attachmentLayout?: AttachmentLayout;
|
|
1222
1229
|
/**
|
|
1223
|
-
*
|
|
1224
|
-
* ([see example]({% slug attachments_chat %})).
|
|
1230
|
+
* Optional message attachments ([see example]({% slug attachments_chat %})).
|
|
1225
1231
|
*/
|
|
1226
1232
|
attachments?: Attachment[];
|
|
1227
1233
|
/**
|
|
1228
|
-
*
|
|
1229
|
-
* ([see example]({% slug quick_actions_suggested_actions_chat %}#toc-defining-quick-actions)).
|
|
1234
|
+
* Suggested quick actions displayed below this message ([see example]({% slug quick_actions_suggested_actions_chat %}#toc-defining-quick-actions)).
|
|
1230
1235
|
*
|
|
1231
|
-
* >
|
|
1236
|
+
* > The Chat displays suggested actions only for the last message in the conversation.
|
|
1232
1237
|
*/
|
|
1233
1238
|
suggestedActions?: Action[];
|
|
1234
1239
|
/**
|
|
1235
|
-
*
|
|
1236
|
-
*
|
|
1237
|
-
* by clicking on it or by using the keyboard navigation shortcuts.
|
|
1240
|
+
* Optional status string for the message.
|
|
1241
|
+
* Displays when you select the message by mouse or keyboard.
|
|
1238
1242
|
*/
|
|
1239
1243
|
status?: string;
|
|
1240
1244
|
/**
|
|
1241
|
-
*
|
|
1242
|
-
*
|
|
1243
|
-
* only attachments or quick actions.
|
|
1245
|
+
* Optional text for the message.
|
|
1246
|
+
* Some messages contain only attachments or quick actions.
|
|
1244
1247
|
*/
|
|
1245
1248
|
text?: string;
|
|
1246
1249
|
/**
|
|
1247
|
-
*
|
|
1248
|
-
*
|
|
1250
|
+
* Time when the message was composed.
|
|
1249
1251
|
*/
|
|
1250
1252
|
timestamp?: Date;
|
|
1251
1253
|
/**
|
|
1252
|
-
*
|
|
1253
|
-
* If
|
|
1254
|
+
* Indicates if the user is still typing the message.
|
|
1255
|
+
* If `true`, the Chat displays a typing indicator instead of the message.
|
|
1254
1256
|
*/
|
|
1255
1257
|
typing?: boolean;
|
|
1256
1258
|
/**
|
|
1257
|
-
*
|
|
1258
|
-
* If
|
|
1259
|
+
* Indicates if the message is loading.
|
|
1260
|
+
* If `true`, the Chat displays a skeleton placeholder instead of the content.
|
|
1259
1261
|
*/
|
|
1260
1262
|
isLoading?: boolean;
|
|
1261
1263
|
/**
|
|
1262
|
-
*
|
|
1264
|
+
* Indicates if the message is pinned.
|
|
1263
1265
|
*/
|
|
1264
1266
|
isPinned?: boolean;
|
|
1265
1267
|
/**
|
|
1266
|
-
*
|
|
1268
|
+
* Date and time when the message was pinned.
|
|
1267
1269
|
*/
|
|
1268
1270
|
pinnedAt?: Date;
|
|
1269
1271
|
/**
|
|
1270
|
-
*
|
|
1272
|
+
* User who pinned the message.
|
|
1271
1273
|
*/
|
|
1272
1274
|
pinnedBy?: User;
|
|
1273
1275
|
/**
|
|
1274
|
-
*
|
|
1276
|
+
* ID of the message this message replies to.
|
|
1275
1277
|
*/
|
|
1276
1278
|
replyToId?: number | string;
|
|
1277
1279
|
/**
|
|
1278
|
-
* Indicates
|
|
1280
|
+
* Indicates if the message has been deleted.
|
|
1279
1281
|
*/
|
|
1280
1282
|
isDeleted?: boolean;
|
|
1281
1283
|
/**
|
|
1282
1284
|
* Files attached to the message.
|
|
1283
1285
|
*/
|
|
1284
1286
|
files?: any[];
|
|
1287
|
+
/**
|
|
1288
|
+
* Index used for keyboard selection navigation.
|
|
1289
|
+
*/
|
|
1285
1290
|
selectionIndex?: number;
|
|
1286
1291
|
}
|
|
1287
1292
|
|
|
@@ -1315,27 +1320,27 @@ export declare interface MessageModel extends Message, Selectable {
|
|
|
1315
1320
|
|
|
1316
1321
|
export declare interface OutputActionInterface {
|
|
1317
1322
|
/**
|
|
1318
|
-
*
|
|
1323
|
+
* Unique identifier for the action command.
|
|
1319
1324
|
*/
|
|
1320
1325
|
id: string;
|
|
1321
1326
|
/**
|
|
1322
|
-
*
|
|
1327
|
+
* Text displayed on the button.
|
|
1323
1328
|
*/
|
|
1324
1329
|
text: string;
|
|
1325
1330
|
/**
|
|
1326
|
-
*
|
|
1331
|
+
* SVG icon displayed on the button.
|
|
1327
1332
|
*/
|
|
1328
1333
|
svgIcon?: any;
|
|
1329
1334
|
/**
|
|
1330
|
-
*
|
|
1335
|
+
* Theme color of the button.
|
|
1331
1336
|
*/
|
|
1332
1337
|
themeColor?: ButtonProps['themeColor'];
|
|
1333
1338
|
/**
|
|
1334
|
-
*
|
|
1339
|
+
* Title attribute (tooltip) for the button.
|
|
1335
1340
|
*/
|
|
1336
1341
|
title?: string;
|
|
1337
1342
|
/**
|
|
1338
|
-
* If
|
|
1343
|
+
* If `true`, adds a spacer in the action commands section for visual separation.
|
|
1339
1344
|
* Useful for visually separating groups of actions.
|
|
1340
1345
|
*/
|
|
1341
1346
|
spacer?: boolean;
|
|
@@ -1368,7 +1373,7 @@ declare interface Selectable {
|
|
|
1368
1373
|
*/
|
|
1369
1374
|
export declare interface StatusTemplateProps {
|
|
1370
1375
|
/**
|
|
1371
|
-
*
|
|
1376
|
+
* Message item containing the status information.
|
|
1372
1377
|
*/
|
|
1373
1378
|
item: Message;
|
|
1374
1379
|
}
|
|
@@ -1391,7 +1396,13 @@ declare interface SuggestionGroupProps {
|
|
|
1391
1396
|
export declare type SuggestionsView = 'classic' | 'modern';
|
|
1392
1397
|
|
|
1393
1398
|
export declare interface SuggestionTemplateProps {
|
|
1399
|
+
/**
|
|
1400
|
+
* The suggestion object containing the data to be rendered.
|
|
1401
|
+
*/
|
|
1394
1402
|
suggestion: ChatSuggestion;
|
|
1403
|
+
/**
|
|
1404
|
+
* A callback function that is called when the suggestion is clicked.
|
|
1405
|
+
*/
|
|
1395
1406
|
onClick?: (event: React_2.MouseEvent<HTMLElement>) => void;
|
|
1396
1407
|
}
|
|
1397
1408
|
|
|
@@ -1400,21 +1411,20 @@ export declare interface SuggestionTemplateProps {
|
|
|
1400
1411
|
*/
|
|
1401
1412
|
export declare interface User {
|
|
1402
1413
|
/**
|
|
1403
|
-
*
|
|
1404
|
-
* Typically
|
|
1405
|
-
* Can also be a string or an object.
|
|
1414
|
+
* Unique ID for this user.
|
|
1415
|
+
* Typically a number. Can be a string or an object.
|
|
1406
1416
|
*/
|
|
1407
1417
|
id: any;
|
|
1408
1418
|
/**
|
|
1409
|
-
*
|
|
1419
|
+
* Optional displayed name for the user.
|
|
1410
1420
|
*/
|
|
1411
1421
|
name?: string;
|
|
1412
1422
|
/**
|
|
1413
|
-
*
|
|
1423
|
+
* Optional avatar image URL for the user.
|
|
1414
1424
|
*/
|
|
1415
1425
|
avatarUrl?: string;
|
|
1416
1426
|
/**
|
|
1417
|
-
*
|
|
1427
|
+
* Optional avatar image `alt` text for the user.
|
|
1418
1428
|
*/
|
|
1419
1429
|
avatarAltText?: string;
|
|
1420
1430
|
}
|