@aws/mynah-ui 4.17.1 → 4.18.1-beta.1
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/components/background.d.ts +10 -0
- package/dist/components/button.d.ts +4 -3
- package/dist/components/card/card-body.d.ts +1 -1
- package/dist/components/chat-item/chat-item-buttons.d.ts +1 -1
- package/dist/components/chat-item/chat-item-card-content.d.ts +2 -2
- package/dist/components/chat-item/chat-item-card.d.ts +4 -1
- package/dist/components/chat-item/chat-item-information-card.d.ts +3 -1
- package/dist/components/chat-item/chat-item-tabbed-card.d.ts +17 -0
- package/dist/components/chat-item/chat-item-tree-file.d.ts +1 -0
- package/dist/components/chat-item/chat-prompt-input.d.ts +3 -1
- package/dist/components/chat-item/chat-wrapper.d.ts +4 -0
- package/dist/components/chat-item/prompt-input/prompt-text-input.d.ts +1 -0
- package/dist/components/icon.d.ts +1 -0
- package/dist/components/syntax-highlighter.d.ts +0 -21
- package/dist/components/title-description-with-icon.d.ts +20 -0
- package/dist/helper/chat-item.d.ts +2 -1
- package/dist/helper/dom.d.ts +1 -1
- package/dist/helper/test-ids.d.ts +5 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +52 -13
- package/docs/CONFIG.md +11 -0
- package/docs/DATAMODEL.md +354 -32
- package/docs/img/data-model/chatItems/actions.png +0 -0
- package/docs/img/data-model/chatItems/buttonFlash.png +0 -0
- package/docs/img/data-model/chatItems/confirmationButtons.png +0 -0
- package/docs/img/data-model/chatItems/hoverEffect.png +0 -0
- package/docs/img/data-model/chatItems/tabbed-card.png +0 -0
- package/docs/img/data-model/tabStore/compactMode.png +0 -0
- package/docs/img/data-model/tabStore/promptInputLabel.png +0 -0
- package/docs/img/data-model/tabStore/promptInputText.png +0 -0
- package/docs/img/data-model/tabStore/promptInputVisible.png +0 -0
- package/docs/img/data-model/tabStore/tabBackground.png +0 -0
- package/docs/img/data-model/tabStore/tabHeaderDetails.png +0 -0
- package/docs/img/data-model/tabStore/tabHeaderDetails2.png +0 -0
- package/docs/img/texts/commandConfirmation.png +0 -0
- package/package.json +1 -1
- package/ui-tests/dist/main.js +5 -1
- package/ui-tests/dist/main.js.map +1 -1
package/dist/static.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { MynahIcons } from './components/icon';
|
|
6
6
|
import { ChatItemBodyRenderer } from './helper/dom';
|
|
7
|
-
import { SelectAbstract, SelectProps, RadioGroupAbstract, RadioGroupProps, ButtonAbstract, ButtonProps, TextInputProps, TextInputAbstract, TextAreaProps, TextAreaAbstract } from './main';
|
|
7
|
+
import { SelectAbstract, SelectProps, RadioGroupAbstract, RadioGroupProps, ButtonAbstract, ButtonProps, TextInputProps, TextInputAbstract, TextAreaProps, TextAreaAbstract, ToggleOption } from './main';
|
|
8
8
|
export interface QuickActionCommand {
|
|
9
9
|
command: string;
|
|
10
10
|
disabled?: boolean;
|
|
@@ -24,6 +24,10 @@ export interface MynahUIDataModel {
|
|
|
24
24
|
* Tab title
|
|
25
25
|
* */
|
|
26
26
|
tabTitle?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Tab title
|
|
29
|
+
* */
|
|
30
|
+
tabBackground?: boolean;
|
|
27
31
|
/**
|
|
28
32
|
* If tab is running an action (loadingChat = true) this markdown will be shown before close in a popup
|
|
29
33
|
*/
|
|
@@ -61,6 +65,18 @@ export interface MynahUIDataModel {
|
|
|
61
65
|
*/
|
|
62
66
|
promptInputPlaceholder?: string;
|
|
63
67
|
/**
|
|
68
|
+
* Prompt input text
|
|
69
|
+
*/
|
|
70
|
+
promptInputText?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Label to be shown on top of the prompt input
|
|
73
|
+
*/
|
|
74
|
+
promptInputLabel?: string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Label to be shown on top of the prompt input
|
|
77
|
+
*/
|
|
78
|
+
promptInputVisible?: boolean;
|
|
79
|
+
/**
|
|
64
80
|
* Info block to be shown under prompt input
|
|
65
81
|
*/
|
|
66
82
|
promptInputInfo?: string;
|
|
@@ -88,6 +104,14 @@ export interface MynahUIDataModel {
|
|
|
88
104
|
* Tab bar buttons next to the tab items
|
|
89
105
|
*/
|
|
90
106
|
tabBarButtons?: TabBarMainAction[];
|
|
107
|
+
/**
|
|
108
|
+
* Tab content compact mode which keeps everything in the middle
|
|
109
|
+
*/
|
|
110
|
+
compactMode?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Tab content header details, only visibile when showTabHeaderDetails is set to 'true'
|
|
113
|
+
*/
|
|
114
|
+
tabHeaderDetails?: TabHeaderDetails | null;
|
|
91
115
|
}
|
|
92
116
|
export interface MynahUITabStoreTab {
|
|
93
117
|
/**
|
|
@@ -120,6 +144,7 @@ export declare enum MynahEventNames {
|
|
|
120
144
|
CHAT_ITEM_ADD = "chatItemAdd",
|
|
121
145
|
FOLLOW_UP_CLICKED = "followUpClicked",
|
|
122
146
|
BODY_ACTION_CLICKED = "bodyActionClicked",
|
|
147
|
+
TABBED_CONTENT_SWITCH = "tabbedContentSwitch",
|
|
123
148
|
SHOW_MORE_WEB_RESULTS_CLICK = "showMoreWebResultsClick",
|
|
124
149
|
SHOW_FEEDBACK_FORM = "showFeedbackForm",
|
|
125
150
|
FILE_CLICK = "fileClick",
|
|
@@ -192,19 +217,20 @@ export interface TreeNodeDetails {
|
|
|
192
217
|
icon?: MynahIcons;
|
|
193
218
|
label?: string;
|
|
194
219
|
description?: string;
|
|
220
|
+
clickable?: boolean;
|
|
195
221
|
}
|
|
196
222
|
export interface ChatItemContent {
|
|
197
|
-
body?: string;
|
|
198
|
-
customRenderer?: string | ChatItemBodyRenderer | ChatItemBodyRenderer[];
|
|
223
|
+
body?: string | null;
|
|
224
|
+
customRenderer?: string | ChatItemBodyRenderer | ChatItemBodyRenderer[] | null;
|
|
199
225
|
followUp?: {
|
|
200
226
|
text?: string;
|
|
201
227
|
options?: ChatItemAction[];
|
|
202
|
-
};
|
|
228
|
+
} | null;
|
|
203
229
|
relatedContent?: {
|
|
204
230
|
title?: string;
|
|
205
231
|
content: SourceLink[];
|
|
206
|
-
};
|
|
207
|
-
codeReference?: ReferenceTrackerInformation[];
|
|
232
|
+
} | null;
|
|
233
|
+
codeReference?: ReferenceTrackerInformation[] | null;
|
|
208
234
|
fileList?: {
|
|
209
235
|
fileTreeTitle?: string;
|
|
210
236
|
rootFolderTitle?: string;
|
|
@@ -212,10 +238,10 @@ export interface ChatItemContent {
|
|
|
212
238
|
deletedFiles?: string[];
|
|
213
239
|
actions?: Record<string, FileNodeAction[]>;
|
|
214
240
|
details?: Record<string, TreeNodeDetails>;
|
|
215
|
-
};
|
|
216
|
-
buttons?: ChatItemButton[];
|
|
217
|
-
formItems?: ChatItemFormItem[];
|
|
218
|
-
footer?: ChatItemContent;
|
|
241
|
+
} | null;
|
|
242
|
+
buttons?: ChatItemButton[] | null;
|
|
243
|
+
formItems?: ChatItemFormItem[] | null;
|
|
244
|
+
footer?: ChatItemContent | null;
|
|
219
245
|
informationCard?: {
|
|
220
246
|
title?: string;
|
|
221
247
|
status?: {
|
|
@@ -226,8 +252,11 @@ export interface ChatItemContent {
|
|
|
226
252
|
description?: string;
|
|
227
253
|
icon?: MynahIcons;
|
|
228
254
|
content: ChatItemContent;
|
|
229
|
-
};
|
|
230
|
-
|
|
255
|
+
} | null;
|
|
256
|
+
tabbedContent?: Array<ToggleOption & {
|
|
257
|
+
content: ChatItemContent;
|
|
258
|
+
}> | null;
|
|
259
|
+
codeBlockActions?: CodeBlockActions | null;
|
|
231
260
|
}
|
|
232
261
|
export interface ChatItem extends ChatItemContent {
|
|
233
262
|
type: ChatItemType;
|
|
@@ -235,6 +264,7 @@ export interface ChatItem extends ChatItemContent {
|
|
|
235
264
|
snapToTop?: boolean;
|
|
236
265
|
canBeVoted?: boolean;
|
|
237
266
|
icon?: MynahIcons;
|
|
267
|
+
hoverEffect?: boolean;
|
|
238
268
|
status?: Status;
|
|
239
269
|
}
|
|
240
270
|
export interface ChatItemFormItem {
|
|
@@ -270,8 +300,10 @@ export interface ChatItemButton {
|
|
|
270
300
|
id: string;
|
|
271
301
|
disabled?: boolean;
|
|
272
302
|
description?: string;
|
|
273
|
-
status?: 'primary' | Status;
|
|
303
|
+
status?: 'main' | 'primary' | 'clear' | Status;
|
|
304
|
+
flash?: 'infinite' | 'once';
|
|
274
305
|
icon?: MynahIcons;
|
|
306
|
+
position?: 'inside' | 'outside';
|
|
275
307
|
}
|
|
276
308
|
export interface TabBarAction {
|
|
277
309
|
text?: string;
|
|
@@ -382,12 +414,18 @@ export declare enum NotificationType {
|
|
|
382
414
|
WARNING = "warning",
|
|
383
415
|
ERROR = "error"
|
|
384
416
|
}
|
|
417
|
+
export interface TabHeaderDetails {
|
|
418
|
+
icon?: MynahIcons;
|
|
419
|
+
title?: string;
|
|
420
|
+
description?: string;
|
|
421
|
+
}
|
|
385
422
|
export interface CodeBlockAction {
|
|
386
423
|
id: 'copy' | 'insert-to-cursor' | string;
|
|
387
424
|
label: string;
|
|
388
425
|
description?: string;
|
|
389
426
|
icon?: MynahIcons;
|
|
390
427
|
data?: any;
|
|
428
|
+
flash?: 'infinite' | 'once';
|
|
391
429
|
acceptedLanguages?: string[];
|
|
392
430
|
}
|
|
393
431
|
export type CodeBlockActions = Record<'copy' | 'insert-to-cursor' | string, CodeBlockAction | undefined | null>;
|
|
@@ -419,6 +457,7 @@ export interface ConfigTexts {
|
|
|
419
457
|
tabCloseConfirmationCloseButton: string;
|
|
420
458
|
noTabsOpen: string;
|
|
421
459
|
openNewTab: string;
|
|
460
|
+
commandConfirmation: string;
|
|
422
461
|
}
|
|
423
462
|
type PickMatching<T, V> = {
|
|
424
463
|
[K in keyof T as T[K] extends V ? K : never]: T[K];
|
package/docs/CONFIG.md
CHANGED
|
@@ -35,6 +35,7 @@ interface ConfigModel {
|
|
|
35
35
|
tabCloseConfirmationCloseButton?: string;
|
|
36
36
|
noTabsOpen: string; // Supports markdown
|
|
37
37
|
openNewTab: string;
|
|
38
|
+
commandConfirmation: string;
|
|
38
39
|
};
|
|
39
40
|
// Options to show up on the overlay feedback form
|
|
40
41
|
// after user clicks to downvote on a chat item
|
|
@@ -202,6 +203,13 @@ Default tab title text if it is not set through store data for that tab.
|
|
|
202
203
|
|
|
203
204
|
---
|
|
204
205
|
|
|
206
|
+
## commandConfirmation
|
|
207
|
+
<p align="center">
|
|
208
|
+
<img src="./img/texts/commandConfirmation.png" alt="commandConfirmation" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
209
|
+
</p>
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
205
213
|
<p><br/></p>
|
|
206
214
|
|
|
207
215
|
# `feedbackOptions`
|
|
@@ -321,6 +329,9 @@ With this parameter, you can add global code block actions to the code blocks. B
|
|
|
321
329
|
### Note
|
|
322
330
|
If you want to show that action only for certain coding languages, you can set the array for `acceptedLanguages` parameter. Keep in mind that it will check an exact mathc. If the incoming language is same with one of the acceptedLanguages list, it will show the action.
|
|
323
331
|
|
|
332
|
+
#### flash
|
|
333
|
+
You can also make the code block actions flash once or foverer when user hovers the the containing card. Until user hovers to the action itself, whenever they hover to the card it will flash the code block action. It you set it to `once` it will only flash once for every hover to the container card, if you set it to `infinite` it will keep flashing forever every 3 seconds until user hovers to the action itself. Whe user hovers to the action, it will not flash again.
|
|
334
|
+
|
|
324
335
|
#### By default, we add `copy` and `insert to cursor position` ones:
|
|
325
336
|
|
|
326
337
|
```typescript
|