@aws/mynah-ui 4.24.0 → 4.25.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/static.d.ts CHANGED
@@ -30,6 +30,14 @@ export interface MynahUIDataModel {
30
30
  * Tab title
31
31
  * */
32
32
  tabTitle?: string;
33
+ /**
34
+ * Tab icon
35
+ * */
36
+ tabIcon?: MynahIcons | MynahIconsType | null;
37
+ /**
38
+ * is tab pinned
39
+ * */
40
+ pinned?: boolean;
33
41
  /**
34
42
  * Tab title
35
43
  * */
@@ -101,7 +109,7 @@ export interface MynahUIDataModel {
101
109
  /**
102
110
  * List of chat item objects to be shown on the web suggestions search screen
103
111
  */
104
- chatItems?: ChatItem[];
112
+ chatItems?: Array<ChatItem | InformationItemGroup>;
105
113
  /**
106
114
  * Attached code under the prompt input field
107
115
  */
@@ -201,6 +209,20 @@ export declare enum ChatItemType {
201
209
  ANSWER_PART = "answer-part",
202
210
  CODE_RESULT = "code-result"
203
211
  }
212
+ export interface InformationItemGroup {
213
+ title?: string;
214
+ icon?: MynahIcons | MynahIconsType;
215
+ children: InformationItem[];
216
+ }
217
+ export interface InformationItem {
218
+ messageId?: string;
219
+ icon?: MynahIcons | MynahIconsType;
220
+ title?: string;
221
+ description?: string;
222
+ actions?: ChatItemButton[];
223
+ active?: boolean;
224
+ clickable?: boolean;
225
+ }
204
226
  export type Status = 'info' | 'success' | 'warning' | 'error';
205
227
  export interface ProgressField {
206
228
  /**
package/docs/DATAMODEL.md CHANGED
@@ -12,6 +12,14 @@ interface MynahUIDataModel {
12
12
  * Tab title
13
13
  * */
14
14
  tabTitle?: string;
15
+ /**
16
+ * Tab icon
17
+ * */
18
+ tabIcon?: MynahIcons | MynahIconsType | null;
19
+ /**
20
+ * is tab pinned
21
+ * */
22
+ pinned?: boolean;
15
23
  /**
16
24
  * Tab title
17
25
  * */
@@ -83,7 +91,7 @@ interface MynahUIDataModel {
83
91
  /**
84
92
  * List of chat item objects to be shown on the web suggestions search screen
85
93
  */
86
- chatItems?: ChatItem[];
94
+ chatItems?: Array<ChatItem | InformationItemGroup>;
87
95
  /**
88
96
  * Attached code under the prompt input field
89
97
  */
@@ -124,6 +132,57 @@ mynahUI.updateStore('tab-1', {
124
132
  })
125
133
  ```
126
134
 
135
+ ### `tabIcon` (default: undefined)
136
+ Basically it is an icon you can give to the tab.
137
+
138
+ ```typescript
139
+ const mynahUI = new MynahUI({
140
+ tabs: {
141
+ 'tab-1': {
142
+ ...
143
+ }
144
+ }
145
+ });
146
+
147
+ mynahUI.updateStore('tab-1', {
148
+ tabTitle: '',
149
+ tabIcon: MynahIcons.MENU,
150
+ pinned: true
151
+ })
152
+ ```
153
+
154
+ ###
155
+
156
+ <p align="center">
157
+ <img src="./img/data-model/tabStore/pinnedTab.png" alt="pinnedTab" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
158
+ </p>
159
+
160
+
161
+ ### `pinned` (default: `false`)
162
+ You can pin the tabs to the beginning. But when you pin a tab, end user cannot close them anymore. It will disable the middle mouse click to close a tab and remove the close button too. The tab will be basically pinned.
163
+
164
+ ```typescript
165
+ const mynahUI = new MynahUI({
166
+ tabs: {
167
+ 'tab-1': {
168
+ ...
169
+ }
170
+ }
171
+ });
172
+
173
+ mynahUI.updateStore('tab-1', {
174
+ tabTitle: '',
175
+ tabIcon: MynahIcons.MENU,
176
+ pinned: true
177
+ })
178
+ ```
179
+
180
+ ###
181
+
182
+ <p align="center">
183
+ <img src="./img/data-model/tabStore/pinnedTab.png" alt="pinnedTab" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
184
+ </p>
185
+
127
186
  ### `tabBackground` (default: `false`)
128
187
  Shows or hides the gradient background on the tab.
129
188
 
@@ -856,6 +915,8 @@ This is holding the chat items. If you provide it through the `defaults` or insi
856
915
 
857
916
  **BUT** if you will set it through `updateStore` it will append the items in the list to the current chatItems list. In case if you need to update the list with a new one manually on runtime, you need to send an empty list first and than send the desired new list.
858
917
 
918
+ ChatItems will either be of type `ChatItem` or `InformationItemGroup`. An `InformationItemGroup` can hold one or more `InformationItem` objects. This means that if you would like to just access the ChatItems in a tab, you should filter out the InformationItemGroups first.
919
+
859
920
  ```typescript
860
921
  const mynahUI = new MynahUI({
861
922
  tabs: {
@@ -2756,4 +2817,28 @@ export interface ChatPrompt {
2756
2817
  command?: string;
2757
2818
  context?: string[];
2758
2819
  }
2820
+ ```
2821
+
2822
+ ---
2823
+
2824
+ # `InformationItem`
2825
+
2826
+ Information items can be rendered in an `InformationItemGroup` within the `chatItems?` array. These items are full width information displays, with an optional icon on the left, and room for a title, description, and a list of actions.
2827
+
2828
+ ```typescript
2829
+ export interface InformationItemGroup {
2830
+ title?: string;
2831
+ icon?: MynahIcons | MynahIconsType;
2832
+ children: InformationItem[];
2833
+ }
2834
+
2835
+ export interface InformationItem {
2836
+ messageId?: string;
2837
+ icon?: MynahIcons | MynahIconsType;
2838
+ title?: string;
2839
+ description?: string;
2840
+ actions?: ChatItemButton[];
2841
+ active?: boolean;
2842
+ clickable?: boolean;
2843
+ }
2759
2844
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws/mynah-ui",
3
3
  "displayName": "AWS Mynah UI",
4
- "version": "4.24.0",
4
+ "version": "4.25.0",
5
5
  "description": "AWS Toolkit VSCode and Intellij IDE Extension Mynah UI",
6
6
  "publisher": "Amazon Web Services",
7
7
  "license": "Apache License 2.0",