@aws/mynah-ui 1.0.0 → 1.1.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
@@ -2,6 +2,23 @@
2
2
  * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
+ export interface MynahUIDataModel {
6
+ loading?: boolean;
7
+ liveSearchState?: LiveSearchState;
8
+ query?: string;
9
+ code?: string;
10
+ codeSelection?: SearchPayloadCodeSelection;
11
+ codeQuery?: SearchPayloadCodeQuery;
12
+ matchPolicy?: SearchPayloadMatchPolicy;
13
+ userAddedContext?: string[];
14
+ suggestions?: Suggestion[];
15
+ autoCompleteSuggestions?: AutocompleteItem[];
16
+ searchHistory?: SearchHistoryItem[];
17
+ headerInfo?: {
18
+ content: string;
19
+ type?: NotificationType;
20
+ };
21
+ }
5
22
  export interface ServiceConnector {
6
23
  liveSearchHandler?: (searchPayload?: SearchPayload, suggestions?: Suggestion[]) => void;
7
24
  liveSearchStateExternalChangeHandler?: (state: LiveSearchState) => void;
@@ -29,14 +46,24 @@ export interface ServiceConnector {
29
46
  toggleLiveSearch?: (liveSearchState: LiveSearchState, onFeedReceived: (searchPayload?: SearchPayload, suggestions?: Suggestion[]) => void) => void;
30
47
  clickAutocompleteSuggestionItem: (text: string, currSelected?: number, suggestionCount?: number) => void;
31
48
  }
32
- export interface StateManager {
33
- getState: () => Record<string, any>;
34
- setState: (state: Record<string, any>) => void;
49
+ export declare enum MynahEventNames {
50
+ RESET_STORE = "resetStore",
51
+ CONTEXT_VISIBILITY_CHANGE = "contextVisibilityChange",
52
+ REQUEST_AUTOCOMPLETE_SUGGESTIONS = "requestAutocompleteSuggestions",
53
+ AUTOCOMPLETE_SUGGESTION_CLICK = "autoCompleteSuggestionClick",
54
+ SEARCH = "search",
55
+ REQUEST_SEARCH_HISTORY = "requestSearchHistory",
56
+ SEARCH_HISTORY_ITEM_CLICK = "searchHistoryItemClick",
57
+ LIVE_SEARCH_STATE_CHANGED = "liveSearchStateChanged",
58
+ FEEDBACK_SET = "feedbackSet",
59
+ CODE_DETAILS_CLICK = "codeDetailsClick",
60
+ SUGGESTION_VOTE = "suggestionVote",
61
+ SUGGESTION_OPEN = "suggestionOpen",
62
+ SUGGESTION_LINK_CLICK = "suggestionLinkClick",
63
+ SUGGESTION_LINK_COPY = "suggestionLinkCopy",
64
+ SUGGESTION_ENGAGEMENT = "suggestionEngagement",
65
+ SUGGESTION_COPY_TO_CLIPBOARD = "suggestionCopyToClipboard"
35
66
  }
36
- export declare const MynahEventNames: {
37
- CONTEXT_VISIBILITY_CHANGE: string;
38
- REMOVE_ALL_CONTEXT: string;
39
- };
40
67
  export declare const MynahPortalNames: {
41
68
  WRAPPER: string;
42
69
  OVERLAY: string;
@@ -72,6 +99,7 @@ export interface SearchPayload {
72
99
  matchPolicy: SearchPayloadMatchPolicy;
73
100
  codeSelection: SearchPayloadCodeSelection;
74
101
  codeQuery?: SearchPayloadCodeQuery;
102
+ code?: string;
75
103
  }
76
104
  export interface SuggestionMetaData {
77
105
  site: string;
@@ -126,7 +154,6 @@ export declare const SupportedCodingLanguagesExtensionToTypeMap: {
126
154
  json: string;
127
155
  };
128
156
  export declare type OnCopiedToClipboardFunction = (type?: 'selection' | 'block', text?: string) => void;
129
- export declare type OnCopiedToClipboardFunctionWithSuggestionId = (suggestionId: string, type?: 'selection' | 'block', text?: string) => void;
130
157
  export interface SearchHistoryFilters {
131
158
  /**
132
159
  * Flag to define are we looking in global search-history or only in worplace
@@ -238,6 +265,7 @@ export interface SearchHistoryItem {
238
265
  trigger: string;
239
266
  codeQuery: CodeQuery;
240
267
  codeSelection: SearchPayloadCodeSelection;
268
+ code?: string;
241
269
  };
242
270
  recordDate?: number;
243
271
  suggestions: Suggestion[];
@@ -260,8 +288,6 @@ export declare enum ContextTypeClassNames {
260
288
  export interface ContextType {
261
289
  context: string;
262
290
  type?: ContextTypes;
263
- availableInSuggestion?: boolean;
264
- visible?: boolean;
265
291
  source: ContextSource;
266
292
  }
267
293
  export declare type FeedbackStars = 1 | 2 | 3 | 4 | 5;
@@ -273,4 +299,10 @@ export interface AutocompleteItem {
273
299
  suggestion: string;
274
300
  highlight: string;
275
301
  }
302
+ export declare enum NotificationType {
303
+ INFO = "info",
304
+ SUCCESS = "ok-circled",
305
+ WARNING = "warning",
306
+ ERROR = "error"
307
+ }
276
308
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws/mynah-ui",
3
3
  "displayName": "AWS Mynah UI",
4
- "version": "1.0.0",
4
+ "version": "1.1.1",
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",
@@ -28,7 +28,7 @@
28
28
  "@types/estree": "0.0.49",
29
29
  "@types/glob": "7.1.3",
30
30
  "@types/json-schema": "7.0.7",
31
- "@types/node": "12.20.12",
31
+ "@types/node": "17.0.29",
32
32
  "@types/prismjs": "1.26.0",
33
33
  "@typescript-eslint/eslint-plugin": "5.34.0",
34
34
  "css-loader": "6.6.0",
@@ -1,34 +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 './dom';
6
- import { ContextSource, ContextTypes, ContextType, SearchPayloadMatchPolicy } from '../static';
7
- export interface ContextCheckboxProps {
8
- context: ContextType;
9
- }
10
- export declare class ContextCheckbox {
11
- render: ExtendedHTMLElement[];
12
- constructor(props: ContextCheckboxProps);
13
- }
14
- export declare const ContextTypePriorityMap: string[];
15
- export declare const EmptyContextObject: {
16
- context: string;
17
- visible: boolean;
18
- availableInSuggestion: boolean;
19
- type: ContextTypes;
20
- source: ContextSource;
21
- };
22
- export declare class ContextManager {
23
- private static instance;
24
- contextMap: Record<string, ContextType>;
25
- private contextCheckboxes;
26
- static getInstance(): ContextManager;
27
- removeAll: () => void;
28
- clear: () => void;
29
- areContextItemsIdentical: (context: ContextType, contextToCompare: ContextType) => boolean;
30
- addOrUpdateContext: (context: ContextType, dispatchEvent?: boolean) => ContextType;
31
- removeContext: (contextKey: string) => void;
32
- getContextObjectFromKey: (contextKey: string) => ContextType;
33
- getContextMatchPolicy: () => SearchPayloadMatchPolicy;
34
- }