@azure/communication-react 1.16.0-alpha-202404270012 → 1.16.0-alpha-202405011636
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 +14 -1
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DSlV4PZz.js → ChatMessageComponentAsRichTextEditBox-CNg75yjR.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DSlV4PZz.js.map → ChatMessageComponentAsRichTextEditBox-CNg75yjR.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-aGXLnB_I.js → index-CMUOoVHA.js} +19 -7
- package/dist/dist-cjs/communication-react/index-CMUOoVHA.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +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/RemoteVideoTile.js +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.d.ts +13 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js +13 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +4 -0
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-aGXLnB_I.js.map +0 -1
@@ -19,7 +19,7 @@ export const CapabilitiesChangedNotificationBar = (props) => {
|
|
19
19
|
})));
|
20
20
|
};
|
21
21
|
const getCapabilityChangedNotificationString = (notification, strings) => {
|
22
|
-
var _a, _b, _c, _d, _e, _f;
|
22
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
23
23
|
switch (notification.capabilityName) {
|
24
24
|
case 'turnVideoOn':
|
25
25
|
if (notification.changedReason === 'MeetingOptionOrOrganizerPolicyChanged') {
|
@@ -43,6 +43,18 @@ const getCapabilityChangedNotificationString = (notification, strings) => {
|
|
43
43
|
return (_f = strings === null || strings === void 0 ? void 0 : strings.shareScreen) === null || _f === void 0 ? void 0 : _f.lostDueToRoleChangeToAttendee;
|
44
44
|
}
|
45
45
|
break;
|
46
|
+
/* @conditional-compile-remove(hide-attendee-name) */
|
47
|
+
case 'viewAttendeeNames':
|
48
|
+
if (!notification.isPresent &&
|
49
|
+
notification.changedReason === 'MeetingOptionOrOrganizerPolicyChanged' &&
|
50
|
+
notification.role === 'Attendee') {
|
51
|
+
return (_g = strings === null || strings === void 0 ? void 0 : strings.hideAttendeeNames) === null || _g === void 0 ? void 0 : _g.hideAttendeeNameAttendee;
|
52
|
+
}
|
53
|
+
if (!notification.isPresent &&
|
54
|
+
notification.changedReason === 'MeetingOptionOrOrganizerPolicyChanged' &&
|
55
|
+
notification.role === 'Presenter') {
|
56
|
+
return (_h = strings === null || strings === void 0 ? void 0 : strings.hideAttendeeNames) === null || _h === void 0 ? void 0 : _h.hideAttendeeNamePresenter;
|
57
|
+
}
|
46
58
|
}
|
47
59
|
return undefined;
|
48
60
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CapabilitiesChangedNotificationBar.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAgC,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAIlG,OAAO,EAAE,SAAS,EAAE,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C3B,QAAQ,GAAG,oBAAoB,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACN,QAAQ,GAAG,4BAA4B,CAAC;YAC1C,CAAC;YACD,MAAM;QACR;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;AACtF,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG;IACvB,SAAS,EAAE;QACT,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,CAAC;KACV;IACD,OAAO,EAAE;QACP,UAAU,EAAE,SAAS;KACtB;IACD,SAAS,EAAE;QACT,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\n\nimport { IIconProps, IMessageBarProps, MessageBar, MessageBarType, Stack } from '@fluentui/react';\n\nimport { CapabilitiesChangedReason, ParticipantCapabilityName, ParticipantRole } from '@azure/communication-calling';\n\nimport { useLocale } from '../../localization';\n\n/**\n * @private\n */\nexport interface CapabilitiesChangeNotificationBarProps extends IMessageBarProps {\n capabilitiesChangedNotifications: CapabalityChangedNotification[];\n onDismissNotification: (notification: CapabalityChangedNotification) => void;\n}\n\n/**\n * @private\n */\nexport interface CapabalityChangedNotification {\n /**\n * Name of capability\n */\n capabilityName: ParticipantCapabilityName;\n /**\n * Is capability now available\n */\n isPresent: boolean;\n\n /**\n * Reason capability was changed\n */\n changedReason?: CapabilitiesChangedReason;\n\n /**\n * Role of participant when capability changed\n */\n role?: ParticipantRole;\n /**\n * The latest timestamp when this notification was observed.\n *\n * When available, this is used to track notifications that have already been seen and dismissed\n * by the user.\n */\n timestamp?: Date;\n}\n\n/**\n * Notification bar for capabilities changed\n * @private\n */\nexport const CapabilitiesChangedNotificationBar = (props: CapabilitiesChangeNotificationBarProps): JSX.Element => {\n const locale = useLocale();\n\n return (\n <Stack data-ui-id=\"capabilities-changed-notification-bar-stack\">\n {props.capabilitiesChangedNotifications.map((notification) => {\n const message = getCapabilityChangedNotificationString(\n notification,\n locale.strings.call.capabilityChangedNotification\n );\n if (!message) {\n return null;\n }\n const iconProps = getCustomMessageBarIconProps(notification);\n return (\n <MessageBar\n key={notification.capabilityName}\n styles={messageBarStyles}\n messageBarType={MessageBarType.warning}\n dismissIconProps={{ iconName: 'ErrorBarClear' }}\n onDismiss={() => props.onDismissNotification(notification)}\n messageBarIconProps={iconProps}\n >\n {message}\n </MessageBar>\n );\n })}\n </Stack>\n );\n};\n\nconst getCapabilityChangedNotificationString = (\n notification: CapabalityChangedNotification,\n strings?: CapabilityChangedNotificationStrings\n): string | undefined => {\n switch (notification.capabilityName) {\n case 'turnVideoOn':\n if (notification.changedReason === 'MeetingOptionOrOrganizerPolicyChanged') {\n return notification.isPresent\n ? strings?.turnVideoOn?.grantedDueToMeetingOption\n : strings?.turnVideoOn?.lostDueToMeetingOption;\n }\n break;\n case 'unmuteMic':\n if (notification.changedReason === 'MeetingOptionOrOrganizerPolicyChanged') {\n return notification.isPresent\n ? strings?.unmuteMic?.grantedDueToMeetingOption\n : strings?.unmuteMic?.lostDueToMeetingOption;\n }\n break;\n case 'shareScreen':\n if (notification.isPresent && notification.changedReason === 'RoleChanged' && notification.role === 'Presenter') {\n return strings?.shareScreen?.grantedDueToRoleChangeToPresenter;\n }\n if (!notification.isPresent && notification.changedReason === 'RoleChanged' && notification.role === 'Attendee') {\n return strings?.shareScreen?.lostDueToRoleChangeToAttendee;\n }\n break;\n }\n return undefined;\n};\n\nconst getCustomMessageBarIconProps = (notification: CapabalityChangedNotification): IIconProps | undefined => {\n let iconName: string | undefined = undefined;\n switch (notification.capabilityName) {\n case 'turnVideoOn':\n if (notification.isPresent) {\n iconName = 'ControlButtonCameraOn';\n } else {\n iconName = 'ControlButtonCameraProhibited';\n }\n break;\n case 'unmuteMic':\n if (notification.isPresent) {\n iconName = 'ControlButtonMicOn';\n } else {\n iconName = 'ControlButtonMicProhibited';\n }\n break;\n default:\n return undefined;\n }\n return { iconName, styles: { root: { '> *': { height: '1rem', width: '1rem' } } } };\n};\n\nconst messageBarStyles = {\n innerText: {\n alignSelf: 'center'\n },\n icon: {\n height: 0\n },\n content: {\n lineHeight: 'inherit'\n },\n dismissal: {\n height: 0,\n paddingTop: '0.8rem'\n }\n};\n\n/**\n * Strings for capability changed notification\n * @public\n */\nexport interface CapabilityChangedNotificationStrings {\n /**\n * Strings for 'turnVideoOn' capability\n */\n turnVideoOn?: {\n /**\n * Notification message shown to the user when capability to turn video on is lost due to a meeting option change\n */\n lostDueToMeetingOption?: string;\n /**\n * Notification message shown to the user when capability to turn video on is granted due to a meeting option change\n */\n grantedDueToMeetingOption?: string;\n };\n /**\n * Strings for 'unmuteMic' capability\n */\n unmuteMic?: {\n /**\n * Notification message shown to the user when capability to unmute mic is lost due to a meeting option change\n */\n lostDueToMeetingOption?: string;\n /**\n * Notification message shown to the user when capability to unmute mic is granted due to a meeting option change\n */\n grantedDueToMeetingOption?: string;\n };\n /**\n * Strings for 'shareScreen' capability\n */\n shareScreen?: {\n /**\n * Notification message shown to the user when capability to share screen is lost due to a role change to Attendeee\n */\n lostDueToRoleChangeToAttendee?: string;\n /**\n * Notification message shown to the user when capability to share screen is granted due to a role change to Presenter\n */\n grantedDueToRoleChangeToPresenter?: string;\n };\n}\n"]}
|
1
|
+
{"version":3,"file":"CapabilitiesChangedNotificationBar.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAgC,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,iBAAiB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MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,0CAAE,yBAAyB,CAAC;YAC/D,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,4BAA4B,GAAG,CAAC,YAA2C,EAA0B,EAAE;IAC3G,IAAI,QAAQ,GAAuB,SAAS,CAAC;IAC7C,QAAQ,YAAY,CAAC,cAAc,EAAE,CAAC;QACpC,KAAK,aAAa;YAChB,IAAI,YAAY,CAAC,SAAS,EAAE,CAAC;gBAC3B,QAAQ,GAAG,uBAAuB,CAAC;YACrC,CAAC;iBAAM,CAAC;gBACN,QAAQ,GAAG,+BAA+B,CAAC;YAC7C,CAAC;YACD,MAAM;QACR,KAAK,WAAW;YACd,IAAI,YAAY,CAAC,SAAS,EAAE,CAAC;gBAC3B,QAAQ,GAAG,oBAAoB,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACN,QAAQ,GAAG,4BAA4B,CAAC;YAC1C,CAAC;YACD,MAAM;QACR;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;AACtF,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG;IACvB,SAAS,EAAE;QACT,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,CAAC;KACV;IACD,OAAO,EAAE;QACP,UAAU,EAAE,SAAS;KACtB;IACD,SAAS,EAAE;QACT,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\n\nimport { IIconProps, IMessageBarProps, MessageBar, MessageBarType, Stack } from '@fluentui/react';\n\nimport { CapabilitiesChangedReason, ParticipantCapabilityName, ParticipantRole } from '@azure/communication-calling';\n\nimport { useLocale } from '../../localization';\n\n/**\n * @private\n */\nexport interface CapabilitiesChangeNotificationBarProps extends IMessageBarProps {\n capabilitiesChangedNotifications: CapabalityChangedNotification[];\n onDismissNotification: (notification: CapabalityChangedNotification) => void;\n}\n\n/**\n * @private\n */\nexport interface CapabalityChangedNotification {\n /**\n * Name of capability\n */\n capabilityName: ParticipantCapabilityName;\n /**\n * Is capability now available\n */\n isPresent: boolean;\n\n /**\n * Reason capability was changed\n */\n changedReason?: CapabilitiesChangedReason;\n\n /**\n * Role of participant when capability changed\n */\n role?: ParticipantRole;\n /**\n * The latest timestamp when this notification was observed.\n *\n * When available, this is used to track notifications that have already been seen and dismissed\n * by the user.\n */\n timestamp?: Date;\n}\n\n/**\n * Notification bar for capabilities changed\n * @private\n */\nexport const CapabilitiesChangedNotificationBar = (props: CapabilitiesChangeNotificationBarProps): JSX.Element => {\n const locale = useLocale();\n\n return (\n <Stack data-ui-id=\"capabilities-changed-notification-bar-stack\">\n {props.capabilitiesChangedNotifications.map((notification) => {\n const message = getCapabilityChangedNotificationString(\n notification,\n locale.strings.call.capabilityChangedNotification\n );\n if (!message) {\n return null;\n }\n const iconProps = getCustomMessageBarIconProps(notification);\n return (\n <MessageBar\n key={notification.capabilityName}\n styles={messageBarStyles}\n messageBarType={MessageBarType.warning}\n dismissIconProps={{ iconName: 'ErrorBarClear' }}\n onDismiss={() => props.onDismissNotification(notification)}\n messageBarIconProps={iconProps}\n >\n {message}\n </MessageBar>\n );\n })}\n </Stack>\n );\n};\n\nconst getCapabilityChangedNotificationString = (\n notification: CapabalityChangedNotification,\n strings?: CapabilityChangedNotificationStrings\n): string | undefined => {\n switch (notification.capabilityName) {\n case 'turnVideoOn':\n if (notification.changedReason === 'MeetingOptionOrOrganizerPolicyChanged') {\n return notification.isPresent\n ? strings?.turnVideoOn?.grantedDueToMeetingOption\n : strings?.turnVideoOn?.lostDueToMeetingOption;\n }\n break;\n case 'unmuteMic':\n if (notification.changedReason === 'MeetingOptionOrOrganizerPolicyChanged') {\n return notification.isPresent\n ? strings?.unmuteMic?.grantedDueToMeetingOption\n : strings?.unmuteMic?.lostDueToMeetingOption;\n }\n break;\n case 'shareScreen':\n if (notification.isPresent && notification.changedReason === 'RoleChanged' && notification.role === 'Presenter') {\n return strings?.shareScreen?.grantedDueToRoleChangeToPresenter;\n }\n if (!notification.isPresent && notification.changedReason === 'RoleChanged' && notification.role === 'Attendee') {\n return strings?.shareScreen?.lostDueToRoleChangeToAttendee;\n }\n break;\n /* @conditional-compile-remove(hide-attendee-name) */\n case 'viewAttendeeNames':\n if (\n !notification.isPresent &&\n notification.changedReason === 'MeetingOptionOrOrganizerPolicyChanged' &&\n notification.role === 'Attendee'\n ) {\n return strings?.hideAttendeeNames?.hideAttendeeNameAttendee;\n }\n if (\n !notification.isPresent &&\n notification.changedReason === 'MeetingOptionOrOrganizerPolicyChanged' &&\n notification.role === 'Presenter'\n ) {\n return strings?.hideAttendeeNames?.hideAttendeeNamePresenter;\n }\n }\n return undefined;\n};\n\nconst getCustomMessageBarIconProps = (notification: CapabalityChangedNotification): IIconProps | undefined => {\n let iconName: string | undefined = undefined;\n switch (notification.capabilityName) {\n case 'turnVideoOn':\n if (notification.isPresent) {\n iconName = 'ControlButtonCameraOn';\n } else {\n iconName = 'ControlButtonCameraProhibited';\n }\n break;\n case 'unmuteMic':\n if (notification.isPresent) {\n iconName = 'ControlButtonMicOn';\n } else {\n iconName = 'ControlButtonMicProhibited';\n }\n break;\n default:\n return undefined;\n }\n return { iconName, styles: { root: { '> *': { height: '1rem', width: '1rem' } } } };\n};\n\nconst messageBarStyles = {\n innerText: {\n alignSelf: 'center'\n },\n icon: {\n height: 0\n },\n content: {\n lineHeight: 'inherit'\n },\n dismissal: {\n height: 0,\n paddingTop: '0.8rem'\n }\n};\n\n/**\n * Strings for capability changed notification\n * @public\n */\nexport interface CapabilityChangedNotificationStrings {\n /**\n * Strings for 'turnVideoOn' capability\n */\n turnVideoOn?: {\n /**\n * Notification message shown to the user when capability to turn video on is lost due to a meeting option change\n */\n lostDueToMeetingOption?: string;\n /**\n * Notification message shown to the user when capability to turn video on is granted due to a meeting option change\n */\n grantedDueToMeetingOption?: string;\n };\n /**\n * Strings for 'unmuteMic' capability\n */\n unmuteMic?: {\n /**\n * Notification message shown to the user when capability to unmute mic is lost due to a meeting option change\n */\n lostDueToMeetingOption?: string;\n /**\n * Notification message shown to the user when capability to unmute mic is granted due to a meeting option change\n */\n grantedDueToMeetingOption?: string;\n };\n /**\n * Strings for 'shareScreen' capability\n */\n shareScreen?: {\n /**\n * Notification message shown to the user when capability to share screen is lost due to a role change to Attendeee\n */\n lostDueToRoleChangeToAttendee?: string;\n /**\n * Notification message shown to the user when capability to share screen is granted due to a role change to Presenter\n */\n grantedDueToRoleChangeToPresenter?: string;\n };\n /* @conditional-compile-remove(hide-attendee-name) */\n /**\n * Strings for hidden attendee names capability\n */\n hideAttendeeNames?: {\n /**\n * Notification message shown to the user when capability to view attendee names is lost due to a meeting option change for Attendee\n */\n hideAttendeeNameAttendee?: string;\n /**\n * Notification message shown to the user when capability to view attendee names is lost due to a meeting option change for Presenter\n */\n hideAttendeeNamePresenter?: string;\n };\n}\n"]}
|
package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json
CHANGED
@@ -244,6 +244,10 @@
|
|
244
244
|
"shareScreen": {
|
245
245
|
"lostDueToRoleChangeToAttendee": "Your role has been changed. Some actions, like sharing content, won't be available to you.",
|
246
246
|
"grantedDueToRoleChangeToPresenter": "You're a presenter. You can share content and facilitate the meeting."
|
247
|
+
},
|
248
|
+
"hideAttendeeNames": {
|
249
|
+
"hideAttendeeNameAttendee": "Your name is hidden from other attendees. Organizers and presenters can see your real name.",
|
250
|
+
"hideAttendeeNamePresenter": "Attendee names are hidden. Only organizers and presenters can see names to protect attendee privacy."
|
247
251
|
}
|
248
252
|
},
|
249
253
|
"surveyTitle": "Help us improve",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure/communication-react",
|
3
|
-
"version": "1.16.0-alpha-
|
3
|
+
"version": "1.16.0-alpha-202405011636",
|
4
4
|
"sideEffects": false,
|
5
5
|
"description": "React library for building modern communication user experiences utilizing Azure Communication Services",
|
6
6
|
"keywords": [
|