@azure/communication-react 1.17.0-alpha-202405220013 → 1.17.0-alpha-202405230013
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 +2 -0
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CDsn-zU7.js → ChatMessageComponentAsRichTextEditBox-BIM6HeBg.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CDsn-zU7.js.map → ChatMessageComponentAsRichTextEditBox-BIM6HeBg.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-Dm4S2bpT.js → RichTextSendBoxWrapper-bWS9ze-2.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-Dm4S2bpT.js.map → RichTextSendBoxWrapper-bWS9ze-2.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-DO36MBbq.js → index-CwHFMnmg.js} +24 -16
- package/dist/dist-cjs/communication-react/index-CwHFMnmg.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/ParticipantItem.js +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantList.js +4 -0
- package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +10 -8
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -0
- package/dist/dist-esm/react-components/src/theming/icons.js +2 -1
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +2 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -0
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-DO36MBbq.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PeoplePaneContent.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/PeoplePaneContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAuB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG7D,OAAO,EACL,eAAe,EAKhB,yCAAmC;AACpC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7G,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AAIxG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KASjC,EAAe,EAAE;IAChB,MAAM,EACJ,UAAU,EACV,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB;IACtB,4CAA4C,CAAC,qCAAqC,EACnF,GAAG,KAAK,CAAC;IACV,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC;IAElC,4EAA4E;IAC5E,MAAM,UAAU,GAAG,GA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AM,IAAI,GAAG,MAAA,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,0CAAE,IAAI,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC;IACnF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IContextualMenuItem, Stack } from '@fluentui/react';\n/* @conditional-compile-remove(spotlight) */\nimport { IContextualMenuProps } from '@fluentui/react';\nimport {\n ParticipantList,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantMenuItemsCallback,\n _DrawerMenuItemProps\n} from '@internal/react-components';\nimport React, { useCallback, useMemo } from 'react';\nimport { CallWithChatCompositeStrings } from '../CallWithChatComposite';\nimport { usePropsFor } from '../CallComposite/hooks/usePropsFor';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { ParticipantListWithHeading } from '../common/ParticipantContainer';\nimport { peoplePaneContainerTokens } from '../common/styles/ParticipantContainer.styles';\nimport { participantListContainerStyles, peoplePaneContainerStyle } from './styles/PeoplePaneContent.styles';\nimport { convertContextualMenuItemToDrawerMenuItem } from './ConvertContextualMenuItemToDrawerMenuItem';\nimport { CommonCallAdapter } from '../CallComposite';\n/* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */\nimport { CallCompositeStrings } from '../CallComposite';\nimport { AddPeopleButton } from './AddPeopleButton';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { PhoneNumberIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { useAdapter } from '../CallComposite/adapter/CallAdapterProvider';\nimport { useLocale } from '../localization';\n\n/**\n * @private\n */\nexport const PeoplePaneContent = (props: {\n inviteLink?: string;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n setDrawerMenuItems: (drawerMenuItems: _DrawerMenuItemProps[]) => void;\n setParticipantActioned?: (userId: string) => void;\n mobileView?: boolean;\n /* @conditional-compile-remove(spotlight) */\n participantListHeadingMoreButtonProps?: IContextualMenuProps;\n}): JSX.Element => {\n const {\n inviteLink,\n onFetchParticipantMenuItems,\n setDrawerMenuItems,\n setParticipantActioned,\n /* @conditional-compile-remove(spotlight) */ participantListHeadingMoreButtonProps\n } = props;\n const adapter = useAdapter();\n const localeStrings = useLocale();\n\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n const getStrings = () => {\n /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */\n return localeStrings.strings.call;\n\n return localeStrings.strings.callWithChat;\n };\n const strings = getStrings();\n\n const removeParticipantFromCall = useCallback(\n async (participantId: string): Promise<void> => {\n await adapter.removeParticipant(participantId);\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(PSTN-calls) */\n const addParticipantToCall = useCallback(\n async (participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void> => {\n await adapter.addParticipant(participant, options);\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = adapter.getState().alternateCallerId;\n\n const participantListDefaultProps = usePropsFor(ParticipantList);\n const removeButtonAllowed = canRemoveParticipants(adapter);\n const setDrawerMenuItemsForParticipant: (participant?: ParticipantListParticipant) => void = useMemo(() => {\n return (participant?: ParticipantListParticipant) => {\n if (participant) {\n setParticipantActioned?.(participant.userId);\n let contextualMenuItems: IContextualMenuItem[] = createDefaultContextualMenuItems(\n participant,\n strings,\n removeButtonAllowed && participant.isRemovable ? participantListDefaultProps.onRemoveParticipant : undefined,\n participantListDefaultProps.myUserId\n );\n if (onFetchParticipantMenuItems) {\n contextualMenuItems = onFetchParticipantMenuItems(\n participant.userId,\n participantListDefaultProps.myUserId,\n contextualMenuItems\n );\n }\n const drawerMenuItems = contextualMenuItems.map((contextualMenu: IContextualMenuItem) =>\n convertContextualMenuItemToDrawerMenuItem(contextualMenu, () => setDrawerMenuItems([]))\n );\n setDrawerMenuItems(drawerMenuItems);\n }\n };\n }, [\n strings,\n participantListDefaultProps.onRemoveParticipant,\n participantListDefaultProps.myUserId,\n removeButtonAllowed,\n onFetchParticipantMenuItems,\n setDrawerMenuItems,\n setParticipantActioned\n ]);\n\n /* @conditional-compile-remove(spotlight) */\n const setDrawerMenuItemsForParticipantListHeadingMoreButton = useMemo(() => {\n const drawerMenuItems = participantListHeadingMoreButtonProps?.items.map((contextualMenu: IContextualMenuItem) =>\n convertContextualMenuItemToDrawerMenuItem(contextualMenu, () => setDrawerMenuItems([]))\n );\n return drawerMenuItems && drawerMenuItems.length > 0 ? () => setDrawerMenuItems(drawerMenuItems) : undefined;\n }, [participantListHeadingMoreButtonProps?.items, setDrawerMenuItems]);\n\n const participantListProps: ParticipantListProps = useMemo(() => {\n const onRemoveAParticipant = async (participantId: string): Promise<void> =>\n removeParticipantFromCall(participantId);\n return {\n ...participantListDefaultProps,\n // Passing undefined callback for mobile to avoid context menus for participants in ParticipantList are clicked\n onRemoveParticipant: props.mobileView ? undefined : onRemoveAParticipant,\n // We want the drawer menu items to appear when participants in ParticipantList are clicked\n onParticipantClick: props.mobileView ? setDrawerMenuItemsForParticipant : undefined\n };\n }, [participantListDefaultProps, props.mobileView, setDrawerMenuItemsForParticipant, removeParticipantFromCall]);\n\n const participantList = (\n <ParticipantListWithHeading\n isMobile={props.mobileView}\n participantListProps={participantListProps}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.mobileView ? undefined : onFetchParticipantMenuItems}\n title={strings.peoplePaneSubTitle}\n /* @conditional-compile-remove(spotlight) */\n headingMoreButtonAriaLabel={localeStrings.strings.call.peoplePaneMoreButtonAriaLabel}\n /* @conditional-compile-remove(spotlight) */\n onClickHeadingMoreButton={props.mobileView ? setDrawerMenuItemsForParticipantListHeadingMoreButton : undefined}\n /* @conditional-compile-remove(spotlight) */\n headingMoreButtonMenuProps={props.participantListHeadingMoreButtonProps}\n />\n );\n\n if (props.mobileView) {\n return (\n <Stack\n verticalFill\n styles={peoplePaneContainerStyle}\n tokens={peoplePaneContainerTokens}\n data-ui-id=\"people-pane-content\"\n >\n <Stack.Item grow styles={participantListContainerStyles}>\n {participantList}\n </Stack.Item>\n\n <AddPeopleButton\n inviteLink={inviteLink}\n mobileView={props.mobileView}\n participantList={participantList}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n </Stack>\n );\n }\n\n return (\n <AddPeopleButton\n inviteLink={inviteLink}\n mobileView={props.mobileView}\n participantList={participantList}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n );\n};\n\n/**\n * Create default contextual menu items for particant\n * @param participant - participant to create contextual menu items for\n * @param strings - localized strings for menu item text\n * @param onRemoveParticipant - callback to remove participant\n * @param localParticipantUserId - Local participant user id\n * @returns - IContextualMenuItem[]\n */\nconst createDefaultContextualMenuItems = (\n participant: ParticipantListParticipant,\n strings:\n | CallWithChatCompositeStrings\n | /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */ CallCompositeStrings,\n onRemoveParticipant?: (userId: string) => Promise<void>,\n localParticipantUserId?: string\n): IContextualMenuItem[] => {\n const menuItems: IContextualMenuItem[] = [];\n if (onRemoveParticipant && participant?.userId !== localParticipantUserId) {\n menuItems.push({\n key: 'remove',\n text: strings.removeMenuLabel,\n onClick: () => {\n if (participant?.userId) {\n onRemoveParticipant?.(participant?.userId);\n }\n },\n iconProps: {\n iconName: 'UserRemove'\n },\n 'data-ui-id': 'participant-list-remove-participant-button'\n });\n }\n return menuItems;\n};\n\nconst canRemoveParticipants = (adapter: CommonCallAdapter): boolean => {\n // TODO: We should be using the removeParticipant capability here but there is an SDK bug for Rooms where a\n // Presenter's removeParticipant capability is {isPresent: false, reason: 'CapabilityNotApplicableForTheCallType'}.\n // But a Presenter in Rooms should be able to remove participants according to the following documentation\n // https://learn.microsoft.com/en-us/azure/communication-services/concepts/rooms/room-concept#predefined-participant-roles-and-permissions\n const role = adapter.getState().call?.role;\n const canRemove = role === 'Presenter' || role === 'Unknown' || role === undefined;\n return canRemove;\n};\n"]}
|
1
|
+
{"version":3,"file":"PeoplePaneContent.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/PeoplePaneContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAuB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG7D,OAAO,EACL,eAAe,EAKhB,yCAAmC;AACpC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7G,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AAIxG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KASjC,EAAe,EAAE;IAChB,MAAM,EACJ,UAAU,EACV,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB;IACtB,4CAA4C,CAAC,qCAAqC,EACnF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C;YACD,YAAY,EAAE,4CAA4C;SAC3D,CAAC,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,OAA0B,EAAW,EAAE;;IACpE,2GAA2G;IAC3G,mHAAmH;IACnH,0GAA0G;IAC1G,0IAA0I;IAC1I,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,0CAAE,IAAI,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC;IACnF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IContextualMenuItem, Stack } from '@fluentui/react';\n/* @conditional-compile-remove(spotlight) */\nimport { IContextualMenuProps } from '@fluentui/react';\nimport {\n ParticipantList,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantMenuItemsCallback,\n _DrawerMenuItemProps\n} from '@internal/react-components';\nimport React, { useCallback, useMemo } from 'react';\nimport { CallWithChatCompositeStrings } from '../CallWithChatComposite';\nimport { usePropsFor } from '../CallComposite/hooks/usePropsFor';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { ParticipantListWithHeading } from '../common/ParticipantContainer';\nimport { peoplePaneContainerTokens } from '../common/styles/ParticipantContainer.styles';\nimport { participantListContainerStyles, peoplePaneContainerStyle } from './styles/PeoplePaneContent.styles';\nimport { convertContextualMenuItemToDrawerMenuItem } from './ConvertContextualMenuItemToDrawerMenuItem';\nimport { CommonCallAdapter } from '../CallComposite';\n/* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */\nimport { CallCompositeStrings } from '../CallComposite';\nimport { AddPeopleButton } from './AddPeopleButton';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { PhoneNumberIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { useAdapter } from '../CallComposite/adapter/CallAdapterProvider';\nimport { useLocale } from '../localization';\n\n/**\n * @private\n */\nexport const PeoplePaneContent = (props: {\n inviteLink?: string;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n setDrawerMenuItems: (drawerMenuItems: _DrawerMenuItemProps[]) => void;\n setParticipantActioned?: (userId: string) => void;\n mobileView?: boolean;\n /* @conditional-compile-remove(spotlight) */\n participantListHeadingMoreButtonProps?: IContextualMenuProps;\n}): JSX.Element => {\n const {\n inviteLink,\n onFetchParticipantMenuItems,\n setDrawerMenuItems,\n setParticipantActioned,\n /* @conditional-compile-remove(spotlight) */ participantListHeadingMoreButtonProps\n } = props;\n const adapter = useAdapter();\n const localeStrings = useLocale();\n\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n const getStrings = () => {\n /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */\n return localeStrings.strings.call;\n\n return localeStrings.strings.callWithChat;\n };\n const strings = getStrings();\n\n const removeParticipantFromCall = useCallback(\n async (participantId: string): Promise<void> => {\n await adapter.removeParticipant(participantId);\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(PSTN-calls) */\n const addParticipantToCall = useCallback(\n async (participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void> => {\n await adapter.addParticipant(participant, options);\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = adapter.getState().alternateCallerId;\n\n const participantListDefaultProps = usePropsFor(ParticipantList);\n const removeButtonAllowed = canRemoveParticipants(adapter);\n const setDrawerMenuItemsForParticipant: (participant?: ParticipantListParticipant) => void = useMemo(() => {\n return (participant?: ParticipantListParticipant) => {\n if (participant) {\n setParticipantActioned?.(participant.userId);\n let contextualMenuItems: IContextualMenuItem[] = createDefaultContextualMenuItems(\n participant,\n strings,\n removeButtonAllowed && participant.isRemovable ? participantListDefaultProps.onRemoveParticipant : undefined,\n participantListDefaultProps.myUserId\n );\n if (onFetchParticipantMenuItems) {\n contextualMenuItems = onFetchParticipantMenuItems(\n participant.userId,\n participantListDefaultProps.myUserId,\n contextualMenuItems\n );\n }\n const drawerMenuItems = contextualMenuItems.map((contextualMenu: IContextualMenuItem) =>\n convertContextualMenuItemToDrawerMenuItem(contextualMenu, () => setDrawerMenuItems([]))\n );\n setDrawerMenuItems(drawerMenuItems);\n }\n };\n }, [\n strings,\n participantListDefaultProps.onRemoveParticipant,\n participantListDefaultProps.myUserId,\n removeButtonAllowed,\n onFetchParticipantMenuItems,\n setDrawerMenuItems,\n setParticipantActioned\n ]);\n\n /* @conditional-compile-remove(spotlight) */\n const setDrawerMenuItemsForParticipantListHeadingMoreButton = useMemo(() => {\n const drawerMenuItems = participantListHeadingMoreButtonProps?.items.map((contextualMenu: IContextualMenuItem) =>\n convertContextualMenuItemToDrawerMenuItem(contextualMenu, () => setDrawerMenuItems([]))\n );\n return drawerMenuItems && drawerMenuItems.length > 0 ? () => setDrawerMenuItems(drawerMenuItems) : undefined;\n }, [participantListHeadingMoreButtonProps?.items, setDrawerMenuItems]);\n\n const participantListProps: ParticipantListProps = useMemo(() => {\n const onRemoveAParticipant = async (participantId: string): Promise<void> =>\n removeParticipantFromCall(participantId);\n return {\n ...participantListDefaultProps,\n // Passing undefined callback for mobile to avoid context menus for participants in ParticipantList are clicked\n onRemoveParticipant: props.mobileView ? undefined : onRemoveAParticipant,\n // We want the drawer menu items to appear when participants in ParticipantList are clicked\n onParticipantClick: props.mobileView ? setDrawerMenuItemsForParticipant : undefined\n };\n }, [participantListDefaultProps, props.mobileView, setDrawerMenuItemsForParticipant, removeParticipantFromCall]);\n\n const participantList = (\n <ParticipantListWithHeading\n isMobile={props.mobileView}\n participantListProps={participantListProps}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.mobileView ? undefined : onFetchParticipantMenuItems}\n title={strings.peoplePaneSubTitle}\n /* @conditional-compile-remove(spotlight) */\n headingMoreButtonAriaLabel={localeStrings.strings.call.peoplePaneMoreButtonAriaLabel}\n /* @conditional-compile-remove(spotlight) */\n onClickHeadingMoreButton={props.mobileView ? setDrawerMenuItemsForParticipantListHeadingMoreButton : undefined}\n /* @conditional-compile-remove(spotlight) */\n headingMoreButtonMenuProps={props.participantListHeadingMoreButtonProps}\n />\n );\n\n if (props.mobileView) {\n return (\n <Stack\n verticalFill\n styles={peoplePaneContainerStyle}\n tokens={peoplePaneContainerTokens}\n data-ui-id=\"people-pane-content\"\n >\n <Stack.Item grow styles={participantListContainerStyles}>\n {participantList}\n </Stack.Item>\n\n <AddPeopleButton\n inviteLink={inviteLink}\n mobileView={props.mobileView}\n participantList={participantList}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n </Stack>\n );\n }\n\n return (\n <AddPeopleButton\n inviteLink={inviteLink}\n mobileView={props.mobileView}\n participantList={participantList}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n );\n};\n\n/**\n * Create default contextual menu items for particant\n * @param participant - participant to create contextual menu items for\n * @param strings - localized strings for menu item text\n * @param onRemoveParticipant - callback to remove participant\n * @param localParticipantUserId - Local participant user id\n * @returns - IContextualMenuItem[]\n */\nconst createDefaultContextualMenuItems = (\n participant: ParticipantListParticipant,\n strings:\n | CallWithChatCompositeStrings\n | /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */ CallCompositeStrings,\n onRemoveParticipant?: (userId: string) => Promise<void>,\n localParticipantUserId?: string\n): IContextualMenuItem[] => {\n const menuItems: IContextualMenuItem[] = [];\n if (onRemoveParticipant && participant?.userId !== localParticipantUserId) {\n menuItems.push({\n key: 'remove',\n text: strings.removeMenuLabel,\n onClick: () => {\n if (participant?.userId) {\n onRemoveParticipant?.(participant?.userId);\n }\n },\n iconProps: {\n iconName: 'ContextMenuRemoveParticipant',\n styles: { root: { lineHeight: 0 } }\n },\n 'data-ui-id': 'participant-list-remove-participant-button'\n });\n }\n return menuItems;\n};\n\nconst canRemoveParticipants = (adapter: CommonCallAdapter): boolean => {\n // TODO: We should be using the removeParticipant capability here but there is an SDK bug for Rooms where a\n // Presenter's removeParticipant capability is {isPresent: false, reason: 'CapabilityNotApplicableForTheCallType'}.\n // But a Presenter in Rooms should be able to remove participants according to the following documentation\n // https://learn.microsoft.com/en-us/azure/communication-services/concepts/rooms/room-concept#predefined-participant-roles-and-permissions\n const role = adapter.getState().call?.role;\n const canRemove = role === 'Presenter' || role === 'Unknown' || role === undefined;\n return canRemove;\n};\n"]}
|
@@ -152,6 +152,7 @@ export declare const DEFAULT_COMPOSITE_ICONS: {
|
|
152
152
|
ContextMenuCameraIcon: React.JSX.Element;
|
153
153
|
ContextMenuMicIcon: React.JSX.Element;
|
154
154
|
ContextMenuSpeakerIcon: React.JSX.Element;
|
155
|
+
ContextMenuRemoveParticipant: React.JSX.Element;
|
155
156
|
SurveyStarIcon: React.JSX.Element;
|
156
157
|
SurveyStarIconFilled: React.JSX.Element;
|
157
158
|
StartSpotlightContextualMenuItem: React.JSX.Element;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure/communication-react",
|
3
|
-
"version": "1.17.0-alpha-
|
3
|
+
"version": "1.17.0-alpha-202405230013",
|
4
4
|
"sideEffects": false,
|
5
5
|
"description": "React library for building modern communication user experiences utilizing Azure Communication Services",
|
6
6
|
"keywords": [
|