@azure/communication-react 1.3.3-alpha-202209080049.0 → 1.3.3-alpha-202209110016.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/communication-react.d.ts +82 -1
  2. package/dist/dist-cjs/communication-react/index.js +37 -28
  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/Drawer/DrawerMenuItem.d.ts +4 -0
  7. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js +1 -1
  8. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js.map +1 -1
  9. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +31 -0
  10. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  11. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -1
  12. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +11 -9
  13. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  14. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MutedNotification.js +6 -7
  15. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MutedNotification.js.map +1 -1
  16. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js +15 -10
  17. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js.map +1 -1
  18. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.d.ts +19 -0
  19. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.js.map +1 -1
  20. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +31 -0
  21. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  22. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js +15 -8
  23. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js.map +1 -1
  24. package/package.json +11 -10
@@ -960,6 +960,37 @@ export declare type CallCompositeOptions = {
960
960
  * @defaultValue true
961
961
  */
962
962
  callControls?: boolean | CallControlOptions;
963
+ /**
964
+ * Callback you may provide to supply users with further steps to troubleshoot why they have been
965
+ * unable to grant your site the required permissions for the call.
966
+ *
967
+ * @example
968
+ * ```ts
969
+ * onPermissionsTroubleshootingClick: () =>
970
+ * window.open('https://contoso.com/permissions-troubleshooting', '_blank');
971
+ * ```
972
+ *
973
+ * @remarks
974
+ * if this is not supplied, the composite will not show a 'further troubleshooting' link.
975
+ */
976
+ onPermissionsTroubleshootingClick?: (permissionsState: {
977
+ camera: PermissionState;
978
+ microphone: PermissionState;
979
+ }) => void;
980
+ /**
981
+ * Callback you may provide to supply users with further steps to troubleshoot why they have been
982
+ * having network issues when connecting to the call.
983
+ *
984
+ * @example
985
+ * ```ts
986
+ * onNetworkingTroubleShootingClick?: () =>
987
+ * window.open('https://contoso.com/network-troubleshooting', '_blank');
988
+ * ```
989
+ *
990
+ * @remarks
991
+ * if this is not supplied, the composite will not show a 'network troubleshooting' link.
992
+ */
993
+ onNetworkingTroubleShootingClick?: () => void;
963
994
  };
964
995
 
965
996
  /**
@@ -1510,7 +1541,7 @@ export declare type CallParticipantListParticipant = ParticipantListParticipant
1510
1541
  * @beta
1511
1542
  */
1512
1543
  export declare type CallParticipantsLocator = {
1513
- participantIDs: string[];
1544
+ participantIds: string[];
1514
1545
  };
1515
1546
 
1516
1547
  /**
@@ -2097,6 +2128,37 @@ export declare type CallWithChatCompositeOptions = {
2097
2128
  * @beta
2098
2129
  */
2099
2130
  fileSharing?: FileSharingOptions;
2131
+ /**
2132
+ * Callback you may provide to supply users with further steps to troubleshoot why they have been
2133
+ * unable to grant your site the required permissions for the call.
2134
+ *
2135
+ * @example
2136
+ * ```ts
2137
+ * onPermissionsTroubleshootingClick: () =>
2138
+ * window.open('https://contoso.com/permissions-troubleshooting', '_blank');
2139
+ * ```
2140
+ *
2141
+ * @remarks
2142
+ * if this is not supplied, the composite will not show a 'further troubleshooting' link.
2143
+ */
2144
+ onPermissionsTroubleshootingClick?: (permissionsState: {
2145
+ camera: PermissionState;
2146
+ microphone: PermissionState;
2147
+ }) => void;
2148
+ /**
2149
+ * Optional callback to supply users with further troubleshooting steps for network issues
2150
+ * experienced when connecting to a call.
2151
+ *
2152
+ * @example
2153
+ * ```ts
2154
+ * onNetworkingTroubleShootingClick?: () =>
2155
+ * window.open('https://contoso.com/network-troubleshooting', '_blank');
2156
+ * ```
2157
+ *
2158
+ * @remarks
2159
+ * if this is not supplied, the composite will not show a 'network troubleshooting' link.
2160
+ */
2161
+ onNetworkingTroubleShootingClick?: () => void;
2100
2162
  };
2101
2163
 
2102
2164
  /**
@@ -3801,6 +3863,9 @@ export declare interface CustomCallWithChatControlButtonProps extends CustomCont
3801
3863
  * @beta
3802
3864
  */
3803
3865
  export declare interface CustomControlButtonProps {
3866
+ /**
3867
+ * Calback for when button is clicked
3868
+ */
3804
3869
  onItemClick?: () => void;
3805
3870
  /**
3806
3871
  * Whether the buttons is disabled
@@ -3820,6 +3885,22 @@ export declare interface CustomControlButtonProps {
3820
3885
  * Optional label for the button
3821
3886
  */
3822
3887
  text?: string;
3888
+ /**
3889
+ * A unique key for the button
3890
+ */
3891
+ key?: string | number;
3892
+ /**
3893
+ * The aria label of the button for the benefit of screen readers.
3894
+ */
3895
+ ariaLabel?: string;
3896
+ /**
3897
+ * Detailed description of the button for the benefit of screen readers.
3898
+ */
3899
+ ariaDescription?: string;
3900
+ /**
3901
+ * A unique id set for the standard HTML id attibute
3902
+ */
3903
+ id?: string;
3823
3904
  }
3824
3905
 
3825
3906
  /**
@@ -192,7 +192,7 @@ const fromFlatCommunicationIdentifier = (id) => {
192
192
  // Copyright (c) Microsoft Corporation.
193
193
  // Licensed under the MIT license.
194
194
  // GENERATED FILE. DO NOT EDIT MANUALLY.
195
- var telemetryVersion = '1.3.3-alpha-202209080049.0';
195
+ var telemetryVersion = '1.3.3-alpha-202209110016.0';
196
196
 
197
197
  // Copyright (c) Microsoft Corporation.
198
198
  /**
@@ -7257,7 +7257,7 @@ const DrawerMenuItem = (props) => {
7257
7257
  const onClick = (ev) => props.onItemClick && props.onItemClick(ev, props.itemKey);
7258
7258
  const onKeyPress = (ev) => onClick && submitWithKeyboard(ev, onClick);
7259
7259
  const secondaryIcon = props.secondaryIconProps ? (React__default['default'].createElement(MenuItemIcon, Object.assign({}, props.secondaryIconProps))) : props.subMenuProps ? (React__default['default'].createElement(MenuItemIcon, { iconName: "ChevronRight" })) : undefined;
7260
- 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 },
7260
+ 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 },
7261
7261
  props.iconProps && (React__default['default'].createElement(react.Stack.Item, { role: "presentation", styles: props.disabled ? { root: { color: theme.palette.neutralTertiaryAlt } } : undefined },
7262
7262
  React__default['default'].createElement(MenuItemIcon, Object.assign({}, props.iconProps)))),
7263
7263
  React__default['default'].createElement(react.Stack.Item, { styles: drawerMenuItemTextStyles, grow: true },
@@ -14833,9 +14833,10 @@ const generateCustomControlBarButtons = (onFetchCustomButtonProps, displayType)
14833
14833
  for (const key in response) {
14834
14834
  response[key] = (React__default['default'].createElement(React__default['default'].Fragment, null, allButtonProps
14835
14835
  .filter((buttonProps) => buttonProps.placement === key)
14836
- .map((buttonProps, i) => (React__default['default'].createElement(ControlBarButton, { onClick: buttonProps.onItemClick, showLabel: buttonProps.showLabel, strings: generateCustomControlBarButtonStrings(buttonProps.text), styles: buttonProps.styles, key: `${buttonProps.placement}_${i}`,
14837
- // set default icon if not provided
14838
- onRenderIcon: () => { var _a; return React__default['default'].createElement(react.Icon, { iconName: (_a = buttonProps.iconName) !== null && _a !== void 0 ? _a : 'ControlButtonOptions' }); }, disabled: buttonProps.disabled })))));
14836
+ .map((buttonProps, i) => {
14837
+ var _a;
14838
+ return (React__default['default'].createElement(ControlBarButton, { ariaDescription: buttonProps.ariaDescription, ariaLabel: buttonProps.ariaLabel, disabled: buttonProps.disabled, id: buttonProps.id, key: (_a = buttonProps.key) !== null && _a !== void 0 ? _a : `${buttonProps.placement}_${i}`, onClick: buttonProps.onItemClick, onRenderIcon: () => { var _a; return React__default['default'].createElement(react.Icon, { iconName: (_a = buttonProps.iconName) !== null && _a !== void 0 ? _a : 'ControlButtonOptions' }); }, showLabel: buttonProps.showLabel, strings: generateCustomControlBarButtonStrings(buttonProps.text), styles: buttonProps.styles }));
14839
+ })));
14839
14840
  }
14840
14841
  return response;
14841
14842
  };
@@ -16256,10 +16257,7 @@ const CallPane = (props) => {
16256
16257
  function MutedNotification(props) {
16257
16258
  const locale = useLocale();
16258
16259
  const theme = react.useTheme();
16259
- if (!props.speakingWhileMuted) {
16260
- return React__default['default'].createElement(React__default['default'].Fragment, null);
16261
- }
16262
- return (React__default['default'].createElement(react.Stack, { horizontal: true, horizontalAlign: "center" },
16260
+ return (React__default['default'].createElement(react.Stack, { horizontal: true, horizontalAlign: "center", className: react.mergeStyles(props.speakingWhileMuted === true ? isSpeakingAndMutedAnimationStyles : isNotSpeakingAndMutedAnimationStyles) },
16263
16261
  React__default['default'].createElement(react.Stack, { horizontal: true, className: react.mergeStyles(stackStyle(theme)) },
16264
16262
  React__default['default'].createElement(CallCompositeIcon, { iconName: "Muted", className: react.mergeStyles(iconStyle(theme)) }),
16265
16263
  React__default['default'].createElement(react.Text, { className: react.mergeStyles(textStyle(theme)), "aria-live": 'polite' }, locale.strings.call.mutedMessage))));
@@ -16267,11 +16265,11 @@ function MutedNotification(props) {
16267
16265
  const stackStyle = (theme) => {
16268
16266
  return {
16269
16267
  background: theme.palette.black,
16270
- opacity: 0.8,
16271
16268
  gap: `1rem`,
16272
16269
  padding: `1rem`,
16273
16270
  borderRadius: theme.effects.roundedCorner4,
16274
- width: 'fit-content'
16271
+ width: 'fit-content',
16272
+ opacity: 0.8
16275
16273
  };
16276
16274
  };
16277
16275
  const iconStyle = (theme) => {
@@ -16286,6 +16284,8 @@ const textStyle = (theme) => {
16286
16284
  fontSize: `1rem`
16287
16285
  };
16288
16286
  };
16287
+ const isSpeakingAndMutedAnimationStyles = Object.assign({}, react.AnimationStyles.fadeIn100);
16288
+ const isNotSpeakingAndMutedAnimationStyles = Object.assign(Object.assign({}, react.AnimationStyles.fadeOut200), { display: 'none' });
16289
16289
 
16290
16290
  // Copyright (c) Microsoft Corporation.
16291
16291
  /**
@@ -17854,18 +17854,20 @@ class AzureCommunicationCallAdapter {
17854
17854
  if (_isInCall((_b = (_a = this.getState().call) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : 'None')) {
17855
17855
  throw new Error('You are already in the call!');
17856
17856
  }
17857
- /* @conditional-compile-remove(teams-adhoc-call) */
17858
- /* @conditional-compile-remove(PSTN-calls) */
17859
- if (isOutboundCall(this.locator)) {
17860
- const phoneNumber = this.getState().alternateCallerId;
17861
- return this.startCall(this.locator.participantIDs, {
17862
- alternateCallerId: phoneNumber ? { phoneNumber: phoneNumber } : undefined
17863
- });
17864
- }
17865
17857
  return this.teeErrorToEventEmitter(() => {
17866
17858
  const audioOptions = { muted: !(microphoneOn !== null && microphoneOn !== void 0 ? microphoneOn : this.getState().isLocalPreviewMicrophoneEnabled) };
17867
17859
  // TODO: find a way to expose stream to here
17868
17860
  const videoOptions = { localVideoStreams: this.localStream ? [this.localStream] : undefined };
17861
+ /* @conditional-compile-remove(teams-adhoc-call) */
17862
+ /* @conditional-compile-remove(PSTN-calls) */
17863
+ if (isOutboundCall(this.locator)) {
17864
+ const phoneNumber = this.getState().alternateCallerId;
17865
+ return this.startCall(this.locator.participantIds, {
17866
+ alternateCallerId: phoneNumber ? { phoneNumber: phoneNumber } : undefined,
17867
+ audioOptions,
17868
+ videoOptions
17869
+ });
17870
+ }
17869
17871
  const call = this._joinCall(audioOptions, videoOptions);
17870
17872
  this.processNewCall(call);
17871
17873
  return call;
@@ -18313,7 +18315,7 @@ const isCallError = (e) => {
18313
18315
  /* @conditional-compile-remove(teams-adhoc-call) */
18314
18316
  /* @conditional-compile-remove(PSTN-calls) */
18315
18317
  const isOutboundCall = (callLocator) => {
18316
- return 'participantIDs' in callLocator;
18318
+ return 'participantIds' in callLocator;
18317
18319
  };
18318
18320
 
18319
18321
  // Copyright (c) Microsoft Corporation.
@@ -18494,7 +18496,10 @@ const generateCustomCallWithChatControlBarButton = (onFetchCustomButtonProps, di
18494
18496
  for (const key in response) {
18495
18497
  response[key] = (React__default['default'].createElement(React__default['default'].Fragment, null, allButtonProps
18496
18498
  .filter((buttonProps) => buttonProps.placement === key)
18497
- .map((buttonProps, i) => (React__default['default'].createElement(ControlBarButton, { onClick: buttonProps.onItemClick, showLabel: buttonProps.showLabel, strings: generateCustomControlBarButtonStrings(buttonProps.text), styles: buttonProps.styles, key: `${buttonProps.placement}_${i}`, onRenderIcon: () => { var _a; return React__default['default'].createElement(react.Icon, { iconName: (_a = buttonProps.iconName) !== null && _a !== void 0 ? _a : 'ControlButtonOptions' }); }, disabled: buttonProps.disabled })))));
18499
+ .map((buttonProps, i) => {
18500
+ var _a;
18501
+ return (React__default['default'].createElement(ControlBarButton, { ariaDescription: buttonProps.ariaDescription, ariaLabel: buttonProps.ariaLabel, disabled: buttonProps.disabled, id: buttonProps.id, key: (_a = buttonProps.key) !== null && _a !== void 0 ? _a : `${buttonProps.placement}_${i}`, onClick: buttonProps.onItemClick, onRenderIcon: () => { var _a; return React__default['default'].createElement(react.Icon, { iconName: (_a = buttonProps.iconName) !== null && _a !== void 0 ? _a : 'ControlButtonOptions' }); }, showLabel: buttonProps.showLabel, strings: generateCustomControlBarButtonStrings(buttonProps.text), styles: buttonProps.styles }));
18502
+ })));
18498
18503
  }
18499
18504
  return response;
18500
18505
  };
@@ -18512,13 +18517,17 @@ const generateCustomCallWithChatDrawerButtons = (onFetchCustomButtonProps, displ
18512
18517
  for (const key in response) {
18513
18518
  response[key] = (React__default['default'].createElement(React__default['default'].Fragment, null, allButtonProps
18514
18519
  .filter((buttonProps) => buttonProps.placement === key)
18515
- .map((buttonProps, i) => ({
18516
- itemKey: `${buttonProps.placement}_${i}`,
18517
- text: buttonProps.text,
18518
- onItemClick: buttonProps.onItemClick,
18519
- iconProps: { iconName: buttonProps.iconName },
18520
- disabled: buttonProps.disabled
18521
- }))));
18520
+ .map((buttonProps, i) => {
18521
+ var _a;
18522
+ return ({
18523
+ disabled: buttonProps.disabled,
18524
+ id: buttonProps.id,
18525
+ iconProps: { iconName: buttonProps.iconName },
18526
+ itemKey: (_a = buttonProps.key) !== null && _a !== void 0 ? _a : `${buttonProps.placement}_${i}`,
18527
+ onItemClick: buttonProps.onItemClick,
18528
+ text: buttonProps.text
18529
+ });
18530
+ })));
18522
18531
  }
18523
18532
  return response;
18524
18533
  };