@azure/communication-react 1.24.0-alpha-202502040016 → 1.24.0-alpha-202502050016

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/communication-react.d.ts +13 -3
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-AkTSmAsd.js → ChatMessageComponentAsRichTextEditBox-CeWY0AY6.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-AkTSmAsd.js.map → ChatMessageComponentAsRichTextEditBox-CeWY0AY6.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-B3Xe7mdR.js → RichTextSendBoxWrapper-ClpG1pEU.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-B3Xe7mdR.js.map → RichTextSendBoxWrapper-ClpG1pEU.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-CNpitKVB.js → index-k4-DEMHk.js} +171 -97
  7. package/dist/dist-cjs/communication-react/index-k4-DEMHk.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +1 -12
  12. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  13. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +7 -0
  14. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
  15. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js +35 -22
  16. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js.map +1 -1
  17. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +5 -1
  18. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  19. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +6 -2
  20. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +30 -9
  21. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  22. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +2 -0
  23. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/NotificationStack.d.ts +5 -1
  25. package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/RaiseHandButton.js +2 -2
  27. package/dist/dist-esm/react-components/src/components/RaiseHandButton.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/ReactionButton.js +2 -2
  29. package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
  30. package/dist/dist-esm/react-components/src/components/utils.js +2 -0
  31. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +5 -0
  33. package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -0
  34. package/dist/dist-esm/react-components/src/theming/icons.js +2 -0
  35. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +1 -0
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +26 -28
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js +8 -2
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js.map +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +25 -1
  45. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +1 -1
  47. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +5 -6
  48. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  49. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +17 -6
  50. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  51. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +3 -1
  52. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  53. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -0
  54. package/package.json +2 -2
  55. package/dist/dist-cjs/communication-react/index-CNpitKVB.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CNpitKVB.js');
3
+ var index = require('./index-k4-DEMHk.js');
4
4
  require('react');
5
5
  require('@fluentui/react');
6
6
  require('@fluentui/react-components');
@@ -2,5 +2,5 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT License.
4
4
  // GENERATED FILE. DO NOT EDIT MANUALLY.
5
- module.exports = '1.24.0-alpha-202502040016';
5
+ module.exports = '1.24.0-alpha-202502050016';
6
6
  //# sourceMappingURL=telemetryVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.24.0-alpha-202502040016';\n"]}
1
+ {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.24.0-alpha-202502050016';\n"]}
@@ -23,14 +23,7 @@ import { createDefaultCommonCallingHandlers } from './createCommonHandlers';
23
23
  * @public
24
24
  */
25
25
  export const createDefaultCallingHandlers = memoizeOne((...args) => {
26
- var _a;
27
26
  const [callClient, callAgent, deviceManager, call, options] = args;
28
- /* @conditional-compile-remove(breakout-rooms) */
29
- const callState = (call === null || call === void 0 ? void 0 : call.id) ? callClient.getState().calls[call === null || call === void 0 ? void 0 : call.id] : undefined;
30
- /* @conditional-compile-remove(breakout-rooms) */
31
- const breakoutRoomOriginCallId = (_a = callState === null || callState === void 0 ? void 0 : callState.breakoutRooms) === null || _a === void 0 ? void 0 : _a.breakoutRoomOriginCallId;
32
- /* @conditional-compile-remove(breakout-rooms) */
33
- const breakoutRoomOriginCall = callAgent === null || callAgent === void 0 ? void 0 : callAgent.calls.find((call) => call.id === breakoutRoomOriginCallId);
34
27
  const commonCallingHandlers = createDefaultCommonCallingHandlers(callClient, deviceManager, call, options);
35
28
  return Object.assign(Object.assign({}, commonCallingHandlers), {
36
29
  // FIXME: onStartCall API should use string, not the underlying SDK types.
@@ -58,10 +51,6 @@ export const createDefaultCallingHandlers = memoizeOne((...args) => {
58
51
  if (incomingCall) {
59
52
  yield incomingCall.reject();
60
53
  }
61
- }),
62
- /* @conditional-compile-remove(breakout-rooms) */
63
- onHangUp: breakoutRoomOriginCall
64
- ? () => __awaiter(void 0, void 0, void 0, function* () { return breakoutRoomOriginCall.hangUp().then(() => commonCallingHandlers.onHangUp()); })
65
- : commonCallingHandlers.onHangUp });
54
+ }) });
66
55
  });
67
56
  //# sourceMappingURL=createHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,0BAA0B,EAAE,mCAAgC;AAGrE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,kCAAkC,EAAyB,MAAM,wBAAwB,CAAC;AA4CnG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAiC,UAAU,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE;;IAC/F,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACnE,iDAAiD;IACjD,MAAM,SAAS,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,EAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,iDAAiD;IACjD,MAAM,wBAAwB,GAAG,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,aAAa,0CAAE,wBAAwB,CAAC;IACpF,iDAAiD;IACjD,MAAM,sBAAsB,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,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CAAC;YACzF,MAAM,YAAY,GAAI,SAAkC,aAAlC,SAAS,uBAAT,SAAS,CAA2B,aAAa,CAAC,IAAI,CAC1E,CAAC,YAAgC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,cAAc,CACzE,CAAC;YACF,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,YAAY,CAAC,MAAM,CACvB,gBAAgB,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,iBAAiB,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAC3F,CAAC;YACJ,CAAC;QACH,CAAC,CAAA,EACD,YAAY,EAAE,CAAO,cAAsB,EAAiB,EAAE;YAC5D,MAAM,YAAY,GAAI,SAAkC,aAAlC,SAAS,uBAAT,SAAS,CAA2B,aAAa,CAAC,IAAI,CAC1E,CAAC,YAAgC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,cAAc,CACzE,CAAC;YACF,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC,CAAA;QACD,iDAAiD;QACjD,QAAQ,EAAE,sBAAsB;YAC9B,CAAC,CAAC,GAAS,EAAE,kDAAC,OAAA,sBAAsB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,QAAQ,EAAE,CAAC,CAAA,GAAA;YAC1F,CAAC,CAAC,qBAAqB,CAAC,QAAQ,IAClC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Call, CallAgent, StartCallOptions } from '@azure/communication-calling';\nimport { IncomingCallCommon } from '@azure/communication-calling';\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport {\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { CommunicationIdentifier } from '@azure/communication-common';\n\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { DeclarativeCallAgent } from '@internal/calling-stateful-client';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { createLocalVideoStream } from '../utils/callUtils';\nimport { createDefaultCommonCallingHandlers, CommonCallingHandlers } from './createCommonHandlers';\n\nimport { VideoBackgroundEffectsDependency } from './createCommonHandlers';\nimport { DeepNoiseSuppressionEffectDependency } from './createCommonHandlers';\n\n/**\n * Object containing all the handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface CallingHandlers extends CommonCallingHandlers {\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => Call | undefined;\n}\n\n/**\n * Configuration options to include video effect background dependency.\n * @public\n */\nexport type CallingHandlersOptions = {\n onResolveVideoBackgroundEffectsDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n /**\n * Dependency resolver for deep noise suppression effect.\n * @beta\n */\n onResolveDeepNoiseSuppressionDependency?: () => Promise<DeepNoiseSuppressionEffectDependency>;\n};\n\n/**\n * Type of {@link createDefaultCallingHandlers}.\n *\n * @public\n */\nexport type CreateDefaultCallingHandlers = (\n callClient: StatefulCallClient,\n callAgent: CallAgent | undefined,\n deviceManager: StatefulDeviceManager | undefined,\n call: Call | undefined,\n\n options?: CallingHandlersOptions\n) => CallingHandlers;\n\n/**\n * Create the default implementation of {@link CallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultCallingHandlers: CreateDefaultCallingHandlers = memoizeOne((...args) => {\n const [callClient, callAgent, deviceManager, call, options] = args;\n /* @conditional-compile-remove(breakout-rooms) */\n const callState = call?.id ? callClient.getState().calls[call?.id] : undefined;\n /* @conditional-compile-remove(breakout-rooms) */\n const breakoutRoomOriginCallId = callState?.breakoutRooms?.breakoutRoomOriginCallId;\n /* @conditional-compile-remove(breakout-rooms) */\n const breakoutRoomOriginCall = callAgent?.calls.find((call) => call.id === breakoutRoomOriginCallId);\n const commonCallingHandlers = createDefaultCommonCallingHandlers(callClient, deviceManager, call, options);\n return {\n ...commonCallingHandlers,\n // FIXME: onStartCall API should use string, not the underlying SDK types.\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined => {\n return callAgent?.startCall(participants, options);\n },\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, options);\n } else if (isCommunicationUserIdentifier(participant) || isMicrosoftTeamsUserIdentifier(participant)) {\n call?.addParticipant(participant);\n }\n },\n onRemoveParticipant: async (userId: string | CommunicationIdentifier): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n await call?.removeParticipant(participant);\n },\n onAcceptCall: async (incomingCallId: string, useVideo?: boolean): Promise<void> => {\n const localVideoStream = useVideo ? await createLocalVideoStream(callClient) : undefined;\n const incomingCall = (callAgent as DeclarativeCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.accept(\n localVideoStream ? { videoOptions: { localVideoStreams: [localVideoStream] } } : undefined\n );\n }\n },\n onRejectCall: async (incomingCallId: string): Promise<void> => {\n const incomingCall = (callAgent as DeclarativeCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.reject();\n }\n },\n /* @conditional-compile-remove(breakout-rooms) */\n onHangUp: breakoutRoomOriginCall\n ? async () => breakoutRoomOriginCall.hangUp().then(() => commonCallingHandlers.onHangUp())\n : commonCallingHandlers.onHangUp\n };\n});\n\n/**\n * Handlers only for calling components\n * @internal\n */\nexport interface _ComponentCallingHandlers {\n /** VideoGallery callback prop to start local spotlight */\n onStartLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to stop local spotlight */\n onStopLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to start remote spotlight */\n onStartRemoteSpotlight: (userIds: string[]) => Promise<void>;\n /** VideoGallery callback prop to stop remote spotlight */\n onStopRemoteSpotlight: (userIds: string[]) => Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,0BAA0B,EAAE,mCAAgC;AAGrE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,kCAAkC,EAAyB,MAAM,wBAAwB,CAAC;AA4CnG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAiC,UAAU,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE;IAC/F,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACnE,MAAM,qBAAqB,GAAG,kCAAkC,CAAC,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3G,uCACK,qBAAqB;QACxB,0EAA0E;QAC1E,WAAW,EAAE,CAAC,YAAuC,EAAE,OAA0B,EAAoB,EAAE;YACrG,OAAO,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACrD,CAAC,EACD,gBAAgB,EAAE,CAChB,MAAwC,EACxC,OAA+B,EAChB,EAAE;YACjB,MAAM,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GAAI,SAAkC,aAAlC,SAAS,uBAAT,SAAS,CAA2B,aAAa,CAAC,IAAI,CAC1E,CAAC,YAAgC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,cAAc,CACzE,CAAC;YACF,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC,CAAA,IACD;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Call, CallAgent, StartCallOptions } from '@azure/communication-calling';\nimport { IncomingCallCommon } from '@azure/communication-calling';\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport {\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { CommunicationIdentifier } from '@azure/communication-common';\n\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { DeclarativeCallAgent } from '@internal/calling-stateful-client';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { createLocalVideoStream } from '../utils/callUtils';\nimport { createDefaultCommonCallingHandlers, CommonCallingHandlers } from './createCommonHandlers';\n\nimport { VideoBackgroundEffectsDependency } from './createCommonHandlers';\nimport { DeepNoiseSuppressionEffectDependency } from './createCommonHandlers';\n\n/**\n * Object containing all the handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface CallingHandlers extends CommonCallingHandlers {\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => Call | undefined;\n}\n\n/**\n * Configuration options to include video effect background dependency.\n * @public\n */\nexport type CallingHandlersOptions = {\n onResolveVideoBackgroundEffectsDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n /**\n * Dependency resolver for deep noise suppression effect.\n * @beta\n */\n onResolveDeepNoiseSuppressionDependency?: () => Promise<DeepNoiseSuppressionEffectDependency>;\n};\n\n/**\n * Type of {@link createDefaultCallingHandlers}.\n *\n * @public\n */\nexport type CreateDefaultCallingHandlers = (\n callClient: StatefulCallClient,\n callAgent: CallAgent | undefined,\n deviceManager: StatefulDeviceManager | undefined,\n call: Call | undefined,\n\n options?: CallingHandlersOptions\n) => CallingHandlers;\n\n/**\n * Create the default implementation of {@link CallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultCallingHandlers: CreateDefaultCallingHandlers = memoizeOne((...args) => {\n const [callClient, callAgent, deviceManager, call, options] = args;\n const commonCallingHandlers = createDefaultCommonCallingHandlers(callClient, deviceManager, call, options);\n return {\n ...commonCallingHandlers,\n // FIXME: onStartCall API should use string, not the underlying SDK types.\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined => {\n return callAgent?.startCall(participants, options);\n },\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, options);\n } else if (isCommunicationUserIdentifier(participant) || isMicrosoftTeamsUserIdentifier(participant)) {\n call?.addParticipant(participant);\n }\n },\n onRemoveParticipant: async (userId: string | CommunicationIdentifier): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n await call?.removeParticipant(participant);\n },\n onAcceptCall: async (incomingCallId: string, useVideo?: boolean): Promise<void> => {\n const localVideoStream = useVideo ? await createLocalVideoStream(callClient) : undefined;\n const incomingCall = (callAgent as DeclarativeCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.accept(\n localVideoStream ? { videoOptions: { localVideoStreams: [localVideoStream] } } : undefined\n );\n }\n },\n onRejectCall: async (incomingCallId: string): Promise<void> => {\n const incomingCall = (callAgent as DeclarativeCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.reject();\n }\n }\n };\n});\n\n/**\n * Handlers only for calling components\n * @internal\n */\nexport interface _ComponentCallingHandlers {\n /** VideoGallery callback prop to start local spotlight */\n onStartLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to stop local spotlight */\n onStopLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to start remote spotlight */\n onStartRemoteSpotlight: (userIds: string[]) => Promise<void>;\n /** VideoGallery callback prop to stop remote spotlight */\n onStopRemoteSpotlight: (userIds: string[]) => Promise<void>;\n}\n"]}
@@ -183,6 +183,13 @@ export const notificationStackSelector = createSelector([
183
183
  });
184
184
  }
185
185
  /* @conditional-compile-remove(breakout-rooms) */
186
+ if (latestNotifications['assignedBreakoutRoomClosed']) {
187
+ activeNotifications.push({
188
+ type: 'assignedBreakoutRoomClosed',
189
+ timestamp: latestNotifications['assignedBreakoutRoomClosed'].timestamp
190
+ });
191
+ }
192
+ /* @conditional-compile-remove(breakout-rooms) */
186
193
  if (latestNotifications['breakoutRoomJoined']) {
187
194
  activeNotifications.push({
188
195
  type: 'breakoutRoomJoined',
@@ -1 +1 @@
1
- {"version":3,"file":"notificationStackSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/notificationStackSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AACzB,iDAAiD;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAI7D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI1C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;QACrB,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,SAAS;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CallingBaseSelectorProps,\n getDeviceManager,\n getDiagnostics,\n getLatestErrors,\n getEnvironmentInfo\n} from './baseSelectors';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { getAssignedBreakoutRoom } from './baseSelectors';\n\nimport { getLatestNotifications } from './baseSelectors';\n\nimport { getMeetingConferencePhones } from './baseSelectors';\n\nimport { ActiveNotification, NotificationType } from '@internal/react-components';\n\nimport { createSelector } from 'reselect';\n\nimport { CallClientState, CallErrors, CallErrorTarget } from '@internal/calling-stateful-client';\n\nimport { DiagnosticQuality } from '@azure/communication-calling';\n\n/**\n * Selector type for {@link Notification} component.\n *\n * @public\n */\nexport type NotificationStackSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n activeErrorMessages: ActiveNotification[];\n activeNotifications: ActiveNotification[];\n};\n\n/**\n * Select the active errors from the state for the `Notification` component.\n *\n * Invariants:\n * - `ErrorType` is never repeated in the returned errors.\n * - Errors are returned in a fixed order by `ErrorType`.\n *\n * @public\n */\nexport const notificationStackSelector: NotificationStackSelector = createSelector(\n [\n getLatestErrors,\n getLatestNotifications,\n getDiagnostics,\n getDeviceManager,\n getEnvironmentInfo,\n getMeetingConferencePhones,\n /* @conditional-compile-remove(breakout-rooms) */ getAssignedBreakoutRoom\n ],\n (\n latestErrors: CallErrors,\n latestNotifications,\n diagnostics,\n deviceManager,\n environmentInfo,\n meetingConference,\n /* @conditional-compile-remove(breakout-rooms) */ assignedBreakoutRoom\n ): { activeErrorMessages: ActiveNotification[]; activeNotifications: ActiveNotification[] } => {\n // The order in which the errors are returned is significant: The `Notification` shows errors on the UI in that order.\n // There are several options for the ordering:\n // - Sorted by when the errors happened (latest first / oldest first).\n // - Stable sort by error type.\n //\n // We chose to stable sort by error type: We intend to show only a small number of errors on the UI and we do not\n // have timestamps for errors.\n const activeErrorMessages: ActiveNotification[] = [];\n\n const isSafari = (): boolean => {\n return environmentInfo?.environment.browser === 'safari';\n };\n\n const isMacOS = (): boolean => {\n return environmentInfo?.environment.platform === 'mac';\n };\n\n // Errors reported via diagnostics are more reliable than from API method failures, so process those first.\n let isTeamsMeetingWithPhones = false;\n\n if (meetingConference && meetingConference.length > 0) {\n isTeamsMeetingWithPhones = true;\n }\n if (\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Bad ||\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Poor\n ) {\n if (isTeamsMeetingWithPhones) {\n activeErrorMessages.push({ type: 'teamsMeetingCallNetworkQualityLow' });\n } else {\n activeErrorMessages.push({ type: 'callNetworkQualityLow' });\n }\n }\n if (diagnostics?.media.latest.noSpeakerDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoSpeakerFound' });\n }\n if (diagnostics?.media.latest.noMicrophoneDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoMicrophoneFound' });\n }\n if (deviceManager.deviceAccess?.audio === false && isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDeniedSafari' });\n }\n if (deviceManager.deviceAccess?.audio === false && !isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n if (diagnostics?.media.latest.microphonePermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsMicrophoneAccessDenied' });\n } else if (diagnostics?.media.latest.microphonePermissionDenied?.value === true) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n const microphoneMuteUnexpectedlyDiagnostic =\n diagnostics?.media.latest.microphoneMuteUnexpectedly || diagnostics?.media.latest.microphoneNotFunctioning;\n if (microphoneMuteUnexpectedlyDiagnostic) {\n if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that microphone stopped working and inform them to start microphone again\n activeErrorMessages.push({ type: 'callMicrophoneMutedBySystem' });\n } else if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that microphone recovered\n activeErrorMessages.push({ type: 'callMicrophoneUnmutedBySystem' });\n }\n }\n\n const cameraStoppedUnexpectedlyDiagnostic = diagnostics?.media.latest.cameraStoppedUnexpectedly;\n if (cameraStoppedUnexpectedlyDiagnostic) {\n if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that camera stopped working and inform them to start video again\n activeErrorMessages.push({ type: 'callVideoStoppedBySystem' });\n } else if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that camera recovered\n activeErrorMessages.push({ type: 'callVideoRecoveredBySystem' });\n }\n }\n if (deviceManager.deviceAccess?.video === false && isSafari()) {\n activeErrorMessages.push({ type: 'callCameraAccessDeniedSafari' });\n } else if (deviceManager.deviceAccess?.video === false) {\n activeErrorMessages.push({ type: 'callCameraAccessDenied' });\n } else {\n if (diagnostics?.media.latest.cameraFreeze?.value === true) {\n activeErrorMessages.push({ type: 'cameraFrozenForRemoteParticipants' });\n }\n }\n\n /**\n * show the Mac specific strings if the platform is detected as mac\n */\n if (diagnostics?.media.latest.cameraPermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsCameraAccessDenied' });\n }\n\n /**\n * This UFD only works on mac still so we should only see it fire on mac.\n */\n if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsScreenShareAccessDenied' });\n } else if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true) {\n activeErrorMessages.push({ type: 'startScreenShareGeneric' });\n }\n\n // Prefer to show errors with privacy implications.\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopVideo', 'stopVideoGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mute', 'muteGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopScreenSharing', 'stopScreenShareGeneric');\n\n if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure SourceUnavailableError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAlreadyInUse');\n } else if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure permissionDeniedError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAccessDenied');\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'startVideoGeneric');\n }\n\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.unmute', 'unmuteGeneric');\n if (\n latestNotifications &&\n !latestNotifications['capabilityUnmuteMicAbsent'] &&\n !latestNotifications['capabilityUnmuteMicPresent']\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mutedByOthers', 'mutedByRemoteParticipant');\n }\n\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'VideoEffectsFeature.startEffects',\n 'unableToStartVideoEffect'\n );\n\n if (latestErrors['CallAgent.join']?.message === 'CallAgent.join: Invalid meeting link') {\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'CallAgent.join',\n 'failedToJoinCallInvalidMeetingLink'\n );\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'CallAgent.join', 'failedToJoinCallGeneric');\n }\n\n if (\n latestErrors['Call.feature']?.message.match(\n /Call\\.feature: startSpotlight failed\\. \\d+ is the max number of participants that can be Spotlighted/g\n )\n ) {\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'Call.feature',\n 'startSpotlightWhileMaxParticipantsAreSpotlighted'\n );\n }\n\n //below is for active notifications\n const activeNotifications: ActiveNotification[] = [];\n if (diagnostics?.media.latest.speakingWhileMicrophoneIsMuted?.value) {\n activeNotifications.push({\n type: 'speakingWhileMuted',\n timestamp: new Date(Date.now()),\n autoDismiss: true,\n ariaLive: 'off' // \"You're muted\" is too noisy, so we don't want to announce it.\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomOpened']) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomOpened',\n timestamp: latestNotifications['assignedBreakoutRoomOpened'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomOpenedPromptJoin'] && assignedBreakoutRoom) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomOpenedPromptJoin',\n timestamp: latestNotifications['assignedBreakoutRoomOpenedPromptJoin'].timestamp,\n onClickPrimaryButton: () => assignedBreakoutRoom.join()\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomChanged']) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomChanged',\n timestamp: latestNotifications['assignedBreakoutRoomChanged'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['breakoutRoomJoined']) {\n activeNotifications.push({\n type: 'breakoutRoomJoined',\n timestamp: latestNotifications['breakoutRoomJoined'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['breakoutRoomClosingSoon']) {\n activeNotifications.push({\n type: 'breakoutRoomClosingSoon',\n timestamp: latestNotifications['breakoutRoomClosingSoon'].timestamp\n });\n }\n\n if (latestNotifications['capabilityTurnVideoOnPresent']) {\n activeNotifications.push({\n type: 'capabilityTurnVideoOnPresent',\n timestamp: latestNotifications['capabilityTurnVideoOnPresent'].timestamp\n });\n }\n\n if (latestNotifications['capabilityTurnVideoOnAbsent']) {\n activeNotifications.push({\n type: 'capabilityTurnVideoOnAbsent',\n timestamp: latestNotifications['capabilityTurnVideoOnAbsent'].timestamp\n });\n }\n\n if (latestNotifications['capabilityUnmuteMicPresent']) {\n activeNotifications.push({\n type: 'capabilityUnmuteMicPresent',\n timestamp: latestNotifications['capabilityUnmuteMicPresent'].timestamp\n });\n }\n\n if (latestNotifications['capabilityUnmuteMicAbsent']) {\n activeNotifications.push({\n type: 'capabilityUnmuteMicAbsent',\n timestamp: latestNotifications['capabilityUnmuteMicAbsent'].timestamp\n });\n }\n\n /* @conditional-compile-remove(together-mode) */\n if (latestNotifications['togetherModeStarted']) {\n activeNotifications.push({\n type: 'togetherModeStarted',\n timestamp: latestNotifications['togetherModeStarted'].timestamp,\n autoDismiss: true\n });\n }\n /* @conditional-compile-remove(together-mode) */\n if (latestNotifications['togetherModeEnded']) {\n activeNotifications.push({\n type: 'togetherModeEnded',\n timestamp: latestNotifications['togetherModeEnded'].timestamp,\n autoDismiss: true\n });\n }\n\n return { activeErrorMessages: activeErrorMessages, activeNotifications: activeNotifications };\n }\n);\n\nconst appendActiveErrorIfDefined = (\n activeErrorMessages: ActiveNotification[],\n latestErrors: CallErrors,\n target: CallErrorTarget,\n activeErrorType: NotificationType\n): void => {\n if (latestErrors[target] === undefined) {\n return;\n }\n activeErrorMessages.push({\n type: activeErrorType,\n timestamp: latestErrors[target].timestamp\n });\n};\n"]}
1
+ {"version":3,"file":"notificationStackSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/notificationStackSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AACzB,iDAAiD;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAI7D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAejE;;;;;;;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C,EAC3B,EAAE;IACR,IAAI,YAAY,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO;IACT,CAAC;IACD,mBAAmB,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,SAAS;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CallingBaseSelectorProps,\n getDeviceManager,\n getDiagnostics,\n getLatestErrors,\n getEnvironmentInfo\n} from './baseSelectors';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { getAssignedBreakoutRoom } from './baseSelectors';\n\nimport { getLatestNotifications } from './baseSelectors';\n\nimport { getMeetingConferencePhones } from './baseSelectors';\n\nimport { ActiveNotification, NotificationType } from '@internal/react-components';\n\nimport { createSelector } from 'reselect';\n\nimport { CallClientState, CallErrors, CallErrorTarget } from '@internal/calling-stateful-client';\n\nimport { DiagnosticQuality } from '@azure/communication-calling';\n\n/**\n * Selector type for {@link Notification} component.\n *\n * @public\n */\nexport type NotificationStackSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n activeErrorMessages: ActiveNotification[];\n activeNotifications: ActiveNotification[];\n};\n\n/**\n * Select the active errors from the state for the `Notification` component.\n *\n * Invariants:\n * - `ErrorType` is never repeated in the returned errors.\n * - Errors are returned in a fixed order by `ErrorType`.\n *\n * @public\n */\nexport const notificationStackSelector: NotificationStackSelector = createSelector(\n [\n getLatestErrors,\n getLatestNotifications,\n getDiagnostics,\n getDeviceManager,\n getEnvironmentInfo,\n getMeetingConferencePhones,\n /* @conditional-compile-remove(breakout-rooms) */ getAssignedBreakoutRoom\n ],\n (\n latestErrors: CallErrors,\n latestNotifications,\n diagnostics,\n deviceManager,\n environmentInfo,\n meetingConference,\n /* @conditional-compile-remove(breakout-rooms) */ assignedBreakoutRoom\n ): { activeErrorMessages: ActiveNotification[]; activeNotifications: ActiveNotification[] } => {\n // The order in which the errors are returned is significant: The `Notification` shows errors on the UI in that order.\n // There are several options for the ordering:\n // - Sorted by when the errors happened (latest first / oldest first).\n // - Stable sort by error type.\n //\n // We chose to stable sort by error type: We intend to show only a small number of errors on the UI and we do not\n // have timestamps for errors.\n const activeErrorMessages: ActiveNotification[] = [];\n\n const isSafari = (): boolean => {\n return environmentInfo?.environment.browser === 'safari';\n };\n\n const isMacOS = (): boolean => {\n return environmentInfo?.environment.platform === 'mac';\n };\n\n // Errors reported via diagnostics are more reliable than from API method failures, so process those first.\n let isTeamsMeetingWithPhones = false;\n\n if (meetingConference && meetingConference.length > 0) {\n isTeamsMeetingWithPhones = true;\n }\n if (\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Bad ||\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Poor\n ) {\n if (isTeamsMeetingWithPhones) {\n activeErrorMessages.push({ type: 'teamsMeetingCallNetworkQualityLow' });\n } else {\n activeErrorMessages.push({ type: 'callNetworkQualityLow' });\n }\n }\n if (diagnostics?.media.latest.noSpeakerDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoSpeakerFound' });\n }\n if (diagnostics?.media.latest.noMicrophoneDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoMicrophoneFound' });\n }\n if (deviceManager.deviceAccess?.audio === false && isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDeniedSafari' });\n }\n if (deviceManager.deviceAccess?.audio === false && !isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n if (diagnostics?.media.latest.microphonePermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsMicrophoneAccessDenied' });\n } else if (diagnostics?.media.latest.microphonePermissionDenied?.value === true) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n const microphoneMuteUnexpectedlyDiagnostic =\n diagnostics?.media.latest.microphoneMuteUnexpectedly || diagnostics?.media.latest.microphoneNotFunctioning;\n if (microphoneMuteUnexpectedlyDiagnostic) {\n if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that microphone stopped working and inform them to start microphone again\n activeErrorMessages.push({ type: 'callMicrophoneMutedBySystem' });\n } else if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that microphone recovered\n activeErrorMessages.push({ type: 'callMicrophoneUnmutedBySystem' });\n }\n }\n\n const cameraStoppedUnexpectedlyDiagnostic = diagnostics?.media.latest.cameraStoppedUnexpectedly;\n if (cameraStoppedUnexpectedlyDiagnostic) {\n if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that camera stopped working and inform them to start video again\n activeErrorMessages.push({ type: 'callVideoStoppedBySystem' });\n } else if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that camera recovered\n activeErrorMessages.push({ type: 'callVideoRecoveredBySystem' });\n }\n }\n if (deviceManager.deviceAccess?.video === false && isSafari()) {\n activeErrorMessages.push({ type: 'callCameraAccessDeniedSafari' });\n } else if (deviceManager.deviceAccess?.video === false) {\n activeErrorMessages.push({ type: 'callCameraAccessDenied' });\n } else {\n if (diagnostics?.media.latest.cameraFreeze?.value === true) {\n activeErrorMessages.push({ type: 'cameraFrozenForRemoteParticipants' });\n }\n }\n\n /**\n * show the Mac specific strings if the platform is detected as mac\n */\n if (diagnostics?.media.latest.cameraPermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsCameraAccessDenied' });\n }\n\n /**\n * This UFD only works on mac still so we should only see it fire on mac.\n */\n if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsScreenShareAccessDenied' });\n } else if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true) {\n activeErrorMessages.push({ type: 'startScreenShareGeneric' });\n }\n\n // Prefer to show errors with privacy implications.\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopVideo', 'stopVideoGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mute', 'muteGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopScreenSharing', 'stopScreenShareGeneric');\n\n if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure SourceUnavailableError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAlreadyInUse');\n } else if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure permissionDeniedError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAccessDenied');\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'startVideoGeneric');\n }\n\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.unmute', 'unmuteGeneric');\n if (\n latestNotifications &&\n !latestNotifications['capabilityUnmuteMicAbsent'] &&\n !latestNotifications['capabilityUnmuteMicPresent']\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mutedByOthers', 'mutedByRemoteParticipant');\n }\n\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'VideoEffectsFeature.startEffects',\n 'unableToStartVideoEffect'\n );\n\n if (latestErrors['CallAgent.join']?.message === 'CallAgent.join: Invalid meeting link') {\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'CallAgent.join',\n 'failedToJoinCallInvalidMeetingLink'\n );\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'CallAgent.join', 'failedToJoinCallGeneric');\n }\n\n if (\n latestErrors['Call.feature']?.message.match(\n /Call\\.feature: startSpotlight failed\\. \\d+ is the max number of participants that can be Spotlighted/g\n )\n ) {\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'Call.feature',\n 'startSpotlightWhileMaxParticipantsAreSpotlighted'\n );\n }\n\n //below is for active notifications\n const activeNotifications: ActiveNotification[] = [];\n if (diagnostics?.media.latest.speakingWhileMicrophoneIsMuted?.value) {\n activeNotifications.push({\n type: 'speakingWhileMuted',\n timestamp: new Date(Date.now()),\n autoDismiss: true,\n ariaLive: 'off' // \"You're muted\" is too noisy, so we don't want to announce it.\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomOpened']) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomOpened',\n timestamp: latestNotifications['assignedBreakoutRoomOpened'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomOpenedPromptJoin'] && assignedBreakoutRoom) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomOpenedPromptJoin',\n timestamp: latestNotifications['assignedBreakoutRoomOpenedPromptJoin'].timestamp,\n onClickPrimaryButton: () => assignedBreakoutRoom.join()\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomChanged']) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomChanged',\n timestamp: latestNotifications['assignedBreakoutRoomChanged'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['assignedBreakoutRoomClosed']) {\n activeNotifications.push({\n type: 'assignedBreakoutRoomClosed',\n timestamp: latestNotifications['assignedBreakoutRoomClosed'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['breakoutRoomJoined']) {\n activeNotifications.push({\n type: 'breakoutRoomJoined',\n timestamp: latestNotifications['breakoutRoomJoined'].timestamp\n });\n }\n /* @conditional-compile-remove(breakout-rooms) */\n if (latestNotifications['breakoutRoomClosingSoon']) {\n activeNotifications.push({\n type: 'breakoutRoomClosingSoon',\n timestamp: latestNotifications['breakoutRoomClosingSoon'].timestamp\n });\n }\n\n if (latestNotifications['capabilityTurnVideoOnPresent']) {\n activeNotifications.push({\n type: 'capabilityTurnVideoOnPresent',\n timestamp: latestNotifications['capabilityTurnVideoOnPresent'].timestamp\n });\n }\n\n if (latestNotifications['capabilityTurnVideoOnAbsent']) {\n activeNotifications.push({\n type: 'capabilityTurnVideoOnAbsent',\n timestamp: latestNotifications['capabilityTurnVideoOnAbsent'].timestamp\n });\n }\n\n if (latestNotifications['capabilityUnmuteMicPresent']) {\n activeNotifications.push({\n type: 'capabilityUnmuteMicPresent',\n timestamp: latestNotifications['capabilityUnmuteMicPresent'].timestamp\n });\n }\n\n if (latestNotifications['capabilityUnmuteMicAbsent']) {\n activeNotifications.push({\n type: 'capabilityUnmuteMicAbsent',\n timestamp: latestNotifications['capabilityUnmuteMicAbsent'].timestamp\n });\n }\n\n /* @conditional-compile-remove(together-mode) */\n if (latestNotifications['togetherModeStarted']) {\n activeNotifications.push({\n type: 'togetherModeStarted',\n timestamp: latestNotifications['togetherModeStarted'].timestamp,\n autoDismiss: true\n });\n }\n /* @conditional-compile-remove(together-mode) */\n if (latestNotifications['togetherModeEnded']) {\n activeNotifications.push({\n type: 'togetherModeEnded',\n timestamp: latestNotifications['togetherModeEnded'].timestamp,\n autoDismiss: true\n });\n }\n\n return { activeErrorMessages: activeErrorMessages, activeNotifications: activeNotifications };\n }\n);\n\nconst appendActiveErrorIfDefined = (\n activeErrorMessages: ActiveNotification[],\n latestErrors: CallErrors,\n target: CallErrorTarget,\n activeErrorType: NotificationType\n): void => {\n if (latestErrors[target] === undefined) {\n return;\n }\n activeErrorMessages.push({\n type: activeErrorType,\n timestamp: latestErrors[target].timestamp\n });\n};\n"]}
@@ -28,7 +28,7 @@ export class BreakoutRoomsSubscriber {
28
28
  }
29
29
  };
30
30
  this.onAssignedBreakoutRoomUpdated = (breakoutRoom) => {
31
- var _a, _b, _c, _d, _e;
31
+ var _a, _b, _c, _d;
32
32
  const callState = this._context.getState().calls[this._callIdRef.callId];
33
33
  const currentAssignedBreakoutRoom = (_a = callState === null || callState === void 0 ? void 0 : callState.breakoutRooms) === null || _a === void 0 ? void 0 : _a.assignedBreakoutRoom;
34
34
  // This call won't exist in the calls array in state if this call is a breakout room that was re-assigned.
@@ -46,36 +46,48 @@ export class BreakoutRoomsSubscriber {
46
46
  this._context.setAssignedBreakoutRoom(this._callIdRef.callId, breakoutRoom);
47
47
  return;
48
48
  }
49
+ // TODO: Fix the condition in this if statement to check for different breakout room ID instead of the display name
50
+ // when Calling SDK fixes the breakout room call id to be correct
49
51
  if (breakoutRoom.state === 'open' &&
50
- (currentAssignedBreakoutRoom === null || currentAssignedBreakoutRoom === void 0 ? void 0 : currentAssignedBreakoutRoom.state) === 'open' &&
51
- ((_c = currentAssignedBreakoutRoom === null || currentAssignedBreakoutRoom === void 0 ? void 0 : currentAssignedBreakoutRoom.call) === null || _c === void 0 ? void 0 : _c.id) !== ((_d = breakoutRoom.call) === null || _d === void 0 ? void 0 : _d.id)) {
52
- if (!this._context.getState().latestNotifications['assignedBreakoutRoomOpened'] &&
53
- !this._context.getState().latestNotifications['assignedBreakoutRoomOpenedPromptJoin']) {
54
- this._context.setLatestNotification(this._callIdRef.callId, {
55
- target: 'assignedBreakoutRoomChanged',
56
- timestamp: new Date(Date.now())
57
- });
58
- }
52
+ ((_c = callState.breakoutRooms) === null || _c === void 0 ? void 0 : _c.breakoutRoomDisplayName) &&
53
+ callState.breakoutRooms.breakoutRoomDisplayName !== breakoutRoom.displayName) {
54
+ this._context.setLatestNotification(this._callIdRef.callId, {
55
+ target: 'assignedBreakoutRoomChanged',
56
+ timestamp: new Date(Date.now())
57
+ });
59
58
  }
60
- else if (breakoutRoom.state === 'open') {
61
- if (!this._context.getState().latestNotifications['assignedBreakoutRoomChanged']) {
62
- const target = breakoutRoom.autoMoveParticipantToBreakoutRoom === false
63
- ? 'assignedBreakoutRoomOpenedPromptJoin'
64
- : 'assignedBreakoutRoomOpened';
65
- this._context.setLatestNotification(this._callIdRef.callId, { target, timestamp: new Date(Date.now()) });
66
- }
59
+ else if (breakoutRoom.state === 'open' &&
60
+ !((_d = callState === null || callState === void 0 ? void 0 : callState.breakoutRooms) === null || _d === void 0 ? void 0 : _d.breakoutRoomSettings) &&
61
+ this._context.getOpenBreakoutRoom() === undefined) {
62
+ const target = breakoutRoom.autoMoveParticipantToBreakoutRoom === false
63
+ ? 'assignedBreakoutRoomOpenedPromptJoin'
64
+ : 'assignedBreakoutRoomOpened';
65
+ this._context.setLatestNotification(this._callIdRef.callId, { target, timestamp: new Date(Date.now()) });
67
66
  }
68
- else if (breakoutRoom.state === 'closed' && (currentAssignedBreakoutRoom === null || currentAssignedBreakoutRoom === void 0 ? void 0 : currentAssignedBreakoutRoom.state) === 'closed') {
67
+ else if (breakoutRoom.state === 'closed' && (currentAssignedBreakoutRoom === null || currentAssignedBreakoutRoom === void 0 ? void 0 : currentAssignedBreakoutRoom.state) === 'open') {
69
68
  // This scenario covers the case where the breakout room is opened but then closed before the user joins.
70
69
  this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpened');
71
70
  this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpenedPromptJoin');
72
71
  this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomChanged');
72
+ this._context.deleteLatestNotification(this._callIdRef.callId, 'breakoutRoomJoined');
73
73
  }
74
- else if (breakoutRoom.state === 'closed' && ((_e = currentAssignedBreakoutRoom === null || currentAssignedBreakoutRoom === void 0 ? void 0 : currentAssignedBreakoutRoom.call) === null || _e === void 0 ? void 0 : _e.id)) {
75
- // This scenario covers the case where the breakout room is changed to a closed breakout room.
76
- this._context.deleteLatestNotification(currentAssignedBreakoutRoom.call.id, 'breakoutRoomJoined');
77
- this._context.deleteLatestNotification(currentAssignedBreakoutRoom.call.id, 'breakoutRoomClosingSoon');
74
+ else if (breakoutRoom.state === 'closed') {
75
+ // This scenario covers the case where the breakout room is closed
76
+ this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpened');
77
+ this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpenedPromptJoin');
78
+ this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomChanged');
79
+ this._context.deleteLatestNotification(this._callIdRef.callId, 'breakoutRoomJoined');
80
+ this._context.deleteLatestNotification(this._callIdRef.callId, 'breakoutRoomClosingSoon');
78
81
  clearTimeout(this._breakoutRoomClosingSoonTimeoutId);
82
+ const openBreakoutRoomId = this._context.getOpenBreakoutRoom();
83
+ if (openBreakoutRoomId && this._context.getState().calls[openBreakoutRoomId]) {
84
+ // Show notification that the assigned breakout room was closed if the user is in that breakout room.
85
+ this._context.setLatestNotification(this._callIdRef.callId, {
86
+ target: 'assignedBreakoutRoomClosed',
87
+ timestamp: new Date(Date.now())
88
+ });
89
+ }
90
+ this._context.deleteOpenBreakoutRoom();
79
91
  }
80
92
  this._context.setAssignedBreakoutRoom(this._callIdRef.callId, breakoutRoom);
81
93
  };
@@ -90,6 +102,7 @@ export class BreakoutRoomsSubscriber {
90
102
  target: 'breakoutRoomJoined',
91
103
  timestamp: new Date(Date.now())
92
104
  });
105
+ this._context.setOpenBreakoutRoom(call.id);
93
106
  // If assigned breakout room has a display name, set the display name for its call state.
94
107
  const assignedBreakoutRoomDisplayName = (_c = (_b = (_a = this._context.getState().calls[this._callIdRef.callId]) === null || _a === void 0 ? void 0 : _a.breakoutRooms) === null || _b === void 0 ? void 0 : _b.assignedBreakoutRoom) === null || _c === void 0 ? void 0 : _c.displayName;
95
108
  if (assignedBreakoutRoomDisplayName) {
@@ -1 +1 @@
1
- {"version":3,"file":"BreakoutRoomsSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/BreakoutRoomsSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC,iDAAiD;AACjD,MAAM,wDAAwD,GAAG,KAAK,CAAC;AAEvE,iDAAiD;AACjD;;GAEG;AACH,MAAM,OA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C,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;QAElD,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAWO,SAAS;QACf,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACrF,CAAC;CAmHF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(breakout-rooms) */\nimport {\n BreakoutRoom,\n BreakoutRoomsCallFeature,\n BreakoutRoomsEventData,\n BreakoutRoomsSettings,\n Call,\n TeamsCall\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { CallContext } from './CallContext';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { CallIdRef } from './CallIdRef';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { NotificationTarget } from './CallClientState';\n\n/* @conditional-compile-remove(breakout-rooms) */\nconst MILLSECONDS_BEFORE_END_TIME_TO_SHOW_CLOSING_NOTIFICATION = 30000;\n\n/* @conditional-compile-remove(breakout-rooms) */\n/**\n * @private\n */\nexport class BreakoutRoomsSubscriber {\n private _callIdRef: CallIdRef;\n private _context: CallContext;\n private _breakoutRoomsFeature: BreakoutRoomsCallFeature;\n private _breakoutRoomClosingSoonTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n constructor(callIdRef: CallIdRef, context: CallContext, breakoutRoomsFeature: BreakoutRoomsCallFeature) {\n this._callIdRef = callIdRef;\n this._context = context;\n this._breakoutRoomsFeature = breakoutRoomsFeature;\n\n this.subscribe();\n }\n\n public unsubscribe = (): void => {\n this._breakoutRoomsFeature.off('breakoutRoomsUpdated', this.onBreakoutRoomsUpdated);\n // Clear breakout room joined notification for this call.\n this._context.deleteLatestNotification(this._callIdRef.callId, 'breakoutRoomJoined');\n // Clear breakout room closing soon notification for this call.\n this._context.deleteLatestNotification(this._callIdRef.callId, 'breakoutRoomClosingSoon');\n clearTimeout(this._breakoutRoomClosingSoonTimeoutId);\n };\n\n private subscribe(): void {\n this._breakoutRoomsFeature.on('breakoutRoomsUpdated', this.onBreakoutRoomsUpdated);\n }\n\n private onBreakoutRoomsUpdated = (eventData: BreakoutRoomsEventData): void => {\n if (eventData.type === 'assignedBreakoutRooms') {\n this.onAssignedBreakoutRoomUpdated(eventData.data);\n } else if (eventData.type === 'join') {\n this.onBreakoutRoomsJoined(eventData.data);\n } else if (eventData.type === 'breakoutRoomsSettings' && eventData.data) {\n this.onBreakoutRoomSettingsUpdated(eventData.data);\n }\n };\n\n private onAssignedBreakoutRoomUpdated = (breakoutRoom?: BreakoutRoom): void => {\n const callState = this._context.getState().calls[this._callIdRef.callId];\n const currentAssignedBreakoutRoom = callState?.breakoutRooms?.assignedBreakoutRoom;\n\n // This call won't exist in the calls array in state if this call is a breakout room that was re-assigned.\n // If so, do nothing.\n if (callState === undefined) {\n return;\n }\n\n if (!breakoutRoom) {\n // This scenario covers the case where the user is unassigned from a breakout room.\n if (currentAssignedBreakoutRoom?.call?.id) {\n this._context.deleteLatestNotification(currentAssignedBreakoutRoom.call.id, 'breakoutRoomJoined');\n this._context.deleteLatestNotification(currentAssignedBreakoutRoom.call.id, 'breakoutRoomClosingSoon');\n clearTimeout(this._breakoutRoomClosingSoonTimeoutId);\n }\n this._context.setAssignedBreakoutRoom(this._callIdRef.callId, breakoutRoom);\n return;\n }\n\n if (\n breakoutRoom.state === 'open' &&\n currentAssignedBreakoutRoom?.state === 'open' &&\n currentAssignedBreakoutRoom?.call?.id !== breakoutRoom.call?.id\n ) {\n if (\n !this._context.getState().latestNotifications['assignedBreakoutRoomOpened'] &&\n !this._context.getState().latestNotifications['assignedBreakoutRoomOpenedPromptJoin']\n ) {\n this._context.setLatestNotification(this._callIdRef.callId, {\n target: 'assignedBreakoutRoomChanged',\n timestamp: new Date(Date.now())\n });\n }\n } else if (breakoutRoom.state === 'open') {\n if (!this._context.getState().latestNotifications['assignedBreakoutRoomChanged']) {\n const target: NotificationTarget =\n breakoutRoom.autoMoveParticipantToBreakoutRoom === false\n ? 'assignedBreakoutRoomOpenedPromptJoin'\n : 'assignedBreakoutRoomOpened';\n this._context.setLatestNotification(this._callIdRef.callId, { target, timestamp: new Date(Date.now()) });\n }\n } else if (breakoutRoom.state === 'closed' && currentAssignedBreakoutRoom?.state === 'closed') {\n // This scenario covers the case where the breakout room is opened but then closed before the user joins.\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpened');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpenedPromptJoin');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomChanged');\n } else if (breakoutRoom.state === 'closed' && currentAssignedBreakoutRoom?.call?.id) {\n // This scenario covers the case where the breakout room is changed to a closed breakout room.\n this._context.deleteLatestNotification(currentAssignedBreakoutRoom.call.id, 'breakoutRoomJoined');\n this._context.deleteLatestNotification(currentAssignedBreakoutRoom.call.id, 'breakoutRoomClosingSoon');\n clearTimeout(this._breakoutRoomClosingSoonTimeoutId);\n }\n this._context.setAssignedBreakoutRoom(this._callIdRef.callId, breakoutRoom);\n };\n\n private onBreakoutRoomsJoined = (call: Call | TeamsCall): void => {\n this._context.setBreakoutRoomOriginCallId(this._callIdRef.callId, call.id);\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpened');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpenedPromptJoin');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomChanged');\n\n // Send latest notification for breakoutRoomJoined on behalf of the call that was joined.\n this._context.setLatestNotification(call.id, {\n target: 'breakoutRoomJoined',\n timestamp: new Date(Date.now())\n });\n\n // If assigned breakout room has a display name, set the display name for its call state.\n const assignedBreakoutRoomDisplayName =\n this._context.getState().calls[this._callIdRef.callId]?.breakoutRooms?.assignedBreakoutRoom?.displayName;\n if (assignedBreakoutRoomDisplayName) {\n this._context.setBreakoutRoomDisplayName(call.id, assignedBreakoutRoomDisplayName);\n }\n };\n\n private onBreakoutRoomSettingsUpdated = (breakoutRoomSettings: BreakoutRoomsSettings): void => {\n // If the roomEndTime is available, set a timeout to show a notification before the room closes.\n if (\n typeof breakoutRoomSettings.roomEndTime === 'string' &&\n !Number.isNaN(Date.parse(breakoutRoomSettings.roomEndTime))\n ) {\n const now = new Date(Date.now());\n const roomClosingTime = new Date(breakoutRoomSettings.roomEndTime).getTime();\n const timeBeforeClosing = roomClosingTime - now.getTime();\n const timeBeforeSendingClosingSoonNotification = Math.max(\n timeBeforeClosing - MILLSECONDS_BEFORE_END_TIME_TO_SHOW_CLOSING_NOTIFICATION,\n 0\n );\n if (!this._breakoutRoomClosingSoonTimeoutId) {\n this._breakoutRoomClosingSoonTimeoutId = setTimeout(\n () =>\n this._context.setLatestNotification(this._callIdRef.callId, {\n target: 'breakoutRoomClosingSoon',\n timestamp: now\n }),\n timeBeforeSendingClosingSoonNotification\n );\n }\n }\n this._context.setBreakoutRoomSettings(this._callIdRef.callId, breakoutRoomSettings);\n };\n}\n"]}
1
+ {"version":3,"file":"BreakoutRoomsSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/BreakoutRoomsSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC,iDAAiD;AACjD,MAAM,wDAAwD,GAAG,KAAK,CAAC;AAEvE,iDAAiD;AACjD;;GAEG;AACH,MAAM,OAAO,uBAAuB;IAMlC,YAAY,SAAoB,EAAE,OAAoB,EAAE,oBAA8C;QAQ/F,gBAAW,GAAG,GAAS,EAAE;YAC9B,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC;YACpF,yDAAyD;YACzD,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,oBAAoB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AqB,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;wBAC1D,MAAM,EAAE,yBAAyB;wBACjC,SAAS,EAAE,GAAG;qBACf,CAAC,EACJ,wCAAwC,CACzC,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;QACtF,CAAC,CAAC;QAnJA,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;QAElD,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAWO,SAAS;QACf,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACrF,CAAC;CAkIF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(breakout-rooms) */\nimport {\n BreakoutRoom,\n BreakoutRoomsCallFeature,\n BreakoutRoomsEventData,\n BreakoutRoomsSettings,\n Call,\n TeamsCall\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { CallContext } from './CallContext';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { CallIdRef } from './CallIdRef';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { NotificationTarget } from './CallClientState';\n\n/* @conditional-compile-remove(breakout-rooms) */\nconst MILLSECONDS_BEFORE_END_TIME_TO_SHOW_CLOSING_NOTIFICATION = 30000;\n\n/* @conditional-compile-remove(breakout-rooms) */\n/**\n * @private\n */\nexport class BreakoutRoomsSubscriber {\n private _callIdRef: CallIdRef;\n private _context: CallContext;\n private _breakoutRoomsFeature: BreakoutRoomsCallFeature;\n private _breakoutRoomClosingSoonTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n constructor(callIdRef: CallIdRef, context: CallContext, breakoutRoomsFeature: BreakoutRoomsCallFeature) {\n this._callIdRef = callIdRef;\n this._context = context;\n this._breakoutRoomsFeature = breakoutRoomsFeature;\n\n this.subscribe();\n }\n\n public unsubscribe = (): void => {\n this._breakoutRoomsFeature.off('breakoutRoomsUpdated', this.onBreakoutRoomsUpdated);\n // Clear breakout room joined notification for this call.\n this._context.deleteLatestNotification(this._callIdRef.callId, 'breakoutRoomJoined');\n // Clear breakout room closing soon notification for this call.\n this._context.deleteLatestNotification(this._callIdRef.callId, 'breakoutRoomClosingSoon');\n clearTimeout(this._breakoutRoomClosingSoonTimeoutId);\n };\n\n private subscribe(): void {\n this._breakoutRoomsFeature.on('breakoutRoomsUpdated', this.onBreakoutRoomsUpdated);\n }\n\n private onBreakoutRoomsUpdated = (eventData: BreakoutRoomsEventData): void => {\n if (eventData.type === 'assignedBreakoutRooms') {\n this.onAssignedBreakoutRoomUpdated(eventData.data);\n } else if (eventData.type === 'join') {\n this.onBreakoutRoomsJoined(eventData.data);\n } else if (eventData.type === 'breakoutRoomsSettings' && eventData.data) {\n this.onBreakoutRoomSettingsUpdated(eventData.data);\n }\n };\n\n private onAssignedBreakoutRoomUpdated = (breakoutRoom?: BreakoutRoom): void => {\n const callState = this._context.getState().calls[this._callIdRef.callId];\n const currentAssignedBreakoutRoom = callState?.breakoutRooms?.assignedBreakoutRoom;\n\n // This call won't exist in the calls array in state if this call is a breakout room that was re-assigned.\n // If so, do nothing.\n if (callState === undefined) {\n return;\n }\n\n if (!breakoutRoom) {\n // This scenario covers the case where the user is unassigned from a breakout room.\n if (currentAssignedBreakoutRoom?.call?.id) {\n this._context.deleteLatestNotification(currentAssignedBreakoutRoom.call.id, 'breakoutRoomJoined');\n this._context.deleteLatestNotification(currentAssignedBreakoutRoom.call.id, 'breakoutRoomClosingSoon');\n clearTimeout(this._breakoutRoomClosingSoonTimeoutId);\n }\n this._context.setAssignedBreakoutRoom(this._callIdRef.callId, breakoutRoom);\n return;\n }\n\n // TODO: Fix the condition in this if statement to check for different breakout room ID instead of the display name\n // when Calling SDK fixes the breakout room call id to be correct\n if (\n breakoutRoom.state === 'open' &&\n callState.breakoutRooms?.breakoutRoomDisplayName &&\n callState.breakoutRooms.breakoutRoomDisplayName !== breakoutRoom.displayName\n ) {\n this._context.setLatestNotification(this._callIdRef.callId, {\n target: 'assignedBreakoutRoomChanged',\n timestamp: new Date(Date.now())\n });\n } else if (\n breakoutRoom.state === 'open' &&\n !callState?.breakoutRooms?.breakoutRoomSettings &&\n this._context.getOpenBreakoutRoom() === undefined\n ) {\n const target: NotificationTarget =\n breakoutRoom.autoMoveParticipantToBreakoutRoom === false\n ? 'assignedBreakoutRoomOpenedPromptJoin'\n : 'assignedBreakoutRoomOpened';\n this._context.setLatestNotification(this._callIdRef.callId, { target, timestamp: new Date(Date.now()) });\n } else if (breakoutRoom.state === 'closed' && currentAssignedBreakoutRoom?.state === 'open') {\n // This scenario covers the case where the breakout room is opened but then closed before the user joins.\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpened');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpenedPromptJoin');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomChanged');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'breakoutRoomJoined');\n } else if (breakoutRoom.state === 'closed') {\n // This scenario covers the case where the breakout room is closed\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpened');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpenedPromptJoin');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomChanged');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'breakoutRoomJoined');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'breakoutRoomClosingSoon');\n clearTimeout(this._breakoutRoomClosingSoonTimeoutId);\n const openBreakoutRoomId = this._context.getOpenBreakoutRoom();\n if (openBreakoutRoomId && this._context.getState().calls[openBreakoutRoomId]) {\n // Show notification that the assigned breakout room was closed if the user is in that breakout room.\n this._context.setLatestNotification(this._callIdRef.callId, {\n target: 'assignedBreakoutRoomClosed',\n timestamp: new Date(Date.now())\n });\n }\n this._context.deleteOpenBreakoutRoom();\n }\n\n this._context.setAssignedBreakoutRoom(this._callIdRef.callId, breakoutRoom);\n };\n\n private onBreakoutRoomsJoined = (call: Call | TeamsCall): void => {\n this._context.setBreakoutRoomOriginCallId(this._callIdRef.callId, call.id);\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpened');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomOpenedPromptJoin');\n this._context.deleteLatestNotification(this._callIdRef.callId, 'assignedBreakoutRoomChanged');\n\n // Send latest notification for breakoutRoomJoined on behalf of the call that was joined.\n this._context.setLatestNotification(call.id, {\n target: 'breakoutRoomJoined',\n timestamp: new Date(Date.now())\n });\n\n this._context.setOpenBreakoutRoom(call.id);\n\n // If assigned breakout room has a display name, set the display name for its call state.\n const assignedBreakoutRoomDisplayName =\n this._context.getState().calls[this._callIdRef.callId]?.breakoutRooms?.assignedBreakoutRoom?.displayName;\n if (assignedBreakoutRoomDisplayName) {\n this._context.setBreakoutRoomDisplayName(call.id, assignedBreakoutRoomDisplayName);\n }\n };\n\n private onBreakoutRoomSettingsUpdated = (breakoutRoomSettings: BreakoutRoomsSettings): void => {\n // If the roomEndTime is available, set a timeout to show a notification before the room closes.\n if (\n typeof breakoutRoomSettings.roomEndTime === 'string' &&\n !Number.isNaN(Date.parse(breakoutRoomSettings.roomEndTime))\n ) {\n const now = new Date(Date.now());\n const roomClosingTime = new Date(breakoutRoomSettings.roomEndTime).getTime();\n const timeBeforeClosing = roomClosingTime - now.getTime();\n const timeBeforeSendingClosingSoonNotification = Math.max(\n timeBeforeClosing - MILLSECONDS_BEFORE_END_TIME_TO_SHOW_CLOSING_NOTIFICATION,\n 0\n );\n if (!this._breakoutRoomClosingSoonTimeoutId) {\n this._breakoutRoomClosingSoonTimeoutId = setTimeout(\n () =>\n this._context.setLatestNotification(this._callIdRef.callId, {\n target: 'breakoutRoomClosingSoon',\n timestamp: now\n }),\n timeBeforeSendingClosingSoonNotification\n );\n }\n }\n this._context.setBreakoutRoomSettings(this._callIdRef.callId, breakoutRoomSettings);\n };\n}\n"]}
@@ -217,9 +217,13 @@ export interface SpotlightState {
217
217
  * @public
218
218
  */
219
219
  export interface BreakoutRoomsState {
220
+ /** Breakout room assigned to local user in call */
220
221
  assignedBreakoutRoom?: BreakoutRoom;
222
+ /** Breakout room settings of call. This is defined when call is a breakout room. */
221
223
  breakoutRoomSettings?: BreakoutRoomsSettings;
224
+ /** Origin call id of breakout room. This is defined when call is a breakout room. */
222
225
  breakoutRoomOriginCallId?: string;
226
+ /** Display name of breakout room. This is defined when call is a breakout room. */
223
227
  breakoutRoomDisplayName?: string;
224
228
  }
225
229
  /**
@@ -1057,7 +1061,7 @@ export interface CallNotification {
1057
1061
  timestamp: Date;
1058
1062
  }
1059
1063
  /** @public */
1060
- export type NotificationTarget = /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomOpened' | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomOpenedPromptJoin' | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomChanged' | /* @conditional-compile-remove(breakout-rooms) */ 'breakoutRoomJoined' | /* @conditional-compile-remove(breakout-rooms) */ 'breakoutRoomClosingSoon' | 'capabilityTurnVideoOnPresent' | 'capabilityTurnVideoOnAbsent' | 'capabilityUnmuteMicPresent' | 'capabilityUnmuteMicAbsent' | /* @conditional-compile-remove(together-mode) */ 'togetherModeStarted' | /* @conditional-compile-remove(together-mode) */ 'togetherModeEnded';
1064
+ export type NotificationTarget = /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomOpened' | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomOpenedPromptJoin' | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomChanged' | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomClosed' | /* @conditional-compile-remove(breakout-rooms) */ 'breakoutRoomJoined' | /* @conditional-compile-remove(breakout-rooms) */ 'breakoutRoomClosingSoon' | 'capabilityTurnVideoOnPresent' | 'capabilityTurnVideoOnAbsent' | 'capabilityUnmuteMicPresent' | 'capabilityUnmuteMicAbsent' | /* @conditional-compile-remove(together-mode) */ 'togetherModeStarted' | /* @conditional-compile-remove(together-mode) */ 'togetherModeEnded';
1061
1065
  /**
1062
1066
  * State only proxy for {@link @azure/communication-calling#DiagnosticsCallFeature}.
1063
1067
  *