@aws/mynah-ui 4.23.0-beta.1 → 4.23.0-beta.3

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.
@@ -19,6 +19,7 @@ export declare class PromptTextInput {
19
19
  private readonly checkIsEmpty;
20
20
  private readonly removeContextPlaceholderOverlay;
21
21
  private readonly insertElementToGivenPosition;
22
+ private readonly moveCursorToEnd;
22
23
  readonly insertContextItem: (contextItem: QuickActionCommand, position: number) => void;
23
24
  readonly getCursorPos: () => number;
24
25
  readonly clear: () => void;
@@ -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,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;
package/dist/main.d.ts CHANGED
@@ -9,7 +9,7 @@ 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';
@@ -80,6 +80,9 @@ export interface MynahUIProps {
80
80
  onFileClick?: (tabId: string, filePath: string, deleted: boolean, messageId?: string, eventId?: string) => void;
81
81
  onFileActionClick?: (tabId: string, messageId: string, filePath: string, actionName: string, eventId?: string) => void;
82
82
  onTabBarButtonClick?: (tabId: string, buttonId: string, eventId?: string) => void;
83
+ onQuickCommandGroupActionClick?: (tabId: string, action: {
84
+ id: string;
85
+ }, eventId?: string) => void;
83
86
  }
84
87
  export declare class MynahUI {
85
88
  private readonly render;
@@ -115,6 +118,12 @@ export declare class MynahUI {
115
118
  * @param updateWith ChatItem object to update with.
116
119
  */
117
120
  updateChatAnswerWithMessageId: (tabId: string, messageId: string, updateWith: Partial<ChatItem>) => void;
121
+ /**
122
+ * Serialize all (non-empty) chat messages in a tab into a string
123
+ * @param tabId Corresponding tab ID.
124
+ * @param format Whether to serialize to markdown or HTML format
125
+ */
126
+ serializeChat: (tabId: string, format: 'markdown' | 'html') => string;
118
127
  /**
119
128
  * Converts a card to an ANSWER if it is an ANSWER_STREAM
120
129
  * @param tabId Corresponding tab ID.