@aws/mynah-ui 4.35.0-beta.1 → 4.35.0-beta.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/components/button.d.ts +9 -0
- package/dist/components/card/card.d.ts +2 -1
- package/dist/components/chat-item/chat-item-form-items.d.ts +2 -1
- package/dist/components/chat-item/prompt-input/prompt-options.d.ts +1 -1
- package/dist/components/detailed-list/detailed-list-item.d.ts +7 -1
- package/dist/components/detailed-list/detailed-list-sheet.d.ts +6 -3
- package/dist/components/detailed-list/detailed-list.d.ts +6 -1
- package/dist/components/form-items/form-item-list.d.ts +43 -0
- package/dist/components/icon.d.ts +2 -0
- package/dist/components/navigation-tab-bar-buttons.d.ts +14 -0
- package/dist/components/sheet.d.ts +16 -3
- package/dist/helper/test-ids.d.ts +2 -0
- package/dist/main.d.ts +2 -2
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +44 -5
- package/package.json +3 -1
- package/ui-tests/jest.chromium.config.js +22 -0
- package/ui-tests/jest.webkit.config.js +22 -0
- package/ui-tests/package.json +2 -0
- package/ui-tests/run-browser-tests.ts +30 -0
package/dist/static.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { CheckboxAbstract, CheckboxProps } from './components/form-items/checkbox';
|
|
6
|
+
import { FormItemListAbstract, FormItemListProps } from './components/form-items/form-item-list';
|
|
6
7
|
import { SwitchAbstract, SwitchProps } from './components/form-items/switch';
|
|
7
8
|
import { CustomIcon, MynahIcons, MynahIconsType } from './components/icon';
|
|
8
9
|
import { ChatItemBodyRenderer } from './helper/dom';
|
|
@@ -205,7 +206,8 @@ export declare enum MynahPortalNames {
|
|
|
205
206
|
WRAPPER = "wrapper",
|
|
206
207
|
SIDE_NAV = "sideNav",
|
|
207
208
|
OVERLAY = "overlay",
|
|
208
|
-
SHEET = "sheet"
|
|
209
|
+
SHEET = "sheet",
|
|
210
|
+
LOADER = "loader"
|
|
209
211
|
}
|
|
210
212
|
export type PromptAttachmentType = 'code' | 'markdown';
|
|
211
213
|
export interface SourceLinkMetaData {
|
|
@@ -237,14 +239,21 @@ export declare enum ChatItemType {
|
|
|
237
239
|
}
|
|
238
240
|
export interface DetailedList {
|
|
239
241
|
filterOptions?: FilterOption[] | null;
|
|
242
|
+
filterActions?: ChatItemButton[];
|
|
240
243
|
list?: DetailedListItemGroup[];
|
|
241
244
|
header?: {
|
|
242
245
|
title?: string;
|
|
243
246
|
icon?: MynahIcons | MynahIconsType;
|
|
247
|
+
status?: {
|
|
248
|
+
icon?: MynahIcons | MynahIconsType;
|
|
249
|
+
title: string;
|
|
250
|
+
description?: string;
|
|
251
|
+
status?: Status;
|
|
252
|
+
};
|
|
244
253
|
description?: string;
|
|
245
|
-
actions?:
|
|
254
|
+
actions?: TabBarMainAction[];
|
|
246
255
|
};
|
|
247
|
-
selectable?: boolean;
|
|
256
|
+
selectable?: boolean | 'clickable';
|
|
248
257
|
textDirection?: 'row' | 'column';
|
|
249
258
|
}
|
|
250
259
|
export interface DetailedListItemGroup {
|
|
@@ -258,6 +267,7 @@ export interface DetailedListItem {
|
|
|
258
267
|
name?: string;
|
|
259
268
|
id?: string;
|
|
260
269
|
icon?: MynahIcons | MynahIconsType;
|
|
270
|
+
iconForegroundStatus?: Status;
|
|
261
271
|
description?: string;
|
|
262
272
|
disabled?: boolean;
|
|
263
273
|
followupText?: string;
|
|
@@ -265,6 +275,12 @@ export interface DetailedListItem {
|
|
|
265
275
|
groupActions?: boolean;
|
|
266
276
|
children?: DetailedListItemGroup[];
|
|
267
277
|
keywords?: string[];
|
|
278
|
+
status?: {
|
|
279
|
+
status?: Status;
|
|
280
|
+
description?: string;
|
|
281
|
+
icon?: MynahIcons | MynahIconsType;
|
|
282
|
+
text?: string;
|
|
283
|
+
};
|
|
268
284
|
}
|
|
269
285
|
export type Status = 'info' | 'success' | 'warning' | 'error';
|
|
270
286
|
export interface ProgressField {
|
|
@@ -429,13 +445,29 @@ type CheckboxFormItem = BaseFormItem & {
|
|
|
429
445
|
label?: string;
|
|
430
446
|
alternateTooltip?: string;
|
|
431
447
|
};
|
|
432
|
-
export type
|
|
448
|
+
export type SingularFormItem = TextBasedFormItem | OtherFormItem | RadioGroupFormItem | CheckboxFormItem;
|
|
449
|
+
export type ChatItemFormItem = TextBasedFormItem | OtherFormItem | RadioGroupFormItem | CheckboxFormItem | ListFormItem;
|
|
433
450
|
export type FilterOption = ChatItemFormItem;
|
|
451
|
+
export interface ListFormItem {
|
|
452
|
+
type: 'list';
|
|
453
|
+
id: string;
|
|
454
|
+
mandatory?: boolean;
|
|
455
|
+
title?: string;
|
|
456
|
+
description?: string;
|
|
457
|
+
tooltip?: string;
|
|
458
|
+
icon?: MynahIcons | MynahIconsType;
|
|
459
|
+
items: SingularFormItem[];
|
|
460
|
+
value: ListItemEntry[];
|
|
461
|
+
}
|
|
462
|
+
export interface ListItemEntry {
|
|
463
|
+
persistent?: boolean;
|
|
464
|
+
value: Record<string, string>;
|
|
465
|
+
}
|
|
434
466
|
export interface ChatPrompt {
|
|
435
467
|
prompt?: string;
|
|
436
468
|
escapedPrompt?: string;
|
|
437
469
|
command?: string;
|
|
438
|
-
options?: Record<string, string
|
|
470
|
+
options?: Record<string, string | Array<Record<string, string>>>;
|
|
439
471
|
context?: string[] | QuickActionCommand[];
|
|
440
472
|
}
|
|
441
473
|
export interface ChatItemAction extends ChatPrompt {
|
|
@@ -459,6 +491,12 @@ export interface Action {
|
|
|
459
491
|
id: string;
|
|
460
492
|
disabled?: boolean;
|
|
461
493
|
description?: string;
|
|
494
|
+
confirmation?: {
|
|
495
|
+
confirmButtonText: string;
|
|
496
|
+
cancelButtonText: string;
|
|
497
|
+
title: string;
|
|
498
|
+
description?: string;
|
|
499
|
+
};
|
|
462
500
|
status?: 'main' | 'primary' | 'clear' | 'dimmed-clear' | Status;
|
|
463
501
|
icon?: MynahIcons | MynahIconsType;
|
|
464
502
|
}
|
|
@@ -623,6 +661,7 @@ export interface ComponentOverrides {
|
|
|
623
661
|
Select?: new (props: SelectProps) => ExtractMethods<SelectAbstract>;
|
|
624
662
|
TextInput?: new (props: TextInputProps) => ExtractMethods<TextInputAbstract>;
|
|
625
663
|
TextArea?: new (props: TextAreaProps) => ExtractMethods<TextAreaAbstract>;
|
|
664
|
+
FormItemList?: new (props: FormItemListProps) => ExtractMethods<FormItemListAbstract>;
|
|
626
665
|
}
|
|
627
666
|
export interface ConfigOptions {
|
|
628
667
|
feedbackOptions: Array<{
|
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.35.0-beta.
|
|
4
|
+
"version": "4.35.0-beta.3",
|
|
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",
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"format:write": "npx prettier --write .",
|
|
30
30
|
"tests:unit": "jest",
|
|
31
31
|
"tests:e2e": "cd ./ui-tests && npm install && npm run prepare && npm run e2e",
|
|
32
|
+
"tests:e2e:chromium": "cd ./ui-tests && npm install && npm run prepare && BROWSER=chromium ts-node run-browser-tests.ts",
|
|
33
|
+
"tests:e2e:webkit": "cd ./ui-tests && npm install && npm run prepare && BROWSER=webkit ts-node run-browser-tests.ts",
|
|
32
34
|
"api-docs": "npx typedoc src/main.ts --out ./api-docs",
|
|
33
35
|
"api-doc-deploy": "npx typedoc src/main.ts --out ./example/dist/api-doc",
|
|
34
36
|
"postinstall": "node postinstall.js",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const isHeadless = process.env.HEADLESS !== 'false';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
rootDir: './',
|
|
5
|
+
roots: ['./__test__', './src'],
|
|
6
|
+
preset: 'jest-playwright-preset',
|
|
7
|
+
testEnvironmentOptions: {
|
|
8
|
+
'jest-playwright': {
|
|
9
|
+
use: {
|
|
10
|
+
trace: 'on-first-retry',
|
|
11
|
+
},
|
|
12
|
+
browsers: ['chromium'],
|
|
13
|
+
launchOptions: {
|
|
14
|
+
headless: isHeadless,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
transform: { '^.+\\.ts?$': 'ts-jest' },
|
|
19
|
+
testMatch: ['**/?(*.)+(spec|test).[t]s'],
|
|
20
|
+
testPathIgnorePatterns: ['/node_modules/', 'dist', 'src'],
|
|
21
|
+
testTimeout: 15000,
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const isHeadless = process.env.HEADLESS !== 'false';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
rootDir: './',
|
|
5
|
+
roots: ['./__test__', './src'],
|
|
6
|
+
preset: 'jest-playwright-preset',
|
|
7
|
+
testEnvironmentOptions: {
|
|
8
|
+
'jest-playwright': {
|
|
9
|
+
use: {
|
|
10
|
+
trace: 'on-first-retry',
|
|
11
|
+
},
|
|
12
|
+
browsers: ['webkit'],
|
|
13
|
+
launchOptions: {
|
|
14
|
+
headless: isHeadless,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
transform: { '^.+\\.ts?$': 'ts-jest' },
|
|
19
|
+
testMatch: ['**/?(*.)+(spec|test).[t]s'],
|
|
20
|
+
testPathIgnorePatterns: ['/node_modules/', 'dist', 'src'],
|
|
21
|
+
testTimeout: 15000,
|
|
22
|
+
};
|
package/ui-tests/package.json
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
"clean": "rm -rf build dist node_modules",
|
|
8
8
|
"prepare": "webpack --config webpack.config.js --mode development",
|
|
9
9
|
"e2e": "npm run prepare && jest --detectOpenHandles --config=./jest.config.js",
|
|
10
|
+
"e2e:chromium": "npm run prepare && ts-node run-browser-tests.ts",
|
|
11
|
+
"e2e:webkit": "npm run prepare && BROWSER=webkit ts-node run-browser-tests.ts",
|
|
10
12
|
"postinstall": "npx playwright install webkit chromium --with-deps"
|
|
11
13
|
},
|
|
12
14
|
"dependencies": {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper script to run tests for a specific browser
|
|
3
|
+
*/
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
|
+
|
|
6
|
+
// Define valid browser types
|
|
7
|
+
type BrowserType = 'all' | 'chromium' | 'webkit';
|
|
8
|
+
|
|
9
|
+
// Get the browser from environment variable or use default
|
|
10
|
+
const browser = (process.env.BROWSER ?? 'all') as BrowserType;
|
|
11
|
+
|
|
12
|
+
console.log(`Running tests for browser: ${browser}`);
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
if (browser === 'all') {
|
|
16
|
+
// Run tests for all browsers using the default config
|
|
17
|
+
execSync('jest --detectOpenHandles --config=./jest.config.js', { stdio: 'inherit' });
|
|
18
|
+
} else if (browser === 'chromium') {
|
|
19
|
+
// Run tests for Chromium only
|
|
20
|
+
execSync('jest --detectOpenHandles --config=./jest.chromium.config.js', { stdio: 'inherit' });
|
|
21
|
+
} else if (browser === 'webkit') {
|
|
22
|
+
// Run tests for Webkit only
|
|
23
|
+
execSync('jest --detectOpenHandles --config=./jest.webkit.config.js', { stdio: 'inherit' });
|
|
24
|
+
} else {
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error(`Test execution failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|