@aws/mynah-ui 4.23.0-beta.9 → 4.23.1

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.
@@ -11,6 +11,7 @@ export interface ChatItemButtonsWrapperProps {
11
11
  buttons: ChatItemButton[] | null;
12
12
  formItems?: ChatItemFormItemsWrapper | null;
13
13
  onActionClick?: (action: ChatItemButton, e?: Event) => void;
14
+ onAllButtonsDisabled?: () => void;
14
15
  }
15
16
  export declare class ChatItemButtonsWrapper {
16
17
  private readonly props;
@@ -15,9 +15,11 @@ export declare class ChatItemFormItemsWrapper {
15
15
  private readonly validationItems;
16
16
  private isValid;
17
17
  onValidationChange?: (isValid: boolean) => void;
18
+ onAllFormItemsDisabled?: () => void;
18
19
  render: ExtendedHTMLElement;
19
20
  constructor(props: ChatItemFormItemsWrapperProps);
20
21
  private readonly getValidationHandler;
22
+ private readonly handleTextualItemKeyPressEvent;
21
23
  private readonly isItemValid;
22
24
  isFormValid: () => boolean;
23
25
  disableAll: () => void;
@@ -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;
@@ -13,6 +14,7 @@ export interface ChatItemTreeViewWrapperProps {
13
14
  rootTitle?: string;
14
15
  deletedFiles: string[];
15
16
  flatList?: boolean;
17
+ folderIcon?: MynahIcons | MynahIconsType | null;
16
18
  actions?: Record<string, FileNodeAction[]>;
17
19
  details?: Record<string, TreeNodeDetails>;
18
20
  hideFileCount?: boolean;
@@ -1,5 +1,6 @@
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;
@@ -7,9 +8,11 @@ export interface ChatItemTreeViewProps {
7
8
  messageId: string;
8
9
  hideFileCount?: boolean;
9
10
  collapsed?: boolean;
11
+ folderIcon?: MynahIcons | MynahIconsType | null;
10
12
  }
11
13
  export declare class ChatItemTreeView {
12
14
  private readonly node;
15
+ private readonly folderIcon;
13
16
  private isOpen;
14
17
  private readonly depth;
15
18
  private readonly tabId;
@@ -34,6 +34,7 @@ export declare class ChatPromptInput {
34
34
  private readonly userPromptHistory;
35
35
  private userPromptHistoryIndex;
36
36
  private lastUnsentUserPrompt;
37
+ private readonly markerRemovalRegex;
37
38
  constructor(props: ChatPromptInputProps);
38
39
  private readonly updateAvailableCharactersIndicator;
39
40
  private readonly handleInputKeydown;
@@ -11,6 +11,7 @@ export interface PromptTextInputProps {
11
11
  export declare class PromptTextInput {
12
12
  render: ExtendedHTMLElement;
13
13
  promptTextInputMaxLength: number;
14
+ private lastCursorIndex;
14
15
  private readonly props;
15
16
  private readonly promptTextInput;
16
17
  private promptInputOverlay;
@@ -19,6 +20,7 @@ export declare class PromptTextInput {
19
20
  private contextTooltip;
20
21
  private contextTooltipTimeout;
21
22
  constructor(props: PromptTextInputProps);
23
+ private readonly updateCursorPos;
22
24
  private readonly checkIsEmpty;
23
25
  private readonly removeContextPlaceholderOverlay;
24
26
  private readonly insertElementToGivenPosition;
@@ -35,9 +37,15 @@ export declare class PromptTextInput {
35
37
  readonly updateTextInputMaxLength: (maxLength: number) => void;
36
38
  readonly updateTextInputPlaceholder: (text: string) => void;
37
39
  readonly deleteTextRange: (position: number, endPosition: number) => void;
38
- readonly getCursorLine: () => {
40
+ /**
41
+ * Returns the cursorLine, totalLines and if the cursor is at the beginning or end of the whole text
42
+ * @returns {cursorLine: number, totalLines: number, isAtTheBeginning: boolean, isAtTheEnd: boolean}
43
+ */
44
+ readonly getCursorPosition: () => {
39
45
  cursorLine: number;
40
46
  totalLines: number;
47
+ isAtTheBeginning: boolean;
48
+ isAtTheEnd: boolean;
41
49
  };
42
50
  readonly getUsedContext: () => QuickActionCommand[];
43
51
  }
@@ -12,6 +12,7 @@ export interface CustomFormWrapperProps {
12
12
  title?: string;
13
13
  description?: string;
14
14
  onFormAction?: (actionName: string, formData: Record<string, string>) => void;
15
+ onFormDisabled?: () => void;
15
16
  onCloseButtonClick?: (e: Event) => void;
16
17
  }
17
18
  export declare class CustomFormWrapper {
@@ -9,6 +9,7 @@ export interface TextAreaProps {
9
9
  classNames?: string[];
10
10
  attributes?: Record<string, string>;
11
11
  label?: HTMLElement | ExtendedHTMLElement | string;
12
+ autoFocus?: boolean;
12
13
  description?: ExtendedHTMLElement;
13
14
  mandatory?: boolean;
14
15
  fireModifierAndEnterKeyPress?: () => void;
@@ -19,6 +20,7 @@ export interface TextAreaProps {
19
20
  };
20
21
  value?: string;
21
22
  onChange?: (value: string) => void;
23
+ onKeyPress?: (event: KeyboardEvent) => void;
22
24
  testId?: string;
23
25
  }
24
26
  export declare abstract class TextAreaAbstract {
@@ -9,6 +9,7 @@ export interface TextInputProps {
9
9
  classNames?: string[];
10
10
  attributes?: Record<string, string>;
11
11
  label?: HTMLElement | ExtendedHTMLElement | string;
12
+ autoFocus?: boolean;
12
13
  description?: ExtendedHTMLElement;
13
14
  mandatory?: boolean;
14
15
  fireModifierAndEnterKeyPress?: () => void;
@@ -20,6 +21,7 @@ export interface TextInputProps {
20
21
  };
21
22
  value?: string;
22
23
  onChange?: (value: string) => void;
24
+ onKeyPress?: (event: KeyboardEvent) => void;
23
25
  testId?: string;
24
26
  }
25
27
  export declare abstract class TextInputAbstract {
@@ -1,2 +1,4 @@
1
1
  import { QuickActionCommandGroup } from '../static';
2
2
  export declare const filterQuickPickItems: (commands: QuickActionCommandGroup[], searchTerm: string) => QuickActionCommandGroup[];
3
+ export declare const MARK_OPEN = "<mark>";
4
+ export declare const MARK_CLOSE = "</mark>";
package/dist/main.d.ts CHANGED
@@ -70,6 +70,7 @@ export interface MynahUIProps {
70
70
  onFormLinkClick?: (link: string, mouseEvent?: MouseEvent, eventId?: string) => void;
71
71
  onSendFeedback?: (tabId: string, feedbackPayload: FeedbackPayload, eventId?: string) => void;
72
72
  onFormModifierEnterPress?: (formData: Record<string, string>, tabId: string, eventId?: string) => void;
73
+ onFormTextualItemKeyPress?: (event: KeyboardEvent, formData: Record<string, string>, itemId: string, tabId: string, eventId?: string) => boolean;
73
74
  onCustomFormAction?: (tabId: string, action: {
74
75
  id: string;
75
76
  text?: string;