@aws/mynah-ui 1.4.0 → 2.0.0-beta.10.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.
- package/DEVELOPMENT.md +24 -0
- package/README.md +1 -1
- package/dist/components/button.d.ts +1 -0
- package/dist/components/chat-item/chat-item-card.d.ts +28 -0
- package/dist/components/chat-item/chat-item-followup.d.ts +15 -0
- package/dist/components/chat-item/chat-item-relevance-vote.d.ts +17 -0
- package/dist/components/{suggestion-card/suggestion-card-context-wrapper.d.ts → chat-item/chat-item-tree-view-wrapper.d.ts} +6 -4
- package/dist/components/chat-item/chat-item-tree-view.d.ts +22 -0
- package/dist/components/chat-item/chat-prompt-input.d.ts +29 -0
- package/dist/components/chat-item/chat-wrapper.d.ts +24 -0
- package/dist/components/feedback-form/feedback-form-comment.d.ts +2 -2
- package/dist/components/feedback-form/feedback-form.d.ts +6 -5
- package/dist/components/icon/icon-importer.d.ts +9 -0
- package/dist/components/icon.d.ts +8 -3
- package/dist/components/navigation-tabs.d.ts +7 -6
- package/dist/components/notification/notification.d.ts +0 -4
- package/dist/components/overlay/overlay.d.ts +5 -37
- package/dist/components/suggestion-card/suggestion-card-body.d.ts +11 -1
- package/dist/components/suggestion-card/suggestion-card-header.d.ts +2 -3
- package/dist/components/suggestion-card/suggestion-card.d.ts +2 -0
- package/dist/components/suggestion-card/suggestion-skeleton.d.ts +5 -0
- package/dist/components/syntax-highlighter.d.ts +22 -3
- package/dist/components/toggle.d.ts +10 -5
- package/dist/helper/config.d.ts +6 -5
- package/dist/helper/date-time.d.ts +2 -2
- package/dist/helper/dom.d.ts +3 -0
- package/dist/helper/events.d.ts +0 -15
- package/dist/helper/file-tree.d.ts +16 -0
- package/dist/helper/store.d.ts +2 -38
- package/dist/helper/tabs-store.d.ts +40 -0
- package/dist/helper/url.d.ts +1 -0
- package/dist/main.d.ts +33 -50
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +5 -0
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +114 -219
- package/package.json +14 -8
- package/dist/components/context-item.d.ts +0 -16
- package/dist/components/feedback-form/feedback-form-stars.d.ts +0 -15
- package/dist/components/main-container.d.ts +0 -17
- package/dist/components/prioritization-menu.d.ts +0 -18
- package/dist/components/search-block/autocomplete-card.d.ts +0 -20
- package/dist/components/search-block/autocomplete-content.d.ts +0 -32
- package/dist/components/search-block/search-api-help.d.ts +0 -14
- package/dist/components/search-block/search-card-header.d.ts +0 -12
- package/dist/components/search-block/search-card.d.ts +0 -19
- package/dist/components/search-block/search-context.d.ts +0 -30
- package/dist/components/search-block/search-history-card.d.ts +0 -16
- package/dist/components/search-block/search-history-content.d.ts +0 -19
- package/dist/components/search-block/search-input.d.ts +0 -22
- package/dist/components/search-block/search-live-toggle.d.ts +0 -15
- package/dist/components/suggestion-card/suggestion-card-relevance-vote.d.ts +0 -14
- package/dist/helper/find-language.d.ts +0 -17
- package/dist/helper/payload-transformer.d.ts +0 -13
- package/dist/translations/en.d.ts +0 -9
- package/dist/translations/i18n.d.ts +0 -13
package/DEVELOPMENT.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Mynah UI
|
|
2
|
+
This package is the whole UI of AWS Codewhisperer Chat extension UI for Web, VSCode and Intellij IDEs written in typescript without any framework or third-party UI library dependency. Purpose of the separated UI is to handle the interactions and look & feel of the UI from one single source.
|
|
3
|
+
|
|
4
|
+
## How to release
|
|
5
|
+
### Production
|
|
6
|
+
You need to create a new release from your desired branch with a tag which should follow the naming `v*.*` to release a production version to npm. The tag you're creating shouldn't be existed before.
|
|
7
|
+
|
|
8
|
+
### Beta releases
|
|
9
|
+
If you need to release a beta version first you need to specify the version name inside `package.json` which should follow the versioning `2.0.0-beta.1`
|
|
10
|
+
After that you need to create a new release from your desired branch with a tag which should follow the naming `beta*.*` to release a beta version to npm. The tag you're creating shouldn't be existed before.
|
|
11
|
+
|
|
12
|
+
``` console
|
|
13
|
+
please see publish.yml and beta.yml for releasing details.
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Security
|
|
18
|
+
|
|
19
|
+
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
|
|
20
|
+
|
|
21
|
+
## License
|
|
22
|
+
|
|
23
|
+
This project is licensed under the Apache-2.0 License.
|
|
24
|
+
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Mynah UI
|
|
2
2
|
|
|
3
|
-
This package is the whole UI of AWS
|
|
3
|
+
This package is the whole UI of AWS Codewhisperer Chat extension UI for Web, VSCode and Intellij IDEs written in typescript without any framework or third-party UI library dependency. Purpose of the separated UI is to handle the interactions and look & feel of the UI from one single source.
|
|
4
4
|
|
|
5
5
|
## How to install
|
|
6
6
|
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { ChatItem } from '../../static';
|
|
7
|
+
import { SuggestionCardBody } from '../suggestion-card/suggestion-card-body';
|
|
8
|
+
export interface ChatItemCardProps {
|
|
9
|
+
tabId: string;
|
|
10
|
+
chatItem: ChatItem;
|
|
11
|
+
}
|
|
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;
|
|
19
|
+
render: ExtendedHTMLElement;
|
|
20
|
+
suggestionCardBody: SuggestionCardBody;
|
|
21
|
+
chatAvatar: ExtendedHTMLElement;
|
|
22
|
+
constructor(props: ChatItemCardProps);
|
|
23
|
+
private readonly checkIsMuted;
|
|
24
|
+
private readonly showLinkPreview;
|
|
25
|
+
private readonly hideLinkPreview;
|
|
26
|
+
private readonly getChatAvatar;
|
|
27
|
+
readonly updateAnswerBody: (body: ExtendedHTMLElement | HTMLElement | string) => void;
|
|
28
|
+
}
|
|
@@ -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 { ChatItem } from '../../static';
|
|
7
|
+
export interface ChatItemFollowUpProps {
|
|
8
|
+
tabId: string;
|
|
9
|
+
chatItem: ChatItem;
|
|
10
|
+
}
|
|
11
|
+
export declare class ChatItemFollowUpContainer {
|
|
12
|
+
private readonly props;
|
|
13
|
+
render: ExtendedHTMLElement;
|
|
14
|
+
constructor(props: ChatItemFollowUpProps);
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 ChatItemRelevanceVoteProps {
|
|
7
|
+
tabId: string;
|
|
8
|
+
messageId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class ChatItemRelevanceVote {
|
|
11
|
+
private readonly votingId;
|
|
12
|
+
private sendFeedbackListenerId;
|
|
13
|
+
render: ExtendedHTMLElement;
|
|
14
|
+
props: ChatItemRelevanceVoteProps;
|
|
15
|
+
constructor(props: ChatItemRelevanceVoteProps);
|
|
16
|
+
private readonly handleVoteChange;
|
|
17
|
+
}
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
|
-
export interface
|
|
7
|
-
|
|
6
|
+
export interface ChatItemTreeViewWrapperProps {
|
|
7
|
+
tabId: string;
|
|
8
|
+
messageId: string;
|
|
9
|
+
files: string[];
|
|
8
10
|
}
|
|
9
|
-
export declare class
|
|
11
|
+
export declare class ChatItemTreeViewWrapper {
|
|
10
12
|
render: ExtendedHTMLElement;
|
|
11
|
-
constructor(props:
|
|
13
|
+
constructor(props: ChatItemTreeViewWrapperProps);
|
|
12
14
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
2
|
+
import { TreeNode } from '../../helper/file-tree';
|
|
3
|
+
export interface ChatItemTreeViewProps {
|
|
4
|
+
node: TreeNode;
|
|
5
|
+
depth?: number;
|
|
6
|
+
tabId: string;
|
|
7
|
+
messageId: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ChatItemTreeView {
|
|
10
|
+
private readonly node;
|
|
11
|
+
private isOpen;
|
|
12
|
+
private readonly depth;
|
|
13
|
+
private readonly tabId;
|
|
14
|
+
private readonly messageId;
|
|
15
|
+
render: ExtendedHTMLElement;
|
|
16
|
+
constructor(props: ChatItemTreeViewProps);
|
|
17
|
+
getClassNames(): string[];
|
|
18
|
+
updateTree(): void;
|
|
19
|
+
buildFolderChildren(): ExtendedHTMLElement[];
|
|
20
|
+
buildFolderNode(): ExtendedHTMLElement[];
|
|
21
|
+
buildFileNode(): ExtendedHTMLElement[];
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 ChatPromptInputProps {
|
|
7
|
+
tabId: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ChatPromptInput {
|
|
10
|
+
render: ExtendedHTMLElement;
|
|
11
|
+
private readonly props;
|
|
12
|
+
private readonly attachmentWrapper;
|
|
13
|
+
private readonly promptTextInputWrapper;
|
|
14
|
+
private readonly promptTextInput;
|
|
15
|
+
private readonly promptTextInputSizer;
|
|
16
|
+
private readonly sendButton;
|
|
17
|
+
private quickActionCommands;
|
|
18
|
+
private commandSelector;
|
|
19
|
+
private commandSelectorOpen;
|
|
20
|
+
private inputDisabled;
|
|
21
|
+
private attachment?;
|
|
22
|
+
private filteredCommandsList;
|
|
23
|
+
constructor(props: ChatPromptInputProps);
|
|
24
|
+
private readonly handleInputKeydown;
|
|
25
|
+
private readonly getQuickCommandActions;
|
|
26
|
+
private readonly calculateTextAreaHeight;
|
|
27
|
+
private readonly resetTextAreaHeight;
|
|
28
|
+
private readonly sendPrompt;
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { Suggestion } from '../../static';
|
|
7
|
+
export interface ChatWrapperProps {
|
|
8
|
+
onStopChatResponse?: (tabId: string) => void;
|
|
9
|
+
tabId: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class ChatWrapper {
|
|
12
|
+
private readonly props;
|
|
13
|
+
private readonly chatItemsContainer;
|
|
14
|
+
private readonly intermediateBlockContainer;
|
|
15
|
+
private readonly promptInput;
|
|
16
|
+
private lastChatItemCard;
|
|
17
|
+
render: ExtendedHTMLElement;
|
|
18
|
+
constructor(props: ChatWrapperProps);
|
|
19
|
+
private readonly insertChatItem;
|
|
20
|
+
updateLastCharAnswerStream: (updateWith: string | {
|
|
21
|
+
title: string | boolean;
|
|
22
|
+
suggestions: Suggestion[];
|
|
23
|
+
}) => void;
|
|
24
|
+
}
|
|
@@ -10,6 +10,6 @@ export interface FeedbackFormCommentProps {
|
|
|
10
10
|
export declare class FeedbackFormComment {
|
|
11
11
|
render: ExtendedHTMLElement;
|
|
12
12
|
constructor(props: FeedbackFormCommentProps);
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
getComment: () => string;
|
|
14
|
+
clear: () => void;
|
|
15
15
|
}
|
|
@@ -8,14 +8,15 @@ export interface FeedbackFormProps {
|
|
|
8
8
|
initPayload?: FeedbackPayload;
|
|
9
9
|
}
|
|
10
10
|
export declare class FeedbackForm {
|
|
11
|
-
private
|
|
12
|
-
private readonly
|
|
11
|
+
private feedbackFormWrapper;
|
|
12
|
+
private readonly feedbackSelect;
|
|
13
|
+
private readonly feedbackOptionsWrapper;
|
|
13
14
|
private readonly feedbackComment;
|
|
14
|
-
private feedbackPayload;
|
|
15
|
-
private readonly triggerButton;
|
|
16
15
|
private readonly feedbackSubmitButton;
|
|
16
|
+
private feedbackPayload;
|
|
17
17
|
readonly feedbackFormContainer: ExtendedHTMLElement;
|
|
18
|
-
readonly feedbackContainer: ExtendedHTMLElement;
|
|
19
18
|
constructor(props?: FeedbackFormProps);
|
|
20
19
|
private readonly onFeedbackSet;
|
|
20
|
+
close: () => void;
|
|
21
|
+
show: () => void;
|
|
21
22
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
export declare class MynahUIIconImporter {
|
|
6
|
+
private static instance;
|
|
7
|
+
private constructor();
|
|
8
|
+
static getInstance: () => MynahUIIconImporter;
|
|
9
|
+
}
|
|
@@ -4,19 +4,22 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../helper/dom';
|
|
6
6
|
export declare enum MynahIcons {
|
|
7
|
+
MYNAH = "mynah",
|
|
7
8
|
MENU = "menu",
|
|
8
9
|
MINUS = "minus",
|
|
9
10
|
SEARCH = "search",
|
|
10
11
|
PLUS = "plus",
|
|
11
12
|
CHAT = "chat",
|
|
12
13
|
LINK = "link",
|
|
14
|
+
DOC = "doc",
|
|
13
15
|
EXTERNAL = "external",
|
|
14
16
|
CANCEL = "cancel",
|
|
15
17
|
CALENDAR = "calendar",
|
|
16
18
|
MEGAPHONE = "megaphone",
|
|
19
|
+
NOTIFICATION = "notification",
|
|
17
20
|
EYE = "eye",
|
|
21
|
+
ELLIPSIS = "ellipsis",
|
|
18
22
|
OK = "ok",
|
|
19
|
-
UP_CIRCLED = "up-circled",
|
|
20
23
|
UP_OPEN = "up-open",
|
|
21
24
|
DOWN_OPEN = "down-open",
|
|
22
25
|
RIGHT_OPEN = "right-open",
|
|
@@ -33,13 +36,15 @@ export declare enum MynahIcons {
|
|
|
33
36
|
STAR = "star",
|
|
34
37
|
LIGHT_BULB = "light-bulb",
|
|
35
38
|
ENVELOPE_SEND = "envelope-send",
|
|
36
|
-
|
|
39
|
+
REFRESH = "refresh",
|
|
37
40
|
USER = "user",
|
|
38
41
|
PLAY = "play",
|
|
39
42
|
PAUSE = "pause",
|
|
40
43
|
CODE_BLOCK = "code-block",
|
|
41
44
|
COPY = "copy",
|
|
42
|
-
|
|
45
|
+
CURSOR_INSERT = "cursor-insert",
|
|
46
|
+
TEXT_SELECT = "text-select",
|
|
47
|
+
REVERT = "revert"
|
|
43
48
|
}
|
|
44
49
|
export interface IconProps {
|
|
45
50
|
icon: MynahIcons;
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../helper/dom';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
onChange?: (selectedValue: string) => void;
|
|
6
|
+
export interface TabsProps {
|
|
7
|
+
onChange?: (selectedTabId: string) => void;
|
|
9
8
|
}
|
|
10
|
-
export declare class
|
|
9
|
+
export declare class Tabs {
|
|
11
10
|
render: ExtendedHTMLElement;
|
|
11
|
+
private tabIdSubscriptions;
|
|
12
|
+
private toggleGroup;
|
|
12
13
|
private readonly props;
|
|
13
|
-
constructor(props:
|
|
14
|
-
private readonly
|
|
14
|
+
constructor(props: TabsProps);
|
|
15
|
+
private readonly getTabOptionsFromTabStoreData;
|
|
15
16
|
private readonly getTabsRender;
|
|
16
17
|
}
|
|
@@ -20,10 +20,6 @@ export declare class Notification {
|
|
|
20
20
|
private readonly props;
|
|
21
21
|
constructor(props: NotificationProps);
|
|
22
22
|
notify(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Calculates the top according to the previously shown and still visible notifications
|
|
25
|
-
* @returns number
|
|
26
|
-
*/
|
|
27
23
|
private readonly getNextCalculatedTop;
|
|
28
24
|
private readonly getChildren;
|
|
29
25
|
}
|
|
@@ -4,58 +4,22 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { DomBuilderObject, ExtendedHTMLElement } from '../../helper/dom';
|
|
6
6
|
export declare const OVERLAY_MARGIN = 8;
|
|
7
|
-
/**
|
|
8
|
-
* The horizontal creation direction of the overlay
|
|
9
|
-
*/
|
|
10
7
|
export declare enum OverlayHorizontalDirection {
|
|
11
|
-
/**
|
|
12
|
-
* starts from the left edge of the reference element and opens to left
|
|
13
|
-
*/
|
|
14
8
|
TO_LEFT = "horizontal-direction-to-left",
|
|
15
|
-
/**
|
|
16
|
-
* starts from the right edge of the reference element and opens to left
|
|
17
|
-
*/
|
|
18
9
|
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
10
|
TO_RIGHT = "horizontal-direction-to-right",
|
|
23
|
-
/**
|
|
24
|
-
* starts from the left edge of the reference element and opens to right
|
|
25
|
-
*/
|
|
26
11
|
START_TO_RIGHT = "horizontal-direction-from-start-to-right",
|
|
27
|
-
/**
|
|
28
|
-
* starts and opens at the center of the reference element
|
|
29
|
-
*/
|
|
30
12
|
CENTER = "horizontal-direction-at-center"
|
|
31
13
|
}
|
|
32
|
-
/**
|
|
33
|
-
* The vertical creation direction of the overlay
|
|
34
|
-
*/
|
|
35
14
|
export declare enum OverlayVerticalDirection {
|
|
36
|
-
/**
|
|
37
|
-
* starts from the bottom edge of the reference element and opens to bottom
|
|
38
|
-
*/
|
|
39
15
|
TO_BOTTOM = "vertical-direction-to-bottom",
|
|
40
|
-
/**
|
|
41
|
-
* starts from the top edge of the reference element and opens to bottom
|
|
42
|
-
*/
|
|
43
16
|
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
17
|
TO_TOP = "vertical-direction-to-top",
|
|
48
|
-
/**
|
|
49
|
-
* starts from the bottom edge of the reference element and opens to top
|
|
50
|
-
*/
|
|
51
18
|
END_TO_TOP = "vertical-direction-from-end-to-top",
|
|
52
|
-
/**
|
|
53
|
-
* starts and opens at the center of the reference element
|
|
54
|
-
*/
|
|
55
19
|
CENTER = "vertical-direction-at-center"
|
|
56
20
|
}
|
|
57
21
|
export interface OverlayProps {
|
|
58
|
-
referenceElement?:
|
|
22
|
+
referenceElement?: HTMLElement | ExtendedHTMLElement;
|
|
59
23
|
referencePoint?: {
|
|
60
24
|
top: number;
|
|
61
25
|
left: number;
|
|
@@ -63,9 +27,12 @@ export interface OverlayProps {
|
|
|
63
27
|
children: Array<HTMLElement | ExtendedHTMLElement | DomBuilderObject>;
|
|
64
28
|
horizontalDirection?: OverlayHorizontalDirection;
|
|
65
29
|
verticalDirection?: OverlayVerticalDirection;
|
|
30
|
+
stretchWidth?: boolean;
|
|
66
31
|
dimOutside?: boolean;
|
|
67
32
|
closeOnOutsideClick?: boolean;
|
|
33
|
+
background?: boolean;
|
|
68
34
|
onClose?: () => void;
|
|
35
|
+
removeOtherOverlays?: boolean;
|
|
69
36
|
}
|
|
70
37
|
export declare class Overlay {
|
|
71
38
|
render: ExtendedHTMLElement;
|
|
@@ -77,6 +44,7 @@ export declare class Overlay {
|
|
|
77
44
|
close: () => void;
|
|
78
45
|
private readonly windowBlurHandler;
|
|
79
46
|
private readonly getCalculatedLeft;
|
|
47
|
+
private readonly getCalculatedWidth;
|
|
80
48
|
private readonly getCalculatedTop;
|
|
81
49
|
updateContent: (children: Array<string | DomBuilderObject | HTMLElement | ExtendedHTMLElement>) => void;
|
|
82
50
|
}
|
|
@@ -5,9 +5,19 @@
|
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
6
|
import { Suggestion } from '../../static';
|
|
7
7
|
export interface SuggestionCardBodyProps {
|
|
8
|
-
suggestion: Suggestion
|
|
8
|
+
suggestion: Partial<Suggestion>;
|
|
9
|
+
showFooterButtons?: boolean;
|
|
10
|
+
onLinkMouseEnter?: (e: MouseEvent, url: string) => void;
|
|
11
|
+
onLinkMouseLeave?: (e: MouseEvent, url: string) => void;
|
|
9
12
|
}
|
|
10
13
|
export declare class SuggestionCardBody {
|
|
11
14
|
render: ExtendedHTMLElement;
|
|
15
|
+
cardBody: ExtendedHTMLElement;
|
|
16
|
+
props: SuggestionCardBodyProps;
|
|
17
|
+
private readonly syntaxHighlighterHighlightWithTooltipRangeItems;
|
|
12
18
|
constructor(props: SuggestionCardBodyProps);
|
|
19
|
+
private readonly processNode;
|
|
20
|
+
private readonly getCardBodyChildren;
|
|
21
|
+
readonly updateCardBody: (body: string) => void;
|
|
22
|
+
readonly addToCardBody: (elementToAdd: ExtendedHTMLElement | HTMLElement | string) => void;
|
|
13
23
|
}
|
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
|
-
import {
|
|
6
|
+
import { SuggestionMetaData } from '../../static';
|
|
7
7
|
export interface SuggestionCardHeaderProps {
|
|
8
8
|
title: string;
|
|
9
9
|
url: string;
|
|
10
|
-
metadata?:
|
|
10
|
+
metadata?: Record<string, SuggestionMetaData>;
|
|
11
11
|
onSuggestionTitleClick?: (e?: MouseEvent) => void;
|
|
12
12
|
onSuggestionLinkCopy?: () => void;
|
|
13
13
|
}
|
|
14
14
|
export declare class SuggestionCardHeader {
|
|
15
15
|
render: ExtendedHTMLElement;
|
|
16
16
|
constructor(props: SuggestionCardHeaderProps);
|
|
17
|
-
private readonly getSourceMetaBlockClassName;
|
|
18
17
|
private readonly getSourceMetaBlock;
|
|
19
18
|
}
|
|
@@ -6,6 +6,8 @@ import { ExtendedHTMLElement } from '../../helper/dom';
|
|
|
6
6
|
import { Suggestion } from '../../static';
|
|
7
7
|
export interface SuggestionCardProps {
|
|
8
8
|
suggestion: Suggestion;
|
|
9
|
+
compact?: 'flat' | true;
|
|
10
|
+
showFooterButtons?: boolean;
|
|
9
11
|
}
|
|
10
12
|
export declare class SuggestionCard {
|
|
11
13
|
private engagementStartTime;
|
|
@@ -9,7 +9,7 @@ import 'prismjs/components/prism-java';
|
|
|
9
9
|
import 'prismjs/components/prism-javascript';
|
|
10
10
|
import 'prismjs/components/prism-json';
|
|
11
11
|
import 'prismjs/plugins/line-numbers/prism-line-numbers.js';
|
|
12
|
-
import { OnCopiedToClipboardFunction,
|
|
12
|
+
import { OnCopiedToClipboardFunction, OnInsertToCursorPositionFunction, ReferenceTrackerInformation } from '../static';
|
|
13
13
|
export declare const highlighters: {
|
|
14
14
|
start: {
|
|
15
15
|
markup: string;
|
|
@@ -20,6 +20,16 @@ export declare const highlighters: {
|
|
|
20
20
|
textReplacement: string;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
+
export declare const highlightersWithTooltip: {
|
|
24
|
+
start: {
|
|
25
|
+
markup: string;
|
|
26
|
+
textReplacement: string;
|
|
27
|
+
};
|
|
28
|
+
end: {
|
|
29
|
+
markup: string;
|
|
30
|
+
textReplacement: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
23
33
|
export declare const ellipsis: {
|
|
24
34
|
start: {
|
|
25
35
|
markup: string;
|
|
@@ -32,17 +42,26 @@ export declare const ellipsis: {
|
|
|
32
42
|
};
|
|
33
43
|
export interface SyntaxHighlighterProps {
|
|
34
44
|
codeStringWithMarkup: string;
|
|
35
|
-
language?:
|
|
45
|
+
language?: string;
|
|
36
46
|
keepHighlights?: boolean;
|
|
37
47
|
showLineNumbers?: boolean;
|
|
48
|
+
block?: boolean;
|
|
38
49
|
startingLineNumber?: number;
|
|
39
50
|
showCopyOptions?: boolean;
|
|
51
|
+
highlightRangeWithTooltip?: ReferenceTrackerInformation[];
|
|
40
52
|
onCopiedToClipboard?: OnCopiedToClipboardFunction;
|
|
53
|
+
onInsertToCursorPosition?: OnInsertToCursorPositionFunction;
|
|
41
54
|
}
|
|
42
55
|
export declare class SyntaxHighlighter {
|
|
43
|
-
private readonly code;
|
|
44
56
|
private readonly onCopiedToClipboard?;
|
|
57
|
+
private readonly onInsertToCursorPosition?;
|
|
58
|
+
private readonly highlightRangeWithTooltip;
|
|
59
|
+
private highlightRangeTooltipTimeout;
|
|
60
|
+
private highlightRangeTooltip;
|
|
45
61
|
render: ExtendedHTMLElement;
|
|
46
62
|
constructor(props: SyntaxHighlighterProps);
|
|
63
|
+
private readonly showHighlightRangeTooltip;
|
|
64
|
+
private readonly hideHighlightRangeTooltip;
|
|
65
|
+
private readonly getSelectedCode;
|
|
47
66
|
private readonly copyToClipboard;
|
|
48
67
|
}
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../helper/dom';
|
|
6
|
+
import { MynahIcons } from './icon';
|
|
6
7
|
export interface ToggleOption {
|
|
7
8
|
label?: ExtendedHTMLElement | string | HTMLElement;
|
|
8
|
-
|
|
9
|
+
icon?: MynahIcons;
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
selected?: boolean;
|
|
11
12
|
value: string;
|
|
@@ -13,21 +14,25 @@ export interface ToggleOption {
|
|
|
13
14
|
}
|
|
14
15
|
export interface ToggleProps {
|
|
15
16
|
options: ToggleOption[];
|
|
16
|
-
|
|
17
|
+
direction?: 'horizontal' | 'vertical';
|
|
17
18
|
value?: string | null;
|
|
18
19
|
name: string;
|
|
19
20
|
disabled?: boolean;
|
|
20
21
|
onChange?: (selectedValue: string) => void;
|
|
22
|
+
onRemove?: (selectedValue: string) => void;
|
|
21
23
|
}
|
|
22
24
|
export declare class Toggle {
|
|
23
25
|
render: ExtendedHTMLElement;
|
|
24
26
|
private readonly props;
|
|
25
27
|
private currentValue?;
|
|
26
|
-
private readonly relocateTransitioner;
|
|
27
28
|
constructor(props: ToggleProps);
|
|
29
|
+
private readonly transformScroll;
|
|
28
30
|
private readonly getChildren;
|
|
29
|
-
private readonly setRelocatePosition;
|
|
30
31
|
private readonly updateSelectionRender;
|
|
31
32
|
setValue: (value: string) => void;
|
|
32
|
-
|
|
33
|
+
addOption: (option: ToggleOption) => void;
|
|
34
|
+
removeOption: (value: string) => void;
|
|
35
|
+
updateOptionTitle: (value: string, title: string) => void;
|
|
36
|
+
snapToOption: (value: string) => void;
|
|
37
|
+
getValue: () => string | undefined | null;
|
|
33
38
|
}
|
package/dist/helper/config.d.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { ConfigModel } from '../static';
|
|
6
|
+
export declare class Config {
|
|
7
|
+
private static instance;
|
|
8
|
+
config: ConfigModel;
|
|
9
|
+
private constructor();
|
|
10
|
+
static getInstance(config?: Partial<ConfigModel>): Config;
|
|
10
11
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
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 declare const getTimeDiff: (differenceInMs: number, show?: {
|
|
5
|
+
export declare const getTimeDiff: (differenceInMs: number, show?: 1 | 2 | 5 | 3 | 4 | 6 | {
|
|
6
6
|
years?: boolean | undefined;
|
|
7
7
|
months?: boolean | undefined;
|
|
8
8
|
weeks?: boolean | undefined;
|
|
9
9
|
days?: boolean | undefined;
|
|
10
10
|
hours?: boolean | undefined;
|
|
11
11
|
minutes?: boolean | undefined;
|
|
12
|
-
} |
|
|
12
|
+
} | undefined, separator?: string | undefined) => string;
|
package/dist/helper/dom.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
+
import { MynahPortalNames } from '../static';
|
|
5
6
|
export declare const DS: typeof document.querySelectorAll;
|
|
6
7
|
export interface DomBuilderObject {
|
|
7
8
|
type: string;
|
|
@@ -48,4 +49,6 @@ export declare class DomBuilder {
|
|
|
48
49
|
createPortal: (portalName: string, builderObject: DomBuilderObject, position: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend') => ExtendedHTMLElement;
|
|
49
50
|
getPortal: (portalName: string) => ExtendedHTMLElement;
|
|
50
51
|
removePortal: (portalName: string) => void;
|
|
52
|
+
removeAllPortals: (portalsWithName: MynahPortalNames) => void;
|
|
51
53
|
}
|
|
54
|
+
export declare const htmlDecode: (input: string) => string;
|
package/dist/helper/events.d.ts
CHANGED
|
@@ -9,22 +9,7 @@ export declare class MynahUIGlobalEvents {
|
|
|
9
9
|
private readonly listeners;
|
|
10
10
|
private constructor();
|
|
11
11
|
static getInstance: () => MynahUIGlobalEvents;
|
|
12
|
-
/**
|
|
13
|
-
* Subscribe to value changes of a specific item in data store
|
|
14
|
-
* @param eventKey One of the keys in MynahUIDataModel
|
|
15
|
-
* @param handler function will be called with optional data field
|
|
16
|
-
* @returns listenerId which will be necessary to removeListener
|
|
17
|
-
*/
|
|
18
12
|
addListener: (eventKey: MynahEventNames, handler: (data?: any) => void) => string;
|
|
19
|
-
/**
|
|
20
|
-
* Unsubscribe from changes of a specific item in data store
|
|
21
|
-
* @param eventKey One of the keys in MynahUIDataModel
|
|
22
|
-
* @param listenerId listenerId which is returned from addListener function
|
|
23
|
-
*/
|
|
24
13
|
removeListener: (eventKey: MynahEventNames, listenerId: string) => void;
|
|
25
|
-
/**
|
|
26
|
-
* Updates the store and informs the subscribers.
|
|
27
|
-
* @param data A full or partial set of store data model with values.
|
|
28
|
-
*/
|
|
29
14
|
dispatch: (eventKey: MynahEventNames, data?: any) => void;
|
|
30
15
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
export declare type TreeNode = FolderNode | FileNode;
|
|
6
|
+
export interface FileNode {
|
|
7
|
+
name: string;
|
|
8
|
+
type: 'file';
|
|
9
|
+
filePath: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FolderNode {
|
|
12
|
+
name: string;
|
|
13
|
+
type: 'folder';
|
|
14
|
+
children: Array<FolderNode | FileNode>;
|
|
15
|
+
}
|
|
16
|
+
export declare const fileListToTree: (filePaths: string[]) => TreeNode;
|