@azure/communication-react 1.14.1-alpha-202403270012 → 1.14.1-alpha-202403290012
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 +203 -63
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-Yty3fOoA.js → RichTextSendBoxWrapper-CH6WvEGZ.js} +7 -4
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-Yty3fOoA.js.map → RichTextSendBoxWrapper-CH6WvEGZ.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-BEomNZbT.js → index-qxnuqL7s.js} +1017 -321
- package/dist/dist-cjs/communication-react/index-qxnuqL7s.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +6 -3
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +5 -0
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +2 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +6 -2
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +1 -2
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +1 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/AttachmentCard.d.ts +11 -15
- package/dist/dist-esm/react-components/src/components/AttachmentCard.js +25 -41
- package/dist/dist-esm/react-components/src/components/AttachmentCard.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.d.ts +18 -11
- package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.js +74 -62
- package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js +37 -4
- package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +6 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +5 -5
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +7 -7
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +13 -18
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +9 -9
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +9 -9
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +10 -10
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +12 -10
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +2 -2
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageStatusIcon.js +1 -1
- package/dist/dist-esm/react-components/src/components/MessageStatusIcon.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +10 -9
- package/dist/dist-esm/react-components/src/components/MessageThread.js +17 -13
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.d.ts +7 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/{RichTextRibbonButtons.js → Buttons/RichTextRibbonButtons.js} +16 -20
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.d.ts +7 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js +56 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.d.ts +16 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.js +62 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.d.ts +8 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.js +57 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.d.ts +9 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.js +34 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +23 -11
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +44 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +16 -6
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +2 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js +5 -3
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.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.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js +1 -1
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +25 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +132 -2
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +10 -2
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +20 -14
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.d.ts +15 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.js +39 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +22 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +29 -0
- package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +1 -0
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +13 -1
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +7 -2
- package/dist/dist-esm/react-components/src/theming/icons.js +15 -5
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/Attachment.d.ts +97 -37
- package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +22 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +3 -3
- 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/LocalPreview.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -2
- 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/DtmfDialpadPage.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +32 -17
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalDeviceSettings.styles.d.ts +5 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalDeviceSettings.styles.js +12 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalDeviceSettings.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.d.ts +2 -14
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.js +14 -10
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +13 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +53 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +196 -57
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +4 -5
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.d.ts +15 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/{FileDownloadErrorBar.js → AttachmentDownloadErrorBar.js} +5 -5
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +4 -5
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +10 -7
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +6 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +22 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +11 -2
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +7 -2
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +2 -1
- package/package.json +2 -1
- package/dist/dist-cjs/communication-react/index-BEomNZbT.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextRibbonButtons.d.ts +0 -12
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextRibbonButtons.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.d.ts +0 -15
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.js.map +0 -1
@@ -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,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC3G,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;AAKtE,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;AAyD/C,eAAe;AACf,MAAM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BAAqB,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 { chatMessageDateStyle, chatMessageFailedTagStyle } 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(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FileDownloadHandler } from '../../../types/Attachment';\nimport { _AttachmentDownloadCards } from '../../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\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 /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Optional callback to render uploaded files in the message component.\n */\n onRenderFileDownloads?: (userId: string, message: ChatMessage) => JSX.Element;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Optional function called when someone clicks on the file download icon.\n */\n fileDownloadHandler?: FileDownloadHandler;\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};\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 /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n fileDownloadHandler,\n inlineImageOptions,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderFileDownloads,\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 // 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 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(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderFileDownloads,\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n fileDownloadHandler\n );\n }, [\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ fileDownloadHandler,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */ mentionDisplayOptions,\n message,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ onRenderFileDownloads,\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 chatMyMessageStyles.body,\n isBlockedMessage\n ? chatMessageCommonStyles.blocked\n : props.message.status === 'failed'\n ? chatMessageCommonStyles.failed\n : undefined,\n attached !== 'top' ? chatMyMessageStyles.bodyAttached : 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 // make body not focusable to remove repetitions from narrators.\n // inner components are already focusable\n role: 'none',\n tabIndex: -1\n }}\n data-ui-id=\"chat-composite-message\"\n author={\n <Text className={chatMessageDateStyle} tabIndex={0}>\n {message.senderDisplayName}\n </Text>\n }\n timestamp={\n <Text className={chatMessageDateStyle} data-ui-id={ids.messageTimestamp} tabIndex={0}>\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,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,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wBAC3B,OAAO;oBACT,CAAC;oBACD,oEAAoE;oBACpE,gEAAgE;oBAChE,uCAAuC;oBACvC,yEAAyE;oBACzE,8DAA8D;oBAC9D,gCAAgC,CAAC,UAAU,CAAC,CAAC;oBAC7C,IAAI,OAAO,CAAC,WAAW,KAAK,MAAM,EAAE,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 { chatMessageDateStyle, chatMessageFailedTagStyle } 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(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMenuAction, AttachmentMetadata } from '../../../types/Attachment';\nimport { _AttachmentDownloadCards } from '../../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\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(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Optional callback to render message attachments in the message component.\n */\n onRenderAttachmentDownloads?: (userId: string, message: ChatMessage) => JSX.Element;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\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(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\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 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(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n actionsForAttachment\n );\n }, [\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ actionsForAttachment,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */ mentionDisplayOptions,\n message,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ 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 chatMyMessageStyles.body,\n isBlockedMessage\n ? chatMessageCommonStyles.blocked\n : props.message.status === 'failed'\n ? chatMessageCommonStyles.failed\n : undefined,\n attached !== 'top' ? chatMyMessageStyles.bodyAttached : 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 // make body not focusable to remove repetitions from narrators.\n // inner components are already focusable\n role: 'none',\n tabIndex: -1\n }}\n data-ui-id=\"chat-composite-message\"\n author={\n <Text className={chatMessageDateStyle} tabIndex={0}>\n {message.senderDisplayName}\n </Text>\n }\n timestamp={\n <Text className={chatMessageDateStyle} data-ui-id={ids.messageTimestamp} tabIndex={0}>\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"]}
|
@@ -21,18 +21,19 @@ export const FluentChatMyMessageComponent = (props) => {
|
|
21
21
|
/* @conditional-compile-remove(date-time-customization) */
|
22
22
|
onDisplayDateTimeString, inlineImageOptions,
|
23
23
|
/* @conditional-compile-remove(mention) */
|
24
|
-
mentionOptions,
|
24
|
+
mentionOptions, userId, defaultStatusRenderer, statusToRender,
|
25
25
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
26
|
-
|
26
|
+
actionsForAttachment,
|
27
27
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
28
|
-
|
28
|
+
onRenderAttachmentDownloads } = props;
|
29
29
|
const chatMessageRenderStyles = useChatMessageRenderStyles();
|
30
|
-
|
30
|
+
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
31
|
+
const onRenderAttachmentDownloadsMemo = useMemo(() => {
|
31
32
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
32
|
-
return
|
33
|
+
return onRenderAttachmentDownloads;
|
33
34
|
return undefined;
|
34
35
|
}, [
|
35
|
-
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
36
|
+
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ onRenderAttachmentDownloads
|
36
37
|
]);
|
37
38
|
// To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp
|
38
39
|
// needs to be regenerated), the dependency on "new Date().toDateString()"" is added.
|
@@ -41,7 +42,7 @@ export const FluentChatMyMessageComponent = (props) => {
|
|
41
42
|
/* @conditional-compile-remove(data-loss-prevention) */ messageProps.message.messageType === 'blocked') {
|
42
43
|
return (React.createElement(ChatMyMessageComponent, Object.assign({}, messageProps, {
|
43
44
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
44
|
-
|
45
|
+
onRenderAttachmentDownloads: onRenderAttachmentDownloadsMemo,
|
45
46
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
46
47
|
strings: messageProps.strings, message: messageProps.message, userId: userId, remoteParticipantsCount: participantCount ? participantCount - 1 : 0, shouldOverlapAvatarAndMessage: shouldOverlapAvatarAndMessage, onRenderAvatar: onRenderAvatar, showMessageStatus: showMessageStatus, messageStatus: messageProps.message.status, onActionButtonClick: onActionButtonClick,
|
47
48
|
/* @conditional-compile-remove(date-time-customization) */
|
@@ -49,13 +50,12 @@ export const FluentChatMyMessageComponent = (props) => {
|
|
49
50
|
/* @conditional-compile-remove(mention) */
|
50
51
|
mentionOptions: mentionOptions,
|
51
52
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
52
|
-
|
53
|
+
actionsForAttachment: actionsForAttachment })));
|
53
54
|
}
|
54
55
|
return React.createElement(React.Fragment, null);
|
55
56
|
}, [
|
56
57
|
onActionButtonClick,
|
57
58
|
onRenderAvatar,
|
58
|
-
onRenderFileDownloadsMemo,
|
59
59
|
participantCount,
|
60
60
|
shouldOverlapAvatarAndMessage,
|
61
61
|
showMessageStatus,
|
@@ -66,7 +66,9 @@ export const FluentChatMyMessageComponent = (props) => {
|
|
66
66
|
/* @conditional-compile-remove(mention) */
|
67
67
|
mentionOptions,
|
68
68
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
69
|
-
|
69
|
+
onRenderAttachmentDownloadsMemo,
|
70
|
+
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
71
|
+
actionsForAttachment,
|
70
72
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
71
73
|
new Date().toDateString()
|
72
74
|
]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FluentChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKpD,OAAO,EAAE,oBAAoB,EAAE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AClB,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,mBAAmB,IAE9B,eAAe,mBAAM,KAAK,EAAG,CACV,CACvB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MessageStatus, _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo } from 'react';\nimport { MessageProps, _ChatMessageProps } from '../../MessageThread';\nimport { ChatMessage } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\nimport { noMessageStatusStyle, useChatMessageRenderStyles } from '../../styles/MessageThread.styles';\nimport { mergeStyles } from '@fluentui/react';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { MessageStatusIndicatorProps } from '../../MessageStatusIndicator';\nimport { ChatMyMessageComponent } from './ChatMyMessageComponent';\nimport { ChatMyMessage as FluentChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { getFluentUIAttachedValue } from '../../utils/ChatMessageComponentUtils';\nimport type { FluentChatMessageComponentWrapperProps } from '../MessageComponents/FluentChatMessageComponent';\n\n/**\n * The component for rendering a chat message using Fluent UI components\n * and handling default and custom renderers.\n * This component handles rendering for chat message body, avatar and message status.\n * The chat message body, avatar and message status should be shown for both default and custom renderers.\n *\n * @private\n */\nexport const FluentChatMyMessageComponent = (props: FluentChatMessageComponentWrapperProps): JSX.Element => {\n const {\n message,\n styles,\n shouldOverlapAvatarAndMessage,\n onRenderMessage,\n onRenderAvatar,\n showMessageStatus,\n onRenderMessageStatus,\n participantCount,\n readCount,\n onActionButtonClick,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n fileDownloadHandler,\n userId,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderFileDownloads,\n defaultStatusRenderer,\n statusToRender\n } = props;\n const chatMessageRenderStyles = useChatMessageRenderStyles();\n\n const onRenderFileDownloadsMemo = useMemo(() => {\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n return onRenderFileDownloads;\n return undefined;\n }, [\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ onRenderFileDownloads\n ]);\n\n // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp\n // needs to be regenerated), the dependency on \"new Date().toDateString()\"\" is added.\n const defaultChatMessageRenderer = useCallback(\n (messageProps: MessageProps) => {\n if (\n messageProps.message.messageType === 'chat' ||\n /* @conditional-compile-remove(data-loss-prevention) */ messageProps.message.messageType === 'blocked'\n ) {\n return (\n <ChatMyMessageComponent\n {...messageProps}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderFileDownloads={onRenderFileDownloadsMemo}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n strings={messageProps.strings}\n message={messageProps.message}\n userId={userId}\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n shouldOverlapAvatarAndMessage={shouldOverlapAvatarAndMessage}\n onRenderAvatar={onRenderAvatar}\n showMessageStatus={showMessageStatus}\n messageStatus={messageProps.message.status}\n onActionButtonClick={onActionButtonClick}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n inlineImageOptions={inlineImageOptions}\n /* @conditional-compile-remove(mention) */\n mentionOptions={mentionOptions}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n fileDownloadHandler={fileDownloadHandler}\n />\n );\n }\n return <></>;\n },\n [\n onActionButtonClick,\n onRenderAvatar,\n onRenderFileDownloadsMemo,\n participantCount,\n shouldOverlapAvatarAndMessage,\n showMessageStatus,\n userId,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n fileDownloadHandler,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n new Date().toDateString()\n ]\n );\n\n const messageRenderer = useCallback(\n (messageProps: MessageProps) => {\n return onRenderMessage === undefined\n ? defaultChatMessageRenderer({ ...messageProps })\n : onRenderMessage(messageProps, defaultChatMessageRenderer);\n },\n [defaultChatMessageRenderer, onRenderMessage]\n );\n\n const messageStatusRenderer = useCallback(\n (\n onRenderMessageStatus:\n | ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null)\n | undefined,\n defaultStatusRenderer: (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n participantCount: number,\n readCount: number,\n status?: MessageStatus\n ) => JSX.Element,\n showMessageStatus?: boolean,\n participantCount?: number,\n readCount?: number\n ) => {\n return showMessageStatus && statusToRender ? (\n onRenderMessageStatus ? (\n onRenderMessageStatus({ status: message.status })\n ) : (\n defaultStatusRenderer(message, participantCount ?? 0, readCount ?? 0, message.status)\n )\n ) : (\n <div className={mergeStyles(noMessageStatusStyle)} />\n );\n },\n [message, statusToRender]\n );\n\n const attached = useMemo(() => {\n return getFluentUIAttachedValue(message.attached);\n }, [message.attached]);\n\n const myMessageRootProps = useMemo(() => {\n return {\n // myChatItemMessageContainer used in className and style prop as style prop can't handle CSS selectors\n className: mergeClasses(\n chatMessageRenderStyles.rootMyMessage,\n chatMessageRenderStyles.rootCommon,\n mergeStyles(styles?.myChatItemMessageContainer)\n ),\n style:\n styles?.myChatItemMessageContainer !== undefined\n ? createStyleFromV8Style(styles?.myChatItemMessageContainer)\n : {},\n role: 'none'\n };\n }, [chatMessageRenderStyles.rootCommon, chatMessageRenderStyles.rootMyMessage, styles?.myChatItemMessageContainer]);\n\n const myMessageBodyProps = useMemo(() => {\n return {\n className: mergeClasses(chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage),\n // make body not focusable to remove repetitions from narrators.\n // inner components are already focusable\n tabIndex: -1,\n role: 'none'\n };\n }, [chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage]);\n\n const myMessageStatusIcon = useMemo(() => {\n return (\n <div\n className={mergeStyles(\n { paddingLeft: '0.25rem' },\n styles?.messageStatusContainer ? styles.messageStatusContainer(message.mine ?? false) : ''\n )}\n >\n {message.status\n ? messageStatusRenderer(\n onRenderMessageStatus,\n defaultStatusRenderer,\n showMessageStatus,\n participantCount,\n readCount\n )\n : undefined}\n </div>\n );\n }, [\n defaultStatusRenderer,\n message.mine,\n message.status,\n messageStatusRenderer,\n onRenderMessageStatus,\n participantCount,\n readCount,\n showMessageStatus,\n styles\n ]);\n\n // Fluent UI message components are used here as for default message renderer,\n // timestamp and author name should be shown but they aren't shown for custom renderer.\n // More investigations are needed to check if this can be simplified with states.\n // Status and avatar should be shown for both custom and default renderers.\n return (\n <FluentChatMyMessage\n attached={attached}\n root={myMessageRootProps}\n body={myMessageBodyProps}\n statusIcon={myMessageStatusIcon}\n >\n {messageRenderer({ ...props })}\n </FluentChatMyMessage>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"FluentChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKpD,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,s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licensed under the MIT License.\n\nimport { MessageStatus, _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo } from 'react';\nimport { MessageProps, _ChatMessageProps } from '../../MessageThread';\nimport { ChatMessage } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\nimport { noMessageStatusStyle, useChatMessageRenderStyles } from '../../styles/MessageThread.styles';\nimport { mergeStyles } from '@fluentui/react';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { MessageStatusIndicatorProps } from '../../MessageStatusIndicator';\nimport { ChatMyMessageComponent } from './ChatMyMessageComponent';\nimport { ChatMyMessage as FluentChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { getFluentUIAttachedValue } from '../../utils/ChatMessageComponentUtils';\nimport type { FluentChatMessageComponentWrapperProps } from '../MessageComponents/FluentChatMessageComponent';\n\n/**\n * The component for rendering a chat message using Fluent UI components\n * and handling default and custom renderers.\n * This component handles rendering for chat message body, avatar and message status.\n * The chat message body, avatar and message status should be shown for both default and custom renderers.\n *\n * @private\n */\nexport const FluentChatMyMessageComponent = (props: FluentChatMessageComponentWrapperProps): JSX.Element => {\n const {\n message,\n styles,\n shouldOverlapAvatarAndMessage,\n onRenderMessage,\n onRenderAvatar,\n showMessageStatus,\n onRenderMessageStatus,\n participantCount,\n readCount,\n onActionButtonClick,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n userId,\n defaultStatusRenderer,\n statusToRender,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n actionsForAttachment,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentDownloads\n } = props;\n const chatMessageRenderStyles = useChatMessageRenderStyles();\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const onRenderAttachmentDownloadsMemo = useMemo(() => {\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n return onRenderAttachmentDownloads;\n return undefined;\n }, [\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ onRenderAttachmentDownloads\n ]);\n\n // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp\n // needs to be regenerated), the dependency on \"new Date().toDateString()\"\" is added.\n const defaultChatMessageRenderer = useCallback(\n (messageProps: MessageProps) => {\n if (\n messageProps.message.messageType === 'chat' ||\n /* @conditional-compile-remove(data-loss-prevention) */ messageProps.message.messageType === 'blocked'\n ) {\n return (\n <ChatMyMessageComponent\n {...messageProps}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentDownloads={onRenderAttachmentDownloadsMemo}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n strings={messageProps.strings}\n message={messageProps.message}\n userId={userId}\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n shouldOverlapAvatarAndMessage={shouldOverlapAvatarAndMessage}\n onRenderAvatar={onRenderAvatar}\n showMessageStatus={showMessageStatus}\n messageStatus={messageProps.message.status}\n onActionButtonClick={onActionButtonClick}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n inlineImageOptions={inlineImageOptions}\n /* @conditional-compile-remove(mention) */\n mentionOptions={mentionOptions}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n actionsForAttachment={actionsForAttachment}\n />\n );\n }\n return <></>;\n },\n [\n onActionButtonClick,\n onRenderAvatar,\n participantCount,\n shouldOverlapAvatarAndMessage,\n showMessageStatus,\n userId,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentDownloadsMemo,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n actionsForAttachment,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n new Date().toDateString()\n ]\n );\n\n const messageRenderer = useCallback(\n (messageProps: MessageProps) => {\n return onRenderMessage === undefined\n ? defaultChatMessageRenderer({ ...messageProps })\n : onRenderMessage(messageProps, defaultChatMessageRenderer);\n },\n [defaultChatMessageRenderer, onRenderMessage]\n );\n\n const messageStatusRenderer = useCallback(\n (\n onRenderMessageStatus:\n | ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null)\n | undefined,\n defaultStatusRenderer: (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n participantCount: number,\n readCount: number,\n status?: MessageStatus\n ) => JSX.Element,\n showMessageStatus?: boolean,\n participantCount?: number,\n readCount?: number\n ) => {\n return showMessageStatus && statusToRender ? (\n onRenderMessageStatus ? (\n onRenderMessageStatus({ status: message.status })\n ) : (\n defaultStatusRenderer(message, participantCount ?? 0, readCount ?? 0, message.status)\n )\n ) : (\n <div className={mergeStyles(noMessageStatusStyle)} />\n );\n },\n [message, statusToRender]\n );\n\n const attached = useMemo(() => {\n return getFluentUIAttachedValue(message.attached);\n }, [message.attached]);\n\n const myMessageRootProps = useMemo(() => {\n return {\n // myChatItemMessageContainer used in className and style prop as style prop can't handle CSS selectors\n className: mergeClasses(\n chatMessageRenderStyles.rootMyMessage,\n chatMessageRenderStyles.rootCommon,\n mergeStyles(styles?.myChatItemMessageContainer)\n ),\n style:\n styles?.myChatItemMessageContainer !== undefined\n ? createStyleFromV8Style(styles?.myChatItemMessageContainer)\n : {},\n role: 'none'\n };\n }, [chatMessageRenderStyles.rootCommon, chatMessageRenderStyles.rootMyMessage, styles?.myChatItemMessageContainer]);\n\n const myMessageBodyProps = useMemo(() => {\n return {\n className: mergeClasses(chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage),\n // make body not focusable to remove repetitions from narrators.\n // inner components are already focusable\n tabIndex: -1,\n role: 'none'\n };\n }, [chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage]);\n\n const myMessageStatusIcon = useMemo(() => {\n return (\n <div\n className={mergeStyles(\n { paddingLeft: '0.25rem' },\n styles?.messageStatusContainer ? styles.messageStatusContainer(message.mine ?? false) : ''\n )}\n >\n {message.status\n ? messageStatusRenderer(\n onRenderMessageStatus,\n defaultStatusRenderer,\n showMessageStatus,\n participantCount,\n readCount\n )\n : undefined}\n </div>\n );\n }, [\n defaultStatusRenderer,\n message.mine,\n message.status,\n messageStatusRenderer,\n onRenderMessageStatus,\n participantCount,\n readCount,\n showMessageStatus,\n styles\n ]);\n\n // Fluent UI message components are used here as for default message renderer,\n // timestamp and author name should be shown but they aren't shown for custom renderer.\n // More investigations are needed to check if this can be simplified with states.\n // Status and avatar should be shown for both custom and default renderers.\n return (\n <FluentChatMyMessage\n attached={attached}\n root={myMessageRootProps}\n body={myMessageBodyProps}\n statusIcon={myMessageStatusIcon}\n >\n {messageRenderer({ ...props })}\n </FluentChatMyMessage>\n );\n};\n"]}
|
@@ -85,6 +85,10 @@ export interface DialpadProps {
|
|
85
85
|
* and can be edited to change the number being dialed.
|
86
86
|
*/
|
87
87
|
dialpadMode?: DialpadMode;
|
88
|
+
/**
|
89
|
+
* Audio context for generating DTMF tones. If this if not provided the dialpad will create one iteslf.
|
90
|
+
*/
|
91
|
+
dtmfAudioContext?: AudioContext;
|
88
92
|
}
|
89
93
|
/**
|
90
94
|
* A component to allow users to enter phone number through clicking on dialpad/using keyboard
|
@@ -112,8 +112,8 @@ const DialpadButton = (props) => {
|
|
112
112
|
const DialpadContainer = (props) => {
|
113
113
|
var _a, _b;
|
114
114
|
const theme = useTheme();
|
115
|
-
const { onSendDtmfTone, onClickDialpadButton, textFieldValue, onChange, showDeleteButton = true, longPressTrigger = 'mouseAndTouch', disableDtmfPlayback, dialpadMode = 'dialer' } = props;
|
116
|
-
const dtmfToneAudioContext = useRef(new AudioContext());
|
115
|
+
const { onSendDtmfTone, onClickDialpadButton, textFieldValue, onChange, showDeleteButton = true, longPressTrigger = 'mouseAndTouch', disableDtmfPlayback, dialpadMode = 'dialer', dtmfAudioContext } = props;
|
116
|
+
const dtmfToneAudioContext = useRef(dtmfAudioContext ? dtmfAudioContext : new AudioContext());
|
117
117
|
const [plainTextValue, setPlainTextValue] = useState(textFieldValue !== null && textFieldValue !== void 0 ? textFieldValue : '');
|
118
118
|
const plainTextValuePreviousRenderValue = useRef(plainTextValue);
|
119
119
|
useEffect(() => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dialpad.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/Dialpad/Dialpad.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,KAAK,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EACT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAuB,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAsHjF,MAAM,qBAAqB,GAA6B;IACtD,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAA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ft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useEffect, useRef } from 'react';\nimport { IStyle, IButtonStyles, ITextFieldStyles } from '@fluentui/react';\n\nimport { IconButton } from '@fluentui/react';\nimport {\n concatStyleSets,\n DefaultButton,\n FocusZone,\n mergeStyles,\n Stack,\n Text,\n TextField,\n useTheme\n} from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useState } from 'react';\nimport { useLocale } from '../../localization';\nimport {\n buttonStyles,\n containerStyles,\n iconButtonStyles,\n digitStyles,\n letterStyles,\n textFieldStyles\n} from '../styles/Dialpad.styles';\nimport { formatPhoneNumber } from '../utils/formatPhoneNumber';\nimport useLongPress from '../utils/useLongPress';\n\nimport { dtmfFrequencies, DtmfFrequenciesKeys, Tone } from './DTMFToneGenerator';\n\n/**\n * Strings of {@link Dialpad} that can be overridden.\n *\n * @public\n */\nexport interface DialpadStrings {\n placeholderText: string;\n deleteButtonAriaLabel?: string;\n}\n\n/**\n * Styles for {@link Dialpad} component.\n *\n * @public\n */\nexport interface DialpadStyles {\n root?: IStyle;\n button?: IButtonStyles;\n textField?: Partial<ITextFieldStyles>;\n digit?: IStyle;\n letter?: IStyle;\n deleteIcon?: IButtonStyles;\n}\n\n/**\n * DTMF tone for PSTN calls.\n *\n * @public\n */\nexport type DtmfTone =\n | 'A'\n | 'B'\n | 'C'\n | 'D'\n | 'Flash'\n | 'Num0'\n | 'Num1'\n | 'Num2'\n | 'Num3'\n | 'Num4'\n | 'Num5'\n | 'Num6'\n | 'Num7'\n | 'Num8'\n | 'Num9'\n | 'Pound'\n | 'Star';\n\n/**\n * Modes of the dialpad component.\n * @public\n */\nexport type DialpadMode = 'dtmf' | 'dialer';\n\n/**\n * Modes of how the longpress handlers can be tiggered.\n * @public\n */\nexport type LongPressTrigger = 'mouseAndTouch' | 'touch';\n\n/**\n * Props for {@link Dialpad} component.\n *\n * @public\n */\nexport interface DialpadProps {\n strings?: DialpadStrings;\n /**\n * function to send dtmf tones on button click\n */\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /**\n * Callback for dialpad button behavior\n */\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /**\n * set dialpad textfield content\n */\n textFieldValue?: string;\n /**\n * on change function for text field, provides an unformatted plain text\n */\n onChange?: (input: string) => void;\n /**\n * flag to determine when to show/hide delete button, default true\n */\n showDeleteButton?: boolean;\n /**\n * Determines what kind of device that the user is on and should respect that based on interaction\n * interfaces available to the user\n */\n longPressTrigger?: LongPressTrigger;\n /**\n * Styles for customizing the dialpad component\n */\n styles?: DialpadStyles;\n /**\n * Disables DTMF sounds when dialpad buttons are pressed. the actual\n * tones are still sent to the call.\n */\n disableDtmfPlayback?: boolean;\n /**\n * Dialer mode for the dialpad. The dtmf mode is for sending dtmf tones and the appearence of\n * the dialpad is changed like hiding the input box. When using dialer mode the input box is there\n * and can be edited to change the number being dialed.\n */\n dialpadMode?: DialpadMode;\n}\n\ntype DialpadButtonContent = {\n /** Number displayed on each dialpad button */\n digit: DtmfFrequenciesKeys;\n /** Letters displayed on each dialpad button */\n letter?: string;\n};\n\nconst dialPadButtonsDefault: DialpadButtonContent[][] = [\n [{ digit: '1' }, { digit: '2', letter: 'ABC' }, { digit: '3', letter: 'DEF' }],\n [\n { digit: '4', letter: 'GHI' },\n { digit: '5', letter: 'JKL' },\n { digit: '6', letter: 'MNO' }\n ],\n [\n { digit: '7', letter: 'PQRS' },\n { digit: '8', letter: 'TUV' },\n { digit: '9', letter: 'WXYZ' }\n ],\n [{ digit: '*' }, { digit: '0', letter: '+' }, { digit: '#' }]\n];\n\nconst DtmfTones: DtmfTone[] = [\n 'Num1',\n 'Num2',\n 'Num3',\n 'Num4',\n 'Num5',\n 'Num6',\n 'Num7',\n 'Num8',\n 'Num9',\n 'Star',\n 'Num0',\n 'Pound'\n];\n\nconst DialpadButton = (props: {\n digit: DtmfFrequenciesKeys;\n letter?: string;\n styles?: DialpadStyles;\n index: number;\n onClick: (input: string, index: number) => void;\n onLongPress: (input: string, index: number) => void;\n longPressTrigger: LongPressTrigger;\n dtmfToneAudioContext: AudioContext;\n disableDtmfPlayback?: boolean;\n}): JSX.Element => {\n const theme = useTheme();\n\n const { digit, index, onClick, onLongPress, longPressTrigger, dtmfToneAudioContext, disableDtmfPlayback } = props;\n const [buttonPressed, setButtonPressed] = useState(false);\n\n const dtmfToneSound = useRef<Tone>(\n new Tone(dtmfToneAudioContext, dtmfFrequencies[digit].f1, dtmfFrequencies[digit].f2)\n );\n\n const useLongPressProps = React.useMemo(\n () => ({\n onClick: async () => {\n onClick(digit, index);\n },\n onLongPress: async () => {\n onLongPress(digit, index);\n },\n touchEventsOnly: longPressTrigger === 'touch'\n }),\n [digit, index, longPressTrigger, onClick, onLongPress]\n );\n\n const longPressHandlers = useLongPress(useLongPressProps);\n\n return (\n <DefaultButton\n data-test-id={`dialpad-button-${props.index}`}\n styles={concatStyleSets(buttonStyles(theme), props.styles?.button)}\n {...longPressHandlers}\n onKeyDown={(e) => {\n if ((e.key === 'Enter' || e.key === ' ') && !buttonPressed) {\n if (!disableDtmfPlayback) {\n dtmfToneSound.current.play();\n }\n longPressHandlers.onKeyDown();\n setButtonPressed(true);\n return;\n }\n if (\n e.key === 'Tab' ||\n e.key === 'ArrowLeft' ||\n e.key === 'ArrowRight' ||\n e.key === 'ArrowUp' ||\n e.key === 'ArrowDown'\n ) {\n dtmfToneSound.current.stop();\n }\n longPressHandlers.onKeyDown();\n }}\n onKeyUp={(e) => {\n if ((e.key === 'Enter' || e.key === ' ') && buttonPressed) {\n dtmfToneSound.current.stop();\n longPressHandlers.onKeyUp();\n setButtonPressed(false);\n }\n longPressHandlers.onKeyUp();\n }}\n onMouseDown={() => {\n if (!disableDtmfPlayback) {\n dtmfToneSound.current.play();\n }\n longPressHandlers.onMouseDown();\n }}\n onMouseUp={() => {\n dtmfToneSound.current.stop();\n longPressHandlers.onMouseUp();\n }}\n onMouseLeave={() => {\n dtmfToneSound.current.stop();\n }}\n onTouchStart={() => {\n if (!disableDtmfPlayback) {\n dtmfToneSound.current.play();\n }\n longPressHandlers.onTouchStart();\n }}\n onTouchEnd={() => {\n dtmfToneSound.current.stop();\n longPressHandlers.onTouchEnd();\n }}\n >\n <Stack>\n <Text className={mergeStyles(digitStyles(theme), props.styles?.digit)}>{props.digit}</Text>\n\n <Text className={mergeStyles(letterStyles(theme), props.styles?.letter)}>{props.letter ?? ' '}</Text>\n </Stack>\n </DefaultButton>\n );\n};\n\nconst DialpadContainer = (props: {\n strings: DialpadStrings;\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /** Callback for dialpad button behavior */\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /** Pass in custom content to dialpad textfield */\n textFieldValue?: string;\n /** on change function for text field, provides an unformatted plain text */\n onChange?: (input: string) => void;\n /** boolean input to determine when to show/hide delete button, default true */\n showDeleteButton?: boolean;\n /** boolean input to determine if dialpad is in mobile view, default false */\n longPressTrigger?: LongPressTrigger;\n styles?: DialpadStyles;\n disableDtmfPlayback?: boolean;\n dialpadMode?: DialpadMode;\n}): JSX.Element => {\n const theme = useTheme();\n\n const {\n onSendDtmfTone,\n onClickDialpadButton,\n textFieldValue,\n onChange,\n showDeleteButton = true,\n longPressTrigger = 'mouseAndTouch',\n disableDtmfPlayback,\n dialpadMode = 'dialer'\n } = props;\n\n const dtmfToneAudioContext = useRef(new AudioContext());\n\n const [plainTextValue, setPlainTextValue] = useState(textFieldValue ?? '');\n const plainTextValuePreviousRenderValue = useRef(plainTextValue);\n\n useEffect(() => {\n if (plainTextValuePreviousRenderValue.current !== plainTextValue) {\n onChange?.(plainTextValue);\n }\n plainTextValuePreviousRenderValue.current = plainTextValue;\n }, [plainTextValuePreviousRenderValue, plainTextValue, onChange]);\n\n useEffect(() => {\n setText(textFieldValue ?? '');\n }, [textFieldValue]);\n\n const onClickDialpad = (input: string, index: number): void => {\n setText(plainTextValue + input);\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n };\n\n const onLongPressDialpad = (input: string, index: number): void => {\n if (input === '0' && index === 10) {\n setText(plainTextValue + '+');\n } else {\n setText(plainTextValue + input);\n }\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const setText = (input: string): void => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n const plainInput = sanitizeInput(input);\n setPlainTextValue(plainInput);\n };\n\n const deleteNumbers = (): void => {\n const modifiedInput = plainTextValue.substring(0, plainTextValue.length - 1);\n setText(modifiedInput);\n };\n\n return (\n <Stack\n className={mergeStyles(containerStyles(theme), props.styles?.root)}\n data-test-id=\"dialpadContainer\"\n data-ui-id=\"dialpadContainer\"\n horizontalAlign={'center'}\n >\n {dialpadMode === 'dialer' && (\n <TextField\n styles={concatStyleSets(textFieldStyles(theme, plainTextValue !== ''), props.styles?.textField)}\n value={textFieldValue ? textFieldValue : formatPhoneNumber(plainTextValue)}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange={(e: any) => {\n setText(e.target.value);\n }}\n onClick={(e) => {\n e.preventDefault();\n }}\n placeholder={props.strings.placeholderText}\n data-test-id=\"dialpad-input\"\n onRenderSuffix={(): JSX.Element => (\n <>\n {showDeleteButton && plainTextValue.length !== 0 && (\n <IconButton\n ariaLabel={props.strings.deleteButtonAriaLabel}\n onClick={deleteNumbers}\n styles={concatStyleSets(iconButtonStyles(theme), props.styles?.deleteIcon)}\n iconProps={{ iconName: 'DialpadBackspace' }}\n />\n )}\n </>\n )}\n />\n )}\n <FocusZone>\n {dialPadButtonsDefault.map((rows, rowIndex) => {\n return (\n <Stack horizontal key={`row_${rowIndex}`} horizontalAlign=\"stretch\" tokens={{ childrenGap: '1rem' }}>\n {rows.map((button, columnIndex) => (\n <DialpadButton\n key={`button_${columnIndex}`}\n /* row index = 0\n columnIndex: (0,1,2) => (0,1,2)\n row index = 1\n columnIndex: (0,1,2)=> (3,4,5)\n row index = 2\n columnIndex: (0,1,2)=> (6,7,8)\n row index = 3\n columnIndex: (0,1,2)=> (9,10,11)\n columnIndex + rowIndex*rows.length calculates the corresponding index for each button\n dialpad index:\n 0 1 2\n 3 4 5\n 6 7 8\n 9 10 11\n then use this index to locate the corresponding dtmf tones\n DtmfTones[index]\n */\n index={columnIndex + rowIndex * rows.length}\n digit={button.digit}\n letter={button.letter}\n styles={props.styles}\n onClick={onClickDialpad}\n onLongPress={onLongPressDialpad}\n longPressTrigger={longPressTrigger}\n dtmfToneAudioContext={dtmfToneAudioContext.current}\n disableDtmfPlayback={disableDtmfPlayback}\n />\n ))}\n </Stack>\n );\n })}\n </FocusZone>\n </Stack>\n );\n};\n\n/**\n * A component to allow users to enter phone number through clicking on dialpad/using keyboard\n * It will return empty component for stable builds\n *\n * @public\n */\nexport const Dialpad = (props: DialpadProps): JSX.Element => {\n const localeStrings = useLocale().strings.dialpad;\n\n const strings = { ...localeStrings, ...props.strings };\n return <DialpadContainer strings={strings} {...props} />;\n};\n\nconst sanitizeInput = (input: string): string => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n return input.replace(/[^\\d*#+]/g, '');\n};\n"]}
|
1
|
+
{"version":3,"file":"Dialpad.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/Dialpad/Dialpad.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,KAAK,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EACT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,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,CACN,CACT,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAe,EAAE;IAC1D,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;IAElD,MAAM,OAAO,mCAAQ,aAAa,GAAK,KAAK,CAAC,OAAO,CAAE,CAAC;IACvD,OAAO,oBAAC,gBAAgB,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK,EAAI,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IAC9C,sFAAsF;IACtF,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useEffect, useRef } from 'react';\nimport { IStyle, IButtonStyles, ITextFieldStyles } from '@fluentui/react';\n\nimport { IconButton } from '@fluentui/react';\nimport {\n concatStyleSets,\n DefaultButton,\n FocusZone,\n mergeStyles,\n Stack,\n Text,\n TextField,\n useTheme\n} from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useState } from 'react';\nimport { useLocale } from '../../localization';\nimport {\n buttonStyles,\n containerStyles,\n iconButtonStyles,\n digitStyles,\n letterStyles,\n textFieldStyles\n} from '../styles/Dialpad.styles';\nimport { formatPhoneNumber } from '../utils/formatPhoneNumber';\nimport useLongPress from '../utils/useLongPress';\n\nimport { dtmfFrequencies, DtmfFrequenciesKeys, Tone } from './DTMFToneGenerator';\n\n/**\n * Strings of {@link Dialpad} that can be overridden.\n *\n * @public\n */\nexport interface DialpadStrings {\n placeholderText: string;\n deleteButtonAriaLabel?: string;\n}\n\n/**\n * Styles for {@link Dialpad} component.\n *\n * @public\n */\nexport interface DialpadStyles {\n root?: IStyle;\n button?: IButtonStyles;\n textField?: Partial<ITextFieldStyles>;\n digit?: IStyle;\n letter?: IStyle;\n deleteIcon?: IButtonStyles;\n}\n\n/**\n * DTMF tone for PSTN calls.\n *\n * @public\n */\nexport type DtmfTone =\n | 'A'\n | 'B'\n | 'C'\n | 'D'\n | 'Flash'\n | 'Num0'\n | 'Num1'\n | 'Num2'\n | 'Num3'\n | 'Num4'\n | 'Num5'\n | 'Num6'\n | 'Num7'\n | 'Num8'\n | 'Num9'\n | 'Pound'\n | 'Star';\n\n/**\n * Modes of the dialpad component.\n * @public\n */\nexport type DialpadMode = 'dtmf' | 'dialer';\n\n/**\n * Modes of how the longpress handlers can be tiggered.\n * @public\n */\nexport type LongPressTrigger = 'mouseAndTouch' | 'touch';\n\n/**\n * Props for {@link Dialpad} component.\n *\n * @public\n */\nexport interface DialpadProps {\n strings?: DialpadStrings;\n /**\n * function to send dtmf tones on button click\n */\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /**\n * Callback for dialpad button behavior\n */\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /**\n * set dialpad textfield content\n */\n textFieldValue?: string;\n /**\n * on change function for text field, provides an unformatted plain text\n */\n onChange?: (input: string) => void;\n /**\n * flag to determine when to show/hide delete button, default true\n */\n showDeleteButton?: boolean;\n /**\n * Determines what kind of device that the user is on and should respect that based on interaction\n * interfaces available to the user\n */\n longPressTrigger?: LongPressTrigger;\n /**\n * Styles for customizing the dialpad component\n */\n styles?: DialpadStyles;\n /**\n * Disables DTMF sounds when dialpad buttons are pressed. the actual\n * tones are still sent to the call.\n */\n disableDtmfPlayback?: boolean;\n /**\n * Dialer mode for the dialpad. The dtmf mode is for sending dtmf tones and the appearence of\n * the dialpad is changed like hiding the input box. When using dialer mode the input box is there\n * and can be edited to change the number being dialed.\n */\n dialpadMode?: DialpadMode;\n /**\n * Audio context for generating DTMF tones. If this if not provided the dialpad will create one iteslf.\n */\n dtmfAudioContext?: AudioContext;\n}\n\ntype DialpadButtonContent = {\n /** Number displayed on each dialpad button */\n digit: DtmfFrequenciesKeys;\n /** Letters displayed on each dialpad button */\n letter?: string;\n};\n\nconst dialPadButtonsDefault: DialpadButtonContent[][] = [\n [{ digit: '1' }, { digit: '2', letter: 'ABC' }, { digit: '3', letter: 'DEF' }],\n [\n { digit: '4', letter: 'GHI' },\n { digit: '5', letter: 'JKL' },\n { digit: '6', letter: 'MNO' }\n ],\n [\n { digit: '7', letter: 'PQRS' },\n { digit: '8', letter: 'TUV' },\n { digit: '9', letter: 'WXYZ' }\n ],\n [{ digit: '*' }, { digit: '0', letter: '+' }, { digit: '#' }]\n];\n\nconst DtmfTones: DtmfTone[] = [\n 'Num1',\n 'Num2',\n 'Num3',\n 'Num4',\n 'Num5',\n 'Num6',\n 'Num7',\n 'Num8',\n 'Num9',\n 'Star',\n 'Num0',\n 'Pound'\n];\n\nconst DialpadButton = (props: {\n digit: DtmfFrequenciesKeys;\n letter?: string;\n styles?: DialpadStyles;\n index: number;\n onClick: (input: string, index: number) => void;\n onLongPress: (input: string, index: number) => void;\n longPressTrigger: LongPressTrigger;\n dtmfToneAudioContext: AudioContext;\n disableDtmfPlayback?: boolean;\n}): JSX.Element => {\n const theme = useTheme();\n\n const { digit, index, onClick, onLongPress, longPressTrigger, dtmfToneAudioContext, disableDtmfPlayback } = props;\n const [buttonPressed, setButtonPressed] = useState(false);\n\n const dtmfToneSound = useRef<Tone>(\n new Tone(dtmfToneAudioContext, dtmfFrequencies[digit].f1, dtmfFrequencies[digit].f2)\n );\n\n const useLongPressProps = React.useMemo(\n () => ({\n onClick: async () => {\n onClick(digit, index);\n },\n onLongPress: async () => {\n onLongPress(digit, index);\n },\n touchEventsOnly: longPressTrigger === 'touch'\n }),\n [digit, index, longPressTrigger, onClick, onLongPress]\n );\n\n const longPressHandlers = useLongPress(useLongPressProps);\n\n return (\n <DefaultButton\n data-test-id={`dialpad-button-${props.index}`}\n styles={concatStyleSets(buttonStyles(theme), props.styles?.button)}\n {...longPressHandlers}\n onKeyDown={(e) => {\n if ((e.key === 'Enter' || e.key === ' ') && !buttonPressed) {\n if (!disableDtmfPlayback) {\n dtmfToneSound.current.play();\n }\n longPressHandlers.onKeyDown();\n setButtonPressed(true);\n return;\n }\n if (\n e.key === 'Tab' ||\n e.key === 'ArrowLeft' ||\n e.key === 'ArrowRight' ||\n e.key === 'ArrowUp' ||\n e.key === 'ArrowDown'\n ) {\n dtmfToneSound.current.stop();\n }\n longPressHandlers.onKeyDown();\n }}\n onKeyUp={(e) => {\n if ((e.key === 'Enter' || e.key === ' ') && buttonPressed) {\n dtmfToneSound.current.stop();\n longPressHandlers.onKeyUp();\n setButtonPressed(false);\n }\n longPressHandlers.onKeyUp();\n }}\n onMouseDown={() => {\n if (!disableDtmfPlayback) {\n dtmfToneSound.current.play();\n }\n longPressHandlers.onMouseDown();\n }}\n onMouseUp={() => {\n dtmfToneSound.current.stop();\n longPressHandlers.onMouseUp();\n }}\n onMouseLeave={() => {\n dtmfToneSound.current.stop();\n }}\n onTouchStart={() => {\n if (!disableDtmfPlayback) {\n dtmfToneSound.current.play();\n }\n longPressHandlers.onTouchStart();\n }}\n onTouchEnd={() => {\n dtmfToneSound.current.stop();\n longPressHandlers.onTouchEnd();\n }}\n >\n <Stack>\n <Text className={mergeStyles(digitStyles(theme), props.styles?.digit)}>{props.digit}</Text>\n\n <Text className={mergeStyles(letterStyles(theme), props.styles?.letter)}>{props.letter ?? ' '}</Text>\n </Stack>\n </DefaultButton>\n );\n};\n\nconst DialpadContainer = (props: {\n strings: DialpadStrings;\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /** Callback for dialpad button behavior */\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /** Pass in custom content to dialpad textfield */\n textFieldValue?: string;\n /** on change function for text field, provides an unformatted plain text */\n onChange?: (input: string) => void;\n /** boolean input to determine when to show/hide delete button, default true */\n showDeleteButton?: boolean;\n /** boolean input to determine if dialpad is in mobile view, default false */\n longPressTrigger?: LongPressTrigger;\n styles?: DialpadStyles;\n disableDtmfPlayback?: boolean;\n dialpadMode?: DialpadMode;\n dtmfAudioContext?: AudioContext;\n}): JSX.Element => {\n const theme = useTheme();\n\n const {\n onSendDtmfTone,\n onClickDialpadButton,\n textFieldValue,\n onChange,\n showDeleteButton = true,\n longPressTrigger = 'mouseAndTouch',\n disableDtmfPlayback,\n dialpadMode = 'dialer',\n dtmfAudioContext\n } = props;\n\n const dtmfToneAudioContext = useRef(dtmfAudioContext ? dtmfAudioContext : new AudioContext());\n\n const [plainTextValue, setPlainTextValue] = useState(textFieldValue ?? '');\n const plainTextValuePreviousRenderValue = useRef(plainTextValue);\n\n useEffect(() => {\n if (plainTextValuePreviousRenderValue.current !== plainTextValue) {\n onChange?.(plainTextValue);\n }\n plainTextValuePreviousRenderValue.current = plainTextValue;\n }, [plainTextValuePreviousRenderValue, plainTextValue, onChange]);\n\n useEffect(() => {\n setText(textFieldValue ?? '');\n }, [textFieldValue]);\n\n const onClickDialpad = (input: string, index: number): void => {\n setText(plainTextValue + input);\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n };\n\n const onLongPressDialpad = (input: string, index: number): void => {\n if (input === '0' && index === 10) {\n setText(plainTextValue + '+');\n } else {\n setText(plainTextValue + input);\n }\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const setText = (input: string): void => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n const plainInput = sanitizeInput(input);\n setPlainTextValue(plainInput);\n };\n\n const deleteNumbers = (): void => {\n const modifiedInput = plainTextValue.substring(0, plainTextValue.length - 1);\n setText(modifiedInput);\n };\n\n return (\n <Stack\n className={mergeStyles(containerStyles(theme), props.styles?.root)}\n data-test-id=\"dialpadContainer\"\n data-ui-id=\"dialpadContainer\"\n horizontalAlign={'center'}\n >\n {dialpadMode === 'dialer' && (\n <TextField\n styles={concatStyleSets(textFieldStyles(theme, plainTextValue !== ''), props.styles?.textField)}\n value={textFieldValue ? textFieldValue : formatPhoneNumber(plainTextValue)}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange={(e: any) => {\n setText(e.target.value);\n }}\n onClick={(e) => {\n e.preventDefault();\n }}\n placeholder={props.strings.placeholderText}\n data-test-id=\"dialpad-input\"\n onRenderSuffix={(): JSX.Element => (\n <>\n {showDeleteButton && plainTextValue.length !== 0 && (\n <IconButton\n ariaLabel={props.strings.deleteButtonAriaLabel}\n onClick={deleteNumbers}\n styles={concatStyleSets(iconButtonStyles(theme), props.styles?.deleteIcon)}\n iconProps={{ iconName: 'DialpadBackspace' }}\n />\n )}\n </>\n )}\n />\n )}\n <FocusZone>\n {dialPadButtonsDefault.map((rows, rowIndex) => {\n return (\n <Stack horizontal key={`row_${rowIndex}`} horizontalAlign=\"stretch\" tokens={{ childrenGap: '1rem' }}>\n {rows.map((button, columnIndex) => (\n <DialpadButton\n key={`button_${columnIndex}`}\n /* row index = 0\n columnIndex: (0,1,2) => (0,1,2)\n row index = 1\n columnIndex: (0,1,2)=> (3,4,5)\n row index = 2\n columnIndex: (0,1,2)=> (6,7,8)\n row index = 3\n columnIndex: (0,1,2)=> (9,10,11)\n columnIndex + rowIndex*rows.length calculates the corresponding index for each button\n dialpad index:\n 0 1 2\n 3 4 5\n 6 7 8\n 9 10 11\n then use this index to locate the corresponding dtmf tones\n DtmfTones[index]\n */\n index={columnIndex + rowIndex * rows.length}\n digit={button.digit}\n letter={button.letter}\n styles={props.styles}\n onClick={onClickDialpad}\n onLongPress={onLongPressDialpad}\n longPressTrigger={longPressTrigger}\n dtmfToneAudioContext={dtmfToneAudioContext.current}\n disableDtmfPlayback={disableDtmfPlayback}\n />\n ))}\n </Stack>\n );\n })}\n </FocusZone>\n </Stack>\n );\n};\n\n/**\n * A component to allow users to enter phone number through clicking on dialpad/using keyboard\n * It will return empty component for stable builds\n *\n * @public\n */\nexport const Dialpad = (props: DialpadProps): JSX.Element => {\n const localeStrings = useLocale().strings.dialpad;\n\n const strings = { ...localeStrings, ...props.strings };\n return <DialpadContainer strings={strings} {...props} />;\n};\n\nconst sanitizeInput = (input: string): string => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n return input.replace(/[^\\d*#+]/g, '');\n};\n"]}
|
@@ -11,7 +11,7 @@ import LiveMessage from './Announcer/LiveMessage';
|
|
11
11
|
export const MessageStatusIcon = (props) => {
|
12
12
|
const { shouldAnnounce, iconName, iconClassName, ariaLabel } = props;
|
13
13
|
return (React.createElement(React.Fragment, null,
|
14
|
-
ariaLabel && React.createElement(LiveMessage, { message: ariaLabel, ariaLive: "polite" }),
|
14
|
+
ariaLabel && shouldAnnounce && React.createElement(LiveMessage, { message: ariaLabel, ariaLive: "polite" }),
|
15
15
|
React.createElement("div", {
|
16
16
|
// make icon accessible
|
17
17
|
tabIndex: 0 },
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MessageStatusIcon.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MessageStatusIcon.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAclD;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAe,EAAE;IAC9E,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAErE,OAAO,CACL;QAEG,SAAS,IAAI,oBAAC,WAAW,IAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAC,QAAQ,GAAG;
|
1
|
+
{"version":3,"file":"MessageStatusIcon.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MessageStatusIcon.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAclD;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAe,EAAE;IAC9E,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAErE,OAAO,CACL;QAEG,SAAS,IAAI,cAAc,IAAI,oBAAC,WAAW,IAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAC,QAAQ,GAAG;QACrF;YACE,uBAAuB;YACvB,QAAQ,EAAE,CAAC;YAEX,oBAAC,IAAI,IACH,IAAI,EAAE,QAAQ,eAKH,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,gBAChC,oCAAoC,gBACpC,SAAS,EACrB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,aAAa,GACxB,CACE,CACL,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Icon } from '@fluentui/react';\nimport React from 'react';\nimport LiveMessage from './Announcer/LiveMessage';\n\n/**\n * Props for {@link MessageStatusIndicatorInternal}.\n *\n * @internal\n */\nexport interface MessageStatusIconProps {\n shouldAnnounce: boolean;\n iconName: string;\n iconClassName: string;\n ariaLabel?: string;\n}\n\n/**\n * Component to display message status icon\n *\n * @internal\n */\nexport const MessageStatusIcon = (props: MessageStatusIconProps): JSX.Element => {\n const { shouldAnnounce, iconName, iconClassName, ariaLabel } = props;\n\n return (\n <>\n {/* live message is used here so that aria labels are announced on mobile */}\n {ariaLabel && shouldAnnounce && <LiveMessage message={ariaLabel} ariaLive=\"polite\" />}\n <div\n // make icon accessible\n tabIndex={0}\n >\n <Icon\n role={'status'}\n // Role `status` is one of the live region roles and is used to notify screen readers of changes to the status of the message\n // it has aria-live prop set to `polite` by default.\n // By setting it to `off` value, we disable live updates when they aren't needed\n // and keep it available in the accessibility tree\n aria-live={shouldAnnounce ? 'polite' : 'off'}\n data-ui-id={'chat-composite-message-status-icon'}\n aria-label={ariaLabel}\n iconName={iconName}\n className={iconClassName}\n />\n </div>\n </>\n );\n};\n"]}
|
@@ -4,7 +4,7 @@ import { BaseCustomStyles, ChatMessage, CustomMessage, SystemMessage, OnRenderAv
|
|
4
4
|
import { BlockedMessage } from '../types';
|
5
5
|
import { MessageStatusIndicatorProps } from './MessageStatusIndicator';
|
6
6
|
import { MessageStatus } from "../../../acs-ui-common/src";
|
7
|
-
import { AttachmentMetadata,
|
7
|
+
import { AttachmentMetadata, AttachmentOptions } from '../types/Attachment';
|
8
8
|
import { MentionOptions } from './MentionPopover';
|
9
9
|
import { InlineImageOptions } from './ChatMessage/ChatMessageContent';
|
10
10
|
/**
|
@@ -96,13 +96,15 @@ export interface MessageThreadStrings {
|
|
96
96
|
actionMenuMoreOptions?: string;
|
97
97
|
/** Aria label to announce when a message is deleted */
|
98
98
|
messageDeletedAnnouncementAriaLabel: string;
|
99
|
-
/** String for download
|
99
|
+
/** String for download attachment button in attachment card */
|
100
100
|
downloadAttachment: string;
|
101
|
+
/** String for open attachment button in attachment card */
|
102
|
+
openAttachment: string;
|
101
103
|
/** String for policy violation message removal */
|
102
104
|
blockedWarningText: string;
|
103
105
|
/** String for policy violation message removal details link */
|
104
106
|
blockedWarningLinkText: string;
|
105
|
-
/** String for aria text in
|
107
|
+
/** String for aria text in attachment card group*/
|
106
108
|
attachmentCardGroupMessage: string;
|
107
109
|
}
|
108
110
|
/**
|
@@ -230,10 +232,10 @@ export type MessageThreadProps = {
|
|
230
232
|
*/
|
231
233
|
onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;
|
232
234
|
/**
|
233
|
-
* Optional callback to render
|
235
|
+
* Optional callback to render attachments in the message component.
|
234
236
|
* @beta
|
235
237
|
*/
|
236
|
-
|
238
|
+
onRenderAttachmentDownloads?: (userId: string, message: ChatMessage) => JSX.Element;
|
237
239
|
/**
|
238
240
|
* Optional callback to edit a message.
|
239
241
|
*
|
@@ -277,11 +279,10 @@ export type MessageThreadProps = {
|
|
277
279
|
strings?: Partial<MessageThreadStrings>;
|
278
280
|
/**
|
279
281
|
* @beta
|
280
|
-
* Optional
|
281
|
-
*
|
282
|
-
* this function will be called with the data inside `fileSharingMetadata` key.
|
282
|
+
* Optional attachment options, which defines behvaiour for uploading and downloading attachments.
|
283
|
+
* As this moment, the uploadOptions would be ignored and this option is intended for download only.
|
283
284
|
*/
|
284
|
-
|
285
|
+
attachmentOptions?: AttachmentOptions;
|
285
286
|
/**
|
286
287
|
* Optional function to provide customized date format.
|
287
288
|
* @beta
|
@@ -174,7 +174,9 @@ export const MessageThreadWrapper = (props) => {
|
|
174
174
|
/* @conditional-compile-remove(mention) */
|
175
175
|
mentionOptions, inlineImageOptions,
|
176
176
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
177
|
-
|
177
|
+
attachmentOptions,
|
178
|
+
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
179
|
+
onRenderAttachmentDownloads } = props;
|
178
180
|
// We need this state to wait for one tick and scroll to bottom after messages have been initialized.
|
179
181
|
// Otherwise chatScrollDivRef.current.clientHeight is wrong if we scroll to bottom before messages are initialized.
|
180
182
|
const [chatMessagesInitialized, setChatMessagesInitialized] = useState(false);
|
@@ -501,22 +503,24 @@ export const MessageThreadWrapper = (props) => {
|
|
501
503
|
existsNewChatMessage && !disableJumpToNewMessageButton && (React.createElement("div", { className: mergeStyles(newMessageButtonContainerStyle, styles === null || styles === void 0 ? void 0 : styles.newMessageButtonContainer) }, onRenderJumpToNewMessageButton ? (onRenderJumpToNewMessageButton({ text: strings.newMessagesIndicator, onClick: scrollToBottom })) : (React.createElement(DefaultJumpToNewMessageButton, { text: strings.newMessagesIndicator, onClick: scrollToBottom })))),
|
502
504
|
React.createElement(LiveAnnouncer, null,
|
503
505
|
React.createElement(FluentV9ThemeProvider, { v8Theme: theme },
|
504
|
-
latestDeletedMessageId && (React.createElement(Announcer, { key: latestDeletedMessageId, announcementString: deletedMessageAriaLabel, ariaLive: 'assertive' })),
|
505
506
|
React.createElement(Chat
|
506
507
|
// styles?.chatContainer used in className and style prop as style prop can't handle CSS selectors
|
507
508
|
, {
|
508
509
|
// styles?.chatContainer used in className and style prop as style prop can't handle CSS selectors
|
509
|
-
className: mergeClasses(classes.root, mergeStyles(styles === null || styles === void 0 ? void 0 : styles.chatContainer)), ref: chatScrollDivRef, style: Object.assign({}, createStyleFromV8Style(styles === null || styles === void 0 ? void 0 : styles.chatContainer)) },
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
510
|
+
className: mergeClasses(classes.root, mergeStyles(styles === null || styles === void 0 ? void 0 : styles.chatContainer)), ref: chatScrollDivRef, style: Object.assign({}, createStyleFromV8Style(styles === null || styles === void 0 ? void 0 : styles.chatContainer)) },
|
511
|
+
latestDeletedMessageId && (React.createElement(Announcer, { key: latestDeletedMessageId, announcementString: deletedMessageAriaLabel, ariaLive: 'polite' })),
|
512
|
+
messagesToDisplay.map((message) => {
|
513
|
+
var _a;
|
514
|
+
return (React.createElement(MemoChatMessageComponentWrapper, Object.assign({}, message, { userId: userId, key: message.key, styles: styles, shouldOverlapAvatarAndMessage: isNarrow, strings: strings, onRenderAvatar: onRenderAvatar, onRenderMessage: onRenderMessage, onRenderMessageStatus: onRenderMessageStatus, defaultStatusRenderer: defaultStatusRenderer, onActionButtonClick: onActionButtonClickMemo, readCount: readCountForHoveredIndicator, participantCount: participantCount,
|
515
|
+
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
516
|
+
actionsForAttachment: (_a = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.downloadOptions) === null || _a === void 0 ? void 0 : _a.actionsForAttachment, inlineImageOptions: inlineImageOptions,
|
517
|
+
/* @conditional-compile-remove(date-time-customization) */
|
518
|
+
onDisplayDateTimeString: onDisplayDateTimeString,
|
519
|
+
/* @conditional-compile-remove(mention) */
|
520
|
+
mentionOptions: mentionOptions,
|
521
|
+
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
522
|
+
onRenderAttachmentDownloads: onRenderAttachmentDownloads })));
|
523
|
+
}))))));
|
520
524
|
};
|
521
525
|
const MemoChatMessageComponentWrapper = React.memo((obj) => {
|
522
526
|
return React.createElement(ChatMessageComponentWrapper, Object.assign({}, obj));
|