@microsoft/omnichannel-chat-widget 1.8.7 → 2.0.0-main.5ebd4eb

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 (251) hide show
  1. package/README.md +52 -5
  2. package/lib/cjs/common/Constants.js +5 -0
  3. package/lib/cjs/common/facades/FacadeChatSDK.js +234 -9
  4. package/lib/cjs/common/telemetry/TelemetryConstants.js +19 -0
  5. package/lib/cjs/common/telemetry/TelemetryManager.js +6 -1
  6. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +2 -3
  7. package/lib/cjs/common/telemetry/sanitizeSasInPayload.js +91 -0
  8. package/lib/cjs/common/utils.js +93 -17
  9. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +16 -6
  10. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +20 -10
  11. package/lib/cjs/components/citationpanestateful/CitationDim.js +2 -3
  12. package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +27 -5
  13. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +23 -3
  14. package/lib/cjs/components/dimlayer/DimLayer.js +1 -3
  15. package/lib/cjs/components/draggable/DraggableChatWidget.js +35 -15
  16. package/lib/cjs/components/draggable/DraggableEventEmitter.js +10 -1
  17. package/lib/cjs/components/draggable/DraggableEventReceiver.js +1 -3
  18. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +54 -17
  19. package/lib/cjs/components/errorboundary/ErrorBoundary.js +4 -12
  20. package/lib/cjs/components/footerstateful/FooterStateful.js +18 -9
  21. package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +2 -4
  22. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +4 -6
  23. package/lib/cjs/components/headerstateful/HeaderStateful.js +24 -12
  24. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +27 -4
  25. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +5 -11
  26. package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +1 -0
  27. package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +11 -4
  28. package/lib/cjs/components/livechatwidget/common/authHelper.js +44 -4
  29. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +98 -5
  30. package/lib/cjs/components/livechatwidget/common/endChat.js +12 -9
  31. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +182 -1
  32. package/lib/cjs/components/livechatwidget/common/recoveryEligibilityTelemetry.js +60 -0
  33. package/lib/cjs/components/livechatwidget/common/startChat.js +31 -14
  34. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +160 -21
  35. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +16 -11
  36. package/lib/cjs/components/notificationpanestateful/NotificationPaneStateful.js +19 -12
  37. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +13 -6
  38. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +28 -5
  39. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +12 -5
  40. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +105 -11
  41. package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +12 -1
  42. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +17 -7
  43. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +16 -7
  44. package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +10 -2
  45. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +154 -29
  46. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +10 -0
  47. package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +115 -10
  48. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -0
  49. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +2 -1
  50. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +3 -1
  51. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +2 -2
  52. package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +3 -1
  53. package/lib/cjs/components/webchatcontainerstateful/common/utils/citationA11y.js +195 -0
  54. package/lib/cjs/components/webchatcontainerstateful/interfaces/IWebChatAction.js +17 -1
  55. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +27 -4
  56. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +1 -3
  57. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +1 -3
  58. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +180 -190
  59. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +3 -5
  60. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +22 -6
  61. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +12 -23
  62. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +27 -35
  63. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.js +199 -0
  64. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +29 -15
  65. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +5 -12
  66. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +1 -1
  67. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  68. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +8 -3
  69. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +8 -1
  70. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +5 -8
  71. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.js +6 -4
  72. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +6 -4
  73. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +14 -12
  74. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +16 -14
  75. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +18 -30
  76. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +10 -2
  77. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +1 -3
  78. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +16 -12
  79. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +6 -6
  80. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.js +83 -0
  81. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +36 -8
  82. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +5 -1
  83. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +10 -7
  84. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +4 -0
  85. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -4
  86. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +5 -1
  87. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +7 -7
  88. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +10 -14
  89. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +6 -4
  90. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -10
  91. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +57 -11
  92. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +6 -4
  93. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +25 -30
  94. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +10 -7
  95. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +6 -4
  96. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +55 -1
  97. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +2 -4
  98. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +5 -0
  99. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +17 -1
  100. package/lib/cjs/contexts/createReducer.js +15 -0
  101. package/lib/cjs/controller/componentController.js +13 -1
  102. package/lib/cjs/hooks/useWindowDimensions.js +13 -5
  103. package/lib/cjs/package.json +1 -0
  104. package/lib/cjs/plugins/createChatTranscript.js +3 -4
  105. package/lib/cjs/plugins/newMessageEventHandler.js +20 -3
  106. package/lib/esm/common/Constants.js +5 -0
  107. package/lib/esm/common/facades/FacadeChatSDK.js +235 -10
  108. package/lib/esm/common/telemetry/TelemetryConstants.js +19 -0
  109. package/lib/esm/common/telemetry/TelemetryManager.js +6 -1
  110. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +2 -3
  111. package/lib/esm/common/telemetry/sanitizeSasInPayload.js +84 -0
  112. package/lib/esm/common/utils.js +88 -14
  113. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +15 -5
  114. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +19 -9
  115. package/lib/esm/components/citationpanestateful/CitationDim.js +2 -3
  116. package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +26 -4
  117. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +22 -2
  118. package/lib/esm/components/dimlayer/DimLayer.js +1 -3
  119. package/lib/esm/components/draggable/DraggableChatWidget.js +34 -14
  120. package/lib/esm/components/draggable/DraggableEventEmitter.js +10 -1
  121. package/lib/esm/components/draggable/DraggableEventReceiver.js +1 -3
  122. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +54 -17
  123. package/lib/esm/components/errorboundary/ErrorBoundary.js +4 -12
  124. package/lib/esm/components/footerstateful/FooterStateful.js +17 -8
  125. package/lib/esm/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +2 -4
  126. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +4 -6
  127. package/lib/esm/components/headerstateful/HeaderStateful.js +22 -10
  128. package/lib/esm/components/livechatwidget/LiveChatWidget.js +27 -4
  129. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +5 -11
  130. package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +1 -0
  131. package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +11 -4
  132. package/lib/esm/components/livechatwidget/common/authHelper.js +44 -4
  133. package/lib/esm/components/livechatwidget/common/createMarkdown.js +98 -5
  134. package/lib/esm/components/livechatwidget/common/endChat.js +12 -9
  135. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +182 -1
  136. package/lib/esm/components/livechatwidget/common/recoveryEligibilityTelemetry.js +52 -0
  137. package/lib/esm/components/livechatwidget/common/startChat.js +31 -14
  138. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +159 -20
  139. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +14 -9
  140. package/lib/esm/components/notificationpanestateful/NotificationPaneStateful.js +17 -10
  141. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +12 -5
  142. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +28 -5
  143. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +11 -4
  144. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +105 -11
  145. package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +12 -1
  146. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +16 -6
  147. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +15 -6
  148. package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +9 -1
  149. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +154 -29
  150. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +10 -0
  151. package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +115 -10
  152. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -0
  153. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +2 -1
  154. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +3 -1
  155. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +2 -2
  156. package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +3 -1
  157. package/lib/esm/components/webchatcontainerstateful/common/utils/citationA11y.js +188 -0
  158. package/lib/esm/components/webchatcontainerstateful/interfaces/IWebChatAction.js +10 -1
  159. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +27 -4
  160. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +1 -3
  161. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +1 -3
  162. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +180 -190
  163. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +3 -5
  164. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +19 -4
  165. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +12 -23
  166. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +27 -32
  167. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.js +193 -0
  168. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +28 -14
  169. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +5 -12
  170. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +1 -1
  171. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  172. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +8 -3
  173. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +8 -1
  174. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +5 -8
  175. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.js +6 -4
  176. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +6 -4
  177. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +13 -11
  178. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +15 -13
  179. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +17 -27
  180. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +9 -1
  181. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +1 -3
  182. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +16 -10
  183. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +6 -6
  184. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.js +77 -0
  185. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +36 -8
  186. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +5 -2
  187. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +10 -7
  188. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +4 -0
  189. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -4
  190. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +5 -1
  191. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +7 -7
  192. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +10 -14
  193. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +6 -4
  194. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -10
  195. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +57 -11
  196. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +6 -4
  197. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +25 -31
  198. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +10 -7
  199. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +6 -4
  200. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +55 -1
  201. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +2 -4
  202. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +5 -0
  203. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +17 -1
  204. package/lib/esm/contexts/createReducer.js +15 -0
  205. package/lib/esm/controller/componentController.js +13 -1
  206. package/lib/esm/hooks/useWindowDimensions.js +13 -5
  207. package/lib/esm/plugins/createChatTranscript.js +3 -4
  208. package/lib/esm/plugins/newMessageEventHandler.js +20 -3
  209. package/lib/types/common/Constants.d.ts +4 -0
  210. package/lib/types/common/facades/FacadeChatSDK.d.ts +29 -0
  211. package/lib/types/common/facades/types/IFacadeChatSDKInput.d.ts +3 -1
  212. package/lib/types/common/telemetry/TelemetryConstants.d.ts +15 -2
  213. package/lib/types/common/telemetry/sanitizeSasInPayload.d.ts +24 -0
  214. package/lib/types/common/utils.d.ts +3 -1
  215. package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +2 -1
  216. package/lib/types/components/livechatwidget/common/authHelper.d.ts +9 -2
  217. package/lib/types/components/livechatwidget/common/recoveryEligibilityTelemetry.d.ts +17 -0
  218. package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +6 -0
  219. package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +1 -1
  220. package/lib/types/components/webchatcontainerstateful/common/utils/citationA11y.d.ts +1 -0
  221. package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +1 -0
  222. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatAction.d.ts +16 -1
  223. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +7 -0
  224. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +14 -38
  225. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -0
  226. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.d.ts +18 -0
  227. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.d.ts +3 -0
  228. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.d.ts +2 -4
  229. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +2 -4
  230. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.d.ts +2 -4
  231. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.d.ts +10 -0
  232. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +2 -4
  233. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.d.ts +2 -2
  234. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +2 -4
  235. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +2 -2
  236. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +2 -4
  237. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.d.ts +2 -2
  238. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.d.ts +2 -4
  239. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.d.ts +2 -4
  240. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.d.ts +2 -4
  241. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.d.ts +2 -4
  242. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +2 -4
  243. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.d.ts +2 -4
  244. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.d.ts +2 -4
  245. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +2 -2
  246. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.d.ts +2 -4
  247. package/lib/types/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.d.ts +7 -0
  248. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
  249. package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +17 -0
  250. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
  251. package/package.json +71 -57
@@ -1,6 +1,12 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1
7
  import { HtmlAttributeNames, Regex } from "../../common/Constants";
2
8
  import { ConversationStage, LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
3
- import React, { useEffect } from "react";
9
+ import React, { useEffect, useRef, useState } from "react";
4
10
  import { createTimer, extractPreChatSurveyResponseValues, findAllFocusableElement, getStateFromCache, getWidgetCacheId, isUndefinedOrEmpty, parseAdaptiveCardPayload } from "../../common/utils";
5
11
  import { ConversationState } from "../../contexts/common/ConversationState";
6
12
  import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
@@ -11,6 +17,34 @@ import { defaultGeneralPreChatSurveyPaneStyleProps } from "./common/defaultStyle
11
17
  import { defaultPreChatSurveyLocalizedTexts } from "./common/defaultProps/defaultPreChatSurveyLocalizedTexts";
12
18
  import useChatContextStore from "../../hooks/useChatContextStore";
13
19
  let uiTimer;
20
+ const getFocusedElementAnnouncement = element => {
21
+ var _element$textContent;
22
+ const ariaLabel = element.getAttribute(HtmlAttributeNames.ariaLabel);
23
+ if (ariaLabel) {
24
+ return ariaLabel.trim();
25
+ }
26
+ const ariaLabelledBy = element.getAttribute(HtmlAttributeNames.ariaLabelledby);
27
+ if (ariaLabelledBy) {
28
+ const labelledByText = ariaLabelledBy.split(/\s+/).map(id => {
29
+ var _document$getElementB;
30
+ return (_document$getElementB = document.getElementById(id)) === null || _document$getElementB === void 0 || (_document$getElementB = _document$getElementB.textContent) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.trim();
31
+ }).filter(Boolean).join(" ");
32
+ if (labelledByText) {
33
+ return labelledByText;
34
+ }
35
+ }
36
+ if (element.id) {
37
+ const label = Array.from(document.querySelectorAll("label")).find(candidate => candidate.htmlFor === element.id || candidate.getAttribute("for") === element.id);
38
+ if (label !== null && label !== void 0 && label.textContent) {
39
+ return label.textContent.trim();
40
+ }
41
+ }
42
+ const parentLabel = element.closest("label");
43
+ if (parentLabel !== null && parentLabel !== void 0 && parentLabel.textContent) {
44
+ return parentLabel.textContent.trim();
45
+ }
46
+ return ((_element$textContent = element.textContent) === null || _element$textContent === void 0 ? void 0 : _element$textContent.trim()) ?? "";
47
+ };
14
48
 
15
49
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
50
  export const PreChatSurveyPaneStateful = props => {
@@ -27,12 +61,18 @@ export const PreChatSurveyPaneStateful = props => {
27
61
  }, []);
28
62
 
29
63
  // Set MarkDown global variable to be used for prechat adaptive cards
30
- window["markdownit"] = MarkdownIt;
31
- const [state, dispatch] = useChatContextStore();
32
- const {
33
- surveyProps,
34
- initStartChat
35
- } = props;
64
+ window.markdownit = MarkdownIt;
65
+ const _useChatContextStore = useChatContextStore(),
66
+ _useChatContextStore2 = _slicedToArray(_useChatContextStore, 2),
67
+ state = _useChatContextStore2[0],
68
+ dispatch = _useChatContextStore2[1];
69
+ const surveyProps = props.surveyProps,
70
+ initStartChat = props.initStartChat;
71
+ const _useState = useState(""),
72
+ _useState2 = _slicedToArray(_useState, 2),
73
+ preChatFocusAnnouncement = _useState2[0],
74
+ setPreChatFocusAnnouncement = _useState2[1];
75
+ const liveRegionUpdateTimeout = useRef();
36
76
  const generalStyleProps = Object.assign({}, defaultGeneralPreChatSurveyPaneStyleProps, surveyProps === null || surveyProps === void 0 || (_surveyProps$stylePro = surveyProps.styleProps) === null || _surveyProps$stylePro === void 0 ? void 0 : _surveyProps$stylePro.generalStyleProps, {
37
77
  display: state.appStates.isMinimized ? "none" : ""
38
78
  });
@@ -119,6 +159,16 @@ export const PreChatSurveyPaneStateful = props => {
119
159
  ...(surveyProps === null || surveyProps === void 0 ? void 0 : surveyProps.styleProps),
120
160
  generalStyleProps: generalStyleProps
121
161
  };
162
+ const announceFocusedElement = event => {
163
+ if (liveRegionUpdateTimeout.current) {
164
+ window.clearTimeout(liveRegionUpdateTimeout.current);
165
+ }
166
+ const announcement = getFocusedElementAnnouncement(event.target);
167
+ setPreChatFocusAnnouncement("");
168
+ liveRegionUpdateTimeout.current = window.setTimeout(() => {
169
+ setPreChatFocusAnnouncement(announcement);
170
+ }, 0);
171
+ };
122
172
  useEffect(() => {
123
173
  // Set Aria-Label Attribute for Inputs
124
174
  const adaptiveCardElements = document.getElementsByClassName(HtmlAttributeNames.adaptiveCardClassName);
@@ -166,9 +216,53 @@ export const PreChatSurveyPaneStateful = props => {
166
216
  }
167
217
  }
168
218
  }, [state.appStates.isMinimized]);
169
- return /*#__PURE__*/React.createElement(PreChatSurveyPane, {
170
- controlProps: controlProps,
171
- styleProps: styleProps
172
- });
219
+ useEffect(() => () => {
220
+ if (liveRegionUpdateTimeout.current) {
221
+ window.clearTimeout(liveRegionUpdateTimeout.current);
222
+ }
223
+ }, []);
224
+ return (
225
+ /*#__PURE__*/
226
+ // Bug 6525143 / Bug 6423684: the LiveChatWidget container is a centered
227
+ // flex column (HeaderStateful first, this pane second) with
228
+ // justifyContent: center and clipped overflow. Sizing this focus-capture
229
+ // wrapper to height: 100% makes it 100% of the ENTIRE container rather than
230
+ // the space remaining below the header, so header + pane overflow the
231
+ // container and the centered column splits the overflow top & bottom -
232
+ // clipping the header's top edge. Instead, fill only the remaining space
233
+ // with flex (flex: 1 1 auto + minHeight: 0) and lay out as a column so the
234
+ // header stays fully visible while the inner pane (a flex child that grows
235
+ // via flexGrow/flexBasis - see defaultGeneralPreChatSurveyPaneStyleProps)
236
+ // fills the leftover area and scrolls, instead of collapsing to its
237
+ // intrinsic content size.
238
+ React.createElement("div", {
239
+ onFocusCapture: announceFocusedElement,
240
+ style: {
241
+ width: "100%",
242
+ flex: "1 1 auto",
243
+ minHeight: 0,
244
+ display: "flex",
245
+ flexDirection: "column"
246
+ }
247
+ }, /*#__PURE__*/React.createElement("div", {
248
+ role: "status",
249
+ "aria-live": "polite",
250
+ "aria-atomic": "true",
251
+ style: {
252
+ position: "absolute",
253
+ width: "1px",
254
+ height: "1px",
255
+ margin: "-1px",
256
+ padding: 0,
257
+ border: 0,
258
+ clip: "rect(0, 0, 0, 0)",
259
+ overflow: "hidden",
260
+ whiteSpace: "nowrap"
261
+ }
262
+ }, preChatFocusAnnouncement), /*#__PURE__*/React.createElement(PreChatSurveyPane, {
263
+ controlProps: controlProps,
264
+ styleProps: styleProps
265
+ }))
266
+ );
173
267
  };
174
268
  export default PreChatSurveyPaneStateful;
@@ -5,6 +5,17 @@ export const defaultGeneralPreChatSurveyPaneStyleProps = {
5
5
  backgroundColor: "#FFFFFF",
6
6
  borderColor: "#F1F1F1",
7
7
  overflowY: "auto",
8
- height: "inherit",
8
+ // Bug 6525143 / Bug 6423684: the focus-capture wrapper is a flex column sized to
9
+ // the space remaining below the header (flex: 1 1 auto). Fill that space via flex
10
+ // (flexGrow: 1 / flexBasis: 0 / minHeight: 0) instead of height: 100%, which
11
+ // resolved against the whole centered #oc-lcw container and pushed the header out
12
+ // (the clip). minHeight: 0 keeps the pane shrinkable so its overflowY scroll
13
+ // engages for tall surveys rather than growing the column and clipping the header.
14
+ // Note: the shared PreChatSurveyPane default (chat-components) still merges
15
+ // height: "inherit" underneath these props; under this flex parent that resolves
16
+ // to auto and is overridden by the flex main-size, so the pane still fills via flex.
17
+ flexGrow: 1,
18
+ flexBasis: 0,
19
+ minHeight: 0,
9
20
  width: "inherit"
10
21
  };
@@ -1,3 +1,9 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1
7
  import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
8
  import React, { useEffect, useState } from "react";
3
9
  import { createTimer } from "../../common/utils";
@@ -21,13 +27,17 @@ export const ProactiveChatPaneStateful = props => {
21
27
  Description: "Proactive chat pane loading started."
22
28
  });
23
29
  }, []);
24
- const [state, dispatch] = useChatContextStore();
25
- const {
26
- proactiveChatProps,
27
- startChat
28
- } = props;
30
+ const _useChatContextStore = useChatContextStore(),
31
+ _useChatContextStore2 = _slicedToArray(_useChatContextStore, 2),
32
+ state = _useChatContextStore2[0],
33
+ dispatch = _useChatContextStore2[1];
34
+ const proactiveChatProps = props.proactiveChatProps,
35
+ startChat = props.startChat;
29
36
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
- const [timeoutRemoved, setTimeoutRemoved] = useState(false);
37
+ const _useState = useState(false),
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ timeoutRemoved = _useState2[0],
40
+ setTimeoutRemoved = _useState2[1];
31
41
  const handleProactiveChatInviteTimeout = () => {
32
42
  if (!timeoutRemoved) {
33
43
  setTimeoutRemoved(true);
@@ -1,3 +1,9 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1
7
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
8
  import React, { useEffect } from "react";
3
9
  import { createTimer, setFocusOnElement } from "../../common/utils";
@@ -16,15 +22,18 @@ export const ReconnectChatPaneStateful = props => {
16
22
  ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
17
23
  });
18
24
  }, []);
19
- const [state, dispatch] = useChatContextStore();
25
+ const _useChatContextStore = useChatContextStore(),
26
+ _useChatContextStore2 = _slicedToArray(_useChatContextStore, 2),
27
+ state = _useChatContextStore2[0],
28
+ dispatch = _useChatContextStore2[1];
20
29
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
30
  //const chatSDK: any = useChatSDKStore();
22
- const [facadeChatSDK] = useFacadeChatSDKStore();
31
+ const _useFacadeChatSDKStor = useFacadeChatSDKStore(),
32
+ _useFacadeChatSDKStor2 = _slicedToArray(_useFacadeChatSDKStor, 1),
33
+ facadeChatSDK = _useFacadeChatSDKStor2[0];
23
34
  const chatSDK = facadeChatSDK.getChatSDK();
24
- const {
25
- reconnectChatProps,
26
- initStartChat
27
- } = props;
35
+ const reconnectChatProps = props.reconnectChatProps,
36
+ initStartChat = props.initStartChat;
28
37
  const startChat = async continueChat => {
29
38
  dispatch({
30
39
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
@@ -1,3 +1,9 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1
7
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
8
  import React, { useEffect } from "react";
3
9
  import { createTimer, findAllFocusableElement } from "../../common/utils";
@@ -20,7 +26,9 @@ export const StartChatErrorPaneStateful = startChatErrorPaneProps => {
20
26
  Event: TelemetryEvent.UXStartChatErrorPaneStart
21
27
  });
22
28
  }, []);
23
- const [state] = useChatContextStore();
29
+ const _useChatContextStore = useChatContextStore(),
30
+ _useChatContextStore2 = _slicedToArray(_useChatContextStore, 1),
31
+ state = _useChatContextStore2[0];
24
32
  const generalStyleProps = Object.assign({}, defaultStartChatErrorPaneGeneralStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 || (_startChatErrorPanePr = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr === void 0 ? void 0 : _startChatErrorPanePr.generalStyleProps);
25
33
  const titleStyleProps = Object.assign({}, defaultStartChatErrorPaneTitleStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 || (_startChatErrorPanePr2 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr2 === void 0 ? void 0 : _startChatErrorPanePr2.titleStyleProps);
26
34
  const subtitleStyleProps = Object.assign({}, defaultStartChatErrorPaneSubtitleStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 || (_startChatErrorPanePr3 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr3 === void 0 ? void 0 : _startChatErrorPanePr3.subtitleStyleProps);
@@ -1,3 +1,9 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1
7
  import { Constants, HtmlAttributeNames, HtmlClassNames } from "../../common/Constants";
2
8
  import { Stack } from "@fluentui/react";
3
9
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
@@ -25,6 +31,7 @@ import { shouldLoadPersistentChatHistory } from "../livechatwidget/common/liveCh
25
31
  import { useChatContextStore } from "../..";
26
32
  import useFacadeSDKStore from "../../hooks/useFacadeChatSDKStore";
27
33
  import usePersistentChatHistory from "./hooks/usePersistentChatHistory";
34
+ import { patchCitationAnchorsForA11y } from "./common/utils/citationA11y";
28
35
  let uiTimer;
29
36
  const broadcastChannelMessageEvent = "message";
30
37
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -53,8 +60,10 @@ const createMagicCodeSuccessResponse = signin => {
53
60
  };
54
61
  };
55
62
  export const WebChatContainerStateful = props => {
56
- var _props$webChatContain, _defaultWebChatContai, _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp0, _props$webChatContain4, _defaultWebChatContai2, _props$webChatContain5, _defaultWebChatContai3, _webChatContainerProp1, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _props$webChatContain6, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _props$citationPanePr, _props$citationPanePr2, _props$citationPanePr3, _props$citationPanePr4, _props$citationPanePr5;
57
- const [facadeChatSDK] = useFacadeSDKStore();
63
+ var _props$webChatContain, _defaultWebChatContai, _props$webChatContain2, _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp0, _props$webChatContain5, _defaultWebChatContai2, _props$webChatContain6, _defaultWebChatContai3, _webChatContainerProp1, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _props$webChatContain7, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _props$citationPanePr, _props$citationPanePr2, _props$citationPanePr3, _props$citationPanePr4, _props$citationPanePr5;
64
+ const _useFacadeSDKStore = useFacadeSDKStore(),
65
+ _useFacadeSDKStore2 = _slicedToArray(_useFacadeSDKStore, 1),
66
+ facadeChatSDK = _useFacadeSDKStore2[0];
58
67
 
59
68
  // Create a font family that includes emoji support, based on the primary font or default
60
69
  const webChatStyles = ((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles) ?? defaultWebChatContainerStatefulProps.webChatStyles;
@@ -62,6 +71,10 @@ export const WebChatContainerStateful = props => {
62
71
 
63
72
  // Use iOS-optimized emoji font that prioritizes system-ui for proper emoji rendering
64
73
  const fontFamilyWithEmojis = createIOSOptimizedEmojiFont(primaryFont);
74
+
75
+ // Enforce minimum input font-size to prevent iOS Safari auto-zoom on focus
76
+ const configuredInputFontSize = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 || (_props$webChatContain2 = _props$webChatContain2.adaptiveCardStyles) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.inputFontSize) ?? defaultAdaptiveCardStyles.inputFontSize;
77
+ const inputFontSize = parseFloat(configuredInputFontSize ?? String(Constants.minInputFontSizePx)) < Constants.minInputFontSizePx ? Constants.minInputFontSize : configuredInputFontSize;
65
78
  useEffect(() => {
66
79
  uiTimer = createTimer();
67
80
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
@@ -70,20 +83,25 @@ export const WebChatContainerStateful = props => {
70
83
  }, []);
71
84
 
72
85
  // Citation pane state
73
- const [citationPaneOpen, setCitationPaneOpen] = useState(false);
74
- const [citationPaneText, setCitationPaneText] = useState("");
86
+ const _useState = useState(false),
87
+ _useState2 = _slicedToArray(_useState, 2),
88
+ citationPaneOpen = _useState2[0],
89
+ setCitationPaneOpen = _useState2[1];
90
+ const _useState3 = useState(""),
91
+ _useState4 = _slicedToArray(_useState3, 2),
92
+ citationPaneText = _useState4[0],
93
+ setCitationPaneText = _useState4[1];
75
94
 
76
95
  // Guard to prevent handling multiple rapid clicks which could cause
77
96
  // the dim layer and pane to re-render out of sync and create a flicker.
78
97
  const citationOpeningRef = useRef(false);
79
- const {
80
- BasicWebChat
81
- } = Components;
82
- const [state, dispatch] = useChatContextStore();
83
- const {
84
- webChatContainerProps,
85
- contextDataStore
86
- } = props;
98
+ const BasicWebChat = Components.BasicWebChat;
99
+ const _useChatContextStore = useChatContextStore(),
100
+ _useChatContextStore2 = _slicedToArray(_useChatContextStore, 2),
101
+ state = _useChatContextStore2[0],
102
+ dispatch = _useChatContextStore2[1];
103
+ const webChatContainerProps = props.webChatContainerProps,
104
+ contextDataStore = props.contextDataStore;
87
105
 
88
106
  // Type the chatConfig properly to avoid 'any' usage
89
107
  const extendedChatConfig = props.chatConfig;
@@ -142,23 +160,123 @@ export const WebChatContainerStateful = props => {
142
160
  document.addEventListener("click", clickHandler);
143
161
  return () => document.removeEventListener("click", clickHandler);
144
162
  }, [state]);
163
+
164
+ // Accessibility: Merge citation card's number badge and link text into a single
165
+ // focusable element. WebChat's LinkDefinitionItem renders an <a> containing a
166
+ // badge <div> (the number, e.g. "1") and a text <div> (the title). On iOS
167
+ // VoiceOver and Android TalkBack, those block-level descendants are otherwise
168
+ // announced as two separate focusable links. The patch sets a combined
169
+ // aria-label on the anchor and hides every descendant from the a11y tree so
170
+ // the whole card is announced as one link.
171
+ useEffect(() => {
172
+ const webChatRoot = document.getElementById("ms_lcw_webchat_root");
173
+ if (!webChatRoot) {
174
+ return;
175
+ }
176
+ patchCitationAnchorsForA11y(webChatRoot);
177
+ const observer = new MutationObserver(mutations => {
178
+ for (const m of mutations) {
179
+ if (m.type === "childList") {
180
+ m.addedNodes.forEach(node => {
181
+ if (node.nodeType === Node.ELEMENT_NODE) {
182
+ var _parentElement, _parentElement$closes;
183
+ patchCitationAnchorsForA11y(node);
184
+ // A child added inside an existing anchor (e.g. React
185
+ // mounting OpenInNewWindowIcon after the anchor) means
186
+ // the parent anchor needs to re-walk its descendants.
187
+ const ancestor = (_parentElement = node.parentElement) === null || _parentElement === void 0 || (_parentElement$closes = _parentElement.closest) === null || _parentElement$closes === void 0 ? void 0 : _parentElement$closes.call(_parentElement, "a.webchat__link-definitions__list-item-box");
188
+ if (ancestor) {
189
+ patchCitationAnchorsForA11y(ancestor);
190
+ }
191
+ }
192
+ });
193
+ } else if (m.type === "attributes" && m.target.nodeType === Node.ELEMENT_NODE) {
194
+ var _target$closest;
195
+ // React may strip our aria-hidden during a re-render; reapply
196
+ // by re-patching the closest matching anchor ancestor.
197
+ const target = m.target;
198
+ const ancestor = (_target$closest = target.closest) === null || _target$closest === void 0 ? void 0 : _target$closest.call(target, "a.webchat__link-definitions__list-item-box");
199
+ if (ancestor) {
200
+ patchCitationAnchorsForA11y(ancestor);
201
+ }
202
+ }
203
+ }
204
+ });
205
+ observer.observe(webChatRoot, {
206
+ childList: true,
207
+ subtree: true,
208
+ attributes: true,
209
+ attributeFilter: ["aria-hidden", "role", "tabindex", "inert"]
210
+ });
211
+ return () => observer.disconnect();
212
+ }, []);
213
+ const minimizedStyles = state.appStates.isMinimized ? shouldLoadPersistentHistoryMessages ? {
214
+ visibility: "hidden",
215
+ position: "absolute",
216
+ width: 0,
217
+ height: 0,
218
+ overflow: "hidden",
219
+ pointerEvents: "none"
220
+ } : {
221
+ display: "none"
222
+ } : {};
145
223
  const containerStyles = {
146
- root: Object.assign({}, defaultWebChatContainerStatefulProps.containerStyles, webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.containerStyles, {
147
- display: state.appStates.isMinimized ? "none" : ""
148
- }) // Use this instead of removing WebChat from the picture so that the activity observer inside the adapter is not invoked
224
+ root: Object.assign({}, defaultWebChatContainerStatefulProps.containerStyles, webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.containerStyles, minimizedStyles) // Use visibility-based hiding instead of display:none to preserve scroll position across minimize/maximize
149
225
  };
150
226
  const localizedTexts = {
151
227
  ...defaultMiddlewareLocalizedTexts,
152
228
  ...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
153
229
  };
154
230
  useEffect(() => {
155
- var _props$webChatContain2;
231
+ var _props$webChatContain3;
156
232
  if (getDeviceType() !== "standard" && (webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.webChatHistoryMobileAccessibilityLabel) !== undefined) {
157
233
  const chatHistoryElement = document.querySelector(`.${HtmlClassNames.webChatHistoryContainer}`);
158
234
  if (chatHistoryElement) {
159
235
  chatHistoryElement.setAttribute(HtmlAttributeNames.ariaLabel, webChatContainerProps.webChatHistoryMobileAccessibilityLabel);
160
236
  }
161
237
  }
238
+
239
+ // internal tracking: WebChats BasicToaster renders a `role="log"` container
240
+ // with no accessible name. When the toaster is empty (typical idle
241
+ // state) screen readers traversing the page announce it as "blank".
242
+ // Inject an aria-label so the region has a meaningful name; the
243
+ // consumer can override via the new
244
+ // `webChatNotificationRegionAccessibilityLabel` prop. The toaster
245
+ // may not be rendered yet when this effect first runs, so observe
246
+ // for it via a MutationObserver scoped to the widget root (or, if
247
+ // not yet mounted, the widget container's parent) so we never fire
248
+ // on host-page mutations outside the widget subtree.
249
+ const toasterLabel = (webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.webChatNotificationRegionAccessibilityLabel) ?? defaultWebChatContainerStatefulProps.webChatNotificationRegionAccessibilityLabel ?? "Chat notifications";
250
+ const labelToaster = root => {
251
+ const toaster = root.querySelector(".webchat__toaster[role='log']");
252
+ if (toaster && !toaster.getAttribute(HtmlAttributeNames.ariaLabel)) {
253
+ toaster.setAttribute(HtmlAttributeNames.ariaLabel, toasterLabel);
254
+ return true;
255
+ }
256
+ return false;
257
+ };
258
+ // Prefer the widget root; if it is not yet in the DOM, fall back to
259
+ // `document` for the *initial* lookup only, then observe the most
260
+ // specific available scope (widget root if present, otherwise the
261
+ // widget's parent / document.body as a last resort). The observer
262
+ // re-resolves the widget root on every callback so we tighten scope
263
+ // as soon as it mounts.
264
+ let toasterObserver;
265
+ const resolveScope = () => document.getElementById("ms_lcw_webchat_root") ?? document.body;
266
+ if (!labelToaster(resolveScope())) {
267
+ toasterObserver = new MutationObserver(() => {
268
+ const scope = resolveScope();
269
+ if (labelToaster(scope)) {
270
+ var _toasterObserver;
271
+ (_toasterObserver = toasterObserver) === null || _toasterObserver === void 0 || _toasterObserver.disconnect();
272
+ toasterObserver = undefined;
273
+ }
274
+ });
275
+ toasterObserver.observe(resolveScope(), {
276
+ childList: true,
277
+ subtree: true
278
+ });
279
+ }
162
280
  dispatch({
163
281
  type: LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS,
164
282
  payload: webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.renderingMiddlewareProps
@@ -170,7 +288,7 @@ export const WebChatContainerStateful = props => {
170
288
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
171
289
  Event: TelemetryEvent.WebChatLoaded
172
290
  });
173
- if (((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 || (_props$webChatContain2 = _props$webChatContain2.renderingMiddlewareProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
291
+ if (((_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 || (_props$webChatContain3 = _props$webChatContain3.renderingMiddlewareProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
174
292
  try {
175
293
  localStorage;
176
294
  sessionStorage;
@@ -183,10 +301,14 @@ export const WebChatContainerStateful = props => {
183
301
  }
184
302
  }
185
303
  }
304
+ return () => {
305
+ var _toasterObserver2;
306
+ (_toasterObserver2 = toasterObserver) === null || _toasterObserver2 === void 0 || _toasterObserver2.disconnect();
307
+ };
186
308
  }, []);
187
309
  useEffect(() => {
188
- var _props$webChatContain3;
189
- if (!((_props$webChatContain3 = props.webChatContainerProps) !== null && _props$webChatContain3 !== void 0 && (_props$webChatContain3 = _props$webChatContain3.botMagicCode) !== null && _props$webChatContain3 !== void 0 && _props$webChatContain3.disabled)) {
310
+ var _props$webChatContain4;
311
+ if (!((_props$webChatContain4 = props.webChatContainerProps) !== null && _props$webChatContain4 !== void 0 && (_props$webChatContain4 = _props$webChatContain4.botMagicCode) !== null && _props$webChatContain4 !== void 0 && _props$webChatContain4.disabled)) {
190
312
  return;
191
313
  }
192
314
  if (!window.BroadcastChannel) {
@@ -202,14 +324,10 @@ export const WebChatContainerStateful = props => {
202
324
 
203
325
  const eventListener = event => {
204
326
  // eslint-disable-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-function
205
- const {
206
- data
207
- } = event;
327
+ const data = event.data;
208
328
  if (BotMagicCodeStore.botOAuthSignInId === data.signin) {
209
- const {
210
- signin,
211
- code
212
- } = data;
329
+ const signin = data.signin,
330
+ code = data.code;
213
331
  const text = `${code}`;
214
332
  const action = postActivity({
215
333
  text,
@@ -284,9 +402,15 @@ export const WebChatContainerStateful = props => {
284
402
  ${webChatContainerProps !== null && webChatContainerProps !== void 0 && (_webChatContainerProp0 = webChatContainerProps.adaptiveCardStyles) !== null && _webChatContainerProp0 !== void 0 && _webChatContainerProp0.choiceInputPadding ? `padding: ${webChatContainerProps.adaptiveCardStyles.choiceInputPadding} !important;` : ""}
285
403
  }
286
404
 
405
+ div[class="ac-input-container"] input,
406
+ div[class="ac-input-container"] textarea,
407
+ div[class="ac-input-container"] select {
408
+ font-size: ${inputFontSize} !important;
409
+ }
410
+
287
411
  .ms_lcw_webchat_received_message>div.webchat__stacked-layout>div.webchat__stacked-layout__main>div.webchat__stacked-layout__content>div.webchat__stacked-layout__message-row>[class^=webchat]:not(.webchat__bubble--from-user)>.webchat__bubble__content {
288
- background-color: ${((_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 || (_props$webChatContain4 = _props$webChatContain4.webChatStyles) === null || _props$webChatContain4 === void 0 ? void 0 : _props$webChatContain4.bubbleBackground) ?? ((_defaultWebChatContai2 = defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleBackground)};
289
- color:${((_props$webChatContain5 = props.webChatContainerProps) === null || _props$webChatContain5 === void 0 || (_props$webChatContain5 = _props$webChatContain5.webChatStyles) === null || _props$webChatContain5 === void 0 ? void 0 : _props$webChatContain5.bubbleTextColor) ?? ((_defaultWebChatContai3 = defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.bubbleTextColor)};
412
+ background-color: ${((_props$webChatContain5 = props.webChatContainerProps) === null || _props$webChatContain5 === void 0 || (_props$webChatContain5 = _props$webChatContain5.webChatStyles) === null || _props$webChatContain5 === void 0 ? void 0 : _props$webChatContain5.bubbleBackground) ?? ((_defaultWebChatContai2 = defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleBackground)};
413
+ color:${((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 || (_props$webChatContain6 = _props$webChatContain6.webChatStyles) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.bubbleTextColor) ?? ((_defaultWebChatContai3 = defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.bubbleTextColor)};
290
414
  }
291
415
 
292
416
  div[class="ac-textBlock"] a:link,
@@ -371,7 +495,7 @@ export const WebChatContainerStateful = props => {
371
495
  }
372
496
 
373
497
  .webchat__stacked-layout_container>div {
374
- background: ${(props === null || props === void 0 || (_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 || (_props$webChatContain6 = _props$webChatContain6.containerStyles) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.background) ?? ""}
498
+ background: ${(props === null || props === void 0 || (_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 || (_props$webChatContain7 = _props$webChatContain7.containerStyles) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.background) ?? ""}
375
499
  }
376
500
  .webchat__toast_text {
377
501
  display: flex;
@@ -400,6 +524,7 @@ export const WebChatContainerStateful = props => {
400
524
 
401
525
  .webchat__auto-resize-textarea__textarea.webchat__send-box-text-box__html-text-area {
402
526
  font-family: ${fontFamilyWithEmojis} !important;
527
+ font-size: ${inputFontSize} !important;
403
528
  }
404
529
 
405
530
  /* Suggested actions carousel previous/next navigation focus */
@@ -51,6 +51,16 @@ export let DesignerChatAdapter = /*#__PURE__*/function (_MockAdapter) {
51
51
  if (msg.text) {
52
52
  if (msg.suggestedActions) {
53
53
  postAgentSuggestedActionsActivity(this.activityObserver, msg.text, msg.suggestedActions, index * 100);
54
+ } else if (msg.from && msg.from.role) {
55
+ // Route caller-supplied `from` through the shared
56
+ // postBotMessageActivity helper so the activity shape
57
+ // (id, channelData.tags, timestamp, type) matches every
58
+ // other designer-mode path and downstream middleware
59
+ // (localizedStringsBotInitialsMiddleware, telemetry,
60
+ // attachment plumbing) behaves identically. The override
61
+ // narrows only the fields the caller cares about (e.g.
62
+ // from.name / from.role) — base botUser fields remain.
63
+ postBotMessageActivity(this.activityObserver, msg.text, undefined, index * 100, msg.from);
54
64
  } else {
55
65
  postBotMessageActivity(this.activityObserver, msg.text, undefined, index * 100);
56
66
  }