@aws/mynah-ui 4.27.0-beta.2 → 4.27.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/card/card-body.d.ts +1 -0
- package/dist/components/chat-item/chat-item-card-content.d.ts +1 -0
- package/dist/components/chat-item/chat-item-card.d.ts +0 -1
- package/dist/components/chat-item/chat-item-form-items.d.ts +1 -1
- package/dist/components/chat-item/chat-item-tree-file.d.ts +2 -2
- package/dist/components/chat-item/chat-prompt-input.d.ts +1 -0
- package/dist/components/chat-item/prompt-input/prompt-options.d.ts +16 -0
- package/dist/components/detailed-list/detailed-list-item.d.ts +2 -1
- package/dist/components/detailed-list/detailed-list.d.ts +4 -4
- package/dist/components/form-items/radio-group.d.ts +4 -1
- package/dist/components/icon.d.ts +2 -1
- package/dist/components/more-content-indicator.d.ts +24 -0
- package/dist/components/syntax-highlighter.d.ts +1 -0
- package/dist/components/{toggle.d.ts → tabs.d.ts} +4 -4
- package/dist/helper/test-ids.d.ts +3 -0
- package/dist/main.d.ts +4 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +42 -6
- package/docs/DATAMODEL.md +294 -29
- package/docs/PROPERTIES.md +32 -0
- package/docs/STYLING.md +1 -0
- package/docs/USAGE.md +32 -0
- package/docs/img/data-model/chatItems/directive.png +0 -0
- package/docs/img/data-model/chatItems/fileListDetailsChanges.png +0 -0
- package/docs/img/data-model/chatItems/fullWidth.png +0 -0
- package/docs/img/data-model/chatItems/headerMore.png +0 -0
- package/docs/img/data-model/chatItems/options-all-filled.png +0 -0
- package/docs/img/data-model/chatItems/options-mandatory-filled.png +0 -0
- package/docs/img/data-model/chatItems/options-submitted.png +0 -0
- package/docs/img/data-model/chatItems/options.png +0 -0
- package/docs/img/data-model/chatItems/padding.png +0 -0
- package/docs/img/data-model/tabStore/promptOptions.png +0 -0
- package/docs/img/detailedListSheet.png +0 -0
- package/package.json +1 -1
- package/ui-tests/dist/27f62b53b93858475a7f.ttf +0 -0
- package/ui-tests/dist/d50a80138ec4f2fb5e9f.ttf +0 -0
- package/ui-tests/dist/index.html +9 -0
- package/ui-tests/dist/main.js +1362 -0
- package/ui-tests/dist/main.js.map +1 -0
|
@@ -23,6 +23,7 @@ export interface CardBodyProps {
|
|
|
23
23
|
children?: Array<ExtendedHTMLElement | HTMLElement | string | DomBuilderObject>;
|
|
24
24
|
childLocation?: 'above-body' | 'below-body';
|
|
25
25
|
highlightRangeWithTooltip?: ReferenceTrackerInformation[] | null;
|
|
26
|
+
hideCodeBlockLanguage?: boolean;
|
|
26
27
|
codeBlockActions?: CodeBlockActions;
|
|
27
28
|
useParts?: boolean;
|
|
28
29
|
codeBlockStartIndex?: number;
|
|
@@ -10,6 +10,7 @@ export interface ChatItemCardContentProps {
|
|
|
10
10
|
testId?: string;
|
|
11
11
|
renderAsStream?: boolean;
|
|
12
12
|
classNames?: string[];
|
|
13
|
+
hideCodeBlockLanguage?: boolean;
|
|
13
14
|
codeReference?: ReferenceTrackerInformation[] | null;
|
|
14
15
|
onAnimationStateChange?: (isAnimating: boolean) => void;
|
|
15
16
|
contentProperties?: {
|
|
@@ -41,7 +41,6 @@ export declare class ChatItemCard {
|
|
|
41
41
|
private readonly updateCardContent;
|
|
42
42
|
private readonly getChatAvatar;
|
|
43
43
|
private readonly canShowAvatar;
|
|
44
|
-
private readonly checkCardSnap;
|
|
45
44
|
readonly updateCard: () => void;
|
|
46
45
|
readonly updateCardStack: (updateWith: Partial<ChatItem>) => void;
|
|
47
46
|
readonly clearContent: () => void;
|
|
@@ -21,7 +21,7 @@ export declare class ChatItemFormItemsWrapper {
|
|
|
21
21
|
onAllFormItemsDisabled?: () => void;
|
|
22
22
|
render: ExtendedHTMLElement;
|
|
23
23
|
constructor(props: ChatItemFormItemsWrapperProps);
|
|
24
|
-
private readonly
|
|
24
|
+
private readonly getHandlers;
|
|
25
25
|
private readonly handleTextualItemKeyPressEvent;
|
|
26
26
|
private readonly isItemValid;
|
|
27
27
|
isFormValid: () => boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
2
2
|
import { FileNodeAction, TreeNodeDetails } from '../../static';
|
|
3
|
-
import { MynahIcons } from '../icon';
|
|
3
|
+
import { MynahIcons, MynahIconsType } from '../icon';
|
|
4
4
|
export interface ChatItemTreeFileProps {
|
|
5
5
|
tabId: string;
|
|
6
6
|
messageId: string;
|
|
7
7
|
filePath: string;
|
|
8
8
|
originalFilePath: string;
|
|
9
9
|
fileName: string;
|
|
10
|
-
icon?: MynahIcons;
|
|
10
|
+
icon?: MynahIcons | MynahIconsType | null;
|
|
11
11
|
deleted?: boolean;
|
|
12
12
|
details?: TreeNodeDetails;
|
|
13
13
|
actions?: FileNodeAction[];
|
|
@@ -19,6 +19,7 @@ export declare class ChatPromptInput {
|
|
|
19
19
|
private readonly sendButton;
|
|
20
20
|
private readonly progressIndicator;
|
|
21
21
|
private readonly promptAttachment;
|
|
22
|
+
private readonly promptOptions;
|
|
22
23
|
private readonly chatPrompt;
|
|
23
24
|
private quickPickItemsSelectorContainer;
|
|
24
25
|
private promptTextInputLabel;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ExtendedHTMLElement } from '../../../helper/dom';
|
|
2
|
+
import { FilterOption } from '../../../static';
|
|
3
|
+
export interface PromptOptionsProps {
|
|
4
|
+
classNames?: string[];
|
|
5
|
+
filterOptions: FilterOption[];
|
|
6
|
+
onFiltersChange?: (filterFormData: Record<string, any>, isValid: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare class PromptOptions {
|
|
9
|
+
render: ExtendedHTMLElement;
|
|
10
|
+
private readonly props;
|
|
11
|
+
private formItemsWrapper;
|
|
12
|
+
constructor(props: PromptOptionsProps);
|
|
13
|
+
private readonly getFilterOptionsWrapper;
|
|
14
|
+
readonly update: (filterOptions: FilterOption[]) => void;
|
|
15
|
+
readonly getOptionValues: () => Record<string, string>;
|
|
16
|
+
}
|
|
@@ -5,13 +5,14 @@ export interface DetailedListItemWrapperProps {
|
|
|
5
5
|
onSelect?: (detailedListItem: DetailedListItem) => void;
|
|
6
6
|
onActionClick?: (action: ChatItemButton) => void;
|
|
7
7
|
selectable?: boolean;
|
|
8
|
+
textDirection?: 'row' | 'column';
|
|
8
9
|
}
|
|
9
10
|
export declare class DetailedListItemWrapper {
|
|
10
11
|
render: ExtendedHTMLElement;
|
|
11
12
|
private readonly props;
|
|
12
13
|
private actionMenuOverlay;
|
|
13
14
|
constructor(props: DetailedListItemWrapperProps);
|
|
14
|
-
readonly setFocus: (isFocused: boolean) => void;
|
|
15
|
+
readonly setFocus: (isFocused: boolean, scrollIntoView: boolean) => void;
|
|
15
16
|
readonly getItem: () => DetailedListItem;
|
|
16
17
|
private readonly showActionMenuOverlay;
|
|
17
18
|
private getActionButton;
|
|
@@ -3,9 +3,9 @@ import { ChatItemButton, DetailedList, DetailedListItem } from '../../static';
|
|
|
3
3
|
export interface DetailedListWrapperProps {
|
|
4
4
|
detailedList: DetailedList;
|
|
5
5
|
onFilterValueChange?: (filterValues: Record<string, any>, isValid: boolean) => void;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
onGroupActionClick?: (action: ChatItemButton) => void;
|
|
7
|
+
onItemSelect?: (detailedListItem: DetailedListItem) => void;
|
|
8
|
+
onItemActionClick?: (action: ChatItemButton) => void;
|
|
9
9
|
}
|
|
10
10
|
export declare class DetailedListWrapper {
|
|
11
11
|
render: ExtendedHTMLElement;
|
|
@@ -19,7 +19,7 @@ export declare class DetailedListWrapper {
|
|
|
19
19
|
private readonly getHeader;
|
|
20
20
|
private readonly getFilters;
|
|
21
21
|
private readonly getDetailedListItemGroups;
|
|
22
|
-
readonly changeTarget: (direction: 'up' | 'down', snapOnLastAndFirst?: boolean) => void;
|
|
22
|
+
readonly changeTarget: (direction: 'up' | 'down', snapOnLastAndFirst?: boolean, scrollIntoView?: boolean) => void;
|
|
23
23
|
readonly getTargetElement: () => DetailedListItem | null;
|
|
24
24
|
readonly update: (detailedList: DetailedList) => void;
|
|
25
25
|
}
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
|
+
import { MynahIcons, MynahIconsType } from '../icon';
|
|
6
7
|
import '../../styles/components/_form-input.scss';
|
|
7
8
|
interface SelectOption {
|
|
8
9
|
value: string;
|
|
9
|
-
label
|
|
10
|
+
label?: string;
|
|
11
|
+
icon?: MynahIcons | MynahIconsType;
|
|
10
12
|
}
|
|
11
13
|
export interface RadioGroupProps {
|
|
14
|
+
type?: 'radio' | 'toggle';
|
|
12
15
|
classNames?: string[];
|
|
13
16
|
attributes?: Record<string, string>;
|
|
14
17
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
@@ -52,8 +52,9 @@ export declare enum MynahIcons {
|
|
|
52
52
|
SCROLL_DOWN = "scroll-down",
|
|
53
53
|
USER = "user",
|
|
54
54
|
PLAY = "play",
|
|
55
|
-
PENCIL = "pencil",
|
|
56
55
|
PAUSE = "pause",
|
|
56
|
+
STOP = "stop",
|
|
57
|
+
PENCIL = "pencil",
|
|
57
58
|
CODE_BLOCK = "code-block",
|
|
58
59
|
COPY = "copy",
|
|
59
60
|
CURSOR_INSERT = "cursor-insert",
|
|
@@ -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 { MynahIcons, MynahIconsType } from './icon';
|
|
7
|
+
import '../styles/components/_more-content-indicator.scss';
|
|
8
|
+
interface MoreContentIndicatorProps {
|
|
9
|
+
icon?: MynahIcons | MynahIconsType;
|
|
10
|
+
border?: boolean;
|
|
11
|
+
testId?: string;
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare class MoreContentIndicator {
|
|
15
|
+
render: ExtendedHTMLElement;
|
|
16
|
+
private props;
|
|
17
|
+
private button;
|
|
18
|
+
private readonly uid;
|
|
19
|
+
private readonly icon;
|
|
20
|
+
constructor(props: MoreContentIndicatorProps);
|
|
21
|
+
private readonly getButton;
|
|
22
|
+
update: (props: Partial<MoreContentIndicatorProps>) => void;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -13,6 +13,7 @@ export interface SyntaxHighlighterProps {
|
|
|
13
13
|
startingLineNumber?: number;
|
|
14
14
|
index?: number;
|
|
15
15
|
codeBlockActions?: CodeBlockActions;
|
|
16
|
+
hideLanguage?: boolean;
|
|
16
17
|
onCopiedToClipboard?: (type?: CodeSelectionType, text?: string, codeBlockIndex?: number) => void;
|
|
17
18
|
onCodeBlockAction?: OnCodeBlockActionFunction;
|
|
18
19
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../helper/dom';
|
|
6
6
|
import { MynahIcons, MynahIconsType } from './icon';
|
|
7
|
-
import '../styles/components/
|
|
7
|
+
import '../styles/components/_tab.scss';
|
|
8
8
|
export interface ToggleOption {
|
|
9
9
|
label?: ExtendedHTMLElement | string | HTMLElement;
|
|
10
10
|
icon?: MynahIcons | MynahIconsType | null;
|
|
@@ -14,7 +14,7 @@ export interface ToggleOption {
|
|
|
14
14
|
value: string;
|
|
15
15
|
disabledTooltip?: string | ExtendedHTMLElement;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface TabProps {
|
|
18
18
|
testId?: string;
|
|
19
19
|
options: ToggleOption[];
|
|
20
20
|
direction?: 'horizontal' | 'vertical';
|
|
@@ -24,11 +24,11 @@ export interface ToggleProps {
|
|
|
24
24
|
onChange?: (selectedValue: string) => void;
|
|
25
25
|
onRemove?: (selectedValue: string, domElement: ExtendedHTMLElement) => void;
|
|
26
26
|
}
|
|
27
|
-
export declare class
|
|
27
|
+
export declare class Tab {
|
|
28
28
|
render: ExtendedHTMLElement;
|
|
29
29
|
private readonly props;
|
|
30
30
|
private currentValue?;
|
|
31
|
-
constructor(props:
|
|
31
|
+
constructor(props: TabProps);
|
|
32
32
|
private readonly transformScroll;
|
|
33
33
|
private readonly getChildren;
|
|
34
34
|
private readonly updateSelectionRender;
|
|
@@ -4,6 +4,7 @@ declare const _default: {
|
|
|
4
4
|
wrapper: string;
|
|
5
5
|
attachmentWrapper: string;
|
|
6
6
|
attachment: string;
|
|
7
|
+
options: string;
|
|
7
8
|
attachmentRemove: string;
|
|
8
9
|
send: string;
|
|
9
10
|
input: string;
|
|
@@ -72,6 +73,8 @@ declare const _default: {
|
|
|
72
73
|
itemStarsWrapper: string;
|
|
73
74
|
itemStars: string;
|
|
74
75
|
itemTextArea: string;
|
|
76
|
+
itemToggleWrapper: string;
|
|
77
|
+
itemToggleOption: string;
|
|
75
78
|
};
|
|
76
79
|
vote: {
|
|
77
80
|
wrapper: string;
|
package/dist/main.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { generateUID } from './helper/guid';
|
|
|
9
9
|
export { ChatItemBodyRenderer, } from './helper/dom';
|
|
10
10
|
export { AllowedAttributesInCustomRenderer, AllowedTagsInCustomRenderer } from './helper/sanitize';
|
|
11
11
|
export * from './static';
|
|
12
|
-
export { ToggleOption } from './components/
|
|
12
|
+
export { ToggleOption } from './components/tabs';
|
|
13
13
|
export { MynahIcons, MynahIconsType } from './components/icon';
|
|
14
14
|
export { DomBuilder, DomBuilderObject, ExtendedHTMLElement, } from './helper/dom';
|
|
15
15
|
export { ButtonProps, ButtonAbstract } from './components/button';
|
|
@@ -78,6 +78,7 @@ export interface MynahUIProps {
|
|
|
78
78
|
text?: string;
|
|
79
79
|
formItemValues?: Record<string, string>;
|
|
80
80
|
}, eventId?: string) => void;
|
|
81
|
+
onPromptInputOptionChange?: (tabId: string, optionsValues: Record<string, string>, eventId?: string) => void;
|
|
81
82
|
/**
|
|
82
83
|
* @deprecated since version 4.6.3. Will be dropped after version 5.x.x. Use {@link onFileClick} instead
|
|
83
84
|
*/
|
|
@@ -201,6 +202,8 @@ export declare class MynahUI {
|
|
|
201
202
|
openDetailedList: (data: DetailedListSheetProps) => {
|
|
202
203
|
update: (data: DetailedList) => void;
|
|
203
204
|
close: () => void;
|
|
205
|
+
changeTarget: (direction: 'up' | 'down', snapOnLastAndFirst?: boolean) => void;
|
|
206
|
+
getTargetElementId: () => string | undefined;
|
|
204
207
|
};
|
|
205
208
|
destroy: () => void;
|
|
206
209
|
}
|