botframework-webchat-api 4.18.2 → 4.19.1-main.20260526.b9ad8fa
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/LICENSE +21 -0
- package/boot/deprecated/decorator.js +7 -0
- package/boot/deprecated/decorator.mjs +5 -0
- package/boot/deprecated/graph.js +7 -0
- package/boot/deprecated/graph.mjs +5 -0
- package/boot/deprecated/hook.js +7 -0
- package/boot/deprecated/hook.mjs +5 -0
- package/boot/deprecated/internal.js +7 -0
- package/boot/deprecated/internal.mjs +5 -0
- package/boot/deprecated/middleware.js +7 -0
- package/boot/deprecated/middleware.mjs +5 -0
- package/decorator.js +1 -1
- package/dist/StyleOptions-4TkRjGbQ.d.mts +802 -0
- package/dist/StyleOptions-4TkRjGbQ.d.ts +802 -0
- package/dist/_dtsroll-chunks/B1b7R2eH-avatarMiddleware-CHa011_j.d.ts +109 -0
- package/dist/_dtsroll-chunks/CEcj2Npa-botframework-webchat-redux-store.d.ts +16 -0
- package/dist/_dtsroll-chunks/DnThgHcF-botframework-webchat-api-middleware.d.ts +231 -0
- package/dist/_dtsroll-chunks/Dtb0H_Ee-handler-chain.d.ts +4 -0
- package/dist/_dtsroll-chunks/N-ttGLxs-botframework-webchat-base.utils.d.ts +4 -0
- package/dist/_dtsroll-chunks/qKTV3q17-avatarMiddleware-CHa011_j.d.ts +93 -0
- package/dist/botframework-webchat-api.d.mts +173 -1250
- package/dist/botframework-webchat-api.d.ts +387 -0
- package/dist/botframework-webchat-api.decorator.d.mts +71 -26
- package/dist/botframework-webchat-api.decorator.d.ts +81 -0
- package/dist/botframework-webchat-api.decorator.js +2 -0
- package/dist/botframework-webchat-api.decorator.js.map +1 -0
- package/dist/botframework-webchat-api.decorator.mjs +1 -2
- package/dist/botframework-webchat-api.decorator.mjs.map +1 -1
- package/dist/botframework-webchat-api.graph.d.mts +5 -0
- package/dist/botframework-webchat-api.graph.d.ts +2 -0
- package/dist/botframework-webchat-api.graph.js +2 -0
- package/dist/botframework-webchat-api.graph.js.map +1 -0
- package/dist/botframework-webchat-api.graph.mjs +2 -0
- package/dist/botframework-webchat-api.hook.d.mts +9 -0
- package/dist/botframework-webchat-api.hook.d.ts +9 -0
- package/dist/botframework-webchat-api.hook.js +2 -0
- package/dist/botframework-webchat-api.hook.js.map +1 -0
- package/dist/botframework-webchat-api.hook.mjs +2 -0
- package/dist/botframework-webchat-api.hook.mjs.map +1 -0
- package/dist/botframework-webchat-api.internal.d.mts +66 -1
- package/dist/botframework-webchat-api.internal.d.ts +68 -0
- package/dist/botframework-webchat-api.internal.js +2 -0
- package/dist/botframework-webchat-api.internal.js.map +1 -0
- package/dist/botframework-webchat-api.internal.mjs +1 -2
- package/dist/botframework-webchat-api.internal.mjs.map +1 -1
- package/dist/botframework-webchat-api.js +2 -0
- package/dist/botframework-webchat-api.js.map +1 -0
- package/dist/botframework-webchat-api.middleware.d.mts +45 -0
- package/dist/botframework-webchat-api.middleware.d.ts +45 -0
- package/dist/botframework-webchat-api.middleware.js +2 -0
- package/dist/botframework-webchat-api.middleware.js.map +1 -0
- package/dist/botframework-webchat-api.middleware.mjs +2 -0
- package/dist/botframework-webchat-api.middleware.mjs.map +1 -0
- package/dist/botframework-webchat-api.mjs +1 -139
- package/dist/botframework-webchat-api.mjs.LEGAL.txt +2 -27
- package/dist/botframework-webchat-api.mjs.map +1 -1
- package/dist/chunk-3YCFZWVR.js +2 -0
- package/dist/chunk-3YCFZWVR.js.map +1 -0
- package/dist/chunk-42OUJPJV.js +2 -0
- package/dist/chunk-42OUJPJV.js.map +1 -0
- package/dist/chunk-5HALOM2E.mjs +2 -0
- package/dist/chunk-5HALOM2E.mjs.map +1 -0
- package/dist/chunk-5JETBPYY.mjs +2 -0
- package/dist/chunk-5JETBPYY.mjs.map +1 -0
- package/dist/chunk-5X4VJZOM.js +2 -0
- package/dist/chunk-5X4VJZOM.js.map +1 -0
- package/dist/chunk-62M3VAKR.js +2 -0
- package/dist/chunk-62M3VAKR.js.map +1 -0
- package/dist/chunk-7GV72C4W.js +2 -0
- package/dist/chunk-7GV72C4W.js.map +1 -0
- package/dist/chunk-A6GQOZT3.js +2 -0
- package/dist/chunk-A6GQOZT3.js.map +1 -0
- package/dist/chunk-BWPBSJNH.js +2 -0
- package/dist/chunk-BWPBSJNH.js.map +1 -0
- package/dist/chunk-CIL5QUZ4.js +2 -0
- package/dist/chunk-CIL5QUZ4.js.map +1 -0
- package/dist/chunk-EVD4K5QH.mjs +2 -0
- package/dist/chunk-EVD4K5QH.mjs.map +1 -0
- package/dist/chunk-FA2GLWPN.mjs +2 -0
- package/dist/chunk-FA2GLWPN.mjs.map +1 -0
- package/dist/chunk-FD7QXXVX.js +2 -0
- package/dist/chunk-FD7QXXVX.js.map +1 -0
- package/dist/chunk-G5ZR6XJL.js +2 -0
- package/dist/chunk-G5ZR6XJL.js.map +1 -0
- package/dist/chunk-JKWDQH6P.mjs +2 -0
- package/dist/chunk-JKWDQH6P.mjs.map +1 -0
- package/dist/chunk-L5VFUNB4.js +2 -0
- package/dist/chunk-L5VFUNB4.js.map +1 -0
- package/dist/chunk-LIZ64UIL.mjs +2 -0
- package/dist/chunk-LIZ64UIL.mjs.map +1 -0
- package/dist/chunk-LW6LHF6Z.mjs +2 -0
- package/dist/chunk-LW6LHF6Z.mjs.map +1 -0
- package/dist/chunk-MMNBOGJJ.mjs +2 -0
- package/dist/chunk-MMNBOGJJ.mjs.map +1 -0
- package/dist/chunk-RLEJOP6E.mjs +2 -0
- package/dist/chunk-RLEJOP6E.mjs.map +1 -0
- package/dist/chunk-UK6V7R7K.js +2 -0
- package/dist/chunk-UK6V7R7K.js.map +1 -0
- package/dist/{chunk-J6D5YEY6.mjs → chunk-VAX7AB37.mjs} +1 -2
- package/dist/chunk-VAX7AB37.mjs.map +1 -0
- package/dist/chunk-VNGDFILB.mjs +2 -0
- package/dist/chunk-VNGDFILB.mjs.map +1 -0
- package/dist/chunk-XVCIEKX5.mjs +2 -0
- package/dist/chunk-XVCIEKX5.mjs.map +1 -0
- package/dist/hook-BXcgekzo.d.mts +536 -0
- package/dist/hook-C8NHjp6P.d.ts +536 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -1
- package/dist/templateMiddleware-BEttHPJk.d.mts +20 -0
- package/dist/templateMiddleware-BEttHPJk.d.ts +20 -0
- package/dist/types-BKuj7f2p.d.ts +228 -0
- package/dist/types-BZzd7aAk.d.mts +228 -0
- package/graph.js +3 -0
- package/hook.js +3 -0
- package/internal.js +1 -1
- package/middleware.js +3 -0
- package/package.json +158 -90
- package/src/StyleOptions.ts +400 -285
- package/src/__tests__/addMetaTag.spec.js +9 -0
- package/src/__tests__/addMetaTag.spec.mjs +9 -0
- package/src/boot/decorator.ts +21 -0
- package/src/boot/graph.ts +1 -0
- package/src/boot/hook.ts +82 -0
- package/src/boot/internal.ts +7 -0
- package/src/boot/middleware.ts +60 -0
- package/src/buildInfo.ts +9 -0
- package/src/decorator/ActivityBorder/ActivityBorderDecorator.tsx +57 -0
- package/src/decorator/ActivityBorder/private/ActivityBorderDecoratorMiddleware.ts +34 -0
- package/src/decorator/ActivityBorder/private/ActivityBorderDecoratorRequestContext.ts +48 -0
- package/src/decorator/ActivityGrouping/ActivityGroupingDecorator.tsx +43 -0
- package/src/decorator/ActivityGrouping/private/ActivityGroupingDecoratorMiddleware.ts +40 -0
- package/src/decorator/DecoratorComposer.tsx +51 -0
- package/src/decorator/internal/InternalDecoratorComposer.tsx +33 -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/templateDecorator.tsx +113 -0
- package/src/decorator/types.ts +4 -0
- package/src/decorator/useDecoratorRequest.ts +15 -0
- package/src/defaultStyleOptions.ts +40 -23
- package/src/env.d.ts +9 -0
- package/src/errorBox/errorBoxTelemetryPolymiddleware.ts +53 -0
- package/src/hooks/Composer.tsx +204 -142
- package/src/hooks/index.ts +19 -2
- package/src/hooks/internal/Tracker.ts +1 -1
- package/src/hooks/internal/WebChatAPIContext.ts +7 -12
- package/src/hooks/internal/WebChatReduxContext.js +3 -2
- package/src/hooks/internal/usePostVoiceActivity.ts +18 -0
- package/src/hooks/internal/useRegisterVoiceHandler.ts +23 -0
- package/src/hooks/internal/useShouldShowMicrophoneButton.ts +22 -0
- package/src/hooks/internal/useVoiceHandlers.ts +11 -0
- package/src/hooks/internal/useVoiceStateWritable.ts +18 -0
- package/src/hooks/middleware/UserlandBoundary.js +2 -2
- package/src/hooks/middleware/activityFallbackPolymiddleware.ts +23 -0
- package/src/hooks/middleware/applyMiddleware.js +5 -5
- package/src/hooks/middleware/concatMiddleware.spec.js +20 -0
- package/src/hooks/middleware/concatMiddleware.ts +7 -6
- package/src/hooks/private/reduceIterable.spec.ts +0 -2
- package/src/hooks/useActiveTyping.ts +3 -2
- package/src/hooks/useActivities.ts +62 -3
- package/src/hooks/useCreateActivityRenderer.ts +27 -6
- package/src/hooks/useCreateActivityStatusRenderer.tsx +13 -33
- package/src/hooks/useCreateAvatarRenderer.ts +19 -33
- package/src/hooks/useDebouncedNotifications.spec.js +1 -0
- package/src/hooks/useDisabled.ts +8 -2
- package/src/hooks/useLocalizer.ts +3 -3
- package/src/hooks/useRenderAttachment.ts +2 -2
- package/src/hooks/useSendBoxAttachments.ts +2 -0
- package/src/hooks/useSendFiles.ts +1 -1
- package/src/hooks/useSendTimeoutForActivity.ts +2 -0
- package/src/hooks/useStartVoice.ts +9 -0
- package/src/hooks/useStopVoice.ts +9 -0
- package/src/hooks/useStyleOptions.ts +1 -6
- package/src/hooks/useSuggestedActions.ts +9 -23
- package/src/hooks/useTrackEvent.ts +3 -3
- package/src/hooks/useUIState.ts +18 -0
- package/src/hooks/useVoiceRecordingMuted.ts +24 -0
- package/src/hooks/useVoiceState.ts +15 -0
- package/src/hooks/validation/uiState.parseUIState.spec.ts +21 -0
- package/src/hooks/validation/uiState.ts +10 -0
- package/src/index.ts +52 -94
- package/src/legacy/LegacyActivityBridge.tsx +77 -0
- package/src/legacy/LegacyActivityBridgeContext.ts +23 -0
- package/src/legacy/createActivityPolymiddlewareFromLegacy.tsx +123 -0
- package/src/legacy/createAvatarPolymiddlewareFromLegacy.tsx +102 -0
- package/src/localization/ar-SA.json +134 -111
- package/src/localization/bg-BG.json +134 -111
- package/src/localization/ca-ES.json +134 -111
- package/src/localization/cs-CZ.json +134 -111
- package/src/localization/da-DK.json +134 -111
- package/src/localization/de-DE.json +134 -111
- package/src/localization/el-GR.json +134 -111
- package/src/localization/en-US.json +45 -19
- package/src/localization/es-ES.json +134 -111
- package/src/localization/et-EE.json +134 -111
- package/src/localization/eu-ES.json +134 -111
- package/src/localization/fi-FI.json +134 -111
- package/src/localization/fr-FR.json +134 -111
- package/src/localization/gl-ES.json +134 -111
- package/src/localization/he-IL.json +134 -111
- package/src/localization/hi-IN.json +134 -111
- package/src/localization/hr-HR.json +134 -111
- package/src/localization/hu-HU.json +134 -111
- package/src/localization/id-ID.json +134 -111
- package/src/localization/it-IT.json +134 -111
- package/src/localization/ja-JP.json +134 -111
- package/src/localization/kk-KZ.json +134 -111
- package/src/localization/ko-KR.json +134 -111
- package/src/localization/lt-LT.json +134 -111
- package/src/localization/lv-LV.json +134 -111
- package/src/localization/ms-MY.json +134 -111
- package/src/localization/nb-NO.json +134 -111
- package/src/localization/nl-NL.json +134 -111
- package/src/localization/pl-PL.json +134 -111
- package/src/localization/pt-BR.json +134 -111
- package/src/localization/pt-PT.json +134 -111
- package/src/localization/ro-RO.json +134 -111
- package/src/localization/ru-RU.json +134 -111
- package/src/localization/sk-SK.json +134 -111
- package/src/localization/sl-SI.json +134 -111
- package/src/localization/sr-Cyrl-CS.json +134 -111
- package/src/localization/sr-Latn-CS.json +134 -111
- package/src/localization/sv-SE.json +134 -111
- package/src/localization/th-TH.json +134 -111
- package/src/localization/tr-TR.json +134 -111
- package/src/localization/uk-UA.json +134 -111
- package/src/localization/vi-VN.json +134 -111
- package/src/localization/yue.json +5 -16
- package/src/localization/zh-CN.json +134 -111
- package/src/localization/zh-HK.json +134 -111
- package/src/localization/zh-TW.json +134 -111
- package/src/middleware/AvatarPolymiddlewareProxy.tsx +46 -0
- package/src/middleware/SendBoxMiddleware.ts +28 -0
- package/src/middleware/SendBoxToolbarMiddleware.ts +28 -0
- package/src/middleware/private/templateMiddleware.check.test.tsx +47 -0
- package/src/{decorator → middleware}/private/templateMiddleware.test.tsx +19 -17
- package/src/middleware/private/templateMiddleware.tsx +106 -0
- package/src/middleware/useBuildRenderAvatarCallback.ts +37 -0
- package/src/normalizeStyleOptions.ts +51 -76
- package/src/providers/ActivityKeyer/ActivityKeyerComposer.tsx +197 -40
- package/src/providers/ActivityKeyer/private/someIterable.spec.ts +0 -2
- package/src/providers/ActivityListener/ActivityListenerComposer.tsx +1 -1
- package/src/providers/ActivitySendStatus/ActivitySendStatusComposer.tsx +6 -3
- package/src/providers/ActivityTyping/ActivityTypingComposer.tsx +145 -59
- package/src/providers/ActivityTyping/private/useReduceActivities.spec.tsx +236 -0
- package/src/providers/ActivityTyping/private/useReduceActivities.ts +49 -0
- package/src/providers/Capabilities/CapabilitiesComposer.tsx +53 -0
- package/src/providers/Capabilities/private/Context.ts +13 -0
- package/src/providers/Capabilities/private/capabilityRegistry.ts +45 -0
- package/src/providers/Capabilities/private/fetchCapabilitiesFromAdapter.ts +59 -0
- package/src/providers/Capabilities/private/shallowEqual.ts +18 -0
- package/src/providers/Capabilities/private/useContext.ts +12 -0
- package/src/providers/Capabilities/types/Capabilities.ts +16 -0
- package/src/providers/Capabilities/useCapabilities.ts +25 -0
- package/src/providers/GroupActivities/GroupActivitiesComposer.tsx +116 -0
- package/src/providers/GroupActivities/private/GroupActivitiesContext.ts +23 -0
- package/src/providers/GroupActivities/private/createDefaultGroupActivitiesMiddleware.ts +113 -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/providers/SpeechToSpeech/SpeechToSpeechComposer.tsx +20 -0
- package/src/providers/SpeechToSpeech/private/VoiceHandlerBridge.tsx +23 -0
- package/src/providers/SpeechToSpeech/private/VoiceRecorderBridge.tsx +49 -0
- package/src/providers/SpeechToSpeech/private/useAudioPlayer.spec.tsx +355 -0
- package/src/providers/SpeechToSpeech/private/useAudioPlayer.ts +92 -0
- package/src/providers/SpeechToSpeech/private/useRecorder.spec.tsx +344 -0
- package/src/providers/SpeechToSpeech/private/useRecorder.ts +220 -0
- package/src/providers/StyleOptions/StyleOptionsComposer.tsx +46 -0
- package/src/providers/StyleOptions/private/StyleOptionsContext.ts +20 -0
- package/src/providers/StyleOptions/private/rectifyStyleOptions.ts +6 -0
- package/src/providers/StyleOptions/useStyleOptions.ts +6 -0
- package/src/tsconfig.json +5 -14
- package/src/types/ActivityStatusMiddleware.ts +1 -9
- package/src/types/AttachmentForScreenReaderMiddleware.ts +9 -2
- package/src/types/AvatarMiddleware.ts +12 -1
- package/src/types/CardActionMiddleware.ts +2 -0
- package/src/types/ComponentMiddleware.ts +1 -1
- package/src/types/GroupActivitiesMiddleware.ts +7 -11
- package/dist/botframework-webchat-api.decorator.mjs.LEGAL.txt +0 -0
- package/dist/botframework-webchat-api.internal.mjs.LEGAL.txt +0 -0
- package/dist/chunk-2S76JUVM.mjs +0 -3
- package/dist/chunk-2S76JUVM.mjs.LEGAL.txt +0 -0
- package/dist/chunk-2S76JUVM.mjs.map +0 -1
- package/dist/chunk-J6D5YEY6.mjs.LEGAL.txt +0 -0
- package/dist/chunk-ZAMHKQQC.mjs +0 -3
- package/dist/chunk-ZAMHKQQC.mjs.LEGAL.txt +0 -0
- package/dist/chunk-ZAMHKQQC.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/decorator/index.d.ts +0 -5
- package/lib/decorator/index.d.ts.map +0 -1
- package/lib/decorator/index.js +0 -28
- package/lib/decorator/private/ActivityBorderDecoratorMiddleware.d.ts +0 -27
- package/lib/decorator/private/ActivityBorderDecoratorMiddleware.d.ts.map +0 -1
- package/lib/decorator/private/ActivityBorderDecoratorMiddleware.js +0 -19
- package/lib/decorator/private/ActivityDecorator.d.ts +0 -9
- package/lib/decorator/private/ActivityDecorator.d.ts.map +0 -1
- package/lib/decorator/private/ActivityDecorator.js +0 -36
- package/lib/decorator/private/DecoratorComposer.d.ts +0 -3
- package/lib/decorator/private/DecoratorComposer.d.ts.map +0 -1
- package/lib/decorator/private/DecoratorComposer.js +0 -13
- package/lib/decorator/private/activityDecoratorRequest.d.ts +0 -6
- package/lib/decorator/private/activityDecoratorRequest.d.ts.map +0 -1
- package/lib/decorator/private/activityDecoratorRequest.js +0 -2
- package/lib/decorator/private/createDecoratorComposer.d.ts +0 -11
- package/lib/decorator/private/createDecoratorComposer.d.ts.map +0 -1
- package/lib/decorator/private/createDecoratorComposer.js +0 -27
- package/lib/decorator/private/templateMiddleware.d.ts +0 -30
- package/lib/decorator/private/templateMiddleware.d.ts.map +0 -1
- package/lib/decorator/private/templateMiddleware.js +0 -53
- package/lib/decorator/private/templateMiddleware.test.d.ts +0 -3
- package/lib/decorator/private/templateMiddleware.test.d.ts.map +0 -1
- package/lib/defaultStyleOptions.d.ts +0 -4
- package/lib/defaultStyleOptions.d.ts.map +0 -1
- package/lib/defaultStyleOptions.js +0 -277
- package/lib/external/PrecompiledGlobalize.js +0 -6361
- package/lib/hooks/Composer.d.ts +0 -88
- package/lib/hooks/Composer.d.ts.map +0 -1
- package/lib/hooks/Composer.js +0 -605
- package/lib/hooks/index.d.ts +0 -73
- package/lib/hooks/index.d.ts.map +0 -1
- package/lib/hooks/index.js +0 -504
- package/lib/hooks/internal/ErrorBox.js +0 -47
- package/lib/hooks/internal/SendBoxMiddleware.d.ts +0 -37
- 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 -37
- 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 -3
- package/lib/hooks/internal/private/templateMiddleware.d.ts.map +0 -1
- package/lib/hooks/internal/private/templateMiddleware.js +0 -12
- 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 -3
- 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/private/numberWithInfinity.d.ts +0 -3
- package/lib/hooks/private/numberWithInfinity.d.ts.map +0 -1
- package/lib/hooks/private/numberWithInfinity.js +0 -17
- package/lib/hooks/private/numberWithInfinity.spec.d.ts +0 -2
- package/lib/hooks/private/numberWithInfinity.spec.d.ts.map +0 -1
- package/lib/hooks/private/reduceIterable.d.ts +0 -2
- package/lib/hooks/private/reduceIterable.d.ts.map +0 -1
- package/lib/hooks/private/reduceIterable.js +0 -26
- package/lib/hooks/private/reduceIterable.spec.d.ts +0 -2
- package/lib/hooks/private/reduceIterable.spec.d.ts.map +0 -1
- package/lib/hooks/useActiveTyping.d.ts +0 -4
- 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/useGetActivitiesByKey.d.ts +0 -3
- package/lib/hooks/useGetActivitiesByKey.d.ts.map +0 -1
- package/lib/hooks/useGetActivitiesByKey.js +0 -11
- 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 -112
- package/lib/localization/bg-BG.json +0 -112
- package/lib/localization/ca-ES.json +0 -112
- package/lib/localization/cs-CZ.json +0 -112
- package/lib/localization/da-DK.json +0 -112
- package/lib/localization/de-DE.json +0 -112
- package/lib/localization/el-GR.json +0 -112
- package/lib/localization/en-US.json +0 -183
- package/lib/localization/es-ES.json +0 -112
- package/lib/localization/et-EE.json +0 -112
- package/lib/localization/eu-ES.json +0 -112
- package/lib/localization/fi-FI.json +0 -112
- package/lib/localization/fr-FR.json +0 -112
- 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 -112
- package/lib/localization/he-IL.json +0 -112
- package/lib/localization/hi-IN.json +0 -112
- package/lib/localization/hr-HR.json +0 -112
- package/lib/localization/hu-HU.json +0 -112
- package/lib/localization/id-ID.json +0 -112
- package/lib/localization/it-IT.json +0 -112
- package/lib/localization/ja-JP.json +0 -112
- package/lib/localization/kk-KZ.json +0 -112
- package/lib/localization/ko-KR.json +0 -112
- package/lib/localization/lt-LT.json +0 -112
- package/lib/localization/lv-LV.json +0 -112
- 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 -112
- package/lib/localization/nb-NO.json +0 -112
- package/lib/localization/nl-NL.json +0 -112
- package/lib/localization/overrides.json +0 -257
- package/lib/localization/pl-PL.json +0 -112
- package/lib/localization/pt-BR.json +0 -112
- package/lib/localization/pt-PT.json +0 -112
- package/lib/localization/ro-RO.json +0 -112
- package/lib/localization/ru-RU.json +0 -112
- package/lib/localization/sk-SK.json +0 -112
- package/lib/localization/sl-SI.json +0 -112
- package/lib/localization/sl-SL.json +0 -3
- package/lib/localization/sr-Cyrl-CS.json +0 -112
- package/lib/localization/sr-Cyrl.json +0 -3
- package/lib/localization/sr-Latn-CS.json +0 -112
- package/lib/localization/sr-Latn.json +0 -3
- package/lib/localization/sv-SE.json +0 -112
- package/lib/localization/th-TH.json +0 -112
- package/lib/localization/tr-TR.json +0 -112
- package/lib/localization/uk-UA.json +0 -112
- package/lib/localization/vi-VN.json +0 -112
- package/lib/localization/yue.json +0 -115
- package/lib/localization/zh-CN.json +0 -112
- package/lib/localization/zh-HK.json +0 -112
- package/lib/localization/zh-TW.json +0 -112
- 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 -149
- package/lib/providers/ActivityKeyer/private/Context.d.ts +0 -13
- 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/lastOf.d.ts +0 -2
- package/lib/providers/ActivityKeyer/private/lastOf.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/private/lastOf.js +0 -10
- package/lib/providers/ActivityKeyer/private/lastOf.spec.d.ts +0 -2
- package/lib/providers/ActivityKeyer/private/lastOf.spec.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/private/someIterable.d.ts +0 -2
- package/lib/providers/ActivityKeyer/private/someIterable.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/private/someIterable.js +0 -27
- package/lib/providers/ActivityKeyer/private/someIterable.spec.d.ts +0 -2
- package/lib/providers/ActivityKeyer/private/someIterable.spec.d.ts.map +0 -1
- 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/useGetActivitiesByKey.d.ts +0 -3
- package/lib/providers/ActivityKeyer/useGetActivitiesByKey.d.ts.map +0 -1
- package/lib/providers/ActivityKeyer/useGetActivitiesByKey.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/ActivityListener/ActivityListenerComposer.d.ts +0 -7
- package/lib/providers/ActivityListener/ActivityListenerComposer.d.ts.map +0 -1
- package/lib/providers/ActivityListener/ActivityListenerComposer.js +0 -55
- package/lib/providers/ActivityListener/private/Context.d.ts +0 -8
- package/lib/providers/ActivityListener/private/Context.d.ts.map +0 -1
- package/lib/providers/ActivityListener/private/Context.js +0 -15
- package/lib/providers/ActivityListener/private/useContext.d.ts +0 -2
- package/lib/providers/ActivityListener/private/useContext.d.ts.map +0 -1
- package/lib/providers/ActivityListener/private/useContext.js +0 -13
- package/lib/providers/ActivityListener/useUpsertedActivities.d.ts +0 -3
- package/lib/providers/ActivityListener/useUpsertedActivities.d.ts.map +0 -1
- package/lib/providers/ActivityListener/useUpsertedActivities.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/ActivityTyping/ActivityTypingComposer.d.ts +0 -9
- package/lib/providers/ActivityTyping/ActivityTypingComposer.d.ts.map +0 -1
- package/lib/providers/ActivityTyping/ActivityTypingComposer.js +0 -98
- package/lib/providers/ActivityTyping/private/Context.d.ts +0 -8
- package/lib/providers/ActivityTyping/private/Context.d.ts.map +0 -1
- package/lib/providers/ActivityTyping/private/Context.js +0 -15
- package/lib/providers/ActivityTyping/private/useContext.d.ts +0 -3
- package/lib/providers/ActivityTyping/private/useContext.d.ts.map +0 -1
- package/lib/providers/ActivityTyping/private/useContext.js +0 -13
- package/lib/providers/ActivityTyping/private/useMemoWithPrevious.d.ts +0 -3
- package/lib/providers/ActivityTyping/private/useMemoWithPrevious.d.ts.map +0 -1
- package/lib/providers/ActivityTyping/private/useMemoWithPrevious.js +0 -22
- package/lib/providers/ActivityTyping/types/AllTyping.d.ts +0 -9
- package/lib/providers/ActivityTyping/types/AllTyping.d.ts.map +0 -1
- package/lib/providers/ActivityTyping/types/AllTyping.js +0 -2
- package/lib/providers/ActivityTyping/useAllTyping.d.ts +0 -3
- package/lib/providers/ActivityTyping/useAllTyping.d.ts.map +0 -1
- package/lib/providers/ActivityTyping/useAllTyping.js +0 -12
- 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/decorator/index.ts +0 -4
- package/src/decorator/private/ActivityBorderDecoratorMiddleware.ts +0 -31
- package/src/decorator/private/ActivityDecorator.tsx +0 -31
- package/src/decorator/private/DecoratorComposer.tsx +0 -6
- package/src/decorator/private/activityDecoratorRequest.ts +0 -6
- package/src/decorator/private/createDecoratorComposer.tsx +0 -36
- package/src/decorator/private/templateMiddleware.ts +0 -58
- package/src/hooks/internal/ErrorBox.js +0 -34
- package/src/hooks/internal/SendBoxMiddleware.ts +0 -21
- package/src/hooks/internal/SendBoxToolbarMiddleware.ts +0 -21
- package/src/hooks/internal/private/templateMiddleware.ts +0 -4
- package/src/hooks/internal/useCreateActivityRendererInternal.ts +0 -46
- package/src/hooks/internal/useDebugDeps.js +0 -30
- package/src/hooks/internal/useErrorBoxClass.js +0 -7
- package/src/hooks/middleware/createDefaultGroupActivitiesMiddleware.ts +0 -75
- package/src/hooks/useGroupActivities.ts +0 -10
- package/src/internal.ts +0 -3
- package/src/patchStyleOptionsFromDeprecatedProps.js +0 -14
- package/src/providers/ActivityTyping/private/useMemoWithPrevious.ts +0 -17
- package/src/types/ActivityMiddleware.ts +0 -36
- package/src/types/AttachmentMiddleware.ts +0 -16
- package/src/utils/isObject.js +0 -5
- package/src/utils/warnOnce.ts +0 -10
- /package/dist/{chunk-J6D5YEY6.mjs.map → botframework-webchat-api.graph.mjs.map} +0 -0
package/src/hooks/index.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import useCapabilities from '../providers/Capabilities/useCapabilities';
|
|
2
|
+
import useGroupActivities from '../providers/GroupActivities/useGroupActivities';
|
|
3
|
+
import useGroupActivitiesByName from '../providers/GroupActivities/useGroupActivitiesByName';
|
|
1
4
|
import useActiveTyping from './useActiveTyping';
|
|
2
5
|
import useActivities from './useActivities';
|
|
3
6
|
import useActivityKeys from './useActivityKeys';
|
|
@@ -26,7 +29,6 @@ import useGetKeyByActivity from './useGetKeyByActivity';
|
|
|
26
29
|
import useGetKeyByActivityId from './useGetKeyByActivityId';
|
|
27
30
|
import useGetSendTimeoutForActivity from './useGetSendTimeoutForActivity';
|
|
28
31
|
import useGrammars from './useGrammars';
|
|
29
|
-
import useGroupActivities from './useGroupActivities';
|
|
30
32
|
import useGroupTimestamp from './useGroupTimestamp';
|
|
31
33
|
import useLanguage from './useLanguage';
|
|
32
34
|
import useLastAcknowledgedActivityKey from './useLastAcknowledgedActivityKey';
|
|
@@ -57,7 +59,9 @@ import useSendTypingIndicator from './useSendTypingIndicator';
|
|
|
57
59
|
import useSetNotification from './useSetNotification';
|
|
58
60
|
import useShouldSpeakIncomingActivity from './useShouldSpeakIncomingActivity';
|
|
59
61
|
import useStartDictate from './useStartDictate';
|
|
62
|
+
import useStartVoice from './useStartVoice';
|
|
60
63
|
import useStopDictate from './useStopDictate';
|
|
64
|
+
import useStopVoice from './useStopVoice';
|
|
61
65
|
import useStyleOptions from './useStyleOptions';
|
|
62
66
|
import useSubmitSendBox from './useSubmitSendBox';
|
|
63
67
|
import useSuggestedActions from './useSuggestedActions';
|
|
@@ -66,9 +70,15 @@ import useTrackDimension from './useTrackDimension';
|
|
|
66
70
|
import useTrackEvent from './useTrackEvent';
|
|
67
71
|
import useTrackException from './useTrackException';
|
|
68
72
|
import useTrackTiming from './useTrackTiming';
|
|
73
|
+
import useUIState from './useUIState';
|
|
69
74
|
import useUserID from './useUserID';
|
|
70
75
|
import useUsername from './useUsername';
|
|
76
|
+
import useVoiceRecordingMuted from './useVoiceRecordingMuted';
|
|
71
77
|
import useVoiceSelector from './useVoiceSelector';
|
|
78
|
+
import useVoiceState from './useVoiceState';
|
|
79
|
+
|
|
80
|
+
export { useBuildRenderActivityCallback } from '@msinternal/botframework-webchat-api-middleware';
|
|
81
|
+
export { useSuggestedActionsHooks } from '@msinternal/botframework-webchat-redux-store';
|
|
72
82
|
|
|
73
83
|
export {
|
|
74
84
|
useActiveTyping,
|
|
@@ -78,6 +88,7 @@ export {
|
|
|
78
88
|
useAvatarForBot,
|
|
79
89
|
useAvatarForUser,
|
|
80
90
|
useByteFormatter,
|
|
91
|
+
useCapabilities,
|
|
81
92
|
useConnectivityStatus,
|
|
82
93
|
useCreateActivityRenderer,
|
|
83
94
|
useCreateActivityStatusRenderer,
|
|
@@ -100,6 +111,7 @@ export {
|
|
|
100
111
|
useGetSendTimeoutForActivity,
|
|
101
112
|
useGrammars,
|
|
102
113
|
useGroupActivities,
|
|
114
|
+
useGroupActivitiesByName,
|
|
103
115
|
useGroupTimestamp,
|
|
104
116
|
useLanguage,
|
|
105
117
|
useLastAcknowledgedActivityKey,
|
|
@@ -130,7 +142,9 @@ export {
|
|
|
130
142
|
useSetNotification,
|
|
131
143
|
useShouldSpeakIncomingActivity,
|
|
132
144
|
useStartDictate,
|
|
145
|
+
useStartVoice,
|
|
133
146
|
useStopDictate,
|
|
147
|
+
useStopVoice,
|
|
134
148
|
useStyleOptions,
|
|
135
149
|
useSubmitSendBox,
|
|
136
150
|
useSuggestedActions,
|
|
@@ -139,7 +153,10 @@ export {
|
|
|
139
153
|
useTrackEvent,
|
|
140
154
|
useTrackException,
|
|
141
155
|
useTrackTiming,
|
|
156
|
+
useUIState,
|
|
142
157
|
useUserID,
|
|
143
158
|
useUsername,
|
|
144
|
-
|
|
159
|
+
useVoiceRecordingMuted,
|
|
160
|
+
useVoiceSelector,
|
|
161
|
+
useVoiceState
|
|
145
162
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LegacyRenderAttachment } from '@msinternal/botframework-webchat-api-middleware/legacy';
|
|
1
2
|
import {
|
|
2
3
|
type DirectLineJSBotConnection,
|
|
3
4
|
type Observable,
|
|
@@ -8,12 +9,8 @@ import {
|
|
|
8
9
|
} from 'botframework-webchat-core';
|
|
9
10
|
import { createContext } from 'react';
|
|
10
11
|
|
|
11
|
-
import { StrictStyleOptions } from '../../StyleOptions';
|
|
12
|
-
import { LegacyActivityRenderer } from '../../types/ActivityMiddleware';
|
|
13
12
|
import { RenderActivityStatus } from '../../types/ActivityStatusMiddleware';
|
|
14
13
|
import { AttachmentForScreenReaderComponentFactory } from '../../types/AttachmentForScreenReaderMiddleware';
|
|
15
|
-
import { RenderAttachment } from '../../types/AttachmentMiddleware';
|
|
16
|
-
import { AvatarComponentFactory } from '../../types/AvatarMiddleware';
|
|
17
14
|
import { PerformCardAction } from '../../types/CardActionMiddleware';
|
|
18
15
|
import { GroupActivities } from '../../types/GroupActivitiesMiddleware';
|
|
19
16
|
import LocalizedStrings from '../../types/LocalizedStrings';
|
|
@@ -23,16 +20,13 @@ import { ScrollToEndButtonComponentFactory } from '../../types/ScrollToEndButton
|
|
|
23
20
|
import TelemetryMeasurementEvent from '../../types/TelemetryMeasurementEvent';
|
|
24
21
|
import { RenderToast } from '../../types/ToastMiddleware';
|
|
25
22
|
|
|
26
|
-
type
|
|
27
|
-
activityRenderer?: LegacyActivityRenderer;
|
|
23
|
+
export type WebChatAPIContextType = {
|
|
28
24
|
activityStatusRenderer: RenderActivityStatus;
|
|
29
25
|
attachmentForScreenReaderRenderer?: AttachmentForScreenReaderComponentFactory;
|
|
30
|
-
attachmentRenderer?:
|
|
31
|
-
avatarRenderer: AvatarComponentFactory;
|
|
26
|
+
attachmentRenderer?: LegacyRenderAttachment;
|
|
32
27
|
clearSuggestedActions?: () => void;
|
|
33
28
|
dir?: string;
|
|
34
29
|
directLine?: DirectLineJSBotConnection;
|
|
35
|
-
disabled?: boolean;
|
|
36
30
|
dismissNotification?: (id: string) => void;
|
|
37
31
|
downscaleImageToDataURL?: (
|
|
38
32
|
blob: Blob,
|
|
@@ -44,7 +38,6 @@ type WebChatAPIContext = {
|
|
|
44
38
|
emitTypingIndicator?: () => void;
|
|
45
39
|
grammars?: any;
|
|
46
40
|
groupActivities?: GroupActivities;
|
|
47
|
-
internalErrorBoxClass?: React.Component | Function;
|
|
48
41
|
language?: string;
|
|
49
42
|
localizedGlobalizeState?: PrecompiledGlobalize[];
|
|
50
43
|
localizedStrings?: { [language: string]: LocalizedStrings };
|
|
@@ -76,19 +69,21 @@ type WebChatAPIContext = {
|
|
|
76
69
|
setSendTimeout?: (timeout: number) => void;
|
|
77
70
|
startDictate?: () => void;
|
|
78
71
|
startSpeakingActivity?: () => void;
|
|
72
|
+
startVoice?: () => void;
|
|
79
73
|
stopDictate?: () => void;
|
|
80
74
|
stopSpeakingActivity?: () => void;
|
|
81
|
-
|
|
75
|
+
stopVoice?: () => void;
|
|
82
76
|
submitSendBox?: (method?: string, { channelData }?: { channelData: any }) => void;
|
|
83
77
|
telemetryDimensionsRef?: React.Ref<any>;
|
|
84
78
|
toastRenderer?: RenderToast;
|
|
85
79
|
trackDimension?: (name: string, data: any) => void;
|
|
86
80
|
typingIndicatorRenderer?: any; // TODO
|
|
81
|
+
uiState: 'blueprint' | 'disabled' | undefined;
|
|
87
82
|
userID?: string;
|
|
88
83
|
username?: string;
|
|
89
84
|
};
|
|
90
85
|
|
|
91
|
-
const context = createContext<
|
|
86
|
+
const context = createContext<WebChatAPIContextType>(undefined);
|
|
92
87
|
|
|
93
88
|
context.displayName = 'WebChatAPIContext';
|
|
94
89
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
|
-
import { createDispatchHook, createSelectorHook } from 'react-redux';
|
|
2
|
+
import { createDispatchHook, createSelectorHook, createStoreHook } from 'react-redux';
|
|
3
3
|
|
|
4
4
|
const context = createContext();
|
|
5
5
|
|
|
6
6
|
const useDispatch = createDispatchHook(context);
|
|
7
7
|
const useSelector = createSelectorHook(context);
|
|
8
|
+
const useStore = createStoreHook(context);
|
|
8
9
|
|
|
9
10
|
context.displayName = 'WebChatReduxContext';
|
|
10
11
|
|
|
11
12
|
export default context;
|
|
12
13
|
|
|
13
|
-
export { useDispatch, useSelector };
|
|
14
|
+
export { useDispatch, useSelector, useStore };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { postVoiceActivity, type WebChatActivity } from 'botframework-webchat-core';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { useDispatch } from './WebChatReduxContext';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Hook to post voice activities (fire-and-forget, no echo back).
|
|
7
|
+
* Use this for DTMF and other voice-related event activities.
|
|
8
|
+
*/
|
|
9
|
+
export default function usePostVoiceActivity(): (activity: WebChatActivity) => void {
|
|
10
|
+
const dispatch = useDispatch();
|
|
11
|
+
|
|
12
|
+
return useCallback(
|
|
13
|
+
(activity: WebChatActivity) => {
|
|
14
|
+
dispatch(postVoiceActivity(activity));
|
|
15
|
+
},
|
|
16
|
+
[dispatch]
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { registerVoiceHandler, unregisterVoiceHandler, type VoiceHandler } from 'botframework-webchat-core';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import randomId from '../../utils/randomId';
|
|
4
|
+
import { useDispatch } from './WebChatReduxContext';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal hook to register a voice handler for audio playback.
|
|
8
|
+
* @returns A function that registers a voice handler and returns an unregister function.
|
|
9
|
+
*/
|
|
10
|
+
export default function useRegisterVoiceHandler(): (voiceHandler: VoiceHandler) => () => void {
|
|
11
|
+
const dispatch = useDispatch();
|
|
12
|
+
|
|
13
|
+
return useCallback(
|
|
14
|
+
(voiceHandler: VoiceHandler) => {
|
|
15
|
+
const id = randomId();
|
|
16
|
+
dispatch(registerVoiceHandler(id, voiceHandler));
|
|
17
|
+
return () => {
|
|
18
|
+
dispatch(unregisterVoiceHandler(id));
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
[dispatch]
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import useStyleOptions from '../useStyleOptions';
|
|
2
|
+
import useCapabilities from '../../providers/Capabilities/useCapabilities';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Internal hook to determine if the microphone button should be shown based on:
|
|
6
|
+
* - `showMicrophoneButton` style option ('auto' | 'hide')
|
|
7
|
+
* - Adapter voice capability (voiceConfiguration)
|
|
8
|
+
*
|
|
9
|
+
* - 'auto': Show if adapter has voiceConfiguration capability, hide otherwise
|
|
10
|
+
* - 'hide': Never show
|
|
11
|
+
*/
|
|
12
|
+
export default function useShouldShowMicrophoneButton(): boolean {
|
|
13
|
+
const [{ showMicrophoneButton }] = useStyleOptions();
|
|
14
|
+
// If adapter has voice capability, voiceConfiguration will be defined,
|
|
15
|
+
const voiceConfiguration = useCapabilities(caps => caps.voiceConfiguration);
|
|
16
|
+
|
|
17
|
+
if (showMicrophoneButton === 'hide') {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return !!voiceConfiguration;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { VoiceHandler } from 'botframework-webchat-core';
|
|
2
|
+
import { useSelector } from './WebChatReduxContext';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Internal hook to get all registered voice handlers from Redux state.
|
|
6
|
+
*/
|
|
7
|
+
export default function useVoiceHandlers(): readonly [ReadonlyMap<string, VoiceHandler>] {
|
|
8
|
+
return Object.freeze([
|
|
9
|
+
useSelector((state: { voice: { voiceHandlers: Map<string, VoiceHandler> } }) => state.voice.voiceHandlers)
|
|
10
|
+
]);
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { setVoiceState, type VoiceState } from 'botframework-webchat-core';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { useDispatch, useSelector } from './WebChatReduxContext';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Internal hook to set the voice state.
|
|
7
|
+
*/
|
|
8
|
+
export default function useVoiceStateWritable(): readonly [VoiceState, (state: VoiceState) => void] {
|
|
9
|
+
const dispatch = useDispatch();
|
|
10
|
+
const setter = useCallback(
|
|
11
|
+
(state: VoiceState) => {
|
|
12
|
+
dispatch(setVoiceState(state));
|
|
13
|
+
},
|
|
14
|
+
[dispatch]
|
|
15
|
+
);
|
|
16
|
+
const value = useSelector(({ voice }) => voice.voiceState);
|
|
17
|
+
return Object.freeze([value, setter]);
|
|
18
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { ErrorBoxPolymiddlewareProxy } from '@msinternal/botframework-webchat-api-middleware';
|
|
1
2
|
import PropTypes from 'prop-types';
|
|
2
3
|
import React, { useCallback, useState } from 'react';
|
|
3
4
|
|
|
4
5
|
import ErrorBoundary from '../utils/ErrorBoundary';
|
|
5
|
-
import ErrorBox from '../internal/ErrorBox';
|
|
6
6
|
|
|
7
7
|
const UserlandBoundary = ({ children, type }) => {
|
|
8
8
|
const [error, setError] = useState();
|
|
@@ -10,7 +10,7 @@ const UserlandBoundary = ({ children, type }) => {
|
|
|
10
10
|
const handleError = useCallback(error => setError(error), []);
|
|
11
11
|
|
|
12
12
|
return error ? (
|
|
13
|
-
<
|
|
13
|
+
<ErrorBoxPolymiddlewareProxy error={error} where={type} />
|
|
14
14
|
) : (
|
|
15
15
|
<ErrorBoundary onError={handleError}>{children}</ErrorBoundary>
|
|
16
16
|
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { activityComponent, createActivityPolymiddleware } from '@msinternal/botframework-webchat-api-middleware';
|
|
2
|
+
import { type WebChatActivity } from 'botframework-webchat-core';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line prefer-arrow-callback
|
|
6
|
+
const NoActivityToRenderComponent = memo(function NoActivityToRenderComponent({
|
|
7
|
+
activity
|
|
8
|
+
}: {
|
|
9
|
+
readonly activity: WebChatActivity;
|
|
10
|
+
children?: never;
|
|
11
|
+
}) {
|
|
12
|
+
throw new Error(`No renderer for activity of type "${activity.type}"`);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const activityFallbackPolymiddleware = createActivityPolymiddleware(
|
|
16
|
+
() =>
|
|
17
|
+
({ activity }) =>
|
|
18
|
+
activityComponent<{ readonly activity: WebChatActivity; children?: never }>(NoActivityToRenderComponent, {
|
|
19
|
+
activity
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default activityFallbackPolymiddleware;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ErrorBoxPolymiddlewareProxy } from '@msinternal/botframework-webchat-api-middleware';
|
|
1
2
|
import React, { isValidElement } from 'react';
|
|
2
|
-
import ErrorBox from '../internal/ErrorBox';
|
|
3
3
|
import concatMiddleware from './concatMiddleware';
|
|
4
4
|
import UserlandBoundary from './UserlandBoundary';
|
|
5
5
|
|
|
@@ -22,7 +22,7 @@ export function forLegacyRenderer(type, ...middleware) {
|
|
|
22
22
|
try {
|
|
23
23
|
return fn(...args);
|
|
24
24
|
} catch (err) {
|
|
25
|
-
return <
|
|
25
|
+
return <ErrorBoxPolymiddlewareProxy error={err} where={`render of ${type}`} />;
|
|
26
26
|
}
|
|
27
27
|
}}
|
|
28
28
|
</UserlandBoundary>
|
|
@@ -42,7 +42,7 @@ export function forLegacyRenderer(type, ...middleware) {
|
|
|
42
42
|
export function forRenderer(type, { strict = false } = {}, ...middleware) {
|
|
43
43
|
return (...setupArgs) => {
|
|
44
44
|
const runMiddleware = concatMiddleware(...middleware)(...setupArgs)(() => (
|
|
45
|
-
<
|
|
45
|
+
<ErrorBoxPolymiddlewareProxy error={new Error(`reached terminator of ${type}`)} where={type} />
|
|
46
46
|
));
|
|
47
47
|
|
|
48
48
|
return (...createRendererArgs) => {
|
|
@@ -73,13 +73,13 @@ export function forRenderer(type, { strict = false } = {}, ...middleware) {
|
|
|
73
73
|
|
|
74
74
|
return element;
|
|
75
75
|
} catch (err) {
|
|
76
|
-
return <
|
|
76
|
+
return <ErrorBoxPolymiddlewareProxy error={err} where={`render of ${type}`} />;
|
|
77
77
|
}
|
|
78
78
|
}}
|
|
79
79
|
</UserlandBoundary>
|
|
80
80
|
);
|
|
81
81
|
} catch (err) {
|
|
82
|
-
return <
|
|
82
|
+
return <ErrorBoxPolymiddlewareProxy error={err} where={`render of ${type}`} />;
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
};
|
|
@@ -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,15 +1,16 @@
|
|
|
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
|
|
|
5
5
|
export default function concatMiddleware<Setup, Result>(
|
|
6
|
-
...middleware: Middleware<Setup, Result>[]
|
|
6
|
+
...middleware: readonly 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();
|
|
@@ -36,15 +36,16 @@ function useActiveTyping(expireAfter?: number): readonly [Readonly<Record<string
|
|
|
36
36
|
]);
|
|
37
37
|
|
|
38
38
|
const earliestExpireAt = Math.min(...Object.values(activeTypingState[0]).map(({ expireAt }) => expireAt));
|
|
39
|
-
const timeToRender = earliestExpireAt && earliestExpireAt - now;
|
|
40
39
|
|
|
41
40
|
useEffect(() => {
|
|
41
|
+
const timeToRender = earliestExpireAt && earliestExpireAt - Date.now();
|
|
42
|
+
|
|
42
43
|
if (timeToRender && isFinite(timeToRender)) {
|
|
43
44
|
const timeout = setTimeout(forceRender, Math.max(0, timeToRender));
|
|
44
45
|
|
|
45
46
|
return () => clearTimeout(timeout);
|
|
46
47
|
}
|
|
47
|
-
}, [clearTimeout, forceRender, setTimeout
|
|
48
|
+
}, [clearTimeout, Date, earliestExpireAt, forceRender, setTimeout]);
|
|
48
49
|
|
|
49
50
|
return activeTypingState;
|
|
50
51
|
}
|
|
@@ -1,7 +1,66 @@
|
|
|
1
|
+
import { useOrderedActivities } from '@msinternal/botframework-webchat-api-graph';
|
|
1
2
|
import type { WebChatActivity } from 'botframework-webchat-core';
|
|
2
3
|
|
|
3
|
-
import { useSelector } from './internal/WebChatReduxContext';
|
|
4
|
+
import { useSelector, useStore } from './internal/WebChatReduxContext';
|
|
5
|
+
import usePrevious from './internal/usePrevious';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
declare const process: {
|
|
8
|
+
env: {
|
|
9
|
+
NODE_ENV?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function useActivitiesForProduction(): readonly [readonly WebChatActivity[]] {
|
|
14
|
+
return useOrderedActivities();
|
|
7
15
|
}
|
|
16
|
+
|
|
17
|
+
function useActivitiesForDevelopment(): readonly [readonly WebChatActivity[]] {
|
|
18
|
+
const activitiesFromGraphState = useActivitiesForProduction();
|
|
19
|
+
|
|
20
|
+
// Checks if store changed.
|
|
21
|
+
const store = useStore();
|
|
22
|
+
const prevStore = usePrevious(store);
|
|
23
|
+
|
|
24
|
+
const [activitiesFromGraph] = activitiesFromGraphState;
|
|
25
|
+
|
|
26
|
+
const activitiesFromRedux = useSelector(({ activities }) => activities);
|
|
27
|
+
|
|
28
|
+
// If store changed, skip one assertion turn.
|
|
29
|
+
// This is because <GraphProvider> is using `useState()` for propagating changes.
|
|
30
|
+
// It is always one render behind if `store` changed.
|
|
31
|
+
if (prevStore === store) {
|
|
32
|
+
if (activitiesFromGraph.length !== activitiesFromRedux.length) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
`botframework-webchat-internal: Activities from graph and Redux are of different size (graph has ${activitiesFromGraph.length} activities, Redux has ${activitiesFromRedux.length} activities)`,
|
|
35
|
+
{
|
|
36
|
+
cause: {
|
|
37
|
+
activitiesFromGraph,
|
|
38
|
+
activitiesFromRedux
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
for (let index = 0; index < activitiesFromGraph.length; index++) {
|
|
45
|
+
if (!Object.is(activitiesFromGraph.at(index), activitiesFromRedux.at(index))) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`botframework-webchat-internal: Activities from graph and Redux are different at index ${index}`,
|
|
48
|
+
{
|
|
49
|
+
cause: {
|
|
50
|
+
activitiesFromGraph,
|
|
51
|
+
activitiesFromRedux,
|
|
52
|
+
index
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return activitiesFromGraphState;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const useActivities: () => readonly [readonly WebChatActivity[]] =
|
|
64
|
+
process.env.NODE_ENV === 'production' ? useActivitiesForProduction : useActivitiesForDevelopment;
|
|
65
|
+
|
|
66
|
+
export default useActivities;
|
|
@@ -1,8 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { useBuildRenderActivityCallback } from '@msinternal/botframework-webchat-api-middleware';
|
|
2
|
+
import {
|
|
3
|
+
type LegacyActivityComponentFactory,
|
|
4
|
+
type LegacyActivityProps
|
|
5
|
+
} from '@msinternal/botframework-webchat-api-middleware/legacy';
|
|
6
|
+
import { useCallback } from 'react';
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use useBuildRenderActivityCallback() instead, this hook will be removed on or after 2027-08-16.
|
|
10
|
+
*/
|
|
11
|
+
export default function useCreateActivityRenderer(): LegacyActivityComponentFactory {
|
|
12
|
+
const render = useBuildRenderActivityCallback();
|
|
13
|
+
|
|
14
|
+
return useCallback(
|
|
15
|
+
({ activity }) =>
|
|
16
|
+
// TODO: [P2] TypeScript turns `{ children?: never | undefined }` into `{ children?: undefined }`.
|
|
17
|
+
// Thus we are getting a typing error here.
|
|
18
|
+
// Maybe moving to a stricter tsconfig would help removing the line below.
|
|
19
|
+
//
|
|
20
|
+
// Use the following commented line once we move to stricter tsconfig.
|
|
21
|
+
// (props: LegacyActivityProps) =>
|
|
22
|
+
(
|
|
23
|
+
/** @deprecated Some props are only processed by the legacy activity middleware and may not be processed by the newer activity middleware registered via `polymiddleware`. */
|
|
24
|
+
props: LegacyActivityProps & { children?: never }
|
|
25
|
+
) =>
|
|
26
|
+
render({ activity })?.(props),
|
|
27
|
+
[render]
|
|
28
|
+
);
|
|
8
29
|
}
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
/* eslint react/prop-types: "off" */
|
|
2
2
|
/* eslint react/require-default-props: "off" */
|
|
3
3
|
|
|
4
|
-
import type
|
|
4
|
+
import { type WebChatActivity } from 'botframework-webchat-core';
|
|
5
5
|
import React, { memo, useMemo, type ReactNode } from 'react';
|
|
6
6
|
|
|
7
7
|
import useGetKeyByActivity from '../hooks/useGetKeyByActivity';
|
|
8
8
|
import useSendStatusByActivityKey from '../hooks/useSendStatusByActivityKey';
|
|
9
|
-
import type
|
|
10
|
-
import type
|
|
9
|
+
import { type RenderActivityStatus } from '../types/ActivityStatusMiddleware';
|
|
10
|
+
import { type SendStatus } from '../types/SendStatus';
|
|
11
11
|
import useWebChatAPIContext from './internal/useWebChatAPIContext';
|
|
12
12
|
|
|
13
13
|
type ActivityStatusContainerCoreProps = Readonly<{
|
|
14
14
|
activity: WebChatActivity;
|
|
15
15
|
hideTimestamp: boolean;
|
|
16
|
-
nextVisibleActivity: WebChatActivity;
|
|
17
16
|
sendStatus: SendStatus;
|
|
18
17
|
}>;
|
|
19
18
|
|
|
20
19
|
const ActivityStatusContainerCore = memo(
|
|
21
|
-
({ activity, hideTimestamp,
|
|
20
|
+
({ activity, hideTimestamp, sendStatus }: ActivityStatusContainerCoreProps) => {
|
|
22
21
|
const { activityStatusRenderer: createActivityStatusRenderer }: { activityStatusRenderer: RenderActivityStatus } =
|
|
23
22
|
useWebChatAPIContext();
|
|
24
23
|
|
|
25
24
|
return createActivityStatusRenderer({
|
|
26
25
|
activity,
|
|
27
26
|
hideTimestamp,
|
|
28
|
-
nextVisibleActivity, // "nextVisibleActivity" is for backward compatibility, please remove this line on or after 2022-07-22.
|
|
29
|
-
sameTimestampGroup: hideTimestamp, // "sameTimestampGroup" is for backward compatibility, please remove this line on or after 2022-07-22.
|
|
30
27
|
sendState: sendStatus === 'send failed' || sendStatus === 'sent' ? sendStatus : 'sending'
|
|
31
28
|
});
|
|
32
29
|
}
|
|
@@ -35,45 +32,28 @@ const ActivityStatusContainerCore = memo(
|
|
|
35
32
|
type ActivityStatusContainerProps = Readonly<{
|
|
36
33
|
activity: WebChatActivity;
|
|
37
34
|
hideTimestamp: boolean;
|
|
38
|
-
nextVisibleActivity: WebChatActivity;
|
|
39
35
|
}>;
|
|
40
36
|
|
|
41
|
-
const ActivityStatusContainer = memo(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const getKeyByActivity = useGetKeyByActivity();
|
|
37
|
+
const ActivityStatusContainer = memo(({ activity, hideTimestamp }: ActivityStatusContainerProps) => {
|
|
38
|
+
const [sendStatusByActivityKey] = useSendStatusByActivityKey();
|
|
39
|
+
const getKeyByActivity = useGetKeyByActivity();
|
|
45
40
|
|
|
46
|
-
|
|
41
|
+
const key = getKeyByActivity(activity);
|
|
47
42
|
|
|
48
|
-
|
|
43
|
+
const sendStatus = (typeof key === 'string' && sendStatusByActivityKey.get(key)) || 'sent';
|
|
49
44
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
activity={activity}
|
|
53
|
-
hideTimestamp={hideTimestamp}
|
|
54
|
-
nextVisibleActivity={nextVisibleActivity}
|
|
55
|
-
sendStatus={sendStatus}
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
);
|
|
45
|
+
return <ActivityStatusContainerCore activity={activity} hideTimestamp={hideTimestamp} sendStatus={sendStatus} />;
|
|
46
|
+
});
|
|
60
47
|
|
|
61
48
|
export type ActivityStatusRenderer = (renderOptions: {
|
|
62
49
|
activity: WebChatActivity;
|
|
63
|
-
nextVisibleActivity: WebChatActivity;
|
|
64
50
|
}) => (props?: { hideTimestamp?: boolean }) => ReactNode;
|
|
65
51
|
|
|
66
52
|
export default function useCreateActivityStatusRenderer(): ActivityStatusRenderer {
|
|
67
53
|
return useMemo<ActivityStatusRenderer>(
|
|
68
54
|
() =>
|
|
69
|
-
({ activity
|
|
70
|
-
({ hideTimestamp } = {}) =>
|
|
71
|
-
<ActivityStatusContainer
|
|
72
|
-
activity={activity}
|
|
73
|
-
hideTimestamp={hideTimestamp}
|
|
74
|
-
nextVisibleActivity={nextVisibleActivity}
|
|
75
|
-
/>
|
|
76
|
-
),
|
|
55
|
+
({ activity }) =>
|
|
56
|
+
({ hideTimestamp } = {}) => <ActivityStatusContainer activity={activity} hideTimestamp={hideTimestamp} />,
|
|
77
57
|
[]
|
|
78
58
|
);
|
|
79
59
|
}
|