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.
- package/decorator.js +3 -0
- package/dist/botframework-webchat-api.d.mts +213 -55
- package/dist/botframework-webchat-api.d.ts +1612 -0
- package/dist/botframework-webchat-api.decorator.d.mts +30 -0
- package/dist/botframework-webchat-api.decorator.d.ts +30 -0
- package/dist/botframework-webchat-api.decorator.js +3 -0
- package/dist/botframework-webchat-api.decorator.js.map +1 -0
- package/dist/botframework-webchat-api.decorator.mjs +3 -0
- package/dist/botframework-webchat-api.decorator.mjs.LEGAL.txt +0 -0
- package/dist/botframework-webchat-api.decorator.mjs.map +1 -0
- package/dist/botframework-webchat-api.internal.d.mts +18 -1
- package/dist/botframework-webchat-api.internal.d.ts +20 -0
- package/dist/botframework-webchat-api.internal.js +3 -0
- package/dist/botframework-webchat-api.internal.js.LEGAL.txt +0 -0
- package/dist/botframework-webchat-api.internal.js.map +1 -0
- package/dist/botframework-webchat-api.internal.mjs +1 -1
- package/dist/botframework-webchat-api.internal.mjs.map +1 -1
- package/dist/botframework-webchat-api.js +3 -0
- package/dist/botframework-webchat-api.js.LEGAL.txt +0 -0
- package/dist/botframework-webchat-api.js.map +1 -0
- package/dist/botframework-webchat-api.mjs +1 -1
- package/dist/botframework-webchat-api.mjs.map +1 -1
- package/dist/chunk-2HABAU7C.mjs +3 -0
- package/dist/chunk-2HABAU7C.mjs.LEGAL.txt +0 -0
- package/dist/chunk-2HABAU7C.mjs.map +1 -0
- package/dist/chunk-45Z2ZE4M.js +3 -0
- package/dist/chunk-45Z2ZE4M.js.LEGAL.txt +0 -0
- package/dist/chunk-45Z2ZE4M.js.map +1 -0
- package/dist/chunk-7K3OK5TS.mjs +3 -0
- package/dist/chunk-7K3OK5TS.mjs.LEGAL.txt +0 -0
- package/dist/chunk-7K3OK5TS.mjs.map +1 -0
- package/dist/chunk-LXPINC7N.js +3 -0
- package/dist/chunk-LXPINC7N.js.LEGAL.txt +0 -0
- package/dist/chunk-LXPINC7N.js.map +1 -0
- package/dist/chunk-PRWGXTDA.mjs +3 -0
- package/dist/chunk-PRWGXTDA.mjs.LEGAL.txt +0 -0
- package/dist/chunk-PRWGXTDA.mjs.map +1 -0
- package/dist/chunk-WH7VSYKK.js +3 -0
- package/dist/chunk-WH7VSYKK.js.LEGAL.txt +0 -0
- package/dist/chunk-WH7VSYKK.js.map +1 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -1
- package/dist/types-BXPldIKA.d.mts +86 -0
- package/dist/types-BXPldIKA.d.ts +86 -0
- package/internal.js +1 -1
- package/package.json +68 -70
- package/src/StyleOptions.ts +123 -4
- package/src/decorator/ActivityBorder/ActivityBorderDecorator.tsx +48 -0
- package/src/decorator/ActivityBorder/private/ActivityBorderDecoratorMiddleware.ts +51 -0
- package/src/decorator/ActivityBorder/types.ts +1 -0
- package/src/decorator/ActivityGrouping/ActivityGroupingDecorator.tsx +31 -0
- package/src/decorator/ActivityGrouping/private/ActivityGroupingDecoratorMiddleware.ts +38 -0
- package/src/decorator/ActivityGrouping/types.ts +1 -0
- package/src/decorator/DecoratorComposer.tsx +22 -0
- package/src/decorator/internal/InternalDecoratorComposer.tsx +61 -0
- package/src/decorator/internal/LowPriorityDecoratorComposer.tsx +19 -0
- package/src/decorator/private/DecoratorComposerContext.ts +16 -0
- package/src/decorator/private/PassthroughFallback.tsx +12 -0
- package/src/decorator/private/templateMiddleware.test.tsx +100 -0
- package/src/decorator/private/templateMiddleware.ts +60 -0
- package/src/decorator/types.ts +15 -0
- package/src/decorator.ts +16 -0
- package/src/defaultStyleOptions.ts +26 -5
- package/{lib/external/PrecompiledGlobalize.cjs → src/external/PrecompiledGlobalize.js} +8 -7
- package/src/hooks/Composer.tsx +75 -53
- package/src/hooks/index.ts +7 -1
- package/src/hooks/internal/SendBoxMiddleware.ts +5 -3
- package/src/hooks/internal/SendBoxToolbarMiddleware.ts +5 -3
- package/src/hooks/internal/Tracker.ts +1 -1
- package/src/hooks/internal/WebChatAPIContext.ts +12 -5
- package/src/hooks/internal/private/templateMiddleware.ts +3 -43
- package/src/hooks/internal/usePrevious.ts +5 -2
- package/src/hooks/middleware/concatMiddleware.spec.js +20 -0
- package/src/hooks/middleware/concatMiddleware.ts +6 -5
- package/src/hooks/private/numberWithInfinity.spec.ts +9 -0
- package/src/hooks/private/numberWithInfinity.ts +15 -0
- package/src/hooks/private/reduceIterable.spec.ts +29 -0
- package/src/hooks/private/reduceIterable.ts +13 -0
- package/src/hooks/useActiveTyping.ts +31 -28
- package/src/hooks/useDisabled.ts +8 -2
- package/src/hooks/useGetActivitiesByKey.ts +3 -0
- package/src/hooks/useSuggestedActions.ts +17 -4
- package/src/hooks/useUIState.ts +18 -0
- package/src/hooks/validation/uiState.parseUIState.spec.ts +21 -0
- package/src/hooks/validation/uiState.ts +10 -0
- package/src/index.ts +4 -4
- package/src/internal.ts +3 -1
- package/src/localization/ar-SA.json +19 -0
- package/src/localization/bg-BG.json +19 -0
- package/src/localization/ca-ES.json +19 -0
- package/src/localization/cs-CZ.json +19 -0
- package/src/localization/da-DK.json +19 -0
- package/src/localization/de-DE.json +19 -0
- package/src/localization/el-GR.json +19 -0
- package/src/localization/en-US.json +20 -2
- package/src/localization/es-ES.json +19 -0
- package/src/localization/et-EE.json +19 -0
- package/src/localization/eu-ES.json +19 -0
- package/src/localization/fi-FI.json +19 -0
- package/src/localization/fr-FR.json +19 -0
- package/src/localization/gl-ES.json +19 -0
- package/src/localization/he-IL.json +20 -1
- package/src/localization/hi-IN.json +19 -0
- package/src/localization/hr-HR.json +19 -0
- package/src/localization/hu-HU.json +19 -0
- package/src/localization/id-ID.json +19 -0
- package/src/localization/it-IT.json +19 -0
- package/src/localization/ja-JP.json +19 -0
- package/src/localization/kk-KZ.json +19 -0
- package/src/localization/ko-KR.json +19 -0
- package/src/localization/lt-LT.json +19 -0
- package/src/localization/lv-LV.json +19 -0
- package/src/localization/ms-MY.json +19 -0
- package/src/localization/nb-NO.json +19 -0
- package/src/localization/nl-NL.json +19 -0
- package/src/localization/pl-PL.json +19 -0
- package/src/localization/pt-BR.json +19 -0
- package/src/localization/pt-PT.json +19 -0
- package/src/localization/ro-RO.json +19 -0
- package/src/localization/ru-RU.json +19 -0
- package/src/localization/sk-SK.json +19 -0
- package/src/localization/sl-SI.json +19 -0
- package/src/localization/sr-Cyrl-CS.json +19 -0
- package/src/localization/sr-Latn-CS.json +19 -0
- package/src/localization/sv-SE.json +19 -0
- package/src/localization/th-TH.json +19 -0
- package/src/localization/tr-TR.json +19 -0
- package/src/localization/uk-UA.json +19 -0
- package/src/localization/vi-VN.json +19 -0
- package/src/localization/zh-CN.json +21 -2
- package/src/localization/zh-HK.json +19 -0
- package/src/localization/zh-TW.json +19 -0
- package/src/normalizeStyleOptions.ts +45 -0
- package/src/providers/ActivityAcknowledgement/useLastReadActivityKey.ts +1 -1
- package/src/providers/ActivityKeyer/ActivityKeyerComposer.tsx +50 -30
- package/src/providers/ActivityKeyer/private/Context.ts +2 -1
- package/src/providers/ActivityKeyer/private/lastOf.spec.ts +6 -0
- package/src/providers/ActivityKeyer/private/lastOf.ts +3 -0
- package/src/providers/ActivityKeyer/private/someIterable.spec.ts +44 -0
- package/src/providers/ActivityKeyer/private/someIterable.ts +9 -0
- package/src/providers/ActivityKeyer/useGetActivitiesByKey.ts +7 -0
- package/src/providers/ActivityListener/ActivityListenerComposer.tsx +28 -0
- package/src/providers/ActivityListener/private/Context.tsx +16 -0
- package/src/providers/ActivityListener/private/useContext.ts +6 -0
- package/src/providers/ActivityListener/useUpsertedActivities.ts +6 -0
- package/src/providers/ActivitySendStatus/ActivitySendStatusComposer.tsx +2 -2
- package/src/providers/ActivityTyping/ActivityTypingComposer.tsx +170 -0
- package/src/providers/ActivityTyping/private/Context.ts +16 -0
- package/src/providers/ActivityTyping/private/useContext.ts +6 -0
- package/src/providers/ActivityTyping/private/useMemoWithPrevious.ts +17 -0
- package/src/providers/ActivityTyping/private/useReduceActivities.spec.tsx +231 -0
- package/src/providers/ActivityTyping/private/useReduceActivities.ts +48 -0
- package/src/providers/ActivityTyping/types/AllTyping.ts +8 -0
- package/src/providers/ActivityTyping/useAllTyping.ts +6 -0
- package/src/providers/GroupActivities/GroupActivitiesComposer.tsx +115 -0
- package/src/providers/GroupActivities/private/GroupActivitiesContext.ts +23 -0
- package/src/providers/GroupActivities/private/createDefaultGroupActivitiesMiddleware.ts +93 -0
- package/src/providers/GroupActivities/private/isGroupingValid.ts +41 -0
- package/src/providers/GroupActivities/private/useGroupActivitiesContext.ts +6 -0
- package/src/providers/GroupActivities/useGroupActivities.ts +20 -0
- package/src/providers/GroupActivities/useGroupActivitiesByName.ts +17 -0
- package/src/tsconfig.json +1 -5
- package/src/types/AttachmentForScreenReaderMiddleware.ts +9 -2
- package/src/types/AvatarMiddleware.ts +5 -1
- package/src/types/CardActionMiddleware.ts +2 -0
- package/src/types/ComponentMiddleware.ts +1 -1
- package/src/types/GroupActivitiesMiddleware.ts +7 -11
- package/src/types/Typing.ts +2 -3
- package/src/utils/validateProps.spec.ts +74 -0
- package/src/utils/validateProps.ts +56 -0
- package/dist/chunk-4ZIUY4G5.mjs +0 -3
- package/dist/chunk-4ZIUY4G5.mjs.map +0 -1
- package/lib/StyleOptions.d.ts +0 -697
- package/lib/StyleOptions.d.ts.map +0 -1
- package/lib/StyleOptions.js +0 -2
- package/lib/defaultStyleOptions.d.ts +0 -4
- package/lib/defaultStyleOptions.d.ts.map +0 -1
- package/lib/defaultStyleOptions.js +0 -277
- package/lib/hooks/Composer.d.ts +0 -88
- package/lib/hooks/Composer.d.ts.map +0 -1
- package/lib/hooks/Composer.js +0 -602
- package/lib/hooks/index.d.ts +0 -72
- package/lib/hooks/index.d.ts.map +0 -1
- package/lib/hooks/index.js +0 -497
- package/lib/hooks/internal/ErrorBox.js +0 -47
- package/lib/hooks/internal/SendBoxMiddleware.d.ts +0 -34
- package/lib/hooks/internal/SendBoxMiddleware.d.ts.map +0 -1
- package/lib/hooks/internal/SendBoxMiddleware.js +0 -17
- package/lib/hooks/internal/SendBoxToolbarMiddleware.d.ts +0 -34
- package/lib/hooks/internal/SendBoxToolbarMiddleware.d.ts.map +0 -1
- package/lib/hooks/internal/SendBoxToolbarMiddleware.js +0 -17
- package/lib/hooks/internal/Tracker.d.ts +0 -4
- package/lib/hooks/internal/Tracker.d.ts.map +0 -1
- package/lib/hooks/internal/Tracker.js +0 -15
- package/lib/hooks/internal/WebChatAPIContext.d.ts +0 -80
- package/lib/hooks/internal/WebChatAPIContext.d.ts.map +0 -1
- package/lib/hooks/internal/WebChatAPIContext.js +0 -12
- package/lib/hooks/internal/WebChatReduxContext.js +0 -17
- package/lib/hooks/internal/defaultSelectVoice.js +0 -28
- package/lib/hooks/internal/private/templateMiddleware.d.ts +0 -28
- package/lib/hooks/internal/private/templateMiddleware.d.ts.map +0 -1
- package/lib/hooks/internal/private/templateMiddleware.js +0 -48
- package/lib/hooks/internal/useCreateActivityRendererInternal.d.ts +0 -4
- package/lib/hooks/internal/useCreateActivityRendererInternal.d.ts.map +0 -1
- package/lib/hooks/internal/useCreateActivityRendererInternal.js +0 -37
- package/lib/hooks/internal/useDebugDeps.js +0 -39
- package/lib/hooks/internal/useDirFromProps.js +0 -12
- package/lib/hooks/internal/useErrorBoxClass.js +0 -14
- package/lib/hooks/internal/useForceRender.js +0 -24
- package/lib/hooks/internal/useLocalizedGlobalize.js +0 -12
- package/lib/hooks/internal/useLocalizedStrings.js +0 -14
- package/lib/hooks/internal/useMarkActivity.js +0 -12
- package/lib/hooks/internal/usePrevious.d.ts +0 -2
- package/lib/hooks/internal/usePrevious.d.ts.map +0 -1
- package/lib/hooks/internal/usePrevious.js +0 -15
- package/lib/hooks/internal/useReadTelemetryDimensions.js +0 -20
- package/lib/hooks/internal/useSetDictateState.d.ts +0 -2
- package/lib/hooks/internal/useSetDictateState.d.ts.map +0 -1
- package/lib/hooks/internal/useSetDictateState.js +0 -12
- package/lib/hooks/internal/useTimer.d.ts +0 -5
- package/lib/hooks/internal/useTimer.d.ts.map +0 -1
- package/lib/hooks/internal/useTimer.js +0 -43
- package/lib/hooks/internal/useTracker.js +0 -42
- package/lib/hooks/internal/useValueRef.d.ts +0 -3
- package/lib/hooks/internal/useValueRef.d.ts.map +0 -1
- package/lib/hooks/internal/useValueRef.js +0 -22
- package/lib/hooks/internal/useWebChatAPIContext.d.ts +0 -83
- package/lib/hooks/internal/useWebChatAPIContext.d.ts.map +0 -1
- package/lib/hooks/internal/useWebChatAPIContext.js +0 -17
- package/lib/hooks/middleware/UserlandBoundary.js +0 -48
- package/lib/hooks/middleware/applyMiddleware.js +0 -122
- package/lib/hooks/middleware/concatMiddleware.d.ts +0 -6
- package/lib/hooks/middleware/concatMiddleware.d.ts.map +0 -1
- package/lib/hooks/middleware/concatMiddleware.js +0 -33
- package/lib/hooks/middleware/createDefaultCardActionMiddleware.d.ts +0 -3
- package/lib/hooks/middleware/createDefaultCardActionMiddleware.d.ts.map +0 -1
- package/lib/hooks/middleware/createDefaultCardActionMiddleware.js +0 -43
- package/lib/hooks/middleware/createDefaultGroupActivitiesMiddleware.d.ts +0 -7
- package/lib/hooks/middleware/createDefaultGroupActivitiesMiddleware.d.ts.map +0 -1
- package/lib/hooks/middleware/createDefaultGroupActivitiesMiddleware.js +0 -68
- package/lib/hooks/useActiveTyping.d.ts +0 -6
- package/lib/hooks/useActiveTyping.d.ts.map +0 -1
- package/lib/hooks/useActiveTyping.js +0 -81
- package/lib/hooks/useActivities.d.ts +0 -3
- package/lib/hooks/useActivities.d.ts.map +0 -1
- package/lib/hooks/useActivities.js +0 -14
- package/lib/hooks/useActivityKeys.d.ts +0 -3
- package/lib/hooks/useActivityKeys.d.ts.map +0 -1
- package/lib/hooks/useActivityKeys.js +0 -11
- package/lib/hooks/useActivityKeysByRead.d.ts +0 -3
- package/lib/hooks/useActivityKeysByRead.d.ts.map +0 -1
- package/lib/hooks/useActivityKeysByRead.js +0 -11
- package/lib/hooks/useAvatarForBot.d.ts +0 -5
- package/lib/hooks/useAvatarForBot.d.ts.map +0 -1
- package/lib/hooks/useAvatarForBot.js +0 -26
- package/lib/hooks/useAvatarForUser.d.ts +0 -5
- package/lib/hooks/useAvatarForUser.d.ts.map +0 -1
- package/lib/hooks/useAvatarForUser.js +0 -26
- package/lib/hooks/useByteFormatter.d.ts +0 -2
- package/lib/hooks/useByteFormatter.d.ts.map +0 -1
- package/lib/hooks/useByteFormatter.js +0 -43
- package/lib/hooks/useConnectivityStatus.d.ts +0 -2
- package/lib/hooks/useConnectivityStatus.d.ts.map +0 -1
- package/lib/hooks/useConnectivityStatus.js +0 -14
- package/lib/hooks/useCreateActivityRenderer.d.ts +0 -3
- package/lib/hooks/useCreateActivityRenderer.d.ts.map +0 -1
- package/lib/hooks/useCreateActivityRenderer.js +0 -14
- package/lib/hooks/useCreateActivityStatusRenderer.d.ts +0 -10
- package/lib/hooks/useCreateActivityStatusRenderer.d.ts.map +0 -1
- package/lib/hooks/useCreateActivityStatusRenderer.js +0 -72
- package/lib/hooks/useCreateAttachmentForScreenReaderRenderer.d.ts +0 -3
- package/lib/hooks/useCreateAttachmentForScreenReaderRenderer.d.ts.map +0 -1
- package/lib/hooks/useCreateAttachmentForScreenReaderRenderer.js +0 -12
- package/lib/hooks/useCreateAvatarRenderer.d.ts +0 -6
- package/lib/hooks/useCreateAvatarRenderer.d.ts.map +0 -1
- package/lib/hooks/useCreateAvatarRenderer.js +0 -44
- package/lib/hooks/useCreateScrollToEndButtonRenderer.d.ts +0 -3
- package/lib/hooks/useCreateScrollToEndButtonRenderer.d.ts.map +0 -1
- package/lib/hooks/useCreateScrollToEndButtonRenderer.js +0 -12
- package/lib/hooks/useDateFormatter.d.ts +0 -2
- package/lib/hooks/useDateFormatter.d.ts.map +0 -1
- package/lib/hooks/useDateFormatter.js +0 -35
- package/lib/hooks/useDebouncedNotifications.d.ts +0 -13
- package/lib/hooks/useDebouncedNotifications.d.ts.map +0 -1
- package/lib/hooks/useDebouncedNotifications.js +0 -118
- package/lib/hooks/useDictateInterims.d.ts +0 -2
- package/lib/hooks/useDictateInterims.d.ts.map +0 -1
- package/lib/hooks/useDictateInterims.js +0 -16
- package/lib/hooks/useDictateState.d.ts +0 -2
- package/lib/hooks/useDictateState.d.ts.map +0 -1
- package/lib/hooks/useDictateState.js +0 -15
- package/lib/hooks/useDirection.d.ts +0 -2
- package/lib/hooks/useDirection.d.ts.map +0 -1
- package/lib/hooks/useDirection.js +0 -38
- package/lib/hooks/useDisabled.d.ts +0 -2
- package/lib/hooks/useDisabled.d.ts.map +0 -1
- package/lib/hooks/useDisabled.js +0 -12
- package/lib/hooks/useDismissNotification.d.ts +0 -2
- package/lib/hooks/useDismissNotification.d.ts.map +0 -1
- package/lib/hooks/useDismissNotification.js +0 -12
- package/lib/hooks/useEmitTypingIndicator.d.ts +0 -2
- package/lib/hooks/useEmitTypingIndicator.d.ts.map +0 -1
- package/lib/hooks/useEmitTypingIndicator.js +0 -12
- package/lib/hooks/useGetActivityByKey.d.ts +0 -3
- package/lib/hooks/useGetActivityByKey.d.ts.map +0 -1
- package/lib/hooks/useGetActivityByKey.js +0 -11
- package/lib/hooks/useGetHasAcknowledgedByActivityKey.d.ts +0 -3
- package/lib/hooks/useGetHasAcknowledgedByActivityKey.d.ts.map +0 -1
- package/lib/hooks/useGetHasAcknowledgedByActivityKey.js +0 -11
- package/lib/hooks/useGetKeyByActivity.d.ts +0 -3
- package/lib/hooks/useGetKeyByActivity.d.ts.map +0 -1
- package/lib/hooks/useGetKeyByActivity.js +0 -11
- package/lib/hooks/useGetKeyByActivityId.d.ts +0 -3
- package/lib/hooks/useGetKeyByActivityId.d.ts.map +0 -1
- package/lib/hooks/useGetKeyByActivityId.js +0 -11
- package/lib/hooks/useGetSendTimeoutForActivity.d.ts +0 -5
- package/lib/hooks/useGetSendTimeoutForActivity.d.ts.map +0 -1
- package/lib/hooks/useGetSendTimeoutForActivity.js +0 -33
- package/lib/hooks/useGrammars.d.ts +0 -2
- package/lib/hooks/useGrammars.d.ts.map +0 -1
- package/lib/hooks/useGrammars.js +0 -12
- package/lib/hooks/useGroupActivities.d.ts +0 -8
- package/lib/hooks/useGroupActivities.d.ts.map +0 -1
- package/lib/hooks/useGroupActivities.js +0 -12
- package/lib/hooks/useGroupTimestamp.d.ts +0 -2
- package/lib/hooks/useGroupTimestamp.d.ts.map +0 -1
- package/lib/hooks/useGroupTimestamp.js +0 -21
- package/lib/hooks/useLanguage.d.ts +0 -2
- package/lib/hooks/useLanguage.d.ts.map +0 -1
- package/lib/hooks/useLanguage.js +0 -19
- package/lib/hooks/useLastAcknowledgedActivityKey.d.ts +0 -3
- package/lib/hooks/useLastAcknowledgedActivityKey.d.ts.map +0 -1
- package/lib/hooks/useLastAcknowledgedActivityKey.js +0 -11
- package/lib/hooks/useLastReadActivityKey.d.ts +0 -3
- package/lib/hooks/useLastReadActivityKey.d.ts.map +0 -1
- package/lib/hooks/useLastReadActivityKey.js +0 -11
- package/lib/hooks/useLocalizer.d.ts +0 -13
- package/lib/hooks/useLocalizer.d.ts.map +0 -1
- package/lib/hooks/useLocalizer.js +0 -75
- package/lib/hooks/useMarkActivityAsSpoken.d.ts +0 -3
- package/lib/hooks/useMarkActivityAsSpoken.d.ts.map +0 -1
- package/lib/hooks/useMarkActivityAsSpoken.js +0 -16
- package/lib/hooks/useMarkActivityKeyAsRead.d.ts +0 -3
- package/lib/hooks/useMarkActivityKeyAsRead.d.ts.map +0 -1
- package/lib/hooks/useMarkActivityKeyAsRead.js +0 -11
- package/lib/hooks/useMarkAllAsAcknowledged.d.ts +0 -3
- package/lib/hooks/useMarkAllAsAcknowledged.d.ts.map +0 -1
- package/lib/hooks/useMarkAllAsAcknowledged.js +0 -11
- package/lib/hooks/useNotifications.d.ts +0 -3
- package/lib/hooks/useNotifications.d.ts.map +0 -1
- package/lib/hooks/useNotifications.js +0 -14
- package/lib/hooks/usePerformCardAction.d.ts +0 -3
- package/lib/hooks/usePerformCardAction.d.ts.map +0 -1
- package/lib/hooks/usePerformCardAction.js +0 -12
- package/lib/hooks/usePonyfill.d.ts +0 -3
- package/lib/hooks/usePonyfill.d.ts.map +0 -1
- package/lib/hooks/usePonyfill.js +0 -11
- package/lib/hooks/usePostActivity.d.ts +0 -3
- package/lib/hooks/usePostActivity.d.ts.map +0 -1
- package/lib/hooks/usePostActivity.js +0 -12
- package/lib/hooks/useReferenceGrammarID.d.ts +0 -2
- package/lib/hooks/useReferenceGrammarID.d.ts.map +0 -1
- package/lib/hooks/useReferenceGrammarID.js +0 -14
- package/lib/hooks/useRelativeTimeFormatter.d.ts +0 -2
- package/lib/hooks/useRelativeTimeFormatter.d.ts.map +0 -1
- package/lib/hooks/useRelativeTimeFormatter.js +0 -61
- package/lib/hooks/useRenderAttachment.d.ts +0 -3
- package/lib/hooks/useRenderAttachment.d.ts.map +0 -1
- package/lib/hooks/useRenderAttachment.js +0 -14
- package/lib/hooks/useRenderToast.d.ts +0 -3
- package/lib/hooks/useRenderToast.d.ts.map +0 -1
- package/lib/hooks/useRenderToast.js +0 -12
- package/lib/hooks/useRenderTypingIndicator.d.ts +0 -3
- package/lib/hooks/useRenderTypingIndicator.d.ts.map +0 -1
- package/lib/hooks/useRenderTypingIndicator.js +0 -12
- package/lib/hooks/useSendBoxAttachments.d.ts +0 -6
- package/lib/hooks/useSendBoxAttachments.d.ts.map +0 -1
- package/lib/hooks/useSendBoxAttachments.js +0 -23
- package/lib/hooks/useSendBoxValue.d.ts +0 -2
- package/lib/hooks/useSendBoxValue.d.ts.map +0 -1
- package/lib/hooks/useSendBoxValue.js +0 -16
- package/lib/hooks/useSendEvent.d.ts +0 -2
- package/lib/hooks/useSendEvent.d.ts.map +0 -1
- package/lib/hooks/useSendEvent.js +0 -12
- package/lib/hooks/useSendFiles.d.ts +0 -10
- package/lib/hooks/useSendFiles.d.ts.map +0 -1
- package/lib/hooks/useSendFiles.js +0 -35
- package/lib/hooks/useSendMessage.d.ts +0 -6
- package/lib/hooks/useSendMessage.d.ts.map +0 -1
- package/lib/hooks/useSendMessage.js +0 -33
- package/lib/hooks/useSendMessageBack.d.ts +0 -2
- package/lib/hooks/useSendMessageBack.d.ts.map +0 -1
- package/lib/hooks/useSendMessageBack.js +0 -12
- package/lib/hooks/useSendPostBack.d.ts +0 -2
- package/lib/hooks/useSendPostBack.d.ts.map +0 -1
- package/lib/hooks/useSendPostBack.js +0 -12
- package/lib/hooks/useSendStatusByActivityKey.d.ts +0 -22
- package/lib/hooks/useSendStatusByActivityKey.d.ts.map +0 -1
- package/lib/hooks/useSendStatusByActivityKey.js +0 -31
- package/lib/hooks/useSendTimeoutForActivity.d.ts +0 -4
- package/lib/hooks/useSendTimeoutForActivity.d.ts.map +0 -1
- package/lib/hooks/useSendTimeoutForActivity.js +0 -22
- package/lib/hooks/useSendTypingIndicator.d.ts +0 -2
- package/lib/hooks/useSendTypingIndicator.d.ts.map +0 -1
- package/lib/hooks/useSendTypingIndicator.js +0 -14
- package/lib/hooks/useSetNotification.d.ts +0 -3
- package/lib/hooks/useSetNotification.d.ts.map +0 -1
- package/lib/hooks/useSetNotification.js +0 -12
- package/lib/hooks/useShouldSpeakIncomingActivity.d.ts +0 -2
- package/lib/hooks/useShouldSpeakIncomingActivity.d.ts.map +0 -1
- package/lib/hooks/useShouldSpeakIncomingActivity.js +0 -22
- package/lib/hooks/useStartDictate.d.ts +0 -2
- package/lib/hooks/useStartDictate.d.ts.map +0 -1
- package/lib/hooks/useStartDictate.js +0 -12
- package/lib/hooks/useStopDictate.d.ts +0 -2
- package/lib/hooks/useStopDictate.d.ts.map +0 -1
- package/lib/hooks/useStopDictate.js +0 -12
- package/lib/hooks/useStyleOptions.d.ts +0 -3
- package/lib/hooks/useStyleOptions.d.ts.map +0 -1
- package/lib/hooks/useStyleOptions.js +0 -12
- package/lib/hooks/useSubmitSendBox.d.ts +0 -4
- package/lib/hooks/useSubmitSendBox.d.ts.map +0 -1
- package/lib/hooks/useSubmitSendBox.js +0 -49
- package/lib/hooks/useSuggestedActions.d.ts +0 -3
- package/lib/hooks/useSuggestedActions.d.ts.map +0 -1
- package/lib/hooks/useSuggestedActions.js +0 -25
- package/lib/hooks/useTimeoutForSend.d.ts +0 -3
- package/lib/hooks/useTimeoutForSend.d.ts.map +0 -1
- package/lib/hooks/useTimeoutForSend.js +0 -21
- package/lib/hooks/useTrackDimension.d.ts +0 -2
- package/lib/hooks/useTrackDimension.d.ts.map +0 -1
- package/lib/hooks/useTrackDimension.js +0 -14
- package/lib/hooks/useTrackEvent.d.ts +0 -10
- package/lib/hooks/useTrackEvent.d.ts.map +0 -1
- package/lib/hooks/useTrackEvent.js +0 -51
- package/lib/hooks/useTrackException.d.ts +0 -2
- package/lib/hooks/useTrackException.d.ts.map +0 -1
- package/lib/hooks/useTrackException.js +0 -31
- package/lib/hooks/useTrackTiming.d.ts +0 -2
- package/lib/hooks/useTrackTiming.d.ts.map +0 -1
- package/lib/hooks/useTrackTiming.js +0 -93
- package/lib/hooks/useUserID.d.ts +0 -2
- package/lib/hooks/useUserID.d.ts.map +0 -1
- package/lib/hooks/useUserID.js +0 -12
- package/lib/hooks/useUsername.d.ts +0 -2
- package/lib/hooks/useUsername.d.ts.map +0 -1
- package/lib/hooks/useUsername.js +0 -12
- package/lib/hooks/useVoiceSelector.d.ts +0 -2
- package/lib/hooks/useVoiceSelector.d.ts.map +0 -1
- package/lib/hooks/useVoiceSelector.js +0 -16
- package/lib/hooks/utils/ErrorBoundary.js +0 -68
- package/lib/hooks/utils/observableToPromise.d.ts +0 -3
- package/lib/hooks/utils/observableToPromise.d.ts.map +0 -1
- package/lib/hooks/utils/observableToPromise.js +0 -28
- package/lib/index.d.ts +0 -37
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -88
- package/lib/internal.d.ts +0 -3
- package/lib/internal.d.ts.map +0 -1
- package/lib/internal.js +0 -14
- package/lib/localization/Localize.d.ts +0 -4
- package/lib/localization/Localize.d.ts.map +0 -1
- package/lib/localization/Localize.js +0 -50
- package/lib/localization/ar-EG.json +0 -42
- package/lib/localization/ar-JO.json +0 -45
- package/lib/localization/ar-SA.json +0 -97
- package/lib/localization/bg-BG.json +0 -97
- package/lib/localization/ca-ES.json +0 -97
- package/lib/localization/cs-CZ.json +0 -97
- package/lib/localization/da-DK.json +0 -97
- package/lib/localization/de-DE.json +0 -97
- package/lib/localization/el-GR.json +0 -97
- package/lib/localization/en-US.json +0 -167
- package/lib/localization/es-ES.json +0 -97
- package/lib/localization/et-EE.json +0 -97
- package/lib/localization/eu-ES.json +0 -97
- package/lib/localization/fi-FI.json +0 -97
- package/lib/localization/fr-FR.json +0 -97
- package/lib/localization/getAllLocalizedStrings.d.ts +0 -6
- package/lib/localization/getAllLocalizedStrings.d.ts.map +0 -1
- package/lib/localization/getAllLocalizedStrings.js +0 -117
- package/lib/localization/getRTLList.d.ts +0 -2
- package/lib/localization/getRTLList.d.ts.map +0 -1
- package/lib/localization/getRTLList.js +0 -46
- package/lib/localization/gl-ES.json +0 -97
- package/lib/localization/he-IL.json +0 -97
- package/lib/localization/hi-IN.json +0 -97
- package/lib/localization/hr-HR.json +0 -97
- package/lib/localization/hu-HU.json +0 -97
- package/lib/localization/id-ID.json +0 -97
- package/lib/localization/it-IT.json +0 -97
- package/lib/localization/ja-JP.json +0 -97
- package/lib/localization/kk-KZ.json +0 -97
- package/lib/localization/ko-KR.json +0 -97
- package/lib/localization/lt-LT.json +0 -97
- package/lib/localization/lv-LV.json +0 -97
- package/lib/localization/mergeLocalizedStrings.d.ts +0 -7
- package/lib/localization/mergeLocalizedStrings.d.ts.map +0 -1
- package/lib/localization/mergeLocalizedStrings.js +0 -49
- package/lib/localization/ms-MY.json +0 -97
- package/lib/localization/nb-NO.json +0 -97
- package/lib/localization/nl-NL.json +0 -97
- package/lib/localization/overrides.json +0 -257
- package/lib/localization/pl-PL.json +0 -97
- package/lib/localization/pt-BR.json +0 -97
- package/lib/localization/pt-PT.json +0 -97
- package/lib/localization/ro-RO.json +0 -97
- package/lib/localization/ru-RU.json +0 -97
- package/lib/localization/sk-SK.json +0 -97
- package/lib/localization/sl-SI.json +0 -97
- package/lib/localization/sl-SL.json +0 -3
- package/lib/localization/sr-Cyrl-CS.json +0 -97
- package/lib/localization/sr-Cyrl.json +0 -3
- package/lib/localization/sr-Latn-CS.json +0 -97
- package/lib/localization/sr-Latn.json +0 -3
- package/lib/localization/sv-SE.json +0 -97
- package/lib/localization/th-TH.json +0 -97
- package/lib/localization/tr-TR.json +0 -97
- package/lib/localization/uk-UA.json +0 -97
- package/lib/localization/vi-VN.json +0 -97
- package/lib/localization/yue.json +0 -100
- package/lib/localization/zh-CN.json +0 -97
- package/lib/localization/zh-HK.json +0 -97
- package/lib/localization/zh-TW.json +0 -97
- package/lib/normalizeStyleOptions.d.ts +0 -3
- package/lib/normalizeStyleOptions.d.ts.map +0 -1
- package/lib/normalizeStyleOptions.js +0 -147
- package/lib/patchStyleOptionsFromDeprecatedProps.js +0 -21
- package/lib/providers/ActivityAcknowledgement/ActivityAcknowledgementComposer.d.ts +0 -6
- package/lib/providers/ActivityAcknowledgement/ActivityAcknowledgementComposer.d.ts.map +0 -1
- package/lib/providers/ActivityAcknowledgement/ActivityAcknowledgementComposer.js +0 -153
- package/lib/providers/ActivityAcknowledgement/private/Context.d.ts +0 -13
- package/lib/providers/ActivityAcknowledgement/private/Context.d.ts.map +0 -1
- package/lib/providers/ActivityAcknowledgement/private/Context.js +0 -14
- package/lib/providers/ActivityAcknowledgement/private/useContext.d.ts +0 -3
- package/lib/providers/ActivityAcknowledgement/private/useContext.d.ts.map +0 -1
- package/lib/providers/ActivityAcknowledgement/private/useContext.js +0 -18
- package/lib/providers/ActivityAcknowledgement/useActivityKeysByRead.d.ts +0 -5
- package/lib/providers/ActivityAcknowledgement/useActivityKeysByRead.d.ts.map +0 -1
- package/lib/providers/ActivityAcknowledgement/useActivityKeysByRead.js +0 -15
- package/lib/providers/ActivityAcknowledgement/useGetHasAcknowledgedByActivityKey.d.ts +0 -2
- package/lib/providers/ActivityAcknowledgement/useGetHasAcknowledgedByActivityKey.d.ts.map +0 -1
- package/lib/providers/ActivityAcknowledgement/useGetHasAcknowledgedByActivityKey.js +0 -12
- package/lib/providers/ActivityAcknowledgement/useLastAcknowledgedActivityKey.d.ts +0 -2
- package/lib/providers/ActivityAcknowledgement/useLastAcknowledgedActivityKey.d.ts.map +0 -1
- package/lib/providers/ActivityAcknowledgement/useLastAcknowledgedActivityKey.js +0 -12
- package/lib/providers/ActivityAcknowledgement/useLastReadActivityKey.d.ts +0 -2
- package/lib/providers/ActivityAcknowledgement/useLastReadActivityKey.d.ts.map +0 -1
- package/lib/providers/ActivityAcknowledgement/useLastReadActivityKey.js +0 -12
- package/lib/providers/ActivityAcknowledgement/useMarkActivityKeyAsRead.d.ts +0 -2
- package/lib/providers/ActivityAcknowledgement/useMarkActivityKeyAsRead.d.ts.map +0 -1
- package/lib/providers/ActivityAcknowledgement/useMarkActivityKeyAsRead.js +0 -12
- package/lib/providers/ActivityAcknowledgement/useMarkAllAsAcknowledged.d.ts +0 -2
- package/lib/providers/ActivityAcknowledgement/useMarkAllAsAcknowledged.d.ts.map +0 -1
- package/lib/providers/ActivityAcknowledgement/useMarkAllAsAcknowledged.js +0 -12
- package/lib/providers/ActivityKeyer/ActivityKeyerComposer.d.ts +0 -20
- package/lib/providers/ActivityKeyer/ActivityKeyerComposer.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/ActivityKeyerComposer.js +0 -119
- package/lib/providers/ActivityKeyer/private/Context.d.ts +0 -12
- package/lib/providers/ActivityKeyer/private/Context.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/private/Context.js +0 -10
- package/lib/providers/ActivityKeyer/private/getActivityId.d.ts +0 -3
- package/lib/providers/ActivityKeyer/private/getActivityId.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/private/getActivityId.js +0 -10
- package/lib/providers/ActivityKeyer/private/getClientActivityId.d.ts +0 -3
- package/lib/providers/ActivityKeyer/private/getClientActivityId.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/private/getClientActivityId.js +0 -11
- package/lib/providers/ActivityKeyer/private/uniqueId.d.ts +0 -2
- package/lib/providers/ActivityKeyer/private/uniqueId.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/private/uniqueId.js +0 -15
- package/lib/providers/ActivityKeyer/private/useContext.d.ts +0 -3
- package/lib/providers/ActivityKeyer/private/useContext.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/private/useContext.js +0 -18
- package/lib/providers/ActivityKeyer/useActivityKeys.d.ts +0 -2
- package/lib/providers/ActivityKeyer/useActivityKeys.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/useActivityKeys.js +0 -12
- package/lib/providers/ActivityKeyer/useGetActivityByKey.d.ts +0 -3
- package/lib/providers/ActivityKeyer/useGetActivityByKey.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/useGetActivityByKey.js +0 -12
- package/lib/providers/ActivityKeyer/useGetKeyByActivity.d.ts +0 -3
- package/lib/providers/ActivityKeyer/useGetKeyByActivity.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/useGetKeyByActivity.js +0 -12
- package/lib/providers/ActivityKeyer/useGetKeyByActivityId.d.ts +0 -2
- package/lib/providers/ActivityKeyer/useGetKeyByActivityId.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/useGetKeyByActivityId.js +0 -12
- package/lib/providers/ActivitySendStatus/ActivitySendStatusComposer.d.ts +0 -4
- package/lib/providers/ActivitySendStatus/ActivitySendStatusComposer.d.ts.map +0 -1
- package/lib/providers/ActivitySendStatus/ActivitySendStatusComposer.js +0 -149
- package/lib/providers/ActivitySendStatus/private/Context.d.ts +0 -9
- package/lib/providers/ActivitySendStatus/private/Context.d.ts.map +0 -1
- package/lib/providers/ActivitySendStatus/private/Context.js +0 -13
- package/lib/providers/ActivitySendStatus/private/isMapEqual.d.ts +0 -7
- package/lib/providers/ActivitySendStatus/private/isMapEqual.d.ts.map +0 -1
- package/lib/providers/ActivitySendStatus/private/isMapEqual.js +0 -55
- package/lib/providers/ActivitySendStatus/private/useContext.d.ts +0 -3
- package/lib/providers/ActivitySendStatus/private/useContext.d.ts.map +0 -1
- package/lib/providers/ActivitySendStatus/private/useContext.js +0 -18
- package/lib/providers/ActivitySendStatus/useSendStatusByActivityKey.d.ts +0 -22
- package/lib/providers/ActivitySendStatus/useSendStatusByActivityKey.d.ts.map +0 -1
- package/lib/providers/ActivitySendStatus/useSendStatusByActivityKey.js +0 -31
- package/lib/providers/ActivitySendStatusTelemetry/ActivitySendStatusTelemetryComposer.d.ts +0 -3
- package/lib/providers/ActivitySendStatusTelemetry/ActivitySendStatusTelemetryComposer.d.ts.map +0 -1
- package/lib/providers/ActivitySendStatusTelemetry/ActivitySendStatusTelemetryComposer.js +0 -71
- package/lib/providers/Ponyfill/PonyfillComposer.d.ts +0 -17
- package/lib/providers/Ponyfill/PonyfillComposer.d.ts.map +0 -1
- package/lib/providers/Ponyfill/PonyfillComposer.js +0 -87
- package/lib/providers/Ponyfill/private/PonyfillContext.d.ts +0 -8
- package/lib/providers/Ponyfill/private/PonyfillContext.d.ts.map +0 -1
- package/lib/providers/Ponyfill/private/PonyfillContext.js +0 -10
- package/lib/providers/Ponyfill/private/useContext.d.ts +0 -6
- package/lib/providers/Ponyfill/private/useContext.d.ts.map +0 -1
- package/lib/providers/Ponyfill/private/useContext.js +0 -17
- package/lib/providers/Ponyfill/usePonyfill.d.ts +0 -3
- package/lib/providers/Ponyfill/usePonyfill.d.ts.map +0 -1
- package/lib/providers/Ponyfill/usePonyfill.js +0 -12
- package/lib/tsconfig.json +0 -18
- package/lib/types/ActivityMiddleware.d.ts +0 -24
- package/lib/types/ActivityMiddleware.d.ts.map +0 -1
- package/lib/types/ActivityMiddleware.js +0 -2
- package/lib/types/ActivityStatusMiddleware.d.ts +0 -17
- package/lib/types/ActivityStatusMiddleware.d.ts.map +0 -1
- package/lib/types/ActivityStatusMiddleware.js +0 -2
- package/lib/types/AttachmentForScreenReaderMiddleware.d.ts +0 -14
- package/lib/types/AttachmentForScreenReaderMiddleware.d.ts.map +0 -1
- package/lib/types/AttachmentForScreenReaderMiddleware.js +0 -2
- package/lib/types/AttachmentMiddleware.d.ts +0 -12
- package/lib/types/AttachmentMiddleware.d.ts.map +0 -1
- package/lib/types/AttachmentMiddleware.js +0 -2
- package/lib/types/AvatarMiddleware.d.ts +0 -15
- package/lib/types/AvatarMiddleware.d.ts.map +0 -1
- package/lib/types/AvatarMiddleware.js +0 -2
- package/lib/types/CardActionMiddleware.d.ts +0 -19
- package/lib/types/CardActionMiddleware.d.ts.map +0 -1
- package/lib/types/CardActionMiddleware.js +0 -2
- package/lib/types/ComponentMiddleware.d.ts +0 -31
- package/lib/types/ComponentMiddleware.d.ts.map +0 -1
- package/lib/types/ComponentMiddleware.js +0 -2
- package/lib/types/ContextOf.d.ts +0 -4
- package/lib/types/ContextOf.d.ts.map +0 -1
- package/lib/types/ContextOf.js +0 -2
- package/lib/types/FunctionMiddleware.d.ts +0 -6
- package/lib/types/FunctionMiddleware.d.ts.map +0 -1
- package/lib/types/FunctionMiddleware.js +0 -2
- package/lib/types/GroupActivitiesMiddleware.d.ts +0 -22
- package/lib/types/GroupActivitiesMiddleware.d.ts.map +0 -1
- package/lib/types/GroupActivitiesMiddleware.js +0 -2
- package/lib/types/LocalizedStrings.d.ts +0 -5
- package/lib/types/LocalizedStrings.d.ts.map +0 -1
- package/lib/types/LocalizedStrings.js +0 -2
- package/lib/types/Notification.d.ts +0 -10
- package/lib/types/Notification.d.ts.map +0 -1
- package/lib/types/Notification.js +0 -2
- package/lib/types/PrecompiledGlobalize.d.ts +0 -13
- package/lib/types/PrecompiledGlobalize.d.ts.map +0 -1
- package/lib/types/PrecompiledGlobalize.js +0 -2
- package/lib/types/ScrollToEndButtonMiddleware.d.ts +0 -30
- package/lib/types/ScrollToEndButtonMiddleware.d.ts.map +0 -1
- package/lib/types/ScrollToEndButtonMiddleware.js +0 -2
- package/lib/types/SendStatus.d.ts +0 -3
- package/lib/types/SendStatus.d.ts.map +0 -1
- package/lib/types/SendStatus.js +0 -2
- package/lib/types/TelemetryMeasurementEvent.d.ts +0 -31
- package/lib/types/TelemetryMeasurementEvent.d.ts.map +0 -1
- package/lib/types/TelemetryMeasurementEvent.js +0 -2
- package/lib/types/ToastMiddleware.d.ts +0 -11
- package/lib/types/ToastMiddleware.d.ts.map +0 -1
- package/lib/types/ToastMiddleware.js +0 -2
- package/lib/types/Typing.d.ts +0 -8
- package/lib/types/Typing.d.ts.map +0 -1
- package/lib/types/Typing.js +0 -2
- package/lib/types/TypingIndicatorMiddleware.d.ts +0 -17
- package/lib/types/TypingIndicatorMiddleware.d.ts.map +0 -1
- package/lib/types/TypingIndicatorMiddleware.js +0 -2
- package/lib/types/WebSpeechPonyfill.d.ts +0 -19
- package/lib/types/WebSpeechPonyfill.d.ts.map +0 -1
- package/lib/types/WebSpeechPonyfill.js +0 -2
- package/lib/types/WebSpeechPonyfillFactory.d.ts +0 -6
- package/lib/types/WebSpeechPonyfillFactory.d.ts.map +0 -1
- package/lib/types/WebSpeechPonyfillFactory.js +0 -2
- package/lib/utils/createCustomEvent.d.ts +0 -4
- package/lib/utils/createCustomEvent.d.ts.map +0 -1
- package/lib/utils/createCustomEvent.js +0 -34
- package/lib/utils/findLastIndex.d.ts +0 -2
- package/lib/utils/findLastIndex.d.ts.map +0 -1
- package/lib/utils/findLastIndex.js +0 -22
- package/lib/utils/findMin.d.ts +0 -7
- package/lib/utils/findMin.d.ts.map +0 -1
- package/lib/utils/findMin.js +0 -46
- package/lib/utils/freezeArray.d.ts +0 -8
- package/lib/utils/freezeArray.d.ts.map +0 -1
- package/lib/utils/freezeArray.js +0 -19
- package/lib/utils/isObject.js +0 -12
- package/lib/utils/mapMap.d.ts +0 -6
- package/lib/utils/mapMap.d.ts.map +0 -1
- package/lib/utils/mapMap.js +0 -27
- package/lib/utils/normalizeLanguage.d.ts +0 -2
- package/lib/utils/normalizeLanguage.d.ts.map +0 -1
- package/lib/utils/normalizeLanguage.js +0 -115
- package/lib/utils/randomId.d.ts +0 -2
- package/lib/utils/randomId.d.ts.map +0 -1
- package/lib/utils/randomId.js +0 -15
- package/lib/utils/warnOnce.d.ts +0 -2
- package/lib/utils/warnOnce.d.ts.map +0 -1
- package/lib/utils/warnOnce.js +0 -16
- package/src/external/PrecompiledGlobalize.cjs +0 -8855
- package/src/hooks/middleware/createDefaultGroupActivitiesMiddleware.ts +0 -75
- package/src/hooks/useGroupActivities.ts +0 -10
- /package/dist/{chunk-4ZIUY4G5.mjs.LEGAL.txt → botframework-webchat-api.decorator.js.LEGAL.txt} +0 -0
package/src/hooks/Composer.tsx
CHANGED
|
@@ -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 {
|
|
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
|
|
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:
|
|
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<
|
|
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?:
|
|
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
|
-
[
|
|
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<
|
|
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
|
-
<
|
|
593
|
-
<
|
|
594
|
-
<
|
|
595
|
-
{
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
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
|
-
|
|
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
|
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -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 '
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19
|
+
initSendBoxToolbarMiddleware,
|
|
18
20
|
type SendBoxToolbarMiddleware,
|
|
19
21
|
type SendBoxToolbarMiddlewareProps,
|
|
20
22
|
type SendBoxToolbarMiddlewareRequest
|
|
@@ -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
|
|
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?:
|
|
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<
|
|
98
|
+
const context = createContext<WebChatAPIContextType>(undefined);
|
|
92
99
|
|
|
93
100
|
context.displayName = 'WebChatAPIContext';
|
|
94
101
|
|
|
@@ -1,44 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
+
}
|