@aws/mynah-ui 4.0.2 → 4.0.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.
@@ -3,8 +3,8 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
- export declare const MAX_USER_INPUT = 4000;
7
6
  export declare const MAX_USER_INPUT_THRESHOLD = 96;
7
+ export declare const MAX_USER_INPUT: () => number;
8
8
  export interface ChatPromptInputProps {
9
9
  tabId: string;
10
10
  }
@@ -5,6 +5,7 @@
5
5
  import { ExtendedHTMLElement } from '../helper/dom';
6
6
  export interface TabsProps {
7
7
  onChange?: (selectedTabId: string) => void;
8
+ onBeforeTabRemove?: (tabId: string) => boolean;
8
9
  }
9
10
  export declare class Tabs {
10
11
  render: ExtendedHTMLElement;
@@ -12,12 +13,15 @@ export declare class Tabs {
12
13
  private tabIdChatItemsSubscriptions;
13
14
  private toggleGroup;
14
15
  private maxReachedOverlay;
16
+ private closeConfirmationOverlay;
15
17
  private readonly props;
16
18
  constructor(props: TabsProps);
17
19
  private readonly getTabOptionsFromTabStoreData;
18
20
  private readonly getTabsRender;
19
21
  private readonly showMaxReachedOverLay;
20
22
  private readonly hideMaxReachedOverLay;
23
+ private readonly showCloseTabConfirmationOverLay;
24
+ private readonly hideshowCloseTabConfirmationOverLay;
21
25
  private readonly assignListener;
22
26
  private readonly removeListenerAssignments;
23
27
  }
@@ -19,7 +19,7 @@ export interface ToggleProps {
19
19
  name: string;
20
20
  disabled?: boolean;
21
21
  onChange?: (selectedValue: string) => void;
22
- onRemove?: (selectedValue: string) => void;
22
+ onRemove?: (selectedValue: string, domElement: ExtendedHTMLElement) => void;
23
23
  }
24
24
  export declare class Toggle {
25
25
  render: ExtendedHTMLElement;
@@ -2,10 +2,14 @@
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 { ConfigModel } from '../static';
5
+ import { ConfigModel, ConfigOptions, ConfigTexts } from '../static';
6
+ interface ConfigFullModel extends ConfigOptions {
7
+ texts: ConfigTexts;
8
+ }
6
9
  export declare class Config {
7
10
  private static instance;
8
- config: ConfigModel;
11
+ config: ConfigFullModel;
9
12
  private constructor();
10
13
  static getInstance(config?: Partial<ConfigModel>): Config;
11
14
  }
15
+ export {};
@@ -4,11 +4,16 @@
4
4
  */
5
5
  import { MynahPortalNames } from '../static';
6
6
  export declare const DS: typeof document.querySelectorAll;
7
+ type DomBuilderEventHandler = (event?: any) => any;
8
+ interface DomBuilderEventHandlerWithOptions {
9
+ handler: DomBuilderEventHandler;
10
+ options?: AddEventListenerOptions;
11
+ }
7
12
  export interface DomBuilderObject {
8
13
  type: string;
9
14
  attributes?: Record<string, string> | undefined;
10
15
  classNames?: string[] | undefined;
11
- events?: Record<string, (event?: any) => any> | undefined;
16
+ events?: Record<string, DomBuilderEventHandler | DomBuilderEventHandlerWithOptions> | undefined;
12
17
  children?: Array<string | DomBuilderObject | HTMLElement | ExtendedHTMLElement> | undefined;
13
18
  innerHTML?: string | undefined;
14
19
  persistent?: boolean | undefined;
@@ -52,3 +57,4 @@ export declare class DomBuilder {
52
57
  removeAllPortals: (portalsWithName: MynahPortalNames) => void;
53
58
  }
54
59
  export declare const htmlDecode: (input: string) => string;
60
+ export {};
package/dist/main.d.ts CHANGED
@@ -27,6 +27,7 @@ export interface MynahUIProps {
27
27
  onTabChange?: (tabId: string) => void;
28
28
  onTabAdd?: (tabId: string) => void;
29
29
  onTabRemove?: (tabId: string) => void;
30
+ onBeforeTabRemove?: (tabId: string) => boolean;
30
31
  onChatItemEngagement?: (tabId: string, messageId: string, engagement: Engagement) => void;
31
32
  onCopyCodeToClipboard?: (tabId: string, messageId: string, code?: string, type?: CodeSelectionType, referenceTrackerInformation?: ReferenceTrackerInformation[]) => void;
32
33
  onCodeInsertToCursorPosition?: (tabId: string, messageId: string, code?: string, type?: CodeSelectionType, referenceTrackerInformation?: ReferenceTrackerInformation[]) => void;