@azure/communication-react 1.17.0-alpha-202405150013 → 1.17.0-alpha-202405170014
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 +33 -5
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BkDaUOJU.js → ChatMessageComponentAsRichTextEditBox-BLFNaheX.js} +9 -3
- package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BLFNaheX.js.map +1 -0
- package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-BhTpuspw.js +54 -0
- package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-BhTpuspw.js.map +1 -0
- package/dist/dist-cjs/communication-react/{index-DJswSfNy.js → index-C9I6Mcil.js} +291 -139
- package/dist/dist-cjs/communication-react/index-C9I6Mcil.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +2 -2
- package/dist/dist-esm/acs-ui-common/src/common.d.ts +8 -1
- package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/index.d.ts +1 -1
- package/dist/dist-esm/acs-ui-common/src/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-component-bindings/src/utils/videoGalleryUtils.js +1 -6
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +1 -1
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +0 -4
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +0 -3
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/PPTLiveSubscriber.js +0 -2
- package/dist/dist-esm/calling-stateful-client/src/PPTLiveSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/index-public.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/Attachment/AttachmentCard.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js +27 -22
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCardGroup.d.ts +15 -0
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCardGroup.js +14 -16
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCardGroup.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +16 -15
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentUploadCards.js +2 -2
- package/dist/dist-esm/react-components/src/components/Attachment/AttachmentUploadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +9 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +8 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +2 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +8 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +9 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ErrorBoundary.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/ErrorBoundary.js +2 -2
- package/dist/dist-esm/react-components/src/components/ErrorBoundary.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +5 -3
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +5 -2
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/SendBox.js +5 -2
- package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +6 -4
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js +3 -6
- package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +1 -3
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.js +0 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +1 -0
- package/dist/dist-esm/react-components/src/components/index.js +1 -0
- 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 +9 -1
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js +27 -3
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.d.ts +17 -0
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.js +47 -0
- package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +8 -0
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +9 -0
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +3 -1
- package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +23 -2
- package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +31 -10
- package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +31 -10
- package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +31 -10
- package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +31 -10
- package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +22 -1
- package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +30 -9
- package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +24 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +6 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +28 -8
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +10 -0
- package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +20 -0
- package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.d.ts +30 -0
- package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +44 -0
- package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +4 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +4 -0
- package/package.json +2 -2
- package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BkDaUOJU.js.map +0 -1
- package/dist/dist-cjs/communication-react/index-DJswSfNy.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/ChatComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAsB,MAAM,yBAAyB,CAAC;AAG3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"ChatComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/ChatComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAsB,MAAM,yBAAyB,CAAC;AAG3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuF1C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAe,EAAE;IACtE,MAAM,EACJ,OAAO,EACP,OAAO,EACP,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,2BAA2B,EAC5B,GAAG,KAAK,CAAC;IAEV,qGAAqG;IACrG,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC;IAEpD,OAAO,CACL,6BAAK,SAAS,EAAE,wBAAwB;QACtC,oBAAC,YAAY,oBAAK,KAAK;YACrB,oBAAC,mBAAmB,IAAC,OAAO,EAAE,OAAO;gBACnC,oBAAC,UAAU;gBACT,qGAAqG;;oBAArG,qGAAqG;oBACrG,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,wBAAwB,EAAE,wBAAwB,EAClD,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,eAAe,EAChC,2BAA2B,EAAE,2BAA2B;oBACxD,qGAAqG;oBACrG,iBAAiB,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,GAC7C,CACkB,CACT,CACX,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommunicationParticipant, MessageRenderer, MessageProps } from '@internal/react-components';\nimport React from 'react';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { ChatCompositeIcons } from '../common/icons';\nimport { ChatAdapter } from './adapter/ChatAdapter';\nimport { ChatAdapterProvider } from './adapter/ChatAdapterProvider';\nimport { chatScreenContainerStyle } from './styles/Chat.styles';\nimport { ChatScreen } from './ChatScreen';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentOptions } from '@internal/react-components';\n\n/**\n * Props for {@link ChatComposite}.\n *\n * @public\n */\nexport interface ChatCompositeProps extends BaseCompositeProps<ChatCompositeIcons> {\n /**\n * An adapter provides logic and data to the composite.\n * Composite can also be controlled using the adapter.\n */\n adapter: ChatAdapter;\n /**\n * `(messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element`\n * A callback for customizing the message renderer.\n */\n onRenderMessage?: (messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element;\n /**\n * `(typingUsers: CommunicationParticipant[]) => JSX.Element`\n * A callback for customizing the typing indicator renderer.\n */\n onRenderTypingIndicator?: (typingUsers: CommunicationParticipant[]) => JSX.Element;\n /**\n * Flags to enable/disable visual elements of the {@link ChatComposite}.\n */\n options?: ChatCompositeOptions;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n}\n\n/**\n * Optional features of the {@link ChatComposite}.\n *\n * @public\n */\nexport type ChatCompositeOptions = {\n /**\n * Surface Azure Communication Services backend errors in the UI with {@link @azure/communication-react#ErrorBar}.\n * Hide or show the error bar.\n * @defaultValue true\n */\n errorBar?: boolean;\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n /**\n * Show or hide the participant pane. This feature is in beta and not supported on mobile or narrow screen views.\n * @defaultValue false\n *\n * @beta\n */\n participantPane?: boolean;\n /**\n * Show or hide the topic at the top of the chat. Hidden if set to `false`\n * @defaultValue true\n */\n topic?: boolean;\n /**\n * enumerable to determine if the input box has focus on render or not.\n * When undefined nothing has focus on render\n */\n autoFocus?: 'sendBoxTextField';\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n attachmentOptions?: AttachmentOptions;\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n /**\n * enables rich text editor for the edit box\n * @defaultValue `false`\n *\n * @beta\n */\n richTextEditor?: boolean;\n};\n\n/**\n * A customizable UI composite for the chat experience.\n *\n * @remarks Chat composite min width and height are respectively 17.5rem and 20rem (280px and 320px, with default rem at 16px)\n *\n * @public\n */\nexport const ChatComposite = (props: ChatCompositeProps): JSX.Element => {\n const {\n adapter,\n options,\n onFetchAvatarPersonaData,\n onRenderTypingIndicator,\n onRenderMessage,\n onFetchParticipantMenuItems\n } = props;\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const formFactor = props['formFactor'] || 'desktop';\n\n return (\n <div className={chatScreenContainerStyle}>\n <BaseProvider {...props}>\n <ChatAdapterProvider adapter={adapter}>\n <ChatScreen\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n formFactor={formFactor}\n options={options}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onRenderTypingIndicator={onRenderTypingIndicator}\n onRenderMessage={onRenderMessage}\n onFetchParticipantMenuItems={onFetchParticipantMenuItems}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n attachmentOptions={options?.attachmentOptions}\n />\n </ChatAdapterProvider>\n </BaseProvider>\n </div>\n );\n};\n"]}
|
@@ -33,11 +33,13 @@ import { toFlatCommunicationIdentifier } from "../../../../acs-ui-common/src";
|
|
33
33
|
import { AttachmentDownloadErrorBar } from './AttachmentDownloadErrorBar';
|
34
34
|
import { _AttachmentDownloadCards } from "../../../../react-components/src";
|
35
35
|
import { ImageOverlay } from "../../../../react-components/src";
|
36
|
-
import { SendBox } from "../../../../react-components/src";
|
37
36
|
/* @conditional-compile-remove(attachment-upload) */
|
38
37
|
import { nanoid } from 'nanoid';
|
39
38
|
/* @conditional-compile-remove(attachment-upload) */
|
40
39
|
import { AttachmentUploadActionType, AttachmentUploadReducer } from './file-sharing/AttachmentUpload';
|
40
|
+
import { SendBoxPicker } from '../common/SendBoxPicker';
|
41
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
42
|
+
import { loadRichTextSendBox } from '../common/SendBoxPicker';
|
41
43
|
/**
|
42
44
|
* @private
|
43
45
|
*/
|
@@ -63,8 +65,16 @@ export const ChatScreen = (props) => {
|
|
63
65
|
});
|
64
66
|
fetchData();
|
65
67
|
}, [adapter]);
|
68
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
69
|
+
useEffect(() => {
|
70
|
+
// if rich text editor is enabled, the rich text editor component should be loaded early for good UX
|
71
|
+
if ((options === null || options === void 0 ? void 0 : options.richTextEditor) !== undefined && options.richTextEditor) {
|
72
|
+
// this line is needed to load the Rooster JS dependencies early in the lifecycle
|
73
|
+
// when the rich text editor is enabled
|
74
|
+
loadRichTextSendBox();
|
75
|
+
}
|
76
|
+
}, [options === null || options === void 0 ? void 0 : options.richTextEditor]);
|
66
77
|
const messageThreadProps = usePropsFor(MessageThread);
|
67
|
-
const sendBoxProps = usePropsFor(SendBox);
|
68
78
|
const typingIndicatorProps = usePropsFor(TypingIndicator);
|
69
79
|
const headerProps = useAdaptedSelector(getHeaderProps);
|
70
80
|
const errorBarProps = usePropsFor(ErrorBar);
|
@@ -261,7 +271,8 @@ export const ChatScreen = (props) => {
|
|
261
271
|
const attachments = useMemo(() => {
|
262
272
|
return uploads === null || uploads === void 0 ? void 0 : uploads.map((v) => v.metadata);
|
263
273
|
}, [uploads]);
|
264
|
-
const onSendMessageHandler = useCallback(function (content,
|
274
|
+
const onSendMessageHandler = useCallback(function (content,
|
275
|
+
/* @conditional-compile-remove(attachment-upload) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */ options) {
|
265
276
|
return __awaiter(this, void 0, void 0, function* () {
|
266
277
|
var _a;
|
267
278
|
/* @conditional-compile-remove(attachment-upload) */
|
@@ -270,11 +281,16 @@ export const ChatScreen = (props) => {
|
|
270
281
|
handleUploadAction({ type: AttachmentUploadActionType.Clear });
|
271
282
|
/* @conditional-compile-remove(attachment-upload) */
|
272
283
|
yield adapter.sendMessage(content, {
|
273
|
-
attachments: attachments
|
284
|
+
attachments: attachments,
|
285
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
286
|
+
type: options === null || options === void 0 ? void 0 : options.type
|
274
287
|
});
|
275
288
|
/* @conditional-compile-remove(attachment-upload) */
|
276
289
|
return;
|
277
|
-
yield adapter.sendMessage(content
|
290
|
+
yield adapter.sendMessage(content, {
|
291
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
292
|
+
type: options === null || options === void 0 ? void 0 : options.type
|
293
|
+
});
|
278
294
|
});
|
279
295
|
}, [adapter]);
|
280
296
|
/* @conditional-compile-remove(attachment-upload) */
|
@@ -294,21 +310,25 @@ export const ChatScreen = (props) => {
|
|
294
310
|
}, []), attachmentDownloadErrorMessage: downloadErrorMessage || '' }),
|
295
311
|
React.createElement(MessageThread, Object.assign({}, messageThreadProps, { onRenderAvatar: onRenderAvatarCallback, onRenderMessage: onRenderMessage,
|
296
312
|
/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
|
297
|
-
onRenderAttachmentDownloads: onRenderAttachmentDownloads, inlineImageOptions: inlineImageOptions, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles
|
313
|
+
onRenderAttachmentDownloads: onRenderAttachmentDownloads, inlineImageOptions: inlineImageOptions, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles,
|
314
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
315
|
+
richTextEditor: options === null || options === void 0 ? void 0 : options.richTextEditor })),
|
298
316
|
React.createElement(Stack, { className: mergeStyles(sendboxContainerStyles) },
|
299
317
|
React.createElement("div", { className: mergeStyles(typingIndicatorContainerStyles) }, onRenderTypingIndicator ? (onRenderTypingIndicator(typingIndicatorProps.typingUsers)) : (React.createElement(TypingIndicator, Object.assign({}, typingIndicatorProps, { styles: typingIndicatorStyles })))),
|
300
318
|
React.createElement(Stack, { horizontal: formFactor === 'mobile' },
|
301
319
|
formFactor === 'mobile' && (React.createElement(Stack, { verticalAlign: "center" },
|
302
320
|
React.createElement(AttachmentButton, null))),
|
303
321
|
React.createElement(Stack, { grow: true },
|
304
|
-
React.createElement(
|
322
|
+
React.createElement(SendBoxPicker, { styles: sendBoxStyles, autoFocus: options === null || options === void 0 ? void 0 : options.autoFocus,
|
323
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
324
|
+
richTextEditor: options === null || options === void 0 ? void 0 : options.richTextEditor,
|
305
325
|
/* @conditional-compile-remove(attachment-upload) */
|
306
326
|
attachments: attachments,
|
307
327
|
/* @conditional-compile-remove(attachment-upload) */
|
308
328
|
onCancelAttachmentUpload: onCancelUploadHandler,
|
309
329
|
// we need to overwrite onSendMessage for SendBox because we need to clear attachment state
|
310
330
|
// when submit button is clicked
|
311
|
-
onSendMessage: onSendMessageHandler }))
|
331
|
+
onSendMessage: onSendMessageHandler })),
|
312
332
|
formFactor !== 'mobile' && React.createElement(AttachmentButton, null)))),
|
313
333
|
/* @conditional-compile-remove(chat-composite-participant-pane) */
|
314
334
|
(options === null || options === void 0 ? void 0 : options.participantPane) === true && (React.createElement(ChatScreenPeoplePane, { onFetchAvatarPersonaData: onFetchAvatarPersonaData, onFetchParticipantMenuItems: props.onFetchParticipantMenuItems, isMobile: formFactor === 'mobile' }))),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatScreen.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/ChatScreen.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAEL,QAAQ,EAGR,aAAa,EAIb,eAAe,EAEf,QAAQ,EACT,yCAAmC;AAGpC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/D,oDAAoD;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,aAAa,EAAiD,MAAM,yBAAyB,CAAC;AACvG,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,oDAAoD;AACpD,OAAO,EAAE,6BAA6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KAAK,QAAQ,GACjC,CACH,CAEG;QACP,gBAAgB,IAAI,CACnB,oBAAC,YAAY,oBACP,gBAAgB,IACpB,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAE,GAAG,EAAE;gBACd,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBAC/B,qBAAqB,CAAC,KAAK,CAAC,CAAC;gBAC7B,OAAO,CAAC,uBAAuB,CAAC;oBAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,QAAQ;oBAC5C,SAAS,EAAE,gBAAgB,CAAC,SAAS;oBACrC,WAAW,EAAE,gBAAgB,CAAC,QAAQ;iBACvC,CAAC,CAAC;YACL,CAAC,EACD,uBAAuB,EAAE,uBAAuB,IAChD,CACH,CACK,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isIOS } from '@fluentui/react';\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { PersonaSize } from '@fluentui/react';\nimport {\n CommunicationParticipant,\n ErrorBar,\n MessageProps,\n MessageRenderer,\n MessageThread,\n MessageThreadStyles,\n ParticipantMenuItemsCallback,\n SendBoxStylesProps,\n TypingIndicator,\n TypingIndicatorStylesProps,\n useTheme\n} from '@internal/react-components';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { ChatMessage } from '@internal/react-components';\nimport React, { useCallback, useEffect, useMemo } from 'react';\n/* @conditional-compile-remove(attachment-upload) */\nimport { useReducer } from 'react';\nimport { useState } from 'react';\nimport { AvatarPersona, AvatarPersonaDataCallback, AvatarPersonaProps } from '../common/AvatarPersona';\nimport { useAdapter } from './adapter/ChatAdapterProvider';\nimport { ChatCompositeOptions } from './ChatComposite';\nimport { ChatHeader, getHeaderProps } from './ChatHeader';\n/* @conditional-compile-remove(attachment-upload) */\nimport { AttachmentUploadButtonWrapper as AttachmentUploadButton } from './file-sharing';\nimport { useAdaptedSelector } from './hooks/useAdaptedSelector';\nimport { usePropsFor } from './hooks/usePropsFor';\n\nimport {\n chatArea,\n chatContainer,\n chatWrapper,\n messageThreadChatCompositeStyles,\n sendboxContainerStyles,\n typingIndicatorContainerStyles\n} from './styles/Chat.styles';\nimport { participantListContainerPadding } from '../common/styles/ParticipantContainer.styles';\n/* @conditional-compile-remove(chat-composite-participant-pane) */\nimport { ChatScreenPeoplePane } from './ChatScreenPeoplePane';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentDownloadErrorBar } from './AttachmentDownloadErrorBar';\nimport { _AttachmentDownloadCards } from '@internal/react-components';\nimport { ImageOverlay } from '@internal/react-components';\nimport { InlineImage } from '@internal/react-components';\nimport { ResourceFetchResult } from '@internal/chat-stateful-client';\nimport { AttachmentOptions } from '@internal/react-components';\nimport { SendBox } from '@internal/react-components';\n/* @conditional-compile-remove(attachment-upload) */\nimport { nanoid } from 'nanoid';\n/* @conditional-compile-remove(attachment-upload) */\nimport { AttachmentUploadActionType, AttachmentUpload, AttachmentUploadReducer } from './file-sharing/AttachmentUpload';\n/* @conditional-compile-remove(attachment-upload) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\nexport type ChatScreenProps = {\n options?: ChatCompositeOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onRenderMessage?: (messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element;\n onRenderTypingIndicator?: (typingUsers: CommunicationParticipant[]) => JSX.Element;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n styles?: ChatScreenStyles;\n attachmentOptions?: AttachmentOptions;\n formFactor?: 'desktop' | 'mobile';\n};\n\n/**\n * @private\n */\nexport type ChatScreenStyles = {\n messageThread?: MessageThreadStyles;\n sendBox?: SendBoxStylesProps;\n typingIndicator?: TypingIndicatorStylesProps;\n};\n\n/**\n * @private\n */\ninterface OverlayImageItem {\n imageSrc: string;\n title: string;\n titleIcon: JSX.Element;\n attachmentId: string;\n messageId: string;\n imageUrl: string;\n}\n\n/**\n * @private\n */\nexport const ChatScreen = (props: ChatScreenProps): JSX.Element => {\n const {\n onFetchAvatarPersonaData,\n onRenderMessage,\n onRenderTypingIndicator,\n options,\n styles,\n attachmentOptions,\n formFactor\n } = props;\n\n const defaultNumberOfChatMessagesToReload = 5;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const [downloadErrorMessage, setDownloadErrorMessage] = React.useState('');\n const [overlayImageItem, setOverlayImageItem] = useState<OverlayImageItem>();\n const [isImageOverlayOpen, setIsImageOverlayOpen] = useState<boolean>(false);\n /* @conditional-compile-remove(attachment-upload) */\n const [uploads, handleUploadAction] = useReducer(AttachmentUploadReducer, []);\n\n const adapter = useAdapter();\n const theme = useTheme();\n\n useEffect(() => {\n // Initial data should be always fetched by the composite(or external caller) instead of the adapter\n const fetchData: () => Promise<void> = async () => {\n // Fetch initial data for adapter\n await adapter.fetchInitialData();\n // Fetch initial set of messages. Without fetching messages here, if the Composite's adapter is changed the message thread does not load new messages.\n await adapter.loadPreviousChatMessages(defaultNumberOfChatMessagesToReload);\n };\n fetchData();\n }, [adapter]);\n\n const messageThreadProps = usePropsFor(MessageThread);\n const sendBoxProps = usePropsFor(SendBox);\n const typingIndicatorProps = usePropsFor(TypingIndicator);\n const headerProps = useAdaptedSelector(getHeaderProps);\n const errorBarProps = usePropsFor(ErrorBar);\n\n useEffect(() => {\n if (overlayImageItem === undefined) {\n return;\n }\n const message = adapter.getState().thread.chatMessages[overlayImageItem.messageId];\n if (message === undefined) {\n return;\n }\n const resourceCache = message.resourceCache;\n if (overlayImageItem.imageSrc === '' && resourceCache && resourceCache[overlayImageItem.imageUrl]) {\n const fullSizeImageSrc = getResourceSourceUrl(resourceCache[overlayImageItem.imageUrl]);\n if (fullSizeImageSrc === undefined || fullSizeImageSrc === '' || overlayImageItem.imageSrc === fullSizeImageSrc) {\n return;\n }\n setOverlayImageItem({\n ...overlayImageItem,\n imageSrc: fullSizeImageSrc\n });\n }\n // Disable eslint because we are using the overlayImageItem in this effect but don't want to have it as a dependency, as it will cause an infinite loop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messageThreadProps.messages]);\n\n const getResourceSourceUrl = (result: ResourceFetchResult): string => {\n let src = '';\n if (result.error || !result.sourceUrl) {\n src = 'blob://';\n } else {\n src = result.sourceUrl;\n }\n\n return src;\n };\n\n const onRenderAvatarCallback = useCallback(\n (userId?: string, defaultOptions?: AvatarPersonaProps) => {\n return (\n <AvatarPersona\n userId={userId}\n hidePersonaDetails={true}\n {...defaultOptions}\n dataProvider={onFetchAvatarPersonaData}\n />\n );\n },\n [onFetchAvatarPersonaData]\n );\n\n const messageThreadStyles = useMemo(() => {\n return Object.assign(\n {},\n messageThreadChatCompositeStyles(theme.semanticColors.bodyBackground),\n styles?.messageThread\n );\n }, [styles?.messageThread, theme.semanticColors.bodyBackground]);\n\n const typingIndicatorStyles = useMemo(() => {\n return Object.assign({}, styles?.typingIndicator);\n }, [styles?.typingIndicator]);\n\n const sendBoxStyles = useMemo(() => {\n return Object.assign({}, styles?.sendBox);\n }, [styles?.sendBox]);\n\n const userId = toFlatCommunicationIdentifier(adapter.getState().userId);\n\n /* @conditional-compile-remove(attachment-upload) */\n const attachmentUploadButtonOnChange = useCallback(\n (files: FileList | null): void => {\n if (!files) {\n return;\n }\n\n // Get files, change to tasks, store locally and pass back to Contoso\n const newUploads = Array.from(files).map((file): AttachmentUpload => {\n const taskId = nanoid();\n return {\n file,\n taskId,\n metadata: {\n id: taskId,\n name: file.name,\n progress: 0\n },\n notifyUploadProgressChanged: (value: number) => {\n handleUploadAction({ type: AttachmentUploadActionType.Progress, taskId, progress: value });\n },\n notifyUploadCompleted: (id: string, url: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Completed, taskId, id, url });\n },\n notifyUploadFailed: (message: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Failed, taskId, message });\n // remove the failed upload task when error banner is auto dismissed after 10 seconds\n // so the banner won't be shown again on UI re-rendering.\n setTimeout(() => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id: taskId });\n }, 10 * 1000);\n }\n };\n });\n\n handleUploadAction({ type: AttachmentUploadActionType.Set, newUploads });\n attachmentOptions?.uploadOptions?.handleAttachmentSelection(newUploads);\n },\n [attachmentOptions?.uploadOptions]\n );\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const onRenderAttachmentDownloads = useCallback(\n (message: ChatMessage) =>\n message?.attachments?.length ?? 0 > 0 ? (\n <_AttachmentDownloadCards\n attachments={message.attachments}\n message={message}\n actionsForAttachment={attachmentOptions?.downloadOptions?.actionsForAttachment}\n onActionHandlerFailed={(errorMessage: string) => {\n setDownloadErrorMessage(errorMessage);\n }}\n />\n ) : (\n <></>\n ),\n [attachmentOptions?.downloadOptions?.actionsForAttachment]\n );\n\n const onInlineImageClicked = useCallback(\n (attachmentId: string, messageId: string) => {\n const message = adapter.getState().thread.chatMessages[messageId];\n const inlinedImages = message.content?.attachments?.filter((attachment) => {\n return attachment.attachmentType === 'image' && attachment.id === attachmentId;\n });\n\n if (!inlinedImages || inlinedImages.length <= 0) {\n return;\n }\n\n const attachment = inlinedImages[0];\n\n const resourceCache = message.resourceCache;\n let imageSrc = '';\n\n if (attachment.url) {\n if (resourceCache && resourceCache[attachment.url]) {\n imageSrc = getResourceSourceUrl(resourceCache[attachment.url]);\n } else {\n adapter.downloadResourceToCache({\n threadId: adapter.getState().thread.threadId,\n messageId: messageId,\n resourceUrl: attachment.url\n });\n }\n }\n\n const titleIconRenderOptions = {\n text: message.senderDisplayName,\n size: PersonaSize.size32,\n showOverflowTooltip: false,\n imageAlt: message.senderDisplayName\n };\n\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n const titleIcon = onRenderAvatarCallback && onRenderAvatarCallback(messageSenderId, titleIconRenderOptions);\n const overlayImage: OverlayImageItem = {\n title: message.senderDisplayName || '',\n titleIcon: titleIcon,\n attachmentId: attachment.id,\n imageSrc: imageSrc,\n messageId: messageId,\n imageUrl: attachment.url || ''\n };\n\n setIsImageOverlayOpen(true);\n setOverlayImageItem(overlayImage);\n },\n [adapter, onRenderAvatarCallback, userId]\n );\n\n const onRenderInlineImage = useCallback(\n (inlineImage: InlineImage, defaultOnRender: (inlineImage: InlineImage) => JSX.Element): JSX.Element => {\n const message = adapter.getState().thread.chatMessages[inlineImage.messageId];\n const attachment = message?.content?.attachments?.find(\n (attachment) => attachment.id === inlineImage.imageAttributes.id\n );\n\n if (attachment === undefined) {\n return defaultOnRender(inlineImage);\n }\n\n let pointerEvents: 'none' | 'auto' = inlineImage.imageAttributes.src === '' ? 'none' : 'auto';\n const resourceCache = message.resourceCache;\n if (\n resourceCache &&\n attachment.previewUrl &&\n resourceCache[attachment.previewUrl] &&\n resourceCache[attachment.previewUrl].error\n ) {\n pointerEvents = 'none';\n }\n\n return (\n <span\n key={inlineImage.imageAttributes.id}\n onClick={() => onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId)}\n tabIndex={0}\n role=\"button\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId);\n }\n }}\n style={{ cursor: 'pointer', pointerEvents }}\n >\n {defaultOnRender(inlineImage)}\n </span>\n );\n },\n [adapter, onInlineImageClicked]\n );\n\n const inlineImageOptions = useMemo(() => {\n return { onRenderInlineImage: onRenderInlineImage };\n }, [onRenderInlineImage]);\n\n const onDownloadButtonClicked = useCallback(\n (imageSrc: string): void => {\n if (imageSrc === '') {\n return;\n }\n if (isIOS()) {\n window.open(imageSrc, '_blank');\n } else {\n // Create a new anchor element\n const a = document.createElement('a');\n // Set the href and download attributes for the anchor element\n a.href = imageSrc;\n a.download = overlayImageItem?.attachmentId || '';\n a.rel = 'noopener noreferrer';\n a.target = '_blank';\n\n // Programmatically click the anchor element to trigger the download\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n },\n [overlayImageItem?.attachmentId]\n );\n\n const AttachmentButton = useCallback(() => {\n /* @conditional-compile-remove(attachment-upload) */\n if (!attachmentOptions?.uploadOptions?.handleAttachmentSelection) {\n return null;\n }\n /* @conditional-compile-remove(attachment-upload) */\n return (\n <AttachmentUploadButton\n supportedMediaTypes={attachmentOptions?.uploadOptions?.supportedMediaTypes}\n disableMultipleUploads={attachmentOptions?.uploadOptions?.disableMultipleUploads}\n onChange={attachmentUploadButtonOnChange}\n />\n );\n return <></>;\n }, [\n attachmentOptions?.uploadOptions?.handleAttachmentSelection,\n attachmentOptions?.uploadOptions?.supportedMediaTypes,\n attachmentOptions?.uploadOptions?.disableMultipleUploads,\n /* @conditional-compile-remove(attachment-upload) */\n attachmentUploadButtonOnChange\n ]);\n\n /* @conditional-compile-remove(attachment-upload) */\n const attachments = useMemo(() => {\n return uploads?.map((v) => v.metadata);\n }, [uploads]);\n\n const onSendMessageHandler = useCallback(\n async function (content: string, /* @conditional-compile-remove(attachment-upload) */ options?: MessageOptions) {\n /* @conditional-compile-remove(attachment-upload) */\n const attachments = options?.attachments ?? [];\n /* @conditional-compile-remove(attachment-upload) */\n handleUploadAction({ type: AttachmentUploadActionType.Clear });\n /* @conditional-compile-remove(attachment-upload) */\n await adapter.sendMessage(content, {\n attachments: attachments\n });\n /* @conditional-compile-remove(attachment-upload) */\n return;\n await adapter.sendMessage(content);\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(attachment-upload) */\n const onCancelUploadHandler = useCallback(\n (id: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id });\n attachmentOptions?.uploadOptions?.handleAttachmentRemoval?.(id);\n },\n [attachmentOptions?.uploadOptions]\n );\n return (\n <Stack className={chatContainer} grow>\n {options?.topic !== false && <ChatHeader {...headerProps} />}\n <Stack className={chatArea} tokens={participantListContainerPadding} horizontal grow>\n <Stack className={chatWrapper} grow>\n {options?.errorBar !== false && <ErrorBar {...errorBarProps} />}\n {\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n <AttachmentDownloadErrorBar\n onDismissDownloadErrorMessage={useCallback(() => {\n setDownloadErrorMessage('');\n }, [])}\n attachmentDownloadErrorMessage={downloadErrorMessage || ''}\n />\n }\n <MessageThread\n {...messageThreadProps}\n onRenderAvatar={onRenderAvatarCallback}\n onRenderMessage={onRenderMessage}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n inlineImageOptions={inlineImageOptions}\n numberOfChatMessagesToReload={defaultNumberOfChatMessagesToReload}\n styles={messageThreadStyles}\n />\n <Stack className={mergeStyles(sendboxContainerStyles)}>\n <div className={mergeStyles(typingIndicatorContainerStyles)}>\n {onRenderTypingIndicator ? (\n onRenderTypingIndicator(typingIndicatorProps.typingUsers)\n ) : (\n <TypingIndicator {...typingIndicatorProps} styles={typingIndicatorStyles} />\n )}\n </div>\n <Stack horizontal={formFactor === 'mobile'}>\n {formFactor === 'mobile' && (\n <Stack verticalAlign=\"center\">\n <AttachmentButton />\n </Stack>\n )}\n <Stack grow>\n <SendBox\n {...sendBoxProps}\n autoFocus={options?.autoFocus}\n styles={sendBoxStyles}\n /* @conditional-compile-remove(attachment-upload) */\n attachments={attachments}\n /* @conditional-compile-remove(attachment-upload) */\n onCancelAttachmentUpload={onCancelUploadHandler}\n // we need to overwrite onSendMessage for SendBox because we need to clear attachment state\n // when submit button is clicked\n onSendMessage={onSendMessageHandler}\n />\n </Stack>\n {formFactor !== 'mobile' && <AttachmentButton />}\n </Stack>\n </Stack>\n </Stack>\n {\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n options?.participantPane === true && (\n <ChatScreenPeoplePane\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.onFetchParticipantMenuItems}\n isMobile={formFactor === 'mobile'}\n />\n )\n }\n </Stack>\n {overlayImageItem && (\n <ImageOverlay\n {...overlayImageItem}\n isOpen={isImageOverlayOpen}\n onDismiss={() => {\n setOverlayImageItem(undefined);\n setIsImageOverlayOpen(false);\n adapter.removeResourceFromCache({\n threadId: adapter.getState().thread.threadId,\n messageId: overlayImageItem.messageId,\n resourceUrl: overlayImageItem.imageUrl\n });\n }}\n onDownloadButtonClicked={onDownloadButtonClicked}\n />\n )}\n </Stack>\n );\n};\n"]}
|
1
|
+
{"version":3,"file":"ChatScreen.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/ChatScreen.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAEL,QAAQ,EAGR,aAAa,EAIb,eAAe,EAEf,QAAQ,EACT,yCAAmC;AAGpC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/D,oDAAoD;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,aAAa,EAAiD,MAAM,yBAAyB,CAAC;AACvG,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,oDAAoD;AACpD,OAAO,EAAE,6BAA6B,IAAI,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,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S;gCAC7B,qEAAqE;gCACrE,cAAc,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc;gCACvC,oDAAoD;gCACpD,WAAW,EAAE,WAAW;gCACxB,oDAAoD;gCACpD,wBAAwB,EAAE,qBAAqB;gCAC/C,2FAA2F;gCAC3F,gCAAgC;gCAChC,aAAa,EAAE,oBAAoB,GACnC,CACI;wBACP,UAAU,KAAK,QAAQ,IAAI,oBAAC,gBAAgB,OAAG,CAC1C,CACF,CACF;YAEN,kEAAkE;YAClE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,MAAK,IAAI,IAAI,CACnC,oBAAC,oBAAoB,IACnB,wBAAwB,EAAE,wBAAwB,EAClD,2BAA2B,EAAE,KAAK,CAAC,2BAA2B,EAC9D,QAAQ,EAAE,UAAU,KAAK,QAAQ,GACjC,CACH,CAEG;QACP,gBAAgB,IAAI,CACnB,oBAAC,YAAY,oBACP,gBAAgB,IACpB,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAE,GAAG,EAAE;gBACd,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBAC/B,qBAAqB,CAAC,KAAK,CAAC,CAAC;gBAC7B,OAAO,CAAC,uBAAuB,CAAC;oBAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,QAAQ;oBAC5C,SAAS,EAAE,gBAAgB,CAAC,SAAS;oBACrC,WAAW,EAAE,gBAAgB,CAAC,QAAQ;iBACvC,CAAC,CAAC;YACL,CAAC,EACD,uBAAuB,EAAE,uBAAuB,IAChD,CACH,CACK,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isIOS } from '@fluentui/react';\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { PersonaSize } from '@fluentui/react';\nimport {\n CommunicationParticipant,\n ErrorBar,\n MessageProps,\n MessageRenderer,\n MessageThread,\n MessageThreadStyles,\n ParticipantMenuItemsCallback,\n SendBoxStylesProps,\n TypingIndicator,\n TypingIndicatorStylesProps,\n useTheme\n} from '@internal/react-components';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { ChatMessage } from '@internal/react-components';\nimport React, { useCallback, useEffect, useMemo } from 'react';\n/* @conditional-compile-remove(attachment-upload) */\nimport { useReducer } from 'react';\nimport { useState } from 'react';\nimport { AvatarPersona, AvatarPersonaDataCallback, AvatarPersonaProps } from '../common/AvatarPersona';\nimport { useAdapter } from './adapter/ChatAdapterProvider';\nimport { ChatCompositeOptions } from './ChatComposite';\nimport { ChatHeader, getHeaderProps } from './ChatHeader';\n/* @conditional-compile-remove(attachment-upload) */\nimport { AttachmentUploadButtonWrapper as AttachmentUploadButton } from './file-sharing';\nimport { useAdaptedSelector } from './hooks/useAdaptedSelector';\nimport { usePropsFor } from './hooks/usePropsFor';\n\nimport {\n chatArea,\n chatContainer,\n chatWrapper,\n messageThreadChatCompositeStyles,\n sendboxContainerStyles,\n typingIndicatorContainerStyles\n} from './styles/Chat.styles';\nimport { participantListContainerPadding } from '../common/styles/ParticipantContainer.styles';\n/* @conditional-compile-remove(chat-composite-participant-pane) */\nimport { ChatScreenPeoplePane } from './ChatScreenPeoplePane';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentDownloadErrorBar } from './AttachmentDownloadErrorBar';\nimport { _AttachmentDownloadCards } from '@internal/react-components';\nimport { ImageOverlay } from '@internal/react-components';\nimport { InlineImage } from '@internal/react-components';\nimport { ResourceFetchResult } from '@internal/chat-stateful-client';\nimport { AttachmentOptions } from '@internal/react-components';\n/* @conditional-compile-remove(attachment-upload) */\nimport { nanoid } from 'nanoid';\n/* @conditional-compile-remove(attachment-upload) */\nimport { AttachmentUploadActionType, AttachmentUpload, AttachmentUploadReducer } from './file-sharing/AttachmentUpload';\n/* @conditional-compile-remove(attachment-upload) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport { SendBoxPicker } from '../common/SendBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { loadRichTextSendBox } from '../common/SendBoxPicker';\n\n/**\n * @private\n */\nexport type ChatScreenProps = {\n options?: ChatCompositeOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onRenderMessage?: (messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element;\n onRenderTypingIndicator?: (typingUsers: CommunicationParticipant[]) => JSX.Element;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n styles?: ChatScreenStyles;\n attachmentOptions?: AttachmentOptions;\n formFactor?: 'desktop' | 'mobile';\n};\n\n/**\n * @private\n */\nexport type ChatScreenStyles = {\n messageThread?: MessageThreadStyles;\n sendBox?: SendBoxStylesProps;\n typingIndicator?: TypingIndicatorStylesProps;\n};\n\n/**\n * @private\n */\ninterface OverlayImageItem {\n imageSrc: string;\n title: string;\n titleIcon: JSX.Element;\n attachmentId: string;\n messageId: string;\n imageUrl: string;\n}\n\n/**\n * @private\n */\nexport const ChatScreen = (props: ChatScreenProps): JSX.Element => {\n const {\n onFetchAvatarPersonaData,\n onRenderMessage,\n onRenderTypingIndicator,\n options,\n styles,\n attachmentOptions,\n formFactor\n } = props;\n\n const defaultNumberOfChatMessagesToReload = 5;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const [downloadErrorMessage, setDownloadErrorMessage] = React.useState('');\n const [overlayImageItem, setOverlayImageItem] = useState<OverlayImageItem>();\n const [isImageOverlayOpen, setIsImageOverlayOpen] = useState<boolean>(false);\n /* @conditional-compile-remove(attachment-upload) */\n const [uploads, handleUploadAction] = useReducer(AttachmentUploadReducer, []);\n\n const adapter = useAdapter();\n const theme = useTheme();\n\n useEffect(() => {\n // Initial data should be always fetched by the composite(or external caller) instead of the adapter\n const fetchData: () => Promise<void> = async () => {\n // Fetch initial data for adapter\n await adapter.fetchInitialData();\n // Fetch initial set of messages. Without fetching messages here, if the Composite's adapter is changed the message thread does not load new messages.\n await adapter.loadPreviousChatMessages(defaultNumberOfChatMessagesToReload);\n };\n fetchData();\n }, [adapter]);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n useEffect(() => {\n // if rich text editor is enabled, the rich text editor component should be loaded early for good UX\n if (options?.richTextEditor !== undefined && options.richTextEditor) {\n // this line is needed to load the Rooster JS dependencies early in the lifecycle\n // when the rich text editor is enabled\n loadRichTextSendBox();\n }\n }, [options?.richTextEditor]);\n\n const messageThreadProps = usePropsFor(MessageThread);\n const typingIndicatorProps = usePropsFor(TypingIndicator);\n const headerProps = useAdaptedSelector(getHeaderProps);\n const errorBarProps = usePropsFor(ErrorBar);\n\n useEffect(() => {\n if (overlayImageItem === undefined) {\n return;\n }\n const message = adapter.getState().thread.chatMessages[overlayImageItem.messageId];\n if (message === undefined) {\n return;\n }\n const resourceCache = message.resourceCache;\n if (overlayImageItem.imageSrc === '' && resourceCache && resourceCache[overlayImageItem.imageUrl]) {\n const fullSizeImageSrc = getResourceSourceUrl(resourceCache[overlayImageItem.imageUrl]);\n if (fullSizeImageSrc === undefined || fullSizeImageSrc === '' || overlayImageItem.imageSrc === fullSizeImageSrc) {\n return;\n }\n setOverlayImageItem({\n ...overlayImageItem,\n imageSrc: fullSizeImageSrc\n });\n }\n // Disable eslint because we are using the overlayImageItem in this effect but don't want to have it as a dependency, as it will cause an infinite loop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messageThreadProps.messages]);\n\n const getResourceSourceUrl = (result: ResourceFetchResult): string => {\n let src = '';\n if (result.error || !result.sourceUrl) {\n src = 'blob://';\n } else {\n src = result.sourceUrl;\n }\n\n return src;\n };\n\n const onRenderAvatarCallback = useCallback(\n (userId?: string, defaultOptions?: AvatarPersonaProps) => {\n return (\n <AvatarPersona\n userId={userId}\n hidePersonaDetails={true}\n {...defaultOptions}\n dataProvider={onFetchAvatarPersonaData}\n />\n );\n },\n [onFetchAvatarPersonaData]\n );\n\n const messageThreadStyles = useMemo(() => {\n return Object.assign(\n {},\n messageThreadChatCompositeStyles(theme.semanticColors.bodyBackground),\n styles?.messageThread\n );\n }, [styles?.messageThread, theme.semanticColors.bodyBackground]);\n\n const typingIndicatorStyles = useMemo(() => {\n return Object.assign({}, styles?.typingIndicator);\n }, [styles?.typingIndicator]);\n\n const sendBoxStyles = useMemo(() => {\n return Object.assign({}, styles?.sendBox);\n }, [styles?.sendBox]);\n\n const userId = toFlatCommunicationIdentifier(adapter.getState().userId);\n\n /* @conditional-compile-remove(attachment-upload) */\n const attachmentUploadButtonOnChange = useCallback(\n (files: FileList | null): void => {\n if (!files) {\n return;\n }\n\n // Get files, change to tasks, store locally and pass back to Contoso\n const newUploads = Array.from(files).map((file): AttachmentUpload => {\n const taskId = nanoid();\n return {\n file,\n taskId,\n metadata: {\n id: taskId,\n name: file.name,\n progress: 0\n },\n notifyUploadProgressChanged: (value: number) => {\n handleUploadAction({ type: AttachmentUploadActionType.Progress, taskId, progress: value });\n },\n notifyUploadCompleted: (id: string, url: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Completed, taskId, id, url });\n },\n notifyUploadFailed: (message: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Failed, taskId, message });\n // remove the failed upload task when error banner is auto dismissed after 10 seconds\n // so the banner won't be shown again on UI re-rendering.\n setTimeout(() => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id: taskId });\n }, 10 * 1000);\n }\n };\n });\n\n handleUploadAction({ type: AttachmentUploadActionType.Set, newUploads });\n attachmentOptions?.uploadOptions?.handleAttachmentSelection(newUploads);\n },\n [attachmentOptions?.uploadOptions]\n );\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const onRenderAttachmentDownloads = useCallback(\n (message: ChatMessage) =>\n message?.attachments?.length ?? 0 > 0 ? (\n <_AttachmentDownloadCards\n attachments={message.attachments}\n message={message}\n actionsForAttachment={attachmentOptions?.downloadOptions?.actionsForAttachment}\n onActionHandlerFailed={(errorMessage: string) => {\n setDownloadErrorMessage(errorMessage);\n }}\n />\n ) : (\n <></>\n ),\n [attachmentOptions?.downloadOptions?.actionsForAttachment]\n );\n\n const onInlineImageClicked = useCallback(\n (attachmentId: string, messageId: string) => {\n const message = adapter.getState().thread.chatMessages[messageId];\n const inlinedImages = message.content?.attachments?.filter((attachment) => {\n return attachment.attachmentType === 'image' && attachment.id === attachmentId;\n });\n\n if (!inlinedImages || inlinedImages.length <= 0) {\n return;\n }\n\n const attachment = inlinedImages[0];\n\n const resourceCache = message.resourceCache;\n let imageSrc = '';\n\n if (attachment.url) {\n if (resourceCache && resourceCache[attachment.url]) {\n imageSrc = getResourceSourceUrl(resourceCache[attachment.url]);\n } else {\n adapter.downloadResourceToCache({\n threadId: adapter.getState().thread.threadId,\n messageId: messageId,\n resourceUrl: attachment.url\n });\n }\n }\n\n const titleIconRenderOptions = {\n text: message.senderDisplayName,\n size: PersonaSize.size32,\n showOverflowTooltip: false,\n imageAlt: message.senderDisplayName\n };\n\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n const titleIcon = onRenderAvatarCallback && onRenderAvatarCallback(messageSenderId, titleIconRenderOptions);\n const overlayImage: OverlayImageItem = {\n title: message.senderDisplayName || '',\n titleIcon: titleIcon,\n attachmentId: attachment.id,\n imageSrc: imageSrc,\n messageId: messageId,\n imageUrl: attachment.url || ''\n };\n\n setIsImageOverlayOpen(true);\n setOverlayImageItem(overlayImage);\n },\n [adapter, onRenderAvatarCallback, userId]\n );\n\n const onRenderInlineImage = useCallback(\n (inlineImage: InlineImage, defaultOnRender: (inlineImage: InlineImage) => JSX.Element): JSX.Element => {\n const message = adapter.getState().thread.chatMessages[inlineImage.messageId];\n const attachment = message?.content?.attachments?.find(\n (attachment) => attachment.id === inlineImage.imageAttributes.id\n );\n\n if (attachment === undefined) {\n return defaultOnRender(inlineImage);\n }\n\n let pointerEvents: 'none' | 'auto' = inlineImage.imageAttributes.src === '' ? 'none' : 'auto';\n const resourceCache = message.resourceCache;\n if (\n resourceCache &&\n attachment.previewUrl &&\n resourceCache[attachment.previewUrl] &&\n resourceCache[attachment.previewUrl].error\n ) {\n pointerEvents = 'none';\n }\n\n return (\n <span\n key={inlineImage.imageAttributes.id}\n onClick={() => onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId)}\n tabIndex={0}\n role=\"button\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId);\n }\n }}\n style={{ cursor: 'pointer', pointerEvents }}\n >\n {defaultOnRender(inlineImage)}\n </span>\n );\n },\n [adapter, onInlineImageClicked]\n );\n\n const inlineImageOptions = useMemo(() => {\n return { onRenderInlineImage: onRenderInlineImage };\n }, [onRenderInlineImage]);\n\n const onDownloadButtonClicked = useCallback(\n (imageSrc: string): void => {\n if (imageSrc === '') {\n return;\n }\n if (isIOS()) {\n window.open(imageSrc, '_blank');\n } else {\n // Create a new anchor element\n const a = document.createElement('a');\n // Set the href and download attributes for the anchor element\n a.href = imageSrc;\n a.download = overlayImageItem?.attachmentId || '';\n a.rel = 'noopener noreferrer';\n a.target = '_blank';\n\n // Programmatically click the anchor element to trigger the download\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n },\n [overlayImageItem?.attachmentId]\n );\n\n const AttachmentButton = useCallback(() => {\n /* @conditional-compile-remove(attachment-upload) */\n if (!attachmentOptions?.uploadOptions?.handleAttachmentSelection) {\n return null;\n }\n /* @conditional-compile-remove(attachment-upload) */\n return (\n <AttachmentUploadButton\n supportedMediaTypes={attachmentOptions?.uploadOptions?.supportedMediaTypes}\n disableMultipleUploads={attachmentOptions?.uploadOptions?.disableMultipleUploads}\n onChange={attachmentUploadButtonOnChange}\n />\n );\n return <></>;\n }, [\n attachmentOptions?.uploadOptions?.handleAttachmentSelection,\n attachmentOptions?.uploadOptions?.supportedMediaTypes,\n attachmentOptions?.uploadOptions?.disableMultipleUploads,\n /* @conditional-compile-remove(attachment-upload) */\n attachmentUploadButtonOnChange\n ]);\n\n /* @conditional-compile-remove(attachment-upload) */\n const attachments = useMemo(() => {\n return uploads?.map((v) => v.metadata);\n }, [uploads]);\n\n const onSendMessageHandler = useCallback(\n async function (\n content: string,\n /* @conditional-compile-remove(attachment-upload) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */ options?: MessageOptions\n ) {\n /* @conditional-compile-remove(attachment-upload) */\n const attachments = options?.attachments ?? [];\n /* @conditional-compile-remove(attachment-upload) */\n handleUploadAction({ type: AttachmentUploadActionType.Clear });\n /* @conditional-compile-remove(attachment-upload) */\n await adapter.sendMessage(content, {\n attachments: attachments,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: options?.type\n });\n /* @conditional-compile-remove(attachment-upload) */\n return;\n await adapter.sendMessage(content, {\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: options?.type\n });\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(attachment-upload) */\n const onCancelUploadHandler = useCallback(\n (id: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id });\n attachmentOptions?.uploadOptions?.handleAttachmentRemoval?.(id);\n },\n [attachmentOptions?.uploadOptions]\n );\n return (\n <Stack className={chatContainer} grow>\n {options?.topic !== false && <ChatHeader {...headerProps} />}\n <Stack className={chatArea} tokens={participantListContainerPadding} horizontal grow>\n <Stack className={chatWrapper} grow>\n {options?.errorBar !== false && <ErrorBar {...errorBarProps} />}\n {\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n <AttachmentDownloadErrorBar\n onDismissDownloadErrorMessage={useCallback(() => {\n setDownloadErrorMessage('');\n }, [])}\n attachmentDownloadErrorMessage={downloadErrorMessage || ''}\n />\n }\n <MessageThread\n {...messageThreadProps}\n onRenderAvatar={onRenderAvatarCallback}\n onRenderMessage={onRenderMessage}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n inlineImageOptions={inlineImageOptions}\n numberOfChatMessagesToReload={defaultNumberOfChatMessagesToReload}\n styles={messageThreadStyles}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor={options?.richTextEditor}\n />\n <Stack className={mergeStyles(sendboxContainerStyles)}>\n <div className={mergeStyles(typingIndicatorContainerStyles)}>\n {onRenderTypingIndicator ? (\n onRenderTypingIndicator(typingIndicatorProps.typingUsers)\n ) : (\n <TypingIndicator {...typingIndicatorProps} styles={typingIndicatorStyles} />\n )}\n </div>\n <Stack horizontal={formFactor === 'mobile'}>\n {formFactor === 'mobile' && (\n <Stack verticalAlign=\"center\">\n <AttachmentButton />\n </Stack>\n )}\n <Stack grow>\n <SendBoxPicker\n styles={sendBoxStyles}\n autoFocus={options?.autoFocus}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor={options?.richTextEditor}\n /* @conditional-compile-remove(attachment-upload) */\n attachments={attachments}\n /* @conditional-compile-remove(attachment-upload) */\n onCancelAttachmentUpload={onCancelUploadHandler}\n // we need to overwrite onSendMessage for SendBox because we need to clear attachment state\n // when submit button is clicked\n onSendMessage={onSendMessageHandler}\n />\n </Stack>\n {formFactor !== 'mobile' && <AttachmentButton />}\n </Stack>\n </Stack>\n </Stack>\n {\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n options?.participantPane === true && (\n <ChatScreenPeoplePane\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.onFetchParticipantMenuItems}\n isMobile={formFactor === 'mobile'}\n />\n )\n }\n </Stack>\n {overlayImageItem && (\n <ImageOverlay\n {...overlayImageItem}\n isOpen={isImageOverlayOpen}\n onDismiss={() => {\n setOverlayImageItem(undefined);\n setIsImageOverlayOpen(false);\n adapter.removeResourceFromCache({\n threadId: adapter.getState().thread.threadId,\n messageId: overlayImageItem.messageId,\n resourceUrl: overlayImageItem.imageUrl\n });\n }}\n onDownloadButtonClicked={onDownloadButtonClicked}\n />\n )}\n </Stack>\n );\n};\n"]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { RichTextSendBoxProps } from "../../../../react-components/src";
|
3
|
+
/**
|
4
|
+
* @private
|
5
|
+
*
|
6
|
+
* Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox
|
7
|
+
* before lazyLoading is done
|
8
|
+
*/
|
9
|
+
export declare const RichTextSendBoxWrapper: (props: RichTextSendBoxProps) => JSX.Element;
|
10
|
+
//# sourceMappingURL=RichTextSendBoxWrapper.d.ts.map
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
4
|
+
import React from 'react';
|
5
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
6
|
+
import { usePropsFor } from '../ChatComposite/hooks/usePropsFor';
|
7
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
8
|
+
import { RichTextSendBox } from "../../../../react-components/src";
|
9
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
10
|
+
/**
|
11
|
+
* @private
|
12
|
+
*
|
13
|
+
* Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox
|
14
|
+
* before lazyLoading is done
|
15
|
+
*/
|
16
|
+
export const RichTextSendBoxWrapper = (props) => {
|
17
|
+
const richTextSendBoxProps = usePropsFor(RichTextSendBox);
|
18
|
+
return React.createElement(RichTextSendBox, Object.assign({}, richTextSendBoxProps, props));
|
19
|
+
};
|
20
|
+
//# sourceMappingURL=RichTextSendBoxWrapper.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RichTextSendBoxWrapper.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/RichTextSendBoxWrapper.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,qEAAqE;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,qEAAqE;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,qEAAqE;AACrE,OAAO,EAAE,eAAe,EAAwB,yCAAmC;AAEnF,qEAAqE;AACrE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAA2B,EAAe,EAAE;IACjF,MAAM,oBAAoB,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;IAE1D,OAAO,oBAAC,eAAe,oBAAK,oBAAoB,EAAM,KAAK,EAAI,CAAC;AAClE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport React from 'react';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { usePropsFor } from '../ChatComposite/hooks/usePropsFor';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { RichTextSendBox, RichTextSendBoxProps } from '@internal/react-components';\n\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\n/**\n * @private\n *\n * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox\n * before lazyLoading is done\n */\nexport const RichTextSendBoxWrapper = (props: RichTextSendBoxProps): JSX.Element => {\n const richTextSendBoxProps = usePropsFor(RichTextSendBox);\n\n return <RichTextSendBox {...richTextSendBoxProps} {...props} />;\n};\n"]}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { SendBoxStylesProps } from "../../../../react-components/src";
|
3
|
+
import { RichTextSendBoxProps } from "../../../../react-components/src";
|
4
|
+
import { AttachmentMetadataInProgress, MessageOptions } from "../../../../acs-ui-common/src";
|
5
|
+
/**
|
6
|
+
* @private
|
7
|
+
* Use this function to load RoosterJS dependencies early in the lifecycle.
|
8
|
+
* It should be the same import as used for lazy loading.
|
9
|
+
*
|
10
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support)
|
11
|
+
*/
|
12
|
+
export declare const loadRichTextSendBox: () => Promise<{
|
13
|
+
default: React.ComponentType<RichTextSendBoxProps>;
|
14
|
+
}>;
|
15
|
+
/**
|
16
|
+
* @private
|
17
|
+
*/
|
18
|
+
export type SendBoxPickerProps = {
|
19
|
+
styles?: SendBoxStylesProps;
|
20
|
+
autoFocus?: 'sendBoxTextField';
|
21
|
+
onSendMessage: (content: string, options?: MessageOptions) => Promise<void>;
|
22
|
+
richTextEditor?: boolean;
|
23
|
+
attachments?: AttachmentMetadataInProgress[];
|
24
|
+
onCancelAttachmentUpload?: (attachmentId: string) => void;
|
25
|
+
};
|
26
|
+
/**
|
27
|
+
* @private
|
28
|
+
*/
|
29
|
+
export declare const SendBoxPicker: (props: SendBoxPickerProps) => JSX.Element;
|
30
|
+
//# sourceMappingURL=SendBoxPicker.d.ts.map
|
@@ -0,0 +1,44 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
import React, { useMemo } from 'react';
|
4
|
+
import { SendBox } from "../../../../react-components/src";
|
5
|
+
import { usePropsFor } from '../ChatComposite/hooks/usePropsFor';
|
6
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
7
|
+
import { Suspense } from 'react';
|
8
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
9
|
+
import { _ErrorBoundary } from "../../../../react-components/src";
|
10
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
11
|
+
/**
|
12
|
+
* Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox with lazy loading
|
13
|
+
*/
|
14
|
+
const RichTextSendBoxWrapper = React.lazy(() => import('./RichTextSendBoxWrapper').then((module) => ({ default: module.RichTextSendBoxWrapper })));
|
15
|
+
/**
|
16
|
+
* @private
|
17
|
+
* Use this function to load RoosterJS dependencies early in the lifecycle.
|
18
|
+
* It should be the same import as used for lazy loading.
|
19
|
+
*
|
20
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support)
|
21
|
+
*/
|
22
|
+
export const loadRichTextSendBox = () => import('./RichTextSendBoxWrapper').then((module) => ({ default: module.RichTextSendBoxWrapper }));
|
23
|
+
/**
|
24
|
+
* @private
|
25
|
+
*/
|
26
|
+
export const SendBoxPicker = (props) => {
|
27
|
+
const {
|
28
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
29
|
+
richTextEditor } = props;
|
30
|
+
const sendBoxProps = usePropsFor(SendBox);
|
31
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
32
|
+
const isRichTextEditorEnabled = useMemo(() => {
|
33
|
+
return richTextEditor;
|
34
|
+
}, [richTextEditor]);
|
35
|
+
const sendBox = useMemo(() => React.createElement(SendBox, Object.assign({}, sendBoxProps, props)), [props, sendBoxProps]);
|
36
|
+
/* @conditional-compile-remove(rich-text-editor-composite-support) */
|
37
|
+
if (isRichTextEditorEnabled) {
|
38
|
+
return (React.createElement(_ErrorBoundary, { fallback: sendBox },
|
39
|
+
React.createElement(Suspense, { fallback: sendBox },
|
40
|
+
React.createElement(RichTextSendBoxWrapper, Object.assign({}, props)))));
|
41
|
+
}
|
42
|
+
return sendBox;
|
43
|
+
};
|
44
|
+
//# sourceMappingURL=SendBoxPicker.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SendBoxPicker.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/common/SendBoxPicker.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,EAAsB,yCAAmC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,qEAAqE;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,qEAAqE;AACrE,OAAO,EAAE,cAA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ourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useMemo } from 'react';\nimport { SendBox, SendBoxStylesProps } from '@internal/react-components';\nimport { usePropsFor } from '../ChatComposite/hooks/usePropsFor';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { Suspense } from 'react';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { _ErrorBoundary, RichTextSendBoxProps } from '@internal/react-components';\n/* @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadataInProgress, MessageOptions } from '@internal/acs-ui-common';\n\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\n/**\n * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox with lazy loading\n */\nconst RichTextSendBoxWrapper = React.lazy(() =>\n import('./RichTextSendBoxWrapper').then((module) => ({ default: module.RichTextSendBoxWrapper }))\n);\n\n/**\n * @private\n * Use this function to load RoosterJS dependencies early in the lifecycle.\n * It should be the same import as used for lazy loading.\n *\n/* @conditional-compile-remove(rich-text-editor-composite-support)\n */\nexport const loadRichTextSendBox = (): Promise<{\n default: React.ComponentType<RichTextSendBoxProps>;\n}> => import('./RichTextSendBoxWrapper').then((module) => ({ default: module.RichTextSendBoxWrapper }));\n\n/**\n * @private\n */\nexport type SendBoxPickerProps = {\n styles?: SendBoxStylesProps;\n autoFocus?: 'sendBoxTextField';\n onSendMessage: (\n content: string,\n /* @conditional-compile-remove(attachment-upload) */ options?: MessageOptions\n ) => Promise<void>;\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor?: boolean;\n /* @conditional-compile-remove(attachment-upload) */\n attachments?: AttachmentMetadataInProgress[];\n /* @conditional-compile-remove(attachment-upload) */\n onCancelAttachmentUpload?: (attachmentId: string) => void;\n};\n\n/**\n * @private\n */\nexport const SendBoxPicker = (props: SendBoxPickerProps): JSX.Element => {\n const {\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor\n } = props;\n\n const sendBoxProps = usePropsFor(SendBox);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n const isRichTextEditorEnabled = useMemo(() => {\n return richTextEditor;\n }, [richTextEditor]);\n\n const sendBox = useMemo(() => <SendBox {...sendBoxProps} {...props} />, [props, sendBoxProps]);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n if (isRichTextEditorEnabled) {\n return (\n <_ErrorBoundary fallback={sendBox}>\n <Suspense fallback={sendBox}>\n <RichTextSendBoxWrapper {...props} />\n </Suspense>\n </_ErrorBoundary>\n );\n }\n return sendBox;\n};\n"]}
|
package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
"complianceBannerTranscriptionStopped": "توقفت كتابة الحديث.",
|
21
21
|
"configurationPageTitle": "بدء مكالمة",
|
22
22
|
"copyInviteLinkButtonLabel": "نسخ ارتباط دعوة",
|
23
|
+
"copyInviteLinkButtonActionedLabel": "تم نسخ الارتباط",
|
23
24
|
"copyInviteLinkActionedAriaLabel": "تم نسخ ارتباط الدعوة",
|
24
25
|
"defaultPlaceHolder": "تحديد خيار",
|
25
26
|
"dismissSidePaneButtonLabel": "إغلاق",
|
@@ -349,6 +350,7 @@
|
|
349
350
|
"chatButtonTooltipOpen": "إظهار الدردشة",
|
350
351
|
"chatPaneTitle": "دردشة",
|
351
352
|
"copyInviteLinkButtonLabel": "نسخ ارتباط دعوة",
|
353
|
+
"copyInviteLinkButtonActionedLabel": "تم نسخ الارتباط",
|
352
354
|
"copyInviteLinkActionedAriaLabel": "تم نسخ ارتباط الدعوة",
|
353
355
|
"dismissSidePaneButtonLabel": "إغلاق",
|
354
356
|
"moreDrawerAudioDeviceMenuTitle": "جهاز صوت",
|
@@ -364,6 +366,8 @@
|
|
364
366
|
"selectedPeopleButtonLabel": "تم تحديد زر الأشخاص",
|
365
367
|
"peopleButtonTooltipOpen": "إظهار المشاركين",
|
366
368
|
"peopleButtonTooltipClose": "إخفاء المشاركين",
|
369
|
+
"peopleButtonTooltipOpenAriaLabel": "زر الأشخاص، إظهار المشاركين",
|
370
|
+
"peopleButtonTooltipCloseAriaLabel": "زر الأشخاص، إخفاء المشاركين",
|
367
371
|
"peoplePaneSubTitle": "في هذه المكالمة",
|
368
372
|
"peoplePaneTitle": "الأشخاص",
|
369
373
|
"pictureInPictureTileAriaLabel": "موجزات الفيديو. انقر للعودة إلى شاشة المكالمة.",
|
package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
"complianceBannerTranscriptionStopped": "Přepis se zastavil.",
|
21
21
|
"configurationPageTitle": "Začít hovor",
|
22
22
|
"copyInviteLinkButtonLabel": "Kopírovat odkaz pro pozvání",
|
23
|
+
"copyInviteLinkButtonActionedLabel": "Odkaz byl zkopírován.",
|
23
24
|
"copyInviteLinkActionedAriaLabel": "Odkaz pozvánky se zkopíroval",
|
24
25
|
"defaultPlaceHolder": "Vyberte jednu možnost",
|
25
26
|
"dismissSidePaneButtonLabel": "Zavřít",
|
@@ -349,6 +350,7 @@
|
|
349
350
|
"chatButtonTooltipOpen": "Zobrazit chat",
|
350
351
|
"chatPaneTitle": "Chat",
|
351
352
|
"copyInviteLinkButtonLabel": "Kopírovat odkaz pro pozvání",
|
353
|
+
"copyInviteLinkButtonActionedLabel": "Odkaz byl zkopírován.",
|
352
354
|
"copyInviteLinkActionedAriaLabel": "Odkaz pozvánky se zkopíroval",
|
353
355
|
"dismissSidePaneButtonLabel": "Zavřít",
|
354
356
|
"moreDrawerAudioDeviceMenuTitle": "Zvukové zařízení",
|
@@ -364,6 +366,8 @@
|
|
364
366
|
"selectedPeopleButtonLabel": "Vybráno tlačítko Lidé",
|
365
367
|
"peopleButtonTooltipOpen": "Zobrazit účastníky",
|
366
368
|
"peopleButtonTooltipClose": "Skrýt účastníky",
|
369
|
+
"peopleButtonTooltipOpenAriaLabel": "Tlačítko Lidé, Zobrazit účastníky",
|
370
|
+
"peopleButtonTooltipCloseAriaLabel": "Tlačítko Lidé, Skrýt účastníky",
|
367
371
|
"peoplePaneSubTitle": "V tomto hovoru",
|
368
372
|
"peoplePaneTitle": "Lidé",
|
369
373
|
"pictureInPictureTileAriaLabel": "Informační kanály videa. Kliknutím se vrátíte na obrazovku hovoru.",
|
package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
"complianceBannerTranscriptionStopped": "Die Transkription wurde beendet.",
|
21
21
|
"configurationPageTitle": "Einen Anruf beginnen",
|
22
22
|
"copyInviteLinkButtonLabel": "Einladungslink kopieren",
|
23
|
+
"copyInviteLinkButtonActionedLabel": "Link kopiert",
|
23
24
|
"copyInviteLinkActionedAriaLabel": "Gruppeneinladungslink kopiert",
|
24
25
|
"defaultPlaceHolder": "Option auswählen",
|
25
26
|
"dismissSidePaneButtonLabel": "Schließen",
|
@@ -349,6 +350,7 @@
|
|
349
350
|
"chatButtonTooltipOpen": "Chat anzeigen",
|
350
351
|
"chatPaneTitle": "Chat",
|
351
352
|
"copyInviteLinkButtonLabel": "Einladungslink kopieren",
|
353
|
+
"copyInviteLinkButtonActionedLabel": "Link kopiert",
|
352
354
|
"copyInviteLinkActionedAriaLabel": "Gruppeneinladungslink kopiert",
|
353
355
|
"dismissSidePaneButtonLabel": "Schließen",
|
354
356
|
"moreDrawerAudioDeviceMenuTitle": "Audiogerät",
|
@@ -364,6 +366,8 @@
|
|
364
366
|
"selectedPeopleButtonLabel": "Schaltfläche \"Personen\" ausgewählt",
|
365
367
|
"peopleButtonTooltipOpen": "Teilnehmende anzeigen",
|
366
368
|
"peopleButtonTooltipClose": "Teilnehmende ausblenden",
|
369
|
+
"peopleButtonTooltipOpenAriaLabel": "Schaltfläche „Personen“, Teilnehmer anzeigen",
|
370
|
+
"peopleButtonTooltipCloseAriaLabel": "Schaltfläche „Personen“, Teilnehmer ausblenden",
|
367
371
|
"peoplePaneSubTitle": "In diesem Anruf",
|
368
372
|
"peoplePaneTitle": "Personen",
|
369
373
|
"pictureInPictureTileAriaLabel": "Videofeeds. Klicken Sie hier, um zum Anrufbildschirm zurückzukehren.",
|
package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
"complianceBannerTranscriptionStopped": "Transcription has stopped.",
|
21
21
|
"configurationPageTitle": "Start a call",
|
22
22
|
"copyInviteLinkButtonLabel": "Copy invite link",
|
23
|
+
"copyInviteLinkButtonActionedLabel": "Link copied",
|
23
24
|
"copyInviteLinkActionedAriaLabel": "Invite link copied",
|
24
25
|
"defaultPlaceHolder": "Select an option",
|
25
26
|
"dismissSidePaneButtonLabel": "Close",
|
@@ -349,6 +350,7 @@
|
|
349
350
|
"chatButtonTooltipOpen": "Show chat",
|
350
351
|
"chatPaneTitle": "Chat",
|
351
352
|
"copyInviteLinkButtonLabel": "Copy invite link",
|
353
|
+
"copyInviteLinkButtonActionedLabel": "Link copied",
|
352
354
|
"copyInviteLinkActionedAriaLabel": "Invite link copied",
|
353
355
|
"dismissSidePaneButtonLabel": "Close",
|
354
356
|
"moreDrawerAudioDeviceMenuTitle": "Audio Device",
|
@@ -364,6 +366,8 @@
|
|
364
366
|
"selectedPeopleButtonLabel": "People Button Selected",
|
365
367
|
"peopleButtonTooltipOpen": "Show participants",
|
366
368
|
"peopleButtonTooltipClose": "Hide participants",
|
369
|
+
"peopleButtonTooltipOpenAriaLabel": "People button, Show participants",
|
370
|
+
"peopleButtonTooltipCloseAriaLabel": "People button, Hide participants",
|
367
371
|
"peoplePaneSubTitle": "In this call",
|
368
372
|
"peoplePaneTitle": "People",
|
369
373
|
"pictureInPictureTileAriaLabel": "Video Feeds. Click to return to call screen.",
|
package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
"complianceBannerTranscriptionStopped": "La transcripción se ha detenido.",
|
21
21
|
"configurationPageTitle": "Iniciar una llamada",
|
22
22
|
"copyInviteLinkButtonLabel": "Copiar vínculo de invitación",
|
23
|
+
"copyInviteLinkButtonActionedLabel": "Vínculo copiado",
|
23
24
|
"copyInviteLinkActionedAriaLabel": "Vínculo de invitación copiado",
|
24
25
|
"defaultPlaceHolder": "Seleccionar una opción",
|
25
26
|
"dismissSidePaneButtonLabel": "Cerrar",
|
@@ -349,6 +350,7 @@
|
|
349
350
|
"chatButtonTooltipOpen": "Mostrar chat",
|
350
351
|
"chatPaneTitle": "Chat",
|
351
352
|
"copyInviteLinkButtonLabel": "Copiar vínculo de invitación",
|
353
|
+
"copyInviteLinkButtonActionedLabel": "Vínculo copiado",
|
352
354
|
"copyInviteLinkActionedAriaLabel": "Vínculo de invitación copiado",
|
353
355
|
"dismissSidePaneButtonLabel": "Cerrar",
|
354
356
|
"moreDrawerAudioDeviceMenuTitle": "Dispositivo de audio",
|
@@ -364,6 +366,8 @@
|
|
364
366
|
"selectedPeopleButtonLabel": "Se seleccionó el botón Contactos",
|
365
367
|
"peopleButtonTooltipOpen": "Mostrar participantes",
|
366
368
|
"peopleButtonTooltipClose": "Ocultar participantes",
|
369
|
+
"peopleButtonTooltipOpenAriaLabel": "Botón Contactos, Mostrar participantes",
|
370
|
+
"peopleButtonTooltipCloseAriaLabel": "Botón Contactos, Ocultar participantes",
|
367
371
|
"peoplePaneSubTitle": "En esta llamada",
|
368
372
|
"peoplePaneTitle": "Contactos",
|
369
373
|
"pictureInPictureTileAriaLabel": "Fuentes de vídeo. Hacer clic para volver a la pantalla de la llamada.",
|
package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
"complianceBannerTranscriptionStopped": "Transkriptio on pysäytetty.",
|
21
21
|
"configurationPageTitle": "Aloita puhelu",
|
22
22
|
"copyInviteLinkButtonLabel": "Kopioi kutsulinkki",
|
23
|
+
"copyInviteLinkButtonActionedLabel": "Linkki kopioitu",
|
23
24
|
"copyInviteLinkActionedAriaLabel": "Kutsulinkki kopioitu",
|
24
25
|
"defaultPlaceHolder": "Valitse vaihtoehto",
|
25
26
|
"dismissSidePaneButtonLabel": "Sulje",
|
@@ -349,6 +350,7 @@
|
|
349
350
|
"chatButtonTooltipOpen": "Näytä keskustelu",
|
350
351
|
"chatPaneTitle": "Keskustelu",
|
351
352
|
"copyInviteLinkButtonLabel": "Kopioi kutsulinkki",
|
353
|
+
"copyInviteLinkButtonActionedLabel": "Linkki kopioitu",
|
352
354
|
"copyInviteLinkActionedAriaLabel": "Kutsulinkki kopioitu",
|
353
355
|
"dismissSidePaneButtonLabel": "Sulje",
|
354
356
|
"moreDrawerAudioDeviceMenuTitle": "Äänilaite",
|
@@ -364,6 +366,8 @@
|
|
364
366
|
"selectedPeopleButtonLabel": "Henkilöt-painike valittu",
|
365
367
|
"peopleButtonTooltipOpen": "Näytä osallistujat",
|
366
368
|
"peopleButtonTooltipClose": "Piilota osallistujat",
|
369
|
+
"peopleButtonTooltipOpenAriaLabel": "Henkilöt-painike, Näytä osallistujat",
|
370
|
+
"peopleButtonTooltipCloseAriaLabel": "Henkilöt-painike, Piilota osallistujat",
|
367
371
|
"peoplePaneSubTitle": "Tässä puhelussa",
|
368
372
|
"peoplePaneTitle": "Ihmiset",
|
369
373
|
"pictureInPictureTileAriaLabel": "Videosyötteet. Palaa puhelunäyttöön napsauttamalla.",
|
package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
"complianceBannerTranscriptionStopped": "La transcription a pris fin.",
|
21
21
|
"configurationPageTitle": "Lancer un appel",
|
22
22
|
"copyInviteLinkButtonLabel": "Copier le lien d'invitation",
|
23
|
+
"copyInviteLinkButtonActionedLabel": "Lien copié",
|
23
24
|
"copyInviteLinkActionedAriaLabel": "Le lien d’invitation a été copié.",
|
24
25
|
"defaultPlaceHolder": "Sélectionnez une option",
|
25
26
|
"dismissSidePaneButtonLabel": "Fermer",
|
@@ -349,6 +350,7 @@
|
|
349
350
|
"chatButtonTooltipOpen": "Afficher la conversation",
|
350
351
|
"chatPaneTitle": "Clavardage",
|
351
352
|
"copyInviteLinkButtonLabel": "Copier le lien d'invitation",
|
353
|
+
"copyInviteLinkButtonActionedLabel": "Lien copié",
|
352
354
|
"copyInviteLinkActionedAriaLabel": "Le lien d’invitation a été copié.",
|
353
355
|
"dismissSidePaneButtonLabel": "Fermer",
|
354
356
|
"moreDrawerAudioDeviceMenuTitle": "Périphérique audio",
|
@@ -364,6 +366,8 @@
|
|
364
366
|
"selectedPeopleButtonLabel": "Bouton Contacts sélectionné",
|
365
367
|
"peopleButtonTooltipOpen": "Afficher les participants",
|
366
368
|
"peopleButtonTooltipClose": "Masquer les participants",
|
369
|
+
"peopleButtonTooltipOpenAriaLabel": "Bouton Contacts, Afficher les participants",
|
370
|
+
"peopleButtonTooltipCloseAriaLabel": "Bouton Contacts, Masquer les participants",
|
367
371
|
"peoplePaneSubTitle": "Pendant cet appel",
|
368
372
|
"peoplePaneTitle": "Personnes",
|
369
373
|
"pictureInPictureTileAriaLabel": "Flux vidéo. Cliquez pour revenir à l’écran d’appel.",
|