@azure/communication-react 1.5.1-alpha-202306130014 → 1.5.1-alpha-202306140013

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 (22) hide show
  1. package/dist/communication-react.d.ts +8 -9
  2. package/dist/dist-cjs/communication-react/index.js +44 -14
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +1 -1
  7. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +8 -2
  9. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -1
  10. package/dist/dist-esm/react-components/src/components/VideoTile.js +7 -3
  11. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  12. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +2 -3
  13. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  14. package/dist/dist-esm/react-composites/src/Logger.d.ts +5 -0
  15. package/dist/dist-esm/react-composites/src/Logger.js +8 -0
  16. package/dist/dist-esm/react-composites/src/Logger.js.map +1 -0
  17. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +8 -9
  18. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +19 -3
  19. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  20. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js +1 -1
  21. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js.map +1 -1
  22. package/package.json +8 -8
@@ -3980,6 +3980,12 @@ export declare type CommonCallAdapterOptions = {
3980
3980
  * Default set of background images for background image picker.
3981
3981
  */
3982
3982
  videoBackgroundImages?: VideoBackgroundImage[];
3983
+ /**
3984
+ * Use this to fetch profile information which will override data in {@link CallAdapterState} like display name
3985
+ * The onFetchProfile is fetch-and-forget one time action for each user, once a user profile is updated, the value will be cached
3986
+ * and would not be updated again within the lifecycle of adapter.
3987
+ */
3988
+ onFetchProfile?: OnFetchProfileCallback;
3983
3989
  };
3984
3990
 
3985
3991
  /**
@@ -4882,7 +4888,7 @@ export declare const createTeamsCallAdapter: ({ userId, credential, locator, opt
4882
4888
  *
4883
4889
  * @beta
4884
4890
  */
4885
- export declare const createTeamsCallAdapterFromClient: (callClient: StatefulCallClient, callAgent: TeamsCallAgent, locator: CallAdapterLocator, options?: TeamsAdapterOptions | undefined) => Promise<TeamsCallAdapter>;
4891
+ export declare const createTeamsCallAdapterFromClient: (callClient: StatefulCallClient, callAgent: TeamsCallAgent, locator: CallAdapterLocator, options?: CommonCallAdapterOptions | undefined) => Promise<TeamsCallAdapter>;
4886
4892
 
4887
4893
  /**
4888
4894
  * Object returned after creating a local or remote VideoStream.
@@ -8462,14 +8468,7 @@ export declare interface SystemMessageCommon extends MessageCommon {
8462
8468
  *
8463
8469
  * @beta
8464
8470
  */
8465
- export declare type TeamsAdapterOptions = {
8466
- /**
8467
- * Use this to fetch profile information which will override data in {@link CallAdapterState} like display name
8468
- * The onFetchProfile is fetch-and-forget one time action for each user, once a user profile is updated, the value will be cached
8469
- * and would not be updated again within the lifecycle of adapter.
8470
- */
8471
- onFetchProfile?: OnFetchProfileCallback;
8472
- } & CommonCallAdapterOptions;
8471
+ export declare type TeamsAdapterOptions = CommonCallAdapterOptions;
8473
8472
 
8474
8473
  /**
8475
8474
  * An Adapter interface specific for Teams identity which extends {@link CommonCallAdapter}.
@@ -167,7 +167,7 @@ const _toCommunicationIdentifier = (id) => {
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  // Licensed under the MIT license.
169
169
  // GENERATED FILE. DO NOT EDIT MANUALLY.
170
- var telemetryVersion = '1.5.1-alpha-202306130014';
170
+ var telemetryVersion = '1.5.1-alpha-202306140013';
171
171
 
172
172
  // Copyright (c) Microsoft Corporation.
173
173
  /**
@@ -5424,9 +5424,8 @@ const sendBoxWrapperStyles = react.mergeStyles({
5424
5424
  * @private
5425
5425
  */
5426
5426
  const sendButtonStyle = react.mergeStyles({
5427
- height: '1.25rem',
5428
- width: '1.25rem',
5429
- marginRight: '0.313rem' // 5px
5427
+ height: '2.25rem',
5428
+ width: '2.25rem'
5430
5429
  });
5431
5430
  /**
5432
5431
  * @private
@@ -7245,11 +7244,17 @@ const TextFieldWithMention = (props) => {
7245
7244
  else {
7246
7245
  event.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, mentionEndIndex, event.currentTarget.selectionDirection);
7247
7246
  }
7247
+ setSelectionStartValue(mentionTag.plainTextBeginIndex);
7248
+ setSelectionEndValue(mentionEndIndex);
7249
+ }
7250
+ else {
7251
+ // bounds of the mention were selected
7252
+ setSelectionStartValue(event.currentTarget.selectionStart);
7253
+ setSelectionEndValue(event.currentTarget.selectionEnd);
7248
7254
  }
7249
- setSelectionStartValue(mentionTag.plainTextBeginIndex);
7250
- setSelectionEndValue(mentionEndIndex);
7251
7255
  }
7252
7256
  else {
7257
+ // not a mention tag
7253
7258
  setSelectionStartValue(event.currentTarget.selectionStart);
7254
7259
  setSelectionEndValue(nullToUndefined(event.currentTarget.selectionEnd));
7255
7260
  }
@@ -7495,7 +7500,7 @@ const InputBoxComponent = (props) => {
7495
7500
  errorMessage: styles === null || styles === void 0 ? void 0 : styles.systemMessage,
7496
7501
  suffix: {
7497
7502
  backgroundColor: 'transparent',
7498
- padding: props.inlineChildren ? '0 0.25rem' : '0 0'
7503
+ padding: '0 0'
7499
7504
  }
7500
7505
  });
7501
7506
  const mergedChildrenStyle = react.mergeStyles(props.inlineChildren ? {} : newLineButtonsContainerStyle);
@@ -11155,15 +11160,19 @@ const VideoTile = (props) => {
11155
11160
  const [isHovered, setIsHovered] = React.useState(false);
11156
11161
  /* @conditional-compile-remove(pinned-participants) */
11157
11162
  const [isFocused, setIsFocused] = React.useState(false);
11158
- const [personaSize, setPersonaSize] = React.useState();
11163
+ // need to set a default otherwise the resizeObserver will get stuck in an infinite loop.
11164
+ const [personaSize, setPersonaSize] = React.useState(1);
11159
11165
  const videoTileRef = React.useRef(null);
11160
11166
  const locale = useLocale$1();
11161
11167
  const theme = useTheme();
11162
11168
  const isVideoRendered = !!renderElement;
11163
11169
  const observer = React.useRef(new ResizeObserver((entries) => {
11164
11170
  const { width, height } = entries[0].contentRect;
11165
- const personaSize = Math.min(width, height) / 3;
11166
- setPersonaSize(Math.max(Math.min(personaSize, personaMaxSize), personaMinSize));
11171
+ const personaCalcSize = Math.min(width, height) / 3;
11172
+ // we only want to set the persona size if it has changed
11173
+ if (personaCalcSize !== personaSize) {
11174
+ setPersonaSize(Math.max(Math.min(personaCalcSize, personaMaxSize), personaMinSize));
11175
+ }
11167
11176
  }));
11168
11177
  React.useLayoutEffect(() => {
11169
11178
  if (videoTileRef.current) {
@@ -26444,6 +26453,12 @@ const getQueryOptions = (options) => {
26444
26453
  return { video: true, audio: true };
26445
26454
  };
26446
26455
 
26456
+ // Copyright (c) Microsoft Corporation.
26457
+ /**
26458
+ * @private
26459
+ */
26460
+ const compositeLogger = logger.createClientLogger('communication-react:composite');
26461
+
26447
26462
  /**
26448
26463
  * @private
26449
26464
  */
@@ -26562,8 +26577,8 @@ const createProfileStateModifier = (onFetchProfile, notifyUpdate) => {
26562
26577
  const profile = yield onFetchProfile(key, { displayName: originalParticipants[key].displayName });
26563
26578
  if ((profile === null || profile === void 0 ? void 0 : profile.displayName) && originalParticipants[key].displayName !== (profile === null || profile === void 0 ? void 0 : profile.displayName)) {
26564
26579
  cachedDisplayName[key] = profile === null || profile === void 0 ? void 0 : profile.displayName;
26580
+ shouldNotifyUpdates = true;
26565
26581
  }
26566
- shouldNotifyUpdates = true;
26567
26582
  }
26568
26583
  // notify update only when there is a change, which most likely will trigger modifier and setState again
26569
26584
  shouldNotifyUpdates && notifyUpdate();
@@ -26893,29 +26908,44 @@ class AzureCommunicationCallAdapter {
26893
26908
  }
26894
26909
  queryCameras() {
26895
26910
  return __awaiter$3(this, void 0, void 0, function* () {
26911
+ const startTime = new Date().getTime();
26896
26912
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$3(this, void 0, void 0, function* () {
26897
- return this.deviceManager.getCameras();
26913
+ const cameras = yield this.deviceManager.getCameras();
26914
+ const endTime = new Date().getTime();
26915
+ compositeLogger.info('time to query cameras', endTime - startTime, 'ms');
26916
+ return cameras;
26898
26917
  }));
26899
26918
  });
26900
26919
  }
26901
26920
  queryMicrophones() {
26902
26921
  return __awaiter$3(this, void 0, void 0, function* () {
26922
+ const startTime = new Date().getTime();
26903
26923
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$3(this, void 0, void 0, function* () {
26904
- return this.deviceManager.getMicrophones();
26924
+ const microphones = yield this.deviceManager.getMicrophones();
26925
+ const endTime = new Date().getTime();
26926
+ compositeLogger.info('time to query microphones', endTime - startTime, 'ms');
26927
+ return microphones;
26905
26928
  }));
26906
26929
  });
26907
26930
  }
26908
26931
  querySpeakers() {
26909
26932
  return __awaiter$3(this, void 0, void 0, function* () {
26933
+ const startTime = new Date().getTime();
26910
26934
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$3(this, void 0, void 0, function* () {
26911
- return this.deviceManager.isSpeakerSelectionAvailable ? this.deviceManager.getSpeakers() : [];
26935
+ const speakers = (yield this.deviceManager.isSpeakerSelectionAvailable) ? this.deviceManager.getSpeakers() : [];
26936
+ const endTime = new Date().getTime();
26937
+ compositeLogger.info('time to query speakers', endTime - startTime, 'ms');
26938
+ return speakers;
26912
26939
  }));
26913
26940
  });
26914
26941
  }
26915
26942
  askDevicePermission(constrain) {
26916
26943
  return __awaiter$3(this, void 0, void 0, function* () {
26944
+ const startTime = new Date().getTime();
26917
26945
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$3(this, void 0, void 0, function* () {
26918
26946
  yield this.deviceManager.askDevicePermission(constrain);
26947
+ const endTime = new Date().getTime();
26948
+ compositeLogger.info('time to query askDevicePermissions', endTime - startTime, 'ms');
26919
26949
  }));
26920
26950
  });
26921
26951
  }