@aws/mynah-ui 4.9.2 → 4.10.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.
@@ -3,6 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
+ import { PromptAttachmentType } from '../../static';
6
7
  export declare const MAX_USER_INPUT_THRESHOLD = 96;
7
8
  export declare const MAX_USER_INPUT: () => number;
8
9
  export interface ChatPromptInputProps {
@@ -16,12 +17,11 @@ export declare class ChatPromptInput {
16
17
  private readonly promptTextInputCommand;
17
18
  private readonly remainingCharsIndicator;
18
19
  private readonly sendButton;
19
- private readonly codeSnippet;
20
+ private readonly promptAttachment;
20
21
  private quickActionCommands;
21
22
  private commandSelector;
22
23
  private commandSelectorOpen;
23
24
  private selectedCommand;
24
- private attachment?;
25
25
  private filteredCommandsList;
26
26
  constructor(props: ChatPromptInputProps);
27
27
  private readonly updateAvailableCharactersIndicator;
@@ -29,6 +29,6 @@ export declare class ChatPromptInput {
29
29
  private readonly getQuickCommandActions;
30
30
  private readonly handleCommandSelection;
31
31
  readonly clearTextArea: (keepAttachment?: boolean) => void;
32
- readonly addText: (textToAdd: string) => void;
32
+ readonly addAttachment: (attachmentContent: string, type?: PromptAttachmentType) => void;
33
33
  private readonly sendPrompt;
34
34
  }
@@ -3,7 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
- import { CardRenderDetails, ChatItem } from '../../static';
6
+ import { CardRenderDetails, ChatItem, PromptAttachmentType } from '../../static';
7
7
  export declare const CONTAINER_GAP = 12;
8
8
  export interface ChatWrapperProps {
9
9
  onStopChatResponse?: (tabId: string) => void;
@@ -32,5 +32,5 @@ export declare class ChatWrapper {
32
32
  } | undefined;
33
33
  endStreamWithMessageId: (messageId: string, updateWith: Partial<ChatItem>) => void;
34
34
  updateChatAnswerWithMessageId: (messageId: string, updateWith: Partial<ChatItem>) => void;
35
- addToPrompt: (textToAdd: string) => void;
35
+ addAttachmentToPrompt: (textToAdd: string, type?: PromptAttachmentType) => void;
36
36
  }
@@ -0,0 +1,14 @@
1
+ import { ExtendedHTMLElement } from '../../../helper/dom';
2
+ import { PromptAttachmentType } from '../../../static';
3
+ export interface PromptAttachmentProps {
4
+ tabId: string;
5
+ }
6
+ export declare class PromptAttachment {
7
+ render: ExtendedHTMLElement;
8
+ lastAttachmentContent: string;
9
+ private readonly props;
10
+ private attachmentItem;
11
+ constructor(props: PromptAttachmentProps);
12
+ readonly updateAttachment: (attachmentContent: string | undefined, type?: PromptAttachmentType) => void;
13
+ readonly clear: () => void;
14
+ }
@@ -1,15 +1,16 @@
1
1
  import { ExtendedHTMLElement } from '../../../helper/dom';
2
- export interface ICodeSnippetWidgetProps {
2
+ import { PromptAttachmentType } from '../../../static';
3
+ export interface PromptTextAttachmentProps {
3
4
  tabId: string;
4
- markdownText: string;
5
+ content: string;
6
+ type: PromptAttachmentType;
5
7
  }
6
- export declare class CodeSnippetWidget {
8
+ export declare class PromptTextAttachment {
9
+ render: ExtendedHTMLElement;
7
10
  private readonly props;
8
11
  private previewOverlay;
9
- render: ExtendedHTMLElement;
10
- constructor(props: ICodeSnippetWidgetProps);
12
+ constructor(props: PromptTextAttachmentProps);
11
13
  private readonly showPreviewOverLay;
12
14
  private readonly closePreviewOverLay;
13
- private readonly renderCodeSnippetWidget;
14
15
  readonly clear: () => void;
15
16
  }
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, ChatItemFormItem, ChatItemButton, CardRenderDetails } from './static';
5
+ import { RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemAction, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation, CodeSelectionType, Engagement, ChatItemFormItem, ChatItemButton, CardRenderDetails, PromptAttachmentType } from './static';
6
6
  import './styles/styles.scss';
7
7
  export { ChatItemBodyRenderer, } from './helper/dom';
8
8
  export { AllowedAttributesInCustomRenderer, AllowedTagsInCustomRenderer } from './helper/sanitize';
@@ -66,7 +66,7 @@ export declare class MynahUI {
66
66
  private readonly getUserEventId;
67
67
  private readonly focusToInput;
68
68
  private readonly addGlobalListeners;
69
- addToUserPrompt: (tabId: string, codeStringToAdd: string) => void;
69
+ addToUserPrompt: (tabId: string, attachmentContent: string, type?: PromptAttachmentType) => void;
70
70
  /**
71
71
  * Adds a new item to the chat window
72
72
  * @param tabId Corresponding tab ID.