@microsoft/omnichannel-chat-widget 0.1.0-main.a27ec4b → 0.1.0-main.a2e5071

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 (264) hide show
  1. package/lib/cjs/common/Constants.js +17 -168
  2. package/lib/cjs/common/KeyCodes.js +0 -3
  3. package/lib/cjs/common/contextDataStore/DataStoreManager.js +0 -4
  4. package/lib/cjs/common/storage/default/defaultCacheManager.js +0 -10
  5. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +4 -16
  6. package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +2 -10
  7. package/lib/cjs/common/telemetry/TelemetryConstants.js +22 -23
  8. package/lib/cjs/common/telemetry/TelemetryHelper.js +16 -57
  9. package/lib/cjs/common/telemetry/TelemetryManager.js +0 -31
  10. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +0 -2
  11. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +30 -36
  12. package/lib/cjs/common/telemetry/loggers/consoleLogger.js +0 -9
  13. package/lib/cjs/common/utils.js +18 -105
  14. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +8 -46
  15. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +2 -24
  16. package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  17. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -32
  18. package/lib/cjs/components/dimlayer/DimLayer.js +0 -4
  19. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -36
  20. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -8
  21. package/lib/cjs/components/footerstateful/FooterStateful.js +10 -34
  22. package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +0 -6
  23. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +7 -45
  24. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -8
  25. package/lib/cjs/components/headerstateful/HeaderStateful.js +12 -27
  26. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -14
  27. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +2 -9
  28. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +0 -5
  29. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +4 -11
  30. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +11 -19
  31. package/lib/cjs/components/livechatwidget/common/Deferred.js +3 -10
  32. package/lib/cjs/components/livechatwidget/common/authHelper.js +4 -19
  33. package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -13
  34. package/lib/cjs/components/livechatwidget/common/createFooter.js +0 -10
  35. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +2 -14
  36. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +16 -24
  37. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +14 -0
  38. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +41 -35
  39. package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +0 -3
  40. package/lib/cjs/components/livechatwidget/common/endChat.js +30 -33
  41. package/lib/cjs/components/livechatwidget/common/getGeneralStylesForButton.js +0 -6
  42. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +7 -16
  43. package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -8
  44. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +16 -54
  45. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +80 -150
  46. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +4 -17
  47. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +2 -11
  48. package/lib/cjs/components/livechatwidget/common/shareObservable.js +4 -8
  49. package/lib/cjs/components/livechatwidget/common/startChat.js +126 -109
  50. package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +0 -8
  51. package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +2 -11
  52. package/lib/cjs/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  53. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +201 -256
  54. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +4 -17
  55. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +4 -17
  56. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -17
  57. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -23
  58. package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  59. package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +13 -0
  60. package/lib/cjs/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  61. package/lib/cjs/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  62. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -37
  63. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +2 -32
  64. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -24
  65. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +19 -38
  66. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +0 -7
  67. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -6
  68. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +9 -26
  69. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +2 -17
  70. package/lib/cjs/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -24
  71. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +3 -15
  72. package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -8
  73. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +0 -4
  74. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +0 -4
  75. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  76. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  77. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  78. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  79. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  80. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  81. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  82. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  83. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +0 -7
  84. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -5
  85. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +17 -41
  86. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +8 -19
  87. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +23 -60
  88. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +7 -15
  89. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +2 -13
  90. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -16
  91. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +10 -0
  92. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -3
  93. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -3
  94. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +10 -0
  95. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -9
  96. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +2 -30
  97. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +2 -12
  98. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +6 -28
  99. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
  100. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +13 -30
  101. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -9
  102. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -34
  103. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +1 -10
  104. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +1 -12
  105. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -19
  106. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +1 -9
  107. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -9
  108. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -34
  109. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +1 -10
  110. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +7 -11
  111. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +5 -14
  112. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -21
  113. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -12
  114. package/lib/cjs/contexts/ChatAdapterStore.js +0 -2
  115. package/lib/cjs/contexts/ChatContextStore.js +0 -2
  116. package/lib/cjs/contexts/ChatSDKStore.js +0 -2
  117. package/lib/cjs/contexts/common/ConversationState.js +0 -1
  118. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +3 -3
  119. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -11
  120. package/lib/cjs/contexts/createReducer.js +146 -108
  121. package/lib/cjs/controller/componentController.js +2 -31
  122. package/lib/cjs/hooks/useChatAdapterStore.js +0 -6
  123. package/lib/cjs/hooks/useChatContextStore.js +0 -6
  124. package/lib/cjs/hooks/useChatSDKStore.js +0 -6
  125. package/lib/cjs/index.js +0 -5
  126. package/lib/cjs/plugins/newMessageEventHandler.js +15 -36
  127. package/lib/esm/common/Constants.js +14 -155
  128. package/lib/esm/common/KeyCodes.js +0 -2
  129. package/lib/esm/common/contextDataStore/DataStoreManager.js +0 -2
  130. package/lib/esm/common/storage/default/defaultCacheManager.js +0 -3
  131. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +4 -11
  132. package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +2 -3
  133. package/lib/esm/common/telemetry/TelemetryConstants.js +26 -20
  134. package/lib/esm/common/telemetry/TelemetryHelper.js +16 -45
  135. package/lib/esm/common/telemetry/TelemetryManager.js +0 -18
  136. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +28 -24
  137. package/lib/esm/common/telemetry/loggers/consoleLogger.js +0 -5
  138. package/lib/esm/common/utils.js +18 -53
  139. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +8 -17
  140. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +2 -7
  141. package/lib/esm/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  142. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +10 -13
  143. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -15
  144. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -6
  145. package/lib/esm/components/footerstateful/FooterStateful.js +12 -15
  146. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +7 -35
  147. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -6
  148. package/lib/esm/components/headerstateful/HeaderStateful.js +12 -12
  149. package/lib/esm/components/livechatwidget/LiveChatWidget.js +2 -2
  150. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +2 -6
  151. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +0 -3
  152. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +4 -8
  153. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +11 -15
  154. package/lib/esm/components/livechatwidget/common/Deferred.js +3 -8
  155. package/lib/esm/components/livechatwidget/common/authHelper.js +4 -12
  156. package/lib/esm/components/livechatwidget/common/createAdapter.js +4 -6
  157. package/lib/esm/components/livechatwidget/common/createFooter.js +0 -1
  158. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +2 -5
  159. package/lib/esm/components/livechatwidget/common/createMarkdown.js +18 -18
  160. package/lib/esm/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +7 -0
  161. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +43 -22
  162. package/lib/esm/components/livechatwidget/common/endChat.js +32 -18
  163. package/lib/esm/components/livechatwidget/common/getGeneralStylesForButton.js +0 -2
  164. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +9 -11
  165. package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -5
  166. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +18 -19
  167. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +79 -130
  168. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +4 -9
  169. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -3
  170. package/lib/esm/components/livechatwidget/common/shareObservable.js +4 -7
  171. package/lib/esm/components/livechatwidget/common/startChat.js +126 -81
  172. package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +4 -2
  173. package/lib/esm/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  174. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +203 -190
  175. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +4 -5
  176. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +4 -5
  177. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -5
  178. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -11
  179. package/lib/esm/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  180. package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +6 -0
  181. package/lib/esm/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  182. package/lib/esm/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  183. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +11 -21
  184. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +4 -8
  185. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -6
  186. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +17 -11
  187. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
  188. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +9 -18
  189. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +2 -13
  190. package/lib/esm/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -16
  191. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +3 -5
  192. package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -6
  193. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +0 -2
  194. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +0 -2
  195. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  196. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  197. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  198. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  199. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  200. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  201. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  202. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  203. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +2 -5
  204. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -4
  205. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +17 -26
  206. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +10 -11
  207. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +23 -38
  208. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +9 -8
  209. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +2 -9
  210. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -14
  211. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +3 -0
  212. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -1
  213. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -1
  214. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +3 -0
  215. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -7
  216. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +4 -28
  217. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +3 -3
  218. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +7 -14
  219. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +3 -3
  220. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +15 -19
  221. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +5 -8
  222. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -29
  223. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +3 -7
  224. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +3 -8
  225. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -14
  226. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +3 -7
  227. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -7
  228. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +15 -27
  229. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +3 -5
  230. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +9 -9
  231. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +7 -9
  232. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -13
  233. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -5
  234. package/lib/esm/contexts/ChatAdapterStore.js +2 -1
  235. package/lib/esm/contexts/ChatContextStore.js +2 -1
  236. package/lib/esm/contexts/ChatSDKStore.js +2 -1
  237. package/lib/esm/contexts/common/ConversationState.js +0 -1
  238. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +3 -3
  239. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -5
  240. package/lib/esm/contexts/createReducer.js +146 -105
  241. package/lib/esm/controller/componentController.js +3 -2
  242. package/lib/esm/hooks/useChatAdapterStore.js +0 -4
  243. package/lib/esm/hooks/useChatContextStore.js +0 -4
  244. package/lib/esm/hooks/useChatSDKStore.js +0 -4
  245. package/lib/esm/plugins/newMessageEventHandler.js +15 -26
  246. package/lib/types/common/Constants.d.ts +12 -0
  247. package/lib/types/common/telemetry/TelemetryConstants.d.ts +11 -4
  248. package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -4
  249. package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -0
  250. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -7
  251. package/lib/types/components/livechatwidget/common/startChat.d.ts +3 -2
  252. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +1 -1
  253. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +4 -2
  254. package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -0
  255. package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -2
  256. package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -0
  257. package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +4 -0
  258. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
  259. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +2 -0
  260. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -0
  261. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -0
  262. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -2
  263. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +4 -3
  264. package/package.json +3 -3
@@ -1,17 +1,18 @@
1
1
  import MarkdownIt from "markdown-it";
2
2
  import MarkdownItForInline from "markdown-it-for-inline";
3
3
  import { defaultMarkdownLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts";
4
- import { Constants } from "../../../common/Constants"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ import { Constants } from "../../../common/Constants";
5
5
 
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
7
  export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineMarkdownSupport) => {
7
8
  let markdown;
8
-
9
9
  if (!disableMarkdownMessageFormatting) {
10
10
  markdown = new MarkdownIt(Constants.Default, {
11
11
  html: true,
12
12
  linkify: true,
13
13
  breaks: !disableNewLineMarkdownSupport
14
- }); // ToDo: Commenting below usage of plugin until deferred bug is resolved: https://github.com/mayashavin/markdown-it-slack/issues/1
14
+ });
15
+ // ToDo: Commenting below usage of plugin until deferred bug is resolved: https://github.com/mayashavin/markdown-it-slack/issues/1
15
16
  // markdown.use(MarkdownSlack);
16
17
  } else {
17
18
  markdown = new MarkdownIt(Constants.Zero, {
@@ -19,38 +20,37 @@ export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineM
19
20
  linkify: true,
20
21
  breaks: !disableNewLineMarkdownSupport
21
22
  });
22
- markdown.enable(["entity", // Rule to process html entity - {, ¯, "
23
- "linkify", // Rule to replace link-like texts with link nodes
24
- "html_block", // Rule to process html blocks and paragraphs
25
- "html_inline", // Rule to process html tags
23
+ markdown.enable(["entity",
24
+ // Rule to process html entity - {, ¯, "
25
+ "linkify",
26
+ // Rule to replace link-like texts with link nodes
27
+ "html_block",
28
+ // Rule to process html blocks and paragraphs
29
+ "html_inline",
30
+ // Rule to process html tags
26
31
  "newline" // Rule to proceess '\n'
27
32
  ]);
28
- } // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
-
33
+ }
30
34
 
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
36
  markdown.use(MarkdownItForInline, "url_new_win", "link_open", function (tokens, idx, env) {
32
- const targetAttrIndex = tokens[idx].attrIndex(Constants.Target); // Put a transparent pixel instead of the "open in new window" icon, so developers can easily modify the icon in CSS.
33
-
37
+ const targetAttrIndex = tokens[idx].attrIndex(Constants.Target);
38
+ // Put a transparent pixel instead of the "open in new window" icon, so developers can easily modify the icon in CSS.
34
39
  const TRANSPARENT_GIF = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
35
-
36
40
  if (~targetAttrIndex) {
37
41
  tokens[idx].attrs[targetAttrIndex][1] = Constants.Blank;
38
42
  } else {
39
43
  tokens[idx].attrPush([Constants.Target, Constants.Blank]);
40
44
  }
41
-
42
45
  const relAttrIndex = tokens[idx].attrIndex(Constants.TargetRelationship);
43
-
44
46
  if (~relAttrIndex) {
45
47
  tokens[idx].attrs[relAttrIndex][1] = Constants.TargetRelationshipAttributes;
46
48
  } else {
47
49
  tokens[idx].attrPush([Constants.TargetRelationship, Constants.TargetRelationshipAttributes]);
48
-
49
50
  if (!disableMarkdownMessageFormatting) {
50
- tokens[idx].attrPush([Constants.Title, defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT]); // eslint-disable-next-line quotes
51
-
51
+ tokens[idx].attrPush([Constants.Title, defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT]);
52
+ // eslint-disable-next-line quotes
52
53
  const iconTokens = markdown.parseInline(`![${defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT}](${TRANSPARENT_GIF})`, env)[0].children;
53
-
54
54
  if (iconTokens && iconTokens.length > 0) {
55
55
  iconTokens[0].attrJoin("class", Constants.OpenLinkIconCssClass);
56
56
  tokens.splice(idx + 2, 0, ...iconTokens);
@@ -0,0 +1,7 @@
1
+ export const defaultScrollBarProps = {
2
+ width: "7px",
3
+ trackBackgroundColor: "#f1f1f1",
4
+ thumbBackgroundColor: "#888",
5
+ thumbBorderRadius: "10px",
6
+ thumbHoverColor: "#555"
7
+ };
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-empty-function, @typescript-eslint/no-explicit-any */
2
+
2
3
  import { ChatReconnectIconBase64, CloseChatButtonIconBase64, ModernChatIconBase64, ProactiveChatBannerBase64 } from "@microsoft/omnichannel-chat-components";
3
4
  import MockAdapter from "../../../webchatcontainerstateful/common/mockadapter";
4
5
  import { NewMessageNotificationSoundBase64 } from "../../../../assets/Audios";
@@ -10,8 +11,9 @@ import { createAvatarMiddleware } from "../../../webchatcontainerstateful/webcha
10
11
  import { createMarkdown } from "../createMarkdown";
11
12
  import { groupActivitiesMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware";
12
13
  import { typingIndicatorMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware";
13
- import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger"; // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+ import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger";
14
15
 
16
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
17
  export const dummyDefaultProps = {
16
18
  audioNotificationProps: {
17
19
  audioSrc: NewMessageNotificationSoundBase64
@@ -166,24 +168,28 @@ export const dummyDefaultProps = {
166
168
  },
167
169
  audioCallButtonStyleProps: {
168
170
  borderRadius: "50%",
169
- color: "#FFFFFF",
170
171
  backgroundColor: "#008000",
171
172
  lineHeight: "40px",
172
173
  height: "40px",
173
174
  width: "40px",
174
- fontSize: 18
175
+ icon: {
176
+ fontSize: 18,
177
+ color: "#FFFFFF"
178
+ }
175
179
  },
176
180
  audioCallButtonHoverStyleProps: {
177
181
  filter: "brightness(0.8)"
178
182
  },
179
183
  videoCallButtonStyleProps: {
180
184
  borderRadius: "50%",
181
- color: "#FFFFFF",
182
185
  backgroundColor: "#008000",
183
186
  lineHeight: "40px",
184
187
  height: "40px",
185
188
  width: "40px",
186
- fontSize: 18
189
+ icon: {
190
+ fontSize: 18,
191
+ color: "#FFFFFF"
192
+ }
187
193
  },
188
194
  videoCallButtonHoverStyleProps: {
189
195
  filter: "brightness(0.8)"
@@ -194,13 +200,15 @@ export const dummyDefaultProps = {
194
200
  },
195
201
  declineCallButtonStyleProps: {
196
202
  borderRadius: "50%",
197
- color: "#FFFFFF",
198
203
  backgroundColor: "#DC0000",
199
204
  lineHeight: "40px",
200
205
  height: "40px",
201
206
  width: "40px",
202
- fontSize: 18,
203
- marginLeft: "5px"
207
+ marginLeft: "5px",
208
+ icon: {
209
+ fontSize: 18,
210
+ color: "#FFFFFF"
211
+ }
204
212
  },
205
213
  incomingCallTitleStyleProps: {
206
214
  margin: "0 5px",
@@ -465,8 +473,8 @@ export const dummyDefaultProps = {
465
473
  onConfirm: () => {},
466
474
  // Detailed implementation omitted
467
475
  onCancel: () => {} // Detailed implementation omitted
468
-
469
476
  },
477
+
470
478
  styleProps: {
471
479
  generalStyleProps: {
472
480
  backgroundColor: "#FFFFFF",
@@ -571,7 +579,7 @@ export const dummyDefaultProps = {
571
579
  hideProactiveChatPane: false,
572
580
  hideReconnectChatPane: false,
573
581
  hideWebChatContainer: false,
574
- skipChatButtonRendering: false
582
+ hideStartChatButton: false
575
583
  },
576
584
  directLine: new MockAdapter(),
577
585
  downloadTranscriptProps: {
@@ -771,6 +779,7 @@ export const dummyDefaultProps = {
771
779
  },
772
780
  audioNotificationButtonProps: {
773
781
  id: "oc-lcw-footer-audionotification-button",
782
+ type: "icon",
774
783
  ariaLabel: "Turn sound off",
775
784
  toggleAriaLabel: "Turn sound on",
776
785
  iconName: "Volume3",
@@ -796,8 +805,10 @@ export const dummyDefaultProps = {
796
805
  padding: "0 10px 5px 10px"
797
806
  },
798
807
  downloadTranscriptButtonStyleProps: {
799
- color: "blue",
800
- fontSize: 16,
808
+ icon: {
809
+ color: "blue",
810
+ fontSize: 16
811
+ },
801
812
  height: "25px",
802
813
  lineHeight: "25px",
803
814
  width: "25px"
@@ -807,8 +818,10 @@ export const dummyDefaultProps = {
807
818
  backgroundColor: "#C8C8C8"
808
819
  },
809
820
  emailTranscriptButtonStyleProps: {
810
- color: "blue",
811
- fontSize: 16,
821
+ cicon: {
822
+ color: "blue",
823
+ fontSize: 16
824
+ },
812
825
  height: "25px",
813
826
  lineHeight: "25px",
814
827
  width: "25px"
@@ -818,8 +831,10 @@ export const dummyDefaultProps = {
818
831
  backgroundColor: "#C8C8C8"
819
832
  },
820
833
  audioNotificationButtonStyleProps: {
821
- color: "blue",
822
- fontSize: 16,
834
+ icon: {
835
+ color: "blue",
836
+ fontSize: 16
837
+ },
823
838
  height: "25px",
824
839
  lineHeight: "25px",
825
840
  width: "25px"
@@ -1049,8 +1064,8 @@ export const dummyDefaultProps = {
1049
1064
  titleText: "We're Offline",
1050
1065
  subtitleText: "No agents available",
1051
1066
  onClick: () => {} // Detailed implementation omitted
1052
-
1053
1067
  },
1068
+
1054
1069
  styleProps: {
1055
1070
  // ...[Existing chat button style props]
1056
1071
  iconStyleProps: {
@@ -1068,8 +1083,8 @@ export const dummyDefaultProps = {
1068
1083
  text: "We're Offline"
1069
1084
  },
1070
1085
  onMinimizeClick: () => {} // Detailed implementation omitted
1071
-
1072
1086
  },
1087
+
1073
1088
  styleProps: {
1074
1089
  // ...[Existing chat button style props]
1075
1090
  generalStyleProps: {
@@ -1166,7 +1181,8 @@ export const dummyDefaultProps = {
1166
1181
  backgroundColor: "#FFFFFF",
1167
1182
  borderColor: "#F1F1F1"
1168
1183
  }
1169
- }
1184
+ },
1185
+ isCustomerVoiceSurveyCompact: undefined
1170
1186
  },
1171
1187
  proactiveChatPaneProps: {
1172
1188
  componentOverrides: {
@@ -1206,8 +1222,8 @@ export const dummyDefaultProps = {
1206
1222
  onClose: () => {},
1207
1223
  // Detailed implementation omitted
1208
1224
  onStart: () => {} // Detailed implementation omitted
1209
-
1210
1225
  },
1226
+
1211
1227
  styleProps: {
1212
1228
  generalStyleProps: {
1213
1229
  backgroundColor: "rgb(255, 255, 255)",
@@ -1338,8 +1354,8 @@ export const dummyDefaultProps = {
1338
1354
  onStartNewChat: () => {},
1339
1355
  // Detailed implementation omitted
1340
1356
  onMinimize: () => {} // Detailed implementation omitted
1341
-
1342
1357
  },
1358
+
1343
1359
  styleProps: {
1344
1360
  generalStyleProps: {
1345
1361
  backgroundColor: "rgb(255, 255, 255)",
@@ -1424,7 +1440,6 @@ export const dummyDefaultProps = {
1424
1440
  startNewChatButtonClassName: undefined
1425
1441
  }
1426
1442
  },
1427
- isReconnectEnabled: undefined,
1428
1443
  reconnectId: undefined,
1429
1444
  redirectInSameWindow: undefined
1430
1445
  },
@@ -1546,6 +1561,12 @@ export const dummyDefaultProps = {
1546
1561
  lineHeight: "16px",
1547
1562
  padding: "0px 10px 0 10px"
1548
1563
  },
1564
+ userMessageBoxStyles: {
1565
+ maxWidth: "75%"
1566
+ },
1567
+ systemMessageBoxStyles: {
1568
+ maxWidth: "75%"
1569
+ },
1549
1570
  typingIndicatorStyleProps: {
1550
1571
  marginLeft: "10px",
1551
1572
  marginBottom: "5px",
@@ -7,16 +7,34 @@ import { WebChatStoreLoader } from "../../webchatcontainerstateful/webchatcontro
7
7
  import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
8
8
  import { PostChatSurveyMode } from "../../postchatsurveypanestateful/enums/PostChatSurveyMode";
9
9
  import { Constants } from "../../../common/Constants";
10
- import { addDelayInMs, getWidgetEndChatEventName } from "../../../common/utils"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ import { addDelayInMs, getWidgetEndChatEventName } from "../../../common/utils";
11
+ import { getAuthClientFunction, handleAuthentication } from "./authHelper";
11
12
 
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
14
  const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, state) => {
13
15
  var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4, _conversationDetails;
14
-
15
16
  const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
16
- const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode; // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode;
18
+
19
+ //Unable to end chat if token has expired
20
+ if (props.getAuthToken) {
21
+ const authClientFunction = getAuthClientFunction(props.chatConfig);
22
+ if (props.getAuthToken && authClientFunction) {
23
+ // set auth token to chat sdk before start chat
24
+ const authSuccess = await handleAuthentication(chatSDK, props.chatConfig, props.getAuthToken);
25
+ if (!authSuccess) {
26
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
27
+ Event: TelemetryEvent.GetAuthTokenFailed,
28
+ ExceptionDetails: {
29
+ exception: "Unable to get auth token during end chat"
30
+ }
31
+ });
32
+ }
33
+ }
34
+ }
17
35
 
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
37
  let conversationDetails = undefined;
19
-
20
38
  try {
21
39
  conversationDetails = await chatSDK.getConversationDetails();
22
40
  } catch (erorr) {
@@ -27,12 +45,10 @@ const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, disp
27
45
  }
28
46
  });
29
47
  }
30
-
31
48
  if (isPostChatEnabled === "true" && ((_conversationDetails = conversationDetails) === null || _conversationDetails === void 0 ? void 0 : _conversationDetails.canRenderPostChat) === Constants.truePascal) {
32
49
  const skipEndChatSDK = false;
33
50
  const skipCloseChat = true;
34
51
  await endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat, false);
35
-
36
52
  if (postChatSurveyMode === PostChatSurveyMode.Embed) {
37
53
  dispatch({
38
54
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
@@ -49,14 +65,12 @@ const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, disp
49
65
  payload: ConversationState.InActive
50
66
  });
51
67
  }
52
-
53
68
  return;
54
69
  }
55
-
56
70
  await endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, false, false, true);
57
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
-
71
+ };
59
72
 
73
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
74
  const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTab) => {
61
75
  if (!skipEndChatSDK) {
62
76
  try {
@@ -73,9 +87,9 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
73
87
  });
74
88
  postMessageToOtherTab = false;
75
89
  }
76
- } // Need to clear these states immediately when chat ended from OC.
77
-
90
+ }
78
91
 
92
+ // Need to clear these states immediately when chat ended from OC.
79
93
  dispatch({
80
94
  type: LiveChatWidgetActionType.SET_CUSTOM_CONTEXT,
81
95
  payload: undefined
@@ -88,14 +102,17 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
88
102
  type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
89
103
  payload: undefined
90
104
  });
91
-
105
+ dispatch({
106
+ type: LiveChatWidgetActionType.SET_RECONNECT_ID,
107
+ payload: undefined
108
+ });
92
109
  if (!skipCloseChat) {
93
110
  try {
94
111
  var _props$webChatContain;
95
-
96
112
  adapter === null || adapter === void 0 ? void 0 : adapter.end();
97
113
  setAdapter(undefined);
98
- setWebChatStyles({ ...defaultWebChatContainerStatefulProps.webChatStyles,
114
+ setWebChatStyles({
115
+ ...defaultWebChatContainerStatefulProps.webChatStyles,
99
116
  ...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles)
100
117
  });
101
118
  WebChatStoreLoader.store = null;
@@ -127,10 +144,8 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
127
144
  proactiveChatInNewWindow: false
128
145
  }
129
146
  });
130
-
131
147
  if (postMessageToOtherTab) {
132
148
  var _chatSDK$omnichannelC, _chatSDK$omnichannelC2, _props$controlProps;
133
-
134
149
  const endChatEventName = getWidgetEndChatEventName(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC === void 0 ? void 0 : _chatSDK$omnichannelC.orgId, chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC2 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC2 === void 0 ? void 0 : _chatSDK$omnichannelC2.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
135
150
  BroadcastService.postMessage({
136
151
  eventName: endChatEventName
@@ -146,5 +161,4 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
146
161
  }
147
162
  }
148
163
  };
149
-
150
164
  export { prepareEndChat, endChat };
@@ -2,7 +2,6 @@ import { shouldShowChatButton, shouldShowProactiveChatPane } from "../../../cont
2
2
  import { defaultLiveChatWidgetGeneralStyles } from "./defaultStyles/defaultLiveChatWidgetGeneralStyles";
3
3
  export const getGeneralStylesForButton = state => {
4
4
  let generalStylesForButton = defaultLiveChatWidgetGeneralStyles;
5
-
6
5
  if (!shouldShowChatButton(state) && !shouldShowProactiveChatPane(state)) {
7
6
  generalStylesForButton = Object.assign({}, defaultLiveChatWidgetGeneralStyles, {
8
7
  boxShadow: "0px 0px 2px rgba(0, 0, 0, 0.16), 0px 4px 8px rgba(0, 0, 0, 0.12)",
@@ -12,6 +11,5 @@ export const getGeneralStylesForButton = state => {
12
11
  padding: "0.5"
13
12
  });
14
13
  }
15
-
16
14
  return generalStylesForButton;
17
15
  };
@@ -1,6 +1,7 @@
1
1
  import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
2
- import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
+ import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
3
3
 
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
5
  export const initCallingSdk = async (chatSDK, setVoiceVideoCallingSDK) => {
5
6
  try {
6
7
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13,18 +14,15 @@ export const initCallingSdk = async (chatSDK, setVoiceVideoCallingSDK) => {
13
14
  });
14
15
  return true;
15
16
  }
16
-
17
17
  return false;
18
18
  } catch (error) {
19
- if (error !== "Voice and video call is not enabled") {
20
- TelemetryHelper.logCallingEvent(LogLevel.ERROR, {
21
- Event: TelemetryEvent.CallingSDKLoadFailed,
22
- ExceptionDetails: {
23
- exception: error
24
- }
25
- });
26
- }
27
-
19
+ TelemetryHelper.logCallingEvent(LogLevel.ERROR, {
20
+ Event: TelemetryEvent.CallingSDKLoadFailed,
21
+ ExceptionDetails: {
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
+ exception: error.message
24
+ }
25
+ });
28
26
  return false;
29
27
  }
30
28
  };
@@ -1,14 +1,13 @@
1
1
  import { defaultConfirmationPaneLocalizedTexts } from "../../confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts";
2
2
  export const initConfirmationPropsComposer = props => {
3
3
  var _props$confirmationPa, _props$footerProps, _props$footerProps$co, _props$footerProps2, _props$footerProps2$c, _props$confirmationPa2;
4
-
5
- const confirmationPanelocalizedTexts = { ...defaultConfirmationPaneLocalizedTexts,
4
+ const confirmationPanelocalizedTexts = {
5
+ ...defaultConfirmationPaneLocalizedTexts,
6
6
  ...(props === null || props === void 0 ? void 0 : (_props$confirmationPa = props.confirmationPaneProps) === null || _props$confirmationPa === void 0 ? void 0 : _props$confirmationPa.confirmationPaneLocalizedTexts)
7
7
  };
8
8
  let confirmationPaneInputs;
9
9
  const emailTranscriptDisabled = ((_props$footerProps = props.footerProps) === null || _props$footerProps === void 0 ? void 0 : (_props$footerProps$co = _props$footerProps.controlProps) === null || _props$footerProps$co === void 0 ? void 0 : _props$footerProps$co.hideEmailTranscriptButton) ?? false;
10
10
  const downloadTranscriptDisabled = ((_props$footerProps2 = props.footerProps) === null || _props$footerProps2 === void 0 ? void 0 : (_props$footerProps2$c = _props$footerProps2.controlProps) === null || _props$footerProps2$c === void 0 ? void 0 : _props$footerProps2$c.hideDownloadTranscriptButton) ?? false;
11
-
12
11
  if (!emailTranscriptDisabled && !downloadTranscriptDisabled) {
13
12
  confirmationPaneInputs = {
14
13
  title: confirmationPanelocalizedTexts.CLOSE_CONFIRMATION_DIALOG_TITLE_FOR_EMAIL_AND_DOWNLOAD_TRANSCRIPT_ENABLED,
@@ -30,8 +29,8 @@ export const initConfirmationPropsComposer = props => {
30
29
  description: confirmationPanelocalizedTexts.CLOSE_CONFIRMATION_DIALOG_DESCRIPTION_DEFAULT
31
30
  };
32
31
  }
33
-
34
- const confirmationPaneProps = { ...props.confirmationPaneProps,
32
+ const confirmationPaneProps = {
33
+ ...props.confirmationPaneProps,
35
34
  controlProps: {
36
35
  titleText: confirmationPaneInputs.title,
37
36
  subtitleText: confirmationPaneInputs.description,
@@ -29,41 +29,39 @@ import preProcessingMiddleware from "../../webchatcontainerstateful/webchatcontr
29
29
  import sanitizationMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware";
30
30
  import { createCardActionMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware";
31
31
  import createMessageTimeStampMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware";
32
- import { Constants } from "../../../common/Constants"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ import { Constants } from "../../../common/Constants";
33
33
 
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
35
  export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatStyles) => {
35
36
  var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4, _state$domainStates$l8, _state$domainStates$l9, _props$webChatContain7, _props$webChatContain8, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain9, _props$webChatContain10, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain11, _props$webChatContain12, _defaultWebChatContai, _props$webChatContain13, _props$webChatContain14, _props$webChatContain15, _props$webChatContain16, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain17, _props$webChatContain18, _defaultWebChatContai2, _props$webChatContain19, _props$webChatContain20, _defaultWebChatContai3, _props$webChatContain21, _props$webChatContain22;
36
-
37
- const localizedTexts = { ...defaultMiddlewareLocalizedTexts,
37
+ const localizedTexts = {
38
+ ...defaultMiddlewareLocalizedTexts,
38
39
  ...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.localizedTexts)
39
40
  };
40
- const disableNewLineMarkdownSupport = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableNewLineMarkdownSupport) ?? defaultWebChatContainerStatefulProps.disableNewLineMarkdownSupport; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
41
-
41
+ const disableNewLineMarkdownSupport = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableNewLineMarkdownSupport) ?? defaultWebChatContainerStatefulProps.disableNewLineMarkdownSupport;
42
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
42
43
  const markdown = createMarkdown(((_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.disableMarkdownMessageFormatting) ?? defaultWebChatContainerStatefulProps.disableMarkdownMessageFormatting, disableNewLineMarkdownSupport);
43
44
  const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
44
- const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode; // Initialize Web Chat's redux store
45
+ const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode;
45
46
 
47
+ // Initialize Web Chat's redux store
46
48
  let webChatStore = WebChatStoreLoader.store;
47
-
48
49
  if (!webChatStore) {
49
50
  var _state$domainStates$l5, _state$domainStates$l6, _state$domainStates$l7, _props$webChatContain6;
50
-
51
51
  const conversationEndCallback = async () => {
52
52
  var _props$webChatContain4, _props$webChatContain5;
53
-
54
53
  TelemetryHelper.logActionEvent(LogLevel.INFO, {
55
54
  Event: TelemetryEvent.ConversationEndedThreadEventReceived,
56
55
  Description: "Conversation is ended by agent side or by timeout."
57
56
  });
58
-
59
57
  if ((props === null || props === void 0 ? void 0 : (_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : (_props$webChatContain5 = _props$webChatContain4.renderingMiddlewareProps) === null || _props$webChatContain5 === void 0 ? void 0 : _props$webChatContain5.hideSendboxOnConversationEnd) !== false) {
60
58
  setWebChatStyles(styles => {
61
- return { ...styles,
59
+ return {
60
+ ...styles,
62
61
  hideSendBox: true
63
62
  };
64
63
  });
65
64
  }
66
-
67
65
  if (isPostChatEnabled === "true") {
68
66
  if (postChatSurveyMode === PostChatSurveyMode.Embed) {
69
67
  WebChatStoreLoader.store = null;
@@ -92,7 +90,6 @@ export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatS
92
90
  payload: true
93
91
  });
94
92
  }
95
-
96
93
  dispatch({
97
94
  type: LiveChatWidgetActionType.SET_CHAT_TOKEN,
98
95
  payload: undefined
@@ -102,15 +99,17 @@ export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatS
102
99
  payload: undefined
103
100
  });
104
101
  };
105
-
106
- webChatStore = createStore({}, //initial state
107
- preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.allowedFileExtensions, (_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : _state$domainStates$l6.maxUploadFileSize, localizedTexts), channelDataMiddleware, createConversationEndMiddleware(conversationEndCallback), createDataMaskingMiddleware((_state$domainStates$l7 = state.domainStates.liveChatConfig) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.DataMaskingInfo), createMessageTimeStampMiddleware, gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware, createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, // eslint-disable-next-line @typescript-eslint/no-explicit-any
102
+ webChatStore = createStore({},
103
+ //initial state
104
+ preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.allowedFileExtensions, (_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : _state$domainStates$l6.maxUploadFileSize, localizedTexts), channelDataMiddleware, createConversationEndMiddleware(conversationEndCallback), createDataMaskingMiddleware((_state$domainStates$l7 = state.domainStates.liveChatConfig) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.DataMaskingInfo), createMessageTimeStampMiddleware, gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware, createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware,
105
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
108
106
  ...(((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.storeMiddlewares) ?? []));
109
107
  WebChatStoreLoader.store = webChatStore;
110
- } // Initialize the remaining Web Chat props
111
-
108
+ }
112
109
 
113
- const webChatProps = { ...defaultWebChatContainerStatefulProps.webChatProps,
110
+ // Initialize the remaining Web Chat props
111
+ const webChatProps = {
112
+ ...defaultWebChatContainerStatefulProps.webChatProps,
114
113
  dir: state.domainStates.globalDir,
115
114
  locale: changeLanguageCodeFormatForWebChat(getLocaleStringFromId((_state$domainStates$l8 = state.domainStates.liveChatConfig) === null || _state$domainStates$l8 === void 0 ? void 0 : (_state$domainStates$l9 = _state$domainStates$l8.ChatWidgetLanguage) === null || _state$domainStates$l9 === void 0 ? void 0 : _state$domainStates$l9.msdyn_localeid)),
116
115
  store: webChatStore,