@aws/mynah-ui 4.16.1-beta.1 → 4.17.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
@@ -164,11 +164,12 @@ export declare enum ChatItemType {
164
164
  ANSWER_PART = "answer-part",
165
165
  CODE_RESULT = "code-result"
166
166
  }
167
+ export type Status = 'info' | 'success' | 'warning' | 'error';
167
168
  export interface ProgressField {
168
169
  /**
169
170
  * Prompt input progress status
170
171
  */
171
- status?: 'default' | 'info' | 'success' | 'warning' | 'error';
172
+ status?: 'default' | Status;
172
173
  /**
173
174
  * Prompt input progress text
174
175
  */
@@ -187,7 +188,7 @@ export interface ProgressField {
187
188
  actions?: ChatItemButton[];
188
189
  }
189
190
  export interface TreeNodeDetails {
190
- status?: 'info' | 'success' | 'warning' | 'error';
191
+ status?: Status;
191
192
  icon?: MynahIcons;
192
193
  label?: string;
193
194
  description?: string;
@@ -215,6 +216,17 @@ export interface ChatItemContent {
215
216
  buttons?: ChatItemButton[];
216
217
  formItems?: ChatItemFormItem[];
217
218
  footer?: ChatItemContent;
219
+ informationCard?: {
220
+ title?: string;
221
+ status?: {
222
+ status?: Status;
223
+ icon?: MynahIcons;
224
+ body?: string;
225
+ };
226
+ description?: string;
227
+ icon?: MynahIcons;
228
+ content: ChatItemContent;
229
+ };
218
230
  codeBlockActions?: CodeBlockActions;
219
231
  }
220
232
  export interface ChatItem extends ChatItemContent {
@@ -223,7 +235,7 @@ export interface ChatItem extends ChatItemContent {
223
235
  snapToTop?: boolean;
224
236
  canBeVoted?: boolean;
225
237
  icon?: MynahIcons;
226
- status?: 'info' | 'success' | 'warning' | 'error';
238
+ status?: Status;
227
239
  }
228
240
  export interface ChatItemFormItem {
229
241
  id: string;
@@ -248,7 +260,7 @@ export interface ChatItemAction extends ChatPrompt {
248
260
  pillText: string;
249
261
  disabled?: boolean;
250
262
  description?: string;
251
- status?: 'primary' | 'info' | 'success' | 'warning' | 'error';
263
+ status?: 'primary' | Status;
252
264
  icon?: MynahIcons;
253
265
  }
254
266
  export interface ChatItemButton {
@@ -258,7 +270,7 @@ export interface ChatItemButton {
258
270
  id: string;
259
271
  disabled?: boolean;
260
272
  description?: string;
261
- status?: 'primary' | 'info' | 'success' | 'warning' | 'error';
273
+ status?: 'primary' | Status;
262
274
  icon?: MynahIcons;
263
275
  }
264
276
  export interface TabBarAction {
@@ -266,7 +278,7 @@ export interface TabBarAction {
266
278
  id: string;
267
279
  disabled?: boolean;
268
280
  description?: string;
269
- status?: 'info' | 'success' | 'warning' | 'error';
281
+ status?: Status;
270
282
  icon?: MynahIcons;
271
283
  }
272
284
  export interface TabBarMainAction extends TabBarAction {
@@ -277,7 +289,7 @@ export interface FileNodeAction {
277
289
  label?: string;
278
290
  disabled?: boolean;
279
291
  description?: string;
280
- status?: 'info' | 'success' | 'warning' | 'error';
292
+ status?: Status;
281
293
  icon: MynahIcons;
282
294
  }
283
295
  export declare enum KeyMap {
package/docs/DATAMODEL.md CHANGED
@@ -716,6 +716,17 @@ interface ChatItemContent {
716
716
  buttons?: ChatItemButton[];
717
717
  formItems?: ChatItemFormItem[];
718
718
  footer?: ChatItemContent;
719
+ informationCard?: {
720
+ title?: string;
721
+ status?: {
722
+ status?: Status;
723
+ icon?: MynahIcons;
724
+ body?: string;
725
+ };
726
+ description?: string;
727
+ icon?: MynahIcons;
728
+ content: ChatItemContent;
729
+ };
719
730
  codeBlockActions?: CodeBlockActions;
720
731
  }
721
732
 
@@ -1562,6 +1573,44 @@ mynahUI.addChatItem(tabId, {
1562
1573
 
1563
1574
  ---
1564
1575
 
1576
+ ### `informationCard`
1577
+
1578
+ Show a styled card for e.g. introducing or highlighting a particular feature.
1579
+
1580
+ ```typescript
1581
+ mynahUI.addChatItem(tabId, {
1582
+ messageId: generateUID(),
1583
+ type: ChatItemType.ANSWER,
1584
+ informationCard: {
1585
+ title: 'Information card',
1586
+ description: 'With a description below the title and success status.',
1587
+ icon: MynahIcons.BUG,
1588
+ content: {
1589
+ body: 'Some card body here'
1590
+ },
1591
+ status: {
1592
+ status: 'success',
1593
+ icon: MynahIcons.THUMBS_UP,
1594
+ body: 'Successfully completed this task!'
1595
+ }
1596
+ },
1597
+ });
1598
+ ```
1599
+
1600
+ Information cards have a top section, including a title, description, and icon. The content of the card can be defined in the `content.body`.
1601
+
1602
+ A status can also be added to emphasize a particular state. The `status.status` supports either `success`, `warning`, or `error`. An icon and body message can also be defined.
1603
+
1604
+ <p align="center">
1605
+ <img src="./img/data-model/chatItems/information-card.png" alt="mainTitle" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
1606
+ </p>
1607
+
1608
+ <p align="center">
1609
+ <img src="./img/data-model/chatItems/information-card-statuses.jpg" alt="mainTitle" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
1610
+ </p>
1611
+
1612
+ ---
1613
+
1565
1614
  ## `buttons`
1566
1615
  It allows you to add actions inside a chat item card. **BUT, beware that when those actions are clicked if you set the `keepCardAfterClick` to false, they will remove the card they are in.**.
1567
1616
 
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.16.1-beta.1",
4
+ "version": "4.17.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",
@@ -19,7 +19,9 @@
19
19
  "packdemo": "cd ./example && npm run pack",
20
20
  "watch": "webpack --config webpack.config.js --mode development --watch",
21
21
  "watch:example": "cd ./example && npm run watch",
22
- "start:example": "cd ./example && npm install && npm run build && npm run dev",
22
+ "watch:web": "run-p watch watch:example serve:example",
23
+ "serve:example": "live-server --port=9000 example/dist",
24
+ "start:example": "cd ./example && npm install && npm run build && cd .. && npm run watch:web",
23
25
  "dev": "npm run clean && npm install && npm run build && npm run start:example",
24
26
  "lint-fix": "npx eslint \"./**\" --fix",
25
27
  "lint": "npx eslint \"./**\"",
@@ -29,13 +31,13 @@
29
31
  "tests:e2e": "cd ./ui-tests && npm install && npm run prepare && npm run e2e",
30
32
  "api-docs": "npx typedoc src/main.ts --out ./api-docs",
31
33
  "api-doc-deploy": "npx typedoc src/main.ts --out ./example/dist/api-doc",
32
- "postinstall": "node postinstall.js",
34
+ "postinstall": "npm install -g live-server && node postinstall.js",
33
35
  "prepare": "npx husky"
34
36
  },
35
37
  "dependencies": {
36
38
  "escape-html": "^1.0.3",
37
39
  "just-clone": "^6.2.0",
38
- "marked": "^12.0.2",
40
+ "marked": "^14.1.0",
39
41
  "prismjs": "1.29.0",
40
42
  "sanitize-html": "^2.12.1",
41
43
  "unescape-html": "^1.1.0"
@@ -0,0 +1,9 @@
1
+ <html theme="base-light">
2
+ <head>
3
+ <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
4
+ <script defer src="main.js"></script></head>
5
+
6
+ <body>
7
+ <div id="mynah-ui-wrapper"></div>
8
+ </body>
9
+ </html>