botframework-webchat-component 4.14.1 → 4.15.2-main.20220413.af6e8a3

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 (411) hide show
  1. package/.eslintrc.yml +4 -106
  2. package/.prettierrc.yml +1 -1
  3. package/lib/Activity/CarouselFilmStrip.js +1 -1
  4. package/lib/Activity/CarouselFilmStripAttachment.js +1 -1
  5. package/lib/Activity/CarouselLayout.js +3 -3
  6. package/lib/Activity/Speak.d.ts +2 -2
  7. package/lib/Activity/Speak.d.ts.map +1 -1
  8. package/lib/Activity/Speak.js +15 -8
  9. package/lib/Activity/StackedLayout.d.ts +5 -3
  10. package/lib/Activity/StackedLayout.d.ts.map +1 -1
  11. package/lib/Activity/StackedLayout.js +16 -21
  12. package/lib/Attachment/FileAttachment.js +2 -2
  13. package/lib/Attachment/FileContent.d.ts.map +1 -1
  14. package/lib/Attachment/FileContent.js +11 -1
  15. package/lib/BasicSendBox.d.ts.map +1 -1
  16. package/lib/BasicSendBox.js +8 -9
  17. package/lib/BasicToast.js +1 -1
  18. package/lib/BasicToaster.js +6 -3
  19. package/lib/BasicTranscript.d.ts +7 -0
  20. package/lib/BasicTranscript.d.ts.map +1 -0
  21. package/lib/BasicTranscript.js +386 -728
  22. package/lib/BasicTypingIndicator.d.ts +2 -1
  23. package/lib/BasicTypingIndicator.d.ts.map +1 -1
  24. package/lib/BasicTypingIndicator.js +12 -4
  25. package/lib/Composer.d.ts.map +1 -1
  26. package/lib/Composer.js +37 -32
  27. package/lib/ConnectivityStatus/Connecting.js +1 -1
  28. package/lib/Dictation.js +1 -1
  29. package/lib/Middleware/Activity/createCoreMiddleware.d.ts.map +1 -1
  30. package/lib/Middleware/Activity/createCoreMiddleware.js +9 -12
  31. package/lib/Middleware/ActivityStatus/SendStatus/SendFailedRetry.js +1 -1
  32. package/lib/Middleware/ActivityStatus/SendStatus/SendStatus.d.ts +2 -2
  33. package/lib/Middleware/ActivityStatus/SendStatus/SendStatus.d.ts.map +1 -1
  34. package/lib/Middleware/ActivityStatus/SendStatus/SendStatus.js +5 -4
  35. package/lib/Middleware/ActivityStatus/Timestamp.d.ts +2 -2
  36. package/lib/Middleware/ActivityStatus/Timestamp.d.ts.map +1 -1
  37. package/lib/Middleware/ActivityStatus/Timestamp.js +4 -2
  38. package/lib/Middleware/ActivityStatus/createSendStatusMiddleware.js +20 -17
  39. package/lib/Middleware/Attachment/createCoreMiddleware.js +2 -5
  40. package/lib/Middleware/AttachmentForScreenReader/createCoreMiddleware.d.ts.map +1 -1
  41. package/lib/Middleware/AttachmentForScreenReader/createCoreMiddleware.js +1 -1
  42. package/lib/Middleware/Avatar/createCoreMiddleware.d.ts.map +1 -1
  43. package/lib/Middleware/Avatar/createCoreMiddleware.js +2 -3
  44. package/lib/Middleware/CardAction/createCoreMiddleware.js +10 -3
  45. package/lib/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.d.ts.map +1 -1
  46. package/lib/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.js +1 -1
  47. package/lib/Middleware/Toast/createCoreMiddleware.d.ts.map +1 -1
  48. package/lib/Middleware/Toast/createCoreMiddleware.js +1 -1
  49. package/lib/Middleware/TypingIndicator/createCoreMiddleware.d.ts.map +1 -1
  50. package/lib/Middleware/TypingIndicator/createCoreMiddleware.js +8 -6
  51. package/lib/ReactWebChat.js +2 -2
  52. package/lib/ScreenReaderActivity.js +15 -6
  53. package/lib/ScreenReaderText.d.ts +9 -0
  54. package/lib/ScreenReaderText.d.ts.map +1 -0
  55. package/lib/ScreenReaderText.js +22 -8
  56. package/lib/SendBox/AutoResizeTextArea.js +1 -1
  57. package/lib/SendBox/DictationInterims.js +1 -1
  58. package/lib/SendBox/IconButton.d.ts +11 -0
  59. package/lib/SendBox/IconButton.d.ts.map +1 -0
  60. package/lib/SendBox/IconButton.js +26 -6
  61. package/lib/SendBox/MicrophoneButton.js +2 -2
  62. package/lib/SendBox/SendButton.js +2 -2
  63. package/lib/SendBox/SuggestedAction.d.ts +17 -0
  64. package/lib/SendBox/SuggestedAction.d.ts.map +1 -0
  65. package/lib/SendBox/SuggestedAction.js +26 -17
  66. package/lib/SendBox/SuggestedActions.d.ts.map +1 -1
  67. package/lib/SendBox/SuggestedActions.js +26 -9
  68. package/lib/SendBox/TextBox.js +4 -4
  69. package/lib/SendBox/UploadButton.js +4 -4
  70. package/lib/Styles/StyleSet/BasicTranscript.d.ts +13 -5
  71. package/lib/Styles/StyleSet/BasicTranscript.d.ts.map +1 -1
  72. package/lib/Styles/StyleSet/BasicTranscript.js +21 -9
  73. package/lib/Styles/StyleSet/Bubble.d.ts.map +1 -1
  74. package/lib/Styles/StyleSet/Bubble.js +3 -3
  75. package/lib/Styles/StyleSet/CarouselFilmStrip.d.ts.map +1 -1
  76. package/lib/Styles/StyleSet/CarouselFilmStrip.js +3 -3
  77. package/lib/Styles/StyleSet/CarouselFilmStripAttachment.d.ts.map +1 -1
  78. package/lib/Styles/StyleSet/CarouselFilmStripAttachment.js +3 -3
  79. package/lib/Styles/StyleSet/KeyboardHelp.d.ts +123 -0
  80. package/lib/Styles/StyleSet/KeyboardHelp.d.ts.map +1 -0
  81. package/lib/Styles/StyleSet/KeyboardHelp.js +145 -0
  82. package/lib/Styles/StyleSet/ScrollToEndButton.d.ts +1 -1
  83. package/lib/Styles/StyleSet/ScrollToEndButton.js +2 -2
  84. package/lib/Styles/StyleSet/SendBoxButton.d.ts +56 -10
  85. package/lib/Styles/StyleSet/SendBoxButton.d.ts.map +1 -1
  86. package/lib/Styles/StyleSet/SendBoxButton.js +76 -12
  87. package/lib/Styles/StyleSet/SendBoxTextBox.d.ts +1 -1
  88. package/lib/Styles/StyleSet/SendBoxTextBox.d.ts.map +1 -1
  89. package/lib/Styles/StyleSet/SendBoxTextBox.js +3 -3
  90. package/lib/Styles/StyleSet/StackedLayout.d.ts.map +1 -1
  91. package/lib/Styles/StyleSet/StackedLayout.js +1 -1
  92. package/lib/Styles/StyleSet/SuggestedAction.d.ts +73 -28
  93. package/lib/Styles/StyleSet/SuggestedAction.d.ts.map +1 -1
  94. package/lib/Styles/StyleSet/SuggestedAction.js +116 -41
  95. package/lib/Styles/StyleSet/SuggestedActions.d.ts +13 -6
  96. package/lib/Styles/StyleSet/SuggestedActions.d.ts.map +1 -1
  97. package/lib/Styles/StyleSet/SuggestedActions.js +13 -6
  98. package/lib/Styles/createStyleSet.d.ts +324 -55
  99. package/lib/Styles/createStyleSet.d.ts.map +1 -1
  100. package/lib/Styles/createStyleSet.js +6 -3
  101. package/lib/Styles/mirrorStyle.js +12 -3
  102. package/lib/Toast/NotificationIcon.js +7 -3
  103. package/lib/Toast/createToastMiddleware.d.ts.map +1 -1
  104. package/lib/Toast/createToastMiddleware.js +1 -1
  105. package/lib/Transcript/ActivityRow.d.ts +9 -0
  106. package/lib/Transcript/ActivityRow.d.ts.map +1 -0
  107. package/lib/Transcript/ActivityRow.js +159 -0
  108. package/lib/Transcript/ActivityTextAlt.js +57 -0
  109. package/lib/Transcript/FocusTrap.d.ts +8 -0
  110. package/lib/Transcript/FocusTrap.d.ts.map +1 -0
  111. package/lib/Transcript/FocusTrap.js +74 -0
  112. package/lib/Transcript/KeyboardHelp.d.ts +4 -0
  113. package/lib/Transcript/KeyboardHelp.d.ts.map +1 -0
  114. package/lib/Transcript/KeyboardHelp.js +550 -0
  115. package/lib/Transcript/LiveRegionTranscript.d.ts +8 -0
  116. package/lib/Transcript/LiveRegionTranscript.d.ts.map +1 -0
  117. package/lib/Transcript/LiveRegionTranscript.js +229 -0
  118. package/lib/Transcript/types.d.ts +2 -0
  119. package/lib/Transcript/types.d.ts.map +1 -0
  120. package/lib/Transcript/types.js +2 -0
  121. package/lib/Transcript/useActivityAccessibleName.d.ts +4 -0
  122. package/lib/Transcript/useActivityAccessibleName.d.ts.map +1 -0
  123. package/lib/Transcript/useActivityAccessibleName.js +97 -0
  124. package/lib/Transcript/useTypistNames.d.ts +3 -0
  125. package/lib/Transcript/useTypistNames.d.ts.map +1 -0
  126. package/lib/Transcript/useTypistNames.js +61 -0
  127. package/lib/Utils/AccessKeySink/Surface.js +1 -1
  128. package/lib/Utils/AccessibleButton.d.ts +11 -0
  129. package/lib/Utils/AccessibleButton.d.ts.map +1 -0
  130. package/lib/Utils/AccessibleButton.js +12 -7
  131. package/lib/Utils/AccessibleInputText.js +1 -1
  132. package/lib/Utils/AccessibleTextArea.js +1 -1
  133. package/lib/Utils/CroppedImage.js +1 -1
  134. package/lib/Utils/FocusRedirector.d.ts +9 -0
  135. package/lib/Utils/FocusRedirector.d.ts.map +1 -0
  136. package/lib/Utils/FocusRedirector.js +17 -14
  137. package/lib/Utils/InlineMarkdown.js +15 -8
  138. package/lib/Utils/TypeFocusSink/FocusBox.js +1 -1
  139. package/lib/Utils/TypeFocusSink/inputtableKey.d.ts +2 -0
  140. package/lib/Utils/TypeFocusSink/inputtableKey.d.ts.map +1 -0
  141. package/lib/Utils/TypeFocusSink/inputtableKey.js +5 -2
  142. package/lib/Utils/activityAltText.d.ts +8 -0
  143. package/lib/Utils/activityAltText.d.ts.map +1 -0
  144. package/lib/Utils/addTargetBlankToHyperlinksMarkdown.js +2 -2
  145. package/lib/Utils/createCustomEvent.js +8 -2
  146. package/lib/Utils/detectBrowser.js +4 -2
  147. package/lib/Utils/downscaleImageToDataURL/downscaleImageToDataURLUsingWorker.js +1 -1
  148. package/lib/Utils/downscaleImageToDataURL/index.js +1 -1
  149. package/lib/Utils/findAncestor.js +17 -0
  150. package/lib/Utils/getActivityUniqueId.js +4 -2
  151. package/lib/Utils/intersectionOf.d.ts +5 -0
  152. package/lib/Utils/intersectionOf.d.ts.map +1 -0
  153. package/lib/Utils/intersectionOf.js +17 -2
  154. package/lib/Utils/isZeroOrPositive.d.ts +5 -0
  155. package/lib/Utils/isZeroOrPositive.d.ts.map +1 -0
  156. package/lib/Utils/isZeroOrPositive.js +4 -1
  157. package/lib/Utils/mapMap.js +9 -2
  158. package/lib/Utils/readDataURIToBlob.js +1 -1
  159. package/lib/Utils/scrollIntoViewWithBlockNearest.d.ts +7 -0
  160. package/lib/Utils/scrollIntoViewWithBlockNearest.d.ts.map +1 -0
  161. package/lib/Utils/scrollIntoViewWithBlockNearest.js +48 -0
  162. package/lib/Utils/shallowEquals.js +7 -3
  163. package/lib/Utils/supportPseudoClass.d.ts +2 -0
  164. package/lib/Utils/supportPseudoClass.d.ts.map +1 -0
  165. package/lib/Utils/supportPseudoClass.js +23 -0
  166. package/lib/Utils/tabbableElements.d.ts +2 -0
  167. package/lib/Utils/tabbableElements.d.ts.map +1 -0
  168. package/lib/Utils/tabbableElements.js +2 -2
  169. package/lib/connectToWebChat.js +15 -7
  170. package/lib/hooks/index.js +24 -24
  171. package/lib/hooks/internal/BypassSpeechSynthesisPonyfill.js +8 -7
  172. package/lib/hooks/internal/useChanged.js +8 -1
  173. package/lib/hooks/internal/useDispatchScrollPosition.js +3 -7
  174. package/lib/hooks/internal/useDispatchTranscriptFocusByActivityKey.d.ts +2 -0
  175. package/lib/hooks/internal/useDispatchTranscriptFocusByActivityKey.d.ts.map +1 -0
  176. package/lib/hooks/internal/useDispatchTranscriptFocusByActivityKey.js +15 -0
  177. package/lib/hooks/internal/useFocusVisible.d.ts +3 -0
  178. package/lib/hooks/internal/useFocusVisible.d.ts.map +1 -0
  179. package/lib/hooks/internal/useFocusVisible.js +48 -0
  180. package/lib/hooks/internal/useMemoWithPrevious.d.ts +3 -0
  181. package/lib/hooks/internal/useMemoWithPrevious.d.ts.map +1 -0
  182. package/lib/hooks/internal/useMemoWithPrevious.js +22 -0
  183. package/lib/hooks/internal/useMemoize.d.ts +14 -0
  184. package/lib/hooks/internal/useMemoize.d.ts.map +1 -0
  185. package/lib/hooks/internal/useMemoize.js +11 -2
  186. package/lib/hooks/internal/useObserveFocusVisible.d.ts +3 -0
  187. package/lib/hooks/internal/useObserveFocusVisible.d.ts.map +1 -0
  188. package/lib/hooks/internal/useObserveFocusVisible.js +208 -0
  189. package/lib/hooks/internal/usePrevious.d.ts +2 -0
  190. package/lib/hooks/internal/usePrevious.d.ts.map +1 -0
  191. package/lib/hooks/internal/usePrevious.js +18 -0
  192. package/lib/hooks/internal/useStateRef.d.ts +3 -0
  193. package/lib/hooks/internal/useStateRef.d.ts.map +1 -0
  194. package/lib/hooks/internal/useStateRef.js +40 -0
  195. package/lib/hooks/internal/useValueRef.d.ts +3 -0
  196. package/lib/hooks/internal/useValueRef.d.ts.map +1 -0
  197. package/lib/hooks/internal/useValueRef.js +25 -0
  198. package/lib/hooks/useFocus.d.ts +1 -1
  199. package/lib/hooks/useFocus.d.ts.map +1 -1
  200. package/lib/hooks/useFocus.js +1 -1
  201. package/lib/hooks/useObserveTranscriptFocus.d.ts +2 -2
  202. package/lib/hooks/useObserveTranscriptFocus.d.ts.map +1 -1
  203. package/lib/hooks/useObserveTranscriptFocus.js +1 -1
  204. package/lib/hooks/useRenderMarkdownAsHTML.d.ts.map +1 -1
  205. package/lib/hooks/useRenderMarkdownAsHTML.js +1 -1
  206. package/lib/hooks/useScrollTo.d.ts.map +1 -1
  207. package/lib/hooks/useScrollTo.js +1 -1
  208. package/lib/hooks/useScrollToEnd.d.ts.map +1 -1
  209. package/lib/hooks/useScrollToEnd.js +1 -1
  210. package/lib/hooks/useSendFiles.d.ts.map +1 -1
  211. package/lib/hooks/useSendFiles.js +4 -4
  212. package/lib/index.d.ts +13 -3
  213. package/lib/index.d.ts.map +1 -1
  214. package/lib/index.js +20 -18
  215. package/lib/providers/ActivityTree/ActivityTreeComposer.d.ts +5 -0
  216. package/lib/providers/ActivityTree/ActivityTreeComposer.d.ts.map +1 -0
  217. package/lib/providers/ActivityTree/ActivityTreeComposer.js +86 -0
  218. package/lib/providers/ActivityTree/private/Context.d.ts +9 -0
  219. package/lib/providers/ActivityTree/private/Context.d.ts.map +1 -0
  220. package/lib/providers/ActivityTree/private/Context.js +13 -0
  221. package/lib/providers/ActivityTree/private/types.d.ts +10 -0
  222. package/lib/providers/ActivityTree/private/types.d.ts.map +1 -0
  223. package/lib/providers/ActivityTree/private/types.js +2 -0
  224. package/lib/providers/ActivityTree/private/useActivitiesWithRenderer.d.ts +4 -0
  225. package/lib/providers/ActivityTree/private/useActivitiesWithRenderer.d.ts.map +1 -0
  226. package/lib/providers/ActivityTree/private/useActivitiesWithRenderer.js +58 -0
  227. package/lib/providers/ActivityTree/private/useActivityTreeWithRenderer.d.ts +5 -0
  228. package/lib/providers/ActivityTree/private/useActivityTreeWithRenderer.d.ts.map +1 -0
  229. package/lib/providers/ActivityTree/private/useActivityTreeWithRenderer.js +166 -0
  230. package/lib/providers/ActivityTree/private/useContext.d.ts +3 -0
  231. package/lib/providers/ActivityTree/private/useContext.d.ts.map +1 -0
  232. package/lib/providers/ActivityTree/private/useContext.js +24 -0
  233. package/lib/providers/ActivityTree/useActivityTreeWithRenderer.d.ts +8 -0
  234. package/lib/providers/ActivityTree/useActivityTreeWithRenderer.d.ts.map +1 -0
  235. package/lib/providers/ActivityTree/useActivityTreeWithRenderer.js +17 -0
  236. package/lib/providers/LiveRegionTwin/LiveRegionTwinComposer.d.ts +37 -0
  237. package/lib/providers/LiveRegionTwin/LiveRegionTwinComposer.d.ts.map +1 -0
  238. package/lib/providers/LiveRegionTwin/LiveRegionTwinComposer.js +160 -0
  239. package/lib/providers/LiveRegionTwin/private/Context.d.ts +10 -0
  240. package/lib/providers/LiveRegionTwin/private/Context.d.ts.map +1 -0
  241. package/lib/providers/LiveRegionTwin/private/Context.js +13 -0
  242. package/lib/providers/LiveRegionTwin/private/LiveRegionTwinContainer.d.ts +12 -0
  243. package/lib/providers/LiveRegionTwin/private/LiveRegionTwinContainer.d.ts.map +1 -0
  244. package/lib/providers/LiveRegionTwin/private/LiveRegionTwinContainer.js +100 -0
  245. package/lib/providers/LiveRegionTwin/private/types.d.ts +8 -0
  246. package/lib/providers/LiveRegionTwin/private/types.d.ts.map +1 -0
  247. package/lib/providers/LiveRegionTwin/private/types.js +2 -0
  248. package/lib/providers/LiveRegionTwin/private/useContext.d.ts +3 -0
  249. package/lib/providers/LiveRegionTwin/private/useContext.d.ts.map +1 -0
  250. package/lib/providers/LiveRegionTwin/private/useContext.js +24 -0
  251. package/lib/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.d.ts +2 -0
  252. package/lib/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.d.ts.map +1 -0
  253. package/lib/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.js +24 -0
  254. package/lib/providers/LiveRegionTwin/private/useStaticElementEntries.d.ts +3 -0
  255. package/lib/providers/LiveRegionTwin/private/useStaticElementEntries.d.ts.map +1 -0
  256. package/lib/providers/LiveRegionTwin/private/useStaticElementEntries.js +15 -0
  257. package/lib/providers/LiveRegionTwin/useQueueStaticElement.d.ts +8 -0
  258. package/lib/providers/LiveRegionTwin/useQueueStaticElement.d.ts.map +1 -0
  259. package/lib/providers/LiveRegionTwin/useQueueStaticElement.js +20 -0
  260. package/lib/providers/TranscriptFocus/TranscriptFocusComposer.d.ts +7 -0
  261. package/lib/providers/TranscriptFocus/TranscriptFocusComposer.d.ts.map +1 -0
  262. package/lib/providers/TranscriptFocus/TranscriptFocusComposer.js +184 -0
  263. package/lib/providers/TranscriptFocus/private/Context.d.ts +12 -0
  264. package/lib/providers/TranscriptFocus/private/Context.d.ts.map +1 -0
  265. package/lib/providers/TranscriptFocus/private/Context.js +13 -0
  266. package/lib/providers/TranscriptFocus/private/useContext.d.ts +2 -0
  267. package/lib/providers/TranscriptFocus/private/useContext.d.ts.map +1 -0
  268. package/lib/providers/TranscriptFocus/private/useContext.js +24 -0
  269. package/lib/providers/TranscriptFocus/useActiveDescendantId.d.ts +2 -0
  270. package/lib/providers/TranscriptFocus/useActiveDescendantId.d.ts.map +1 -0
  271. package/lib/providers/TranscriptFocus/useActiveDescendantId.js +15 -0
  272. package/lib/providers/TranscriptFocus/useFocusByActivityKey.d.ts +8 -0
  273. package/lib/providers/TranscriptFocus/useFocusByActivityKey.d.ts.map +1 -0
  274. package/lib/providers/TranscriptFocus/useFocusByActivityKey.js +21 -0
  275. package/lib/providers/TranscriptFocus/useFocusRelativeActivity.d.ts +2 -0
  276. package/lib/providers/TranscriptFocus/useFocusRelativeActivity.d.ts.map +1 -0
  277. package/lib/providers/TranscriptFocus/useFocusRelativeActivity.js +15 -0
  278. package/lib/providers/TranscriptFocus/useFocusedActivityKey.d.ts +2 -0
  279. package/lib/providers/TranscriptFocus/useFocusedActivityKey.d.ts.map +1 -0
  280. package/lib/providers/TranscriptFocus/useFocusedActivityKey.js +15 -0
  281. package/lib/providers/TranscriptFocus/useFocusedExplicitly.d.ts +2 -0
  282. package/lib/providers/TranscriptFocus/useFocusedExplicitly.d.ts.map +1 -0
  283. package/lib/providers/TranscriptFocus/useFocusedExplicitly.js +15 -0
  284. package/lib/providers/TranscriptFocus/useGetDescendantIdByActivityKey.d.ts +2 -0
  285. package/lib/providers/TranscriptFocus/useGetDescendantIdByActivityKey.d.ts.map +1 -0
  286. package/lib/providers/TranscriptFocus/useGetDescendantIdByActivityKey.js +15 -0
  287. package/package.json +30 -33
  288. package/src/Activity/CarouselFilmStripAttachment.js +0 -1
  289. package/src/Activity/Speak.tsx +21 -18
  290. package/src/Activity/StackedLayout.tsx +30 -35
  291. package/src/Attachment/FileAttachment.js +1 -1
  292. package/src/Attachment/FileContent.tsx +12 -0
  293. package/src/BasicSendBox.tsx +3 -2
  294. package/src/BasicToaster.js +5 -1
  295. package/src/BasicTranscript.tsx +894 -0
  296. package/src/BasicTypingIndicator.tsx +3 -2
  297. package/src/Composer.tsx +41 -29
  298. package/src/Middleware/Activity/createCoreMiddleware.tsx +47 -46
  299. package/src/Middleware/ActivityStatus/SendStatus/SendStatus.tsx +5 -3
  300. package/src/Middleware/ActivityStatus/Timestamp.tsx +5 -3
  301. package/src/Middleware/ActivityStatus/createSendStatusMiddleware.js +2 -0
  302. package/src/Middleware/Attachment/createCoreMiddleware.tsx +28 -28
  303. package/src/Middleware/AttachmentForScreenReader/createCoreMiddleware.tsx +25 -23
  304. package/src/Middleware/Avatar/createCoreMiddleware.tsx +9 -8
  305. package/src/Middleware/CardAction/createCoreMiddleware.js +9 -2
  306. package/src/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.ts +11 -9
  307. package/src/Middleware/Toast/createCoreMiddleware.tsx +12 -10
  308. package/src/Middleware/TypingIndicator/createCoreMiddleware.tsx +8 -2
  309. package/src/ScreenReaderActivity.js +18 -3
  310. package/src/{ScreenReaderText.js → ScreenReaderText.tsx} +27 -9
  311. package/src/SendBox/{IconButton.js → IconButton.tsx} +19 -3
  312. package/src/SendBox/{SuggestedAction.js → SuggestedAction.tsx} +72 -35
  313. package/src/SendBox/SuggestedActions.tsx +48 -21
  314. package/src/Styles/StyleSet/BasicTranscript.ts +34 -20
  315. package/src/Styles/StyleSet/Bubble.ts +0 -1
  316. package/src/Styles/StyleSet/CarouselFilmStrip.ts +12 -10
  317. package/src/Styles/StyleSet/CarouselFilmStripAttachment.ts +4 -3
  318. package/src/Styles/StyleSet/KeyboardHelp.ts +157 -0
  319. package/src/Styles/StyleSet/ScrollToEndButton.ts +1 -1
  320. package/src/Styles/StyleSet/SendBoxButton.ts +84 -13
  321. package/src/Styles/StyleSet/SendBoxTextBox.ts +1 -2
  322. package/src/Styles/StyleSet/StackedLayout.ts +13 -11
  323. package/src/Styles/StyleSet/SuggestedAction.ts +129 -42
  324. package/src/Styles/StyleSet/SuggestedActions.ts +13 -5
  325. package/src/Styles/createStyleSet.ts +2 -1
  326. package/src/Styles/mirrorStyle.js +10 -2
  327. package/src/Toast/NotificationIcon.js +4 -1
  328. package/src/Toast/createToastMiddleware.tsx +4 -1
  329. package/src/Transcript/ActivityRow.tsx +123 -0
  330. package/src/Transcript/ActivityTextAlt.tsx +31 -0
  331. package/src/Transcript/FocusTrap.tsx +64 -0
  332. package/src/Transcript/KeyboardHelp.tsx +282 -0
  333. package/src/Transcript/LiveRegionTranscript.tsx +196 -0
  334. package/src/Transcript/types.ts +1 -0
  335. package/src/Transcript/useActivityAccessibleName.ts +84 -0
  336. package/src/Transcript/useTypistNames.ts +37 -0
  337. package/src/Utils/{AccessibleButton.js → AccessibleButton.tsx} +19 -4
  338. package/src/Utils/{FocusRedirector.js → FocusRedirector.tsx} +21 -8
  339. package/src/Utils/InlineMarkdown.js +18 -2
  340. package/src/Utils/TypeFocusSink/inputtableKey.ts +5 -1
  341. package/src/Utils/createCustomEvent.js +7 -1
  342. package/src/Utils/detectBrowser.js +2 -1
  343. package/src/Utils/findAncestor.ts +12 -0
  344. package/src/Utils/getActivityUniqueId.ts +5 -0
  345. package/src/Utils/intersectionOf.ts +14 -0
  346. package/src/Utils/isZeroOrPositive.ts +7 -0
  347. package/src/Utils/mapMap.js +7 -1
  348. package/src/Utils/scrollIntoViewWithBlockNearest.ts +20 -0
  349. package/src/Utils/shallowEquals.js +8 -1
  350. package/src/Utils/supportPseudoClass.ts +17 -0
  351. package/src/Utils/{tabbableElements.js → tabbableElements.ts} +6 -5
  352. package/src/connectToWebChat.js +11 -4
  353. package/src/hooks/internal/BypassSpeechSynthesisPonyfill.js +3 -1
  354. package/src/hooks/internal/useChanged.ts +17 -0
  355. package/src/hooks/internal/useDispatchScrollPosition.js +1 -3
  356. package/src/hooks/internal/useDispatchTranscriptFocusByActivityKey.ts +5 -0
  357. package/src/hooks/internal/useFocusVisible.ts +22 -0
  358. package/src/hooks/internal/useMemoWithPrevious.ts +16 -0
  359. package/src/hooks/internal/useMemoize.spec.js +1 -1
  360. package/src/hooks/internal/useMemoize.ts +53 -0
  361. package/src/hooks/internal/useObserveFocusVisible.ts +252 -0
  362. package/src/hooks/internal/usePrevious.ts +12 -0
  363. package/src/hooks/internal/useStateRef.ts +31 -0
  364. package/src/hooks/internal/useValueRef.ts +22 -0
  365. package/src/hooks/useFocus.ts +1 -1
  366. package/src/hooks/useObserveTranscriptFocus.ts +2 -2
  367. package/src/hooks/useRenderMarkdownAsHTML.ts +4 -5
  368. package/src/hooks/useScrollTo.ts +4 -3
  369. package/src/hooks/useScrollToEnd.ts +4 -3
  370. package/src/hooks/useSendFiles.ts +7 -5
  371. package/src/index.ts +0 -1
  372. package/src/providers/ActivityTree/ActivityTreeComposer.tsx +74 -0
  373. package/src/providers/ActivityTree/private/Context.ts +12 -0
  374. package/src/providers/ActivityTree/private/types.ts +12 -0
  375. package/src/providers/ActivityTree/private/useActivitiesWithRenderer.ts +64 -0
  376. package/src/providers/ActivityTree/private/useActivityTreeWithRenderer.ts +135 -0
  377. package/src/providers/ActivityTree/private/useContext.ts +15 -0
  378. package/src/providers/ActivityTree/useActivityTreeWithRenderer.ts +16 -0
  379. package/src/providers/LiveRegionTwin/LiveRegionTwinComposer.tsx +161 -0
  380. package/src/providers/LiveRegionTwin/private/Context.ts +15 -0
  381. package/src/providers/LiveRegionTwin/private/LiveRegionTwinContainer.tsx +80 -0
  382. package/src/providers/LiveRegionTwin/private/types.ts +10 -0
  383. package/src/providers/LiveRegionTwin/private/useContext.ts +15 -0
  384. package/src/providers/LiveRegionTwin/private/useMarkAllAsRenderedEffect.ts +13 -0
  385. package/src/providers/LiveRegionTwin/private/useStaticElementEntries.ts +7 -0
  386. package/src/providers/LiveRegionTwin/useQueueStaticElement.ts +12 -0
  387. package/src/providers/TranscriptFocus/TranscriptFocusComposer.tsx +180 -0
  388. package/src/providers/TranscriptFocus/private/Context.ts +16 -0
  389. package/src/providers/TranscriptFocus/private/useContext.ts +13 -0
  390. package/src/providers/TranscriptFocus/useActiveDescendantId.ts +5 -0
  391. package/src/providers/TranscriptFocus/useFocusByActivityKey.ts +14 -0
  392. package/src/providers/TranscriptFocus/useFocusRelativeActivity.ts +5 -0
  393. package/src/providers/TranscriptFocus/useFocusedActivityKey.ts +5 -0
  394. package/src/providers/TranscriptFocus/useFocusedExplicitly.ts +5 -0
  395. package/src/providers/TranscriptFocus/useGetDescendantIdByActivityKey.ts +5 -0
  396. package/.eslintignore +0 -1
  397. package/lib/Middleware/GroupActivities/createCoreMiddleware.js +0 -69
  398. package/lib/Utils/findLastIndex.js +0 -32
  399. package/lib/hooks/internal/useAcknowledgedActivity.js +0 -90
  400. package/lib/hooks/internal/useDispatchTranscriptFocus.js +0 -19
  401. package/src/BasicTranscript.js +0 -1139
  402. package/src/Middleware/GroupActivities/createCoreMiddleware.js +0 -57
  403. package/src/Utils/findLastIndex.js +0 -11
  404. package/src/Utils/findLastIndex.spec.js +0 -31
  405. package/src/Utils/getActivityUniqueId.js +0 -3
  406. package/src/Utils/intersectionOf.js +0 -11
  407. package/src/Utils/isZeroOrPositive.js +0 -4
  408. package/src/hooks/internal/useAcknowledgedActivity.js +0 -65
  409. package/src/hooks/internal/useChanged.js +0 -10
  410. package/src/hooks/internal/useDispatchTranscriptFocus.js +0 -7
  411. package/src/hooks/internal/useMemoize.js +0 -37
@@ -6,7 +6,10 @@ import React from 'react';
6
6
  import BasicToast from '../BasicToast';
7
7
 
8
8
  function createToastMiddleware(): ToastMiddleware {
9
- return () => () => ({ notification }) => <BasicToast notification={notification} />;
9
+ return () =>
10
+ () =>
11
+ ({ notification }) =>
12
+ <BasicToast notification={notification} />;
10
13
  }
11
14
 
12
15
  export default createToastMiddleware;
@@ -0,0 +1,123 @@
1
+ import { hooks } from 'botframework-webchat-api';
2
+ import classNames from 'classnames';
3
+ import PropTypes from 'prop-types';
4
+ import React, { forwardRef, useCallback, useRef } from 'react';
5
+ import type { MouseEventHandler, PropsWithChildren } from 'react';
6
+ import type { WebChatActivity } from 'botframework-webchat-core';
7
+
8
+ import { android } from '../Utils/detectBrowser';
9
+ import FocusTrap from './FocusTrap';
10
+ import ScreenReaderText from '../ScreenReaderText';
11
+ import SpeakActivity from '../Activity/Speak';
12
+ import useActiveDescendantId from '../providers/TranscriptFocus/useActiveDescendantId';
13
+ import useActivityAccessibleName from './useActivityAccessibleName';
14
+ import useFocusByActivityKey from '../providers/TranscriptFocus/useFocusByActivityKey';
15
+ import useGetDescendantIdByActivityKey from '../providers/TranscriptFocus/useGetDescendantIdByActivityKey';
16
+ import useValueRef from '../hooks/internal/useValueRef';
17
+
18
+ const { useActivityKeysByRead, useGetHasAcknowledgedByActivityKey, useGetKeyByActivity } = hooks;
19
+
20
+ type ActivityRowProps = PropsWithChildren<{ activity: WebChatActivity }>;
21
+
22
+ const ActivityRow = forwardRef<HTMLLIElement, ActivityRowProps>(({ activity, children }, ref) => {
23
+ const [activeDescendantId] = useActiveDescendantId();
24
+ const [readActivityKeys] = useActivityKeysByRead();
25
+ const bodyRef = useRef<HTMLDivElement>();
26
+ const focusByActivityKey = useFocusByActivityKey();
27
+ const getKeyByActivity = useGetKeyByActivity();
28
+ // TODO: [P2] #2858 We should use core/definitions/speakingActivity for this predicate instead
29
+ const shouldSpeak = activity.channelData?.speak;
30
+
31
+ const [accessibleName] = useActivityAccessibleName(activity, bodyRef);
32
+ const activityKey = getKeyByActivity(activity);
33
+
34
+ const acknowledged = useGetHasAcknowledgedByActivityKey()(activityKey);
35
+ const activityKeyRef = useValueRef<string>(activityKey);
36
+ const descendantId = useGetDescendantIdByActivityKey()(activityKey);
37
+ const descendantLabelId = `webchat__basic-transcript__active-descendant-label--${activityKey}`;
38
+
39
+ const isActiveDescendant = descendantId === activeDescendantId;
40
+ const read = readActivityKeys.includes(activityKey);
41
+
42
+ const focusSelf = useCallback<(withFocus?: boolean) => void>(
43
+ (withFocus?: boolean) => focusByActivityKey(activityKeyRef.current, withFocus),
44
+ [activityKeyRef, focusByActivityKey]
45
+ );
46
+
47
+ // When a child of the activity receives focus, notify the transcript to set the `aria-activedescendant` to this activity.
48
+ const handleDescendantFocus: () => void = useCallback(() => focusSelf(false), [focusSelf]);
49
+
50
+ // When receive Escape key from descendant, focus back to the activity.
51
+ const handleLeaveFocusTrap = useCallback(() => focusSelf(), [focusSelf]);
52
+
53
+ // When the user press UP/DOWN arrow keys, we put a visual focus indicator around the focused activity.
54
+ // We should do the same for mouse, when the user click on the activity, we should also put a visual focus indicator around the activity.
55
+ // We are doing it in event capture phase to prevent descendants from stopping event propagation to us.
56
+ const handleMouseDownCapture: MouseEventHandler = useCallback(() => focusSelf(false), [focusSelf]);
57
+
58
+ return (
59
+ // TODO: [P2] Add `aria-roledescription="message"` for better AX, need localization strings.
60
+ <article
61
+ aria-hidden={activity.channelData?.['webchat:fallback-text'] === ''}
62
+ className={classNames('webchat__basic-transcript__activity', {
63
+ 'webchat__basic-transcript__activity--acknowledged': acknowledged,
64
+ 'webchat__basic-transcript__activity--read': read
65
+ })}
66
+ // When NVDA is in browse mode, using up/down arrow key to "browse" will dispatch "click" and "mousedown" events for <article> element (inside <ScreenReaderActivity>).
67
+ onMouseDownCapture={handleMouseDownCapture}
68
+ ref={ref}
69
+ >
70
+ {/* TODO: [P1] File a crbug for TalkBack. It should not able to read the content twice when scanning. */}
71
+
72
+ {/* The following <div> is designed for active descendant only.
73
+ We want to prevent screen reader from scanning the content that is authored only for active descendant.
74
+ The specific content should only read when user press UP/DOWN arrow keys to change `aria-activedescendant`.
75
+ However, Android TalkBack 12.1 is buggy when the there is an element with ID of one of the `aria-activedescendant` potential candidates,
76
+ TalkBack will narrate the message content twice (i.e. content of `bodyRef`), regardless whether the ID is currently set as `aria-activedescendant` or not.
77
+ As Android does not support active descendant, we are hiding the whole DOM element altogether. */}
78
+
79
+ {!android && (
80
+ <div
81
+ aria-labelledby={descendantLabelId}
82
+ className="webchat__basic-transcript__activity-active-descendant"
83
+ // "id" is required for "aria-labelledby"
84
+ // eslint-disable-next-line react/forbid-dom-props
85
+ id={descendantId}
86
+ role="article"
87
+ >
88
+ <ScreenReaderText aria-hidden={true} id={descendantLabelId} text={accessibleName} />
89
+ </div>
90
+ )}
91
+ {/* Add tests for focus trap */}
92
+ <FocusTrap onFocus={handleDescendantFocus} onLeave={handleLeaveFocusTrap}>
93
+ <div className="webchat__basic-transcript__activity-body" ref={bodyRef}>
94
+ {children}
95
+ </div>
96
+ </FocusTrap>
97
+ {shouldSpeak && <SpeakActivity activity={activity} />}
98
+ <div
99
+ className={classNames('webchat__basic-transcript__activity-indicator', {
100
+ 'webchat__basic-transcript__activity-indicator--focus': isActiveDescendant
101
+ })}
102
+ />
103
+ </article>
104
+ );
105
+ });
106
+
107
+ ActivityRow.defaultProps = {
108
+ children: undefined
109
+ };
110
+
111
+ ActivityRow.propTypes = {
112
+ // PropTypes cannot fully capture TypeScript type.
113
+ // @ts-ignore
114
+ activity: PropTypes.shape({
115
+ channelData: PropTypes.shape({
116
+ speak: PropTypes.bool,
117
+ 'webchat:fallback-text': PropTypes.string
118
+ })
119
+ }).isRequired,
120
+ children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)])
121
+ };
122
+
123
+ export default ActivityRow;
@@ -0,0 +1,31 @@
1
+ import PropTypes from 'prop-types';
2
+ import React from 'react';
3
+ import type { RefObject, VFC } from 'react';
4
+ import type { WebChatActivity } from 'botframework-webchat-core';
5
+
6
+ import ScreenReaderText from '../ScreenReaderText';
7
+ import useActivityAccessibleName from './useActivityAccessibleName';
8
+
9
+ type ActivityTextAltProps = {
10
+ activity: WebChatActivity;
11
+ bodyRef: RefObject<HTMLDivElement>;
12
+ id: string;
13
+ };
14
+
15
+ const ActivityTextAlt: VFC<ActivityTextAltProps> = ({ activity, bodyRef, id }) => {
16
+ const [accessibleName] = useActivityAccessibleName(activity, bodyRef);
17
+
18
+ return <ScreenReaderText aria-hidden={true} id={id} text={accessibleName} />;
19
+ };
20
+
21
+ ActivityTextAlt.propTypes = {
22
+ activity: PropTypes.any.isRequired,
23
+ // PropTypes is not fully compatible with TypeScript
24
+ // @ts-ignore
25
+ bodyRef: PropTypes.shape({
26
+ current: PropTypes.any
27
+ }).isRequired,
28
+ id: PropTypes.string.isRequired
29
+ };
30
+
31
+ export default ActivityTextAlt;
@@ -0,0 +1,64 @@
1
+ import PropTypes from 'prop-types';
2
+ import React, { Fragment, useCallback, useRef } from 'react';
3
+
4
+ import type { FC, KeyboardEventHandler, PropsWithChildren } from 'react';
5
+
6
+ import FocusRedirector from '../Utils/FocusRedirector';
7
+ import tabbableElements from '../Utils/tabbableElements';
8
+ import useValueRef from '../hooks/internal/useValueRef';
9
+
10
+ type FocusTrapProps = PropsWithChildren<{
11
+ onFocus: () => void;
12
+ onLeave: () => void;
13
+ }>;
14
+
15
+ const FocusTrap: FC<FocusTrapProps> = ({ children, onFocus, onLeave }) => {
16
+ const bodyRef = useRef<HTMLDivElement>();
17
+ const onLeaveRef = useValueRef<() => void>(onLeave);
18
+
19
+ const handleBodyKeyDown: KeyboardEventHandler = useCallback(
20
+ event => {
21
+ if (event.key === 'Escape') {
22
+ event.preventDefault();
23
+ event.stopPropagation();
24
+
25
+ onLeaveRef.current?.();
26
+ }
27
+ },
28
+ [onLeaveRef]
29
+ );
30
+
31
+ const handleFirstSentinelFocus: () => void = useCallback(() => {
32
+ const focusables = tabbableElements(bodyRef.current);
33
+
34
+ focusables[focusables.length - 1]?.focus();
35
+ }, [bodyRef]);
36
+
37
+ const handleLastSentinelFocus: () => void = useCallback(
38
+ () => tabbableElements(bodyRef.current)[0]?.focus(),
39
+ [bodyRef]
40
+ );
41
+
42
+ return (
43
+ <Fragment>
44
+ <FocusRedirector onFocus={handleFirstSentinelFocus} />
45
+ <div onFocus={onFocus} onKeyDown={handleBodyKeyDown} ref={bodyRef}>
46
+ {children}
47
+ </div>
48
+ <FocusRedirector onFocus={handleLastSentinelFocus} />
49
+ </Fragment>
50
+ );
51
+ };
52
+
53
+ FocusTrap.defaultProps = {
54
+ children: undefined,
55
+ onFocus: undefined
56
+ };
57
+
58
+ FocusTrap.propTypes = {
59
+ children: PropTypes.any,
60
+ onFocus: PropTypes.func,
61
+ onLeave: PropTypes.func.isRequired
62
+ };
63
+
64
+ export default FocusTrap;
@@ -0,0 +1,282 @@
1
+ import { hooks } from 'botframework-webchat-api';
2
+ import classNames from 'classnames';
3
+ import PropTypes from 'prop-types';
4
+ import React, { useCallback, useState } from 'react';
5
+
6
+ import type { VFC } from 'react';
7
+
8
+ import useFocus from '../hooks/useFocus';
9
+ import useStyleSet from '../hooks/useStyleSet';
10
+
11
+ const { useLocalizer } = hooks;
12
+
13
+ type NotesBodyProps = {
14
+ header: string;
15
+ text: string;
16
+ };
17
+
18
+ const Notes: VFC<NotesBodyProps> = ({ header, text }) => (
19
+ <section className="webchat__keyboard-help__notes">
20
+ <h4 className="webchat__keyboard-help__notes-header">{header}</h4>
21
+ {text.split('\n').map((line, index) => (
22
+ // We are splitting lines into paragraphs, index as key is legitimate here.
23
+ // eslint-disable-next-line react/no-array-index-key
24
+ <p className="webchat__keyboard-help__notes-text" key={index}>
25
+ {line}
26
+ </p>
27
+ ))}
28
+ </section>
29
+ );
30
+
31
+ Notes.propTypes = {
32
+ header: PropTypes.string.isRequired,
33
+ text: PropTypes.string.isRequired
34
+ };
35
+
36
+ const KeyboardHelp: VFC<{}> = () => {
37
+ const [{ keyboardHelp: keyboardHelpStyleSet }] = useStyleSet();
38
+ const [shown, setShown] = useState(false);
39
+ const focus = useFocus();
40
+ const localize = useLocalizer();
41
+
42
+ const chatHistoryAccessItemsInMessageBody = localize('KEYBOARD_HELP_CHAT_HISTORY_ACCESS_ITEMS_IN_MESSAGE_BODY');
43
+ const chatHistoryAccessItemsInMessageHeader = localize('KEYBOARD_HELP_CHAT_HISTORY_ACCESS_ITEMS_IN_MESSAGE_HEADER');
44
+ const chatHistoryHeader = localize('KEYBOARD_HELP_CHAT_HISTORY_HEADER');
45
+ const chatHistoryLeaveMessageBody = localize('KEYBOARD_HELP_CHAT_HISTORY_LEAVE_MESSAGE_BODY');
46
+ const chatHistoryLeaveMessageHeader = localize('KEYBOARD_HELP_CHAT_HISTORY_LEAVE_MESSAGE_HEADER');
47
+ const chatHistoryMoveBetweenItemsBody = localize('KEYBOARD_HELP_CHAT_HISTORY_MOVE_BETWEEN_ITEMS_BODY');
48
+ const chatHistoryMoveBetweenItemsHeader = localize('KEYBOARD_HELP_CHAT_HISTORY_MOVE_BETWEEN_ITEMS_HEADER');
49
+ const chatHistoryMoveBetweenMessagesBody = localize('KEYBOARD_HELP_CHAT_HISTORY_MOVE_BETWEEN_MESSAGES_BODY');
50
+ const chatHistoryMoveBetweenMessagesHeader = localize('KEYBOARD_HELP_CHAT_HISTORY_MOVE_BETWEEN_MESSAGES_HEADER');
51
+ const chatWindowBodyDoActionBody = localize('KEYBOARD_HELP_CHAT_WINDOW_BODY_DO_ACTION_BODY');
52
+ const chatWindowBodyDoActionHeader = localize('KEYBOARD_HELP_CHAT_WINDOW_BODY_DO_ACTION_HEADER');
53
+ const chatWindowBodyMoveBetweenItemsBody = localize('KEYBOARD_HELP_CHAT_WINDOW_BODY_MOVE_BETWEEN_ITEMS_BODY');
54
+ const chatWindowBodyMoveBetweenItemsHeader = localize('KEYBOARD_HELP_CHAT_WINDOW_BODY_MOVE_BETWEEN_ITEMS_HEADER');
55
+ const chatWindowHeader = localize('KEYBOARD_HELP_CHAT_WINDOW_HEADER');
56
+ const closeButtonAlt = localize('KEYBOARD_HELP_CLOSE_BUTTON_ALT');
57
+ const header = localize('KEYBOARD_HELP_HEADER');
58
+
59
+ const handleBlur = useCallback(
60
+ // We will keep the help screen shown if the blur is caused by switch app.
61
+ // When switch app, `document.activeElement` will remains.
62
+ event => document.activeElement !== event.target && setShown(false),
63
+ [setShown]
64
+ );
65
+
66
+ const handleCloseButtonClick = useCallback(() => focus('main'), [focus]);
67
+
68
+ const handleFocusWithin = useCallback(() => setShown(true), [setShown]);
69
+
70
+ const handleKeyPress = useCallback(
71
+ ({ key }) => (key === 'Enter' || key === 'Escape' || key === ' ') && focus('main'),
72
+ [focus]
73
+ );
74
+
75
+ return (
76
+ <div
77
+ // When the dialog is not shown, "aria-hidden" helps to prevent scan mode from able to scan the content of the dialog.
78
+ aria-hidden={!shown}
79
+ className={classNames('webchat__keyboard-help', keyboardHelpStyleSet + '', {
80
+ 'webchat__keyboard-help--shown': shown
81
+ })}
82
+ onBlur={handleBlur}
83
+ onFocus={handleFocusWithin}
84
+ onKeyPress={handleKeyPress}
85
+ role="dialog"
86
+ tabIndex={0}
87
+ >
88
+ <div className="webchat__keyboard-help__box">
89
+ <header>
90
+ <h2 className="webchat__keyboard-help__header">{header}</h2>
91
+ </header>
92
+ <button
93
+ aria-label={closeButtonAlt}
94
+ className="webchat__keyboard-help__close-button"
95
+ onClick={handleCloseButtonClick}
96
+ onFocus={handleFocusWithin}
97
+ tabIndex={-1}
98
+ type="button"
99
+ >
100
+ <svg
101
+ className="webchat__keyboard-help__close-button_image"
102
+ role="presentation"
103
+ viewBox="0 0 2048 2048"
104
+ xmlns="http://www.w3.org/2000/svg"
105
+ >
106
+ <path d="M2048 136l-888 888 888 888-136 136-888-888-888 888L0 1912l888-888L0 136 136 0l888 888L1912 0l136 136z" />
107
+ </svg>
108
+ </button>
109
+ <article className="webchat__keyboard-help__section">
110
+ <header>
111
+ <h3 className="webchat__keyboard-help__sub-header">{chatWindowHeader}</h3>
112
+ </header>
113
+ <div className="webchat__keyboard-help__two-panes">
114
+ <svg
115
+ className="webchat__keyboard-help__image webchat__keyboard-help__image--light"
116
+ fill="none"
117
+ height="200"
118
+ role="presentation"
119
+ viewBox="0 0 121 200"
120
+ width="121"
121
+ xmlns="http://www.w3.org/2000/svg"
122
+ >
123
+ <rect height="199" stroke="#C8C6C4" width="109" x="0.5" y="0.5" />
124
+ <rect height="156" stroke="#323130" width="102" x="3.5" y="4.5" />
125
+ <rect height="42" stroke="#C8C6C4" width="93" x="7.5" y="8.5" />
126
+ <rect height="99" stroke="#C8C6C4" width="93" x="7.5" y="55.5" />
127
+ <rect height="13" stroke="#323130" width="102" x="3.5" y="182.5" />
128
+ <rect height="13" stroke="#323130" width="32" x="3.5" y="165.5" />
129
+ <rect height="13" stroke="#323130" width="32" x="38.5" y="165.5" />
130
+ <rect height="13" stroke="#323130" width="32" x="73.5" y="165.5" />
131
+ <path
132
+ clipRule="evenodd"
133
+ d="M116.328 5.64645C116.524 5.45118 116.84 5.45118 117.036 5.64645L120.218 8.82843C120.413 9.02369 120.413 9.34027 120.218 9.53553C120.022 9.7308 119.706 9.7308 119.51 9.53553L117.182 7.20711V192.793L119.51 190.464C119.706 190.269 120.022 190.269 120.218 190.464C120.413 190.66 120.413 190.976 120.218 191.172L117.036 194.354C116.84 194.549 116.524 194.549 116.328 194.354L113.146 191.172C112.951 190.976 112.951 190.66 113.146 190.464C113.342 190.269 113.658 190.269 113.854 190.464L116.182 192.793V7.20711L113.854 9.53553C113.658 9.7308 113.342 9.7308 113.146 9.53553C112.951 9.34027 112.951 9.02369 113.146 8.82843L116.328 5.64645Z"
134
+ fill="#323130"
135
+ fillRule="evenodd"
136
+ />
137
+ </svg>
138
+ <svg
139
+ className="webchat__keyboard-help__image webchat__keyboard-help__image--dark"
140
+ fill="none"
141
+ height="200"
142
+ role="presentation"
143
+ viewBox="0 0 121 200"
144
+ width="121"
145
+ xmlns="http://www.w3.org/2000/svg"
146
+ >
147
+ <rect height="199" stroke="#484644" width="109" x="0.5" y="0.5" />
148
+ <rect height="156" stroke="#F3F2F1" width="102" x="3.5" y="4.5" />
149
+ <rect height="42" stroke="#484644" width="93" x="7.5" y="8.5" />
150
+ <rect height="99" stroke="#484644" width="93" x="7.5" y="55.5" />
151
+ <rect height="13" stroke="#F3F2F1" width="102" x="3.5" y="182.5" />
152
+ <rect height="13" stroke="#F3F2F1" width="32" x="3.5" y="165.5" />
153
+ <rect height="13" stroke="#F3F2F1" width="32" x="38.5" y="165.5" />
154
+ <rect height="13" stroke="#F3F2F1" width="32" x="73.5" y="165.5" />
155
+ <path
156
+ clipRule="evenodd"
157
+ d="M116.328 5.64645C116.524 5.45118 116.84 5.45118 117.036 5.64645L120.218 8.82843C120.413 9.02369 120.413 9.34027 120.218 9.53553C120.022 9.7308 119.706 9.7308 119.51 9.53553L117.182 7.20711V192.793L119.51 190.464C119.706 190.269 120.022 190.269 120.218 190.464C120.413 190.66 120.413 190.976 120.218 191.172L117.036 194.354C116.84 194.549 116.524 194.549 116.328 194.354L113.146 191.172C112.951 190.976 112.951 190.66 113.146 190.464C113.342 190.269 113.658 190.269 113.854 190.464L116.182 192.793V7.20711L113.854 9.53553C113.658 9.7308 113.342 9.7308 113.146 9.53553C112.951 9.34027 112.951 9.02369 113.146 8.82843L116.328 5.64645Z"
158
+ fill="#F3F2F1"
159
+ fillRule="evenodd"
160
+ />
161
+ </svg>
162
+ <svg
163
+ className="webchat__keyboard-help__image webchat__keyboard-help__image--high-contrast"
164
+ fill="none"
165
+ height="200"
166
+ role="presentation"
167
+ viewBox="0 0 121 200"
168
+ width="121"
169
+ xmlns="http://www.w3.org/2000/svg"
170
+ >
171
+ <rect height="199" stroke="white" width="109" x="0.5" y="0.5" />
172
+ <rect height="156" stroke="white" width="102" x="3.5" y="4.5" />
173
+ <rect height="42" stroke="white" width="93" x="7.5" y="8.5" />
174
+ <rect height="99" stroke="white" width="93" x="7.5" y="55.5" />
175
+ <rect height="13" stroke="white" width="102" x="3.5" y="182.5" />
176
+ <rect height="13" stroke="white" width="32" x="3.5" y="165.5" />
177
+ <rect height="13" stroke="white" width="32" x="38.5" y="165.5" />
178
+ <rect height="13" stroke="white" width="32" x="73.5" y="165.5" />
179
+ <path
180
+ clipRule="evenodd"
181
+ d="M116.328 5.64645C116.524 5.45118 116.84 5.45118 117.036 5.64645L120.218 8.82843C120.413 9.02369 120.413 9.34027 120.218 9.53553C120.022 9.7308 119.706 9.7308 119.51 9.53553L117.182 7.20711V192.793L119.51 190.464C119.706 190.269 120.022 190.269 120.218 190.464C120.413 190.66 120.413 190.976 120.218 191.172L117.036 194.354C116.84 194.549 116.524 194.549 116.328 194.354L113.146 191.172C112.951 190.976 112.951 190.66 113.146 190.464C113.342 190.269 113.658 190.269 113.854 190.464L116.182 192.793V7.20711L113.854 9.53553C113.658 9.7308 113.342 9.7308 113.146 9.53553C112.951 9.34027 112.951 9.02369 113.146 8.82843L116.328 5.64645Z"
182
+ fill="white"
183
+ fillRule="evenodd"
184
+ />
185
+ </svg>
186
+ <div className="webchat__keyboard-help__notes-pane">
187
+ <Notes header={chatWindowBodyMoveBetweenItemsHeader} text={chatWindowBodyMoveBetweenItemsBody} />
188
+ <Notes header={chatWindowBodyDoActionHeader} text={chatWindowBodyDoActionBody} />
189
+ </div>
190
+ </div>
191
+ </article>
192
+ <article className="webchat__keyboard-help__section">
193
+ <header>
194
+ <h3 className="webchat__keyboard-help__header">{chatHistoryHeader}</h3>
195
+ </header>
196
+ <div className="webchat__keyboard-help__two-panes">
197
+ <svg
198
+ className="webchat__keyboard-help__image webchat__keyboard-help__image--light"
199
+ fill="none"
200
+ height="200"
201
+ role="presentation"
202
+ viewBox="0 0 121 200"
203
+ width="121"
204
+ xmlns="http://www.w3.org/2000/svg"
205
+ >
206
+ <rect height="199" stroke="#C8C6C4" width="109" x="0.5" y="0.5" />
207
+ <rect height="156" stroke="#323130" width="102" x="3.5" y="4.5" />
208
+ <rect height="42" stroke="#323130" strokeDasharray="2 2" width="93" x="7.5" y="8.5" />
209
+ <rect height="99" stroke="#323130" strokeDasharray="2 2" width="93" x="7.5" y="55.5" />
210
+ <rect height="13" stroke="#C8C6C4" width="102" x="3.5" y="182.5" />
211
+ <rect height="13" stroke="#C8C6C4" width="32" x="3.5" y="165.5" />
212
+ <rect height="13" stroke="#C8C6C4" width="32" x="38.5" y="165.5" />
213
+ <rect height="13" stroke="#C8C6C4" width="32" x="73.5" y="165.5" />
214
+ <path
215
+ clipRule="evenodd"
216
+ d="M116.328 7.64645C116.524 7.45118 116.84 7.45118 117.036 7.64645L120.218 10.8284C120.413 11.0237 120.413 11.3403 120.218 11.5355C120.022 11.7308 119.706 11.7308 119.51 11.5355L117.182 9.20711V156.793L119.51 154.464C119.706 154.269 120.022 154.269 120.218 154.464C120.413 154.66 120.413 154.976 120.218 155.172L117.036 158.354C116.84 158.549 116.524 158.549 116.328 158.354L113.146 155.172C112.951 154.976 112.951 154.66 113.146 154.464C113.342 154.269 113.658 154.269 113.854 154.464L116.182 156.793V9.20711L113.854 11.5355C113.658 11.7308 113.342 11.7308 113.146 11.5355C112.951 11.3403 112.951 11.0237 113.146 10.8284L116.328 7.64645Z"
217
+ fill="#323130"
218
+ fillRule="evenodd"
219
+ />
220
+ </svg>
221
+ <svg
222
+ className="webchat__keyboard-help__image webchat__keyboard-help__image--dark"
223
+ fill="none"
224
+ height="200"
225
+ role="presentation"
226
+ viewBox="0 0 121 200"
227
+ width="121"
228
+ xmlns="http://www.w3.org/2000/svg"
229
+ >
230
+ <rect height="199" stroke="#484644" width="109" x="0.5" y="0.5" />
231
+ <rect height="156" stroke="#F3F2F1" width="102" x="3.5" y="4.5" />
232
+ <rect height="42" stroke="#F3F2F1" strokeDasharray="2 2" width="93" x="7.5" y="8.5" />
233
+ <rect height="99" stroke="#F3F2F1" strokeDasharray="2 2" width="93" x="7.5" y="55.5" />
234
+ <rect height="13" stroke="#484644" width="102" x="3.5" y="182.5" />
235
+ <rect height="13" stroke="#484644" width="32" x="3.5" y="165.5" />
236
+ <rect height="13" stroke="#484644" width="32" x="38.5" y="165.5" />
237
+ <rect height="13" stroke="#484644" width="32" x="73.5" y="165.5" />
238
+ <path
239
+ clipRule="evenodd"
240
+ d="M116.328 7.64645C116.524 7.45118 116.84 7.45118 117.036 7.64645L120.218 10.8284C120.413 11.0237 120.413 11.3403 120.218 11.5355C120.022 11.7308 119.706 11.7308 119.51 11.5355L117.182 9.20711V156.793L119.51 154.464C119.706 154.269 120.022 154.269 120.218 154.464C120.413 154.66 120.413 154.976 120.218 155.172L117.036 158.354C116.84 158.549 116.524 158.549 116.328 158.354L113.146 155.172C112.951 154.976 112.951 154.66 113.146 154.464C113.342 154.269 113.658 154.269 113.854 154.464L116.182 156.793V9.20711L113.854 11.5355C113.658 11.7308 113.342 11.7308 113.146 11.5355C112.951 11.3403 112.951 11.0237 113.146 10.8284L116.328 7.64645Z"
241
+ fill="#F3F2F1"
242
+ fillRule="evenodd"
243
+ />
244
+ </svg>
245
+ <svg
246
+ className="webchat__keyboard-help__image webchat__keyboard-help__image--high-contrast"
247
+ fill="none"
248
+ height="200"
249
+ role="presentation"
250
+ viewBox="0 0 121 200"
251
+ width="121"
252
+ xmlns="http://www.w3.org/2000/svg"
253
+ >
254
+ <rect height="199" stroke="white" width="109" x="0.5" y="0.5" />
255
+ <rect height="156" stroke="white" width="102" x="3.5" y="4.5" />
256
+ <rect height="42" stroke="white" strokeDasharray="2 2" width="93" x="7.5" y="8.5" />
257
+ <rect height="99" stroke="white" strokeDasharray="2 2" width="93" x="7.5" y="55.5" />
258
+ <rect height="13" stroke="white" width="102" x="3.5" y="182.5" />
259
+ <rect height="13" stroke="white" width="32" x="3.5" y="165.5" />
260
+ <rect height="13" stroke="white" width="32" x="38.5" y="165.5" />
261
+ <rect height="13" stroke="white" width="32" x="73.5" y="165.5" />
262
+ <path
263
+ clipRule="evenodd"
264
+ d="M116.328 7.64645C116.524 7.45118 116.84 7.45118 117.036 7.64645L120.218 10.8284C120.413 11.0237 120.413 11.3403 120.218 11.5355C120.022 11.7308 119.706 11.7308 119.51 11.5355L117.182 9.20711V156.793L119.51 154.464C119.706 154.269 120.022 154.269 120.218 154.464C120.413 154.66 120.413 154.976 120.218 155.172L117.036 158.354C116.84 158.549 116.524 158.549 116.328 158.354L113.146 155.172C112.951 154.976 112.951 154.66 113.146 154.464C113.342 154.269 113.658 154.269 113.854 154.464L116.182 156.793V9.20711L113.854 11.5355C113.658 11.7308 113.342 11.7308 113.146 11.5355C112.951 11.3403 112.951 11.0237 113.146 10.8284L116.328 7.64645Z"
265
+ fill="white"
266
+ fillRule="evenodd"
267
+ />
268
+ </svg>
269
+ <div className="webchat__keyboard-help__notes-pane">
270
+ <Notes header={chatHistoryMoveBetweenMessagesHeader} text={chatHistoryMoveBetweenMessagesBody} />
271
+ <Notes header={chatHistoryAccessItemsInMessageHeader} text={chatHistoryAccessItemsInMessageBody} />
272
+ <Notes header={chatHistoryMoveBetweenItemsHeader} text={chatHistoryMoveBetweenItemsBody} />
273
+ <Notes header={chatHistoryLeaveMessageHeader} text={chatHistoryLeaveMessageBody} />
274
+ </div>
275
+ </div>
276
+ </article>
277
+ </div>
278
+ </div>
279
+ );
280
+ };
281
+
282
+ export default KeyboardHelp;