@microsoft/omnichannel-chat-widget 0.1.0-main.24bd1e6 → 0.1.0-main.306098a

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 (118) hide show
  1. package/lib/cjs/common/Constants.js +2 -0
  2. package/lib/cjs/common/storage/default/defaultCacheManager.js +34 -0
  3. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +114 -0
  4. package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +86 -0
  5. package/lib/cjs/common/telemetry/TelemetryConstants.js +15 -0
  6. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +31 -18
  7. package/lib/cjs/common/utils.js +20 -7
  8. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +4 -4
  9. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -4
  10. package/lib/cjs/components/footerstateful/FooterStateful.js +5 -13
  11. package/lib/cjs/components/headerstateful/HeaderStateful.js +14 -7
  12. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +44 -0
  13. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +23 -0
  14. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  15. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +39 -0
  16. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +70 -0
  17. package/lib/cjs/components/livechatwidget/common/Deferred.js +42 -0
  18. package/lib/cjs/components/livechatwidget/common/authHelper.js +65 -0
  19. package/lib/cjs/components/livechatwidget/common/createAdapter.js +13 -1
  20. package/lib/cjs/components/livechatwidget/common/createFooter.js +7 -16
  21. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +12 -0
  22. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +31 -30
  23. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +23 -5
  24. package/lib/cjs/components/livechatwidget/common/endChat.js +3 -3
  25. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +5 -2
  26. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +55 -35
  27. package/lib/cjs/components/livechatwidget/common/shareObservable.js +45 -0
  28. package/lib/cjs/components/livechatwidget/common/startChat.js +54 -21
  29. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +139 -57
  30. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  31. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +20 -4
  32. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +4 -1
  33. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +11 -0
  34. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +2 -0
  35. package/lib/cjs/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
  36. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +2 -1
  37. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +10 -0
  38. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +2 -1
  39. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +13 -5
  40. package/lib/cjs/contexts/createReducer.js +10 -2
  41. package/lib/esm/common/Constants.js +2 -0
  42. package/lib/esm/common/storage/default/defaultCacheManager.js +19 -0
  43. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +102 -0
  44. package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +71 -0
  45. package/lib/esm/common/telemetry/TelemetryConstants.js +15 -0
  46. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +29 -13
  47. package/lib/esm/common/utils.js +14 -5
  48. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +4 -4
  49. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -4
  50. package/lib/esm/components/footerstateful/FooterStateful.js +5 -13
  51. package/lib/esm/components/headerstateful/HeaderStateful.js +14 -7
  52. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +34 -0
  53. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +14 -0
  54. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  55. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +29 -0
  56. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +59 -0
  57. package/lib/esm/components/livechatwidget/common/Deferred.js +33 -0
  58. package/lib/esm/components/livechatwidget/common/authHelper.js +50 -0
  59. package/lib/esm/components/livechatwidget/common/createAdapter.js +12 -2
  60. package/lib/esm/components/livechatwidget/common/createFooter.js +4 -15
  61. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +8 -0
  62. package/lib/esm/components/livechatwidget/common/createMarkdown.js +31 -30
  63. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +23 -5
  64. package/lib/esm/components/livechatwidget/common/endChat.js +3 -3
  65. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +5 -2
  66. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +56 -37
  67. package/lib/esm/components/livechatwidget/common/shareObservable.js +38 -0
  68. package/lib/esm/components/livechatwidget/common/startChat.js +50 -22
  69. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +138 -59
  70. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  71. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +15 -2
  72. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -1
  73. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +4 -0
  74. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +2 -0
  75. package/lib/esm/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
  76. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +2 -1
  77. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +3 -0
  78. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +2 -1
  79. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +11 -5
  80. package/lib/esm/contexts/createReducer.js +10 -2
  81. package/lib/types/common/Constants.d.ts +1 -0
  82. package/lib/types/common/storage/default/defaultCacheManager.d.ts +4 -0
  83. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -0
  84. package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -0
  85. package/lib/types/common/telemetry/TelemetryConstants.d.ts +7 -1
  86. package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -1
  87. package/lib/types/common/utils.d.ts +5 -4
  88. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +1 -1
  89. package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +2 -1
  90. package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -0
  91. package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
  92. package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
  93. package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -0
  94. package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
  95. package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -0
  96. package/lib/types/components/livechatwidget/common/authHelper.d.ts +5 -0
  97. package/lib/types/components/livechatwidget/common/endChat.d.ts +1 -1
  98. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -4
  99. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
  100. package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
  101. package/lib/types/components/livechatwidget/common/startChat.d.ts +3 -2
  102. package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +1 -1
  103. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +1 -0
  104. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +1 -0
  105. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
  106. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -0
  107. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
  108. package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +4 -0
  109. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +2 -1
  110. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +2 -0
  111. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +1 -1
  112. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
  113. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
  114. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +2 -0
  115. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -1
  116. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +3 -2
  117. package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +1 -2
  118. package/package.json +5 -4
@@ -2,6 +2,7 @@ import { Stack } from "@fluentui/react";
2
2
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
3
3
  import React, { useEffect } from "react";
4
4
  import { Components } from "botframework-webchat";
5
+ import { BroadcastChannel } from "broadcast-channel";
5
6
  import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
6
7
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
7
8
  import { defaultMiddlewareLocalizedTexts } from "./common/defaultProps/defaultMiddlewareLocalizedTexts";
@@ -12,6 +13,8 @@ import { WebChatActionType } from "./webchatcontroller/enums/WebChatActionType";
12
13
  import { WebChatStoreLoader } from "./webchatcontroller/WebChatStoreLoader";
13
14
  import { Constants } from "../../common/Constants";
14
15
  import { BotMagicCodeStore } from "./webchatcontroller/BotMagicCodeStore";
16
+ import { defaultAdaptiveCardStyles } from "./common/defaultStyles/defaultAdaptiveCardStyles";
17
+ import { defaultReceivedMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles";
15
18
  const broadcastChannelMessageEvent = "message";
16
19
 
17
20
  const postActivity = activity => {
@@ -41,6 +44,8 @@ const createMagicCodeSuccessResponse = signin => {
41
44
  };
42
45
 
43
46
  export const WebChatContainerStateful = props => {
47
+ var _props$adaptiveCardSt, _props$adaptiveCardSt2, _props$renderingMiddl, _props$renderingMiddl2, _props$renderingMiddl3, _props$renderingMiddl4;
48
+
44
49
  const {
45
50
  BasicWebChat
46
51
  } = Components;
@@ -109,10 +114,18 @@ export const WebChatContainerStateful = props => {
109
114
  magicCodeBroadcastChannel.addEventListener(broadcastChannelMessageEvent, eventListener);
110
115
  }, []);
111
116
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
117
+
118
+ .webchat__bubble__content>div#ms_lcw_webchat_adaptive_card {
119
+ background: ${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt = props.adaptiveCardStyles) === null || _props$adaptiveCardSt === void 0 ? void 0 : _props$adaptiveCardSt.background) ?? defaultAdaptiveCardStyles.background};
120
+ }
121
+
122
+ div[class="ac-textBlock"]>p{color:${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt2 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt2 === void 0 ? void 0 : _props$adaptiveCardSt2.color) ?? defaultAdaptiveCardStyles.color};}
123
+
112
124
  .ms_lcw_webchat_received_message img.webchat__markdown__external-link-icon {
113
125
  background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMjggOC4yMjAwM0w1LjAwMzEyIDE2Ljc1MDdDNS4wMDM0MyAxNy45NDE1IDUuOTI4ODUgMTguOTE2MSA3LjA5OTY2IDE4Ljk5NDlMNy4yNTM3MSAxOS4wMDAxTDE1Ljc1MTggMTguOTg4NEMxNi45NDE1IDE4Ljk4NjggMTcuOTE0NSAxOC4wNjIgMTcuOTkzNSAxNi44OTIzTDE3Ljk5ODcgMTYuNzM4NFYxMy4yMzIxQzE3Ljk5ODcgMTIuODE3OSAxOC4zMzQ1IDEyLjQ4MjEgMTguNzQ4NyAxMi40ODIxQzE5LjEyODQgMTIuNDgyMSAxOS40NDIyIDEyLjc2NDMgMTkuNDkxOCAxMy4xMzAzTDE5LjQ5ODcgMTMuMjMyMVYxNi43Mzg0QzE5LjQ5ODcgMTguNzQwNyAxNy45MjkzIDIwLjM3NjkgMTUuOTUyOCAyMC40ODI5TDE1Ljc1MzggMjAuNDg4NEw3LjI1ODI3IDIwLjUwMDFMNy4wNTQ5NSAyMC40OTQ5QzUuMTQyMzkgMjAuMzk1NCAzLjYwODk1IDE4Ljg2MjcgMy41MDgzNyAxNi45NTAyTDMuNTAzMTIgMTYuNzUxMUwzLjUwMDg5IDguMjUyN0wzLjUwNTI5IDguMDUwMkMzLjYwNTM5IDYuMTM3NDkgNS4xMzg2NyA0LjYwNDQ5IDcuMDUwOTYgNC41MDUyN0w3LjI1MDEgNC41MDAxN0gxMC43NDk1SDcuMjUwMVpNMTMuNzQ4MSAzLjAwMTQ2TDIwLjMwMTggMy4wMDE5N0wyMC40MDE0IDMuMDE1NzVMMjAuNTAyMiAzLjA0MzkzTDIwLjU1OSAzLjA2ODAzQzIwLjYxMjIgMy4wOTEyMiAyMC42NjM0IDMuMTIxNjMgMjAuNzExMSAzLjE1ODg1TDIwLjc4MDQgMy4yMjE1NkwyMC44NjQxIDMuMzIwMTRMMjAuOTE4MyAzLjQxMDI1TDIwLjk1NyAzLjUwMDU3TDIwLjk3NjIgMy41NjQ3NkwyMC45ODk4IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
114
126
  height: '.75em';
115
- marginLeft: '.25em';
127
+ marginLeft: '.25em';
128
+ filter:${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl = props.renderingMiddlewareProps) === null || _props$renderingMiddl === void 0 ? void 0 : (_props$renderingMiddl2 = _props$renderingMiddl.receivedMessageAnchorStyles) === null || _props$renderingMiddl2 === void 0 ? void 0 : _props$renderingMiddl2.filter) ?? "none"};
116
129
  }
117
130
  pre {
118
131
  white-space: pre-wrap;
@@ -125,7 +138,7 @@ export const WebChatContainerStateful = props => {
125
138
  .ms_lcw_webchat_received_message a:visited,
126
139
  .ms_lcw_webchat_received_message a:hover,
127
140
  .ms_lcw_webchat_received_message a:active {
128
- color: white;
141
+ color: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl3 = props.renderingMiddlewareProps) === null || _props$renderingMiddl3 === void 0 ? void 0 : (_props$renderingMiddl4 = _props$renderingMiddl3.receivedMessageAnchorStyles) === null || _props$renderingMiddl4 === void 0 ? void 0 : _props$renderingMiddl4.color) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.color)};
129
142
  } `), /*#__PURE__*/React.createElement(Stack, {
130
143
  styles: containerStyles
131
144
  }, /*#__PURE__*/React.createElement(BasicWebChat, null)));
@@ -2,11 +2,13 @@ import MockAdapter from "../mockadapter";
2
2
  import { defaultWebChatStatefulContainerStyles } from "../defaultStyles/defaultWebChatStatefulContainerStyles";
3
3
  import { defaultWebChatStatefulProps } from "./defaultWebChatStatefulProps";
4
4
  import { defaultWebChatStatefulStyles } from "../defaultStyles/defaultWebChatContainerStatefulStyles";
5
+ import { defaultAdaptiveCardStyles } from "../defaultStyles/defaultAdaptiveCardStyles";
5
6
  export const defaultWebChatContainerStatefulProps = {
6
7
  webChatStyles: defaultWebChatStatefulStyles,
7
8
  webChatProps: defaultWebChatStatefulProps,
8
9
  containerStyles: defaultWebChatStatefulContainerStyles,
9
10
  disableNewLineMarkdownSupport: false,
10
11
  disableMarkdownMessageFormatting: false,
11
- directLine: new MockAdapter()
12
+ directLine: new MockAdapter(),
13
+ adaptiveCardStyles: defaultAdaptiveCardStyles
12
14
  };
@@ -0,0 +1,4 @@
1
+ export const defaultAdaptiveCardStyles = {
2
+ background: "white",
3
+ color: "black"
4
+ };
@@ -4,6 +4,8 @@ import MockAdapter from "./mockadapter";
4
4
  export class MockChatSDK {
5
5
  constructor() {
6
6
  _defineProperty(this, "sleep", ms => new Promise(r => setTimeout(r, ms)));
7
+
8
+ _defineProperty(this, "isMockModeOn", true);
7
9
  }
8
10
 
9
11
  async startChat() {
@@ -61,6 +61,7 @@ export const activityStatusMiddleware = () => next => args => {
61
61
  args: args,
62
62
  role: current_role,
63
63
  name: current_name
64
- }));
64
+ })) // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
+ ;
65
66
  }
66
67
  };
@@ -7,7 +7,7 @@ export let LiveChatWidgetActionType;
7
7
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_GLOBAL_DIR"] = 3] = "SET_GLOBAL_DIR";
8
8
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MINIMIZED"] = 4] = "SET_MINIMIZED";
9
9
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_STATE"] = 5] = "SET_CONVERSATION_STATE";
10
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT";
10
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT_ID"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT_ID";
11
11
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 7] = "SET_OUTSIDE_OPERATING_HOURS";
12
12
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 8] = "SET_PRE_CHAT_SURVEY_RESPONSE";
13
13
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 9] = "SET_CUSTOM_CONTEXT";
@@ -34,4 +34,5 @@ export let LiveChatWidgetActionType;
34
34
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 30] = "SET_LIVE_CHAT_CONTEXT";
35
35
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 31] = "SET_BOT_OAUTH_SIGNIN_ID";
36
36
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 32] = "SET_WIDGET_SIZE";
37
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 33] = "SET_WIDGET_INSTANCE_ID";
37
38
  })(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
@@ -1,10 +1,15 @@
1
1
  import { ConversationState } from "./ConversationState";
2
2
  import { defaultMiddlewareLocalizedTexts } from "../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
3
+ import { getWidgetCacheId, isNullOrUndefined } from "../../common/utils";
4
+ import { defaultClientDataStoreProvider } from "../../common/storage/default/defaultClientDataStoreProvider";
3
5
  export const getLiveChatWidgetContextInitialState = props => {
4
- var _props$webChatContain;
6
+ var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$webChatContain;
5
7
 
6
- if (props !== null && props !== void 0 && props.liveChatContextFromCache) {
7
- return props === null || props === void 0 ? void 0 : props.liveChatContextFromCache;
8
+ const widgetCacheId = getWidgetCacheId(props === null || props === void 0 ? void 0 : (_props$chatSDK = props.chatSDK) === null || _props$chatSDK === void 0 ? void 0 : (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) === null || _props$chatSDK$omnich === void 0 ? void 0 : _props$chatSDK$omnich.orgId, props === null || props === void 0 ? void 0 : (_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
9
+ const initialState = defaultClientDataStoreProvider().getData(widgetCacheId, "localStorage");
10
+
11
+ if (!isNullOrUndefined(initialState)) {
12
+ return JSON.parse(initialState);
8
13
  }
9
14
 
10
15
  const LiveChatWidgetContextInitialState = {
@@ -20,12 +25,13 @@ export const getLiveChatWidgetContextInitialState = props => {
20
25
  globalDir: "ltr",
21
26
  liveChatContext: undefined,
22
27
  customContext: undefined,
23
- widgetSize: undefined
28
+ widgetSize: undefined,
29
+ widgetInstanceId: ""
24
30
  },
25
31
  appStates: {
26
32
  conversationState: ConversationState.Closed,
27
33
  isMinimized: false,
28
- previousElementOnFocusBeforeModalOpen: null,
34
+ previousElementIdOnFocusBeforeModalOpen: null,
29
35
  outsideOperatingHours: false,
30
36
  preChatResponseEmail: "",
31
37
  isAudioMuted: null,
@@ -69,10 +69,10 @@ export const createReducer = () => {
69
69
  }
70
70
  };
71
71
 
72
- case LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT:
72
+ case LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT_ID:
73
73
  return { ...state,
74
74
  appStates: { ...state.appStates,
75
- previousElementOnFocusBeforeModalOpen: action.payload
75
+ previousElementIdOnFocusBeforeModalOpen: action.payload
76
76
  }
77
77
  };
78
78
 
@@ -235,6 +235,14 @@ export const createReducer = () => {
235
235
  }
236
236
  };
237
237
 
238
+ case LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID:
239
+ return { ...state,
240
+ domainStates: { ...state.domainStates,
241
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
242
+ widgetInstanceId: action.payload
243
+ }
244
+ };
245
+
238
246
  default:
239
247
  return state;
240
248
  }
@@ -77,6 +77,7 @@ export declare class Constants {
77
77
  static readonly internetConnectionTestUrlText = "Omnichannel Connect Test";
78
78
  static readonly ChatWidgetStateChangedPrefix = "ChatWidgetStateChanged";
79
79
  static readonly PostChatLoadingDurationInMs = 2000;
80
+ static readonly BrowserUnloadConfirmationMessage = "Do you want to leave chat?";
80
81
  }
81
82
  export declare const Regex: {
82
83
  new (): {};
@@ -0,0 +1,4 @@
1
+ export declare class defaultCacheManager {
2
+ static InternalCache: any;
3
+ }
4
+ export declare const registerBroadcastServiceForLocalStorage: (orgid: string, widgetId: string, widgetInstanceId: string) => void;
@@ -0,0 +1,2 @@
1
+ import { IContextDataStore } from "../../interfaces/IContextDataStore";
2
+ export declare const defaultClientDataStoreProvider: () => IContextDataStore;
@@ -0,0 +1,6 @@
1
+ export declare const defaultInitializeInMemoryDataStore: (widgetId: string) => void;
2
+ export declare const inMemoryDataStore: () => {
3
+ getData: (key: string) => any;
4
+ setData: (key: any, data: any) => void;
5
+ removeData: (key: string) => void;
6
+ };
@@ -79,6 +79,8 @@ export declare enum TelemetryEvent {
79
79
  PostChatContextCallSucceed = "PostChatContextCallSucceed",
80
80
  PostChatContextCallFailed = "PostChatContextCallFailed",
81
81
  ParseAdaptiveCardFailed = "ParseAdaptiveCardFailed",
82
+ ClientDataStoreProviderFailed = "ClientDataStoreProviderFailed",
83
+ InMemoryDataStoreFailed = "InMemoryDataStoreFailed",
82
84
  WebChatLoaded = "WebChatLoaded",
83
85
  LCWChatButtonClicked = "LCWChatButtonClicked",
84
86
  LCWChatButtonShow = "LCWChatButtonShow",
@@ -121,6 +123,8 @@ export declare enum TelemetryEvent {
121
123
  SuppressBotMagicCodeFailed = "SuppressBotMagicCodeFailed",
122
124
  GetConversationDetailsException = "GetConversationDetailsException",
123
125
  BrowserUnloadEventStarted = "BrowserUnloadEventStarted",
126
+ GetAuthTokenCalled = "GetAuthTokenCalled",
127
+ ReceivedNullOrEmptyToken = "ReceivedNullOrEmptyToken",
124
128
  ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
125
129
  ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
126
130
  FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
@@ -146,7 +150,9 @@ export declare enum TelemetryEvent {
146
150
  ReconnectChatMinimize = "ReconnectChatMinimize",
147
151
  MessageSent = "MessageSent",
148
152
  MessageReceived = "MessageReceived",
149
- CustomContextReceived = "CustomContextReceived"
153
+ CustomContextReceived = "CustomContextReceived",
154
+ NetworkDisconnected = "NetworkDisconnected",
155
+ NetworkReconnected = "NetworkReconnected"
150
156
  }
151
157
  export interface TelemetryInput {
152
158
  scenarioType: ScenarioType;
@@ -31,7 +31,7 @@ export declare class TelemetryHelper {
31
31
  static addWidgetDataToTelemetry(telemetryConfig: ITelemetryConfig, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
32
32
  static addSessionDataToTelemetry(chatSession: LiveChatContext, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
33
33
  static addConversationDataToTelemetry(liveWorkItem: LiveWorkItemDetails, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
34
- static logCallingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper, callId?: string) => void;
34
+ static logCallingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper, callId?: string | undefined) => void;
35
35
  static logLoadingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
36
36
  static logActionEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
37
37
  static logSDKEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
@@ -18,12 +18,13 @@ export declare const extractPreChatSurveyResponseValues: (preChatSurvey: string,
18
18
  value: string;
19
19
  }[]) => {};
20
20
  export declare const isNullOrUndefined: (obj: any) => boolean;
21
- export declare const isNullOrEmptyString: (s: string) => boolean;
21
+ export declare const isNullOrEmptyString: (s: string | null) => boolean;
22
22
  export declare const newGuid: () => string;
23
23
  export declare const createTimer: () => ITimer;
24
24
  export declare const getDomain: (hostValue: any) => string;
25
- export declare const getWidgetCacheId: (orgId: string, widgetId: string) => string;
26
- export declare const getWidgetEndChatEventName: (orgId: string, widgetId: string) => string;
27
- export declare const getStateFromCache: (orgId: string, widgetId: string) => any;
25
+ export declare const getWidgetCacheId: (orgId: string, widgetId: string, widgetInstanceId: string) => string;
26
+ export declare const getWidgetEndChatEventName: (orgId: string, widgetId: string, widgetInstanceId: string) => string;
27
+ export declare const getStateFromCache: (orgId: string, widgetId: string, widgetInstanceId: string) => any;
28
28
  export declare const isUndefinedOrEmpty: (object: any) => boolean;
29
29
  export declare const addDelayInMs: (ms: number) => Promise<void>;
30
+ export declare const getBroadcastChannelName: (widgetId: string, widgetInstanceId: string) => string;
@@ -1 +1 @@
1
- export declare const downloadTranscript: (chatSDK: any, renderMarkDown?: ((transcriptContent: string) => string) | undefined, bannerMessageOnError?: string, attachmentMessage?: string) => Promise<void>;
1
+ export declare const downloadTranscript: (chatSDK: any, renderMarkDown?: ((transcriptContent: string) => string) | undefined, bannerMessageOnError?: string | undefined, attachmentMessage?: string | undefined) => Promise<void>;
@@ -15,6 +15,7 @@ export interface IHeaderStatefulParams {
15
15
  * @param adapter : The chat adapter for the live chat session
16
16
  * @param skipEndChatSDK : If set to true endchat will skip chatSDK endChat call
17
17
  * @param skipCloseChat : If set to true endchat will skip closing the live chat instance
18
+ * @param postMessageToOtherTab : If set to true endchat will send a message to other tabs(multi-tabs)
18
19
  */
19
- endChat: (adapter: any, skipEndChatSDK?: boolean, skipCloseChat?: boolean) => Promise<void>;
20
+ endChat: (adapter: any, skipEndChatSDK?: boolean, skipCloseChat?: boolean, postMessageToOtherTab?: boolean) => Promise<void>;
20
21
  }
@@ -0,0 +1,14 @@
1
+ export declare class ActivityStreamHandler {
2
+ static restoreDeferred: any;
3
+ static restorePromise: Promise<any>;
4
+ /**
5
+ * Use of a deferred pattern, to hold the execution of the activity.
6
+ *
7
+ * */
8
+ static cork(): void;
9
+ /**
10
+ * Resolve the promise, releasing it to continue with the execution of the activity.
11
+ *
12
+ * */
13
+ static uncork(): void;
14
+ }
@@ -0,0 +1,5 @@
1
+ import { IActivitySubscriber } from "./IActivitySubscriber";
2
+ export declare class DefaultActivitySubscriber implements IActivitySubscriber {
3
+ observer: any;
4
+ next(activity: any): Promise<boolean>;
5
+ }
@@ -0,0 +1,6 @@
1
+ export interface IActivitySubscriber {
2
+ observer: any;
3
+ next(activity: any): Promise<any>;
4
+ applicable?(activity: any): boolean;
5
+ apply?(activity: any): Promise<any>;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { IActivitySubscriber } from "./IActivitySubscriber";
2
+ export declare class PauseActivitySubscriber implements IActivitySubscriber {
3
+ observer: any;
4
+ apply(activity: any): Promise<void>;
5
+ applicable(activity: any): boolean;
6
+ next(activity: any): Promise<any>;
7
+ }
@@ -0,0 +1,7 @@
1
+ export declare class ChatAdapterShim {
2
+ chatAdapter: any;
3
+ activityObserver: any;
4
+ private subscribers;
5
+ constructor(chatAdapter: any);
6
+ addSubscriber(subscriber: any): void;
7
+ }
@@ -0,0 +1,9 @@
1
+ export declare class Deferred<T> {
2
+ private _promise;
3
+ private _resolve;
4
+ private _reject;
5
+ constructor();
6
+ resolve: (value?: any | PromiseLike<T>) => void;
7
+ reject: (value?: any | PromiseLike<T>) => void;
8
+ get promise(): Promise<T>;
9
+ }
@@ -0,0 +1,5 @@
1
+ import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
2
+ declare const getAuthClientFunction: (chatConfig: ChatConfig | undefined) => string | undefined;
3
+ declare const handleAuthentication: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined) => Promise<boolean>;
4
+ declare const removeAuthTokenProvider: (chatSDK: any) => void;
5
+ export { getAuthClientFunction, handleAuthentication, removeAuthTokenProvider };
@@ -3,5 +3,5 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
3
3
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
4
4
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
5
5
  declare const prepareEndChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
6
- declare const endChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, skipEndChatSDK?: boolean, skipCloseChat?: boolean, postMessageToOtherTab?: boolean) => Promise<void>;
6
+ declare const endChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, skipEndChatSDK?: boolean | undefined, skipCloseChat?: boolean | undefined, postMessageToOtherTab?: boolean | undefined) => Promise<void>;
7
7
  export { prepareEndChat, endChat };
@@ -1,10 +1,11 @@
1
1
  import "regenerator-runtime/runtime";
2
+ import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
2
3
  import { Dispatch } from "react";
3
4
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
4
5
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
- declare const getChatReconnectContext: (chatSDK: any, reconnectId?: string) => Promise<any>;
6
+ declare const getChatReconnectContext: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, isReconnectEnabled?: boolean | undefined, reconnectId?: string | undefined) => Promise<any>;
6
7
  declare const getReconnectIdForAuthenticatedChat: (props: ILiveChatWidgetProps, chatSDK: any) => Promise<string | undefined>;
7
- declare const handleUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any, redirectInSameWindow: boolean | undefined) => Promise<void>;
8
- declare const startUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any) => Promise<void>;
9
- declare const handleRedirectUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, reconnectId: string, redirectInSameWindow: boolean | undefined) => Promise<void>;
8
+ declare const handleUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isReconnectEnabled: boolean | undefined, reconnectId: string, initStartChat: any, redirectInSameWindow: boolean | undefined) => Promise<void>;
9
+ declare const startUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isReconnectEnabled: boolean | undefined, reconnectId: string, initStartChat: any) => Promise<void>;
10
+ declare const handleRedirectUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, isReconnectEnabled: boolean | undefined, reconnectId: string, redirectInSameWindow: boolean | undefined) => Promise<void>;
10
11
  export { getChatReconnectContext, getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat, handleRedirectUnauthenticatedReconnectChat };
@@ -1,3 +1,3 @@
1
1
  import { Dispatch } from "react";
2
2
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
- export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean) => Promise<void>;
3
+ export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function shareObservable(observable: any): any;
@@ -1,8 +1,9 @@
1
+ import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
1
2
  import { Dispatch } from "react";
2
3
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
4
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
5
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
6
  declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
6
- declare const setPreChatAndInitiateChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | false, proactiveChatEnablePrechatState?: boolean | false) => Promise<void>;
7
- declare const initStartChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, params?: any, persistedState?: any) => Promise<void>;
7
+ declare const setPreChatAndInitiateChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | undefined, proactiveChatEnablePrechatState?: boolean | undefined) => Promise<void>;
8
+ declare const initStartChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, params?: any, persistedState?: any) => Promise<void>;
8
9
  export { prepareStartChat, initStartChat, setPreChatAndInitiateChat };
@@ -1,4 +1,4 @@
1
1
  import { Dispatch } from "react";
2
2
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
3
  import { IProactiveChatNotificationConfig } from "../../proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig";
4
- export declare const startProactiveChat: (dispatch: Dispatch<ILiveChatWidgetAction>, notificationConfig?: IProactiveChatNotificationConfig, enablePreChat?: boolean, inNewWindow?: boolean) => void;
4
+ export declare const startProactiveChat: (dispatch: Dispatch<ILiveChatWidgetAction>, notificationConfig?: IProactiveChatNotificationConfig | undefined, enablePreChat?: boolean | undefined, inNewWindow?: boolean | undefined) => void;
@@ -14,4 +14,5 @@ export interface ILiveChatWidgetControlProps {
14
14
  hideReconnectChatPane?: boolean;
15
15
  hideWebChatContainer?: boolean;
16
16
  skipChatButtonRendering?: boolean;
17
+ widgetInstanceId?: string | undefined;
17
18
  }
@@ -49,4 +49,5 @@ export interface ILiveChatWidgetProps {
49
49
  webChatContainerProps?: IWebChatContainerStatefulProps;
50
50
  liveChatContextFromCache?: ILiveChatWidgetContext;
51
51
  contextDataStore?: IContextDataStore;
52
+ getAuthToken?: (authClientFunction?: string) => Promise<string | null>;
52
53
  }
@@ -1,6 +1,5 @@
1
1
  import { IReconnectChatPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/reconnectchatpane/interfaces/IReconnectChatPaneProps";
2
2
  export interface IReconnectChatPaneStatefulProps extends IReconnectChatPaneProps {
3
- authClientFunction?: string;
4
3
  isReconnectEnabled?: boolean;
5
4
  reconnectId?: string;
6
5
  redirectInSameWindow?: boolean;
@@ -0,0 +1,2 @@
1
+ import { IAdaptiveCardStyles } from "../../interfaces/IAdaptiveCardStyles";
2
+ export declare const defaultAdaptiveCardStyles: IAdaptiveCardStyles;
@@ -1,6 +1,7 @@
1
1
  import MockAdapter from "./mockadapter";
2
2
  export declare class MockChatSDK {
3
3
  protected sleep: (ms: any) => Promise<unknown>;
4
+ isMockModeOn: boolean;
4
5
  startChat(): Promise<void>;
5
6
  endChat(): null;
6
7
  getChatToken(): null;
@@ -0,0 +1,4 @@
1
+ export interface IAdaptiveCardStyles {
2
+ background?: string;
3
+ color?: string;
4
+ }
@@ -1,5 +1,5 @@
1
- import { IAttachmentProps } from "./IAttachmentProps";
2
1
  import React from "react";
2
+ import { IAttachmentProps } from "./IAttachmentProps";
3
3
  export interface IRenderingMiddlewareProps {
4
4
  timestampDir?: "ltr" | "rtl" | "auto";
5
5
  disableActivityMiddleware?: boolean;
@@ -28,4 +28,5 @@ export interface IRenderingMiddlewareProps {
28
28
  attachmentDownloadIconStyles?: React.CSSProperties;
29
29
  attachmentContentStyles?: React.CSSProperties;
30
30
  attachmentSizeStyles?: React.CSSProperties;
31
+ receivedMessageAnchorStyles?: React.CSSProperties;
31
32
  }
@@ -4,6 +4,7 @@ import { IRenderingMiddlewareProps } from "./IRenderingMiddlewareProps";
4
4
  import { IStyle } from "@fluentui/react";
5
5
  import { IWebChatProps } from "./IWebChatProps";
6
6
  import { StyleOptions } from "botframework-webchat-api";
7
+ import { IAdaptiveCardStyles } from "./IAdaptiveCardStyles";
7
8
  export interface IWebChatContainerStatefulProps {
8
9
  containerStyles?: IStyle;
9
10
  disableNewLineMarkdownSupport?: boolean;
@@ -15,4 +16,5 @@ export interface IWebChatContainerStatefulProps {
15
16
  renderingMiddlewareProps?: IRenderingMiddlewareProps;
16
17
  localizedTexts?: ILiveChatWidgetLocalizedTexts;
17
18
  botMagicCode?: IBotMagicCodeConfig;
19
+ adaptiveCardStyles?: IAdaptiveCardStyles;
18
20
  }
@@ -7,4 +7,4 @@
7
7
  * 3. Decodes certain html characters that came through from chat services
8
8
  ******/
9
9
  import React from "react";
10
- export declare const createActivityMiddleware: (systemMessageStyleProps?: React.CSSProperties, userMessageStyleProps?: React.CSSProperties) => () => (next: any) => (...args: any) => any;
10
+ export declare const createActivityMiddleware: (systemMessageStyleProps?: React.CSSProperties | undefined, userMessageStyleProps?: React.CSSProperties | undefined) => () => (next: any) => (...args: any) => any;
@@ -1 +1 @@
1
- export declare const activityStatusMiddleware: () => (next: any) => (args: any) => JSX.Element | undefined;
1
+ export declare const activityStatusMiddleware: () => (next: any) => (args: any) => any;
@@ -5,4 +5,4 @@
5
5
  * 1. Renders the first two letters of the sender as the profile pic
6
6
  ******/
7
7
  import React from "react";
8
- export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties, avatarTextStyleProps?: React.CSSProperties) => () => (next: any) => (args_0: any) => false | (() => JSX.Element);
8
+ export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties | undefined, avatarTextStyleProps?: React.CSSProperties | undefined) => () => (next: any) => (args_0: any) => false | (() => JSX.Element);
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const defaultReceivedMessageAnchorStyles: React.CSSProperties;
@@ -17,11 +17,12 @@ export interface ILiveChatWidgetContext {
17
17
  liveChatContext: any;
18
18
  customContext: any;
19
19
  widgetSize: any;
20
+ widgetInstanceId: string;
20
21
  };
21
22
  appStates: {
22
23
  conversationState: ConversationState;
23
24
  isMinimized: boolean;
24
- previousElementOnFocusBeforeModalOpen: HTMLElement | null;
25
+ previousElementIdOnFocusBeforeModalOpen: string | null;
25
26
  outsideOperatingHours: boolean;
26
27
  preChatResponseEmail: string;
27
28
  isAudioMuted: boolean | null;
@@ -5,7 +5,7 @@ export declare enum LiveChatWidgetActionType {
5
5
  SET_GLOBAL_DIR = 3,
6
6
  SET_MINIMIZED = 4,
7
7
  SET_CONVERSATION_STATE = 5,
8
- SET_PREVIOUS_FOCUSED_ELEMENT = 6,
8
+ SET_PREVIOUS_FOCUSED_ELEMENT_ID = 6,
9
9
  SET_OUTSIDE_OPERATING_HOURS = 7,
10
10
  SET_PRE_CHAT_SURVEY_RESPONSE = 8,
11
11
  SET_CUSTOM_CONTEXT = 9,
@@ -31,5 +31,6 @@ export declare enum LiveChatWidgetActionType {
31
31
  SET_WIDGET_STATE = 29,
32
32
  SET_LIVE_CHAT_CONTEXT = 30,
33
33
  SET_BOT_OAUTH_SIGNIN_ID = 31,
34
- SET_WIDGET_SIZE = 32
34
+ SET_WIDGET_SIZE = 32,
35
+ SET_WIDGET_INSTANCE_ID = 33
35
36
  }
@@ -1,3 +1,2 @@
1
- import { ILiveChatWidgetContext } from "./ILiveChatWidgetContext";
2
1
  import { ILiveChatWidgetProps } from "../../components/livechatwidget/interfaces/ILiveChatWidgetProps";
3
- export declare const getLiveChatWidgetContextInitialState: (props: ILiveChatWidgetProps) => ILiveChatWidgetContext;
2
+ export declare const getLiveChatWidgetContextInitialState: (props: ILiveChatWidgetProps) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "0.1.0-main.24bd1e6",
3
+ "version": "0.1.0-main.306098a",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -68,18 +68,19 @@
68
68
  "storybook-addon-playwright": "^4.9.2",
69
69
  "terser-webpack-plugin": "^4.2.3",
70
70
  "ts-loader": "^9.2.6",
71
- "typescript": "^4.4.4",
71
+ "typescript": "4.6.4",
72
72
  "webpack": "^4.44.2",
73
73
  "webpack-cli": "^4.9.2"
74
74
  },
75
75
  "dependencies": {
76
76
  "@fluentui/react": "^8.49.1",
77
- "@microsoft/omnichannel-chat-components": "0.1.0-main.b59a07c",
78
- "@microsoft/omnichannel-chat-sdk": "1.0.1-main.077d17c",
77
+ "@microsoft/omnichannel-chat-components": "0.1.0-main.600e05c",
78
+ "@microsoft/omnichannel-chat-sdk": "1.1.1-main.4e1bf63",
79
79
  "abort-controller-es5": "^2.0.1",
80
80
  "dompurify": "^2.3.4",
81
81
  "markdown-it": "^12.3.2",
82
82
  "markdown-it-for-inline": "^0.1.1",
83
+ "md5-typescript": "^1.0.5",
83
84
  "p-defer-es5": "^2.0.1",
84
85
  "slack-markdown-it": "^1.0.5"
85
86
  },