botframework-webchat-api 4.17.1 → 4.18.1-hotfix.20260127.b53acdf

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 (708) hide show
  1. package/decorator.js +3 -0
  2. package/dist/botframework-webchat-api.d.mts +213 -55
  3. package/dist/botframework-webchat-api.d.ts +1612 -0
  4. package/dist/botframework-webchat-api.decorator.d.mts +30 -0
  5. package/dist/botframework-webchat-api.decorator.d.ts +30 -0
  6. package/dist/botframework-webchat-api.decorator.js +3 -0
  7. package/dist/botframework-webchat-api.decorator.js.map +1 -0
  8. package/dist/botframework-webchat-api.decorator.mjs +3 -0
  9. package/dist/botframework-webchat-api.decorator.mjs.LEGAL.txt +0 -0
  10. package/dist/botframework-webchat-api.decorator.mjs.map +1 -0
  11. package/dist/botframework-webchat-api.internal.d.mts +18 -1
  12. package/dist/botframework-webchat-api.internal.d.ts +20 -0
  13. package/dist/botframework-webchat-api.internal.js +3 -0
  14. package/dist/botframework-webchat-api.internal.js.LEGAL.txt +0 -0
  15. package/dist/botframework-webchat-api.internal.js.map +1 -0
  16. package/dist/botframework-webchat-api.internal.mjs +1 -1
  17. package/dist/botframework-webchat-api.internal.mjs.map +1 -1
  18. package/dist/botframework-webchat-api.js +3 -0
  19. package/dist/botframework-webchat-api.js.LEGAL.txt +0 -0
  20. package/dist/botframework-webchat-api.js.map +1 -0
  21. package/dist/botframework-webchat-api.mjs +1 -1
  22. package/dist/botframework-webchat-api.mjs.map +1 -1
  23. package/dist/chunk-2HABAU7C.mjs +3 -0
  24. package/dist/chunk-2HABAU7C.mjs.LEGAL.txt +0 -0
  25. package/dist/chunk-2HABAU7C.mjs.map +1 -0
  26. package/dist/chunk-45Z2ZE4M.js +3 -0
  27. package/dist/chunk-45Z2ZE4M.js.LEGAL.txt +0 -0
  28. package/dist/chunk-45Z2ZE4M.js.map +1 -0
  29. package/dist/chunk-7K3OK5TS.mjs +3 -0
  30. package/dist/chunk-7K3OK5TS.mjs.LEGAL.txt +0 -0
  31. package/dist/chunk-7K3OK5TS.mjs.map +1 -0
  32. package/dist/chunk-LXPINC7N.js +3 -0
  33. package/dist/chunk-LXPINC7N.js.LEGAL.txt +0 -0
  34. package/dist/chunk-LXPINC7N.js.map +1 -0
  35. package/dist/chunk-PRWGXTDA.mjs +3 -0
  36. package/dist/chunk-PRWGXTDA.mjs.LEGAL.txt +0 -0
  37. package/dist/chunk-PRWGXTDA.mjs.map +1 -0
  38. package/dist/chunk-WH7VSYKK.js +3 -0
  39. package/dist/chunk-WH7VSYKK.js.LEGAL.txt +0 -0
  40. package/dist/chunk-WH7VSYKK.js.map +1 -0
  41. package/dist/metafile-cjs.json +1 -0
  42. package/dist/metafile-esm.json +1 -1
  43. package/dist/types-BXPldIKA.d.mts +86 -0
  44. package/dist/types-BXPldIKA.d.ts +86 -0
  45. package/internal.js +1 -1
  46. package/package.json +68 -70
  47. package/src/StyleOptions.ts +123 -4
  48. package/src/decorator/ActivityBorder/ActivityBorderDecorator.tsx +48 -0
  49. package/src/decorator/ActivityBorder/private/ActivityBorderDecoratorMiddleware.ts +51 -0
  50. package/src/decorator/ActivityBorder/types.ts +1 -0
  51. package/src/decorator/ActivityGrouping/ActivityGroupingDecorator.tsx +31 -0
  52. package/src/decorator/ActivityGrouping/private/ActivityGroupingDecoratorMiddleware.ts +38 -0
  53. package/src/decorator/ActivityGrouping/types.ts +1 -0
  54. package/src/decorator/DecoratorComposer.tsx +22 -0
  55. package/src/decorator/internal/InternalDecoratorComposer.tsx +61 -0
  56. package/src/decorator/internal/LowPriorityDecoratorComposer.tsx +19 -0
  57. package/src/decorator/private/DecoratorComposerContext.ts +16 -0
  58. package/src/decorator/private/PassthroughFallback.tsx +12 -0
  59. package/src/decorator/private/templateMiddleware.test.tsx +100 -0
  60. package/src/decorator/private/templateMiddleware.ts +60 -0
  61. package/src/decorator/types.ts +15 -0
  62. package/src/decorator.ts +16 -0
  63. package/src/defaultStyleOptions.ts +26 -5
  64. package/{lib/external/PrecompiledGlobalize.cjs → src/external/PrecompiledGlobalize.js} +8 -7
  65. package/src/hooks/Composer.tsx +75 -53
  66. package/src/hooks/index.ts +7 -1
  67. package/src/hooks/internal/SendBoxMiddleware.ts +5 -3
  68. package/src/hooks/internal/SendBoxToolbarMiddleware.ts +5 -3
  69. package/src/hooks/internal/Tracker.ts +1 -1
  70. package/src/hooks/internal/WebChatAPIContext.ts +12 -5
  71. package/src/hooks/internal/private/templateMiddleware.ts +3 -43
  72. package/src/hooks/internal/usePrevious.ts +5 -2
  73. package/src/hooks/middleware/concatMiddleware.spec.js +20 -0
  74. package/src/hooks/middleware/concatMiddleware.ts +6 -5
  75. package/src/hooks/private/numberWithInfinity.spec.ts +9 -0
  76. package/src/hooks/private/numberWithInfinity.ts +15 -0
  77. package/src/hooks/private/reduceIterable.spec.ts +29 -0
  78. package/src/hooks/private/reduceIterable.ts +13 -0
  79. package/src/hooks/useActiveTyping.ts +31 -28
  80. package/src/hooks/useDisabled.ts +8 -2
  81. package/src/hooks/useGetActivitiesByKey.ts +3 -0
  82. package/src/hooks/useSuggestedActions.ts +17 -4
  83. package/src/hooks/useUIState.ts +18 -0
  84. package/src/hooks/validation/uiState.parseUIState.spec.ts +21 -0
  85. package/src/hooks/validation/uiState.ts +10 -0
  86. package/src/index.ts +4 -4
  87. package/src/internal.ts +3 -1
  88. package/src/localization/ar-SA.json +19 -0
  89. package/src/localization/bg-BG.json +19 -0
  90. package/src/localization/ca-ES.json +19 -0
  91. package/src/localization/cs-CZ.json +19 -0
  92. package/src/localization/da-DK.json +19 -0
  93. package/src/localization/de-DE.json +19 -0
  94. package/src/localization/el-GR.json +19 -0
  95. package/src/localization/en-US.json +20 -2
  96. package/src/localization/es-ES.json +19 -0
  97. package/src/localization/et-EE.json +19 -0
  98. package/src/localization/eu-ES.json +19 -0
  99. package/src/localization/fi-FI.json +19 -0
  100. package/src/localization/fr-FR.json +19 -0
  101. package/src/localization/gl-ES.json +19 -0
  102. package/src/localization/he-IL.json +20 -1
  103. package/src/localization/hi-IN.json +19 -0
  104. package/src/localization/hr-HR.json +19 -0
  105. package/src/localization/hu-HU.json +19 -0
  106. package/src/localization/id-ID.json +19 -0
  107. package/src/localization/it-IT.json +19 -0
  108. package/src/localization/ja-JP.json +19 -0
  109. package/src/localization/kk-KZ.json +19 -0
  110. package/src/localization/ko-KR.json +19 -0
  111. package/src/localization/lt-LT.json +19 -0
  112. package/src/localization/lv-LV.json +19 -0
  113. package/src/localization/ms-MY.json +19 -0
  114. package/src/localization/nb-NO.json +19 -0
  115. package/src/localization/nl-NL.json +19 -0
  116. package/src/localization/pl-PL.json +19 -0
  117. package/src/localization/pt-BR.json +19 -0
  118. package/src/localization/pt-PT.json +19 -0
  119. package/src/localization/ro-RO.json +19 -0
  120. package/src/localization/ru-RU.json +19 -0
  121. package/src/localization/sk-SK.json +19 -0
  122. package/src/localization/sl-SI.json +19 -0
  123. package/src/localization/sr-Cyrl-CS.json +19 -0
  124. package/src/localization/sr-Latn-CS.json +19 -0
  125. package/src/localization/sv-SE.json +19 -0
  126. package/src/localization/th-TH.json +19 -0
  127. package/src/localization/tr-TR.json +19 -0
  128. package/src/localization/uk-UA.json +19 -0
  129. package/src/localization/vi-VN.json +19 -0
  130. package/src/localization/zh-CN.json +21 -2
  131. package/src/localization/zh-HK.json +19 -0
  132. package/src/localization/zh-TW.json +19 -0
  133. package/src/normalizeStyleOptions.ts +45 -0
  134. package/src/providers/ActivityAcknowledgement/useLastReadActivityKey.ts +1 -1
  135. package/src/providers/ActivityKeyer/ActivityKeyerComposer.tsx +50 -30
  136. package/src/providers/ActivityKeyer/private/Context.ts +2 -1
  137. package/src/providers/ActivityKeyer/private/lastOf.spec.ts +6 -0
  138. package/src/providers/ActivityKeyer/private/lastOf.ts +3 -0
  139. package/src/providers/ActivityKeyer/private/someIterable.spec.ts +44 -0
  140. package/src/providers/ActivityKeyer/private/someIterable.ts +9 -0
  141. package/src/providers/ActivityKeyer/useGetActivitiesByKey.ts +7 -0
  142. package/src/providers/ActivityListener/ActivityListenerComposer.tsx +28 -0
  143. package/src/providers/ActivityListener/private/Context.tsx +16 -0
  144. package/src/providers/ActivityListener/private/useContext.ts +6 -0
  145. package/src/providers/ActivityListener/useUpsertedActivities.ts +6 -0
  146. package/src/providers/ActivitySendStatus/ActivitySendStatusComposer.tsx +2 -2
  147. package/src/providers/ActivityTyping/ActivityTypingComposer.tsx +170 -0
  148. package/src/providers/ActivityTyping/private/Context.ts +16 -0
  149. package/src/providers/ActivityTyping/private/useContext.ts +6 -0
  150. package/src/providers/ActivityTyping/private/useMemoWithPrevious.ts +17 -0
  151. package/src/providers/ActivityTyping/private/useReduceActivities.spec.tsx +231 -0
  152. package/src/providers/ActivityTyping/private/useReduceActivities.ts +48 -0
  153. package/src/providers/ActivityTyping/types/AllTyping.ts +8 -0
  154. package/src/providers/ActivityTyping/useAllTyping.ts +6 -0
  155. package/src/providers/GroupActivities/GroupActivitiesComposer.tsx +115 -0
  156. package/src/providers/GroupActivities/private/GroupActivitiesContext.ts +23 -0
  157. package/src/providers/GroupActivities/private/createDefaultGroupActivitiesMiddleware.ts +93 -0
  158. package/src/providers/GroupActivities/private/isGroupingValid.ts +41 -0
  159. package/src/providers/GroupActivities/private/useGroupActivitiesContext.ts +6 -0
  160. package/src/providers/GroupActivities/useGroupActivities.ts +20 -0
  161. package/src/providers/GroupActivities/useGroupActivitiesByName.ts +17 -0
  162. package/src/tsconfig.json +1 -5
  163. package/src/types/AttachmentForScreenReaderMiddleware.ts +9 -2
  164. package/src/types/AvatarMiddleware.ts +5 -1
  165. package/src/types/CardActionMiddleware.ts +2 -0
  166. package/src/types/ComponentMiddleware.ts +1 -1
  167. package/src/types/GroupActivitiesMiddleware.ts +7 -11
  168. package/src/types/Typing.ts +2 -3
  169. package/src/utils/validateProps.spec.ts +74 -0
  170. package/src/utils/validateProps.ts +56 -0
  171. package/dist/chunk-4ZIUY4G5.mjs +0 -3
  172. package/dist/chunk-4ZIUY4G5.mjs.map +0 -1
  173. package/lib/StyleOptions.d.ts +0 -697
  174. package/lib/StyleOptions.d.ts.map +0 -1
  175. package/lib/StyleOptions.js +0 -2
  176. package/lib/defaultStyleOptions.d.ts +0 -4
  177. package/lib/defaultStyleOptions.d.ts.map +0 -1
  178. package/lib/defaultStyleOptions.js +0 -277
  179. package/lib/hooks/Composer.d.ts +0 -88
  180. package/lib/hooks/Composer.d.ts.map +0 -1
  181. package/lib/hooks/Composer.js +0 -602
  182. package/lib/hooks/index.d.ts +0 -72
  183. package/lib/hooks/index.d.ts.map +0 -1
  184. package/lib/hooks/index.js +0 -497
  185. package/lib/hooks/internal/ErrorBox.js +0 -47
  186. package/lib/hooks/internal/SendBoxMiddleware.d.ts +0 -34
  187. package/lib/hooks/internal/SendBoxMiddleware.d.ts.map +0 -1
  188. package/lib/hooks/internal/SendBoxMiddleware.js +0 -17
  189. package/lib/hooks/internal/SendBoxToolbarMiddleware.d.ts +0 -34
  190. package/lib/hooks/internal/SendBoxToolbarMiddleware.d.ts.map +0 -1
  191. package/lib/hooks/internal/SendBoxToolbarMiddleware.js +0 -17
  192. package/lib/hooks/internal/Tracker.d.ts +0 -4
  193. package/lib/hooks/internal/Tracker.d.ts.map +0 -1
  194. package/lib/hooks/internal/Tracker.js +0 -15
  195. package/lib/hooks/internal/WebChatAPIContext.d.ts +0 -80
  196. package/lib/hooks/internal/WebChatAPIContext.d.ts.map +0 -1
  197. package/lib/hooks/internal/WebChatAPIContext.js +0 -12
  198. package/lib/hooks/internal/WebChatReduxContext.js +0 -17
  199. package/lib/hooks/internal/defaultSelectVoice.js +0 -28
  200. package/lib/hooks/internal/private/templateMiddleware.d.ts +0 -28
  201. package/lib/hooks/internal/private/templateMiddleware.d.ts.map +0 -1
  202. package/lib/hooks/internal/private/templateMiddleware.js +0 -48
  203. package/lib/hooks/internal/useCreateActivityRendererInternal.d.ts +0 -4
  204. package/lib/hooks/internal/useCreateActivityRendererInternal.d.ts.map +0 -1
  205. package/lib/hooks/internal/useCreateActivityRendererInternal.js +0 -37
  206. package/lib/hooks/internal/useDebugDeps.js +0 -39
  207. package/lib/hooks/internal/useDirFromProps.js +0 -12
  208. package/lib/hooks/internal/useErrorBoxClass.js +0 -14
  209. package/lib/hooks/internal/useForceRender.js +0 -24
  210. package/lib/hooks/internal/useLocalizedGlobalize.js +0 -12
  211. package/lib/hooks/internal/useLocalizedStrings.js +0 -14
  212. package/lib/hooks/internal/useMarkActivity.js +0 -12
  213. package/lib/hooks/internal/usePrevious.d.ts +0 -2
  214. package/lib/hooks/internal/usePrevious.d.ts.map +0 -1
  215. package/lib/hooks/internal/usePrevious.js +0 -15
  216. package/lib/hooks/internal/useReadTelemetryDimensions.js +0 -20
  217. package/lib/hooks/internal/useSetDictateState.d.ts +0 -2
  218. package/lib/hooks/internal/useSetDictateState.d.ts.map +0 -1
  219. package/lib/hooks/internal/useSetDictateState.js +0 -12
  220. package/lib/hooks/internal/useTimer.d.ts +0 -5
  221. package/lib/hooks/internal/useTimer.d.ts.map +0 -1
  222. package/lib/hooks/internal/useTimer.js +0 -43
  223. package/lib/hooks/internal/useTracker.js +0 -42
  224. package/lib/hooks/internal/useValueRef.d.ts +0 -3
  225. package/lib/hooks/internal/useValueRef.d.ts.map +0 -1
  226. package/lib/hooks/internal/useValueRef.js +0 -22
  227. package/lib/hooks/internal/useWebChatAPIContext.d.ts +0 -83
  228. package/lib/hooks/internal/useWebChatAPIContext.d.ts.map +0 -1
  229. package/lib/hooks/internal/useWebChatAPIContext.js +0 -17
  230. package/lib/hooks/middleware/UserlandBoundary.js +0 -48
  231. package/lib/hooks/middleware/applyMiddleware.js +0 -122
  232. package/lib/hooks/middleware/concatMiddleware.d.ts +0 -6
  233. package/lib/hooks/middleware/concatMiddleware.d.ts.map +0 -1
  234. package/lib/hooks/middleware/concatMiddleware.js +0 -33
  235. package/lib/hooks/middleware/createDefaultCardActionMiddleware.d.ts +0 -3
  236. package/lib/hooks/middleware/createDefaultCardActionMiddleware.d.ts.map +0 -1
  237. package/lib/hooks/middleware/createDefaultCardActionMiddleware.js +0 -43
  238. package/lib/hooks/middleware/createDefaultGroupActivitiesMiddleware.d.ts +0 -7
  239. package/lib/hooks/middleware/createDefaultGroupActivitiesMiddleware.d.ts.map +0 -1
  240. package/lib/hooks/middleware/createDefaultGroupActivitiesMiddleware.js +0 -68
  241. package/lib/hooks/useActiveTyping.d.ts +0 -6
  242. package/lib/hooks/useActiveTyping.d.ts.map +0 -1
  243. package/lib/hooks/useActiveTyping.js +0 -81
  244. package/lib/hooks/useActivities.d.ts +0 -3
  245. package/lib/hooks/useActivities.d.ts.map +0 -1
  246. package/lib/hooks/useActivities.js +0 -14
  247. package/lib/hooks/useActivityKeys.d.ts +0 -3
  248. package/lib/hooks/useActivityKeys.d.ts.map +0 -1
  249. package/lib/hooks/useActivityKeys.js +0 -11
  250. package/lib/hooks/useActivityKeysByRead.d.ts +0 -3
  251. package/lib/hooks/useActivityKeysByRead.d.ts.map +0 -1
  252. package/lib/hooks/useActivityKeysByRead.js +0 -11
  253. package/lib/hooks/useAvatarForBot.d.ts +0 -5
  254. package/lib/hooks/useAvatarForBot.d.ts.map +0 -1
  255. package/lib/hooks/useAvatarForBot.js +0 -26
  256. package/lib/hooks/useAvatarForUser.d.ts +0 -5
  257. package/lib/hooks/useAvatarForUser.d.ts.map +0 -1
  258. package/lib/hooks/useAvatarForUser.js +0 -26
  259. package/lib/hooks/useByteFormatter.d.ts +0 -2
  260. package/lib/hooks/useByteFormatter.d.ts.map +0 -1
  261. package/lib/hooks/useByteFormatter.js +0 -43
  262. package/lib/hooks/useConnectivityStatus.d.ts +0 -2
  263. package/lib/hooks/useConnectivityStatus.d.ts.map +0 -1
  264. package/lib/hooks/useConnectivityStatus.js +0 -14
  265. package/lib/hooks/useCreateActivityRenderer.d.ts +0 -3
  266. package/lib/hooks/useCreateActivityRenderer.d.ts.map +0 -1
  267. package/lib/hooks/useCreateActivityRenderer.js +0 -14
  268. package/lib/hooks/useCreateActivityStatusRenderer.d.ts +0 -10
  269. package/lib/hooks/useCreateActivityStatusRenderer.d.ts.map +0 -1
  270. package/lib/hooks/useCreateActivityStatusRenderer.js +0 -72
  271. package/lib/hooks/useCreateAttachmentForScreenReaderRenderer.d.ts +0 -3
  272. package/lib/hooks/useCreateAttachmentForScreenReaderRenderer.d.ts.map +0 -1
  273. package/lib/hooks/useCreateAttachmentForScreenReaderRenderer.js +0 -12
  274. package/lib/hooks/useCreateAvatarRenderer.d.ts +0 -6
  275. package/lib/hooks/useCreateAvatarRenderer.d.ts.map +0 -1
  276. package/lib/hooks/useCreateAvatarRenderer.js +0 -44
  277. package/lib/hooks/useCreateScrollToEndButtonRenderer.d.ts +0 -3
  278. package/lib/hooks/useCreateScrollToEndButtonRenderer.d.ts.map +0 -1
  279. package/lib/hooks/useCreateScrollToEndButtonRenderer.js +0 -12
  280. package/lib/hooks/useDateFormatter.d.ts +0 -2
  281. package/lib/hooks/useDateFormatter.d.ts.map +0 -1
  282. package/lib/hooks/useDateFormatter.js +0 -35
  283. package/lib/hooks/useDebouncedNotifications.d.ts +0 -13
  284. package/lib/hooks/useDebouncedNotifications.d.ts.map +0 -1
  285. package/lib/hooks/useDebouncedNotifications.js +0 -118
  286. package/lib/hooks/useDictateInterims.d.ts +0 -2
  287. package/lib/hooks/useDictateInterims.d.ts.map +0 -1
  288. package/lib/hooks/useDictateInterims.js +0 -16
  289. package/lib/hooks/useDictateState.d.ts +0 -2
  290. package/lib/hooks/useDictateState.d.ts.map +0 -1
  291. package/lib/hooks/useDictateState.js +0 -15
  292. package/lib/hooks/useDirection.d.ts +0 -2
  293. package/lib/hooks/useDirection.d.ts.map +0 -1
  294. package/lib/hooks/useDirection.js +0 -38
  295. package/lib/hooks/useDisabled.d.ts +0 -2
  296. package/lib/hooks/useDisabled.d.ts.map +0 -1
  297. package/lib/hooks/useDisabled.js +0 -12
  298. package/lib/hooks/useDismissNotification.d.ts +0 -2
  299. package/lib/hooks/useDismissNotification.d.ts.map +0 -1
  300. package/lib/hooks/useDismissNotification.js +0 -12
  301. package/lib/hooks/useEmitTypingIndicator.d.ts +0 -2
  302. package/lib/hooks/useEmitTypingIndicator.d.ts.map +0 -1
  303. package/lib/hooks/useEmitTypingIndicator.js +0 -12
  304. package/lib/hooks/useGetActivityByKey.d.ts +0 -3
  305. package/lib/hooks/useGetActivityByKey.d.ts.map +0 -1
  306. package/lib/hooks/useGetActivityByKey.js +0 -11
  307. package/lib/hooks/useGetHasAcknowledgedByActivityKey.d.ts +0 -3
  308. package/lib/hooks/useGetHasAcknowledgedByActivityKey.d.ts.map +0 -1
  309. package/lib/hooks/useGetHasAcknowledgedByActivityKey.js +0 -11
  310. package/lib/hooks/useGetKeyByActivity.d.ts +0 -3
  311. package/lib/hooks/useGetKeyByActivity.d.ts.map +0 -1
  312. package/lib/hooks/useGetKeyByActivity.js +0 -11
  313. package/lib/hooks/useGetKeyByActivityId.d.ts +0 -3
  314. package/lib/hooks/useGetKeyByActivityId.d.ts.map +0 -1
  315. package/lib/hooks/useGetKeyByActivityId.js +0 -11
  316. package/lib/hooks/useGetSendTimeoutForActivity.d.ts +0 -5
  317. package/lib/hooks/useGetSendTimeoutForActivity.d.ts.map +0 -1
  318. package/lib/hooks/useGetSendTimeoutForActivity.js +0 -33
  319. package/lib/hooks/useGrammars.d.ts +0 -2
  320. package/lib/hooks/useGrammars.d.ts.map +0 -1
  321. package/lib/hooks/useGrammars.js +0 -12
  322. package/lib/hooks/useGroupActivities.d.ts +0 -8
  323. package/lib/hooks/useGroupActivities.d.ts.map +0 -1
  324. package/lib/hooks/useGroupActivities.js +0 -12
  325. package/lib/hooks/useGroupTimestamp.d.ts +0 -2
  326. package/lib/hooks/useGroupTimestamp.d.ts.map +0 -1
  327. package/lib/hooks/useGroupTimestamp.js +0 -21
  328. package/lib/hooks/useLanguage.d.ts +0 -2
  329. package/lib/hooks/useLanguage.d.ts.map +0 -1
  330. package/lib/hooks/useLanguage.js +0 -19
  331. package/lib/hooks/useLastAcknowledgedActivityKey.d.ts +0 -3
  332. package/lib/hooks/useLastAcknowledgedActivityKey.d.ts.map +0 -1
  333. package/lib/hooks/useLastAcknowledgedActivityKey.js +0 -11
  334. package/lib/hooks/useLastReadActivityKey.d.ts +0 -3
  335. package/lib/hooks/useLastReadActivityKey.d.ts.map +0 -1
  336. package/lib/hooks/useLastReadActivityKey.js +0 -11
  337. package/lib/hooks/useLocalizer.d.ts +0 -13
  338. package/lib/hooks/useLocalizer.d.ts.map +0 -1
  339. package/lib/hooks/useLocalizer.js +0 -75
  340. package/lib/hooks/useMarkActivityAsSpoken.d.ts +0 -3
  341. package/lib/hooks/useMarkActivityAsSpoken.d.ts.map +0 -1
  342. package/lib/hooks/useMarkActivityAsSpoken.js +0 -16
  343. package/lib/hooks/useMarkActivityKeyAsRead.d.ts +0 -3
  344. package/lib/hooks/useMarkActivityKeyAsRead.d.ts.map +0 -1
  345. package/lib/hooks/useMarkActivityKeyAsRead.js +0 -11
  346. package/lib/hooks/useMarkAllAsAcknowledged.d.ts +0 -3
  347. package/lib/hooks/useMarkAllAsAcknowledged.d.ts.map +0 -1
  348. package/lib/hooks/useMarkAllAsAcknowledged.js +0 -11
  349. package/lib/hooks/useNotifications.d.ts +0 -3
  350. package/lib/hooks/useNotifications.d.ts.map +0 -1
  351. package/lib/hooks/useNotifications.js +0 -14
  352. package/lib/hooks/usePerformCardAction.d.ts +0 -3
  353. package/lib/hooks/usePerformCardAction.d.ts.map +0 -1
  354. package/lib/hooks/usePerformCardAction.js +0 -12
  355. package/lib/hooks/usePonyfill.d.ts +0 -3
  356. package/lib/hooks/usePonyfill.d.ts.map +0 -1
  357. package/lib/hooks/usePonyfill.js +0 -11
  358. package/lib/hooks/usePostActivity.d.ts +0 -3
  359. package/lib/hooks/usePostActivity.d.ts.map +0 -1
  360. package/lib/hooks/usePostActivity.js +0 -12
  361. package/lib/hooks/useReferenceGrammarID.d.ts +0 -2
  362. package/lib/hooks/useReferenceGrammarID.d.ts.map +0 -1
  363. package/lib/hooks/useReferenceGrammarID.js +0 -14
  364. package/lib/hooks/useRelativeTimeFormatter.d.ts +0 -2
  365. package/lib/hooks/useRelativeTimeFormatter.d.ts.map +0 -1
  366. package/lib/hooks/useRelativeTimeFormatter.js +0 -61
  367. package/lib/hooks/useRenderAttachment.d.ts +0 -3
  368. package/lib/hooks/useRenderAttachment.d.ts.map +0 -1
  369. package/lib/hooks/useRenderAttachment.js +0 -14
  370. package/lib/hooks/useRenderToast.d.ts +0 -3
  371. package/lib/hooks/useRenderToast.d.ts.map +0 -1
  372. package/lib/hooks/useRenderToast.js +0 -12
  373. package/lib/hooks/useRenderTypingIndicator.d.ts +0 -3
  374. package/lib/hooks/useRenderTypingIndicator.d.ts.map +0 -1
  375. package/lib/hooks/useRenderTypingIndicator.js +0 -12
  376. package/lib/hooks/useSendBoxAttachments.d.ts +0 -6
  377. package/lib/hooks/useSendBoxAttachments.d.ts.map +0 -1
  378. package/lib/hooks/useSendBoxAttachments.js +0 -23
  379. package/lib/hooks/useSendBoxValue.d.ts +0 -2
  380. package/lib/hooks/useSendBoxValue.d.ts.map +0 -1
  381. package/lib/hooks/useSendBoxValue.js +0 -16
  382. package/lib/hooks/useSendEvent.d.ts +0 -2
  383. package/lib/hooks/useSendEvent.d.ts.map +0 -1
  384. package/lib/hooks/useSendEvent.js +0 -12
  385. package/lib/hooks/useSendFiles.d.ts +0 -10
  386. package/lib/hooks/useSendFiles.d.ts.map +0 -1
  387. package/lib/hooks/useSendFiles.js +0 -35
  388. package/lib/hooks/useSendMessage.d.ts +0 -6
  389. package/lib/hooks/useSendMessage.d.ts.map +0 -1
  390. package/lib/hooks/useSendMessage.js +0 -33
  391. package/lib/hooks/useSendMessageBack.d.ts +0 -2
  392. package/lib/hooks/useSendMessageBack.d.ts.map +0 -1
  393. package/lib/hooks/useSendMessageBack.js +0 -12
  394. package/lib/hooks/useSendPostBack.d.ts +0 -2
  395. package/lib/hooks/useSendPostBack.d.ts.map +0 -1
  396. package/lib/hooks/useSendPostBack.js +0 -12
  397. package/lib/hooks/useSendStatusByActivityKey.d.ts +0 -22
  398. package/lib/hooks/useSendStatusByActivityKey.d.ts.map +0 -1
  399. package/lib/hooks/useSendStatusByActivityKey.js +0 -31
  400. package/lib/hooks/useSendTimeoutForActivity.d.ts +0 -4
  401. package/lib/hooks/useSendTimeoutForActivity.d.ts.map +0 -1
  402. package/lib/hooks/useSendTimeoutForActivity.js +0 -22
  403. package/lib/hooks/useSendTypingIndicator.d.ts +0 -2
  404. package/lib/hooks/useSendTypingIndicator.d.ts.map +0 -1
  405. package/lib/hooks/useSendTypingIndicator.js +0 -14
  406. package/lib/hooks/useSetNotification.d.ts +0 -3
  407. package/lib/hooks/useSetNotification.d.ts.map +0 -1
  408. package/lib/hooks/useSetNotification.js +0 -12
  409. package/lib/hooks/useShouldSpeakIncomingActivity.d.ts +0 -2
  410. package/lib/hooks/useShouldSpeakIncomingActivity.d.ts.map +0 -1
  411. package/lib/hooks/useShouldSpeakIncomingActivity.js +0 -22
  412. package/lib/hooks/useStartDictate.d.ts +0 -2
  413. package/lib/hooks/useStartDictate.d.ts.map +0 -1
  414. package/lib/hooks/useStartDictate.js +0 -12
  415. package/lib/hooks/useStopDictate.d.ts +0 -2
  416. package/lib/hooks/useStopDictate.d.ts.map +0 -1
  417. package/lib/hooks/useStopDictate.js +0 -12
  418. package/lib/hooks/useStyleOptions.d.ts +0 -3
  419. package/lib/hooks/useStyleOptions.d.ts.map +0 -1
  420. package/lib/hooks/useStyleOptions.js +0 -12
  421. package/lib/hooks/useSubmitSendBox.d.ts +0 -4
  422. package/lib/hooks/useSubmitSendBox.d.ts.map +0 -1
  423. package/lib/hooks/useSubmitSendBox.js +0 -49
  424. package/lib/hooks/useSuggestedActions.d.ts +0 -3
  425. package/lib/hooks/useSuggestedActions.d.ts.map +0 -1
  426. package/lib/hooks/useSuggestedActions.js +0 -25
  427. package/lib/hooks/useTimeoutForSend.d.ts +0 -3
  428. package/lib/hooks/useTimeoutForSend.d.ts.map +0 -1
  429. package/lib/hooks/useTimeoutForSend.js +0 -21
  430. package/lib/hooks/useTrackDimension.d.ts +0 -2
  431. package/lib/hooks/useTrackDimension.d.ts.map +0 -1
  432. package/lib/hooks/useTrackDimension.js +0 -14
  433. package/lib/hooks/useTrackEvent.d.ts +0 -10
  434. package/lib/hooks/useTrackEvent.d.ts.map +0 -1
  435. package/lib/hooks/useTrackEvent.js +0 -51
  436. package/lib/hooks/useTrackException.d.ts +0 -2
  437. package/lib/hooks/useTrackException.d.ts.map +0 -1
  438. package/lib/hooks/useTrackException.js +0 -31
  439. package/lib/hooks/useTrackTiming.d.ts +0 -2
  440. package/lib/hooks/useTrackTiming.d.ts.map +0 -1
  441. package/lib/hooks/useTrackTiming.js +0 -93
  442. package/lib/hooks/useUserID.d.ts +0 -2
  443. package/lib/hooks/useUserID.d.ts.map +0 -1
  444. package/lib/hooks/useUserID.js +0 -12
  445. package/lib/hooks/useUsername.d.ts +0 -2
  446. package/lib/hooks/useUsername.d.ts.map +0 -1
  447. package/lib/hooks/useUsername.js +0 -12
  448. package/lib/hooks/useVoiceSelector.d.ts +0 -2
  449. package/lib/hooks/useVoiceSelector.d.ts.map +0 -1
  450. package/lib/hooks/useVoiceSelector.js +0 -16
  451. package/lib/hooks/utils/ErrorBoundary.js +0 -68
  452. package/lib/hooks/utils/observableToPromise.d.ts +0 -3
  453. package/lib/hooks/utils/observableToPromise.d.ts.map +0 -1
  454. package/lib/hooks/utils/observableToPromise.js +0 -28
  455. package/lib/index.d.ts +0 -37
  456. package/lib/index.d.ts.map +0 -1
  457. package/lib/index.js +0 -88
  458. package/lib/internal.d.ts +0 -3
  459. package/lib/internal.d.ts.map +0 -1
  460. package/lib/internal.js +0 -14
  461. package/lib/localization/Localize.d.ts +0 -4
  462. package/lib/localization/Localize.d.ts.map +0 -1
  463. package/lib/localization/Localize.js +0 -50
  464. package/lib/localization/ar-EG.json +0 -42
  465. package/lib/localization/ar-JO.json +0 -45
  466. package/lib/localization/ar-SA.json +0 -97
  467. package/lib/localization/bg-BG.json +0 -97
  468. package/lib/localization/ca-ES.json +0 -97
  469. package/lib/localization/cs-CZ.json +0 -97
  470. package/lib/localization/da-DK.json +0 -97
  471. package/lib/localization/de-DE.json +0 -97
  472. package/lib/localization/el-GR.json +0 -97
  473. package/lib/localization/en-US.json +0 -167
  474. package/lib/localization/es-ES.json +0 -97
  475. package/lib/localization/et-EE.json +0 -97
  476. package/lib/localization/eu-ES.json +0 -97
  477. package/lib/localization/fi-FI.json +0 -97
  478. package/lib/localization/fr-FR.json +0 -97
  479. package/lib/localization/getAllLocalizedStrings.d.ts +0 -6
  480. package/lib/localization/getAllLocalizedStrings.d.ts.map +0 -1
  481. package/lib/localization/getAllLocalizedStrings.js +0 -117
  482. package/lib/localization/getRTLList.d.ts +0 -2
  483. package/lib/localization/getRTLList.d.ts.map +0 -1
  484. package/lib/localization/getRTLList.js +0 -46
  485. package/lib/localization/gl-ES.json +0 -97
  486. package/lib/localization/he-IL.json +0 -97
  487. package/lib/localization/hi-IN.json +0 -97
  488. package/lib/localization/hr-HR.json +0 -97
  489. package/lib/localization/hu-HU.json +0 -97
  490. package/lib/localization/id-ID.json +0 -97
  491. package/lib/localization/it-IT.json +0 -97
  492. package/lib/localization/ja-JP.json +0 -97
  493. package/lib/localization/kk-KZ.json +0 -97
  494. package/lib/localization/ko-KR.json +0 -97
  495. package/lib/localization/lt-LT.json +0 -97
  496. package/lib/localization/lv-LV.json +0 -97
  497. package/lib/localization/mergeLocalizedStrings.d.ts +0 -7
  498. package/lib/localization/mergeLocalizedStrings.d.ts.map +0 -1
  499. package/lib/localization/mergeLocalizedStrings.js +0 -49
  500. package/lib/localization/ms-MY.json +0 -97
  501. package/lib/localization/nb-NO.json +0 -97
  502. package/lib/localization/nl-NL.json +0 -97
  503. package/lib/localization/overrides.json +0 -257
  504. package/lib/localization/pl-PL.json +0 -97
  505. package/lib/localization/pt-BR.json +0 -97
  506. package/lib/localization/pt-PT.json +0 -97
  507. package/lib/localization/ro-RO.json +0 -97
  508. package/lib/localization/ru-RU.json +0 -97
  509. package/lib/localization/sk-SK.json +0 -97
  510. package/lib/localization/sl-SI.json +0 -97
  511. package/lib/localization/sl-SL.json +0 -3
  512. package/lib/localization/sr-Cyrl-CS.json +0 -97
  513. package/lib/localization/sr-Cyrl.json +0 -3
  514. package/lib/localization/sr-Latn-CS.json +0 -97
  515. package/lib/localization/sr-Latn.json +0 -3
  516. package/lib/localization/sv-SE.json +0 -97
  517. package/lib/localization/th-TH.json +0 -97
  518. package/lib/localization/tr-TR.json +0 -97
  519. package/lib/localization/uk-UA.json +0 -97
  520. package/lib/localization/vi-VN.json +0 -97
  521. package/lib/localization/yue.json +0 -100
  522. package/lib/localization/zh-CN.json +0 -97
  523. package/lib/localization/zh-HK.json +0 -97
  524. package/lib/localization/zh-TW.json +0 -97
  525. package/lib/normalizeStyleOptions.d.ts +0 -3
  526. package/lib/normalizeStyleOptions.d.ts.map +0 -1
  527. package/lib/normalizeStyleOptions.js +0 -147
  528. package/lib/patchStyleOptionsFromDeprecatedProps.js +0 -21
  529. package/lib/providers/ActivityAcknowledgement/ActivityAcknowledgementComposer.d.ts +0 -6
  530. package/lib/providers/ActivityAcknowledgement/ActivityAcknowledgementComposer.d.ts.map +0 -1
  531. package/lib/providers/ActivityAcknowledgement/ActivityAcknowledgementComposer.js +0 -153
  532. package/lib/providers/ActivityAcknowledgement/private/Context.d.ts +0 -13
  533. package/lib/providers/ActivityAcknowledgement/private/Context.d.ts.map +0 -1
  534. package/lib/providers/ActivityAcknowledgement/private/Context.js +0 -14
  535. package/lib/providers/ActivityAcknowledgement/private/useContext.d.ts +0 -3
  536. package/lib/providers/ActivityAcknowledgement/private/useContext.d.ts.map +0 -1
  537. package/lib/providers/ActivityAcknowledgement/private/useContext.js +0 -18
  538. package/lib/providers/ActivityAcknowledgement/useActivityKeysByRead.d.ts +0 -5
  539. package/lib/providers/ActivityAcknowledgement/useActivityKeysByRead.d.ts.map +0 -1
  540. package/lib/providers/ActivityAcknowledgement/useActivityKeysByRead.js +0 -15
  541. package/lib/providers/ActivityAcknowledgement/useGetHasAcknowledgedByActivityKey.d.ts +0 -2
  542. package/lib/providers/ActivityAcknowledgement/useGetHasAcknowledgedByActivityKey.d.ts.map +0 -1
  543. package/lib/providers/ActivityAcknowledgement/useGetHasAcknowledgedByActivityKey.js +0 -12
  544. package/lib/providers/ActivityAcknowledgement/useLastAcknowledgedActivityKey.d.ts +0 -2
  545. package/lib/providers/ActivityAcknowledgement/useLastAcknowledgedActivityKey.d.ts.map +0 -1
  546. package/lib/providers/ActivityAcknowledgement/useLastAcknowledgedActivityKey.js +0 -12
  547. package/lib/providers/ActivityAcknowledgement/useLastReadActivityKey.d.ts +0 -2
  548. package/lib/providers/ActivityAcknowledgement/useLastReadActivityKey.d.ts.map +0 -1
  549. package/lib/providers/ActivityAcknowledgement/useLastReadActivityKey.js +0 -12
  550. package/lib/providers/ActivityAcknowledgement/useMarkActivityKeyAsRead.d.ts +0 -2
  551. package/lib/providers/ActivityAcknowledgement/useMarkActivityKeyAsRead.d.ts.map +0 -1
  552. package/lib/providers/ActivityAcknowledgement/useMarkActivityKeyAsRead.js +0 -12
  553. package/lib/providers/ActivityAcknowledgement/useMarkAllAsAcknowledged.d.ts +0 -2
  554. package/lib/providers/ActivityAcknowledgement/useMarkAllAsAcknowledged.d.ts.map +0 -1
  555. package/lib/providers/ActivityAcknowledgement/useMarkAllAsAcknowledged.js +0 -12
  556. package/lib/providers/ActivityKeyer/ActivityKeyerComposer.d.ts +0 -20
  557. package/lib/providers/ActivityKeyer/ActivityKeyerComposer.d.ts.map +0 -1
  558. package/lib/providers/ActivityKeyer/ActivityKeyerComposer.js +0 -119
  559. package/lib/providers/ActivityKeyer/private/Context.d.ts +0 -12
  560. package/lib/providers/ActivityKeyer/private/Context.d.ts.map +0 -1
  561. package/lib/providers/ActivityKeyer/private/Context.js +0 -10
  562. package/lib/providers/ActivityKeyer/private/getActivityId.d.ts +0 -3
  563. package/lib/providers/ActivityKeyer/private/getActivityId.d.ts.map +0 -1
  564. package/lib/providers/ActivityKeyer/private/getActivityId.js +0 -10
  565. package/lib/providers/ActivityKeyer/private/getClientActivityId.d.ts +0 -3
  566. package/lib/providers/ActivityKeyer/private/getClientActivityId.d.ts.map +0 -1
  567. package/lib/providers/ActivityKeyer/private/getClientActivityId.js +0 -11
  568. package/lib/providers/ActivityKeyer/private/uniqueId.d.ts +0 -2
  569. package/lib/providers/ActivityKeyer/private/uniqueId.d.ts.map +0 -1
  570. package/lib/providers/ActivityKeyer/private/uniqueId.js +0 -15
  571. package/lib/providers/ActivityKeyer/private/useContext.d.ts +0 -3
  572. package/lib/providers/ActivityKeyer/private/useContext.d.ts.map +0 -1
  573. package/lib/providers/ActivityKeyer/private/useContext.js +0 -18
  574. package/lib/providers/ActivityKeyer/useActivityKeys.d.ts +0 -2
  575. package/lib/providers/ActivityKeyer/useActivityKeys.d.ts.map +0 -1
  576. package/lib/providers/ActivityKeyer/useActivityKeys.js +0 -12
  577. package/lib/providers/ActivityKeyer/useGetActivityByKey.d.ts +0 -3
  578. package/lib/providers/ActivityKeyer/useGetActivityByKey.d.ts.map +0 -1
  579. package/lib/providers/ActivityKeyer/useGetActivityByKey.js +0 -12
  580. package/lib/providers/ActivityKeyer/useGetKeyByActivity.d.ts +0 -3
  581. package/lib/providers/ActivityKeyer/useGetKeyByActivity.d.ts.map +0 -1
  582. package/lib/providers/ActivityKeyer/useGetKeyByActivity.js +0 -12
  583. package/lib/providers/ActivityKeyer/useGetKeyByActivityId.d.ts +0 -2
  584. package/lib/providers/ActivityKeyer/useGetKeyByActivityId.d.ts.map +0 -1
  585. package/lib/providers/ActivityKeyer/useGetKeyByActivityId.js +0 -12
  586. package/lib/providers/ActivitySendStatus/ActivitySendStatusComposer.d.ts +0 -4
  587. package/lib/providers/ActivitySendStatus/ActivitySendStatusComposer.d.ts.map +0 -1
  588. package/lib/providers/ActivitySendStatus/ActivitySendStatusComposer.js +0 -149
  589. package/lib/providers/ActivitySendStatus/private/Context.d.ts +0 -9
  590. package/lib/providers/ActivitySendStatus/private/Context.d.ts.map +0 -1
  591. package/lib/providers/ActivitySendStatus/private/Context.js +0 -13
  592. package/lib/providers/ActivitySendStatus/private/isMapEqual.d.ts +0 -7
  593. package/lib/providers/ActivitySendStatus/private/isMapEqual.d.ts.map +0 -1
  594. package/lib/providers/ActivitySendStatus/private/isMapEqual.js +0 -55
  595. package/lib/providers/ActivitySendStatus/private/useContext.d.ts +0 -3
  596. package/lib/providers/ActivitySendStatus/private/useContext.d.ts.map +0 -1
  597. package/lib/providers/ActivitySendStatus/private/useContext.js +0 -18
  598. package/lib/providers/ActivitySendStatus/useSendStatusByActivityKey.d.ts +0 -22
  599. package/lib/providers/ActivitySendStatus/useSendStatusByActivityKey.d.ts.map +0 -1
  600. package/lib/providers/ActivitySendStatus/useSendStatusByActivityKey.js +0 -31
  601. package/lib/providers/ActivitySendStatusTelemetry/ActivitySendStatusTelemetryComposer.d.ts +0 -3
  602. package/lib/providers/ActivitySendStatusTelemetry/ActivitySendStatusTelemetryComposer.d.ts.map +0 -1
  603. package/lib/providers/ActivitySendStatusTelemetry/ActivitySendStatusTelemetryComposer.js +0 -71
  604. package/lib/providers/Ponyfill/PonyfillComposer.d.ts +0 -17
  605. package/lib/providers/Ponyfill/PonyfillComposer.d.ts.map +0 -1
  606. package/lib/providers/Ponyfill/PonyfillComposer.js +0 -87
  607. package/lib/providers/Ponyfill/private/PonyfillContext.d.ts +0 -8
  608. package/lib/providers/Ponyfill/private/PonyfillContext.d.ts.map +0 -1
  609. package/lib/providers/Ponyfill/private/PonyfillContext.js +0 -10
  610. package/lib/providers/Ponyfill/private/useContext.d.ts +0 -6
  611. package/lib/providers/Ponyfill/private/useContext.d.ts.map +0 -1
  612. package/lib/providers/Ponyfill/private/useContext.js +0 -17
  613. package/lib/providers/Ponyfill/usePonyfill.d.ts +0 -3
  614. package/lib/providers/Ponyfill/usePonyfill.d.ts.map +0 -1
  615. package/lib/providers/Ponyfill/usePonyfill.js +0 -12
  616. package/lib/tsconfig.json +0 -18
  617. package/lib/types/ActivityMiddleware.d.ts +0 -24
  618. package/lib/types/ActivityMiddleware.d.ts.map +0 -1
  619. package/lib/types/ActivityMiddleware.js +0 -2
  620. package/lib/types/ActivityStatusMiddleware.d.ts +0 -17
  621. package/lib/types/ActivityStatusMiddleware.d.ts.map +0 -1
  622. package/lib/types/ActivityStatusMiddleware.js +0 -2
  623. package/lib/types/AttachmentForScreenReaderMiddleware.d.ts +0 -14
  624. package/lib/types/AttachmentForScreenReaderMiddleware.d.ts.map +0 -1
  625. package/lib/types/AttachmentForScreenReaderMiddleware.js +0 -2
  626. package/lib/types/AttachmentMiddleware.d.ts +0 -12
  627. package/lib/types/AttachmentMiddleware.d.ts.map +0 -1
  628. package/lib/types/AttachmentMiddleware.js +0 -2
  629. package/lib/types/AvatarMiddleware.d.ts +0 -15
  630. package/lib/types/AvatarMiddleware.d.ts.map +0 -1
  631. package/lib/types/AvatarMiddleware.js +0 -2
  632. package/lib/types/CardActionMiddleware.d.ts +0 -19
  633. package/lib/types/CardActionMiddleware.d.ts.map +0 -1
  634. package/lib/types/CardActionMiddleware.js +0 -2
  635. package/lib/types/ComponentMiddleware.d.ts +0 -31
  636. package/lib/types/ComponentMiddleware.d.ts.map +0 -1
  637. package/lib/types/ComponentMiddleware.js +0 -2
  638. package/lib/types/ContextOf.d.ts +0 -4
  639. package/lib/types/ContextOf.d.ts.map +0 -1
  640. package/lib/types/ContextOf.js +0 -2
  641. package/lib/types/FunctionMiddleware.d.ts +0 -6
  642. package/lib/types/FunctionMiddleware.d.ts.map +0 -1
  643. package/lib/types/FunctionMiddleware.js +0 -2
  644. package/lib/types/GroupActivitiesMiddleware.d.ts +0 -22
  645. package/lib/types/GroupActivitiesMiddleware.d.ts.map +0 -1
  646. package/lib/types/GroupActivitiesMiddleware.js +0 -2
  647. package/lib/types/LocalizedStrings.d.ts +0 -5
  648. package/lib/types/LocalizedStrings.d.ts.map +0 -1
  649. package/lib/types/LocalizedStrings.js +0 -2
  650. package/lib/types/Notification.d.ts +0 -10
  651. package/lib/types/Notification.d.ts.map +0 -1
  652. package/lib/types/Notification.js +0 -2
  653. package/lib/types/PrecompiledGlobalize.d.ts +0 -13
  654. package/lib/types/PrecompiledGlobalize.d.ts.map +0 -1
  655. package/lib/types/PrecompiledGlobalize.js +0 -2
  656. package/lib/types/ScrollToEndButtonMiddleware.d.ts +0 -30
  657. package/lib/types/ScrollToEndButtonMiddleware.d.ts.map +0 -1
  658. package/lib/types/ScrollToEndButtonMiddleware.js +0 -2
  659. package/lib/types/SendStatus.d.ts +0 -3
  660. package/lib/types/SendStatus.d.ts.map +0 -1
  661. package/lib/types/SendStatus.js +0 -2
  662. package/lib/types/TelemetryMeasurementEvent.d.ts +0 -31
  663. package/lib/types/TelemetryMeasurementEvent.d.ts.map +0 -1
  664. package/lib/types/TelemetryMeasurementEvent.js +0 -2
  665. package/lib/types/ToastMiddleware.d.ts +0 -11
  666. package/lib/types/ToastMiddleware.d.ts.map +0 -1
  667. package/lib/types/ToastMiddleware.js +0 -2
  668. package/lib/types/Typing.d.ts +0 -8
  669. package/lib/types/Typing.d.ts.map +0 -1
  670. package/lib/types/Typing.js +0 -2
  671. package/lib/types/TypingIndicatorMiddleware.d.ts +0 -17
  672. package/lib/types/TypingIndicatorMiddleware.d.ts.map +0 -1
  673. package/lib/types/TypingIndicatorMiddleware.js +0 -2
  674. package/lib/types/WebSpeechPonyfill.d.ts +0 -19
  675. package/lib/types/WebSpeechPonyfill.d.ts.map +0 -1
  676. package/lib/types/WebSpeechPonyfill.js +0 -2
  677. package/lib/types/WebSpeechPonyfillFactory.d.ts +0 -6
  678. package/lib/types/WebSpeechPonyfillFactory.d.ts.map +0 -1
  679. package/lib/types/WebSpeechPonyfillFactory.js +0 -2
  680. package/lib/utils/createCustomEvent.d.ts +0 -4
  681. package/lib/utils/createCustomEvent.d.ts.map +0 -1
  682. package/lib/utils/createCustomEvent.js +0 -34
  683. package/lib/utils/findLastIndex.d.ts +0 -2
  684. package/lib/utils/findLastIndex.d.ts.map +0 -1
  685. package/lib/utils/findLastIndex.js +0 -22
  686. package/lib/utils/findMin.d.ts +0 -7
  687. package/lib/utils/findMin.d.ts.map +0 -1
  688. package/lib/utils/findMin.js +0 -46
  689. package/lib/utils/freezeArray.d.ts +0 -8
  690. package/lib/utils/freezeArray.d.ts.map +0 -1
  691. package/lib/utils/freezeArray.js +0 -19
  692. package/lib/utils/isObject.js +0 -12
  693. package/lib/utils/mapMap.d.ts +0 -6
  694. package/lib/utils/mapMap.d.ts.map +0 -1
  695. package/lib/utils/mapMap.js +0 -27
  696. package/lib/utils/normalizeLanguage.d.ts +0 -2
  697. package/lib/utils/normalizeLanguage.d.ts.map +0 -1
  698. package/lib/utils/normalizeLanguage.js +0 -115
  699. package/lib/utils/randomId.d.ts +0 -2
  700. package/lib/utils/randomId.d.ts.map +0 -1
  701. package/lib/utils/randomId.js +0 -15
  702. package/lib/utils/warnOnce.d.ts +0 -2
  703. package/lib/utils/warnOnce.d.ts.map +0 -1
  704. package/lib/utils/warnOnce.js +0 -16
  705. package/src/external/PrecompiledGlobalize.cjs +0 -8855
  706. package/src/hooks/middleware/createDefaultGroupActivitiesMiddleware.ts +0 -75
  707. package/src/hooks/useGroupActivities.ts +0 -10
  708. /package/dist/{chunk-4ZIUY4G5.mjs.LEGAL.txt → botframework-webchat-api.decorator.js.LEGAL.txt} +0 -0
@@ -32,7 +32,7 @@ import {
32
32
  type WebChatActivity
33
33
  } from 'botframework-webchat-core';
34
34
  import PropTypes from 'prop-types';
35
- import React, { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
35
+ import React, { useCallback, useEffect, useMemo, useRef, useState, type ComponentType, type ReactNode } from 'react';
36
36
  import { Provider } from 'react-redux';
37
37
  import updateIn from 'simple-update-in';
38
38
 
@@ -43,8 +43,10 @@ import normalizeStyleOptions from '../normalizeStyleOptions';
43
43
  import patchStyleOptionsFromDeprecatedProps from '../patchStyleOptionsFromDeprecatedProps';
44
44
  import ActivityAcknowledgementComposer from '../providers/ActivityAcknowledgement/ActivityAcknowledgementComposer';
45
45
  import ActivityKeyerComposer from '../providers/ActivityKeyer/ActivityKeyerComposer';
46
+ import ActivityListenerComposer from '../providers/ActivityListener/ActivityListenerComposer';
46
47
  import ActivitySendStatusComposer from '../providers/ActivitySendStatus/ActivitySendStatusComposer';
47
48
  import ActivitySendStatusTelemetryComposer from '../providers/ActivitySendStatusTelemetry/ActivitySendStatusTelemetryComposer';
49
+ import ActivityTypingComposer from '../providers/ActivityTyping/ActivityTypingComposer';
48
50
  import PonyfillComposer from '../providers/Ponyfill/PonyfillComposer';
49
51
  import ActivityMiddleware from '../types/ActivityMiddleware';
50
52
  import { type ActivityStatusMiddleware, type RenderActivityStatus } from '../types/ActivityStatusMiddleware';
@@ -52,6 +54,7 @@ import AttachmentForScreenReaderMiddleware from '../types/AttachmentForScreenRea
52
54
  import AttachmentMiddleware from '../types/AttachmentMiddleware';
53
55
  import AvatarMiddleware from '../types/AvatarMiddleware';
54
56
  import CardActionMiddleware from '../types/CardActionMiddleware';
57
+ import { type ContextOf } from '../types/ContextOf';
55
58
  import GroupActivitiesMiddleware from '../types/GroupActivitiesMiddleware';
56
59
  import LocalizedStrings from '../types/LocalizedStrings';
57
60
  import PrecompiledGlobalizeType from '../types/PrecompiledGlobalize';
@@ -59,7 +62,6 @@ import ScrollToEndButtonMiddleware, { ScrollToEndButtonComponentFactory } from '
59
62
  import TelemetryMeasurementEvent, { TelemetryExceptionMeasurementEvent } from '../types/TelemetryMeasurementEvent';
60
63
  import ToastMiddleware from '../types/ToastMiddleware';
61
64
  import TypingIndicatorMiddleware from '../types/TypingIndicatorMiddleware';
62
- import { type ContextOf } from '../types/ContextOf';
63
65
  import createCustomEvent from '../utils/createCustomEvent';
64
66
  import isObject from '../utils/isObject';
65
67
  import mapMap from '../utils/mapMap';
@@ -67,7 +69,7 @@ import normalizeLanguage from '../utils/normalizeLanguage';
67
69
  import { SendBoxMiddlewareProvider, type SendBoxMiddleware } from './internal/SendBoxMiddleware';
68
70
  import { SendBoxToolbarMiddlewareProvider, type SendBoxToolbarMiddleware } from './internal/SendBoxToolbarMiddleware';
69
71
  import Tracker from './internal/Tracker';
70
- import { default as WebChatAPIContext } from './internal/WebChatAPIContext';
72
+ import WebChatAPIContext, { type WebChatAPIContextType } from './internal/WebChatAPIContext';
71
73
  import WebChatReduxContext, { useDispatch } from './internal/WebChatReduxContext';
72
74
  import defaultSelectVoice from './internal/defaultSelectVoice';
73
75
  import applyMiddleware, {
@@ -75,14 +77,15 @@ import applyMiddleware, {
75
77
  forRenderer as applyMiddlewareForRenderer
76
78
  } from './middleware/applyMiddleware';
77
79
  import createDefaultCardActionMiddleware from './middleware/createDefaultCardActionMiddleware';
78
- import createDefaultGroupActivitiesMiddleware from './middleware/createDefaultGroupActivitiesMiddleware';
79
80
  import useMarkAllAsAcknowledged from './useMarkAllAsAcknowledged';
80
81
  import ErrorBoundary from './utils/ErrorBoundary';
81
82
  import observableToPromise from './utils/observableToPromise';
82
83
 
83
84
  // PrecompileGlobalize is a generated file and is not ES module. TypeScript don't work with UMD.
84
85
  // @ts-ignore
85
- import PrecompiledGlobalize from '../external/PrecompiledGlobalize.cjs';
86
+ import PrecompiledGlobalize from '../external/PrecompiledGlobalize';
87
+ import GroupActivitiesComposer from '../providers/GroupActivities/GroupActivitiesComposer';
88
+ import { parseUIState } from './validation/uiState';
86
89
 
87
90
  // List of Redux actions factory we are hoisting as Web Chat functions
88
91
  const DISPATCHERS = {
@@ -109,16 +112,20 @@ const DISPATCHERS = {
109
112
  submitSendBox
110
113
  };
111
114
 
115
+ const EMPTY_ARRAY: readonly [] = Object.freeze([]);
116
+
112
117
  function createCardActionContext({
113
118
  cardActionMiddleware,
119
+ continuous,
114
120
  directLine,
115
121
  dispatch,
116
122
  markAllAsAcknowledged,
117
123
  ponyfill
118
124
  }: {
119
125
  cardActionMiddleware: readonly CardActionMiddleware[];
126
+ continuous: boolean;
120
127
  directLine: DirectLineJSBotConnection;
121
- dispatch: Function;
128
+ dispatch: (...args: unknown[]) => unknown;
122
129
  markAllAsAcknowledged: () => void;
123
130
  ponyfill: GlobalScopePonyfill;
124
131
  }) {
@@ -132,6 +139,11 @@ function createCardActionContext({
132
139
  onCardAction: (cardAction, { target }: { target?: any } = {}) => {
133
140
  markAllAsAcknowledged();
134
141
 
142
+ // Stop speech recognition only if under interactive mode.
143
+ if (!continuous) {
144
+ dispatch(stopDictate());
145
+ }
146
+
135
147
  return runMiddleware({
136
148
  cardAction,
137
149
  getSignInUrl:
@@ -161,26 +173,6 @@ function createCardActionContext({
161
173
  };
162
174
  }
163
175
 
164
- function createGroupActivitiesContext({
165
- groupActivitiesMiddleware,
166
- groupTimestamp,
167
- ponyfill
168
- }: {
169
- groupActivitiesMiddleware: readonly GroupActivitiesMiddleware[];
170
- groupTimestamp: boolean | number;
171
- ponyfill: GlobalScopePonyfill;
172
- }) {
173
- const runMiddleware = applyMiddleware(
174
- 'group activities',
175
- ...groupActivitiesMiddleware,
176
- createDefaultGroupActivitiesMiddleware({ groupTimestamp, ponyfill })
177
- );
178
-
179
- return {
180
- groupActivities: runMiddleware({})
181
- };
182
- }
183
-
184
176
  function mergeStringsOverrides(localizedStrings, language, overrideLocalizedStrings) {
185
177
  if (!overrideLocalizedStrings) {
186
178
  return localizedStrings;
@@ -213,9 +205,12 @@ type ComposerCoreProps = Readonly<{
213
205
  attachmentMiddleware?: OneOrMany<AttachmentMiddleware>;
214
206
  avatarMiddleware?: OneOrMany<AvatarMiddleware>;
215
207
  cardActionMiddleware?: OneOrMany<CardActionMiddleware>;
216
- children?: ReactNode | ((context: ContextOf<typeof WebChatAPIContext>) => ReactNode);
208
+ children?: ReactNode | ((context: ContextOf<React.Context<WebChatAPIContextType>>) => ReactNode);
217
209
  dir?: string;
218
210
  directLine: DirectLineJSBotConnection;
211
+ /**
212
+ * @deprecated Please use `uiState="disabled"` instead. This feature will be removed on or after 2026-09-04.
213
+ */
219
214
  disabled?: boolean;
220
215
  downscaleImageToDataURL?: (
221
216
  blob: Blob,
@@ -226,7 +221,14 @@ type ComposerCoreProps = Readonly<{
226
221
  ) => Promise<URL>;
227
222
  grammars?: any;
228
223
  groupActivitiesMiddleware?: OneOrMany<GroupActivitiesMiddleware>;
229
- internalErrorBoxClass?: React.Component | Function;
224
+ internalErrorBoxClass?:
225
+ | ComponentType<
226
+ Readonly<{
227
+ error: Error;
228
+ type?: string;
229
+ }>
230
+ >
231
+ | undefined;
230
232
  locale?: string;
231
233
  onTelemetry?: (event: TelemetryMeasurementEvent) => void;
232
234
  overrideLocalizedStrings?: LocalizedStrings | ((strings: LocalizedStrings, language: string) => LocalizedStrings);
@@ -243,6 +245,16 @@ type ComposerCoreProps = Readonly<{
243
245
  styleOptions?: StyleOptions;
244
246
  toastMiddleware?: OneOrMany<ToastMiddleware>;
245
247
  typingIndicatorMiddleware?: OneOrMany<TypingIndicatorMiddleware>;
248
+ /**
249
+ * Sets the state of the UI.
250
+ *
251
+ * - `undefined` will render normally
252
+ * - `"blueprint"` will render as few UI elements as possible and should be non-functional
253
+ * - Useful for loading scenarios
254
+ * - `"disabled"` will render most UI elements as non-functional
255
+ * - Scrolling may continue to trigger read acknowledgements
256
+ */
257
+ uiState?: 'blueprint' | 'disabled' | undefined;
246
258
  userID?: string;
247
259
  username?: string;
248
260
  }>;
@@ -274,6 +286,7 @@ const ComposerCore = ({
274
286
  styleOptions,
275
287
  toastMiddleware,
276
288
  typingIndicatorMiddleware,
289
+ uiState,
277
290
  userID,
278
291
  username
279
292
  }: ComposerCoreProps) => {
@@ -288,6 +301,8 @@ const ComposerCore = ({
288
301
  [styleOptions]
289
302
  );
290
303
 
304
+ uiState = parseUIState(uiState, disabled);
305
+
291
306
  useEffect(() => {
292
307
  dispatch(setLanguage(locale));
293
308
  }, [dispatch, locale]);
@@ -319,12 +334,20 @@ const ComposerCore = ({
319
334
  () =>
320
335
  createCardActionContext({
321
336
  cardActionMiddleware: Object.freeze([...singleToArray(cardActionMiddleware)]),
337
+ continuous: !!styleOptions.speechRecognitionContinuous,
322
338
  directLine,
323
339
  dispatch,
324
340
  markAllAsAcknowledged,
325
341
  ponyfill
326
342
  }),
327
- [cardActionMiddleware, directLine, dispatch, markAllAsAcknowledged, ponyfill]
343
+ [
344
+ cardActionMiddleware,
345
+ directLine,
346
+ dispatch,
347
+ markAllAsAcknowledged,
348
+ ponyfill,
349
+ styleOptions.speechRecognitionContinuous
350
+ ]
328
351
  );
329
352
 
330
353
  const patchedSelectVoice = useMemo(
@@ -332,16 +355,6 @@ const ComposerCore = ({
332
355
  [locale, selectVoice]
333
356
  );
334
357
 
335
- const groupActivitiesContext = useMemo(
336
- () =>
337
- createGroupActivitiesContext({
338
- groupActivitiesMiddleware: Object.freeze([...singleToArray(groupActivitiesMiddleware)]),
339
- groupTimestamp: patchedStyleOptions.groupTimestamp,
340
- ponyfill
341
- }),
342
- [groupActivitiesMiddleware, patchedStyleOptions.groupTimestamp, ponyfill]
343
- );
344
-
345
358
  const hoistedDispatchers = useMemo(
346
359
  () =>
347
360
  mapMap(
@@ -522,10 +535,9 @@ const ComposerCore = ({
522
535
  * This context should consist of members that are not in the Redux store
523
536
  * i.e. members that are not interested in other types of UIs
524
537
  */
525
- const context = useMemo<ContextOf<typeof WebChatAPIContext>>(
538
+ const context = useMemo<ContextOf<React.Context<WebChatAPIContextType>>>(
526
539
  () => ({
527
540
  ...cardActionContext,
528
- ...groupActivitiesContext,
529
541
  ...hoistedDispatchers,
530
542
  activityRenderer: patchedActivityRenderer,
531
543
  activityStatusRenderer: patchedActivityStatusRenderer,
@@ -534,7 +546,6 @@ const ComposerCore = ({
534
546
  avatarRenderer: patchedAvatarRenderer,
535
547
  dir: patchedDir,
536
548
  directLine,
537
- disabled,
538
549
  downscaleImageToDataURL,
539
550
  grammars: patchedGrammars,
540
551
  internalErrorBoxClass,
@@ -551,15 +562,14 @@ const ComposerCore = ({
551
562
  toastRenderer: patchedToastRenderer,
552
563
  trackDimension,
553
564
  typingIndicatorRenderer: patchedTypingIndicatorRenderer,
565
+ uiState,
554
566
  userID,
555
567
  username
556
568
  }),
557
569
  [
558
570
  cardActionContext,
559
571
  directLine,
560
- disabled,
561
572
  downscaleImageToDataURL,
562
- groupActivitiesContext,
563
573
  hoistedDispatchers,
564
574
  internalErrorBoxClass,
565
575
  locale,
@@ -582,6 +592,7 @@ const ComposerCore = ({
582
592
  sendTypingIndicator,
583
593
  telemetryDimensionsRef,
584
594
  trackDimension,
595
+ uiState,
585
596
  userID,
586
597
  username
587
598
  ]
@@ -589,14 +600,20 @@ const ComposerCore = ({
589
600
 
590
601
  return (
591
602
  <WebChatAPIContext.Provider value={context}>
592
- <ActivitySendStatusComposer>
593
- <SendBoxMiddlewareProvider middleware={sendBoxMiddleware || Object.freeze([])}>
594
- <SendBoxToolbarMiddlewareProvider middleware={sendBoxToolbarMiddleware || Object.freeze([])}>
595
- {typeof children === 'function' ? children(context) : children}
596
- <ActivitySendStatusTelemetryComposer />
597
- </SendBoxToolbarMiddlewareProvider>
598
- </SendBoxMiddlewareProvider>
599
- </ActivitySendStatusComposer>
603
+ <ActivityListenerComposer>
604
+ <ActivitySendStatusComposer>
605
+ <ActivityTypingComposer>
606
+ <SendBoxMiddlewareProvider middleware={sendBoxMiddleware || EMPTY_ARRAY}>
607
+ <SendBoxToolbarMiddlewareProvider middleware={sendBoxToolbarMiddleware || EMPTY_ARRAY}>
608
+ <GroupActivitiesComposer groupActivitiesMiddleware={singleToArray(groupActivitiesMiddleware)}>
609
+ {typeof children === 'function' ? children(context) : children}
610
+ </GroupActivitiesComposer>
611
+ <ActivitySendStatusTelemetryComposer />
612
+ </SendBoxToolbarMiddlewareProvider>
613
+ </SendBoxMiddlewareProvider>
614
+ </ActivityTypingComposer>
615
+ </ActivitySendStatusComposer>
616
+ </ActivityListenerComposer>
600
617
  {onTelemetry && <Tracker />}
601
618
  </WebChatAPIContext.Provider>
602
619
  );
@@ -632,6 +649,7 @@ ComposerCore.defaultProps = {
632
649
  styleOptions: {},
633
650
  toastMiddleware: undefined,
634
651
  typingIndicatorMiddleware: undefined,
652
+ uiState: undefined,
635
653
  userID: '',
636
654
  username: ''
637
655
  };
@@ -664,7 +682,10 @@ ComposerCore.propTypes = {
664
682
  downscaleImageToDataURL: PropTypes.func,
665
683
  grammars: PropTypes.arrayOf(PropTypes.string),
666
684
  groupActivitiesMiddleware: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.func), PropTypes.func]),
667
- internalErrorBoxClass: PropTypes.func, // This is for internal use only. We don't allow customization of error box.
685
+ // This is for internal use only. We don't allow customization of error box.
686
+ // - Functional component is of type PropTypes.func
687
+ // - Memoized functional component is of type PropTypes.object
688
+ internalErrorBoxClass: PropTypes.oneOfType([PropTypes.any, PropTypes.func]),
668
689
  locale: PropTypes.string,
669
690
  onTelemetry: PropTypes.func,
670
691
  overrideLocalizedStrings: PropTypes.oneOfType([PropTypes.any, PropTypes.func]),
@@ -675,6 +696,7 @@ ComposerCore.propTypes = {
675
696
  styleOptions: PropTypes.any,
676
697
  toastMiddleware: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.func), PropTypes.func]),
677
698
  typingIndicatorMiddleware: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.func), PropTypes.func]),
699
+ uiState: PropTypes.oneOf(['blueprint', 'disabled']),
678
700
  userID: PropTypes.string,
679
701
  username: PropTypes.string
680
702
  };
@@ -19,13 +19,15 @@ import useDirection from './useDirection';
19
19
  import useDisabled from './useDisabled';
20
20
  import useDismissNotification from './useDismissNotification';
21
21
  import useEmitTypingIndicator from './useEmitTypingIndicator';
22
+ import useGetActivitiesByKey from './useGetActivitiesByKey';
22
23
  import useGetActivityByKey from './useGetActivityByKey';
23
24
  import useGetHasAcknowledgedByActivityKey from './useGetHasAcknowledgedByActivityKey';
24
25
  import useGetKeyByActivity from './useGetKeyByActivity';
25
26
  import useGetKeyByActivityId from './useGetKeyByActivityId';
26
27
  import useGetSendTimeoutForActivity from './useGetSendTimeoutForActivity';
27
28
  import useGrammars from './useGrammars';
28
- import useGroupActivities from './useGroupActivities';
29
+ import useGroupActivities from '../providers/GroupActivities/useGroupActivities';
30
+ import useGroupActivitiesByName from '../providers/GroupActivities/useGroupActivitiesByName';
29
31
  import useGroupTimestamp from './useGroupTimestamp';
30
32
  import useLanguage from './useLanguage';
31
33
  import useLastAcknowledgedActivityKey from './useLastAcknowledgedActivityKey';
@@ -65,6 +67,7 @@ import useTrackDimension from './useTrackDimension';
65
67
  import useTrackEvent from './useTrackEvent';
66
68
  import useTrackException from './useTrackException';
67
69
  import useTrackTiming from './useTrackTiming';
70
+ import useUIState from './useUIState';
68
71
  import useUserID from './useUserID';
69
72
  import useUsername from './useUsername';
70
73
  import useVoiceSelector from './useVoiceSelector';
@@ -91,6 +94,7 @@ export {
91
94
  useDisabled,
92
95
  useDismissNotification,
93
96
  useEmitTypingIndicator,
97
+ useGetActivitiesByKey,
94
98
  useGetActivityByKey,
95
99
  useGetHasAcknowledgedByActivityKey,
96
100
  useGetKeyByActivity,
@@ -98,6 +102,7 @@ export {
98
102
  useGetSendTimeoutForActivity,
99
103
  useGrammars,
100
104
  useGroupActivities,
105
+ useGroupActivitiesByName,
101
106
  useGroupTimestamp,
102
107
  useLanguage,
103
108
  useLastAcknowledgedActivityKey,
@@ -137,6 +142,7 @@ export {
137
142
  useTrackEvent,
138
143
  useTrackException,
139
144
  useTrackTiming,
145
+ useUIState,
140
146
  useUserID,
141
147
  useUsername,
142
148
  useVoiceSelector
@@ -1,11 +1,13 @@
1
1
  import templateMiddleware from './private/templateMiddleware';
2
2
 
3
3
  const {
4
+ initMiddleware: initSendBoxMiddleware,
4
5
  Provider: SendBoxMiddlewareProvider,
5
6
  Proxy: SendBoxMiddlewareProxy,
6
- rectifyProps: rectifySendBoxMiddlewareProps,
7
+ // False positive, `types` is used for its typing.
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
9
  types
8
- } = templateMiddleware<{ className?: string | undefined }>('sendBoxMiddleware');
10
+ } = templateMiddleware<undefined, void, { className?: string | undefined }>('sendBoxMiddleware');
9
11
 
10
12
  type SendBoxMiddleware = typeof types.middleware;
11
13
  type SendBoxMiddlewareProps = typeof types.props;
@@ -14,7 +16,7 @@ type SendBoxMiddlewareRequest = typeof types.request;
14
16
  export {
15
17
  SendBoxMiddlewareProvider,
16
18
  SendBoxMiddlewareProxy,
17
- rectifySendBoxMiddlewareProps,
19
+ initSendBoxMiddleware,
18
20
  type SendBoxMiddleware,
19
21
  type SendBoxMiddlewareProps,
20
22
  type SendBoxMiddlewareRequest
@@ -1,11 +1,13 @@
1
1
  import templateMiddleware from './private/templateMiddleware';
2
2
 
3
3
  const {
4
+ initMiddleware: initSendBoxToolbarMiddleware,
4
5
  Provider: SendBoxToolbarMiddlewareProvider,
5
6
  Proxy: SendBoxToolbarMiddlewareProxy,
6
- rectifyProps: rectifySendBoxToolbarMiddlewareProps,
7
+ // False positive, `types` is used for its typing.
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
9
  types
8
- } = templateMiddleware<{ className?: string | undefined }>('sendBoxToolbarMiddleware');
10
+ } = templateMiddleware<undefined, void, { className?: string | undefined }>('sendBoxToolbarMiddleware');
9
11
 
10
12
  type SendBoxToolbarMiddleware = typeof types.middleware;
11
13
  type SendBoxToolbarMiddlewareProps = typeof types.props;
@@ -14,7 +16,7 @@ type SendBoxToolbarMiddlewareRequest = typeof types.request;
14
16
  export {
15
17
  SendBoxToolbarMiddlewareProvider,
16
18
  SendBoxToolbarMiddlewareProxy,
17
- rectifySendBoxToolbarMiddlewareProps,
19
+ initSendBoxToolbarMiddleware,
18
20
  type SendBoxToolbarMiddleware,
19
21
  type SendBoxToolbarMiddlewareProps,
20
22
  type SendBoxToolbarMiddlewareRequest
@@ -1,6 +1,6 @@
1
1
  import useTracker from './useTracker';
2
2
 
3
- const Tracker: React.FC<{}> = () => {
3
+ const Tracker = () => {
4
4
  useTracker();
5
5
 
6
6
  return null;
@@ -6,7 +6,7 @@ import {
6
6
  type sendMessage,
7
7
  type setSendBoxAttachments
8
8
  } from 'botframework-webchat-core';
9
- import { createContext } from 'react';
9
+ import { createContext, type ComponentType } from 'react';
10
10
 
11
11
  import { StrictStyleOptions } from '../../StyleOptions';
12
12
  import { LegacyActivityRenderer } from '../../types/ActivityMiddleware';
@@ -23,7 +23,7 @@ import { ScrollToEndButtonComponentFactory } from '../../types/ScrollToEndButton
23
23
  import TelemetryMeasurementEvent from '../../types/TelemetryMeasurementEvent';
24
24
  import { RenderToast } from '../../types/ToastMiddleware';
25
25
 
26
- type WebChatAPIContext = {
26
+ export type WebChatAPIContextType = {
27
27
  activityRenderer?: LegacyActivityRenderer;
28
28
  activityStatusRenderer: RenderActivityStatus;
29
29
  attachmentForScreenReaderRenderer?: AttachmentForScreenReaderComponentFactory;
@@ -32,7 +32,6 @@ type WebChatAPIContext = {
32
32
  clearSuggestedActions?: () => void;
33
33
  dir?: string;
34
34
  directLine?: DirectLineJSBotConnection;
35
- disabled?: boolean;
36
35
  dismissNotification?: (id: string) => void;
37
36
  downscaleImageToDataURL?: (
38
37
  blob: Blob,
@@ -44,7 +43,14 @@ type WebChatAPIContext = {
44
43
  emitTypingIndicator?: () => void;
45
44
  grammars?: any;
46
45
  groupActivities?: GroupActivities;
47
- internalErrorBoxClass?: React.Component | Function;
46
+ internalErrorBoxClass?:
47
+ | ComponentType<
48
+ Readonly<{
49
+ error: Error;
50
+ type?: string;
51
+ }>
52
+ >
53
+ | undefined;
48
54
  language?: string;
49
55
  localizedGlobalizeState?: PrecompiledGlobalize[];
50
56
  localizedStrings?: { [language: string]: LocalizedStrings };
@@ -84,11 +90,12 @@ type WebChatAPIContext = {
84
90
  toastRenderer?: RenderToast;
85
91
  trackDimension?: (name: string, data: any) => void;
86
92
  typingIndicatorRenderer?: any; // TODO
93
+ uiState: 'blueprint' | 'disabled' | undefined;
87
94
  userID?: string;
88
95
  username?: string;
89
96
  };
90
97
 
91
- const context = createContext<WebChatAPIContext>(undefined);
98
+ const context = createContext<WebChatAPIContextType>(undefined);
92
99
 
93
100
  context.displayName = 'WebChatAPIContext';
94
101
 
@@ -1,44 +1,4 @@
1
- import { warnOnce } from 'botframework-webchat-core';
2
- import { createChainOfResponsibility, type ComponentMiddleware } from 'react-chain-of-responsibility';
3
- import { type EmptyObject } from 'type-fest';
4
- import { any, array, custom, safeParse, type Output } from 'valibot';
1
+ import templateMiddleware from '../../../decorator/private/templateMiddleware';
5
2
 
6
- export default function createMiddlewareFacility<Props extends {} = EmptyObject, Request extends {} = EmptyObject>(
7
- name: string
8
- ) {
9
- type Middleware = ComponentMiddleware<Request, Props>;
10
-
11
- const validateMiddleware = custom<Middleware>(input => typeof input === 'function', 'Middleware must be a function.');
12
-
13
- const middlewareSchema = array(any([validateMiddleware]));
14
-
15
- const isMiddleware = (middleware: unknown): middleware is Output<typeof middlewareSchema> =>
16
- safeParse(middlewareSchema, middleware).success;
17
-
18
- const warnInvalid = warnOnce(`"${name}" prop is invalid`);
19
-
20
- const rectifyProps = (middleware: unknown): readonly Middleware[] => {
21
- if (middleware) {
22
- if (isMiddleware(middleware)) {
23
- return Object.isFrozen(middleware) ? middleware : Object.freeze([...middleware]);
24
- }
25
-
26
- warnInvalid();
27
- }
28
-
29
- return Object.freeze([]);
30
- };
31
-
32
- const { Provider, Proxy } = createChainOfResponsibility<Request, Props>();
33
-
34
- return {
35
- types: {
36
- middleware: {} as Middleware,
37
- props: {} as Props,
38
- request: {} as Request
39
- },
40
- Provider,
41
- Proxy,
42
- rectifyProps
43
- };
44
- }
3
+ // TODO: We should move them to a common directory.
4
+ export default templateMiddleware;
@@ -1,7 +1,10 @@
1
1
  import { useEffect, useRef } from 'react';
2
2
 
3
- export default function usePrevious<T>(value: T): T {
4
- const ref = useRef<T>();
3
+ export default function usePrevious<T>(value: T): T | undefined;
4
+ export default function usePrevious<T>(value: T, initialValue: T): T;
5
+
6
+ export default function usePrevious<T>(value: T, initialValue?: T | undefined): T | undefined {
7
+ const ref = useRef<T | undefined>(initialValue);
5
8
 
6
9
  useEffect(() => {
7
10
  ref.current = value;
@@ -53,3 +53,23 @@ test('one middleware ran twice by a single upstream middleware', () => {
53
53
 
54
54
  expect(work(1)).toEqual(210);
55
55
  });
56
+
57
+ test('a middleware return undefined after setup should be skipped', () => {
58
+ const enhancer = concatMiddleware(
59
+ () => next => value => next(value + 2),
60
+ () => undefined,
61
+ () => next => value => next(value * 3)
62
+ );
63
+
64
+ expect(enhancer()(value => value)(5)).toEqual(21); // (5 + 2) * 3
65
+ });
66
+
67
+ test('an undefined middleware should be skipped', () => {
68
+ const enhancer = concatMiddleware(
69
+ () => next => value => next(value + 2),
70
+ undefined,
71
+ () => next => value => next(value * 3)
72
+ );
73
+
74
+ expect(enhancer()(value => value)(5)).toEqual(21); // (5 + 2) * 3
75
+ });
@@ -1,4 +1,4 @@
1
- type Work<T> = (...args: any[]) => T;
1
+ type Work<T> = (...args: unknown[]) => T;
2
2
  type Enhancer<T> = (next: Work<T>) => Work<T>;
3
3
  type Middleware<Setup, Result> = (setup: Setup) => Enhancer<Result>;
4
4
 
@@ -6,10 +6,11 @@ export default function concatMiddleware<Setup, Result>(
6
6
  ...middleware: Middleware<Setup, Result>[]
7
7
  ): Middleware<Setup, Result> {
8
8
  return setupArgs => {
9
- const setup = middleware.reduce(
10
- (setup, middleware) => (middleware ? [...setup, middleware(setupArgs)] : setup),
11
- []
12
- );
9
+ const setup = middleware.reduce((setup, middleware) => {
10
+ const enhancer = middleware?.(setupArgs);
11
+
12
+ return enhancer ? [...setup, enhancer] : setup;
13
+ }, []);
13
14
 
14
15
  return last => {
15
16
  const stack = setup.slice();
@@ -0,0 +1,9 @@
1
+ import numberWithInfinity from './numberWithInfinity';
2
+
3
+ test('passing "Infinity" should return Infinity', () => expect(numberWithInfinity('Infinity')).toBe(Infinity));
4
+ test('passing "-Infinity" should return -Infinity', () => expect(numberWithInfinity('-Infinity')).toBe(-Infinity));
5
+ test('passing 0 should return 0', () => expect(numberWithInfinity(0)).toBe(0));
6
+ test('passing -0 should return -0', () => expect(numberWithInfinity(-0)).toBe(-0));
7
+ test('passing 1 should return 1', () => expect(numberWithInfinity(1)).toBe(1));
8
+ test('passing "1" should return undefined', () => expect(numberWithInfinity('1' as any)).toBeUndefined());
9
+ test('passing "ABC" should return undefined', () => expect(numberWithInfinity('ABC' as any)).toBeUndefined());
@@ -0,0 +1,15 @@
1
+ export default function numberWithInfinity(value: number | 'Infinity' | '-Infinity'): number;
2
+ export default function numberWithInfinity(value: unknown): undefined;
3
+
4
+ export default function numberWithInfinity(value: number | 'Infinity' | '-Infinity' | unknown): number | undefined {
5
+ switch (value) {
6
+ case 'Infinity':
7
+ return Infinity;
8
+
9
+ case '-Infinity':
10
+ return -Infinity;
11
+
12
+ default:
13
+ return typeof value === 'number' ? value : undefined;
14
+ }
15
+ }
@@ -0,0 +1,29 @@
1
+ import reduceIterable from './reduceIterable';
2
+
3
+ describe('when called with a summation reducer', () => {
4
+ let reducer: jest.Mock<number, [number, string]>;
5
+ let actual: number;
6
+
7
+ beforeEach(() => {
8
+ reducer = jest.fn((intermediate, value) => intermediate + +value);
9
+ actual = reduceIterable(['1', '2', '3'].values(), reducer, 100);
10
+ });
11
+
12
+ test('should return summation', () => expect(actual).toBe(106));
13
+ test('should have called reducer 3 times', () => expect(reducer).toHaveBeenCalledTimes(3));
14
+ test("should have called reducer with (100, '1')", () => expect(reducer).toHaveBeenNthCalledWith(1, 100, '1'));
15
+ test("should have called reducer with (101, '2')", () => expect(reducer).toHaveBeenNthCalledWith(2, 101, '2'));
16
+ test("should have called reducer with (103, '3')", () => expect(reducer).toHaveBeenNthCalledWith(3, 103, '3'));
17
+ });
18
+
19
+ describe('when called with an empty array', () => {
20
+ let reducer: jest.Mock<number, [number, string]>;
21
+ let actual: number;
22
+
23
+ beforeEach(() => {
24
+ reducer = jest.fn();
25
+ actual = reduceIterable([].values(), reducer, 100);
26
+ });
27
+
28
+ test('should return initial value', () => expect(actual).toBe(100));
29
+ });
@@ -0,0 +1,13 @@
1
+ export default function reduceIterable<T, U>(
2
+ iterable: Iterable<T>,
3
+ reducer: (intermediate: U, item: T) => U,
4
+ initial: U
5
+ ): U {
6
+ let intermediate = initial;
7
+
8
+ for (const item of iterable) {
9
+ intermediate = reducer(intermediate, item);
10
+ }
11
+
12
+ return intermediate;
13
+ }