@azure/communication-react 1.3.3-alpha-202209170015.0 → 1.3.3-alpha-202209210019.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/dist-cjs/communication-react/index.js +88 -52
- 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/ErrorBar.js +2 -99
- package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js +7 -2
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.d.ts +66 -0
- package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js +43 -0
- package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/index.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/index.js +1 -0
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.d.ts +14 -0
- package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.js +51 -0
- package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils.d.ts +51 -0
- package/dist/dist-esm/react-components/src/components/utils.js +130 -0
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.js +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/package.json +8 -8
@@ -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-
|
195
|
+
var telemetryVersion = '1.3.3-alpha-202209210019.0';
|
196
196
|
|
197
197
|
// Copyright (c) Microsoft Corporation.
|
198
198
|
/**
|
@@ -1332,46 +1332,19 @@ const formatInlineElements = (str, vars) => {
|
|
1332
1332
|
|
1333
1333
|
// Copyright (c) Microsoft Corporation.
|
1334
1334
|
/**
|
1335
|
-
*
|
1336
|
-
* All strings that can be shown are accepted as the {@link ErrorBarProps.strings} so that they can be localized.
|
1337
|
-
* Active errors are selected by {@link ErrorBarProps.activeErrorMessages}.
|
1338
|
-
*
|
1339
|
-
* This component internally tracks dismissed by the user.
|
1340
|
-
* * Errors that have an associated timestamp: The error is shown on the UI again if it occurs after being dismissed.
|
1341
|
-
* * Errors that do not have a timestamp: The error is dismissed until it disappears from the props.
|
1342
|
-
* If the error recurs, it is shown in the UI.
|
1343
|
-
*
|
1344
|
-
* Uses {@link @fluentui/react#MessageBar} UI element.
|
1335
|
+
* @private
|
1345
1336
|
*
|
1346
|
-
* @
|
1337
|
+
* @param fileName
|
1338
|
+
* @returns string
|
1339
|
+
*/
|
1340
|
+
const extension = (fileName) => fileName.split('.').pop() || '';
|
1341
|
+
/**
|
1342
|
+
* @private
|
1343
|
+
* @param dismissedErrors
|
1344
|
+
* @param toDismiss
|
1345
|
+
* @returns DismissedError[]
|
1346
|
+
* Always returns a new Array so that the state variable is updated, trigerring a render.
|
1347
1347
|
*/
|
1348
|
-
const ErrorBar = (props) => {
|
1349
|
-
var _a;
|
1350
|
-
const localeStrings = useLocale$1().strings.errorBar;
|
1351
|
-
const strings = (_a = props.strings) !== null && _a !== void 0 ? _a : localeStrings;
|
1352
|
-
const [dismissedErrors, setDismissedErrors] = React.useState([]);
|
1353
|
-
// dropDismissalsForInactiveErrors only returns a new object if `dismissedErrors` actually changes.
|
1354
|
-
// Without this behaviour, this `useEffect` block would cause a render loop.
|
1355
|
-
React.useEffect(() => setDismissedErrors(dropDismissalsForInactiveErrors(props.activeErrorMessages, dismissedErrors)), [props.activeErrorMessages, dismissedErrors]);
|
1356
|
-
const toShow = errorsToShow(props.activeErrorMessages, dismissedErrors);
|
1357
|
-
return (React__default['default'].createElement(react.Stack, { "data-ui-id": "error-bar-stack" }, toShow.map((error) => (React__default['default'].createElement(react.MessageBar, Object.assign({}, props, { styles: {
|
1358
|
-
innerText: {
|
1359
|
-
paddingTop: messageBarType(error.type) === 5 ? '0.15rem' : '0.1rem',
|
1360
|
-
lineHeight: 'none'
|
1361
|
-
},
|
1362
|
-
icon: {
|
1363
|
-
height: 0
|
1364
|
-
},
|
1365
|
-
content: {
|
1366
|
-
lineHeight: 'inherit'
|
1367
|
-
},
|
1368
|
-
dismissal: {
|
1369
|
-
height: 0,
|
1370
|
-
paddingTop: '0.8rem'
|
1371
|
-
}
|
1372
|
-
}, key: error.type, messageBarType: messageBarType(error.type), messageBarIconProps: messageBarIconProps(error.type), onDismiss: () => setDismissedErrors(dismissError(dismissedErrors, error)), dismissButtonAriaLabel: strings.dismissButtonAriaLabel, dismissIconProps: { iconName: 'ErrorBarClear' } }), strings[error.type])))));
|
1373
|
-
};
|
1374
|
-
// Always returns a new Array so that the state variable is updated, trigerring a render.
|
1375
1348
|
const dismissError = (dismissedErrors, toDismiss) => {
|
1376
1349
|
const now = new Date(Date.now());
|
1377
1350
|
for (const error of dismissedErrors) {
|
@@ -1392,7 +1365,13 @@ const dismissError = (dismissedErrors, toDismiss) => {
|
|
1392
1365
|
}
|
1393
1366
|
];
|
1394
1367
|
};
|
1395
|
-
|
1368
|
+
/**
|
1369
|
+
* @private
|
1370
|
+
* @param activeErrorMessages
|
1371
|
+
* @param dismissedErrors
|
1372
|
+
* @returns DismissedError[]
|
1373
|
+
* Returns a new Array if and only if contents change, to avoid re-rendering when nothing was dropped.
|
1374
|
+
*/
|
1396
1375
|
const dropDismissalsForInactiveErrors = (activeErrorMessages, dismissedErrors) => {
|
1397
1376
|
const active = new Map();
|
1398
1377
|
for (const message of activeErrorMessages) {
|
@@ -1410,6 +1389,12 @@ const dropDismissalsForInactiveErrors = (activeErrorMessages, dismissedErrors) =
|
|
1410
1389
|
}
|
1411
1390
|
return dismissedErrors;
|
1412
1391
|
};
|
1392
|
+
/**
|
1393
|
+
* @private
|
1394
|
+
* @param activeErrorMessages
|
1395
|
+
* @param dismissedErrors
|
1396
|
+
* @returns ActiveErrorMessage[]
|
1397
|
+
*/
|
1413
1398
|
const errorsToShow = (activeErrorMessages, dismissedErrors) => {
|
1414
1399
|
const dismissed = new Map();
|
1415
1400
|
for (const error of dismissedErrors) {
|
@@ -1429,6 +1414,11 @@ const errorsToShow = (activeErrorMessages, dismissedErrors) => {
|
|
1429
1414
|
return error.timestamp > dismissal.dismissedAt;
|
1430
1415
|
});
|
1431
1416
|
};
|
1417
|
+
/**
|
1418
|
+
* @private
|
1419
|
+
* @param errorType
|
1420
|
+
* @returns MessageBarType
|
1421
|
+
*/
|
1432
1422
|
const messageBarType = (errorType) => {
|
1433
1423
|
switch (errorType) {
|
1434
1424
|
case 'callNetworkQualityLow':
|
@@ -1450,10 +1440,18 @@ const messageBarType = (errorType) => {
|
|
1450
1440
|
return react.MessageBarType.error;
|
1451
1441
|
}
|
1452
1442
|
};
|
1443
|
+
/**
|
1444
|
+
* @private
|
1445
|
+
* @param errorType
|
1446
|
+
* @returns IIconProps | undefined
|
1447
|
+
*/
|
1453
1448
|
const messageBarIconProps = (errorType) => {
|
1454
1449
|
const iconName = customIconName[errorType];
|
1455
1450
|
return iconName ? { iconName } : undefined;
|
1456
1451
|
};
|
1452
|
+
/**
|
1453
|
+
* @private
|
1454
|
+
*/
|
1457
1455
|
const customIconName = {
|
1458
1456
|
callNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',
|
1459
1457
|
callNoSpeakerFound: 'ErrorBarCallNoSpeakerFound',
|
@@ -1470,6 +1468,48 @@ const customIconName = {
|
|
1470
1468
|
callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied'
|
1471
1469
|
};
|
1472
1470
|
|
1471
|
+
// Copyright (c) Microsoft Corporation.
|
1472
|
+
/**
|
1473
|
+
* A component to show error messages on the UI.
|
1474
|
+
* All strings that can be shown are accepted as the {@link ErrorBarProps.strings} so that they can be localized.
|
1475
|
+
* Active errors are selected by {@link ErrorBarProps.activeErrorMessages}.
|
1476
|
+
*
|
1477
|
+
* This component internally tracks dismissed by the user.
|
1478
|
+
* * Errors that have an associated timestamp: The error is shown on the UI again if it occurs after being dismissed.
|
1479
|
+
* * Errors that do not have a timestamp: The error is dismissed until it disappears from the props.
|
1480
|
+
* If the error recurs, it is shown in the UI.
|
1481
|
+
*
|
1482
|
+
* Uses {@link @fluentui/react#MessageBar} UI element.
|
1483
|
+
*
|
1484
|
+
* @public
|
1485
|
+
*/
|
1486
|
+
const ErrorBar = (props) => {
|
1487
|
+
var _a;
|
1488
|
+
const localeStrings = useLocale$1().strings.errorBar;
|
1489
|
+
const strings = (_a = props.strings) !== null && _a !== void 0 ? _a : localeStrings;
|
1490
|
+
const [dismissedErrors, setDismissedErrors] = React.useState([]);
|
1491
|
+
// dropDismissalsForInactiveErrors only returns a new object if `dismissedErrors` actually changes.
|
1492
|
+
// Without this behaviour, this `useEffect` block would cause a render loop.
|
1493
|
+
React.useEffect(() => setDismissedErrors(dropDismissalsForInactiveErrors(props.activeErrorMessages, dismissedErrors)), [props.activeErrorMessages, dismissedErrors]);
|
1494
|
+
const toShow = errorsToShow(props.activeErrorMessages, dismissedErrors);
|
1495
|
+
return (React__default['default'].createElement(react.Stack, { "data-ui-id": "error-bar-stack" }, toShow.map((error) => (React__default['default'].createElement(react.MessageBar, Object.assign({}, props, { styles: {
|
1496
|
+
innerText: {
|
1497
|
+
paddingTop: messageBarType(error.type) === 5 ? '0.15rem' : '0.1rem',
|
1498
|
+
lineHeight: 'none'
|
1499
|
+
},
|
1500
|
+
icon: {
|
1501
|
+
height: 0
|
1502
|
+
},
|
1503
|
+
content: {
|
1504
|
+
lineHeight: 'inherit'
|
1505
|
+
},
|
1506
|
+
dismissal: {
|
1507
|
+
height: 0,
|
1508
|
+
paddingTop: '0.8rem'
|
1509
|
+
}
|
1510
|
+
}, key: error.type, messageBarType: messageBarType(error.type), messageBarIconProps: messageBarIconProps(error.type), onDismiss: () => setDismissedErrors(dismissError(dismissedErrors, error)), dismissButtonAriaLabel: strings.dismissButtonAriaLabel, dismissIconProps: { iconName: 'ErrorBarClear' } }), strings[error.type])))));
|
1511
|
+
};
|
1512
|
+
|
1473
1513
|
// Copyright (c) Microsoft Corporation.
|
1474
1514
|
/**
|
1475
1515
|
* @private
|
@@ -1972,7 +2012,7 @@ const DEFAULT_COMPONENT_ICONS = {
|
|
1972
2012
|
OptionsMic: React__default['default'].createElement(reactIcons.MicOn20Regular, null),
|
1973
2013
|
OptionsSpeaker: React__default['default'].createElement(reactIcons.Speaker220Regular, null),
|
1974
2014
|
ParticipantItemMicOff: React__default['default'].createElement(reactIcons.MicOff16Regular, null),
|
1975
|
-
ParticipantItemOptions: React__default['default'].createElement(
|
2015
|
+
ParticipantItemOptions: React__default['default'].createElement(React__default['default'].Fragment, null),
|
1976
2016
|
ParticipantItemOptionsHovered: React__default['default'].createElement(reactIcons.MoreHorizontal20Filled, null),
|
1977
2017
|
ParticipantItemScreenShareStart: React__default['default'].createElement(reactIcons.ShareScreenStart20Filled, null),
|
1978
2018
|
/* @conditional-compile-remove(PSTN-calls) */
|
@@ -2440,15 +2480,6 @@ const _FileCardGroup = (props) => {
|
|
2440
2480
|
return (React__default['default'].createElement(react.Stack, { horizontal: true, className: fileCardGroupClassName }, children));
|
2441
2481
|
};
|
2442
2482
|
|
2443
|
-
// Copyright (c) Microsoft Corporation.
|
2444
|
-
/**
|
2445
|
-
* @private
|
2446
|
-
*
|
2447
|
-
* @param fileName
|
2448
|
-
* @returns string
|
2449
|
-
*/
|
2450
|
-
const extension = (fileName) => fileName.split('.').pop() || '';
|
2451
|
-
|
2452
2483
|
// Copyright (c) Microsoft Corporation.
|
2453
2484
|
/**
|
2454
2485
|
* @private
|
@@ -4450,6 +4481,7 @@ const ParticipantItem = (props) => {
|
|
4450
4481
|
/* @conditional-compile-remove(PSTN-calls) */
|
4451
4482
|
} = props;
|
4452
4483
|
const [itemHovered, setItemHovered] = React.useState(false);
|
4484
|
+
const [itemFocused, setItemFocused] = React.useState(false);
|
4453
4485
|
const [menuHidden, setMenuHidden] = React.useState(true);
|
4454
4486
|
const containerRef = React.useRef(null);
|
4455
4487
|
const theme = useTheme();
|
@@ -4471,13 +4503,17 @@ const ParticipantItem = (props) => {
|
|
4471
4503
|
const contextualMenuStyle = React.useMemo(() => react.mergeStyles({ background: theme.palette.neutralLighterAlt }, styles === null || styles === void 0 ? void 0 : styles.menu), [theme.palette.neutralLighterAlt, styles === null || styles === void 0 ? void 0 : styles.menu]);
|
4472
4504
|
const infoContainerStyle = React.useMemo(() => react.mergeStyles(iconContainerStyle$1, { color: theme.palette.neutralTertiary }, styles === null || styles === void 0 ? void 0 : styles.iconContainer), [theme.palette.neutralTertiary, styles === null || styles === void 0 ? void 0 : styles.iconContainer]);
|
4473
4505
|
const menuButton = React.useMemo(() => (React__default['default'].createElement(react.Stack, { horizontal: true, horizontalAlign: "end", className: react.mergeStyles(menuButtonContainerStyle), title: strings.menuTitle, "data-ui-id": ids.participantItemMenuButton },
|
4474
|
-
React__default['default'].createElement(react.Icon, { iconName: itemHovered ? 'ParticipantItemOptionsHovered' : 'ParticipantItemOptions', className: iconStyles$4 }))), [
|
4506
|
+
React__default['default'].createElement(react.Icon, { iconName: itemHovered || itemFocused || !menuHidden ? 'ParticipantItemOptionsHovered' : 'ParticipantItemOptions', className: iconStyles$4 }))), [strings.menuTitle, ids.participantItemMenuButton, itemHovered, itemFocused, menuHidden]);
|
4475
4507
|
const onDismissMenu = () => {
|
4476
4508
|
setItemHovered(false);
|
4509
|
+
setItemFocused(false);
|
4477
4510
|
setMenuHidden(true);
|
4478
4511
|
};
|
4479
4512
|
const participantStateString = participantStateStringTrampoline$1(props, strings);
|
4480
|
-
return (React__default['default'].createElement("div", { ref: containerRef, role: 'menuitem', "data-is-focusable": true, "data-ui-id": "participant-item", className: react.mergeStyles(participantItemContainerStyle({
|
4513
|
+
return (React__default['default'].createElement("div", { ref: containerRef, role: 'menuitem', "data-is-focusable": true, "data-ui-id": "participant-item", className: react.mergeStyles(participantItemContainerStyle({
|
4514
|
+
localparticipant: me,
|
4515
|
+
clickable: !!menuItems
|
4516
|
+
}), styles === null || styles === void 0 ? void 0 : styles.root), onMouseEnter: () => setItemHovered(true), onMouseLeave: () => setItemHovered(false), onFocus: () => setItemFocused(true), onBlur: () => setItemFocused(false), onClick: () => {
|
4481
4517
|
if (!participantStateString) {
|
4482
4518
|
setItemHovered(true);
|
4483
4519
|
setMenuHidden(false);
|