@aws/mynah-ui 4.12.0 → 4.14.0
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/button.d.ts +8 -6
- package/dist/components/card/card-body.d.ts +5 -7
- package/dist/components/card/card.d.ts +2 -1
- package/dist/components/chat-item/chat-item-buttons.d.ts +1 -1
- package/dist/components/chat-item/chat-item-card-content.d.ts +36 -0
- package/dist/components/chat-item/chat-item-card.d.ts +20 -18
- package/dist/components/chat-item/chat-item-form-items.d.ts +1 -0
- package/dist/components/chat-item/chat-item-relevance-vote.d.ts +1 -0
- package/dist/components/chat-item/chat-item-tree-view-wrapper.d.ts +1 -0
- package/dist/components/chat-item/chat-wrapper.d.ts +3 -0
- package/dist/components/chat-item/prompt-input/prompt-text-input.d.ts +2 -0
- package/dist/components/chat-item/prompt-input/send-button.d.ts +4 -5
- package/dist/components/collapsible-content.d.ts +1 -0
- package/dist/components/feedback-form/feedback-form.d.ts +1 -0
- package/dist/components/form-items/radio-group.d.ts +15 -1
- package/dist/components/form-items/select.d.ts +16 -1
- package/dist/components/form-items/stars.d.ts +1 -0
- package/dist/components/form-items/text-area.d.ts +15 -1
- package/dist/components/form-items/text-input.d.ts +16 -2
- package/dist/components/icon.d.ts +5 -1
- package/dist/components/navigation-tabs.d.ts +1 -0
- package/dist/components/no-tabs.d.ts +1 -0
- package/dist/components/notification.d.ts +1 -0
- package/dist/components/overlay.d.ts +1 -0
- package/dist/components/syntax-highlighter.d.ts +6 -4
- package/dist/components/toggle.d.ts +1 -0
- package/dist/helper/chat-item.d.ts +1 -0
- package/dist/helper/config.d.ts +2 -1
- package/dist/helper/dom.d.ts +2 -0
- package/dist/main.d.ts +19 -4
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +38 -12
- package/docs/CONFIG.md +350 -0
- package/docs/DATAMODEL.md +2146 -0
- package/docs/DEVELOPER.md +499 -0
- package/docs/PROPERTIES.md +863 -0
- package/docs/STARTUP.md +51 -0
- package/docs/STYLING.md +195 -0
- package/docs/USAGE.md +502 -0
- package/docs/img/code-attachment.png +0 -0
- package/docs/img/customForm.png +0 -0
- package/docs/img/data-model/chatItems/actions.png +0 -0
- package/docs/img/data-model/chatItems/answer.png +0 -0
- package/docs/img/data-model/chatItems/answerStream.png +0 -0
- package/docs/img/data-model/chatItems/body.png +0 -0
- package/docs/img/data-model/chatItems/canBeVoted.png +0 -0
- package/docs/img/data-model/chatItems/codeBlockActions.png +0 -0
- package/docs/img/data-model/chatItems/codeInsertAndCopyButtons.png +0 -0
- package/docs/img/data-model/chatItems/codeInsertAndCopyButtonsThroughConfig.png +0 -0
- package/docs/img/data-model/chatItems/codeReference-1.png +0 -0
- package/docs/img/data-model/chatItems/codeReference-2.png +0 -0
- package/docs/img/data-model/chatItems/codeResult.png +0 -0
- package/docs/img/data-model/chatItems/customRenderer_html.png +0 -0
- package/docs/img/data-model/chatItems/customRenderer_json.png +0 -0
- package/docs/img/data-model/chatItems/followUp-1.png +0 -0
- package/docs/img/data-model/chatItems/followUp-2.png +0 -0
- package/docs/img/data-model/chatItems/footer.png +0 -0
- package/docs/img/data-model/chatItems/footer2.png +0 -0
- package/docs/img/data-model/chatItems/icon.png +0 -0
- package/docs/img/data-model/chatItems/notification-1.png +0 -0
- package/docs/img/data-model/chatItems/notification-2.png +0 -0
- package/docs/img/data-model/chatItems/notification-3.png +0 -0
- package/docs/img/data-model/chatItems/notification-4.png +0 -0
- package/docs/img/data-model/chatItems/options-all-filled.png +0 -0
- package/docs/img/data-model/chatItems/options-mandatory-filled.png +0 -0
- package/docs/img/data-model/chatItems/options-submitted.png +0 -0
- package/docs/img/data-model/chatItems/options.png +0 -0
- package/docs/img/data-model/chatItems/prompt.png +0 -0
- package/docs/img/data-model/chatItems/relatedContent-1.png +0 -0
- package/docs/img/data-model/chatItems/relatedContent-2.png +0 -0
- package/docs/img/data-model/chatItems/relatedContent-3.png +0 -0
- package/docs/img/data-model/chatItems/status.png +0 -0
- package/docs/img/data-model/chatItems/systemPrompt.png +0 -0
- package/docs/img/data-model/tabStore/contextCommands.png +0 -0
- package/docs/img/data-model/tabStore/loadingChat-1.png +0 -0
- package/docs/img/data-model/tabStore/loadingChat-2.png +0 -0
- package/docs/img/data-model/tabStore/promptInputDisabledState.png +0 -0
- package/docs/img/data-model/tabStore/promptInputPlaceholder.png +0 -0
- package/docs/img/data-model/tabStore/promptInputStickyCard.png +0 -0
- package/docs/img/data-model/tabStore/quickActionCommands.png +0 -0
- package/docs/img/data-model/tabStore/selectedCodeSnippet.png +0 -0
- package/docs/img/data-model/tabStore/stopChatResponse.png +0 -0
- package/docs/img/data-model/tabStore/tabBarButtons1.png +0 -0
- package/docs/img/data-model/tabStore/tabBarButtons2.png +0 -0
- package/docs/img/data-model/tabStore/tabTitle.png +0 -0
- package/docs/img/developer/comp0.png +0 -0
- package/docs/img/developer/comp1.png +0 -0
- package/docs/img/developer/comp2.png +0 -0
- package/docs/img/feedbackOptions.png +0 -0
- package/docs/img/maxTabs1.png +0 -0
- package/docs/img/noPrompt.png +0 -0
- package/docs/img/notification.png +0 -0
- package/docs/img/onBeforeTabRemove.png +0 -0
- package/docs/img/onBodyActionClicked.png +0 -0
- package/docs/img/onChatItemEngagement.png +0 -0
- package/docs/img/onChatPrompt.png +0 -0
- package/docs/img/onCodeInsertToCursorPosition.png +0 -0
- package/docs/img/onCopyCodeToClipboard.png +0 -0
- package/docs/img/onCustomFormAction.png +0 -0
- package/docs/img/onFileActionClick.png +0 -0
- package/docs/img/onFollowupClicked.png +0 -0
- package/docs/img/onInfoLinkClick.png +0 -0
- package/docs/img/onLinkClick.png +0 -0
- package/docs/img/onOpenDiff.png +0 -0
- package/docs/img/onSendFeedback-1.png +0 -0
- package/docs/img/onSendFeedback-2.png +0 -0
- package/docs/img/onSendFeedback-3.png +0 -0
- package/docs/img/onShowMoreClick.png +0 -0
- package/docs/img/onSourceLinkClick.png +0 -0
- package/docs/img/onStopChatResponse.png +0 -0
- package/docs/img/onTabAdd.png +0 -0
- package/docs/img/onTabChange.png +0 -0
- package/docs/img/onTabRemove.png +0 -0
- package/docs/img/onVote.png +0 -0
- package/docs/img/prompt-with-code-attached.png +0 -0
- package/docs/img/splash.gif +0 -0
- package/docs/img/texts/codeFileSuggestions.png +0 -0
- package/docs/img/texts/copyInsertToCursor.png +0 -0
- package/docs/img/texts/feedbackForm.png +0 -0
- package/docs/img/texts/fileTreeTitle.png +0 -0
- package/docs/img/texts/mainTitle.png +0 -0
- package/docs/img/texts/noMoreTabs.png +0 -0
- package/docs/img/texts/noTabsOpen.png +0 -0
- package/docs/img/texts/pleaseSelect.png +0 -0
- package/docs/img/texts/spinnerText.png +0 -0
- package/docs/img/texts/stopGenerating.png +0 -0
- package/docs/img/texts/tabCloseConfirmation.png +0 -0
- package/docs/img/texts/voteAndSourceActions.png +0 -0
- package/docs/img/theming-1.png +0 -0
- package/docs/img/theming-2.png +0 -0
- package/package.json +2 -2
- package/postinstall.js +4 -2
- package/dist/__test__/main.spec.d.ts +0 -1
- package/dist/components/__test__/button.spec.d.ts +0 -1
- package/dist/components/__test__/chat-item/chat-item-followup.spec.d.ts +0 -1
- package/dist/components/__test__/chat-item/chat-prompt-input.spec.d.ts +0 -1
- package/dist/components/__test__/feedback-form/feedback-form.spec.d.ts +0 -1
- package/dist/components/__test__/notification.spec.d.ts +0 -1
- package/dist/components/__test__/syntax-highlighter.spec.d.ts +0 -1
- package/dist/components/__test__/toggle.spec.d.ts +0 -1
- package/dist/helper/__test__/date-time.spec.d.ts +0 -1
- package/dist/helper/__test__/dom.spec.d.ts +0 -1
- package/dist/helper/__test__/events.spec.d.ts +0 -1
- package/dist/helper/__test__/file-tree.spec.d.ts +0 -1
package/dist/static.d.ts
CHANGED
|
@@ -4,6 +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
8
|
export interface QuickActionCommand {
|
|
8
9
|
command: string;
|
|
9
10
|
disabled?: boolean;
|
|
@@ -108,7 +109,7 @@ export declare enum MynahEventNames {
|
|
|
108
109
|
LINK_CLICK = "linkClick",
|
|
109
110
|
CHAT_ITEM_ENGAGEMENT = "chatItemEngagement",
|
|
110
111
|
COPY_CODE_TO_CLIPBOARD = "copyCodeToClipboard",
|
|
111
|
-
|
|
112
|
+
CODE_BLOCK_ACTION = "codeBlockAction",
|
|
112
113
|
CHAT_PROMPT = "chatPrompt",
|
|
113
114
|
CHAT_ITEM_ADD = "chatItemAdd",
|
|
114
115
|
FOLLOW_UP_CLICKED = "followUpClicked",
|
|
@@ -162,15 +163,9 @@ export interface TreeNodeDetails {
|
|
|
162
163
|
label?: string;
|
|
163
164
|
description?: string;
|
|
164
165
|
}
|
|
165
|
-
export interface
|
|
166
|
-
type: ChatItemType;
|
|
166
|
+
export interface ChatItemContent {
|
|
167
167
|
body?: string;
|
|
168
168
|
customRenderer?: string | ChatItemBodyRenderer | ChatItemBodyRenderer[];
|
|
169
|
-
messageId?: string;
|
|
170
|
-
snapToTop?: boolean;
|
|
171
|
-
canBeVoted?: boolean;
|
|
172
|
-
codeInsertToCursorEnabled?: boolean;
|
|
173
|
-
codeCopyToClipboardEnabled?: boolean;
|
|
174
169
|
followUp?: {
|
|
175
170
|
text?: string;
|
|
176
171
|
options?: ChatItemAction[];
|
|
@@ -188,14 +183,22 @@ export interface ChatItem {
|
|
|
188
183
|
actions?: Record<string, FileNodeAction[]>;
|
|
189
184
|
details?: Record<string, TreeNodeDetails>;
|
|
190
185
|
};
|
|
191
|
-
icon?: MynahIcons;
|
|
192
|
-
status?: 'info' | 'success' | 'warning' | 'error';
|
|
193
186
|
buttons?: ChatItemButton[];
|
|
194
187
|
formItems?: ChatItemFormItem[];
|
|
188
|
+
footer?: ChatItemContent;
|
|
189
|
+
codeBlockActions?: CodeBlockActions;
|
|
190
|
+
}
|
|
191
|
+
export interface ChatItem extends ChatItemContent {
|
|
192
|
+
type: ChatItemType;
|
|
193
|
+
messageId?: string;
|
|
194
|
+
snapToTop?: boolean;
|
|
195
|
+
canBeVoted?: boolean;
|
|
196
|
+
icon?: MynahIcons;
|
|
197
|
+
status?: 'info' | 'success' | 'warning' | 'error';
|
|
195
198
|
}
|
|
196
199
|
export interface ChatItemFormItem {
|
|
197
200
|
id: string;
|
|
198
|
-
type: 'select' | 'textarea' | 'textinput' | 'numericinput' | 'stars' | 'radiogroup';
|
|
201
|
+
type: 'select' | 'textarea' | 'textinput' | 'numericinput' | 'stars' | 'radiogroup' | 'email';
|
|
199
202
|
mandatory?: boolean;
|
|
200
203
|
title?: string;
|
|
201
204
|
placeholder?: string;
|
|
@@ -283,7 +286,7 @@ export interface ReferenceTrackerInformation {
|
|
|
283
286
|
}
|
|
284
287
|
export type CodeSelectionType = 'selection' | 'block';
|
|
285
288
|
export type OnCopiedToClipboardFunction = (type?: CodeSelectionType, text?: string, referenceTrackerInformation?: ReferenceTrackerInformation[], codeBlockIndex?: number, totalCodeBlocks?: number) => void;
|
|
286
|
-
export type
|
|
289
|
+
export type OnCodeBlockActionFunction = (actionId: string, data?: any, type?: CodeSelectionType, text?: string, referenceTrackerInformation?: ReferenceTrackerInformation[], codeBlockIndex?: number, totalCodeBlocks?: number) => void;
|
|
287
290
|
export declare enum RelevancyVoteType {
|
|
288
291
|
UP = "upvote",
|
|
289
292
|
DOWN = "downvote"
|
|
@@ -338,6 +341,15 @@ export declare enum NotificationType {
|
|
|
338
341
|
WARNING = "warning",
|
|
339
342
|
ERROR = "error"
|
|
340
343
|
}
|
|
344
|
+
export interface CodeBlockAction {
|
|
345
|
+
id: 'copy' | 'insert-to-cursor' | string;
|
|
346
|
+
label: string;
|
|
347
|
+
description?: string;
|
|
348
|
+
icon?: MynahIcons;
|
|
349
|
+
data?: any;
|
|
350
|
+
acceptedLanguages?: string[];
|
|
351
|
+
}
|
|
352
|
+
export type CodeBlockActions = Record<'copy' | 'insert-to-cursor' | string, CodeBlockAction | undefined | null>;
|
|
341
353
|
export interface ConfigTexts {
|
|
342
354
|
mainTitle: string;
|
|
343
355
|
feedbackFormTitle: string;
|
|
@@ -367,6 +379,17 @@ export interface ConfigTexts {
|
|
|
367
379
|
noTabsOpen: string;
|
|
368
380
|
openNewTab: string;
|
|
369
381
|
}
|
|
382
|
+
type PickMatching<T, V> = {
|
|
383
|
+
[K in keyof T as T[K] extends V ? K : never]: T[K];
|
|
384
|
+
};
|
|
385
|
+
type ExtractMethods<T> = PickMatching<T, any>;
|
|
386
|
+
export interface ComponentOverrides {
|
|
387
|
+
Button?: new (props: ButtonProps) => ExtractMethods<ButtonAbstract>;
|
|
388
|
+
RadioGroup?: new (props: RadioGroupProps) => ExtractMethods<RadioGroupAbstract>;
|
|
389
|
+
Select?: new (props: SelectProps) => ExtractMethods<SelectAbstract>;
|
|
390
|
+
TextInput?: new (props: TextInputProps) => ExtractMethods<TextInputAbstract>;
|
|
391
|
+
TextArea?: new (props: TextAreaProps) => ExtractMethods<TextAreaAbstract>;
|
|
392
|
+
}
|
|
370
393
|
export interface ConfigOptions {
|
|
371
394
|
feedbackOptions: Array<{
|
|
372
395
|
label: string;
|
|
@@ -377,12 +400,15 @@ export interface ConfigOptions {
|
|
|
377
400
|
showPromptField: boolean;
|
|
378
401
|
autoFocus: boolean;
|
|
379
402
|
maxUserInput: number;
|
|
403
|
+
codeBlockActions?: CodeBlockActions;
|
|
380
404
|
codeInsertToCursorEnabled?: boolean;
|
|
381
405
|
codeCopyToClipboardEnabled?: boolean;
|
|
382
406
|
}
|
|
383
407
|
export interface ConfigModel extends ConfigOptions {
|
|
384
408
|
texts: Partial<ConfigTexts>;
|
|
409
|
+
componentOverrides: Partial<ComponentOverrides>;
|
|
385
410
|
}
|
|
386
411
|
export interface CardRenderDetails {
|
|
387
412
|
totalNumberOfCodeBlocks?: number;
|
|
388
413
|
}
|
|
414
|
+
export {};
|
package/docs/CONFIG.md
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
# MynahUI Config
|
|
2
|
+
|
|
3
|
+
You can set the config from the constructor parameters while creating a new instance of `mynah-ui`.
|
|
4
|
+
|
|
5
|
+
_**Note:** You cannot set it on runtime. It is getting used just once during the initialization._
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
...
|
|
9
|
+
interface ConfigModel {
|
|
10
|
+
// Do not forget that you have to provide all of them
|
|
11
|
+
// Config allows partial set of texts
|
|
12
|
+
texts: {
|
|
13
|
+
mainTitle?: string;
|
|
14
|
+
feedbackFormTitle?: string;
|
|
15
|
+
feedbackFormOptionsLabel?: string;
|
|
16
|
+
feedbackFormCommentLabel?: string;
|
|
17
|
+
feedbackThanks?: string;
|
|
18
|
+
feedbackReportButtonLabel?: string;
|
|
19
|
+
codeSuggestions?: string;
|
|
20
|
+
files?: string;
|
|
21
|
+
insertAtCursorLabel?: string;
|
|
22
|
+
copy?: string;
|
|
23
|
+
showMore?: string;
|
|
24
|
+
save?: string;
|
|
25
|
+
cancel?: string;
|
|
26
|
+
submit?: string;
|
|
27
|
+
pleaseSelect?: string;
|
|
28
|
+
stopGenerating?: string;
|
|
29
|
+
copyToClipboard?: string;
|
|
30
|
+
noMoreTabsTooltip?: string;
|
|
31
|
+
codeSuggestionWithReferenceTitle?: string;
|
|
32
|
+
spinnerText?: string;
|
|
33
|
+
tabCloseConfirmationMessage?: string;
|
|
34
|
+
tabCloseConfirmationKeepButton?: string;
|
|
35
|
+
tabCloseConfirmationCloseButton?: string;
|
|
36
|
+
noTabsOpen: string; // Supports markdown
|
|
37
|
+
openNewTab: string;
|
|
38
|
+
};
|
|
39
|
+
// Options to show up on the overlay feedback form
|
|
40
|
+
// after user clicks to downvote on a chat item
|
|
41
|
+
// and clicks 'Report' again
|
|
42
|
+
feedbackOptions: Array<{
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}>;
|
|
46
|
+
tabBarButtons?: TabBarMainAction[]; // Tab bar buttons will be shown on the right of the tab
|
|
47
|
+
maxUserInput: number; // max number of chars for the input field
|
|
48
|
+
codeInsertToCursorEnabled?: boolean; // show or hide copy buttons on code blocks system wide
|
|
49
|
+
codeCopyToClipboardEnabled?: boolean; // show or hide insert to cursor buttons on code blocks system wide
|
|
50
|
+
autoFocus: boolean; // auto focuses to input panel after every action
|
|
51
|
+
maxTabs: number; // set 1 to hide tabs panel
|
|
52
|
+
showPromptField: boolean; // shows prompt field (default: true)
|
|
53
|
+
}
|
|
54
|
+
...
|
|
55
|
+
```
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
<p><br/></p>
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# `tabBarButtons`
|
|
62
|
+
|
|
63
|
+
You can put buttons on the right of the tab bar also with some inner buttons inside a menu. You can do it in two different ways. If you want the buttons globally available for every tab you can use the `tabBarButtons` in the config. If you want them set individually for different tabs check the **[DATAMODEL Documentation](./DATAMODEL.md#tabbarbuttons)**.
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
const mynahUI = new MynahUI({
|
|
67
|
+
...
|
|
68
|
+
config: {
|
|
69
|
+
...
|
|
70
|
+
tabBarButtons: [
|
|
71
|
+
{
|
|
72
|
+
id: 'clear',
|
|
73
|
+
description: 'Clear messages in this tab',
|
|
74
|
+
icon: MynahIcons.REFRESH,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'multi',
|
|
78
|
+
icon: MynahIcons.ELLIPSIS,
|
|
79
|
+
items: [
|
|
80
|
+
{
|
|
81
|
+
id: 'menu-action-1',
|
|
82
|
+
text: 'Menu action 1!',
|
|
83
|
+
icon: MynahIcons.CHAT,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'menu-action-2',
|
|
87
|
+
text: 'Menu action 2!',
|
|
88
|
+
icon: MynahIcons.CODE_BLOCK,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'menu-action-3',
|
|
92
|
+
text: 'Menu action 3!'
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
...
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
<p align="center">
|
|
103
|
+
<img src="./img/data-model/tabStore/tabBarButtons1.png" alt="mainTitle" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
104
|
+
<br/>
|
|
105
|
+
<img src="./img/data-model/tabStore/tabBarButtons2.png" alt="mainTitle" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
106
|
+
</p>
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# `texts`
|
|
113
|
+
All static texts will be shown on UI.
|
|
114
|
+
Please take a look at each image to identify which text blongs to which item on UI.
|
|
115
|
+
|
|
116
|
+
## mainTitle
|
|
117
|
+
Default tab title text if it is not set through store data for that tab.
|
|
118
|
+
|
|
119
|
+
<p align="center">
|
|
120
|
+
<img src="./img/texts/mainTitle.png" alt="mainTitle" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
121
|
+
</p>
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## feedbackFormTitle, feedbackFormOptionsLabel, feedbackFormCommentLabel, submit, cancel
|
|
126
|
+
<p align="center">
|
|
127
|
+
<img src="./img/texts/feedbackForm.png" alt="feedbackForm" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
128
|
+
</p>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## fileTreeTitle, rootFolderTitle, feedbackFormCommentLabel, submit, cancel
|
|
134
|
+
<p align="center">
|
|
135
|
+
<img src="./img/texts/fileTreeTitle.png" alt="fileTree" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
136
|
+
</p>
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## pleaseSelect
|
|
142
|
+
<p align="center">
|
|
143
|
+
<img src="./img/texts/pleaseSelect.png" alt="feedbackForm" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
144
|
+
</p>
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## feedbackThanks, feedbackReportButtonLabel, showMore
|
|
149
|
+
<p align="center">
|
|
150
|
+
<img src="./img/texts/voteAndSourceActions.png" alt="voteAndSourceActions" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
151
|
+
</p>
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## stopGenerating
|
|
156
|
+
<p align="center">
|
|
157
|
+
<img src="./img/texts/stopGenerating.png" alt="stopGenerating" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
158
|
+
</p>
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## insertAtCursorLabel, copy
|
|
163
|
+
<p align="center">
|
|
164
|
+
<img src="./img/texts/copyInsertToCursor.png" alt="copyInsertToCursor" style="border-radius: 10px; max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
165
|
+
</p>
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## codeSuggestions, files, codeSuggestionWithReferenceTitle
|
|
170
|
+
<p align="center">
|
|
171
|
+
<img src="./img/texts/codeFileSuggestions.png" alt="codeFileSuggestions" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
172
|
+
</p>
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## spinnerText
|
|
177
|
+
<p align="center">
|
|
178
|
+
<img src="./img/texts/spinnerText.png" alt="spinnerText" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
179
|
+
</p>
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## tabCloseConfirmationMessage, tabCloseConfirmationKeepButton, tabCloseConfirmationCloseButton
|
|
184
|
+
<p align="center">
|
|
185
|
+
<img src="./img/texts/tabCloseConfirmation.png" alt="tabCloseConfirmation" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
186
|
+
</p>
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## noMoreTabsTooltip
|
|
191
|
+
<p align="center">
|
|
192
|
+
<img src="./img/texts/noMoreTabs.png" alt="noMoreTabsTooltip" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
193
|
+
</p>
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## noTabsOpen, openNewTab
|
|
198
|
+
<p align="center">
|
|
199
|
+
<img src="./img/texts/noTabsOpen.png" alt="noTabsOpen" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
200
|
+
</p>
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
<p><br/></p>
|
|
205
|
+
|
|
206
|
+
# `feedbackOptions`
|
|
207
|
+
|
|
208
|
+
Feedback type options to be shown on feedback form.
|
|
209
|
+
defaults:
|
|
210
|
+
```typescript
|
|
211
|
+
...
|
|
212
|
+
feedbackOptions: [
|
|
213
|
+
{
|
|
214
|
+
value: 'inaccurate-response',
|
|
215
|
+
label: 'Inaccurate response',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
value: 'harmful-content',
|
|
219
|
+
label: 'Harmful content'
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
value: 'overlap',
|
|
223
|
+
label: 'Overlaps with existing content'
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
value: 'incorrect-syntax',
|
|
227
|
+
label: 'Incorrect syntax'
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
value: 'buggy-code',
|
|
231
|
+
label: 'Buggy code'
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
value: 'low-quality',
|
|
235
|
+
label: 'Low quality'
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
value: 'other',
|
|
239
|
+
label: 'Other'
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
...
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
<p align="center">
|
|
246
|
+
<img src="./img/feedbackOptions.png" alt="feedbackOptions" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
247
|
+
</p>
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
<p><br/></p>
|
|
252
|
+
|
|
253
|
+
# `maxTabs`
|
|
254
|
+
Maximum number of tabs user/system can open in a single instance of `mynah-ui`.
|
|
255
|
+
|
|
256
|
+
default: `1000`
|
|
257
|
+
|
|
258
|
+
An important note here is that if you provide **`1`** to maxTabs, it will not show the tab bar at all. However you still need to add a tab then initially to show a content.
|
|
259
|
+
|
|
260
|
+
And finally, if you try to add tabs more than given `maxTabs` amount while initializing the MynahUI with [Constructor Properties](./PROPERTIES.md), it will only generate the tabs till it reaches the `maxTabs` limit.
|
|
261
|
+
|
|
262
|
+
_Assume that you've provided `1` for `maxTabs`._
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
<p align="center">
|
|
266
|
+
<img src="./img/maxTabs1.png" alt="maxTabs1" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
267
|
+
</p>
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
<p><br/></p>
|
|
272
|
+
|
|
273
|
+
# `autoFocus`
|
|
274
|
+
Just auto focus to prompt input field after every response arrival or initialization.
|
|
275
|
+
|
|
276
|
+
default: `true`
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
<p><br/></p>
|
|
281
|
+
|
|
282
|
+
# `maxUserInput`
|
|
283
|
+
Max number of chars user can insert into the prompt field. But, as might know you can also add code attachments under the prompt field. A treshold of `96` chars will be automatically reduced from the `maxUserInput`.
|
|
284
|
+
|
|
285
|
+
**So beware that if you want 4000 chars exact, you need to give 4096 to the config.**
|
|
286
|
+
|
|
287
|
+
default: `4096`
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## `codeInsertToCursorEnabled` and `codeCopyToClipboardEnabled` (default: true)
|
|
292
|
+
These two parameters allow you to make copy and insert buttons disabled system wide. If you want to disable it specifically for a message you can do it through `ChatItem` object. Please see [DATAMODEL Documentation](./DATAMODEL.md#codeinserttocursorenabled-and-codecopytoclipboardenabled-default-true).
|
|
293
|
+
|
|
294
|
+
<p align="center">
|
|
295
|
+
<img src="./img/data-model/chatItems/codeInsertAndCopyButtons.png" alt="codeInsertAndCopy" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
296
|
+
</p>
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## `codeBlockActions`
|
|
301
|
+
With this parameter, you can add global code block actions to the code blocks. But, you can override them through [ChatItem Data Model](./DATAMODEL.md#codeBlockActions).
|
|
302
|
+
|
|
303
|
+
### Note
|
|
304
|
+
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.
|
|
305
|
+
|
|
306
|
+
#### By default, we add `copy` and `insert to cursor position` ones:
|
|
307
|
+
|
|
308
|
+
```typescript
|
|
309
|
+
{
|
|
310
|
+
codeBlockActions: {
|
|
311
|
+
...(codeCopyToClipboardEnabled !== false
|
|
312
|
+
? {
|
|
313
|
+
copy: {
|
|
314
|
+
id: 'copy',
|
|
315
|
+
label: texts.copy,
|
|
316
|
+
icon: MynahIcons.COPY
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
: {}),
|
|
320
|
+
...(codeInsertToCursorEnabled !== false
|
|
321
|
+
? {
|
|
322
|
+
'insert-to-cursor': {
|
|
323
|
+
id: 'insert-to-cursor',
|
|
324
|
+
label: texts.insertAtCursorLabel,
|
|
325
|
+
icon: MynahIcons.CURSOR_INSERT
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
: {}),
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
<p align="center">
|
|
334
|
+
<img src="./img/data-model/chatItems/codeInsertAndCopyButtonsThroughConfig.png" alt="codeInsertAndCopy" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
335
|
+
</p>
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
<p><br/></p>
|
|
340
|
+
|
|
341
|
+
# `showPromptField`
|
|
342
|
+
Show or hide the prompt input field completely. You may want to hide the prompt field by setting `showPromptField` to `false` to make the chat work one way only. Just to provide answers or information.
|
|
343
|
+
|
|
344
|
+
default: `true`
|
|
345
|
+
|
|
346
|
+
_If you set `showPromptField` to `false`_
|
|
347
|
+
|
|
348
|
+
<p align="center">
|
|
349
|
+
<img src="./img/noPrompt.png" alt="noPrompt" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
350
|
+
</p>
|