@aws/mynah-ui 4.15.10 → 4.16.0-beta.1

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
@@ -72,6 +72,10 @@ export interface MynahUIDataModel {
72
72
  */
73
73
  promptInputDisabledState?: boolean;
74
74
  /**
75
+ * Prompt input progress field
76
+ */
77
+ promptInputProgress?: ProgressField | null;
78
+ /**
75
79
  * List of chat item objects to be shown on the web suggestions search screen
76
80
  */
77
81
  chatItems?: ChatItem[];
@@ -123,7 +127,8 @@ export declare enum MynahEventNames {
123
127
  CUSTOM_FORM_ACTION_CLICK = "customFormActionClick",
124
128
  ADD_ATTACHMENT = "addAttachment",
125
129
  REMOVE_ATTACHMENT = "removeAttachment",
126
- TAB_BAR_BUTTON_CLICK = "tabBarButtonClick"
130
+ TAB_BAR_BUTTON_CLICK = "tabBarButtonClick",
131
+ PROMPT_PROGRESS_ACTION_CLICK = "promptProgressActionClick"
127
132
  }
128
133
  export declare enum MynahPortalNames {
129
134
  WRAPPER = "wrapper",
@@ -158,6 +163,28 @@ export declare enum ChatItemType {
158
163
  ANSWER_PART = "answer-part",
159
164
  CODE_RESULT = "code-result"
160
165
  }
166
+ export interface ProgressField {
167
+ /**
168
+ * Prompt input progress status
169
+ */
170
+ status?: 'default' | 'info' | 'success' | 'warning' | 'error';
171
+ /**
172
+ * Prompt input progress text
173
+ */
174
+ text?: string;
175
+ /**
176
+ * Prompt input progress text for the current state (ie: 15%, 2min remaining)
177
+ */
178
+ valueText?: string;
179
+ /**
180
+ * Prompt input progress value to show the inner bar state, -1 for infinite
181
+ */
182
+ value?: number;
183
+ /**
184
+ * Prompt input progress actions
185
+ */
186
+ actions?: ChatItemButton[];
187
+ }
161
188
  export interface TreeNodeDetails {
162
189
  status?: 'info' | 'success' | 'warning' | 'error';
163
190
  icon?: MynahIcons;
@@ -406,6 +433,7 @@ export interface ConfigOptions {
406
433
  codeBlockActions?: CodeBlockActions;
407
434
  codeInsertToCursorEnabled?: boolean;
408
435
  codeCopyToClipboardEnabled?: boolean;
436
+ test?: boolean;
409
437
  }
410
438
  export interface ConfigModel extends ConfigOptions {
411
439
  texts: Partial<ConfigTexts>;
package/jest.config.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const jestConfig = {
2
2
  testEnvironment: 'jsdom',
3
3
  preset: 'ts-jest',
4
+ modulePathIgnorePatterns: ['<rootDir>/ui-tests/'],
4
5
  moduleNameMapper: {
5
6
  '\\.svg$': 'jest-svg-transformer',
6
7
  '^.+\\.(css|less|scss)$': 'babel-jest',
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.15.10",
4
+ "version": "4.16.0-beta.1",
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,13 +19,16 @@
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
- "dev": "npm run clean && npm install && npm run build && npm run packdemo && npm run watch",
22
+ "start:example": "cd ./example && npm install && npm run build && npm run dev",
23
+ "dev": "npm run clean && npm install && npm run build && npm run start:example",
23
24
  "lint-fix": "npx eslint \"./**\" --fix",
24
25
  "lint": "npx eslint \"./**\"",
25
26
  "test": "jest",
27
+ "test:e2e": "npm install && npm run build && cd ./ui-tests && npm run tests:run",
26
28
  "api-docs": "npx typedoc src/main.ts --out ./api-docs",
27
29
  "api-doc-deploy": "npx typedoc src/main.ts --out ./example/dist/api-doc",
28
- "postinstall": "node postinstall.js"
30
+ "postinstall": "node postinstall.js",
31
+ "prepare": "husky"
29
32
  },
30
33
  "dependencies": {
31
34
  "escape-html": "^1.0.3",
@@ -68,6 +71,7 @@
68
71
  "eslint-plugin-no-null": "^1.0.2",
69
72
  "eslint-plugin-prettier": "^5.0.0",
70
73
  "eslint-plugin-promise": "6.0.0",
74
+ "husky": "^9.1.6",
71
75
  "jest": "^29.7.0",
72
76
  "jest-environment-jsdom": "^29.7.0",
73
77
  "jest-svg-transformer": "^1.0.0",
@@ -95,4 +99,4 @@
95
99
  "arrowParens": "avoid",
96
100
  "endOfLine": "lf"
97
101
  }
98
- }
102
+ }
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ rootDir: './',
3
+ roots: ['./__test__', './src'],
4
+ preset: 'jest-playwright-preset',
5
+ transform: { '^.+\\.ts?$': 'ts-jest' },
6
+ testMatch: ['**/?(*.)+(spec|test).[t]s'],
7
+ testPathIgnorePatterns: ['/node_modules/', 'dist', 'src'],
8
+ setupFilesAfterEnv: ['./jest.image.ts'],
9
+ testTimeout: 15000,
10
+ };
@@ -0,0 +1,8 @@
1
+ import { configureToMatchImageSnapshot } from 'jest-image-snapshot';
2
+
3
+ const toMatchImageSnapshot = configureToMatchImageSnapshot({
4
+ failureThreshold: 0.25,
5
+ failureThresholdType: 'percent'
6
+ });
7
+
8
+ expect.extend({ toMatchImageSnapshot });
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@amzn/mynah-website",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "webpack.media.config.js",
6
+ "scripts": {
7
+ "clean": "rm -rf build dist node_modules",
8
+ "tests:prepare": "webpack --config webpack.config.js --mode development",
9
+ "tests:e2e": "jest --runInBand --detectOpenHandles --config=./jest.config.js",
10
+ "tests:run": "npm install && npm run tests:prepare && npm run tests:e2e",
11
+ "postinstall": "npx playwright install webkit"
12
+ },
13
+ "dependencies": {
14
+ "@aws/mynah-ui": "file:../"
15
+ },
16
+ "devDependencies": {
17
+ "@types/jest": "^29.5.12",
18
+ "@types/jest-image-snapshot": "^6.4.0",
19
+ "css-loader": "^6.6.0",
20
+ "html-webpack-plugin": "^5.5.0",
21
+ "jest": "^29.7.0",
22
+ "jest-image-snapshot": "^6.4.0",
23
+ "jest-playwright-preset": "^4.0.0",
24
+ "playwright": "^1.47.0",
25
+ "raw-loader": "^4.0.2",
26
+ "sass": "^1.49.8",
27
+ "sass-loader": "^12.6.0",
28
+ "style-loader": "^3.3.1",
29
+ "ts-loader": "^9.4.4",
30
+ "ts-node": "^10.9.1",
31
+ "typescript": "^5.0.4",
32
+ "webpack": "^5.61.0",
33
+ "webpack-cli": "^4.7.2"
34
+ },
35
+ "prettier": {
36
+ "printWidth": 160,
37
+ "trailingComma": "es5",
38
+ "tabWidth": 4,
39
+ "singleQuote": true,
40
+ "semi": true,
41
+ "bracketSpacing": true,
42
+ "arrowParens": "avoid",
43
+ "endOfLine": "lf"
44
+ },
45
+ "author": ""
46
+ }
@@ -1,21 +0,0 @@
1
- /*!
2
- * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { ExtendedHTMLElement } from '../../helper/dom';
6
- import { ChatItemAction } from '../../static';
7
- export interface ChatItemFollowUpOptionProps {
8
- followUpOption: ChatItemAction;
9
- onClick: (followUpOption: ChatItemAction) => void;
10
- }
11
- export declare class ChatItemFollowUpOption {
12
- private readonly props;
13
- render: ExtendedHTMLElement;
14
- private followupTooltip;
15
- private followupTooltipTimeout;
16
- private disabled;
17
- constructor(props: ChatItemFollowUpOptionProps);
18
- private readonly showCroppedFollowupText;
19
- readonly hideCroppedFollowupText: () => void;
20
- readonly setEnabled: (enabled: boolean) => void;
21
- }