@aws/mynah-ui 4.17.1 → 4.18.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/dist/components/background.d.ts +10 -0
- package/dist/components/button.d.ts +4 -3
- package/dist/components/card/card-body.d.ts +1 -1
- package/dist/components/chat-item/chat-item-buttons.d.ts +1 -1
- package/dist/components/chat-item/chat-item-card-content.d.ts +2 -2
- package/dist/components/chat-item/chat-item-card.d.ts +4 -1
- package/dist/components/chat-item/chat-item-information-card.d.ts +3 -1
- package/dist/components/chat-item/chat-item-tabbed-card.d.ts +17 -0
- package/dist/components/chat-item/chat-item-tree-file.d.ts +1 -0
- package/dist/components/chat-item/chat-prompt-input.d.ts +3 -1
- package/dist/components/chat-item/chat-wrapper.d.ts +4 -0
- package/dist/components/icon.d.ts +1 -0
- package/dist/components/syntax-highlighter.d.ts +0 -21
- package/dist/components/title-description-with-icon.d.ts +20 -0
- package/dist/helper/chat-item.d.ts +2 -1
- package/dist/helper/dom.d.ts +1 -1
- package/dist/helper/test-ids.d.ts +5 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +51 -13
- package/docs/CONFIG.md +3 -0
- package/docs/DATAMODEL.md +354 -32
- package/docs/img/data-model/chatItems/actions.png +0 -0
- package/docs/img/data-model/chatItems/buttonFlash.png +0 -0
- package/docs/img/data-model/chatItems/confirmationButtons.png +0 -0
- package/docs/img/data-model/chatItems/hoverEffect.png +0 -0
- package/docs/img/data-model/chatItems/tabbed-card.png +0 -0
- package/docs/img/data-model/tabStore/compactMode.png +0 -0
- package/docs/img/data-model/tabStore/promptInputLabel.png +0 -0
- package/docs/img/data-model/tabStore/promptInputText.png +0 -0
- package/docs/img/data-model/tabStore/promptInputVisible.png +0 -0
- package/docs/img/data-model/tabStore/tabBackground.png +0 -0
- package/docs/img/data-model/tabStore/tabHeaderDetails.png +0 -0
- package/docs/img/data-model/tabStore/tabHeaderDetails2.png +0 -0
- package/package.json +1 -1
- package/ui-tests/dist/main.js +1 -1
- package/ui-tests/dist/main.js.map +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
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 '../styles/components/_background.scss';
|
|
7
|
+
export declare class GradientBackground {
|
|
8
|
+
render: ExtendedHTMLElement;
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
@@ -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 { ExtendedHTMLElement } from '../helper/dom';
|
|
5
|
+
import { DomBuilderEventHandler, DomBuilderEventHandlerWithOptions, ExtendedHTMLElement, GenericEvents } from '../helper/dom';
|
|
6
6
|
import { OverlayHorizontalDirection, OverlayVerticalDirection } from './overlay';
|
|
7
7
|
import '../styles/components/_button.scss';
|
|
8
8
|
export interface ButtonProps {
|
|
@@ -18,9 +18,10 @@ export interface ButtonProps {
|
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
primary?: boolean;
|
|
20
20
|
border?: boolean;
|
|
21
|
-
status?: 'primary' | 'info' | 'success' | 'warning' | 'error';
|
|
22
|
-
additionalEvents?: Record<
|
|
21
|
+
status?: 'main' | 'primary' | 'info' | 'success' | 'warning' | 'error' | 'clear';
|
|
22
|
+
additionalEvents?: Partial<Record<GenericEvents, DomBuilderEventHandler | DomBuilderEventHandlerWithOptions>>;
|
|
23
23
|
onClick: (e: Event) => void;
|
|
24
|
+
onHover?: (e: Event) => void;
|
|
24
25
|
}
|
|
25
26
|
export declare abstract class ButtonAbstract {
|
|
26
27
|
render: ExtendedHTMLElement;
|
|
@@ -22,7 +22,7 @@ export interface CardBodyProps {
|
|
|
22
22
|
testId?: string;
|
|
23
23
|
children?: Array<ExtendedHTMLElement | HTMLElement | string | DomBuilderObject>;
|
|
24
24
|
childLocation?: 'above-body' | 'below-body';
|
|
25
|
-
highlightRangeWithTooltip?: ReferenceTrackerInformation[];
|
|
25
|
+
highlightRangeWithTooltip?: ReferenceTrackerInformation[] | null;
|
|
26
26
|
codeBlockActions?: CodeBlockActions;
|
|
27
27
|
useParts?: boolean;
|
|
28
28
|
codeBlockStartIndex?: number;
|
|
@@ -8,7 +8,7 @@ import { ChatItemFormItemsWrapper } from './chat-item-form-items';
|
|
|
8
8
|
export interface ChatItemButtonsWrapperProps {
|
|
9
9
|
tabId?: string;
|
|
10
10
|
classNames?: string[];
|
|
11
|
-
buttons: ChatItemButton[];
|
|
11
|
+
buttons: ChatItemButton[] | null;
|
|
12
12
|
formItems?: ChatItemFormItemsWrapper | null;
|
|
13
13
|
onActionClick?: (action: ChatItemButton, e?: Event) => void;
|
|
14
14
|
}
|
|
@@ -6,11 +6,11 @@ import { DomBuilderObject, ExtendedHTMLElement } from '../../helper/dom';
|
|
|
6
6
|
import { CardRenderDetails, CodeBlockActions, OnCodeBlockActionFunction, OnCopiedToClipboardFunction, ReferenceTrackerInformation } from '../../static';
|
|
7
7
|
import { CardBody } from '../card/card-body';
|
|
8
8
|
export interface ChatItemCardContentProps {
|
|
9
|
-
body?: string;
|
|
9
|
+
body?: string | null;
|
|
10
10
|
testId?: string;
|
|
11
11
|
renderAsStream?: boolean;
|
|
12
12
|
classNames?: string[];
|
|
13
|
-
codeReference?: ReferenceTrackerInformation[];
|
|
13
|
+
codeReference?: ReferenceTrackerInformation[] | null;
|
|
14
14
|
onAnimationStateChange?: (isAnimating: boolean) => void;
|
|
15
15
|
contentProperties?: {
|
|
16
16
|
codeBlockActions?: CodeBlockActions;
|
|
@@ -18,12 +18,14 @@ export declare class ChatItemCard {
|
|
|
18
18
|
private readonly initialSpinner;
|
|
19
19
|
private cardFooter;
|
|
20
20
|
private informationCard;
|
|
21
|
+
private tabbedCard;
|
|
21
22
|
private cardIcon;
|
|
22
23
|
private contentBody;
|
|
23
24
|
private chatAvatar;
|
|
24
25
|
private chatFormItems;
|
|
25
26
|
private customRendererWrapper;
|
|
26
|
-
private
|
|
27
|
+
private chatButtonsInside;
|
|
28
|
+
private chatButtonsOutside;
|
|
27
29
|
private fileTreeWrapper;
|
|
28
30
|
private followUps;
|
|
29
31
|
private votes;
|
|
@@ -38,6 +40,7 @@ export declare class ChatItemCard {
|
|
|
38
40
|
private readonly checkCardSnap;
|
|
39
41
|
readonly updateCard: () => void;
|
|
40
42
|
readonly updateCardStack: (updateWith: Partial<ChatItem>) => void;
|
|
43
|
+
readonly clearContent: () => void;
|
|
41
44
|
readonly getRenderDetails: () => CardRenderDetails;
|
|
42
45
|
readonly cleanFollowupsAndRemoveIfEmpty: () => boolean;
|
|
43
46
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
2
2
|
import { ChatItemContent } from '../../static';
|
|
3
|
+
import '../../styles/components/chat/_chat-item-card-information-card.scss';
|
|
3
4
|
export interface ChatItemInformationCardProps {
|
|
4
5
|
tabId: string;
|
|
5
6
|
testId?: string;
|
|
6
7
|
messageId: string | undefined;
|
|
7
|
-
|
|
8
|
+
classNames?: string[];
|
|
9
|
+
informationCard: NonNullable<Required<ChatItemContent>['informationCard']>;
|
|
8
10
|
}
|
|
9
11
|
export declare class ChatItemInformationCard {
|
|
10
12
|
render: ExtendedHTMLElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
2
|
+
import { ChatItemContent } from '../../static';
|
|
3
|
+
import { ChatItemCard } from './chat-item-card';
|
|
4
|
+
import '../../styles/components/chat/_chat-item-card-tabbed-card.scss';
|
|
5
|
+
export interface ChatItemTabbedCardProps {
|
|
6
|
+
tabId: string;
|
|
7
|
+
messageId: string | undefined;
|
|
8
|
+
tabbedCard: NonNullable<Required<ChatItemContent>['tabbedContent']>;
|
|
9
|
+
classNames?: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare class ChatItemTabbedCard {
|
|
12
|
+
contentCard: ChatItemCard;
|
|
13
|
+
render: ExtendedHTMLElement;
|
|
14
|
+
props: ChatItemTabbedCardProps;
|
|
15
|
+
constructor(props: ChatItemTabbedCardProps);
|
|
16
|
+
private readonly getTabOfSelectedOrGivenValue;
|
|
17
|
+
}
|
|
@@ -20,6 +20,7 @@ export declare class ChatPromptInput {
|
|
|
20
20
|
private readonly progressIndicator;
|
|
21
21
|
private readonly promptAttachment;
|
|
22
22
|
private readonly chatPrompt;
|
|
23
|
+
private promptTextInputLabel;
|
|
23
24
|
private remainingCharsOverlay;
|
|
24
25
|
private quickPickTriggerIndex;
|
|
25
26
|
private quickPickType;
|
|
@@ -36,7 +37,8 @@ export declare class ChatPromptInput {
|
|
|
36
37
|
private readonly getQuickPickItemGroups;
|
|
37
38
|
private readonly handleQuickActionCommandSelection;
|
|
38
39
|
private readonly handleContextCommandSelection;
|
|
40
|
+
private readonly sendPrompt;
|
|
41
|
+
private readonly getPromptInputTextLabel;
|
|
39
42
|
readonly clearTextArea: (keepAttachment?: boolean) => void;
|
|
40
43
|
readonly addAttachment: (attachmentContent: string, type?: PromptAttachmentType) => void;
|
|
41
|
-
private readonly sendPrompt;
|
|
42
44
|
}
|
|
@@ -16,8 +16,12 @@ export declare class ChatWrapper {
|
|
|
16
16
|
private readonly intermediateBlockContainer;
|
|
17
17
|
private readonly promptInputElement;
|
|
18
18
|
private readonly promptInput;
|
|
19
|
+
private readonly footerSpacer;
|
|
20
|
+
private readonly headerSpacer;
|
|
19
21
|
private readonly promptInfo;
|
|
20
22
|
private readonly promptStickyCard;
|
|
23
|
+
private tabHeaderDetails;
|
|
24
|
+
private tabModeSwitchTimeout;
|
|
21
25
|
private lastStreamingChatItemCard;
|
|
22
26
|
private lastStreamingChatItemMessageId;
|
|
23
27
|
private allRenderedChatItems;
|
|
@@ -31,30 +31,9 @@ import 'prismjs/plugins/keep-markup/prism-keep-markup.js';
|
|
|
31
31
|
import 'prismjs/plugins/diff-highlight/prism-diff-highlight.min';
|
|
32
32
|
import { CodeBlockActions, CodeSelectionType, OnCodeBlockActionFunction } from '../static';
|
|
33
33
|
import '../styles/components/_syntax-highlighter.scss';
|
|
34
|
-
export declare const highlighters: {
|
|
35
|
-
start: {
|
|
36
|
-
markup: string;
|
|
37
|
-
textReplacement: string;
|
|
38
|
-
};
|
|
39
|
-
end: {
|
|
40
|
-
markup: string;
|
|
41
|
-
textReplacement: string;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export declare const ellipsis: {
|
|
45
|
-
start: {
|
|
46
|
-
markup: string;
|
|
47
|
-
textReplacement: string;
|
|
48
|
-
};
|
|
49
|
-
end: {
|
|
50
|
-
markup: string;
|
|
51
|
-
textReplacement: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
34
|
export interface SyntaxHighlighterProps {
|
|
55
35
|
codeStringWithMarkup: string;
|
|
56
36
|
language?: string;
|
|
57
|
-
keepHighlights?: boolean;
|
|
58
37
|
showLineNumbers?: boolean;
|
|
59
38
|
block?: boolean;
|
|
60
39
|
startingLineNumber?: number;
|
|
@@ -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 { DomBuilderObject, ExtendedHTMLElement } from '../helper/dom';
|
|
6
|
+
import { MynahIcons } from './icon';
|
|
7
|
+
import '../styles/components/_title-description-icon.scss';
|
|
8
|
+
interface TitleDescriptionWithIconProps {
|
|
9
|
+
title?: string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
|
|
10
|
+
description?: string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
|
|
11
|
+
icon?: MynahIcons;
|
|
12
|
+
testId?: string;
|
|
13
|
+
classNames?: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare class TitleDescriptionWithIcon {
|
|
16
|
+
render: ExtendedHTMLElement;
|
|
17
|
+
private readonly props;
|
|
18
|
+
constructor(props: TitleDescriptionWithIconProps);
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { ChatItem } from '../static';
|
|
1
|
+
import { ChatItem, ChatItemContent } from '../static';
|
|
2
|
+
export declare const emptyChatItemContent: ChatItemContent;
|
|
2
3
|
export declare const chatItemHasContent: (chatItem: Partial<ChatItem>) => boolean;
|
|
3
4
|
export declare const copyToClipboard: (textToSendClipboard: string, onCopied?: () => void) => Promise<void>;
|
package/dist/helper/dom.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { MynahPortalNames } from '../static';
|
|
6
6
|
import { AllowedTagsInCustomRenderer, AllowedAttributesInCustomRenderer } from './sanitize';
|
|
7
7
|
export declare const DS: typeof document.querySelectorAll;
|
|
8
|
-
type GenericEvents = Extract<keyof GlobalEventHandlersEventMap, string>;
|
|
8
|
+
export type GenericEvents = Extract<keyof GlobalEventHandlersEventMap, string>;
|
|
9
9
|
export type DomBuilderEventHandler = (event?: any) => any;
|
|
10
10
|
export interface DomBuilderEventHandlerWithOptions {
|
|
11
11
|
handler: DomBuilderEventHandler;
|
|
@@ -18,12 +18,14 @@ declare const _default: {
|
|
|
18
18
|
footerInfoBody: string;
|
|
19
19
|
stickyCard: string;
|
|
20
20
|
progress: string;
|
|
21
|
+
label: string;
|
|
21
22
|
};
|
|
22
23
|
chat: {
|
|
23
24
|
wrapper: string;
|
|
24
25
|
chatItemsContainer: string;
|
|
25
26
|
middleBlockWrapper: string;
|
|
26
27
|
stopButton: string;
|
|
28
|
+
header: string;
|
|
27
29
|
};
|
|
28
30
|
chatItem: {
|
|
29
31
|
type: {
|
|
@@ -93,6 +95,9 @@ declare const _default: {
|
|
|
93
95
|
fileAction: string;
|
|
94
96
|
fileTooltipWrapper: string;
|
|
95
97
|
};
|
|
98
|
+
tabbedCard: {
|
|
99
|
+
tabs: string;
|
|
100
|
+
};
|
|
96
101
|
};
|
|
97
102
|
feedbackForm: {
|
|
98
103
|
wrapper: string;
|
package/dist/main.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export interface MynahUIProps {
|
|
|
40
40
|
text?: string;
|
|
41
41
|
formItemValues?: Record<string, string>;
|
|
42
42
|
}, eventId?: string) => void;
|
|
43
|
+
onTabbedContentTabChange?: (tabId: string, messageId: string, contentTabId: string, eventId?: string) => void;
|
|
43
44
|
onTabChange?: (tabId: string, eventId?: string) => void;
|
|
44
45
|
onTabAdd?: (tabId: string, eventId?: string) => void;
|
|
45
46
|
onTabRemove?: (tabId: string, eventId?: string) => void;
|