@aws/mynah-ui 4.31.0-beta.6 → 4.31.0-beta.7

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 (39) hide show
  1. package/dist/components/background.d.ts +0 -1
  2. package/dist/components/button.d.ts +0 -1
  3. package/dist/components/card/card-body.d.ts +0 -1
  4. package/dist/components/card/card.d.ts +0 -1
  5. package/dist/components/chat-item/chat-item-card.d.ts +5 -0
  6. package/dist/components/chat-item/chat-item-information-card.d.ts +0 -1
  7. package/dist/components/chat-item/chat-item-tabbed-card.d.ts +0 -1
  8. package/dist/components/chat-item/chat-item-tree-view-wrapper.d.ts +5 -1
  9. package/dist/components/chat-item/chat-item-tree-view.d.ts +2 -0
  10. package/dist/components/chat-item/chat-prompt-input.d.ts +1 -0
  11. package/dist/components/chat-item/chat-wrapper.d.ts +0 -1
  12. package/dist/components/collapsible-content.d.ts +0 -1
  13. package/dist/components/form-items/checkbox.d.ts +0 -1
  14. package/dist/components/form-items/radio-group.d.ts +0 -1
  15. package/dist/components/form-items/select.d.ts +0 -1
  16. package/dist/components/form-items/stars.d.ts +0 -1
  17. package/dist/components/form-items/text-area.d.ts +0 -1
  18. package/dist/components/form-items/text-input.d.ts +0 -1
  19. package/dist/components/icon.d.ts +2 -0
  20. package/dist/components/more-content-indicator.d.ts +0 -1
  21. package/dist/components/navigation-tabs.d.ts +0 -1
  22. package/dist/components/no-tabs.d.ts +0 -1
  23. package/dist/components/notification.d.ts +0 -1
  24. package/dist/components/overlay.d.ts +0 -1
  25. package/dist/components/progress.d.ts +0 -2
  26. package/dist/components/sheet.d.ts +0 -1
  27. package/dist/components/spinner/spinner.d.ts +0 -1
  28. package/dist/components/syntax-highlighter.d.ts +0 -1
  29. package/dist/components/tabs.d.ts +0 -1
  30. package/dist/components/title-description-with-icon.d.ts +0 -1
  31. package/dist/helper/file-tree.d.ts +3 -2
  32. package/dist/helper/style-loader.d.ts +12 -0
  33. package/dist/main.d.ts +3 -3
  34. package/dist/main.js +1 -1
  35. package/dist/main.js.map +1 -1
  36. package/dist/static.d.ts +10 -0
  37. package/docs/DATAMODEL.md +39 -9
  38. package/docs/img/data-model/chatItems/shimmer.gif +0 -0
  39. package/package.json +1 -1
@@ -3,7 +3,6 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../helper/dom';
6
- import '../styles/components/_background.scss';
7
6
  export declare class GradientBackground {
8
7
  render: ExtendedHTMLElement;
9
8
  constructor();
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { DomBuilderEventHandler, DomBuilderEventHandlerWithOptions, ExtendedHTMLElement, GenericEvents } from '../helper/dom';
6
6
  import { OverlayHorizontalDirection, OverlayVerticalDirection } from './overlay';
7
- import '../styles/components/_button.scss';
8
7
  export interface ButtonProps {
9
8
  classNames?: string[];
10
9
  attributes?: Record<string, string>;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { DomBuilderObject, ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { CodeBlockActions, OnCodeBlockActionFunction, OnCopiedToClipboardFunction, ReferenceTrackerInformation } from '../../static';
7
- import '../../styles/components/card/_card.scss';
8
7
  export declare const highlightersWithTooltip: {
9
8
  start: {
10
9
  markupStart: string;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { DomBuilderObject, ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { EngagementType } from '../../static';
7
- import '../../styles/components/card/_card.scss';
8
7
  export interface CardProps extends Partial<DomBuilderObject> {
9
8
  border?: boolean;
10
9
  background?: boolean;
@@ -14,6 +14,8 @@ export interface ChatItemCardProps {
14
14
  export declare class ChatItemCard {
15
15
  readonly props: ChatItemCardProps;
16
16
  render: ExtendedHTMLElement;
17
+ private tooltipOverlay;
18
+ private tooltipTimeout;
17
19
  private readonly card;
18
20
  private readonly updateStack;
19
21
  private readonly initialSpinner;
@@ -30,6 +32,7 @@ export declare class ChatItemCard {
30
32
  private chatButtonsInside;
31
33
  private chatButtonsOutside;
32
34
  private fileTreeWrapper;
35
+ private fileTreeWrapperCollapsedState;
33
36
  private followUps;
34
37
  private readonly moreContentIndicator;
35
38
  private isMoreContentExpanded;
@@ -46,6 +49,8 @@ export declare class ChatItemCard {
46
49
  private readonly updateCardContent;
47
50
  private readonly getChatAvatar;
48
51
  private readonly canShowAvatar;
52
+ private readonly showTooltip;
53
+ readonly hideTooltip: () => void;
49
54
  readonly updateCard: () => void;
50
55
  readonly updateCardStack: (updateWith: Partial<ChatItem>) => void;
51
56
  readonly clearContent: () => void;
@@ -1,6 +1,5 @@
1
1
  import { ExtendedHTMLElement } from '../../helper/dom';
2
2
  import { ChatItemContent } from '../../static';
3
- import '../../styles/components/chat/_chat-item-card-information-card.scss';
4
3
  export interface ChatItemInformationCardProps {
5
4
  tabId: string;
6
5
  testId?: string;
@@ -1,7 +1,6 @@
1
1
  import { ExtendedHTMLElement } from '../../helper/dom';
2
2
  import { ChatItemContent } from '../../static';
3
3
  import { ChatItemCard } from './chat-item-card';
4
- import '../../styles/components/chat/_chat-item-card-tabbed-card.scss';
5
4
  export interface ChatItemTabbedCardProps {
6
5
  tabId: string;
7
6
  messageId: string | undefined;
@@ -3,7 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
- import { FileNodeAction, ReferenceTrackerInformation, TreeNodeDetails } from '../../static';
6
+ import { FileNodeAction, ReferenceTrackerInformation, Status, TreeNodeDetails } from '../../static';
7
7
  import { MynahIcons, MynahIconsType } from '../icon';
8
8
  export interface ChatItemTreeViewWrapperProps {
9
9
  tabId: string;
@@ -12,6 +12,9 @@ export interface ChatItemTreeViewWrapperProps {
12
12
  cardTitle?: string;
13
13
  classNames?: string[];
14
14
  rootTitle?: string;
15
+ rootLabel?: string;
16
+ rootStatusIcon?: MynahIcons | MynahIconsType;
17
+ rootIconForegroundStatus?: Status;
15
18
  deletedFiles: string[];
16
19
  flatList?: boolean;
17
20
  folderIcon?: MynahIcons | MynahIconsType | null;
@@ -21,6 +24,7 @@ export interface ChatItemTreeViewWrapperProps {
21
24
  collapsed?: boolean;
22
25
  referenceSuggestionLabel: string;
23
26
  references: ReferenceTrackerInformation[];
27
+ onRootCollapsedStateChange: (isCollapsed: boolean) => void;
24
28
  }
25
29
  export declare class ChatItemTreeViewWrapper {
26
30
  render: ExtendedHTMLElement;
@@ -9,8 +9,10 @@ export interface ChatItemTreeViewProps {
9
9
  hideFileCount?: boolean;
10
10
  collapsed?: boolean;
11
11
  folderIcon?: MynahIcons | MynahIconsType | null;
12
+ onRootCollapsedStateChange?: (isCollapsed: boolean) => void;
12
13
  }
13
14
  export declare class ChatItemTreeView {
15
+ private readonly props;
14
16
  private readonly node;
15
17
  private readonly folderIcon;
16
18
  private isOpen;
@@ -16,6 +16,7 @@ export declare class ChatPromptInput {
16
16
  private readonly props;
17
17
  private readonly attachmentWrapper;
18
18
  private readonly promptTextInput;
19
+ private readonly contextSelectorButton;
19
20
  private readonly promptTextInputCommand;
20
21
  private readonly sendButton;
21
22
  private readonly stopButton;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { CardRenderDetails, ChatItem, PromptAttachmentType } from '../../static';
7
- import '../../styles/components/chat/_chat-wrapper.scss';
8
7
  export declare const CONTAINER_GAP = 12;
9
8
  export interface ChatWrapperProps {
10
9
  onStopChatResponse?: (tabId: string) => void;
@@ -3,7 +3,6 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { DomBuilderObject, ExtendedHTMLElement } from '../helper/dom';
6
- import '../styles/components/_collapsible-content.scss';
7
6
  interface CollapsibleContentProps {
8
7
  title: string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
9
8
  testId?: string;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { MynahIcons, MynahIconsType } from '../icon';
7
- import '../../styles/components/_form-input.scss';
8
7
  export interface CheckboxProps {
9
8
  type?: 'checkbox' | 'switch';
10
9
  classNames?: string[];
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { MynahIcons, MynahIconsType } from '../icon';
7
- import '../../styles/components/_form-input.scss';
8
7
  interface SelectOption {
9
8
  value: string;
10
9
  label?: string;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { MynahIcons, MynahIconsType } from '../icon';
7
- import '../../styles/components/_form-input.scss';
8
7
  interface SelectOption {
9
8
  value: string;
10
9
  label: string;
@@ -3,7 +3,6 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
- import '../../styles/components/_form-input.scss';
7
6
  export type StarValues = 1 | 2 | 3 | 4 | 5;
8
7
  export interface StarsProps {
9
8
  classNames?: string[];
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { ValidationPattern } from '../../static';
7
- import '../../styles/components/_form-input.scss';
8
7
  export interface TextAreaProps {
9
8
  classNames?: string[];
10
9
  attributes?: Record<string, string>;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { ValidationPattern } from '../../static';
7
- import '../../styles/components/_form-input.scss';
8
7
  import { MynahIcons, MynahIconsType } from '../icon';
9
8
  export interface TextInputProps {
10
9
  classNames?: string[];
@@ -7,6 +7,7 @@ import '../styles/components/_icon.scss';
7
7
  import { Status } from '../static';
8
8
  export declare enum MynahIcons {
9
9
  Q = "q",
10
+ AT = "at",
10
11
  MENU = "menu",
11
12
  MINUS = "minus",
12
13
  SEARCH = "search",
@@ -61,6 +62,7 @@ export declare enum MynahIcons {
61
62
  COPY = "copy",
62
63
  CURSOR_INSERT = "cursor-insert",
63
64
  TEXT_SELECT = "text-select",
65
+ TOOLS = "tools",
64
66
  REVERT = "revert",
65
67
  UNDO = "undo",
66
68
  ROCKET = "rocket",
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../helper/dom';
6
6
  import { MynahIcons, MynahIconsType } from './icon';
7
- import '../styles/components/_more-content-indicator.scss';
8
7
  interface MoreContentIndicatorProps {
9
8
  icon?: MynahIcons | MynahIconsType;
10
9
  border?: boolean;
@@ -3,7 +3,6 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../helper/dom';
6
- import '../styles/components/_nav-tabs.scss';
7
6
  export interface TabsProps {
8
7
  onChange?: (selectedTabId: string) => void;
9
8
  noMoreTabsTooltip?: string;
@@ -3,7 +3,6 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../helper/dom';
6
- import '../styles/components/_no-tabs.scss';
7
6
  export declare class NoTabs {
8
7
  render: ExtendedHTMLElement;
9
8
  constructor();
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { DomBuilderObject, ExtendedHTMLElement } from '../helper/dom';
6
6
  import { NotificationType } from '../static';
7
- import '../styles/components/_notification.scss';
8
7
  type NotificationContentType = string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
9
8
  export declare const DEFAULT_TIMEOUT = 5000;
10
9
  export interface NotificationProps {
@@ -3,7 +3,6 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { DomBuilderObject, ExtendedHTMLElement } from '../helper/dom';
6
- import '../styles/components/_overlay.scss';
7
6
  export declare const OVERLAY_MARGIN = 8;
8
7
  /**
9
8
  * The horizontal creation direction of the overlay
@@ -3,9 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../helper/dom';
6
- import '../styles/components/_collapsible-content.scss';
7
6
  import { ChatItemButton, ProgressField } from '../static';
8
- import '../styles/components/_progress.scss';
9
7
  interface ProgressIndicatorProps extends ProgressField {
10
8
  testId?: string;
11
9
  classNames?: string[];
@@ -3,7 +3,6 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { DomBuilderObject, ExtendedHTMLElement } from '../main';
6
- import '../styles/components/_sheet.scss';
7
6
  export interface SheetProps {
8
7
  title?: string;
9
8
  children?: Array<ExtendedHTMLElement | HTMLElement | string | DomBuilderObject>;
@@ -3,7 +3,6 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
- import '../../styles/components/_spinner.scss';
7
6
  export declare class Spinner {
8
7
  render: ExtendedHTMLElement;
9
8
  constructor();
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../helper/dom';
6
6
  import { CodeBlockActions, CodeSelectionType, OnCodeBlockActionFunction } from '../static';
7
- import '../styles/components/_syntax-highlighter.scss';
8
7
  export interface SyntaxHighlighterProps {
9
8
  codeStringWithMarkup: string;
10
9
  language?: string;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../helper/dom';
6
6
  import { MynahIcons, MynahIconsType } from './icon';
7
- import '../styles/components/_tab.scss';
8
7
  export interface ToggleOption {
9
8
  label?: ExtendedHTMLElement | string | HTMLElement;
10
9
  icon?: MynahIcons | MynahIconsType | null;
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { DomBuilderObject, ExtendedHTMLElement } from '../helper/dom';
6
6
  import { MynahIcons, MynahIconsType } from './icon';
7
- import '../styles/components/_title-description-icon.scss';
8
7
  interface TitleDescriptionWithIconProps {
9
8
  title?: string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
10
9
  description?: string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
@@ -2,7 +2,8 @@
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
+ import { MynahIcons, MynahIconsType } from '../main';
6
+ import { FileNodeAction, Status, TreeNodeDetails } from '../static';
6
7
  export type TreeNode = FolderNode | FileNode;
7
8
  export interface FileNode {
8
9
  name: string;
@@ -19,4 +20,4 @@ export interface FolderNode {
19
20
  details?: TreeNodeDetails;
20
21
  children: Array<FolderNode | FileNode>;
21
22
  }
22
- export declare const fileListToTree: (modifiedFilePaths: string[], deletedFilePaths?: string[], actions?: Record<string, FileNodeAction[]>, details?: Record<string, TreeNodeDetails>, rootTitle?: string) => TreeNode;
23
+ export declare const fileListToTree: (modifiedFilePaths: string[], deletedFilePaths?: string[], actions?: Record<string, FileNodeAction[]>, details?: Record<string, TreeNodeDetails>, rootTitle?: string, rootStatusIcon?: MynahIcons | MynahIconsType, rootStatusIconForegroundStatus?: Status, rootLabel?: string) => TreeNode;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ export declare class StyleLoader {
6
+ private readonly loadStyles;
7
+ private static instance;
8
+ private constructor();
9
+ load: (stylePath: string) => Promise<void>;
10
+ static getInstance(loadStyles?: boolean): StyleLoader;
11
+ destroy: () => void;
12
+ }
package/dist/main.d.ts CHANGED
@@ -2,8 +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, PromptAttachmentType, QuickActionCommand, DetailedList } from './static';
6
- import './styles/styles.scss';
5
+ import { RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemAction, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation, CodeSelectionType, Engagement, ChatItemFormItem, ChatItemButton, CardRenderDetails, PromptAttachmentType, QuickActionCommand, DetailedList, TreeNodeDetails } from './static';
7
6
  import { DetailedListSheetProps } from './components/detailed-list/detailed-list-sheet';
8
7
  import { MynahUIDataStore } from './helper/store';
9
8
  export { generateUID } from './helper/guid';
@@ -22,6 +21,7 @@ export { ChatItemCardContent, ChatItemCardContentProps } from './components/chat
22
21
  export { default as MynahUITestIds } from './helper/test-ids';
23
22
  export interface MynahUIProps {
24
23
  rootSelector?: string;
24
+ loadStyles?: boolean;
25
25
  defaults?: MynahUITabStoreTab;
26
26
  splashScreenInitialStatus?: {
27
27
  visible: boolean;
@@ -84,7 +84,7 @@ export interface MynahUIProps {
84
84
  * @deprecated since version 4.6.3. Will be dropped after version 5.x.x. Use {@link onFileClick} instead
85
85
  */
86
86
  onOpenDiff?: (tabId: string, filePath: string, deleted: boolean, messageId?: string, eventId?: string) => void;
87
- onFileClick?: (tabId: string, filePath: string, deleted: boolean, messageId?: string, eventId?: string) => void;
87
+ onFileClick?: (tabId: string, filePath: string, deleted: boolean, messageId?: string, eventId?: string, fileDetails?: TreeNodeDetails) => void;
88
88
  onMessageDismiss?: (tabId: string, messageId: string, eventId?: string) => void;
89
89
  onFileActionClick?: (tabId: string, messageId: string, filePath: string, actionName: string, eventId?: string) => void;
90
90
  onTabBarButtonClick?: (tabId: string, buttonId: string, eventId?: string) => void;