@azure/communication-react 1.3.2-alpha-202207240017.0 → 1.3.2-alpha-202207260015.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.
- package/dist/communication-react.d.ts +10 -7
- package/dist/dist-cjs/communication-react/index.js +95 -34
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/identifier.d.ts.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/identifier.js +7 -6
- package/dist/dist-esm/acs-ui-common/src/identifier.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +4 -2
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +2 -2
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ControlBar.js +1 -1
- package/dist/dist-esm/react-components/src/components/ControlBar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +6 -2
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +19 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +5 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +10 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +19 -5
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js +5 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/BaseComposite.d.ts.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/BaseComposite.js +20 -2
- package/dist/dist-esm/react-composites/src/composites/common/BaseComposite.js.map +1 -1
- package/package.json +8 -8
@@ -255,7 +255,7 @@ export declare type AzureCommunicationCallAdapterArgs = {
|
|
255
255
|
displayName: string;
|
256
256
|
credential: CommunicationTokenCredential;
|
257
257
|
locator: CallAdapterLocator;
|
258
|
-
|
258
|
+
alternateCallerId?: string;
|
259
259
|
};
|
260
260
|
|
261
261
|
/**
|
@@ -269,6 +269,7 @@ export declare type AzureCommunicationCallWithChatAdapterArgs = {
|
|
269
269
|
displayName: string;
|
270
270
|
credential: CommunicationTokenCredential;
|
271
271
|
locator: CallAndChatLocator | TeamsMeetingLinkLocator;
|
272
|
+
alternateCallerId?: string;
|
272
273
|
};
|
273
274
|
|
274
275
|
/**
|
@@ -501,7 +502,7 @@ export declare type CallAdapterClientState = {
|
|
501
502
|
/**
|
502
503
|
* Azure communications Phone number to make PSTN calls with.
|
503
504
|
*/
|
504
|
-
|
505
|
+
alternateCallerId?: string;
|
505
506
|
};
|
506
507
|
|
507
508
|
/**
|
@@ -852,9 +853,11 @@ export declare interface CallClientState {
|
|
852
853
|
*/
|
853
854
|
latestErrors: CallErrors;
|
854
855
|
/**
|
855
|
-
*
|
856
|
+
* A phone number in E.164 format that will be used to represent callers identity.
|
857
|
+
* For example, using the alternateCallerId to add a participant using PSTN, this number will
|
858
|
+
* be used as the caller id in the PSTN call.
|
856
859
|
*/
|
857
|
-
|
860
|
+
alternateCallerId?: string;
|
858
861
|
}
|
859
862
|
|
860
863
|
/**
|
@@ -3379,7 +3382,7 @@ export declare interface ControlBarProps {
|
|
3379
3382
|
*
|
3380
3383
|
* @public
|
3381
3384
|
*/
|
3382
|
-
export declare const createAzureCommunicationCallAdapter: ({ userId, displayName, credential, locator,
|
3385
|
+
export declare const createAzureCommunicationCallAdapter: ({ userId, displayName, credential, locator, alternateCallerId }: AzureCommunicationCallAdapterArgs) => Promise<CallAdapter>;
|
3383
3386
|
|
3384
3387
|
/**
|
3385
3388
|
* Create a {@link CallAdapter} using the provided {@link StatefulCallClient}.
|
@@ -3397,7 +3400,7 @@ export declare const createAzureCommunicationCallAdapterFromClient: (callClient:
|
|
3397
3400
|
*
|
3398
3401
|
* @public
|
3399
3402
|
*/
|
3400
|
-
export declare const createAzureCommunicationCallWithChatAdapter: ({ userId, displayName, credential, endpoint, locator }: AzureCommunicationCallWithChatAdapterArgs) => Promise<CallWithChatAdapter>;
|
3403
|
+
export declare const createAzureCommunicationCallWithChatAdapter: ({ userId, displayName, credential, endpoint, locator, alternateCallerId }: AzureCommunicationCallWithChatAdapterArgs) => Promise<CallWithChatAdapter>;
|
3401
3404
|
|
3402
3405
|
/**
|
3403
3406
|
* Create a {@link CallWithChatAdapter} using the provided {@link StatefulChatClient} and {@link StatefulCallClient}.
|
@@ -6455,7 +6458,7 @@ export declare type StatefulCallClientArgs = {
|
|
6455
6458
|
*
|
6456
6459
|
* This is not a cached value from the headless calling client.
|
6457
6460
|
*/
|
6458
|
-
|
6461
|
+
alternateCallerId?: string;
|
6459
6462
|
};
|
6460
6463
|
|
6461
6464
|
/**
|
@@ -170,20 +170,21 @@ const fromFlatCommunicationIdentifier = (id) => {
|
|
170
170
|
// The prefix is preserved for this variant of the identifier.
|
171
171
|
return { communicationUserId: id };
|
172
172
|
}
|
173
|
-
if (id.startsWith(PHONE_NUMBER_PREFIX)) {
|
174
|
-
|
173
|
+
if (id.startsWith(PHONE_NUMBER_PREFIX) || id.startsWith('+')) {
|
174
|
+
const isPhoneNumber = id.startsWith(PHONE_NUMBER_PREFIX) ? id.replace(PHONE_NUMBER_PREFIX, '') : id;
|
175
|
+
return { phoneNumber: isPhoneNumber };
|
175
176
|
}
|
176
177
|
if (id.startsWith(TEAMS_USER_PREFIX)) {
|
177
|
-
return { microsoftTeamsUserId: id.
|
178
|
+
return { microsoftTeamsUserId: id.replace(TEAMS_USER_PREFIX, '') };
|
178
179
|
}
|
179
180
|
if (id.startsWith(TEAMS_DOD_PREFIX)) {
|
180
|
-
return { microsoftTeamsUserId: id.
|
181
|
+
return { microsoftTeamsUserId: id.replace(TEAMS_DOD_PREFIX, ''), cloud: 'dod' };
|
181
182
|
}
|
182
183
|
if (id.startsWith(TEAMS_GCCH_PREFIX)) {
|
183
|
-
return { microsoftTeamsUserId: id.
|
184
|
+
return { microsoftTeamsUserId: id.replace(TEAMS_GCCH_PREFIX, ''), cloud: 'gcch' };
|
184
185
|
}
|
185
186
|
if (id.startsWith(TEAMS_VISITOR_PREFIX)) {
|
186
|
-
return { microsoftTeamsUserId: id.
|
187
|
+
return { microsoftTeamsUserId: id.replace(TEAMS_VISITOR_PREFIX, ''), isAnonymous: true };
|
187
188
|
}
|
188
189
|
return { id };
|
189
190
|
};
|
@@ -191,7 +192,7 @@ const fromFlatCommunicationIdentifier = (id) => {
|
|
191
192
|
// Copyright (c) Microsoft Corporation.
|
192
193
|
// Licensed under the MIT license.
|
193
194
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
194
|
-
var telemetryVersion = '1.3.2-alpha-
|
195
|
+
var telemetryVersion = '1.3.2-alpha-202207260015.0';
|
195
196
|
|
196
197
|
// Copyright (c) Microsoft Corporation.
|
197
198
|
/**
|
@@ -2711,7 +2712,9 @@ const defaultChatItemMessageContainer = (overlapAvatarAndMessage) => {
|
|
2711
2712
|
const defaultMyChatMessageContainer = {
|
2712
2713
|
maxWidth: '100%',
|
2713
2714
|
minWidth: `${CHAT_MESSAGE_CONTAINER_MIN_WIDTH_REM}rem`,
|
2714
|
-
marginLeft: '0rem'
|
2715
|
+
marginLeft: '0rem',
|
2716
|
+
// This makes message bubble show border in high contrast mode making each message distinguishable
|
2717
|
+
border: '1px solid transparent'
|
2715
2718
|
};
|
2716
2719
|
/**
|
2717
2720
|
* @private
|
@@ -2732,7 +2735,9 @@ const defaultChatMessageContainer = {
|
|
2732
2735
|
// Deal with awkward padding seen in messages from Teams.
|
2733
2736
|
// For more info see https://github.com/Azure/communication-ui-library/pull/1507
|
2734
2737
|
marginBlock: '0.125rem'
|
2735
|
-
}
|
2738
|
+
},
|
2739
|
+
// This makes message bubble show border in high contrast mode making each message distinguishable
|
2740
|
+
border: '1px solid transparent'
|
2736
2741
|
};
|
2737
2742
|
/**
|
2738
2743
|
* @private
|
@@ -6218,7 +6223,7 @@ const VideoGallery = (props) => {
|
|
6218
6223
|
/**
|
6219
6224
|
* @private
|
6220
6225
|
*/
|
6221
|
-
const controlBarStyles = {
|
6226
|
+
const controlBarStyles$1 = {
|
6222
6227
|
horizontal: {
|
6223
6228
|
flexFlow: 'row nowrap'
|
6224
6229
|
},
|
@@ -6649,8 +6654,8 @@ const ControlBar = (props) => {
|
|
6649
6654
|
const { styles, layout } = props;
|
6650
6655
|
const theme = useTheme();
|
6651
6656
|
const controlBarClassName = React.useMemo(() => {
|
6652
|
-
const controlBarStyle = controlBarStyles[layout !== null && layout !== void 0 ? layout : 'horizontal'];
|
6653
|
-
// if theme is dark and layout is floating then use palette.neutralQuaternaryAlt as background, otherwise use palette.white
|
6657
|
+
const controlBarStyle = controlBarStyles$1[layout !== null && layout !== void 0 ? layout : 'horizontal'];
|
6658
|
+
// if theme is dark and layout is floating then use palette.neutralQuaternaryAlt as background, otherwise use theme.palette.white
|
6654
6659
|
const backgroundStyle = {
|
6655
6660
|
background: isDarkThemed(theme) && (layout === null || layout === void 0 ? void 0 : layout.startsWith('floating')) ? theme.palette.neutralQuaternaryAlt : theme.palette.white
|
6656
6661
|
};
|
@@ -9258,7 +9263,7 @@ const MAX_CALL_HISTORY_LENGTH = 10;
|
|
9258
9263
|
*/
|
9259
9264
|
class CallContext$1 {
|
9260
9265
|
constructor(userId, maxListeners = 50,
|
9261
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
9266
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId) {
|
9262
9267
|
this._callIdHistory = new CallIdHistory();
|
9263
9268
|
this._logger = logger.createClientLogger('communication-react:calling-context');
|
9264
9269
|
this._state = {
|
@@ -9275,7 +9280,7 @@ class CallContext$1 {
|
|
9275
9280
|
},
|
9276
9281
|
callAgent: undefined,
|
9277
9282
|
userId: userId,
|
9278
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
9283
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId: alternateCallerId,
|
9279
9284
|
latestErrors: {}
|
9280
9285
|
};
|
9281
9286
|
this._emitter = new EventEmitter__default['default']();
|
@@ -11306,7 +11311,7 @@ class ProxyCallClient {
|
|
11306
11311
|
const createStatefulCallClient = (args, options) => {
|
11307
11312
|
callingStatefulLogger.info(`Creating calling stateful client using library version: ${_getApplicationId()}`);
|
11308
11313
|
return createStatefulCallClientWithDeps(new communicationCalling.CallClient(withTelemetryTag(options === null || options === void 0 ? void 0 : options.callClientOptions)), new CallContext$1(communicationCommon.getIdentifierKind(args.userId), options === null || options === void 0 ? void 0 : options.maxStateChangeListeners,
|
11309
|
-
/* @conditional-compile-remove(PSTN-calls) */ args.
|
11314
|
+
/* @conditional-compile-remove(PSTN-calls) */ args.alternateCallerId), new InternalCallContext());
|
11310
11315
|
};
|
11311
11316
|
/**
|
11312
11317
|
* Package-internal version of createStatefulCallClient that allows dependency injection.
|
@@ -13369,7 +13374,8 @@ const BaseProvider = (props) => {
|
|
13369
13374
|
// which stop polluting global dom tree and increase compatibility with react-full-screen
|
13370
13375
|
const CompositeElement = (React__default['default'].createElement(FluentThemeProvider, { fluentTheme: fluentTheme, rtl: rtl },
|
13371
13376
|
React__default['default'].createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" }),
|
13372
|
-
React__default['default'].createElement(react.Customizer, { scopedSettings: { Layer: { hostId: globalLayerHostId } } },
|
13377
|
+
React__default['default'].createElement(react.Customizer, { scopedSettings: { Layer: { hostId: globalLayerHostId } } },
|
13378
|
+
React__default['default'].createElement(WithBackgroundColor, null, props.children)),
|
13373
13379
|
React__default['default'].createElement(react.LayerHost, { id: globalLayerHostId, className: react.mergeStyles(globalLayerHostStyle) })));
|
13374
13380
|
const localizedElement = locale ? LocalizationProvider({ locale, children: CompositeElement }) : CompositeElement;
|
13375
13381
|
return React__default['default'].createElement(BaseContext.Provider, { value: true }, localizedElement);
|
@@ -13382,6 +13388,23 @@ const BaseContext = React.createContext(false);
|
|
13382
13388
|
* @private
|
13383
13389
|
*/
|
13384
13390
|
const useBase = () => React.useContext(BaseContext);
|
13391
|
+
/**
|
13392
|
+
* @private
|
13393
|
+
* Provides a wrapper with a background color to ensure that composites always have a background color.
|
13394
|
+
* This is necessary to ensure that composites are not transparent,
|
13395
|
+
* and the background color of it's parent elements doesn't show through the composite.
|
13396
|
+
*/
|
13397
|
+
const WithBackgroundColor = (props) => {
|
13398
|
+
const { children } = props;
|
13399
|
+
const theme = react.useTheme();
|
13400
|
+
const className = react.mergeStyles({
|
13401
|
+
background: theme.semanticColors.bodyBackground,
|
13402
|
+
height: '100%',
|
13403
|
+
width: '100%',
|
13404
|
+
position: 'relative'
|
13405
|
+
});
|
13406
|
+
return React__default['default'].createElement(react.Stack, { className: className }, children);
|
13407
|
+
};
|
13385
13408
|
|
13386
13409
|
// Copyright (c) Microsoft Corporation.
|
13387
13410
|
const ChatAdapterContext = React.createContext(undefined);
|
@@ -14586,11 +14609,14 @@ const isDisabled = (option) => {
|
|
14586
14609
|
};
|
14587
14610
|
|
14588
14611
|
// Copyright (c) Microsoft Corporation.
|
14612
|
+
// Enforce a background color on control bar to ensure it matches the composite background color.
|
14613
|
+
const controlBarStyles = react.memoizeFunction((background) => ({ root: { background: background } }));
|
14589
14614
|
/**
|
14590
14615
|
* @private
|
14591
14616
|
*/
|
14592
14617
|
const CallControls = (props) => {
|
14593
14618
|
const options = React.useMemo(() => (typeof props.options === 'boolean' ? {} : props.options), [props.options]);
|
14619
|
+
const theme = react.useTheme();
|
14594
14620
|
/* @conditional-compile-remove(control-bar-button-injection) */
|
14595
14621
|
const customButtons = React.useMemo(() => generateCustomControlBarButtons(onFetchCustomButtonPropsTrampoline$1(options), options === null || options === void 0 ? void 0 : options.displayType), [options]);
|
14596
14622
|
// when props.options is false then we want to hide the whole control bar.
|
@@ -14599,7 +14625,7 @@ const CallControls = (props) => {
|
|
14599
14625
|
}
|
14600
14626
|
return (React__default['default'].createElement(react.Stack, { horizontalAlign: "center" },
|
14601
14627
|
React__default['default'].createElement(react.Stack.Item, null,
|
14602
|
-
React__default['default'].createElement(ControlBar, { layout: "horizontal" },
|
14628
|
+
React__default['default'].createElement(ControlBar, { layout: "horizontal", styles: controlBarStyles(theme.semanticColors.bodyBackground) },
|
14603
14629
|
isEnabled$2(options === null || options === void 0 ? void 0 : options.microphoneButton) && React__default['default'].createElement(Microphone, { displayType: options === null || options === void 0 ? void 0 : options.displayType }),
|
14604
14630
|
isEnabled$2(options === null || options === void 0 ? void 0 : options.cameraButton) && React__default['default'].createElement(Camera, { displayType: options === null || options === void 0 ? void 0 : options.displayType }),
|
14605
14631
|
isEnabled$2(options === null || options === void 0 ? void 0 : options.screenShareButton) && (React__default['default'].createElement(ScreenShare, { option: options === null || options === void 0 ? void 0 : options.screenShareButton, displayType: options === null || options === void 0 ? void 0 : options.displayType })),
|
@@ -15848,7 +15874,8 @@ class CallContext {
|
|
15848
15874
|
call: undefined,
|
15849
15875
|
page: 'configuration',
|
15850
15876
|
latestErrors: clientState.latestErrors,
|
15851
|
-
isTeamsCall
|
15877
|
+
isTeamsCall,
|
15878
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId: clientState.alternateCallerId
|
15852
15879
|
};
|
15853
15880
|
}
|
15854
15881
|
onStateChange(handler) {
|
@@ -16026,7 +16053,7 @@ class AzureCommunicationCallAdapter {
|
|
16026
16053
|
/* @conditional-compile-remove(teams-adhoc-call) */
|
16027
16054
|
/* @conditional-compile-remove(PSTN-calls) */
|
16028
16055
|
if (isOutboundCall(this.locator)) {
|
16029
|
-
const phoneNumber = this.getState().
|
16056
|
+
const phoneNumber = this.getState().alternateCallerId;
|
16030
16057
|
return this.startCall(this.locator.participantIDs, {
|
16031
16058
|
alternateCallerId: phoneNumber ? { phoneNumber: phoneNumber } : undefined
|
16032
16059
|
});
|
@@ -16190,7 +16217,7 @@ class AzureCommunicationCallAdapter {
|
|
16190
16217
|
const backendId = fromFlatCommunicationIdentifier(participant);
|
16191
16218
|
if (communicationCommon.isPhoneNumberIdentifier(backendId)) {
|
16192
16219
|
if ((options === null || options === void 0 ? void 0 : options.alternateCallerId) === undefined) {
|
16193
|
-
throw new Error('unable to start call, PSTN user present with no
|
16220
|
+
throw new Error('unable to start call, PSTN user present with no alternateCallerId.');
|
16194
16221
|
}
|
16195
16222
|
return backendId;
|
16196
16223
|
}
|
@@ -16345,10 +16372,10 @@ class AzureCommunicationCallAdapter {
|
|
16345
16372
|
* @public
|
16346
16373
|
*/
|
16347
16374
|
const createAzureCommunicationCallAdapter = ({ userId, displayName, credential, locator,
|
16348
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
16375
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId }) => __awaiter$5(void 0, void 0, void 0, function* () {
|
16349
16376
|
const callClient = createStatefulCallClient({
|
16350
16377
|
userId,
|
16351
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
16378
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId
|
16352
16379
|
});
|
16353
16380
|
const callAgent = yield callClient.createCallAgent(credential, {
|
16354
16381
|
displayName
|
@@ -16390,7 +16417,7 @@ afterCreate,
|
|
16390
16417
|
* This is useful for clean up tasks, e.g., leaving any ongoing calls.
|
16391
16418
|
*/
|
16392
16419
|
beforeDispose) => {
|
16393
|
-
const { credential, displayName, locator, userId } = args;
|
16420
|
+
const { credential, displayName, locator, userId, /*@conditional-compile-remove(PSTN-calls) */ alternateCallerId } = args;
|
16394
16421
|
// State update needed to rerender the parent component when a new adapter is created.
|
16395
16422
|
const [adapter, setAdapter] = React.useState(undefined);
|
16396
16423
|
// Ref needed for cleanup to access the old adapter created asynchronously.
|
@@ -16424,7 +16451,8 @@ beforeDispose) => {
|
|
16424
16451
|
credential,
|
16425
16452
|
displayName,
|
16426
16453
|
locator,
|
16427
|
-
userId
|
16454
|
+
userId,
|
16455
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId
|
16428
16456
|
});
|
16429
16457
|
if (afterCreateRef.current) {
|
16430
16458
|
newAdapter = yield afterCreateRef.current(newAdapter);
|
@@ -16434,7 +16462,16 @@ beforeDispose) => {
|
|
16434
16462
|
}))();
|
16435
16463
|
},
|
16436
16464
|
// Explicitly list all arguments so that caller doesn't have to memoize the `args` object.
|
16437
|
-
[
|
16465
|
+
[
|
16466
|
+
adapterRef,
|
16467
|
+
afterCreateRef,
|
16468
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
|
16469
|
+
beforeDisposeRef,
|
16470
|
+
credential,
|
16471
|
+
displayName,
|
16472
|
+
locator,
|
16473
|
+
userId
|
16474
|
+
]);
|
16438
16475
|
// Dispose any existing adapter when the component unmounts.
|
16439
16476
|
React.useEffect(() => {
|
16440
16477
|
return () => {
|
@@ -16734,7 +16771,15 @@ const CallWithChatControlBar = (props) => {
|
|
16734
16771
|
label: callWithChatStrings.moreDrawerButtonLabel,
|
16735
16772
|
tooltipContent: callWithChatStrings.moreDrawerButtonTooltip
|
16736
16773
|
}), [callWithChatStrings]);
|
16737
|
-
const centerContainerStyles = React.useMemo(() =>
|
16774
|
+
const centerContainerStyles = React.useMemo(() => {
|
16775
|
+
const styles = !props.mobileView ? desktopControlBarStyles : {};
|
16776
|
+
return react.mergeStyleSets(styles, {
|
16777
|
+
root: {
|
16778
|
+
// Enforce a background color on control bar to ensure it matches the composite background color.
|
16779
|
+
background: theme.semanticColors.bodyBackground
|
16780
|
+
}
|
16781
|
+
});
|
16782
|
+
}, [props.mobileView, theme.semanticColors.bodyBackground]);
|
16738
16783
|
const screenShareButtonStyles = React.useMemo(() => (!props.mobileView ? getDesktopScreenShareButtonStyles(theme) : undefined), [props.mobileView, theme]);
|
16739
16784
|
const commonButtonStyles = React.useMemo(() => (!props.mobileView ? getDesktopCommonButtonStyles(theme) : undefined), [props.mobileView, theme]);
|
16740
16785
|
const endCallButtonStyles = React.useMemo(() => (!props.mobileView ? getDesktopEndCallButtonStyles(theme) : undefined), [props.mobileView, theme]);
|
@@ -17146,7 +17191,7 @@ const inferCallWithChatControlOptions = (callWithChatControls) => {
|
|
17146
17191
|
const MoreDrawer = (props) => {
|
17147
17192
|
var _a, _b, _c, _d, _e;
|
17148
17193
|
const drawerMenuItems = [];
|
17149
|
-
const { speakers, onSelectSpeaker } = props;
|
17194
|
+
const { speakers, onSelectSpeaker, onLightDismiss } = props;
|
17150
17195
|
const onSpeakerItemClick = React.useCallback((_ev, itemKey) => {
|
17151
17196
|
const selected = speakers === null || speakers === void 0 ? void 0 : speakers.find((speaker) => speaker.id === itemKey);
|
17152
17197
|
if (selected) {
|
@@ -17154,7 +17199,8 @@ const MoreDrawer = (props) => {
|
|
17154
17199
|
// But this is a known issue in our state.
|
17155
17200
|
onSelectSpeaker(selected);
|
17156
17201
|
}
|
17157
|
-
|
17202
|
+
onLightDismiss();
|
17203
|
+
}, [speakers, onSelectSpeaker, onLightDismiss]);
|
17158
17204
|
const drawerSelectionOptions = inferCallWithChatControlOptions(props.callControls);
|
17159
17205
|
if (props.speakers && props.speakers.length > 0) {
|
17160
17206
|
drawerMenuItems.push({
|
@@ -17183,7 +17229,8 @@ const MoreDrawer = (props) => {
|
|
17183
17229
|
// But this is a known issue in our state.
|
17184
17230
|
onSelectMicrophone(selected);
|
17185
17231
|
}
|
17186
|
-
|
17232
|
+
onLightDismiss();
|
17233
|
+
}, [microphones, onSelectMicrophone, onLightDismiss]);
|
17187
17234
|
if (props.microphones && props.microphones.length > 0) {
|
17188
17235
|
// Set props as Microphone if speakers can be enumerated else set as Audio Device
|
17189
17236
|
const speakersAvailable = props.speakers && props.speakers.length > 0;
|
@@ -18504,13 +18551,15 @@ class AzureCommunicationCallWithChatAdapter {
|
|
18504
18551
|
*
|
18505
18552
|
* @public
|
18506
18553
|
*/
|
18507
|
-
const createAzureCommunicationCallWithChatAdapter = ({ userId, displayName, credential, endpoint, locator
|
18554
|
+
const createAzureCommunicationCallWithChatAdapter = ({ userId, displayName, credential, endpoint, locator,
|
18555
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId }) => __awaiter(void 0, void 0, void 0, function* () {
|
18508
18556
|
const callAdapterLocator = isTeamsMeetingLinkLocator(locator) ? locator : locator.callLocator;
|
18509
18557
|
const createCallAdapterPromise = createAzureCommunicationCallAdapter({
|
18510
18558
|
userId,
|
18511
18559
|
displayName,
|
18512
18560
|
credential,
|
18513
|
-
locator: callAdapterLocator
|
18561
|
+
locator: callAdapterLocator,
|
18562
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId
|
18514
18563
|
});
|
18515
18564
|
const threadId = isTeamsMeetingLinkLocator(locator)
|
18516
18565
|
? getChatThreadFromTeamsLink(locator.meetingLink)
|
@@ -18559,7 +18608,8 @@ afterCreate,
|
|
18559
18608
|
* This is useful for clean up tasks, e.g., leaving any ongoing calls.
|
18560
18609
|
*/
|
18561
18610
|
beforeDispose) => {
|
18562
|
-
const { credential, displayName, endpoint, locator, userId
|
18611
|
+
const { credential, displayName, endpoint, locator, userId,
|
18612
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId } = args;
|
18563
18613
|
// State update needed to rerender the parent component when a new adapter is created.
|
18564
18614
|
const [adapter, setAdapter] = React.useState(undefined);
|
18565
18615
|
// Ref needed for cleanup to access the old adapter created asynchronously.
|
@@ -18594,7 +18644,8 @@ beforeDispose) => {
|
|
18594
18644
|
displayName,
|
18595
18645
|
endpoint,
|
18596
18646
|
locator,
|
18597
|
-
userId
|
18647
|
+
userId,
|
18648
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId
|
18598
18649
|
});
|
18599
18650
|
if (afterCreateRef.current) {
|
18600
18651
|
newAdapter = yield afterCreateRef.current(newAdapter);
|
@@ -18604,7 +18655,17 @@ beforeDispose) => {
|
|
18604
18655
|
}))();
|
18605
18656
|
},
|
18606
18657
|
// Explicitly list all arguments so that caller doesn't have to memoize the `args` object.
|
18607
|
-
[
|
18658
|
+
[
|
18659
|
+
adapterRef,
|
18660
|
+
afterCreateRef,
|
18661
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
|
18662
|
+
beforeDisposeRef,
|
18663
|
+
credential,
|
18664
|
+
displayName,
|
18665
|
+
endpoint,
|
18666
|
+
locator,
|
18667
|
+
userId
|
18668
|
+
]);
|
18608
18669
|
// Dispose any existing adapter when the component unmounts.
|
18609
18670
|
React.useEffect(() => {
|
18610
18671
|
return () => {
|