@aws/mynah-ui 2.0.0-beta.13.9 → 2.0.0-beta.14.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/components/card/card-body.d.ts +35 -0
- package/dist/components/{card.d.ts → card/card.d.ts} +4 -1
- package/dist/components/chat-item/chat-item-card.d.ts +2 -2
- package/dist/components/chat-item/chat-item-related-content.d.ts +0 -2
- package/dist/components/chat-item/chat-prompt-input.d.ts +4 -0
- package/dist/components/chat-item/prompt-input/code-snippet-widget.d.ts +0 -1
- package/dist/components/chat-item/prompt-input/code-snippet.d.ts +3 -0
- package/dist/components/suggestion-card/suggestion-card-body.d.ts +0 -19
- package/dist/components/suggestion-card/suggestion-card.d.ts +0 -1
- package/dist/components/syntax-highlighter.d.ts +1 -0
- package/dist/main.d.ts +3 -6
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +4 -2
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
onCopiedToClipboard?: OnCopiedToClipboardFunction;
|
|
22
|
+
onInsertToCursorPosition?: OnInsertToCursorPositionFunction;
|
|
23
|
+
}
|
|
24
|
+
export declare class CardBody {
|
|
25
|
+
render: ExtendedHTMLElement;
|
|
26
|
+
props: CardBodyProps;
|
|
27
|
+
private highlightRangeTooltip;
|
|
28
|
+
private highlightRangeTooltipTimeout;
|
|
29
|
+
constructor(props: CardBodyProps);
|
|
30
|
+
private readonly processNode;
|
|
31
|
+
private readonly getReferenceTrackerInformationFromElement;
|
|
32
|
+
private readonly showHighlightRangeTooltip;
|
|
33
|
+
private readonly hideHighlightRangeTooltip;
|
|
34
|
+
private readonly getContentBodyChildren;
|
|
35
|
+
}
|
|
@@ -2,8 +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
|
-
import { DomBuilderObject, ExtendedHTMLElement } from '
|
|
5
|
+
import { DomBuilderObject, ExtendedHTMLElement } from '../../helper/dom';
|
|
6
6
|
export interface CardProps extends Partial<DomBuilderObject> {
|
|
7
|
+
border?: boolean;
|
|
8
|
+
background?: boolean;
|
|
9
|
+
padding?: 'small' | 'medium' | 'large' | 'none';
|
|
7
10
|
children?: Array<HTMLElement | ExtendedHTMLElement | string>;
|
|
8
11
|
}
|
|
9
12
|
export declare class Card {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
6
|
import { ChatItem } from '../../static';
|
|
7
|
-
import {
|
|
7
|
+
import { CardBody } from '../card/card-body';
|
|
8
8
|
export interface ChatItemCardProps {
|
|
9
9
|
tabId: string;
|
|
10
10
|
chatItem: ChatItem;
|
|
@@ -12,7 +12,7 @@ export interface ChatItemCardProps {
|
|
|
12
12
|
export declare class ChatItemCard {
|
|
13
13
|
readonly props: ChatItemCardProps;
|
|
14
14
|
render: ExtendedHTMLElement;
|
|
15
|
-
|
|
15
|
+
contentBody: CardBody;
|
|
16
16
|
chatAvatar: ExtendedHTMLElement;
|
|
17
17
|
constructor(props: ChatItemCardProps);
|
|
18
18
|
private readonly generateCard;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
6
|
import { Suggestion } from '../../static';
|
|
7
|
-
import { SuggestionCardBody } from '../suggestion-card/suggestion-card-body';
|
|
8
7
|
export interface ChatItemRelatedContentProps {
|
|
9
8
|
tabId: string;
|
|
10
9
|
messageId: string;
|
|
@@ -17,7 +16,6 @@ export declare class ChatItemRelatedContent {
|
|
|
17
16
|
private relatedContentPreview;
|
|
18
17
|
private relatedContentPreviewTimeout;
|
|
19
18
|
render: ExtendedHTMLElement;
|
|
20
|
-
suggestionCardBody: SuggestionCardBody;
|
|
21
19
|
chatAvatar: ExtendedHTMLElement;
|
|
22
20
|
constructor(props: ChatItemRelatedContentProps);
|
|
23
21
|
private readonly showLinkPreview;
|
|
@@ -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
|
}
|
|
@@ -14,8 +15,10 @@ export declare class ChatPromptInput {
|
|
|
14
15
|
private readonly promptTextInput;
|
|
15
16
|
private readonly promptTextInputSizer;
|
|
16
17
|
private readonly promptTextInputCommand;
|
|
18
|
+
private readonly remainingCharsIndicator;
|
|
17
19
|
private readonly sendButton;
|
|
18
20
|
private readonly codeSnippet;
|
|
21
|
+
private currentAttachmentLength;
|
|
19
22
|
private quickActionCommands;
|
|
20
23
|
private commandSelector;
|
|
21
24
|
private commandSelectorOpen;
|
|
@@ -24,6 +27,7 @@ export declare class ChatPromptInput {
|
|
|
24
27
|
private attachment?;
|
|
25
28
|
private filteredCommandsList;
|
|
26
29
|
constructor(props: ChatPromptInputProps);
|
|
30
|
+
private readonly updateAvailableChars;
|
|
27
31
|
private readonly handleInputKeydown;
|
|
28
32
|
private readonly getQuickCommandActions;
|
|
29
33
|
private readonly handleCommandSelection;
|
|
@@ -6,7 +6,6 @@ export interface ICodeSnippetWidgetProps {
|
|
|
6
6
|
export declare class CodeSnippetWidget {
|
|
7
7
|
private readonly props;
|
|
8
8
|
private previewOverlay;
|
|
9
|
-
private parsedCode;
|
|
10
9
|
render: ExtendedHTMLElement;
|
|
11
10
|
constructor(props: ICodeSnippetWidgetProps);
|
|
12
11
|
private readonly showPreviewOverLay;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ExtendedHTMLElement } from '../../../helper/dom';
|
|
2
2
|
export interface ICodeSnippetProps {
|
|
3
3
|
tabId: string;
|
|
4
|
+
onCodeSnippetAdd?: (codeSnippet: string) => void;
|
|
5
|
+
onCodeSnippetRemove?: () => void;
|
|
4
6
|
}
|
|
5
7
|
export interface ISelectCodeSnippetEvent {
|
|
6
8
|
tabId: string;
|
|
@@ -9,6 +11,7 @@ export interface ISelectCodeSnippetEvent {
|
|
|
9
11
|
export declare class CodeSnippet {
|
|
10
12
|
private readonly props;
|
|
11
13
|
render: ExtendedHTMLElement;
|
|
14
|
+
availableChars: number;
|
|
12
15
|
constructor(props: ICodeSnippetProps);
|
|
13
16
|
readonly clear: () => void;
|
|
14
17
|
}
|
|
@@ -4,32 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { DomBuilderObject, ExtendedHTMLElement } from '../../helper/dom';
|
|
6
6
|
import { ReferenceTrackerInformation, Suggestion } 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
7
|
export interface SuggestionCardBodyProps {
|
|
18
8
|
suggestion: Partial<Suggestion>;
|
|
19
9
|
children?: Array<ExtendedHTMLElement | HTMLElement | string | DomBuilderObject>;
|
|
20
10
|
highlightRangeWithTooltip?: ReferenceTrackerInformation[];
|
|
21
|
-
showFooterButtons?: boolean;
|
|
22
11
|
}
|
|
23
12
|
export declare class SuggestionCardBody {
|
|
24
13
|
render: ExtendedHTMLElement;
|
|
25
|
-
cardBody: ExtendedHTMLElement;
|
|
26
14
|
props: SuggestionCardBodyProps;
|
|
27
|
-
private highlightRangeTooltip;
|
|
28
|
-
private highlightRangeTooltipTimeout;
|
|
29
15
|
constructor(props: SuggestionCardBodyProps);
|
|
30
|
-
private readonly processNode;
|
|
31
|
-
private readonly getReferenceTrackerInformationFromElement;
|
|
32
|
-
private readonly showHighlightRangeTooltip;
|
|
33
|
-
private readonly hideHighlightRangeTooltip;
|
|
34
|
-
private readonly getCardBodyChildren;
|
|
35
16
|
}
|
|
@@ -64,6 +64,7 @@ export declare class SyntaxHighlighter {
|
|
|
64
64
|
private readonly onInsertToCursorPosition?;
|
|
65
65
|
render: ExtendedHTMLElement;
|
|
66
66
|
constructor(props: SyntaxHighlighterProps);
|
|
67
|
+
private readonly getSelectedCodeContextMenu;
|
|
67
68
|
private readonly getSelectedCode;
|
|
68
69
|
private readonly copyToClipboard;
|
|
69
70
|
}
|
package/dist/main.d.ts
CHANGED
|
@@ -2,7 +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 { SuggestionEngagement, Suggestion, SuggestionEventName, RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemFollowUp, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation } from './static';
|
|
5
|
+
import { SuggestionEngagement, Suggestion, SuggestionEventName, RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemFollowUp, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation, CodeSelectionType } from './static';
|
|
6
6
|
import './styles/styles.scss';
|
|
7
7
|
export { FeedbackPayload, RelevancyVoteType, Suggestion, EngagementType, SuggestionEngagement, SuggestionEventName, MynahUIDataModel, NotificationType, ChatItem, ChatItemFollowUp, ChatItemType, ChatPrompt } from './static';
|
|
8
8
|
export { ToggleOption } from './components/toggle';
|
|
@@ -23,8 +23,8 @@ export interface MynahUIProps {
|
|
|
23
23
|
onTabAdd?: (tabId: string) => void;
|
|
24
24
|
onTabRemove?: (tabId: string) => void;
|
|
25
25
|
onSuggestionEngagement?: (tabId: string, engagement: SuggestionEngagement) => void;
|
|
26
|
-
onCopyCodeToClipboard?: (tabId: string, messageId: string, code?: string, type?:
|
|
27
|
-
onCodeInsertToCursorPosition?: (tabId: string, messageId: string, code?: string, type?:
|
|
26
|
+
onCopyCodeToClipboard?: (tabId: string, messageId: string, code?: string, type?: CodeSelectionType, referenceTrackerInformation?: ReferenceTrackerInformation[]) => void;
|
|
27
|
+
onCodeInsertToCursorPosition?: (tabId: string, messageId: string, code?: string, type?: CodeSelectionType, referenceTrackerInformation?: ReferenceTrackerInformation[]) => void;
|
|
28
28
|
onSuggestionInteraction?: (tabId: string, eventName: SuggestionEventName, suggestion: Suggestion, mouseEvent?: MouseEvent) => void;
|
|
29
29
|
onSendFeedback?: (tabId: string, feedbackPayload: FeedbackPayload) => void;
|
|
30
30
|
onOpenDiff?: (tabId: string, leftPath: string, rightPath: string, messageId?: string) => void;
|
|
@@ -38,9 +38,6 @@ export declare class MynahUI {
|
|
|
38
38
|
private readonly chatWrappers;
|
|
39
39
|
constructor(props: MynahUIProps);
|
|
40
40
|
private readonly addGlobalListeners;
|
|
41
|
-
createNewTab: (initialTabData: MynahUIDataModel) => string;
|
|
42
|
-
updateTab: (tabId: string, tabData: MynahUIDataModel) => void;
|
|
43
|
-
setChatLoadingState: (tabId: string, isLoading: boolean) => void;
|
|
44
41
|
addToUserPrompt: (tabId: string, prompt: string) => void;
|
|
45
42
|
addChatItem: (tabId: string, chatItem: ChatItem) => void;
|
|
46
43
|
updateLastChatAnswer: (tabId: string, updateWith: Partial<ChatItem>) => void;
|