@aws/mynah-ui 2.0.0-beta.6.1 → 2.0.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.
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { ExtendedHTMLElement } from '../../helper/dom';
6
+ export interface ChatItemRelevanceVoteProps {
7
+ tabId: string;
8
+ messageId: string;
9
+ }
10
+ export declare class ChatItemRelevanceVote {
11
+ private readonly votingId;
12
+ private sendFeedbackListenerId;
13
+ render: ExtendedHTMLElement;
14
+ props: ChatItemRelevanceVoteProps;
15
+ constructor(props: ChatItemRelevanceVoteProps);
16
+ private readonly handleVoteChange;
17
+ }
@@ -10,6 +10,6 @@ export interface FeedbackFormCommentProps {
10
10
  export declare class FeedbackFormComment {
11
11
  render: ExtendedHTMLElement;
12
12
  constructor(props: FeedbackFormCommentProps);
13
- setEnabled: (enabled: boolean) => void;
14
- setComment: (comment: string) => void;
13
+ getComment: () => string;
14
+ clear: () => void;
15
15
  }
@@ -9,11 +9,14 @@ export interface FeedbackFormProps {
9
9
  }
10
10
  export declare class FeedbackForm {
11
11
  private feedbackFormWrapper;
12
- private readonly feedbackStars;
12
+ private readonly feedbackSelect;
13
+ private readonly feedbackOptionsWrapper;
13
14
  private readonly feedbackComment;
14
- private readonly feedbackPayload;
15
15
  private readonly feedbackSubmitButton;
16
+ private feedbackPayload;
16
17
  readonly feedbackFormContainer: ExtendedHTMLElement;
17
18
  constructor(props?: FeedbackFormProps);
18
19
  private readonly onFeedbackSet;
20
+ close: () => void;
21
+ show: () => void;
19
22
  }
@@ -0,0 +1,9 @@
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 MynahUIIconImporter {
6
+ private static instance;
7
+ private constructor();
8
+ static getInstance: () => MynahUIIconImporter;
9
+ }
@@ -15,10 +15,10 @@ export declare enum MynahIcons {
15
15
  CANCEL = "cancel",
16
16
  CALENDAR = "calendar",
17
17
  MEGAPHONE = "megaphone",
18
+ NOTIFICATION = "notification",
18
19
  EYE = "eye",
19
20
  ELLIPSIS = "ellipsis",
20
21
  OK = "ok",
21
- UP_CIRCLED = "up-circled",
22
22
  UP_OPEN = "up-open",
23
23
  DOWN_OPEN = "down-open",
24
24
  RIGHT_OPEN = "right-open",
@@ -35,13 +35,15 @@ export declare enum MynahIcons {
35
35
  STAR = "star",
36
36
  LIGHT_BULB = "light-bulb",
37
37
  ENVELOPE_SEND = "envelope-send",
38
- SEARCH_HISTORY = "search-history",
38
+ REFRESH = "refresh",
39
39
  USER = "user",
40
40
  PLAY = "play",
41
41
  PAUSE = "pause",
42
42
  CODE_BLOCK = "code-block",
43
43
  COPY = "copy",
44
- TEXT_SELECT = "text-select"
44
+ CURSOR_INSERT = "cursor-insert",
45
+ TEXT_SELECT = "text-select",
46
+ REVERT = "revert"
45
47
  }
46
48
  export interface IconProps {
47
49
  icon: MynahIcons;
@@ -3,11 +3,11 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
- import { SuggestionMetaDataUnion } from '../../static';
6
+ import { SuggestionMetaData } from '../../static';
7
7
  export interface SuggestionCardHeaderProps {
8
8
  title: string;
9
9
  url: string;
10
- metadata?: SuggestionMetaDataUnion;
10
+ metadata?: Record<string, SuggestionMetaData>;
11
11
  onSuggestionTitleClick?: (e?: MouseEvent) => void;
12
12
  onSuggestionLinkCopy?: () => void;
13
13
  }
@@ -30,5 +30,8 @@ export declare class Toggle {
30
30
  private readonly getChildren;
31
31
  private readonly updateSelectionRender;
32
32
  setValue: (value: string) => void;
33
- getValue: () => string | undefined;
33
+ addOption: (option: ToggleOption) => void;
34
+ removeOption: (value: string) => void;
35
+ snapToOption: (value: string) => void;
36
+ getValue: () => string | undefined | null;
34
37
  }
@@ -2,9 +2,10 @@
2
2
  * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- export declare class MynahConfig {
6
- private config;
7
- constructor();
8
- getConfig: (configName: string) => any;
9
- setConfig: (configName: string, configValue: string) => void;
5
+ import { ConfigModel } from '../static';
6
+ export declare class Config {
7
+ private static instance;
8
+ config: ConfigModel;
9
+ private constructor();
10
+ static getInstance(config?: Partial<ConfigModel>): Config;
10
11
  }
@@ -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
- export declare const getTimeDiff: (differenceInMs: number, show?: 1 | 2 | 3 | 4 | 5 | 6 | {
5
+ export declare const getTimeDiff: (differenceInMs: number, show?: 1 | 2 | 5 | 3 | 4 | 6 | {
6
6
  years?: boolean | undefined;
7
7
  months?: boolean | undefined;
8
8
  weeks?: boolean | undefined;
@@ -5,9 +5,9 @@
5
5
  import { MynahUITabStoreModel, MynahUITabStoreTab } from '../static';
6
6
  interface TabStoreSubscription {
7
7
  'add': Record<string, (tabId: string, tabData?: MynahUITabStoreTab) => void>;
8
- 'remove': Record<string, (tabId: string) => void>;
8
+ 'remove': Record<string, (tabId: string, newSelectedTab?: MynahUITabStoreTab) => void>;
9
9
  'update': Record<string, (tabId: string, tabData?: MynahUITabStoreTab) => void>;
10
- 'selectedTabChange': Record<string, (tabId: string) => void>;
10
+ 'selectedTabChange': Record<string, (tabId: string, previousSelectedTab?: MynahUITabStoreTab) => void>;
11
11
  }
12
12
  export declare class EmptyMynahUITabsStoreModel {
13
13
  data: Required<MynahUITabStoreModel>;
@@ -20,6 +20,7 @@ export declare class MynahUITabsStore {
20
20
  private readonly tabsStore;
21
21
  private readonly tabsDataStore;
22
22
  private constructor();
23
+ private readonly deselectAllTabs;
23
24
  readonly addTab: (tabData?: MynahUITabStoreTab | undefined) => string;
24
25
  readonly removeTab: (tabId: string) => string;
25
26
  readonly selectTab: (tabId: string) => void;
@@ -28,7 +29,7 @@ export declare class MynahUITabsStore {
28
29
  addListener: (eventName: keyof TabStoreSubscription, handler: (tabId: string, tabData?: MynahUITabStoreTab | undefined) => void) => string;
29
30
  removeListener: (eventName: keyof TabStoreSubscription, subscriptionId: string) => void;
30
31
  private readonly informSubscribers;
31
- getTab: (tabId: string) => any;
32
+ getTab: (tabId: string) => MynahUITabStoreTab | null;
32
33
  getAllTabs: () => MynahUITabStoreModel;
33
34
  getTabDataStore: (tabId: string) => any;
34
35
  getSelectedTabId: () => string;
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 { SuggestionEngagement, Suggestion, SuggestionEventName, RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemFollowUp, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab } from './static';
5
+ import { SuggestionEngagement, Suggestion, SuggestionEventName, RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemFollowUp, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel } from './static';
6
6
  import './styles/styles.scss';
7
7
  export { FeedbackPayload, RelevancyVoteType, Suggestion, EngagementType, SuggestionEngagement, SuggestionEventName, MynahUIDataModel, NotificationType, ChatItem, ChatItemFollowUp, ChatItemType, ChatPrompt } from './static';
8
8
  export { ToggleOption } from './components/toggle';
@@ -11,9 +11,10 @@ export interface MynahUIProps {
11
11
  rootSelector?: string;
12
12
  defaults?: MynahUITabStoreTab;
13
13
  tabs?: MynahUITabStoreModel;
14
+ config?: ConfigModel;
14
15
  onShowMoreWebResultsClick?: () => void;
15
16
  onReady?: () => void;
16
- onVote?: (tabId: string, votedItemID: string, vote: RelevancyVoteType) => void;
17
+ onVote?: (tabId: string, messageId: string, vote: RelevancyVoteType) => void;
17
18
  onStopChatResponse?: (tabId: string) => void;
18
19
  onResetStore?: () => void;
19
20
  onChatPrompt?: (tabId: string, prompt: ChatPrompt) => void;
@@ -35,7 +36,6 @@ export declare class MynahUI {
35
36
  private readonly tabContentsWrapper;
36
37
  private readonly feedbackForm?;
37
38
  private readonly chatWrappers;
38
- private readonly config;
39
39
  constructor(props: MynahUIProps);
40
40
  private readonly addGlobalListeners;
41
41
  addChatAnswer: (tabId: string, answer: ChatItem) => void;
@@ -45,7 +45,6 @@ export declare class MynahUI {
45
45
  suggestions: Suggestion[];
46
46
  }) => void;
47
47
  updateStore: (tabId: string | '', data: MynahUIDataModel) => string;
48
- showFeedbackForm: () => void;
49
48
  notify: (props: {
50
49
  duration?: number;
51
50
  type?: NotificationType;