@aws/mynah-ui 4.22.1 → 4.23.0-beta.10
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/chat-item/chat-item-card.d.ts +3 -0
- package/dist/components/chat-item/chat-item-form-items.d.ts +1 -0
- package/dist/components/chat-item/chat-item-tree-view-wrapper.d.ts +5 -0
- package/dist/components/chat-item/chat-item-tree-view.d.ts +6 -0
- package/dist/components/chat-item/chat-prompt-input.d.ts +2 -1
- package/dist/components/chat-item/prompt-input/prompt-input-quick-pick-item.d.ts +13 -0
- package/dist/components/chat-item/prompt-input/prompt-input-quick-pick-selector.d.ts +18 -0
- package/dist/components/chat-item/prompt-input/prompt-text-input.d.ts +17 -16
- package/dist/components/form-items/radio-group.d.ts +1 -0
- package/dist/components/form-items/select.d.ts +1 -0
- package/dist/components/form-items/stars.d.ts +1 -0
- package/dist/components/form-items/text-area.d.ts +14 -0
- package/dist/components/form-items/text-input.d.ts +14 -0
- package/dist/components/icon.d.ts +2 -1
- package/dist/components/title-description-with-icon.d.ts +2 -2
- package/dist/helper/quick-pick-data-handler.d.ts +4 -0
- package/dist/helper/serialize-chat.d.ts +12 -0
- package/dist/helper/test-ids.d.ts +2 -0
- package/dist/helper/validator.d.ts +19 -0
- package/dist/main.d.ts +14 -2
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +57 -23
- package/docs/DATAMODEL.md +49 -0
- package/docs/PROPERTIES.md +47 -0
- package/docs/STARTUP.md +1 -0
- package/docs/USAGE.md +20 -0
- package/docs/img/data-model/chatItems/header.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 +0 -9
- package/ui-tests/dist/main.js +0 -1359
- package/ui-tests/dist/main.js.map +0 -1
|
@@ -18,6 +18,7 @@ export declare class ChatItemCard {
|
|
|
18
18
|
private readonly updateStack;
|
|
19
19
|
private readonly initialSpinner;
|
|
20
20
|
private cardFooter;
|
|
21
|
+
private cardHeader;
|
|
21
22
|
private informationCard;
|
|
22
23
|
private tabbedCard;
|
|
23
24
|
private cardIcon;
|
|
@@ -31,8 +32,10 @@ export declare class ChatItemCard {
|
|
|
31
32
|
private followUps;
|
|
32
33
|
private votes;
|
|
33
34
|
private footer;
|
|
35
|
+
private header;
|
|
34
36
|
constructor(props: ChatItemCardProps);
|
|
35
37
|
private readonly getCardFooter;
|
|
38
|
+
private readonly getCardHeader;
|
|
36
39
|
private readonly generateCard;
|
|
37
40
|
private readonly getCardClasses;
|
|
38
41
|
private readonly updateCardContent;
|
|
@@ -18,6 +18,7 @@ export declare class ChatItemFormItemsWrapper {
|
|
|
18
18
|
render: ExtendedHTMLElement;
|
|
19
19
|
constructor(props: ChatItemFormItemsWrapperProps);
|
|
20
20
|
private readonly getValidationHandler;
|
|
21
|
+
private readonly isItemValid;
|
|
21
22
|
isFormValid: () => boolean;
|
|
22
23
|
disableAll: () => void;
|
|
23
24
|
getAllValues: () => Record<string, string>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
6
|
import { FileNodeAction, ReferenceTrackerInformation, TreeNodeDetails } from '../../static';
|
|
7
|
+
import { MynahIcons, MynahIconsType } from '../icon';
|
|
7
8
|
export interface ChatItemTreeViewWrapperProps {
|
|
8
9
|
tabId: string;
|
|
9
10
|
messageId: string;
|
|
@@ -12,8 +13,12 @@ export interface ChatItemTreeViewWrapperProps {
|
|
|
12
13
|
classNames?: string[];
|
|
13
14
|
rootTitle?: string;
|
|
14
15
|
deletedFiles: string[];
|
|
16
|
+
flatList?: boolean;
|
|
17
|
+
folderIcon?: MynahIcons | MynahIconsType | null;
|
|
15
18
|
actions?: Record<string, FileNodeAction[]>;
|
|
16
19
|
details?: Record<string, TreeNodeDetails>;
|
|
20
|
+
hideFileCount?: boolean;
|
|
21
|
+
collapsed?: boolean;
|
|
17
22
|
referenceSuggestionLabel: string;
|
|
18
23
|
references: ReferenceTrackerInformation[];
|
|
19
24
|
}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
2
2
|
import { TreeNode } from '../../helper/file-tree';
|
|
3
|
+
import { MynahIcons, MynahIconsType } from '../icon';
|
|
3
4
|
export interface ChatItemTreeViewProps {
|
|
4
5
|
node: TreeNode;
|
|
5
6
|
depth?: number;
|
|
6
7
|
tabId: string;
|
|
7
8
|
messageId: string;
|
|
9
|
+
hideFileCount?: boolean;
|
|
10
|
+
collapsed?: boolean;
|
|
11
|
+
folderIcon?: MynahIcons | MynahIconsType | null;
|
|
8
12
|
}
|
|
9
13
|
export declare class ChatItemTreeView {
|
|
10
14
|
private readonly node;
|
|
15
|
+
private readonly folderIcon;
|
|
11
16
|
private isOpen;
|
|
12
17
|
private readonly depth;
|
|
13
18
|
private readonly tabId;
|
|
14
19
|
private readonly messageId;
|
|
20
|
+
private readonly hideFileCount;
|
|
15
21
|
render: ExtendedHTMLElement;
|
|
16
22
|
constructor(props: ChatItemTreeViewProps);
|
|
17
23
|
getClassNames(): string[];
|
|
@@ -20,13 +20,14 @@ export declare class ChatPromptInput {
|
|
|
20
20
|
private readonly progressIndicator;
|
|
21
21
|
private readonly promptAttachment;
|
|
22
22
|
private readonly chatPrompt;
|
|
23
|
+
private quickPickItemsSelectorContainer;
|
|
23
24
|
private promptTextInputLabel;
|
|
24
25
|
private remainingCharsOverlay;
|
|
25
26
|
private quickPickTriggerIndex;
|
|
26
27
|
private quickPickType;
|
|
27
|
-
private textAfter;
|
|
28
28
|
private quickPickItemGroups;
|
|
29
29
|
private filteredQuickPickItemGroups;
|
|
30
|
+
private searchTerm;
|
|
30
31
|
private quickPick;
|
|
31
32
|
private quickPickOpen;
|
|
32
33
|
private selectedCommand;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExtendedHTMLElement } from '../../../helper/dom';
|
|
2
|
+
import { QuickActionCommand } from '../../../static';
|
|
3
|
+
export interface PromptInputQuickPickItemProps {
|
|
4
|
+
quickPickItem: QuickActionCommand;
|
|
5
|
+
onSelect: (quickPickItem: QuickActionCommand) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare class PromptInputQuickPickItem {
|
|
8
|
+
render: ExtendedHTMLElement;
|
|
9
|
+
private readonly props;
|
|
10
|
+
constructor(props: PromptInputQuickPickItemProps);
|
|
11
|
+
readonly setFocus: (isFocused: boolean) => void;
|
|
12
|
+
readonly getItem: () => QuickActionCommand;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExtendedHTMLElement } from '../../../helper/dom';
|
|
2
|
+
import { ChatItemButton, QuickActionCommandGroup, QuickActionCommand } from '../../../static';
|
|
3
|
+
export interface PromptInputQuickPickSelectorProps {
|
|
4
|
+
quickPickGroupList: QuickActionCommandGroup[];
|
|
5
|
+
onQuickPickGroupActionClick: (action: ChatItemButton) => void;
|
|
6
|
+
onQuickPickItemSelect: (quickPickItem: QuickActionCommand) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare class PromptInputQuickPickSelector {
|
|
9
|
+
render: ExtendedHTMLElement;
|
|
10
|
+
private readonly props;
|
|
11
|
+
private activeTargetElementIndex;
|
|
12
|
+
private allSelectableQuickPickElements;
|
|
13
|
+
constructor(props: PromptInputQuickPickSelectorProps);
|
|
14
|
+
private readonly getQuickPickGroups;
|
|
15
|
+
readonly changeTarget: (direction: 'up' | 'down') => void;
|
|
16
|
+
readonly getTargetElement: () => QuickActionCommand | null;
|
|
17
|
+
readonly updateList: (quickPickGroupList: QuickActionCommandGroup[]) => void;
|
|
18
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ExtendedHTMLElement } from '../../../helper/dom';
|
|
2
|
+
import { QuickActionCommand } from '../../../static';
|
|
2
3
|
export interface PromptTextInputProps {
|
|
3
4
|
tabId: string;
|
|
4
5
|
initMaxLength: number;
|
|
5
|
-
contextReplacement?: boolean;
|
|
6
|
-
contextItems?: string[];
|
|
7
6
|
onKeydown: (e: KeyboardEvent) => void;
|
|
8
7
|
onInput?: (e: KeyboardEvent) => void;
|
|
9
8
|
onFocus?: () => void;
|
|
@@ -12,33 +11,35 @@ export interface PromptTextInputProps {
|
|
|
12
11
|
export declare class PromptTextInput {
|
|
13
12
|
render: ExtendedHTMLElement;
|
|
14
13
|
promptTextInputMaxLength: number;
|
|
14
|
+
private lastCursorIndex;
|
|
15
15
|
private readonly props;
|
|
16
|
-
private readonly promptTextInputSizer;
|
|
17
16
|
private readonly promptTextInput;
|
|
18
17
|
private promptInputOverlay;
|
|
19
18
|
private keydownSupport;
|
|
19
|
+
private readonly selectedContext;
|
|
20
|
+
private contextTooltip;
|
|
21
|
+
private contextTooltipTimeout;
|
|
20
22
|
constructor(props: PromptTextInputProps);
|
|
21
|
-
private readonly
|
|
22
|
-
readonly
|
|
23
|
+
private readonly updateCursorPos;
|
|
24
|
+
private readonly checkIsEmpty;
|
|
25
|
+
private readonly removeContextPlaceholderOverlay;
|
|
26
|
+
private readonly insertElementToGivenPosition;
|
|
27
|
+
private readonly moveCursorToEnd;
|
|
28
|
+
private readonly showContextTooltip;
|
|
29
|
+
private readonly hideContextTooltip;
|
|
30
|
+
readonly insertContextItem: (contextItem: QuickActionCommand, position: number) => void;
|
|
23
31
|
readonly getCursorPos: () => number;
|
|
24
|
-
readonly getWordAndIndexOnCursorPos: () => {
|
|
25
|
-
wordStartIndex: number;
|
|
26
|
-
word: string;
|
|
27
|
-
};
|
|
28
|
-
readonly getContextElementAtTextIndex: (textIndex: number) => HTMLSpanElement | null;
|
|
29
32
|
readonly clear: () => void;
|
|
30
|
-
readonly focus: (
|
|
33
|
+
readonly focus: () => void;
|
|
31
34
|
readonly blur: () => void;
|
|
32
35
|
readonly getTextInputValue: () => string;
|
|
33
|
-
readonly updateTextInputValue: (value: string
|
|
34
|
-
index?: number;
|
|
35
|
-
text?: string;
|
|
36
|
-
}) => void;
|
|
36
|
+
readonly updateTextInputValue: (value: string) => void;
|
|
37
37
|
readonly updateTextInputMaxLength: (maxLength: number) => void;
|
|
38
38
|
readonly updateTextInputPlaceholder: (text: string) => void;
|
|
39
|
-
readonly
|
|
39
|
+
readonly deleteTextRange: (position: number, endPosition: number) => void;
|
|
40
40
|
readonly getCursorLine: () => {
|
|
41
41
|
cursorLine: number;
|
|
42
42
|
totalLines: number;
|
|
43
43
|
};
|
|
44
|
+
readonly getUsedContext: () => QuickActionCommand[];
|
|
44
45
|
}
|
|
@@ -12,6 +12,7 @@ export interface RadioGroupProps {
|
|
|
12
12
|
classNames?: string[];
|
|
13
13
|
attributes?: Record<string, string>;
|
|
14
14
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
15
|
+
description?: ExtendedHTMLElement;
|
|
15
16
|
value?: string;
|
|
16
17
|
optional?: boolean;
|
|
17
18
|
options?: SelectOption[];
|
|
@@ -9,6 +9,7 @@ export interface StarsProps {
|
|
|
9
9
|
classNames?: string[];
|
|
10
10
|
attributes?: Record<string, string>;
|
|
11
11
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
12
|
+
description?: ExtendedHTMLElement;
|
|
12
13
|
value?: string;
|
|
13
14
|
onChange?: (value: string) => void;
|
|
14
15
|
initStar?: StarValues;
|
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
|
+
import { ValidationPattern } from '../../static';
|
|
6
7
|
import '../../styles/components/_form-input.scss';
|
|
7
8
|
export interface TextAreaProps {
|
|
8
9
|
classNames?: string[];
|
|
9
10
|
attributes?: Record<string, string>;
|
|
10
11
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
12
|
+
description?: ExtendedHTMLElement;
|
|
13
|
+
mandatory?: boolean;
|
|
14
|
+
fireModifierAndEnterKeyPress?: () => void;
|
|
11
15
|
placeholder?: string;
|
|
16
|
+
validationPatterns?: {
|
|
17
|
+
operator?: 'and' | 'or';
|
|
18
|
+
patterns: ValidationPattern[];
|
|
19
|
+
};
|
|
12
20
|
value?: string;
|
|
13
21
|
onChange?: (value: string) => void;
|
|
14
22
|
testId?: string;
|
|
@@ -18,14 +26,19 @@ export declare abstract class TextAreaAbstract {
|
|
|
18
26
|
setValue: (value: string) => void;
|
|
19
27
|
getValue: () => string;
|
|
20
28
|
setEnabled: (enabled: boolean) => void;
|
|
29
|
+
checkValidation: () => void;
|
|
21
30
|
}
|
|
22
31
|
export declare class TextAreaInternal extends TextAreaAbstract {
|
|
23
32
|
private readonly inputElement;
|
|
33
|
+
private readonly validationErrorBlock;
|
|
34
|
+
private readonly props;
|
|
35
|
+
private readyToValidate;
|
|
24
36
|
render: ExtendedHTMLElement;
|
|
25
37
|
constructor(props: TextAreaProps);
|
|
26
38
|
setValue: (value: string) => void;
|
|
27
39
|
getValue: () => string;
|
|
28
40
|
setEnabled: (enabled: boolean) => void;
|
|
41
|
+
checkValidation: () => void;
|
|
29
42
|
}
|
|
30
43
|
export declare class TextArea extends TextAreaAbstract {
|
|
31
44
|
render: ExtendedHTMLElement;
|
|
@@ -33,4 +46,5 @@ export declare class TextArea extends TextAreaAbstract {
|
|
|
33
46
|
setValue: (value: string) => void;
|
|
34
47
|
getValue: () => string;
|
|
35
48
|
setEnabled: (enabled: boolean) => void;
|
|
49
|
+
checkValidation: () => void;
|
|
36
50
|
}
|
|
@@ -3,13 +3,21 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
|
+
import { ValidationPattern } from '../../static';
|
|
6
7
|
import '../../styles/components/_form-input.scss';
|
|
7
8
|
export interface TextInputProps {
|
|
8
9
|
classNames?: string[];
|
|
9
10
|
attributes?: Record<string, string>;
|
|
10
11
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
12
|
+
description?: ExtendedHTMLElement;
|
|
13
|
+
mandatory?: boolean;
|
|
14
|
+
fireModifierAndEnterKeyPress?: () => void;
|
|
11
15
|
placeholder?: string;
|
|
12
16
|
type?: 'text' | 'number' | 'email';
|
|
17
|
+
validationPatterns?: {
|
|
18
|
+
operator?: 'and' | 'or';
|
|
19
|
+
patterns: ValidationPattern[];
|
|
20
|
+
};
|
|
13
21
|
value?: string;
|
|
14
22
|
onChange?: (value: string) => void;
|
|
15
23
|
testId?: string;
|
|
@@ -19,14 +27,19 @@ export declare abstract class TextInputAbstract {
|
|
|
19
27
|
setValue: (value: string) => void;
|
|
20
28
|
getValue: () => string;
|
|
21
29
|
setEnabled: (enabled: boolean) => void;
|
|
30
|
+
checkValidation: () => void;
|
|
22
31
|
}
|
|
23
32
|
export declare class TextInputInternal extends TextInputAbstract {
|
|
24
33
|
private readonly inputElement;
|
|
34
|
+
private readonly validationErrorBlock;
|
|
35
|
+
private readonly props;
|
|
36
|
+
private readyToValidate;
|
|
25
37
|
render: ExtendedHTMLElement;
|
|
26
38
|
constructor(props: TextInputProps);
|
|
27
39
|
setValue: (value: string) => void;
|
|
28
40
|
getValue: () => string;
|
|
29
41
|
setEnabled: (enabled: boolean) => void;
|
|
42
|
+
checkValidation: () => void;
|
|
30
43
|
}
|
|
31
44
|
export declare class TextInput extends TextInputAbstract {
|
|
32
45
|
render: ExtendedHTMLElement;
|
|
@@ -34,4 +47,5 @@ export declare class TextInput extends TextInputAbstract {
|
|
|
34
47
|
setValue: (value: string) => void;
|
|
35
48
|
getValue: () => string;
|
|
36
49
|
setEnabled: (enabled: boolean) => void;
|
|
50
|
+
checkValidation: () => void;
|
|
37
51
|
}
|
|
@@ -65,8 +65,9 @@ export declare enum MynahIcons {
|
|
|
65
65
|
TRASH = "trash",
|
|
66
66
|
TRANSFORM = "transform"
|
|
67
67
|
}
|
|
68
|
+
export type MynahIconsType = `${MynahIcons}`;
|
|
68
69
|
export interface IconProps {
|
|
69
|
-
icon: MynahIcons;
|
|
70
|
+
icon: MynahIcons | MynahIconsType;
|
|
70
71
|
classNames?: string[];
|
|
71
72
|
}
|
|
72
73
|
export declare class Icon {
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { DomBuilderObject, ExtendedHTMLElement } from '../helper/dom';
|
|
6
|
-
import { MynahIcons } from './icon';
|
|
6
|
+
import { MynahIcons, MynahIconsType } from './icon';
|
|
7
7
|
import '../styles/components/_title-description-icon.scss';
|
|
8
8
|
interface TitleDescriptionWithIconProps {
|
|
9
9
|
title?: string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
|
|
10
10
|
description?: string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
|
|
11
|
-
icon?: MynahIcons;
|
|
11
|
+
icon?: MynahIcons | MynahIconsType;
|
|
12
12
|
testId?: string;
|
|
13
13
|
classNames?: string[];
|
|
14
14
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { QuickActionCommandGroup } from '../static';
|
|
2
|
+
export declare const filterQuickPickItems: (commands: QuickActionCommandGroup[], searchTerm: string) => QuickActionCommandGroup[];
|
|
3
|
+
export declare const MARK_OPEN = "<mark>";
|
|
4
|
+
export declare const MARK_CLOSE = "</mark>";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialize all (non-empty) chat messages in a tab to a markdown string
|
|
3
|
+
* @param tabId Corresponding tab ID.
|
|
4
|
+
* @returns The bodies of chat cards in markdown format, separated by \n\n---\n\n
|
|
5
|
+
*/
|
|
6
|
+
export declare const serializeMarkdown: (tabId: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Serialize all (non-empty) chat messages in a tab to an HTML string
|
|
9
|
+
* @param tabId Corresponding tab ID.
|
|
10
|
+
* @returns The bodies of chat cards in HTML format
|
|
11
|
+
*/
|
|
12
|
+
export declare const serializeHtml: (tabId: string) => string;
|
|
@@ -9,6 +9,7 @@ declare const _default: {
|
|
|
9
9
|
input: string;
|
|
10
10
|
inputWrapper: string;
|
|
11
11
|
remainingCharsIndicator: string;
|
|
12
|
+
contextTooltip: string;
|
|
12
13
|
selectedCommand: string;
|
|
13
14
|
quickPicksWrapper: string;
|
|
14
15
|
quickPicksGroup: string;
|
|
@@ -59,6 +60,7 @@ declare const _default: {
|
|
|
59
60
|
chatItemForm: {
|
|
60
61
|
wrapper: string;
|
|
61
62
|
title: string;
|
|
63
|
+
description: string;
|
|
62
64
|
itemSelectWrapper: string;
|
|
63
65
|
itemSelect: string;
|
|
64
66
|
itemRadioWrapper: string;
|
|
@@ -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 '../main';
|
|
6
|
+
import { ValidationPattern } from '../static';
|
|
7
|
+
export declare const isTextualFormItemValid: (value: string, validationPatterns: {
|
|
8
|
+
operator?: 'and' | 'or';
|
|
9
|
+
genericValidationErrorMessage?: string;
|
|
10
|
+
patterns: ValidationPattern[];
|
|
11
|
+
}, mandatory?: boolean) => {
|
|
12
|
+
isValid: boolean;
|
|
13
|
+
validationErrors: string[];
|
|
14
|
+
};
|
|
15
|
+
export declare const isMandatoryItemValid: (value: string) => boolean;
|
|
16
|
+
export declare const checkTextElementValidation: (inputElement: ExtendedHTMLElement, validationPatterns: {
|
|
17
|
+
operator?: 'and' | 'or';
|
|
18
|
+
patterns: ValidationPattern[];
|
|
19
|
+
} | undefined, validationErrorBlock: ExtendedHTMLElement, readyToValidate: boolean, mandatory?: boolean) => void;
|
package/dist/main.d.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
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 { RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemAction, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation, CodeSelectionType, Engagement, ChatItemFormItem, ChatItemButton, CardRenderDetails, PromptAttachmentType } from './static';
|
|
5
|
+
import { RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemAction, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation, CodeSelectionType, Engagement, ChatItemFormItem, ChatItemButton, CardRenderDetails, PromptAttachmentType, QuickActionCommand } from './static';
|
|
6
6
|
import './styles/styles.scss';
|
|
7
7
|
export { generateUID } from './helper/guid';
|
|
8
8
|
export { ChatItemBodyRenderer, } from './helper/dom';
|
|
9
9
|
export { AllowedAttributesInCustomRenderer, AllowedTagsInCustomRenderer } from './helper/sanitize';
|
|
10
10
|
export * from './static';
|
|
11
11
|
export { ToggleOption } from './components/toggle';
|
|
12
|
-
export { MynahIcons } from './components/icon';
|
|
12
|
+
export { MynahIcons, MynahIconsType } from './components/icon';
|
|
13
13
|
export { DomBuilder, DomBuilderObject, ExtendedHTMLElement, } from './helper/dom';
|
|
14
14
|
export { ButtonProps, ButtonAbstract } from './components/button';
|
|
15
15
|
export { RadioGroupProps, RadioGroupAbstract } from './components/form-items/radio-group';
|
|
@@ -47,6 +47,7 @@ export interface MynahUIProps {
|
|
|
47
47
|
onTabbedContentTabChange?: (tabId: string, messageId: string, contentTabId: string, eventId?: string) => void;
|
|
48
48
|
onTabChange?: (tabId: string, eventId?: string) => void;
|
|
49
49
|
onTabAdd?: (tabId: string, eventId?: string) => void;
|
|
50
|
+
onContextSelected?: (contextItem: QuickActionCommand, tabId: string, eventId?: string) => boolean;
|
|
50
51
|
onTabRemove?: (tabId: string, eventId?: string) => void;
|
|
51
52
|
/**
|
|
52
53
|
* @param tabId tabId which the close button triggered
|
|
@@ -68,6 +69,7 @@ export interface MynahUIProps {
|
|
|
68
69
|
onInfoLinkClick?: (tabId: string, link: string, mouseEvent?: MouseEvent, eventId?: string) => void;
|
|
69
70
|
onFormLinkClick?: (link: string, mouseEvent?: MouseEvent, eventId?: string) => void;
|
|
70
71
|
onSendFeedback?: (tabId: string, feedbackPayload: FeedbackPayload, eventId?: string) => void;
|
|
72
|
+
onFormModifierEnterPress?: (formData: Record<string, string>, tabId: string, eventId?: string) => void;
|
|
71
73
|
onCustomFormAction?: (tabId: string, action: {
|
|
72
74
|
id: string;
|
|
73
75
|
text?: string;
|
|
@@ -80,6 +82,9 @@ export interface MynahUIProps {
|
|
|
80
82
|
onFileClick?: (tabId: string, filePath: string, deleted: boolean, messageId?: string, eventId?: string) => void;
|
|
81
83
|
onFileActionClick?: (tabId: string, messageId: string, filePath: string, actionName: string, eventId?: string) => void;
|
|
82
84
|
onTabBarButtonClick?: (tabId: string, buttonId: string, eventId?: string) => void;
|
|
85
|
+
onQuickCommandGroupActionClick?: (tabId: string, action: {
|
|
86
|
+
id: string;
|
|
87
|
+
}, eventId?: string) => void;
|
|
83
88
|
}
|
|
84
89
|
export declare class MynahUI {
|
|
85
90
|
private readonly render;
|
|
@@ -115,6 +120,12 @@ export declare class MynahUI {
|
|
|
115
120
|
* @param updateWith ChatItem object to update with.
|
|
116
121
|
*/
|
|
117
122
|
updateChatAnswerWithMessageId: (tabId: string, messageId: string, updateWith: Partial<ChatItem>) => void;
|
|
123
|
+
/**
|
|
124
|
+
* Serialize all (non-empty) chat messages in a tab into a string
|
|
125
|
+
* @param tabId Corresponding tab ID.
|
|
126
|
+
* @param format Whether to serialize to markdown or HTML format
|
|
127
|
+
*/
|
|
128
|
+
serializeChat: (tabId: string, format: 'markdown' | 'html') => string;
|
|
118
129
|
/**
|
|
119
130
|
* Converts a card to an ANSWER if it is an ANSWER_STREAM
|
|
120
131
|
* @param tabId Corresponding tab ID.
|
|
@@ -159,6 +170,7 @@ export declare class MynahUI {
|
|
|
159
170
|
* @returns string selectedTabId or undefined
|
|
160
171
|
*/
|
|
161
172
|
getAllTabs: () => MynahUITabStoreModel;
|
|
173
|
+
getTabData: (tabId: string) => any;
|
|
162
174
|
/**
|
|
163
175
|
* Toggles the visibility of the splash loader screen
|
|
164
176
|
*/
|