@aws/mynah-ui 4.0.3 → 4.0.4

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.
@@ -9,7 +9,8 @@ export interface ChatItemButtonsWrapperProps {
9
9
  tabId: string;
10
10
  buttons: ChatItemButton[];
11
11
  formItems: ChatItemFormItemsWrapper | null;
12
- onActionClick: (action: ChatItemButton) => void;
12
+ useButtonComponent?: boolean;
13
+ onActionClick: (action: ChatItemButton, e?: Event) => void;
13
14
  }
14
15
  export declare class ChatItemButtonsWrapper {
15
16
  private readonly props;
@@ -6,7 +6,7 @@ import { ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { ChatItem } from '../../static';
7
7
  export interface ChatItemFormItemsWrapperProps {
8
8
  tabId: string;
9
- chatItem: ChatItem;
9
+ chatItem: Partial<ChatItem>;
10
10
  }
11
11
  export declare class ChatItemFormItemsWrapper {
12
12
  private readonly props;
@@ -3,12 +3,14 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
- import { ReferenceTrackerInformation } from '../../static';
6
+ import { FileNodeAction, ReferenceTrackerInformation, TreeNodeDetails } from '../../static';
7
7
  export interface ChatItemTreeViewWrapperProps {
8
8
  tabId: string;
9
9
  messageId: string;
10
10
  files: string[];
11
11
  deletedFiles: string[];
12
+ actions?: Record<string, FileNodeAction[]>;
13
+ details?: Record<string, TreeNodeDetails>;
12
14
  referenceSuggestionLabel: string;
13
15
  references: ReferenceTrackerInformation[];
14
16
  }
@@ -17,9 +17,11 @@ export declare class ChatWrapper {
17
17
  private readonly promptInfo;
18
18
  private readonly promptStickyCard;
19
19
  private lastChatItemCard;
20
+ private allRenderedChatItems;
20
21
  render: ExtendedHTMLElement;
21
22
  constructor(props: ChatWrapperProps);
22
23
  private readonly insertChatItem;
23
24
  updateLastChatAnswer: (updateWith: Partial<ChatItem>) => void;
25
+ updateChatAnswerWithMessageId: (messageId: string, updateWith: Partial<ChatItem>) => void;
24
26
  addToPrompt: (textToAdd: string) => void;
25
27
  }
@@ -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 { ChatItem } from '../../static';
7
+ import { ChatItemFormItemsWrapper } from '../chat-item/chat-item-form-items';
8
+ import { ChatItemButtonsWrapper } from '../chat-item/chat-item-buttons';
9
+ export interface CustomFormWrapperProps {
10
+ tabId: string;
11
+ chatItem: Partial<ChatItem>;
12
+ title?: string;
13
+ description?: string;
14
+ onFormAction?: (actionName: string, formData: Record<string, string>) => void;
15
+ onCloseButtonClick?: (e: Event) => void;
16
+ }
17
+ export declare class CustomFormWrapper {
18
+ readonly props: CustomFormWrapperProps;
19
+ render: ExtendedHTMLElement;
20
+ chatFormItems: ChatItemFormItemsWrapper | null;
21
+ chatButtons: ChatItemButtonsWrapper | null;
22
+ constructor(props: CustomFormWrapperProps);
23
+ private readonly getFormItems;
24
+ }
@@ -14,7 +14,9 @@ export declare enum MynahIcons {
14
14
  DOC = "doc",
15
15
  EXTERNAL = "external",
16
16
  CANCEL = "cancel",
17
+ CANCEL_CIRCLE = "cancel-circle",
17
18
  CALENDAR = "calendar",
19
+ COMMENT = "comment",
18
20
  MEGAPHONE = "megaphone",
19
21
  NOTIFICATION = "notification",
20
22
  EYE = "eye",
@@ -39,6 +41,7 @@ export declare enum MynahIcons {
39
41
  REFRESH = "refresh",
40
42
  USER = "user",
41
43
  PLAY = "play",
44
+ PENCIL = "pencil",
42
45
  PAUSE = "pause",
43
46
  CODE_BLOCK = "code-block",
44
47
  COPY = "copy",
@@ -2,16 +2,20 @@
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
+ import { FileNodeAction, TreeNodeDetails } from '../static';
5
6
  export type TreeNode = FolderNode | FileNode;
6
7
  export interface FileNode {
7
8
  name: string;
8
9
  type: 'file';
9
10
  filePath: string;
10
11
  deleted: boolean;
12
+ actions?: FileNodeAction[];
13
+ details?: TreeNodeDetails;
11
14
  }
12
15
  export interface FolderNode {
13
16
  name: string;
14
17
  type: 'folder';
18
+ details?: TreeNodeDetails;
15
19
  children: Array<FolderNode | FileNode>;
16
20
  }
17
- export declare const fileListToTree: (modifiedFilePaths: string[], deletedFilePaths?: string[]) => TreeNode;
21
+ export declare const fileListToTree: (modifiedFilePaths: string[], deletedFilePaths?: string[], actions?: Record<string, FileNodeAction[]>, details?: Record<string, TreeNodeDetails>) => TreeNode;
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 { RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemAction, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation, CodeSelectionType, Engagement } from './static';
5
+ import { RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemAction, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation, CodeSelectionType, Engagement, ChatItemFormItem, ChatItemButton } from './static';
6
6
  import './styles/styles.scss';
7
7
  export { FeedbackPayload, RelevancyVoteType, EngagementType, Engagement, MynahUIDataModel, NotificationType, ChatItem, ChatItemAction, ChatItemType, ChatPrompt, SourceLink } from './static';
8
8
  export { ToggleOption } from './components/toggle';
@@ -35,7 +35,13 @@ export interface MynahUIProps {
35
35
  onLinkClick?: (tabId: string, messageId: string, link: string, mouseEvent?: MouseEvent) => void;
36
36
  onInfoLinkClick?: (tabId: string, link: string, mouseEvent?: MouseEvent) => void;
37
37
  onSendFeedback?: (tabId: string, feedbackPayload: FeedbackPayload) => void;
38
+ onCustomFormAction?: (tabId: string, action: {
39
+ id: string;
40
+ text?: string;
41
+ formItemValues?: Record<string, string>;
42
+ }) => void;
38
43
  onOpenDiff?: (tabId: string, filePath: string, deleted: boolean, messageId?: string) => void;
44
+ onFileActionClick?: (tabId: string, messageId: string, filePath: string, actionName: string) => void;
39
45
  }
40
46
  export declare class MynahUI {
41
47
  private readonly props;
@@ -49,6 +55,7 @@ export declare class MynahUI {
49
55
  addToUserPrompt: (tabId: string, prompt: string) => void;
50
56
  addChatItem: (tabId: string, chatItem: ChatItem) => void;
51
57
  updateLastChatAnswer: (tabId: string, updateWith: Partial<ChatItem>) => void;
58
+ updateChatAnswerWithMessageId: (tabId: string, messageId: string, updateWith: Partial<ChatItem>) => void;
52
59
  updateStore: (tabId: string | '', data: MynahUIDataModel) => string | undefined;
53
60
  getSelectedTabId: () => string | undefined;
54
61
  getAllTabs: () => MynahUITabStoreModel;
@@ -60,4 +67,5 @@ export declare class MynahUI {
60
67
  onNotificationClick?: () => void;
61
68
  onNotificationHide?: () => void;
62
69
  }) => void;
70
+ showCustomForm: (tabId: string, formItems?: ChatItemFormItem[], buttons?: ChatItemButton[], title?: string, description?: string) => void;
63
71
  }