@aws/mynah-ui 1.0.0

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 (47) hide show
  1. package/CODE_OF_CONDUCT.md +4 -0
  2. package/CONTRIBUTING.md +59 -0
  3. package/LICENSE +175 -0
  4. package/NOTICE +1 -0
  5. package/README.md +187 -0
  6. package/THIRD-PARTY-LICENSES +27 -0
  7. package/dist/components/button.d.ts +20 -0
  8. package/dist/components/context-item.d.ts +16 -0
  9. package/dist/components/feedback-form/feedback-form-comment.d.ts +15 -0
  10. package/dist/components/feedback-form/feedback-form-stars.d.ts +15 -0
  11. package/dist/components/feedback-form/feedback-form.d.ts +22 -0
  12. package/dist/components/icon.d.ts +51 -0
  13. package/dist/components/main-container.d.ts +29 -0
  14. package/dist/components/notification/notification.d.ts +48 -0
  15. package/dist/components/overlay/overlay.d.ts +82 -0
  16. package/dist/components/prioritization-menu.d.ts +18 -0
  17. package/dist/components/search-block/autocomplete-card.d.ts +20 -0
  18. package/dist/components/search-block/autocomplete-content.d.ts +33 -0
  19. package/dist/components/search-block/search-api-help.d.ts +38 -0
  20. package/dist/components/search-block/search-card-header.d.ts +14 -0
  21. package/dist/components/search-block/search-card.d.ts +74 -0
  22. package/dist/components/search-block/search-context.d.ts +31 -0
  23. package/dist/components/search-block/search-history-card.d.ts +16 -0
  24. package/dist/components/search-block/search-history-content.d.ts +20 -0
  25. package/dist/components/search-block/search-input.d.ts +36 -0
  26. package/dist/components/search-block/search-live-toggle.d.ts +18 -0
  27. package/dist/components/suggestion-card/suggestion-card-body.d.ts +15 -0
  28. package/dist/components/suggestion-card/suggestion-card-context-wrapper.d.ts +12 -0
  29. package/dist/components/suggestion-card/suggestion-card-header.d.ts +19 -0
  30. package/dist/components/suggestion-card/suggestion-card-relevance-vote.d.ts +16 -0
  31. package/dist/components/suggestion-card/suggestion-card.d.ts +27 -0
  32. package/dist/components/syntax-highlighter.d.ts +38 -0
  33. package/dist/components/toggle.d.ts +27 -0
  34. package/dist/helper/config.d.ts +15 -0
  35. package/dist/helper/context-manager.d.ts +34 -0
  36. package/dist/helper/date-time.d.ts +12 -0
  37. package/dist/helper/dom.d.ts +52 -0
  38. package/dist/helper/find-language.d.ts +17 -0
  39. package/dist/helper/guid.d.ts +5 -0
  40. package/dist/main.d.ts +26 -0
  41. package/dist/main.js +3 -0
  42. package/dist/main.js.LICENSE.txt +13 -0
  43. package/dist/main.js.map +1 -0
  44. package/dist/static.d.ts +276 -0
  45. package/dist/translations/en.d.ts +9 -0
  46. package/dist/translations/i18n.d.ts +13 -0
  47. package/package.json +62 -0
@@ -0,0 +1,48 @@
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
+ declare type NotificationContentType = string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
7
+ /**
8
+ * Options for where to show the notification
9
+ */
10
+ export declare enum NotificationTarget {
11
+ /**
12
+ * Shows an IDE level notification
13
+ */
14
+ IDE = "ide",
15
+ /**
16
+ * Shows a notification inside the extension UI
17
+ */
18
+ UI = "ui"
19
+ }
20
+ export declare enum NotificationType {
21
+ INFO = "info",
22
+ SUCCESS = "ok-circled",
23
+ WARNING = "warning",
24
+ ERROR = "error"
25
+ }
26
+ export interface NotificationProps {
27
+ duration?: number;
28
+ type?: NotificationType;
29
+ title?: string;
30
+ content: NotificationContentType | NotificationContentType[];
31
+ onNotificationClick?: () => void;
32
+ onNotificationHide?: () => void;
33
+ }
34
+ export declare class Notification {
35
+ private notificationOverlay;
36
+ private readonly duration;
37
+ private readonly type;
38
+ private readonly props;
39
+ constructor(props: NotificationProps);
40
+ notify(): void;
41
+ /**
42
+ * Calculates the top according to the previously shown and still visible notifications
43
+ * @returns number
44
+ */
45
+ private readonly getNextCalculatedTop;
46
+ private readonly getChildren;
47
+ }
48
+ export {};
@@ -0,0 +1,82 @@
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
+ export declare const OVERLAY_MARGIN = 8;
7
+ /**
8
+ * The horizontal creation direction of the overlay
9
+ */
10
+ export declare enum OverlayHorizontalDirection {
11
+ /**
12
+ * starts from the left edge of the reference element and opens to left
13
+ */
14
+ TO_LEFT = "horizontal-direction-to-left",
15
+ /**
16
+ * starts from the right edge of the reference element and opens to left
17
+ */
18
+ END_TO_LEFT = "horizontal-direction-from-end-to-left",
19
+ /**
20
+ * starts from the right edge of the reference element and opens to right
21
+ */
22
+ TO_RIGHT = "horizontal-direction-to-right",
23
+ /**
24
+ * starts from the left edge of the reference element and opens to right
25
+ */
26
+ START_TO_RIGHT = "horizontal-direction-from-start-to-right",
27
+ /**
28
+ * starts and opens at the center of the reference element
29
+ */
30
+ CENTER = "horizontal-direction-at-center"
31
+ }
32
+ /**
33
+ * The vertical creation direction of the overlay
34
+ */
35
+ export declare enum OverlayVerticalDirection {
36
+ /**
37
+ * starts from the bottom edge of the reference element and opens to bottom
38
+ */
39
+ TO_BOTTOM = "vertical-direction-to-bottom",
40
+ /**
41
+ * starts from the top edge of the reference element and opens to bottom
42
+ */
43
+ START_TO_BOTTOM = "vertical-direction-from-start-to-bottom",
44
+ /**
45
+ * starts from the top edge of the reference element and opens to top
46
+ */
47
+ TO_TOP = "vertical-direction-to-top",
48
+ /**
49
+ * starts from the bottom edge of the reference element and opens to top
50
+ */
51
+ END_TO_TOP = "vertical-direction-from-end-to-top",
52
+ /**
53
+ * starts and opens at the center of the reference element
54
+ */
55
+ CENTER = "vertical-direction-at-center"
56
+ }
57
+ export interface OverlayProps {
58
+ referenceElement?: Element | ExtendedHTMLElement;
59
+ referencePoint?: {
60
+ top: number;
61
+ left: number;
62
+ };
63
+ children: Array<HTMLElement | ExtendedHTMLElement | DomBuilderObject>;
64
+ horizontalDirection?: OverlayHorizontalDirection;
65
+ verticalDirection?: OverlayVerticalDirection;
66
+ dimOutside?: boolean;
67
+ closeOnOutsideClick?: boolean;
68
+ onClose?: () => void;
69
+ }
70
+ export declare class Overlay {
71
+ render: ExtendedHTMLElement;
72
+ private readonly container;
73
+ private readonly innerContainer;
74
+ private readonly guid;
75
+ private readonly onClose;
76
+ constructor(props: OverlayProps);
77
+ close: () => void;
78
+ private readonly windowBlurHandler;
79
+ private readonly getCalculatedLeft;
80
+ private readonly getCalculatedTop;
81
+ updateContent: (children: Array<string | DomBuilderObject | HTMLElement | ExtendedHTMLElement>) => void;
82
+ }
@@ -0,0 +1,18 @@
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
+ }
@@ -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 { 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
+ }
@@ -0,0 +1,33 @@
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
+ onAutocompleteClick: (autocompleteQuery: AutocompleteItem, index: number, count: number) => void;
12
+ onClose?: () => void;
13
+ }
14
+ export declare class AutocompleteContent {
15
+ private readonly autocompleteItemsOverlay;
16
+ suggestions: AutocompleteItem[];
17
+ private searchQuery;
18
+ private currHover;
19
+ private readonly props;
20
+ private isUsed;
21
+ render: ExtendedHTMLElement;
22
+ constructor(props: AutocompleteContentProps);
23
+ autocompleteCards: (autocompleteSuggestions: AutocompleteItem[], hovered: number) => ExtendedHTMLElement[];
24
+ private readonly handleAutocompleteClick;
25
+ updateSuggestions: (autocompleteSuggestions: AutocompleteItem[], hoverQuery: number) => void;
26
+ updateQuery: (searchQuery: string) => void;
27
+ hover: (isUp: boolean) => string;
28
+ setIsUsed: (val: boolean) => void;
29
+ getIsUsed: () => boolean;
30
+ getCurrentSelected: () => number;
31
+ getSuggestionsCount: () => number;
32
+ close: () => void;
33
+ }
@@ -0,0 +1,38 @@
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 SearchApiHelpProps {
7
+ code: string;
8
+ fileName?: string;
9
+ range?: {
10
+ start: {
11
+ row: string;
12
+ column?: string;
13
+ };
14
+ end?: {
15
+ row: string;
16
+ column?: string;
17
+ };
18
+ };
19
+ }
20
+ export declare class SearchApiHelp {
21
+ props: SearchApiHelpProps;
22
+ render: ExtendedHTMLElement;
23
+ private isCollapsed;
24
+ private readonly onCodeDetailsClicked?;
25
+ constructor(onCodeDetailsClicked?: (code: string, fileName?: string, range?: {
26
+ start: {
27
+ row: string;
28
+ column?: string;
29
+ };
30
+ end?: {
31
+ row: string;
32
+ column?: string;
33
+ };
34
+ }) => void);
35
+ hide: () => void;
36
+ show: () => void;
37
+ updateContent: (props: SearchApiHelpProps) => void;
38
+ }
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { FeedbackPayload } from '../../static';
6
+ import { ExtendedHTMLElement } from '../../helper/dom';
7
+ export interface SearchCardHeaderProps {
8
+ onFeedbackSet: (feedbackPayload: FeedbackPayload) => void;
9
+ }
10
+ export declare class SearchCardHeader {
11
+ private readonly feedbackForm;
12
+ render: ExtendedHTMLElement;
13
+ constructor(props: SearchCardHeaderProps);
14
+ }
@@ -0,0 +1,74 @@
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 { LiveSearchState, SearchPayload, SearchPayloadMatchPolicy, Suggestion, SearchHistoryItem, FeedbackPayload, AutocompleteItem, SearchHistoryFilters } from '../../static';
7
+ export interface SearchCardProps {
8
+ onSearch: (searchPayload: SearchPayload, isFromAutocomplete: boolean, currAutocompleteSuggestionSelected?: number, autocompleteSuggestionsCount?: number) => void;
9
+ onHistoryChange?: (historySuggestions: Suggestion[], searchPayload: SearchPayload) => void;
10
+ onLiveSearchToggle?: (value: LiveSearchState) => void;
11
+ onFeedbackSet: (feedbackPayload: FeedbackPayload) => void;
12
+ onHistoryOpen: (filterPayload: SearchHistoryFilters) => Promise<SearchHistoryItem[]>;
13
+ onAutocompleteRequest: (input: string) => Promise<AutocompleteItem[]>;
14
+ onCodeDetailsClicked?: (code: string, fileName?: string, range?: {
15
+ start: {
16
+ row: string;
17
+ column?: string;
18
+ };
19
+ end?: {
20
+ row: string;
21
+ column?: string;
22
+ };
23
+ }) => void;
24
+ initContextList?: SearchPayloadMatchPolicy;
25
+ initText?: string;
26
+ liveSearch?: boolean;
27
+ codeSelection?: {
28
+ selectedCode: string;
29
+ file?: {
30
+ range: {
31
+ start: {
32
+ row: string;
33
+ column: string;
34
+ };
35
+ end: {
36
+ row: string;
37
+ column: string;
38
+ };
39
+ };
40
+ name: string;
41
+ };
42
+ };
43
+ codeQuery?: {
44
+ simpleNames: string[];
45
+ usedFullyQualifiedNames: string[];
46
+ };
47
+ }
48
+ export declare class SearchCard {
49
+ props: SearchCardProps;
50
+ private historyProcess;
51
+ private readonly searchInput;
52
+ private readonly searchAPIHelp;
53
+ private liveSearchToggle;
54
+ private searchPayload;
55
+ private readonly foldUnfoldButton;
56
+ private readonly contextManagement;
57
+ private readonly searchCardHeader;
58
+ private unfoldedByContextInsertion;
59
+ private unfoldedByButton;
60
+ render: ExtendedHTMLElement;
61
+ constructor(props: SearchCardProps);
62
+ addFocusOnInput: () => void;
63
+ private readonly performSearch;
64
+ private readonly handleSearchQueryChange;
65
+ private readonly handleContextChange;
66
+ private readonly handleHistoryChange;
67
+ setSearchQuery: (value: string) => void;
68
+ setContextItems: (contextItems: SearchPayloadMatchPolicy) => void;
69
+ setWaitState: (waitState: boolean) => void;
70
+ setFolded: (folded: boolean) => void;
71
+ removeLiveSearchToggle: () => void;
72
+ onLiveSearchDataReceived: () => void;
73
+ changeLiveSearchState: (state: LiveSearchState) => void;
74
+ }
@@ -0,0 +1,31 @@
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
+ updateLocalContext: (contextItems: SearchPayloadMatchPolicy) => void;
22
+ private readonly updateContextItems;
23
+ private readonly enableContextInsertion;
24
+ private readonly disableContextInsertion;
25
+ private readonly contextInsertionKeydownHandler;
26
+ private readonly inputAutoWidth;
27
+ private contextInsertionInput;
28
+ private readonly contextInsertionButton;
29
+ private readonly contextWrapper;
30
+ render: ExtendedHTMLElement;
31
+ }
@@ -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
+ 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
+ }
@@ -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 { ExtendedHTMLElement } from '../../helper/dom';
6
+ import { SearchHistoryItem } from '../../static';
7
+ export interface HistoryContentProps {
8
+ referenceElement: Element | ExtendedHTMLElement;
9
+ searchHistory: SearchHistoryItem[];
10
+ onHistoryChange: (historyItem: SearchHistoryItem) => void;
11
+ }
12
+ export declare class HistoryContent {
13
+ private historyItemsOverlay;
14
+ private readonly props;
15
+ render: ExtendedHTMLElement;
16
+ constructor(props: HistoryContentProps);
17
+ createOverlay(): void;
18
+ searchHistoryCards: (historyItems: SearchHistoryItem[]) => ExtendedHTMLElement[];
19
+ private readonly handleHistoryChange;
20
+ }
@@ -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 { ExtendedHTMLElement } from '../../helper/dom';
6
+ import { AutocompleteItem, SearchHistoryFilters, SearchHistoryItem } from '../../static';
7
+ export interface SearchInputProps {
8
+ onSearch: (queryText: string, isFromAutocomplete: boolean, currAutocompleteSuggestionSelected?: number, autocompleteSuggestionsCount?: number) => void;
9
+ onHistoryOpen: (filterPayload: SearchHistoryFilters) => Promise<SearchHistoryItem[]>;
10
+ onAutocompleteRequest: (input: string) => Promise<AutocompleteItem[]>;
11
+ onHistoryChange: (historyItem: SearchHistoryItem) => void;
12
+ initText?: string;
13
+ searchAlwaysActive?: boolean;
14
+ hideHistoryButton?: boolean;
15
+ }
16
+ export declare class SearchInput {
17
+ props: SearchInputProps;
18
+ render: ExtendedHTMLElement;
19
+ private searchTextInput;
20
+ private readonly searchButton;
21
+ private readonly searchHistoryButton;
22
+ private readonly remainingIndicator;
23
+ private autocompleteContent;
24
+ private readonly allowedCharCount;
25
+ constructor(props: SearchInputProps);
26
+ addFocusOnInput: () => void;
27
+ private readonly handleInputKeydown;
28
+ triggerSearch: () => void;
29
+ triggerSearchHistory: () => void;
30
+ getAutocompleteSuggestions: (input: string) => void;
31
+ private readonly handleHistoryChange;
32
+ private readonly handleAutocompleteClick;
33
+ getSearchText: () => string;
34
+ setSearchText: (value: string) => void;
35
+ setWaitState: (waitState?: boolean | undefined) => void;
36
+ }
@@ -0,0 +1,18 @@
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 { LiveSearchState } from '../../static';
7
+ export interface SearchLiveToggleProps {
8
+ label: string;
9
+ value: LiveSearchState.RESUME | LiveSearchState.PAUSE;
10
+ onChange?: (value: LiveSearchState.RESUME | LiveSearchState.PAUSE) => void;
11
+ }
12
+ export declare class SearchLiveToggle {
13
+ render: ExtendedHTMLElement;
14
+ private readonly toggle;
15
+ constructor(props: SearchLiveToggleProps);
16
+ setToggleState: (state: LiveSearchState) => void;
17
+ flashToggle: () => void;
18
+ }
@@ -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 { OnCopiedToClipboardFunction, RelevancyVoteType, Suggestion } from '../../static';
7
+ export interface SuggestionCardBodyProps {
8
+ suggestion: Suggestion;
9
+ onVoteChange: (suggestion: Suggestion, vote: RelevancyVoteType) => void;
10
+ onCopiedToClipboard?: OnCopiedToClipboardFunction;
11
+ }
12
+ export declare class SuggestionCardBody {
13
+ render: ExtendedHTMLElement;
14
+ constructor(props: SuggestionCardBodyProps);
15
+ }
@@ -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 SuggestionCardContextWrapperProps {
7
+ contextList: string[];
8
+ }
9
+ export declare class SuggestionCardContextWrapper {
10
+ render: ExtendedHTMLElement;
11
+ constructor(props: SuggestionCardContextWrapperProps);
12
+ }
@@ -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 { SuggestionMetaData } from '../../static';
7
+ export interface SuggestionCardHeaderProps {
8
+ title: string;
9
+ url: string;
10
+ metaData?: SuggestionMetaData;
11
+ onSuggestionTitleClick?: () => void;
12
+ onSuggestionLinkClick?: () => void;
13
+ onSuggestionLinkCopy?: () => void;
14
+ }
15
+ export declare class SuggestionCardHeader {
16
+ render: ExtendedHTMLElement;
17
+ constructor(props: SuggestionCardHeaderProps);
18
+ private readonly getSourceMetaBlock;
19
+ }
@@ -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 { RelevancyVoteType, Suggestion } from '../../static';
6
+ import { ExtendedHTMLElement } from '../../helper/dom';
7
+ export interface SuggestionCardRelevanceVoteProps {
8
+ suggestion: Suggestion;
9
+ onVoteChange: (suggestion: Suggestion, vote: RelevancyVoteType) => void;
10
+ }
11
+ export declare class SuggestionCardRelevanceVote {
12
+ render: ExtendedHTMLElement;
13
+ private readonly onVoteChange;
14
+ constructor(props: SuggestionCardRelevanceVoteProps);
15
+ private readonly handleVoteChange;
16
+ }
@@ -0,0 +1,27 @@
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 { OnCopiedToClipboardFunctionWithSuggestionId, RelevancyVoteType, Suggestion, SuggestionEngagement } from '../../static';
7
+ export interface SuggestionCardProps {
8
+ suggestion: Suggestion;
9
+ onSuggestionOpen?: (suggestion: Suggestion) => void;
10
+ onSuggestionLinkClick?: (suggestion: Suggestion) => void;
11
+ onSuggestionLinkCopy?: (suggestion: Suggestion) => void;
12
+ onSuggestionEngaged?: (engagementInfo: SuggestionEngagement) => void;
13
+ onCopiedToClipboard?: OnCopiedToClipboardFunctionWithSuggestionId;
14
+ onVoteChange: (suggestion: Suggestion, vote: RelevancyVoteType) => void;
15
+ }
16
+ export declare class SuggestionCard {
17
+ private engagementStartTime;
18
+ private totalMouseDistanceTraveled;
19
+ private previousMousePosition;
20
+ private mouseDownInfo;
21
+ private readonly onSuggestionEngaged;
22
+ private readonly suggestion;
23
+ render: ExtendedHTMLElement;
24
+ constructor(props: SuggestionCardProps);
25
+ private readonly resetEngagement;
26
+ private readonly handleEngagement;
27
+ }
@@ -0,0 +1,38 @@
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 'prismjs/components/prism-typescript';
7
+ import 'prismjs/components/prism-python';
8
+ import 'prismjs/components/prism-java';
9
+ import 'prismjs/components/prism-javascript';
10
+ import 'prismjs/components/prism-json';
11
+ import 'prismjs/plugins/line-numbers/prism-line-numbers.js';
12
+ import { OnCopiedToClipboardFunction, SupportedCodingLanguagesType } from '../static';
13
+ export declare const highlighters: {
14
+ start: {
15
+ markup: string;
16
+ textReplacement: string;
17
+ };
18
+ end: {
19
+ markup: string;
20
+ textReplacement: string;
21
+ };
22
+ };
23
+ export interface SyntaxHighlighterProps {
24
+ codeStringWithMarkup: string;
25
+ language?: SupportedCodingLanguagesType;
26
+ keepHighlights?: boolean;
27
+ showLineNumbers?: boolean;
28
+ startingLineNumber?: number;
29
+ showCopyOptions?: boolean;
30
+ onCopiedToClipboard?: OnCopiedToClipboardFunction;
31
+ }
32
+ export declare class SyntaxHighlighter {
33
+ private readonly code;
34
+ private readonly onCopiedToClipboard?;
35
+ render: ExtendedHTMLElement;
36
+ constructor(props: SyntaxHighlighterProps);
37
+ private readonly copyToClipboard;
38
+ }
@@ -0,0 +1,27 @@
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 ToggleOption {
7
+ label?: ExtendedHTMLElement | string | HTMLElement;
8
+ color?: string;
9
+ value: string;
10
+ }
11
+ export interface ToggleProps {
12
+ options: ToggleOption[];
13
+ value?: string;
14
+ name: string;
15
+ disabled?: boolean;
16
+ onChange?: (selectedValue: string) => void;
17
+ }
18
+ export declare class Toggle {
19
+ render: ExtendedHTMLElement;
20
+ private readonly props;
21
+ private readonly relocateTransitioner;
22
+ constructor(props: ToggleProps);
23
+ private readonly getChildren;
24
+ private readonly setRelocatePosition;
25
+ private readonly updateSelectionRender;
26
+ setValue: (value: string) => void;
27
+ }
@@ -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 { StateManager } from '../static';
6
+ export interface MynahConfigProps {
7
+ stateManager: StateManager;
8
+ }
9
+ export declare class MynahConfig {
10
+ private config;
11
+ private readonly stateManager;
12
+ constructor(props: MynahConfigProps);
13
+ getConfig: (configName: string) => any;
14
+ setConfig: (configName: string, configValue: string) => void;
15
+ }