@aws/mynah-ui 2.0.0-beta.9.2 → 3.0.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.
Files changed (45) hide show
  1. package/.eslintrc.js +48 -0
  2. package/README.md +53 -114
  3. package/dist/components/card/card-body.d.ts +36 -0
  4. package/dist/components/card/card.d.ts +32 -0
  5. package/dist/components/chat-item/chat-item-card.d.ts +8 -12
  6. package/dist/components/chat-item/chat-item-followup.d.ts +4 -0
  7. package/dist/components/chat-item/chat-item-source-links.d.ts +19 -0
  8. package/dist/components/chat-item/chat-item-tree-view-license.d.ts +15 -0
  9. package/dist/components/chat-item/chat-item-tree-view-wrapper.d.ts +4 -0
  10. package/dist/components/chat-item/chat-prompt-input-command.d.ts +16 -0
  11. package/dist/components/chat-item/chat-prompt-input-info.d.ts +12 -0
  12. package/dist/components/chat-item/chat-prompt-input.d.ts +9 -5
  13. package/dist/components/chat-item/chat-wrapper.d.ts +5 -6
  14. package/dist/components/chat-item/prompt-input/code-snippet-widget.d.ts +14 -0
  15. package/dist/components/chat-item/prompt-input/code-snippet.d.ts +16 -0
  16. package/dist/components/chat-item/prompt-input/prompt-text-input.d.ts +21 -0
  17. package/dist/components/chat-item/prompt-input/send-button.d.ts +11 -0
  18. package/dist/components/collapsible-content.d.ts +20 -0
  19. package/dist/components/navigation-tabs.d.ts +7 -1
  20. package/dist/components/{notification/notification.d.ts → notification.d.ts} +3 -3
  21. package/dist/components/{overlay/overlay.d.ts → overlay.d.ts} +1 -1
  22. package/dist/components/source-link/source-link-body.d.ts +16 -0
  23. package/dist/components/source-link/source-link-header.d.ts +20 -0
  24. package/dist/components/source-link/source-link.d.ts +15 -0
  25. package/dist/components/syntax-highlighter.d.ts +25 -22
  26. package/dist/components/toggle.d.ts +1 -0
  27. package/dist/helper/__test__/date-time.spec.d.ts +1 -0
  28. package/dist/helper/__test__/dom.spec.d.ts +1 -0
  29. package/dist/helper/__test__/events.spec.d.ts +1 -0
  30. package/dist/helper/__test__/file-tree.spec.d.ts +1 -0
  31. package/dist/helper/date-time.d.ts +8 -8
  32. package/dist/helper/file-tree.d.ts +3 -2
  33. package/dist/helper/store.d.ts +2 -2
  34. package/dist/helper/tabs-store.d.ts +8 -6
  35. package/dist/main.d.ts +14 -16
  36. package/dist/main.js +1 -1
  37. package/dist/main.js.LICENSE.txt +8 -0
  38. package/dist/main.js.map +1 -1
  39. package/dist/static.d.ts +45 -33
  40. package/jest.config.js +6 -0
  41. package/package.json +16 -10
  42. package/dist/components/suggestion-card/suggestion-card-body.d.ts +0 -23
  43. package/dist/components/suggestion-card/suggestion-card-header.d.ts +0 -18
  44. package/dist/components/suggestion-card/suggestion-card.d.ts +0 -22
  45. package/dist/components/suggestion-card/suggestion-skeleton.d.ts +0 -5
package/.eslintrc.js ADDED
@@ -0,0 +1,48 @@
1
+ module.exports = {
2
+ "env": {
3
+ "browser": true,
4
+ "es2021": true,
5
+ "node": true
6
+ },
7
+ "extends": [
8
+ "standard-with-typescript"
9
+ ],
10
+ "parser": "@typescript-eslint/parser",
11
+ "parserOptions": {
12
+ "ecmaVersion": "latest",
13
+ "sourceType": "module",
14
+ "project": "./tsconfig.json",
15
+ },
16
+ "plugins": [
17
+ "@typescript-eslint",
18
+ "prettier"
19
+ ],
20
+ "rules": {
21
+ "@typescript-eslint/semi": [
22
+ 2,
23
+ "always"
24
+ ],
25
+ "comma-dangle": [
26
+ 2,
27
+ "only-multiline"
28
+ ],
29
+ "array-bracket-spacing": [
30
+ 2,
31
+ "always"
32
+ ],
33
+ "no-useless-call": "off",
34
+ "@typescript-eslint/member-delimiter-style": [
35
+ "error",
36
+ {
37
+ "multiline": {
38
+ "delimiter": "semi",
39
+ "requireLast": true
40
+ },
41
+ "singleline": {
42
+ "delimiter": "semi",
43
+ "requireLast": false
44
+ }
45
+ }
46
+ ]
47
+ }
48
+ }
package/README.md CHANGED
@@ -16,71 +16,27 @@ import { MynahUI } from '@aws/mynah-ui';
16
16
 
17
17
  export const createMynahUI = () => {
18
18
  const mynahUI = new MynahUI({
19
- // initial UI state data
20
- // It doesn't have to be matched with backend data
21
- // but to update the UI and rerender its desired parts,
22
- // it expects the data in type of MynahUIDataModel.
23
- storeData?: MynahUIDataModel;
24
-
25
- // All below items trigger when;
26
- // User hits search button or enter inside query input
27
- onSearch?: (
28
- searchPayload: SearchPayload,
29
- isFromHistory?: boolean,
30
- isFromAutocomplete?: boolean
31
- ) => void;
32
-
33
- // UI is ready
19
+ rootSelector?: string;
20
+ defaults?: MynahUITabStoreTab;
21
+ tabs?: MynahUITabStoreModel;
22
+ config?: ConfigModel;
23
+ onShowMoreWebResultsClick?: (tabId: string, messageId: string) => void;
34
24
  onReady?: () => void;
35
-
36
- // User votes a suggestion
37
- onClickSuggestionVote?: (suggestion: Suggestion, vote: RelevancyVoteType) => void;
38
- // User opens the detail view of selected code block
39
- onClickCodeDetails?: (
40
- code: string,
41
- fileName?: string,
42
- range?: {
43
- start: { row: string; column?: string };
44
- end?: { row: string; column?: string };
45
- }
46
- ) => void;
47
-
48
- // Data store is reset
49
- onResetStore?: () => void;
50
-
51
- // Matching policy is changed (context items)
52
- onChangeContext?: (changeType: ContextChangeType, queryContext: ContextType) => void;
53
-
54
- // When navigation tab is changed
55
- onNavigationTabChange?: (selectedTab: string) => void;
56
-
57
- // User engages with a suggestion
58
- onSuggestionEngagement?: (engagement: SuggestionEngagement) => void;
59
-
60
- // User copies text from suggestion
61
- onSuggestionClipboardInteraction?: (suggestionId: string, type?: string, text?: string) => void;
62
-
63
- // User clicks to the title, clicks or copies the link of the suggestion
64
- onSuggestionInteraction?: (eventName: SuggestionEventName, suggestion: Suggestion) => void;
65
-
66
- // User sends feedback
67
- onSendFeedback?: (feedbackPayload: FeedbackPayload) => void;
68
-
69
- // Search history panel view opens
70
- onRequestHistoryRecords?: (filterPayload: SearchHistoryFilters) => void;
71
-
72
- // Autocomplete items list block opens
73
- onRequestAutocompleteList?: (input: string) => void;
74
-
75
- // User changes live search state
76
- onChangeLiveSearchState?: (liveSearchState: LiveSearchState) => void;
77
-
78
- // User selects and autocomplete item
79
- onClickAutocompleteItem?: (
80
- text: string,
81
- currSelected?: number,
82
- suggestionCount?: number
83
- ) => void;
25
+ onVote?: (tabId: string, messageId: string, vote: RelevancyVoteType) => void;
26
+ onStopChatResponse?: (tabId: string) => void;
27
+ onResetStore?: (tabId: string) => void;
28
+ onChatPrompt?: (tabId: string, prompt: ChatPrompt) => void;
29
+ onFollowUpClicked?: (tabId: string, messageId: string, followUp: ChatItemFollowUp) => void;
30
+ onTabChange?: (tabId: string) => void;
31
+ onTabAdd?: (tabId: string) => void;
32
+ onTabRemove?: (tabId: string) => void;
33
+ onChatItemEngagement?: (tabId: string, messageId: string, engagement: Engagement) => void;
34
+ onCopyCodeToClipboard?: (tabId: string, messageId: string, code?: string, type?: CodeSelectionType, referenceTrackerInformation?: ReferenceTrackerInformation[]) => void;
35
+ onCodeInsertToCursorPosition?: (tabId: string, messageId: string, code?: string, type?: CodeSelectionType, referenceTrackerInformation?: ReferenceTrackerInformation[]) => void;
36
+ onSourceLinkClick?: (tabId: string, messageId: string, link: string, mouseEvent?: MouseEvent) => void;
37
+ onLinkClick?: (tabId: string, messageId: string, link: string, mouseEvent?: MouseEvent) => void;
38
+ onSendFeedback?: (tabId: string, feedbackPayload: FeedbackPayload) => void;
39
+ onOpenDiff?: (tabId: string, filePath: string, deleted: boolean, messageId?: string) => void;
84
40
  });
85
41
  }
86
42
  ```
@@ -92,37 +48,7 @@ import { MynahUI } from '@aws/mynah-ui';
92
48
 
93
49
  export const createMynahUI = () => {
94
50
  let mynahUI:MynahUI;
95
- const getSuggestions = (searchPayload) => {
96
- mynahUI.updateStore({loading: true});
97
- // get suggestions list
98
- const suggestions = await getSuggestions(searchPayload);
99
- if(suggestions){
100
- mynahUI.updateStore({suggestions, loading: false});
101
- } else {
102
- mynahUI.updateStore({loading: false});
103
- mynahUI.notify({
104
- content: "Couldn't get suggestions!",
105
- type: NotificationType.ERROR,
106
- });
107
- }
108
-
109
- }
110
- const mynahUI = new MynahUI({
111
- ...,
112
- onSearch: getSuggestions
113
- });
114
-
115
- // to update the store fully or partially
116
- mynahUI.updateStore(...);
117
-
118
- // set default values for the UI data store fully or partially
119
- mynahUI.setStoreDefaults(...);
120
-
121
- // get current search payload
122
- mynahUI.getSearchPayload();
123
-
124
- // Show a notification balloon
125
- mynahUI.notify(...);
51
+ ...
126
52
  }
127
53
  ```
128
54
 
@@ -130,24 +56,18 @@ In addition to MynahUI class, there are also some exported type definitions that
130
56
 
131
57
  ``` typescript
132
58
  import {
133
- AutocompleteItem,
134
- SearchPayloadCodeSelection,
135
59
  FeedbackPayload,
136
60
  RelevancyVoteType,
137
- LiveSearchState,
138
- SearchPayload,
139
- Suggestion,
140
- ContextType,
141
- SearchHistoryItem,
142
61
  EngagementType,
143
- SuggestionEngagement,
144
- SuggestionEventName,
145
- SearchHistoryFilters,
62
+ Engagement,
146
63
  MynahUIDataModel,
147
- ContextChangeType,
148
- ContextSource,
149
- ContextTypes,
150
64
  NotificationType,
65
+ ChatItem,
66
+ ChatItemFollowUp,
67
+ ChatItemType,
68
+ ChatPrompt,
69
+ SourceLink,
70
+ MynahIcons
151
71
  } from '@aws/mynah-ui';
152
72
  ```
153
73
 
@@ -163,9 +83,10 @@ import './custom-style.css';
163
83
  You can provide any of the following css custom property values:
164
84
  ``` css
165
85
  :root {
166
- font-size: 1rem;
86
+ --mynah-font-family: ...;
87
+ font-size: ...;
167
88
  font-family: ...;
168
-
89
+ --mynah-max-width: ...;
169
90
  --mynah-sizing-base: ...;
170
91
  --mynah-sizing-half: ...;
171
92
  --mynah-sizing-1: ...;
@@ -187,19 +108,22 @@ You can provide any of the following css custom property values:
187
108
  --mynah-sizing-17: ...;
188
109
  --mynah-sizing-18: ...;
189
110
  --mynah-button-border-width: ...;
111
+ --mynah-border-width: ...;
190
112
 
191
- --mynah-color-text-...: ...;
113
+ --mynah-color-text-default: ...;
192
114
  --mynah-color-text-strong: ...;
193
115
  --mynah-color-text-weak: ...;
194
116
  --mynah-color-text-link: ...;
195
117
  --mynah-color-text-input: ...;
196
118
 
197
119
  --mynah-color-bg: ...;
120
+ --mynah-color-bg-alt: ...;
121
+ --mynah-color-tab-active: ...;
198
122
  --mynah-color-light: ...;
199
123
 
200
124
  --mynah-color-deep: ...;
201
125
  --mynah-color-deep-reverse: ...;
202
- --mynah-color-border-...: ...;
126
+ --mynah-color-border-default: ...;
203
127
  --mynah-color-input-bg: ...;
204
128
 
205
129
  --mynah-color-highlight: ...;
@@ -211,6 +135,18 @@ You can provide any of the following css custom property values:
211
135
  --mynah-color-context-reverse: ...;
212
136
  --mynah-color-context-filter: ...;
213
137
 
138
+ --mynah-color-syntax-bg: ...;
139
+ --mynah-color-syntax-variable: ...;
140
+ --mynah-color-syntax-function: ...;
141
+ --mynah-color-syntax-operator: ...;
142
+ --mynah-color-syntax-attr-value: ...;
143
+ --mynah-color-syntax-attr: ...;
144
+ --mynah-color-syntax-property: ...;
145
+ --mynah-color-syntax-comment: ...;
146
+ --mynah-color-syntax-code: ...;
147
+ --mynah-syntax-code-font-family: ...;
148
+ --mynah-syntax-code-font-size: ...;
149
+
214
150
  --mynah-color-status-info: ...;
215
151
  --mynah-color-status-success: ...;
216
152
  --mynah-color-status-warning: ...;
@@ -237,6 +173,7 @@ You can provide any of the following css custom property values:
237
173
  --mynah-shadow-prioritization-menu: ...;
238
174
  --mynah-shadow-feedback-form: ...;
239
175
 
176
+ --mynah-font-size-xxsmall: ...;
240
177
  --mynah-font-size-xsmall: ...;
241
178
  --mynah-font-size-small: ...;
242
179
  --mynah-font-size-medium: ...;
@@ -246,6 +183,7 @@ You can provide any of the following css custom property values:
246
183
  --mynah-card-radius: ...;
247
184
  --mynah-button-radius: ...;
248
185
 
186
+ --mynah-bottom-panel-transition: ...;
249
187
  --mynah-very-short-transition: ...;
250
188
  --mynah-short-transition-transform: ...;
251
189
  --mynah-long-transition: ...;
@@ -259,12 +197,13 @@ You can provide any of the following css custom property values:
259
197
  --mynah-short-transition-turbo-bounce: ...;
260
198
  --mynah-short-transition-bounce: ...;
261
199
 
262
- --mynah-mask-image: ...;
200
+ --mynah-mask-image: ...;
263
201
  --mynah-mask-image-rev: ...;
264
202
  --mynah-mask-image-main: ...;
265
203
  --mynah-mask-image-main-rev: ...;
266
-
267
204
  --mynah-mask-image-skeleton: ...;
205
+
206
+ --mynah-policy-group-filter: ...;
268
207
  }
269
208
  ```
270
209
 
@@ -0,0 +1,36 @@
1
+ /*!
2
+ * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { DomBuilderObject, ExtendedHTMLElement } from '../../helper/dom';
6
+ import { OnCopiedToClipboardFunction, OnInsertToCursorPositionFunction, ReferenceTrackerInformation } from '../../static';
7
+ export declare const highlightersWithTooltip: {
8
+ start: {
9
+ markupStart: string;
10
+ markupAttributes: (markerIndex: string) => string;
11
+ markupEnd: string;
12
+ };
13
+ end: {
14
+ markup: string;
15
+ };
16
+ };
17
+ export interface CardBodyProps {
18
+ body: string;
19
+ children?: Array<ExtendedHTMLElement | HTMLElement | string | DomBuilderObject>;
20
+ highlightRangeWithTooltip?: ReferenceTrackerInformation[];
21
+ onLinkClick?: (url: string, e: MouseEvent) => void;
22
+ onCopiedToClipboard?: OnCopiedToClipboardFunction;
23
+ onInsertToCursorPosition?: OnInsertToCursorPositionFunction;
24
+ }
25
+ export declare class CardBody {
26
+ render: ExtendedHTMLElement;
27
+ props: CardBodyProps;
28
+ private highlightRangeTooltip;
29
+ private highlightRangeTooltipTimeout;
30
+ constructor(props: CardBodyProps);
31
+ private readonly processNode;
32
+ private readonly getReferenceTrackerInformationFromElement;
33
+ private readonly showHighlightRangeTooltip;
34
+ private readonly hideHighlightRangeTooltip;
35
+ private readonly getContentBodyChildren;
36
+ }
@@ -0,0 +1,32 @@
1
+ import { DomBuilderObject, ExtendedHTMLElement } from '../../helper/dom';
2
+ import { EngagementType } from '../../static';
3
+ export interface CardProps extends Partial<DomBuilderObject> {
4
+ border?: boolean;
5
+ background?: boolean;
6
+ padding?: 'small' | 'medium' | 'large' | 'none';
7
+ children?: Array<HTMLElement | ExtendedHTMLElement | string>;
8
+ onCardEngaged?: (engagement: {
9
+ engagementDurationTillTrigger: number;
10
+ engagementType: EngagementType;
11
+ totalMouseDistanceTraveled: {
12
+ x: number;
13
+ y: number;
14
+ };
15
+ selectionDistanceTraveled?: {
16
+ x: number;
17
+ y: number;
18
+ selectedText?: string | undefined;
19
+ };
20
+ }) => void;
21
+ }
22
+ export declare class Card {
23
+ private readonly props;
24
+ private engagementStartTime;
25
+ private totalMouseDistanceTraveled;
26
+ private previousMousePosition;
27
+ private mouseDownInfo;
28
+ render: ExtendedHTMLElement;
29
+ constructor(props: CardProps);
30
+ private readonly resetEngagement;
31
+ private readonly handleEngagement;
32
+ }
@@ -4,25 +4,21 @@
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { ChatItem } from '../../static';
7
- import { SuggestionCardBody } from '../suggestion-card/suggestion-card-body';
7
+ import { CardBody } from '../card/card-body';
8
8
  export interface ChatItemCardProps {
9
9
  tabId: string;
10
10
  chatItem: ChatItem;
11
11
  }
12
12
  export declare class ChatItemCard {
13
- private readonly props;
14
- private readonly relatedContentWrapper;
15
- private readonly referencesWrapper;
16
- private readonly showMoreButtonBlock;
17
- private relatedContentPreview;
18
- private relatedContentPreviewTimeout;
13
+ readonly props: ChatItemCardProps;
19
14
  render: ExtendedHTMLElement;
20
- suggestionCardBody: SuggestionCardBody;
15
+ contentBody: CardBody;
21
16
  chatAvatar: ExtendedHTMLElement;
17
+ private updateTimer;
22
18
  constructor(props: ChatItemCardProps);
23
- private readonly checkIsMuted;
24
- private readonly showLinkPreview;
25
- private readonly hideLinkPreview;
19
+ private readonly generateCard;
20
+ private readonly getCardClasses;
21
+ private readonly getCardContent;
26
22
  private readonly getChatAvatar;
27
- readonly updateAnswerBody: (body: ExtendedHTMLElement | HTMLElement | string) => void;
23
+ readonly updateCard: (updateWith: Partial<ChatItem>) => void;
28
24
  }
@@ -11,5 +11,9 @@ export interface ChatItemFollowUpProps {
11
11
  export declare class ChatItemFollowUpContainer {
12
12
  private readonly props;
13
13
  render: ExtendedHTMLElement;
14
+ private followupTooltip;
15
+ private followupTooltipTimeout;
14
16
  constructor(props: ChatItemFollowUpProps);
17
+ private readonly showCroppedFollowupText;
18
+ private readonly hideCroppedFollowupText;
15
19
  }
@@ -0,0 +1,19 @@
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 { SourceLink } from '../../static';
7
+ export interface ChatItemSourceLinksContainerProps {
8
+ tabId: string;
9
+ messageId: string;
10
+ title?: string;
11
+ relatedContent?: SourceLink[];
12
+ }
13
+ export declare class ChatItemSourceLinksContainer {
14
+ private readonly props;
15
+ private readonly showMoreButtonBlock;
16
+ render: ExtendedHTMLElement;
17
+ chatAvatar: ExtendedHTMLElement;
18
+ constructor(props: ChatItemSourceLinksContainerProps);
19
+ }
@@ -0,0 +1,15 @@
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 { ReferenceTrackerInformation } from '../../static';
7
+ export interface ChatItemTreeViewLicenseProps {
8
+ referenceSuggestionLabel: string;
9
+ references: ReferenceTrackerInformation[];
10
+ }
11
+ export declare class ChatItemTreeViewLicense {
12
+ render: ExtendedHTMLElement;
13
+ constructor(props: ChatItemTreeViewLicenseProps);
14
+ private readonly buildDropdownChildren;
15
+ }
@@ -3,10 +3,14 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
+ import { ReferenceTrackerInformation } from '../../static';
6
7
  export interface ChatItemTreeViewWrapperProps {
7
8
  tabId: string;
8
9
  messageId: string;
9
10
  files: string[];
11
+ deletedFiles: string[];
12
+ referenceSuggestionLabel: string;
13
+ references: ReferenceTrackerInformation[];
10
14
  }
11
15
  export declare class ChatItemTreeViewWrapper {
12
16
  render: ExtendedHTMLElement;
@@ -0,0 +1,16 @@
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
+ export interface ChatPromptInputCommandProps {
7
+ command: string;
8
+ onRemoveClick: () => void;
9
+ }
10
+ export declare class ChatPromptInputCommand {
11
+ render: ExtendedHTMLElement;
12
+ private readonly props;
13
+ private readonly promptTextInputCommand;
14
+ constructor(props: ChatPromptInputCommandProps);
15
+ setCommand: (command: string) => void;
16
+ }
@@ -0,0 +1,12 @@
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
+ export interface ChatPromptInputInfoProps {
7
+ tabId: string;
8
+ }
9
+ export declare class ChatPromptInputInfo {
10
+ render: ExtendedHTMLElement;
11
+ constructor(props: ChatPromptInputInfoProps);
12
+ }
@@ -3,6 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
+ export declare const MAX_USER_INPUT = 4000;
6
7
  export interface ChatPromptInputProps {
7
8
  tabId: string;
8
9
  }
@@ -10,20 +11,23 @@ export declare class ChatPromptInput {
10
11
  render: ExtendedHTMLElement;
11
12
  private readonly props;
12
13
  private readonly attachmentWrapper;
13
- private readonly promptTextInputWrapper;
14
14
  private readonly promptTextInput;
15
- private readonly promptTextInputSizer;
15
+ private readonly promptTextInputCommand;
16
+ private readonly remainingCharsIndicator;
16
17
  private readonly sendButton;
18
+ private readonly codeSnippet;
17
19
  private quickActionCommands;
18
20
  private commandSelector;
19
21
  private commandSelectorOpen;
20
- private inputDisabled;
22
+ private selectedCommand;
21
23
  private attachment?;
22
24
  private filteredCommandsList;
23
25
  constructor(props: ChatPromptInputProps);
26
+ private readonly updateAvailableCharactersIndicator;
24
27
  private readonly handleInputKeydown;
25
28
  private readonly getQuickCommandActions;
26
- private readonly calculateTextAreaHeight;
27
- private readonly resetTextAreaHeight;
29
+ private readonly handleCommandSelection;
30
+ readonly clearTextArea: () => void;
31
+ readonly addText: (textToAdd: string) => void;
28
32
  private readonly sendPrompt;
29
33
  }
@@ -3,7 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
- import { Suggestion } from '../../static';
6
+ import { ChatItem } from '../../static';
7
7
  export interface ChatWrapperProps {
8
8
  onStopChatResponse?: (tabId: string) => void;
9
9
  tabId: string;
@@ -12,14 +12,13 @@ export declare class ChatWrapper {
12
12
  private readonly props;
13
13
  private readonly chatItemsContainer;
14
14
  private readonly intermediateBlockContainer;
15
+ private readonly promptInputElement;
15
16
  private readonly promptInput;
17
+ private readonly promptInfo;
16
18
  private lastChatItemCard;
17
19
  render: ExtendedHTMLElement;
18
20
  constructor(props: ChatWrapperProps);
19
21
  private readonly insertChatItem;
20
- removeAllExceptAnswersAndPrompts: () => void;
21
- updateLastCharAnswerStream: (updateWith: string | {
22
- title: string | boolean;
23
- suggestions: Suggestion[];
24
- }) => void;
22
+ updateLastChatAnswer: (updateWith: Partial<ChatItem>) => void;
23
+ addToPrompt: (textToAdd: string) => void;
25
24
  }
@@ -0,0 +1,14 @@
1
+ import { ExtendedHTMLElement } from '../../../helper/dom';
2
+ export interface ICodeSnippetWidgetProps {
3
+ tabId: string;
4
+ markdownText: string;
5
+ }
6
+ export declare class CodeSnippetWidget {
7
+ private readonly props;
8
+ private previewOverlay;
9
+ render: ExtendedHTMLElement;
10
+ constructor(props: ICodeSnippetWidgetProps);
11
+ private readonly showPreviewOverLay;
12
+ private readonly closePreviewOverLay;
13
+ private readonly renderCodeSnippetWidget;
14
+ }
@@ -0,0 +1,16 @@
1
+ import { ExtendedHTMLElement } from '../../../helper/dom';
2
+ export interface ICodeSnippetProps {
3
+ tabId: string;
4
+ }
5
+ export interface ISelectCodeSnippetEvent {
6
+ tabId: string;
7
+ selectedCodeSnippet?: string;
8
+ }
9
+ export declare class CodeSnippet {
10
+ private readonly _props;
11
+ private readonly _render;
12
+ constructor(props: ICodeSnippetProps);
13
+ get render(): ExtendedHTMLElement;
14
+ readonly updateSelectedCodeSnippet: (selectedCodeSnippet: string | undefined) => void;
15
+ readonly clear: () => void;
16
+ }
@@ -0,0 +1,21 @@
1
+ import { ExtendedHTMLElement } from '../../../helper/dom';
2
+ export interface IPromptTextInputProps {
3
+ tabId: string;
4
+ onKeydown: (e: KeyboardEvent) => void;
5
+ onInput?: (e: KeyboardEvent) => void;
6
+ }
7
+ export declare class PromptTextInput {
8
+ private readonly _props;
9
+ private readonly _render;
10
+ private readonly _promptTextInputSizer;
11
+ private readonly _promptTextInput;
12
+ constructor(props: IPromptTextInputProps);
13
+ get render(): ExtendedHTMLElement;
14
+ private readonly updatePromptTextInputSizer;
15
+ readonly clear: () => void;
16
+ readonly focus: () => void;
17
+ readonly getTextInputValue: () => string;
18
+ readonly updateTextInputValue: (value: string) => void;
19
+ readonly updateTextInputMaxLength: (maxLength: number) => void;
20
+ readonly updateTextInputPlaceholder: (text: string) => void;
21
+ }
@@ -0,0 +1,11 @@
1
+ import { ExtendedHTMLElement } from '../../../helper/dom';
2
+ export interface ISendButtonProps {
3
+ tabId: string;
4
+ onClick: () => void;
5
+ }
6
+ export declare class SendButton {
7
+ private readonly _props;
8
+ private readonly _render;
9
+ constructor(props: ISendButtonProps);
10
+ get render(): ExtendedHTMLElement;
11
+ }
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { DomBuilderObject, ExtendedHTMLElement } from '../helper/dom';
6
+ interface CollapsibleContentProps {
7
+ title: string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
8
+ children: Array<string | ExtendedHTMLElement | HTMLElement | DomBuilderObject>;
9
+ classNames?: string[];
10
+ initialCollapsedState?: boolean;
11
+ onCollapseStateChange?: (collapsed: boolean) => void;
12
+ }
13
+ export declare class CollapsibleContent {
14
+ render: ExtendedHTMLElement;
15
+ private readonly props;
16
+ private readonly uid;
17
+ private icon;
18
+ constructor(props: CollapsibleContentProps);
19
+ }
20
+ export {};
@@ -8,10 +8,16 @@ export interface TabsProps {
8
8
  }
9
9
  export declare class Tabs {
10
10
  render: ExtendedHTMLElement;
11
- private tabIdSubscriptions;
11
+ private tabIdTitleSubscriptions;
12
+ private tabIdChatItemsSubscriptions;
12
13
  private toggleGroup;
14
+ private previewOverlay;
13
15
  private readonly props;
14
16
  constructor(props: TabsProps);
15
17
  private readonly getTabOptionsFromTabStoreData;
16
18
  private readonly getTabsRender;
19
+ private readonly showPreviewOverLay;
20
+ private readonly closePreviewOverLay;
21
+ private readonly assignListener;
22
+ private readonly removeListenerAssignments;
17
23
  }