@aws/mynah-ui 2.0.0-beta.7 → 2.0.0-beta.8.0

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.
@@ -32,6 +32,7 @@ export interface OverlayProps {
32
32
  closeOnOutsideClick?: boolean;
33
33
  background?: boolean;
34
34
  onClose?: () => void;
35
+ removeOtherOverlays?: boolean;
35
36
  }
36
37
  export declare class Overlay {
37
38
  render: ExtendedHTMLElement;
@@ -13,8 +13,8 @@ export interface SuggestionCardBodyProps {
13
13
  export declare class SuggestionCardBody {
14
14
  render: ExtendedHTMLElement;
15
15
  cardBody: ExtendedHTMLElement;
16
- matchingLanguage: string;
17
16
  props: SuggestionCardBodyProps;
17
+ private readonly syntaxHighlighterHighlightWithTooltipRangeItems;
18
18
  constructor(props: SuggestionCardBodyProps);
19
19
  private readonly processNode;
20
20
  private readonly getCardBodyChildren;
@@ -9,7 +9,7 @@ import 'prismjs/components/prism-java';
9
9
  import 'prismjs/components/prism-javascript';
10
10
  import 'prismjs/components/prism-json';
11
11
  import 'prismjs/plugins/line-numbers/prism-line-numbers.js';
12
- import { OnCopiedToClipboardFunction, OnInsertToCursorPositionFunction, SupportedCodingLanguagesType } from '../static';
12
+ import { OnCopiedToClipboardFunction, OnInsertToCursorPositionFunction, ReferenceTrackerInformation } from '../static';
13
13
  export declare const highlighters: {
14
14
  start: {
15
15
  markup: string;
@@ -20,6 +20,16 @@ export declare const highlighters: {
20
20
  textReplacement: string;
21
21
  };
22
22
  };
23
+ export declare const highlightersWithTooltip: {
24
+ start: {
25
+ markup: string;
26
+ textReplacement: string;
27
+ };
28
+ end: {
29
+ markup: string;
30
+ textReplacement: string;
31
+ };
32
+ };
23
33
  export declare const ellipsis: {
24
34
  start: {
25
35
  markup: string;
@@ -32,21 +42,26 @@ export declare const ellipsis: {
32
42
  };
33
43
  export interface SyntaxHighlighterProps {
34
44
  codeStringWithMarkup: string;
35
- language?: SupportedCodingLanguagesType;
45
+ language?: string;
36
46
  keepHighlights?: boolean;
37
47
  showLineNumbers?: boolean;
38
48
  block?: boolean;
39
49
  startingLineNumber?: number;
40
50
  showCopyOptions?: boolean;
51
+ highlightRangeWithTooltip?: ReferenceTrackerInformation[];
41
52
  onCopiedToClipboard?: OnCopiedToClipboardFunction;
42
53
  onInsertToCursorPosition?: OnInsertToCursorPositionFunction;
43
54
  }
44
55
  export declare class SyntaxHighlighter {
45
- private readonly code;
46
56
  private readonly onCopiedToClipboard?;
47
57
  private readonly onInsertToCursorPosition?;
58
+ private readonly highlightRangeWithTooltip;
59
+ private highlightRangeTooltipTimeout;
60
+ private highlightRangeTooltip;
48
61
  render: ExtendedHTMLElement;
49
62
  constructor(props: SyntaxHighlighterProps);
63
+ private readonly showHighlightRangeTooltip;
64
+ private readonly hideHighlightRangeTooltip;
50
65
  private readonly getSelectedCode;
51
66
  private readonly copyToClipboard;
52
67
  }
@@ -2,6 +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 { MynahPortalNames } from '../static';
5
6
  export declare const DS: typeof document.querySelectorAll;
6
7
  export interface DomBuilderObject {
7
8
  type: string;
@@ -48,5 +49,6 @@ export declare class DomBuilder {
48
49
  createPortal: (portalName: string, builderObject: DomBuilderObject, position: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend') => ExtendedHTMLElement;
49
50
  getPortal: (portalName: string) => ExtendedHTMLElement;
50
51
  removePortal: (portalName: string) => void;
52
+ removeAllPortals: (portalsWithName: MynahPortalNames) => void;
51
53
  }
52
54
  export declare const htmlDecode: (input: string) => string;
@@ -9,9 +9,10 @@ export declare class EmptyMynahUIDataModel {
9
9
  }
10
10
  export declare class MynahUIDataStore {
11
11
  private readonly subsciptions;
12
+ private readonly tabId;
12
13
  private store;
13
14
  private defaults;
14
- constructor(initialData?: MynahUIDataModel);
15
+ constructor(tabId: string, initialData?: MynahUIDataModel);
15
16
  setDefaults: (defaults: MynahUIDataModel | null) => void;
16
17
  getDefaults: () => MynahUIDataModel | null;
17
18
  subscribe: (storeKey: keyof MynahUIDataModel, handler: (newValue: any, oldValue?: any) => void) => 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, ConfigModel } from './static';
5
+ import { SuggestionEngagement, Suggestion, SuggestionEventName, RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemFollowUp, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation } 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';
@@ -12,20 +12,20 @@ export interface MynahUIProps {
12
12
  defaults?: MynahUITabStoreTab;
13
13
  tabs?: MynahUITabStoreModel;
14
14
  config?: ConfigModel;
15
- onShowMoreWebResultsClick?: () => void;
15
+ onShowMoreWebResultsClick?: (tabId: string, messageId: string) => void;
16
16
  onReady?: () => void;
17
17
  onVote?: (tabId: string, messageId: string, vote: RelevancyVoteType) => void;
18
18
  onStopChatResponse?: (tabId: string) => void;
19
- onResetStore?: () => void;
19
+ onResetStore?: (tabId: string) => void;
20
20
  onChatPrompt?: (tabId: string, prompt: ChatPrompt) => void;
21
21
  onFollowUpClicked?: (tabId: string, followUp: ChatItemFollowUp) => void;
22
- onTabChange?: (selectedTabId: string) => void;
22
+ onTabChange?: (tabId: string) => void;
23
23
  onTabAdd?: (tabId: string) => void;
24
24
  onTabRemove?: (tabId: string) => void;
25
- onSuggestionEngagement?: (engagement: SuggestionEngagement) => void;
26
- onCopyCodeToClipboard?: (code?: string, type?: 'selection' | 'block') => void;
27
- onCodeInsertToCursorPosition?: (code?: string, type?: 'selection' | 'block') => void;
28
- onSuggestionInteraction?: (eventName: SuggestionEventName, suggestion: Suggestion, mouseEvent?: MouseEvent) => void;
25
+ onSuggestionEngagement?: (tabId: string, engagement: SuggestionEngagement) => void;
26
+ onCopyCodeToClipboard?: (tabId: string, code?: string, type?: 'selection' | 'block', referenceTrackerInformation?: ReferenceTrackerInformation[]) => void;
27
+ onCodeInsertToCursorPosition?: (tabId: string, code?: string, type?: 'selection' | 'block', referenceTrackerInformation?: ReferenceTrackerInformation[]) => void;
28
+ onSuggestionInteraction?: (tabId: string, eventName: SuggestionEventName, suggestion: Suggestion, mouseEvent?: MouseEvent) => void;
29
29
  onSendFeedback?: (tabId: string, feedbackPayload: FeedbackPayload) => void;
30
30
  onOpenDiff?: (tabId: string, leftPath: string, rightPath: string) => void;
31
31
  }