@aws/mynah-ui 4.35.0-beta.1 → 4.35.0-beta.2

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
@@ -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';
@@ -237,6 +238,7 @@ export declare enum ChatItemType {
237
238
  }
238
239
  export interface DetailedList {
239
240
  filterOptions?: FilterOption[] | null;
241
+ filterActions?: ChatItemButton[];
240
242
  list?: DetailedListItemGroup[];
241
243
  header?: {
242
244
  title?: string;
@@ -258,6 +260,7 @@ export interface DetailedListItem {
258
260
  name?: string;
259
261
  id?: string;
260
262
  icon?: MynahIcons | MynahIconsType;
263
+ iconForegroundStatus?: Status;
261
264
  description?: string;
262
265
  disabled?: boolean;
263
266
  followupText?: string;
@@ -429,13 +432,30 @@ type CheckboxFormItem = BaseFormItem & {
429
432
  label?: string;
430
433
  alternateTooltip?: string;
431
434
  };
432
- export type ChatItemFormItem = TextBasedFormItem | OtherFormItem | RadioGroupFormItem | CheckboxFormItem;
435
+ export type ChatItemFormItem = TextBasedFormItem | OtherFormItem | RadioGroupFormItem | CheckboxFormItem | ListFormItem;
433
436
  export type FilterOption = ChatItemFormItem;
437
+ export interface ListFormItem {
438
+ type: 'list';
439
+ id: string;
440
+ mandatory?: boolean;
441
+ title?: string;
442
+ description?: string;
443
+ tooltip?: string;
444
+ icon?: MynahIcons | MynahIconsType;
445
+ items: ChatItemFormItem[];
446
+ value: ListItemEntry[];
447
+ }
448
+ export interface ListItemEntry {
449
+ persistent: boolean;
450
+ values: {
451
+ [key: string]: string;
452
+ };
453
+ }
434
454
  export interface ChatPrompt {
435
455
  prompt?: string;
436
456
  escapedPrompt?: string;
437
457
  command?: string;
438
- options?: Record<string, string>;
458
+ options?: Record<string, string | string[]>;
439
459
  context?: string[] | QuickActionCommand[];
440
460
  }
441
461
  export interface ChatItemAction extends ChatPrompt {
@@ -623,6 +643,7 @@ export interface ComponentOverrides {
623
643
  Select?: new (props: SelectProps) => ExtractMethods<SelectAbstract>;
624
644
  TextInput?: new (props: TextInputProps) => ExtractMethods<TextInputAbstract>;
625
645
  TextArea?: new (props: TextAreaProps) => ExtractMethods<TextAreaAbstract>;
646
+ FormItemList?: new (props: FormItemListProps) => ExtractMethods<FormItemListAbstract>;
626
647
  }
627
648
  export interface ConfigOptions {
628
649
  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.1",
4
+ "version": "4.35.0-beta.2",
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
+ };
@@ -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
+ }