@azure/communication-react 1.21.0-alpha-202410210016 → 1.21.0-alpha-202410220016
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 +9 -1
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CskWqSjD.js → ChatMessageComponentAsRichTextEditBox-DUDmkZ-m.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CskWqSjD.js.map → ChatMessageComponentAsRichTextEditBox-DUDmkZ-m.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BmT4tjtB.js → RichTextSendBoxWrapper-BDR_vyKj.js} +3 -3
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BmT4tjtB.js.map → RichTextSendBoxWrapper-BDR_vyKj.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-CsAc6QmC.js → index-BgsEEH3L.js} +64 -115
- package/dist/dist-cjs/communication-react/index-BgsEEH3L.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/common.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/chat-component-bindings/src/messageThreadSelector.js +0 -6
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +1 -15
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +2 -8
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +1 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +4 -12
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +4 -19
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +4 -12
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +4 -24
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +8 -0
- package/dist/dist-esm/react-components/src/components/VideoTile.js +16 -5
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +3 -15
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils.d.ts +5 -0
- package/dist/dist-esm/react-components/src/components/utils.js +21 -0
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +5 -1
- package/dist/dist-esm/react-components/src/theming/icons.js +2 -19
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -2
- package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-CsAc6QmC.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VideoTile.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/VideoTile.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,eAAe,EACf,IAAI,EACJ,UAAU,EAGV,WAAW,EACX,OAAO,EACP,KAAK,EACL,IAAI,EACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAmB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,oBAAoB,EACpB,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA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,uBAAuB;QAClC,CAAC,CAAC,KAAK,CAAC,gBAAgB,KAAK,MAAM;YACjC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB;YAC/B,CAAC,CAAC,SAAS,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG;IAC9B,sEAAsE;IACtE,yDAAyD;IACzD,WAAW,EAAE,MAAM;CACpB,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,iBAAyB,EAAE,YAAqB,EAAU,EAAE;IAC9F,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,iBAAiB,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACrE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DirectionalHint,\n Icon,\n IconButton,\n IContextualMenuProps,\n IStyle,\n mergeStyles,\n Persona,\n Stack,\n Text\n} from '@fluentui/react';\nimport React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { ComponentLocale, useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport { BaseCustomStyles, CustomAvatarOptions, OnRenderAvatarCallback } from '../types';\nimport { CallingTheme } from '../theming';\nimport { RaisedHand } from '../types';\nimport { RaisedHandIcon } from './assets/RaisedHandIcon';\n\nimport { ParticipantState } from '../types';\nimport {\n disabledVideoHint,\n displayNameStyle,\n iconContainerStyle,\n overlayContainerStyles,\n rootStyles,\n videoContainerStyles,\n tileInfoContainerStyle,\n participantStateStringStyles\n} from './styles/VideoTile.styles';\nimport { pinIconStyle } from './styles/VideoTile.styles';\nimport useLongPress from './utils/useLongPress';\nimport { moreButtonStyles } from './styles/VideoTile.styles';\nimport { raiseHandContainerStyles } from './styles/VideoTile.styles';\nimport { ReactionResources } from '../types/ReactionTypes';\n\n/**\n * Strings of {@link VideoTile} that can be overridden.\n * @public\n */\nexport interface VideoTileStrings {\n /** Aria label for announcing the remote video tile drawer menu */\n moreOptionsButtonAriaLabel: string;\n /** String for displaying the Ringing of the remote participant */\n participantStateRinging: string;\n /** String for displaying the Hold state of the remote participant */\n participantStateHold: string;\n}\n\n/**\n * Fluent styles for {@link VideoTile}.\n *\n * @public\n */\nexport interface VideoTileStylesProps extends BaseCustomStyles {\n /** Styles for video container. */\n videoContainer?: IStyle;\n /** Styles for container overlayed on the video container. */\n overlayContainer?: IStyle;\n /** Styles for displayName on the video container. */\n displayNameContainer?: IStyle;\n}\n\n/**\n * Props for {@link VideoTile}.\n *\n * @public\n */\nexport interface VideoTileProps {\n /** React Child components. Child Components will show as overlay component in the VideoTile. */\n children?: React.ReactNode;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <VideoTile styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: VideoTileStylesProps;\n /** user id for the VideoTile placeholder. */\n userId?: string;\n /** Component with the video stream. */\n renderElement?: JSX.Element | null;\n /**\n * Overlay component responsible for rendering reaction\n */\n overlay?: JSX.Element | null;\n /** Determines if the video is mirrored or not. */\n isMirrored?: boolean;\n /** Custom render Component function for no video is available. Render a Persona Icon if undefined. */\n onRenderPlaceholder?: OnRenderAvatarCallback;\n /**\n * Show label on the VideoTile\n * @defaultValue true\n */\n showLabel?: boolean;\n /**\n * Show label background on the VideoTile\n * @defaultValue false\n */\n alwaysShowLabelBackground?: boolean;\n /**\n * Whether to display a mute icon beside the user's display name.\n * @defaultValue true\n */\n showMuteIndicator?: boolean;\n /**\n * Whether the video is muted or not.\n */\n isMuted?: boolean;\n /**\n * If true, the video tile will show the pin icon.\n */\n isPinned?: boolean;\n /**\n * Display Name of the Participant to be shown in the label.\n * @remarks `displayName` is used to generate avatar initials if `initialsName` is not provided.\n */\n displayName?: string;\n /**\n * Name of the participant used to generate initials. For example, a name `John Doe` will display `JD` as initials.\n * @remarks `displayName` is used if this property is not specified.\n */\n initialsName?: string;\n /**\n * Minimum size of the persona avatar in px.\n * The persona avatar is the default placeholder shown when no video stream is available.\n * For more information see https://developer.microsoft.com/en-us/fluentui#/controls/web/persona\n * @defaultValue 32px\n */\n personaMinSize?: number;\n /**\n * Maximum size of the personal avatar in px.\n * The persona avatar is the default placeholder shown when no video stream is available.\n * For more information see https://developer.microsoft.com/en-us/fluentui#/controls/web/persona\n * @defaultValue 100px\n */\n personaMaxSize?: number;\n /** Optional property to set the aria label of the video tile if there is no available stream. */\n noVideoAvailableAriaLabel?: string;\n /** Whether the participant in the videoTile is speaking. Shows a speaking indicator (border). */\n isSpeaking?: boolean;\n\n /** Whether the participant is raised hand. Show a indicator (border) and icon with order */\n raisedHand?: RaisedHand;\n\n /**\n * The call connection state of the participant.\n * For example, `Hold` means the participant is on hold.\n */\n participantState?: ParticipantState;\n /**\n * Strings to override in the component.\n */\n strings?: VideoTileStrings;\n /**\n * Display custom menu items in the VideoTile's contextual menu.\n * Uses Fluent UI ContextualMenu.\n * An ellipses icon will be displayed to open the contextual menu if this prop is defined.\n */\n contextualMenu?: IContextualMenuProps;\n /**\n * Callback triggered by video tile on touch and hold.\n */\n onLongTouch?: () => void;\n /**\n * If true, the video tile will show the spotlighted icon.\n */\n isSpotlighted?: boolean;\n /**\n * Reactions resources' url and metadata.\n */\n reactionResources?: ReactionResources;\n}\n\n// Coin max size is set to PersonaSize.size100\nconst DEFAULT_PERSONA_MAX_SIZE_PX = 100;\n// Coin min size is set PersonaSize.size32\nconst DEFAULT_PERSONA_MIN_SIZE_PX = 32;\n\nconst DefaultPlaceholder = (props: CustomAvatarOptions): JSX.Element => {\n const { text, noVideoAvailableAriaLabel, coinSize, hidePersonaDetails } = props;\n\n return (\n <Stack className={mergeStyles({ position: 'absolute', height: '100%', width: '100%' })}>\n <Stack styles={defaultPersonaStyles}>\n {coinSize && (\n <Persona\n coinSize={coinSize}\n hidePersonaDetails={hidePersonaDetails}\n text={text ?? ''}\n initialsTextColor=\"white\"\n aria-label={noVideoAvailableAriaLabel ?? ''}\n showOverflowTooltip={false}\n />\n )}\n </Stack>\n </Stack>\n );\n};\n\nconst defaultPersonaStyles = { root: { margin: 'auto', maxHeight: '100%' } };\n\nconst videoTileMoreMenuIconProps = { iconName: undefined, style: { display: 'none' } };\nconst videoTileMoreMenuProps = {\n directionalHint: DirectionalHint.topLeftEdge,\n isBeakVisible: false,\n styles: { container: { maxWidth: '8rem' } }\n};\nconst VideoTileMoreOptionsButton = (props: {\n contextualMenu?: IContextualMenuProps;\n canShowContextMenuButton: boolean;\n}): JSX.Element => {\n const locale = useLocale();\n const theme = useTheme();\n const strings = { ...locale.strings.videoTile };\n\n const { contextualMenu, canShowContextMenuButton } = props;\n if (!contextualMenu) {\n return <></>;\n }\n\n const optionsIcon = canShowContextMenuButton ? 'VideoTileMoreOptions' : undefined;\n\n return (\n <IconButton\n data-ui-id=\"video-tile-more-options-button\"\n ariaLabel={strings?.moreOptionsButtonAriaLabel}\n styles={moreButtonStyles(theme)}\n menuIconProps={videoTileMoreMenuIconProps}\n menuProps={{ ...videoTileMoreMenuProps, ...contextualMenu }}\n iconProps={{ iconName: optionsIcon }}\n />\n );\n};\n\n/**\n * A component to render the video stream for a single call participant.\n *\n * Use with {@link GridLayout} in a {@link VideoGallery}.\n *\n * @public\n */\nexport const VideoTile = (props: VideoTileProps): JSX.Element => {\n const {\n children,\n displayName,\n initialsName,\n isMirrored,\n isMuted,\n isSpotlighted,\n isPinned,\n onRenderPlaceholder,\n renderElement,\n overlay: reactionOverlay,\n showLabel = true,\n showMuteIndicator = true,\n styles,\n userId,\n noVideoAvailableAriaLabel,\n isSpeaking,\n raisedHand,\n personaMinSize = DEFAULT_PERSONA_MIN_SIZE_PX,\n personaMaxSize = DEFAULT_PERSONA_MAX_SIZE_PX,\n contextualMenu\n } = props;\n\n const [isHovered, setIsHovered] = useState<boolean>(false);\n const [isFocused, setIsFocused] = useState<boolean>(false);\n // need to set a default otherwise the resizeObserver will get stuck in an infinite loop.\n const [personaSize, setPersonaSize] = useState<number>(1);\n\n const videoTileRef = useRef<HTMLDivElement>(null);\n\n const locale = useLocale();\n const theme = useTheme();\n const callingPalette = (theme as unknown as CallingTheme).callingPalette;\n\n const isVideoRendered = !!renderElement;\n\n const observer = useRef(\n new ResizeObserver((entries): void => {\n if (!entries[0]) {\n return;\n }\n const { width, height } = entries[0].contentRect;\n const personaCalcSize = Math.min(width, height) / 3;\n // we only want to set the persona size if it has changed\n if (personaCalcSize !== personaSize) {\n setPersonaSize(Math.max(Math.min(personaCalcSize, personaMaxSize), personaMinSize));\n }\n })\n );\n\n useLayoutEffect(() => {\n if (videoTileRef.current) {\n observer.current.observe(videoTileRef.current);\n }\n const currentObserver = observer.current;\n return () => currentObserver.disconnect();\n }, [videoTileRef]);\n\n // TODO: Remove after calling sdk fix the keybaord focus\n useEffect(() => {\n // PPTLive stream id is null\n if (videoTileRef.current?.id) {\n return;\n }\n let observer: MutationObserver | undefined;\n if (videoTileRef.current) {\n observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === 'childList') {\n const iframe = document.querySelector('iframe');\n if (iframe) {\n if (!iframe.getAttribute('tabIndex')) {\n iframe.setAttribute('tabIndex', '-1');\n }\n }\n }\n }\n });\n\n observer.observe(videoTileRef.current, { childList: true, subtree: true });\n }\n\n return () => {\n observer?.disconnect();\n };\n }, [displayName, renderElement]);\n\n const useLongPressProps = useMemo(() => {\n return {\n onLongPress: () => {\n props.onLongTouch?.();\n },\n touchEventsOnly: true\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.onLongTouch]);\n const longPressHandlers = useLongPress(useLongPressProps);\n\n const hoverHandlers = useMemo(() => {\n return {\n onMouseEnter: () => setIsHovered(true),\n onMouseLeave: () => setIsHovered(false),\n onFocus: () => setIsFocused(true),\n onBlur: () => setIsFocused(false)\n };\n }, []);\n\n const placeholderOptions = {\n userId,\n text: initialsName ?? displayName,\n noVideoAvailableAriaLabel,\n coinSize: personaSize,\n styles: defaultPersonaStyles,\n hidePersonaDetails: true\n };\n\n const videoHintWithBorderRadius = mergeStyles(disabledVideoHint, {\n borderRadius: theme.effects.roundedCorner4,\n backgroundColor: callingPalette.videoTileLabelBackgroundLight\n });\n\n const tileInfoStyle = useMemo(\n () =>\n mergeStyles(\n isVideoRendered || props.alwaysShowLabelBackground ? videoHintWithBorderRadius : disabledVideoHint,\n styles?.displayNameContainer\n ),\n [isVideoRendered, videoHintWithBorderRadius, styles?.displayNameContainer, props.alwaysShowLabelBackground]\n );\n\n const ids = useIdentifiers();\n\n const canShowLabel = showLabel && (displayName || (showMuteIndicator && isMuted));\n const participantStateString = getParticipantStateString(props, locale);\n const canShowContextMenuButton = isHovered || isFocused;\n let raisedHandBackgroundColor = '';\n raisedHandBackgroundColor = callingPalette.raiseHandGold;\n\n return (\n <Stack\n data-ui-id={ids.videoTile}\n className={mergeStyles(\n rootStyles,\n {\n background: theme.palette.neutralLighter,\n borderRadius: theme.effects.roundedCorner4\n },\n (isSpeaking || raisedHand) && {\n '&::after': {\n content: `''`,\n position: 'absolute',\n border: `0.25rem solid ${isSpeaking ? theme.palette.themePrimary : raisedHandBackgroundColor}`,\n borderRadius: theme.effects.roundedCorner4,\n width: '100%',\n height: '100%',\n pointerEvents: 'none'\n }\n },\n styles?.root\n )}\n {...longPressHandlers}\n >\n <div ref={videoTileRef} style={{ width: '100%', height: '100%' }} {...hoverHandlers} data-is-focusable={true}>\n {isVideoRendered ? (\n <Stack\n className={mergeStyles(\n videoContainerStyles,\n isMirrored && { transform: 'scaleX(-1)' },\n styles?.videoContainer\n )}\n >\n {renderElement}\n </Stack>\n ) : (\n <Stack\n className={mergeStyles(videoContainerStyles, {\n opacity: participantStateString || props.participantState === 'Idle' ? 0.4 : 1\n })}\n >\n {onRenderPlaceholder ? (\n onRenderPlaceholder(userId ?? '', placeholderOptions, DefaultPlaceholder)\n ) : (\n <DefaultPlaceholder {...placeholderOptions} />\n )}\n </Stack>\n )}\n {reactionOverlay}\n {(canShowLabel || participantStateString) && (\n <Stack horizontal className={tileInfoContainerStyle} tokens={tileInfoContainerTokens}>\n <Stack horizontal className={tileInfoStyle}>\n {canShowLabel && (\n <Text\n className={mergeStyles(displayNameStyle)}\n title={displayName}\n style={{ color: participantStateString ? theme.palette.neutralSecondary : 'inherit' }}\n data-ui-id=\"video-tile-display-name\"\n >\n {displayName}\n </Text>\n )}\n {participantStateString && (\n <Text className={mergeStyles(participantStateStringStyles(theme))}>\n {bracketedParticipantString(participantStateString, !!canShowLabel)}\n </Text>\n )}\n {showMuteIndicator && isMuted && (\n <Stack className={mergeStyles(iconContainerStyle)}>\n <Icon iconName=\"VideoTileMicOff\" />\n </Stack>\n )}\n {isSpotlighted && (\n <Stack className={mergeStyles(iconContainerStyle)}>\n <Icon iconName=\"VideoTileSpotlighted\" />\n </Stack>\n )}\n {isPinned && (\n <Stack className={mergeStyles(iconContainerStyle)}>\n <Icon iconName=\"VideoTilePinned\" className={mergeStyles(pinIconStyle)} />\n </Stack>\n )}\n <VideoTileMoreOptionsButton\n contextualMenu={contextualMenu}\n canShowContextMenuButton={canShowContextMenuButton}\n />\n </Stack>\n </Stack>\n )}\n\n {children && (\n <Stack className={mergeStyles(overlayContainerStyles, styles?.overlayContainer)}>{children}</Stack>\n )}\n {raisedHand && (\n <Stack\n horizontal={true}\n tokens={{ childrenGap: '0.2rem' }}\n className={raiseHandContainerStyles(theme, !canShowLabel)}\n >\n <Stack.Item>\n <Text>{raisedHand.raisedHandOrderPosition}</Text>\n </Stack.Item>\n <Stack.Item>\n <RaisedHandIcon />\n </Stack.Item>\n </Stack>\n )}\n </div>\n </Stack>\n );\n};\n\nconst getParticipantStateString = (props: VideoTileProps, locale: ComponentLocale): string | undefined => {\n const strings = { ...locale.strings.videoTile, ...props.strings };\n return props.participantState === 'EarlyMedia' || props.participantState === 'Ringing'\n ? strings?.participantStateRinging\n : props.participantState === 'Hold'\n ? strings?.participantStateHold\n : undefined;\n};\n\nconst tileInfoContainerTokens = {\n // A horizontal Stack sets the left margin to 0 for all it's children.\n // We need to allow the children to set their own margins\n childrenGap: 'none'\n};\n\nconst bracketedParticipantString = (participantString: string, withBrackets: boolean): string => {\n return withBrackets ? `(${participantString})` : participantString;\n};\n"]}
|
1
|
+
{"version":3,"file":"VideoTile.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/VideoTile.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,eAAe,EACf,IAAI,EACJ,UAAU,EAGV,WAAW,EACX,OAAO,EACP,KAAK,EACL,IAAI,EACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAmB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,oBAAoB,EACpB,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAqJ1D,8CAA8C;AAC9C,MAAM,2BAA2B,GAAG,GAAG,CAAC;AACxC,0CAA0C;AAC1C,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAEvC,MAAM,kBAAkB,GAAG,CAAC,KAA0B,EAAe,EAAE;IACrE,MAAM,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J,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,KAAqB,EAAE,MAAuB,EAAsB,EAAE;IACvG,MAAM,OAAO,mCAAQ,MAAM,CAAC,OAAO,CAAC,SAAS,GAAK,KAAK,CAAC,OAAO,CAAE,CAAC;IAClE,OAAO,KAAK,CAAC,gBAAgB,KAAK,YAAY,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS;QACpF,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,uBAAuB;QAClC,CAAC,CAAC,KAAK,CAAC,gBAAgB,KAAK,MAAM;YACjC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB;YAC/B,CAAC,CAAC,SAAS,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG;IAC9B,sEAAsE;IACtE,yDAAyD;IACzD,WAAW,EAAE,MAAM;CACpB,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,iBAAyB,EAAE,YAAqB,EAAU,EAAE;IAC9F,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,iBAAiB,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACrE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DirectionalHint,\n Icon,\n IconButton,\n IContextualMenuProps,\n IStyle,\n mergeStyles,\n Persona,\n Stack,\n Text\n} from '@fluentui/react';\nimport React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { ComponentLocale, useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport { BaseCustomStyles, CustomAvatarOptions, OnRenderAvatarCallback } from '../types';\nimport { CallingTheme } from '../theming';\nimport { RaisedHand } from '../types';\nimport { RaisedHandIcon } from './assets/RaisedHandIcon';\n\nimport { ParticipantState } from '../types';\nimport {\n disabledVideoHint,\n displayNameStyle,\n iconContainerStyle,\n overlayContainerStyles,\n rootStyles,\n videoContainerStyles,\n tileInfoContainerStyle,\n participantStateStringStyles\n} from './styles/VideoTile.styles';\nimport { pinIconStyle } from './styles/VideoTile.styles';\nimport useLongPress from './utils/useLongPress';\nimport { moreButtonStyles } from './styles/VideoTile.styles';\nimport { raiseHandContainerStyles } from './styles/VideoTile.styles';\nimport { ReactionResources } from '../types/ReactionTypes';\nimport { formatMoreButtonAriaDescription } from './utils';\n\n/**\n * Strings of {@link VideoTile} that can be overridden.\n * @public\n */\nexport interface VideoTileStrings {\n /** Aria label for announcing the remote video tile drawer menu */\n moreOptionsButtonAriaLabel: string;\n /** String for displaying the Ringing of the remote participant */\n participantStateRinging: string;\n /** String for displaying the Hold state of the remote participant */\n participantStateHold: string;\n /** String for the announcement of the muted state of the participant when muted */\n moreOptionsParticipantMutedStateMutedAriaLabel: string;\n /** String for the announcement of the unmuted state of the participant when unmuted */\n moreOptionsParticipantMutedStateUnmutedAriaLabel: string;\n /** String for the announcement of the participant has their hand raised */\n moreOptionsParticipantHandRaisedAriaLabel: string;\n /** String for the announcement of whether the participant is speaking or not */\n moreOptionsParticipantIsSpeakingAriaLabel: string;\n}\n\n/**\n * Fluent styles for {@link VideoTile}.\n *\n * @public\n */\nexport interface VideoTileStylesProps extends BaseCustomStyles {\n /** Styles for video container. */\n videoContainer?: IStyle;\n /** Styles for container overlayed on the video container. */\n overlayContainer?: IStyle;\n /** Styles for displayName on the video container. */\n displayNameContainer?: IStyle;\n}\n\n/**\n * Props for {@link VideoTile}.\n *\n * @public\n */\nexport interface VideoTileProps {\n /** React Child components. Child Components will show as overlay component in the VideoTile. */\n children?: React.ReactNode;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <VideoTile styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: VideoTileStylesProps;\n /** user id for the VideoTile placeholder. */\n userId?: string;\n /** Component with the video stream. */\n renderElement?: JSX.Element | null;\n /**\n * Overlay component responsible for rendering reaction\n */\n overlay?: JSX.Element | null;\n /** Determines if the video is mirrored or not. */\n isMirrored?: boolean;\n /** Custom render Component function for no video is available. Render a Persona Icon if undefined. */\n onRenderPlaceholder?: OnRenderAvatarCallback;\n /**\n * Show label on the VideoTile\n * @defaultValue true\n */\n showLabel?: boolean;\n /**\n * Show label background on the VideoTile\n * @defaultValue false\n */\n alwaysShowLabelBackground?: boolean;\n /**\n * Whether to display a mute icon beside the user's display name.\n * @defaultValue true\n */\n showMuteIndicator?: boolean;\n /**\n * Whether the video is muted or not.\n */\n isMuted?: boolean;\n /**\n * If true, the video tile will show the pin icon.\n */\n isPinned?: boolean;\n /**\n * Display Name of the Participant to be shown in the label.\n * @remarks `displayName` is used to generate avatar initials if `initialsName` is not provided.\n */\n displayName?: string;\n /**\n * Name of the participant used to generate initials. For example, a name `John Doe` will display `JD` as initials.\n * @remarks `displayName` is used if this property is not specified.\n */\n initialsName?: string;\n /**\n * Minimum size of the persona avatar in px.\n * The persona avatar is the default placeholder shown when no video stream is available.\n * For more information see https://developer.microsoft.com/en-us/fluentui#/controls/web/persona\n * @defaultValue 32px\n */\n personaMinSize?: number;\n /**\n * Maximum size of the personal avatar in px.\n * The persona avatar is the default placeholder shown when no video stream is available.\n * For more information see https://developer.microsoft.com/en-us/fluentui#/controls/web/persona\n * @defaultValue 100px\n */\n personaMaxSize?: number;\n /** Optional property to set the aria label of the video tile if there is no available stream. */\n noVideoAvailableAriaLabel?: string;\n /** Whether the participant in the videoTile is speaking. Shows a speaking indicator (border). */\n isSpeaking?: boolean;\n\n /** Whether the participant is raised hand. Show a indicator (border) and icon with order */\n raisedHand?: RaisedHand;\n\n /**\n * The call connection state of the participant.\n * For example, `Hold` means the participant is on hold.\n */\n participantState?: ParticipantState;\n /**\n * Strings to override in the component.\n */\n strings?: VideoTileStrings;\n /**\n * Display custom menu items in the VideoTile's contextual menu.\n * Uses Fluent UI ContextualMenu.\n * An ellipses icon will be displayed to open the contextual menu if this prop is defined.\n */\n contextualMenu?: IContextualMenuProps;\n /**\n * Callback triggered by video tile on touch and hold.\n */\n onLongTouch?: () => void;\n /**\n * If true, the video tile will show the spotlighted icon.\n */\n isSpotlighted?: boolean;\n /**\n * Reactions resources' url and metadata.\n */\n reactionResources?: ReactionResources;\n}\n\n// Coin max size is set to PersonaSize.size100\nconst DEFAULT_PERSONA_MAX_SIZE_PX = 100;\n// Coin min size is set PersonaSize.size32\nconst DEFAULT_PERSONA_MIN_SIZE_PX = 32;\n\nconst DefaultPlaceholder = (props: CustomAvatarOptions): JSX.Element => {\n const { text, noVideoAvailableAriaLabel, coinSize, hidePersonaDetails } = props;\n\n return (\n <Stack className={mergeStyles({ position: 'absolute', height: '100%', width: '100%' })}>\n <Stack styles={defaultPersonaStyles}>\n {coinSize && (\n <Persona\n coinSize={coinSize}\n hidePersonaDetails={hidePersonaDetails}\n text={text ?? ''}\n initialsTextColor=\"white\"\n aria-label={noVideoAvailableAriaLabel ?? ''}\n showOverflowTooltip={false}\n />\n )}\n </Stack>\n </Stack>\n );\n};\n\nconst defaultPersonaStyles = { root: { margin: 'auto', maxHeight: '100%' } };\n\nconst videoTileMoreMenuIconProps = { iconName: undefined, style: { display: 'none' } };\nconst videoTileMoreMenuProps = {\n directionalHint: DirectionalHint.topLeftEdge,\n isBeakVisible: false,\n styles: { container: { maxWidth: '8rem' } }\n};\nconst VideoTileMoreOptionsButton = (props: {\n contextualMenu?: IContextualMenuProps;\n participantDisplayName: string | undefined;\n participantState: string | undefined;\n participantHandRaised: boolean;\n participantIsSpeaking: boolean | undefined;\n participantIsMuted: boolean | undefined;\n canShowContextMenuButton: boolean;\n}): JSX.Element => {\n const locale = useLocale().strings.videoTile;\n const theme = useTheme();\n\n const {\n contextualMenu,\n canShowContextMenuButton,\n participantDisplayName,\n participantHandRaised,\n participantIsSpeaking,\n participantState,\n participantIsMuted\n } = props;\n const [moreButtonAiraDescription, setMoreButtonAriaDescription] = useState<string>('');\n\n useEffect(() => {\n setMoreButtonAriaDescription(\n formatMoreButtonAriaDescription(\n participantDisplayName,\n participantIsMuted,\n participantHandRaised,\n participantState,\n participantIsSpeaking,\n locale\n )\n );\n }, [\n participantDisplayName,\n participantHandRaised,\n participantIsMuted,\n participantIsSpeaking,\n participantState,\n locale\n ]);\n\n if (!contextualMenu) {\n return <></>;\n }\n\n const optionsIcon = canShowContextMenuButton ? 'VideoTileMoreOptions' : undefined;\n return (\n <IconButton\n data-ui-id=\"video-tile-more-options-button\"\n ariaLabel={moreButtonAiraDescription}\n styles={moreButtonStyles(theme)}\n menuIconProps={videoTileMoreMenuIconProps}\n menuProps={{ ...videoTileMoreMenuProps, ...contextualMenu }}\n iconProps={{ iconName: optionsIcon }}\n />\n );\n};\n\n/**\n * A component to render the video stream for a single call participant.\n *\n * Use with {@link GridLayout} in a {@link VideoGallery}.\n *\n * @public\n */\nexport const VideoTile = (props: VideoTileProps): JSX.Element => {\n const {\n children,\n displayName,\n initialsName,\n isMirrored,\n isMuted,\n isSpotlighted,\n isPinned,\n onRenderPlaceholder,\n renderElement,\n overlay: reactionOverlay,\n showLabel = true,\n showMuteIndicator = true,\n styles,\n userId,\n noVideoAvailableAriaLabel,\n isSpeaking,\n raisedHand,\n personaMinSize = DEFAULT_PERSONA_MIN_SIZE_PX,\n personaMaxSize = DEFAULT_PERSONA_MAX_SIZE_PX,\n contextualMenu\n } = props;\n\n const [isHovered, setIsHovered] = useState<boolean>(false);\n const [isFocused, setIsFocused] = useState<boolean>(false);\n // need to set a default otherwise the resizeObserver will get stuck in an infinite loop.\n const [personaSize, setPersonaSize] = useState<number>(1);\n\n const videoTileRef = useRef<HTMLDivElement>(null);\n\n const locale = useLocale();\n const theme = useTheme();\n const callingPalette = (theme as unknown as CallingTheme).callingPalette;\n\n const isVideoRendered = !!renderElement;\n\n const observer = useRef(\n new ResizeObserver((entries): void => {\n if (!entries[0]) {\n return;\n }\n const { width, height } = entries[0].contentRect;\n const personaCalcSize = Math.min(width, height) / 3;\n // we only want to set the persona size if it has changed\n if (personaCalcSize !== personaSize) {\n setPersonaSize(Math.max(Math.min(personaCalcSize, personaMaxSize), personaMinSize));\n }\n })\n );\n\n useLayoutEffect(() => {\n if (videoTileRef.current) {\n observer.current.observe(videoTileRef.current);\n }\n const currentObserver = observer.current;\n return () => currentObserver.disconnect();\n }, [videoTileRef]);\n\n // TODO: Remove after calling sdk fix the keybaord focus\n useEffect(() => {\n // PPTLive stream id is null\n if (videoTileRef.current?.id) {\n return;\n }\n let observer: MutationObserver | undefined;\n if (videoTileRef.current) {\n observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === 'childList') {\n const iframe = document.querySelector('iframe');\n if (iframe) {\n if (!iframe.getAttribute('tabIndex')) {\n iframe.setAttribute('tabIndex', '-1');\n }\n }\n }\n }\n });\n\n observer.observe(videoTileRef.current, { childList: true, subtree: true });\n }\n\n return () => {\n observer?.disconnect();\n };\n }, [displayName, renderElement]);\n\n const useLongPressProps = useMemo(() => {\n return {\n onLongPress: () => {\n props.onLongTouch?.();\n },\n touchEventsOnly: true\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.onLongTouch]);\n const longPressHandlers = useLongPress(useLongPressProps);\n\n const hoverHandlers = useMemo(() => {\n return {\n onMouseEnter: () => setIsHovered(true),\n onMouseLeave: () => setIsHovered(false),\n onFocus: () => setIsFocused(true),\n onBlur: () => setIsFocused(false)\n };\n }, []);\n\n const placeholderOptions = {\n userId,\n text: initialsName ?? displayName,\n noVideoAvailableAriaLabel,\n coinSize: personaSize,\n styles: defaultPersonaStyles,\n hidePersonaDetails: true\n };\n\n const videoHintWithBorderRadius = mergeStyles(disabledVideoHint, {\n borderRadius: theme.effects.roundedCorner4,\n backgroundColor: callingPalette.videoTileLabelBackgroundLight\n });\n\n const tileInfoStyle = useMemo(\n () =>\n mergeStyles(\n isVideoRendered || props.alwaysShowLabelBackground ? videoHintWithBorderRadius : disabledVideoHint,\n styles?.displayNameContainer\n ),\n [isVideoRendered, videoHintWithBorderRadius, styles?.displayNameContainer, props.alwaysShowLabelBackground]\n );\n\n const ids = useIdentifiers();\n\n const canShowLabel = showLabel && (displayName || (showMuteIndicator && isMuted));\n const participantStateString = getParticipantStateString(props, locale);\n const canShowContextMenuButton = isHovered || isFocused;\n let raisedHandBackgroundColor = '';\n raisedHandBackgroundColor = callingPalette.raiseHandGold;\n\n return (\n <Stack\n data-ui-id={ids.videoTile}\n className={mergeStyles(\n rootStyles,\n {\n background: theme.palette.neutralLighter,\n borderRadius: theme.effects.roundedCorner4\n },\n (isSpeaking || raisedHand) && {\n '&::after': {\n content: `''`,\n position: 'absolute',\n border: `0.25rem solid ${isSpeaking ? theme.palette.themePrimary : raisedHandBackgroundColor}`,\n borderRadius: theme.effects.roundedCorner4,\n width: '100%',\n height: '100%',\n pointerEvents: 'none'\n }\n },\n styles?.root\n )}\n {...longPressHandlers}\n >\n <div ref={videoTileRef} style={{ width: '100%', height: '100%' }} {...hoverHandlers} data-is-focusable={true}>\n {isVideoRendered ? (\n <Stack\n className={mergeStyles(\n videoContainerStyles,\n isMirrored && { transform: 'scaleX(-1)' },\n styles?.videoContainer\n )}\n >\n {renderElement}\n </Stack>\n ) : (\n <Stack\n className={mergeStyles(videoContainerStyles, {\n opacity: participantStateString || props.participantState === 'Idle' ? 0.4 : 1\n })}\n >\n {onRenderPlaceholder ? (\n onRenderPlaceholder(userId ?? '', placeholderOptions, DefaultPlaceholder)\n ) : (\n <DefaultPlaceholder {...placeholderOptions} />\n )}\n </Stack>\n )}\n {reactionOverlay}\n {(canShowLabel || participantStateString) && (\n <Stack horizontal className={tileInfoContainerStyle} tokens={tileInfoContainerTokens}>\n <Stack horizontal className={tileInfoStyle}>\n {canShowLabel && (\n <Text\n className={mergeStyles(displayNameStyle)}\n title={displayName}\n style={{ color: participantStateString ? theme.palette.neutralSecondary : 'inherit' }}\n data-ui-id=\"video-tile-display-name\"\n >\n {displayName}\n </Text>\n )}\n {participantStateString && (\n <Text className={mergeStyles(participantStateStringStyles(theme))}>\n {bracketedParticipantString(participantStateString, !!canShowLabel)}\n </Text>\n )}\n {showMuteIndicator && isMuted && (\n <Stack className={mergeStyles(iconContainerStyle)}>\n <Icon iconName=\"VideoTileMicOff\" />\n </Stack>\n )}\n {isSpotlighted && (\n <Stack className={mergeStyles(iconContainerStyle)}>\n <Icon iconName=\"VideoTileSpotlighted\" />\n </Stack>\n )}\n {isPinned && (\n <Stack className={mergeStyles(iconContainerStyle)}>\n <Icon iconName=\"VideoTilePinned\" className={mergeStyles(pinIconStyle)} />\n </Stack>\n )}\n <VideoTileMoreOptionsButton\n contextualMenu={contextualMenu}\n participantDisplayName={displayName}\n participantHandRaised={!!raisedHand}\n participantIsMuted={isMuted}\n participantState={participantStateString}\n participantIsSpeaking={isSpeaking}\n canShowContextMenuButton={canShowContextMenuButton}\n />\n </Stack>\n </Stack>\n )}\n\n {children && (\n <Stack className={mergeStyles(overlayContainerStyles, styles?.overlayContainer)}>{children}</Stack>\n )}\n {raisedHand && (\n <Stack\n horizontal={true}\n tokens={{ childrenGap: '0.2rem' }}\n className={raiseHandContainerStyles(theme, !canShowLabel)}\n >\n <Stack.Item>\n <Text>{raisedHand.raisedHandOrderPosition}</Text>\n </Stack.Item>\n <Stack.Item>\n <RaisedHandIcon />\n </Stack.Item>\n </Stack>\n )}\n </div>\n </Stack>\n );\n};\n\nconst getParticipantStateString = (props: VideoTileProps, locale: ComponentLocale): string | undefined => {\n const strings = { ...locale.strings.videoTile, ...props.strings };\n return props.participantState === 'EarlyMedia' || props.participantState === 'Ringing'\n ? strings?.participantStateRinging\n : props.participantState === 'Hold'\n ? strings?.participantStateHold\n : undefined;\n};\n\nconst tileInfoContainerTokens = {\n // A horizontal Stack sets the left margin to 0 for all it's children.\n // We need to allow the children to set their own margins\n childrenGap: 'none'\n};\n\nconst bracketedParticipantString = (participantString: string, withBrackets: boolean): string => {\n return withBrackets ? `(${participantString})` : participantString;\n};\n"]}
|
@@ -21,12 +21,10 @@ export const getFluentUIAttachedValue = (messageAttachedStatus) => {
|
|
21
21
|
export function getMessageBubbleContent(message, strings, userId, inlineImageOptions,
|
22
22
|
/* @conditional-compile-remove(mention) */
|
23
23
|
mentionDisplayOptions,
|
24
|
-
/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
|
25
24
|
/**
|
26
25
|
* Optional callback to render message attachments in the message component.
|
27
26
|
*/
|
28
27
|
onRenderAttachmentDownloads,
|
29
|
-
/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
|
30
28
|
/**
|
31
29
|
* Optional callback to define custom actions for attachments.
|
32
30
|
*/
|
@@ -40,27 +38,17 @@ actionsForAttachment) {
|
|
40
38
|
React.createElement(ChatMessageContent, { message: message, strings: strings,
|
41
39
|
/* @conditional-compile-remove(mention) */
|
42
40
|
mentionDisplayOptions: mentionDisplayOptions, inlineImageOptions: inlineImageOptions }),
|
43
|
-
|
41
|
+
onRenderAttachmentDownloads
|
44
42
|
? onRenderAttachmentDownloads(message)
|
45
|
-
: defaultOnRenderAttachmentDownloads(message, strings,
|
46
|
-
/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
|
47
|
-
actionsForAttachment)));
|
43
|
+
: defaultOnRenderAttachmentDownloads(message, strings, actionsForAttachment)));
|
48
44
|
}
|
49
45
|
/**
|
50
46
|
* Default component for rendering attachment downloads.
|
51
47
|
*/
|
52
|
-
/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
|
53
48
|
const defaultOnRenderAttachmentDownloads = (message, strings, actionsForAttachment) => {
|
54
49
|
var _a;
|
55
50
|
const attachments = 'attachments' in message ? message.attachments : undefined;
|
56
|
-
|
57
|
-
return ((_a = attachments === null || attachments === void 0 ? void 0 : attachments.length) !== null && _a !== void 0 ? _a : 0) > 0 ? (React.createElement(_AttachmentDownloadCards, { message: message,
|
58
|
-
/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
|
59
|
-
attachments: attachments,
|
60
|
-
/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
|
61
|
-
actionsForAttachment: actionsForAttachment,
|
62
|
-
/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
|
63
|
-
strings: {
|
51
|
+
return ((_a = attachments === null || attachments === void 0 ? void 0 : attachments.length) !== null && _a !== void 0 ? _a : 0) > 0 ? (React.createElement(_AttachmentDownloadCards, { message: message, attachments: attachments, actionsForAttachment: actionsForAttachment, strings: {
|
64
52
|
/* @conditional-compile-remove(file-sharing-acs) */
|
65
53
|
downloadAttachment: strings.downloadAttachment,
|
66
54
|
openAttachment: strings.openAttachment,
|
package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatMessageComponentUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/ChatMessageComponentUtils.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGvE,uDAAuD;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAK1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;
|
1
|
+
{"version":3,"file":"ChatMessageComponentUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/ChatMessageComponentUtils.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGvE,uDAAuD;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAK1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC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uBAAuB,GAAG,CACrC,OAA6F,EAC7F,KAAY,EACZ,SAAiB,EACQ,EAAE;IAC3B,MAAM,QAAQ,GAAG,UAAU,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,IAAI,OAAO,CAAC,WAAW,KAAK,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC/C,OAAO,6BAAK,SAAS,EAAE,yBAAyB,CAAC,KAAK,CAAC,IAAG,SAAS,CAAO,CAAC;IAC7E,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { ChatMessage, MessageAttachedStatus } from '../../types/ChatMessage';\nimport { ChatMessageContent } from '../ChatMessage/ChatMessageContent';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessageContent } from '../ChatMessage/ChatMessageContent';\nimport { InlineImageOptions } from '../ChatMessage/ChatMessageContent';\nimport { MessageThreadStrings } from '../MessageThread';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions } from '../MentionPopover';\nimport { _AttachmentDownloadCards } from '../Attachment/AttachmentDownloadCards';\nimport { AttachmentMenuAction } from '../../types/Attachment';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { formatTimeForChatMessage, formatTimestampForChatMessage } from './Datetime';\nimport { ComponentLocale } from '../../localization/LocalizationProvider';\nimport { chatMessageEditedTagStyle } from '../styles/ChatMessageComponent.styles';\nimport { Theme } from '@fluentui/react';\n\n/** @private\n * Return the string value for the FluentUI message attached prop based on the message's attached status.\n * @param attached - The message's attached status.\n */\nexport const getFluentUIAttachedValue = (\n messageAttachedStatus?: MessageAttachedStatus\n): 'bottom' | 'top' | 'center' | undefined => {\n return messageAttachedStatus === 'top' || messageAttachedStatus === false ? 'top' : 'center';\n};\n\n/**\n * @private\n * Get the message bubble content for the message.\n */\nexport function getMessageBubbleContent(\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n strings: MessageThreadStrings,\n userId: string,\n inlineImageOptions: InlineImageOptions | undefined,\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions?: MentionDisplayOptions,\n /**\n * Optional callback to render message attachments in the message component.\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element,\n /**\n * Optional callback to define custom actions for attachments.\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[]\n): JSX.Element {\n /* @conditional-compile-remove(data-loss-prevention) */\n if (message.messageType === 'blocked') {\n return (\n <div tabIndex={0}>\n <BlockedMessageContent message={message} strings={strings} />\n </div>\n );\n }\n return (\n <div className=\"ui-chat__message__content\">\n <ChatMessageContent\n message={message}\n strings={strings}\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions={mentionDisplayOptions}\n inlineImageOptions={inlineImageOptions}\n />\n {onRenderAttachmentDownloads\n ? onRenderAttachmentDownloads(message)\n : defaultOnRenderAttachmentDownloads(\n message,\n strings,\n\n actionsForAttachment\n )}\n </div>\n );\n}\n\n/**\n * Default component for rendering attachment downloads.\n */\nconst defaultOnRenderAttachmentDownloads = (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n strings: MessageThreadStrings,\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[]\n): JSX.Element | undefined => {\n const attachments = 'attachments' in message ? message.attachments : undefined;\n return (attachments?.length ?? 0) > 0 ? (\n <_AttachmentDownloadCards\n message={message as ChatMessage}\n attachments={attachments}\n actionsForAttachment={actionsForAttachment}\n strings={{\n /* @conditional-compile-remove(file-sharing-acs) */\n downloadAttachment: strings.downloadAttachment,\n openAttachment: strings.openAttachment,\n attachmentCardGroupMessage: strings.attachmentCardGroupMessage\n }}\n />\n ) : (\n <></>\n );\n return undefined;\n};\n\n/** @private */\nexport const generateDefaultTimestamp = (\n createdOn: Date,\n showDate: boolean | undefined,\n strings: MessageThreadStrings\n): string => {\n const formattedTimestamp = showDate\n ? formatTimestampForChatMessage(createdOn, new Date(), strings)\n : formatTimeForChatMessage(createdOn);\n\n return formattedTimestamp;\n};\n\n// onDisplayDateTimeString from props overwrite onDisplayDateTimeString from locale\n/** @private */\nexport const generateCustomizedTimestamp = (\n createdOn: Date,\n locale: ComponentLocale,\n onDisplayDateTimeString?: (messageDate: Date) => string\n): string => {\n /* @conditional-compile-remove(date-time-customization) */\n return onDisplayDateTimeString\n ? onDisplayDateTimeString(createdOn)\n : locale.onDisplayDateTimeString\n ? locale.onDisplayDateTimeString(createdOn)\n : '';\n\n return '';\n};\n\n/**\n * @private\n * Get the edited tag for the message if it is edited.\n */\nexport const getMessageEditedDetails = (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n theme: Theme,\n editedTag: string\n): JSX.Element | undefined => {\n const editedOn = 'editedOn' in message ? message.editedOn : undefined;\n if (message.messageType === 'chat' && editedOn) {\n return <div className={chatMessageEditedTagStyle(theme)}>{editedTag}</div>;\n }\n return undefined;\n};\n"]}
|
@@ -2,6 +2,7 @@ import { IIconProps, MessageBarType } from '@fluentui/react';
|
|
2
2
|
import { ActiveErrorMessage, ErrorType } from './ErrorBar';
|
3
3
|
import { _SupportedSpokenLanguage } from '../types';
|
4
4
|
import { ActiveNotification, NotificationType } from './NotificationStack';
|
5
|
+
import { VideoTileStrings } from './VideoTile';
|
5
6
|
/**
|
6
7
|
* @private
|
7
8
|
*
|
@@ -132,4 +133,8 @@ export declare const isEnterKeyEventFromCompositionSession: (e: KeyboardEvent) =
|
|
132
133
|
* @private
|
133
134
|
*/
|
134
135
|
export declare const nullToUndefined: <T>(value: T | null) => T | undefined;
|
136
|
+
/**
|
137
|
+
* @private
|
138
|
+
*/
|
139
|
+
export declare const formatMoreButtonAriaDescription: (displayName?: string, isMuted?: boolean, isHandRaised?: boolean, state?: string, isSpeaking?: boolean, strings?: VideoTileStrings) => string;
|
135
140
|
//# sourceMappingURL=utils.d.ts.map
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
3
|
import { MessageBarType } from '@fluentui/react';
|
4
|
+
import { _formatString } from "../../../acs-ui-common/src";
|
4
5
|
/**
|
5
6
|
* @private
|
6
7
|
*
|
@@ -340,4 +341,24 @@ e.isComposing || e.keyCode === SAFARI_COMPOSITION_KEYCODE || e.which === SAFARI_
|
|
340
341
|
* @private
|
341
342
|
*/
|
342
343
|
export const nullToUndefined = (value) => (value === null ? undefined : value);
|
344
|
+
/**
|
345
|
+
* @private
|
346
|
+
*/
|
347
|
+
export const formatMoreButtonAriaDescription = (displayName, isMuted, isHandRaised, state, isSpeaking, strings) => {
|
348
|
+
const mutedState = isMuted
|
349
|
+
? strings === null || strings === void 0 ? void 0 : strings.moreOptionsParticipantMutedStateMutedAriaLabel
|
350
|
+
: strings === null || strings === void 0 ? void 0 : strings.moreOptionsParticipantMutedStateUnmutedAriaLabel;
|
351
|
+
const handRaisedState = isHandRaised ? strings === null || strings === void 0 ? void 0 : strings.moreOptionsParticipantHandRaisedAriaLabel : undefined;
|
352
|
+
const isSpeakingState = isSpeaking ? strings === null || strings === void 0 ? void 0 : strings.moreOptionsParticipantIsSpeakingAriaLabel : undefined;
|
353
|
+
const description = (strings === null || strings === void 0 ? void 0 : strings.moreOptionsButtonAriaLabel)
|
354
|
+
? _formatString(strings === null || strings === void 0 ? void 0 : strings.moreOptionsButtonAriaLabel, {
|
355
|
+
displayName: displayName !== null && displayName !== void 0 ? displayName : ' ',
|
356
|
+
isMuted: mutedState !== null && mutedState !== void 0 ? mutedState : ' ',
|
357
|
+
isHandRaised: handRaisedState !== null && handRaisedState !== void 0 ? handRaisedState : ' ',
|
358
|
+
state: state !== null && state !== void 0 ? state : ' ',
|
359
|
+
isSpeaking: isSpeakingState !== null && isSpeakingState !== void 0 ? isSpeakingState : ' '
|
360
|
+
})
|
361
|
+
: '';
|
362
|
+
return description;
|
363
|
+
};
|
343
364
|
//# sourceMappingURL=utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAc,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAK7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAU,EAAE;IAC5E,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC5F,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;AAoBvF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,eAAiC,EAAE,SAA6B,EAAoB,EAAE;;IACjH,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;YAClC,gEAAgE;YAChE,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC;YACxB,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC;YACxC,OAAO,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC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AC,MAAM,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAI,OAAY,EAAE,WAAmB;IACxD,MAAM,IAAI,GAAU,EAAE,CAAC;IACvB,IAAI,UAAU,GAAQ,EAAE,CAAC;IACzB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxB,IAAI,UAAU,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YACtC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACtB,UAAU,GAAG,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IACD,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA6B,OAAO,CAAC;AAEvE;;GAEG;AACH,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAgB,EAAW,EAAE;AACjF,oIAAoI;AACpI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,OAAO,KAAK,0BAA0B,IAAI,CAAC,CAAC,KAAK,KAAK,0BAA0B,CAAC;AAEtG;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAI,KAAe,EAAiB,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IIconProps, MessageBarType } from '@fluentui/react';\nimport { ActiveErrorMessage, ErrorType } from './ErrorBar';\nimport { _SupportedSpokenLanguage } from '../types';\nimport { ActiveNotification, NotificationType } from './NotificationStack';\n\n/**\n * @private\n *\n * @param fileName\n * @param length\n * @returns string\n */\nexport const truncatedFileName = (fileName: string, length: number): string => {\n return fileName.substring(0, length).trimEnd() + (fileName.length > length ? '... ' : '');\n};\n\n/**\n * @private\n *\n * @param fileName\n * @returns string\n */\nexport const extension = (fileName: string): string => fileName.split('.').pop() || '';\n\n/**\n * @private\n */\nexport interface DismissedError {\n type: ErrorType;\n dismissedAt: Date;\n activeSince?: Date;\n}\n\n/**\n * @private\n */\nexport interface DismissedNotification {\n type: NotificationType;\n dismissedAt: Date;\n activeSince?: Date;\n}\n\n/**\n * @private\n * @param dismissedErrors\n * @param toDismiss\n * @returns DismissedError[]\n * Always returns a new Array so that the state variable is updated, trigerring a render.\n */\nexport const dismissError = (dismissedErrors: DismissedError[], toDismiss: ActiveErrorMessage): DismissedError[] => {\n const now = new Date(Date.now());\n for (const error of dismissedErrors) {\n if (error.type === toDismiss.type) {\n // Bump the timestamp for latest dismissal of this error to now.\n error.dismissedAt = now;\n error.activeSince = toDismiss.timestamp;\n return Array.from(dismissedErrors);\n }\n }\n\n const toDismissTimestamp = toDismiss.timestamp ?? now;\n\n // Record that this error was dismissed for the first time right now.\n return [\n ...dismissedErrors,\n {\n type: toDismiss.type,\n // the error time could be sometimes later than the button click time, which cause the dismiss not working\n // so we set the dismiss time to the later one\n dismissedAt: now > toDismissTimestamp ? now : toDismissTimestamp,\n activeSince: toDismiss.timestamp\n }\n ];\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns DismissedError[]\n * Returns a new Array if and only if contents change, to avoid re-rendering when nothing was dropped.\n */\nexport const dropDismissalsForInactiveErrors = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[]\n): DismissedError[] => {\n const active = new Map();\n for (const message of activeErrorMessages) {\n active.set(message.type, message);\n }\n\n // For an error such that:\n // * It was previously active, and dismissed.\n // * It did not have a timestamp associated with it.\n // * It is no longer active.\n //\n // We remove it from dismissals. When it becomes active again next time, it will be shown again on the UI.\n const shouldDeleteDismissal = (dismissed: DismissedError): boolean =>\n dismissed.activeSince === undefined && active.get(dismissed.type) === undefined;\n\n if (dismissedErrors.some((dismissed) => shouldDeleteDismissal(dismissed))) {\n return dismissedErrors.filter((dismissed) => !shouldDeleteDismissal(dismissed));\n }\n return dismissedErrors;\n};\n\n/**\n * @private\n * @param dismissedNotifications\n * @param toDismiss\n * @returns DismissedNotification[]\n * Always returns a new Array so that the state variable is updated, trigerring a render.\n */\nexport const dismissNotification = (\n dismissedNotifications: DismissedNotification[],\n toDismiss: ActiveNotification\n): DismissedNotification[] => {\n const now = new Date(Date.now());\n for (const notification of dismissedNotifications) {\n if (notification.type === toDismiss.type) {\n // Bump the timestamp for latest dismissal of this error to now.\n notification.dismissedAt = now;\n notification.activeSince = toDismiss.timestamp;\n return Array.from(dismissedNotifications);\n }\n }\n\n const toDismissTimestamp = toDismiss.timestamp ?? now;\n\n // Record that this error was dismissed for the first time right now.\n return [\n ...dismissedNotifications,\n {\n type: toDismiss.type,\n // the error time could be sometimes later than the button click time, which cause the dismiss not working\n // so we set the dismiss time to the later one\n dismissedAt: now > toDismissTimestamp ? now : toDismissTimestamp,\n activeSince: toDismiss.timestamp\n }\n ];\n};\n\n/**\n * @private\n * @param activeNotifications\n * @param dismissedNotifications\n * @returns DismissedError[]\n * Returns a new Array if and only if contents change, to avoid re-rendering when nothing was dropped.\n */\nexport const dropDismissalsForInactiveNotifications = (\n activeNotifications: ActiveNotification[],\n dismissedNotifications: DismissedNotification[]\n): DismissedNotification[] => {\n const active = new Map();\n for (const message of activeNotifications) {\n active.set(message.type, message);\n }\n\n // For an error such that:\n // * It was previously active, and dismissed.\n // * It did not have a timestamp associated with it.\n // * It is no longer active.\n //\n // We remove it from dismissals. When it becomes active again next time, it will be shown again on the UI.\n const shouldDeleteDismissal = (dismissed: DismissedNotification): boolean =>\n dismissed.activeSince === undefined && active.get(dismissed.type) === undefined;\n\n if (dismissedNotifications.some((dismissed) => shouldDeleteDismissal(dismissed))) {\n return dismissedNotifications.filter((dismissed) => !shouldDeleteDismissal(dismissed));\n }\n return dismissedNotifications;\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns ActiveErrorMessage[]\n */\nexport const errorsToShow = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[],\n mountTimestamp?: Date\n): ActiveErrorMessage[] => {\n const dismissed: Map<ErrorType, DismissedError> = new Map();\n for (const error of dismissedErrors) {\n dismissed.set(error.type, error);\n }\n\n return activeErrorMessages.filter((error) => {\n if (mountTimestamp && error.timestamp && mountTimestamp > error.timestamp) {\n // Error has a timestamp and it is older than when the component was mounted.\n return false;\n }\n\n const dismissal = dismissed.get(error.type);\n if (!dismissal) {\n // This error was never dismissed.\n return true;\n }\n if (!error.timestamp) {\n // No timestamp associated with the error. In this case, the existence of a dismissal is enough to suppress the error.\n return false;\n }\n // Error has an associated timestamp, so compare with last dismissal.\n return error.timestamp > dismissal.dismissedAt;\n });\n};\n\n/**\n * @private\n * @param activeNotifications\n * @param dismissedNotifications\n * @returns ActiveNotification[]\n */\nexport const notificationsToShow = (\n activeNotifications: ActiveNotification[],\n dismissedNotifications: DismissedNotification[],\n mountTimestamp?: Date\n): ActiveNotification[] => {\n const dismissed: Map<NotificationType, DismissedNotification> = new Map();\n for (const notification of dismissedNotifications) {\n dismissed.set(notification.type, notification);\n }\n\n return activeNotifications.filter((notification) => {\n if (mountTimestamp && notification.timestamp && mountTimestamp > notification.timestamp) {\n // Notification has a timestamp and it is older than when the component was mounted.\n return false;\n }\n\n const dismissal = dismissed.get(notification.type);\n if (!dismissal) {\n // This error was never dismissed.\n return true;\n }\n if (!notification.timestamp) {\n // No timestamp associated with the error. In this case, the existence of a dismissal is enough to suppress the error.\n return false;\n }\n // Error has an associated timestamp, so compare with last dismissal.\n return notification.timestamp > dismissal.dismissedAt;\n });\n};\n\n/**\n * @private\n * @param errorType\n * @returns MessageBarType\n */\nexport const messageBarType = (errorType: ErrorType): MessageBarType => {\n switch (errorType) {\n case 'callNetworkQualityLow':\n case 'callNoSpeakerFound':\n case 'callNoMicrophoneFound':\n case 'callMicrophoneAccessDenied':\n case 'callMicrophoneAccessDeniedSafari':\n case 'callMicrophoneMutedBySystem':\n case 'callMicrophoneUnmutedBySystem':\n case 'callMacOsMicrophoneAccessDenied':\n case 'callLocalVideoFreeze':\n case 'callCameraAccessDenied':\n case 'callCameraAccessDeniedSafari':\n case 'callCameraAlreadyInUse':\n case 'callVideoStoppedBySystem':\n case 'callVideoRecoveredBySystem':\n case 'callMacOsCameraAccessDenied':\n case 'callMacOsScreenShareAccessDenied':\n case 'startScreenShareGeneric':\n case 'cameraFrozenForRemoteParticipants':\n return MessageBarType.warning;\n default:\n return MessageBarType.error;\n }\n};\n\n/**\n * @private\n * @param errorType\n * @returns IIconProps | undefined\n */\nexport const messageBarIconProps = (errorType: ErrorType): IIconProps | undefined => {\n const iconName = customIconName[errorType];\n return iconName ? { iconName } : undefined;\n};\n\n/**\n * @private\n */\nexport const customIconName: Partial<{ [key in ErrorType]: string }> = {\n callNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',\n callNoSpeakerFound: 'ErrorBarCallNoSpeakerFound',\n callNoMicrophoneFound: 'ErrorBarCallNoMicrophoneFound',\n callMicrophoneAccessDenied: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneAccessDeniedSafari: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneMutedBySystem: 'ErrorBarCallMicrophoneMutedBySystem',\n callMicrophoneUnmutedBySystem: 'ErrorBarCallMicrophoneUnmutedBySystem',\n callMacOsMicrophoneAccessDenied: 'ErrorBarCallMacOsMicrophoneAccessDenied',\n callLocalVideoFreeze: 'ErrorBarCallLocalVideoFreeze',\n callCameraAccessDenied: 'ErrorBarCallCameraAccessDenied',\n callCameraAccessDeniedSafari: 'ErrorBarCallCameraAccessDenied',\n callCameraAlreadyInUse: 'ErrorBarCallCameraAlreadyInUse',\n callVideoStoppedBySystem: 'ErrorBarCallVideoStoppedBySystem',\n callVideoRecoveredBySystem: 'ErrorBarCallVideoRecoveredBySystem',\n callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied'\n};\n\n/**\n * @private\n * @param NotificationType\n * @returns IIconProps | undefined\n */\nexport const NotificationIconProps = (notificationType: NotificationType): IIconProps | undefined => {\n const iconName = customNotificationIconName[notificationType];\n return iconName ? { iconName } : undefined;\n};\n\n/**\n * @private\n */\nexport const customNotificationIconName: Partial<{ [key in NotificationType]: string }> = {\n callNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',\n teamsMeetingCallNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',\n callNoSpeakerFound: 'ErrorBarCallNoSpeakerFound',\n callNoMicrophoneFound: 'ErrorBarCallNoMicrophoneFound',\n callMicrophoneAccessDenied: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneAccessDeniedSafari: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneMutedBySystem: 'ErrorBarCallMicrophoneMutedBySystem',\n callMicrophoneUnmutedBySystem: 'ErrorBarCallMicrophoneUnmutedBySystem',\n callMacOsMicrophoneAccessDenied: 'ErrorBarCallMacOsMicrophoneAccessDenied',\n callLocalVideoFreeze: 'ErrorBarCallLocalVideoFreeze',\n callCameraAccessDenied: 'ErrorBarCallCameraAccessDenied',\n callCameraAccessDeniedSafari: 'ErrorBarCallCameraAccessDenied',\n callCameraAlreadyInUse: 'ErrorBarCallCameraAlreadyInUse',\n callVideoStoppedBySystem: 'ErrorBarCallVideoStoppedBySystem',\n callVideoRecoveredBySystem: 'ErrorBarCallVideoRecoveredBySystem',\n callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied',\n mutedByRemoteParticipant: 'ErrorBarMutedByRemoteParticipant',\n speakingWhileMuted: 'ErrorBarCallMicrophoneMutedBySystem',\n recordingStarted: 'NotificationBarRecording',\n transcriptionStarted: 'NotificationBarRecording',\n recordingStopped: 'NotificationBarRecording',\n transcriptionStopped: 'NotificationBarRecording',\n recordingAndTranscriptionStarted: 'NotificationBarRecording',\n recordingAndTranscriptionStopped: 'NotificationBarRecording',\n recordingStoppedStillTranscribing: 'NotificationBarRecording',\n transcriptionStoppedStillRecording: 'NotificationBarRecording',\n /* @conditional-compile-remove(breakout-rooms) */\n assignedBreakoutRoomOpened: 'NotificationBarBreakoutRoomOpened',\n /* @conditional-compile-remove(breakout-rooms) */\n assignedBreakoutRoomOpenedPromptJoin: 'NotificationBarBreakoutRoomPromptJoin',\n /* @conditional-compile-remove(breakout-rooms) */\n assignedBreakoutRoomChanged: 'NotificationBarBreakoutRoomChanged',\n /* @conditional-compile-remove(breakout-rooms) */\n breakoutRoomJoined: 'NotificationBarBreakoutRoomJoined',\n /* @conditional-compile-remove(breakout-rooms) */\n breakoutRoomClosingSoon: 'NotificationBarBreakoutRoomClosingSoon'\n};\n\n/**\n * @private\n */\nexport const isValidString = (string: string | undefined): string is string => {\n return !!string && string.length > 0;\n};\n\n/**\n * Chunk an array into rows of a given size.\n * @private\n */\nexport function chunk<T>(options: T[], itemsPerRow: number): T[][] {\n const rows: T[][] = [];\n let currentRow: T[] = [];\n for (const option of options) {\n currentRow.push(option);\n if (currentRow.length === itemsPerRow) {\n rows.push(currentRow);\n currentRow = [];\n }\n }\n if (currentRow.length > 0) {\n rows.push(currentRow);\n }\n return rows;\n}\n\n/**\n * @private\n */\nexport const defaultSpokenLanguage: _SupportedSpokenLanguage = 'en-us';\n\n/**\n * @private\n */\nconst SAFARI_COMPOSITION_KEYCODE = 229;\n/**\n * Determine if the press of the enter key is from a composition session or not (Safari only)\n *\n * @private\n */\nexport const isEnterKeyEventFromCompositionSession = (e: KeyboardEvent): boolean =>\n // Uses KeyCode 229 and which code 229 to determine if the press of the enter key is from a composition session or not (Safari only)\n e.isComposing || e.keyCode === SAFARI_COMPOSITION_KEYCODE || e.which === SAFARI_COMPOSITION_KEYCODE;\n\n/**\n * @private\n */\nexport const nullToUndefined = <T>(value: T | null): T | undefined => (value === null ? undefined : value);\n"]}
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAc,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAK7D,OAAO,EAAE,aAAa,EAAE,mCAAgC;AAExD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAU,EAAE;IAC5E,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC5F,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;AAoBvF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,eAAiC,EAAE,SAA6B,EAAoB,EAAE;;IACjH,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;YAClC,gEAAgE;YAChE,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC;YACxB,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC;YACxC,OAAO,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,MAAM,kBAAkB,GAAG,MAAA,SAAS,CAAC,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QACzD,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gDAAgD,CAAC;IAC9D,MAAM,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,yCAAyC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtG,MAAM,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,yCAAyC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEpG,MAAM,WAAW,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,0BAA0B;QACrD,CAAC,CAAC,aAAa,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,0BAA0B,EAAE;YACjD,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,GAAG;YAC/B,OAAO,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,GAAG;YAC1B,YAAY,EAAE,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,GAAG;YACpC,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,GAAG;YACnB,UAAU,EAAE,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,GAAG;SACnC,CAAC;QACJ,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IIconProps, MessageBarType } from '@fluentui/react';\nimport { ActiveErrorMessage, ErrorType } from './ErrorBar';\nimport { _SupportedSpokenLanguage } from '../types';\nimport { ActiveNotification, NotificationType } from './NotificationStack';\nimport { VideoTileStrings } from './VideoTile';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/**\n * @private\n *\n * @param fileName\n * @param length\n * @returns string\n */\nexport const truncatedFileName = (fileName: string, length: number): string => {\n return fileName.substring(0, length).trimEnd() + (fileName.length > length ? '... ' : '');\n};\n\n/**\n * @private\n *\n * @param fileName\n * @returns string\n */\nexport const extension = (fileName: string): string => fileName.split('.').pop() || '';\n\n/**\n * @private\n */\nexport interface DismissedError {\n type: ErrorType;\n dismissedAt: Date;\n activeSince?: Date;\n}\n\n/**\n * @private\n */\nexport interface DismissedNotification {\n type: NotificationType;\n dismissedAt: Date;\n activeSince?: Date;\n}\n\n/**\n * @private\n * @param dismissedErrors\n * @param toDismiss\n * @returns DismissedError[]\n * Always returns a new Array so that the state variable is updated, trigerring a render.\n */\nexport const dismissError = (dismissedErrors: DismissedError[], toDismiss: ActiveErrorMessage): DismissedError[] => {\n const now = new Date(Date.now());\n for (const error of dismissedErrors) {\n if (error.type === toDismiss.type) {\n // Bump the timestamp for latest dismissal of this error to now.\n error.dismissedAt = now;\n error.activeSince = toDismiss.timestamp;\n return Array.from(dismissedErrors);\n }\n }\n\n const toDismissTimestamp = toDismiss.timestamp ?? now;\n\n // Record that this error was dismissed for the first time right now.\n return [\n ...dismissedErrors,\n {\n type: toDismiss.type,\n // the error time could be sometimes later than the button click time, which cause the dismiss not working\n // so we set the dismiss time to the later one\n dismissedAt: now > toDismissTimestamp ? now : toDismissTimestamp,\n activeSince: toDismiss.timestamp\n }\n ];\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns DismissedError[]\n * Returns a new Array if and only if contents change, to avoid re-rendering when nothing was dropped.\n */\nexport const dropDismissalsForInactiveErrors = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[]\n): DismissedError[] => {\n const active = new Map();\n for (const message of activeErrorMessages) {\n active.set(message.type, message);\n }\n\n // For an error such that:\n // * It was previously active, and dismissed.\n // * It did not have a timestamp associated with it.\n // * It is no longer active.\n //\n // We remove it from dismissals. When it becomes active again next time, it will be shown again on the UI.\n const shouldDeleteDismissal = (dismissed: DismissedError): boolean =>\n dismissed.activeSince === undefined && active.get(dismissed.type) === undefined;\n\n if (dismissedErrors.some((dismissed) => shouldDeleteDismissal(dismissed))) {\n return dismissedErrors.filter((dismissed) => !shouldDeleteDismissal(dismissed));\n }\n return dismissedErrors;\n};\n\n/**\n * @private\n * @param dismissedNotifications\n * @param toDismiss\n * @returns DismissedNotification[]\n * Always returns a new Array so that the state variable is updated, trigerring a render.\n */\nexport const dismissNotification = (\n dismissedNotifications: DismissedNotification[],\n toDismiss: ActiveNotification\n): DismissedNotification[] => {\n const now = new Date(Date.now());\n for (const notification of dismissedNotifications) {\n if (notification.type === toDismiss.type) {\n // Bump the timestamp for latest dismissal of this error to now.\n notification.dismissedAt = now;\n notification.activeSince = toDismiss.timestamp;\n return Array.from(dismissedNotifications);\n }\n }\n\n const toDismissTimestamp = toDismiss.timestamp ?? now;\n\n // Record that this error was dismissed for the first time right now.\n return [\n ...dismissedNotifications,\n {\n type: toDismiss.type,\n // the error time could be sometimes later than the button click time, which cause the dismiss not working\n // so we set the dismiss time to the later one\n dismissedAt: now > toDismissTimestamp ? now : toDismissTimestamp,\n activeSince: toDismiss.timestamp\n }\n ];\n};\n\n/**\n * @private\n * @param activeNotifications\n * @param dismissedNotifications\n * @returns DismissedError[]\n * Returns a new Array if and only if contents change, to avoid re-rendering when nothing was dropped.\n */\nexport const dropDismissalsForInactiveNotifications = (\n activeNotifications: ActiveNotification[],\n dismissedNotifications: DismissedNotification[]\n): DismissedNotification[] => {\n const active = new Map();\n for (const message of activeNotifications) {\n active.set(message.type, message);\n }\n\n // For an error such that:\n // * It was previously active, and dismissed.\n // * It did not have a timestamp associated with it.\n // * It is no longer active.\n //\n // We remove it from dismissals. When it becomes active again next time, it will be shown again on the UI.\n const shouldDeleteDismissal = (dismissed: DismissedNotification): boolean =>\n dismissed.activeSince === undefined && active.get(dismissed.type) === undefined;\n\n if (dismissedNotifications.some((dismissed) => shouldDeleteDismissal(dismissed))) {\n return dismissedNotifications.filter((dismissed) => !shouldDeleteDismissal(dismissed));\n }\n return dismissedNotifications;\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns ActiveErrorMessage[]\n */\nexport const errorsToShow = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[],\n mountTimestamp?: Date\n): ActiveErrorMessage[] => {\n const dismissed: Map<ErrorType, DismissedError> = new Map();\n for (const error of dismissedErrors) {\n dismissed.set(error.type, error);\n }\n\n return activeErrorMessages.filter((error) => {\n if (mountTimestamp && error.timestamp && mountTimestamp > error.timestamp) {\n // Error has a timestamp and it is older than when the component was mounted.\n return false;\n }\n\n const dismissal = dismissed.get(error.type);\n if (!dismissal) {\n // This error was never dismissed.\n return true;\n }\n if (!error.timestamp) {\n // No timestamp associated with the error. In this case, the existence of a dismissal is enough to suppress the error.\n return false;\n }\n // Error has an associated timestamp, so compare with last dismissal.\n return error.timestamp > dismissal.dismissedAt;\n });\n};\n\n/**\n * @private\n * @param activeNotifications\n * @param dismissedNotifications\n * @returns ActiveNotification[]\n */\nexport const notificationsToShow = (\n activeNotifications: ActiveNotification[],\n dismissedNotifications: DismissedNotification[],\n mountTimestamp?: Date\n): ActiveNotification[] => {\n const dismissed: Map<NotificationType, DismissedNotification> = new Map();\n for (const notification of dismissedNotifications) {\n dismissed.set(notification.type, notification);\n }\n\n return activeNotifications.filter((notification) => {\n if (mountTimestamp && notification.timestamp && mountTimestamp > notification.timestamp) {\n // Notification has a timestamp and it is older than when the component was mounted.\n return false;\n }\n\n const dismissal = dismissed.get(notification.type);\n if (!dismissal) {\n // This error was never dismissed.\n return true;\n }\n if (!notification.timestamp) {\n // No timestamp associated with the error. In this case, the existence of a dismissal is enough to suppress the error.\n return false;\n }\n // Error has an associated timestamp, so compare with last dismissal.\n return notification.timestamp > dismissal.dismissedAt;\n });\n};\n\n/**\n * @private\n * @param errorType\n * @returns MessageBarType\n */\nexport const messageBarType = (errorType: ErrorType): MessageBarType => {\n switch (errorType) {\n case 'callNetworkQualityLow':\n case 'callNoSpeakerFound':\n case 'callNoMicrophoneFound':\n case 'callMicrophoneAccessDenied':\n case 'callMicrophoneAccessDeniedSafari':\n case 'callMicrophoneMutedBySystem':\n case 'callMicrophoneUnmutedBySystem':\n case 'callMacOsMicrophoneAccessDenied':\n case 'callLocalVideoFreeze':\n case 'callCameraAccessDenied':\n case 'callCameraAccessDeniedSafari':\n case 'callCameraAlreadyInUse':\n case 'callVideoStoppedBySystem':\n case 'callVideoRecoveredBySystem':\n case 'callMacOsCameraAccessDenied':\n case 'callMacOsScreenShareAccessDenied':\n case 'startScreenShareGeneric':\n case 'cameraFrozenForRemoteParticipants':\n return MessageBarType.warning;\n default:\n return MessageBarType.error;\n }\n};\n\n/**\n * @private\n * @param errorType\n * @returns IIconProps | undefined\n */\nexport const messageBarIconProps = (errorType: ErrorType): IIconProps | undefined => {\n const iconName = customIconName[errorType];\n return iconName ? { iconName } : undefined;\n};\n\n/**\n * @private\n */\nexport const customIconName: Partial<{ [key in ErrorType]: string }> = {\n callNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',\n callNoSpeakerFound: 'ErrorBarCallNoSpeakerFound',\n callNoMicrophoneFound: 'ErrorBarCallNoMicrophoneFound',\n callMicrophoneAccessDenied: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneAccessDeniedSafari: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneMutedBySystem: 'ErrorBarCallMicrophoneMutedBySystem',\n callMicrophoneUnmutedBySystem: 'ErrorBarCallMicrophoneUnmutedBySystem',\n callMacOsMicrophoneAccessDenied: 'ErrorBarCallMacOsMicrophoneAccessDenied',\n callLocalVideoFreeze: 'ErrorBarCallLocalVideoFreeze',\n callCameraAccessDenied: 'ErrorBarCallCameraAccessDenied',\n callCameraAccessDeniedSafari: 'ErrorBarCallCameraAccessDenied',\n callCameraAlreadyInUse: 'ErrorBarCallCameraAlreadyInUse',\n callVideoStoppedBySystem: 'ErrorBarCallVideoStoppedBySystem',\n callVideoRecoveredBySystem: 'ErrorBarCallVideoRecoveredBySystem',\n callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied'\n};\n\n/**\n * @private\n * @param NotificationType\n * @returns IIconProps | undefined\n */\nexport const NotificationIconProps = (notificationType: NotificationType): IIconProps | undefined => {\n const iconName = customNotificationIconName[notificationType];\n return iconName ? { iconName } : undefined;\n};\n\n/**\n * @private\n */\nexport const customNotificationIconName: Partial<{ [key in NotificationType]: string }> = {\n callNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',\n teamsMeetingCallNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',\n callNoSpeakerFound: 'ErrorBarCallNoSpeakerFound',\n callNoMicrophoneFound: 'ErrorBarCallNoMicrophoneFound',\n callMicrophoneAccessDenied: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneAccessDeniedSafari: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneMutedBySystem: 'ErrorBarCallMicrophoneMutedBySystem',\n callMicrophoneUnmutedBySystem: 'ErrorBarCallMicrophoneUnmutedBySystem',\n callMacOsMicrophoneAccessDenied: 'ErrorBarCallMacOsMicrophoneAccessDenied',\n callLocalVideoFreeze: 'ErrorBarCallLocalVideoFreeze',\n callCameraAccessDenied: 'ErrorBarCallCameraAccessDenied',\n callCameraAccessDeniedSafari: 'ErrorBarCallCameraAccessDenied',\n callCameraAlreadyInUse: 'ErrorBarCallCameraAlreadyInUse',\n callVideoStoppedBySystem: 'ErrorBarCallVideoStoppedBySystem',\n callVideoRecoveredBySystem: 'ErrorBarCallVideoRecoveredBySystem',\n callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied',\n mutedByRemoteParticipant: 'ErrorBarMutedByRemoteParticipant',\n speakingWhileMuted: 'ErrorBarCallMicrophoneMutedBySystem',\n recordingStarted: 'NotificationBarRecording',\n transcriptionStarted: 'NotificationBarRecording',\n recordingStopped: 'NotificationBarRecording',\n transcriptionStopped: 'NotificationBarRecording',\n recordingAndTranscriptionStarted: 'NotificationBarRecording',\n recordingAndTranscriptionStopped: 'NotificationBarRecording',\n recordingStoppedStillTranscribing: 'NotificationBarRecording',\n transcriptionStoppedStillRecording: 'NotificationBarRecording',\n /* @conditional-compile-remove(breakout-rooms) */\n assignedBreakoutRoomOpened: 'NotificationBarBreakoutRoomOpened',\n /* @conditional-compile-remove(breakout-rooms) */\n assignedBreakoutRoomOpenedPromptJoin: 'NotificationBarBreakoutRoomPromptJoin',\n /* @conditional-compile-remove(breakout-rooms) */\n assignedBreakoutRoomChanged: 'NotificationBarBreakoutRoomChanged',\n /* @conditional-compile-remove(breakout-rooms) */\n breakoutRoomJoined: 'NotificationBarBreakoutRoomJoined',\n /* @conditional-compile-remove(breakout-rooms) */\n breakoutRoomClosingSoon: 'NotificationBarBreakoutRoomClosingSoon'\n};\n\n/**\n * @private\n */\nexport const isValidString = (string: string | undefined): string is string => {\n return !!string && string.length > 0;\n};\n\n/**\n * Chunk an array into rows of a given size.\n * @private\n */\nexport function chunk<T>(options: T[], itemsPerRow: number): T[][] {\n const rows: T[][] = [];\n let currentRow: T[] = [];\n for (const option of options) {\n currentRow.push(option);\n if (currentRow.length === itemsPerRow) {\n rows.push(currentRow);\n currentRow = [];\n }\n }\n if (currentRow.length > 0) {\n rows.push(currentRow);\n }\n return rows;\n}\n\n/**\n * @private\n */\nexport const defaultSpokenLanguage: _SupportedSpokenLanguage = 'en-us';\n\n/**\n * @private\n */\nconst SAFARI_COMPOSITION_KEYCODE = 229;\n/**\n * Determine if the press of the enter key is from a composition session or not (Safari only)\n *\n * @private\n */\nexport const isEnterKeyEventFromCompositionSession = (e: KeyboardEvent): boolean =>\n // Uses KeyCode 229 and which code 229 to determine if the press of the enter key is from a composition session or not (Safari only)\n e.isComposing || e.keyCode === SAFARI_COMPOSITION_KEYCODE || e.which === SAFARI_COMPOSITION_KEYCODE;\n\n/**\n * @private\n */\nexport const nullToUndefined = <T>(value: T | null): T | undefined => (value === null ? undefined : value);\n\n/**\n * @private\n */\nexport const formatMoreButtonAriaDescription = (\n displayName?: string,\n isMuted?: boolean,\n isHandRaised?: boolean,\n state?: string,\n isSpeaking?: boolean,\n strings?: VideoTileStrings\n): string => {\n const mutedState = isMuted\n ? strings?.moreOptionsParticipantMutedStateMutedAriaLabel\n : strings?.moreOptionsParticipantMutedStateUnmutedAriaLabel;\n const handRaisedState = isHandRaised ? strings?.moreOptionsParticipantHandRaisedAriaLabel : undefined;\n const isSpeakingState = isSpeaking ? strings?.moreOptionsParticipantIsSpeakingAriaLabel : undefined;\n\n const description = strings?.moreOptionsButtonAriaLabel\n ? _formatString(strings?.moreOptionsButtonAriaLabel, {\n displayName: displayName ?? ' ',\n isMuted: mutedState ?? ' ',\n isHandRaised: handRaisedState ?? ' ',\n state: state ?? ' ',\n isSpeaking: isSpeakingState ?? ' '\n })\n : '';\n\n return description;\n};\n"]}
|
@@ -525,7 +525,11 @@
|
|
525
525
|
"videoTile": {
|
526
526
|
"participantStateRinging": "Calling...",
|
527
527
|
"participantStateHold": "On hold",
|
528
|
-
"moreOptionsButtonAriaLabel": "More Options"
|
528
|
+
"moreOptionsButtonAriaLabel": "More Options {displayName} {isMuted} {isHandRaised} {state} {isSpeaking}",
|
529
|
+
"moreOptionsParticipantMutedStateMutedAriaLabel": "muted",
|
530
|
+
"moreOptionsParticipantMutedStateUnmutedAriaLabel": "unmuted",
|
531
|
+
"moreOptionsParticipantHandRaisedAriaLabel": "Hand raised",
|
532
|
+
"moreOptionsParticipantIsSpeakingAriaLabel": "Speaking"
|
529
533
|
},
|
530
534
|
"CameraAndMicrophoneSitePermissionsRequest": {
|
531
535
|
"primaryText": "Allow {appName} to use your camera and microphone",
|
@@ -3,40 +3,24 @@
|
|
3
3
|
import { mergeStyles } from '@fluentui/react';
|
4
4
|
/* @conditional-compile-remove(call-readiness) */ /* @conditional-compile-remove(unsupported-browser) */
|
5
5
|
import { Stack } from '@fluentui/react';
|
6
|
-
import { ArrowClockwise16Regular, CallEnd20Filled, Checkmark20Regular, CheckmarkCircle16Regular, Circle16Regular,
|
7
|
-
import { MicOff16Regular } from '@fluentui/react-icons';
|
6
|
+
import { ArrowClockwise16Regular, Backspace20Regular, Call20Filled, CallEnd20Filled, CallPause20Filled, CallPause20Regular, Checkmark20Regular, CheckmarkCircle16Regular, ChevronLeft20Regular, ChevronRight20Regular, Circle16Regular, ClosedCaption20Regular, ClosedCaptionOff20Regular, Delete20Regular, Dismiss16Regular, Dismiss20Regular, Edit20Regular, Emoji20Regular, ErrorCircle16Regular, Eye16Regular, HandRight20Regular, HandRightOff20Regular, Mic16Filled, Mic20Filled, Mic20Regular, MicOff16Filled, MicOff16Regular, MicOff20Filled, MicOff20Regular, MicProhibited16Filled, MoreHorizontal20Filled, MoreHorizontal20Regular, Open20Regular, People20Filled, People20Regular, PersonDelete20Regular, PersonVoice20Regular, Pin16Filled, Pin20Filled, Pin20Regular, PinOff20Regular, Play20Regular, Record16Regular, ScaleFill20Regular, ScaleFit20Regular, Send20Filled, Send20Regular, Settings20Filled, Settings20Regular, ShareScreenStart20Filled, ShareScreenStop20Filled, Speaker220Regular, SpeakerMute16Filled, Star28Filled, Star28Regular, Translate20Regular, Video16Filled, Video20Filled, Video20Regular, VideoBackgroundEffect20Filled, VideoBackgroundEffect20Regular, VideoOff20Filled, VideoPersonStar20Filled, VideoPersonStarOff20Filled, VideoProhibited16Filled, WifiWarning20Filled } from '@fluentui/react-icons';
|
8
7
|
/* @conditional-compile-remove(rich-text-editor) */
|
9
8
|
import { TextBold20Regular, TextItalic20Regular, TextUnderlineCharacterU20Regular, TextBulletList20Regular, TextNumberListLtr20Regular, TextIndentDecrease20Regular, TextIndentIncrease20Regular, DividerTall24Regular, TextEditStyle20Regular, TextEditStyle20Filled, Table20Regular, Table20Filled, TableAdd20Regular, TableDismiss20Regular } from '@fluentui/react-icons';
|
10
|
-
import { Emoji20Regular } from '@fluentui/react-icons';
|
11
|
-
import { Star28Regular, Star28Filled } from '@fluentui/react-icons';
|
12
|
-
import { HandRight20Regular, HandRightOff20Regular } from '@fluentui/react-icons';
|
13
|
-
import { ClosedCaption20Regular, ClosedCaptionOff20Regular, Settings20Regular, PersonVoice20Regular, Translate20Regular } from '@fluentui/react-icons';
|
14
9
|
/* @conditional-compile-remove(call-readiness) */
|
15
|
-
import { Important20Filled } from '@fluentui/react-icons';
|
16
|
-
import { Record16Regular } from '@fluentui/react-icons';
|
10
|
+
import { Important20Filled, Sparkle20Filled, VideoProhibited20Filled, MicProhibited20Filled } from '@fluentui/react-icons';
|
17
11
|
/* @conditional-compile-remove(breakout-rooms) */
|
18
12
|
import { ConferenceRoom16Regular, DoorArrowLeft16Regular, DoorArrowRight16Regular } from '@fluentui/react-icons';
|
19
|
-
import { VideoBackgroundEffect20Filled, VideoBackgroundEffect20Regular } from '@fluentui/react-icons';
|
20
|
-
import { Backspace20Regular } from '@fluentui/react-icons';
|
21
|
-
/* @conditional-compile-remove(call-readiness) */
|
22
|
-
import { Sparkle20Filled, VideoProhibited20Filled, MicProhibited20Filled } from '@fluentui/react-icons';
|
23
|
-
/* @conditional-compile-remove(file-sharing-teams-interop) */
|
24
|
-
import { Open20Regular } from '@fluentui/react-icons';
|
25
13
|
/* @conditional-compile-remove(file-sharing-acs) */
|
26
14
|
import { ArrowDownload20Regular } from '@fluentui/react-icons';
|
27
|
-
import { CallPause20Regular, CallPause20Filled, Play20Regular } from '@fluentui/react-icons';
|
28
|
-
import { People20Regular } from '@fluentui/react-icons';
|
29
15
|
/* @conditional-compile-remove(data-loss-prevention) */
|
30
16
|
import { Prohibited16Regular } from '@fluentui/react-icons';
|
31
17
|
/* @conditional-compile-remove(unsupported-browser) */
|
32
18
|
import { Warning20Filled } from '@fluentui/react-icons';
|
33
|
-
import { VideoPersonStar20Filled, VideoPersonStarOff20Filled } from '@fluentui/react-icons';
|
34
19
|
import { _pxToRem } from "../../../acs-ui-common/src";
|
35
20
|
import React from 'react';
|
36
21
|
import { useTheme } from './FluentThemeProvider';
|
37
22
|
/* @conditional-compile-remove(call-readiness) */
|
38
23
|
import { sitePermissionIconBackgroundStyle, scaledIconStyles } from './icons.styles';
|
39
|
-
import { Call20Filled } from '@fluentui/react-icons';
|
40
24
|
const WifiWarning16Filled = () => (
|
41
25
|
// All ErrorBar icons are 16px x 16px (when 1rem = 16 px).
|
42
26
|
// There is no 16px version of this icon in the fluent icon package, so scale the larger
|
@@ -146,7 +130,6 @@ export const DEFAULT_COMPONENT_ICONS = {
|
|
146
130
|
CancelAttachmentUpload: React.createElement(Dismiss16Regular, null),
|
147
131
|
/* @conditional-compile-remove(file-sharing-acs) */
|
148
132
|
DownloadAttachment: React.createElement(ArrowDownload20Regular, null),
|
149
|
-
/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
|
150
133
|
OpenAttachment: React.createElement(Open20Regular, null),
|
151
134
|
/* @conditional-compile-remove(file-sharing-acs) */
|
152
135
|
AttachmentMoreMenu: React.createElement(MoreHorizontal20Filled, null),
|