@microsoft/omnichannel-chat-widget 1.8.3-main.ec1328d → 1.8.4-main.4478bbf

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 (185) hide show
  1. package/lib/cjs/common/Constants.js +7 -0
  2. package/lib/cjs/common/facades/FacadeChatSDK.js +6 -0
  3. package/lib/cjs/common/telemetry/AppInsightsEvents.js +4 -5
  4. package/lib/cjs/common/telemetry/TelemetryConstants.js +46 -2
  5. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +26 -10
  6. package/lib/cjs/common/utils/SecureEventBus.js +307 -0
  7. package/lib/cjs/common/utils/dispatchCustomEvent.js +25 -0
  8. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +16 -4
  9. package/lib/cjs/components/citationpanestateful/CitationDim.js +29 -0
  10. package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +199 -0
  11. package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +70 -0
  12. package/lib/cjs/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
  13. package/lib/cjs/components/headerstateful/HeaderStateful.js +8 -2
  14. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +4 -4
  15. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +127 -0
  16. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
  17. package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +15 -0
  18. package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +284 -0
  19. package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
  20. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +18 -0
  21. package/lib/cjs/components/livechatwidget/common/endChat.js +28 -3
  22. package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
  23. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +8 -6
  24. package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
  25. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
  26. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
  27. package/lib/cjs/components/livechatwidget/common/startChat.js +10 -5
  28. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +24 -4
  29. package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +8 -2
  30. package/lib/cjs/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
  31. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +41 -8
  32. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +29 -2
  33. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +12 -3
  34. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +122 -11
  35. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
  36. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
  37. package/lib/cjs/components/webchatcontainerstateful/common/activities/botActivity.js +14 -0
  38. package/lib/cjs/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +17 -0
  39. package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +97 -0
  40. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  41. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +1 -1
  42. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
  43. package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +36 -2
  44. package/lib/cjs/components/webchatcontainerstateful/common/utils/fontUtils.js +28 -0
  45. package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +59 -0
  46. package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
  47. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +122 -0
  48. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +10 -0
  49. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +18 -0
  50. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1038 -0
  51. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +34 -0
  52. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +44 -0
  53. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +16 -2
  54. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  55. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +20 -0
  56. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
  57. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +2 -2
  58. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +59 -0
  59. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +5 -3
  60. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -2
  61. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +97 -30
  62. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
  63. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +46 -45
  64. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -0
  65. package/lib/cjs/contexts/createReducer.js +15 -0
  66. package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
  67. package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
  68. package/lib/cjs/index.js +9 -1
  69. package/lib/cjs/plugins/newMessageEventHandler.js +4 -1
  70. package/lib/esm/common/Constants.js +7 -0
  71. package/lib/esm/common/facades/FacadeChatSDK.js +6 -0
  72. package/lib/esm/common/telemetry/AppInsightsEvents.js +4 -5
  73. package/lib/esm/common/telemetry/TelemetryConstants.js +44 -1
  74. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +27 -11
  75. package/lib/esm/common/utils/SecureEventBus.js +328 -0
  76. package/lib/esm/common/utils/dispatchCustomEvent.js +18 -0
  77. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -5
  78. package/lib/esm/components/citationpanestateful/CitationDim.js +20 -0
  79. package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +188 -0
  80. package/lib/esm/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +61 -0
  81. package/lib/esm/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
  82. package/lib/esm/components/headerstateful/HeaderStateful.js +9 -3
  83. package/lib/esm/components/livechatwidget/LiveChatWidget.js +4 -4
  84. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +120 -0
  85. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
  86. package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +8 -0
  87. package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +277 -0
  88. package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
  89. package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +11 -0
  90. package/lib/esm/components/livechatwidget/common/endChat.js +29 -4
  91. package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
  92. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +8 -6
  93. package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
  94. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
  95. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
  96. package/lib/esm/components/livechatwidget/common/startChat.js +12 -7
  97. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +23 -4
  98. package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
  99. package/lib/esm/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
  100. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +42 -9
  101. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -4
  102. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -4
  103. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +125 -12
  104. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
  105. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
  106. package/lib/esm/components/webchatcontainerstateful/common/activities/botActivity.js +7 -0
  107. package/lib/esm/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +9 -0
  108. package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +90 -0
  109. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  110. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
  111. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
  112. package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +32 -0
  113. package/lib/esm/components/webchatcontainerstateful/common/utils/fontUtils.js +21 -0
  114. package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +51 -0
  115. package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
  116. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +115 -0
  117. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +3 -0
  118. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +10 -0
  119. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1060 -0
  120. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +25 -0
  121. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +42 -0
  122. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +13 -0
  123. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  124. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +13 -0
  125. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
  126. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +1 -1
  127. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +52 -0
  128. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +3 -2
  129. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
  130. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +98 -30
  131. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
  132. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +46 -45
  133. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -0
  134. package/lib/esm/contexts/createReducer.js +15 -0
  135. package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
  136. package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
  137. package/lib/esm/index.js +1 -0
  138. package/lib/esm/plugins/newMessageEventHandler.js +4 -1
  139. package/lib/types/common/Constants.d.ts +6 -0
  140. package/lib/types/common/facades/FacadeChatSDK.d.ts +3 -1
  141. package/lib/types/common/telemetry/TelemetryConstants.d.ts +41 -2
  142. package/lib/types/common/utils/SecureEventBus.d.ts +159 -0
  143. package/lib/types/common/utils/dispatchCustomEvent.d.ts +2 -0
  144. package/lib/types/components/citationpanestateful/CitationDim.d.ts +5 -0
  145. package/lib/types/components/citationpanestateful/CitationPaneStateful.d.ts +4 -0
  146. package/lib/types/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.d.ts +11 -0
  147. package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts +19 -0
  148. package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +1 -1
  149. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +1 -1
  150. package/lib/types/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.d.ts +45 -0
  151. package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +7 -0
  152. package/lib/types/components/livechatwidget/common/PersistentConversationHandler.d.ts +28 -0
  153. package/lib/types/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.d.ts +2 -0
  154. package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +2 -1
  155. package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +1 -0
  156. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +5 -1
  157. package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +5 -3
  158. package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +7 -0
  159. package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +4 -2
  160. package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +5 -0
  161. package/lib/types/components/webchatcontainerstateful/common/activities/botActivity.d.ts +7 -0
  162. package/lib/types/components/webchatcontainerstateful/common/activities/conversationDividerActivity.d.ts +10 -0
  163. package/lib/types/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.d.ts +2 -0
  164. package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +6 -1
  165. package/lib/types/components/webchatcontainerstateful/common/utils/fontUtils.d.ts +10 -0
  166. package/lib/types/components/webchatcontainerstateful/hooks/usePersistentChatHistory.d.ts +4 -0
  167. package/lib/types/components/webchatcontainerstateful/interfaces/ICitation.d.ts +12 -0
  168. package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +7 -0
  169. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.d.ts +3 -0
  170. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.d.ts +4 -0
  171. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +326 -0
  172. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.d.ts +8 -0
  173. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -0
  174. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.d.ts +2 -0
  175. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.d.ts +2 -0
  176. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +3 -4
  177. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +2 -2
  178. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
  179. package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +1 -0
  180. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +46 -45
  181. package/lib/types/index.d.ts +1 -0
  182. package/package.json +3 -3
  183. /package/lib/cjs/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
  184. /package/lib/esm/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
  185. /package/lib/types/components/confirmationpanestateful/interfaces/{IConfirmationPaneLocalizedText.d.ts → IConfirmationPaneLocalizedTexts.d.ts} +0 -0
@@ -7,6 +7,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
7
7
  import { BroadcastEvent, LogLevel, TelemetryEvent } from "../common/telemetry/TelemetryConstants";
8
8
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
9
9
  import { TelemetryHelper } from "../common/telemetry/TelemetryHelper";
10
+ import { Constants } from "../common/Constants";
10
11
  export let FirstResponseLatencyTracker = /*#__PURE__*/function () {
11
12
  function FirstResponseLatencyTracker() {
12
13
  _classCallCheck(this, FirstResponseLatencyTracker);
@@ -127,7 +128,8 @@ export let FirstResponseLatencyTracker = /*#__PURE__*/function () {
127
128
  CustomProperties: {
128
129
  elapsedTime,
129
130
  userMessage: this.startTrackingMessage,
130
- botMessage: this.stopTrackingMessage
131
+ botMessage: this.stopTrackingMessage,
132
+ type: payload === null || payload === void 0 ? void 0 : payload.type
131
133
  }
132
134
  });
133
135
  }
@@ -168,7 +170,9 @@ export let FirstResponseLatencyTracker = /*#__PURE__*/function () {
168
170
  value: function stopClock(payload) {
169
171
  try {
170
172
  if (!payload || !payload.Id) {
171
- throw new Error("Invalid payload");
173
+ if ((payload === null || payload === void 0 ? void 0 : payload.type) !== Constants.typing) {
174
+ throw new Error("Invalid payload");
175
+ }
172
176
  }
173
177
 
174
178
  // Only allow stopTracking if sender is valid and tracking is active
package/lib/esm/index.js CHANGED
@@ -7,5 +7,6 @@ import useFacadeChatSDKStore from "./hooks/useFacadeChatSDKStore";
7
7
  export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
8
8
  export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
9
9
  export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
10
+ export { LiveChatWidgetMockType } from "./components/livechatwidget/interfaces/IMockProps";
10
11
  export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore, useFacadeChatSDKStore };
11
12
  export * from "./components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares";
@@ -78,6 +78,9 @@ export const createOnNewAdapterActivityHandler = (chatId, userId, startTime) =>
78
78
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
79
79
  const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
80
80
  if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
81
+ if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.typing) {
82
+ return true;
83
+ }
81
84
  return false;
82
85
  }
83
86
  return true;
@@ -106,7 +109,7 @@ export const createOnNewAdapterActivityHandler = (chatId, userId, startTime) =>
106
109
  });
107
110
  };
108
111
  const raiseMessageEvent = activity => {
109
- if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message) {
112
+ if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message || (activity === null || activity === void 0 ? void 0 : activity.type) === Constants.typing) {
110
113
  const scenarioType = getScenarioType(activity);
111
114
  switch (scenarioType) {
112
115
  case ScenarioType.UserSendMessageStrategy:
@@ -28,6 +28,9 @@ export declare class Constants {
28
28
  static readonly channelIdKey = "ChannelId-";
29
29
  static readonly ChannelId = "lcw";
30
30
  static readonly CustomerTag = "FromCustomer";
31
+ static persistentChatHistoryMessageTag: string;
32
+ static persistentChatHistoryMessagePullTriggerTag: string;
33
+ static conversationDividerTag: string;
31
34
  static readonly GifContentType = "image/gif";
32
35
  static readonly video = "video";
33
36
  static readonly audio = "audio";
@@ -43,6 +46,7 @@ export declare class Constants {
43
46
  static readonly averageWaitTimeMessageTag = "averagewaittime";
44
47
  static readonly message = "message";
45
48
  static readonly hiddenTag = "Hidden";
49
+ static readonly typing = "typing";
46
50
  static readonly prefixTimestampTag = "ServerMessageTimestamp_";
47
51
  static readonly acsChannel = "ACS_CHANNEL";
48
52
  static readonly publicMessageTag = "public";
@@ -153,6 +157,8 @@ export declare class HtmlAttributeNames {
153
157
  static readonly adaptiveCardTextBlockClassName = "ac-textBlock";
154
158
  static readonly adaptiveCardToggleInputClassName = "ac-toggleInput";
155
159
  static readonly adaptiveCardActionSetClassName = "ac-actionSet";
160
+ static readonly ocwCitationPaneClassName = "ocw-citation-pane";
161
+ static readonly ocwCitationPaneTitle = "Citation";
156
162
  }
157
163
  export declare class WebChatMiddlewareConstants {
158
164
  static readonly nextVisibleActivity = "nextVisibleActivity";
@@ -1,4 +1,4 @@
1
- import { ChatAdapter, ChatSDKMessage, GetAgentAvailabilityResponse, GetLiveChatTranscriptResponse, GetVoiceVideoCallingResponse, IFileInfo, IRawMessage, MaskingRules, OmnichannelChatSDK, VoiceVideoCallingOptionalParams } from "@microsoft/omnichannel-chat-sdk";
1
+ import { ChatAdapter, ChatSDKMessage, GetAgentAvailabilityResponse, GetLiveChatTranscriptResponse, GetPersistentChatHistoryResponse, GetVoiceVideoCallingResponse, IFileInfo, IRawMessage, MaskingRules, OmnichannelChatSDK, VoiceVideoCallingOptionalParams } from "@microsoft/omnichannel-chat-sdk";
2
2
  import { IFacadeChatSDKInput } from "./types/IFacadeChatSDKInput";
3
3
  import ChatAdapterOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/messaging/ChatAdapterOptionalParams";
4
4
  import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
@@ -13,6 +13,7 @@ import GetChatTokenOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core
13
13
  import GetConversationDetailsOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetConversationDetailsOptionalParams";
14
14
  import GetLiveChatConfigOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetLiveChatConfigOptionalParams";
15
15
  import GetLiveChatTranscriptOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetLiveChatTranscriptOptionalParams";
16
+ import GetPersistentChatHistoryOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetPersistentChatHistoryOptionalParams";
16
17
  import IChatToken from "@microsoft/omnichannel-chat-sdk/lib/external/IC3Adapter/IChatToken";
17
18
  import IFileMetadata from "@microsoft/omnichannel-ic3core/lib/model/IFileMetadata";
18
19
  import IMessage from "@microsoft/omnichannel-ic3core/lib/model/IMessage";
@@ -73,4 +74,5 @@ export declare class FacadeChatSDK {
73
74
  getPostChatSurveyContext(): Promise<PostChatContext>;
74
75
  getAgentAvailability(optionalParams?: GetAgentAvailabilityOptionalParams): Promise<GetAgentAvailabilityResponse>;
75
76
  getReconnectableChats(reconnectableChatsParams?: any): Promise<any>;
77
+ fetchPersistentConversationHistory(getPersistentChatHistoryOptionalParams?: GetPersistentChatHistoryOptionalParams): Promise<GetPersistentChatHistoryResponse>;
76
78
  }
@@ -56,9 +56,11 @@ export declare enum BroadcastEvent {
56
56
  SyncMinimize = "SyncMinimize",
57
57
  OnWidgetError = "OnWidgetError",
58
58
  FMLTrackingCompletedAck = "FMLTrackingCompletedAck",
59
- FMLTrackingCompleted = "FMLTrackingCompleted"
59
+ FMLTrackingCompleted = "FMLTrackingCompleted",
60
+ PersistentConversationReset = "PersistentConversationReset"
60
61
  }
61
62
  export declare enum TelemetryEvent {
63
+ FetchPersistentChatHistoryFailed = "FetchPersistentChatHistoryFailed",
62
64
  CallAdded = "CallAdded",
63
65
  LocalVideoStreamAdded = "LocalVideoStreamAdded",
64
66
  LocalVideoStreamRemoved = "LocalVideoStreamRemoved",
@@ -136,6 +138,7 @@ export declare enum TelemetryEvent {
136
138
  EmailTranscriptLoaded = "EmailTranscriptLoaded",
137
139
  OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
138
140
  ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
141
+ CitationPaneLoaded = "CitationPaneLoaded",
139
142
  ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
140
143
  ReconnectChatPaneLoaded = "ReconnectChatPaneLoaded",
141
144
  HeaderCloseButtonClicked = "HeaderCloseButtonClicked",
@@ -262,11 +265,42 @@ export declare enum TelemetryEvent {
262
265
  UXLCWChatButtonLoadingStart = "UXLCWChatButtonLoadingStart",
263
266
  UXLCWChatButtonLoadingCompleted = "UXLCWChatButtonLoadingCompleted",
264
267
  UXConfirmationPaneStart = "UXConfirmationPaneStart",
268
+ UXCitationPaneStart = "UXCitationPaneStart",
265
269
  UXConfirmationPaneCompleted = "UXConfirmationPaneCompleted",
270
+ UXCitationPaneCompleted = "UXCitationPaneCompleted",
266
271
  UXLiveChatWidgetStart = "UXLiveChatWidgetStart",
267
272
  UXLiveChatWidgetCompleted = "UXLiveChatWidgetCompleted",
273
+ UXPostChatPaneStarted = "UXPostChatPaneStarted",
274
+ UXPostChatPaneCompleted = "UXPostChatPaneCompleted",
268
275
  AppInsightsInitialized = "AppInsightsInitialized",
269
- AppInsightsInitFailed = "AppInsightsInitFailed"
276
+ AppInsightsInitFailed = "AppInsightsInitFailed",
277
+ ConvertPersistentChatHistoryMessageToActivityFailed = "ConvertPersistentChatHistoryMessageToActivityFailed",
278
+ UXLCWPersistentChatHistoryInitialized = "UXLCWPersistentChatHistoryInitialized",
279
+ LCWPersistentChatHistoryFetchStarted = "LCWPersistentChatHistoryFetchStarted",
280
+ LCWPersistentChatHistoryFetchCompleted = "LCWPersistentChatHistoryFetchCompleted",
281
+ LCWPersistentChatHistoryFetchFailed = "LCWPersistentChatHistoryFetchFailed",
282
+ LCWWebChatStorePollingStarted = "LCWWebChatStorePollingStarted",
283
+ LCWWebChatStoreReady = "LCWWebChatStoreReady",
284
+ LCWWebChatConnected = "LCWWebChatConnected",
285
+ LCWWebChatDisconnected = "LCWWebChatDisconnected",
286
+ LCWWebChatConnectionCheckFailed = "LCWWebChatConnectionCheckFailed",
287
+ LCWPersistentConversationHandlerInitialized = "LCWPersistentConversationHandlerInitialized",
288
+ LCWPersistentHistoryPullBlocked = "LCWPersistentHistoryPullBlocked",
289
+ LCWPersistentHistoryPullCompleted = "LCWPersistentHistoryPullCompleted",
290
+ LCWLazyLoadInitializationStarted = "LCWLazyLoadInitializationStarted",
291
+ LCWLazyLoadContainerNotFound = "LCWLazyLoadContainerNotFound",
292
+ LCWLazyLoadInitializationCompleted = "LCWLazyLoadInitializationCompleted",
293
+ LCWLazyLoadSessionMetrics = "LCWLazyLoadSessionMetrics",
294
+ LCWLazyLoadTargetElementNotFound = "LCWLazyLoadTargetElementNotFound",
295
+ LCWLazyLoadScrollFailed = "LCWLazyLoadScrollFailed",
296
+ LCWLazyLoadActivityMounted = "LCWLazyLoadActivityMounted",
297
+ LCWLazyLoadReset = "LCWLazyLoadReset",
298
+ LCWLazyLoadNoMoreHistory = "LCWLazyLoadNoMoreHistory",
299
+ LCWLazyLoadDestroyed = "LCWLazyLoadDestroyed",
300
+ SecureEventBusUnauthorizedDispatch = "SecureEventBusUnauthorizedDispatch",
301
+ SecureEventBusListenerError = "SecureEventBusListenerError",
302
+ SecureEventBusDispatchError = "SecureEventBusDispatchError",
303
+ StartChatComplete = "StartChatComplete"
270
304
  }
271
305
  export interface TelemetryInput {
272
306
  scenarioType: ScenarioType;
@@ -277,3 +311,8 @@ export declare class TelemetryConstants {
277
311
  private static map;
278
312
  static mapEventToScenario(eventTypeOrScenarioType: TelemetryEvent): ScenarioType;
279
313
  }
314
+ export declare enum ConversationStage {
315
+ Initialization = "Initialization",
316
+ CSREngagement = "CSR Engagement",
317
+ ConversationEnd = "Conversation End"
318
+ }
@@ -0,0 +1,159 @@
1
+ /**
2
+ * SecureEventBus class implementing the singleton pattern for secure event communication.
3
+ * Provides authentication-based event dispatching to prevent unauthorized external access.
4
+ */
5
+ declare class SecureEventBus {
6
+ private static instance;
7
+ private listeners;
8
+ private readonly authToken;
9
+ private eventCounter;
10
+ /**
11
+ * Private constructor to enforce singleton pattern.
12
+ * Generates a unique authentication token for this session.
13
+ */
14
+ private constructor();
15
+ /**
16
+ * Get the singleton instance of SecureEventBus.
17
+ * Creates a new instance if one doesn't exist.
18
+ *
19
+ * @returns The singleton instance of SecureEventBus
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const eventBus = SecureEventBus.getInstance();
24
+ * ```
25
+ */
26
+ static getInstance(): SecureEventBus;
27
+ /**
28
+ * Generate a cryptographically secure authentication token.
29
+ * Uses crypto.getRandomValues when available, falls back to Math.random.
30
+ *
31
+ * @private
32
+ * @returns A 64-character hexadecimal string representing the authentication token
33
+ */
34
+ private generateAuthToken;
35
+ /**
36
+ * Get the authentication token for this SecureEventBus instance.
37
+ * This token is required for dispatching events and should only be used internally.
38
+ *
39
+ * @returns The authentication token string
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * const eventBus = SecureEventBus.getInstance();
44
+ * const token = eventBus.getAuthToken();
45
+ * eventBus.dispatch('myEvent', { data: 'value' }, token);
46
+ * ```
47
+ */
48
+ getAuthToken(): string;
49
+ /**
50
+ * Dispatch an event with authentication to all registered listeners.
51
+ * Verifies the authentication token before dispatching to prevent unauthorized access.
52
+ *
53
+ * @param eventName - The name of the event to dispatch
54
+ * @param payload - The data to send with the event (optional)
55
+ * @param token - Authentication token (must match the internal token)
56
+ * @returns true if event was successfully dispatched, false if unauthorized or error occurred
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * const eventBus = SecureEventBus.getInstance();
61
+ * const token = eventBus.getAuthToken();
62
+ *
63
+ * // Dispatch with payload
64
+ * const success = eventBus.dispatch('userAction', { action: 'click', target: 'button' }, token);
65
+ *
66
+ * // Dispatch without payload
67
+ * eventBus.dispatch('windowClosed', undefined, token);
68
+ * ```
69
+ */
70
+ dispatch(eventName: string, payload?: any, token?: string): boolean;
71
+ /**
72
+ * Subscribe to an event with a callback function.
73
+ * The callback will be executed whenever the specified event is dispatched.
74
+ *
75
+ * @param eventName - The name of the event to listen for
76
+ * @param callback - The function to execute when the event is fired
77
+ * @returns A function that can be called to unsubscribe from the event
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * const eventBus = SecureEventBus.getInstance();
82
+ *
83
+ * // Subscribe to an event
84
+ * const unsubscribe = eventBus.subscribe('chatMessage', (message) => {
85
+ * console.log('New message:', message.text);
86
+ * console.log('From user:', message.userId);
87
+ * });
88
+ *
89
+ * // Later, unsubscribe
90
+ * unsubscribe();
91
+ * ```
92
+ */
93
+ subscribe(eventName: string, callback: (payload: any) => void): () => void;
94
+ /**
95
+ * Remove all listeners for a specific event.
96
+ * This completely removes the event from the internal listeners map.
97
+ *
98
+ * @param eventName - The name of the event to remove all listeners for
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * const eventBus = SecureEventBus.getInstance();
103
+ *
104
+ * // Remove all listeners for 'chatClosed' event
105
+ * eventBus.removeAllListeners('chatClosed');
106
+ * ```
107
+ */
108
+ removeAllListeners(eventName: string): void;
109
+ /**
110
+ * Clear all listeners for all events.
111
+ * This resets the entire event bus to its initial state.
112
+ * Useful for cleanup during application shutdown or testing.
113
+ *
114
+ * @example
115
+ * ```typescript
116
+ * const eventBus = SecureEventBus.getInstance();
117
+ *
118
+ * // Clear all event listeners
119
+ * eventBus.clear();
120
+ * ```
121
+ */
122
+ clear(): void;
123
+ /**
124
+ * Get the number of listeners for a specific event.
125
+ * Useful for debugging and monitoring purposes.
126
+ *
127
+ * @param eventName - The name of the event to count listeners for
128
+ * @returns The number of listeners registered for the event
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * const eventBus = SecureEventBus.getInstance();
133
+ *
134
+ * // Check how many listeners are registered for 'userAction'
135
+ * const count = eventBus.getListenerCount('userAction');
136
+ * console.log(`${count} listeners registered for userAction`);
137
+ * ```
138
+ */
139
+ getListenerCount(eventName: string): number;
140
+ /**
141
+ * Get all registered event names.
142
+ * Returns an array of event names that currently have listeners.
143
+ * Useful for debugging and monitoring purposes.
144
+ *
145
+ * @returns An array of event names that have registered listeners
146
+ *
147
+ * @example
148
+ * ```typescript
149
+ * const eventBus = SecureEventBus.getInstance();
150
+ *
151
+ * // Get all registered events
152
+ * const events = eventBus.getRegisteredEvents();
153
+ * console.log('Active events:', events);
154
+ * // Output: ['userAction', 'chatMessage', 'windowResize']
155
+ * ```
156
+ */
157
+ getRegisteredEvents(): string[];
158
+ }
159
+ export default SecureEventBus;
@@ -0,0 +1,2 @@
1
+ declare const dispatchCustomEvent: (name: string, payload?: any) => void;
2
+ export default dispatchCustomEvent;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export declare const CitationDim: React.FC<{
3
+ brightness?: string;
4
+ }>;
5
+ export default CitationDim;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { ICitationPaneStatefulProps } from "./interfaces/ICitationPaneStatefulProps";
3
+ export declare const CitationPaneStateful: (props: ICitationPaneStatefulProps) => React.JSX.Element;
4
+ export default CitationPaneStateful;
@@ -0,0 +1,11 @@
1
+ export declare const defaultCitationPaneStyles: {
2
+ pane: React.CSSProperties;
3
+ };
4
+ export declare const defaultCitationContentCSS: (controlId: string) => string;
5
+ declare const _default: {
6
+ defaultCitationPaneStyles: {
7
+ pane: React.CSSProperties;
8
+ };
9
+ defaultCitationContentCSS: (controlId: string) => string;
10
+ };
11
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { ICitationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/citationpane/interfaces/ICitationPaneProps";
2
+ export interface ICitationPaneStatefulProps extends ICitationPaneProps {
3
+ /**
4
+ * id: Optional custom ID for the citation pane container
5
+ */
6
+ id?: string;
7
+ /**
8
+ * title: Optional title for the citation pane
9
+ */
10
+ title?: string;
11
+ /**
12
+ * onClose: Optional callback function called when the citation pane is closed
13
+ */
14
+ onClose?: () => void;
15
+ /**
16
+ * contentHtml: Optional HTML content to display in the citation pane
17
+ */
18
+ contentHtml?: string;
19
+ }
@@ -1,2 +1,2 @@
1
- import { IConfirmationPaneLocalizedTexts } from "../../interfaces/IConfirmationPaneLocalizedText";
1
+ import { IConfirmationPaneLocalizedTexts } from "../../interfaces/IConfirmationPaneLocalizedTexts";
2
2
  export declare const defaultConfirmationPaneLocalizedTexts: IConfirmationPaneLocalizedTexts;
@@ -1,4 +1,4 @@
1
- import { IConfirmationPaneLocalizedTexts } from "./IConfirmationPaneLocalizedText";
1
+ import { IConfirmationPaneLocalizedTexts } from "./IConfirmationPaneLocalizedTexts";
2
2
  import { IConfirmationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/confirmationpane/interfaces/IConfirmationPaneProps";
3
3
  export interface IConfirmationPaneStatefulProps extends IConfirmationPaneProps {
4
4
  /**
@@ -0,0 +1,45 @@
1
+ import { IActivitySubscriber } from "./IActivitySubscriber";
2
+ /**
3
+ * The `AddActivitySubscriber` class is responsible for subscribing to the `ADD_ACTIVITY` event
4
+ * from the `ChatWidgetEvents` and notifying an observer when a new activity is added.
5
+ *
6
+ * This class implements the `IActivitySubscriber` interface and acts as a bridge between
7
+ * the event system and the observer pattern.
8
+ */
9
+ export declare class AddActivitySubscriber implements IActivitySubscriber {
10
+ /**
11
+ * The observer that will be notified when a new activity is added.
12
+ * This is expected to be an object with a `next` method, such as an RxJS `Observer`.
13
+ */
14
+ observer: any;
15
+ /**
16
+ * Set to track processed activity IDs to prevent duplicate processing.
17
+ */
18
+ private processedActivityIds;
19
+ /**
20
+ * Unsubscribe function for the secure event listener
21
+ */
22
+ private unsubscribeFromSecureEvent;
23
+ /**
24
+ * Subscription for PersistentConversationReset event
25
+ */
26
+ private resetEventListener;
27
+ /**
28
+ * Constructor initializes the `AddActivitySubscriber` and sets up a secure event listener
29
+ * for the `ChatWidgetEvents.ADD_ACTIVITY` event. When the event is triggered, it checks
30
+ * if the event payload contains an `activity` and notifies the observer.
31
+ */
32
+ constructor();
33
+ /**
34
+ * The `next` method is a placeholder for processing the activity.
35
+ * This method can be overridden or extended as needed.
36
+ *
37
+ * @param activity - The activity object to process.
38
+ * @returns The activity object (asynchronously).
39
+ */
40
+ next(activity: any): Promise<any>;
41
+ /**
42
+ * Reset the processed activity IDs when a conversation resets
43
+ */
44
+ reset(): void;
45
+ }
@@ -0,0 +1,7 @@
1
+ declare enum ChatWidgetEvents {
2
+ ADD_ACTIVITY = "CHAT_WIDGET/ADD_ACTIVITY",
3
+ FETCH_PERSISTENT_CHAT_HISTORY = "CHAT_WIDGET/FETCH_PERSISTENT_CHAT_HISTORY",
4
+ NO_MORE_HISTORY_AVAILABLE = "CHAT_WIDGET/NO_MORE_HISTORY_AVAILABLE",
5
+ HIDE_LOADING_BANNER = "CHAT_WIDGET/HIDE_LOADING_BANNER"
6
+ }
7
+ export default ChatWidgetEvents;
@@ -0,0 +1,28 @@
1
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
+ import { IPersistentChatHistoryProps } from "../interfaces/IPersistentChatHistoryProps";
3
+ /**
4
+ * Class responsible for handling persistent conversation history
5
+ */
6
+ declare class PersistentConversationHandler {
7
+ private appliedProps;
8
+ private isLastPull;
9
+ private pageToken;
10
+ private facadeChatSDK;
11
+ private lastMessage;
12
+ private count;
13
+ private pageSize;
14
+ private isCurrentlyPulling;
15
+ private pageTokenInTransitSet;
16
+ constructor(facadeChatSDK: FacadeChatSDK, props: IPersistentChatHistoryProps);
17
+ private appliedPropsHandler;
18
+ private resetEventListener;
19
+ reset(): void;
20
+ destroy(): void;
21
+ pullHistory(): Promise<void>;
22
+ private processHistoryMessages;
23
+ private fetchHistoryMessages;
24
+ private shouldPull;
25
+ private processMessageToActivity;
26
+ private createDividerActivity;
27
+ }
28
+ export default PersistentConversationHandler;
@@ -0,0 +1,2 @@
1
+ import { IPersistentChatHistoryProps } from "../../interfaces/IPersistentChatHistoryProps";
2
+ export declare const defaultPersistentChatHistoryProps: IPersistentChatHistoryProps;
@@ -1 +1,2 @@
1
- export declare const getMockChatSDKIfApplicable: (chatSDK: any, type?: string) => any;
1
+ import { IMockProps } from "../interfaces/IMockProps";
2
+ export declare const getMockChatSDKIfApplicable: (chatSDK: any, mockProps?: IMockProps) => any;
@@ -4,4 +4,5 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
4
4
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
5
  export declare const handleStartChatError: (dispatch: Dispatch<ILiveChatWidgetAction>, facadeChatSDK: FacadeChatSDK, props: ILiveChatWidgetProps | undefined, ex: any, isStartChatSuccessful: boolean) => void;
6
6
  export declare const logWidgetLoadComplete: (additionalMessage?: string) => void;
7
+ export declare const logStartChatComplete: (additionalMessage?: string) => void;
7
8
  export declare const logWidgetLoadWithUnexpectedError: (ex: any) => void;
@@ -1,7 +1,9 @@
1
1
  import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
2
+ import { IAppInsightsConfig } from "../../../common/telemetry/interfaces/IAppInsightsConfig";
2
3
  import { IAudioNotificationProps } from "../../footerstateful/audionotificationstateful/interfaces/IAudioNotificationProps";
3
4
  import { ICallingContainerProps } from "@microsoft/omnichannel-chat-components/lib/types/components/callingcontainer/interfaces/ICallingContainerProps";
4
5
  import { IChatButtonProps } from "@microsoft/omnichannel-chat-components/lib/types/components/chatbutton/interfaces/IChatButtonProps";
6
+ import { ICitationPaneStatefulProps } from "../../citationpanestateful/interfaces/ICitationPaneStatefulProps";
5
7
  import { IConfirmationPaneStatefulProps } from "../../confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps";
6
8
  import { IContextDataStore } from "../../../common/interfaces/IContextDataStore";
7
9
  import { IDownloadTranscriptProps } from "../../footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps";
@@ -18,6 +20,7 @@ import { ILoadingPaneProps } from "@microsoft/omnichannel-chat-components/lib/ty
18
20
  import { IMockProps } from "./IMockProps";
19
21
  import { INotificationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/notificationpane/interfaces/INotificationPaneProps";
20
22
  import { IOOOHPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneProps";
23
+ import { IPersistentChatHistoryProps } from "./IPersistentChatHistoryProps";
21
24
  import { IPostChatSurveyPaneStatefulProps } from "../../postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps";
22
25
  import { IPreChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneProps";
23
26
  import { IProactiveChatPaneStatefulProps } from "../../proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps";
@@ -27,7 +30,6 @@ import { IStartChatErrorPaneProps } from "../../startchaterrorpanestateful/inter
27
30
  import { ITelemetryConfig } from "../../../common/telemetry/interfaces/ITelemetryConfig";
28
31
  import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps";
29
32
  import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
30
- import { IAppInsightsConfig } from "../../../common/telemetry/interfaces/IAppInsightsConfig";
31
33
  export interface ILiveChatWidgetProps {
32
34
  audioNotificationProps?: IAudioNotificationProps;
33
35
  callingContainerProps?: ICallingContainerProps;
@@ -51,6 +53,7 @@ export interface ILiveChatWidgetProps {
51
53
  preChatSurveyPaneProps?: IPreChatSurveyPaneProps;
52
54
  proactiveChatPaneProps?: IProactiveChatPaneStatefulProps;
53
55
  reconnectChatPaneProps?: IReconnectChatPaneStatefulProps;
56
+ citationPaneProps?: ICitationPaneStatefulProps;
54
57
  startChatErrorPaneProps?: IStartChatErrorPaneProps;
55
58
  styleProps?: ILiveChatWidgetStyleProps;
56
59
  telemetryConfig: ITelemetryConfig;
@@ -67,4 +70,5 @@ export interface ILiveChatWidgetProps {
67
70
  mock?: IMockProps;
68
71
  featureConfigProps?: IFeatureConfigProps;
69
72
  appInsightsConfig?: IAppInsightsConfig;
73
+ persistentChatHistoryProps?: IPersistentChatHistoryProps;
70
74
  }
@@ -1,8 +1,10 @@
1
- declare enum LiveChatWidgetMockType {
1
+ import { Message } from "botframework-directlinejs";
2
+ export declare enum LiveChatWidgetMockType {
2
3
  Test = "Test",
3
- Demo = "Demo"
4
+ Demo = "Demo",
5
+ Designer = "Designer"
4
6
  }
5
7
  export interface IMockProps {
6
8
  type: LiveChatWidgetMockType;
9
+ mockMessages?: Message[];
7
10
  }
8
- export {};
@@ -0,0 +1,7 @@
1
+ import { IStyle } from "@fluentui/react";
2
+ export interface IPersistentChatHistoryProps {
3
+ persistentChatHistoryEnabled?: boolean;
4
+ pageSize?: number;
5
+ dividerActivityStyle?: IStyle;
6
+ bannerStyle?: IStyle;
7
+ }
@@ -1,8 +1,10 @@
1
1
  import { Message } from "botframework-directlinejs";
2
- import { Observable } from "rxjs/Observable";
3
2
  import MockAdapter from "./mockadapter";
3
+ import { Observable } from "rxjs/Observable";
4
4
  export declare class DesignerChatAdapter extends MockAdapter {
5
- constructor();
5
+ messages?: Message[];
6
+ constructor(messages?: Message[]);
7
+ private processMessage;
6
8
  private postUserActivity;
7
9
  postActivity(activity: Message): Observable<string>;
8
10
  }
@@ -1,7 +1,12 @@
1
1
  import { DesignerChatAdapter } from "./DesignerChatAdapter";
2
+ import { Message } from "botframework-directlinejs";
2
3
  import { MockChatSDK } from "./mockchatsdk";
3
4
  export declare class DesignerChatSDK extends MockChatSDK {
4
5
  constructor();
6
+ /**
7
+ * Create a chat adapter for the designer. Uses this.mockMessages if set.
8
+ */
9
+ mockMessages?: Message[];
5
10
  createChatAdapter(): DesignerChatAdapter;
6
11
  localeId: string;
7
12
  /**
@@ -0,0 +1,7 @@
1
+ declare const botActivity: {
2
+ from: {
3
+ role: string;
4
+ };
5
+ type: string;
6
+ };
7
+ export default botActivity;
@@ -0,0 +1,10 @@
1
+ declare const conversationDividerActivity: {
2
+ channelData: {
3
+ tags: string[];
4
+ };
5
+ from: {
6
+ role: string;
7
+ };
8
+ type: string;
9
+ };
10
+ export default conversationDividerActivity;
@@ -0,0 +1,2 @@
1
+ declare const convertPersistentChatHistoryMessageToActivity: (message: any) => any;
2
+ export default convertPersistentChatHistoryMessageToActivity;
@@ -1,4 +1,4 @@
1
- import { Activity, Attachment, Message, User } from "botframework-directlinejs";
1
+ import { Activity, Attachment, AttachmentLayout, CardAction, Message, User } from "botframework-directlinejs";
2
2
  import { Subscriber } from "rxjs/Subscriber";
3
3
  export declare const customerUser: User;
4
4
  export declare const botUser: User;
@@ -9,3 +9,8 @@ export declare const postAgentMessageActivity: (activityObserver: Subscriber<Act
9
9
  export declare const postSystemMessageActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, delay?: number) => void;
10
10
  export declare const postBotTypingActivity: (activityObserver: Subscriber<Activity> | undefined, delay?: number) => void;
11
11
  export declare const postBotAttachmentActivity: (activityObserver: Subscriber<Activity> | undefined, attachments?: Attachment[], delay?: number) => void;
12
+ export declare const postAgentAttachmentActivity: (activityObserver: Subscriber<Activity> | undefined, attachments?: Attachment[], delay?: number, attachmentLayout?: AttachmentLayout) => void;
13
+ export declare const postAgentSuggestedActionsActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, suggestedActions: {
14
+ actions: CardAction[];
15
+ to?: string[];
16
+ }, delay?: number) => void;