@microsoft/omnichannel-chat-widget 0.1.0-main.1a61ea0 → 0.1.0-main.20562ae

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 (143) hide show
  1. package/README.md +227 -0
  2. package/lib/cjs/assets/Audios.js +8 -0
  3. package/lib/cjs/assets/Icons.js +28 -0
  4. package/lib/cjs/common/Constants.js +6 -0
  5. package/lib/cjs/common/contextDataStore/DataStoreManager.js +14 -0
  6. package/lib/cjs/{assets/assets.d.js → common/interfaces/IContextDataStore.js} +0 -0
  7. package/lib/cjs/common/telemetry/TelemetryConstants.js +33 -3
  8. package/lib/cjs/common/telemetry/TelemetryHelper.js +9 -4
  9. package/lib/cjs/common/telemetry/TelemetryManager.js +18 -8
  10. package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +3 -3
  11. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +14 -1
  12. package/lib/cjs/common/telemetry/loggers/consoleLogger.js +3 -0
  13. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -54
  14. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
  15. package/lib/cjs/components/footerstateful/FooterStateful.js +3 -3
  16. package/lib/cjs/components/headerstateful/HeaderStateful.js +11 -8
  17. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +3 -4
  18. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +38 -33
  19. package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +14 -0
  20. package/lib/cjs/components/livechatwidget/common/endChat.js +102 -50
  21. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +5 -0
  22. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +26 -9
  23. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +23 -7
  24. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +26 -24
  25. package/lib/cjs/components/livechatwidget/common/startChat.js +77 -27
  26. package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +3 -3
  27. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +90 -25
  28. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
  29. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +8 -0
  30. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +8 -0
  31. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +28 -11
  32. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +10 -4
  33. package/lib/cjs/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
  34. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +4 -0
  35. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +51 -73
  36. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +9 -46
  37. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +3 -1
  38. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
  39. package/lib/cjs/contexts/common/ConversationState.js +3 -2
  40. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +15 -13
  41. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +9 -3
  42. package/lib/cjs/contexts/createReducer.js +20 -10
  43. package/lib/cjs/controller/componentController.js +2 -2
  44. package/lib/cjs/plugins/newMessageEventHandler.js +102 -0
  45. package/lib/esm/assets/Audios.js +1 -0
  46. package/lib/esm/assets/Icons.js +11 -0
  47. package/lib/esm/common/Constants.js +6 -0
  48. package/lib/esm/common/contextDataStore/DataStoreManager.js +5 -0
  49. package/lib/esm/common/interfaces/IContextDataStore.js +1 -0
  50. package/lib/esm/common/telemetry/TelemetryConstants.js +29 -2
  51. package/lib/esm/common/telemetry/TelemetryHelper.js +9 -4
  52. package/lib/esm/common/telemetry/TelemetryManager.js +13 -8
  53. package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +3 -3
  54. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +14 -1
  55. package/lib/esm/common/telemetry/loggers/consoleLogger.js +3 -0
  56. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -50
  57. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
  58. package/lib/esm/components/footerstateful/FooterStateful.js +3 -3
  59. package/lib/esm/components/headerstateful/HeaderStateful.js +12 -9
  60. package/lib/esm/components/livechatwidget/common/createMarkdown.js +3 -3
  61. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +36 -33
  62. package/lib/esm/components/livechatwidget/common/disposeTelemetryLoggers.js +4 -0
  63. package/lib/esm/components/livechatwidget/common/endChat.js +100 -47
  64. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -0
  65. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +23 -9
  66. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +20 -3
  67. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +23 -22
  68. package/lib/esm/components/livechatwidget/common/startChat.js +71 -23
  69. package/lib/esm/components/livechatwidget/common/startProactiveChat.js +5 -5
  70. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +84 -25
  71. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
  72. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -0
  73. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +6 -0
  74. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +26 -10
  75. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +9 -5
  76. package/lib/esm/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
  77. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +4 -0
  78. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -12
  79. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -44
  80. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
  81. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
  82. package/lib/esm/contexts/common/ConversationState.js +3 -2
  83. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +15 -13
  84. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +9 -3
  85. package/lib/esm/contexts/createReducer.js +20 -9
  86. package/lib/esm/controller/componentController.js +2 -2
  87. package/lib/esm/plugins/newMessageEventHandler.js +84 -0
  88. package/lib/types/assets/Audios.d.ts +1 -0
  89. package/lib/types/assets/Icons.d.ts +11 -0
  90. package/lib/types/common/Constants.d.ts +3 -0
  91. package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -0
  92. package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -0
  93. package/lib/types/common/telemetry/TelemetryConstants.d.ts +20 -1
  94. package/lib/types/common/telemetry/TelemetryManager.d.ts +1 -0
  95. package/lib/types/common/telemetry/definitions/Contracts.d.ts +3 -0
  96. package/lib/types/common/telemetry/definitions/Payload.d.ts +3 -0
  97. package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +1 -0
  98. package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +2 -0
  99. package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +12 -0
  100. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +5 -2
  101. package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +4 -1
  102. package/lib/types/components/livechatwidget/common/disposeTelemetryLoggers.d.ts +1 -0
  103. package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -1
  104. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
  105. package/lib/types/components/livechatwidget/common/startChat.d.ts +1 -1
  106. package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +2 -1
  107. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
  108. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
  109. package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +1 -1
  110. package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -0
  111. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
  112. package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +1 -1
  113. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +0 -1
  114. package/lib/types/contexts/common/ConversationState.d.ts +3 -2
  115. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -0
  116. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +15 -13
  117. package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
  118. package/package.json +7 -6
  119. package/lib/cjs/assets/audios/newMessageNotification.mp3 +0 -0
  120. package/lib/cjs/assets/icons/archiveIcon.svg +0 -3
  121. package/lib/cjs/assets/icons/audioIcon.svg +0 -6
  122. package/lib/cjs/assets/icons/blankIcon.svg +0 -6
  123. package/lib/cjs/assets/icons/excelIcon.svg +0 -6
  124. package/lib/cjs/assets/icons/imageIcon.svg +0 -6
  125. package/lib/cjs/assets/icons/oneNoteIcon.svg +0 -6
  126. package/lib/cjs/assets/icons/pdfIcon.svg +0 -6
  127. package/lib/cjs/assets/icons/powerpointIcon.svg +0 -6
  128. package/lib/cjs/assets/icons/videoIcon.svg +0 -6
  129. package/lib/cjs/assets/icons/visioIcon.svg +0 -6
  130. package/lib/cjs/assets/icons/wordIcon.svg +0 -6
  131. package/lib/esm/assets/assets.d.js +0 -0
  132. package/lib/esm/assets/audios/newMessageNotification.mp3 +0 -0
  133. package/lib/esm/assets/icons/archiveIcon.svg +0 -3
  134. package/lib/esm/assets/icons/audioIcon.svg +0 -6
  135. package/lib/esm/assets/icons/blankIcon.svg +0 -6
  136. package/lib/esm/assets/icons/excelIcon.svg +0 -6
  137. package/lib/esm/assets/icons/imageIcon.svg +0 -6
  138. package/lib/esm/assets/icons/oneNoteIcon.svg +0 -6
  139. package/lib/esm/assets/icons/pdfIcon.svg +0 -6
  140. package/lib/esm/assets/icons/powerpointIcon.svg +0 -6
  141. package/lib/esm/assets/icons/videoIcon.svg +0 -6
  142. package/lib/esm/assets/icons/visioIcon.svg +0 -6
  143. package/lib/esm/assets/icons/wordIcon.svg +0 -6
@@ -5,59 +5,19 @@
5
5
  * 1. Renders system messages differently, according to Microsoft LiveChatWidget styles
6
6
  * 2. Changes the font size of user messages
7
7
  * 3. Decodes certain html characters that came through from chat services
8
- * 4. Triggers end conversation sequence when the chat thread is deleted
9
8
  ******/
10
- import React from "react";
9
+ import { LogLevel, TelemetryEvent } from "../../../../../common/telemetry/TelemetryConstants";
11
10
  import { Constants } from "../../../../../common/Constants";
12
11
  import { DirectLineActivityType } from "../../enums/DirectLineActivityType";
13
12
  import { DirectLineSenderRole } from "../../enums/DirectLineSenderRole";
14
13
  import { MessageTypes } from "../../enums/MessageType";
14
+ import React from "react";
15
+ import { TelemetryHelper } from "../../../../../common/telemetry/TelemetryHelper";
15
16
  import { defaultSystemMessageStyles } from "./defaultStyles/defaultSystemMessageStyles";
16
17
  import { defaultUserMessageStyles } from "./defaultStyles/defaultUserMessageStyles";
17
18
  import { escapeHtml } from "../../../../../common/utils";
18
- import { TelemetryHelper } from "../../../../../common/telemetry/TelemetryHelper";
19
- import { LogLevel, TelemetryEvent } from "../../../../../common/telemetry/TelemetryConstants";
20
19
  const loggedSystemMessages = new Array(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
20
 
22
- const handleThreadUpdate = channelData => {
23
- var _channelData$properti, _channelData$properti2;
24
-
25
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
26
- Event: TelemetryEvent.IC3ThreadUpdateEventReceived,
27
- Description: "IC3 ThreadUpdateEvent Received"
28
- });
29
-
30
- const postConversationEndedAction = () => {
31
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
32
- Event: TelemetryEvent.ConversationEndedThreadEventReceived,
33
- Description: "Conversation is ended by agent side or by timeout."
34
- });
35
- }; // If the Thread is deleted, then display post conversation survey if enabled.
36
-
37
-
38
- const isThreadDeleted = (channelData === null || channelData === void 0 ? void 0 : (_channelData$properti = channelData.properties) === null || _channelData$properti === void 0 ? void 0 : (_channelData$properti2 = _channelData$properti.isdeleted) === null || _channelData$properti2 === void 0 ? void 0 : _channelData$properti2.toLowerCase()) === Constants.true;
39
-
40
- if (isThreadDeleted) {
41
- postConversationEndedAction();
42
- return;
43
- } //check if customer is still in the thread
44
-
45
-
46
- if (channelData.members && channelData.members.length > 0) {
47
- for (let i = 0; i < channelData.members.length; i++) {
48
- const id = channelData.members[i].id;
49
- const tag = channelData.members[i].tag; // In case of ACS customer is not removed from thread and has "left" tag
50
-
51
- if (id.startsWith(Constants.visitorIdPrefix) && tag !== Constants.left) {
52
- return;
53
- }
54
- }
55
- }
56
-
57
- postConversationEndedAction();
58
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
-
60
-
61
21
  const handleSystemMessage = (next, args, card, systemMessageStyleProps) => {
62
22
  var _card$activity, _card$activity$channe, _card$activity$channe2, _card$activity2, _card$activity2$chann, _card$activity3, _card$activity3$chann, _card$activity3$chann2, _card$activity4, _card$activity4$chann, _card$activity5, _card$activity5$chann, _card$nextVisibleActi, _card$nextVisibleActi2, _card$activity6, _card$activity6$chann, _card$activity7, _card$nextVisibleActi3, _card$activity8;
63
23
 
@@ -108,7 +68,10 @@ export const createActivityMiddleware = (systemMessageStyleProps, userMessageSty
108
68
  var _card$activity$channe3;
109
69
 
110
70
  if (((_card$activity$channe3 = card.activity.channelData) === null || _card$activity$channe3 === void 0 ? void 0 : _card$activity$channe3.type) === MessageTypes.Thread) {
111
- handleThreadUpdate(card.activity.channelData);
71
+ TelemetryHelper.logActionEvent(LogLevel.INFO, {
72
+ Event: TelemetryEvent.IC3ThreadUpdateEventReceived,
73
+ Description: "IC3 ThreadUpdateEvent Received"
74
+ });
112
75
  }
113
76
 
114
77
  return () => false;
@@ -8,6 +8,7 @@
8
8
  import { Constants, MimeTypes, WebChatMiddlewareConstants } from "../../../../../common/Constants";
9
9
  import React from "react";
10
10
  import { getFileAttachmentIconData, isInlineMediaSupported } from "../../../common/utils/FileAttachmentIconManager";
11
+ import { BroadcastEvent } from "../../../../../common/telemetry/TelemetryConstants";
11
12
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
12
13
  import { WebChatActionType } from "../../enums/WebChatActionType";
13
14
  import { defaultAttachmentAdaptiveCardStyles } from "./defaultStyles/defaultAtttachmentAdaptiveCardStyles";
@@ -187,7 +188,7 @@ const createAttachmentMiddleware = enableInlinePlaying => {
187
188
  } catch (e) {
188
189
  const errorData = "Unable to parse the adaptive card format";
189
190
  BroadcastService.postMessage({
190
- eventName: "InvalidAdaptiveCardFormat",
191
+ eventName: BroadcastEvent.InvalidAdaptiveCardFormat,
191
192
  payload: {
192
193
  Message: errorData,
193
194
  ExceptionDetails: e
@@ -17,22 +17,22 @@ const createConversationEndMiddleware = conversationEndCallback => _ref => {
17
17
  var _action$payload;
18
18
 
19
19
  if ((action === null || action === void 0 ? void 0 : action.type) == WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
20
- var _activity$from, _activity$from2, _activity$channelData5, _activity$channelData6;
20
+ var _activity$from, _activity$from2, _activity$channelData7, _activity$channelData8;
21
21
 
22
22
  const activity = action.payload.activity;
23
23
 
24
24
  if (((_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === DirectLineSenderRole.Bot && activity.channelId === "ACS_CHANNEL") {
25
- var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4;
25
+ var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6;
26
26
 
27
27
  // ACS
28
- if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(Constants.systemMessageTag) && (_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && (_activity$channelData4 = _activity$channelData3.tags) !== null && _activity$channelData4 !== void 0 && _activity$channelData4.includes(Constants.agentEndConversationMessageTag)) {
28
+ if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(Constants.systemMessageTag) && ((_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && (_activity$channelData4 = _activity$channelData3.tags) !== null && _activity$channelData4 !== void 0 && _activity$channelData4.includes(Constants.agentEndConversationMessageTag) || (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(Constants.supervisorForceCloseMessageTag))) {
29
29
  conversationEndCallback();
30
30
  }
31
- } else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === DirectLineSenderRole.Channel && ((_activity$channelData5 = activity.channelData) === null || _activity$channelData5 === void 0 ? void 0 : _activity$channelData5.type) === MessageTypes.Thread && (_activity$channelData6 = activity.channelData) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.properties) {
32
- var _activity$channelData7, _activity$channelData8, _activity$channelData9, _activity$channelData10;
31
+ } else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === DirectLineSenderRole.Channel && ((_activity$channelData7 = activity.channelData) === null || _activity$channelData7 === void 0 ? void 0 : _activity$channelData7.type) === MessageTypes.Thread && (_activity$channelData8 = activity.channelData) !== null && _activity$channelData8 !== void 0 && _activity$channelData8.properties) {
32
+ var _activity$channelData9, _activity$channelData10, _activity$channelData11, _activity$channelData12;
33
33
 
34
34
  // IC3
35
- if (((_activity$channelData7 = activity.channelData) === null || _activity$channelData7 === void 0 ? void 0 : (_activity$channelData8 = _activity$channelData7.properties) === null || _activity$channelData8 === void 0 ? void 0 : _activity$channelData8.isdeleted) === Constants.truePascal || !((_activity$channelData9 = activity.channelData) !== null && _activity$channelData9 !== void 0 && (_activity$channelData10 = _activity$channelData9.properties) !== null && _activity$channelData10 !== void 0 && _activity$channelData10.containsExternalEntitiesListeningAll)) {
35
+ if (((_activity$channelData9 = activity.channelData) === null || _activity$channelData9 === void 0 ? void 0 : (_activity$channelData10 = _activity$channelData9.properties) === null || _activity$channelData10 === void 0 ? void 0 : _activity$channelData10.isdeleted) === Constants.truePascal || !((_activity$channelData11 = activity.channelData) !== null && _activity$channelData11 !== void 0 && (_activity$channelData12 = _activity$channelData11.properties) !== null && _activity$channelData12 !== void 0 && _activity$channelData12.containsExternalEntitiesListeningAll)) {
36
36
  conversationEndCallback();
37
37
  }
38
38
  }
@@ -7,6 +7,7 @@ export let ConversationState;
7
7
  ConversationState[ConversationState["OutOfOffice"] = 3] = "OutOfOffice";
8
8
  ConversationState[ConversationState["ProactiveChat"] = 4] = "ProactiveChat";
9
9
  ConversationState[ConversationState["Active"] = 5] = "Active";
10
- ConversationState[ConversationState["Postchat"] = 6] = "Postchat";
11
- ConversationState[ConversationState["Closed"] = 7] = "Closed";
10
+ ConversationState[ConversationState["InActive"] = 6] = "InActive";
11
+ ConversationState[ConversationState["Postchat"] = 7] = "Postchat";
12
+ ConversationState[ConversationState["Closed"] = 8] = "Closed";
12
13
  })(ConversationState || (ConversationState = {}));
@@ -16,17 +16,19 @@ export let LiveChatWidgetActionType;
16
16
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 12] = "SET_AUDIO_NOTIFICATION";
17
17
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 13] = "SET_E2VV_ENABLED";
18
18
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 14] = "SET_POST_CHAT_CONTEXT";
19
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOULD_SHOW_POST_CHAT"] = 15] = "SET_SHOULD_SHOW_POST_CHAT";
20
- LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 16] = "SHOW_CALLING_CONTAINER";
21
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 17] = "SET_INCOMING_CALL";
22
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 18] = "DISABLE_VIDEO_CALL";
23
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 19] = "DISABLE_LOCAL_VIDEO";
24
- LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 20] = "DISABLE_REMOTE_VIDEO";
25
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 21] = "SET_CHAT_TOKEN";
26
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 22] = "SET_SKIP_CHAT_BUTTON_RENDERING";
27
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 23] = "SET_PROACTIVE_CHAT_PARAMS";
28
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 24] = "SET_TELEMETRY_DATA";
29
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 25] = "SET_RECONNECT_ID";
30
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 26] = "SET_UNREAD_MESSAGE_COUNT";
31
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 27] = "SET_FOCUS_CHAT_BUTTON";
19
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 15] = "SHOW_CALLING_CONTAINER";
20
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 16] = "SET_INCOMING_CALL";
21
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 17] = "DISABLE_VIDEO_CALL";
22
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 18] = "DISABLE_LOCAL_VIDEO";
23
+ LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 19] = "DISABLE_REMOTE_VIDEO";
24
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 20] = "SET_CHAT_TOKEN";
25
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SKIP_CHAT_BUTTON_RENDERING"] = 21] = "SET_SKIP_CHAT_BUTTON_RENDERING";
26
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 22] = "SET_PROACTIVE_CHAT_PARAMS";
27
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 23] = "SET_TELEMETRY_DATA";
28
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 24] = "SET_RECONNECT_ID";
29
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 25] = "SET_UNREAD_MESSAGE_COUNT";
30
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 26] = "SET_FOCUS_CHAT_BUTTON";
31
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 27] = "SET_CONVERSATION_ENDED_BY_AGENT";
32
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 28] = "SET_WIDGET_STATE";
33
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 29] = "SET_LIVE_CHAT_CONTEXT";
32
34
  })(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
@@ -3,6 +3,10 @@ import { defaultMiddlewareLocalizedTexts } from "../../components/webchatcontain
3
3
  export const getLiveChatWidgetContextInitialState = props => {
4
4
  var _props$webChatContain;
5
5
 
6
+ if (props !== null && props !== void 0 && props.liveChatContextFromCache) {
7
+ return props === null || props === void 0 ? void 0 : props.liveChatContextFromCache;
8
+ }
9
+
6
10
  const LiveChatWidgetContextInitialState = {
7
11
  domainStates: {
8
12
  liveChatConfig: props.chatConfig,
@@ -13,7 +17,8 @@ export const getLiveChatWidgetContextInitialState = props => {
13
17
  chatToken: undefined,
14
18
  postChatContext: undefined,
15
19
  telemetryInternalData: {},
16
- globalDir: "ltr"
20
+ globalDir: "ltr",
21
+ liveChatContext: undefined
17
22
  },
18
23
  appStates: {
19
24
  conversationState: ConversationState.Closed,
@@ -32,7 +37,8 @@ export const getLiveChatWidgetContextInitialState = props => {
32
37
  proactiveChatInNewWindow: false
33
38
  },
34
39
  e2vvEnabled: false,
35
- unreadMessageCount: 0
40
+ unreadMessageCount: 0,
41
+ conversationEndedByAgent: false
36
42
  },
37
43
  uiStates: {
38
44
  showConfirmationPane: false,
@@ -45,5 +51,5 @@ export const getLiveChatWidgetContextInitialState = props => {
45
51
  focusChatButton: false
46
52
  }
47
53
  };
48
- return props.liveChatContextFromCache ?? LiveChatWidgetContextInitialState;
54
+ return LiveChatWidgetContextInitialState;
49
55
  };
@@ -1,6 +1,5 @@
1
1
  /* eslint-disable indent */
2
2
  import { LiveChatWidgetActionType } from "./common/LiveChatWidgetActionType";
3
- import { TelemetryManager } from "../common/telemetry/TelemetryManager";
4
3
  export const createReducer = () => {
5
4
  const reducer = (state, action) => {
6
5
  var _action$payload, _action$payload2, _action$payload3;
@@ -84,13 +83,6 @@ export const createReducer = () => {
84
83
  }
85
84
  };
86
85
 
87
- case LiveChatWidgetActionType.SET_SHOULD_SHOW_POST_CHAT:
88
- return { ...state,
89
- appStates: { ...state.appStates,
90
- shouldShowPostChat: action.payload
91
- }
92
- };
93
-
94
86
  case LiveChatWidgetActionType.SHOW_CALLING_CONTAINER:
95
87
  return { ...state,
96
88
  uiStates: { ...state.uiStates,
@@ -136,6 +128,7 @@ export const createReducer = () => {
136
128
  case LiveChatWidgetActionType.SET_CHAT_TOKEN:
137
129
  return { ...state,
138
130
  domainStates: { ...state.domainStates,
131
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
139
132
  chatToken: action.payload
140
133
  }
141
134
  };
@@ -187,7 +180,6 @@ export const createReducer = () => {
187
180
  };
188
181
 
189
182
  case LiveChatWidgetActionType.SET_TELEMETRY_DATA:
190
- TelemetryManager.InternalTelemetryData = action.payload;
191
183
  return { ...state,
192
184
  domainStates: { ...state.domainStates,
193
185
  telemetryInternalData: action.payload
@@ -208,6 +200,25 @@ export const createReducer = () => {
208
200
  }
209
201
  };
210
202
 
203
+ case LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT:
204
+ return { ...state,
205
+ domainStates: { ...state.domainStates,
206
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
207
+ liveChatContext: action.payload
208
+ }
209
+ };
210
+
211
+ case LiveChatWidgetActionType.SET_WIDGET_STATE:
212
+ return { ...action.payload
213
+ };
214
+
215
+ case LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT:
216
+ return { ...state,
217
+ appStates: { ...state.appStates,
218
+ conversationEndedByAgent: action.payload
219
+ }
220
+ };
221
+
211
222
  default:
212
223
  return state;
213
224
  }
@@ -9,13 +9,13 @@ export const shouldShowHeader = state => {
9
9
  return !state.appStates.isMinimized && state.appStates.conversationState !== ConversationState.Closed && state.appStates.conversationState !== ConversationState.ProactiveChat;
10
10
  };
11
11
  export const shouldShowFooter = state => {
12
- return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.Active;
12
+ return !state.appStates.isMinimized && (state.appStates.conversationState === ConversationState.Active || state.appStates.conversationState === ConversationState.InActive);
13
13
  };
14
14
  export const shouldShowEmailTranscriptPane = state => {
15
15
  return state.uiStates.showEmailTranscriptPane;
16
16
  };
17
17
  export const shouldShowWebChatContainer = state => {
18
- return state.appStates.conversationState === ConversationState.Active;
18
+ return state.appStates.conversationState === ConversationState.Active || state.appStates.conversationState === ConversationState.InActive;
19
19
  };
20
20
  export const shouldShowLoadingPane = state => {
21
21
  return !state.appStates.isMinimized && !state.appStates.shouldShowPostChat && state.appStates.conversationState === ConversationState.Loading;
@@ -0,0 +1,84 @@
1
+ import { BroadcastEvent, LogLevel, TelemetryEvent } from "../common/telemetry/TelemetryConstants";
2
+ import { BroadcastService } from "@microsoft/omnichannel-chat-components";
3
+ import { Constants } from "../common/Constants";
4
+ import { TelemetryHelper } from "../common/telemetry/TelemetryHelper";
5
+ import { TelemetryManager } from "../common/telemetry/TelemetryManager";
6
+ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
7
+ const onNewAdapterActivityHandler = activity => {
8
+ var _activity$channelData, _activity$channelData2, _activity$channelData3;
9
+
10
+ const isActivityMessage = (activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message;
11
+ const isNotHistoryMessage = isActivityMessage && !(activity !== null && activity !== void 0 && (_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(Constants.historyMessageTag)) && !(activity !== null && activity !== void 0 && (_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && _activity$channelData3.fromList);
12
+
13
+ if (isNotHistoryMessage) {
14
+ raiseMessageEvent(activity);
15
+ }
16
+ };
17
+
18
+ const raiseMessageEvent = activity => {
19
+ if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message) {
20
+ var _TelemetryManager$Int, _activity$from;
21
+
22
+ const payload = {
23
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
+ text: activity === null || activity === void 0 ? void 0 : activity.text,
25
+ id: activity === null || activity === void 0 ? void 0 : activity.id,
26
+ type: activity === null || activity === void 0 ? void 0 : activity.type,
27
+ timestamp: activity === null || activity === void 0 ? void 0 : activity.timestamp,
28
+ chatId: chatId,
29
+ userId: userId,
30
+ conversationId: ((_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.conversationId) ?? "",
31
+ channelData: activity === null || activity === void 0 ? void 0 : activity.channelData,
32
+ messageType: ""
33
+ };
34
+
35
+ if ((activity === null || activity === void 0 ? void 0 : (_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === Constants.userMessageTag) {
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
+ payload.messageType = Constants.userMessageTag;
38
+ const newMessageSentEvent = {
39
+ eventName: BroadcastEvent.NewMessageSent,
40
+ payload: payload
41
+ };
42
+ BroadcastService.postMessage(newMessageSentEvent);
43
+ TelemetryHelper.logActionEvent(LogLevel.INFO, {
44
+ Event: TelemetryEvent.MessageSent,
45
+ Description: "New message sent"
46
+ });
47
+ } else {
48
+ var _activity$channelData4, _activity$channelData5;
49
+
50
+ if (activity !== null && activity !== void 0 && (_activity$channelData4 = activity.channelData) !== null && _activity$channelData4 !== void 0 && (_activity$channelData5 = _activity$channelData4.tags) !== null && _activity$channelData5 !== void 0 && _activity$channelData5.includes(Constants.systemMessageTag)) {
51
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
+ payload.messageType = Constants.systemMessageTag;
53
+ } else {
54
+ var _activity$channelData6, _activity$channelData7, _activity$channelData8;
55
+
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
+ const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text); // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
+
59
+ const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData6 = activity.channelData) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData7 = activity.channelData) === null || _activity$channelData7 === void 0 ? void 0 : (_activity$channelData8 = _activity$channelData7.tags) === null || _activity$channelData8 === void 0 ? void 0 : _activity$channelData8.length) === 0; // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
+
61
+ const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
62
+
63
+ if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
64
+ return;
65
+ }
66
+
67
+ payload.messageType = Constants.userMessageTag;
68
+ }
69
+
70
+ const newMessageReceivedEvent = {
71
+ eventName: BroadcastEvent.NewMessageReceived,
72
+ payload: payload
73
+ };
74
+ BroadcastService.postMessage(newMessageReceivedEvent);
75
+ TelemetryHelper.logActionEvent(LogLevel.INFO, {
76
+ Event: TelemetryEvent.MessageReceived,
77
+ Description: "New message received"
78
+ });
79
+ }
80
+ }
81
+ };
82
+
83
+ return onNewAdapterActivityHandler;
84
+ };
@@ -0,0 +1 @@
1
+ export declare const NewMessageNotificationSoundBase64: string;
@@ -0,0 +1,11 @@
1
+ export declare const ArchiveIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDQ4IDIwNDgiIH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E3dC0xMDMtNDktNzYtODAtMzAtMTEwcTAtNjEgMjktMTA5dDc2LTgwIDEwNC01MCAxMTEtMTdxNTEgMCAxMDAgMTJ0OTIgMzlWMjI2TDc2OCA0NTB2MTIxNHEwIDYyLTI5IDEwOXQtNzYgODAtMTA0IDUwLTExMSAxN3EtNTQgMC0xMTEtMTd0LTEwMy00OS03Ni04MC0zMC0xMTBxMC02MSAyOS0xMDl0NzYtODAgMTA0LTUwIDExMS0xN3E1MSAwIDEwMCAxMnQ5MiAzOVYzNTBMMTc5MiA2MnYxMzQ2eiIgLz4NCjwvc3ZnPg==";
3
+ export declare const BlankIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik01NDkgMGgxMjQzdjE3NTVsLTI5MyAyOTNIMjU2VjI5M0w1NDkgMHptMTExNSAxNzAxVjEyOEg2MDNMMzg0IDM0N3YxNTczaDEwNjFsMjE5LTIxOXoiIC8+DQo8L3N2Zz4=";
4
+ export declare const ExcelIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0yMDQ4IDQ3NXYxNDQ1cTAgMjctMTAgNTB0LTI3IDQwLTQxIDI4LTUwIDEwSDY0MHEtMjcgMC01MC0xMHQtNDAtMjctMjgtNDEtMTAtNTB2LTI1NkgxMTVxLTI0IDAtNDQtOXQtMzctMjUtMjUtMzYtOS00NVY2MjdxMC0yNCA5LTQ0dDI1LTM3IDM2LTI1IDQ1LTloMzk3VjEyOHEwLTI3IDEwLTUwdDI3L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MTQ4LTY3Mkg4MzRsLTgwIDQzOC0xMDAtNDM4SDUwMmwtOTYgNDQwLTg2LTQ0MEgxNzBsMTUwIDY3MnptMzIwIDQ5NmgxMjgwVjUxMmgtMjU2cS0yNyAwLTUwLTEwdC00MC0yNy0yOC00MS0xMC01MFYxMjhINjQwdjM4NGgzOTdxMjQgMCA0NCA5dDM3IDI1IDI1IDM2IDkgNDV2OTIycTAgMjQtOSA0NHQtMjUgMzctMzYgMjUtNDUgOUg2NDB2MjU2em02NDAtMTAyNFY3NjhoNTEydjEyOGgtNTEyem0wIDI1NnYtMTI4aDUxMnYxMjhoLTUxMnptMCAyNTZ2LTEyOGg1MTJ2MTI4aC01MTJ6IiAvPg0KPC9zdmc+";
@@ -1,7 +1,9 @@
1
1
  export declare class Constants {
2
2
  static readonly systemMessageTag = "system";
3
3
  static readonly userMessageTag = "user";
4
+ static readonly historyMessageTag = "history";
4
5
  static readonly agentEndConversationMessageTag = "agentendconversation";
6
+ static readonly supervisorForceCloseMessageTag = "supervisorforceclosedconversation";
5
7
  static readonly receivedMessageClassName = "ms_lcw_webchat_received_message";
6
8
  static readonly sentMessageClassName = "ms_lcw_webchat_sent_message";
7
9
  static readonly webchatChannelId = "webchat";
@@ -13,6 +15,7 @@ export declare class Constants {
13
15
  static readonly true = "true";
14
16
  static readonly false = "false";
15
17
  static readonly maximumUnreadMessageCount = 99;
18
+ static readonly widgetStateDataKey = "LcwChatWidgetState";
16
19
  static readonly channelIdKey = "ChannelId-";
17
20
  static readonly ChannelId = "lcw";
18
21
  static readonly CustomerTag = "FromCustomer";
@@ -0,0 +1,4 @@
1
+ import { IContextDataStore } from "../interfaces/IContextDataStore";
2
+ export declare class DataStoreManager {
3
+ static clientDataStore?: IContextDataStore;
4
+ }
@@ -0,0 +1,14 @@
1
+ export interface IContextDataStore {
2
+ /**
3
+ * getData: Get data from data store
4
+ */
5
+ getData: (key: string, type: string) => any;
6
+ /**
7
+ * setData: Set data to data store
8
+ */
9
+ setData: (key: string, value: string) => void;
10
+ /**
11
+ * removeData: Remove data from data store by key
12
+ */
13
+ removeData?: (key: string) => void;
14
+ }
@@ -17,6 +17,18 @@ export declare enum LogLevel {
17
17
  WARN = "WARN",
18
18
  ERROR = "ERROR"
19
19
  }
20
+ export declare enum BroadcastEvent {
21
+ LoadPostChatSurvey = "LoadPostChatSurvey",
22
+ EndChat = "ChatEnded",
23
+ NewMessageNotification = "NewMessageNotification",
24
+ UnreadMessageCount = "UnreadMessageCount",
25
+ ChatWidgetStateChanged = "ChatWidgetStateChanged",
26
+ ProactiveChatStartChat = "ProactiveChatStartChat",
27
+ ProactiveChatStartPopoutChat = "ProactiveChatStartPopoutChat",
28
+ InvalidAdaptiveCardFormat = "InvalidAdaptiveCardFormat",
29
+ NewMessageSent = "NewMessageSent",
30
+ NewMessageReceived = "NewMessageReceived"
31
+ }
20
32
  export declare enum TelemetryEvent {
21
33
  CallAdded = "CallAdded",
22
34
  LocalVideoStreamAdded = "LocalVideoStreamAdded",
@@ -63,7 +75,9 @@ export declare enum TelemetryEvent {
63
75
  PrechatSurveyLoaded = "PrechatSurveyLoaded",
64
76
  PrechatSubmitted = "PrechatSubmitted",
65
77
  StartChatSDKCall = "StartChatCall",
78
+ StartChatEventRecevied = "StartChatEventReceived",
66
79
  EndChatSDKCall = "EndChatCall",
80
+ EndChatEventReceived = "EndChatEventReceived",
67
81
  OnNewMessageFailed = "OnNewMessageFailed",
68
82
  OnNewMessageAudioNotificationFailed = "OnNewMessageAudioNotificationFailed",
69
83
  DownloadTranscriptResponseNullOrUndefined = "DownloadTranscriptResponseNullOrUndefined",
@@ -77,6 +91,7 @@ export declare enum TelemetryEvent {
77
91
  LoadingPaneLoaded = "LoadingPaneLoaded",
78
92
  EmailTranscriptLoaded = "EmailTranscriptLoaded",
79
93
  OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
94
+ PostChatSurveyLoadingPaneLoaded = "PostChatSurveyLoadingPaneLoaded",
80
95
  PostChatSurveyLoaded = "PostChatSurveyLoaded",
81
96
  ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
82
97
  ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
@@ -99,6 +114,8 @@ export declare enum TelemetryEvent {
99
114
  SendTypingIndicatorSucceeded = "SendTypingIndicatorSucceeded",
100
115
  SendTypingIndicatorFailed = "SendTypingIndicatorFailed",
101
116
  PreChatSurveyStartChatMethodFailed = "PreChatSurveyStartChatMethodFailed",
117
+ ChatAlreadyTriggered = "ChatAlreadyTriggered",
118
+ StartProactiveChatEventReceived = "StartProactiveChatEventReceived",
102
119
  StartProactiveChatMethodFailed = "StartProactiveChatMethodFailed",
103
120
  ProactiveChatAccepted = "ProactiveChatAccepted",
104
121
  ProactiveChatRejected = "ProactiveChatRejected",
@@ -106,7 +123,9 @@ export declare enum TelemetryEvent {
106
123
  ProactiveChatClosed = "ProactiveChatClosed",
107
124
  ReconnectChatContinueConversation = "ReconnectChatContinueConversation",
108
125
  ReconnectChatStartNewConversation = "ReconnectChatStartNewConversation",
109
- ReconnectChatMinimize = "ReconnectChatMinimize"
126
+ ReconnectChatMinimize = "ReconnectChatMinimize",
127
+ MessageSent = "MessageSent",
128
+ MessageReceived = "MessageReceived"
110
129
  }
111
130
  export interface TelemetryInput {
112
131
  scenarioType: ScenarioType;
@@ -8,4 +8,5 @@ export declare class TelemetryTimers {
8
8
  export declare class TelemetryManager {
9
9
  static InternalTelemetryData: IInternalTelemetryData;
10
10
  }
11
+ export declare const disposeLoggers: () => void;
11
12
  export declare const RegisterLoggers: () => void;
@@ -24,6 +24,9 @@ export interface LoadContract extends BaseContract {
24
24
  WidgetState?: string;
25
25
  ChatState?: string;
26
26
  ChatType?: string;
27
+ OCChatSDKVersion: string;
28
+ OCChatWidgetVersion: string;
29
+ OCChatComponentsVersion: string;
27
30
  }
28
31
  export interface ActionsContract extends BaseContract {
29
32
  Event?: string;
@@ -16,6 +16,9 @@ export interface LoadTelemetryData {
16
16
  ChatState?: string;
17
17
  ChatType?: string;
18
18
  ExceptionDetails?: object;
19
+ OCChatSDKVersion?: string;
20
+ OCChatWidgetVersion?: string;
21
+ OCChatComponentsVersion?: string;
19
22
  }
20
23
  export interface MessageProcessingErrorData {
21
24
  Event: string;
@@ -1,4 +1,5 @@
1
1
  import { LogLevel, TelemetryInput } from "../TelemetryConstants";
2
2
  export interface IChatSDKLogger {
3
3
  log: (logLevel: LogLevel, telemetryInput: TelemetryInput) => void;
4
+ dispose: () => void;
4
5
  }
@@ -16,4 +16,6 @@ export interface IInternalTelemetryData {
16
16
  orgUrl?: string;
17
17
  lcwRuntimeId?: string;
18
18
  channelId?: string;
19
+ chatWidgetVersion?: string;
20
+ chatComponentVersion?: string;
19
21
  }
@@ -29,4 +29,16 @@ export interface ITelemetryConfig {
29
29
  * custom loggers list
30
30
  */
31
31
  telemetryLoggers?: IChatSDKLogger[];
32
+ /**
33
+ * Omnichannel chat widget version
34
+ */
35
+ chatWidgetVersion?: string;
36
+ /**
37
+ * Omnichannel chat components version
38
+ */
39
+ chatComponentVersion?: string;
40
+ /**
41
+ * Omnichannel Chat SDK Version
42
+ */
43
+ OCChatSDKVersion?: string;
32
44
  }
@@ -1,3 +1,4 @@
1
+ import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
1
2
  import { IConfirmationPaneStatefulProps } from "./IConfirmationPaneStatefulProps";
2
3
  export interface IConfirmationPaneStatefulParams extends IConfirmationPaneStatefulProps {
3
4
  /**
@@ -5,7 +6,9 @@ export interface IConfirmationPaneStatefulParams extends IConfirmationPaneStatef
5
6
  */
6
7
  setPostChatContext: () => Promise<void>;
7
8
  /**
8
- * endChat: Internal Prop injected for triggering end of a chat using chatSDK
9
+ * prepareEndChat: Internal Prop injected for checking PostChat contexts and trigerring end of chat
10
+ * @param adapter : The chat adapter for the live chat session
11
+ * @param state : The chat state where the conversation is currently in
9
12
  */
10
- endChat: (adapter: any) => Promise<void>;
13
+ prepareEndChat: (adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
11
14
  }
@@ -12,6 +12,9 @@ export interface IHeaderStatefulParams {
12
12
  outOfOfficeHeaderProps?: IHeaderProps;
13
13
  /**
14
14
  * endChat: Internal Prop injected for triggering end of a chat using chatSDK
15
+ * @param adapter : The chat adapter for the live chat session
16
+ * @param skipEndChatSDK : If set to true endchat will skip chatSDK endChat call
17
+ * @param skipCloseChat : If set to true endchat will skip closing the live chat instance
15
18
  */
16
- endChat: (adapter: any) => Promise<void>;
19
+ endChat: (adapter: any, skipEndChatSDK?: boolean, skipCloseChat?: boolean) => Promise<void>;
17
20
  }
@@ -0,0 +1 @@
1
+ export declare const disposeTelemetryLoggers: () => void;
@@ -1,4 +1,7 @@
1
1
  import { Dispatch } from "react";
2
2
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
3
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
4
- export declare const endChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any) => Promise<void>;
4
+ import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
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 | undefined, skipCloseChat?: boolean | undefined) => Promise<void>;
7
+ export { prepareEndChat, endChat };
@@ -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>, loadSurvey: boolean) => Promise<void>;
3
+ export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;