@azure/communication-react 1.11.0-alpha-202312050013 → 1.11.0-alpha-202312060012
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/dist-cjs/communication-react/index.js +124 -21
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ParticipantItem.styles.js +1 -2
- package/dist/dist-esm/react-components/src/components/styles/ParticipantItem.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/themes.js +4 -2
- package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.d.ts +12 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.js +85 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +5 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.d.ts +6 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +33 -14
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
- package/package.json +1 -1
@@ -176,7 +176,7 @@ const _isValidIdentifier = (identifier) => {
|
|
176
176
|
// Copyright (c) Microsoft Corporation.
|
177
177
|
// Licensed under the MIT License.
|
178
178
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
179
|
-
var telemetryVersion = '1.11.0-alpha-
|
179
|
+
var telemetryVersion = '1.11.0-alpha-202312060012';
|
180
180
|
|
181
181
|
// Copyright (c) Microsoft Corporation.
|
182
182
|
/**
|
@@ -5866,7 +5866,8 @@ const lightTheme = {
|
|
5866
5866
|
neutralPrimary: '#323130',
|
5867
5867
|
neutralDark: '#201f1e',
|
5868
5868
|
black: '#000000',
|
5869
|
-
white: '#ffffff'
|
5869
|
+
white: '#ffffff',
|
5870
|
+
whiteTranslucent40: 'rgba(255, 255, 255, 0.4)'
|
5870
5871
|
},
|
5871
5872
|
callingPalette: {
|
5872
5873
|
callRed: '#a42e43',
|
@@ -5916,7 +5917,8 @@ const darkTheme = {
|
|
5916
5917
|
neutralPrimary: '#ffffff',
|
5917
5918
|
neutralDark: '#f4f4f4',
|
5918
5919
|
black: '#f8f8f8',
|
5919
|
-
white: '#252423'
|
5920
|
+
white: '#252423',
|
5921
|
+
whiteTranslucent40: 'rgba(0, 0, 0, 0.4)'
|
5920
5922
|
},
|
5921
5923
|
callingPalette: {
|
5922
5924
|
callRed: '#c4314b',
|
@@ -11587,8 +11589,7 @@ const participantStateStringStyles$1 = {
|
|
11587
11589
|
textOverflow: 'ellipsis',
|
11588
11590
|
whiteSpace: 'nowrap',
|
11589
11591
|
lineHeight: 'normal',
|
11590
|
-
|
11591
|
-
marginLeft: 'auto',
|
11592
|
+
marginLeft: '0.5rem',
|
11592
11593
|
marginRight: 0
|
11593
11594
|
};
|
11594
11595
|
/**
|
@@ -28328,7 +28329,6 @@ const CONFIGURATION_PAGE_SECTION_MAX_WIDTH_REM = 20.625;
|
|
28328
28329
|
/** @private */
|
28329
28330
|
const CONFIGURATION_PAGE_SECTION_HEIGHT_REM = 13.625;
|
28330
28331
|
const LOGO_HEIGHT_REM = 3;
|
28331
|
-
const LOGO_MARGIN_BOTTOM_REM = 1;
|
28332
28332
|
/**
|
28333
28333
|
* @private
|
28334
28334
|
*/
|
@@ -28339,6 +28339,12 @@ const configurationStackTokensDesktop = {
|
|
28339
28339
|
* @private
|
28340
28340
|
*/
|
28341
28341
|
const configurationStackTokensMobile = {
|
28342
|
+
childrenGap: '0.5rem'
|
28343
|
+
};
|
28344
|
+
/**
|
28345
|
+
* @private
|
28346
|
+
*/
|
28347
|
+
const deviceConfigurationStackTokens = {
|
28342
28348
|
childrenGap: '1.5rem'
|
28343
28349
|
};
|
28344
28350
|
/** @private */
|
@@ -28346,7 +28352,7 @@ const configurationContainerStyle = (desktop, backgroundImageUrl) => ({
|
|
28346
28352
|
root: {
|
28347
28353
|
height: '100%',
|
28348
28354
|
width: '100%',
|
28349
|
-
padding: '2rem 1rem 2rem 1rem',
|
28355
|
+
padding: desktop ? '2rem 1rem 2rem 1rem' : '1rem 1rem 2rem 1rem',
|
28350
28356
|
minWidth: desktop
|
28351
28357
|
? '25rem' // sum of min-width from children + ChildrenGap * (nb of children - 1) + padding * 2 = (11 + 11) + (2 * 1) + 0.5 * 2
|
28352
28358
|
: '16rem',
|
@@ -28399,20 +28405,36 @@ const selectionContainerStyle = (theme) => react.mergeStyles({
|
|
28399
28405
|
/**
|
28400
28406
|
* @private
|
28401
28407
|
*/
|
28402
|
-
const titleContainerStyleDesktop = react.mergeStyles({
|
28403
|
-
fontSize: '1.
|
28404
|
-
lineHeight: '
|
28408
|
+
const titleContainerStyleDesktop = (theme) => react.mergeStyles({
|
28409
|
+
fontSize: '1.2rem',
|
28410
|
+
lineHeight: '1rem',
|
28405
28411
|
fontWeight: 600
|
28406
|
-
});
|
28412
|
+
}, configurationPageTextDecoration(theme));
|
28407
28413
|
/**
|
28408
28414
|
* @private
|
28409
28415
|
*/
|
28410
|
-
const titleContainerStyleMobile = react.mergeStyles({
|
28416
|
+
const titleContainerStyleMobile = (theme) => react.mergeStyles({
|
28411
28417
|
fontSize: '1.0625rem',
|
28412
28418
|
lineHeight: '1.375rem',
|
28413
28419
|
fontWeight: 600,
|
28414
28420
|
textAlign: 'center'
|
28415
|
-
});
|
28421
|
+
}, configurationPageTextDecoration(theme));
|
28422
|
+
/**
|
28423
|
+
* Ensure configuration page text is legible on top of a background image.
|
28424
|
+
* @private
|
28425
|
+
*/
|
28426
|
+
const configurationPageTextDecoration = (theme) => {
|
28427
|
+
return {
|
28428
|
+
textShadow: `0px 0px 8px ${theme.palette.whiteTranslucent40}`,
|
28429
|
+
fill: theme.semanticColors.bodyText,
|
28430
|
+
stroke: theme.palette.whiteTranslucent40,
|
28431
|
+
paintOrder: 'stroke fill',
|
28432
|
+
strokeWidth: _pxToRem(1.5),
|
28433
|
+
text: {
|
28434
|
+
letterSpacing: '-0.02rem' // cope with extra width due to stroke width
|
28435
|
+
}
|
28436
|
+
};
|
28437
|
+
};
|
28416
28438
|
/**
|
28417
28439
|
* @private
|
28418
28440
|
*/
|
@@ -28425,8 +28447,7 @@ const callDetailsContainerStyles = {
|
|
28425
28447
|
};
|
28426
28448
|
const callDetailsStyle = {
|
28427
28449
|
fontSize: '0.9375',
|
28428
|
-
lineHeight: '1.25rem'
|
28429
|
-
marginTop: '0.25rem'
|
28450
|
+
lineHeight: '1.25rem'
|
28430
28451
|
};
|
28431
28452
|
/**
|
28432
28453
|
* @private
|
@@ -28435,7 +28456,7 @@ const callDetailsStyleDesktop = react.mergeStyles(Object.assign({}, callDetailsS
|
|
28435
28456
|
/**
|
28436
28457
|
* @private
|
28437
28458
|
*/
|
28438
|
-
const callDetailsStyleMobile = react.mergeStyles(Object.assign(Object.assign({}, callDetailsStyle), { textAlign: 'center' }));
|
28459
|
+
const callDetailsStyleMobile = react.mergeStyles(Object.assign(Object.assign({}, callDetailsStyle), { marginBottom: '0.5rem', textAlign: 'center' }));
|
28439
28460
|
/**
|
28440
28461
|
* @private
|
28441
28462
|
*/
|
@@ -28521,7 +28542,7 @@ const configurationCenteredContent = (fillsHeight, hasLogo) => react.mergeStyles
|
|
28521
28542
|
// in and not shift the content. To exclude the logo, we subtract the logo height
|
28522
28543
|
// and margin from the actual height. This allows the flex box's natural centering
|
28523
28544
|
// to appropriately center the content.
|
28524
|
-
height: `calc(100% - ${!fillsHeight && hasLogo ? `${LOGO_HEIGHT_REM
|
28545
|
+
height: `calc(100% - ${!fillsHeight && hasLogo ? `${LOGO_HEIGHT_REM}rem` : '0rem'})`
|
28525
28546
|
});
|
28526
28547
|
/** @private */
|
28527
28548
|
const panelStyles = {
|
@@ -28551,8 +28572,7 @@ const logoStyles = (shape) => ({
|
|
28551
28572
|
root: {
|
28552
28573
|
overflow: 'initial',
|
28553
28574
|
display: 'flex',
|
28554
|
-
justifyContent: 'center'
|
28555
|
-
marginBottom: `${LOGO_MARGIN_BOTTOM_REM}rem`
|
28575
|
+
justifyContent: 'center'
|
28556
28576
|
},
|
28557
28577
|
image: {
|
28558
28578
|
borderRadius: shape === 'circle' ? '100%' : undefined,
|
@@ -29097,6 +29117,88 @@ const CallReadinessModalFallBack = (props) => {
|
|
29097
29117
|
}
|
29098
29118
|
};
|
29099
29119
|
|
29120
|
+
// Copyright (c) Microsoft Corporation.
|
29121
|
+
/**
|
29122
|
+
* An SVG element component that wraps inner text to fit the width of the SVG.
|
29123
|
+
* @private
|
29124
|
+
*/
|
29125
|
+
const SvgWithWordWrapping = (props) => {
|
29126
|
+
const { width, text, lineHeightPx, bufferHeightPx } = props;
|
29127
|
+
const svgRef = React.useRef(null);
|
29128
|
+
const calculationTextElement = React.useRef(null);
|
29129
|
+
const visibleTextElement = React.useRef(null);
|
29130
|
+
const [height, setHeight] = React.useState(0);
|
29131
|
+
// useLayoutEffect ensures that the calculationTextElement is rendered before being used for calculations.
|
29132
|
+
// Using useLayoutEffect over useEffect ensures we do not get a layout shift when the visibleTextElement is rendered
|
29133
|
+
// and the height is updated. This is because useLayoutEffect runs synchronously after DOM mutations but
|
29134
|
+
// before the browser has a chance to paint. See https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
29135
|
+
// for more details.
|
29136
|
+
React.useLayoutEffect(() => {
|
29137
|
+
if (text && calculationTextElement.current && visibleTextElement.current) {
|
29138
|
+
const numLines = convertTextToWrappedText(calculationTextElement.current, visibleTextElement.current, width, lineHeightPx);
|
29139
|
+
setHeight(numLines * lineHeightPx);
|
29140
|
+
}
|
29141
|
+
}, [width, lineHeightPx, text]);
|
29142
|
+
return (React__default["default"].createElement("svg", { width: width, height: height + bufferHeightPx, ref: svgRef, xmlns: "http://www.w3.org/2000/svg" },
|
29143
|
+
React__default["default"].createElement("text", { height: 0, ref: calculationTextElement, style: { visibility: 'hidden' } }, text),
|
29144
|
+
React__default["default"].createElement("text", { ref: visibleTextElement, x: "0", y: bufferHeightPx / 4, role: "heading", "aria-level": 1 })));
|
29145
|
+
};
|
29146
|
+
/**
|
29147
|
+
* Wrap text in tspan elements to fit the width of the SVG
|
29148
|
+
* @param baseTextElement The text element to create the wrapped text from.
|
29149
|
+
* @param outputTextElement The text element to insert the wrapped text into.
|
29150
|
+
* @param maxWidth The maximum width of the text element.
|
29151
|
+
* @param lineHeightPx The height of each line in pixels.
|
29152
|
+
* @returns The number of lines of text.
|
29153
|
+
*/
|
29154
|
+
const convertTextToWrappedText = (inputTextElement, outputTextElement, maxWidth, lineHeightPx) => {
|
29155
|
+
var _a, _b;
|
29156
|
+
const words = (_b = (_a = inputTextElement.textContent) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
|
29157
|
+
if (words.length === 0 || words[0] === '') {
|
29158
|
+
throw new Error('Text element must contain text');
|
29159
|
+
}
|
29160
|
+
// The current line being built.
|
29161
|
+
let line = '';
|
29162
|
+
// Running total of the number of lines.
|
29163
|
+
let numLines = 0;
|
29164
|
+
// First, clear the output text element.
|
29165
|
+
outputTextElement.textContent = '';
|
29166
|
+
// Iterate through each word and create a tspan element for each line.
|
29167
|
+
for (let i = 0; i < words.length; i++) {
|
29168
|
+
const testLine = line + words[i] + ' ';
|
29169
|
+
const testWidth = inputTextElement.getSubStringLength(0, testLine.length);
|
29170
|
+
if (testWidth > maxWidth && i > 0) {
|
29171
|
+
const newLine = constructTSpanLine(line, lineHeightPx);
|
29172
|
+
outputTextElement.appendChild(newLine);
|
29173
|
+
line = words[i] + ' ';
|
29174
|
+
numLines++;
|
29175
|
+
}
|
29176
|
+
else {
|
29177
|
+
line = testLine;
|
29178
|
+
}
|
29179
|
+
}
|
29180
|
+
// Add the last line.
|
29181
|
+
const newLine = constructTSpanLine(line, lineHeightPx);
|
29182
|
+
outputTextElement.appendChild(newLine);
|
29183
|
+
numLines++;
|
29184
|
+
// Return the number of lines to calculate the height of the SVG.
|
29185
|
+
return numLines;
|
29186
|
+
};
|
29187
|
+
/**
|
29188
|
+
* Create a tspan element for a line of text, with text set to be centered.
|
29189
|
+
* @param line The line of text.
|
29190
|
+
* @param lineHeightPx The height of each line in pixels.
|
29191
|
+
* @returns The tspan element.
|
29192
|
+
*/
|
29193
|
+
const constructTSpanLine = (line, lineHeightPx) => {
|
29194
|
+
const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');
|
29195
|
+
tspan.textContent = line;
|
29196
|
+
tspan.setAttribute('x', '50%');
|
29197
|
+
tspan.setAttribute('dy', _pxToRem(lineHeightPx));
|
29198
|
+
tspan.setAttribute('text-anchor', 'middle');
|
29199
|
+
return tspan;
|
29200
|
+
};
|
29201
|
+
|
29100
29202
|
// Copyright (c) Microsoft Corporation.
|
29101
29203
|
// Licensed under the MIT License.
|
29102
29204
|
var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
@@ -29166,7 +29268,8 @@ const ConfigurationPage = (props) => {
|
|
29166
29268
|
}
|
29167
29269
|
}
|
29168
29270
|
const locale = useLocale();
|
29169
|
-
const title = (React__default["default"].createElement(react.Stack.Item, { className: mobileView ? titleContainerStyleMobile : titleContainerStyleDesktop
|
29271
|
+
const title = locale.strings.call.configurationPageTitle.length > 0 ? (React__default["default"].createElement(react.Stack.Item, { className: mobileView ? titleContainerStyleMobile(theme) : titleContainerStyleDesktop(theme) },
|
29272
|
+
React__default["default"].createElement(SvgWithWordWrapping, { width: mobileView ? 325 : 445, lineHeightPx: 16 * 1.5, bufferHeightPx: 16, text: locale.strings.call.configurationPageTitle }))) : (React__default["default"].createElement(React__default["default"].Fragment, null));
|
29170
29273
|
const callDescription = locale.strings.call.configurationPageCallDetails && (React__default["default"].createElement(react.Stack.Item, { className: mobileView ? callDetailsStyleMobile : callDetailsStyleDesktop }, locale.strings.call.configurationPageCallDetails));
|
29171
29274
|
let mobileWithPreview = mobileView;
|
29172
29275
|
/* @conditional-compile-remove(rooms) */
|
@@ -29265,7 +29368,7 @@ const ConfigurationPage = (props) => {
|
|
29265
29368
|
logo: props.logo }),
|
29266
29369
|
title,
|
29267
29370
|
callDescription),
|
29268
|
-
React__default["default"].createElement(react.Stack, { horizontal: !mobileWithPreview, horizontalAlign: mobileWithPreview ? 'stretch' : 'center', verticalFill: mobileWithPreview, tokens:
|
29371
|
+
React__default["default"].createElement(react.Stack, { horizontal: !mobileWithPreview, horizontalAlign: mobileWithPreview ? 'stretch' : 'center', verticalFill: mobileWithPreview, tokens: deviceConfigurationStackTokens },
|
29269
29372
|
localPreviewTrampoline(mobileWithPreview,
|
29270
29373
|
/* @conditional-compile-remove(rooms) */ !!(role === 'Consumer')),
|
29271
29374
|
React__default["default"].createElement(react.Stack, { styles: mobileView ? undefined : configurationSectionStyle },
|