@azure/communication-react 1.13.0-beta.1 → 1.13.0
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/dist/communication-react.d.ts +157 -1968
- package/dist/dist-cjs/communication-react/index.js +2068 -7634
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/areEqual.d.ts +0 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +1 -2
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -5
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.d.ts +0 -12
- package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +1 -13
- package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +0 -4
- package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +2 -10
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +0 -14
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createDefaultCallingHandlersForComponent.js +0 -10
- package/dist/dist-esm/calling-component-bindings/src/handlers/createDefaultCallingHandlersForComponent.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +1 -15
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.d.ts +1 -4
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js +0 -12
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/index.d.ts +0 -6
- package/dist/dist-esm/calling-component-bindings/src/index.js +0 -8
- package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.d.ts +0 -1
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +2 -8
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/providers/CallAgentProvider.d.ts +3 -4
- package/dist/dist-esm/calling-component-bindings/src/providers/CallAgentProvider.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/providers/CallProvider.d.ts +2 -14
- package/dist/dist-esm/calling-component-bindings/src/providers/CallProvider.js +1 -20
- package/dist/dist-esm/calling-component-bindings/src/providers/CallProvider.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +0 -7
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +0 -12
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +2 -9
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +0 -3
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.d.ts +5 -6
- package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.d.ts +1 -15
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.d.ts +1 -2
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +0 -5
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +3 -24
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +1 -5
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +1 -40
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +8 -12
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +0 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +0 -8
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -7
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/RemoteVideoStreamSubscriber.d.ts +0 -1
- package/dist/dist-esm/calling-stateful-client/src/RemoteVideoStreamSubscriber.js +0 -11
- package/dist/dist-esm/calling-stateful-client/src/RemoteVideoStreamSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +1 -25
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +2 -33
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +2 -2
- package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +0 -8
- package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +0 -2
- package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +1 -5
- package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +0 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +5 -173
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +3 -3
- package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.d.ts +2 -5
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.js +2 -24
- package/dist/dist-esm/chat-stateful-client/src/ChatContext.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +1 -3
- package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js +1 -1
- package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js +1 -4
- package/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.d.ts +0 -2
- package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +1 -28
- package/dist/dist-esm/communication-react/src/index.js +0 -14
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/communication-react/src/mergedHooks.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/Announcer/Announcer.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/Announcer/LiveMessage.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/Announcer/MessageBlock.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/Announcer.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/CameraButton.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/Caption.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionsFlyout.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +1 -20
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +2 -7
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +1 -7
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +12 -43
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +1 -23
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +8 -37
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +1 -11
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js +2 -10
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +0 -35
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +1 -56
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.d.ts +1 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js +5 -27
- package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/BannerMessage.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/ComplianceBanner.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/ComplianceBanner/DelayedUpdateBanner.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/ControlBarButton.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/ControlButtonTooltip.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DevicePermissionDropdown.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/DevicesButton.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.d.ts +7 -8
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +2 -2
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerLightDismiss.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenu.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/EndCallButton.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/FileCard.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +1 -41
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +4 -25
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/FileUploadCards.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/HighContrastAwareIcon.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +0 -2
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +0 -18
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/LocalVideoCameraButton.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/MessageStatusIndicator.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +2 -47
- package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -16
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.d.ts +0 -14
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js +0 -3
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +0 -21
- package/dist/dist-esm/react-components/src/components/ParticipantList.js +4 -22
- package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantsButton.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPicture.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/RaiseHandButton.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +6 -25
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ScreenShareButton.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/SendBox.d.ts +0 -42
- package/dist/dist-esm/react-components/src/components/SendBox.js +9 -81
- package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js +1 -1
- package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/StartCaptionsButton.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/StreamMedia.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/SystemMessage.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/TypingIndicator.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +0 -2
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +0 -2
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +0 -24
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +0 -2
- package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FocusContentLayout.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +1 -5
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +3 -18
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +0 -9
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +6 -42
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +1 -9
- package/dist/dist-esm/react-components/src/components/VideoTile.js +7 -41
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/assets/RaisedHandIcon.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/assets/RaisedHandIcon.js +56 -56
- package/dist/dist-esm/react-components/src/components/assets/RaisedHandIcon.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +1 -21
- package/dist/dist-esm/react-components/src/components/index.js +0 -12
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js +12 -5
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Dialpad.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Dialpad.styles.js +5 -3
- package/dist/dist-esm/react-components/src/components/styles/Dialpad.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +2 -3
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +6 -3
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +14 -6
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/common.js +0 -4
- package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +1 -2
- package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +0 -4
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +1 -5
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/index.d.ts +0 -1
- package/dist/dist-esm/react-components/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +0 -60
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +4 -2
- package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +9 -3
- package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +9 -3
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +0 -13
- package/dist/dist-esm/react-components/src/theming/icons.js +3 -111
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/themes.d.ts +2 -21
- package/dist/dist-esm/react-components/src/theming/themes.js +0 -16
- package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -34
- package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/OnRender.d.ts +0 -9
- package/dist/dist-esm/react-components/src/types/OnRender.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ReactionTypes.d.ts +1 -44
- package/dist/dist-esm/react-components/src/types/ReactionTypes.js +1 -2
- package/dist/dist-esm/react-components/src/types/ReactionTypes.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +0 -6
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js +0 -2
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +1 -74
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +15 -28
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +29 -105
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +50 -75
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +101 -289
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +17 -99
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.d.ts +1 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js +1 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +3 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +11 -25
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +2 -38
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +0 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js +0 -27
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +2 -20
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +0 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js +0 -27
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ExpandedLocalVideoTile.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LobbyTile.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +5 -31
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +2 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MutedNotification.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/StartCallButton.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Participants.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/RaiseHand.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +2 -6
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +7 -20
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/usePropsFor.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +4 -9
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +44 -13
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +0 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +6 -80
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/{HoldPage.d.ts → DtmfDialpadPage.d.ts} +8 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js +80 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +3 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.js +11 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +0 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +0 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js +0 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/DtmfDialpadPage.styles.d.ts +8 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/DtmfDialpadPage.styles.js +18 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/DtmfDialpadPage.styles.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.d.ts +9 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +26 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +15 -16
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +24 -97
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/timerUtils.d.ts +17 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/timerUtils.js +30 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/timerUtils.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +1 -62
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +5 -31
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButton.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/NotificationIcon.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.d.ts +0 -32
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +10 -33
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +16 -108
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +5 -55
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +4 -10
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +7 -37
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +0 -13
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +1 -37
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +0 -22
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +1 -9
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +0 -21
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +1 -2
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatHeader.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +6 -133
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.d.ts +0 -4
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +3 -32
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +5 -129
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.d.ts +0 -28
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js +1 -159
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -17
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js +0 -2
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js +1 -8
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +1 -3
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/usePropsFor.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +0 -4
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.d.ts +1 -6
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js +0 -15
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.d.ts +0 -6
- package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.js +2 -3
- package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +25 -14
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +40 -27
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DtmfDialerButton.d.ts +17 -0
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DtmfDialerButton.js +41 -0
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DtmfDialerButton.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/PeopleButton.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionSettingsDrawer.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +8 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +43 -28
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/MoreButton.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -3
- package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +2 -14
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/TabHeader.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +4 -24
- package/dist/dist-esm/react-composites/src/composites/common/icons.js +5 -13
- package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +8 -13
- package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +20 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +29 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +29 -2
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +4 -4
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.d.ts +0 -45
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +0 -91
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +0 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.d.ts +0 -19
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js +0 -91
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js.map +0 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.d.ts +0 -23
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +0 -49
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +0 -1
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.d.ts +0 -32
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js +0 -129
- package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +0 -10
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +0 -15
- package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.d.ts +0 -69
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js +0 -43
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.d.ts +0 -75
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +0 -75
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +0 -105
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +0 -68
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.d.ts +0 -86
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js +0 -39
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/HoldButton.d.ts +0 -49
- package/dist/dist-esm/react-components/src/components/HoldButton.js +0 -25
- package/dist/dist-esm/react-components/src/components/HoldButton.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/ImageGallery.d.ts +0 -71
- package/dist/dist-esm/react-components/src/components/ImageGallery.js +0 -56
- package/dist/dist-esm/react-components/src/components/ImageGallery.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +0 -121
- package/dist/dist-esm/react-components/src/components/MentionPopover.js +0 -123
- package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +0 -14
- package/dist/dist-esm/react-components/src/components/SendBoxErrors.js +0 -18
- package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.d.ts +0 -24
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +0 -550
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.d.ts +0 -152
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +0 -816
- package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.d.ts +0 -58
- package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js +0 -144
- package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/ImageGallery.style.d.ts +0 -68
- package/dist/dist-esm/react-components/src/components/styles/ImageGallery.style.js +0 -205
- package/dist/dist-esm/react-components/src/components/styles/ImageGallery.style.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.d.ts +0 -26
- package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +0 -69
- package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.d.ts +0 -38
- package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +0 -92
- package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/Stack.style.d.ts +0 -5
- package/dist/dist-esm/react-components/src/components/styles/Stack.style.js +0 -32
- package/dist/dist-esm/react-components/src/components/styles/Stack.style.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +0 -26
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +0 -67
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/utils/merge.d.ts +0 -7
- package/dist/dist-esm/react-components/src/components/utils/merge.js +0 -16
- package/dist/dist-esm/react-components/src/components/utils/merge.js.map +0 -1
- package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +0 -6
- package/dist/dist-esm/react-components/src/theming/icons.styles.js +0 -25
- package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +0 -48
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +0 -218
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.d.ts +0 -12
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js +0 -93
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/People.d.ts +0 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/People.js +0 -26
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/People.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +0 -28
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +0 -15
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +0 -54
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/HoldPane.styles.d.ts +0 -32
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/HoldPane.styles.js +0 -81
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/HoldPane.styles.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.d.ts +0 -18
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js +0 -18
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.d.ts +0 -15
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.js +0 -23
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.d.ts +0 -6
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js +0 -11
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.d.ts +0 -12
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +0 -15
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.d.ts +0 -27
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.js +0 -14
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.d.ts +0 -22
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js +0 -107
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.styles.d.ts +0 -17
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.styles.js +0 -32
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.styles.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.d.ts +0 -22
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js +0 -74
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.d.ts +0 -15
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.js +0 -61
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"updateMessagesWithAttached.js","sourceRoot":"","sources":["../../../../../preprocess-dist/chat-component-bindings/src/utils/updateMessagesWithAttached.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,sBAAiC,EAAQ,EAAE;IACpF,sBAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC7C,sBAAsB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;;QAC1D,IAAI,OAAO,CAAC,WAAW,KAAK,MAAM,
|
1
|
+
{"version":3,"file":"updateMessagesWithAttached.js","sourceRoot":"","sources":["../../../../../preprocess-dist/chat-component-bindings/src/utils/updateMessagesWithAttached.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,sBAAiC,EAAQ,EAAE;IACpF,sBAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC7C,sBAAsB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;;QAC1D,IAAI,OAAO,CAAC,WAAW,KAAK,MAAM,EAAE,CAAC;YACnC;;;;;eAKG;YACH,IAAI,QAAQ,GAAoC,KAAK,CAAC;YACtD,MAAM,eAAe,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,S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E,CAAC;YACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { Message, MessageAttachedStatus } from '@internal/react-components';\nimport { compareMessages } from './compareMessages';\nimport { MINUTE_IN_MS } from './constants';\n\n/**\n * @private\n */\nexport const updateMessagesWithAttached = (chatMessagesWithStatus: Message[]): void => {\n chatMessagesWithStatus.sort(compareMessages);\n chatMessagesWithStatus.forEach((message, index, messages) => {\n if (message.messageType === 'chat') {\n /**\n * Attached === true means it is within a group of messages in the current order\n * Attached === top/bottom means it is on the top/bottom boundary\n * Attached === false means it is just a single message\n * A group of messages: continuous messages that belong to the same sender and not intercepted by other senders.\n */\n let attached: boolean | MessageAttachedStatus = false;\n const previousMessage = index > 0 ? messages[index - 1] : undefined;\n const nextMessage = index === messages.length - 1 ? undefined : messages[index + 1];\n const previousSenderId = previousMessage?.messageType === 'chat' ? previousMessage.senderId : undefined;\n const nextSenderId = nextMessage?.messageType === 'chat' ? nextMessage.senderId : undefined;\n const timediff = new Date(message?.createdOn ?? '').getTime() - new Date(previousMessage?.createdOn ?? '').getTime();\n const diffMins = Math.round(timediff / MINUTE_IN_MS); // minutes\n\n if (previousSenderId !== message.senderId) {\n attached = message.senderId === nextSenderId ? 'top' : false;\n } else if (diffMins && diffMins >= 5) {\n // if there are more than or equal to 5 mins time gap between messages do not attach and show time stamp\n attached = false;\n } else {\n attached = message.senderId === nextSenderId ? true : 'bottom';\n }\n message.attached = attached;\n }\n });\n};"]}
|
@@ -122,5 +122,5 @@ export declare class ChatError extends Error {
|
|
122
122
|
*
|
123
123
|
* @public
|
124
124
|
*/
|
125
|
-
export type ChatErrorTarget = 'ChatClient.createChatThread' | 'ChatClient.deleteChatThread' | 'ChatClient.getChatThreadClient' | 'ChatClient.listChatThreads' | 'ChatClient.off' | 'ChatClient.on' | 'ChatClient.startRealtimeNotifications' | 'ChatClient.stopRealtimeNotifications' | 'ChatThreadClient.addParticipants' | 'ChatThreadClient.deleteMessage' | 'ChatThreadClient.getMessage' | 'ChatThreadClient.getProperties' | 'ChatThreadClient.listMessages' | 'ChatThreadClient.listParticipants' | 'ChatThreadClient.listReadReceipts' | 'ChatThreadClient.removeParticipant' | 'ChatThreadClient.sendMessage' | 'ChatThreadClient.sendReadReceipt' | 'ChatThreadClient.sendTypingNotification' | 'ChatThreadClient.updateMessage' |
|
125
|
+
export type ChatErrorTarget = 'ChatClient.createChatThread' | 'ChatClient.deleteChatThread' | 'ChatClient.getChatThreadClient' | 'ChatClient.listChatThreads' | 'ChatClient.off' | 'ChatClient.on' | 'ChatClient.startRealtimeNotifications' | 'ChatClient.stopRealtimeNotifications' | 'ChatThreadClient.addParticipants' | 'ChatThreadClient.deleteMessage' | 'ChatThreadClient.getMessage' | 'ChatThreadClient.getProperties' | 'ChatThreadClient.listMessages' | 'ChatThreadClient.listParticipants' | 'ChatThreadClient.listReadReceipts' | 'ChatThreadClient.removeParticipant' | 'ChatThreadClient.sendMessage' | 'ChatThreadClient.sendReadReceipt' | 'ChatThreadClient.sendTypingNotification' | 'ChatThreadClient.updateMessage' | 'ChatThreadClient.updateTopic';
|
126
126
|
//# sourceMappingURL=ChatClientState.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatClientState.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/ChatClientState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAwGlC;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAalC,YAAY,MAAuB,EAAE,UAAiB,EAAE,SAAgB;QACtE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,8EAA8E;QAC9E,IAAI,CAAC,SAAS,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;IAC9D,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\n\n/**\n * Centralized state for {@link @azure/communication-chat#ChatClient}.\n *\n * @public\n */\nexport type ChatClientState = {\n /**\n * Identifier of the current user.\n */\n userId: CommunicationIdentifierKind;\n /**\n * DisplayName of the current user.\n * The same value as what others see in {@link @azure/communication-chat#ChatParticipant.displayName}\n */\n displayName: string;\n /**\n * Chat threads joined by the current user.\n * Object with {@link ChatThreadClientState} fields, keyed by {@link ChatThreadClientState.threadId}.\n */\n threads: {\n [key: string]: ChatThreadClientState;\n };\n /**\n * Stores the latest error for each API method.\n *\n * See documentation of {@link ChatErrors} for details.\n */\n latestErrors: ChatErrors;\n};\n\n/**\n * Centralized state for {@link @azure/communication-chat#ChatThreadClient}.\n *\n * @public\n */\nexport type ChatThreadClientState = {\n /**\n * Messages in this thread.\n * Object with {@link ChatMessageWithStatus} entries\n * Local messages are keyed by keyed by {@link ChatMessageWithStatus.clientMessageId}.\n * Remote messages are keyed by {@link @azure/communication-chat#ChatMessage.id}.\n */\n chatMessages: {\n [key: string]: ChatMessageWithStatus;\n };\n /**\n * Participants of this chat thread.\n *\n * Object with {@link @azure/communication-chat#ChatParticipant} fields,\n * keyed by {@link @azure/communication-chat#ChatParticipant.id}.\n */\n participants: {\n [key: string]: ChatParticipant;\n };\n /**\n * Id of this chat thread. Returned from {@link @azure/communication-chat#ChatThreadClient.threadId}\n */\n threadId: string;\n /**\n * An object containing properties of this chat thread.\n */\n properties?: ChatThreadProperties;\n /**\n * An array of ReadReceipts of this chat thread. Returned from {@link @azure/communication-chat#ChatThreadClient.listReadReceipts}\n */\n readReceipts: ChatMessageReadReceipt[];\n /**\n * An array of typingIndicators of this chat thread. Captured from event listener of {@link @azure/communication-chat#ChatClient}\n * Stateful client only stores recent 8000ms real-time typing indicators data.\n */\n typingIndicators: TypingIndicatorReceivedEvent[];\n /**\n * Latest timestamp when other users read messages sent by current user.\n */\n latestReadTime: Date;\n};\n\n/**\n * Properties of a chat thread.\n *\n * We define a minimal one that helps us hide the different types used by underlying API.\n *\n * @public\n */\nexport type ChatThreadProperties = {\n topic?: string;\n};\n\n/**\n * Errors teed from API calls to the Chat SDK.\n *\n * Each property in the object stores the latest error for a particular SDK API method.\n *\n * @public\n */\nexport type ChatErrors = { [target in ChatErrorTarget]: ChatError };\n\n/**\n * Error thrown from failed {@link StatefulChatClient} methods.\n *\n * @public\n */\nexport class ChatError extends Error {\n /**\n * The API method target that failed.\n */\n public target: ChatErrorTarget;\n /**\n * Error thrown by the failed SDK method.\n */\n public innerError: Error;\n /**\n * Timestamp added to the error by the stateful layer.\n */\n public timestamp: Date;\n constructor(target: ChatErrorTarget, innerError: Error, timestamp?: Date) {\n super();\n this.target = target;\n this.innerError = innerError;\n // Testing note: It is easier to mock Date::now() than the Date() constructor.\n this.timestamp = timestamp ?? new Date(Date.now());\n this.name = 'ChatError';\n this.message = `${this.target}: ${this.innerError.message}`;\n }\n}\n\n/**\n * String literal type for all permissible keys in {@link ChatErrors}.\n *\n * @public\n */\nexport type ChatErrorTarget = 'ChatClient.createChatThread' | 'ChatClient.deleteChatThread' | 'ChatClient.getChatThreadClient' | 'ChatClient.listChatThreads' | 'ChatClient.off' | 'ChatClient.on' | 'ChatClient.startRealtimeNotifications' | 'ChatClient.stopRealtimeNotifications' | 'ChatThreadClient.addParticipants' | 'ChatThreadClient.deleteMessage' | 'ChatThreadClient.getMessage' | 'ChatThreadClient.getProperties' | 'ChatThreadClient.listMessages' | 'ChatThreadClient.listParticipants' | 'ChatThreadClient.listReadReceipts' | 'ChatThreadClient.removeParticipant' | 'ChatThreadClient.sendMessage' | 'ChatThreadClient.sendReadReceipt' | 'ChatThreadClient.sendTypingNotification' | 'ChatThreadClient.updateMessage' |
|
1
|
+
{"version":3,"file":"ChatClientState.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/ChatClientState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAwGlC;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAalC,YAAY,MAAuB,EAAE,UAAiB,EAAE,SAAgB;QACtE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,8EAA8E;QAC9E,IAAI,CAAC,SAAS,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;IAC9D,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\n\n/**\n * Centralized state for {@link @azure/communication-chat#ChatClient}.\n *\n * @public\n */\nexport type ChatClientState = {\n /**\n * Identifier of the current user.\n */\n userId: CommunicationIdentifierKind;\n /**\n * DisplayName of the current user.\n * The same value as what others see in {@link @azure/communication-chat#ChatParticipant.displayName}\n */\n displayName: string;\n /**\n * Chat threads joined by the current user.\n * Object with {@link ChatThreadClientState} fields, keyed by {@link ChatThreadClientState.threadId}.\n */\n threads: {\n [key: string]: ChatThreadClientState;\n };\n /**\n * Stores the latest error for each API method.\n *\n * See documentation of {@link ChatErrors} for details.\n */\n latestErrors: ChatErrors;\n};\n\n/**\n * Centralized state for {@link @azure/communication-chat#ChatThreadClient}.\n *\n * @public\n */\nexport type ChatThreadClientState = {\n /**\n * Messages in this thread.\n * Object with {@link ChatMessageWithStatus} entries\n * Local messages are keyed by keyed by {@link ChatMessageWithStatus.clientMessageId}.\n * Remote messages are keyed by {@link @azure/communication-chat#ChatMessage.id}.\n */\n chatMessages: {\n [key: string]: ChatMessageWithStatus;\n };\n /**\n * Participants of this chat thread.\n *\n * Object with {@link @azure/communication-chat#ChatParticipant} fields,\n * keyed by {@link @azure/communication-chat#ChatParticipant.id}.\n */\n participants: {\n [key: string]: ChatParticipant;\n };\n /**\n * Id of this chat thread. Returned from {@link @azure/communication-chat#ChatThreadClient.threadId}\n */\n threadId: string;\n /**\n * An object containing properties of this chat thread.\n */\n properties?: ChatThreadProperties;\n /**\n * An array of ReadReceipts of this chat thread. Returned from {@link @azure/communication-chat#ChatThreadClient.listReadReceipts}\n */\n readReceipts: ChatMessageReadReceipt[];\n /**\n * An array of typingIndicators of this chat thread. Captured from event listener of {@link @azure/communication-chat#ChatClient}\n * Stateful client only stores recent 8000ms real-time typing indicators data.\n */\n typingIndicators: TypingIndicatorReceivedEvent[];\n /**\n * Latest timestamp when other users read messages sent by current user.\n */\n latestReadTime: Date;\n};\n\n/**\n * Properties of a chat thread.\n *\n * We define a minimal one that helps us hide the different types used by underlying API.\n *\n * @public\n */\nexport type ChatThreadProperties = {\n topic?: string;\n};\n\n/**\n * Errors teed from API calls to the Chat SDK.\n *\n * Each property in the object stores the latest error for a particular SDK API method.\n *\n * @public\n */\nexport type ChatErrors = { [target in ChatErrorTarget]: ChatError };\n\n/**\n * Error thrown from failed {@link StatefulChatClient} methods.\n *\n * @public\n */\nexport class ChatError extends Error {\n /**\n * The API method target that failed.\n */\n public target: ChatErrorTarget;\n /**\n * Error thrown by the failed SDK method.\n */\n public innerError: Error;\n /**\n * Timestamp added to the error by the stateful layer.\n */\n public timestamp: Date;\n constructor(target: ChatErrorTarget, innerError: Error, timestamp?: Date) {\n super();\n this.target = target;\n this.innerError = innerError;\n // Testing note: It is easier to mock Date::now() than the Date() constructor.\n this.timestamp = timestamp ?? new Date(Date.now());\n this.name = 'ChatError';\n this.message = `${this.target}: ${this.innerError.message}`;\n }\n}\n\n/**\n * String literal type for all permissible keys in {@link ChatErrors}.\n *\n * @public\n */\nexport type ChatErrorTarget = 'ChatClient.createChatThread' | 'ChatClient.deleteChatThread' | 'ChatClient.getChatThreadClient' | 'ChatClient.listChatThreads' | 'ChatClient.off' | 'ChatClient.on' | 'ChatClient.startRealtimeNotifications' | 'ChatClient.stopRealtimeNotifications' | 'ChatThreadClient.addParticipants' | 'ChatThreadClient.deleteMessage' | 'ChatThreadClient.getMessage' | 'ChatThreadClient.getProperties' | 'ChatThreadClient.listMessages' | 'ChatThreadClient.listParticipants' | 'ChatThreadClient.listReadReceipts' | 'ChatThreadClient.removeParticipant' | 'ChatThreadClient.sendMessage' | 'ChatThreadClient.sendReadReceipt' | 'ChatThreadClient.sendTypingNotification' | 'ChatThreadClient.updateMessage' | 'ChatThreadClient.updateTopic';"]}
|
@@ -3,9 +3,8 @@ import { ChatMessageWithStatus } from './types/ChatMessageWithStatus';
|
|
3
3
|
import { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';
|
4
4
|
import { CommunicationIdentifierKind } from '@azure/communication-common';
|
5
5
|
import { TypingIndicatorReceivedEvent } from '@azure/communication-chat';
|
6
|
-
import type { CommunicationTokenCredential } from '@azure/communication-common';
|
7
6
|
/**
|
8
|
-
* @
|
7
|
+
* @internal
|
9
8
|
*/
|
10
9
|
export declare class ChatContext {
|
11
10
|
private _state;
|
@@ -13,8 +12,7 @@ export declare class ChatContext {
|
|
13
12
|
private _logger;
|
14
13
|
private _emitter;
|
15
14
|
private typingIndicatorInterval;
|
16
|
-
|
17
|
-
constructor(maxListeners?: number, /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ credential?: CommunicationTokenCredential);
|
15
|
+
constructor(maxListeners?: number);
|
18
16
|
getState(): ChatClientState;
|
19
17
|
modifyState(modifier: (draft: ChatClientState) => void): void;
|
20
18
|
setThread(threadId: string, threadState: ChatThreadClientState): void;
|
@@ -38,7 +36,6 @@ export declare class ChatContext {
|
|
38
36
|
private startTypingIndicatorCleanUp;
|
39
37
|
addTypingIndicator(threadId: string, typingIndicator: TypingIndicatorReceivedEvent): void;
|
40
38
|
setChatMessage(threadId: string, message: ChatMessageWithStatus): void;
|
41
|
-
private parseAttachments;
|
42
39
|
/**
|
43
40
|
* Tees any errors encountered in an async function to the state.
|
44
41
|
*
|
@@ -16,16 +16,14 @@ import { createClientLogger, getLogLevel } from '@azure/logger';
|
|
16
16
|
import { _safeJSONStringify, toFlatCommunicationIdentifier } from "../../acs-ui-common/src";
|
17
17
|
import { Constants } from './Constants';
|
18
18
|
import { chatStatefulLogger } from './Logger';
|
19
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
20
|
-
import { ResourceDownloadQueue, requestAttachments } from './ResourceDownloadQueue';
|
21
19
|
enableMapSet();
|
22
20
|
// Needed to generate state diff for verbose logging.
|
23
21
|
enablePatches();
|
24
22
|
/**
|
25
|
-
* @
|
23
|
+
* @internal
|
26
24
|
*/
|
27
25
|
export class ChatContext {
|
28
|
-
constructor(maxListeners
|
26
|
+
constructor(maxListeners) {
|
29
27
|
this._state = {
|
30
28
|
userId: {
|
31
29
|
id: ''
|
@@ -36,14 +34,8 @@ export class ChatContext {
|
|
36
34
|
};
|
37
35
|
this._batchMode = false;
|
38
36
|
this.typingIndicatorInterval = undefined;
|
39
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
40
|
-
this._messageQueue = undefined;
|
41
37
|
this._logger = createClientLogger('communication-react:chat-context');
|
42
38
|
this._emitter = new EventEmitter();
|
43
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
44
|
-
if (credential) {
|
45
|
-
this._messageQueue = new ResourceDownloadQueue(this, credential);
|
46
|
-
}
|
47
39
|
if (maxListeners) {
|
48
40
|
this._emitter.setMaxListeners(maxListeners);
|
49
41
|
}
|
@@ -267,8 +259,6 @@ export class ChatContext {
|
|
267
259
|
this.startTypingIndicatorCleanUp();
|
268
260
|
}
|
269
261
|
setChatMessage(threadId, message) {
|
270
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
271
|
-
this.parseAttachments(threadId, message);
|
272
262
|
const { id: messageId, clientMessageId } = message;
|
273
263
|
if (messageId || clientMessageId) {
|
274
264
|
this.modifyState((draft) => {
|
@@ -287,18 +277,6 @@ export class ChatContext {
|
|
287
277
|
});
|
288
278
|
}
|
289
279
|
}
|
290
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
291
|
-
parseAttachments(threadId, message) {
|
292
|
-
var _a;
|
293
|
-
const attachments = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments;
|
294
|
-
if (message.type === 'html' && attachments && attachments.length > 0) {
|
295
|
-
if (this._messageQueue && !this._messageQueue.containsMessageWithSameAttachments(message) && message.resourceCache === undefined) {
|
296
|
-
// Need to discuss retry logic in case of failure
|
297
|
-
this._messageQueue.addMessage(message);
|
298
|
-
this._messageQueue.startQueue(threadId, requestAttachments);
|
299
|
-
}
|
300
|
-
}
|
301
|
-
}
|
302
280
|
/**
|
303
281
|
* Tees any errors encountered in an async function to the state.
|
304
282
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatContext.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/ChatContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACv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,OAAyC;QAC7D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AACD,MAAM,WAAW,GAAG,CAAC,MAAuB,EAAE,KAAc,EAAa,EAAE;IACzE,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport EventEmitter from 'events';\nimport { enableMapSet, enablePatches, produce, Patch } from 'immer';\nimport { ChatClientState, ChatErrors, ChatThreadClientState, ChatThreadProperties, ChatErrorTarget, ChatError } from './ChatClientState';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nimport { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';\nimport { CommunicationIdentifierKind, UnknownIdentifierKind } from '@azure/communication-common';\nimport { AzureLogger, createClientLogger, getLogLevel } from '@azure/logger';\nimport { _safeJSONStringify, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { Constants } from './Constants';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { chatStatefulLogger } from './Logger';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport type { CommunicationTokenCredential } from '@azure/communication-common';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ResourceDownloadQueue, requestAttachments } from './ResourceDownloadQueue';\nenableMapSet();\n// Needed to generate state diff for verbose logging.\nenablePatches();\n\n/**\n * @private\n */\nexport class ChatContext {\n private _state: ChatClientState = {\n userId: ({\n id: ''\n } as UnknownIdentifierKind),\n displayName: '',\n threads: {},\n latestErrors: ({} as ChatErrors)\n };\n private _batchMode = false;\n private _logger: AzureLogger;\n private _emitter: EventEmitter;\n private typingIndicatorInterval: number | undefined = undefined;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n private _messageQueue: ResourceDownloadQueue | undefined = undefined;\n constructor(maxListeners?: number, /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */credential?: CommunicationTokenCredential) {\n this._logger = createClientLogger('communication-react:chat-context');\n this._emitter = new EventEmitter();\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n if (credential) {\n this._messageQueue = new ResourceDownloadQueue(this, credential);\n }\n if (maxListeners) {\n this._emitter.setMaxListeners(maxListeners);\n }\n }\n public getState(): ChatClientState {\n return this._state;\n }\n public modifyState(modifier: (draft: ChatClientState) => void): void {\n const priorState = this._state;\n this._state = produce(this._state, modifier, (patches: Patch[]) => {\n if (getLogLevel() === 'verbose') {\n // Log to `info` because AzureLogger.verbose() doesn't show up in console.\n this._logger.info(`State change: ${_safeJSONStringify(patches)}`);\n }\n });\n if (!this._batchMode && this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n public setThread(threadId: string, threadState: ChatThreadClientState): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = threadState;\n });\n }\n public createThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = {\n chatMessages: {},\n threadId: threadId,\n properties: properties,\n participants: {},\n readReceipts: [],\n typingIndicators: [],\n latestReadTime: new Date(0)\n };\n });\n }\n public updateChatConfig(userId: CommunicationIdentifierKind, displayName: string): void {\n this.modifyState((draft: ChatClientState) => {\n draft.displayName = displayName;\n draft.userId = userId;\n });\n }\n public createThreadIfNotExist(threadId: string, properties?: ChatThreadProperties): boolean {\n const exists = Object.prototype.hasOwnProperty.call(this.getState().threads, threadId);\n if (!exists) {\n this.createThread(threadId, properties);\n return true;\n }\n return false;\n }\n public updateThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n thread.properties = properties;\n }\n });\n }\n public updateThreadTopic(threadId: string, topic?: string): void {\n this.modifyState((draft: ChatClientState) => {\n if (topic === undefined) {\n return;\n }\n const thread = draft.threads[threadId];\n if (thread && !thread.properties) {\n thread.properties = {\n topic: topic\n };\n } else if (thread && thread.properties) {\n thread.properties.topic = topic;\n }\n });\n }\n public deleteThread(threadId: string): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n delete draft.threads[threadId];\n }\n });\n }\n public setChatMessages(threadId: string, messages: {\n [key: string]: ChatMessageWithStatus;\n }): void {\n this.modifyState((draft: ChatClientState) => {\n const threadState = draft.threads[threadId];\n if (threadState) {\n threadState.chatMessages = messages;\n }\n\n // remove typing indicator when receive messages\n const thread = draft.threads[threadId];\n if (thread) {\n for (const message of Object.values(messages)) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n }\n });\n }\n public updateChatMessageContent(threadId: string, messagesId: string, content: string | undefined): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessage = draft.threads[threadId]?.chatMessages[messagesId];\n if (chatMessage) {\n if (!chatMessage.content) {\n chatMessage.content = {};\n }\n chatMessage.content.message = content;\n }\n });\n }\n public deleteLocalMessage(threadId: string, localId: string): boolean {\n let localMessageDeleted = false;\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n const message: ChatMessageWithStatus | undefined = chatMessages ? chatMessages[localId] : undefined;\n if (chatMessages && message && message.clientMessageId) {\n delete chatMessages[message.clientMessageId];\n localMessageDeleted = true;\n }\n });\n return localMessageDeleted;\n }\n public deleteMessage(threadId: string, id: string): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n if (chatMessages) {\n delete chatMessages[id];\n }\n });\n }\n public setParticipant(threadId: string, participant: ChatParticipant): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participants[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n });\n }\n public setParticipants(threadId: string, participants: ChatParticipant[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participantsMap = draft.threads[threadId]?.participants;\n if (participantsMap) {\n for (const participant of participants) {\n participantsMap[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n }\n });\n }\n public deleteParticipants(threadId: string, participantIds: CommunicationIdentifierKind[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participantIds.forEach(id => {\n delete participants[toFlatCommunicationIdentifier(id)];\n });\n }\n });\n }\n public deleteParticipant(threadId: string, participantId: CommunicationIdentifierKind): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n delete participants[toFlatCommunicationIdentifier(participantId)];\n }\n });\n }\n public addReadReceipt(threadId: string, readReceipt: ChatMessageReadReceipt): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n const readReceipts = thread?.readReceipts;\n if (thread && readReceipts) {\n // TODO(prprabhu): Replace `this.getState()` with `draft`?\n if (readReceipt.sender !== this.getState().userId && thread.latestReadTime < readReceipt.readOn) {\n thread.latestReadTime = readReceipt.readOn;\n }\n readReceipts.push(readReceipt);\n }\n });\n }\n private startTypingIndicatorCleanUp(): void {\n if (this.typingIndicatorInterval) {\n return;\n }\n this.typingIndicatorInterval = window.setInterval(() => {\n let isTypingActive = false;\n this.modifyState((draft: ChatClientState) => {\n for (const thread of Object.values(draft.threads)) {\n const filteredTypingIndicators = thread.typingIndicators.filter(typingIndicator => {\n const timeGap = Date.now() - typingIndicator.receivedOn.getTime();\n return timeGap < Constants.TYPING_INDICATOR_MAINTAIN_TIME;\n });\n if (thread.typingIndicators.length !== filteredTypingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n if (thread.typingIndicators.length > 0) {\n isTypingActive = true;\n }\n }\n });\n if (!isTypingActive && this.typingIndicatorInterval) {\n window.clearInterval(this.typingIndicatorInterval);\n this.typingIndicatorInterval = undefined;\n }\n }, 1000);\n }\n public addTypingIndicator(threadId: string, typingIndicator: TypingIndicatorReceivedEvent): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n const typingIndicators = thread.typingIndicators;\n typingIndicators.push(typingIndicator);\n }\n });\n\n // Make sure we only maintain a period of typing indicator for perf purposes\n this.startTypingIndicatorCleanUp();\n }\n public setChatMessage(threadId: string, message: ChatMessageWithStatus): void {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.parseAttachments(threadId, message);\n const {\n id: messageId,\n clientMessageId\n } = message;\n if (messageId || clientMessageId) {\n this.modifyState((draft: ChatClientState) => {\n const threadMessages = draft.threads[threadId]?.chatMessages;\n const isLocalIdInMap = threadMessages && clientMessageId && threadMessages[clientMessageId];\n const messageKey = !messageId || isLocalIdInMap ? clientMessageId : messageId;\n if (threadMessages && messageKey) {\n threadMessages[messageKey] = message;\n }\n\n // remove typing indicator when receive a message from a user\n const thread = draft.threads[threadId];\n if (thread) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n });\n }\n }\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n private parseAttachments(threadId: string, message: ChatMessageWithStatus): void {\n const attachments = message.content?.attachments;\n if (message.type === 'html' && attachments && attachments.length > 0) {\n if (this._messageQueue && !this._messageQueue.containsMessageWithSameAttachments(message) && message.resourceCache === undefined) {\n // Need to discuss retry logic in case of failure\n this._messageQueue.addMessage(message);\n this._messageQueue.startQueue(threadId, requestAttachments);\n }\n }\n }\n\n /**\n * Tees any errors encountered in an async function to the state.\n *\n * @param f Async function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withAsyncErrorTeedToState<Args extends unknown[], R>(f: (...args: Args) => Promise<R>, target: ChatErrorTarget): (...args: Args) => Promise<R> {\n return async (...args: Args): Promise<R> => {\n try {\n return await f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n\n /**\n * Tees any errors encountered in an function to the state.\n *\n * @param f Function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withErrorTeedToState<Args extends unknown[], R>(f: (...args: Args) => R, target: ChatErrorTarget): (...args: Args) => R {\n return (...args: Args): R => {\n try {\n chatStatefulLogger.info(`Chat stateful client target function called: ${target}`);\n return f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n private setLatestError(target: ChatErrorTarget, error: ChatError): void {\n this.modifyState((draft: ChatClientState) => {\n draft.latestErrors[target] = error;\n });\n }\n\n // This is a mutating function, only use it inside of a produce() function\n private filterTypingIndicatorForUser(thread: ChatThreadClientState, userId?: CommunicationIdentifierKind): void {\n if (!userId) {\n return;\n }\n const typingIndicators = thread.typingIndicators;\n const userIdAsKey = toFlatCommunicationIdentifier(userId);\n const filteredTypingIndicators = typingIndicators.filter(typingIndicator => toFlatCommunicationIdentifier(typingIndicator.sender) !== userIdAsKey);\n if (filteredTypingIndicators.length !== typingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n }\n\n /**\n * Batch updates to minimize `stateChanged` events across related operations.\n *\n * - A maximum of one `stateChanged` event is emitted, at the end of the operations.\n * - No `stateChanged` event is emitted if the state did not change through the operations.\n * - In case of an exception, state is reset to the prior value and no `stateChanged` event is emitted.\n *\n * All operations finished in this batch should be synchronous.\n * This function is not reentrant -- do not call batch() from within another batch().\n */\n public batch(operations: () => void): void {\n if (this._batchMode) {\n throw new Error('batch() called from within another batch()');\n }\n this._batchMode = true;\n const priorState = this._state;\n try {\n operations();\n if (this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n } catch (e) {\n this._state = priorState;\n if (getLogLevel() === 'verbose') {\n this._logger.warning(`State rollback to: ${_safeJSONStringify(priorState)}`);\n }\n throw e;\n } finally {\n this._batchMode = false;\n }\n }\n public onStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.on('stateChanged', handler);\n }\n public offStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.off('stateChanged', handler);\n }\n}\nconst toChatError = (target: ChatErrorTarget, error: unknown): ChatError => {\n if (error instanceof Error) {\n return new ChatError(target, error);\n }\n return new ChatError(target, new Error(`${error}`));\n};"]}
|
1
|
+
{"version":3,"file":"ChatContext.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/ChatContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAS,MAAM,OAAO,CAAC;AACpE,OAAO,EAA6F,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAIzI,OAAO,EAAe,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,gCAAgC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,YAAY,EAAE,CAAC;AACf,qDAAqD;AACrD,aAAa,EAAE,CAAC;AAEhB;;GAEG;AACH,MAAM,OAAO,WAAW;IAatB,YAAY,YAAqB;QAZzB,WAAM,GAAoB;YAChC,MAAM,EAAG;gBACP,EAAE,EAAE,EAAE;aACmB;YAC3B,WAAW,EAAE,EAAE;YACf,OAAO,EAAE,EAAE;YACX,YAAY,EAAG,EAAiB;SACjC,CAAC;QACM,eAAU,GAAG,KAAK,CAAC;QAGnB,4BAAuB,GAAuB,SAAS,CAAC;QAE9D,IAAI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EventEmitter from 'events';\nimport { enableMapSet, enablePatches, produce, Patch } from 'immer';\nimport { ChatClientState, ChatErrors, ChatThreadClientState, ChatThreadProperties, ChatErrorTarget, ChatError } from './ChatClientState';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nimport { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';\nimport { CommunicationIdentifierKind, UnknownIdentifierKind } from '@azure/communication-common';\nimport { AzureLogger, createClientLogger, getLogLevel } from '@azure/logger';\nimport { _safeJSONStringify, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { Constants } from './Constants';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { chatStatefulLogger } from './Logger';\nenableMapSet();\n// Needed to generate state diff for verbose logging.\nenablePatches();\n\n/**\n * @internal\n */\nexport class ChatContext {\n private _state: ChatClientState = {\n userId: ({\n id: ''\n } as UnknownIdentifierKind),\n displayName: '',\n threads: {},\n latestErrors: ({} as ChatErrors)\n };\n private _batchMode = false;\n private _logger: AzureLogger;\n private _emitter: EventEmitter;\n private typingIndicatorInterval: number | undefined = undefined;\n constructor(maxListeners?: number) {\n this._logger = createClientLogger('communication-react:chat-context');\n this._emitter = new EventEmitter();\n if (maxListeners) {\n this._emitter.setMaxListeners(maxListeners);\n }\n }\n public getState(): ChatClientState {\n return this._state;\n }\n public modifyState(modifier: (draft: ChatClientState) => void): void {\n const priorState = this._state;\n this._state = produce(this._state, modifier, (patches: Patch[]) => {\n if (getLogLevel() === 'verbose') {\n // Log to `info` because AzureLogger.verbose() doesn't show up in console.\n this._logger.info(`State change: ${_safeJSONStringify(patches)}`);\n }\n });\n if (!this._batchMode && this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n public setThread(threadId: string, threadState: ChatThreadClientState): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = threadState;\n });\n }\n public createThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n draft.threads[threadId] = {\n chatMessages: {},\n threadId: threadId,\n properties: properties,\n participants: {},\n readReceipts: [],\n typingIndicators: [],\n latestReadTime: new Date(0)\n };\n });\n }\n public updateChatConfig(userId: CommunicationIdentifierKind, displayName: string): void {\n this.modifyState((draft: ChatClientState) => {\n draft.displayName = displayName;\n draft.userId = userId;\n });\n }\n public createThreadIfNotExist(threadId: string, properties?: ChatThreadProperties): boolean {\n const exists = Object.prototype.hasOwnProperty.call(this.getState().threads, threadId);\n if (!exists) {\n this.createThread(threadId, properties);\n return true;\n }\n return false;\n }\n public updateThread(threadId: string, properties?: ChatThreadProperties): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n thread.properties = properties;\n }\n });\n }\n public updateThreadTopic(threadId: string, topic?: string): void {\n this.modifyState((draft: ChatClientState) => {\n if (topic === undefined) {\n return;\n }\n const thread = draft.threads[threadId];\n if (thread && !thread.properties) {\n thread.properties = {\n topic: topic\n };\n } else if (thread && thread.properties) {\n thread.properties.topic = topic;\n }\n });\n }\n public deleteThread(threadId: string): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n delete draft.threads[threadId];\n }\n });\n }\n public setChatMessages(threadId: string, messages: {\n [key: string]: ChatMessageWithStatus;\n }): void {\n this.modifyState((draft: ChatClientState) => {\n const threadState = draft.threads[threadId];\n if (threadState) {\n threadState.chatMessages = messages;\n }\n\n // remove typing indicator when receive messages\n const thread = draft.threads[threadId];\n if (thread) {\n for (const message of Object.values(messages)) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n }\n });\n }\n public updateChatMessageContent(threadId: string, messagesId: string, content: string | undefined): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessage = draft.threads[threadId]?.chatMessages[messagesId];\n if (chatMessage) {\n if (!chatMessage.content) {\n chatMessage.content = {};\n }\n chatMessage.content.message = content;\n }\n });\n }\n public deleteLocalMessage(threadId: string, localId: string): boolean {\n let localMessageDeleted = false;\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n const message: ChatMessageWithStatus | undefined = chatMessages ? chatMessages[localId] : undefined;\n if (chatMessages && message && message.clientMessageId) {\n delete chatMessages[message.clientMessageId];\n localMessageDeleted = true;\n }\n });\n return localMessageDeleted;\n }\n public deleteMessage(threadId: string, id: string): void {\n this.modifyState((draft: ChatClientState) => {\n const chatMessages = draft.threads[threadId]?.chatMessages;\n if (chatMessages) {\n delete chatMessages[id];\n }\n });\n }\n public setParticipant(threadId: string, participant: ChatParticipant): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participants[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n });\n }\n public setParticipants(threadId: string, participants: ChatParticipant[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participantsMap = draft.threads[threadId]?.participants;\n if (participantsMap) {\n for (const participant of participants) {\n participantsMap[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n }\n });\n }\n public deleteParticipants(threadId: string, participantIds: CommunicationIdentifierKind[]): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n participantIds.forEach(id => {\n delete participants[toFlatCommunicationIdentifier(id)];\n });\n }\n });\n }\n public deleteParticipant(threadId: string, participantId: CommunicationIdentifierKind): void {\n this.modifyState((draft: ChatClientState) => {\n const participants = draft.threads[threadId]?.participants;\n if (participants) {\n delete participants[toFlatCommunicationIdentifier(participantId)];\n }\n });\n }\n public addReadReceipt(threadId: string, readReceipt: ChatMessageReadReceipt): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n const readReceipts = thread?.readReceipts;\n if (thread && readReceipts) {\n // TODO(prprabhu): Replace `this.getState()` with `draft`?\n if (readReceipt.sender !== this.getState().userId && thread.latestReadTime < readReceipt.readOn) {\n thread.latestReadTime = readReceipt.readOn;\n }\n readReceipts.push(readReceipt);\n }\n });\n }\n private startTypingIndicatorCleanUp(): void {\n if (this.typingIndicatorInterval) {\n return;\n }\n this.typingIndicatorInterval = window.setInterval(() => {\n let isTypingActive = false;\n this.modifyState((draft: ChatClientState) => {\n for (const thread of Object.values(draft.threads)) {\n const filteredTypingIndicators = thread.typingIndicators.filter(typingIndicator => {\n const timeGap = Date.now() - typingIndicator.receivedOn.getTime();\n return timeGap < Constants.TYPING_INDICATOR_MAINTAIN_TIME;\n });\n if (thread.typingIndicators.length !== filteredTypingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n if (thread.typingIndicators.length > 0) {\n isTypingActive = true;\n }\n }\n });\n if (!isTypingActive && this.typingIndicatorInterval) {\n window.clearInterval(this.typingIndicatorInterval);\n this.typingIndicatorInterval = undefined;\n }\n }, 1000);\n }\n public addTypingIndicator(threadId: string, typingIndicator: TypingIndicatorReceivedEvent): void {\n this.modifyState((draft: ChatClientState) => {\n const thread = draft.threads[threadId];\n if (thread) {\n const typingIndicators = thread.typingIndicators;\n typingIndicators.push(typingIndicator);\n }\n });\n\n // Make sure we only maintain a period of typing indicator for perf purposes\n this.startTypingIndicatorCleanUp();\n }\n public setChatMessage(threadId: string, message: ChatMessageWithStatus): void {\n const {\n id: messageId,\n clientMessageId\n } = message;\n if (messageId || clientMessageId) {\n this.modifyState((draft: ChatClientState) => {\n const threadMessages = draft.threads[threadId]?.chatMessages;\n const isLocalIdInMap = threadMessages && clientMessageId && threadMessages[clientMessageId];\n const messageKey = !messageId || isLocalIdInMap ? clientMessageId : messageId;\n if (threadMessages && messageKey) {\n threadMessages[messageKey] = message;\n }\n\n // remove typing indicator when receive a message from a user\n const thread = draft.threads[threadId];\n if (thread) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n });\n }\n }\n /**\n * Tees any errors encountered in an async function to the state.\n *\n * @param f Async function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withAsyncErrorTeedToState<Args extends unknown[], R>(f: (...args: Args) => Promise<R>, target: ChatErrorTarget): (...args: Args) => Promise<R> {\n return async (...args: Args): Promise<R> => {\n try {\n return await f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n\n /**\n * Tees any errors encountered in an function to the state.\n *\n * @param f Function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n public withErrorTeedToState<Args extends unknown[], R>(f: (...args: Args) => R, target: ChatErrorTarget): (...args: Args) => R {\n return (...args: Args): R => {\n try {\n chatStatefulLogger.info(`Chat stateful client target function called: ${target}`);\n return f(...args);\n } catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n private setLatestError(target: ChatErrorTarget, error: ChatError): void {\n this.modifyState((draft: ChatClientState) => {\n draft.latestErrors[target] = error;\n });\n }\n\n // This is a mutating function, only use it inside of a produce() function\n private filterTypingIndicatorForUser(thread: ChatThreadClientState, userId?: CommunicationIdentifierKind): void {\n if (!userId) {\n return;\n }\n const typingIndicators = thread.typingIndicators;\n const userIdAsKey = toFlatCommunicationIdentifier(userId);\n const filteredTypingIndicators = typingIndicators.filter(typingIndicator => toFlatCommunicationIdentifier(typingIndicator.sender) !== userIdAsKey);\n if (filteredTypingIndicators.length !== typingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n }\n\n /**\n * Batch updates to minimize `stateChanged` events across related operations.\n *\n * - A maximum of one `stateChanged` event is emitted, at the end of the operations.\n * - No `stateChanged` event is emitted if the state did not change through the operations.\n * - In case of an exception, state is reset to the prior value and no `stateChanged` event is emitted.\n *\n * All operations finished in this batch should be synchronous.\n * This function is not reentrant -- do not call batch() from within another batch().\n */\n public batch(operations: () => void): void {\n if (this._batchMode) {\n throw new Error('batch() called from within another batch()');\n }\n this._batchMode = true;\n const priorState = this._state;\n try {\n operations();\n if (this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n } catch (e) {\n this._state = priorState;\n if (getLogLevel() === 'verbose') {\n this._logger.warning(`State rollback to: ${_safeJSONStringify(priorState)}`);\n }\n throw e;\n } finally {\n this._batchMode = false;\n }\n }\n public onStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.on('stateChanged', handler);\n }\n public offStateChange(handler: (state: ChatClientState) => void): void {\n this._emitter.off('stateChanged', handler);\n }\n}\nconst toChatError = (target: ChatErrorTarget, error: unknown): ChatError => {\n if (error instanceof Error) {\n return new ChatError(target, error);\n }\n return new ChatError(target, new Error(`${error}`));\n};"]}
|
@@ -31,9 +31,7 @@ export class EventSubscriber {
|
|
31
31
|
id: event.id,
|
32
32
|
version: event.version,
|
33
33
|
content: {
|
34
|
-
message: event.message
|
35
|
-
/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
|
36
|
-
attachments: event.attachments
|
34
|
+
message: event.message
|
37
35
|
},
|
38
36
|
type: this.convertEventType(event.type),
|
39
37
|
sender: event.sender,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EventSubscriber.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/EventSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAIlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,iEAAiE;AACjE,wEAAwE;AACxE,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,eAAe;IAG1B,YAAY,UAAsB,EAAE,WAAwB;QAKpD,8BAAyB,GAAG,CAAC,KAAwD,EAAyB,EAAE;YACtH,OAAO,kBAAkB,CAAC;gBACxB,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,OAAO,E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UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;CA0JF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatClient, ChatMessageReadReceipt, ChatMessageType } from '@azure/communication-chat';\nimport { ChatMessageDeletedEvent, ChatMessageEditedEvent, ChatMessageReceivedEvent, ChatThreadCreatedEvent, ChatThreadDeletedEvent, ChatThreadPropertiesUpdatedEvent, ParticipantsAddedEvent, ParticipantsRemovedEvent, ReadReceiptReceivedEvent, TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatContext } from './ChatContext';\nimport { convertChatMessage } from './convertChatMessage';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\n\n// TODO: When we can get messageId of event from SDK, remove this\n// Maximum time to look back message list when we receive a system event\nconst maxSyncTimeInMs = 10 * 1000;\n\n/**\n * @private\n */\nexport class EventSubscriber {\n private chatClient: ChatClient;\n private chatContext: ChatContext;\n constructor(chatClient: ChatClient, chatContext: ChatContext) {\n this.chatClient = chatClient;\n this.chatContext = chatContext;\n this.subscribe();\n }\n private convertEventToChatMessage = (event: ChatMessageReceivedEvent | ChatMessageEditedEvent): ChatMessageWithStatus => {\n return convertChatMessage({\n id: event.id,\n version: event.version,\n content: {\n message: event.message,\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n attachments: event.attachments\n },\n type: this.convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n // Note: there is a bug in chatMessageReceived event that it is missing sequenceId\n createdOn: new Date(event.createdOn),\n editedOn: 'editedOn' in event ? event.editedOn : undefined,\n metadata: event.metadata\n });\n };\n\n // convert event type to chatMessage type, only possible type is 'html' and 'text' in chat event\n private convertEventType = (type: string): ChatMessageType => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n } else {\n return 'text';\n }\n };\n private onChatMessageReceived = (event: ChatMessageReceivedEvent): void => {\n // Today we are avoiding how to render these messages. In the future we can\n // remove this condition and handle this message appropriately.\n const messageEventType = event.type.toLowerCase();\n if (messageEventType !== 'text' && messageEventType !== 'richtext/html' && messageEventType !== 'html') {\n return;\n }\n const newMessage = this.convertEventToChatMessage(event);\n\n // Because of bug in chatMessageReceived event, if we already have that particular message in context, we want to\n // make sure to not overwrite the sequenceId when calling setChatMessage.\n const existingMessage = this.chatContext.getState().threads[event.threadId]?.chatMessages[event.id];\n if (existingMessage) {\n newMessage.sequenceId = existingMessage.sequenceId;\n }\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setChatMessage(event.threadId, newMessage);\n });\n };\n private onChatMessageDeleted = (event: ChatMessageDeletedEvent): void => {\n this.chatContext.deleteMessage(event.threadId, event.id);\n };\n private onChatMessageEdited = (event: ChatMessageEditedEvent): void => {\n const editedMessage = this.convertEventToChatMessage(event);\n this.chatContext.setChatMessage(event.threadId, convertChatMessage(editedMessage));\n };\n private onParticipantsAdded = (event: ParticipantsAddedEvent): void => {\n const participantsToAdd = event.participantsAdded.map(participant => ({\n ...participant,\n shareHistoryTime: participant.shareHistoryTime ? new Date(participant.shareHistoryTime) : undefined\n }));\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setParticipants(event.threadId, participantsToAdd);\n });\n this.fetchLastParticipantMessage(event.threadId, 'participantAdded');\n };\n\n // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.\n // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.\n private fetchLastParticipantMessage = async (threadId: string, actionType: 'participantAdded' | 'participantRemoved'): Promise<void> => {\n for await (const message of this.chatClient.getChatThreadClient(threadId).listMessages({\n startTime: new Date(Date.now() - maxSyncTimeInMs)\n })) {\n if (message.type === actionType) {\n this.chatContext.setChatMessage(threadId, {\n ...message,\n status: 'delivered'\n });\n }\n }\n };\n private onParticipantsRemoved = (event: ParticipantsRemovedEvent): void => {\n const participantIds = event.participantsRemoved.map(participant => {\n return participant.id;\n });\n this.chatContext.deleteParticipants(event.threadId, participantIds);\n\n // If the current user is removed from the thread, do not fetch the last participant message\n // as they no longer have access to the thread.\n const currentUserId = toFlatCommunicationIdentifier(this.chatContext.getState().userId);\n const wasCurrentUserRemoved = participantIds.find(id => toFlatCommunicationIdentifier(id) === currentUserId);\n if (!wasCurrentUserRemoved) {\n this.fetchLastParticipantMessage(event.threadId, 'participantRemoved');\n }\n };\n private onReadReceiptReceived = (event: ReadReceiptReceivedEvent): void => {\n const readReceipt: ChatMessageReadReceipt = {\n ...event,\n sender: event.sender,\n readOn: new Date(event.readOn)\n };\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.addReadReceipt(event.threadId, readReceipt);\n });\n };\n private onTypingIndicatorReceived = (typingIndicator: TypingIndicatorReceivedEvent): void => {\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(typingIndicator.threadId);\n this.chatContext.addTypingIndicator(typingIndicator.threadId, typingIndicator);\n });\n };\n private onChatThreadCreated = (event: ChatThreadCreatedEvent): void => {\n const properties = {\n topic: event.properties.topic\n };\n if (!this.chatContext.createThreadIfNotExist(event.threadId, properties)) {\n this.chatContext.updateThread(event.threadId, properties);\n }\n };\n private onChatThreadDeleted = (event: ChatThreadDeletedEvent): void => {\n this.chatContext.deleteThread(event.threadId);\n };\n private onChatThreadPropertiesUpdated = (event: ChatThreadPropertiesUpdatedEvent): void => {\n this.chatContext.updateThread(event.threadId, {\n topic: event.properties.topic\n });\n };\n public subscribe = (): void => {\n this.chatClient.on('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.on('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.on('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.on('participantsAdded', this.onParticipantsAdded);\n this.chatClient.on('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.on('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.on('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.on('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.on('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.on('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n public unsubscribe = (): void => {\n this.chatClient.off('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.off('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.off('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.off('participantsAdded', this.onParticipantsAdded);\n this.chatClient.off('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.off('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.off('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.off('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.off('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.off('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n}"]}
|
1
|
+
{"version":3,"file":"EventSubscriber.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/EventSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAIlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,iEAAiE;AACjE,wEAAwE;AACxE,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,eAAe;IAG1B,YAAY,UAAsB,EAAE,WAAwB;QAKpD,8BAAyB,GAAG,CAAC,KAAwD,EAAyB,EAAE;YACtH,OAAO,kBAAkB,CAAC;gBACxB,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ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AAW,CAAC;QAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;CAwJF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatClient, ChatMessageReadReceipt, ChatMessageType } from '@azure/communication-chat';\nimport { ChatMessageDeletedEvent, ChatMessageEditedEvent, ChatMessageReceivedEvent, ChatThreadCreatedEvent, ChatThreadDeletedEvent, ChatThreadPropertiesUpdatedEvent, ParticipantsAddedEvent, ParticipantsRemovedEvent, ReadReceiptReceivedEvent, TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatContext } from './ChatContext';\nimport { convertChatMessage } from './convertChatMessage';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\n\n// TODO: When we can get messageId of event from SDK, remove this\n// Maximum time to look back message list when we receive a system event\nconst maxSyncTimeInMs = 10 * 1000;\n\n/**\n * @private\n */\nexport class EventSubscriber {\n private chatClient: ChatClient;\n private chatContext: ChatContext;\n constructor(chatClient: ChatClient, chatContext: ChatContext) {\n this.chatClient = chatClient;\n this.chatContext = chatContext;\n this.subscribe();\n }\n private convertEventToChatMessage = (event: ChatMessageReceivedEvent | ChatMessageEditedEvent): ChatMessageWithStatus => {\n return convertChatMessage({\n id: event.id,\n version: event.version,\n content: {\n message: event.message\n },\n type: this.convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n // Note: there is a bug in chatMessageReceived event that it is missing sequenceId\n createdOn: new Date(event.createdOn),\n editedOn: 'editedOn' in event ? event.editedOn : undefined,\n metadata: event.metadata\n });\n };\n\n // convert event type to chatMessage type, only possible type is 'html' and 'text' in chat event\n private convertEventType = (type: string): ChatMessageType => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n } else {\n return 'text';\n }\n };\n private onChatMessageReceived = (event: ChatMessageReceivedEvent): void => {\n // Today we are avoiding how to render these messages. In the future we can\n // remove this condition and handle this message appropriately.\n const messageEventType = event.type.toLowerCase();\n if (messageEventType !== 'text' && messageEventType !== 'richtext/html' && messageEventType !== 'html') {\n return;\n }\n const newMessage = this.convertEventToChatMessage(event);\n\n // Because of bug in chatMessageReceived event, if we already have that particular message in context, we want to\n // make sure to not overwrite the sequenceId when calling setChatMessage.\n const existingMessage = this.chatContext.getState().threads[event.threadId]?.chatMessages[event.id];\n if (existingMessage) {\n newMessage.sequenceId = existingMessage.sequenceId;\n }\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setChatMessage(event.threadId, newMessage);\n });\n };\n private onChatMessageDeleted = (event: ChatMessageDeletedEvent): void => {\n this.chatContext.deleteMessage(event.threadId, event.id);\n };\n private onChatMessageEdited = (event: ChatMessageEditedEvent): void => {\n const editedMessage = this.convertEventToChatMessage(event);\n this.chatContext.setChatMessage(event.threadId, convertChatMessage(editedMessage));\n };\n private onParticipantsAdded = (event: ParticipantsAddedEvent): void => {\n const participantsToAdd = event.participantsAdded.map(participant => ({\n ...participant,\n shareHistoryTime: participant.shareHistoryTime ? new Date(participant.shareHistoryTime) : undefined\n }));\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setParticipants(event.threadId, participantsToAdd);\n });\n this.fetchLastParticipantMessage(event.threadId, 'participantAdded');\n };\n\n // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.\n // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.\n private fetchLastParticipantMessage = async (threadId: string, actionType: 'participantAdded' | 'participantRemoved'): Promise<void> => {\n for await (const message of this.chatClient.getChatThreadClient(threadId).listMessages({\n startTime: new Date(Date.now() - maxSyncTimeInMs)\n })) {\n if (message.type === actionType) {\n this.chatContext.setChatMessage(threadId, {\n ...message,\n status: 'delivered'\n });\n }\n }\n };\n private onParticipantsRemoved = (event: ParticipantsRemovedEvent): void => {\n const participantIds = event.participantsRemoved.map(participant => {\n return participant.id;\n });\n this.chatContext.deleteParticipants(event.threadId, participantIds);\n\n // If the current user is removed from the thread, do not fetch the last participant message\n // as they no longer have access to the thread.\n const currentUserId = toFlatCommunicationIdentifier(this.chatContext.getState().userId);\n const wasCurrentUserRemoved = participantIds.find(id => toFlatCommunicationIdentifier(id) === currentUserId);\n if (!wasCurrentUserRemoved) {\n this.fetchLastParticipantMessage(event.threadId, 'participantRemoved');\n }\n };\n private onReadReceiptReceived = (event: ReadReceiptReceivedEvent): void => {\n const readReceipt: ChatMessageReadReceipt = {\n ...event,\n sender: event.sender,\n readOn: new Date(event.readOn)\n };\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.addReadReceipt(event.threadId, readReceipt);\n });\n };\n private onTypingIndicatorReceived = (typingIndicator: TypingIndicatorReceivedEvent): void => {\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(typingIndicator.threadId);\n this.chatContext.addTypingIndicator(typingIndicator.threadId, typingIndicator);\n });\n };\n private onChatThreadCreated = (event: ChatThreadCreatedEvent): void => {\n const properties = {\n topic: event.properties.topic\n };\n if (!this.chatContext.createThreadIfNotExist(event.threadId, properties)) {\n this.chatContext.updateThread(event.threadId, properties);\n }\n };\n private onChatThreadDeleted = (event: ChatThreadDeletedEvent): void => {\n this.chatContext.deleteThread(event.threadId);\n };\n private onChatThreadPropertiesUpdated = (event: ChatThreadPropertiesUpdatedEvent): void => {\n this.chatContext.updateThread(event.threadId, {\n topic: event.properties.topic\n });\n };\n public subscribe = (): void => {\n this.chatClient.on('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.on('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.on('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.on('participantsAdded', this.onParticipantsAdded);\n this.chatClient.on('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.on('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.on('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.on('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.on('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.on('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n public unsubscribe = (): void => {\n this.chatClient.off('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.off('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.off('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.off('participantsAdded', this.onParticipantsAdded);\n this.chatClient.off('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.off('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.off('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.off('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.off('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.off('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n}"]}
|
@@ -123,7 +123,7 @@ export const _createStatefulChatClientInner = (args, options, telemetryImplement
|
|
123
123
|
* @internal
|
124
124
|
*/
|
125
125
|
export const _createStatefulChatClientWithDeps = (chatClient, args, options) => {
|
126
|
-
const context = new ChatContext(options === null || options === void 0 ? void 0 : options.maxStateChangeListeners
|
126
|
+
const context = new ChatContext(options === null || options === void 0 ? void 0 : options.maxStateChangeListeners);
|
127
127
|
let eventSubscriber;
|
128
128
|
context.updateChatConfig(getIdentifierKind(args.userId), args.displayName);
|
129
129
|
const proxy = new Proxy(chatClient, proxyChatClient);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"StatefulChatClient.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/StatefulChatClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,UAAU,EAAqB,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAgC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B,CAAC;AACvC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatClient, ChatClientOptions } from '@azure/communication-chat';\nimport { _getApplicationId, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport { ChatContext } from './ChatContext';\nimport { ChatClientState } from './ChatClientState';\nimport { EventSubscriber } from './EventSubscriber';\nimport { chatThreadClientDeclaratify } from './StatefulChatThreadClient';\nimport { createDecoratedListThreads } from './iterators/createDecoratedListThreads';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier, getIdentifierKind } from '@azure/communication-common';\nimport { chatStatefulLogger } from './Logger';\n\n/**\n * Defines the methods that allow {@Link @azure/communication-chat#ChatClient} to be used with a centralized generated state.\n *\n * The interface provides access to proxied state and also allows registering a handler for state change events.\n *\n * @public\n */\nexport interface StatefulChatClient extends ChatClient {\n /**\n * Holds all the state that we could proxy from ChatClient {@Link @azure/communication-chat#ChatClient} as\n * ChatClientState {@Link ChatClientState}.\n */\n getState(): ChatClientState;\n /**\n * Allows a handler to be registered for 'stateChanged' events.\n *\n * @param handler - Callback to receive the state.\n */\n onStateChange(handler: (state: ChatClientState) => void): void;\n /**\n * Allows unregistering for 'stateChanged' events.\n *\n * @param handler - Original callback to be unsubscribed.\n */\n offStateChange(handler: (state: ChatClientState) => void): void;\n}\ninterface StatefulChatClientWithPrivateProps extends StatefulChatClient {\n context: ChatContext;\n eventSubscriber: EventSubscriber | undefined;\n}\nconst proxyChatClient: ProxyHandler<ChatClient> = {\n get: function <P extends keyof StatefulChatClientWithPrivateProps>(chatClient: ChatClient, prop: P, receiver: StatefulChatClientWithPrivateProps) {\n // skip receiver.context call to avoid recursive bugs\n if (prop === 'context') {\n return Reflect.get(chatClient, prop);\n }\n const context = receiver.context;\n switch (prop) {\n case 'createChatThread':\n {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['createChatThread']>) {\n const result = await chatClient.createChatThread(...args);\n const thread = result.chatThread;\n if (thread) {\n const [request] = args;\n context.createThread(thread.id, {\n topic: request.topic\n });\n }\n return result;\n }, 'ChatClient.createChatThread');\n }\n case 'deleteChatThread':\n {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['deleteChatThread']>) {\n const result = await chatClient.deleteChatThread(...args);\n context.deleteThread(args[0]);\n return result;\n }, 'ChatClient.deleteChatThread');\n }\n case 'listChatThreads':\n {\n return createDecoratedListThreads(chatClient, context);\n }\n case 'getChatThreadClient':\n {\n return function (...args: Parameters<ChatClient['getChatThreadClient']>) {\n const chatThreadClient = chatClient.getChatThreadClient(...args);\n // TODO(prprabhu): Ensure that thread properties are fetched into the ChatContext at this point.\n // A new thread might be created here, but the properties will never be fetched.\n return chatThreadClientDeclaratify(chatThreadClient, context);\n };\n }\n case 'startRealtimeNotifications':\n {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['startRealtimeNotifications']>) {\n const ret = await chatClient.startRealtimeNotifications(...args);\n if (!receiver.eventSubscriber) {\n receiver.eventSubscriber = new EventSubscriber(chatClient, context);\n }\n return ret;\n }, 'ChatClient.startRealtimeNotifications');\n }\n case 'stopRealtimeNotifications':\n {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['stopRealtimeNotifications']>) {\n const ret = await chatClient.stopRealtimeNotifications(...args);\n if (receiver.eventSubscriber) {\n receiver.eventSubscriber.unsubscribe();\n receiver.eventSubscriber = undefined;\n }\n return ret;\n }, 'ChatClient.stopRealtimeNotifications');\n }\n default:\n return Reflect.get(chatClient, prop);\n }\n }\n};\n\n/**\n * Arguments to construct the {@link StatefulChatClient}.\n *\n * @public\n */\nexport type StatefulChatClientArgs = {\n userId: CommunicationUserIdentifier;\n displayName: string;\n endpoint: string;\n credential: CommunicationTokenCredential;\n};\n\n/**\n * Options to construct the {@link StatefulChatClient}.\n *\n * @public\n */\nexport type StatefulChatClientOptions = {\n /**\n * Options to construct the {@link @azure/communication-chat#ChatClient} with.\n */\n chatClientOptions: ChatClientOptions;\n /**\n * Sets the max listeners limit of the 'stateChange' event. Defaults to the node.js EventEmitter.defaultMaxListeners\n * if not specified.\n */\n maxStateChangeListeners?: number;\n};\n\n/**\n * Creates a stateful ChatClient {@link StatefulChatClient} by proxying ChatClient\n * {@link @azure/communication-chat#ChatClient} with ProxyChatClient {@link ProxyChatClient} which then allows access\n * to state in a declarative way.\n *\n * @public\n */\nexport const createStatefulChatClient = (args: StatefulChatClientArgs, options?: StatefulChatClientOptions): StatefulChatClient => {\n return _createStatefulChatClientInner(args, options);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createStatefulChatClientInner = (args: StatefulChatClientArgs, options?: StatefulChatClientOptions, telemetryImplementationHint: _TelemetryImplementationHint = 'StatefulComponents'): StatefulChatClient => {\n chatStatefulLogger.info(`Creating chat stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`);\n const tweakedOptions = {\n ...options,\n chatClientOptions: {\n ...options?.chatClientOptions,\n userAgentOptions: {\n userAgentPrefix: _getApplicationId(telemetryImplementationHint)\n }\n }\n };\n return _createStatefulChatClientWithDeps(new ChatClient(args.endpoint, args.credential, tweakedOptions.chatClientOptions), args, tweakedOptions);\n};\n\n/**\n * A function to modify the state of the StatefulChatClient.\n *\n * Provided as a callback to the {@link StatefulChatClient.modifyState} method.\n *\n * The function must modify the provided state in place as much as possible.\n * Making large modifications can lead to bad performance by causing spurious rerendering of the UI.\n *\n * Consider using commonly used modifier functions exported from this package.\n */\nexport type ChatStateModifier = (state: ChatClientState) => void;\n\n/**\n * Internal implementation of {@link createStatefulChatClient} for dependency injection.\n *\n * Used by tests. Should not be exported out of this package.\n * @internal\n */\nexport const _createStatefulChatClientWithDeps = (chatClient: ChatClient, args: StatefulChatClientArgs, options?: StatefulChatClientOptions): StatefulChatClient => {\n const context = new ChatContext(options?.maxStateChangeListeners, /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */args.credential);\n let eventSubscriber: EventSubscriber;\n context.updateChatConfig(getIdentifierKind(args.userId), args.displayName);\n const proxy = new Proxy(chatClient, proxyChatClient);\n Object.defineProperty(proxy, 'context', {\n configurable: false,\n get: () => context\n });\n Object.defineProperty(proxy, 'eventSubscriber', {\n configurable: false,\n get: () => eventSubscriber,\n set: (val: EventSubscriber) => {\n eventSubscriber = val;\n }\n });\n Object.defineProperty(proxy, 'getState', {\n configurable: false,\n value: () => context?.getState()\n });\n Object.defineProperty(proxy, 'onStateChange', {\n configurable: false,\n value: (handler: (state: ChatClientState) => void) => context?.onStateChange(handler)\n });\n Object.defineProperty(proxy, 'offStateChange', {\n configurable: false,\n value: (handler: (state: ChatClientState) => void) => context?.offStateChange(handler)\n });\n return (proxy as StatefulChatClient);\n};"]}
|
1
|
+
{"version":3,"file":"StatefulChatClient.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/StatefulChatClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,UAAU,EAAqB,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAgC,gCAAgC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAA6D,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3H,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAgC9C,MAAM,eAAe,GAA6B;IAChD,GAAG,EAAE,UAA8D,UAAsB,EAAE,IAAO,EAAE,QAA4C;QAC9I,qDAAqD;QACrD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;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AAG,GAAG,CAAC;QACxB,CAAC;KACF,CAAC,CAAC;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE;QACvC,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAAE;KACjC,CAAC,CAAC;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE;QAC5C,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,CAAC,OAAyC,EAAE,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAAC,OAAO,CAAC;KACtF,CAAC,CAAC;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,gBAAgB,EAAE;QAC7C,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,CAAC,OAAyC,EAAE,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,CAAC,OAAO,CAAC;KACvF,CAAC,CAAC;IACH,OAAQ,KAA4B,CAAC;AACvC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatClient, ChatClientOptions } from '@azure/communication-chat';\nimport { _getApplicationId, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport { ChatContext } from './ChatContext';\nimport { ChatClientState } from './ChatClientState';\nimport { EventSubscriber } from './EventSubscriber';\nimport { chatThreadClientDeclaratify } from './StatefulChatThreadClient';\nimport { createDecoratedListThreads } from './iterators/createDecoratedListThreads';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier, getIdentifierKind } from '@azure/communication-common';\nimport { chatStatefulLogger } from './Logger';\n\n/**\n * Defines the methods that allow {@Link @azure/communication-chat#ChatClient} to be used with a centralized generated state.\n *\n * The interface provides access to proxied state and also allows registering a handler for state change events.\n *\n * @public\n */\nexport interface StatefulChatClient extends ChatClient {\n /**\n * Holds all the state that we could proxy from ChatClient {@Link @azure/communication-chat#ChatClient} as\n * ChatClientState {@Link ChatClientState}.\n */\n getState(): ChatClientState;\n /**\n * Allows a handler to be registered for 'stateChanged' events.\n *\n * @param handler - Callback to receive the state.\n */\n onStateChange(handler: (state: ChatClientState) => void): void;\n /**\n * Allows unregistering for 'stateChanged' events.\n *\n * @param handler - Original callback to be unsubscribed.\n */\n offStateChange(handler: (state: ChatClientState) => void): void;\n}\ninterface StatefulChatClientWithPrivateProps extends StatefulChatClient {\n context: ChatContext;\n eventSubscriber: EventSubscriber | undefined;\n}\nconst proxyChatClient: ProxyHandler<ChatClient> = {\n get: function <P extends keyof StatefulChatClientWithPrivateProps>(chatClient: ChatClient, prop: P, receiver: StatefulChatClientWithPrivateProps) {\n // skip receiver.context call to avoid recursive bugs\n if (prop === 'context') {\n return Reflect.get(chatClient, prop);\n }\n const context = receiver.context;\n switch (prop) {\n case 'createChatThread':\n {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['createChatThread']>) {\n const result = await chatClient.createChatThread(...args);\n const thread = result.chatThread;\n if (thread) {\n const [request] = args;\n context.createThread(thread.id, {\n topic: request.topic\n });\n }\n return result;\n }, 'ChatClient.createChatThread');\n }\n case 'deleteChatThread':\n {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['deleteChatThread']>) {\n const result = await chatClient.deleteChatThread(...args);\n context.deleteThread(args[0]);\n return result;\n }, 'ChatClient.deleteChatThread');\n }\n case 'listChatThreads':\n {\n return createDecoratedListThreads(chatClient, context);\n }\n case 'getChatThreadClient':\n {\n return function (...args: Parameters<ChatClient['getChatThreadClient']>) {\n const chatThreadClient = chatClient.getChatThreadClient(...args);\n // TODO(prprabhu): Ensure that thread properties are fetched into the ChatContext at this point.\n // A new thread might be created here, but the properties will never be fetched.\n return chatThreadClientDeclaratify(chatThreadClient, context);\n };\n }\n case 'startRealtimeNotifications':\n {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['startRealtimeNotifications']>) {\n const ret = await chatClient.startRealtimeNotifications(...args);\n if (!receiver.eventSubscriber) {\n receiver.eventSubscriber = new EventSubscriber(chatClient, context);\n }\n return ret;\n }, 'ChatClient.startRealtimeNotifications');\n }\n case 'stopRealtimeNotifications':\n {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['stopRealtimeNotifications']>) {\n const ret = await chatClient.stopRealtimeNotifications(...args);\n if (receiver.eventSubscriber) {\n receiver.eventSubscriber.unsubscribe();\n receiver.eventSubscriber = undefined;\n }\n return ret;\n }, 'ChatClient.stopRealtimeNotifications');\n }\n default:\n return Reflect.get(chatClient, prop);\n }\n }\n};\n\n/**\n * Arguments to construct the {@link StatefulChatClient}.\n *\n * @public\n */\nexport type StatefulChatClientArgs = {\n userId: CommunicationUserIdentifier;\n displayName: string;\n endpoint: string;\n credential: CommunicationTokenCredential;\n};\n\n/**\n * Options to construct the {@link StatefulChatClient}.\n *\n * @public\n */\nexport type StatefulChatClientOptions = {\n /**\n * Options to construct the {@link @azure/communication-chat#ChatClient} with.\n */\n chatClientOptions: ChatClientOptions;\n /**\n * Sets the max listeners limit of the 'stateChange' event. Defaults to the node.js EventEmitter.defaultMaxListeners\n * if not specified.\n */\n maxStateChangeListeners?: number;\n};\n\n/**\n * Creates a stateful ChatClient {@link StatefulChatClient} by proxying ChatClient\n * {@link @azure/communication-chat#ChatClient} with ProxyChatClient {@link ProxyChatClient} which then allows access\n * to state in a declarative way.\n *\n * @public\n */\nexport const createStatefulChatClient = (args: StatefulChatClientArgs, options?: StatefulChatClientOptions): StatefulChatClient => {\n return _createStatefulChatClientInner(args, options);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createStatefulChatClientInner = (args: StatefulChatClientArgs, options?: StatefulChatClientOptions, telemetryImplementationHint: _TelemetryImplementationHint = 'StatefulComponents'): StatefulChatClient => {\n chatStatefulLogger.info(`Creating chat stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`);\n const tweakedOptions = {\n ...options,\n chatClientOptions: {\n ...options?.chatClientOptions,\n userAgentOptions: {\n userAgentPrefix: _getApplicationId(telemetryImplementationHint)\n }\n }\n };\n return _createStatefulChatClientWithDeps(new ChatClient(args.endpoint, args.credential, tweakedOptions.chatClientOptions), args, tweakedOptions);\n};\n\n/**\n * A function to modify the state of the StatefulChatClient.\n *\n * Provided as a callback to the {@link StatefulChatClient.modifyState} method.\n *\n * The function must modify the provided state in place as much as possible.\n * Making large modifications can lead to bad performance by causing spurious rerendering of the UI.\n *\n * Consider using commonly used modifier functions exported from this package.\n */\nexport type ChatStateModifier = (state: ChatClientState) => void;\n\n/**\n * Internal implementation of {@link createStatefulChatClient} for dependency injection.\n *\n * Used by tests. Should not be exported out of this package.\n * @internal\n */\nexport const _createStatefulChatClientWithDeps = (chatClient: ChatClient, args: StatefulChatClientArgs, options?: StatefulChatClientOptions): StatefulChatClient => {\n const context = new ChatContext(options?.maxStateChangeListeners);\n let eventSubscriber: EventSubscriber;\n context.updateChatConfig(getIdentifierKind(args.userId), args.displayName);\n const proxy = new Proxy(chatClient, proxyChatClient);\n Object.defineProperty(proxy, 'context', {\n configurable: false,\n get: () => context\n });\n Object.defineProperty(proxy, 'eventSubscriber', {\n configurable: false,\n get: () => eventSubscriber,\n set: (val: EventSubscriber) => {\n eventSubscriber = val;\n }\n });\n Object.defineProperty(proxy, 'getState', {\n configurable: false,\n value: () => context?.getState()\n });\n Object.defineProperty(proxy, 'onStateChange', {\n configurable: false,\n value: (handler: (state: ChatClientState) => void) => context?.onStateChange(handler)\n });\n Object.defineProperty(proxy, 'offStateChange', {\n configurable: false,\n value: (handler: (state: ChatClientState) => void) => context?.offStateChange(handler)\n });\n return (proxy as StatefulChatClient);\n};"]}
|
@@ -4,9 +4,6 @@
|
|
4
4
|
* @private
|
5
5
|
*/
|
6
6
|
export const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
|
7
|
-
|
8
|
-
return Object.assign(Object.assign({}, message), { clientMessageId: clientMessageId, status,
|
9
|
-
/* @conditional-compile-remove(data-loss-prevention) */
|
10
|
-
policyViolation: !!(((_a = message.sender) === null || _a === void 0 ? void 0 : _a.kind) === 'microsoftTeamsUser' && !!message.editedOn && ((_b = message.content) === null || _b === void 0 ? void 0 : _b.message) === '' && ((_c = message.content.attachments) === null || _c === void 0 ? void 0 : _c.length) === 0) });
|
7
|
+
return Object.assign(Object.assign({}, message), { clientMessageId: clientMessageId, status });
|
11
8
|
};
|
12
9
|
//# sourceMappingURL=convertChatMessage.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"convertChatMessage.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/convertChatMessage.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAoB,EAAE,SAAwB,WAAW,EAAE,eAAwB,EAAyB,EAAE
|
1
|
+
{"version":3,"file":"convertChatMessage.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/convertChatMessage.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAoB,EAAE,SAAwB,WAAW,EAAE,eAAwB,EAAyB,EAAE;IAC/I,uCACK,OAAO,KACV,eAAe,EAAE,eAAe,EAChC,MAAM,IACN;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatMessage } from '@azure/communication-chat';\nimport { MessageStatus } from '@internal/acs-ui-common';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\n\n/**\n * @private\n */\nexport const convertChatMessage = (message: ChatMessage, status: MessageStatus = 'delivered', clientMessageId?: string): ChatMessageWithStatus => {\n return {\n ...message,\n clientMessageId: clientMessageId,\n status\n };\n};"]}
|
@@ -11,7 +11,5 @@ import { MessageStatus } from "../../../acs-ui-common/src";
|
|
11
11
|
export type ChatMessageWithStatus = ChatMessage & {
|
12
12
|
clientMessageId?: string;
|
13
13
|
status: MessageStatus;
|
14
|
-
policyViolation?: boolean;
|
15
|
-
resourceCache?: Record<string, string>;
|
16
14
|
};
|
17
15
|
//# sourceMappingURL=ChatMessageWithStatus.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatMessageWithStatus.js","sourceRoot":"","sources":["../../../../../preprocess-dist/chat-stateful-client/src/types/ChatMessageWithStatus.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatMessage } from '@azure/communication-chat';\nimport { MessageStatus } from '@internal/acs-ui-common';\n\n/**\n * An extension to {@link @azure/communication-chat#ChatMessage} that stores\n * client-side only metadata for chat messages.\n *\n * TODO: The name has bitrotted. Rename me.\n *\n * @public\n */\nexport type ChatMessageWithStatus = ChatMessage & {\n clientMessageId?: string;\n status: MessageStatus;\n
|
1
|
+
{"version":3,"file":"ChatMessageWithStatus.js","sourceRoot":"","sources":["../../../../../preprocess-dist/chat-stateful-client/src/types/ChatMessageWithStatus.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatMessage } from '@azure/communication-chat';\nimport { MessageStatus } from '@internal/acs-ui-common';\n\n/**\n * An extension to {@link @azure/communication-chat#ChatMessage} that stores\n * client-side only metadata for chat messages.\n *\n * TODO: The name has bitrotted. Rename me.\n *\n * @public\n */\nexport type ChatMessageWithStatus = ChatMessage & {\n clientMessageId?: string;\n status: MessageStatus;\n};"]}
|
@@ -21,52 +21,25 @@ export type { VideoBackgroundEffectsDependency, CallingHandlersOptions } from '.
|
|
21
21
|
export type { CaptionsOptions } from '../../calling-component-bindings/src';
|
22
22
|
export type { ChatClientProviderProps, ChatThreadClientProviderProps, GetChatSelector, ChatHandlers, ChatBaseSelectorProps } from '../../chat-component-bindings/src';
|
23
23
|
export { CallClientProvider, CallAgentProvider, CallProvider, useCallClient, useCallAgent, useCall, useDeviceManager, getCallingSelector, createDefaultCallingHandlers } from '../../calling-component-bindings/src';
|
24
|
-
export { useTeamsCallAgent, useTeamsCall, createDefaultTeamsCallingHandlers } from '../../calling-component-bindings/src';
|
25
|
-
export type { TeamsCallingHandlers } from '../../calling-component-bindings/src';
|
26
24
|
export type { ScreenShareButtonSelector, CameraButtonSelector, VideoGallerySelector, DevicesButtonSelector, EmptySelector, ErrorBarSelector as CallErrorBarSelector, ParticipantListSelector, MicrophoneButtonSelector, ParticipantsButtonSelector, CreateDefaultCallingHandlers } from '../../calling-component-bindings/src';
|
27
|
-
export type { HoldButtonSelector } from '../../calling-component-bindings/src';
|
28
25
|
export type { RaiseHandButtonSelector } from '../../calling-component-bindings/src';
|
29
26
|
export { ChatClientProvider, ChatThreadClientProvider, useChatClient, useChatThreadClient, getChatSelector, createDefaultChatHandlers } from '../../chat-component-bindings/src';
|
30
27
|
export type { MessageThreadSelector, TypingIndicatorSelector, ChatParticipantListSelector, SendBoxSelector, ErrorBarSelector as ChatErrorBarSelector } from '../../chat-component-bindings/src';
|
31
28
|
export { _IdentifierProvider, CameraButton, ControlBar, ControlBarButton, DevicesButton, EndCallButton, ErrorBar, GridLayout, LocalizationProvider, MessageStatusIndicator, MessageThread, MicrophoneButton, ParticipantItem, ParticipantList, ParticipantsButton, ScreenShareButton, SendBox, StreamMedia, TypingIndicator, VideoGallery, VideoTile, COMPONENT_LOCALE_EN_GB, COMPONENT_LOCALE_AR_SA, COMPONENT_LOCALE_CS_CZ, COMPONENT_LOCALE_DE_DE, COMPONENT_LOCALE_ES_ES, COMPONENT_LOCALE_FI_FI, COMPONENT_LOCALE_FR_FR, COMPONENT_LOCALE_HE_IL, COMPONENT_LOCALE_IT_IT, COMPONENT_LOCALE_JA_JP, COMPONENT_LOCALE_KO_KR, COMPONENT_LOCALE_NB_NO, COMPONENT_LOCALE_NL_NL, COMPONENT_LOCALE_PL_PL, COMPONENT_LOCALE_PT_BR, COMPONENT_LOCALE_RU_RU, COMPONENT_LOCALE_SV_SE, COMPONENT_LOCALE_TR_TR, COMPONENT_LOCALE_ZH_CN, COMPONENT_LOCALE_ZH_TW } from '../../react-components/src';
|
32
|
-
export { ImageGallery } from '../../react-components/src';
|
33
|
-
export { HoldButton } from '../../react-components/src';
|
34
29
|
export { RaiseHandButton } from '../../react-components/src';
|
35
30
|
export { Dialpad } from '../../react-components/src';
|
36
|
-
export {
|
37
|
-
export type { CameraAndMicrophoneSitePermissionsStrings, CameraAndMicrophoneSitePermissionsProps, CameraSitePermissionsStrings, CameraSitePermissionsProps, CommonSitePermissionsProps, SitePermissionsStrings, SitePermissionsStyles, MicrophoneSitePermissionsStrings, MicrophoneSitePermissionsProps } from '../../react-components/src';
|
38
|
-
export type { ParticipantListStrings } from '../../react-components/src';
|
39
|
-
export type { MentionOptions, MentionDisplayOptions, MentionLookupOptions, Mention, MentionPopoverStrings } from '../../react-components/src';
|
40
|
-
export type { _IdentifierProviderProps, _Identifiers, ActiveErrorMessage, BaseCustomStyles, CallParticipantListParticipant, CameraButtonContextualMenuStyles, CameraButtonProps, CameraButtonStrings, CameraButtonStyles, ChatMessage, CommunicationParticipant, ComponentLocale, ComponentSlotStyle, ComponentStrings, ContentSystemMessage, ControlBarButtonProps, ControlBarButtonStrings, ControlBarButtonStyles, ControlBarLayout, ControlBarProps, CreateVideoStreamViewResult, CustomAvatarOptions, CustomMessage, DevicesButtonContextualMenuStyles, DevicesButtonProps, DevicesButtonStrings, DevicesButtonStyles, EndCallButtonProps, EndCallButtonStrings, ErrorBarProps, ErrorBarStrings, ErrorType, GridLayoutProps, GridLayoutStyles, HorizontalGalleryStyles, JumpToNewMessageButtonProps, LocalizationProviderProps, LocalVideoCameraCycleButtonProps, LoadingState, Message, MessageAttachedStatus, MessageCommon, MessageContentType, MessageProps, MessageRenderer, MessageStatusIndicatorProps, MessageStatusIndicatorStrings, MessageThreadProps, MessageThreadStrings, MessageThreadStyles, MicrophoneButtonContextualMenuStyles, MicrophoneButtonProps, MicrophoneButtonStrings, MicrophoneButtonStyles, OnRenderAvatarCallback, OptionsDevice, ParticipantAddedSystemMessage, ParticipantItemProps, ParticipantItemStrings, ParticipantItemStyles, ParticipantListItemStyles, ParticipantListParticipant, ParticipantListProps, ParticipantListStyles, ParticipantMenuItemsCallback, ParticipantRemovedSystemMessage, ParticipantState, ParticipantsButtonContextualMenuStyles, ParticipantsButtonProps, ParticipantsButtonStrings, ParticipantsButtonStyles, ReadReceiptsBySenderId, ScreenShareButtonProps, ScreenShareButtonStrings, SendBoxProps, SendBoxStrings, SendBoxStylesProps, StreamMediaProps, SystemMessage, SystemMessageCommon, TopicUpdatedSystemMessage, TypingIndicatorProps, TypingIndicatorStrings, TypingIndicatorStylesProps, UpdateMessageCallback, CancelEditCallback, VideoGalleryLayout, VideoGalleryLocalParticipant, VideoGalleryParticipant, VideoGalleryProps, VideoGalleryRemoteParticipant, VideoGalleryStream, VideoGalleryStrings, VideoGalleryStyles, VideoStreamOptions, VideoTileProps, VideoTileStylesProps, ViewScalingMode } from '../../react-components/src';
|
31
|
+
export type { _IdentifierProviderProps, _Identifiers, ActiveErrorMessage, BaseCustomStyles, CallParticipantListParticipant, CameraButtonContextualMenuStyles, CameraButtonProps, CameraButtonStrings, CameraButtonStyles, ChatMessage, CommunicationParticipant, ComponentLocale, ComponentSlotStyle, ComponentStrings, ContentSystemMessage, ControlBarButtonProps, ControlBarButtonStrings, ControlBarButtonStyles, ControlBarLayout, ControlBarProps, CreateVideoStreamViewResult, CustomAvatarOptions, CustomMessage, DevicesButtonContextualMenuStyles, DevicesButtonProps, DevicesButtonStrings, DevicesButtonStyles, EndCallButtonProps, EndCallButtonStrings, ErrorBarProps, ErrorBarStrings, ErrorType, GridLayoutProps, GridLayoutStyles, HorizontalGalleryStyles, JumpToNewMessageButtonProps, LocalizationProviderProps, LocalVideoCameraCycleButtonProps, LoadingState, Message, MessageAttachedStatus, MessageCommon, MessageContentType, MessageProps, MessageRenderer, MessageStatusIndicatorProps, MessageStatusIndicatorStrings, MessageThreadProps, MessageThreadStrings, MessageThreadStyles, MicrophoneButtonContextualMenuStyles, MicrophoneButtonProps, MicrophoneButtonStrings, MicrophoneButtonStyles, OnRenderAvatarCallback, OptionsDevice, ParticipantAddedSystemMessage, ParticipantItemProps, ParticipantItemStrings, ParticipantItemStyles, ParticipantListItemStyles, ParticipantListParticipant, ParticipantListProps, ParticipantListStyles, ParticipantMenuItemsCallback, ParticipantRemovedSystemMessage, ParticipantState, ParticipantsButtonContextualMenuStyles, ParticipantsButtonProps, ParticipantsButtonStrings, ParticipantsButtonStyles, ReadReceiptsBySenderId, ScreenShareButtonProps, ScreenShareButtonStrings, SendBoxProps, SendBoxStrings, SendBoxStylesProps, StreamMediaProps, SystemMessage, SystemMessageCommon, TopicUpdatedSystemMessage, TypingIndicatorProps, TypingIndicatorStrings, TypingIndicatorStylesProps, UpdateMessageCallback, CancelEditCallback, VideoGalleryLayout, VideoGalleryLocalParticipant, VideoGalleryParticipant, VideoGalleryProps, VideoGalleryRemoteParticipant, VideoGalleryStream, VideoGalleryStrings, VideoGalleryStyles, VideoStreamOptions, VideoTileProps, VideoTileStylesProps, ViewScalingMode, VideoTileContextualMenuProps, VideoTileDrawerMenuProps } from '../../react-components/src';
|
41
32
|
export type { RaiseHandButtonProps, RaiseHandButtonStrings, RaisedHand } from '../../react-components/src';
|
42
|
-
export type { ImageGalleryProps, ImageGalleryImageProps, ImageGalleryStrings } from '../../react-components/src';
|
43
|
-
export type { BlockedMessage } from '../../react-components/src';
|
44
33
|
export type { DialpadMode, DialpadProps, DialpadStrings, DialpadStyles, DtmfTone, LongPressTrigger } from '../../react-components/src';
|
45
|
-
export type { ActiveFileUpload, SendBoxErrorBarError, FileDownloadHandler, FileDownloadError } from '../../react-components/src';
|
46
|
-
export type { AttachmentMetadata } from '../../react-components/src';
|
47
|
-
export type { FileMetadata } from '../../react-components/src';
|
48
|
-
export type { ChatAttachmentType, AttachmentDownloadResult, InlineImageMetadata } from '../../react-components/src';
|
49
|
-
export type { InlineImageOptions, InlineImage } from '../../react-components/src';
|
50
|
-
export type { HoldButtonProps, HoldButtonStrings, VideoTileStrings } from '../../react-components/src';
|
51
|
-
export type { BrowserPermissionDeniedStrings, BrowserPermissionDeniedProps } from '../../react-components/src';
|
52
|
-
export type { BrowserPermissionDeniedIOSStrings, BrowserPermissionDeniedStyles, BrowserPermissionDeniedIOSProps } from '../../react-components/src';
|
53
|
-
export type { VideoTileContextualMenuProps, VideoTileDrawerMenuProps } from '../../react-components/src';
|
54
34
|
export type { OverflowGalleryPosition } from '../../react-components/src';
|
55
35
|
export type { LocalVideoTileSize } from '../../react-components/src';
|
56
36
|
export * from '../../react-components/src/localization/locales';
|
57
37
|
export * from '../../react-components/src/theming';
|
58
38
|
export * from '../../calling-stateful-client/src/index-public';
|
59
|
-
export type { DeclarativeCallAgent } from '../../calling-stateful-client/src';
|
60
39
|
export { createStatefulChatClient } from '../../chat-stateful-client/src';
|
61
40
|
export type { StatefulChatClient, StatefulChatClientArgs, StatefulChatClientOptions, ChatMessageWithStatus, ChatClientState, ChatError, ChatErrors, ChatThreadClientState, ChatThreadProperties, ChatErrorTarget } from '../../chat-stateful-client/src';
|
62
41
|
export * from '../../react-composites/src/index-public';
|
63
42
|
export * from './mergedHooks';
|
64
|
-
export { UnsupportedBrowser } from '../../react-components/src';
|
65
|
-
export type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from '../../react-components/src';
|
66
|
-
export { UnsupportedBrowserVersion } from '../../react-components/src';
|
67
|
-
export type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from '../../react-components/src';
|
68
|
-
export { UnsupportedOperatingSystem } from '../../react-components/src';
|
69
|
-
export type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from '../../react-components/src';
|
70
43
|
export type { VerticalGalleryStyles, VerticalGalleryStrings, VerticalGalleryControlBarStyles } from '../../react-components/src';
|
71
44
|
export type { SpokenLanguageStrings, CaptionLanguageStrings } from '../../react-components/src';
|
72
45
|
//# sourceMappingURL=index.d.ts.map
|