@progress/kendo-react-conversational-ui 12.0.2-develop.1 → 12.0.2-develop.3
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 +179 -170
- package/index.d.ts +179 -170
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -11
package/index.d.ts
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,11 +513,11 @@ 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
|
}
|
|
@@ -554,7 +551,7 @@ 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
|
/**
|
|
@@ -581,64 +578,66 @@ export declare interface ChatMessageProps {
|
|
|
581
578
|
* For more information, refer to the [Message Template]({% slug customization_message_templates_chat %}) article.
|
|
582
579
|
*/
|
|
583
580
|
export declare interface ChatMessageTemplateProps {
|
|
581
|
+
/**
|
|
582
|
+
* The message data object containing all information about the message to be rendered.
|
|
583
|
+
*/
|
|
584
584
|
item: MessageModel;
|
|
585
585
|
}
|
|
586
586
|
|
|
587
587
|
export declare interface ChatProps extends FieldMappingConfig {
|
|
588
588
|
/**
|
|
589
|
-
*
|
|
589
|
+
* CSS class of the Chat DOM element.
|
|
590
590
|
*/
|
|
591
591
|
className?: string;
|
|
592
592
|
/**
|
|
593
|
-
*
|
|
593
|
+
* ID of the Chat component.
|
|
594
594
|
*/
|
|
595
595
|
id?: string;
|
|
596
596
|
/**
|
|
597
|
-
*
|
|
598
|
-
* 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.
|
|
599
599
|
*/
|
|
600
600
|
messages: Message[] | any[];
|
|
601
601
|
/**
|
|
602
|
-
*
|
|
602
|
+
* ID of the local user. Identifies messages authored by the local user.
|
|
603
603
|
*/
|
|
604
604
|
authorId: number | string;
|
|
605
605
|
/**
|
|
606
|
-
*
|
|
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.
|
|
607
607
|
*/
|
|
608
608
|
messageTemplate?: React.ComponentType<ChatMessageTemplateProps>;
|
|
609
609
|
/**
|
|
610
|
-
*
|
|
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.
|
|
611
611
|
*/
|
|
612
612
|
attachmentTemplate?: any;
|
|
613
613
|
/**
|
|
614
|
-
*
|
|
614
|
+
* Width of the Chat.
|
|
615
615
|
*/
|
|
616
616
|
width?: string | number;
|
|
617
617
|
/**
|
|
618
|
-
*
|
|
618
|
+
* Height of the Chat.
|
|
619
619
|
*/
|
|
620
620
|
height?: string | number;
|
|
621
621
|
/**
|
|
622
|
-
* 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 %}).
|
|
623
623
|
*
|
|
624
|
-
* > The Chat
|
|
624
|
+
* > The Chat does not automatically update with the new message.
|
|
625
625
|
*/
|
|
626
626
|
onSendMessage?: (event: ChatSendMessageEvent) => void;
|
|
627
627
|
/**
|
|
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
|
|
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.
|
|
629
629
|
*/
|
|
630
630
|
onActionExecute?: (event: ChatActionExecuteEvent) => void;
|
|
631
631
|
/**
|
|
632
|
-
*
|
|
632
|
+
* Direction of the Chat component.
|
|
633
633
|
*/
|
|
634
634
|
dir?: string;
|
|
635
635
|
/**
|
|
636
|
-
*
|
|
636
|
+
* Text displayed inside the new message input when empty.
|
|
637
637
|
*/
|
|
638
638
|
placeholder?: string;
|
|
639
639
|
/**
|
|
640
|
-
* Enables
|
|
641
|
-
* ([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 %})).
|
|
642
641
|
*/
|
|
643
642
|
messageBox?: React.ComponentType<ChatMessageBoxProps>;
|
|
644
643
|
/**
|
|
@@ -646,55 +645,57 @@ export declare interface ChatProps extends FieldMappingConfig {
|
|
|
646
645
|
*/
|
|
647
646
|
message?: React.ComponentType<ChatMessageProps>;
|
|
648
647
|
/**
|
|
649
|
-
*
|
|
648
|
+
* List of message suggestions displayed above the message input.
|
|
650
649
|
*/
|
|
651
650
|
suggestions?: ChatSuggestion[];
|
|
652
651
|
/**
|
|
653
|
-
*
|
|
652
|
+
* Template for suggestion items displayed above the message input.
|
|
654
653
|
*/
|
|
655
654
|
suggestionTemplate?: React.ComponentType<SuggestionTemplateProps>;
|
|
656
655
|
/**
|
|
657
|
-
* Fires when a suggestion is clicked.
|
|
656
|
+
* Fires when a suggestion is clicked. Provides the clicked suggestion.
|
|
658
657
|
*/
|
|
659
658
|
onSuggestionClick?: (suggestion: ChatSuggestion) => void;
|
|
660
659
|
/**
|
|
661
|
-
*
|
|
660
|
+
* Template for the header of the Chat component.
|
|
662
661
|
*/
|
|
663
662
|
headerTemplate?: React.ReactElement | (() => React.ReactElement);
|
|
664
663
|
/**
|
|
665
|
-
*
|
|
664
|
+
* Template for the timestamp of the message.
|
|
666
665
|
*/
|
|
667
666
|
timestampTemplate?: React.ComponentType<{
|
|
668
667
|
item: DateMarker;
|
|
669
668
|
}>;
|
|
670
669
|
/**
|
|
671
|
-
*
|
|
670
|
+
* Template for status items below each message.
|
|
672
671
|
*/
|
|
673
672
|
statusTemplate?: React.ComponentType<StatusTemplateProps>;
|
|
674
673
|
/**
|
|
675
|
-
* Enables
|
|
676
|
-
* 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.
|
|
677
675
|
*/
|
|
678
676
|
allowMessageCollapse?: boolean;
|
|
679
677
|
/**
|
|
680
|
-
*
|
|
681
|
-
* This can include buttons for actions like reply, edit, delete, etc.
|
|
678
|
+
* Actions displayed in the message toolbar.
|
|
682
679
|
*/
|
|
683
680
|
messageToolbarActions?: MessageAction[];
|
|
684
681
|
/**
|
|
685
|
-
*
|
|
682
|
+
* Actions displayed in the message context menu.
|
|
686
683
|
*/
|
|
687
684
|
messageContextMenuActions?: MessageAction[];
|
|
685
|
+
/**
|
|
686
|
+
* Actions displayed for files in the message.
|
|
687
|
+
*/
|
|
688
688
|
fileActions?: MessageAction[];
|
|
689
689
|
/**
|
|
690
|
-
* Fires when a message
|
|
691
|
-
* The event contains the message that was unpinned.
|
|
690
|
+
* Fires when a message is unpinned. Provides the message.
|
|
692
691
|
*/
|
|
693
692
|
onUnpin?: (message: Message) => void;
|
|
694
693
|
/**
|
|
695
|
-
* Sets the message width mode.
|
|
696
|
-
* - `full`—
|
|
697
|
-
* - `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'
|
|
698
699
|
*/
|
|
699
700
|
messageWidthMode?: 'full' | 'standard';
|
|
700
701
|
/**
|
|
@@ -712,38 +713,33 @@ export declare interface ChatProps extends FieldMappingConfig {
|
|
|
712
713
|
*/
|
|
713
714
|
sendButtonConfig?: ButtonProps;
|
|
714
715
|
/**
|
|
715
|
-
* Fires when a toolbar action is executed on a message.
|
|
716
|
-
* 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.
|
|
717
717
|
*/
|
|
718
718
|
onToolbarAction?: (action: MessageAction, event: React.SyntheticEvent<any>, target: Message) => void;
|
|
719
719
|
/**
|
|
720
|
-
* Fires when a context menu action is executed on a message.
|
|
721
|
-
* 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.
|
|
722
721
|
*/
|
|
723
722
|
onContextMenuAction?: (action: MessageAction, event: React.SyntheticEvent<any>, target: Message) => void;
|
|
724
723
|
/**
|
|
725
|
-
* Fires when a file action is executed on a message.
|
|
726
|
-
* 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.
|
|
727
725
|
*/
|
|
728
726
|
onFileAction?: (action: FileAction, event: React.SyntheticEvent<any>, target: ChatFile) => void;
|
|
729
727
|
/**
|
|
730
|
-
* Fires when a download action is executed on a message.
|
|
731
|
-
* 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.
|
|
732
729
|
*/
|
|
733
730
|
onDownload?: (files: ChatFile[], message: Message) => void;
|
|
734
731
|
/**
|
|
735
|
-
* Fires when the input value changes.
|
|
736
|
-
* The event contains the new input value.
|
|
732
|
+
* Fires when the input value changes. Provides the new input value.
|
|
737
733
|
*/
|
|
738
734
|
onInputValueChange?: (value: string) => void;
|
|
739
735
|
/**
|
|
740
|
-
*
|
|
736
|
+
* Input value of the Chat component.
|
|
741
737
|
*/
|
|
742
738
|
inputValue?: string;
|
|
743
739
|
}
|
|
744
740
|
|
|
745
741
|
/**
|
|
746
|
-
*
|
|
742
|
+
* Arguments for the `messagesend` event of the Chat.
|
|
747
743
|
*/
|
|
748
744
|
export declare interface ChatSendMessageEvent extends BaseEvent<React_2.Component> {
|
|
749
745
|
/**
|
|
@@ -765,15 +761,30 @@ export declare interface ChatState {
|
|
|
765
761
|
* @interface ChatSuggestion
|
|
766
762
|
*/
|
|
767
763
|
export declare interface ChatSuggestion {
|
|
764
|
+
/**
|
|
765
|
+
* The unique identifier for the suggestion.
|
|
766
|
+
*/
|
|
768
767
|
id: string | number;
|
|
768
|
+
/**
|
|
769
|
+
* The text content of the suggestion that will be displayed to the user.
|
|
770
|
+
*/
|
|
769
771
|
text: string;
|
|
772
|
+
/**
|
|
773
|
+
* An optional description that provides additional context for the suggestion.
|
|
774
|
+
*/
|
|
770
775
|
description?: string;
|
|
776
|
+
/**
|
|
777
|
+
* Determines whether the suggestion is disabled and cannot be clicked.
|
|
778
|
+
*/
|
|
771
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
|
+
*/
|
|
772
783
|
suggestionsView?: SuggestionsView;
|
|
773
784
|
}
|
|
774
785
|
|
|
775
786
|
/**
|
|
776
|
-
*
|
|
787
|
+
* Arguments for the `toolbaractionexecute` event of the Chat.
|
|
777
788
|
*/
|
|
778
789
|
export declare interface ChatToolbarActionExecuteEvent extends BaseEvent<React_2.Component> {
|
|
779
790
|
/**
|
|
@@ -846,9 +857,9 @@ export declare const DEFAULT_FIELD_MAPPING: Required<FieldMappingConfig>;
|
|
|
846
857
|
export declare const extractFieldMappingFromProps: (props: any) => FieldMappingConfig;
|
|
847
858
|
|
|
848
859
|
/**
|
|
849
|
-
* Configuration
|
|
850
|
-
*
|
|
851
|
-
*
|
|
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.
|
|
852
863
|
*/
|
|
853
864
|
export declare interface FieldMappingConfig {
|
|
854
865
|
/**
|
|
@@ -870,19 +881,19 @@ export declare interface FieldMappingConfig {
|
|
|
870
881
|
*/
|
|
871
882
|
authorIdField?: string;
|
|
872
883
|
/**
|
|
873
|
-
* Field name for message author name (when flattened
|
|
884
|
+
* Field name for message author name (when flattened).
|
|
874
885
|
*
|
|
875
886
|
* @default 'authorName'
|
|
876
887
|
*/
|
|
877
888
|
authorNameField?: string;
|
|
878
889
|
/**
|
|
879
|
-
* Field name for message author avatar URL (when flattened
|
|
890
|
+
* Field name for message author avatar URL (when flattened).
|
|
880
891
|
*
|
|
881
892
|
* @default 'authorImageUrl'
|
|
882
893
|
*/
|
|
883
894
|
authorImageUrlField?: string;
|
|
884
895
|
/**
|
|
885
|
-
* 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).
|
|
886
897
|
*
|
|
887
898
|
* @default 'authorImageAltText'
|
|
888
899
|
*/
|
|
@@ -930,13 +941,13 @@ export declare interface FieldMappingConfig {
|
|
|
930
941
|
*/
|
|
931
942
|
isPinnedField?: string;
|
|
932
943
|
/**
|
|
933
|
-
* Field name for the typing
|
|
944
|
+
* Field name for the `typing` property of a message.
|
|
934
945
|
*
|
|
935
946
|
* @default 'typing'
|
|
936
947
|
*/
|
|
937
948
|
typingField?: string;
|
|
938
949
|
/**
|
|
939
|
-
* Field name for the suggestedActions
|
|
950
|
+
* Field name for the `suggestedActions` property of a message.
|
|
940
951
|
*
|
|
941
952
|
* @default 'suggestedActions'
|
|
942
953
|
*/
|
|
@@ -955,7 +966,7 @@ export declare interface FileAction extends MessageAction {
|
|
|
955
966
|
export declare const HeroCard: React_2.FC<HeroCardProps>;
|
|
956
967
|
|
|
957
968
|
/**
|
|
958
|
-
*
|
|
969
|
+
* Arguments for the `actionexecute` event of the hero card.
|
|
959
970
|
*/
|
|
960
971
|
export declare interface HeroCardActionExecuteEvent extends BaseEvent<React_2.Component> {
|
|
961
972
|
/**
|
|
@@ -1071,80 +1082,77 @@ declare interface InlineAIPromptPopupProps {
|
|
|
1071
1082
|
|
|
1072
1083
|
export declare interface InlineAIPromptProps extends Omit<default_2.HTMLAttributes<HTMLElement>, 'onCopy'>, InlineAIPromptPopupProps {
|
|
1073
1084
|
/**
|
|
1074
|
-
*
|
|
1085
|
+
* Inline styles for the root element.
|
|
1075
1086
|
* ```jsx
|
|
1076
1087
|
* <InlineAIPrompt style={{ backgroundColor: 'lightblue' }} />
|
|
1077
1088
|
* ```
|
|
1078
1089
|
*/
|
|
1079
1090
|
style?: default_2.CSSProperties;
|
|
1080
1091
|
/**
|
|
1081
|
-
*
|
|
1092
|
+
* Collection of outputs to display as cards.
|
|
1082
1093
|
*/
|
|
1083
1094
|
outputs?: InlineAIPromptOutputInterface[];
|
|
1084
1095
|
/**
|
|
1085
|
-
*
|
|
1086
|
-
* header, body, actions
|
|
1087
|
-
* The custom fields will override the default one.
|
|
1096
|
+
* Template that lets you define custom Card fields for header, body, and actions. Overrides defaults.
|
|
1088
1097
|
*/
|
|
1089
1098
|
outputCard?: AIPromptCardInterface_2;
|
|
1090
1099
|
/**
|
|
1091
|
-
* Placeholder text for the prompt input
|
|
1100
|
+
* Placeholder text for the prompt input.
|
|
1092
1101
|
*/
|
|
1093
1102
|
promptPlaceholder?: string;
|
|
1094
1103
|
/**
|
|
1095
|
-
*
|
|
1104
|
+
* Initial value of the prompt input.
|
|
1096
1105
|
*/
|
|
1097
1106
|
promptValue?: string;
|
|
1098
1107
|
/**
|
|
1099
|
-
*
|
|
1108
|
+
* Fires when the user submits a prompt.
|
|
1100
1109
|
*/
|
|
1101
1110
|
onPromptRequest?: (prompt: string, outputItem?: InlineAIPromptOutputInterface) => void;
|
|
1102
1111
|
/**
|
|
1103
|
-
*
|
|
1112
|
+
* Fires when the cancel action occurs.
|
|
1104
1113
|
*/
|
|
1105
1114
|
onPromptCancel?: () => void;
|
|
1106
1115
|
/**
|
|
1107
|
-
* Fires
|
|
1116
|
+
* Fires when the user clicks the Copy button.
|
|
1108
1117
|
*/
|
|
1109
1118
|
onCopy?: (output: InlineAIPromptOutputInterface) => void;
|
|
1110
1119
|
/**
|
|
1111
|
-
* Fires
|
|
1120
|
+
* Fires when the user clicks the Discard button.
|
|
1112
1121
|
*/
|
|
1113
1122
|
onDiscard?: (output: InlineAIPromptOutputInterface) => void;
|
|
1114
1123
|
/**
|
|
1115
|
-
*
|
|
1116
|
-
* If not
|
|
1117
|
-
* 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.
|
|
1118
1126
|
*/
|
|
1119
1127
|
outputActions?: OutputActionInterface[];
|
|
1120
1128
|
/**
|
|
1121
|
-
* Fires when an action command
|
|
1122
|
-
* Built-in
|
|
1123
|
-
* 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.
|
|
1124
1132
|
*/
|
|
1125
1133
|
onOutputAction?: (command: OutputActionInterface, output: InlineAIPromptOutputInterface) => void;
|
|
1126
1134
|
/**
|
|
1127
|
-
*
|
|
1135
|
+
* Custom component used to render the prompt input.
|
|
1128
1136
|
*/
|
|
1129
1137
|
promptInput?: CustomComponent<TextAreaProps>;
|
|
1130
1138
|
/**
|
|
1131
|
-
*
|
|
1139
|
+
* Custom component used to render the generate button.
|
|
1132
1140
|
*/
|
|
1133
1141
|
generateButton?: CustomComponent<ButtonProps>;
|
|
1134
1142
|
/**
|
|
1135
|
-
*
|
|
1136
|
-
* 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.
|
|
1137
1145
|
*
|
|
1138
1146
|
* @default false
|
|
1139
1147
|
*/
|
|
1140
1148
|
enableSpeechToText?: boolean | SpeechToTextButtonProps;
|
|
1141
1149
|
/**
|
|
1142
|
-
*
|
|
1150
|
+
* Indicates if the content is streaming.
|
|
1143
1151
|
*/
|
|
1144
1152
|
streaming?: boolean;
|
|
1145
1153
|
/**
|
|
1146
|
-
*
|
|
1147
|
-
* If not
|
|
1154
|
+
* Collection of commands rendered in the context menu.
|
|
1155
|
+
* If not set, default AI text editing commands are used.
|
|
1148
1156
|
*/
|
|
1149
1157
|
commands?: CommandInterface[];
|
|
1150
1158
|
/**
|
|
@@ -1156,8 +1164,7 @@ export declare interface InlineAIPromptProps extends Omit<default_2.HTMLAttribut
|
|
|
1156
1164
|
*/
|
|
1157
1165
|
height?: number | string;
|
|
1158
1166
|
/**
|
|
1159
|
-
* Fires when a command from the context menu
|
|
1160
|
-
* 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.
|
|
1161
1168
|
*/
|
|
1162
1169
|
onCommandExecute?: (command: CommandItemInterface) => void;
|
|
1163
1170
|
}
|
|
@@ -1202,87 +1209,84 @@ export declare const mapMessageToCustomFormat: (message: Message, fieldMapping?:
|
|
|
1202
1209
|
/**
|
|
1203
1210
|
* Represents a Chat message.
|
|
1204
1211
|
*
|
|
1205
|
-
* > *
|
|
1206
|
-
* > * [Local users]({% slug api_conversational-ui_chatprops %}#toc-user)
|
|
1207
|
-
* > * If `typing` is
|
|
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.
|
|
1208
1215
|
*/
|
|
1209
1216
|
export declare interface Message {
|
|
1210
1217
|
/**
|
|
1211
|
-
*
|
|
1218
|
+
* Unique identifier of the message.
|
|
1212
1219
|
*/
|
|
1213
1220
|
id: number | string;
|
|
1214
1221
|
/**
|
|
1215
|
-
*
|
|
1222
|
+
* Author of the message.
|
|
1216
1223
|
*/
|
|
1217
1224
|
author: User;
|
|
1218
1225
|
/**
|
|
1219
|
-
*
|
|
1220
|
-
* ([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)).
|
|
1221
1227
|
*/
|
|
1222
1228
|
attachmentLayout?: AttachmentLayout;
|
|
1223
1229
|
/**
|
|
1224
|
-
*
|
|
1225
|
-
* ([see example]({% slug attachments_chat %})).
|
|
1230
|
+
* Optional message attachments ([see example]({% slug attachments_chat %})).
|
|
1226
1231
|
*/
|
|
1227
1232
|
attachments?: Attachment[];
|
|
1228
1233
|
/**
|
|
1229
|
-
*
|
|
1230
|
-
* ([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)).
|
|
1231
1235
|
*
|
|
1232
|
-
* >
|
|
1236
|
+
* > The Chat displays suggested actions only for the last message in the conversation.
|
|
1233
1237
|
*/
|
|
1234
1238
|
suggestedActions?: Action[];
|
|
1235
1239
|
/**
|
|
1236
|
-
*
|
|
1237
|
-
*
|
|
1238
|
-
* 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.
|
|
1239
1242
|
*/
|
|
1240
1243
|
status?: string;
|
|
1241
1244
|
/**
|
|
1242
|
-
*
|
|
1243
|
-
*
|
|
1244
|
-
* only attachments or quick actions.
|
|
1245
|
+
* Optional text for the message.
|
|
1246
|
+
* Some messages contain only attachments or quick actions.
|
|
1245
1247
|
*/
|
|
1246
1248
|
text?: string;
|
|
1247
1249
|
/**
|
|
1248
|
-
*
|
|
1249
|
-
*
|
|
1250
|
+
* Time when the message was composed.
|
|
1250
1251
|
*/
|
|
1251
1252
|
timestamp?: Date;
|
|
1252
1253
|
/**
|
|
1253
|
-
*
|
|
1254
|
-
* If
|
|
1254
|
+
* Indicates if the user is still typing the message.
|
|
1255
|
+
* If `true`, the Chat displays a typing indicator instead of the message.
|
|
1255
1256
|
*/
|
|
1256
1257
|
typing?: boolean;
|
|
1257
1258
|
/**
|
|
1258
|
-
*
|
|
1259
|
-
* If
|
|
1259
|
+
* Indicates if the message is loading.
|
|
1260
|
+
* If `true`, the Chat displays a skeleton placeholder instead of the content.
|
|
1260
1261
|
*/
|
|
1261
1262
|
isLoading?: boolean;
|
|
1262
1263
|
/**
|
|
1263
|
-
*
|
|
1264
|
+
* Indicates if the message is pinned.
|
|
1264
1265
|
*/
|
|
1265
1266
|
isPinned?: boolean;
|
|
1266
1267
|
/**
|
|
1267
|
-
*
|
|
1268
|
+
* Date and time when the message was pinned.
|
|
1268
1269
|
*/
|
|
1269
1270
|
pinnedAt?: Date;
|
|
1270
1271
|
/**
|
|
1271
|
-
*
|
|
1272
|
+
* User who pinned the message.
|
|
1272
1273
|
*/
|
|
1273
1274
|
pinnedBy?: User;
|
|
1274
1275
|
/**
|
|
1275
|
-
*
|
|
1276
|
+
* ID of the message this message replies to.
|
|
1276
1277
|
*/
|
|
1277
1278
|
replyToId?: number | string;
|
|
1278
1279
|
/**
|
|
1279
|
-
* Indicates
|
|
1280
|
+
* Indicates if the message has been deleted.
|
|
1280
1281
|
*/
|
|
1281
1282
|
isDeleted?: boolean;
|
|
1282
1283
|
/**
|
|
1283
1284
|
* Files attached to the message.
|
|
1284
1285
|
*/
|
|
1285
1286
|
files?: any[];
|
|
1287
|
+
/**
|
|
1288
|
+
* Index used for keyboard selection navigation.
|
|
1289
|
+
*/
|
|
1286
1290
|
selectionIndex?: number;
|
|
1287
1291
|
}
|
|
1288
1292
|
|
|
@@ -1316,27 +1320,27 @@ export declare interface MessageModel extends Message, Selectable {
|
|
|
1316
1320
|
|
|
1317
1321
|
export declare interface OutputActionInterface {
|
|
1318
1322
|
/**
|
|
1319
|
-
*
|
|
1323
|
+
* Unique identifier for the action command.
|
|
1320
1324
|
*/
|
|
1321
1325
|
id: string;
|
|
1322
1326
|
/**
|
|
1323
|
-
*
|
|
1327
|
+
* Text displayed on the button.
|
|
1324
1328
|
*/
|
|
1325
1329
|
text: string;
|
|
1326
1330
|
/**
|
|
1327
|
-
*
|
|
1331
|
+
* SVG icon displayed on the button.
|
|
1328
1332
|
*/
|
|
1329
1333
|
svgIcon?: any;
|
|
1330
1334
|
/**
|
|
1331
|
-
*
|
|
1335
|
+
* Theme color of the button.
|
|
1332
1336
|
*/
|
|
1333
1337
|
themeColor?: ButtonProps['themeColor'];
|
|
1334
1338
|
/**
|
|
1335
|
-
*
|
|
1339
|
+
* Title attribute (tooltip) for the button.
|
|
1336
1340
|
*/
|
|
1337
1341
|
title?: string;
|
|
1338
1342
|
/**
|
|
1339
|
-
* If
|
|
1343
|
+
* If `true`, adds a spacer in the action commands section for visual separation.
|
|
1340
1344
|
* Useful for visually separating groups of actions.
|
|
1341
1345
|
*/
|
|
1342
1346
|
spacer?: boolean;
|
|
@@ -1369,7 +1373,7 @@ declare interface Selectable {
|
|
|
1369
1373
|
*/
|
|
1370
1374
|
export declare interface StatusTemplateProps {
|
|
1371
1375
|
/**
|
|
1372
|
-
*
|
|
1376
|
+
* Message item containing the status information.
|
|
1373
1377
|
*/
|
|
1374
1378
|
item: Message;
|
|
1375
1379
|
}
|
|
@@ -1392,7 +1396,13 @@ declare interface SuggestionGroupProps {
|
|
|
1392
1396
|
export declare type SuggestionsView = 'classic' | 'modern';
|
|
1393
1397
|
|
|
1394
1398
|
export declare interface SuggestionTemplateProps {
|
|
1399
|
+
/**
|
|
1400
|
+
* The suggestion object containing the data to be rendered.
|
|
1401
|
+
*/
|
|
1395
1402
|
suggestion: ChatSuggestion;
|
|
1403
|
+
/**
|
|
1404
|
+
* A callback function that is called when the suggestion is clicked.
|
|
1405
|
+
*/
|
|
1396
1406
|
onClick?: (event: React_2.MouseEvent<HTMLElement>) => void;
|
|
1397
1407
|
}
|
|
1398
1408
|
|
|
@@ -1401,21 +1411,20 @@ export declare interface SuggestionTemplateProps {
|
|
|
1401
1411
|
*/
|
|
1402
1412
|
export declare interface User {
|
|
1403
1413
|
/**
|
|
1404
|
-
*
|
|
1405
|
-
* Typically
|
|
1406
|
-
* 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.
|
|
1407
1416
|
*/
|
|
1408
1417
|
id: any;
|
|
1409
1418
|
/**
|
|
1410
|
-
*
|
|
1419
|
+
* Optional displayed name for the user.
|
|
1411
1420
|
*/
|
|
1412
1421
|
name?: string;
|
|
1413
1422
|
/**
|
|
1414
|
-
*
|
|
1423
|
+
* Optional avatar image URL for the user.
|
|
1415
1424
|
*/
|
|
1416
1425
|
avatarUrl?: string;
|
|
1417
1426
|
/**
|
|
1418
|
-
*
|
|
1427
|
+
* Optional avatar image `alt` text for the user.
|
|
1419
1428
|
*/
|
|
1420
1429
|
avatarAltText?: string;
|
|
1421
1430
|
}
|