@aws/mynah-ui 4.35.6 → 4.35.7-beta.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.
Files changed (28) hide show
  1. package/dist/components/chat-item/chat-prompt-input.d.ts +3 -0
  2. package/dist/components/chat-item/chat-wrapper.d.ts +7 -0
  3. package/dist/components/chat-item/prompt-input/prompt-text-input.d.ts +4 -0
  4. package/dist/components/icon.d.ts +2 -1
  5. package/dist/main.d.ts +3 -0
  6. package/dist/main.js +1 -1
  7. package/dist/main.js.map +1 -1
  8. package/dist/static.d.ts +24 -1
  9. package/docs/DATAMODEL.md +42 -1
  10. package/docs/PROPERTIES.md +63 -0
  11. package/docs/USAGE.md +32 -1
  12. package/docs/img/data-model/chatItems/formItemsTooltip.png +0 -0
  13. package/docs/img/data-model/chatItems/options-all-filled.png +0 -0
  14. package/docs/img/data-model/chatItems/options-mandatory-filled.png +0 -0
  15. package/docs/img/data-model/chatItems/options-submitted.png +0 -0
  16. package/docs/img/data-model/chatItems/options.png +0 -0
  17. package/docs/img/data-model/tabStore/quickActionCommandsHeader.png +0 -0
  18. package/package.json +1 -1
  19. package/ui-tests/__snapshots__/chromium/Open-MynahUI-Forms-should-render-form-elements-correctly/Open-MynahUI-Forms-should-render-form-elements-correctly-1.png +0 -0
  20. package/ui-tests/__snapshots__/chromium/Open-MynahUI-Quick-Action-Commands-Header-should-handle-quick-action-commands-header-interaction/quick-action-commands-header-hover.png +0 -0
  21. package/ui-tests/__snapshots__/chromium/Open-MynahUI-Quick-Action-Commands-Header-should-not-render-header-when-not-applicable/quick-action-commands-header-not-present.png +0 -0
  22. package/ui-tests/__snapshots__/chromium/Open-MynahUI-Quick-Action-Commands-Header-should-render-header-with-correct-status-styling/quick-action-commands-header-status.png +0 -0
  23. package/ui-tests/__snapshots__/chromium/Open-MynahUI-Quick-Action-Commands-Header-should-render-the-quick-action-commands-header/quick-action-commands-header.png +0 -0
  24. package/ui-tests/__snapshots__/webkit/Open-MynahUI-Forms-should-render-form-elements-correctly/Open-MynahUI-Forms-should-render-form-elements-correctly-1.png +0 -0
  25. package/ui-tests/__snapshots__/webkit/Open-MynahUI-Quick-Action-Commands-Header-should-handle-quick-action-commands-header-interaction/quick-action-commands-header-hover.png +0 -0
  26. package/ui-tests/__snapshots__/webkit/Open-MynahUI-Quick-Action-Commands-Header-should-not-render-header-when-not-applicable/quick-action-commands-header-not-present.png +0 -0
  27. package/ui-tests/__snapshots__/webkit/Open-MynahUI-Quick-Action-Commands-Header-should-render-header-with-correct-status-styling/quick-action-commands-header-status.png +0 -0
  28. package/ui-tests/__snapshots__/webkit/Open-MynahUI-Quick-Action-Commands-Header-should-render-the-quick-action-commands-header/quick-action-commands-header.png +0 -0
@@ -62,8 +62,11 @@ export declare class ChatPromptInput {
62
62
  private readonly sendPrompt;
63
63
  private readonly getPromptInputTextLabel;
64
64
  readonly clearTextArea: (keepAttachment?: boolean) => void;
65
+ readonly getCursorPosition: () => number;
65
66
  readonly addAttachment: (attachmentContent: string, type?: PromptAttachmentType) => void;
66
67
  readonly openTopBarButtonItemOverlay: (data: TopBarButtonOverlayProps) => void;
67
68
  readonly updateTopBarButtonItemOverlay: (data: DetailedList) => void;
68
69
  readonly closeTopBarButtonItemOverlay: () => void;
70
+ readonly destroy: () => void;
71
+ readonly getCurrentTriggerSource: () => 'top-bar' | 'prompt-input';
69
72
  }
@@ -46,4 +46,11 @@ export declare class ChatWrapper {
46
46
  openTopBarButtonItemOverlay: (data: TopBarButtonOverlayProps) => void;
47
47
  updateTopBarButtonItemOverlay: (data: DetailedList) => void;
48
48
  closeTopBarButtonItemOverlay: () => void;
49
+ getPromptInputCursorPosition: () => number;
50
+ /**
51
+ * Returns true if the current tab has an image context command available.
52
+ */
53
+ private hasImageContextCommand;
54
+ destroy: () => void;
55
+ getCurrentTriggerSource(): 'top-bar' | 'prompt-input';
49
56
  }
@@ -20,7 +20,10 @@ export declare class PromptTextInput {
20
20
  private readonly selectedContext;
21
21
  private contextTooltip;
22
22
  private contextTooltipTimeout;
23
+ private mutationObserver;
23
24
  constructor(props: PromptTextInputProps);
25
+ private readonly setupContextRemovalObserver;
26
+ private readonly handleContextRemoval;
24
27
  readonly restoreRange: (range: Range) => void;
25
28
  private readonly updateCursorPos;
26
29
  private readonly checkIsEmpty;
@@ -51,4 +54,5 @@ export declare class PromptTextInput {
51
54
  isAtTheEnd: boolean;
52
55
  };
53
56
  readonly getUsedContext: () => QuickActionCommand[];
57
+ readonly destroy: () => void;
54
58
  }
@@ -80,7 +80,8 @@ export declare enum MynahIcons {
80
80
  MCP = "mcp",
81
81
  TRASH = "trash",
82
82
  TRANSFORM = "transform",
83
- HISTORY = "history"
83
+ HISTORY = "history",
84
+ IMAGE = "image"
84
85
  }
85
86
  export interface CustomIcon {
86
87
  name: string;
package/dist/main.d.ts CHANGED
@@ -98,6 +98,8 @@ export interface MynahUIProps {
98
98
  id: string;
99
99
  }, eventId?: string) => void;
100
100
  onSplashLoaderActionClick?: (action: Action, eventId?: string) => void;
101
+ onOpenFileDialogClick?: (tabId: string, fileType: string, insertPosition: number) => void;
102
+ onFilesDropped?: (tabId: string, files: FileList, insertPosition: number) => void;
101
103
  }
102
104
  export declare class MynahUI {
103
105
  private readonly render;
@@ -123,6 +125,7 @@ export declare class MynahUI {
123
125
  * @param answer ChatItem object.
124
126
  */
125
127
  addChatItem: (tabId: string, chatItem: ChatItem) => void;
128
+ addCustomContextToPrompt: (tabId: string, contextItem: QuickActionCommand[], insertPosition?: number) => void;
126
129
  /**
127
130
  * Updates the last ChatItemType.ANSWER_STREAM chat item
128
131
  * @param tabId Corresponding tab ID.