@azure/communication-react 1.7.0-alpha-202308120012 → 1.7.0-alpha-202308150012

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.
@@ -178,7 +178,7 @@ const _isValidIdentifier = (identifier) => {
178
178
  // Copyright (c) Microsoft Corporation.
179
179
  // Licensed under the MIT license.
180
180
  // GENERATED FILE. DO NOT EDIT MANUALLY.
181
- var telemetryVersion = '1.7.0-alpha-202308120012';
181
+ var telemetryVersion = '1.7.0-alpha-202308150012';
182
182
 
183
183
  // Copyright (c) Microsoft Corporation.
184
184
  /**
@@ -19430,6 +19430,7 @@ class ProxyChatThreadClient {
19430
19430
  }
19431
19431
  case 'sendMessage': {
19432
19432
  return this._context.withAsyncErrorTeedToState((...args) => __awaiter$m(this, void 0, void 0, function* () {
19433
+ var _a;
19433
19434
  // Retry logic?
19434
19435
  const [request, options] = args;
19435
19436
  const { content } = request;
@@ -19438,7 +19439,7 @@ class ProxyChatThreadClient {
19438
19439
  content: { message: content },
19439
19440
  clientMessageId,
19440
19441
  id: '',
19441
- type: 'text',
19442
+ type: (_a = options === null || options === void 0 ? void 0 : options.type) !== null && _a !== void 0 ? _a : 'text',
19442
19443
  sequenceId: '',
19443
19444
  version: '',
19444
19445
  createdOn: new Date(),
@@ -22659,6 +22660,14 @@ const getIsScreenShareOn = (state) => { var _a, _b; return (_b = (_a = state.cal
22659
22660
  * @private
22660
22661
  */
22661
22662
  const getIsPreviewCameraOn = (state) => _isPreviewOn(state.devices);
22663
+ /**
22664
+ * @private
22665
+ */
22666
+ const getMicrophones = (state) => state.devices.microphones;
22667
+ /**
22668
+ * @private
22669
+ */
22670
+ const getCameras = (state) => state.devices.cameras;
22662
22671
  /**
22663
22672
  * @private
22664
22673
  */
@@ -27624,6 +27633,17 @@ const containerStyles = {
27624
27633
  }
27625
27634
  };
27626
27635
 
27636
+ // Copyright (c) Microsoft Corporation.
27637
+ /**
27638
+ * @private
27639
+ */
27640
+ const deviceCountSelector = reselect.createSelector([getCameras, getMicrophones], (cameras, microphones) => {
27641
+ return {
27642
+ camerasCount: cameras.length,
27643
+ microphonesCount: microphones.length
27644
+ };
27645
+ });
27646
+
27627
27647
  // Copyright (c) Microsoft Corporation.
27628
27648
  // Licensed under the MIT license.
27629
27649
  var __awaiter$7 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -27640,6 +27660,28 @@ const isShowing = (overrideSidePane) => {
27640
27660
  };
27641
27661
  const MainScreen = (props) => {
27642
27662
  var _a, _b, _c, _d, _e;
27663
+ const adapter = useAdapter();
27664
+ const { camerasCount, microphonesCount } = useSelector$1(deviceCountSelector);
27665
+ const hasCameras = camerasCount > 0;
27666
+ const hasMicrophones = microphonesCount > 0;
27667
+ React.useEffect(() => {
27668
+ (() => __awaiter$7(void 0, void 0, void 0, function* () {
27669
+ var _a;
27670
+ const constrain = getQueryOptions({
27671
+ /* @conditional-compile-remove(rooms) */ role: (_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role
27672
+ });
27673
+ yield adapter.askDevicePermission(constrain);
27674
+ adapter.queryCameras();
27675
+ adapter.queryMicrophones();
27676
+ adapter.querySpeakers();
27677
+ }))();
27678
+ }, [
27679
+ adapter,
27680
+ // Ensure we re-ask for permissions if the number of devices goes from 0 -> n during a call
27681
+ // as we cannot request permissions when there are no devices.
27682
+ hasCameras,
27683
+ hasMicrophones
27684
+ ]);
27643
27685
  const { callInvitationUrl, onRenderAvatar, onFetchAvatarPersonaData, onFetchParticipantMenuItems } = props;
27644
27686
  const page = useSelector$1(getPage);
27645
27687
  const endedCall = useSelector$1(getEndedCall);
@@ -27671,7 +27713,6 @@ const MainScreen = (props) => {
27671
27713
  setTrackedErrors((prev) => trackErrorAsDismissed(error.type, prev));
27672
27714
  }, []);
27673
27715
  const latestErrors = React.useMemo(() => filterLatestErrors(activeErrors, trackedErrors), [activeErrors, trackedErrors]);
27674
- const adapter = useAdapter();
27675
27716
  const locale = useLocale();
27676
27717
  const palette = useTheme().palette;
27677
27718
  const leavePageStyle = React.useMemo(() => leavingPageStyle(palette), [palette]);
@@ -27755,18 +27796,6 @@ const CallComposite = (props) => React__default['default'].createElement(CallCom
27755
27796
  /** @private */
27756
27797
  const CallCompositeInner = (props) => {
27757
27798
  const { adapter, callInvitationUrl, onFetchAvatarPersonaData, onFetchParticipantMenuItems, options, formFactor = 'desktop' } = props;
27758
- React.useEffect(() => {
27759
- (() => __awaiter$7(void 0, void 0, void 0, function* () {
27760
- var _a;
27761
- const constrain = getQueryOptions({
27762
- /* @conditional-compile-remove(rooms) */ role: (_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role
27763
- });
27764
- yield adapter.askDevicePermission(constrain);
27765
- adapter.queryCameras();
27766
- adapter.queryMicrophones();
27767
- adapter.querySpeakers();
27768
- }))();
27769
- }, [adapter]);
27770
27799
  const mobileView = formFactor === 'mobile';
27771
27800
  const modalLayerHostId = reactHooks.useId('modalLayerhost');
27772
27801
  const mainScreenContainerClassName = React.useMemo(() => {