botframework-webchat-component 4.18.1-main.20260518.2a3d1d3 → 4.18.2

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 (1389) hide show
  1. package/dist/botframework-webchat-component.d.mts +2312 -64
  2. package/dist/botframework-webchat-component.internal.d.mts +3 -68
  3. package/dist/botframework-webchat-component.internal.mjs +2 -1
  4. package/dist/botframework-webchat-component.internal.mjs.LEGAL.txt +0 -0
  5. package/dist/botframework-webchat-component.mjs +11 -1
  6. package/dist/botframework-webchat-component.mjs.LEGAL.txt +0 -0
  7. package/dist/botframework-webchat-component.mjs.map +1 -1
  8. package/dist/chunk-X37JABN5.mjs +5 -0
  9. package/dist/chunk-X37JABN5.mjs.LEGAL.txt +0 -0
  10. package/dist/chunk-X37JABN5.mjs.map +1 -0
  11. package/dist/metafile-esm.json +1 -1
  12. package/internal.js +1 -1
  13. package/lib/Activity/Avatar.d.ts +10 -0
  14. package/lib/Activity/Avatar.d.ts.map +1 -0
  15. package/lib/Activity/Avatar.js +35 -0
  16. package/lib/Activity/Bubble.d.ts +11 -0
  17. package/lib/Activity/Bubble.d.ts.map +1 -0
  18. package/lib/Activity/Bubble.js +137 -0
  19. package/lib/Activity/CarouselFilmStrip.js +264 -0
  20. package/lib/Activity/CarouselFilmStripAttachment.js +93 -0
  21. package/lib/Activity/CarouselLayout.js +133 -0
  22. package/lib/Activity/SayAlt.js +31 -0
  23. package/lib/Activity/Speak.d.ts +8 -0
  24. package/lib/Activity/Speak.d.ts.map +1 -0
  25. package/lib/Activity/Speak.js +99 -0
  26. package/lib/Activity/StackedLayout.d.ts +17 -0
  27. package/lib/Activity/StackedLayout.d.ts.map +1 -0
  28. package/lib/Activity/StackedLayout.js +233 -0
  29. package/lib/ActivityStatus/AbsoluteTime.js +38 -0
  30. package/lib/ActivityStatus/OthersActivityStatus.d.ts +8 -0
  31. package/lib/ActivityStatus/OthersActivityStatus.d.ts.map +1 -0
  32. package/lib/ActivityStatus/OthersActivityStatus.js +105 -0
  33. package/lib/ActivityStatus/SelfActivityStatus.d.ts +8 -0
  34. package/lib/ActivityStatus/SelfActivityStatus.d.ts.map +1 -0
  35. package/lib/ActivityStatus/SelfActivityStatus.js +37 -0
  36. package/lib/ActivityStatus/SendStatus/SendStatus.d.ts +10 -0
  37. package/lib/ActivityStatus/SendStatus/SendStatus.d.ts.map +1 -0
  38. package/lib/ActivityStatus/SendStatus/SendStatus.js +58 -0
  39. package/lib/ActivityStatus/SendStatus/private/SendFailedRetry.js +35 -0
  40. package/lib/ActivityStatus/Slotted.d.ts +7 -0
  41. package/lib/ActivityStatus/Slotted.d.ts.map +1 -0
  42. package/lib/ActivityStatus/Slotted.js +31 -0
  43. package/lib/ActivityStatus/Timestamp.d.ts +7 -0
  44. package/lib/ActivityStatus/Timestamp.d.ts.map +1 -0
  45. package/lib/ActivityStatus/Timestamp.js +36 -0
  46. package/lib/ActivityStatus/private/Feedback/Feedback.d.ts +8 -0
  47. package/lib/ActivityStatus/private/Feedback/Feedback.d.ts.map +1 -0
  48. package/lib/ActivityStatus/private/Feedback/Feedback.js +67 -0
  49. package/lib/ActivityStatus/private/Feedback/private/ThumbButton.Image.d.ts +9 -0
  50. package/lib/ActivityStatus/private/Feedback/private/ThumbButton.Image.d.ts.map +1 -0
  51. package/lib/ActivityStatus/private/Feedback/private/ThumbButton.Image.js +34 -0
  52. package/lib/ActivityStatus/private/Feedback/private/ThumbButton.d.ts +9 -0
  53. package/lib/ActivityStatus/private/Feedback/private/ThumbButton.d.ts.map +1 -0
  54. package/lib/ActivityStatus/private/Feedback/private/ThumbButton.js +57 -0
  55. package/lib/ActivityStatus/private/Feedback/private/VoteButton.d.ts +10 -0
  56. package/lib/ActivityStatus/private/Feedback/private/VoteButton.d.ts.map +1 -0
  57. package/lib/ActivityStatus/private/Feedback/private/VoteButton.js +43 -0
  58. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbDislike16Filled.d.ts +7 -0
  59. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbDislike16Filled.d.ts.map +1 -0
  60. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbDislike16Filled.js +28 -0
  61. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbDislike16Regular.d.ts +7 -0
  62. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbDislike16Regular.d.ts.map +1 -0
  63. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbDislike16Regular.js +28 -0
  64. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbLike16Filled.d.ts +7 -0
  65. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbLike16Filled.d.ts.map +1 -0
  66. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbLike16Filled.js +28 -0
  67. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbLike16Regular.d.ts +7 -0
  68. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbLike16Regular.d.ts.map +1 -0
  69. package/lib/ActivityStatus/private/Feedback/private/icons/ThumbLike16Regular.js +28 -0
  70. package/lib/ActivityStatus/private/Originator.d.ts +8 -0
  71. package/lib/ActivityStatus/private/Originator.d.ts.map +1 -0
  72. package/lib/ActivityStatus/private/Originator.js +29 -0
  73. package/lib/ActivityStatus/private/RelativeTime.js +37 -0
  74. package/lib/Assets/TypingAnimation.js +47 -0
  75. package/lib/Attachment/Assets/DownloadIcon.js +35 -0
  76. package/lib/Attachment/AudioAttachment.js +38 -0
  77. package/lib/Attachment/AudioContent.d.ts +11 -0
  78. package/lib/Attachment/AudioContent.d.ts.map +1 -0
  79. package/lib/Attachment/AudioContent.js +51 -0
  80. package/lib/Attachment/FileAttachment.js +43 -0
  81. package/lib/Attachment/FileContent.d.ts +10 -0
  82. package/lib/Attachment/FileContent.d.ts.map +1 -0
  83. package/lib/Attachment/FileContent.js +120 -0
  84. package/lib/Attachment/HTMLVideoContent.d.ts +11 -0
  85. package/lib/Attachment/HTMLVideoContent.d.ts.map +1 -0
  86. package/lib/Attachment/HTMLVideoContent.js +51 -0
  87. package/lib/Attachment/ImageAttachment.js +41 -0
  88. package/lib/Attachment/ImageContent.d.ts +8 -0
  89. package/lib/Attachment/ImageContent.d.ts.map +1 -0
  90. package/lib/Attachment/ImageContent.js +41 -0
  91. package/lib/Attachment/Text/TextAttachment.d.ts +12 -0
  92. package/lib/Attachment/Text/TextAttachment.d.ts.map +1 -0
  93. package/lib/Attachment/Text/TextAttachment.js +27 -0
  94. package/lib/Attachment/Text/TextContent.d.ts +10 -0
  95. package/lib/Attachment/Text/TextContent.d.ts.map +1 -0
  96. package/lib/Attachment/Text/TextContent.js +34 -0
  97. package/lib/Attachment/Text/private/CitationModalContent.d.ts +8 -0
  98. package/lib/Attachment/Text/private/CitationModalContent.d.ts.map +1 -0
  99. package/lib/Attachment/Text/private/CitationModalContent.js +45 -0
  100. package/lib/Attachment/Text/private/MarkdownTextContent.d.ts +9 -0
  101. package/lib/Attachment/Text/private/MarkdownTextContent.d.ts.map +1 -0
  102. package/lib/Attachment/Text/private/MarkdownTextContent.js +204 -0
  103. package/lib/Attachment/Text/private/MessageSensitivityLabel.d.ts +12 -0
  104. package/lib/Attachment/Text/private/MessageSensitivityLabel.d.ts.map +1 -0
  105. package/lib/Attachment/Text/private/MessageSensitivityLabel.js +38 -0
  106. package/lib/Attachment/Text/private/PlainTextContent.d.ts +7 -0
  107. package/lib/Attachment/Text/private/PlainTextContent.d.ts.map +1 -0
  108. package/lib/Attachment/Text/private/PlainTextContent.js +35 -0
  109. package/lib/Attachment/Text/private/ShieldIcon.d.ts +9 -0
  110. package/lib/Attachment/Text/private/ShieldIcon.d.ts.map +1 -0
  111. package/lib/Attachment/Text/private/ShieldIcon.js +39 -0
  112. package/lib/Attachment/Text/private/isHTMLButtonElement.d.ts +2 -0
  113. package/lib/Attachment/Text/private/isHTMLButtonElement.d.ts.map +1 -0
  114. package/lib/Attachment/Text/private/isHTMLButtonElement.js +10 -0
  115. package/lib/Attachment/VideoAttachment.js +45 -0
  116. package/lib/Attachment/VideoContent.d.ts +11 -0
  117. package/lib/Attachment/VideoContent.d.ts.map +1 -0
  118. package/lib/Attachment/VideoContent.js +103 -0
  119. package/lib/Attachment/VimeoContent.d.ts +10 -0
  120. package/lib/Attachment/VimeoContent.d.ts.map +1 -0
  121. package/lib/Attachment/VimeoContent.js +59 -0
  122. package/lib/Attachment/YouTubeContent.d.ts +10 -0
  123. package/lib/Attachment/YouTubeContent.d.ts.map +1 -0
  124. package/lib/Attachment/YouTubeContent.js +60 -0
  125. package/lib/Attachment/createMiddleware.d.ts +3 -0
  126. package/lib/Attachment/createMiddleware.d.ts.map +1 -0
  127. package/lib/Attachment/createMiddleware.js +64 -0
  128. package/lib/Attachment/private/types/WebChatAttachment.d.ts +9 -0
  129. package/lib/Attachment/private/types/WebChatAttachment.d.ts.map +1 -0
  130. package/lib/Attachment/private/types/WebChatAttachment.js +2 -0
  131. package/lib/Avatar/ImageAvatar.js +59 -0
  132. package/lib/Avatar/InitialsAvatar.js +57 -0
  133. package/lib/BasicConnectivityStatus.js +46 -0
  134. package/lib/BasicToast.js +103 -0
  135. package/lib/BasicToaster.js +176 -0
  136. package/lib/BasicTranscript.d.ts +7 -0
  137. package/lib/BasicTranscript.d.ts.map +1 -0
  138. package/lib/BasicTranscript.js +735 -0
  139. package/lib/BasicTypingIndicator.d.ts +6 -0
  140. package/lib/BasicTypingIndicator.d.ts.map +1 -0
  141. package/lib/BasicTypingIndicator.js +54 -0
  142. package/lib/BasicWebChat.d.ts +9 -0
  143. package/lib/BasicWebChat.d.ts.map +1 -0
  144. package/lib/BasicWebChat.js +90 -0
  145. package/lib/Composer.d.ts +50 -0
  146. package/lib/Composer.d.ts.map +1 -0
  147. package/lib/Composer.js +336 -0
  148. package/lib/ConnectivityStatus/Assets/ErrorNotificationIcon.js +47 -0
  149. package/lib/ConnectivityStatus/Assets/SpinnerAnimation.js +32 -0
  150. package/lib/ConnectivityStatus/Assets/WarningNotificationIcon.js +47 -0
  151. package/lib/ConnectivityStatus/Connected.js +20 -0
  152. package/lib/ConnectivityStatus/Connecting.js +82 -0
  153. package/lib/ConnectivityStatus/FailedToConnect.js +41 -0
  154. package/lib/ConnectivityStatus/JavaScriptError.js +41 -0
  155. package/lib/Dictation.js +158 -0
  156. package/lib/ErrorBox.d.ts +8 -0
  157. package/lib/ErrorBox.d.ts.map +1 -0
  158. package/lib/ErrorBox.js +42 -0
  159. package/lib/LinkDefinition/LinkDefinitionItem.d.ts +12 -0
  160. package/lib/LinkDefinition/LinkDefinitionItem.d.ts.map +1 -0
  161. package/lib/LinkDefinition/LinkDefinitionItem.js +57 -0
  162. package/lib/LinkDefinition/LinkDefinitions.d.ts +12 -0
  163. package/lib/LinkDefinition/LinkDefinitions.d.ts.map +1 -0
  164. package/lib/LinkDefinition/LinkDefinitions.js +69 -0
  165. package/lib/LinkDefinition/index.d.ts +4 -0
  166. package/lib/LinkDefinition/index.d.ts.map +1 -0
  167. package/lib/LinkDefinition/index.js +21 -0
  168. package/lib/LinkDefinition/private/Badge.d.ts +7 -0
  169. package/lib/LinkDefinition/private/Badge.d.ts.map +1 -0
  170. package/lib/LinkDefinition/private/Badge.js +20 -0
  171. package/lib/LinkDefinition/private/Chevron.d.ts +4 -0
  172. package/lib/LinkDefinition/private/Chevron.d.ts.map +1 -0
  173. package/lib/LinkDefinition/private/Chevron.js +27 -0
  174. package/lib/LinkDefinition/private/ItemBody.d.ts +11 -0
  175. package/lib/LinkDefinition/private/ItemBody.d.ts.map +1 -0
  176. package/lib/LinkDefinition/private/ItemBody.js +41 -0
  177. package/lib/LinkDefinition/private/OpenInNewWindowIcon.d.ts +7 -0
  178. package/lib/LinkDefinition/private/OpenInNewWindowIcon.d.ts.map +1 -0
  179. package/lib/LinkDefinition/private/OpenInNewWindowIcon.js +23 -0
  180. package/lib/LinkDefinition/private/extractHostnameWithSubdomain.d.ts +2 -0
  181. package/lib/LinkDefinition/private/extractHostnameWithSubdomain.d.ts.map +1 -0
  182. package/lib/LinkDefinition/private/extractHostnameWithSubdomain.js +24 -0
  183. package/lib/LinkDefinition/private/extractHostnameWithSubdomain.spec.d.ts +2 -0
  184. package/lib/LinkDefinition/private/extractHostnameWithSubdomain.spec.d.ts.map +1 -0
  185. package/lib/LiveRegion/LiveRegionActivity.d.ts +9 -0
  186. package/lib/LiveRegion/LiveRegionActivity.d.ts.map +1 -0
  187. package/lib/LiveRegion/LiveRegionActivity.js +70 -0
  188. package/lib/LiveRegion/private/LiveRegionAttachments.d.ts +11 -0
  189. package/lib/LiveRegion/private/LiveRegionAttachments.d.ts.map +1 -0
  190. package/lib/LiveRegion/private/LiveRegionAttachments.js +53 -0
  191. package/lib/LiveRegion/private/LiveRegionSuggestedActions.d.ts +8 -0
  192. package/lib/LiveRegion/private/LiveRegionSuggestedActions.d.ts.map +1 -0
  193. package/lib/LiveRegion/private/LiveRegionSuggestedActions.js +37 -0
  194. package/lib/Middleware/Activity/createCoreMiddleware.d.ts +3 -0
  195. package/lib/Middleware/Activity/createCoreMiddleware.d.ts.map +1 -0
  196. package/lib/Middleware/Activity/createCoreMiddleware.js +95 -0
  197. package/lib/Middleware/ActivityStatus/createCoreMiddleware.d.ts +3 -0
  198. package/lib/Middleware/ActivityStatus/createCoreMiddleware.d.ts.map +1 -0
  199. package/lib/Middleware/ActivityStatus/createCoreMiddleware.js +13 -0
  200. package/lib/Middleware/ActivityStatus/createSendStatusMiddleware.d.ts +3 -0
  201. package/lib/Middleware/ActivityStatus/createSendStatusMiddleware.d.ts.map +1 -0
  202. package/lib/Middleware/ActivityStatus/createSendStatusMiddleware.js +41 -0
  203. package/lib/Middleware/ActivityStatus/createTimestampMiddleware.d.ts +3 -0
  204. package/lib/Middleware/ActivityStatus/createTimestampMiddleware.d.ts.map +1 -0
  205. package/lib/Middleware/ActivityStatus/createTimestampMiddleware.js +48 -0
  206. package/lib/Middleware/AttachmentForScreenReader/AudioAttachment.js +18 -0
  207. package/lib/Middleware/AttachmentForScreenReader/FileAttachment.js +28 -0
  208. package/lib/Middleware/AttachmentForScreenReader/ImageAttachment.js +18 -0
  209. package/lib/Middleware/AttachmentForScreenReader/TextAttachment.js +28 -0
  210. package/lib/Middleware/AttachmentForScreenReader/VideoAttachment.js +18 -0
  211. package/lib/Middleware/AttachmentForScreenReader/createCoreMiddleware.d.ts +3 -0
  212. package/lib/Middleware/AttachmentForScreenReader/createCoreMiddleware.d.ts.map +1 -0
  213. package/lib/Middleware/AttachmentForScreenReader/createCoreMiddleware.js +61 -0
  214. package/lib/Middleware/Avatar/createCoreMiddleware.d.ts +11 -0
  215. package/lib/Middleware/Avatar/createCoreMiddleware.d.ts.map +1 -0
  216. package/lib/Middleware/Avatar/createCoreMiddleware.js +82 -0
  217. package/lib/Middleware/CardAction/createCoreMiddleware.js +108 -0
  218. package/lib/Middleware/ScrollToEndButton/ScrollToEndButton.js +52 -0
  219. package/lib/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.d.ts +3 -0
  220. package/lib/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.d.ts.map +1 -0
  221. package/lib/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.js +27 -0
  222. package/lib/Middleware/Toast/createCoreMiddleware.d.ts +4 -0
  223. package/lib/Middleware/Toast/createCoreMiddleware.d.ts.map +1 -0
  224. package/lib/Middleware/Toast/createCoreMiddleware.js +27 -0
  225. package/lib/Middleware/TypingIndicator/createCoreMiddleware.d.ts +3 -0
  226. package/lib/Middleware/TypingIndicator/createCoreMiddleware.d.ts.map +1 -0
  227. package/lib/Middleware/TypingIndicator/createCoreMiddleware.js +47 -0
  228. package/lib/ReactWebChat.d.ts +42 -0
  229. package/lib/ReactWebChat.d.ts.map +1 -0
  230. package/lib/ReactWebChat.js +52 -0
  231. package/lib/ScreenReaderText.d.ts +9 -0
  232. package/lib/ScreenReaderText.d.ts.map +1 -0
  233. package/lib/ScreenReaderText.js +58 -0
  234. package/lib/SendBox/Assets/MicrophoneIcon.js +25 -0
  235. package/lib/SendBox/Assets/SendIcon.js +45 -0
  236. package/lib/SendBox/AutoResizeTextArea.d.ts +24 -0
  237. package/lib/SendBox/AutoResizeTextArea.d.ts.map +1 -0
  238. package/lib/SendBox/AutoResizeTextArea.js +113 -0
  239. package/lib/SendBox/BasicSendBox.d.ts +9 -0
  240. package/lib/SendBox/BasicSendBox.d.ts.map +1 -0
  241. package/lib/SendBox/BasicSendBox.js +123 -0
  242. package/lib/SendBox/DictationInterims.d.ts +7 -0
  243. package/lib/SendBox/DictationInterims.d.ts.map +1 -0
  244. package/lib/SendBox/DictationInterims.js +68 -0
  245. package/lib/SendBox/IconButton.d.ts +11 -0
  246. package/lib/SendBox/IconButton.d.ts.map +1 -0
  247. package/lib/SendBox/IconButton.js +73 -0
  248. package/lib/SendBox/MicrophoneButton.d.ts +10 -0
  249. package/lib/SendBox/MicrophoneButton.d.ts.map +1 -0
  250. package/lib/SendBox/MicrophoneButton.js +160 -0
  251. package/lib/SendBox/SendButton.d.ts +7 -0
  252. package/lib/SendBox/SendButton.d.ts.map +1 -0
  253. package/lib/SendBox/SendButton.js +53 -0
  254. package/lib/SendBox/SuggestedAction.d.ts +16 -0
  255. package/lib/SendBox/SuggestedAction.d.ts.map +1 -0
  256. package/lib/SendBox/SuggestedAction.js +166 -0
  257. package/lib/SendBox/SuggestedActions.d.ts +7 -0
  258. package/lib/SendBox/SuggestedActions.d.ts.map +1 -0
  259. package/lib/SendBox/SuggestedActions.js +256 -0
  260. package/lib/SendBox/TextBox.d.ts +24 -0
  261. package/lib/SendBox/TextBox.d.ts.map +1 -0
  262. package/lib/SendBox/TextBox.js +252 -0
  263. package/lib/SendBox/createMiddleware.d.ts +4 -0
  264. package/lib/SendBox/createMiddleware.d.ts.map +1 -0
  265. package/lib/SendBox/createMiddleware.js +38 -0
  266. package/lib/SendBoxToolbar/Assets/AttachmentIcon.d.ts +7 -0
  267. package/lib/SendBoxToolbar/Assets/AttachmentIcon.d.ts.map +1 -0
  268. package/lib/SendBoxToolbar/Assets/AttachmentIcon.js +63 -0
  269. package/lib/SendBoxToolbar/BasicSendBoxToolbar.d.ts +6 -0
  270. package/lib/SendBoxToolbar/BasicSendBoxToolbar.d.ts.map +1 -0
  271. package/lib/SendBoxToolbar/BasicSendBoxToolbar.js +32 -0
  272. package/lib/SendBoxToolbar/UploadButton.d.ts +7 -0
  273. package/lib/SendBoxToolbar/UploadButton.d.ts.map +1 -0
  274. package/lib/SendBoxToolbar/UploadButton.js +156 -0
  275. package/lib/SendBoxToolbar/createMiddleware.d.ts +4 -0
  276. package/lib/SendBoxToolbar/createMiddleware.d.ts.map +1 -0
  277. package/lib/SendBoxToolbar/createMiddleware.js +20 -0
  278. package/lib/Styles/CSSTokens.d.ts +16 -0
  279. package/lib/Styles/CSSTokens.d.ts.map +1 -0
  280. package/lib/Styles/CSSTokens.js +19 -0
  281. package/lib/Styles/CustomPropertyNames.d.ts +13 -0
  282. package/lib/Styles/CustomPropertyNames.d.ts.map +1 -0
  283. package/lib/Styles/CustomPropertyNames.js +24 -0
  284. package/lib/Styles/StyleSet/Activities.d.ts +5 -0
  285. package/lib/Styles/StyleSet/Activities.d.ts.map +1 -0
  286. package/lib/Styles/StyleSet/Activities.js +13 -0
  287. package/lib/Styles/StyleSet/AudioAttachment.d.ts +6 -0
  288. package/lib/Styles/StyleSet/AudioAttachment.d.ts.map +1 -0
  289. package/lib/Styles/StyleSet/AudioAttachment.js +15 -0
  290. package/lib/Styles/StyleSet/AudioContent.d.ts +4 -0
  291. package/lib/Styles/StyleSet/AudioContent.d.ts.map +1 -0
  292. package/lib/Styles/StyleSet/AudioContent.js +12 -0
  293. package/lib/Styles/StyleSet/AutoResizeTextArea.d.ts +37 -0
  294. package/lib/Styles/StyleSet/AutoResizeTextArea.d.ts.map +1 -0
  295. package/lib/Styles/StyleSet/AutoResizeTextArea.js +45 -0
  296. package/lib/Styles/StyleSet/Avatar.d.ts +9 -0
  297. package/lib/Styles/StyleSet/Avatar.d.ts.map +1 -0
  298. package/lib/Styles/StyleSet/Avatar.js +18 -0
  299. package/lib/Styles/StyleSet/BasicTranscript.d.ts +85 -0
  300. package/lib/Styles/StyleSet/BasicTranscript.d.ts.map +1 -0
  301. package/lib/Styles/StyleSet/BasicTranscript.js +110 -0
  302. package/lib/Styles/StyleSet/Bubble.d.ts +5 -0
  303. package/lib/Styles/StyleSet/Bubble.d.ts.map +1 -0
  304. package/lib/Styles/StyleSet/Bubble.js +153 -0
  305. package/lib/Styles/StyleSet/CSSCustomProperties.d.ts +16 -0
  306. package/lib/Styles/StyleSet/CSSCustomProperties.d.ts.map +1 -0
  307. package/lib/Styles/StyleSet/CSSCustomProperties.js +27 -0
  308. package/lib/Styles/StyleSet/CarouselFilmStrip.d.ts +5 -0
  309. package/lib/Styles/StyleSet/CarouselFilmStrip.d.ts.map +1 -0
  310. package/lib/Styles/StyleSet/CarouselFilmStrip.js +90 -0
  311. package/lib/Styles/StyleSet/CarouselFilmStripAttachment.d.ts +3 -0
  312. package/lib/Styles/StyleSet/CarouselFilmStripAttachment.d.ts.map +1 -0
  313. package/lib/Styles/StyleSet/CarouselFilmStripAttachment.js +57 -0
  314. package/lib/Styles/StyleSet/CarouselFlipper.d.ts +27 -0
  315. package/lib/Styles/StyleSet/CarouselFlipper.d.ts.map +1 -0
  316. package/lib/Styles/StyleSet/CarouselFlipper.js +42 -0
  317. package/lib/Styles/StyleSet/CitationModalDialog.d.ts +8 -0
  318. package/lib/Styles/StyleSet/CitationModalDialog.d.ts.map +1 -0
  319. package/lib/Styles/StyleSet/CitationModalDialog.js +16 -0
  320. package/lib/Styles/StyleSet/ConnectivityNotification.d.ts +13 -0
  321. package/lib/Styles/StyleSet/ConnectivityNotification.d.ts.map +1 -0
  322. package/lib/Styles/StyleSet/ConnectivityNotification.js +26 -0
  323. package/lib/Styles/StyleSet/Constants.d.ts +6 -0
  324. package/lib/Styles/StyleSet/Constants.d.ts.map +1 -0
  325. package/lib/Styles/StyleSet/Constants.js +15 -0
  326. package/lib/Styles/StyleSet/DictationInterims.d.ts +13 -0
  327. package/lib/Styles/StyleSet/DictationInterims.d.ts.map +1 -0
  328. package/lib/Styles/StyleSet/DictationInterims.js +22 -0
  329. package/lib/Styles/StyleSet/ErrorBox.d.ts +33 -0
  330. package/lib/Styles/StyleSet/ErrorBox.d.ts.map +1 -0
  331. package/lib/Styles/StyleSet/ErrorBox.js +43 -0
  332. package/lib/Styles/StyleSet/ErrorNotification.d.ts +23 -0
  333. package/lib/Styles/StyleSet/ErrorNotification.d.ts.map +1 -0
  334. package/lib/Styles/StyleSet/ErrorNotification.js +36 -0
  335. package/lib/Styles/StyleSet/FileContent.d.ts +32 -0
  336. package/lib/Styles/StyleSet/FileContent.d.ts.map +1 -0
  337. package/lib/Styles/StyleSet/FileContent.js +43 -0
  338. package/lib/Styles/StyleSet/ImageAvatar.d.ts +7 -0
  339. package/lib/Styles/StyleSet/ImageAvatar.d.ts.map +1 -0
  340. package/lib/Styles/StyleSet/ImageAvatar.js +15 -0
  341. package/lib/Styles/StyleSet/InitialsAvatar.d.ts +19 -0
  342. package/lib/Styles/StyleSet/InitialsAvatar.d.ts.map +1 -0
  343. package/lib/Styles/StyleSet/InitialsAvatar.js +31 -0
  344. package/lib/Styles/StyleSet/KeyboardHelp.d.ts +152 -0
  345. package/lib/Styles/StyleSet/KeyboardHelp.d.ts.map +1 -0
  346. package/lib/Styles/StyleSet/KeyboardHelp.js +168 -0
  347. package/lib/Styles/StyleSet/LinkDefinitions.d.ts +165 -0
  348. package/lib/Styles/StyleSet/LinkDefinitions.d.ts.map +1 -0
  349. package/lib/Styles/StyleSet/LinkDefinitions.js +180 -0
  350. package/lib/Styles/StyleSet/MicrophoneButton.d.ts +13 -0
  351. package/lib/Styles/StyleSet/MicrophoneButton.d.ts.map +1 -0
  352. package/lib/Styles/StyleSet/MicrophoneButton.js +21 -0
  353. package/lib/Styles/StyleSet/ModalDialog.d.ts +94 -0
  354. package/lib/Styles/StyleSet/ModalDialog.d.ts.map +1 -0
  355. package/lib/Styles/StyleSet/ModalDialog.js +98 -0
  356. package/lib/Styles/StyleSet/RenderMarkdown.d.ts +51 -0
  357. package/lib/Styles/StyleSet/RenderMarkdown.d.ts.map +1 -0
  358. package/lib/Styles/StyleSet/RenderMarkdown.js +67 -0
  359. package/lib/Styles/StyleSet/Root.d.ts +8 -0
  360. package/lib/Styles/StyleSet/Root.d.ts.map +1 -0
  361. package/lib/Styles/StyleSet/Root.js +19 -0
  362. package/lib/Styles/StyleSet/ScrollToEndButton.d.ts +36 -0
  363. package/lib/Styles/StyleSet/ScrollToEndButton.d.ts.map +1 -0
  364. package/lib/Styles/StyleSet/ScrollToEndButton.js +55 -0
  365. package/lib/Styles/StyleSet/SendBox.d.ts +24 -0
  366. package/lib/Styles/StyleSet/SendBox.d.ts.map +1 -0
  367. package/lib/Styles/StyleSet/SendBox.js +37 -0
  368. package/lib/Styles/StyleSet/SendBoxButton.d.ts +79 -0
  369. package/lib/Styles/StyleSet/SendBoxButton.d.ts.map +1 -0
  370. package/lib/Styles/StyleSet/SendBoxButton.js +112 -0
  371. package/lib/Styles/StyleSet/SendBoxTextBox.d.ts +41 -0
  372. package/lib/Styles/StyleSet/SendBoxTextBox.d.ts.map +1 -0
  373. package/lib/Styles/StyleSet/SendBoxTextBox.js +57 -0
  374. package/lib/Styles/StyleSet/SendStatus.d.ts +19 -0
  375. package/lib/Styles/StyleSet/SendStatus.d.ts.map +1 -0
  376. package/lib/Styles/StyleSet/SendStatus.js +29 -0
  377. package/lib/Styles/StyleSet/SingleAttachmentActivity.d.ts +11 -0
  378. package/lib/Styles/StyleSet/SingleAttachmentActivity.d.ts.map +1 -0
  379. package/lib/Styles/StyleSet/SingleAttachmentActivity.js +21 -0
  380. package/lib/Styles/StyleSet/SlottedActivityStatus.d.ts +12 -0
  381. package/lib/Styles/StyleSet/SlottedActivityStatus.d.ts.map +1 -0
  382. package/lib/Styles/StyleSet/SlottedActivityStatus.js +22 -0
  383. package/lib/Styles/StyleSet/SpinnerAnimation.d.ts +15 -0
  384. package/lib/Styles/StyleSet/SpinnerAnimation.d.ts.map +1 -0
  385. package/lib/Styles/StyleSet/SpinnerAnimation.js +34 -0
  386. package/lib/Styles/StyleSet/StackedLayout.d.ts +63 -0
  387. package/lib/Styles/StyleSet/StackedLayout.d.ts.map +1 -0
  388. package/lib/Styles/StyleSet/StackedLayout.js +77 -0
  389. package/lib/Styles/StyleSet/SuggestedAction.d.ts +94 -0
  390. package/lib/Styles/StyleSet/SuggestedAction.d.ts.map +1 -0
  391. package/lib/Styles/StyleSet/SuggestedAction.js +152 -0
  392. package/lib/Styles/StyleSet/SuggestedActions.d.ts +139 -0
  393. package/lib/Styles/StyleSet/SuggestedActions.d.ts.map +1 -0
  394. package/lib/Styles/StyleSet/SuggestedActions.js +165 -0
  395. package/lib/Styles/StyleSet/TextContent.d.ts +24 -0
  396. package/lib/Styles/StyleSet/TextContent.d.ts.map +1 -0
  397. package/lib/Styles/StyleSet/TextContent.js +34 -0
  398. package/lib/Styles/StyleSet/ThumbButton.d.ts +32 -0
  399. package/lib/Styles/StyleSet/ThumbButton.d.ts.map +1 -0
  400. package/lib/Styles/StyleSet/ThumbButton.js +44 -0
  401. package/lib/Styles/StyleSet/Toast.d.ts +65 -0
  402. package/lib/Styles/StyleSet/Toast.d.ts.map +1 -0
  403. package/lib/Styles/StyleSet/Toast.js +83 -0
  404. package/lib/Styles/StyleSet/Toaster.d.ts +111 -0
  405. package/lib/Styles/StyleSet/Toaster.d.ts.map +1 -0
  406. package/lib/Styles/StyleSet/Toaster.js +137 -0
  407. package/lib/Styles/StyleSet/TypingAnimation.d.ts +8 -0
  408. package/lib/Styles/StyleSet/TypingAnimation.d.ts.map +1 -0
  409. package/lib/Styles/StyleSet/TypingAnimation.js +26 -0
  410. package/lib/Styles/StyleSet/TypingIndicator.d.ts +11 -0
  411. package/lib/Styles/StyleSet/TypingIndicator.d.ts.map +1 -0
  412. package/lib/Styles/StyleSet/TypingIndicator.js +19 -0
  413. package/lib/Styles/StyleSet/UploadButton.d.ts +14 -0
  414. package/lib/Styles/StyleSet/UploadButton.d.ts.map +1 -0
  415. package/lib/Styles/StyleSet/UploadButton.js +27 -0
  416. package/lib/Styles/StyleSet/VideoAttachment.d.ts +2 -0
  417. package/lib/Styles/StyleSet/VideoAttachment.d.ts.map +1 -0
  418. package/lib/Styles/StyleSet/VideoAttachment.js +10 -0
  419. package/lib/Styles/StyleSet/VideoContent.d.ts +6 -0
  420. package/lib/Styles/StyleSet/VideoContent.d.ts.map +1 -0
  421. package/lib/Styles/StyleSet/VideoContent.js +14 -0
  422. package/lib/Styles/StyleSet/VimeoContent.d.ts +7 -0
  423. package/lib/Styles/StyleSet/VimeoContent.d.ts.map +1 -0
  424. package/lib/Styles/StyleSet/VimeoContent.js +15 -0
  425. package/lib/Styles/StyleSet/WarningNotification.d.ts +22 -0
  426. package/lib/Styles/StyleSet/WarningNotification.d.ts.map +1 -0
  427. package/lib/Styles/StyleSet/WarningNotification.js +37 -0
  428. package/lib/Styles/StyleSet/YouTubeContent.d.ts +7 -0
  429. package/lib/Styles/StyleSet/YouTubeContent.d.ts.map +1 -0
  430. package/lib/Styles/StyleSet/YouTubeContent.js +15 -0
  431. package/lib/Styles/createStyleSet.d.ts +1803 -0
  432. package/lib/Styles/createStyleSet.d.ts.map +1 -0
  433. package/lib/Styles/createStyleSet.js +121 -0
  434. package/lib/Styles/mirrorStyle.js +40 -0
  435. package/lib/Toast/CheckMarkIcon.js +36 -0
  436. package/lib/Toast/CollapseIcon.js +32 -0
  437. package/lib/Toast/DismissIcon.js +32 -0
  438. package/lib/Toast/ExclamationMarkIcon.js +34 -0
  439. package/lib/Toast/ExpandIcon.js +32 -0
  440. package/lib/Toast/NotificationIcon.js +46 -0
  441. package/lib/Toast/createToastMiddleware.d.ts +4 -0
  442. package/lib/Toast/createToastMiddleware.d.ts.map +1 -0
  443. package/lib/Toast/createToastMiddleware.js +26 -0
  444. package/lib/Transcript/ActivityRow.d.ts +9 -0
  445. package/lib/Transcript/ActivityRow.d.ts.map +1 -0
  446. package/lib/Transcript/ActivityRow.js +137 -0
  447. package/lib/Transcript/FocusTrap.d.ts +9 -0
  448. package/lib/Transcript/FocusTrap.d.ts.map +1 -0
  449. package/lib/Transcript/FocusTrap.js +76 -0
  450. package/lib/Transcript/KeyboardHelp.d.ts +4 -0
  451. package/lib/Transcript/KeyboardHelp.d.ts.map +1 -0
  452. package/lib/Transcript/KeyboardHelp.js +562 -0
  453. package/lib/Transcript/LiveRegion/SendFailed.d.ts +14 -0
  454. package/lib/Transcript/LiveRegion/SendFailed.d.ts.map +1 -0
  455. package/lib/Transcript/LiveRegion/SendFailed.js +90 -0
  456. package/lib/Transcript/LiveRegion/isPresentational.d.ts +9 -0
  457. package/lib/Transcript/LiveRegion/isPresentational.d.ts.map +1 -0
  458. package/lib/Transcript/LiveRegion/isPresentational.js +30 -0
  459. package/lib/Transcript/LiveRegionTranscript.d.ts +8 -0
  460. package/lib/Transcript/LiveRegionTranscript.d.ts.map +1 -0
  461. package/lib/Transcript/LiveRegionTranscript.js +178 -0
  462. package/lib/Transcript/types.d.ts +2 -0
  463. package/lib/Transcript/types.d.ts.map +1 -0
  464. package/lib/Transcript/types.js +2 -0
  465. package/lib/Transcript/useActivityAccessibleName.d.ts +11 -0
  466. package/lib/Transcript/useActivityAccessibleName.d.ts.map +1 -0
  467. package/lib/Transcript/useActivityAccessibleName.js +103 -0
  468. package/lib/Transcript/useTypistNames.d.ts +3 -0
  469. package/lib/Transcript/useTypistNames.d.ts.map +1 -0
  470. package/lib/Transcript/useTypistNames.js +50 -0
  471. package/lib/TranscriptActivity.d.ts +17 -0
  472. package/lib/TranscriptActivity.d.ts.map +1 -0
  473. package/lib/TranscriptActivity.js +48 -0
  474. package/lib/Utils/AccessKeySink/Surface.js +74 -0
  475. package/lib/Utils/AccessKeySink/internal/Context.js +11 -0
  476. package/lib/Utils/AccessKeySink/internal/useContext.js +13 -0
  477. package/lib/Utils/AccessKeySink/useFocusAccessKeyEffect.js +34 -0
  478. package/lib/Utils/AccessibleButton.d.ts +11 -0
  479. package/lib/Utils/AccessibleButton.d.ts.map +1 -0
  480. package/lib/Utils/AccessibleButton.js +78 -0
  481. package/lib/Utils/AccessibleInputText.d.ts +22 -0
  482. package/lib/Utils/AccessibleInputText.d.ts.map +1 -0
  483. package/lib/Utils/AccessibleInputText.js +114 -0
  484. package/lib/Utils/AccessibleTextArea.d.ts +20 -0
  485. package/lib/Utils/AccessibleTextArea.d.ts.map +1 -0
  486. package/lib/Utils/AccessibleTextArea.js +105 -0
  487. package/lib/Utils/CroppedImage.js +61 -0
  488. package/lib/Utils/FocusRedirector.d.ts +9 -0
  489. package/lib/Utils/FocusRedirector.d.ts.map +1 -0
  490. package/lib/Utils/FocusRedirector.js +61 -0
  491. package/lib/Utils/InlineMarkdown.js +166 -0
  492. package/lib/Utils/JSONLinkedData/BlankNode.d.ts +15 -0
  493. package/lib/Utils/JSONLinkedData/BlankNode.d.ts.map +1 -0
  494. package/lib/Utils/JSONLinkedData/BlankNode.js +2 -0
  495. package/lib/Utils/JSONLinkedData/__snapshots__/dereferenceBlankNodes.spec.ts.snap +92 -0
  496. package/lib/Utils/JSONLinkedData/dereferenceBlankNodes.d.ts +16 -0
  497. package/lib/Utils/JSONLinkedData/dereferenceBlankNodes.d.ts.map +1 -0
  498. package/lib/Utils/JSONLinkedData/dereferenceBlankNodes.js +96 -0
  499. package/lib/Utils/JSONLinkedData/dereferenceBlankNodes.spec.d.ts +2 -0
  500. package/lib/Utils/JSONLinkedData/dereferenceBlankNodes.spec.d.ts.map +1 -0
  501. package/lib/Utils/JSONLinkedData/getSafeOwnPropertyNames.d.ts +10 -0
  502. package/lib/Utils/JSONLinkedData/getSafeOwnPropertyNames.d.ts.map +1 -0
  503. package/lib/Utils/JSONLinkedData/getSafeOwnPropertyNames.js +22 -0
  504. package/lib/Utils/JSONLinkedData/isBlankNode.d.ts +10 -0
  505. package/lib/Utils/JSONLinkedData/isBlankNode.d.ts.map +1 -0
  506. package/lib/Utils/JSONLinkedData/isBlankNode.js +22 -0
  507. package/lib/Utils/JSONLinkedData/isBlankNode.spec.d.ts +2 -0
  508. package/lib/Utils/JSONLinkedData/isBlankNode.spec.d.ts.map +1 -0
  509. package/lib/Utils/JSONLinkedData/isUnconnectedBlankNode.d.ts +10 -0
  510. package/lib/Utils/JSONLinkedData/isUnconnectedBlankNode.d.ts.map +1 -0
  511. package/lib/Utils/JSONLinkedData/isUnconnectedBlankNode.js +21 -0
  512. package/lib/Utils/JSONLinkedData/isUnconnectedBlankNode.spec.d.ts +2 -0
  513. package/lib/Utils/JSONLinkedData/isUnconnectedBlankNode.spec.d.ts.map +1 -0
  514. package/lib/Utils/JSONLinkedData/visitOnce.d.ts +2 -0
  515. package/lib/Utils/JSONLinkedData/visitOnce.d.ts.map +1 -0
  516. package/lib/Utils/JSONLinkedData/visitOnce.js +17 -0
  517. package/lib/Utils/LocalizedString.d.ts +26 -0
  518. package/lib/Utils/LocalizedString.d.ts.map +1 -0
  519. package/lib/Utils/LocalizedString.js +138 -0
  520. package/lib/Utils/TypeFocusSink/Context.js +14 -0
  521. package/lib/Utils/TypeFocusSink/FocusBox.js +91 -0
  522. package/lib/Utils/TypeFocusSink/getTabIndex.d.ts +2 -0
  523. package/lib/Utils/TypeFocusSink/getTabIndex.d.ts.map +1 -0
  524. package/lib/Utils/TypeFocusSink/getTabIndex.js +27 -0
  525. package/lib/Utils/TypeFocusSink/index.js +18 -0
  526. package/lib/Utils/TypeFocusSink/inputtableKey.d.ts +2 -0
  527. package/lib/Utils/TypeFocusSink/inputtableKey.d.ts.map +1 -0
  528. package/lib/Utils/TypeFocusSink/inputtableKey.js +28 -0
  529. package/lib/Utils/TypeFocusSink/navigableEvent.js +59 -0
  530. package/lib/Utils/activityAltText.d.ts +8 -0
  531. package/lib/Utils/activityAltText.d.ts.map +1 -0
  532. package/lib/Utils/activityAltText.js +79 -0
  533. package/lib/Utils/addTargetBlankToHyperlinksMarkdown.js +34 -0
  534. package/lib/Utils/betterLinks.d.ts +28 -0
  535. package/lib/Utils/betterLinks.d.ts.map +1 -0
  536. package/lib/Utils/betterLinks.js +142 -0
  537. package/lib/Utils/computeSuggestedActionText.d.ts +3 -0
  538. package/lib/Utils/computeSuggestedActionText.d.ts.map +1 -0
  539. package/lib/Utils/computeSuggestedActionText.js +24 -0
  540. package/lib/Utils/createCSSKey.js +16 -0
  541. package/lib/Utils/createCustomEvent.js +34 -0
  542. package/lib/Utils/detectBrowser.js +27 -0
  543. package/lib/Utils/downscaleImageToDataURL/WorkerJob.d.ts +16 -0
  544. package/lib/Utils/downscaleImageToDataURL/WorkerJob.d.ts.map +1 -0
  545. package/lib/Utils/downscaleImageToDataURL/WorkerJob.js +2 -0
  546. package/lib/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingBrowser.d.ts +2 -0
  547. package/lib/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingBrowser.d.ts.map +1 -0
  548. package/lib/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingBrowser.js +90 -0
  549. package/lib/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingWorker.d.ts +4 -0
  550. package/lib/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingWorker.d.ts.map +1 -0
  551. package/lib/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingWorker.js +198 -0
  552. package/lib/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingWorker.worker.js +96 -0
  553. package/lib/Utils/downscaleImageToDataURL/index.d.ts +2 -0
  554. package/lib/Utils/downscaleImageToDataURL/index.d.ts.map +1 -0
  555. package/lib/Utils/downscaleImageToDataURL/index.js +44 -0
  556. package/lib/Utils/filterMap.js +28 -0
  557. package/lib/Utils/findAncestor.d.ts +2 -0
  558. package/lib/Utils/findAncestor.d.ts.map +1 -0
  559. package/lib/Utils/findAncestor.js +15 -0
  560. package/lib/Utils/firstTabbableDescendant.js +40 -0
  561. package/lib/Utils/getActivityUniqueId.d.ts +3 -0
  562. package/lib/Utils/getActivityUniqueId.d.ts.map +1 -0
  563. package/lib/Utils/getActivityUniqueId.js +11 -0
  564. package/lib/Utils/intersectionOf.d.ts +5 -0
  565. package/lib/Utils/intersectionOf.d.ts.map +1 -0
  566. package/lib/Utils/intersectionOf.js +27 -0
  567. package/lib/Utils/isZeroOrPositive.d.ts +5 -0
  568. package/lib/Utils/isZeroOrPositive.d.ts.map +1 -0
  569. package/lib/Utils/isZeroOrPositive.js +14 -0
  570. package/lib/Utils/mapMap.js +27 -0
  571. package/lib/Utils/parseDocumentFromString.d.ts +2 -0
  572. package/lib/Utils/parseDocumentFromString.d.ts.map +1 -0
  573. package/lib/Utils/parseDocumentFromString.js +11 -0
  574. package/lib/Utils/randomId.js +15 -0
  575. package/lib/Utils/readDataURIToBlob.js +44 -0
  576. package/lib/Utils/removeInline.js +18 -0
  577. package/lib/Utils/scrollIntoViewWithBlockNearest.d.ts +7 -0
  578. package/lib/Utils/scrollIntoViewWithBlockNearest.d.ts.map +1 -0
  579. package/lib/Utils/scrollIntoViewWithBlockNearest.js +38 -0
  580. package/lib/Utils/serializeDocumentIntoString.d.ts +2 -0
  581. package/lib/Utils/serializeDocumentIntoString.d.ts.map +1 -0
  582. package/lib/Utils/serializeDocumentIntoString.js +27 -0
  583. package/lib/Utils/shallowEquals.js +21 -0
  584. package/lib/Utils/singleToArray.d.ts +2 -0
  585. package/lib/Utils/singleToArray.d.ts.map +1 -0
  586. package/lib/Utils/singleToArray.js +10 -0
  587. package/lib/Utils/supportPseudoClass.d.ts +2 -0
  588. package/lib/Utils/supportPseudoClass.d.ts.map +1 -0
  589. package/lib/Utils/supportPseudoClass.js +21 -0
  590. package/lib/Utils/tabbableElements.d.ts +2 -0
  591. package/lib/Utils/tabbableElements.d.ts.map +1 -0
  592. package/lib/Utils/tabbableElements.js +20 -0
  593. package/lib/Utils/textFormatToContentType.js +17 -0
  594. package/lib/Utils/updateMarkdownAttrs.js +16 -0
  595. package/lib/Utils/walkMarkdownTokens.js +19 -0
  596. package/lib/hooks/index.d.ts +22 -0
  597. package/lib/hooks/index.d.ts.map +1 -0
  598. package/lib/hooks/index.js +152 -0
  599. package/lib/hooks/internal/BypassSpeechSynthesisPonyfill.js +278 -0
  600. package/lib/hooks/internal/UITracker.js +39 -0
  601. package/lib/hooks/internal/WebChatUIContext.d.ts +8 -0
  602. package/lib/hooks/internal/WebChatUIContext.d.ts.map +1 -0
  603. package/lib/hooks/internal/WebChatUIContext.js +11 -0
  604. package/lib/hooks/internal/createWaitUntilable.d.ts +5 -0
  605. package/lib/hooks/internal/createWaitUntilable.d.ts.map +1 -0
  606. package/lib/hooks/internal/createWaitUntilable.js +50 -0
  607. package/lib/hooks/internal/createWaitUntilable.spec.d.ts +2 -0
  608. package/lib/hooks/internal/createWaitUntilable.spec.d.ts.map +1 -0
  609. package/lib/hooks/internal/private/createOnEventShim.d.ts +5 -0
  610. package/lib/hooks/internal/private/createOnEventShim.d.ts.map +1 -0
  611. package/lib/hooks/internal/private/createOnEventShim.js +25 -0
  612. package/lib/hooks/internal/private/createOnEventShim.spec.d.ts +2 -0
  613. package/lib/hooks/internal/private/createOnEventShim.spec.d.ts.map +1 -0
  614. package/lib/hooks/internal/useChanged.d.ts +9 -0
  615. package/lib/hooks/internal/useChanged.d.ts.map +1 -0
  616. package/lib/hooks/internal/useChanged.js +21 -0
  617. package/lib/hooks/internal/useDispatchScrollPosition.js +12 -0
  618. package/lib/hooks/internal/useDispatchTranscriptFocusByActivityKey.d.ts +2 -0
  619. package/lib/hooks/internal/useDispatchTranscriptFocusByActivityKey.d.ts.map +1 -0
  620. package/lib/hooks/internal/useDispatchTranscriptFocusByActivityKey.js +12 -0
  621. package/lib/hooks/internal/useEnterKeyHint.js +18 -0
  622. package/lib/hooks/internal/useFocusVisible.d.ts +3 -0
  623. package/lib/hooks/internal/useFocusVisible.d.ts.map +1 -0
  624. package/lib/hooks/internal/useFocusVisible.js +37 -0
  625. package/lib/hooks/internal/useFocusWithin.d.ts +3 -0
  626. package/lib/hooks/internal/useFocusWithin.d.ts.map +1 -0
  627. package/lib/hooks/internal/useFocusWithin.js +38 -0
  628. package/lib/hooks/internal/useForceRender.js +24 -0
  629. package/lib/hooks/internal/useForceRenderAtInterval.d.ts +3 -0
  630. package/lib/hooks/internal/useForceRenderAtInterval.d.ts.map +1 -0
  631. package/lib/hooks/internal/useForceRenderAtInterval.js +57 -0
  632. package/lib/hooks/internal/useInternalMarkdownIt.js +14 -0
  633. package/lib/hooks/internal/useInternalRenderMarkdownInline.js +16 -0
  634. package/lib/hooks/internal/useLocalizeAccessKey.d.ts +2 -0
  635. package/lib/hooks/internal/useLocalizeAccessKey.d.ts.map +1 -0
  636. package/lib/hooks/internal/useLocalizeAccessKey.js +38 -0
  637. package/lib/hooks/internal/useMemoWithPrevious.d.ts +3 -0
  638. package/lib/hooks/internal/useMemoWithPrevious.d.ts.map +1 -0
  639. package/lib/hooks/internal/useMemoWithPrevious.js +20 -0
  640. package/lib/hooks/internal/useMemoized.d.ts +11 -0
  641. package/lib/hooks/internal/useMemoized.d.ts.map +1 -0
  642. package/lib/hooks/internal/useMemoized.js +82 -0
  643. package/lib/hooks/internal/useMemoized.spec.jsx +159 -0
  644. package/lib/hooks/internal/useNavigatorPlatform.js +31 -0
  645. package/lib/hooks/internal/useNonce.js +14 -0
  646. package/lib/hooks/internal/useObserveFocusVisible.d.ts +3 -0
  647. package/lib/hooks/internal/useObserveFocusVisible.d.ts.map +1 -0
  648. package/lib/hooks/internal/useObserveFocusVisible.js +201 -0
  649. package/lib/hooks/internal/usePrevious.d.ts +2 -0
  650. package/lib/hooks/internal/usePrevious.d.ts.map +1 -0
  651. package/lib/hooks/internal/usePrevious.js +17 -0
  652. package/lib/hooks/internal/useRegisterFocusTranscript.js +27 -0
  653. package/lib/hooks/internal/useRegisterScrollTo.js +27 -0
  654. package/lib/hooks/internal/useRegisterScrollToEnd.js +25 -0
  655. package/lib/hooks/internal/useReplaceEmoticon.js +58 -0
  656. package/lib/hooks/internal/useResumeAudioContext.d.ts +2 -0
  657. package/lib/hooks/internal/useResumeAudioContext.d.ts.map +1 -0
  658. package/lib/hooks/internal/useResumeAudioContext.js +23 -0
  659. package/lib/hooks/internal/useSendBoxFocusRef.js +12 -0
  660. package/lib/hooks/internal/useSettableDictateAbortable.js +15 -0
  661. package/lib/hooks/internal/useStateRef.d.ts +3 -0
  662. package/lib/hooks/internal/useStateRef.d.ts.map +1 -0
  663. package/lib/hooks/internal/useStateRef.js +30 -0
  664. package/lib/hooks/internal/useStyleToEmotionObject.js +12 -0
  665. package/lib/hooks/internal/useSuggestedActionsAccessKey.js +14 -0
  666. package/lib/hooks/internal/useTimer.d.ts +5 -0
  667. package/lib/hooks/internal/useTimer.d.ts.map +1 -0
  668. package/lib/hooks/internal/useTimer.js +46 -0
  669. package/lib/hooks/internal/useTranscriptActivityElementsRef.js +12 -0
  670. package/lib/hooks/internal/useTranscriptFocusRef.js +12 -0
  671. package/lib/hooks/internal/useUniqueId.d.ts +2 -0
  672. package/lib/hooks/internal/useUniqueId.d.ts.map +1 -0
  673. package/lib/hooks/internal/useUniqueId.js +19 -0
  674. package/lib/hooks/internal/useValueRef.d.ts +3 -0
  675. package/lib/hooks/internal/useValueRef.d.ts.map +1 -0
  676. package/lib/hooks/internal/useValueRef.js +24 -0
  677. package/lib/hooks/internal/useWebChatUIContext.js +17 -0
  678. package/lib/hooks/sendBoxFocus.d.ts +7 -0
  679. package/lib/hooks/sendBoxFocus.d.ts.map +1 -0
  680. package/lib/hooks/sendBoxFocus.js +13 -0
  681. package/lib/hooks/transcriptScrollRelative.d.ts +7 -0
  682. package/lib/hooks/transcriptScrollRelative.d.ts.map +1 -0
  683. package/lib/hooks/transcriptScrollRelative.js +13 -0
  684. package/lib/hooks/useDictateAbortable.d.ts +2 -0
  685. package/lib/hooks/useDictateAbortable.d.ts.map +1 -0
  686. package/lib/hooks/useDictateAbortable.js +22 -0
  687. package/lib/hooks/useFocus.d.ts +2 -0
  688. package/lib/hooks/useFocus.d.ts.map +1 -0
  689. package/lib/hooks/useFocus.js +65 -0
  690. package/lib/hooks/useMakeThumbnail.d.ts +2 -0
  691. package/lib/hooks/useMakeThumbnail.d.ts.map +1 -0
  692. package/lib/hooks/useMakeThumbnail.js +74 -0
  693. package/lib/hooks/useObserveScrollPosition.d.ts +3 -0
  694. package/lib/hooks/useObserveScrollPosition.d.ts.map +1 -0
  695. package/lib/hooks/useObserveScrollPosition.js +31 -0
  696. package/lib/hooks/useObserveTranscriptFocus.d.ts +5 -0
  697. package/lib/hooks/useObserveTranscriptFocus.d.ts.map +1 -0
  698. package/lib/hooks/useObserveTranscriptFocus.js +31 -0
  699. package/lib/hooks/useRenderMarkdownAsHTML.d.ts +5 -0
  700. package/lib/hooks/useRenderMarkdownAsHTML.d.ts.map +1 -0
  701. package/lib/hooks/useRenderMarkdownAsHTML.js +62 -0
  702. package/lib/hooks/useScrollDown.d.ts +4 -0
  703. package/lib/hooks/useScrollDown.d.ts.map +1 -0
  704. package/lib/hooks/useScrollDown.js +20 -0
  705. package/lib/hooks/useScrollTo.d.ts +5 -0
  706. package/lib/hooks/useScrollTo.d.ts.map +1 -0
  707. package/lib/hooks/useScrollTo.js +22 -0
  708. package/lib/hooks/useScrollToEnd.d.ts +2 -0
  709. package/lib/hooks/useScrollToEnd.d.ts.map +1 -0
  710. package/lib/hooks/useScrollToEnd.js +21 -0
  711. package/lib/hooks/useScrollUp.d.ts +4 -0
  712. package/lib/hooks/useScrollUp.d.ts.map +1 -0
  713. package/lib/hooks/useScrollUp.js +20 -0
  714. package/lib/hooks/useSendFiles.d.ts +5 -0
  715. package/lib/hooks/useSendFiles.d.ts.map +1 -0
  716. package/lib/hooks/useSendFiles.js +63 -0
  717. package/lib/hooks/useSendMessage.d.ts +8 -0
  718. package/lib/hooks/useSendMessage.d.ts.map +1 -0
  719. package/lib/hooks/useSendMessage.js +102 -0
  720. package/lib/hooks/useStyleSet.d.ts +3 -0
  721. package/lib/hooks/useStyleSet.d.ts.map +1 -0
  722. package/lib/hooks/useStyleSet.js +13 -0
  723. package/lib/hooks/useWebSpeechPonyfill.d.ts +3 -0
  724. package/lib/hooks/useWebSpeechPonyfill.d.ts.map +1 -0
  725. package/lib/hooks/useWebSpeechPonyfill.js +12 -0
  726. package/lib/index.d.ts +330 -0
  727. package/lib/index.d.ts.map +1 -0
  728. package/lib/index.js +164 -0
  729. package/lib/internal.d.ts +4 -0
  730. package/lib/internal.d.ts.map +1 -0
  731. package/lib/internal.js +21 -0
  732. package/lib/providers/ActivityTree/ActivityTreeComposer.d.ts +7 -0
  733. package/lib/providers/ActivityTree/ActivityTreeComposer.d.ts.map +1 -0
  734. package/lib/providers/ActivityTree/ActivityTreeComposer.js +90 -0
  735. package/lib/providers/ActivityTree/private/Context.d.ts +9 -0
  736. package/lib/providers/ActivityTree/private/Context.d.ts.map +1 -0
  737. package/lib/providers/ActivityTree/private/Context.js +10 -0
  738. package/lib/providers/ActivityTree/private/types.d.ts +10 -0
  739. package/lib/providers/ActivityTree/private/types.d.ts.map +1 -0
  740. package/lib/providers/ActivityTree/private/types.js +2 -0
  741. package/lib/providers/ActivityTree/private/useActivitiesWithRenderer.d.ts +4 -0
  742. package/lib/providers/ActivityTree/private/useActivitiesWithRenderer.d.ts.map +1 -0
  743. package/lib/providers/ActivityTree/private/useActivitiesWithRenderer.js +36 -0
  744. package/lib/providers/ActivityTree/private/useActivityTreeWithRenderer.d.ts +5 -0
  745. package/lib/providers/ActivityTree/private/useActivityTreeWithRenderer.d.ts.map +1 -0
  746. package/lib/providers/ActivityTree/private/useActivityTreeWithRenderer.js +147 -0
  747. package/lib/providers/ActivityTree/private/useContext.d.ts +3 -0
  748. package/lib/providers/ActivityTree/private/useContext.d.ts.map +1 -0
  749. package/lib/providers/ActivityTree/private/useContext.js +18 -0
  750. package/lib/providers/ActivityTree/useActivityTreeWithRenderer.d.ts +8 -0
  751. package/lib/providers/ActivityTree/useActivityTreeWithRenderer.d.ts.map +1 -0
  752. package/lib/providers/ActivityTree/useActivityTreeWithRenderer.js +14 -0
  753. package/lib/providers/LiveRegionTwin/LiveRegionTwinComposer.d.ts +37 -0
  754. package/lib/providers/LiveRegionTwin/LiveRegionTwinComposer.d.ts.map +1 -0
  755. package/lib/providers/LiveRegionTwin/LiveRegionTwinComposer.js +145 -0
  756. package/lib/providers/LiveRegionTwin/private/Context.d.ts +10 -0
  757. package/lib/providers/LiveRegionTwin/private/Context.d.ts.map +1 -0
  758. package/lib/providers/LiveRegionTwin/private/Context.js +11 -0
  759. package/lib/providers/LiveRegionTwin/private/LiveRegionTwinContainer.d.ts +12 -0
  760. package/lib/providers/LiveRegionTwin/private/LiveRegionTwinContainer.d.ts.map +1 -0
  761. package/lib/providers/LiveRegionTwin/private/LiveRegionTwinContainer.js +77 -0
  762. package/lib/providers/LiveRegionTwin/private/types.d.ts +8 -0
  763. package/lib/providers/LiveRegionTwin/private/types.d.ts.map +1 -0
  764. package/lib/providers/LiveRegionTwin/private/types.js +2 -0
  765. package/lib/providers/LiveRegionTwin/private/useContext.d.ts +3 -0
  766. package/lib/providers/LiveRegionTwin/private/useContext.d.ts.map +1 -0
  767. package/lib/providers/LiveRegionTwin/private/useContext.js +18 -0
  768. package/lib/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.d.ts +2 -0
  769. package/lib/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.d.ts.map +1 -0
  770. package/lib/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.js +20 -0
  771. package/lib/providers/LiveRegionTwin/private/useStaticElementEntries.d.ts +3 -0
  772. package/lib/providers/LiveRegionTwin/private/useStaticElementEntries.d.ts.map +1 -0
  773. package/lib/providers/LiveRegionTwin/private/useStaticElementEntries.js +12 -0
  774. package/lib/providers/LiveRegionTwin/useQueueStaticElement.d.ts +8 -0
  775. package/lib/providers/LiveRegionTwin/useQueueStaticElement.d.ts.map +1 -0
  776. package/lib/providers/LiveRegionTwin/useQueueStaticElement.js +17 -0
  777. package/lib/providers/ModalDialog/ModalDialogComposer.d.ts +7 -0
  778. package/lib/providers/ModalDialog/ModalDialogComposer.d.ts.map +1 -0
  779. package/lib/providers/ModalDialog/ModalDialogComposer.js +51 -0
  780. package/lib/providers/ModalDialog/private/Context.d.ts +13 -0
  781. package/lib/providers/ModalDialog/private/Context.d.ts.map +1 -0
  782. package/lib/providers/ModalDialog/private/Context.js +24 -0
  783. package/lib/providers/ModalDialog/private/Popover.d.ts +10 -0
  784. package/lib/providers/ModalDialog/private/Popover.d.ts.map +1 -0
  785. package/lib/providers/ModalDialog/private/Popover.js +79 -0
  786. package/lib/providers/ModalDialog/private/useContext.d.ts +4 -0
  787. package/lib/providers/ModalDialog/private/useContext.d.ts.map +1 -0
  788. package/lib/providers/ModalDialog/private/useContext.js +13 -0
  789. package/lib/providers/ModalDialog/useClose.d.ts +3 -0
  790. package/lib/providers/ModalDialog/useClose.d.ts.map +1 -0
  791. package/lib/providers/ModalDialog/useClose.js +12 -0
  792. package/lib/providers/ModalDialog/useShowModal.d.ts +3 -0
  793. package/lib/providers/ModalDialog/useShowModal.d.ts.map +1 -0
  794. package/lib/providers/ModalDialog/useShowModal.js +12 -0
  795. package/lib/providers/RovingTabIndex/RovingTabIndexComposer.d.ts +8 -0
  796. package/lib/providers/RovingTabIndex/RovingTabIndexComposer.d.ts.map +1 -0
  797. package/lib/providers/RovingTabIndex/RovingTabIndexComposer.js +163 -0
  798. package/lib/providers/RovingTabIndex/private/Context.d.ts +8 -0
  799. package/lib/providers/RovingTabIndex/private/Context.d.ts.map +1 -0
  800. package/lib/providers/RovingTabIndex/private/Context.js +17 -0
  801. package/lib/providers/RovingTabIndex/private/useContext.d.ts +2 -0
  802. package/lib/providers/RovingTabIndex/private/useContext.d.ts.map +1 -0
  803. package/lib/providers/RovingTabIndex/private/useContext.js +18 -0
  804. package/lib/providers/RovingTabIndex/useItemRef.d.ts +3 -0
  805. package/lib/providers/RovingTabIndex/useItemRef.d.ts.map +1 -0
  806. package/lib/providers/RovingTabIndex/useItemRef.js +19 -0
  807. package/lib/providers/Theme/ThemeProvider.d.ts +7 -0
  808. package/lib/providers/Theme/ThemeProvider.d.ts.map +1 -0
  809. package/lib/providers/Theme/ThemeProvider.js +103 -0
  810. package/lib/providers/Theme/private/Context.d.ts +19 -0
  811. package/lib/providers/Theme/private/Context.d.ts.map +1 -0
  812. package/lib/providers/Theme/private/Context.js +26 -0
  813. package/lib/providers/Theme/useTheme.d.ts +2 -0
  814. package/lib/providers/Theme/useTheme.d.ts.map +1 -0
  815. package/lib/providers/Theme/useTheme.js +13 -0
  816. package/lib/providers/TranscriptFocus/TranscriptFocusComposer.d.ts +7 -0
  817. package/lib/providers/TranscriptFocus/TranscriptFocusComposer.d.ts.map +1 -0
  818. package/lib/providers/TranscriptFocus/TranscriptFocusComposer.js +153 -0
  819. package/lib/providers/TranscriptFocus/private/Context.d.ts +12 -0
  820. package/lib/providers/TranscriptFocus/private/Context.d.ts.map +1 -0
  821. package/lib/providers/TranscriptFocus/private/Context.js +11 -0
  822. package/lib/providers/TranscriptFocus/private/useContext.d.ts +2 -0
  823. package/lib/providers/TranscriptFocus/private/useContext.d.ts.map +1 -0
  824. package/lib/providers/TranscriptFocus/private/useContext.js +18 -0
  825. package/lib/providers/TranscriptFocus/useActiveDescendantId.d.ts +2 -0
  826. package/lib/providers/TranscriptFocus/useActiveDescendantId.d.ts.map +1 -0
  827. package/lib/providers/TranscriptFocus/useActiveDescendantId.js +12 -0
  828. package/lib/providers/TranscriptFocus/useFocusByActivityKey.d.ts +8 -0
  829. package/lib/providers/TranscriptFocus/useFocusByActivityKey.d.ts.map +1 -0
  830. package/lib/providers/TranscriptFocus/useFocusByActivityKey.js +18 -0
  831. package/lib/providers/TranscriptFocus/useFocusRelativeActivity.d.ts +2 -0
  832. package/lib/providers/TranscriptFocus/useFocusRelativeActivity.d.ts.map +1 -0
  833. package/lib/providers/TranscriptFocus/useFocusRelativeActivity.js +12 -0
  834. package/lib/providers/TranscriptFocus/useFocusedActivityKey.d.ts +2 -0
  835. package/lib/providers/TranscriptFocus/useFocusedActivityKey.d.ts.map +1 -0
  836. package/lib/providers/TranscriptFocus/useFocusedActivityKey.js +12 -0
  837. package/lib/providers/TranscriptFocus/useFocusedExplicitly.d.ts +2 -0
  838. package/lib/providers/TranscriptFocus/useFocusedExplicitly.d.ts.map +1 -0
  839. package/lib/providers/TranscriptFocus/useFocusedExplicitly.js +12 -0
  840. package/lib/providers/TranscriptFocus/useGetDescendantIdByActivityKey.d.ts +2 -0
  841. package/lib/providers/TranscriptFocus/useGetDescendantIdByActivityKey.d.ts.map +1 -0
  842. package/lib/providers/TranscriptFocus/useGetDescendantIdByActivityKey.js +12 -0
  843. package/lib/providers/internal/SendBox/SendBoxComposer.d.ts +4 -0
  844. package/lib/providers/internal/SendBox/SendBoxComposer.d.ts.map +1 -0
  845. package/lib/providers/internal/SendBox/SendBoxComposer.js +161 -0
  846. package/lib/providers/internal/SendBox/private/Context.d.ts +4 -0
  847. package/lib/providers/internal/SendBox/private/Context.d.ts.map +1 -0
  848. package/lib/providers/internal/SendBox/private/Context.js +11 -0
  849. package/lib/providers/internal/SendBox/private/types.d.ts +8 -0
  850. package/lib/providers/internal/SendBox/private/types.d.ts.map +1 -0
  851. package/lib/providers/internal/SendBox/private/types.js +2 -0
  852. package/lib/providers/internal/SendBox/private/useContext.d.ts +3 -0
  853. package/lib/providers/internal/SendBox/private/useContext.d.ts.map +1 -0
  854. package/lib/providers/internal/SendBox/private/useContext.js +17 -0
  855. package/lib/providers/internal/SendBox/useErrorMessageId.d.ts +12 -0
  856. package/lib/providers/internal/SendBox/useErrorMessageId.d.ts.map +1 -0
  857. package/lib/providers/internal/SendBox/useErrorMessageId.js +22 -0
  858. package/lib/providers/internal/SendBox/useSubmit.d.ts +14 -0
  859. package/lib/providers/internal/SendBox/useSubmit.d.ts.map +1 -0
  860. package/lib/providers/internal/SendBox/useSubmit.js +20 -0
  861. package/lib/tsconfig.json +18 -0
  862. package/lib/types/ContextOf.d.ts +4 -0
  863. package/lib/types/ContextOf.d.ts.map +1 -0
  864. package/lib/types/ContextOf.js +2 -0
  865. package/lib/types/PropsOf.d.ts +3 -0
  866. package/lib/types/PropsOf.d.ts.map +1 -0
  867. package/lib/types/PropsOf.js +2 -0
  868. package/lib/types/ScrollPosition.d.ts +6 -0
  869. package/lib/types/ScrollPosition.d.ts.map +1 -0
  870. package/lib/types/ScrollPosition.js +2 -0
  871. package/lib/types/internal/FocusTranscriptInit.d.ts +4 -0
  872. package/lib/types/internal/FocusTranscriptInit.d.ts.map +1 -0
  873. package/lib/types/internal/FocusTranscriptInit.js +2 -0
  874. package/lib/types/internal/SendStatus.d.ts +7 -0
  875. package/lib/types/internal/SendStatus.d.ts.map +1 -0
  876. package/lib/types/internal/SendStatus.js +19 -0
  877. package/lib/types/internal/TypeOfArray.d.ts +2 -0
  878. package/lib/types/internal/TypeOfArray.d.ts.map +1 -0
  879. package/lib/types/internal/TypeOfArray.js +2 -0
  880. package/lib/withEmoji/private/UndoEntry.d.ts +9 -0
  881. package/lib/withEmoji/private/UndoEntry.d.ts.map +1 -0
  882. package/lib/withEmoji/private/UndoEntry.js +69 -0
  883. package/lib/withEmoji/private/useUndoStack.d.ts +6 -0
  884. package/lib/withEmoji/private/useUndoStack.d.ts.map +1 -0
  885. package/lib/withEmoji/private/useUndoStack.js +64 -0
  886. package/lib/withEmoji/withEmoji.d.ts +15 -0
  887. package/lib/withEmoji/withEmoji.d.ts.map +1 -0
  888. package/lib/withEmoji/withEmoji.js +128 -0
  889. package/package.json +81 -146
  890. package/src/Activity/Avatar.tsx +23 -20
  891. package/src/Activity/Bubble.tsx +70 -45
  892. package/src/Activity/CarouselFilmStrip.js +112 -31
  893. package/src/Activity/CarouselFilmStripAttachment.js +15 -14
  894. package/src/Activity/CarouselLayout.js +17 -16
  895. package/src/Activity/SayAlt.js +26 -0
  896. package/src/Activity/Speak.tsx +42 -84
  897. package/src/Activity/StackedLayout.tsx +198 -265
  898. package/src/ActivityStatus/AbsoluteTime.js +32 -0
  899. package/src/ActivityStatus/OthersActivityStatus.tsx +53 -52
  900. package/src/ActivityStatus/SelfActivityStatus.tsx +8 -11
  901. package/src/ActivityStatus/SendStatus/SendStatus.tsx +23 -23
  902. package/src/ActivityStatus/Slotted.tsx +26 -0
  903. package/src/ActivityStatus/Timestamp.tsx +12 -17
  904. package/src/ActivityStatus/private/Feedback/Feedback.tsx +60 -0
  905. package/src/ActivityStatus/private/Feedback/private/ThumbButton.Image.tsx +30 -0
  906. package/src/ActivityStatus/private/Feedback/private/ThumbButton.tsx +54 -0
  907. package/src/ActivityStatus/private/Feedback/private/VoteButton.tsx +36 -0
  908. package/src/ActivityStatus/private/Feedback/private/icons/ThumbDislike16Filled.tsx +16 -0
  909. package/src/ActivityStatus/private/Feedback/private/icons/ThumbDislike16Regular.tsx +16 -0
  910. package/src/ActivityStatus/private/Feedback/private/icons/ThumbLike16Filled.tsx +16 -0
  911. package/src/ActivityStatus/private/Feedback/private/icons/ThumbLike16Regular.tsx +16 -0
  912. package/src/ActivityStatus/private/Originator.tsx +10 -33
  913. package/src/ActivityStatus/private/RelativeTime.js +31 -0
  914. package/src/Assets/TypingAnimation.js +1 -3
  915. package/src/Attachment/Assets/DownloadIcon.js +29 -0
  916. package/src/Attachment/AudioContent.tsx +29 -20
  917. package/src/Attachment/FileContent.tsx +46 -46
  918. package/src/Attachment/HTMLVideoContent.tsx +27 -21
  919. package/src/Attachment/ImageAttachment.js +37 -0
  920. package/src/Attachment/ImageContent.tsx +27 -13
  921. package/src/Attachment/Text/TextAttachment.tsx +14 -38
  922. package/src/Attachment/Text/TextContent.tsx +16 -40
  923. package/src/Attachment/Text/private/CitationModalContent.tsx +21 -28
  924. package/src/Attachment/Text/private/MarkdownTextContent.tsx +126 -223
  925. package/src/Attachment/Text/private/MessageSensitivityLabel.tsx +34 -47
  926. package/src/Attachment/Text/private/PlainTextContent.tsx +14 -24
  927. package/src/Attachment/Text/private/ShieldIcon.tsx +34 -52
  928. package/src/Attachment/VideoAttachment.js +1 -1
  929. package/src/Attachment/VideoContent.tsx +27 -21
  930. package/src/Attachment/VimeoContent.tsx +25 -21
  931. package/src/Attachment/YouTubeContent.tsx +25 -21
  932. package/src/Avatar/ImageAvatar.js +49 -0
  933. package/src/Avatar/InitialsAvatar.js +50 -0
  934. package/src/BasicConnectivityStatus.js +7 -7
  935. package/src/BasicToast.js +1 -1
  936. package/src/BasicToaster.js +8 -47
  937. package/src/BasicTranscript.tsx +587 -402
  938. package/src/BasicWebChat.tsx +34 -28
  939. package/src/Composer.tsx +128 -226
  940. package/src/ConnectivityStatus/Connecting.js +72 -0
  941. package/src/Dictation.js +24 -16
  942. package/src/ErrorBox.tsx +26 -54
  943. package/src/LinkDefinition/LinkDefinitionItem.tsx +21 -51
  944. package/src/LinkDefinition/LinkDefinitions.tsx +19 -84
  945. package/src/LinkDefinition/index.ts +4 -6
  946. package/src/LinkDefinition/private/Badge.tsx +1 -12
  947. package/src/LinkDefinition/private/Chevron.tsx +21 -0
  948. package/src/LinkDefinition/private/ItemBody.tsx +15 -24
  949. package/src/LinkDefinition/private/OpenInNewWindowIcon.tsx +13 -20
  950. package/src/LinkDefinition/private/extractHostnameWithSubdomain.spec.ts +0 -2
  951. package/src/LinkDefinition/private/extractHostnameWithSubdomain.ts +1 -1
  952. package/src/LiveRegion/LiveRegionActivity.tsx +18 -18
  953. package/src/LiveRegion/private/LiveRegionSuggestedActions.tsx +25 -34
  954. package/src/Middleware/Activity/createCoreMiddleware.tsx +102 -0
  955. package/src/Middleware/ActivityStatus/createTimestampMiddleware.tsx +2 -2
  956. package/src/Middleware/Avatar/createCoreMiddleware.tsx +76 -0
  957. package/src/Middleware/ScrollToEndButton/ScrollToEndButton.js +45 -0
  958. package/src/ReactWebChat.tsx +8 -3
  959. package/src/ScreenReaderText.tsx +34 -27
  960. package/src/SendBox/Assets/MicrophoneIcon.js +12 -0
  961. package/src/SendBox/Assets/SendIcon.js +36 -0
  962. package/src/SendBox/AutoResizeTextArea.tsx +64 -28
  963. package/src/SendBox/BasicSendBox.tsx +30 -99
  964. package/src/SendBox/DictationInterims.tsx +21 -32
  965. package/src/SendBox/IconButton.tsx +30 -32
  966. package/src/SendBox/MicrophoneButton.tsx +23 -29
  967. package/src/SendBox/SendButton.tsx +21 -26
  968. package/src/SendBox/SuggestedAction.tsx +72 -60
  969. package/src/SendBox/SuggestedActions.tsx +9 -6
  970. package/src/SendBox/TextBox.tsx +39 -57
  971. package/src/SendBoxToolbar/Assets/AttachmentIcon.tsx +23 -6
  972. package/src/SendBoxToolbar/BasicSendBoxToolbar.tsx +2 -4
  973. package/src/SendBoxToolbar/UploadButton.tsx +26 -47
  974. package/src/Styles/CustomPropertyNames.ts +6 -66
  975. package/src/Styles/StyleSet/AudioAttachment.ts +3 -3
  976. package/src/Styles/StyleSet/Avatar.ts +3 -4
  977. package/src/Styles/StyleSet/CSSCustomProperties.ts +46 -0
  978. package/src/Styles/StyleSet/CarouselFilmStrip.ts +7 -9
  979. package/src/Styles/StyleSet/CarouselFilmStripAttachment.ts +4 -3
  980. package/src/Styles/StyleSet/ErrorBox.ts +2 -2
  981. package/src/Styles/StyleSet/FileContent.ts +1 -2
  982. package/src/Styles/StyleSet/ImageAvatar.ts +5 -8
  983. package/src/Styles/StyleSet/InitialsAvatar.ts +5 -4
  984. package/src/Styles/StyleSet/KeyboardHelp.ts +204 -0
  985. package/src/Styles/StyleSet/LinkDefinitions.ts +11 -17
  986. package/src/Styles/StyleSet/MicrophoneButton.ts +1 -1
  987. package/src/Styles/StyleSet/ModalDialog.ts +8 -14
  988. package/src/Styles/StyleSet/RenderMarkdown.ts +0 -35
  989. package/src/Styles/StyleSet/ScrollToEndButton.ts +11 -0
  990. package/src/Styles/StyleSet/SendBox.ts +7 -57
  991. package/src/Styles/StyleSet/SendBoxButton.ts +5 -7
  992. package/src/Styles/StyleSet/SendBoxTextBox.ts +1 -6
  993. package/src/Styles/StyleSet/SendStatus.ts +0 -12
  994. package/src/Styles/StyleSet/SingleAttachmentActivity.ts +18 -0
  995. package/src/Styles/StyleSet/SlottedActivityStatus.ts +16 -0
  996. package/src/Styles/StyleSet/SpinnerAnimation.ts +1 -3
  997. package/src/Styles/StyleSet/StackedLayout.ts +9 -18
  998. package/src/Styles/StyleSet/SuggestedAction.ts +13 -1
  999. package/src/Styles/StyleSet/TextContent.ts +2 -17
  1000. package/src/Styles/StyleSet/ThumbButton.ts +24 -77
  1001. package/src/Styles/StyleSet/TypingAnimation.ts +1 -3
  1002. package/src/Styles/createStyleSet.ts +14 -14
  1003. package/src/Transcript/ActivityRow.tsx +39 -100
  1004. package/src/Transcript/FocusTrap.tsx +38 -96
  1005. package/src/Transcript/KeyboardHelp.tsx +319 -0
  1006. package/src/Transcript/LiveRegion/SendFailed.tsx +10 -8
  1007. package/src/Transcript/LiveRegionTranscript.tsx +62 -11
  1008. package/src/TranscriptActivity.tsx +64 -0
  1009. package/src/Utils/AccessKeySink/Surface.js +56 -0
  1010. package/src/Utils/AccessibleButton.tsx +49 -64
  1011. package/src/Utils/AccessibleInputText.tsx +106 -97
  1012. package/src/Utils/AccessibleTextArea.tsx +41 -10
  1013. package/src/Utils/CroppedImage.js +45 -0
  1014. package/src/Utils/FocusRedirector.tsx +26 -31
  1015. package/src/Utils/InlineMarkdown.js +1 -6
  1016. package/src/Utils/JSONLinkedData/__snapshots__/dereferenceBlankNodes.spec.ts.snap +17 -17
  1017. package/src/Utils/JSONLinkedData/dereferenceBlankNodes.spec.ts +0 -2
  1018. package/src/Utils/JSONLinkedData/dereferenceBlankNodes.ts +1 -1
  1019. package/src/Utils/JSONLinkedData/getSafeOwnPropertyNames.ts +2 -2
  1020. package/src/Utils/JSONLinkedData/isUnconnectedBlankNode.spec.ts +0 -2
  1021. package/src/Utils/LocalizedString.tsx +3 -3
  1022. package/src/Utils/addTargetBlankToHyperlinksMarkdown.spec.js +4 -4
  1023. package/src/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingBrowser.ts +0 -2
  1024. package/src/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingWorker.ts +4 -4
  1025. package/src/Utils/firstTabbableDescendant.js +1 -0
  1026. package/src/Utils/parseDocumentFromString.ts +5 -0
  1027. package/src/Utils/readDataURIToBlob.js +31 -0
  1028. package/src/Utils/serializeDocumentIntoString.ts +10 -0
  1029. package/src/Utils/singleToArray.ts +3 -0
  1030. package/src/Utils/supportPseudoClass.ts +1 -1
  1031. package/src/Utils/tabbableElements.ts +1 -7
  1032. package/src/Utils/textFormatToContentType.js +12 -0
  1033. package/src/Utils/updateMarkdownAttrs.spec.js +14 -14
  1034. package/src/Utils/walkMarkdownTokens.spec.js +1 -1
  1035. package/src/hooks/index.ts +0 -4
  1036. package/src/hooks/internal/UITracker.js +1 -1
  1037. package/src/hooks/internal/WebChatUIContext.ts +1 -19
  1038. package/src/hooks/internal/createWaitUntilable.spec.ts +2 -4
  1039. package/src/hooks/internal/createWaitUntilable.ts +1 -1
  1040. package/src/hooks/internal/private/createOnEventShim.spec.ts +0 -2
  1041. package/src/hooks/internal/useForceRenderAtInterval.ts +6 -6
  1042. package/src/hooks/internal/useMemoWithPrevious.ts +16 -0
  1043. package/src/hooks/internal/useMemoized.spec.jsx +3 -3
  1044. package/src/hooks/internal/useMemoized.ts +1 -1
  1045. package/src/hooks/internal/useNonce.js +7 -0
  1046. package/src/hooks/internal/useObserveFocusVisible.ts +1 -0
  1047. package/src/hooks/internal/useStateRef.ts +1 -1
  1048. package/src/hooks/internal/useStyleToEmotionObject.js +5 -0
  1049. package/src/hooks/sendBoxFocus.ts +2 -6
  1050. package/src/hooks/transcriptScrollRelative.ts +3 -6
  1051. package/src/hooks/useObserveScrollPosition.ts +0 -3
  1052. package/src/hooks/useObserveTranscriptFocus.ts +3 -9
  1053. package/src/hooks/useRenderMarkdownAsHTML.ts +29 -32
  1054. package/src/hooks/useSendFiles.ts +1 -4
  1055. package/src/index.ts +125 -30
  1056. package/src/internal.ts +4 -0
  1057. package/src/providers/ActivityTree/ActivityTreeComposer.tsx +90 -0
  1058. package/src/providers/ActivityTree/private/Context.ts +12 -0
  1059. package/src/providers/ActivityTree/private/types.ts +12 -0
  1060. package/src/providers/ActivityTree/private/useActivitiesWithRenderer.ts +40 -0
  1061. package/src/providers/ActivityTree/private/useActivityTreeWithRenderer.ts +140 -0
  1062. package/src/providers/ActivityTree/private/useContext.ts +15 -0
  1063. package/src/providers/ActivityTree/useActivityTreeWithRenderer.ts +16 -0
  1064. package/src/providers/LiveRegionTwin/LiveRegionTwinComposer.tsx +172 -0
  1065. package/src/providers/LiveRegionTwin/private/Context.ts +15 -0
  1066. package/src/providers/LiveRegionTwin/private/LiveRegionTwinContainer.tsx +39 -27
  1067. package/src/providers/LiveRegionTwin/private/useContext.ts +8 -2
  1068. package/src/providers/LiveRegionTwin/useQueueStaticElement.ts +2 -2
  1069. package/src/providers/ModalDialog/private/Popover.tsx +15 -5
  1070. package/src/providers/RovingTabIndex/RovingTabIndexComposer.tsx +23 -20
  1071. package/src/providers/Theme/ThemeProvider.tsx +40 -119
  1072. package/src/providers/Theme/private/Context.ts +18 -18
  1073. package/src/providers/TranscriptFocus/TranscriptFocusComposer.tsx +68 -325
  1074. package/src/providers/TranscriptFocus/private/Context.ts +0 -4
  1075. package/src/providers/TranscriptFocus/useActiveDescendantId.ts +1 -4
  1076. package/src/providers/TranscriptFocus/useFocusRelativeActivity.ts +1 -1
  1077. package/src/providers/internal/SendBox/SendBoxComposer.tsx +38 -30
  1078. package/src/tsconfig.json +14 -8
  1079. package/LICENSE +0 -21
  1080. package/boot/deprecated/component.js +0 -7
  1081. package/boot/deprecated/component.mjs +0 -5
  1082. package/boot/deprecated/decorator.js +0 -7
  1083. package/boot/deprecated/decorator.mjs +0 -5
  1084. package/boot/deprecated/hook.js +0 -7
  1085. package/boot/deprecated/hook.mjs +0 -5
  1086. package/boot/deprecated/internal.js +0 -7
  1087. package/boot/deprecated/internal.mjs +0 -5
  1088. package/component.js +0 -3
  1089. package/decorator.js +0 -3
  1090. package/dist/TextBox-BEU2rUID.d.mts +0 -46
  1091. package/dist/TextBox-BEU2rUID.d.ts +0 -46
  1092. package/dist/_dtsroll-chunks/BlpMO3PT-empty-object.d.ts +0 -34
  1093. package/dist/_dtsroll-chunks/Cha1SOtx-botframework-webchat-styles.react.d.ts +0 -38
  1094. package/dist/_dtsroll-chunks/DP9nda2m-botframework-webchat-react-hooks.d.ts +0 -19
  1095. package/dist/botframework-webchat-component.component.css +0 -2
  1096. package/dist/botframework-webchat-component.component.css.map +0 -1
  1097. package/dist/botframework-webchat-component.component.d.mts +0 -9
  1098. package/dist/botframework-webchat-component.component.d.ts +0 -9
  1099. package/dist/botframework-webchat-component.component.js +0 -2
  1100. package/dist/botframework-webchat-component.component.js.map +0 -1
  1101. package/dist/botframework-webchat-component.component.mjs +0 -2
  1102. package/dist/botframework-webchat-component.component.mjs.map +0 -1
  1103. package/dist/botframework-webchat-component.css +0 -2
  1104. package/dist/botframework-webchat-component.css.map +0 -1
  1105. package/dist/botframework-webchat-component.d.ts +0 -90
  1106. package/dist/botframework-webchat-component.decorator.css +0 -2
  1107. package/dist/botframework-webchat-component.decorator.css.map +0 -1
  1108. package/dist/botframework-webchat-component.decorator.d.mts +0 -28
  1109. package/dist/botframework-webchat-component.decorator.d.ts +0 -28
  1110. package/dist/botframework-webchat-component.decorator.js +0 -2
  1111. package/dist/botframework-webchat-component.decorator.js.map +0 -1
  1112. package/dist/botframework-webchat-component.decorator.mjs +0 -2
  1113. package/dist/botframework-webchat-component.decorator.mjs.map +0 -1
  1114. package/dist/botframework-webchat-component.hook.css +0 -2
  1115. package/dist/botframework-webchat-component.hook.css.map +0 -1
  1116. package/dist/botframework-webchat-component.hook.d.mts +0 -8
  1117. package/dist/botframework-webchat-component.hook.d.ts +0 -8
  1118. package/dist/botframework-webchat-component.hook.js +0 -2
  1119. package/dist/botframework-webchat-component.hook.js.map +0 -1
  1120. package/dist/botframework-webchat-component.hook.mjs +0 -2
  1121. package/dist/botframework-webchat-component.hook.mjs.map +0 -1
  1122. package/dist/botframework-webchat-component.internal.css +0 -2
  1123. package/dist/botframework-webchat-component.internal.css.map +0 -1
  1124. package/dist/botframework-webchat-component.internal.d.ts +0 -70
  1125. package/dist/botframework-webchat-component.internal.js +0 -2
  1126. package/dist/botframework-webchat-component.internal.js.map +0 -1
  1127. package/dist/botframework-webchat-component.js +0 -2
  1128. package/dist/botframework-webchat-component.js.map +0 -1
  1129. package/dist/chunk-4IEFVGFY.mjs +0 -2
  1130. package/dist/chunk-4IEFVGFY.mjs.map +0 -1
  1131. package/dist/chunk-AUUHHO4G.mjs +0 -2
  1132. package/dist/chunk-AUUHHO4G.mjs.map +0 -1
  1133. package/dist/chunk-BUJ23PGG.js +0 -77
  1134. package/dist/chunk-BUJ23PGG.js.map +0 -1
  1135. package/dist/chunk-EYXG4PAK.js +0 -2
  1136. package/dist/chunk-EYXG4PAK.js.map +0 -1
  1137. package/dist/chunk-FA5SN6F3.js +0 -2
  1138. package/dist/chunk-FA5SN6F3.js.map +0 -1
  1139. package/dist/chunk-H443W2JC.mjs +0 -2
  1140. package/dist/chunk-H443W2JC.mjs.map +0 -1
  1141. package/dist/chunk-I2HRS7P3.js +0 -2
  1142. package/dist/chunk-I2HRS7P3.js.map +0 -1
  1143. package/dist/chunk-I6DJ35K3.mjs +0 -2
  1144. package/dist/chunk-I6DJ35K3.mjs.map +0 -1
  1145. package/dist/chunk-I6EXXZUN.js +0 -2
  1146. package/dist/chunk-I6EXXZUN.js.map +0 -1
  1147. package/dist/chunk-IB5KEWTO.js +0 -2
  1148. package/dist/chunk-IB5KEWTO.js.map +0 -1
  1149. package/dist/chunk-NNNAE55I.mjs +0 -2
  1150. package/dist/chunk-NNNAE55I.mjs.map +0 -1
  1151. package/dist/chunk-TMUNLKZW.js +0 -2
  1152. package/dist/chunk-TMUNLKZW.js.map +0 -1
  1153. package/dist/chunk-UKBRB4EA.mjs +0 -2
  1154. package/dist/chunk-UKBRB4EA.mjs.map +0 -1
  1155. package/dist/chunk-UXADOWHM.mjs +0 -77
  1156. package/dist/chunk-UXADOWHM.mjs.map +0 -1
  1157. package/dist/component-BtSxgJS5.d.mts +0 -539
  1158. package/dist/component-Fyy8iCRE.d.ts +0 -539
  1159. package/dist/hook-B7KuomGm.d.mts +0 -2259
  1160. package/dist/hook-o9AgRedV.d.ts +0 -2259
  1161. package/dist/metafile-cjs.json +0 -1
  1162. package/hook.js +0 -3
  1163. package/src/Activity/AttachmentRow.tsx +0 -56
  1164. package/src/Activity/Bubble.module.css +0 -131
  1165. package/src/Activity/CarouselFilmStrip.module.css +0 -155
  1166. package/src/Activity/CarouselFilmStripAttachment.module.css +0 -38
  1167. package/src/Activity/CarouselLayout.module.css +0 -30
  1168. package/src/Activity/CodeBlockContent.module.css +0 -40
  1169. package/src/Activity/CodeBlockContent.tsx +0 -42
  1170. package/src/Activity/CollapsibleContent.module.css +0 -43
  1171. package/src/Activity/CollapsibleContent.tsx +0 -68
  1172. package/src/Activity/SayAlt.module.css +0 -4
  1173. package/src/Activity/SayAlt.tsx +0 -25
  1174. package/src/Activity/StackedLayout.module.css +0 -233
  1175. package/src/Activity/StackedLayoutMain.tsx +0 -36
  1176. package/src/Activity/StackedLayoutMessageStatus.tsx +0 -57
  1177. package/src/Activity/StackedLayoutRoot.tsx +0 -71
  1178. package/src/Activity/StackedLayoutStatus.tsx +0 -36
  1179. package/src/Activity/private/MessageStatusLoader.module.css +0 -18
  1180. package/src/Activity/private/MessageStatusLoader.tsx +0 -27
  1181. package/src/ActivityDebug/RestrictedActivityDebugAPI.ts +0 -15
  1182. package/src/ActivityDebug/index.ts +0 -1
  1183. package/src/ActivityFeedback/ActivityFeedback.tsx +0 -88
  1184. package/src/ActivityFeedback/private/FeedbackForm.module.css +0 -123
  1185. package/src/ActivityFeedback/private/FeedbackForm.tsx +0 -83
  1186. package/src/ActivityFeedback/private/FeedbackVoteButton.tsx +0 -88
  1187. package/src/ActivityFeedback/private/FeedbackVoteButtonBar.tsx +0 -40
  1188. package/src/ActivityFeedback/private/ThumbButton.Image.tsx +0 -35
  1189. package/src/ActivityFeedback/private/ThumbButton.module.css +0 -91
  1190. package/src/ActivityFeedback/private/ThumbButton.tsx +0 -103
  1191. package/src/ActivityFeedback/private/canActionResubmit.ts +0 -6
  1192. package/src/ActivityFeedback/private/getDisclaimerFromFeedbackLoop.ts +0 -10
  1193. package/src/ActivityFeedback/private/getDisclaimerFromReviewAction.ts +0 -12
  1194. package/src/ActivityFeedback/private/hasFeedbackLoop.ts +0 -42
  1195. package/src/ActivityFeedback/private/isActionRequireReview.ts +0 -10
  1196. package/src/ActivityFeedback/providers/ActivityFeedbackComposer.tsx +0 -372
  1197. package/src/ActivityFeedback/providers/private/ActivityFeedbackContext.ts +0 -24
  1198. package/src/ActivityFeedback/providers/private/FocusPropagation.ts +0 -10
  1199. package/src/ActivityFeedback/providers/useActivityFeedbackHooks.ts +0 -6
  1200. package/src/ActivityStatus/AbsoluteTime.tsx +0 -37
  1201. package/src/ActivityStatus/ActivityStatus.module.css +0 -31
  1202. package/src/ActivityStatus/StatusSlot.tsx +0 -17
  1203. package/src/ActivityStatus/private/RelativeTime.tsx +0 -43
  1204. package/src/Attachment/ImageAttachment.tsx +0 -58
  1205. package/src/Attachment/Text/TextContent.module.css +0 -45
  1206. package/src/Attachment/Text/private/ActivityButton.module.css +0 -45
  1207. package/src/Attachment/Text/private/ActivityButton.tsx +0 -71
  1208. package/src/Attachment/Text/private/ActivityCopyButton.module.css +0 -45
  1209. package/src/Attachment/Text/private/ActivityCopyButton.tsx +0 -109
  1210. package/src/Attachment/Text/private/ActivityViewCodeButton.tsx +0 -66
  1211. package/src/Attachment/Text/private/CitationModal.module.css +0 -9
  1212. package/src/Attachment/Text/private/CodeContent.tsx +0 -44
  1213. package/src/Attachment/Text/private/Markdownable.tsx +0 -39
  1214. package/src/Attachment/Text/private/ViewCodeDialog.module.css +0 -59
  1215. package/src/Attachment/Text/private/isAIGeneratedActivity.ts +0 -5
  1216. package/src/Avatar/ImageAvatar.tsx +0 -48
  1217. package/src/Avatar/InitialsAvatar.tsx +0 -55
  1218. package/src/BuiltInDecorator.tsx +0 -17
  1219. package/src/ChatHistory/ChatHistoryBox.tsx +0 -27
  1220. package/src/ChatHistory/ChatHistoryToolbar.tsx +0 -36
  1221. package/src/ChatHistory/private/ScrollToEndButton.tsx +0 -105
  1222. package/src/ConnectivityStatus/Connecting.tsx +0 -77
  1223. package/src/Icon/ComponentIcon.module.css +0 -113
  1224. package/src/Icon/ComponentIcon.tsx +0 -59
  1225. package/src/Icon/index.ts +0 -1
  1226. package/src/LinkDefinition/LinkDefinitions.module.css +0 -209
  1227. package/src/Middleware/Activity/defaultActivityPolymiddleware.tsx +0 -104
  1228. package/src/Middleware/ActivityGrouping/createDefaultActivityGroupingDecoratorMiddleware.tsx +0 -21
  1229. package/src/Middleware/ActivityGrouping/ui/LegacyActivityBridgeComposer.tsx +0 -91
  1230. package/src/Middleware/ActivityGrouping/ui/PartGrouping/CollapsibleGrouping.module.css +0 -76
  1231. package/src/Middleware/ActivityGrouping/ui/PartGrouping/CollapsibleGrouping.tsx +0 -97
  1232. package/src/Middleware/ActivityGrouping/ui/PartGrouping/CollapsibleGroupingList.tsx +0 -30
  1233. package/src/Middleware/ActivityGrouping/ui/PartGrouping/CollapsibleGroupingTitle.tsx +0 -29
  1234. package/src/Middleware/ActivityGrouping/ui/PartGrouping/PartGrouping.tsx +0 -52
  1235. package/src/Middleware/ActivityGrouping/ui/PartGrouping/private/PartGroupingActivity.module.css +0 -29
  1236. package/src/Middleware/ActivityGrouping/ui/PartGrouping/private/PartGroupingActivity.tsx +0 -258
  1237. package/src/Middleware/ActivityGrouping/ui/PartGrouping/private/usePartGroupingLogicalGroup.ts +0 -41
  1238. package/src/Middleware/ActivityGrouping/ui/RenderActivity.tsx +0 -37
  1239. package/src/Middleware/ActivityGrouping/ui/RenderActivityGrouping.tsx +0 -41
  1240. package/src/Middleware/ActivityGrouping/ui/SenderGrouping/SenderGrouping.tsx +0 -49
  1241. package/src/Middleware/ActivityGrouping/ui/SenderGrouping/private/SenderGroupingContext.ts +0 -18
  1242. package/src/Middleware/ActivityGrouping/ui/SenderGrouping/private/useSenderGroupingContext.ts +0 -6
  1243. package/src/Middleware/ActivityGrouping/ui/SenderGrouping/useFirstActivity.ts +0 -6
  1244. package/src/Middleware/ActivityGrouping/ui/SenderGrouping/useLastActivity.ts +0 -6
  1245. package/src/Middleware/ActivityGrouping/ui/StatusGrouping/StatusGrouping.tsx +0 -49
  1246. package/src/Middleware/ActivityGrouping/ui/StatusGrouping/private/StatusGroupingContext.ts +0 -18
  1247. package/src/Middleware/ActivityGrouping/ui/StatusGrouping/private/useStatusGroupingContext.ts +0 -6
  1248. package/src/Middleware/ActivityGrouping/ui/StatusGrouping/useFirstActivity.ts +0 -6
  1249. package/src/Middleware/ActivityGrouping/ui/StatusGrouping/useLastActivity.ts +0 -6
  1250. package/src/Middleware/Avatar/DefaultAvatar.tsx +0 -61
  1251. package/src/Middleware/Avatar/createDefaultAvatarPolymiddleware.tsx +0 -22
  1252. package/src/Middleware/ScrollToEndButton/ScrollToEndButton.tsx +0 -58
  1253. package/src/SendBox/AttachmentBar/AttachmentBar.module.css +0 -32
  1254. package/src/SendBox/AttachmentBar/AttachmentBar.tsx +0 -71
  1255. package/src/SendBox/AttachmentBar/AttachmentBarItem.module.css +0 -137
  1256. package/src/SendBox/AttachmentBar/AttachmentBarItem.tsx +0 -103
  1257. package/src/SendBox/AttachmentBar/ItemDeleteButton.tsx +0 -61
  1258. package/src/SendBox/AttachmentBar/ItemPreview.tsx +0 -52
  1259. package/src/SendBox/AttachmentBar/Preview/FilePreview.module.css +0 -35
  1260. package/src/SendBox/AttachmentBar/Preview/FilePreview.tsx +0 -63
  1261. package/src/SendBox/AttachmentBar/Preview/ImagePreview.module.css +0 -5
  1262. package/src/SendBox/AttachmentBar/Preview/ImagePreview.tsx +0 -46
  1263. package/src/SendBox/AttachmentBar/Preview/sendBoxAttachment.ts +0 -13
  1264. package/src/SendBox/AttachmentBar/index.ts +0 -3
  1265. package/src/SendBox/DropZone.tsx +0 -64
  1266. package/src/Styles/CSSCustomPropertiesContainer.tsx +0 -195
  1267. package/src/Styles/StyleSet/ActivityButton.ts +0 -49
  1268. package/src/Styles/StyleSet/ActivityCopyButton.ts +0 -40
  1269. package/src/Styles/StyleSet/ChatHistoryBox.ts +0 -22
  1270. package/src/Styles/StyleSet/CodeBlock.ts +0 -39
  1271. package/src/Styles/StyleSet/CodeBlockCopyButton.ts +0 -71
  1272. package/src/Styles/StyleSet/Tooltip.ts +0 -66
  1273. package/src/Styles/StyleSet/ViewCodeDialog.ts +0 -70
  1274. package/src/Styles/StyleSet/types/StyleSet.ts +0 -11
  1275. package/src/TextArea/TextArea.module.css +0 -75
  1276. package/src/TextArea/TextArea.tsx +0 -126
  1277. package/src/TextArea/index.ts +0 -1
  1278. package/src/Tooltip/index.ts +0 -1
  1279. package/src/Tooltip/private/Tooltip.tsx +0 -26
  1280. package/src/Transcript/ActivityTree.tsx +0 -35
  1281. package/src/Transcript/TranscriptFocus/TranscriptActivityList.tsx +0 -22
  1282. package/src/Transcript/TranscriptFocus/TranscriptFocus.module.css +0 -117
  1283. package/src/Transcript/TranscriptFocus/TranscriptFocusArea.tsx +0 -27
  1284. package/src/Transcript/TranscriptFocus/TranscriptFocusContent.tsx +0 -34
  1285. package/src/Transcript/TranscriptFocus/TranscriptFocusContentActiveDescendant.tsx +0 -26
  1286. package/src/Transcript/TranscriptFocus/TranscriptFocusContentBody.tsx +0 -20
  1287. package/src/Transcript/TranscriptFocus/TranscriptFocusContentOverlay.tsx +0 -20
  1288. package/src/Transcript/TranscriptFocus/TranscriptFocusIndicator.tsx +0 -28
  1289. package/src/Transcript/TranscriptFocus/TranscriptFocusTerminator.tsx +0 -42
  1290. package/src/Transcript/TranscriptFocus/TranscriptFocusTerminatorBody.tsx +0 -20
  1291. package/src/Transcript/TranscriptFocus/TranscriptFocusTerminatorText.tsx +0 -20
  1292. package/src/Transcript/TranscriptFocus/index.ts +0 -25
  1293. package/src/Transcript/hooks/useRenderActivityProps.ts +0 -88
  1294. package/src/Utils/AccessKeySink/Surface.tsx +0 -63
  1295. package/src/Utils/FixedWidthImage.tsx +0 -60
  1296. package/src/Utils/createIconComponent.tsx +0 -126
  1297. package/src/Utils/orgSchema/getFirstBaseOfSoftwareSourceCode.ts +0 -15
  1298. package/src/Utils/parseDocumentFragmentFromString.ts +0 -9
  1299. package/src/Utils/readDataURIToBlob.ts +0 -37
  1300. package/src/Utils/serializeDocumentFragmentIntoString.ts +0 -3
  1301. package/src/Utils/textFormatToContentType.ts +0 -14
  1302. package/src/__tests__/addMetaTag.spec.js +0 -8
  1303. package/src/__tests__/addMetaTag.spec.mjs +0 -8
  1304. package/src/boot/component.ts +0 -45
  1305. package/src/boot/decorator.ts +0 -1
  1306. package/src/boot/hook.ts +0 -118
  1307. package/src/boot/internal.ts +0 -15
  1308. package/src/buildInfo.ts +0 -9
  1309. package/src/decorator/index.ts +0 -3
  1310. package/src/decorator/private/BorderFlair.module.css +0 -566
  1311. package/src/decorator/private/BorderFlair.tsx +0 -39
  1312. package/src/decorator/private/BorderLoader.module.css +0 -53
  1313. package/src/decorator/private/BorderLoader.tsx +0 -24
  1314. package/src/decorator/private/WebChatDecorator.tsx +0 -64
  1315. package/src/decorator/stylesheet/DecoratorStylesheet.tsx +0 -33
  1316. package/src/decorator/stylesheet/createDecoratorStyleElements.ts +0 -8
  1317. package/src/env.d.ts +0 -11
  1318. package/src/hooks/RenderMarkdown.module.css +0 -102
  1319. package/src/hooks/internal/codeHighlighter/index.ts +0 -3
  1320. package/src/hooks/internal/codeHighlighter/private/CodeHighlighterComposer.tsx +0 -32
  1321. package/src/hooks/internal/codeHighlighter/private/createCodeHighlighterComposer.tsx +0 -32
  1322. package/src/hooks/internal/codeHighlighter/private/defaultHighlightCode.tsx +0 -22
  1323. package/src/hooks/internal/styleToEmotionObject/index.ts +0 -1
  1324. package/src/hooks/internal/styleToEmotionObject/private/StyleToEmotionObjectComposer.tsx +0 -20
  1325. package/src/hooks/internal/styleToEmotionObject/private/createStyleToEmotionObjectComposer.tsx +0 -22
  1326. package/src/hooks/internal/useEmotion.ts +0 -37
  1327. package/src/hooks/internal/useFeedbackActions.ts +0 -120
  1328. package/src/hooks/internal/useNonce.ts +0 -7
  1329. package/src/hooks/internal/useSanitizeHrefCallback.ts +0 -37
  1330. package/src/hooks/useStreamingMarkdownWithDefinitions.ts +0 -193
  1331. package/src/providers/ActivityLogicalGrouping/ActivityLogicalGroupingComposer.ts +0 -100
  1332. package/src/providers/ActivityLogicalGrouping/index.ts +0 -7
  1333. package/src/providers/ActivityLogicalGrouping/private/ActivityLogicalGroupingContext.ts +0 -31
  1334. package/src/providers/ActivityLogicalGrouping/private/useStateWithOptimisticRef.ts +0 -13
  1335. package/src/providers/ActivityLogicalGrouping/useAddLogicalGrouping.ts +0 -5
  1336. package/src/providers/ActivityLogicalGrouping/useGetGroupState.ts +0 -5
  1337. package/src/providers/ActivityLogicalGrouping/useGetLogicalGroupBoundaries.ts +0 -5
  1338. package/src/providers/ActivityLogicalGrouping/useGetLogicalGroupKey.ts +0 -5
  1339. package/src/providers/ActivityLogicalGrouping/useRemoveLogicalGrouping.ts +0 -5
  1340. package/src/providers/ChatHistoryDOM/ChatHistoryDOMComposer.tsx +0 -18
  1341. package/src/providers/ChatHistoryDOM/private/ChatHistoryDOMContext.ts +0 -11
  1342. package/src/providers/ChatHistoryDOM/useActivityElementRef.ts +0 -6
  1343. package/src/providers/CustomElements/CustomElementsComposer.tsx +0 -58
  1344. package/src/providers/CustomElements/customElements/CodeBlock.module.css +0 -35
  1345. package/src/providers/CustomElements/customElements/CodeBlock.ts +0 -230
  1346. package/src/providers/CustomElements/customElements/CodeBlockCopyButton.module.css +0 -63
  1347. package/src/providers/CustomElements/customElements/CodeBlockCopyButton.tsx +0 -108
  1348. package/src/providers/CustomElements/customElements/wrapAsCustomElement.ts +0 -85
  1349. package/src/providers/CustomElements/private/CustomElementsContext.ts +0 -15
  1350. package/src/providers/CustomElements/private/useCustomElementsContext.ts +0 -6
  1351. package/src/providers/CustomElements/useCodeBlockCopyButtonTagName.ts +0 -8
  1352. package/src/providers/CustomElements/useCodeBlockTagName.ts +0 -19
  1353. package/src/providers/GroupedRenderingActivities/GroupedRenderingActivities.ts +0 -10
  1354. package/src/providers/GroupedRenderingActivities/GroupedRenderingActivitiesComposer.tsx +0 -87
  1355. package/src/providers/GroupedRenderingActivities/private/GroupedRenderingActivitiesContext.ts +0 -14
  1356. package/src/providers/GroupedRenderingActivities/private/group.spec.ts +0 -31
  1357. package/src/providers/GroupedRenderingActivities/private/group.ts +0 -19
  1358. package/src/providers/GroupedRenderingActivities/private/pick.spec.ts +0 -35
  1359. package/src/providers/GroupedRenderingActivities/private/pick.ts +0 -20
  1360. package/src/providers/GroupedRenderingActivities/useGroupedRenderingActivities.ts +0 -6
  1361. package/src/providers/GroupedRenderingActivities/useNumRenderingActivities.ts +0 -5
  1362. package/src/providers/HTMLContentTransformCOR/HTMLContentTransformComposer.tsx +0 -41
  1363. package/src/providers/HTMLContentTransformCOR/index.ts +0 -8
  1364. package/src/providers/HTMLContentTransformCOR/private/HTMLContentTransformContext.ts +0 -34
  1365. package/src/providers/HTMLContentTransformCOR/private/useHTMLContentTransformContext.ts +0 -6
  1366. package/src/providers/HTMLContentTransformCOR/useTransformHTMLContent.ts +0 -187
  1367. package/src/providers/LiveRegionTwin/index.ts +0 -3
  1368. package/src/providers/LiveRegionTwin/private/LiveRegionTwinComposer.ts +0 -27
  1369. package/src/providers/LiveRegionTwin/private/createLiveRegionTwinComposer.tsx +0 -155
  1370. package/src/providers/LiveRegionTwin/useLiveRegion.ts +0 -27
  1371. package/src/providers/ReducedMotion/ReducedMotionComposer.tsx +0 -35
  1372. package/src/providers/ReducedMotion/private/Context.ts +0 -22
  1373. package/src/providers/ReducedMotion/private/useContext.ts +0 -8
  1374. package/src/providers/ReducedMotion/useShouldReduceMotion.ts +0 -5
  1375. package/src/providers/RenderingActivities/RenderingActivitiesComposer.tsx +0 -103
  1376. package/src/providers/RenderingActivities/private/RenderingActivitiesContext.ts +0 -15
  1377. package/src/providers/RenderingActivities/useActivityRendererMap.ts +0 -9
  1378. package/src/providers/RenderingActivities/useRenderingActivities.ts +0 -7
  1379. package/src/providers/RenderingActivities/useRenderingActivityKeys.ts +0 -5
  1380. package/src/providers/TranscriptFocus/TranscriptFocusComposer.spec.tsx +0 -611
  1381. package/src/providers/TranscriptFocus/useFocusByGroupKey.ts +0 -11
  1382. package/src/providers/TranscriptFocus/useFocusedKey.ts +0 -6
  1383. package/src/providers/TranscriptFocus/useGetGroupDescendantIdByActivityKey.ts +0 -5
  1384. package/src/providers/createContextAndHook.ts +0 -23
  1385. package/src/stylesheet/ComponentStylesheet.tsx +0 -33
  1386. package/src/stylesheet/createComponentStyleElements.ts +0 -8
  1387. package/src/testIds.ts +0 -18
  1388. package/src/types/internal/mutableRefObject.ts +0 -40
  1389. package/src/types/internal/refObject.ts +0 -40
@@ -1,73 +1,65 @@
1
- // TODO: [P2] Fix ESLint error `no-use-before-define`
2
- /* eslint-disable @typescript-eslint/no-use-before-define */
3
-
4
1
  import { hooks } from 'botframework-webchat-api';
5
- import classNames from 'classnames';
6
- import React, {
7
- forwardRef,
8
- Fragment,
9
- memo,
10
- useCallback,
11
- useMemo,
12
- useRef,
13
- type KeyboardEventHandler,
14
- type MutableRefObject,
15
- type ReactNode
16
- } from 'react';
17
2
  import {
18
3
  Composer as ReactScrollToBottomComposer,
19
4
  Panel as ReactScrollToBottomPanel,
5
+ useAnimatingToEnd,
6
+ useAtEnd,
20
7
  useObserveScrollPosition,
21
8
  useScrollTo,
22
9
  useScrollToEnd,
23
10
  useSticky
24
11
  } from 'react-scroll-to-bottom';
25
- import { wrapWith } from 'react-wrap-with';
12
+ import classNames from 'classnames';
13
+ import PropTypes from 'prop-types';
14
+ import React, { forwardRef, Fragment, memo, useCallback, useMemo, useRef } from 'react';
15
+
16
+ import type { ActivityElementMap } from './Transcript/types';
17
+ import type { FC, KeyboardEventHandler, MutableRefObject, ReactNode } from 'react';
18
+ import type { WebChatActivity } from 'botframework-webchat-core';
26
19
 
20
+ import { android } from './Utils/detectBrowser';
27
21
  import BasicTypingIndicator from './BasicTypingIndicator';
28
- import ChatHistoryBox from './ChatHistory/ChatHistoryBox';
29
- import ChatHistoryToolbar from './ChatHistory/ChatHistoryToolbar';
30
- import ScrollToEndButton from './ChatHistory/private/ScrollToEndButton';
31
- import ActivityTree from './Transcript/ActivityTree';
32
- import LiveRegionTranscript from './Transcript/LiveRegionTranscript';
33
- import { TranscriptFocusArea, TranscriptFocusTerminator } from './Transcript/TranscriptFocus';
34
- import TranscriptActivityList from './Transcript/TranscriptFocus/TranscriptActivityList';
35
- import { type ActivityElementMap } from './Transcript/types';
36
22
  import FocusRedirector from './Utils/FocusRedirector';
37
23
  import inputtableKey from './Utils/TypeFocusSink/inputtableKey';
38
- import { android } from './Utils/detectBrowser';
39
- import { useStyleToEmotionObject } from './hooks/internal/styleToEmotionObject';
24
+ import isZeroOrPositive from './Utils/isZeroOrPositive';
25
+ import KeyboardHelp from './Transcript/KeyboardHelp';
26
+ import LiveRegionTranscript from './Transcript/LiveRegionTranscript';
27
+ // TODO: [P2] #4133 Rename to "getTabbableElements".
28
+ import tabbableElements from './Utils/tabbableElements';
29
+ import TranscriptFocusComposer from './providers/TranscriptFocus/TranscriptFocusComposer';
30
+ import useActiveDescendantId from './providers/TranscriptFocus/useActiveDescendantId';
31
+ import useActivityTreeWithRenderer from './providers/ActivityTree/useActivityTreeWithRenderer';
40
32
  import useDispatchScrollPosition from './hooks/internal/useDispatchScrollPosition';
41
33
  import useDispatchTranscriptFocusByActivityKey from './hooks/internal/useDispatchTranscriptFocusByActivityKey';
42
- import useNonce from './hooks/internal/useNonce';
34
+ import useFocus from './hooks/useFocus';
35
+ import useFocusByActivityKey from './providers/TranscriptFocus/useFocusByActivityKey';
36
+ import useFocusedActivityKey from './providers/TranscriptFocus/useFocusedActivityKey';
37
+ import useFocusedExplicitly from './providers/TranscriptFocus/useFocusedExplicitly';
38
+ import useFocusRelativeActivity from './providers/TranscriptFocus/useFocusRelativeActivity';
43
39
  import useObserveFocusVisible from './hooks/internal/useObserveFocusVisible';
44
40
  import usePrevious from './hooks/internal/usePrevious';
45
41
  import useRegisterFocusTranscript from './hooks/internal/useRegisterFocusTranscript';
46
42
  import useRegisterScrollTo from './hooks/internal/useRegisterScrollTo';
47
43
  import useRegisterScrollToEnd from './hooks/internal/useRegisterScrollToEnd';
44
+ import useStyleSet from './hooks/useStyleSet';
45
+ import useStyleToEmotionObject from './hooks/internal/useStyleToEmotionObject';
46
+ import useUniqueId from './hooks/internal/useUniqueId';
48
47
  import useValueRef from './hooks/internal/useValueRef';
48
+ import TranscriptActivity from './TranscriptActivity';
49
+ import useMemoized from './hooks/internal/useMemoized';
49
50
  import {
50
51
  useRegisterScrollRelativeTranscript,
51
52
  type TranscriptScrollRelativeOptions
52
53
  } from './hooks/transcriptScrollRelative';
53
- import useFocus from './hooks/useFocus';
54
- import useStyleSet from './hooks/useStyleSet';
55
- import ChatHistoryDOMComposer from './providers/ChatHistoryDOM/ChatHistoryDOMComposer';
56
- import useActivityElementMapRef from './providers/ChatHistoryDOM/useActivityElementRef';
57
- import GroupedRenderingActivitiesComposer from './providers/GroupedRenderingActivities/GroupedRenderingActivitiesComposer';
58
- import useNumRenderingActivities from './providers/GroupedRenderingActivities/useNumRenderingActivities';
59
- import RenderingActivitiesComposer from './providers/RenderingActivities/RenderingActivitiesComposer';
60
- import TranscriptFocusComposer from './providers/TranscriptFocus/TranscriptFocusComposer';
61
- import useActiveDescendantId from './providers/TranscriptFocus/useActiveDescendantId';
62
- import useFocusByActivityKey from './providers/TranscriptFocus/useFocusByActivityKey';
63
- import useFocusRelativeActivity from './providers/TranscriptFocus/useFocusRelativeActivity';
64
- import useFocusedExplicitly from './providers/TranscriptFocus/useFocusedExplicitly';
65
- import useFocusedKey from './providers/TranscriptFocus/useFocusedKey';
66
54
 
67
55
  const {
68
56
  useActivityKeys,
57
+ useActivityKeysByRead,
58
+ useCreateAvatarRenderer,
59
+ useCreateScrollToEndButtonRenderer,
69
60
  useDirection,
70
61
  useGetActivityByKey,
62
+ useGetKeyByActivity,
71
63
  useGetKeyByActivityId,
72
64
  useLastAcknowledgedActivityKey,
73
65
  useLocalizer,
@@ -99,10 +91,6 @@ const ROOT_STYLE = {
99
91
 
100
92
  '& .webchat__basic-transcript__transcript': {
101
93
  listStyleType: 'none'
102
- },
103
-
104
- '& .webchat__basic-transcript__activity-focus-target': {
105
- pointerEvents: 'none'
106
94
  }
107
95
  }
108
96
  };
@@ -111,388 +99,525 @@ type ScrollBehavior = 'auto' | 'smooth';
111
99
  type ScrollToOptions = { behavior?: ScrollBehavior };
112
100
  type ScrollToPosition = { activityID?: string; scrollTop?: number };
113
101
 
114
- type InternalTranscriptProps = Readonly<{
102
+ type InternalTranscriptProps = {
103
+ activityElementMapRef: MutableRefObject<ActivityElementMap>;
115
104
  className?: string;
116
- terminatorRef: MutableRefObject<HTMLDivElement>;
117
- }>;
105
+ };
118
106
 
119
107
  // TODO: [P1] #4133 Add telemetry for computing how many re-render done so far.
120
- const InternalTranscript = memo(
121
- forwardRef<HTMLDivElement, InternalTranscriptProps>(
122
- (
123
- { className, terminatorRef }: InternalTranscriptProps,
124
- ref: MutableRefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void)
125
- ) => {
126
- const [activeDescendantId] = useActiveDescendantId();
127
- const [direction] = useDirection();
128
- const [focusedKey] = useFocusedKey();
129
- const [focusedExplicitly] = useFocusedExplicitly();
130
- const focusElementMapRef = useActivityElementMapRef();
131
- const focus = useFocus();
132
- const focusByActivityKey = useFocusByActivityKey();
133
- const focusRelativeActivity = useFocusRelativeActivity();
134
- const getActivityByKey = useGetActivityByKey();
135
- const getKeyByActivityId = useGetKeyByActivityId();
136
- const localize = useLocalizer();
137
- const rootClassName = useStyleToEmotionObject()(ROOT_STYLE) + '';
138
- const rootElementRef = useRef<HTMLDivElement>(null);
139
-
140
- const focusedKeyRef = useValueRef(focusedKey);
141
- const transcriptAriaLabel = localize('TRANSCRIPT_ARIA_LABEL_ALT');
142
-
143
- const callbackRef = useCallback(
144
- (element: HTMLDivElement) => {
145
- if (typeof ref === 'function') {
146
- ref(element);
147
- } else {
148
- ref.current = element;
149
- }
150
-
151
- rootElementRef.current = element;
152
- },
153
- [ref, rootElementRef]
154
- );
155
-
156
- const [numRenderingActivities] = useNumRenderingActivities();
108
+ const InternalTranscript = forwardRef<HTMLDivElement, InternalTranscriptProps>(
109
+ ({ activityElementMapRef, className }, ref) => {
110
+ const [{ basicTranscript: basicTranscriptStyleSet }] = useStyleSet();
111
+ const [{ bubbleFromUserNubOffset, bubbleNubOffset, groupTimestamp, showAvatarInGroup }] = useStyleOptions();
112
+ const [activeDescendantId] = useActiveDescendantId();
113
+ const [activityWithRendererTree] = useActivityTreeWithRenderer();
114
+ const [direction] = useDirection();
115
+ const [focusedActivityKey] = useFocusedActivityKey();
116
+ const [focusedExplicitly] = useFocusedExplicitly();
117
+ const createAvatarRenderer = useCreateAvatarRenderer();
118
+ const focus = useFocus();
119
+ const focusByActivityKey = useFocusByActivityKey();
120
+ const focusRelativeActivity = useFocusRelativeActivity();
121
+ const getActivityByKey = useGetActivityByKey();
122
+ const getKeyByActivity = useGetKeyByActivity();
123
+ const getKeyByActivityId = useGetKeyByActivityId();
124
+ const localize = useLocalizer();
125
+ const rootClassName = useStyleToEmotionObject()(ROOT_STYLE) + '';
126
+ const rootElementRef = useRef<HTMLDivElement>();
127
+ const terminatorLabelId = useUniqueId('webchat__basic-transcript__terminator-label');
128
+ const terminatorRef = useRef<HTMLDivElement>();
129
+
130
+ const focusedActivityKeyRef = useValueRef(focusedActivityKey);
131
+ const hideAllTimestamps = groupTimestamp === false;
132
+ const terminatorText = localize('TRANSCRIPT_TERMINATOR_TEXT');
133
+ const transcriptAriaLabel = localize('TRANSCRIPT_ARIA_LABEL_ALT');
134
+
135
+ const callbackRef = useCallback(
136
+ (element: HTMLDivElement) => {
137
+ if (typeof ref === 'function') {
138
+ ref(element);
139
+ } else {
140
+ ref.current = element;
141
+ }
157
142
 
158
- const scrollToBottomScrollTo: (scrollTop: number, options?: ScrollToOptions) => void = useScrollTo();
159
- const scrollToBottomScrollToEnd: (options?: ScrollToOptions) => void = useScrollToEnd();
143
+ rootElementRef.current = element;
144
+ },
145
+ [ref, rootElementRef]
146
+ );
147
+
148
+ const createAvatarRendererMemoized = useMemoized(
149
+ (activity: WebChatActivity) => createAvatarRenderer({ activity }),
150
+ [createAvatarRenderer]
151
+ );
152
+
153
+ // Flatten the tree back into an array with information related to rendering.
154
+ const renderingElements = useMemo(() => {
155
+ const renderingElements: ReactNode[] = [];
156
+ const topSideBotNub = isZeroOrPositive(bubbleNubOffset);
157
+ const topSideUserNub = isZeroOrPositive(bubbleFromUserNubOffset);
158
+
159
+ activityWithRendererTree.forEach(entriesWithSameSender => {
160
+ const [[{ activity: firstActivity }]] = entriesWithSameSender;
161
+ const renderAvatar = createAvatarRendererMemoized(firstActivity);
162
+
163
+ entriesWithSameSender.forEach((entriesWithSameSenderAndStatus, indexWithinSenderGroup) => {
164
+ const firstInSenderGroup = !indexWithinSenderGroup;
165
+ const lastInSenderGroup = indexWithinSenderGroup === entriesWithSameSender.length - 1;
166
+
167
+ entriesWithSameSenderAndStatus.forEach(({ activity, renderActivity }, indexWithinSenderAndStatusGroup) => {
168
+ // We only show the timestamp at the end of the sender group. But we always show the "Send failed, retry" prompt.
169
+ const firstInSenderAndStatusGroup = !indexWithinSenderAndStatusGroup;
170
+ const key: string = getKeyByActivity(activity);
171
+ const lastInSenderAndStatusGroup =
172
+ indexWithinSenderAndStatusGroup === entriesWithSameSenderAndStatus.length - 1;
173
+ const topSideNub = activity.from?.role === 'user' ? topSideUserNub : topSideBotNub;
174
+
175
+ let showCallout: boolean;
176
+
177
+ // Depending on the "showAvatarInGroup" setting, the avatar will render in different positions.
178
+ if (showAvatarInGroup === 'sender') {
179
+ if (topSideNub) {
180
+ showCallout = firstInSenderGroup && firstInSenderAndStatusGroup;
181
+ } else {
182
+ showCallout = lastInSenderGroup && lastInSenderAndStatusGroup;
183
+ }
184
+ } else if (showAvatarInGroup === 'status') {
185
+ if (topSideNub) {
186
+ showCallout = firstInSenderAndStatusGroup;
187
+ } else {
188
+ showCallout = lastInSenderAndStatusGroup;
189
+ }
190
+ } else {
191
+ showCallout = true;
192
+ }
160
193
 
161
- const scrollTo = useCallback(
162
- (position: ScrollToPosition, { behavior = 'auto' }: ScrollToOptions = {}) => {
163
- if (!position) {
164
- throw new Error(
165
- 'botframework-webchat: First argument passed to "useScrollTo" must be a ScrollPosition object.'
194
+ renderingElements.push(
195
+ <TranscriptActivity
196
+ activity={activity}
197
+ activityElementMapRef={activityElementMapRef}
198
+ // "hideTimestamp" is a render-time parameter for renderActivityStatus().
199
+ // If true, it will hide the timestamp, but it will continue to show the
200
+ // retry prompt. And show the screen reader version of the timestamp.
201
+ activityKey={key}
202
+ hideTimestamp={
203
+ hideAllTimestamps || indexWithinSenderAndStatusGroup !== entriesWithSameSenderAndStatus.length - 1
204
+ }
205
+ key={key}
206
+ renderActivity={renderActivity}
207
+ renderAvatar={renderAvatar}
208
+ showCallout={showCallout}
209
+ />
166
210
  );
167
- }
211
+ });
212
+ });
213
+ });
214
+
215
+ return renderingElements;
216
+ }, [
217
+ activityElementMapRef,
218
+ activityWithRendererTree,
219
+ bubbleFromUserNubOffset,
220
+ bubbleNubOffset,
221
+ createAvatarRendererMemoized,
222
+ getKeyByActivity,
223
+ hideAllTimestamps,
224
+ showAvatarInGroup
225
+ ]);
226
+
227
+ const scrollToBottomScrollTo: (scrollTop: number, options?: ScrollToOptions) => void = useScrollTo();
228
+ const scrollToBottomScrollToEnd: (options?: ScrollToOptions) => void = useScrollToEnd();
229
+
230
+ const scrollTo = useCallback(
231
+ (position: ScrollToPosition, { behavior = 'auto' }: ScrollToOptions = {}) => {
232
+ if (!position) {
233
+ throw new Error(
234
+ 'botframework-webchat: First argument passed to "useScrollTo" must be a ScrollPosition object.'
235
+ );
236
+ }
168
237
 
169
- const { activityID: activityId, scrollTop } = position;
238
+ const { activityID: activityId, scrollTop } = position;
170
239
 
171
- if (typeof scrollTop !== 'undefined') {
172
- scrollToBottomScrollTo(scrollTop, { behavior });
173
- } else if (typeof activityId !== 'undefined') {
174
- const activityBoundingBoxElement = focusElementMapRef.current
175
- .get(getKeyByActivityId(activityId))
176
- ?.querySelector('.webchat__basic-transcript__activity-active-descendant');
240
+ if (typeof scrollTop !== 'undefined') {
241
+ scrollToBottomScrollTo(scrollTop, { behavior });
242
+ } else if (typeof activityId !== 'undefined') {
243
+ const activityBoundingBoxElement = activityElementMapRef.current
244
+ .get(getKeyByActivityId(activityId))
245
+ ?.querySelector('.webchat__basic-transcript__activity-active-descendant');
177
246
 
178
- const scrollableElement = rootElementRef.current.querySelector('.webchat__basic-transcript__scrollable');
247
+ const scrollableElement = rootElementRef.current.querySelector('.webchat__basic-transcript__scrollable');
179
248
 
180
- if (scrollableElement && activityBoundingBoxElement) {
181
- // ESLint conflict with TypeScript. The result of getClientRects() is not an Array but DOMRectList, and cannot be destructured.
182
- // eslint-disable-next-line prefer-destructuring
183
- const activityBoundingBoxElementClientRect = activityBoundingBoxElement.getClientRects()[0];
249
+ if (scrollableElement && activityBoundingBoxElement) {
250
+ // ESLint conflict with TypeScript. The result of getClientRects() is not an Array but DOMRectList, and cannot be destructured.
251
+ // eslint-disable-next-line prefer-destructuring
252
+ const activityBoundingBoxElementClientRect = activityBoundingBoxElement.getClientRects()[0];
184
253
 
185
- // ESLint conflict with TypeScript. The result of getClientRects() is not an Array but DOMRectList, and cannot be destructured.
186
- // eslint-disable-next-line prefer-destructuring
187
- const scrollableElementClientRect = scrollableElement.getClientRects()[0];
254
+ // ESLint conflict with TypeScript. The result of getClientRects() is not an Array but DOMRectList, and cannot be destructured.
255
+ // eslint-disable-next-line prefer-destructuring
256
+ const scrollableElementClientRect = scrollableElement.getClientRects()[0];
188
257
 
189
- // If either the activity or the transcript scrollable is not on DOM, we will not scroll the view.
190
- if (activityBoundingBoxElementClientRect && scrollableElementClientRect) {
191
- const { height: activityHeight, y: activityY } = activityBoundingBoxElementClientRect;
192
- const { height: scrollableHeight } = scrollableElementClientRect;
193
- const activityOffsetTop = activityY + scrollableElement.scrollTop;
258
+ // If either the activity or the transcript scrollable is not on DOM, we will not scroll the view.
259
+ if (activityBoundingBoxElementClientRect && scrollableElementClientRect) {
260
+ const { height: activityHeight, y: activityY } = activityBoundingBoxElementClientRect;
261
+ const { height: scrollableHeight } = scrollableElementClientRect;
262
+ const activityOffsetTop = activityY + scrollableElement.scrollTop;
194
263
 
195
- const scrollTop = Math.min(activityOffsetTop, activityOffsetTop - scrollableHeight + activityHeight);
264
+ const scrollTop = Math.min(activityOffsetTop, activityOffsetTop - scrollableHeight + activityHeight);
196
265
 
197
- scrollToBottomScrollTo(scrollTop, { behavior });
198
- }
266
+ scrollToBottomScrollTo(scrollTop, { behavior });
199
267
  }
200
268
  }
201
- },
202
- [focusElementMapRef, getKeyByActivityId, rootElementRef, scrollToBottomScrollTo]
203
- );
204
-
205
- const scrollToEnd = useCallback(
206
- () => scrollToBottomScrollToEnd({ behavior: 'smooth' }),
207
- [scrollToBottomScrollToEnd]
208
- );
209
-
210
- const scrollRelative = useCallback(
211
- ({ direction, displacement }: TranscriptScrollRelativeOptions) => {
212
- const { current: rootElement } = rootElementRef;
213
-
214
- if (!rootElement) {
215
- return;
216
- }
217
-
218
- const scrollable: HTMLElement = rootElement.querySelector('.webchat__basic-transcript__scrollable');
219
- let nextScrollTop: number;
220
-
221
- if (typeof displacement === 'number') {
222
- // eslint-disable-next-line no-magic-numbers
223
- nextScrollTop = scrollable.scrollTop + (direction === 'down' ? 1 : -1) * displacement;
224
- } else {
225
- // eslint-disable-next-line no-magic-numbers
226
- nextScrollTop = scrollable.scrollTop + (direction === 'down' ? 1 : -1) * scrollable.offsetHeight;
227
- }
228
-
229
- scrollTo(
230
- {
231
- scrollTop: Math.max(0, Math.min(scrollable.scrollHeight - scrollable.offsetHeight, nextScrollTop))
232
- },
233
- { behavior: 'smooth' }
234
- );
235
- },
236
- [rootElementRef, scrollTo]
237
- );
238
-
239
- // Since there could be multiple instances of <BasicTranscript> inside the <Composer>, when the developer calls `scrollXXX`, we need to call it on all instances.
240
- // We call `useRegisterScrollXXX` to register a callback function, the `useScrollXXX` will multiplex the call into each instance of <BasicTranscript>.
241
- useRegisterScrollTo(scrollTo);
242
- useRegisterScrollToEnd(scrollToEnd);
243
- useRegisterScrollRelativeTranscript(scrollRelative);
269
+ }
270
+ },
271
+ [activityElementMapRef, getKeyByActivityId, rootElementRef, scrollToBottomScrollTo]
272
+ );
244
273
 
245
- const markActivityKeyAsRead = useMarkActivityKeyAsRead();
274
+ const scrollToEnd = useCallback(
275
+ () => scrollToBottomScrollToEnd({ behavior: 'smooth' }),
276
+ [scrollToBottomScrollToEnd]
277
+ );
246
278
 
247
- const dispatchScrollPositionWithActivityId: (scrollPosition: ScrollToPosition) => void =
248
- useDispatchScrollPosition();
279
+ const scrollRelative = useCallback(
280
+ ({ direction, displacement }: TranscriptScrollRelativeOptions) => {
281
+ const { current: rootElement } = rootElementRef;
249
282
 
250
- // TODO: [P2] We should use IntersectionObserver to track what activity is in the scrollable.
251
- // However, IntersectionObserver is not available on IE11, we need to make a limited polyfill in React style.
252
- const handleScrollPosition = useCallback(
253
- ({ scrollTop }: { scrollTop: number }) => {
254
- const { current: rootElement } = rootElementRef;
283
+ if (!rootElement) {
284
+ return;
285
+ }
255
286
 
256
- if (!rootElement) {
257
- return;
258
- }
287
+ const scrollable: HTMLElement = rootElement.querySelector('.webchat__basic-transcript__scrollable');
288
+ let nextScrollTop: number;
259
289
 
260
- const scrollableElement = rootElement.querySelector('.webchat__basic-transcript__scrollable');
290
+ if (typeof displacement === 'number') {
291
+ // eslint-disable-next-line no-magic-numbers
292
+ nextScrollTop = scrollable.scrollTop + (direction === 'down' ? 1 : -1) * displacement;
293
+ } else {
294
+ // eslint-disable-next-line no-magic-numbers
295
+ nextScrollTop = scrollable.scrollTop + (direction === 'down' ? 1 : -1) * scrollable.offsetHeight;
296
+ }
261
297
 
262
- // "getClientRects()" is not returning an array, thus, it is not destructurable.
263
- // eslint-disable-next-line prefer-destructuring
264
- const scrollableElementClientRect = scrollableElement.getClientRects()[0];
298
+ scrollTo(
299
+ {
300
+ scrollTop: Math.max(0, Math.min(scrollable.scrollHeight - scrollable.offsetHeight, nextScrollTop))
301
+ },
302
+ { behavior: 'smooth' }
303
+ );
304
+ },
305
+ [rootElementRef, scrollTo]
306
+ );
307
+
308
+ // Since there could be multiple instances of <BasicTranscript> inside the <Composer>, when the developer calls `scrollXXX`, we need to call it on all instances.
309
+ // We call `useRegisterScrollXXX` to register a callback function, the `useScrollXXX` will multiplex the call into each instance of <BasicTranscript>.
310
+ useRegisterScrollTo(scrollTo);
311
+ useRegisterScrollToEnd(scrollToEnd);
312
+ useRegisterScrollRelativeTranscript(scrollRelative);
313
+
314
+ const markActivityKeyAsRead = useMarkActivityKeyAsRead();
315
+
316
+ const dispatchScrollPositionWithActivityId: (scrollPosition: ScrollToPosition) => void =
317
+ useDispatchScrollPosition();
318
+
319
+ // TODO: [P2] We should use IntersectionObserver to track what activity is in the scrollable.
320
+ // However, IntersectionObserver is not available on IE11, we need to make a limited polyfill in React style.
321
+ const handleScrollPosition = useCallback(
322
+ ({ scrollTop }: { scrollTop: number }) => {
323
+ const { current: rootElement } = rootElementRef;
324
+
325
+ if (!rootElement) {
326
+ return;
327
+ }
265
328
 
266
- // If the scrollable is not mounted, we cannot measure which activity is in view. Thus, we will not fire any events.
267
- if (!scrollableElementClientRect) {
268
- return;
269
- }
329
+ const scrollableElement = rootElement.querySelector('.webchat__basic-transcript__scrollable');
270
330
 
271
- const { bottom: scrollableClientBottom } = scrollableElementClientRect;
272
-
273
- // Find the activity just above scroll view bottom.
274
- // If the scroll view is already on top, get the first activity.
275
- const activityElements = Array.from(focusElementMapRef.current.entries());
276
- const activityKeyJustAboveScrollBottom: string | undefined = (
277
- scrollableElement.scrollTop
278
- ? activityElements
279
- .reverse()
280
- // Add subpixel tolerance
281
- .find(([, element]) => {
282
- // "getClientRects()" is not returning an array, thus, it is not destructurable.
283
- // eslint-disable-next-line prefer-destructuring
284
- const elementClientRect = element.getClientRects()[0];
285
-
286
- // If the activity is not attached to DOM tree, we should not count it as "bottommost visible activity", as it is not visible.
287
- return elementClientRect && elementClientRect.bottom < scrollableClientBottom + 1;
288
- })
289
- : activityElements[0]
290
- )?.[0];
291
-
292
- // When the end-user slowly scrolling the view down, we will mark activity as read when the message fully appear on the screen.
293
- activityKeyJustAboveScrollBottom && markActivityKeyAsRead(activityKeyJustAboveScrollBottom);
294
-
295
- if (dispatchScrollPositionWithActivityId) {
296
- const activity = getActivityByKey(activityKeyJustAboveScrollBottom);
297
-
298
- dispatchScrollPositionWithActivityId({ ...(activity ? { activityID: activity.id } : {}), scrollTop });
299
- }
300
- },
301
- [
302
- focusElementMapRef,
303
- dispatchScrollPositionWithActivityId,
304
- getActivityByKey,
305
- markActivityKeyAsRead,
306
- rootElementRef
307
- ]
308
- );
309
-
310
- useObserveScrollPosition(handleScrollPosition);
311
-
312
- const handleTranscriptKeyDown = useCallback<KeyboardEventHandler<HTMLDivElement>>(
313
- event => {
314
- const { target } = event;
315
-
316
- const fromEndOfTranscriptIndicator = target === terminatorRef.current;
317
- const fromTranscript = target === event.currentTarget;
318
-
319
- if (!fromEndOfTranscriptIndicator && !fromTranscript) {
320
- return;
321
- }
331
+ // "getClientRects()" is not returning an array, thus, it is not destructurable.
332
+ // eslint-disable-next-line prefer-destructuring
333
+ const scrollableElementClientRect = scrollableElement.getClientRects()[0];
322
334
 
323
- let handled = true;
335
+ // If the scrollable is not mounted, we cannot measure which activity is in view. Thus, we will not fire any events.
336
+ if (!scrollableElementClientRect) {
337
+ return;
338
+ }
324
339
 
325
- switch (event.key) {
326
- case 'ArrowDown':
327
- focusRelativeActivity(fromEndOfTranscriptIndicator ? 0 : 1);
328
- break;
340
+ const { bottom: scrollableClientBottom } = scrollableElementClientRect;
341
+
342
+ // Find the activity just above scroll view bottom.
343
+ // If the scroll view is already on top, get the first activity.
344
+ const activityElements = Array.from(activityElementMapRef.current.entries());
345
+ const activityKeyJustAboveScrollBottom: string | undefined = (
346
+ scrollableElement.scrollTop
347
+ ? activityElements
348
+ .reverse()
349
+ // Add subpixel tolerance
350
+ .find(([, element]) => {
351
+ // "getClientRects()" is not returning an array, thus, it is not destructurable.
352
+ // eslint-disable-next-line prefer-destructuring
353
+ const elementClientRect = element.getClientRects()[0];
354
+
355
+ // If the activity is not attached to DOM tree, we should not count it as "bottommost visible activity", as it is not visible.
356
+ return elementClientRect && elementClientRect.bottom < scrollableClientBottom + 1;
357
+ })
358
+ : activityElements[0]
359
+ )?.[0];
360
+
361
+ // When the end-user slowly scrolling the view down, we will mark activity as read when the message fully appear on the screen.
362
+ activityKeyJustAboveScrollBottom && markActivityKeyAsRead(activityKeyJustAboveScrollBottom);
363
+
364
+ if (dispatchScrollPositionWithActivityId) {
365
+ const activity = getActivityByKey(activityKeyJustAboveScrollBottom);
366
+
367
+ dispatchScrollPositionWithActivityId({ ...(activity ? { activityID: activity.id } : {}), scrollTop });
368
+ }
369
+ },
370
+ [
371
+ activityElementMapRef,
372
+ dispatchScrollPositionWithActivityId,
373
+ getActivityByKey,
374
+ markActivityKeyAsRead,
375
+ rootElementRef
376
+ ]
377
+ );
378
+
379
+ useObserveScrollPosition(handleScrollPosition);
380
+
381
+ const handleTranscriptKeyDown = useCallback<KeyboardEventHandler<HTMLDivElement>>(
382
+ event => {
383
+ const { target } = event;
384
+
385
+ const fromEndOfTranscriptIndicator = target === terminatorRef.current;
386
+ const fromTranscript = target === event.currentTarget;
387
+
388
+ if (!fromEndOfTranscriptIndicator && !fromTranscript) {
389
+ return;
390
+ }
329
391
 
330
- case 'ArrowUp':
331
- // eslint-disable-next-line no-magic-numbers
332
- focusRelativeActivity(fromEndOfTranscriptIndicator ? 0 : -1);
333
- break;
392
+ let handled = true;
334
393
 
335
- case 'End':
336
- focusRelativeActivity(Infinity);
337
- break;
394
+ switch (event.key) {
395
+ case 'ArrowDown':
396
+ focusRelativeActivity(fromEndOfTranscriptIndicator ? 0 : 1);
397
+ break;
338
398
 
339
- case 'Enter':
340
- // This is capturing plain ENTER.
341
- // When screen reader is not running, or screen reader is running outside of scan mode, the ENTER key will be captured here.
342
- if (!fromEndOfTranscriptIndicator) {
343
- const focusElement = focusElementMapRef.current?.get(focusedKeyRef.current);
344
- const activityFocusTrapTarget: HTMLElement =
345
- focusElement?.querySelector('.webchat__basic-transcript__group-focus-target') ??
346
- focusElement?.querySelector('.webchat__basic-transcript__activity-focus-target');
347
- // TODO: review focus approach:
348
- // It is not clear how to handle focus without introducing something like context.
349
- // Ideally we would want a way to interact with focus outside of React
350
- // so it doesn't cause transcript re-renders while still having an ability
351
- // to scope activity-related handlers and data in a single place.
352
- activityFocusTrapTarget?.focus();
353
- }
399
+ case 'ArrowUp':
400
+ // eslint-disable-next-line no-magic-numbers
401
+ focusRelativeActivity(fromEndOfTranscriptIndicator ? 0 : -1);
402
+ break;
403
+
404
+ case 'End':
405
+ focusRelativeActivity(Infinity);
406
+ break;
407
+
408
+ case 'Enter':
409
+ // This is capturing plain ENTER.
410
+ // When screen reader is not running, or screen reader is running outside of scan mode, the ENTER key will be captured here.
411
+ if (!fromEndOfTranscriptIndicator) {
412
+ const body: HTMLElement = activityElementMapRef.current
413
+ .get(focusedActivityKeyRef.current)
414
+ ?.querySelector('.webchat__basic-transcript__activity-body');
415
+
416
+ tabbableElements(body)[0]?.focus();
417
+ }
354
418
 
355
- break;
419
+ break;
356
420
 
357
- case 'Escape':
358
- focus('sendBoxWithoutKeyboard');
359
- break;
421
+ case 'Escape':
422
+ focus('sendBoxWithoutKeyboard');
423
+ break;
360
424
 
361
- case 'Home':
362
- focusRelativeActivity(-Infinity);
363
- break;
425
+ case 'Home':
426
+ focusRelativeActivity(-Infinity);
427
+ break;
364
428
 
365
- default:
366
- handled = false;
367
- break;
368
- }
429
+ default:
430
+ handled = false;
431
+ break;
432
+ }
369
433
 
370
- if (handled) {
371
- event.preventDefault();
434
+ if (handled) {
435
+ event.preventDefault();
372
436
 
373
- // If a custom HTML control wants to handle up/down arrow, we will prevent them from listening to this event to prevent bugs due to handling arrow keys twice.
374
- event.stopPropagation();
375
- }
376
- },
377
- [focusElementMapRef, focus, focusedKeyRef, focusRelativeActivity, terminatorRef]
378
- );
379
-
380
- const handleTranscriptKeyDownCapture = useCallback<KeyboardEventHandler<HTMLDivElement>>(
381
- event => {
382
- const { altKey, ctrlKey, key, metaKey, target } = event;
383
-
384
- if (
385
- altKey ||
386
- (ctrlKey && key !== 'v' && key !== 'V') ||
387
- metaKey ||
388
- (!inputtableKey(key) && key !== 'Backspace')
389
- ) {
390
- // Ignore if one of the utility key (except SHIFT) is pressed
391
- // E.g. CTRL-C on a link in one of the message should not jump to chat box
392
- // E.g. "A" or "Backspace" should jump to chat box
393
- return;
394
- }
437
+ // If a custom HTML control wants to handle up/down arrow, we will prevent them from listening to this event to prevent bugs due to handling arrow keys twice.
438
+ event.stopPropagation();
439
+ }
440
+ },
441
+ [activityElementMapRef, focus, focusedActivityKeyRef, focusRelativeActivity, terminatorRef]
442
+ );
443
+
444
+ const handleTranscriptKeyDownCapture = useCallback<KeyboardEventHandler<HTMLDivElement>>(
445
+ event => {
446
+ const { altKey, ctrlKey, key, metaKey, target } = event;
447
+
448
+ if (altKey || (ctrlKey && key !== 'v') || metaKey || (!inputtableKey(key) && key !== 'Backspace')) {
449
+ // Ignore if one of the utility key (except SHIFT) is pressed
450
+ // E.g. CTRL-C on a link in one of the message should not jump to chat box
451
+ // E.g. "A" or "Backspace" should jump to chat box
452
+ return;
453
+ }
395
454
 
396
- // Send keystrokes to send box if we are focusing on the transcript or terminator.
397
- if (target === event.currentTarget || target === terminatorRef.current) {
398
- event.stopPropagation();
455
+ // Send keystrokes to send box if we are focusing on the transcript or terminator.
456
+ if (target === event.currentTarget || target === terminatorRef.current) {
457
+ event.stopPropagation();
399
458
 
400
- focus('sendBox');
401
- }
402
- },
403
- [focus, terminatorRef]
404
- );
405
-
406
- useRegisterFocusTranscript(useCallback(() => focusByActivityKey(undefined), [focusByActivityKey]));
407
-
408
- // When the focusing activity has changed, dispatch an event to observers of "useObserveTranscriptFocus".
409
- const dispatchTranscriptFocusByActivityKey = useDispatchTranscriptFocusByActivityKey();
410
-
411
- // Dispatch a "transcript focus" event based on user selection.
412
- // We should not dispatch "transcript focus" when a new activity come. Although the selection change, it is not initiated from the user.
413
- useMemo(
414
- () => dispatchTranscriptFocusByActivityKey(focusedExplicitly ? focusedKey : undefined),
415
- [dispatchTranscriptFocusByActivityKey, focusedKey, focusedExplicitly]
416
- );
417
-
418
- // When the transcript is being focused on, we should dispatch a "transcriptfocus" event.
419
- const handleFocus = useCallback(
420
- // We call "focusByActivityKey" with activity key of "true".
421
- // It means, tries to focus on anything.
422
- ({ currentTarget, target }) => target === currentTarget && focusByActivityKey(true, false),
423
- [focusByActivityKey]
424
- );
425
-
426
- // This is required by IE11.
427
- // When the user clicks on and empty space (a.k.a. filler) in an empty transcript, IE11 says the focus is on the <div className="filler">,
428
- // despite the fact there are no "tabIndex" attributes set on the filler.
429
- // We need to artificially send the focus back to the transcript.
430
- const handleFocusFiller = useCallback(() => focusByActivityKey(undefined), [focusByActivityKey]);
431
-
432
- // When focus into the transcript using TAB/SHIFT-TAB, scroll the focused activity into view.
433
- useObserveFocusVisible(
434
- rootElementRef,
435
- useCallback(() => focusByActivityKey(undefined), [focusByActivityKey])
436
- );
437
-
438
- const hasAnyChild = !!numRenderingActivities;
439
-
440
- return (
441
- <TranscriptFocusArea
442
- // Although Android TalkBack 12.1 does not support `aria-activedescendant`, when used, it become buggy and will narrate content twice.
443
- // We are disabling `aria-activedescendant` for Android. See <ActivityRow> for details.
444
- aria-activedescendant={android ? undefined : activeDescendantId}
445
- aria-label={transcriptAriaLabel}
446
- className={classNames('webchat__basic-transcript', rootClassName, (className || '') + '')}
447
- dir={direction}
448
- onFocus={handleFocus}
449
- onKeyDown={handleTranscriptKeyDown}
450
- onKeyDownCapture={handleTranscriptKeyDownCapture}
451
- ref={callbackRef}
452
- // "aria-activedescendant" will only works with a number of roles and it must be explicitly set.
453
- // https://www.w3.org/TR/wai-aria/#aria-activedescendant
454
- role="group"
455
- // For up/down arrow key navigation across activities, this component must be included in the tab sequence.
456
- // Otherwise, "aria-activedescendant" will not be narrated when the user press up/down arrow keys.
457
- // https://www.w3.org/TR/wai-aria-practices-1.1/#kbd_focus_activedescendant
458
- tabIndex={0}
459
- >
460
- <LiveRegionTranscript activityElementMapRef={focusElementMapRef} />
461
- {hasAnyChild && <FocusRedirector redirectRef={terminatorRef} />}
462
- <InternalTranscriptScrollable onFocusFiller={handleFocusFiller}>
463
- {hasAnyChild && <ActivityTree />}
464
- </InternalTranscriptScrollable>
465
- {hasAnyChild && (
466
- <Fragment>
467
- <FocusRedirector redirectRef={rootElementRef} />
468
- <TranscriptFocusTerminator ref={terminatorRef} role="note" tabIndex={0} />
469
- </Fragment>
470
- )}
471
- </TranscriptFocusArea>
472
- );
473
- }
474
- )
459
+ focus('sendBox');
460
+ }
461
+ },
462
+ [focus]
463
+ );
464
+
465
+ useRegisterFocusTranscript(useCallback(() => focusByActivityKey(undefined), [focusByActivityKey]));
466
+
467
+ // When the focusing activity has changed, dispatch an event to observers of "useObserveTranscriptFocus".
468
+ const dispatchTranscriptFocusByActivityKey = useDispatchTranscriptFocusByActivityKey();
469
+
470
+ // Dispatch a "transcript focus" event based on user selection.
471
+ // We should not dispatch "transcript focus" when a new activity come. Although the selection change, it is not initiated from the user.
472
+ useMemo(
473
+ () => dispatchTranscriptFocusByActivityKey(focusedExplicitly ? focusedActivityKey : undefined),
474
+ [dispatchTranscriptFocusByActivityKey, focusedActivityKey, focusedExplicitly]
475
+ );
476
+
477
+ // When the transcript is being focused on, we should dispatch a "transcriptfocus" event.
478
+ const handleFocus = useCallback(
479
+ // We call "focusByActivityKey" with activity key of "true".
480
+ // It means, tries to focus on anything.
481
+ ({ currentTarget, target }) => target === currentTarget && focusByActivityKey(true, false),
482
+ [focusByActivityKey]
483
+ );
484
+
485
+ // This is required by IE11.
486
+ // When the user clicks on and empty space (a.k.a. filler) in an empty transcript, IE11 says the focus is on the <div className="filler">,
487
+ // despite the fact there are no "tabIndex" attributes set on the filler.
488
+ // We need to artificially send the focus back to the transcript.
489
+ const handleFocusFiller = useCallback(() => focusByActivityKey(undefined), [focusByActivityKey]);
490
+
491
+ // When focus into the transcript using TAB/SHIFT-TAB, scroll the focused activity into view.
492
+ useObserveFocusVisible(
493
+ rootElementRef,
494
+ useCallback(() => focusByActivityKey(undefined), [focusByActivityKey])
495
+ );
496
+
497
+ return (
498
+ <div
499
+ // Although Android TalkBack 12.1 does not support `aria-activedescendant`, when used, it become buggy and will narrate content twice.
500
+ // We are disabling `aria-activedescendant` for Android. See <ActivityRow> for details.
501
+ aria-activedescendant={android ? undefined : activeDescendantId}
502
+ aria-label={transcriptAriaLabel}
503
+ className={classNames(
504
+ 'webchat__basic-transcript',
505
+ basicTranscriptStyleSet + '',
506
+ rootClassName,
507
+ (className || '') + ''
508
+ )}
509
+ dir={direction}
510
+ onFocus={handleFocus}
511
+ onKeyDown={handleTranscriptKeyDown}
512
+ onKeyDownCapture={handleTranscriptKeyDownCapture}
513
+ ref={callbackRef}
514
+ // "aria-activedescendant" will only works with a number of roles and it must be explicitly set.
515
+ // https://www.w3.org/TR/wai-aria/#aria-activedescendant
516
+ role="group"
517
+ // For up/down arrow key navigation across activities, this component must be included in the tab sequence.
518
+ // Otherwise, "aria-activedescendant" will not be narrated when the user press up/down arrow keys.
519
+ // https://www.w3.org/TR/wai-aria-practices-1.1/#kbd_focus_activedescendant
520
+ tabIndex={0}
521
+ >
522
+ <LiveRegionTranscript activityElementMapRef={activityElementMapRef} />
523
+ {/* TODO: [P2] Fix ESLint error `no-use-before-define` */}
524
+ {/* eslint-disable-next-line @typescript-eslint/no-use-before-define */}
525
+ <InternalTranscriptScrollable onFocusFiller={handleFocusFiller} terminatorRef={terminatorRef}>
526
+ {renderingElements}
527
+ </InternalTranscriptScrollable>
528
+ {!!renderingElements.length && (
529
+ <Fragment>
530
+ <FocusRedirector redirectRef={rootElementRef} />
531
+ <div
532
+ aria-labelledby={terminatorLabelId}
533
+ className="webchat__basic-transcript__terminator"
534
+ ref={terminatorRef}
535
+ role="note"
536
+ tabIndex={0}
537
+ >
538
+ <div className="webchat__basic-transcript__terminator-body">
539
+ {/* `id` is required for `aria-labelledby` */}
540
+ {/* eslint-disable-next-line react/forbid-dom-props */}
541
+ <div className="webchat__basic-transcript__terminator-text" id={terminatorLabelId}>
542
+ {terminatorText}
543
+ </div>
544
+ </div>
545
+ </div>
546
+ </Fragment>
547
+ )}
548
+ <div className="webchat__basic-transcript__focus-indicator" />
549
+ </div>
550
+ );
551
+ }
475
552
  );
476
553
 
554
+ InternalTranscript.defaultProps = {
555
+ className: ''
556
+ };
557
+
477
558
  InternalTranscript.displayName = 'InternalTranscript';
478
559
 
479
- type InternalTranscriptScrollableProps = Readonly<{
560
+ InternalTranscript.propTypes = {
561
+ // PropTypes cannot validate precisely with its TypeScript counterpart.
562
+ // @ts-ignore
563
+ activityElementMapRef: PropTypes.shape({
564
+ current: PropTypes.instanceOf(Map)
565
+ }).isRequired,
566
+ className: PropTypes.string
567
+ };
568
+
569
+ type InternalTranscriptScrollableProps = {
480
570
  children?: ReactNode;
481
571
  onFocusFiller: () => void;
482
- }>;
572
+ terminatorRef: MutableRefObject<HTMLDivElement>;
573
+ };
483
574
 
484
575
  // Separating high-frequency hooks to improve performance.
485
- const InternalTranscriptScrollable = ({ children, onFocusFiller }: InternalTranscriptScrollableProps) => {
576
+ const InternalTranscriptScrollable: FC<InternalTranscriptScrollableProps> = ({
577
+ children,
578
+ onFocusFiller,
579
+ terminatorRef
580
+ }) => {
486
581
  const [{ activities: activitiesStyleSet }] = useStyleSet();
582
+ const [animatingToEnd]: [boolean] = useAnimatingToEnd();
583
+ const [atEnd]: [boolean] = useAtEnd();
584
+ const [, unreadActivityKeys] = useActivityKeysByRead();
487
585
  const [sticky]: [boolean] = useSticky();
586
+ const [styleOptions] = useStyleOptions();
587
+ const focusByActivityKey = useFocusByActivityKey();
488
588
  const localize = useLocalizer();
589
+ const markActivityKeyAsRead = useMarkActivityKeyAsRead();
489
590
  const markAllAsAcknowledged = useMarkAllAsAcknowledged();
591
+ const scrollToEnd: (options?: ScrollToOptions) => void = useScrollToEnd();
490
592
 
491
593
  const prevSticky = usePrevious(sticky);
492
594
  const transcriptRoleDescription = localize('TRANSCRIPT_ARIA_ROLE_ALT');
493
595
 
494
596
  const stickyChangedToTrue = prevSticky !== sticky && sticky;
495
597
 
598
+ // Acknowledged means either:
599
+ // 1. The user sent a message
600
+ // - We don't need a condition here. When Web Chat sends the user's message, it will scroll to bottom, and it will trigger condition 2 below.
601
+ // 2. The user scroll to the bottom of the transcript, from a non-bottom scroll position
602
+ // - If the transcript is already at the bottom, the user needs to scroll up and then go back down
603
+ // - What happens if we are relaxing "scrolled from a non-bottom scroll position":
604
+ // 1. The condition will become solely "at the bottom of the transcript"
605
+ // 2. Auto-scroll will always scroll the transcript to the bottom
606
+ // 3. Web Chat will always acknowledge all activities as it is at the bottom
607
+ // 4. Acknowledge flag become useless
608
+ // 5. Therefore, even the developer set "pause after 3 activities", if activities are coming in at a slow pace (not batched in a single render)
609
+ // Web Chat will keep scrolling and not snapped/paused
610
+
611
+ // Note: When Web Chat is loaded, there are no activities acknowledged. We need to assume all arriving activities are acknowledged until end-user sends their first activity.
612
+ // Activities loaded initially could be from conversation history. Without assuming acknowledgement, Web Chat will not scroll initially (as everything is not acknowledged).
613
+ // It would be better if the chat adapter should let Web Chat know if the activity is loaded from history or not.
614
+
615
+ // TODO: [P2] #3670 Move the "conversation history acknowledgement" logic mentioned above to polyfill of chat adapters.
616
+ // 1. Chat adapter should send "acknowledged" as part of "channelData"
617
+ // 2. If "acknowledged" is "undefined", we set it to:
618
+ // a. true, if there are no egress activities yet
619
+ // b. Otherwise, false
620
+
496
621
  useMemo(
497
622
  () =>
498
623
  stickyChangedToTrue &&
@@ -503,22 +628,81 @@ const InternalTranscriptScrollable = ({ children, onFocusFiller }: InternalTrans
503
628
  [markAllAsAcknowledged, stickyChangedToTrue]
504
629
  );
505
630
 
506
- // We need to check if `children` is `false` or not.
507
- // If `children` is `false`, React.Children.count(children) will still return 1 (truthy).
508
- const hasAnyChild = !!children && !!React.Children.count(children);
631
+ const [flattenedActivityTreeWithRenderer] = useActivityTreeWithRenderer({ flat: true });
632
+ const getKeyByActivity = useGetKeyByActivity();
633
+
634
+ const renderingActivityKeys: string[] = useMemo<string[]>(
635
+ () => flattenedActivityTreeWithRenderer.map(({ activity }) => getKeyByActivity(activity)),
636
+ [flattenedActivityTreeWithRenderer, getKeyByActivity]
637
+ );
638
+
639
+ const renderingActivityKeysRef = useValueRef(renderingActivityKeys);
640
+
641
+ // To prevent flashy button, we are not waiting for another render loop to update the `[readActivityKeys, unreadActivityKeys]` state.
642
+ // Instead, we are building the next one in this `useMemo` call.
643
+ const nextUnreadActivityKeys = useMemo(() => {
644
+ // This code need to be careful reviewed as it will cause another render. The code should be converging.
645
+ // After we call `markActivityKeyAsRead`, everything will be read and nothing will be unread.
646
+ // That means, in next render, `unreadActivityKeys` will be emptied and the `markActivityKeyAsRead` will not get called again.
647
+ if (sticky && unreadActivityKeys.length) {
648
+ markActivityKeyAsRead(unreadActivityKeys[unreadActivityKeys.length - 1]);
649
+
650
+ return [];
651
+ }
652
+
653
+ return unreadActivityKeys;
654
+ }, [markActivityKeyAsRead, sticky, unreadActivityKeys]);
655
+
656
+ const nextUnreadActivityKeysRef = useValueRef(nextUnreadActivityKeys);
657
+
658
+ // If we are rendering anything that is unread, we should show the "New messages" button.
659
+ // Not everything in the `unreadActivityKeys` are rendered, say, bot typing indicator.
660
+ // We should not show the "New messages" button for bot typing indicator as it will confuse the user.
661
+ const unread = useMemo(
662
+ () => nextUnreadActivityKeys.some(key => renderingActivityKeys.includes(key)),
663
+ [renderingActivityKeys, nextUnreadActivityKeys]
664
+ );
665
+
666
+ const handleScrollToEndButtonClick = useCallback(() => {
667
+ scrollToEnd({ behavior: 'smooth' });
668
+
669
+ const { current: renderingActivityKeys } = renderingActivityKeysRef;
670
+
671
+ // After the "New message" button is clicked, focus on the first unread activity which will be rendered.
672
+ const firstUnreadRenderingActivityKey = nextUnreadActivityKeysRef.current.find(key =>
673
+ renderingActivityKeys.includes(key)
674
+ );
675
+
676
+ if (firstUnreadRenderingActivityKey) {
677
+ focusByActivityKey(firstUnreadRenderingActivityKey);
678
+ } else {
679
+ // If no unread activity, send the focus to the terminator block.
680
+ terminatorRef.current?.focus();
681
+ }
682
+ }, [focusByActivityKey, nextUnreadActivityKeysRef, renderingActivityKeysRef, scrollToEnd, terminatorRef]);
683
+
684
+ const renderScrollToEndButton = useCreateScrollToEndButtonRenderer()({
685
+ atEnd: animatingToEnd || atEnd || sticky,
686
+ styleOptions,
687
+ unread
688
+ });
689
+
690
+ const hasAnyChild = !!React.Children.count(children);
509
691
 
510
692
  return (
511
693
  <React.Fragment>
694
+ {renderScrollToEndButton && renderScrollToEndButton({ onClick: handleScrollToEndButtonClick })}
695
+ {hasAnyChild && <FocusRedirector redirectRef={terminatorRef} />}
512
696
  <ReactScrollToBottomPanel className="webchat__basic-transcript__scrollable">
513
697
  <div aria-hidden={true} className="webchat__basic-transcript__filler" onFocus={onFocusFiller} />
514
698
  {hasAnyChild && (
515
- <TranscriptActivityList
699
+ <section
516
700
  aria-roledescription={transcriptRoleDescription}
517
701
  className={classNames(activitiesStyleSet + '', 'webchat__basic-transcript__transcript')}
518
702
  role="feed"
519
703
  >
520
704
  {children}
521
- </TranscriptActivityList>
705
+ </section>
522
706
  )}
523
707
  <BasicTypingIndicator />
524
708
  </ReactScrollToBottomPanel>
@@ -526,6 +710,12 @@ const InternalTranscriptScrollable = ({ children, onFocusFiller }: InternalTrans
526
710
  );
527
711
  };
528
712
 
713
+ InternalTranscriptScrollable.propTypes = {
714
+ children: PropTypes.any.isRequired,
715
+ onFocusFiller: PropTypes.func.isRequired,
716
+ terminatorRef: PropTypes.any.isRequired
717
+ };
718
+
529
719
  type Scroller = ({ offsetHeight, scrollTop }: { offsetHeight: number; scrollTop: number }) => number;
530
720
 
531
721
  // "scroller" is the auto-scroll limiter, a.k.a. auto scroll snap.
@@ -644,37 +834,32 @@ const useScroller = (activityElementMapRef: MutableRefObject<ActivityElementMap>
644
834
  );
645
835
  };
646
836
 
647
- type BasicTranscriptProps = Readonly<{
648
- className: string;
649
- }>;
837
+ type BasicTranscriptProps = {
838
+ className?: string;
839
+ };
650
840
 
651
- const BasicTranscript = ({ className = '' }: BasicTranscriptProps) => {
652
- const [{ stylesRoot }] = useStyleOptions();
653
- const [nonce] = useNonce();
654
- const activityElementMapRef = useActivityElementMapRef();
655
- const containerRef = useRef<HTMLDivElement>(null);
656
- const terminatorRef = useRef<HTMLDivElement>(null);
841
+ const BasicTranscript: FC<BasicTranscriptProps> = ({ className }) => {
842
+ const activityElementMapRef = useRef<ActivityElementMap>(new Map());
843
+ const containerRef = useRef<HTMLDivElement>();
657
844
 
658
845
  const scroller = useScroller(activityElementMapRef);
659
- const styleOptions = useMemo(() => ({ stylesRoot }), [stylesRoot]);
660
846
 
661
847
  return (
662
- <ChatHistoryBox className={className}>
663
- <RenderingActivitiesComposer>
664
- <TranscriptFocusComposer containerRef={containerRef}>
665
- <ReactScrollToBottomComposer nonce={nonce} scroller={scroller} styleOptions={styleOptions}>
666
- <ChatHistoryToolbar>
667
- <ScrollToEndButton terminatorRef={terminatorRef} />
668
- </ChatHistoryToolbar>
669
- <GroupedRenderingActivitiesComposer>
670
- <InternalTranscript ref={containerRef} terminatorRef={terminatorRef} />
671
- </GroupedRenderingActivitiesComposer>
672
- </ReactScrollToBottomComposer>
673
- </TranscriptFocusComposer>
674
- </RenderingActivitiesComposer>
675
- </ChatHistoryBox>
848
+ <TranscriptFocusComposer containerRef={containerRef}>
849
+ <ReactScrollToBottomComposer scroller={scroller}>
850
+ <KeyboardHelp />
851
+ <InternalTranscript activityElementMapRef={activityElementMapRef} className={className} ref={containerRef} />
852
+ </ReactScrollToBottomComposer>
853
+ </TranscriptFocusComposer>
676
854
  );
677
855
  };
678
856
 
679
- export default wrapWith(ChatHistoryDOMComposer)(memo(BasicTranscript));
680
- export { type BasicTranscriptProps };
857
+ BasicTranscript.defaultProps = {
858
+ className: ''
859
+ };
860
+
861
+ BasicTranscript.propTypes = {
862
+ className: PropTypes.string
863
+ };
864
+
865
+ export default memo(BasicTranscript);