@aws/mynah-ui 2.0.0-beta.1 → 2.0.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
@@ -7,40 +7,17 @@ export interface MynahUIDataModel {
7
7
  loading?: boolean;
8
8
  loadingChat?: boolean;
9
9
  showChatAvatars?: boolean;
10
- liveSearchState?: LiveSearchState;
11
- liveSearchAnimation?: boolean;
12
- query?: string;
13
10
  chatMessageOnTopOfSearchResults?: string;
14
- code?: string;
15
- codeSelection?: SearchPayloadCodeSelection;
16
- codeQuery?: SearchPayloadCodeQuery;
17
- matchPolicy?: SearchPayloadMatchPolicy;
18
- invisibleContextItems?: string[];
19
11
  navigationTabs?: ToggleOption[];
20
12
  sideNavigationTabs?: ToggleOption[];
21
- userAddedContext?: string[];
22
13
  mode?: MynahMode;
23
14
  suggestions?: Suggestion[];
24
15
  chatItems?: ChatItem[];
25
- autoCompleteSuggestions?: AutocompleteItem[];
26
- searchHistory?: SearchHistoryItem[];
27
- showingHistoricalSearch?: boolean;
28
- headerInfo?: {
29
- content: string;
30
- type?: NotificationType;
31
- };
32
16
  }
33
17
  export declare enum MynahEventNames {
34
18
  RESET_STORE = "resetStore",
35
- CONTEXT_VISIBILITY_CHANGE = "contextVisibilityChange",
36
- AUTOCOMPLETE_SUGGESTION_CLICK = "autoCompleteSuggestionClick",
37
19
  SEARCH = "search",
38
- INPUT_QUERY_CHANGE = "inputQueryChange",
39
- REQUEST_SEARCH_HISTORY = "requestSearchHistory",
40
- SEARCH_HISTORY_ITEM_CLICK = "searchHistoryItemClick",
41
- LIVE_SEARCH_STATE_CHANGED = "liveSearchStateChanged",
42
20
  FEEDBACK_SET = "feedbackSet",
43
- CODE_DETAILS_CLICK = "codeDetailsClick",
44
21
  SUGGESTION_VOTE = "suggestionVote",
45
22
  SUGGESTION_OPEN = "suggestionOpen",
46
23
  SUGGESTION_LINK_COPY = "suggestionLinkCopy",
@@ -81,22 +58,7 @@ export interface SearchPayloadCodeSelection {
81
58
  name: string;
82
59
  };
83
60
  }
84
- export interface FullyQualifiedName {
85
- source: string[];
86
- symbol: string[];
87
- }
88
- export interface SearchPayloadCodeQuery {
89
- simpleNames: string[];
90
- fullyQualifiedNames: {
91
- used: FullyQualifiedName[];
92
- };
93
- }
94
61
  export interface SearchPayload {
95
- query: string;
96
- matchPolicy: SearchPayloadMatchPolicy;
97
- codeSelection: SearchPayloadCodeSelection;
98
- codeQuery?: SearchPayloadCodeQuery;
99
- code?: string;
100
62
  selectedTab?: string;
101
63
  }
102
64
  export interface SuggestionMetaData {
@@ -116,11 +78,9 @@ export interface CanonicalExample {
116
78
  };
117
79
  }
118
80
  export interface Suggestion {
119
- id: string;
120
81
  title: string;
121
82
  url: string;
122
- body: string;
123
- context: string[];
83
+ body?: string;
124
84
  type?: string;
125
85
  metadata?: SuggestionMetaDataUnion | CanonicalExample;
126
86
  }
@@ -153,7 +113,7 @@ export interface ChatPrompt {
153
113
  attachment?: Suggestion;
154
114
  }
155
115
  export interface ChatItemFollowUp extends ChatPrompt {
156
- type: string;
116
+ type?: string;
157
117
  pillText: string;
158
118
  }
159
119
  export declare enum MynahMode {
@@ -180,11 +140,6 @@ export declare enum KeyMap {
180
140
  CONTROL = "Control",
181
141
  ALT = "Alt"
182
142
  }
183
- export declare enum LiveSearchState {
184
- PAUSE = "pauseLiveSearch",
185
- RESUME = "resumeLiveSearch",
186
- STOP = "stopLiveSearch"
187
- }
188
143
  export declare const SupportedCodingLanguages: string[];
189
144
  declare type ElementType<T extends readonly unknown[]> = T extends ReadonlyArray<infer ElementType> ? ElementType : never;
190
145
  export declare type SupportedCodingLanguagesType = ElementType<typeof SupportedCodingLanguages>;
@@ -196,55 +151,6 @@ export declare const SupportedCodingLanguagesExtensionToTypeMap: {
196
151
  json: string;
197
152
  };
198
153
  export declare type OnCopiedToClipboardFunction = (type?: 'selection' | 'block', text?: string) => void;
199
- export interface SearchHistoryFilters {
200
- /**
201
- * Flag to define are we looking in global search-history or only in worplace
202
- *
203
- * @default - Search will be performed on workplace store
204
- */
205
- isGlobal: boolean;
206
- /**
207
- * Flag to define are we looking only for queries which were manually typed by the user,
208
- * or only for quries whic were generated by plugin itself, or it's not important
209
- *
210
- * @default - We won't filter records bases on type of input
211
- */
212
- isManualSearch?: boolean;
213
- /**
214
- * Array of language filters. If user chose some, the results would be filtered
215
- *
216
- * @default - We won't filter records bases on languages
217
- */
218
- languages: string[];
219
- /**
220
- * User text from search bar in search-history part of UI
221
- *
222
- * @default - We won't filter records bases on user input in search-history search bar
223
- */
224
- text?: string;
225
- /**
226
- * Allow us to skip n-first results
227
- *
228
- * @default - The starting offset will be 0
229
- */
230
- resultOffset: number;
231
- /**
232
- * Limit of how many results we want to get from store
233
- *
234
- * @default - The records count won't be limited
235
- */
236
- resultLimit?: number;
237
- }
238
- export interface CodeQuery {
239
- simpleNames: string[];
240
- fullyQualifiedNames: {
241
- used: FullyQualifiedName[];
242
- };
243
- }
244
- export declare enum ContextChangeType {
245
- 'ADD' = "add",
246
- 'REMOVE' = "remove"
247
- }
248
154
  export declare enum SuggestionEventName {
249
155
  OPEN = "openSuggestion",
250
156
  COPY = "copy"
@@ -253,96 +159,30 @@ export declare enum RelevancyVoteType {
253
159
  UP = "upvote",
254
160
  DOWN = "downvote"
255
161
  }
256
- /**
257
- * 'interaction' will be set if there was a potential text selection or a click input was triggered by the user.
258
- * If this is a selection selectionDistanceTraveled object will also be filled
259
- * 'timespend' will be set basically if there is no interaction except mouse movements in a time spent longer than the ENGAGEMENT_DURATION_LIMIT
260
- * Don't forget that in 'timespend' case, user should leave the suggestion card at some point to count it as an interaction.
261
- * (They need to go back to the code or move to another card instead)
262
- */
263
162
  export declare enum EngagementType {
264
163
  INTERACTION = "interaction",
265
164
  TIME = "timespend"
266
165
  }
267
166
  export interface SuggestionEngagement {
268
- /**
269
- * Suggestion information
270
- */
271
167
  suggestion: Suggestion;
272
- /**
273
- * Engagement type
274
- */
275
168
  engagementType: EngagementType;
276
- /**
277
- * Total duration in ms till the engagement triggered.
278
- */
279
169
  engagementDurationTillTrigger: number;
280
- /**
281
- * This is a little bit more than what you might expect on a normal scroll position of the suggestion card.
282
- * This attribute gives the value for how much the users traveled their mouses and additionally how much they scrolled to focus on that suggestion
283
- */
284
170
  scrollDistanceToEngage: number;
285
- /**
286
- * Total mouse movement in x and y directions till the engagament triggered.
287
- * To avoid confusion: this is not the distance between start and end points, this is the total traveled distance.
288
- */
289
171
  totalMouseDistanceTraveled: {
290
172
  x: number;
291
173
  y: number;
292
174
  };
293
- /**
294
- * If the engagementType is "interaction" and this object has a value, you can assume it as a text selection.
295
- * If the engagementType is "interaction" but this object is not defined, you can assume it as a click
296
- */
297
175
  selectionDistanceTraveled?: {
298
176
  x: number;
299
177
  y: number;
300
178
  selectedText?: string;
301
179
  };
302
180
  }
303
- export interface SearchHistoryItem {
304
- query: {
305
- input: string;
306
- queryContext: SearchPayloadMatchPolicy;
307
- queryId?: string;
308
- trigger: string;
309
- codeQuery: CodeQuery;
310
- codeSelection: SearchPayloadCodeSelection;
311
- code?: string;
312
- selectedTab?: string;
313
- };
314
- recordDate?: number;
315
- suggestions: Suggestion[];
316
- }
317
- export declare enum ContextTypes {
318
- MUST = "must",
319
- SHOULD = "should",
320
- MUST_NOT = "mustNot"
321
- }
322
- export declare enum ContextSource {
323
- AUTO = "auto",
324
- USER = "user",
325
- SUGGESTION = "suggestion"
326
- }
327
- export declare enum ContextTypeClassNames {
328
- should = "mynah-should-contain",
329
- must = "mynah-must-contain",
330
- mustNot = "mynah-must-not-contain"
331
- }
332
- export interface ContextType {
333
- context: string;
334
- type?: ContextTypes;
335
- source: ContextSource;
336
- }
337
181
  export declare type FeedbackStars = 1 | 2 | 3 | 4 | 5;
338
182
  export interface FeedbackPayload {
339
183
  stars?: FeedbackStars;
340
184
  comment?: string;
341
185
  }
342
- export interface AutocompleteItem {
343
- suggestion: string;
344
- highlight: string;
345
- }
346
186
  export declare enum NotificationType {
347
187
  INFO = "info",
348
188
  SUCCESS = "ok-circled",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws/mynah-ui",
3
3
  "displayName": "AWS Mynah UI",
4
- "version": "2.0.0-beta.1",
4
+ "version": "2.0.0-beta.2",
5
5
  "description": "AWS Tookit VSCode and Intellij IDE Extension Mynah UI",
6
6
  "publisher": "Amazon Web Services",
7
7
  "license": "Apache License 2.0",
@@ -1,16 +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 { ContextType } from '../static';
6
- import { ExtendedHTMLElement } from '../helper/dom';
7
- export interface ContextPillProps {
8
- context: ContextType;
9
- showRemoveButton?: boolean;
10
- }
11
- export declare class ContextPill {
12
- private readonly props;
13
- render: ExtendedHTMLElement;
14
- constructor(props: ContextPillProps);
15
- private readonly handleMenuOpen;
16
- }
@@ -1,18 +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 { ContextType } from '../static';
6
- import { ExtendedHTMLElement } from '../helper/dom';
7
- export interface PrioritizationMenuButtonsProps {
8
- context: ContextType;
9
- referenceElement: Element | ExtendedHTMLElement;
10
- onMenuClose: () => void;
11
- }
12
- export declare class PrioritizationMenuButtons {
13
- private menuOverlay;
14
- private readonly props;
15
- constructor(props: PrioritizationMenuButtonsProps);
16
- createOverlay(): void;
17
- private readonly handlePrioritizationButtonClick;
18
- }
@@ -1,20 +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 { AutocompleteItem } from '../../static';
6
- import { ExtendedHTMLElement } from '../../helper/dom';
7
- export interface AutocompleteCardContentProps {
8
- searchQuery: string;
9
- content: AutocompleteItem;
10
- onAutocompleteClick: (autocompleteQuery: AutocompleteItem, index: number) => void;
11
- index: number;
12
- isHovered: boolean | false;
13
- }
14
- export declare class AutocompleteCardContent {
15
- render: ExtendedHTMLElement;
16
- openSearch: any;
17
- searchQuery: string;
18
- constructor(props: AutocompleteCardContentProps);
19
- private formatSuggestion;
20
- }
@@ -1,32 +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 { AutocompleteItem } from '../../static';
6
- import { ExtendedHTMLElement } from '../../helper/dom';
7
- export interface AutocompleteContentProps {
8
- searchQuery: string;
9
- referenceElement: Element | ExtendedHTMLElement;
10
- autocompleteSuggestions: AutocompleteItem[];
11
- onClose?: () => void;
12
- }
13
- export declare class AutocompleteContent {
14
- private readonly autocompleteItemsOverlay;
15
- suggestions: AutocompleteItem[];
16
- private searchQuery;
17
- private currHover;
18
- private readonly props;
19
- private isUsed;
20
- render: ExtendedHTMLElement;
21
- constructor(props: AutocompleteContentProps);
22
- autocompleteCards: (autocompleteSuggestions: AutocompleteItem[], hovered: number) => ExtendedHTMLElement[];
23
- private readonly handleAutocompleteClick;
24
- updateSuggestions: (autocompleteSuggestions: AutocompleteItem[], hoverQuery: number) => void;
25
- updateQuery: (searchQuery: string) => void;
26
- hover: (isUp: boolean) => string;
27
- setIsUsed: (val: boolean) => void;
28
- getIsUsed: () => boolean;
29
- getCurrentSelected: () => number;
30
- getSuggestionsCount: () => number;
31
- close: () => void;
32
- }
@@ -1,14 +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
- export declare class SearchApiHelp {
7
- render: ExtendedHTMLElement;
8
- private isCollapsed;
9
- constructor();
10
- private readonly hide;
11
- private readonly show;
12
- private readonly updateContent;
13
- private readonly onCodeDetailsClicked;
14
- }
@@ -1,11 +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
- export declare class SearchCardHeader {
7
- private readonly infoBar;
8
- render: ExtendedHTMLElement;
9
- constructor();
10
- private readonly getHeaderInfoContent;
11
- }
@@ -1,19 +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
- export declare class SearchCard {
7
- private unfoldedByContextInsertion;
8
- private unfoldedByButton;
9
- private readonly searchInput;
10
- private readonly searchAPIHelp;
11
- private readonly liveSearchToggle;
12
- private readonly foldUnfoldButton;
13
- private readonly contextManagement;
14
- private readonly searchCardHeader;
15
- render: ExtendedHTMLElement;
16
- constructor();
17
- addFocusOnInput: () => void;
18
- setFolded: (folded: boolean) => void;
19
- }
@@ -1,30 +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 { SearchPayloadMatchPolicy } from '../../static';
7
- export interface SearchContextProps {
8
- initContextList?: SearchPayloadMatchPolicy;
9
- onContextInsertionEnabled?: () => void;
10
- onContextInsertionDisabled?: () => void;
11
- }
12
- export declare class SearchContext {
13
- private readonly allowedCharCount;
14
- private readonly contextCheckExpression;
15
- private readonly isAcceptedKeyPress;
16
- private readonly acceptedNagivationKeys;
17
- private renderedContextMap;
18
- private readonly onContextInsertionEnabled;
19
- private readonly onContextInsertionDisabled;
20
- constructor(props?: SearchContextProps);
21
- private readonly enableContextInsertion;
22
- private readonly disableContextInsertion;
23
- private readonly createContextItemElements;
24
- private readonly contextInsertionKeydownHandler;
25
- private readonly inputAutoWidth;
26
- private contextInsertionInput;
27
- private readonly contextInsertionButton;
28
- private readonly contextWrapper;
29
- render: ExtendedHTMLElement;
30
- }
@@ -1,16 +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 { SearchHistoryItem } from '../../static';
7
- export interface HistoryCardContentProps {
8
- content: SearchHistoryItem;
9
- onHistoryItemClick: (historyItem: SearchHistoryItem) => void;
10
- }
11
- export declare class HistoryCardContent {
12
- render: ExtendedHTMLElement;
13
- openSearch: any;
14
- private getSearchHitoryRecordTitle;
15
- constructor(props: HistoryCardContentProps);
16
- }
@@ -1,19 +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 { SearchHistoryItem } from '../../static';
7
- export interface HistoryContentProps {
8
- referenceElement: Element | ExtendedHTMLElement;
9
- searchHistory: SearchHistoryItem[];
10
- }
11
- export declare class HistoryContent {
12
- private historyItemsOverlay;
13
- private readonly props;
14
- render: ExtendedHTMLElement;
15
- constructor(props: HistoryContentProps);
16
- createOverlay(): void;
17
- searchHistoryCards: (historyItems: SearchHistoryItem[]) => ExtendedHTMLElement[];
18
- private readonly handleHistoryChange;
19
- }
@@ -1,22 +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
- export declare class SearchInput {
7
- render: ExtendedHTMLElement;
8
- private searchTextInput;
9
- private readonly searchButton;
10
- private readonly searchHistoryButton;
11
- private readonly remainingIndicator;
12
- private autocompleteContent;
13
- private readonly allowedCharCount;
14
- private codeSelectionAvailable;
15
- constructor();
16
- addFocusOnInput: () => void;
17
- private readonly handleInputKeydown;
18
- private readonly triggerSearch;
19
- private readonly triggerSearchHistory;
20
- private readonly handleAutocompleteSuggestions;
21
- private readonly setWaitState;
22
- }
@@ -1,15 +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
- export interface SearchLiveToggleProps {
7
- label: string;
8
- }
9
- export declare class SearchLiveToggle {
10
- render: ExtendedHTMLElement;
11
- private readonly toggle;
12
- private queryChangeSubscriptionId;
13
- constructor(props: SearchLiveToggleProps);
14
- flashToggle: () => void;
15
- }
@@ -1,12 +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
- export interface SuggestionCardContextWrapperProps {
7
- contextList: string[];
8
- }
9
- export declare class SuggestionCardContextWrapper {
10
- render: ExtendedHTMLElement;
11
- constructor(props: SuggestionCardContextWrapperProps);
12
- }