@azure/communication-react 1.9.0-alpha-202310120012 → 1.9.0-alpha-202310130013

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.
@@ -177,7 +177,7 @@ const _isValidIdentifier = (identifier) => {
177
177
  // Copyright (c) Microsoft Corporation.
178
178
  // Licensed under the MIT License.
179
179
  // GENERATED FILE. DO NOT EDIT MANUALLY.
180
- var telemetryVersion = '1.9.0-alpha-202310120012';
180
+ var telemetryVersion = '1.9.0-alpha-202310130013';
181
181
 
182
182
  // Copyright (c) Microsoft Corporation.
183
183
  /**
@@ -11848,17 +11848,18 @@ const DrawerMenuItem = (props) => {
11848
11848
  const onClick = (ev) => props.onItemClick && props.onItemClick(ev, props.itemKey);
11849
11849
  const onKeyPress = (ev) => onClick && submitWithKeyboard(ev, onClick);
11850
11850
  const secondaryIcon = props.secondaryIconProps ? (React__default["default"].createElement(MenuItemIcon, Object.assign({}, props.secondaryIconProps))) : props.subMenuProps ? (React__default["default"].createElement(MenuItemIcon, { iconName: "ChevronRight" })) : undefined;
11851
- return (React__default["default"].createElement(react.Stack, { tabIndex: 0, role: "menuitem", horizontal: true, className: react.mergeStyles(drawerMenuItemRootStyles(theme.palette.neutralLight, theme.fonts.small), props.disabled ? disabledDrawerMenuItemRootStyles(theme.palette.neutralQuaternaryAlt) : undefined, (_a = props.styles) === null || _a === void 0 ? void 0 : _a.root), onKeyPress: props.disabled ? undefined : onKeyPress, onClick: props.disabled ? undefined : onClick, tokens: menuItemChildrenGap, id: props.id },
11852
- props.iconProps && (React__default["default"].createElement(react.Stack.Item, { role: "presentation", styles: props.disabled ? { root: { color: theme.palette.neutralTertiaryAlt } } : undefined },
11853
- React__default["default"].createElement(MenuItemIcon, Object.assign({}, props.iconProps)))),
11854
- React__default["default"].createElement(react.Stack.Item, { styles: drawerMenuItemTextStyles, grow: true },
11855
- React__default["default"].createElement(react.Text, { styles: props.disabled ? { root: { color: theme.palette.neutralTertiaryAlt } } : undefined }, props.text)),
11856
- props.secondaryText && (React__default["default"].createElement(react.Stack.Item, { styles: drawerMenuItemTextStyles, className: react.mergeStyles(secondaryTextStyles$2) },
11857
- React__default["default"].createElement(react.Text, { styles: {
11858
- root: { color: props.disabled ? theme.palette.neutralTertiaryAlt : theme.palette.neutralSecondary }
11859
- } }, props.secondaryText))),
11860
- props.secondaryComponent && React__default["default"].createElement(react.Stack.Item, null, props.secondaryComponent),
11861
- secondaryIcon && React__default["default"].createElement(react.Stack.Item, null, secondaryIcon)));
11851
+ return (React__default["default"].createElement(react.FocusZone, { shouldFocusOnMount: props.shouldFocusOnMount },
11852
+ React__default["default"].createElement(react.Stack, { tabIndex: 0, role: "menuitem", horizontal: true, className: react.mergeStyles(drawerMenuItemRootStyles(theme.palette.neutralLight, theme.fonts.small), props.disabled ? disabledDrawerMenuItemRootStyles(theme.palette.neutralQuaternaryAlt) : undefined, (_a = props.styles) === null || _a === void 0 ? void 0 : _a.root), onKeyPress: props.disabled ? undefined : onKeyPress, onClick: props.disabled ? undefined : onClick, tokens: menuItemChildrenGap, id: props.id },
11853
+ props.iconProps && (React__default["default"].createElement(react.Stack.Item, { role: "presentation", styles: props.disabled ? { root: { color: theme.palette.neutralTertiaryAlt } } : undefined },
11854
+ React__default["default"].createElement(MenuItemIcon, Object.assign({}, props.iconProps)))),
11855
+ React__default["default"].createElement(react.Stack.Item, { styles: drawerMenuItemTextStyles, grow: true },
11856
+ React__default["default"].createElement(react.Text, { styles: props.disabled ? { root: { color: theme.palette.neutralTertiaryAlt } } : undefined }, props.text)),
11857
+ props.secondaryText && (React__default["default"].createElement(react.Stack.Item, { styles: drawerMenuItemTextStyles, className: react.mergeStyles(secondaryTextStyles$2) },
11858
+ React__default["default"].createElement(react.Text, { styles: {
11859
+ root: { color: props.disabled ? theme.palette.neutralTertiaryAlt : theme.palette.neutralSecondary }
11860
+ } }, props.secondaryText))),
11861
+ props.secondaryComponent && React__default["default"].createElement(react.Stack.Item, null, props.secondaryComponent),
11862
+ secondaryIcon && React__default["default"].createElement(react.Stack.Item, null, secondaryIcon))));
11862
11863
  };
11863
11864
  const MenuItemIcon = (props) => (React__default["default"].createElement(react.FontIcon, Object.assign({ className: react.mergeStyles(iconStyles$1) }, props)));
11864
11865
  const menuItemChildrenGap = { childrenGap: '0.5rem' };
@@ -12027,10 +12028,10 @@ const _DrawerMenu = (props) => {
12027
12028
  }), [firstItemStyle, borderRadius]);
12028
12029
  return (React__default["default"].createElement(_DrawerSurface, { disableMaxHeight: props.disableMaxHeight, styles: (_b = props.styles) === null || _b === void 0 ? void 0 : _b.drawerSurfaceStyles, onLightDismiss: props.onLightDismiss, heading: props.heading },
12029
12030
  React__default["default"].createElement(react.Stack, { styles: props.styles, role: "menu", "data-ui-id": "drawer-menu" }, menuItemsToRender === null || menuItemsToRender === void 0 ? void 0 :
12030
- menuItemsToRender.slice(0, 1).map((item) => (React__default["default"].createElement(DrawerMenuItem, Object.assign({}, item, { key: '0', styles: modifiedFirstItemStyle, onItemClick: (ev, itemKey) => {
12031
+ menuItemsToRender.slice(0, 1).map((item) => (React__default["default"].createElement(DrawerMenuItem, Object.assign({}, item, { key: `${item.itemKey}` + '0', shouldFocusOnMount: true, styles: modifiedFirstItemStyle, onItemClick: (ev, itemKey) => {
12031
12032
  onItemClick(item, ev, itemKey);
12032
12033
  } })))), menuItemsToRender === null || menuItemsToRender === void 0 ? void 0 :
12033
- menuItemsToRender.slice(1).map((item, i) => (React__default["default"].createElement(DrawerMenuItem, Object.assign({}, item, { key: `${i + 1}`, onItemClick: (ev, itemKey) => {
12034
+ menuItemsToRender.slice(1).map((item, i) => (React__default["default"].createElement(DrawerMenuItem, Object.assign({}, item, { key: `${item.itemKey}` + `${i + 1}`, onItemClick: (ev, itemKey) => {
12034
12035
  onItemClick(item, ev, itemKey);
12035
12036
  } })))))));
12036
12037
  };
@@ -30418,8 +30419,6 @@ class AzureCommunicationCallAdapter {
30418
30419
  throw new Error('You are already in the call.');
30419
30420
  }
30420
30421
  const idsToAdd = participants.map((participant) => {
30421
- // FIXME: `onStartCall` does not allow a Teams user.
30422
- // Need some way to return an error if a Teams user is provided.
30423
30422
  const backendId = _toCommunicationIdentifier(participant);
30424
30423
  if (communicationCommon.isPhoneNumberIdentifier(backendId)) {
30425
30424
  if ((options === null || options === void 0 ? void 0 : options.alternateCallerId) === undefined) {
@@ -30430,6 +30429,12 @@ class AzureCommunicationCallAdapter {
30430
30429
  else if (communicationCommon.isCommunicationUserIdentifier(backendId)) {
30431
30430
  return backendId;
30432
30431
  }
30432
+ else if (communicationCommon.isMicrosoftTeamsAppIdentifier(backendId)) {
30433
+ return backendId;
30434
+ }
30435
+ else if (communicationCommon.isMicrosoftTeamsUserIdentifier(backendId)) {
30436
+ return backendId;
30437
+ }
30433
30438
  return backendId;
30434
30439
  });
30435
30440
  const call = this.handlers.onStartCall(idsToAdd, options);
@@ -32477,6 +32482,7 @@ beforeDispose) => {
32477
32482
  const [adapter, setAdapter] = React.useState(undefined);
32478
32483
  // Ref needed for cleanup to access the old adapter created asynchronously.
32479
32484
  const adapterRef = React.useRef(undefined);
32485
+ const creatingAdapterRef = React.useRef(false);
32480
32486
  const afterCreateRef = React.useRef(undefined);
32481
32487
  const beforeDisposeRef = React.useRef(undefined);
32482
32488
  // These refs are updated on *each* render, so that the latest values
@@ -32502,6 +32508,11 @@ beforeDispose) => {
32502
32508
  adapterRef.current.dispose();
32503
32509
  adapterRef.current = undefined;
32504
32510
  }
32511
+ if (creatingAdapterRef.current) {
32512
+ console.warn('Adapter is already being created, please see storybook for more information: https://azure.github.io/communication-ui-library/?path=/story/troubleshooting--page');
32513
+ return;
32514
+ }
32515
+ creatingAdapterRef.current = true;
32505
32516
  let newAdapter = yield createAzureCommunicationCallWithChatAdapter({
32506
32517
  credential,
32507
32518
  displayName,