@azure/communication-react 1.18.0-alpha-202406260014 → 1.18.0-alpha-202406280014
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 +98 -106
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-_hqOwT_h.js → ChatMessageComponentAsRichTextEditBox-Bl9FzI6X.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-_hqOwT_h.js.map → ChatMessageComponentAsRichTextEditBox-Bl9FzI6X.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-D-KYGmZ9.js → RichTextSendBoxWrapper-G-04IaQB.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-D-KYGmZ9.js.map → RichTextSendBoxWrapper-G-04IaQB.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-DCf8u3Nr.js → index-CWs0GTYF.js} +75 -158
- package/dist/dist-cjs/communication-react/index-CWs0GTYF.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +3 -3
- 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/calling-component-bindings/src/errorBarSelector.js +5 -20
- package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/index.d.ts +2 -2
- package/dist/dist-esm/calling-component-bindings/src/index.js +1 -1
- package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/{errorNotificationsSelector.d.ts → notificationStackSelector.d.ts} +4 -3
- package/dist/dist-esm/calling-component-bindings/src/{errorNotificationsSelector.js → notificationStackSelector.js} +7 -3
- package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +9 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +2 -2
- package/dist/dist-esm/communication-react/src/index.js +1 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/communication-react/src/mergedHooks.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ControlBarButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.d.ts +1 -21
- package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js +8 -8
- package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/{NotificationBar.d.ts → Notification.d.ts} +8 -8
- package/dist/dist-esm/react-components/src/components/{NotificationBar.js → Notification.js} +5 -5
- package/dist/dist-esm/react-components/src/components/Notification.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/{Notifications.d.ts → NotificationStack.d.ts} +46 -42
- package/dist/dist-esm/react-components/src/components/{Notifications.js → NotificationStack.js} +7 -7
- package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/index.js +2 -2
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/{NotificationBar.styles.d.ts → Notification.styles.d.ts} +1 -1
- package/dist/dist-esm/react-components/src/components/styles/{NotificationBar.styles.js → Notification.styles.js} +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Notification.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/merge.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/utils.js +3 -1
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +4 -4
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +10 -10
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -0
- package/dist/dist-esm/react-components/src/theming/icons.js +4 -0
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +3 -13
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +9 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +3 -9
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +12 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.d.ts +2 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js +6 -0
- package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +2 -3
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +2 -40
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -7
- package/package.json +2 -2
- package/dist/dist-cjs/communication-react/index-DCf8u3Nr.js.map +0 -1
- package/dist/dist-esm/calling-component-bindings/src/errorNotificationsSelector.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/NotificationBar.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/Notifications.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/NotificationBar.styles.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BadNetworkQualityNotificationBar.d.ts +0 -22
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BadNetworkQualityNotificationBar.js +0 -40
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BadNetworkQualityNotificationBar.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/badNetworkQualitySelector.d.ts +0 -19
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/badNetworkQualitySelector.js +0 -26
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/badNetworkQualitySelector.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatMessageComponentAsMessageBubble.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEhF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAY5C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,OAAO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CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,gBAEzF,GAAG,CAAC,gBAAgB,IAE/B,kBAAkB,CACd,EAET,OAAO,EAAE,iBAAiB,EAAE,IAE3B,UAAU,EAAE,CACK,CAChB,CACL,CACJ,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,mCAAmC,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Text, mergeStyles } from '@fluentui/react';\nimport { ChatMessage as FluentChatMessage } from '@fluentui-contrib/react-chat';\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo } from 'react';\nimport {\n chatMessageDateStyle,\n chatMessageAuthorStyle,\n chatMessageDateFailedStyle\n} from '../../styles/ChatMessageComponent.styles';\nimport { useIdentifiers } from '../../../identifiers/IdentifierProvider';\nimport { useTheme } from '../../../theming';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMessage } from '../../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types/ChatMessage';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { ComponentSlotStyle } from '../../../types';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMenuAction } from '../../../types';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { _AttachmentDownloadCards } from '../../Attachment/AttachmentDownloadCards';\nimport { useLocale } from '../../../localization';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions } from '../../MentionPopover';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { useChatMessageStyles, useChatMessageCommonStyles } from '../../styles/MessageThread.styles';\nimport {\n generateCustomizedTimestamp,\n generateDefaultTimestamp,\n getMessageBubbleContent,\n getMessageEditedDetails\n} from '../../utils/ChatMessageComponentUtils';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { doesMessageContainMultipleAttachments } from '../../utils/ChatMessageComponentAsEditBoxUtils';\n\ntype ChatMessageComponentAsMessageBubbleProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n messageContainerStyle?: ComponentSlotStyle;\n showDate?: boolean;\n strings: MessageThreadStrings;\n userId: string;\n /**\n * Whether to overlap avatar and message when the view is width constrained.\n */\n shouldOverlapAvatarAndMessage: boolean;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to render message attachments in the message component.\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to define custom actions for attachments.\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to display suggestions in the mention scenario.\n * @internal\n */\n mentionDisplayOptions?: MentionDisplayOptions;\n /**\n * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\n};\n\n/** @private */\nconst MessageBubble = (props: ChatMessageComponentAsMessageBubbleProps): JSX.Element => {\n const ids = useIdentifiers();\n const theme = useTheme();\n const locale = useLocale();\n\n const {\n userId,\n message,\n showDate,\n messageContainerStyle,\n strings,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads,\n inlineImageOptions,\n shouldOverlapAvatarAndMessage,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n actionsForAttachment,\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions,\n onDisplayDateTimeString\n } = props;\n\n const formattedTimestamp = useMemo(() => {\n const defaultTimeStamp = message.createdOn\n ? generateDefaultTimestamp(message.createdOn, showDate, strings)\n : undefined;\n\n const customTimestamp = message.createdOn\n ? generateCustomizedTimestamp(message.createdOn, locale, onDisplayDateTimeString)\n : '';\n\n return customTimestamp || defaultTimeStamp;\n }, [locale, message.createdOn, onDisplayDateTimeString, showDate, strings]);\n\n const getMessageDetails = useCallback(() => {\n return getMessageEditedDetails(message, theme, strings.editedTag);\n }, [strings.editedTag, theme, message]);\n\n const getContent = useCallback(() => {\n return getMessageBubbleContent(\n message,\n strings,\n userId,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n actionsForAttachment\n );\n }, [\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */ actionsForAttachment,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */ mentionDisplayOptions,\n message,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */ onRenderAttachmentDownloads,\n strings,\n userId\n ]);\n\n const isBlockedMessage =\n false || /* @conditional-compile-remove(data-loss-prevention) */ message.messageType === 'blocked';\n const chatMessageCommonStyles = useChatMessageCommonStyles();\n /* @conditional-compile-remove(file-sharing-acs) */\n const hasMultipleAttachments = useMemo(() => {\n return doesMessageContainMultipleAttachments(message as ChatMessage);\n }, [message]);\n const chatMessageStyles = useChatMessageStyles();\n const chatItemMessageContainerClassName = mergeClasses(\n chatMessageCommonStyles.body,\n chatMessageStyles.body,\n // disable placeholder functionality for GA releases as it might confuse users\n chatMessageStyles.bodyWithPlaceholderImage,\n isBlockedMessage\n ? chatMessageCommonStyles.blocked\n : props.message.status === 'failed'\n ? chatMessageCommonStyles.failed\n : undefined,\n shouldOverlapAvatarAndMessage ? chatMessageStyles.avatarOverlap : chatMessageStyles.avatarNoOverlap,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasMultipleAttachments ? chatMessageStyles.multipleAttachments : undefined,\n message.attached === 'top' || message.attached === false\n ? chatMessageStyles.bodyWithAvatar\n : chatMessageStyles.bodyWithoutAvatar,\n // messageContainerStyle used in className and style prop as style prop can't handle CSS selectors\n mergeStyles(messageContainerStyle)\n );\n\n const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n const chatMessage = (\n <>\n <div key={props.message.messageId}>\n <FluentChatMessage\n attached={attached}\n key={props.message.messageId}\n root={{\n className: chatMessageStyles.root\n }}\n author={<Text className={chatMessageAuthorStyle}>{message.senderDisplayName}</Text>}\n body={{\n className: chatItemMessageContainerClassName,\n style: { ...createStyleFromV8Style(messageContainerStyle) }\n }}\n data-ui-id=\"chat-composite-message\"\n timestamp={\n <Text\n className={\n props.message.status === 'failed' ? chatMessageDateFailedStyle(theme) : chatMessageDateStyle(theme)\n }\n data-ui-id={ids.messageTimestamp}\n >\n {formattedTimestamp}\n </Text>\n }\n details={getMessageDetails()}\n >\n {getContent()}\n </FluentChatMessage>\n </div>\n </>\n );\n return chatMessage;\n};\n\n/** @private */\nexport const ChatMessageComponentAsMessageBubble = React.memo(MessageBubble);\n"]}
|
1
|
+
{"version":3,"file":"ChatMessageComponentAsMessageBubble.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEhF,OAAO,KAAK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S,EAAE,sBAAsB,IAAG,OAAO,CAAC,iBAAiB,CAAQ,EACnF,IAAI,EAAE;oBACJ,SAAS,EAAE,iCAAiC;oBAC5C,KAAK,oBAAO,sBAAsB,CAAC,qBAAqB,CAAC,CAAE;iBAC5D,gBACU,wBAAwB,EACnC,SAAS,EACP,oBAAC,IAAI,IACH,SAAS,EACP,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,gBAEzF,GAAG,CAAC,gBAAgB,IAE/B,kBAAkB,CACd,EAET,OAAO,EAAE,iBAAiB,EAAE,IAE3B,UAAU,EAAE,CACK,CAChB,CACL,CACJ,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,mCAAmC,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Text, mergeStyles } from '@fluentui/react';\nimport { ChatMessage as FluentChatMessage } from '@fluentui-contrib/react-chat';\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo } from 'react';\nimport {\n chatMessageDateStyle,\n chatMessageAuthorStyle,\n chatMessageDateFailedStyle\n} from '../../styles/ChatMessageComponent.styles';\nimport { useIdentifiers } from '../../../identifiers/IdentifierProvider';\nimport { useTheme } from '../../../theming';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMessage } from '../../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types/ChatMessage';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { ComponentSlotStyle } from '../../../types';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMenuAction } from '../../../types';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { _AttachmentDownloadCards } from '../../Attachment/AttachmentDownloadCards';\nimport { useLocale } from '../../../localization';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions } from '../../MentionPopover';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { useChatMessageStyles, useChatMessageCommonStyles } from '../../styles/MessageThread.styles';\nimport {\n generateCustomizedTimestamp,\n generateDefaultTimestamp,\n getMessageBubbleContent,\n getMessageEditedDetails\n} from '../../utils/ChatMessageComponentUtils';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { doesMessageContainMultipleAttachments } from '../../utils/ChatMessageComponentAsEditBoxUtils';\n\ntype ChatMessageComponentAsMessageBubbleProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n messageContainerStyle?: ComponentSlotStyle;\n showDate?: boolean;\n strings: MessageThreadStrings;\n userId: string;\n /**\n * Whether to overlap avatar and message when the view is width constrained.\n */\n shouldOverlapAvatarAndMessage: boolean;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to render message attachments in the message component.\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to define custom actions for attachments.\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to display suggestions in the mention scenario.\n * @internal\n */\n mentionDisplayOptions?: MentionDisplayOptions;\n /**\n * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\n};\n\n/** @private */\nconst MessageBubble = (props: ChatMessageComponentAsMessageBubbleProps): JSX.Element => {\n const ids = useIdentifiers();\n const theme = useTheme();\n const locale = useLocale();\n\n const {\n userId,\n message,\n showDate,\n messageContainerStyle,\n strings,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads,\n inlineImageOptions,\n shouldOverlapAvatarAndMessage,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n actionsForAttachment,\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions,\n onDisplayDateTimeString\n } = props;\n\n const formattedTimestamp = useMemo(() => {\n const defaultTimeStamp = message.createdOn\n ? generateDefaultTimestamp(message.createdOn, showDate, strings)\n : undefined;\n\n const customTimestamp = message.createdOn\n ? generateCustomizedTimestamp(message.createdOn, locale, onDisplayDateTimeString)\n : '';\n\n return customTimestamp || defaultTimeStamp;\n }, [locale, message.createdOn, onDisplayDateTimeString, showDate, strings]);\n\n const getMessageDetails = useCallback(() => {\n return getMessageEditedDetails(message, theme, strings.editedTag);\n }, [strings.editedTag, theme, message]);\n\n const getContent = useCallback(() => {\n return getMessageBubbleContent(\n message,\n strings,\n userId,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n actionsForAttachment\n );\n }, [\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */ actionsForAttachment,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */ mentionDisplayOptions,\n message,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */ onRenderAttachmentDownloads,\n strings,\n userId\n ]);\n\n const isBlockedMessage =\n false || /* @conditional-compile-remove(data-loss-prevention) */ message.messageType === 'blocked';\n const chatMessageCommonStyles = useChatMessageCommonStyles();\n /* @conditional-compile-remove(file-sharing-acs) */\n const hasMultipleAttachments = useMemo(() => {\n return doesMessageContainMultipleAttachments(message as ChatMessage);\n }, [message]);\n const chatMessageStyles = useChatMessageStyles();\n const chatItemMessageContainerClassName = mergeClasses(\n chatMessageCommonStyles.body,\n chatMessageStyles.body,\n // disable placeholder functionality for GA releases as it might confuse users\n chatMessageStyles.bodyWithPlaceholderImage,\n isBlockedMessage\n ? chatMessageCommonStyles.blocked\n : props.message.status === 'failed'\n ? chatMessageCommonStyles.failed\n : undefined,\n shouldOverlapAvatarAndMessage ? chatMessageStyles.avatarOverlap : chatMessageStyles.avatarNoOverlap,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasMultipleAttachments ? chatMessageStyles.multipleAttachments : undefined,\n message.attached === 'top' || message.attached === false\n ? chatMessageStyles.bodyWithAvatar\n : chatMessageStyles.bodyWithoutAvatar,\n // messageContainerStyle used in className and style prop as style prop can't handle CSS selectors\n mergeStyles(messageContainerStyle)\n );\n\n const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n const chatMessage = (\n <>\n <div key={props.message.messageId}>\n <FluentChatMessage\n attached={attached}\n key={props.message.messageId}\n root={{\n className: chatMessageStyles.root\n }}\n author={<Text className={chatMessageAuthorStyle}>{message.senderDisplayName}</Text>}\n body={{\n className: chatItemMessageContainerClassName,\n style: { ...createStyleFromV8Style(messageContainerStyle) }\n }}\n data-ui-id=\"chat-composite-message\"\n timestamp={\n <Text\n className={\n props.message.status === 'failed' ? chatMessageDateFailedStyle(theme) : chatMessageDateStyle(theme)\n }\n data-ui-id={ids.messageTimestamp}\n >\n {formattedTimestamp}\n </Text>\n }\n details={getMessageDetails()}\n >\n {getContent()}\n </FluentChatMessage>\n </div>\n </>\n );\n return chatMessage;\n};\n\n/** @private */\nexport const ChatMessageComponentAsMessageBubble = React.memo(MessageBubble);\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatMyMessageComponentAsMessageBubble.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAMtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAOtE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACvG,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,uCAAuC,CAAC;AAC/C,mDAAmD;AACnD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAyDvG,eAAe;AACf,MAAM,aAAa,GAAG,CAAC,KAAiD,EAAe,EAAE;;IACvF,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACz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AC;gBACH,CAAC,IAEA,UAAU,EAAE,CACC,CACZ;QACL,kBAAkB,IAAI,CACrB,oBAAC,uBAAuB,IACtB,MAAM,EAAE,CAAC,6BAA6B,EACtC,MAAM,EAAE,6BAA6B,EACrC,sBAAsB,EAAE,qBAAqB,EAC7C,SAAS,EAAE,qBAAqB,EAChC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,QAAQ,EACxC,uBAAuB,EAAE,uBAAuB,EAChD,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iBAAiB,GACpC,CACH,CACA,CACJ,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,qCAAqC,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Text, mergeStyles } from '@fluentui/react';\nimport { ChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport {\n chatMessageDateStyle,\n chatMessageFailedTagStyle,\n chatMessageDateFailedStyle\n} from '../../styles/ChatMessageComponent.styles';\nimport { useIdentifiers } from '../../../identifiers/IdentifierProvider';\nimport { useTheme } from '../../../theming';\nimport { ChatMessageActionFlyout } from '../ChatMessageActionsFlyout';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMessage } from '../../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types/ChatMessage';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { chatMessageActionMenuProps } from '../ChatMessageActionMenu';\nimport { ComponentSlotStyle, OnRenderAvatarCallback } from '../../../types';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMenuAction } from '../../../types/Attachment';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { _AttachmentDownloadCards } from '../../Attachment/AttachmentDownloadCards';\nimport { useLocale } from '../../../localization';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions } from '../../MentionPopover';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { useChatMyMessageStyles, useChatMessageCommonStyles } from '../../styles/MessageThread.styles';\nimport {\n generateCustomizedTimestamp,\n generateDefaultTimestamp,\n getMessageBubbleContent,\n getMessageEditedDetails\n} from '../../utils/ChatMessageComponentUtils';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { doesMessageContainMultipleAttachments } from '../../utils/ChatMessageComponentAsEditBoxUtils';\n\ntype ChatMyMessageComponentAsMessageBubbleProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n messageContainerStyle?: ComponentSlotStyle;\n showDate?: boolean;\n disableEditing?: boolean;\n onEditClick: () => void;\n onRemoveClick?: () => void;\n onResendClick?: () => void;\n strings: MessageThreadStrings;\n userId: string;\n messageStatus?: string;\n /**\n * Whether the status indicator for each message is displayed or not.\n */\n showMessageStatus?: boolean;\n remoteParticipantsCount?: number;\n onActionButtonClick: (\n message: ChatMessage,\n setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void\n ) => void;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to display suggestions in the mention scenario.\n * @internal\n */\n mentionDisplayOptions?: MentionDisplayOptions;\n /**\n * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to render message attachments in the message component.\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to define custom actions for attachments.\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n};\n\n/** @private */\nconst MessageBubble = (props: ChatMyMessageComponentAsMessageBubbleProps): JSX.Element => {\n const ids = useIdentifiers();\n const theme = useTheme();\n const locale = useLocale();\n\n const {\n userId,\n message,\n onRemoveClick,\n onResendClick,\n disableEditing,\n showDate,\n messageContainerStyle,\n strings,\n onEditClick,\n remoteParticipantsCount = 0,\n onRenderAvatar,\n showMessageStatus,\n messageStatus,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions,\n onDisplayDateTimeString,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n actionsForAttachment\n } = props;\n\n const formattedTimestamp = useMemo(() => {\n const defaultTimeStamp = message.createdOn\n ? generateDefaultTimestamp(message.createdOn, showDate, strings)\n : undefined;\n\n const customTimestamp = message.createdOn\n ? generateCustomizedTimestamp(message.createdOn, locale, onDisplayDateTimeString)\n : '';\n\n return customTimestamp || defaultTimeStamp;\n }, [locale, message.createdOn, onDisplayDateTimeString, showDate, strings]);\n\n // Track if the action menu was opened by touch - if so we increase the touch targets for the items\n const [wasInteractionByTouch, setWasInteractionByTouch] = useState(false);\n // `focused` state is used for show/hide actionMenu\n const [focused, setFocused] = React.useState<boolean>(false);\n\n // The chat message action flyout should target the Chat.Message action menu if clicked,\n // or target the chat message if opened via touch press.\n // Undefined indicates the flyout menu should not be being shown.\n const messageRef = useRef<HTMLDivElement | null>(null);\n const messageActionButtonRef = useRef<HTMLDivElement | null>(null);\n const [chatMessageActionFlyoutTarget, setChatMessageActionFlyoutTarget] = useState<\n React.MutableRefObject<HTMLElement | null> | undefined\n >(undefined);\n\n const chatActionsEnabled =\n !disableEditing &&\n message.status !== 'sending' &&\n !!message.mine &&\n /* @conditional-compile-remove(data-loss-prevention) */ message.messageType !== 'blocked';\n const [messageReadBy, setMessageReadBy] = useState<{ id: string; displayName: string }[]>([]);\n\n const actionMenuProps = chatMessageActionMenuProps({\n ariaLabel: strings.actionMenuMoreOptions ?? '',\n enabled: chatActionsEnabled,\n menuButtonRef: messageActionButtonRef,\n menuExpanded: chatMessageActionFlyoutTarget === messageActionButtonRef,\n onActionButtonClick: () => {\n if (message.messageType === 'chat') {\n props.onActionButtonClick(message, setMessageReadBy);\n setChatMessageActionFlyoutTarget(messageActionButtonRef);\n }\n },\n theme\n });\n\n const onActionFlyoutDismiss = useCallback((): void => {\n // When the flyout dismiss is called, since we control if the action flyout is visible\n // or not we need to set the target to undefined here to actually hide the action flyout\n setChatMessageActionFlyoutTarget(undefined);\n }, [setChatMessageActionFlyoutTarget]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const hasMultipleAttachments = useMemo(() => {\n return doesMessageContainMultipleAttachments(message as ChatMessage);\n }, [message]);\n\n const getMessageDetails = useCallback(() => {\n if (messageStatus === 'failed') {\n return <div className={chatMessageFailedTagStyle(theme)}>{strings.failToSendTag}</div>;\n } else {\n return getMessageEditedDetails(message, theme, strings.editedTag);\n }\n }, [message, messageStatus, strings.editedTag, strings.failToSendTag, theme]);\n\n const getContent = useCallback(() => {\n return getMessageBubbleContent(\n message,\n strings,\n userId,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n actionsForAttachment\n );\n }, [\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */ actionsForAttachment,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */ mentionDisplayOptions,\n message,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */ onRenderAttachmentDownloads,\n strings,\n userId\n ]);\n\n const isBlockedMessage =\n false || /* @conditional-compile-remove(data-loss-prevention) */ message.messageType === 'blocked';\n const chatMyMessageStyles = useChatMyMessageStyles();\n const chatMessageCommonStyles = useChatMessageCommonStyles();\n\n const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n const chatMessage = (\n <>\n <div key={props.message.messageId}>\n <ChatMyMessage\n attached={attached}\n key={props.message.messageId}\n body={{\n // messageContainerStyle used in className and style prop as style prop can't handle CSS selectors\n className: mergeClasses(\n chatMessageCommonStyles.body,\n chatMyMessageStyles.body,\n isBlockedMessage\n ? chatMessageCommonStyles.blocked\n : props.message.status === 'failed'\n ? chatMessageCommonStyles.failed\n : undefined,\n attached !== 'top' ? chatMyMessageStyles.bodyAttached : undefined,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasMultipleAttachments ? chatMyMessageStyles.multipleAttachments : undefined,\n mergeStyles(messageContainerStyle)\n ),\n style: { ...createStyleFromV8Style(messageContainerStyle) },\n ref: messageRef\n }}\n root={{\n className: chatMyMessageStyles.root,\n onBlur: (e) => {\n // `focused` controls is focused the whole `ChatMessage` or any of its children. When we're navigating\n // with keyboard the focused element will be changed and there is no way to use `:focus` selector\n if (chatMessageActionFlyoutTarget?.current) {\n // doesn't dismiss action button if flyout is open, otherwise, narrator's focus will stay on the closed action menu\n return;\n }\n const shouldPreserveFocusState = e.currentTarget.contains(e.relatedTarget);\n setFocused(shouldPreserveFocusState);\n },\n onFocus: () => {\n // react onFocus is called even when nested component receives focus (i.e. it bubbles)\n // so when focus moves within actionMenu, the `focus` state in chatMessage remains true, and keeps actionMenu visible\n setFocused(true);\n }\n }}\n data-ui-id=\"chat-composite-message\"\n author={<Text className={chatMessageDateStyle(theme)}>{message.senderDisplayName}</Text>}\n timestamp={\n <Text\n className={\n props.message.status === 'failed' ? chatMessageDateFailedStyle(theme) : chatMessageDateStyle(theme)\n }\n data-ui-id={ids.messageTimestamp}\n >\n {formattedTimestamp}\n </Text>\n }\n details={getMessageDetails()}\n actions={{\n children: actionMenuProps?.children,\n className: mergeClasses(\n chatMyMessageStyles.menu,\n // Make actions menu visible when the message is focused or the flyout is shown\n focused || chatMessageActionFlyoutTarget?.current\n ? chatMyMessageStyles.menuVisible\n : chatMyMessageStyles.menuHidden,\n attached !== 'top' ? chatMyMessageStyles.menuAttached : undefined\n )\n }}\n onTouchStart={() => setWasInteractionByTouch(true)}\n onPointerDown={() => setWasInteractionByTouch(false)}\n onKeyDown={() => setWasInteractionByTouch(false)}\n onClick={() => {\n if (!wasInteractionByTouch) {\n return;\n }\n // If the message was touched via touch we immediately open the menu\n // flyout (when using mouse the 3-dot menu that appears on hover\n // must be clicked to open the flyout).\n // In doing so here we set the target of the flyout to be the message and\n // not the 3-dot menu button to position the flyout correctly.\n setChatMessageActionFlyoutTarget(messageRef);\n if (message.messageType === 'chat') {\n props.onActionButtonClick(message, setMessageReadBy);\n }\n }}\n >\n {getContent()}\n </ChatMyMessage>\n </div>\n {chatActionsEnabled && (\n <ChatMessageActionFlyout\n hidden={!chatMessageActionFlyoutTarget}\n target={chatMessageActionFlyoutTarget}\n increaseFlyoutItemSize={wasInteractionByTouch}\n onDismiss={onActionFlyoutDismiss}\n onEditClick={onEditClick}\n onRemoveClick={onRemoveClick}\n onResendClick={onResendClick}\n strings={strings}\n messageReadBy={messageReadBy}\n messageStatus={messageStatus ?? 'failed'}\n remoteParticipantsCount={remoteParticipantsCount}\n onRenderAvatar={onRenderAvatar}\n showMessageStatus={showMessageStatus}\n />\n )}\n </>\n );\n return chatMessage;\n};\n\n/** @private */\nexport const ChatMyMessageComponentAsMessageBubble = React.memo(MessageBubble);\n"]}
|
1
|
+
{"version":3,"file":"ChatMyMessageComponentAsMessageBubble.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAMtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAOtE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACvG,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,uCAAuC,CAAC;AAC/C,mDAAmD;AACnD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAyDvG,eAAe;AACf,MAAM,aAAa,GAAG,CAAC,KAAiD,EAAe,EAAE;;IACv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AAE,CAAC;wBACnC,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;oBACvD,CAAC;gBACH,CAAC,IAEA,UAAU,EAAE,CACC,CACZ;QACL,kBAAkB,IAAI,CACrB,oBAAC,uBAAuB,IACtB,MAAM,EAAE,CAAC,6BAA6B,EACtC,MAAM,EAAE,6BAA6B,EACrC,sBAAsB,EAAE,qBAAqB,EAC7C,SAAS,EAAE,qBAAqB,EAChC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,QAAQ,EACxC,uBAAuB,EAAE,uBAAuB,EAChD,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iBAAiB,GACpC,CACH,CACA,CACJ,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,qCAAqC,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Text, mergeStyles } from '@fluentui/react';\nimport { ChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport {\n chatMessageDateStyle,\n chatMessageFailedTagStyle,\n chatMessageDateFailedStyle\n} from '../../styles/ChatMessageComponent.styles';\nimport { useIdentifiers } from '../../../identifiers/IdentifierProvider';\nimport { useTheme } from '../../../theming';\nimport { ChatMessageActionFlyout } from '../ChatMessageActionsFlyout';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMessage } from '../../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types/ChatMessage';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { chatMessageActionMenuProps } from '../ChatMessageActionMenu';\nimport { ComponentSlotStyle, OnRenderAvatarCallback } from '../../../types';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMenuAction } from '../../../types/Attachment';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { _AttachmentDownloadCards } from '../../Attachment/AttachmentDownloadCards';\nimport { useLocale } from '../../../localization';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions } from '../../MentionPopover';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { useChatMyMessageStyles, useChatMessageCommonStyles } from '../../styles/MessageThread.styles';\nimport {\n generateCustomizedTimestamp,\n generateDefaultTimestamp,\n getMessageBubbleContent,\n getMessageEditedDetails\n} from '../../utils/ChatMessageComponentUtils';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { doesMessageContainMultipleAttachments } from '../../utils/ChatMessageComponentAsEditBoxUtils';\n\ntype ChatMyMessageComponentAsMessageBubbleProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n messageContainerStyle?: ComponentSlotStyle;\n showDate?: boolean;\n disableEditing?: boolean;\n onEditClick: () => void;\n onRemoveClick?: () => void;\n onResendClick?: () => void;\n strings: MessageThreadStrings;\n userId: string;\n messageStatus?: string;\n /**\n * Whether the status indicator for each message is displayed or not.\n */\n showMessageStatus?: boolean;\n remoteParticipantsCount?: number;\n onActionButtonClick: (\n message: ChatMessage,\n setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void\n ) => void;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to display suggestions in the mention scenario.\n * @internal\n */\n mentionDisplayOptions?: MentionDisplayOptions;\n /**\n * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to render message attachments in the message component.\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n /**\n * Optional callback to define custom actions for attachments.\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n};\n\n/** @private */\nconst MessageBubble = (props: ChatMyMessageComponentAsMessageBubbleProps): JSX.Element => {\n const ids = useIdentifiers();\n const theme = useTheme();\n const locale = useLocale();\n\n const {\n userId,\n message,\n onRemoveClick,\n onResendClick,\n disableEditing,\n showDate,\n messageContainerStyle,\n strings,\n onEditClick,\n remoteParticipantsCount = 0,\n onRenderAvatar,\n showMessageStatus,\n messageStatus,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions,\n onDisplayDateTimeString,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n actionsForAttachment\n } = props;\n\n const formattedTimestamp = useMemo(() => {\n const defaultTimeStamp = message.createdOn\n ? generateDefaultTimestamp(message.createdOn, showDate, strings)\n : undefined;\n\n const customTimestamp = message.createdOn\n ? generateCustomizedTimestamp(message.createdOn, locale, onDisplayDateTimeString)\n : '';\n\n return customTimestamp || defaultTimeStamp;\n }, [locale, message.createdOn, onDisplayDateTimeString, showDate, strings]);\n\n // Track if the action menu was opened by touch - if so we increase the touch targets for the items\n const [wasInteractionByTouch, setWasInteractionByTouch] = useState(false);\n // `focused` state is used for show/hide actionMenu\n const [focused, setFocused] = React.useState<boolean>(false);\n\n // The chat message action flyout should target the Chat.Message action menu if clicked,\n // or target the chat message if opened via touch press.\n // Undefined indicates the flyout menu should not be being shown.\n const messageRef = useRef<HTMLDivElement | null>(null);\n const messageActionButtonRef = useRef<HTMLDivElement | null>(null);\n const [chatMessageActionFlyoutTarget, setChatMessageActionFlyoutTarget] = useState<\n React.MutableRefObject<HTMLElement | null> | undefined\n >(undefined);\n\n const chatActionsEnabled =\n !disableEditing &&\n message.status !== 'sending' &&\n !!message.mine &&\n /* @conditional-compile-remove(data-loss-prevention) */ message.messageType !== 'blocked';\n const [messageReadBy, setMessageReadBy] = useState<{ id: string; displayName: string }[]>([]);\n\n const actionMenuProps = chatMessageActionMenuProps({\n ariaLabel: strings.actionMenuMoreOptions ?? '',\n enabled: chatActionsEnabled,\n menuButtonRef: messageActionButtonRef,\n menuExpanded: chatMessageActionFlyoutTarget === messageActionButtonRef,\n onActionButtonClick: () => {\n if (message.messageType === 'chat') {\n props.onActionButtonClick(message, setMessageReadBy);\n setChatMessageActionFlyoutTarget(messageActionButtonRef);\n }\n },\n theme\n });\n\n const onActionFlyoutDismiss = useCallback((): void => {\n // When the flyout dismiss is called, since we control if the action flyout is visible\n // or not we need to set the target to undefined here to actually hide the action flyout\n setChatMessageActionFlyoutTarget(undefined);\n }, [setChatMessageActionFlyoutTarget]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const hasMultipleAttachments = useMemo(() => {\n return doesMessageContainMultipleAttachments(message as ChatMessage);\n }, [message]);\n\n const getMessageDetails = useCallback(() => {\n if (messageStatus === 'failed') {\n return <div className={chatMessageFailedTagStyle(theme)}>{strings.failToSendTag}</div>;\n } else {\n return getMessageEditedDetails(message, theme, strings.editedTag);\n }\n }, [message, messageStatus, strings.editedTag, strings.failToSendTag, theme]);\n\n const getContent = useCallback(() => {\n return getMessageBubbleContent(\n message,\n strings,\n userId,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n actionsForAttachment\n );\n }, [\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */ actionsForAttachment,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */ mentionDisplayOptions,\n message,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */ onRenderAttachmentDownloads,\n strings,\n userId\n ]);\n\n const isBlockedMessage =\n false || /* @conditional-compile-remove(data-loss-prevention) */ message.messageType === 'blocked';\n const chatMyMessageStyles = useChatMyMessageStyles();\n const chatMessageCommonStyles = useChatMessageCommonStyles();\n\n const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n const chatMessage = (\n <>\n <div key={props.message.messageId}>\n <ChatMyMessage\n attached={attached}\n key={props.message.messageId}\n body={{\n // messageContainerStyle used in className and style prop as style prop can't handle CSS selectors\n className: mergeClasses(\n chatMessageCommonStyles.body,\n chatMyMessageStyles.body,\n isBlockedMessage\n ? chatMessageCommonStyles.blocked\n : props.message.status === 'failed'\n ? chatMessageCommonStyles.failed\n : undefined,\n attached !== 'top' ? chatMyMessageStyles.bodyAttached : undefined,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasMultipleAttachments ? chatMyMessageStyles.multipleAttachments : undefined,\n mergeStyles(messageContainerStyle)\n ),\n style: { ...createStyleFromV8Style(messageContainerStyle) },\n ref: messageRef\n }}\n root={{\n className: chatMyMessageStyles.root,\n onBlur: (e) => {\n // `focused` controls is focused the whole `ChatMessage` or any of its children. When we're navigating\n // with keyboard the focused element will be changed and there is no way to use `:focus` selector\n if (chatMessageActionFlyoutTarget?.current) {\n // doesn't dismiss action button if flyout is open, otherwise, narrator's focus will stay on the closed action menu\n return;\n }\n const shouldPreserveFocusState = e.currentTarget.contains(e.relatedTarget);\n setFocused(shouldPreserveFocusState);\n },\n onFocus: () => {\n // react onFocus is called even when nested component receives focus (i.e. it bubbles)\n // so when focus moves within actionMenu, the `focus` state in chatMessage remains true, and keeps actionMenu visible\n setFocused(true);\n }\n }}\n data-ui-id=\"chat-composite-message\"\n author={<Text className={chatMessageDateStyle(theme)}>{message.senderDisplayName}</Text>}\n timestamp={\n <Text\n className={\n props.message.status === 'failed' ? chatMessageDateFailedStyle(theme) : chatMessageDateStyle(theme)\n }\n data-ui-id={ids.messageTimestamp}\n >\n {formattedTimestamp}\n </Text>\n }\n details={getMessageDetails()}\n actions={{\n children: actionMenuProps?.children,\n className: mergeClasses(\n chatMyMessageStyles.menu,\n // Make actions menu visible when the message is focused or the flyout is shown\n focused || chatMessageActionFlyoutTarget?.current\n ? chatMyMessageStyles.menuVisible\n : chatMyMessageStyles.menuHidden,\n attached !== 'top' ? chatMyMessageStyles.menuAttached : undefined\n )\n }}\n onTouchStart={() => setWasInteractionByTouch(true)}\n onPointerDown={() => setWasInteractionByTouch(false)}\n onKeyDown={() => setWasInteractionByTouch(false)}\n onClick={() => {\n if (!wasInteractionByTouch) {\n return;\n }\n // If the message was touched via touch we immediately open the menu\n // flyout (when using mouse the 3-dot menu that appears on hover\n // must be clicked to open the flyout).\n // In doing so here we set the target of the flyout to be the message and\n // not the 3-dot menu button to position the flyout correctly.\n setChatMessageActionFlyoutTarget(messageRef);\n if (message.messageType === 'chat') {\n props.onActionButtonClick(message, setMessageReadBy);\n }\n }}\n >\n {getContent()}\n </ChatMyMessage>\n </div>\n {chatActionsEnabled && (\n <ChatMessageActionFlyout\n hidden={!chatMessageActionFlyoutTarget}\n target={chatMessageActionFlyoutTarget}\n increaseFlyoutItemSize={wasInteractionByTouch}\n onDismiss={onActionFlyoutDismiss}\n onEditClick={onEditClick}\n onRemoveClick={onRemoveClick}\n onResendClick={onResendClick}\n strings={strings}\n messageReadBy={messageReadBy}\n messageStatus={messageStatus ?? 'failed'}\n remoteParticipantsCount={remoteParticipantsCount}\n onRenderAvatar={onRenderAvatar}\n showMessageStatus={showMessageStatus}\n />\n )}\n </>\n );\n return chatMessage;\n};\n\n/** @private */\nexport const ChatMyMessageComponentAsMessageBubble = React.memo(MessageBubble);\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ControlBarButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ControlBarButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,aAAa,EAGb,eAAe,EAEf,QAAQ,EACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAkG9D,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAsB,EAAE;IAC9E,OAAO,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO;QACnB,CAAC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,cAAc;YACrB,CAAC,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,cAAc,EAAE;YACzB,CAAC,CAAC,IAAI;QACR,CAAC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe;
|
1
|
+
{"version":3,"file":"ControlBarButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ControlBarButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,aAAa,EAGb,eAAe,EAEf,QAAQ,EACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAkG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AK,CAAE,OAAO,0CAAE,sBAAsB;QACxC,CAAC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO;YACd,CAAC,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,0CAAE,gBAAgB;YAClC,CAAC,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,0CAAE,iBAAiB,CAAC,CAAC;IAE3C,MAAM,SAAS,GAAG,CAAA,MAAA,KAAK,CAAC,SAAS,mCAAI,KAAK,CAAC,QAAQ,EAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;IAE9F,OAAO,CACL,oBAAC,oBAAoB,IAAC,MAAM,EAAE,KAAK,CAAC,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,SAAS;QACxF,oBAAC,aAAa,oBACR,KAAK,IACT,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EACpF,YAAY,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,iBAAiB,EACrD,SAAS,EAAE,MAAA,MAAA,MAAA,KAAK,CAAC,oBAAoB,mCAAI,KAAK,CAAC,SAAS,mCAAI,SAAS,mCAAI,cAAc,EACvF,kBAAkB,EAAE,MAAA,KAAK,CAAC,kBAAkB,mCAAI,IAAI,EACpD,kBAAkB,EAAE,QAAQ,CAAC,IAAI,EACjC,IAAI,EAAE,SAAS,KAEd,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,yCAAK,CACtB,CACK,CACxB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport {\n DefaultButton,\n IButtonProps,\n IRenderFunction,\n concatStyleSets,\n IButtonStyles,\n KeyCodes\n} from '@fluentui/react';\nimport { controlButtonStyles } from './styles/ControlBar.styles';\nimport { ControlButtonTooltip } from './ControlButtonTooltip';\n\n/**\n * Strings of {@link ControlBarButton} that can be overridden.\n *\n * @public\n */\nexport interface ControlBarButtonStrings {\n /**\n * Label of the button. This supersedes onLabel or offLabel if used.\n */\n label?: string;\n /**\n * Label of the button shown when the button is checked.\n */\n onLabel?: string;\n /**\n * Label of the button shown when the button is not checked.\n */\n offLabel?: string;\n /**\n * Tooltip content of the button. This supersedes tooltipDisabledContent, tooltipOnContent and tooltipOffContent if used.\n */\n tooltipContent?: string;\n /**\n * Tooltip content when the button is disabled.\n */\n tooltipDisabledContent?: string;\n /**\n * Tooltip content when the button is in the checked state.\n */\n tooltipOnContent?: string;\n /**\n * Tooltip content when the button is in the unchecked state.\n */\n tooltipOffContent?: string;\n}\n\n/**\n * Styles for all {@link ControlBarButton} implementations.\n *\n * @public\n */\nexport type ControlBarButtonStyles = IButtonStyles;\n\n/**\n * Props for {@link ControlBarButton}.\n *\n * @public\n */\nexport interface ControlBarButtonProps extends IButtonProps {\n /**\n * Whether the label is displayed or not.\n *\n * @defaultValue `false`\n */\n showLabel?: boolean;\n\n /**\n * Key to use for the Label component\n */\n labelKey?: string;\n\n /**\n * Disable tooltip.\n *\n * @defaultValue 'false'\n */\n disableTooltip?: boolean;\n\n /**\n * Id to use for the tooltip host.\n *\n * @defaultValue This uses the labelKey and appends -tooltip by default\n */\n tooltipId?: string;\n\n /**\n * Optional strings to override in component.\n */\n strings?: ControlBarButtonStrings;\n\n /**\n * Icon to render when the button is checked.\n */\n onRenderOnIcon?: IRenderFunction<IButtonProps>;\n\n /**\n * Icon to render when the button is not checked.\n */\n onRenderOffIcon?: IRenderFunction<IButtonProps>;\n\n /**\n * Fluent styles, including extensions common to all {@link ControlBarButton}s.\n */\n styles?: ControlBarButtonStyles;\n}\n\nconst DefaultRenderIcon = (props?: ControlBarButtonProps): JSX.Element | null => {\n return props?.checked\n ? props?.onRenderOnIcon\n ? props?.onRenderOnIcon()\n : null\n : props?.onRenderOffIcon\n ? props?.onRenderOffIcon()\n : null;\n};\n\n/**\n * Default button styled for the {@link ControlBar}.\n *\n * Use this component create custom buttons that are styled the same as other buttons provided by the UI Library.\n *\n * @public\n */\nexport const ControlBarButton = (props: ControlBarButtonProps): JSX.Element => {\n const componentStyles = concatStyleSets(controlButtonStyles, props.styles ?? {});\n\n const labelText =\n props?.text ?? props?.strings?.label ?? (props?.checked ? props?.strings?.onLabel : props?.strings?.offLabel);\n\n const tooltipContent =\n props?.strings?.tooltipContent ??\n (props?.disabled\n ? props?.strings?.tooltipDisabledContent\n : props?.checked\n ? props?.strings?.tooltipOnContent\n : props?.strings?.tooltipOffContent);\n\n const tooltipId = props.tooltipId ?? props.labelKey ? props.labelKey + '-tooltip' : undefined;\n\n return (\n <ControlButtonTooltip hidden={props.disableTooltip} content={tooltipContent} id={tooltipId}>\n <DefaultButton\n {...props}\n styles={componentStyles}\n onRenderText={props.showLabel && props.onRenderText ? props.onRenderText : undefined}\n onRenderIcon={props.onRenderIcon ?? DefaultRenderIcon}\n ariaLabel={props.splitButtonAriaLabel ?? props.ariaLabel ?? labelText ?? tooltipContent}\n allowDisabledFocus={props.allowDisabledFocus ?? true}\n menuTriggerKeyCode={KeyCodes.down} // explicitly sets the keypress to activiate the split button drop down.\n text={undefined} // this is handled as a child of the button, without this the `showLabel` prop may be ignored.\n >\n {props.showLabel ? labelText : <></>}\n </DefaultButton>\n </ControlButtonTooltip>\n );\n};\n"]}
|
package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SitePermissions.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/DevicePermissions/SitePermissions.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,iDAAiD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C,iDAAiD;IACjD,MAAM,OAAO,GAAG,eAAe,CAC7B,KAAK,CAAC,IAAI,KAAK,QAAQ;QACrB,CAAC,CAAC,KAAK,CAAC,WAAW,KAAK,QAAQ;YAC9B,CAAC,CAAC,MAAM,CAAC,iCAAiC;YAC1C,CAAC,CAAC,MAAM,CAAC,2BAA2B;QACtC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS;YAC1B,CAAC,CAAC,MAAM,CAAC,4BAA4B;YACrC,CAAC,CAAC,MAAM,CAAC,0BAA0B,EACrC,KAAK,CAAC,OAAO,CACd,CAAC;IAEF,iDAAiD;IACjD,MAAM,QAAQ,GACZ,CAAA,MAAA,KAAK,CAAC,cAAc,mCAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,sBAAsB,CAAC;IAE1G,iDAAiD;IACjD,OAAO,CACL,oBAAC,wBAAwB,oBACnB,KAAK,IACT,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,QAAQ,EAC5B,oBAAoB,EAAE,KAAK,CAAC,qBAAqB,IACjD,CACH,CAAC;IACF,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useLocale } from '../../localization';\nimport { SitePermissionsStrings, SitePermissionsStyles } from './SitePermissionsScaffolding';\n/* @conditional-compile-remove(call-readiness) */\nimport { SitePermissionsContainer } from './SitePermissionsScaffolding';\n/* @conditional-compile-remove(call-readiness) */\nimport { useShallowMerge } from '../utils/merge';\n\n/**\n * @beta\n * Props for SitePermissions components.\n */\nexport interface CommonSitePermissionsProps {\n /**\n * Name of application calling experience is in.\n */\n appName: string;\n /**\n * Kind of the Site Permissions component.\n */\n kind: 'request' | 'denied' | 'check';\n /**\n * Type of the browser used, the Site permission component will show different guidance text based on the browser type\n */\n browserHint?: 'safari' | 'unset';\n /**\n * Action to be taken by the more help link. Possible to send to external page or show other modal.\n * If this is not provided the button will not be shown.\n */\n onTroubleshootingClick?: () => void;\n /**\n * Action that is taken when the user clicks the continue anyway button.\n * If this is not provided the button will not be shown.\n */\n onContinueAnywayClick?: () => void;\n /**\n * Styles for SitePermissions component.\n */\n styles?: SitePermissionsStyles;\n}\n\n/**\n * @beta\n * Strings for CameraAndMicrophoneSitePermissions component.\n */\nexport type CameraAndMicrophoneSitePermissionsStrings = SitePermissionsStrings;\n\n/**\n * @beta\n * Props for CameraAndMicrophoneSitePermissions component.\n */\nexport interface CameraAndMicrophoneSitePermissionsProps extends CommonSitePermissionsProps {\n /** Icon name for the camera icon */\n cameraIconName?: string;\n /** Icon name for the microphone icon */\n microphoneIconName?: string;\n /** Icon name for the central icon between the camera and microphone icons */\n connectorIconName?: string;\n /** Strings for use with the {@link CameraAndMicrophoneSitePermissions} */\n strings?: CameraAndMicrophoneSitePermissionsStrings;\n}\n\n/**\n * @beta\n *\n * Component to allow Contoso to help their end user with their devices should their permissions be blocked\n * by their browsers settings.\n */\nexport const CameraAndMicrophoneSitePermissions = (props: CameraAndMicrophoneSitePermissionsProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings;\n\n /* @conditional-compile-remove(call-readiness) */\n const strings = useShallowMerge(\n props.kind === 'denied'\n ? props.browserHint === 'safari'\n ? locale.CameraAndMicrophoneSitePermissionsDeniedSafari\n : locale.CameraAndMicrophoneSitePermissionsDenied\n : props.kind === 'request'\n ? locale.CameraAndMicrophoneSitePermissionsRequest\n : locale.CameraAndMicrophoneSitePermissionsCheck,\n props.strings\n );\n\n /* @conditional-compile-remove(call-readiness) */\n const cameraIconName =\n props.microphoneIconName ?? props.kind === 'denied' ? 'SitePermissionCameraDenied' : 'SitePermissionCamera';\n /* @conditional-compile-remove(call-readiness) */\n const microphoneIconName =\n props.microphoneIconName ?? props.kind === 'denied' ? 'SitePermissionMicDenied' : 'SitePermissionMic';\n /* @conditional-compile-remove(call-readiness) */\n const connectorIconName = props.microphoneIconName ?? 'SitePermissionsSparkle';\n\n /* @conditional-compile-remove(call-readiness) */\n return (\n <SitePermissionsContainer\n {...props}\n strings={strings}\n cameraIconName={cameraIconName}\n connectorIconName={connectorIconName}\n microphoneIconName={microphoneIconName}\n onPrimaryButtonClick={props.onContinueAnywayClick}\n />\n );\n return <></>;\n};\n\n/**\n * @beta\n * Strings for MicrophoneSitePermissions component.\n */\nexport type MicrophoneSitePermissionsStrings = SitePermissionsStrings;\n\n/**\n * @beta\n * Props for MicrophoneSitePermissions component.\n */\nexport interface MicrophoneSitePermissionsProps extends CommonSitePermissionsProps {\n /** Icon name for the microphone icon */\n microphoneIconName?: string;\n /** Strings for use with the {@link MicrophoneSitePermissions} */\n strings?: MicrophoneSitePermissionsStrings;\n}\n\n/**\n * Component to allow Contoso to help their end user with their devices should their permissions be blocked\n * by their browsers settings.\n *\n * @beta\n */\nexport const MicrophoneSitePermissions = (props: MicrophoneSitePermissionsProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings;\n\n /* @conditional-compile-remove(call-readiness) */\n const strings = useShallowMerge(\n props.kind === 'denied'\n ? props.browserHint === 'safari'\n ? locale.MicrophoneSitePermissionsDeniedSafari\n : locale.MicrophoneSitePermissionsDenied\n : props.kind === 'request'\n ? locale.MicrophoneSitePermissionsRequest\n : locale.MicrophoneSitePermissionsCheck,\n props.strings\n );\n\n /* @conditional-compile-remove(call-readiness) */\n const iconName =\n props.microphoneIconName ?? props.kind === 'denied' ? 'SitePermissionMicDenied' : 'SitePermissionMic';\n\n /* @conditional-compile-remove(call-readiness) */\n return (\n <SitePermissionsContainer\n {...props}\n strings={strings}\n cameraIconName={iconName}\n onPrimaryButtonClick={props.onContinueAnywayClick}\n />\n );\n return <></>;\n};\n\n/**\n * @beta\n * Strings for CameraSitePermissions component.\n */\nexport type CameraSitePermissionsStrings = SitePermissionsStrings;\n\n/**\n * @beta\n * Props for CameraSitePermissions component.\n */\nexport interface CameraSitePermissionsProps extends CommonSitePermissionsProps {\n /** Icon name for the camera icon */\n cameraIconName?: string;\n /** Strings for use with the {@link CameraSitePermissions} */\n strings?: CameraSitePermissionsStrings;\n}\n\n/**\n * Component to allow Contoso to help their end user with their devices should their permissions be blocked\n * by their browsers settings.\n *\n * @beta\n */\nexport const CameraSitePermissions = (props: CameraSitePermissionsProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings;\n\n /* @conditional-compile-remove(call-readiness) */\n const strings = useShallowMerge(\n props.kind === 'denied'\n ? props.browserHint === 'safari'\n ? locale.CameraSitePermissionsDeniedSafari\n : locale.CameraSitePermissionsDenied\n : props.kind === 'request'\n ? locale.CameraSitePermissionsRequest\n : locale.CameraSitePermissionsCheck,\n props.strings\n );\n\n /* @conditional-compile-remove(call-readiness) */\n const iconName =\n props.cameraIconName ?? props.kind === 'denied' ? 'SitePermissionCameraDenied' : 'SitePermissionCamera';\n\n /* @conditional-compile-remove(call-readiness) */\n return (\n <SitePermissionsContainer\n {...props}\n strings={strings}\n microphoneIconName={iconName}\n onPrimaryButtonClick={props.onContinueAnywayClick}\n />\n );\n return <></>;\n};\n"]}
|
1
|
+
{"version":3,"file":"SitePermissions.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/DevicePermissions/SitePermissions.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,iDAAiD;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,iDAAiD;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,iDAAiD;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAwDjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,KAA8C,EAAe,EAAE;;IAChH,iDAAiD;IACjD,MAAM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YACrC,CAAC,CAAC,MAAM,CAAC,0BAA0B,EACvC,KAAK,CAAC,OAAO,CACd,CAAC;IAEF,iDAAiD;IACjD,MAAM,QAAQ,GACZ,CAAA,MAAA,KAAK,CAAC,cAAc,mCAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,sBAAsB,CAAC;IAE1G,iDAAiD;IACjD,OAAO,CACL,oBAAC,wBAAwB,oBACnB,KAAK,IACT,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,QAAQ,EAC5B,oBAAoB,EAAE,KAAK,CAAC,qBAAqB,IACjD,CACH,CAAC;IACF,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useLocale } from '../../localization';\nimport { SitePermissionsStrings, SitePermissionsStyles } from './SitePermissionsScaffolding';\n/* @conditional-compile-remove(call-readiness) */\nimport { SitePermissionsContainer } from './SitePermissionsScaffolding';\n/* @conditional-compile-remove(call-readiness) */\nimport { useShallowMerge } from '../utils/merge';\n\n/**\n * @beta\n * Props for SitePermissions components.\n */\nexport interface CommonSitePermissionsProps {\n /**\n * Name of application calling experience is in.\n */\n appName: string;\n /**\n * Kind of the Site Permissions component.\n */\n kind: 'request' | 'denied' | 'check';\n /**\n * Type of the browser used, the Site permission component will show different guidance text based on the browser type\n */\n browserHint?: 'safari' | 'unset';\n /**\n * Action to be taken by the more help link. Possible to send to external page or show other modal.\n * If this is not provided the button will not be shown.\n */\n onTroubleshootingClick?: () => void;\n /**\n * Action that is taken when the user clicks the continue anyway button.\n * If this is not provided the button will not be shown.\n */\n onContinueAnywayClick?: () => void;\n /**\n * Styles for SitePermissions component.\n */\n styles?: SitePermissionsStyles;\n}\n\n/**\n * @beta\n * Strings for CameraAndMicrophoneSitePermissions component.\n */\nexport type CameraAndMicrophoneSitePermissionsStrings = SitePermissionsStrings;\n\n/**\n * @beta\n * Props for CameraAndMicrophoneSitePermissions component.\n */\nexport interface CameraAndMicrophoneSitePermissionsProps extends CommonSitePermissionsProps {\n /** Icon name for the camera icon */\n cameraIconName?: string;\n /** Icon name for the microphone icon */\n microphoneIconName?: string;\n /** Icon name for the central icon between the camera and microphone icons */\n connectorIconName?: string;\n /** Strings for use with the {@link CameraAndMicrophoneSitePermissions} */\n strings?: CameraAndMicrophoneSitePermissionsStrings;\n}\n\n/**\n * @beta\n *\n * Component to allow Contoso to help their end user with their devices should their permissions be blocked\n * by their browsers settings.\n */\nexport const CameraAndMicrophoneSitePermissions = (props: CameraAndMicrophoneSitePermissionsProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings;\n\n /* @conditional-compile-remove(call-readiness) */\n const strings = useShallowMerge(\n props.kind === 'denied'\n ? props.browserHint === 'safari'\n ? locale.CameraAndMicrophoneSitePermissionsDeniedSafari\n : locale.CameraAndMicrophoneSitePermissionsDenied\n : props.kind === 'request'\n ? locale.CameraAndMicrophoneSitePermissionsRequest\n : locale.CameraAndMicrophoneSitePermissionsCheck,\n props.strings\n );\n\n /* @conditional-compile-remove(call-readiness) */\n const cameraIconName =\n props.microphoneIconName ?? props.kind === 'denied' ? 'SitePermissionCameraDenied' : 'SitePermissionCamera';\n /* @conditional-compile-remove(call-readiness) */\n const microphoneIconName =\n props.microphoneIconName ?? props.kind === 'denied' ? 'SitePermissionMicDenied' : 'SitePermissionMic';\n /* @conditional-compile-remove(call-readiness) */\n const connectorIconName = props.microphoneIconName ?? 'SitePermissionsSparkle';\n\n /* @conditional-compile-remove(call-readiness) */\n return (\n <SitePermissionsContainer\n {...props}\n strings={strings}\n cameraIconName={cameraIconName}\n connectorIconName={connectorIconName}\n microphoneIconName={microphoneIconName}\n onPrimaryButtonClick={props.onContinueAnywayClick}\n />\n );\n return <></>;\n};\n\n/**\n * @beta\n * Strings for MicrophoneSitePermissions component.\n */\nexport type MicrophoneSitePermissionsStrings = SitePermissionsStrings;\n\n/**\n * @beta\n * Props for MicrophoneSitePermissions component.\n */\nexport interface MicrophoneSitePermissionsProps extends CommonSitePermissionsProps {\n /** Icon name for the microphone icon */\n microphoneIconName?: string;\n /** Strings for use with the {@link MicrophoneSitePermissions} */\n strings?: MicrophoneSitePermissionsStrings;\n}\n\n/**\n * Component to allow Contoso to help their end user with their devices should their permissions be blocked\n * by their browsers settings.\n *\n * @beta\n */\nexport const MicrophoneSitePermissions = (props: MicrophoneSitePermissionsProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings;\n\n /* @conditional-compile-remove(call-readiness) */\n const strings = useShallowMerge(\n props.kind === 'denied'\n ? props.browserHint === 'safari'\n ? locale.MicrophoneSitePermissionsDeniedSafari\n : locale.MicrophoneSitePermissionsDenied\n : props.kind === 'request'\n ? locale.MicrophoneSitePermissionsRequest\n : locale.MicrophoneSitePermissionsCheck,\n props.strings\n );\n\n /* @conditional-compile-remove(call-readiness) */\n const iconName =\n props.microphoneIconName ?? props.kind === 'denied' ? 'SitePermissionMicDenied' : 'SitePermissionMic';\n\n /* @conditional-compile-remove(call-readiness) */\n return (\n <SitePermissionsContainer\n {...props}\n strings={strings}\n cameraIconName={iconName}\n onPrimaryButtonClick={props.onContinueAnywayClick}\n />\n );\n return <></>;\n};\n\n/**\n * @beta\n * Strings for CameraSitePermissions component.\n */\nexport type CameraSitePermissionsStrings = SitePermissionsStrings;\n\n/**\n * @beta\n * Props for CameraSitePermissions component.\n */\nexport interface CameraSitePermissionsProps extends CommonSitePermissionsProps {\n /** Icon name for the camera icon */\n cameraIconName?: string;\n /** Strings for use with the {@link CameraSitePermissions} */\n strings?: CameraSitePermissionsStrings;\n}\n\n/**\n * Component to allow Contoso to help their end user with their devices should their permissions be blocked\n * by their browsers settings.\n *\n * @beta\n */\nexport const CameraSitePermissions = (props: CameraSitePermissionsProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings;\n\n /* @conditional-compile-remove(call-readiness) */\n const strings = useShallowMerge(\n props.kind === 'denied'\n ? props.browserHint === 'safari'\n ? locale.CameraSitePermissionsDeniedSafari\n : locale.CameraSitePermissionsDenied\n : props.kind === 'request'\n ? locale.CameraSitePermissionsRequest\n : locale.CameraSitePermissionsCheck,\n props.strings\n );\n\n /* @conditional-compile-remove(call-readiness) */\n const iconName =\n props.cameraIconName ?? props.kind === 'denied' ? 'SitePermissionCameraDenied' : 'SitePermissionCamera';\n\n /* @conditional-compile-remove(call-readiness) */\n return (\n <SitePermissionsContainer\n {...props}\n strings={strings}\n microphoneIconName={iconName}\n onPrimaryButtonClick={props.onContinueAnywayClick}\n />\n );\n return <></>;\n};\n"]}
|
@@ -182,6 +182,10 @@ export interface ErrorBarStrings {
|
|
182
182
|
* An error message when starting spotlight while max participants are spotlighted
|
183
183
|
*/
|
184
184
|
startSpotlightWhileMaxParticipantsAreSpotlighted: string;
|
185
|
+
/**
|
186
|
+
* An error message when local user is muted by a remote participant
|
187
|
+
*/
|
188
|
+
mutedByRemoteParticipant: string;
|
185
189
|
}
|
186
190
|
/**
|
187
191
|
* All errors that can be shown in the {@link ErrorBar}.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ErrorBar.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ErrorBar.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAoB,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAEL,YAAY,EACZ,+BAA+B,EAC/B,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACf,MAAM,SAAS,CAAC;AAqPjB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,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rB;SACF,EACD,GAAG,EAAE,KAAK,CAAC,IAAI,EACf,cAAc,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAC1C,mBAAmB,EAAE,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,EACpD,SAAS,EAAE,GAAG,EAAE;;YACd,OAAA,8BAA8B;gBAC5B,CAAC,CAAC,kBAAkB,CAAC,YAAY,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;gBAC1D,CAAC,CAAC,MAAA,KAAK,CAAC,cAAc,sDAAG,KAAK,CAAC,CAAA;SAAA,EAEnC,sBAAsB,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,sBAAsB,EAAE,EACnF,gBAAgB,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,KAE9C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CACT,CACd,CAAC,CACI,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useEffect, useRef, useState } from 'react';\nimport { IMessageBarProps, MessageBar, Stack } from '@fluentui/react';\nimport { useLocale } from '../localization';\nimport {\n DismissedError,\n dismissError,\n dropDismissalsForInactiveErrors,\n errorsToShow,\n messageBarIconProps,\n messageBarType\n} from './utils';\n\n/**\n * Props for {@link ErrorBar}.\n *\n * In addition to the following, {@link ErrorBar} forwards all\n * {@link @fluentui/react#IMessageBarProps} to the underlying {@link @fluentui/react#MessageBar}.\n *\n * @public\n */\nexport interface ErrorBarProps extends IMessageBarProps {\n /**\n * Strings shown on the UI on errors.\n */\n strings?: ErrorBarStrings;\n\n /**\n * Currently active errors.\n */\n activeErrorMessages: ActiveErrorMessage[];\n\n /**\n * If set, errors with {@link ActiveErrorMessage.timestamp} older than the time this component is mounted\n * are not shown.\n *\n * This is useful when using the {@link ErrorBar} with a stateful client that handles more than one call\n * or chat thread. Set this prop to ignore errors from previous call or chat.\n *\n * @defaultValue false\n */\n ignorePremountErrors?: boolean;\n\n /**\n * Callback called when the dismiss button is triggered.\n * Use this to control errors shown when they dismissed by the user.\n */\n onDismissError?: (dismissedError: ActiveErrorMessage) => void;\n}\n\n/**\n * All strings that may be shown on the UI in the {@link ErrorBar}.\n *\n * @public\n */\nexport interface ErrorBarStrings {\n /**\n * Unable to reach Chat service.\n *\n * This can mean:\n * - Incorrect Azure Communication Services endpoint was provided.\n * - User's network connection is down.\n */\n unableToReachChatService: string;\n\n /**\n * User does not have access to the Chat service.\n * This usually means that either the Azure Communication Services endpiont or the token provided are incorrect.\n */\n accessDenied: string;\n\n /**\n * User is no longer on the thread.\n *\n * See also: {@link ErrorBarStrings.sendMessageNotInChatThread} for a more specific error.\n */\n userNotInChatThread: string;\n\n /**\n * Sending message failed because user is no longer on the thread.\n */\n sendMessageNotInChatThread: string;\n\n /**\n * A generic message when sending message fails.\n * Prefer more specific error strings when possible.\n */\n sendMessageGeneric: string;\n\n /**\n * A generic message when starting video fails.\n */\n startVideoGeneric: string;\n\n /**\n * A generic message when starting video fails.\n */\n stopVideoGeneric: string;\n\n /**\n * A generic message when muting microphone fails.\n */\n muteGeneric: string;\n\n /**\n * A generic message when unmuting microphone fails.\n */\n unmuteGeneric: string;\n\n /**\n * A generic message when starting screenshare fails.\n */\n startScreenShareGeneric: string;\n\n /**\n * A generic message when stopping screenshare fails.\n */\n stopScreenShareGeneric: string;\n\n /**\n * Message shown when poor network quality is detected during a call.\n */\n callNetworkQualityLow: string;\n\n /**\n * Message shown on failure to detect audio output devices.\n */\n callNoSpeakerFound: string;\n\n /**\n * Message shown on failure to detect audio input devices.\n */\n callNoMicrophoneFound: string;\n\n /**\n * Message shown when microphone can be enumerated but access is blocked by the system.\n */\n callMicrophoneAccessDenied: string;\n\n /**\n * Message shown when microphone can be enumerated but access is blocked by the system, for safari browsers\n */\n callMicrophoneAccessDeniedSafari: string;\n\n /**\n * Message shown when microphone is muted by the system (not by local or remote participants)\n */\n callMicrophoneMutedBySystem: string;\n\n /**\n * Message shown when microphone is unmuted by the system (not by local or remote participants).\n * This typically occurs if the system recovers from an unexpected mute.\n */\n callMicrophoneUnmutedBySystem: string;\n\n /**\n * Mac OS specific message shown when microphone can be enumerated but access is\n * blocked by the system.\n */\n callMacOsMicrophoneAccessDenied: string;\n\n /**\n * Message shown when poor network causes local video stream to be frozen.\n */\n callLocalVideoFreeze: string;\n\n /**\n * Message shown when camera can be enumerated but access is blocked by the system.\n */\n callCameraAccessDenied: string;\n\n /**\n * Message shown when camera can be enumerated but access is blocked by the system, for safari browsers\n */\n callCameraAccessDeniedSafari: string;\n\n /**\n * Message shown when local video fails to start because camera is already in use by\n * another applciation.\n */\n callCameraAlreadyInUse: string;\n\n /**\n * Message shown when local video is stopped by the system (not by local or remote participants)\n */\n callVideoStoppedBySystem: string;\n\n /**\n * Message shown when local video was recovered by the system (not by the local participant)\n */\n callVideoRecoveredBySystem: string;\n\n /**\n * Mac OS specific message shown when system denies access to camera.\n */\n callMacOsCameraAccessDenied: string;\n\n /**\n * Mac OS specific message shown when system denies sharing local screen on a call.\n */\n callMacOsScreenShareAccessDenied: string;\n /**\n * Dimiss errorbar button aria label read by screen reader accessibility tools\n */\n dismissButtonAriaLabel?: string;\n\n /**\n * An error message when joining a call fails.\n */\n failedToJoinCallGeneric?: string;\n\n /**\n * An error message when joining a call fails specifically due to an invalid meeting link.\n */\n failedToJoinCallInvalidMeetingLink?: string;\n /**\n * Error bar string letting you know remote participants see a frozen stream for you.\n */\n cameraFrozenForRemoteParticipants?: string;\n\n /**\n * Unable to start effect\n */\n unableToStartVideoEffect?: string;\n /**\n * An error message when starting spotlight while max participants are spotlighted\n */\n startSpotlightWhileMaxParticipantsAreSpotlighted: string;\n}\n\n/**\n * All errors that can be shown in the {@link ErrorBar}.\n *\n * @public\n */\nexport type ErrorType = keyof ErrorBarStrings;\n\n/**\n * Active error messages to be shown via {@link ErrorBar}.\n *\n * @public\n */\nexport interface ActiveErrorMessage {\n /**\n * Type of error that is active.\n */\n type: ErrorType;\n /**\n * The latest timestamp when this error was observed.\n *\n * When available, this is used to track errors that have already been seen and dismissed\n * by the user.\n */\n timestamp?: Date;\n}\n\n/**\n * A component to show error messages on the UI.\n * All strings that can be shown are accepted as the {@link ErrorBarProps.strings} so that they can be localized.\n * Active errors are selected by {@link ErrorBarProps.activeErrorMessages}.\n *\n * This component internally tracks dismissed by the user.\n * * Errors that have an associated timestamp: The error is shown on the UI again if it occurs after being dismissed.\n * * Errors that do not have a timestamp: The error is dismissed until it disappears from the props.\n * If the error recurs, it is shown in the UI.\n *\n * Uses {@link @fluentui/react#MessageBar} UI element.\n *\n * @public\n */\nexport const ErrorBar = (props: ErrorBarProps): JSX.Element => {\n const localeStrings = useLocale().strings.errorBar;\n const strings = props.strings ?? localeStrings;\n\n const trackDismissedErrorsInternally = !props.onDismissError;\n\n // Timestamp for when this comopnent is first mounted.\n // Never updated through the lifecycle of this component.\n const mountTimestamp = useRef(new Date(Date.now()));\n\n const [dismissedErrors, setDismissedErrors] = useState<DismissedError[]>([]);\n\n // dropDismissalsForInactiveErrors only returns a new object if `dismissedErrors` actually changes.\n // Without this behaviour, this `useEffect` block would cause a render loop.\n useEffect(() => {\n trackDismissedErrorsInternally &&\n setDismissedErrors(dropDismissalsForInactiveErrors(props.activeErrorMessages, dismissedErrors));\n }, [props.activeErrorMessages, dismissedErrors, trackDismissedErrorsInternally]);\n\n const toShow = errorsToShow(\n props.activeErrorMessages,\n dismissedErrors,\n props.ignorePremountErrors ? mountTimestamp.current : undefined\n );\n\n return (\n <Stack data-ui-id=\"notifications-stack\">\n {toShow.map((error) => (\n <MessageBar\n {...props}\n styles={{\n innerText: {\n alignSelf: 'center'\n },\n icon: {\n height: 0\n },\n content: {\n lineHeight: 'inherit'\n },\n dismissal: {\n height: 0,\n paddingTop: '0.8rem'\n }\n }}\n key={error.type}\n messageBarType={messageBarType(error.type)}\n messageBarIconProps={messageBarIconProps(error.type)}\n onDismiss={() =>\n trackDismissedErrorsInternally\n ? setDismissedErrors(dismissError(dismissedErrors, error))\n : props.onDismissError?.(error)\n }\n dismissButtonAriaLabel={`${strings[error.type]}, ${strings.dismissButtonAriaLabel}`}\n dismissIconProps={{ iconName: 'ErrorBarClear' }}\n >\n {strings[error.type]}\n </MessageBar>\n ))}\n </Stack>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"ErrorBar.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ErrorBar.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAoB,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAEL,YAAY,EACZ,+BAA+B,EAC/B,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACf,MAAM,SAAS,CAAC;AA4PjB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAe,EAAE;;IAC5D,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;IACnD,MAAM,OAAO,GAAG,MAAA,KAAK,CAAC,OAAO,mCAAI,aAAa,CAAC;IAE/C,MAAM,8BAA8B,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC;IAE7D,sDAAsD;IACtD,yDAAyD;IACzD,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAEpD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAmB,EAAE,CAAC,CAAC;IAE7E,mGAAmG;IACnG,4EAA4E;IAC5E,SAAS,CAAC,GAAG,EAAE;QACb,8BAA8B;YAC5B,kBAAkB,CAAC,+BAA+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ACT,CACd,CAAC,CACI,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useEffect, useRef, useState } from 'react';\nimport { IMessageBarProps, MessageBar, Stack } from '@fluentui/react';\nimport { useLocale } from '../localization';\nimport {\n DismissedError,\n dismissError,\n dropDismissalsForInactiveErrors,\n errorsToShow,\n messageBarIconProps,\n messageBarType\n} from './utils';\n\n/**\n * Props for {@link ErrorBar}.\n *\n * In addition to the following, {@link ErrorBar} forwards all\n * {@link @fluentui/react#IMessageBarProps} to the underlying {@link @fluentui/react#MessageBar}.\n *\n * @public\n */\nexport interface ErrorBarProps extends IMessageBarProps {\n /**\n * Strings shown on the UI on errors.\n */\n strings?: ErrorBarStrings;\n\n /**\n * Currently active errors.\n */\n activeErrorMessages: ActiveErrorMessage[];\n\n /**\n * If set, errors with {@link ActiveErrorMessage.timestamp} older than the time this component is mounted\n * are not shown.\n *\n * This is useful when using the {@link ErrorBar} with a stateful client that handles more than one call\n * or chat thread. Set this prop to ignore errors from previous call or chat.\n *\n * @defaultValue false\n */\n ignorePremountErrors?: boolean;\n\n /**\n * Callback called when the dismiss button is triggered.\n * Use this to control errors shown when they dismissed by the user.\n */\n onDismissError?: (dismissedError: ActiveErrorMessage) => void;\n}\n\n/**\n * All strings that may be shown on the UI in the {@link ErrorBar}.\n *\n * @public\n */\nexport interface ErrorBarStrings {\n /**\n * Unable to reach Chat service.\n *\n * This can mean:\n * - Incorrect Azure Communication Services endpoint was provided.\n * - User's network connection is down.\n */\n unableToReachChatService: string;\n\n /**\n * User does not have access to the Chat service.\n * This usually means that either the Azure Communication Services endpiont or the token provided are incorrect.\n */\n accessDenied: string;\n\n /**\n * User is no longer on the thread.\n *\n * See also: {@link ErrorBarStrings.sendMessageNotInChatThread} for a more specific error.\n */\n userNotInChatThread: string;\n\n /**\n * Sending message failed because user is no longer on the thread.\n */\n sendMessageNotInChatThread: string;\n\n /**\n * A generic message when sending message fails.\n * Prefer more specific error strings when possible.\n */\n sendMessageGeneric: string;\n\n /**\n * A generic message when starting video fails.\n */\n startVideoGeneric: string;\n\n /**\n * A generic message when starting video fails.\n */\n stopVideoGeneric: string;\n\n /**\n * A generic message when muting microphone fails.\n */\n muteGeneric: string;\n\n /**\n * A generic message when unmuting microphone fails.\n */\n unmuteGeneric: string;\n\n /**\n * A generic message when starting screenshare fails.\n */\n startScreenShareGeneric: string;\n\n /**\n * A generic message when stopping screenshare fails.\n */\n stopScreenShareGeneric: string;\n\n /**\n * Message shown when poor network quality is detected during a call.\n */\n callNetworkQualityLow: string;\n\n /**\n * Message shown on failure to detect audio output devices.\n */\n callNoSpeakerFound: string;\n\n /**\n * Message shown on failure to detect audio input devices.\n */\n callNoMicrophoneFound: string;\n\n /**\n * Message shown when microphone can be enumerated but access is blocked by the system.\n */\n callMicrophoneAccessDenied: string;\n\n /**\n * Message shown when microphone can be enumerated but access is blocked by the system, for safari browsers\n */\n callMicrophoneAccessDeniedSafari: string;\n\n /**\n * Message shown when microphone is muted by the system (not by local or remote participants)\n */\n callMicrophoneMutedBySystem: string;\n\n /**\n * Message shown when microphone is unmuted by the system (not by local or remote participants).\n * This typically occurs if the system recovers from an unexpected mute.\n */\n callMicrophoneUnmutedBySystem: string;\n\n /**\n * Mac OS specific message shown when microphone can be enumerated but access is\n * blocked by the system.\n */\n callMacOsMicrophoneAccessDenied: string;\n\n /**\n * Message shown when poor network causes local video stream to be frozen.\n */\n callLocalVideoFreeze: string;\n\n /**\n * Message shown when camera can be enumerated but access is blocked by the system.\n */\n callCameraAccessDenied: string;\n\n /**\n * Message shown when camera can be enumerated but access is blocked by the system, for safari browsers\n */\n callCameraAccessDeniedSafari: string;\n\n /**\n * Message shown when local video fails to start because camera is already in use by\n * another applciation.\n */\n callCameraAlreadyInUse: string;\n\n /**\n * Message shown when local video is stopped by the system (not by local or remote participants)\n */\n callVideoStoppedBySystem: string;\n\n /**\n * Message shown when local video was recovered by the system (not by the local participant)\n */\n callVideoRecoveredBySystem: string;\n\n /**\n * Mac OS specific message shown when system denies access to camera.\n */\n callMacOsCameraAccessDenied: string;\n\n /**\n * Mac OS specific message shown when system denies sharing local screen on a call.\n */\n callMacOsScreenShareAccessDenied: string;\n /**\n * Dimiss errorbar button aria label read by screen reader accessibility tools\n */\n dismissButtonAriaLabel?: string;\n\n /**\n * An error message when joining a call fails.\n */\n failedToJoinCallGeneric?: string;\n\n /**\n * An error message when joining a call fails specifically due to an invalid meeting link.\n */\n failedToJoinCallInvalidMeetingLink?: string;\n /**\n * Error bar string letting you know remote participants see a frozen stream for you.\n */\n cameraFrozenForRemoteParticipants?: string;\n\n /**\n * Unable to start effect\n */\n unableToStartVideoEffect?: string;\n\n /**\n * An error message when starting spotlight while max participants are spotlighted\n */\n startSpotlightWhileMaxParticipantsAreSpotlighted: string;\n\n /* @conditional-compile-remove(soft-mute) */\n /**\n * An error message when local user is muted by a remote participant\n */\n mutedByRemoteParticipant: string;\n}\n\n/**\n * All errors that can be shown in the {@link ErrorBar}.\n *\n * @public\n */\nexport type ErrorType = keyof ErrorBarStrings;\n\n/**\n * Active error messages to be shown via {@link ErrorBar}.\n *\n * @public\n */\nexport interface ActiveErrorMessage {\n /**\n * Type of error that is active.\n */\n type: ErrorType;\n /**\n * The latest timestamp when this error was observed.\n *\n * When available, this is used to track errors that have already been seen and dismissed\n * by the user.\n */\n timestamp?: Date;\n}\n\n/**\n * A component to show error messages on the UI.\n * All strings that can be shown are accepted as the {@link ErrorBarProps.strings} so that they can be localized.\n * Active errors are selected by {@link ErrorBarProps.activeErrorMessages}.\n *\n * This component internally tracks dismissed by the user.\n * * Errors that have an associated timestamp: The error is shown on the UI again if it occurs after being dismissed.\n * * Errors that do not have a timestamp: The error is dismissed until it disappears from the props.\n * If the error recurs, it is shown in the UI.\n *\n * Uses {@link @fluentui/react#MessageBar} UI element.\n *\n * @public\n */\nexport const ErrorBar = (props: ErrorBarProps): JSX.Element => {\n const localeStrings = useLocale().strings.errorBar;\n const strings = props.strings ?? localeStrings;\n\n const trackDismissedErrorsInternally = !props.onDismissError;\n\n // Timestamp for when this comopnent is first mounted.\n // Never updated through the lifecycle of this component.\n const mountTimestamp = useRef(new Date(Date.now()));\n\n const [dismissedErrors, setDismissedErrors] = useState<DismissedError[]>([]);\n\n // dropDismissalsForInactiveErrors only returns a new object if `dismissedErrors` actually changes.\n // Without this behaviour, this `useEffect` block would cause a render loop.\n useEffect(() => {\n trackDismissedErrorsInternally &&\n setDismissedErrors(dropDismissalsForInactiveErrors(props.activeErrorMessages, dismissedErrors));\n }, [props.activeErrorMessages, dismissedErrors, trackDismissedErrorsInternally]);\n\n const toShow = errorsToShow(\n props.activeErrorMessages,\n dismissedErrors,\n props.ignorePremountErrors ? mountTimestamp.current : undefined\n );\n\n return (\n <Stack data-ui-id=\"notifications-stack\">\n {toShow.map((error) => (\n <MessageBar\n {...props}\n styles={{\n innerText: {\n alignSelf: 'center'\n },\n icon: {\n height: 0\n },\n content: {\n lineHeight: 'inherit'\n },\n dismissal: {\n height: 0,\n paddingTop: '0.8rem'\n }\n }}\n key={error.type}\n messageBarType={messageBarType(error.type)}\n messageBarIconProps={messageBarIconProps(error.type)}\n onDismiss={() =>\n trackDismissedErrorsInternally\n ? setDismissedErrors(dismissError(dismissedErrors, error))\n : props.onDismissError?.(error)\n }\n dismissButtonAriaLabel={`${strings[error.type]}, ${strings.dismissButtonAriaLabel}`}\n dismissIconProps={{ iconName: 'ErrorBarClear' }}\n >\n {strings[error.type]}\n </MessageBar>\n ))}\n </Stack>\n );\n};\n"]}
|
@@ -24,10 +24,6 @@ export interface MeetingConferencePhoneInfoModalStrings {
|
|
24
24
|
* Toll Free Phone Label
|
25
25
|
*/
|
26
26
|
meetingConferencePhoneInfoModalTollFree?: string;
|
27
|
-
/**
|
28
|
-
* Toll Free Phone Label without geo data
|
29
|
-
*/
|
30
|
-
meetingConferencePhoneInfoModalTollFreeWithoutGeoData?: string;
|
31
27
|
/**
|
32
28
|
* Toll Phone Label
|
33
29
|
*/
|
@@ -35,27 +31,11 @@ export interface MeetingConferencePhoneInfoModalStrings {
|
|
35
31
|
/**
|
36
32
|
* Toll Phone Label without geo data
|
37
33
|
*/
|
38
|
-
|
34
|
+
meetingConferencePhoneInfoModalTollGeoData?: string;
|
39
35
|
/**
|
40
36
|
* No phone number available message
|
41
37
|
*/
|
42
38
|
meetingConferencePhoneInfoModalNoPhoneAvailable?: string;
|
43
|
-
/**
|
44
|
-
* Bad quality bar title
|
45
|
-
*/
|
46
|
-
badQualityBarTitle?: string;
|
47
|
-
/**
|
48
|
-
* Bad quality bar message
|
49
|
-
*/
|
50
|
-
badQualityBarMessage?: string;
|
51
|
-
/**
|
52
|
-
* Bad quality bar close button aria label
|
53
|
-
*/
|
54
|
-
badQualityBarClose?: string;
|
55
|
-
/**
|
56
|
-
* Bad quality bar join button label
|
57
|
-
*/
|
58
|
-
badQualityBarJoin?: string;
|
59
39
|
}
|
60
40
|
/**
|
61
41
|
* @beta
|
@@ -47,7 +47,13 @@ export const MeetingConferencePhoneInfoModal = (props) => {
|
|
47
47
|
React.createElement(Stack.Item, null,
|
48
48
|
React.createElement(Text, { className: stepTextStyle }, strings === null || strings === void 0 ? void 0 : strings.meetingConferencePhoneInfoModalDialIn)))),
|
49
49
|
React.createElement(Stack.Item, { className: phoneInfoStep }, conferencePhoneInfoList.map((phoneNumber, index) => (React.createElement(Stack.Item, { key: index },
|
50
|
-
React.createElement(Text, { className: phoneInfoTextStyle },
|
50
|
+
React.createElement(Text, { className: phoneInfoTextStyle },
|
51
|
+
formatPhoneNumber(phoneNumber.phoneNumber),
|
52
|
+
' ',
|
53
|
+
phoneNumber.isTollFree
|
54
|
+
? strings.meetingConferencePhoneInfoModalTollFree
|
55
|
+
: strings.meetingConferencePhoneInfoModalToll),
|
56
|
+
React.createElement("br", null),
|
51
57
|
React.createElement(Text, { className: phoneInfoTextStyle },
|
52
58
|
" ",
|
53
59
|
formatPhoneNumberInfo(phoneNumber, strings))))))),
|
@@ -101,13 +107,7 @@ export const formatPhoneNumberLink = (phoneNumber) => {
|
|
101
107
|
* format phone number
|
102
108
|
*/
|
103
109
|
export const formatPhoneNumberInfo = (phoneNumber, strings) => {
|
104
|
-
const templateText = phoneNumber.
|
105
|
-
? phoneNumber.country && phoneNumber.city
|
106
|
-
? strings === null || strings === void 0 ? void 0 : strings.meetingConferencePhoneInfoModalTollFree
|
107
|
-
: strings === null || strings === void 0 ? void 0 : strings.meetingConferencePhoneInfoModalTollFreeWithoutGeoData
|
108
|
-
: phoneNumber.country && phoneNumber.city
|
109
|
-
? strings === null || strings === void 0 ? void 0 : strings.meetingConferencePhoneInfoModalToll
|
110
|
-
: strings === null || strings === void 0 ? void 0 : strings.meetingConferencePhoneInfoModalTollWithoutGeoData;
|
110
|
+
const templateText = phoneNumber.country && phoneNumber.city ? strings === null || strings === void 0 ? void 0 : strings.meetingConferencePhoneInfoModalTollGeoData : '';
|
111
111
|
return ((templateText === null || templateText === void 0 ? void 0 : templateText.replace('{phoneNumber}', formatPhoneNumber(phoneNumber.phoneNumber)).replace('{country}', phoneNumber.country || '').replace('{city}', phoneNumber.city || '').trim()) || '');
|
112
112
|
};
|
113
113
|
/* @conditional-compile-remove(teams-meeting-conference) */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MeetingConferencePhoneInfo.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MeetingConferencePhoneInfo.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,2DAA2D;AAC3D,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,2DAA2D;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,2DAA2D;AAC3D,OAAO,EAAgB,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE/F,2DAA2D;AAC3D,OAAO,EACL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;IAED,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAC/F,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport React, { useCallback } from 'react';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { useMemo } from 'react';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { IModalStyles, Modal, Stack, useTheme, Text, IconButton, Icon } from '@fluentui/react';\n\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport {\n themedPhoneInfoModalStyle,\n titleClassName,\n titleContainerClassName,\n phoneInfoTextStyle,\n phoneInfoIcon,\n phoneInfoInctructionLine,\n phoneInfoStep,\n stepTextStyle,\n infoConnectionLinkStyle,\n phoneInfoIconStyle\n} from './styles/TeamsMeetingConferenceInfo';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { _preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { isPossiblePhoneNumber, parsePhoneNumber } from 'libphonenumber-js';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { _pxToRem } from '@internal/acs-ui-common';\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * strings for phone info modal\n * @beta\n */\nexport interface MeetingConferencePhoneInfoModalStrings {\n /**\n * Header for the phone info modal\n */\n meetingConferencePhoneInfoModalTitle?: string;\n /**\n * Phone number instruction\n */\n meetingConferencePhoneInfoModalDialIn?: string;\n /**\n * Meeting ID instruction\n */\n meetingConferencePhoneInfoModalMeetingId?: string;\n /**\n * Wait for phone connection\n */\n meetingConferencePhoneInfoModalWait?: string;\n /**\n * Toll Free Phone Label\n */\n meetingConferencePhoneInfoModalTollFree?: string;\n /**\n * Toll Free Phone Label without geo data\n */\n meetingConferencePhoneInfoModalTollFreeWithoutGeoData?: string;\n /**\n * Toll Phone Label\n */\n meetingConferencePhoneInfoModalToll?: string;\n /**\n * Toll Phone Label without geo data\n */\n meetingConferencePhoneInfoModalTollWithoutGeoData?: string;\n /**\n * No phone number available message\n */\n meetingConferencePhoneInfoModalNoPhoneAvailable?: string;\n\n /**\n * Bad quality bar title\n */\n badQualityBarTitle?: string;\n\n /**\n * Bad quality bar message\n */\n badQualityBarMessage?: string;\n\n /**\n * Bad quality bar close button aria label\n */\n badQualityBarClose?: string;\n\n /**\n * Bad quality bar join button label\n */\n badQualityBarJoin?: string;\n}\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @beta\n * MeetingConferencePhoneInfoModal Component Props.\n */\nexport interface MeetingConferencePhoneInfoModalProps {\n conferencePhoneInfoList: ConferencePhoneInfo[];\n showModal?: boolean;\n onDismissMeetingPhoneInfoSettings?: () => void;\n}\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @beta\n * a component for setting spoken languages\n */\nexport const MeetingConferencePhoneInfoModal = (props: MeetingConferencePhoneInfoModalProps): JSX.Element => {\n const { conferencePhoneInfoList, showModal, onDismissMeetingPhoneInfoSettings } = props;\n\n const theme = useTheme();\n const strings = useLocale().strings.MeetingConferencePhoneInfo;\n\n const onDismiss = useCallback((): void => {\n if (onDismissMeetingPhoneInfoSettings) {\n onDismissMeetingPhoneInfoSettings();\n }\n }, [onDismissMeetingPhoneInfoSettings]);\n\n const PhoneInfoModalStyle: Partial<IModalStyles> = useMemo(() => themedPhoneInfoModalStyle(theme), [theme]);\n\n return (\n <>\n <Modal\n titleAriaId={strings?.meetingConferencePhoneInfoModalTitle}\n isOpen={showModal}\n onDismiss={onDismiss}\n isBlocking={true}\n styles={PhoneInfoModalStyle}\n >\n <Stack horizontal horizontalAlign=\"space-between\" verticalAlign=\"center\" className={titleContainerClassName}>\n <Text className={titleClassName}>{strings?.meetingConferencePhoneInfoModalTitle}</Text>\n <IconButton\n iconProps={{ iconName: 'Cancel' }}\n ariaLabel={strings?.meetingConferencePhoneInfoModalTitle}\n onClick={onDismiss}\n style={{ color: theme.palette.black }}\n />\n </Stack>\n {conferencePhoneInfoList.length === 0 && (\n <Stack horizontal>\n <Text className={stepTextStyle}>{strings?.meetingConferencePhoneInfoModalNoPhoneAvailable}</Text>\n </Stack>\n )}\n {conferencePhoneInfoList.length > 0 && (\n <Stack>\n <Stack horizontal horizontalAlign=\"space-between\" className={phoneInfoInctructionLine}>\n <Stack.Item style={{ display: 'flex' }}>\n <Stack horizontal className={phoneInfoStep}>\n <Stack className={infoConnectionLinkStyle(theme)}></Stack>\n <Stack.Item className={phoneInfoIcon(theme)}>\n <Stack verticalAlign=\"center\" horizontalAlign=\"center\">\n <Icon iconName=\"PhoneNumberButton\" className={phoneInfoIconStyle(theme)} />\n </Stack>\n </Stack.Item>\n <Stack.Item>\n <Text className={stepTextStyle}>{strings?.meetingConferencePhoneInfoModalDialIn}</Text>\n </Stack.Item>\n </Stack>\n </Stack.Item>\n <Stack.Item className={phoneInfoStep}>\n {conferencePhoneInfoList.map((phoneNumber, index) => (\n <Stack.Item key={index}>\n <Text className={phoneInfoTextStyle}>{formatPhoneNumber(phoneNumber.phoneNumber)}</Text>\n <Text className={phoneInfoTextStyle}> {formatPhoneNumberInfo(phoneNumber, strings)}</Text>\n </Stack.Item>\n ))}\n </Stack.Item>\n </Stack>\n <Stack\n horizontal\n horizontalAlign=\"space-between\"\n verticalAlign=\"center\"\n className={phoneInfoInctructionLine}\n >\n <Stack.Item style={{ display: 'flex' }}>\n <Stack horizontal>\n <Stack className={infoConnectionLinkStyle(theme)}></Stack>\n <Stack.Item className={phoneInfoIcon(theme)}>\n <Stack verticalAlign=\"center\" horizontalAlign=\"center\">\n <Icon iconName=\"DtmfDialpadButton\" className={phoneInfoIconStyle(theme)} />\n </Stack>\n </Stack.Item>\n <Stack.Item>\n <Text className={stepTextStyle}>{strings?.meetingConferencePhoneInfoModalMeetingId}</Text>\n </Stack.Item>\n </Stack>\n </Stack.Item>\n <Text className={phoneInfoTextStyle}>{formatMeetingId(conferencePhoneInfoList[0].conferenceId)}</Text>\n </Stack>\n <Stack horizontal horizontalAlign=\"space-between\" verticalAlign=\"center\">\n <Stack horizontal>\n <Stack.Item className={phoneInfoIcon(theme)} style={{ marginLeft: _pxToRem(2) }}>\n <Icon iconName=\"PhoneInfoWait\" className={phoneInfoIconStyle(theme)} />\n </Stack.Item>\n <Stack.Item>\n <Text className={stepTextStyle}>{strings?.meetingConferencePhoneInfoModalWait}</Text>\n </Stack.Item>\n </Stack>\n </Stack>\n </Stack>\n )}\n </Modal>\n </>\n );\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @internal\n * format phone number\n */\nexport const formatPhoneNumber = (phoneNumber: string): string => {\n if (!phoneNumber) {\n return '';\n }\n let enchantedPhoneNumber = phoneNumber;\n if (!phoneNumber.startsWith('+')) {\n enchantedPhoneNumber = `+${phoneNumber}`;\n }\n if (isPossiblePhoneNumber(enchantedPhoneNumber)) {\n return parsePhoneNumber(enchantedPhoneNumber)?.formatInternational() || enchantedPhoneNumber;\n }\n return phoneNumber;\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @internal\n * format phone number link\n */\nexport const formatPhoneNumberLink = (phoneNumber: ConferencePhoneInfo): string => {\n return `tel:+${phoneNumber.phoneNumber},,${phoneNumber.conferenceId}#`;\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @internal\n * format phone number\n */\nexport const formatPhoneNumberInfo = (\n phoneNumber: ConferencePhoneInfo,\n strings: MeetingConferencePhoneInfoModalStrings | undefined\n): string => {\n const templateText = phoneNumber.isTollFree\n ? phoneNumber.country && phoneNumber.city\n ? strings?.meetingConferencePhoneInfoModalTollFree\n : strings?.meetingConferencePhoneInfoModalTollFreeWithoutGeoData\n : phoneNumber.country && phoneNumber.city\n ? strings?.meetingConferencePhoneInfoModalToll\n : strings?.meetingConferencePhoneInfoModalTollWithoutGeoData;\n return (\n templateText\n ?.replace('{phoneNumber}', formatPhoneNumber(phoneNumber.phoneNumber))\n .replace('{country}', phoneNumber.country || '')\n .replace('{city}', phoneNumber.city || '')\n .trim() || ''\n );\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @internal\n * format meeting id\n */\nexport const formatMeetingId = (meetingId?: string): string => {\n if (!meetingId) {\n return '';\n }\n if (meetingId?.length !== 9) {\n return meetingId;\n }\n\n return [meetingId.slice(0, 3), meetingId.slice(3, 6), meetingId.slice(6, 9)].join(' ') + '#';\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @public\n * Information for conference phone info\n */\nexport interface ConferencePhoneInfo {\n phoneNumber: string;\n conferenceId: string;\n isTollFree: boolean;\n country?: string;\n city?: string;\n}\n"]}
|
1
|
+
{"version":3,"file":"MeetingConferencePhoneInfo.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MeetingConferencePhoneInfo.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,2DAA2D;AAC3D,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,2DAA2D;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,2DAA2D;AAC3D,OAAO,EAAgB,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE/F,2DAA2D;AAC3D,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,qCAAqC,CAAC;AAG7C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IT License.\n\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport React, { useCallback } from 'react';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { useMemo } from 'react';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { IModalStyles, Modal, Stack, useTheme, Text, IconButton, Icon } from '@fluentui/react';\n\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport {\n themedPhoneInfoModalStyle,\n titleClassName,\n titleContainerClassName,\n phoneInfoTextStyle,\n phoneInfoIcon,\n phoneInfoInctructionLine,\n phoneInfoStep,\n stepTextStyle,\n infoConnectionLinkStyle,\n phoneInfoIconStyle\n} from './styles/TeamsMeetingConferenceInfo';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { _preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { isPossiblePhoneNumber, parsePhoneNumber } from 'libphonenumber-js';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { _pxToRem } from '@internal/acs-ui-common';\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * strings for phone info modal\n * @beta\n */\nexport interface MeetingConferencePhoneInfoModalStrings {\n /**\n * Header for the phone info modal\n */\n meetingConferencePhoneInfoModalTitle?: string;\n /**\n * Phone number instruction\n */\n meetingConferencePhoneInfoModalDialIn?: string;\n /**\n * Meeting ID instruction\n */\n meetingConferencePhoneInfoModalMeetingId?: string;\n /**\n * Wait for phone connection\n */\n meetingConferencePhoneInfoModalWait?: string;\n /**\n * Toll Free Phone Label\n */\n meetingConferencePhoneInfoModalTollFree?: string;\n /**\n * Toll Phone Label\n */\n meetingConferencePhoneInfoModalToll?: string;\n /**\n * Toll Phone Label without geo data\n */\n meetingConferencePhoneInfoModalTollGeoData?: string;\n /**\n * No phone number available message\n */\n meetingConferencePhoneInfoModalNoPhoneAvailable?: string;\n}\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @beta\n * MeetingConferencePhoneInfoModal Component Props.\n */\nexport interface MeetingConferencePhoneInfoModalProps {\n conferencePhoneInfoList: ConferencePhoneInfo[];\n showModal?: boolean;\n onDismissMeetingPhoneInfoSettings?: () => void;\n}\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @beta\n * a component for setting spoken languages\n */\nexport const MeetingConferencePhoneInfoModal = (props: MeetingConferencePhoneInfoModalProps): JSX.Element => {\n const { conferencePhoneInfoList, showModal, onDismissMeetingPhoneInfoSettings } = props;\n\n const theme = useTheme();\n const strings = useLocale().strings.MeetingConferencePhoneInfo;\n\n const onDismiss = useCallback((): void => {\n if (onDismissMeetingPhoneInfoSettings) {\n onDismissMeetingPhoneInfoSettings();\n }\n }, [onDismissMeetingPhoneInfoSettings]);\n\n const PhoneInfoModalStyle: Partial<IModalStyles> = useMemo(() => themedPhoneInfoModalStyle(theme), [theme]);\n\n return (\n <>\n <Modal\n titleAriaId={strings?.meetingConferencePhoneInfoModalTitle}\n isOpen={showModal}\n onDismiss={onDismiss}\n isBlocking={true}\n styles={PhoneInfoModalStyle}\n >\n <Stack horizontal horizontalAlign=\"space-between\" verticalAlign=\"center\" className={titleContainerClassName}>\n <Text className={titleClassName}>{strings?.meetingConferencePhoneInfoModalTitle}</Text>\n <IconButton\n iconProps={{ iconName: 'Cancel' }}\n ariaLabel={strings?.meetingConferencePhoneInfoModalTitle}\n onClick={onDismiss}\n style={{ color: theme.palette.black }}\n />\n </Stack>\n {conferencePhoneInfoList.length === 0 && (\n <Stack horizontal>\n <Text className={stepTextStyle}>{strings?.meetingConferencePhoneInfoModalNoPhoneAvailable}</Text>\n </Stack>\n )}\n {conferencePhoneInfoList.length > 0 && (\n <Stack>\n <Stack horizontal horizontalAlign=\"space-between\" className={phoneInfoInctructionLine}>\n <Stack.Item style={{ display: 'flex' }}>\n <Stack horizontal className={phoneInfoStep}>\n <Stack className={infoConnectionLinkStyle(theme)}></Stack>\n <Stack.Item className={phoneInfoIcon(theme)}>\n <Stack verticalAlign=\"center\" horizontalAlign=\"center\">\n <Icon iconName=\"PhoneNumberButton\" className={phoneInfoIconStyle(theme)} />\n </Stack>\n </Stack.Item>\n <Stack.Item>\n <Text className={stepTextStyle}>{strings?.meetingConferencePhoneInfoModalDialIn}</Text>\n </Stack.Item>\n </Stack>\n </Stack.Item>\n <Stack.Item className={phoneInfoStep}>\n {conferencePhoneInfoList.map((phoneNumber, index) => (\n <Stack.Item key={index}>\n <Text className={phoneInfoTextStyle}>\n {formatPhoneNumber(phoneNumber.phoneNumber)}{' '}\n {phoneNumber.isTollFree\n ? strings.meetingConferencePhoneInfoModalTollFree\n : strings.meetingConferencePhoneInfoModalToll}\n </Text>\n <br />\n <Text className={phoneInfoTextStyle}> {formatPhoneNumberInfo(phoneNumber, strings)}</Text>\n </Stack.Item>\n ))}\n </Stack.Item>\n </Stack>\n <Stack\n horizontal\n horizontalAlign=\"space-between\"\n verticalAlign=\"center\"\n className={phoneInfoInctructionLine}\n >\n <Stack.Item style={{ display: 'flex' }}>\n <Stack horizontal>\n <Stack className={infoConnectionLinkStyle(theme)}></Stack>\n <Stack.Item className={phoneInfoIcon(theme)}>\n <Stack verticalAlign=\"center\" horizontalAlign=\"center\">\n <Icon iconName=\"DtmfDialpadButton\" className={phoneInfoIconStyle(theme)} />\n </Stack>\n </Stack.Item>\n <Stack.Item>\n <Text className={stepTextStyle}>{strings?.meetingConferencePhoneInfoModalMeetingId}</Text>\n </Stack.Item>\n </Stack>\n </Stack.Item>\n <Text className={phoneInfoTextStyle}>{formatMeetingId(conferencePhoneInfoList[0].conferenceId)}</Text>\n </Stack>\n <Stack horizontal horizontalAlign=\"space-between\" verticalAlign=\"center\">\n <Stack horizontal>\n <Stack.Item className={phoneInfoIcon(theme)} style={{ marginLeft: _pxToRem(2) }}>\n <Icon iconName=\"PhoneInfoWait\" className={phoneInfoIconStyle(theme)} />\n </Stack.Item>\n <Stack.Item>\n <Text className={stepTextStyle}>{strings?.meetingConferencePhoneInfoModalWait}</Text>\n </Stack.Item>\n </Stack>\n </Stack>\n </Stack>\n )}\n </Modal>\n </>\n );\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @internal\n * format phone number\n */\nexport const formatPhoneNumber = (phoneNumber: string): string => {\n if (!phoneNumber) {\n return '';\n }\n let enchantedPhoneNumber = phoneNumber;\n if (!phoneNumber.startsWith('+')) {\n enchantedPhoneNumber = `+${phoneNumber}`;\n }\n if (isPossiblePhoneNumber(enchantedPhoneNumber)) {\n return parsePhoneNumber(enchantedPhoneNumber)?.formatInternational() || enchantedPhoneNumber;\n }\n return phoneNumber;\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @internal\n * format phone number link\n */\nexport const formatPhoneNumberLink = (phoneNumber: ConferencePhoneInfo): string => {\n return `tel:+${phoneNumber.phoneNumber},,${phoneNumber.conferenceId}#`;\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @internal\n * format phone number\n */\nexport const formatPhoneNumberInfo = (\n phoneNumber: ConferencePhoneInfo,\n strings: MeetingConferencePhoneInfoModalStrings | undefined\n): string => {\n const templateText =\n phoneNumber.country && phoneNumber.city ? strings?.meetingConferencePhoneInfoModalTollGeoData : '';\n return (\n templateText\n ?.replace('{phoneNumber}', formatPhoneNumber(phoneNumber.phoneNumber))\n .replace('{country}', phoneNumber.country || '')\n .replace('{city}', phoneNumber.city || '')\n .trim() || ''\n );\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @internal\n * format meeting id\n */\nexport const formatMeetingId = (meetingId?: string): string => {\n if (!meetingId) {\n return '';\n }\n if (meetingId?.length !== 9) {\n return meetingId;\n }\n\n return [meetingId.slice(0, 3), meetingId.slice(3, 6), meetingId.slice(6, 9)].join(' ') + '#';\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/**\n * @public\n * Information for conference phone info\n */\nexport interface ConferencePhoneInfo {\n phoneNumber: string;\n conferenceId: string;\n isTollFree: boolean;\n country?: string;\n city?: string;\n}\n"]}
|
package/dist/dist-esm/react-components/src/components/{NotificationBar.d.ts → Notification.d.ts}
RENAMED
@@ -1,19 +1,19 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { IIconProps } from '@fluentui/react';
|
3
3
|
/**
|
4
|
-
* Props for {@link
|
4
|
+
* Props for {@link Notification}.
|
5
5
|
*
|
6
6
|
* @beta
|
7
7
|
*/
|
8
|
-
export interface
|
8
|
+
export interface NotificationProps {
|
9
9
|
/**
|
10
10
|
* Notification bar strings;
|
11
11
|
*/
|
12
|
-
|
12
|
+
notificationStrings?: NotificationStrings;
|
13
13
|
/**
|
14
14
|
* Notification bar icon;
|
15
15
|
*/
|
16
|
-
|
16
|
+
notificationIconProps?: IIconProps;
|
17
17
|
/**
|
18
18
|
* If set, notifications will automatically dismiss after 5 seconds
|
19
19
|
* @defaultValue false
|
@@ -38,11 +38,11 @@ export interface NotificationBarProps {
|
|
38
38
|
onDismiss?: () => void;
|
39
39
|
}
|
40
40
|
/**
|
41
|
-
* All strings that may be shown on the UI in the {@link
|
41
|
+
* All strings that may be shown on the UI in the {@link Notification}.
|
42
42
|
*
|
43
43
|
* @beta
|
44
44
|
*/
|
45
|
-
export interface
|
45
|
+
export interface NotificationStrings {
|
46
46
|
/**
|
47
47
|
* Notification bar title.
|
48
48
|
*/
|
@@ -69,5 +69,5 @@ export interface NotificationBarStrings {
|
|
69
69
|
*
|
70
70
|
* @beta
|
71
71
|
*/
|
72
|
-
export declare const
|
73
|
-
//# sourceMappingURL=
|
72
|
+
export declare const Notification: (props: NotificationProps) => JSX.Element;
|
73
|
+
//# sourceMappingURL=Notification.d.ts.map
|
package/dist/dist-esm/react-components/src/components/{NotificationBar.js → Notification.js}
RENAMED
@@ -3,15 +3,15 @@
|
|
3
3
|
import React, { useState } from 'react';
|
4
4
|
import { Icon, IconButton, PrimaryButton, Stack, useTheme, Text, DefaultButton } from '@fluentui/react';
|
5
5
|
import { cancelIcon } from './styles/ImageOverlay.style';
|
6
|
-
import { containerStyles, hiddenContainerStyles, messageTextStyle, notificationIconClassName, titleTextClassName } from './styles/
|
6
|
+
import { containerStyles, hiddenContainerStyles, messageTextStyle, notificationIconClassName, titleTextClassName } from './styles/Notification.styles';
|
7
7
|
/**
|
8
8
|
* A component to show notification messages on the UI.
|
9
9
|
*
|
10
10
|
* @beta
|
11
11
|
*/
|
12
|
-
export const
|
12
|
+
export const Notification = (props) => {
|
13
13
|
var _a, _b;
|
14
|
-
const strings = props.
|
14
|
+
const strings = props.notificationStrings;
|
15
15
|
const theme = useTheme();
|
16
16
|
const [show, setShow] = useState(true);
|
17
17
|
if (props.autoDismiss) {
|
@@ -28,7 +28,7 @@ export const NotificationBar = (props) => {
|
|
28
28
|
React.createElement(Stack, { "data-ui-id": "notification-bar", className: containerStyles(theme) },
|
29
29
|
React.createElement(Stack, { horizontal: true, horizontalAlign: "space-between" },
|
30
30
|
React.createElement(Stack, { horizontal: true },
|
31
|
-
React.createElement(Icon, Object.assign({ className: notificationIconClassName, iconName: (_b = (_a = props.
|
31
|
+
React.createElement(Icon, Object.assign({ className: notificationIconClassName, iconName: (_b = (_a = props.notificationIconProps) === null || _a === void 0 ? void 0 : _a.iconName) !== null && _b !== void 0 ? _b : 'ErrorBadge' }, props.notificationIconProps)),
|
32
32
|
React.createElement(Text, { className: titleTextClassName }, strings === null || strings === void 0 ? void 0 : strings.title)),
|
33
33
|
React.createElement(IconButton, { iconProps: cancelIcon, ariaLabel: strings === null || strings === void 0 ? void 0 : strings.closeButtonAriaLabel, "aria-live": 'polite', onClick: props.onDismiss })),
|
34
34
|
React.createElement(Text, { className: messageTextStyle(theme) }, strings === null || strings === void 0 ? void 0 : strings.message),
|
@@ -37,4 +37,4 @@ export const NotificationBar = (props) => {
|
|
37
37
|
(strings === null || strings === void 0 ? void 0 : strings.primaryButtonLabel) && (React.createElement(PrimaryButton, { onClick: props.onClickPrimaryButton, style: { marginTop: '1rem' } }, strings === null || strings === void 0 ? void 0 : strings.primaryButtonLabel)))),
|
38
38
|
props.showStackedEffect && React.createElement(Stack, { className: hiddenContainerStyles(theme) })));
|
39
39
|
};
|
40
|
-
//# sourceMappingURL=
|
40
|
+
//# sourceMappingURL=Notification.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Notification.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/Notification.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAc,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,8BAA8B,CAAC;AA0EtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAe,EAAE;;IACpE,MAAM,OAAO,GAAG,KAAK,CAAC,mBAAmB,CAAC;IAC1C,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEvC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QACtB,UAAU,CAAC,GAAG,EAAE;YACd,8CAA8C;YAC9C,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;YACrC,OAAO,yCAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,CACL,oBAAC,KAAK,IAAC,eAAe,EAAC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CAAE,kBAAkB,CACd,CACjB,CACK,CACF;QACP,KAAK,CAAC,iBAAiB,IAAI,oBAAC,KAAK,IAAC,SAAS,EAAE,qBAAqB,CAAC,KAAK,CAAC,GAAU,CAC9E,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useState } from 'react';\nimport { Icon, IconButton, PrimaryButton, Stack, useTheme, Text, IIconProps, DefaultButton } from '@fluentui/react';\nimport { cancelIcon } from './styles/ImageOverlay.style';\nimport {\n containerStyles,\n hiddenContainerStyles,\n messageTextStyle,\n notificationIconClassName,\n titleTextClassName\n} from './styles/Notification.styles';\n\n/**\n * Props for {@link Notification}.\n *\n * @beta\n */\nexport interface NotificationProps {\n /**\n * Notification bar strings;\n */\n notificationStrings?: NotificationStrings;\n\n /**\n * Notification bar icon;\n */\n notificationIconProps?: IIconProps;\n\n /**\n * If set, notifications will automatically dismiss after 5 seconds\n * @defaultValue false\n */\n autoDismiss?: boolean;\n\n /**\n * If set, notifications will be shown in a stacked effect\n * @defaultValue false\n */\n showStackedEffect?: boolean;\n\n /**\n * Callback called when the primary button inside notification bar is clicked.\n */\n onClickPrimaryButton?: () => void;\n\n /**\n * Callback called when the secondary button inside notification bar is clicked.\n */\n onClickSecondaryButton?: () => void;\n\n /**\n * Callback called when the notification is dismissed.\n */\n onDismiss?: () => void;\n}\n\n/**\n * All strings that may be shown on the UI in the {@link Notification}.\n *\n * @beta\n */\nexport interface NotificationStrings {\n /**\n * Notification bar title.\n */\n title: string;\n /**\n * Notification bar close button aria label\n */\n closeButtonAriaLabel: string;\n /**\n * Notification bar message.\n */\n message?: string;\n /**\n * Notification bar primary button label\n */\n primaryButtonLabel?: string;\n /**\n * Notification bar secondary button label\n */\n secondaryButtonLabel?: string;\n}\n\n/**\n * A component to show notification messages on the UI.\n *\n * @beta\n */\nexport const Notification = (props: NotificationProps): JSX.Element => {\n const strings = props.notificationStrings;\n const theme = useTheme();\n const [show, setShow] = useState(true);\n\n if (props.autoDismiss) {\n setTimeout(() => {\n // After 5 seconds set the show value to false\n setShow(false);\n }, 5000);\n\n if (!show) {\n props.onDismiss && props.onDismiss();\n return <></>;\n }\n }\n\n return (\n <Stack horizontalAlign=\"center\">\n <Stack data-ui-id=\"notification-bar\" className={containerStyles(theme)}>\n <Stack horizontal horizontalAlign=\"space-between\">\n <Stack horizontal>\n <Icon\n className={notificationIconClassName}\n iconName={props.notificationIconProps?.iconName ?? 'ErrorBadge'}\n {...props.notificationIconProps}\n />\n <Text className={titleTextClassName}>{strings?.title}</Text>\n </Stack>\n\n <IconButton\n iconProps={cancelIcon}\n ariaLabel={strings?.closeButtonAriaLabel}\n aria-live={'polite'}\n onClick={props.onDismiss}\n />\n </Stack>\n <Text className={messageTextStyle(theme)}>{strings?.message}</Text>\n <Stack horizontal horizontalAlign=\"space-evenly\">\n {strings?.secondaryButtonLabel && (\n <DefaultButton onClick={props.onClickSecondaryButton} style={{ marginTop: '1rem' }}>\n {strings?.secondaryButtonLabel}\n </DefaultButton>\n )}\n {strings?.primaryButtonLabel && (\n <PrimaryButton onClick={props.onClickPrimaryButton} style={{ marginTop: '1rem' }}>\n {strings?.primaryButtonLabel}\n </PrimaryButton>\n )}\n </Stack>\n </Stack>\n {props.showStackedEffect && <Stack className={hiddenContainerStyles(theme)}></Stack>}\n </Stack>\n );\n};\n"]}
|