@azure/communication-react 1.16.0-alpha-202404160012 → 1.16.0-alpha-202404170013
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/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CmrzlNzS.js → ChatMessageComponentAsRichTextEditBox-DZWR3o3q.js} +3 -3
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CmrzlNzS.js.map → ChatMessageComponentAsRichTextEditBox-DZWR3o3q.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-CC43HCUd.js → index-pky6z3v4.js} +94 -60
- package/dist/dist-cjs/communication-react/index-pky6z3v4.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +2 -2
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.js +8 -4
- package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +14 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +5 -0
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +49 -13
- 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 +3 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +3 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js +1 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +5 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +17 -17
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +10 -21
- package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-CC43HCUd.js.map +0 -1
@@ -4,7 +4,7 @@ var react = require('@fluentui/react');
|
|
4
4
|
var reactChat = require('@fluentui-contrib/react-chat');
|
5
5
|
var reactComponents = require('@fluentui/react-components');
|
6
6
|
require('@azure/communication-common');
|
7
|
-
var index = require('./index-
|
7
|
+
var index = require('./index-pky6z3v4.js');
|
8
8
|
var React = require('react');
|
9
9
|
require('reselect');
|
10
10
|
require('@azure/communication-calling');
|
@@ -19,9 +19,9 @@ require('@fluentui/react-file-type-icons');
|
|
19
19
|
require('@griffel/react');
|
20
20
|
require('roosterjs-editor-plugins');
|
21
21
|
require('roosterjs-editor-core');
|
22
|
+
require('roosterjs-editor-types-compatible');
|
22
23
|
require('roosterjs-react');
|
23
24
|
require('roosterjs-editor-dom');
|
24
|
-
require('roosterjs-editor-types-compatible');
|
25
25
|
require('roosterjs-editor-api');
|
26
26
|
require('uuid');
|
27
27
|
require('html-react-parser');
|
@@ -126,4 +126,4 @@ const ChatMessageComponentAsRichTextEditBox = (props) => {
|
|
126
126
|
|
127
127
|
exports.ChatMessageComponentAsRichTextEditBox = ChatMessageComponentAsRichTextEditBox;
|
128
128
|
exports.default = ChatMessageComponentAsRichTextEditBox;
|
129
|
-
//# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-
|
129
|
+
//# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-DZWR3o3q.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChatMessageComponentAsRichTextEditBox-CmrzlNzS.js","sources":["../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.tsx"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { ChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useTheme } from '../../../theming';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { editBoxWidthStyles, richTextEditBoxActionButtonIcon } from '../../styles/EditBox.styles';\nimport { InputBoxButton } from '../../InputBoxButton';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { useChatMyMessageStyles } from '../../styles/MessageThread.styles';\nimport { ChatMessage } from '../../../types';\nimport { _AttachmentUploadCards } from '../../AttachmentUploadCards';\n/* @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadata } from '../../../types/Attachment';\nimport { useChatMessageRichTextEditContainerStyles } from '../../styles/ChatMessageComponent.styles';\nimport { MAXIMUM_LENGTH_OF_MESSAGE } from '../../utils/SendBoxUtils';\nimport {\n getMessageState,\n onRenderCancelIcon,\n onRenderSubmitIcon\n} from '../../utils/ChatMessageComponentAsEditBoxUtils';\n/* @conditional-compile-remove(attachment-upload) */\nimport { getMessageWithAttachmentMetadata } from '../../utils/ChatMessageComponentAsEditBoxUtils';\nimport { RichTextEditorComponentRef } from '../../RichTextEditor/RichTextEditor';\nimport { RichTextInputBoxComponent } from '../../RichTextEditor/RichTextInputBoxComponent';\nimport { editBoxRichTextEditorStyle, richTextActionButtonsStyle } from '../../styles/RichTextEditor.styles';\nimport { RichTextSendBoxErrors } from '../../RichTextEditor/RichTextSendBoxErrors';\nimport { useLocale } from '../../../localization';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FluentV9ThemeProvider } from '../../../theming/FluentV9ThemeProvider';\n/* @conditional-compile-remove(attachment-upload) */\nimport { attachmentUploadCardsStyles } from '../../styles/SendBox.styles';\n\n/** @private */\nexport type ChatMessageComponentAsRichTextEditBoxProps = {\n onCancel?: (messageId: string) => void;\n onSubmit: (\n text: string,\n metadata?: Record<string, string>,\n options?: {\n /* @conditional-compile-remove(attachment-upload) */\n attachmentMetadata?: AttachmentMetadata[];\n }\n ) => void;\n message: ChatMessage;\n strings: MessageThreadStrings;\n};\n\n/**\n * @private\n */\nexport const ChatMessageComponentAsRichTextEditBox = (\n props: ChatMessageComponentAsRichTextEditBoxProps\n): JSX.Element => {\n const { onCancel, onSubmit, strings, message } = props;\n\n const [textValue, setTextValue] = useState<string>(message.content || '');\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const [attachmentMetadata, setAttachmentMetadata] = useState(getMessageWithAttachmentMetadata(message));\n const editTextFieldRef = React.useRef<RichTextEditorComponentRef>(null);\n const theme = useTheme();\n const messageState = getMessageState(\n textValue,\n /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata ?? []\n );\n const submitEnabled = messageState === 'OK';\n\n const editContainerStyles = useChatMessageRichTextEditContainerStyles();\n const chatMyMessageStyles = useChatMyMessageStyles();\n const locale = useLocale().strings;\n\n const setText = (newValue?: string): void => {\n setTextValue(newValue ?? '');\n };\n\n const textTooLongMessage =\n messageState === 'too long'\n ? _formatString(strings.editBoxTextLimit, { limitNumber: `${MAXIMUM_LENGTH_OF_MESSAGE}` })\n : undefined;\n\n const iconClassName = useCallback(\n (isHover: boolean) => {\n const color = isHover ? theme.palette.accent : theme.palette.neutralSecondary;\n return mergeStyles(richTextEditBoxActionButtonIcon, { color });\n },\n [theme.palette.accent, theme.palette.neutralSecondary]\n );\n\n const onRenderThemedCancelIcon = useCallback(\n (isHover: boolean) => {\n return onRenderCancelIcon(iconClassName(isHover));\n },\n [iconClassName]\n );\n\n const onRenderThemedSubmitIcon = useCallback(\n (isHover: boolean) => {\n return onRenderSubmitIcon(iconClassName(isHover));\n },\n [iconClassName]\n );\n\n const actionButtons = useMemo(() => {\n return (\n <Stack horizontal>\n <InputBoxButton\n className={richTextActionButtonsStyle}\n ariaLabel={strings.editBoxCancelButton}\n tooltipContent={strings.editBoxCancelButton}\n onRenderIcon={onRenderThemedCancelIcon}\n onClick={() => {\n onCancel && onCancel(message.messageId);\n }}\n id={'dismissIconWrapper'}\n />\n <InputBoxButton\n className={richTextActionButtonsStyle}\n ariaLabel={strings.editBoxSubmitButton}\n tooltipContent={strings.editBoxSubmitButton}\n onRenderIcon={onRenderThemedSubmitIcon}\n onClick={(e) => {\n submitEnabled &&\n onSubmit(\n textValue,\n message.metadata,\n /* @conditional-compile-remove(attachment-upload) */ {\n attachmentMetadata\n }\n );\n e.stopPropagation();\n }}\n id={'submitIconWrapper'}\n />\n </Stack>\n );\n }, [\n /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata,\n message.messageId,\n message.metadata,\n onCancel,\n onRenderThemedCancelIcon,\n onRenderThemedSubmitIcon,\n onSubmit,\n strings.editBoxCancelButton,\n strings.editBoxSubmitButton,\n submitEnabled,\n textValue\n ]);\n const richTextLocaleStrings = useMemo(() => {\n /* @conditional-compile-remove(rich-text-editor) */\n return locale.richTextSendBox;\n return locale.sendBox;\n }, [/* @conditional-compile-remove(rich-text-editor) */ locale.richTextSendBox, locale.sendBox]);\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const onCancelAttachmentUpload = useCallback(\n (attachmentId: string) => {\n setAttachmentMetadata(attachmentMetadata?.filter((attachment) => attachment.id !== attachmentId));\n },\n [attachmentMetadata]\n );\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const onRenderAttachmentUploads = useCallback(() => {\n return (\n <Stack className={attachmentUploadCardsStyles}>\n <FluentV9ThemeProvider v8Theme={theme}>\n <_AttachmentUploadCards\n activeAttachmentUploads={attachmentMetadata}\n onCancelAttachmentUpload={onCancelAttachmentUpload}\n />\n </FluentV9ThemeProvider>\n </Stack>\n );\n }, [attachmentMetadata, onCancelAttachmentUpload, theme]);\n\n const getContent = (): JSX.Element => {\n return (\n <Stack className={mergeStyles(editBoxWidthStyles)}>\n <RichTextSendBoxErrors textTooLongMessage={textTooLongMessage} systemMessage={message.failureReason} />\n <RichTextInputBoxComponent\n placeholderText={strings.editBoxPlaceholderText}\n onChange={setText}\n editorComponentRef={editTextFieldRef}\n initialContent={message.content}\n content={textValue}\n strings={richTextLocaleStrings}\n disabled={false}\n actionComponents={actionButtons}\n richTextEditorStyleProps={editBoxRichTextEditorStyle}\n isHorizontalLayoutDisabled={true}\n /* @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentUploads={onRenderAttachmentUploads}\n />\n </Stack>\n );\n };\n\n const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n return (\n <ChatMyMessage\n attached={attached}\n root={{\n className: chatMyMessageStyles.root\n }}\n body={{\n className: mergeClasses(\n editContainerStyles.body,\n attached !== 'top' ? editContainerStyles.bodyAttached : undefined\n )\n }}\n >\n {getContent()}\n </ChatMyMessage>\n );\n};\n\nexport default ChatMessageComponentAsRichTextEditBox;\n"],"names":["useState","getMessageWithAttachmentMetadata","useTheme","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","useCallback","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","useMemo","Stack","InputBoxButton","richTextActionButtonsStyle","attachmentUploadCardsStyles","FluentV9ThemeProvider","_AttachmentUploadCards","editBoxWidthStyles","RichTextSend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Q,EAClB,IAAI,EAAE;YACJ,SAAS,EAAE,mBAAmB,CAAC,IAAI;AACpC,SAAA,EACD,IAAI,EAAE;YACJ,SAAS,EAAEC,4BAAY,CACrB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,GAAG,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAClE;AACF,SAAA,EAAA,EAEA,UAAU,EAAE,CACC,EAChB;AACJ;;;;;"}
|
1
|
+
{"version":3,"file":"ChatMessageComponentAsRichTextEditBox-DZWR3o3q.js","sources":["../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.tsx"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { ChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useTheme } from '../../../theming';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { editBoxWidthStyles, richTextEditBoxActionButtonIcon } from '../../styles/EditBox.styles';\nimport { InputBoxButton } from '../../InputBoxButton';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { useChatMyMessageStyles } from '../../styles/MessageThread.styles';\nimport { ChatMessage } from '../../../types';\nimport { _AttachmentUploadCards } from '../../AttachmentUploadCards';\n/* @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadata } from '../../../types/Attachment';\nimport { useChatMessageRichTextEditContainerStyles } from '../../styles/ChatMessageComponent.styles';\nimport { MAXIMUM_LENGTH_OF_MESSAGE } from '../../utils/SendBoxUtils';\nimport {\n getMessageState,\n onRenderCancelIcon,\n onRenderSubmitIcon\n} from '../../utils/ChatMessageComponentAsEditBoxUtils';\n/* @conditional-compile-remove(attachment-upload) */\nimport { getMessageWithAttachmentMetadata } from '../../utils/ChatMessageComponentAsEditBoxUtils';\nimport { RichTextEditorComponentRef } from '../../RichTextEditor/RichTextEditor';\nimport { RichTextInputBoxComponent } from '../../RichTextEditor/RichTextInputBoxComponent';\nimport { editBoxRichTextEditorStyle, richTextActionButtonsStyle } from '../../styles/RichTextEditor.styles';\nimport { RichTextSendBoxErrors } from '../../RichTextEditor/RichTextSendBoxErrors';\nimport { useLocale } from '../../../localization';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FluentV9ThemeProvider } from '../../../theming/FluentV9ThemeProvider';\n/* @conditional-compile-remove(attachment-upload) */\nimport { attachmentUploadCardsStyles } from '../../styles/SendBox.styles';\n\n/** @private */\nexport type ChatMessageComponentAsRichTextEditBoxProps = {\n onCancel?: (messageId: string) => void;\n onSubmit: (\n text: string,\n metadata?: Record<string, string>,\n options?: {\n /* @conditional-compile-remove(attachment-upload) */\n attachmentMetadata?: AttachmentMetadata[];\n }\n ) => void;\n message: ChatMessage;\n strings: MessageThreadStrings;\n};\n\n/**\n * @private\n */\nexport const ChatMessageComponentAsRichTextEditBox = (\n props: ChatMessageComponentAsRichTextEditBoxProps\n): JSX.Element => {\n const { onCancel, onSubmit, strings, message } = props;\n\n const [textValue, setTextValue] = useState<string>(message.content || '');\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const [attachmentMetadata, setAttachmentMetadata] = useState(getMessageWithAttachmentMetadata(message));\n const editTextFieldRef = React.useRef<RichTextEditorComponentRef>(null);\n const theme = useTheme();\n const messageState = getMessageState(\n textValue,\n /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata ?? []\n );\n const submitEnabled = messageState === 'OK';\n\n const editContainerStyles = useChatMessageRichTextEditContainerStyles();\n const chatMyMessageStyles = useChatMyMessageStyles();\n const locale = useLocale().strings;\n\n const setText = (newValue?: string): void => {\n setTextValue(newValue ?? '');\n };\n\n const textTooLongMessage =\n messageState === 'too long'\n ? _formatString(strings.editBoxTextLimit, { limitNumber: `${MAXIMUM_LENGTH_OF_MESSAGE}` })\n : undefined;\n\n const iconClassName = useCallback(\n (isHover: boolean) => {\n const color = isHover ? theme.palette.accent : theme.palette.neutralSecondary;\n return mergeStyles(richTextEditBoxActionButtonIcon, { color });\n },\n [theme.palette.accent, theme.palette.neutralSecondary]\n );\n\n const onRenderThemedCancelIcon = useCallback(\n (isHover: boolean) => {\n return onRenderCancelIcon(iconClassName(isHover));\n },\n [iconClassName]\n );\n\n const onRenderThemedSubmitIcon = useCallback(\n (isHover: boolean) => {\n return onRenderSubmitIcon(iconClassName(isHover));\n },\n [iconClassName]\n );\n\n const actionButtons = useMemo(() => {\n return (\n <Stack horizontal>\n <InputBoxButton\n className={richTextActionButtonsStyle}\n ariaLabel={strings.editBoxCancelButton}\n tooltipContent={strings.editBoxCancelButton}\n onRenderIcon={onRenderThemedCancelIcon}\n onClick={() => {\n onCancel && onCancel(message.messageId);\n }}\n id={'dismissIconWrapper'}\n />\n <InputBoxButton\n className={richTextActionButtonsStyle}\n ariaLabel={strings.editBoxSubmitButton}\n tooltipContent={strings.editBoxSubmitButton}\n onRenderIcon={onRenderThemedSubmitIcon}\n onClick={(e) => {\n submitEnabled &&\n onSubmit(\n textValue,\n message.metadata,\n /* @conditional-compile-remove(attachment-upload) */ {\n attachmentMetadata\n }\n );\n e.stopPropagation();\n }}\n id={'submitIconWrapper'}\n />\n </Stack>\n );\n }, [\n /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata,\n message.messageId,\n message.metadata,\n onCancel,\n onRenderThemedCancelIcon,\n onRenderThemedSubmitIcon,\n onSubmit,\n strings.editBoxCancelButton,\n strings.editBoxSubmitButton,\n submitEnabled,\n textValue\n ]);\n const richTextLocaleStrings = useMemo(() => {\n /* @conditional-compile-remove(rich-text-editor) */\n return locale.richTextSendBox;\n return locale.sendBox;\n }, [/* @conditional-compile-remove(rich-text-editor) */ locale.richTextSendBox, locale.sendBox]);\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const onCancelAttachmentUpload = useCallback(\n (attachmentId: string) => {\n setAttachmentMetadata(attachmentMetadata?.filter((attachment) => attachment.id !== attachmentId));\n },\n [attachmentMetadata]\n );\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const onRenderAttachmentUploads = useCallback(() => {\n return (\n <Stack className={attachmentUploadCardsStyles}>\n <FluentV9ThemeProvider v8Theme={theme}>\n <_AttachmentUploadCards\n activeAttachmentUploads={attachmentMetadata}\n onCancelAttachmentUpload={onCancelAttachmentUpload}\n />\n </FluentV9ThemeProvider>\n </Stack>\n );\n }, [attachmentMetadata, onCancelAttachmentUpload, theme]);\n\n const getContent = (): JSX.Element => {\n return (\n <Stack className={mergeStyles(editBoxWidthStyles)}>\n <RichTextSendBoxErrors textTooLongMessage={textTooLongMessage} systemMessage={message.failureReason} />\n <RichTextInputBoxComponent\n placeholderText={strings.editBoxPlaceholderText}\n onChange={setText}\n editorComponentRef={editTextFieldRef}\n initialContent={message.content}\n content={textValue}\n strings={richTextLocaleStrings}\n disabled={false}\n actionComponents={actionButtons}\n richTextEditorStyleProps={editBoxRichTextEditorStyle}\n isHorizontalLayoutDisabled={true}\n /* @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentUploads={onRenderAttachmentUploads}\n />\n </Stack>\n );\n };\n\n const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n return (\n <ChatMyMessage\n attached={attached}\n root={{\n className: chatMyMessageStyles.root\n }}\n body={{\n className: mergeClasses(\n editContainerStyles.body,\n attached !== 'top' ? editContainerStyles.bodyAttached : undefined\n )\n }}\n >\n {getContent()}\n </ChatMyMessage>\n );\n};\n\nexport default ChatMessageComponentAsRichTextEditBox;\n"],"names":["useState","getMessageWithAttachmentMetadata","useTheme","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","useCallback","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","useMemo","Stack","InputBoxButton","richTextActionButtonsStyle","attachmentUploadCardsStyles","FluentV9ThemeProvider","_AttachmentUploadCards","editBoxWidthStyles","RichTextSendBoxErrors","RichTextInputBoxComponent","editBoxRichTextEditorStyle","ChatMyMessage","mergeClasses"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAkDA;;AAEG;AACU,MAAA,qCAAqC,GAAG,CACnD,KAAiD,KAClC;IACf,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AAEvD,IAAA,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,cAAQ,CAAS,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;;AAE1E,IAAA,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAGA,cAAQ,CAACC,sCAAgC,CAAC,OAAO,CAAC,CAAC,CAAC;IACxG,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAA6B,IAAI,CAAC,CAAC;AACxE,IAAA,MAAM,KAAK,GAAGC,cAAQ,EAAE,CAAC;AACzB,IAAA,MAAM,YAAY,GAAGC,qBAAe,CAClC,SAAS;yDAC4C,kBAAkB,KAAlB,IAAA,IAAA,kBAAkB,cAAlB,kBAAkB,GAAI,EAAE,CAC9E,CAAC;AACF,IAAA,MAAM,aAAa,GAAG,YAAY,KAAK,IAAI,CAAC;AAE5C,IAAA,MAAM,mBAAmB,GAAGC,+CAAyC,EAAE,CAAC;AACxE,IAAA,MAAM,mBAAmB,GAAGC,4BAAsB,EAAE,CAAC;AACrD,IAAA,MAAM,MAAM,GAAGC,eAAS,EAAE,CAAC,OAAO,CAAC;AAEnC,IAAA,MAAM,OAAO,GAAG,CAAC,QAAiB,KAAU;QAC1C,YAAY,CAAC,QAAQ,KAAR,IAAA,IAAA,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAC,CAAC;AAC/B,KAAC,CAAC;AAEF,IAAA,MAAM,kBAAkB,GACtB,Y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AAK,CAAC;IACzG,QACE,oBAACC,uBAAa,EAAA,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE;YACJ,SAAS,EAAE,mBAAmB,CAAC,IAAI;AACpC,SAAA,EACD,IAAI,EAAE;YACJ,SAAS,EAAEC,4BAAY,CACrB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,GAAG,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAClE;AACF,SAAA,EAAA,EAEA,UAAU,EAAE,CACC,EAChB;AACJ;;;;;"}
|
@@ -17,9 +17,9 @@ var reactFileTypeIcons = require('@fluentui/react-file-type-icons');
|
|
17
17
|
var react$1 = require('@griffel/react');
|
18
18
|
var roosterjsEditorPlugins = require('roosterjs-editor-plugins');
|
19
19
|
var roosterjsEditorCore = require('roosterjs-editor-core');
|
20
|
+
var roosterjsEditorTypesCompatible = require('roosterjs-editor-types-compatible');
|
20
21
|
var roosterjsReact = require('roosterjs-react');
|
21
22
|
var roosterjsEditorDom = require('roosterjs-editor-dom');
|
22
|
-
var roosterjsEditorTypesCompatible = require('roosterjs-editor-types-compatible');
|
23
23
|
var roosterjsEditorApi = require('roosterjs-editor-api');
|
24
24
|
var reactChat = require('@fluentui-contrib/react-chat');
|
25
25
|
var uuid = require('uuid');
|
@@ -176,7 +176,7 @@ function getDefaultExportFromCjs (x) {
|
|
176
176
|
// Copyright (c) Microsoft Corporation.
|
177
177
|
// Licensed under the MIT License.
|
178
178
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
179
|
-
var telemetryVersion = '1.16.0-alpha-
|
179
|
+
var telemetryVersion = '1.16.0-alpha-202404170013';
|
180
180
|
|
181
181
|
|
182
182
|
var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
|
@@ -9915,14 +9915,14 @@ const ribbonTableButtonRootStyles = (theme, isSelected) => {
|
|
9915
9915
|
'.ribbon-table-button-regular-icon': {
|
9916
9916
|
width: '1.25rem',
|
9917
9917
|
height: '1.25rem',
|
9918
|
-
|
9918
|
+
margin: '-0.25rem 0.25rem 0 0.25rem',
|
9919
9919
|
color: theme.palette.neutralPrimary,
|
9920
9920
|
display: isSelected ? 'none' : 'inline-block'
|
9921
9921
|
},
|
9922
9922
|
'.ribbon-table-button-filled-icon': {
|
9923
9923
|
width: '1.25rem',
|
9924
9924
|
height: '1.25rem',
|
9925
|
-
|
9925
|
+
margin: '-0.25rem 0.25rem 0 0.25rem',
|
9926
9926
|
color: theme.palette.themePrimary,
|
9927
9927
|
display: isSelected ? 'inline-block' : 'none'
|
9928
9928
|
}
|
@@ -9933,22 +9933,11 @@ const ribbonTableButtonRootStyles = (theme, isSelected) => {
|
|
9933
9933
|
* @private
|
9934
9934
|
*/
|
9935
9935
|
const ribbonDividerStyle = (theme) => {
|
9936
|
-
return {
|
9937
|
-
|
9938
|
-
|
9939
|
-
|
9940
|
-
|
9941
|
-
selectors: {
|
9942
|
-
// Icon's color doesn't work here because of the specificity
|
9943
|
-
'.ms-Button-icon': {
|
9944
|
-
color: theme.palette.neutralQuaternaryAlt
|
9945
|
-
},
|
9946
|
-
'.ms-Button-menuIcon': {
|
9947
|
-
color: theme.palette.neutralQuaternaryAlt
|
9948
|
-
}
|
9949
|
-
}
|
9950
|
-
}
|
9951
|
-
};
|
9936
|
+
return react.mergeStyles({
|
9937
|
+
color: theme.palette.neutralQuaternaryAlt,
|
9938
|
+
margin: '0 -0.5rem',
|
9939
|
+
paddingTop: '0.5rem'
|
9940
|
+
});
|
9952
9941
|
};
|
9953
9942
|
/**
|
9954
9943
|
* @private
|
@@ -9971,7 +9960,7 @@ const richTextFormatButtonIconStyle = (theme, isSelected) => {
|
|
9971
9960
|
const editBoxRichTextEditorStyle = () => {
|
9972
9961
|
return {
|
9973
9962
|
minHeight: '2.25rem',
|
9974
|
-
maxHeight: '
|
9963
|
+
maxHeight: '8rem'
|
9975
9964
|
};
|
9976
9965
|
};
|
9977
9966
|
/**
|
@@ -9979,8 +9968,8 @@ const editBoxRichTextEditorStyle = () => {
|
|
9979
9968
|
*/
|
9980
9969
|
const sendBoxRichTextEditorStyle = (isExpanded) => {
|
9981
9970
|
return {
|
9982
|
-
minHeight: isExpanded ? '
|
9983
|
-
maxHeight: '
|
9971
|
+
minHeight: isExpanded ? '4rem' : '1.25rem',
|
9972
|
+
maxHeight: '8rem'
|
9984
9973
|
};
|
9985
9974
|
};
|
9986
9975
|
/**
|
@@ -10227,16 +10216,19 @@ const MaxColumnsNumber = 5;
|
|
10227
10216
|
const dividerRibbonButton = (theme, key) => {
|
10228
10217
|
return {
|
10229
10218
|
key: key,
|
10230
|
-
|
10219
|
+
// the icon will be set in `onRender` callback
|
10220
|
+
// this is needed to make the divider unavailable for keyboard navigation
|
10221
|
+
iconName: '',
|
10222
|
+
// no text is needed here as we don't want to show a tooltip for the divider
|
10231
10223
|
unlocalizedText: '',
|
10232
10224
|
onClick: () => { },
|
10233
10225
|
isDisabled: () => true,
|
10234
10226
|
commandBarProperties: {
|
10235
10227
|
// show the item correctly for the overflow menu
|
10236
10228
|
itemType: react.ContextualMenuItemType.Divider,
|
10237
|
-
buttonStyles: ribbonDividerStyle(theme),
|
10238
10229
|
// this is still needed to remove checkmark icon space even though it is a divider
|
10239
|
-
canCheck: false
|
10230
|
+
canCheck: false,
|
10231
|
+
onRender: () => React.createElement(react.Icon, { iconName: "RichTextDividerIcon", className: ribbonDividerStyle(theme) })
|
10240
10232
|
}
|
10241
10233
|
};
|
10242
10234
|
};
|
@@ -10456,6 +10448,10 @@ const RichTextEditor = React.forwardRef((props, ref) => {
|
|
10456
10448
|
if (editor.current) {
|
10457
10449
|
editor.current.setContent('');
|
10458
10450
|
}
|
10451
|
+
},
|
10452
|
+
getPlainContent() {
|
10453
|
+
var _a;
|
10454
|
+
return (_a = editor === null || editor === void 0 ? void 0 : editor.current) === null || _a === void 0 ? void 0 : _a.getContent(roosterjsEditorTypesCompatible.CompatibleGetContentMode.PlainTextFast);
|
10459
10455
|
}
|
10460
10456
|
};
|
10461
10457
|
}, []);
|
@@ -10751,7 +10747,7 @@ const RichTextSendBox = (props) => {
|
|
10751
10747
|
setContentValue(newValue);
|
10752
10748
|
}, []);
|
10753
10749
|
const sendMessageOnClick = React.useCallback(() => {
|
10754
|
-
var _a, _b;
|
10750
|
+
var _a, _b, _c;
|
10755
10751
|
if (disabled || contentValueOverflow) {
|
10756
10752
|
return;
|
10757
10753
|
}
|
@@ -10764,20 +10760,29 @@ const RichTextSendBox = (props) => {
|
|
10764
10760
|
return;
|
10765
10761
|
}
|
10766
10762
|
const message = contentValue;
|
10763
|
+
// get plain text content from the editor to check if the message is empty
|
10764
|
+
// as the content may contain tags even when the content is empty
|
10765
|
+
const plainTextContent = (_a = editorComponentRef.current) === null || _a === void 0 ? void 0 : _a.getPlainContent();
|
10766
|
+
const hasContent = !isContentEmpty({
|
10767
|
+
plainTextContent,
|
10768
|
+
content: message,
|
10769
|
+
placeholder: strings.placeholderText
|
10770
|
+
});
|
10767
10771
|
// we don't want to send empty messages including spaces, newlines, tabs
|
10768
10772
|
// Message can be empty if there is a valid attachment upload
|
10769
|
-
if (
|
10773
|
+
if (hasContent ||
|
10770
10774
|
/* @conditional-compile-remove(attachment-upload) */ hasCompletedAttachmentUploads(activeAttachmentUploads)) {
|
10771
10775
|
onSendMessage(message);
|
10772
10776
|
setContentValue('');
|
10773
|
-
(
|
10777
|
+
(_b = editorComponentRef.current) === null || _b === void 0 ? void 0 : _b.setEmptyContent();
|
10774
10778
|
}
|
10775
|
-
(
|
10779
|
+
(_c = editorComponentRef.current) === null || _c === void 0 ? void 0 : _c.focus();
|
10776
10780
|
}, [
|
10777
10781
|
contentValue,
|
10778
10782
|
contentValueOverflow,
|
10779
10783
|
disabled,
|
10780
10784
|
onSendMessage,
|
10785
|
+
strings.placeholderText,
|
10781
10786
|
/* @conditional-compile-remove(attachment-upload) */ activeAttachmentUploads,
|
10782
10787
|
/* @conditional-compile-remove(attachment-upload) */ strings.attachmentUploadsPendingError
|
10783
10788
|
]);
|
@@ -10797,15 +10802,26 @@ const RichTextSendBox = (props) => {
|
|
10797
10802
|
attachmentUploadsPendingError,
|
10798
10803
|
systemMessage
|
10799
10804
|
]);
|
10800
|
-
const onRenderSendIcon = React.useCallback((isHover) =>
|
10801
|
-
|
10802
|
-
|
10803
|
-
|
10804
|
-
|
10805
|
-
|
10806
|
-
|
10807
|
-
|
10808
|
-
|
10805
|
+
const onRenderSendIcon = React.useCallback((isHover) => {
|
10806
|
+
var _a;
|
10807
|
+
// get plain text content from the editor to check if the message is empty
|
10808
|
+
// as the content may contain tags even when the content is empty
|
10809
|
+
const plainTextContent = (_a = editorComponentRef.current) === null || _a === void 0 ? void 0 : _a.getPlainContent();
|
10810
|
+
const hasContent = !isContentEmpty({
|
10811
|
+
plainTextContent: plainTextContent,
|
10812
|
+
content: contentValue,
|
10813
|
+
placeholder: strings.placeholderText
|
10814
|
+
});
|
10815
|
+
return (React.createElement(react.Icon, { iconName: isHover && hasContent ? 'SendBoxSendHovered' : 'SendBoxSend', className: sendIconStyle({
|
10816
|
+
theme,
|
10817
|
+
hasText: hasContent,
|
10818
|
+
/* @conditional-compile-remove(attachment-upload) */
|
10819
|
+
hasAttachment: false,
|
10820
|
+
hasErrorMessage: hasErrorMessage,
|
10821
|
+
defaultTextColor: theme.palette.neutralSecondary,
|
10822
|
+
disabled: disabled
|
10823
|
+
}) }));
|
10824
|
+
}, [contentValue, disabled, hasErrorMessage, strings.placeholderText, theme]);
|
10809
10825
|
const sendBoxErrorsProps = React.useMemo(() => {
|
10810
10826
|
var _a;
|
10811
10827
|
return {
|
@@ -10867,6 +10883,22 @@ const RichTextSendBox = (props) => {
|
|
10867
10883
|
/* @conditional-compile-remove(attachment-upload) */
|
10868
10884
|
hasAttachments: hasAttachmentUploads })));
|
10869
10885
|
};
|
10886
|
+
/**
|
10887
|
+
* Checks if the content of the rich text editor is empty.
|
10888
|
+
*
|
10889
|
+
* @param {Object} params - The parameters for the function.
|
10890
|
+
* @param {string | undefined} params.plainTextContent - The plain text content of the editor.
|
10891
|
+
* @param {string} params.content - The HTML content of the editor.
|
10892
|
+
* @param {string} params.placeholder - The placeholder text of the editor.
|
10893
|
+
* @returns {boolean} - True if the content is empty, false otherwise.
|
10894
|
+
*/
|
10895
|
+
const isContentEmpty = ({ plainTextContent, content, placeholder }) => {
|
10896
|
+
// RoosterJS returns placeholder text as plain text when the editor is empty and in this case,
|
10897
|
+
// plainTextContent contains only placeholder text but content doesn't include the placeholder text
|
10898
|
+
// this needs to be reviewed after migration to the content model packages.
|
10899
|
+
const plainTextContainsPlaceholderOnly = plainTextContent === placeholder && !content.includes(placeholder);
|
10900
|
+
return plainTextContainsPlaceholderOnly || sanitizeText(plainTextContent !== null && plainTextContent !== void 0 ? plainTextContent : '').length === 0;
|
10901
|
+
};
|
10870
10902
|
|
10871
10903
|
// Copyright (c) Microsoft Corporation.
|
10872
10904
|
// Licensed under the MIT License.
|
@@ -12690,7 +12722,7 @@ class ErrorBoundary extends React.Component {
|
|
12690
12722
|
// Copyright (c) Microsoft Corporation.
|
12691
12723
|
// Licensed under the MIT License.
|
12692
12724
|
/* @conditional-compile-remove(rich-text-editor) */
|
12693
|
-
const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-
|
12725
|
+
const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-DZWR3o3q.js'); }));
|
12694
12726
|
/**
|
12695
12727
|
* @private
|
12696
12728
|
* Use this function to load RoosterJS dependencies early in the lifecycle.
|
@@ -12698,7 +12730,7 @@ const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve()
|
|
12698
12730
|
*
|
12699
12731
|
* @conditional-compile-remove(rich-text-editor)
|
12700
12732
|
*/
|
12701
|
-
const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-
|
12733
|
+
const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-DZWR3o3q.js'); });
|
12702
12734
|
/**
|
12703
12735
|
* @private
|
12704
12736
|
*/
|
@@ -15582,12 +15614,12 @@ const participantsById = (participants) => {
|
|
15582
15614
|
// Licensed under the MIT License.
|
15583
15615
|
const DEFAULT_MAX_OVERFLOW_GALLERY_DOMINANT_SPEAKERS = 6;
|
15584
15616
|
const DEFAULT_MAX_VIDEO_SREAMS = 4;
|
15617
|
+
/**
|
15618
|
+
* @private
|
15619
|
+
*/
|
15585
15620
|
const MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY = 9;
|
15586
15621
|
const getOrganizedParticipants = (props) => {
|
15587
|
-
const { remoteParticipants = [], dominantSpeakers = [],
|
15588
|
-
const maxRemoteVideoStreamsToUse = maxRemoteVideoStreams > MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY
|
15589
|
-
? MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY
|
15590
|
-
: maxRemoteVideoStreams;
|
15622
|
+
const { remoteParticipants = [], dominantSpeakers = [], maxGridParticipants = DEFAULT_MAX_VIDEO_SREAMS, maxOverflowGalleryDominantSpeakers = DEFAULT_MAX_OVERFLOW_GALLERY_DOMINANT_SPEAKERS, isScreenShareActive = false, layout, previousGridParticipants = [], previousOverflowParticipants = [] } = props;
|
15591
15623
|
const remoteParticipantsOrdered = putVideoParticipantsFirst(remoteParticipants);
|
15592
15624
|
const videoParticipants = remoteParticipants.filter((p) => { var _a; return (_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
|
15593
15625
|
const participants = layout === 'floatingLocalVideo' && videoParticipants.length > 0 ? videoParticipants : remoteParticipantsOrdered;
|
@@ -15595,8 +15627,8 @@ const getOrganizedParticipants = (props) => {
|
|
15595
15627
|
participants: participants,
|
15596
15628
|
dominantSpeakers,
|
15597
15629
|
currentParticipants: previousGridParticipants,
|
15598
|
-
maxDominantSpeakers:
|
15599
|
-
}).slice(0,
|
15630
|
+
maxDominantSpeakers: maxGridParticipants
|
15631
|
+
}).slice(0, maxGridParticipants);
|
15600
15632
|
const dominantSpeakerToGrid = layout === 'speaker'
|
15601
15633
|
? dominantSpeakers && dominantSpeakers[0]
|
15602
15634
|
? newGridParticipants.filter((p) => p.userId === dominantSpeakers[0])
|
@@ -15621,14 +15653,14 @@ const getOrganizedParticipants = (props) => {
|
|
15621
15653
|
isScreenShareActive,
|
15622
15654
|
gridParticipants: newGridParticipants,
|
15623
15655
|
overflowGalleryParticipants: newOverflowGalleryParticipants,
|
15624
|
-
|
15656
|
+
maxGridParticipants: maxGridParticipants,
|
15625
15657
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants
|
15626
15658
|
});
|
15627
15659
|
const overflowGalleryParticipants = getOverflowGalleryRemoteParticipants({
|
15628
15660
|
isScreenShareActive,
|
15629
15661
|
gridParticipants: newGridParticipants,
|
15630
15662
|
overflowGalleryParticipants: newOverflowGalleryParticipants,
|
15631
|
-
|
15663
|
+
maxGridParticipants: maxGridParticipants,
|
15632
15664
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants
|
15633
15665
|
});
|
15634
15666
|
return { gridParticipants, overflowGalleryParticipants };
|
@@ -15656,7 +15688,7 @@ const useOrganizedParticipants = (props) => {
|
|
15656
15688
|
const unfocusedParticipants = props.remoteParticipants.filter((p) => !focusedParticipantUserIdSet.has(p.userId));
|
15657
15689
|
const useOrganizedParticipantsProps = Object.assign(Object.assign({}, props), {
|
15658
15690
|
// if there are focused participants then leave no room in the grid by setting maxGridParticipants to 0
|
15659
|
-
|
15691
|
+
maxGridParticipants: focusedParticipants.length > 0 || props.isScreenShareActive ? 0 : props.maxGridParticipants, remoteParticipants: unfocusedParticipants, previousGridParticipants: currentGridParticipants.current, previousOverflowParticipants: currentOverflowGalleryParticipants.current });
|
15660
15692
|
const useOrganizedParticipantsResult = getOrganizedParticipants(useOrganizedParticipantsProps);
|
15661
15693
|
currentGridParticipants.current = useOrganizedParticipantsResult.gridParticipants;
|
15662
15694
|
currentOverflowGalleryParticipants.current = useOrganizedParticipantsResult.overflowGalleryParticipants;
|
@@ -15679,9 +15711,9 @@ const getGridParticipants = (args) => {
|
|
15679
15711
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
15680
15712
|
return args.gridParticipants.length > 0
|
15681
15713
|
? args.gridParticipants
|
15682
|
-
: args.overflowGalleryParticipants.length > args.
|
15683
|
-
? args.overflowGalleryParticipants.slice(0, args.
|
15684
|
-
: args.overflowGalleryParticipants.slice(0, args.
|
15714
|
+
: args.overflowGalleryParticipants.length > args.maxGridParticipants
|
15715
|
+
? args.overflowGalleryParticipants.slice(0, args.maxGridParticipants)
|
15716
|
+
: args.overflowGalleryParticipants.slice(0, args.maxGridParticipants).concat(args.callingParticipants);
|
15685
15717
|
};
|
15686
15718
|
const getOverflowGalleryRemoteParticipants = (args) => {
|
15687
15719
|
if (args.isScreenShareActive) {
|
@@ -15697,8 +15729,8 @@ const getOverflowGalleryRemoteParticipants = (args) => {
|
|
15697
15729
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
15698
15730
|
return args.gridParticipants.length > 0
|
15699
15731
|
? args.overflowGalleryParticipants.concat(args.callingParticipants)
|
15700
|
-
: args.overflowGalleryParticipants.length > args.
|
15701
|
-
? args.overflowGalleryParticipants.slice(args.
|
15732
|
+
: args.overflowGalleryParticipants.length > args.maxGridParticipants
|
15733
|
+
? args.overflowGalleryParticipants.slice(args.maxGridParticipants).concat(args.callingParticipants)
|
15702
15734
|
: [];
|
15703
15735
|
}
|
15704
15736
|
};
|
@@ -17538,11 +17570,12 @@ const DefaultLayout = (props) => {
|
|
17538
17570
|
// This number will be used for the maxOverflowGalleryDominantSpeakers when organizing the remote participants.
|
17539
17571
|
// We need to add the local participant to the pinned participant count so we are placing the speakers correctly.
|
17540
17572
|
const childrenPerPage = React.useRef(4);
|
17573
|
+
const remoteVideosOn = remoteParticipants.filter((p) => { var _a; return (_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable; }).length > 0;
|
17541
17574
|
const { gridParticipants, overflowGalleryParticipants } = useOrganizedParticipants({
|
17542
17575
|
remoteParticipants,
|
17543
17576
|
localParticipant,
|
17544
17577
|
dominantSpeakers,
|
17545
|
-
maxRemoteVideoStreams,
|
17578
|
+
maxGridParticipants: remoteVideosOn ? maxRemoteVideoStreams : MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY,
|
17546
17579
|
isScreenShareActive: !!screenShareComponent,
|
17547
17580
|
maxOverflowGalleryDominantSpeakers: screenShareComponent
|
17548
17581
|
? childrenPerPage.current - ((pinnedParticipantUserIds.length + 1) % childrenPerPage.current)
|
@@ -18370,10 +18403,11 @@ const FloatingLocalVideoLayout = (props) => {
|
|
18370
18403
|
// This is for tracking the number of children in the first page of overflow gallery.
|
18371
18404
|
// This number will be used for the maxOverflowGalleryDominantSpeakers when organizing the remote participants.
|
18372
18405
|
const childrenPerPage = React.useRef(4);
|
18406
|
+
const remoteVideosOn = remoteParticipants.filter((p) => { var _a; return (_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable; }).length > 0;
|
18373
18407
|
const { gridParticipants, overflowGalleryParticipants } = useOrganizedParticipants({
|
18374
18408
|
remoteParticipants,
|
18375
18409
|
dominantSpeakers,
|
18376
|
-
maxRemoteVideoStreams,
|
18410
|
+
maxGridParticipants: remoteVideosOn ? maxRemoteVideoStreams : MAX_GRID_PARTICIPANTS_NOT_LARGE_GALLERY,
|
18377
18411
|
isScreenShareActive: !!screenShareComponent,
|
18378
18412
|
maxOverflowGalleryDominantSpeakers: screenShareComponent
|
18379
18413
|
? childrenPerPage.current - (pinnedParticipantUserIds.length % childrenPerPage.current)
|
@@ -18489,7 +18523,7 @@ const SpeakerVideoLayout = (props) => {
|
|
18489
18523
|
const { gridParticipants, overflowGalleryParticipants } = useOrganizedParticipants({
|
18490
18524
|
remoteParticipants,
|
18491
18525
|
dominantSpeakers,
|
18492
|
-
maxRemoteVideoStreams,
|
18526
|
+
maxGridParticipants: maxRemoteVideoStreams,
|
18493
18527
|
isScreenShareActive: !!screenShareComponent,
|
18494
18528
|
maxOverflowGalleryDominantSpeakers: screenShareComponent
|
18495
18529
|
? childrenPerPage.current - (pinnedParticipantUserIds.length % childrenPerPage.current)
|
@@ -18624,7 +18658,7 @@ const LargeGalleryLayout = (props) => {
|
|
18624
18658
|
remoteParticipants,
|
18625
18659
|
localParticipant,
|
18626
18660
|
dominantSpeakers,
|
18627
|
-
|
18661
|
+
maxGridParticipants: maxStreamsTrampoline(),
|
18628
18662
|
isScreenShareActive: !!screenShareComponent,
|
18629
18663
|
maxOverflowGalleryDominantSpeakers: screenShareComponent
|
18630
18664
|
? childrenPerPage.current - ((pinnedParticipantUserIds.length + 1) % childrenPerPage.current)
|
@@ -39675,4 +39709,4 @@ exports.useTeamsCall = useTeamsCall;
|
|
39675
39709
|
exports.useTeamsCallAdapter = useTeamsCallAdapter;
|
39676
39710
|
exports.useTeamsCallAgent = useTeamsCallAgent;
|
39677
39711
|
exports.useTheme = useTheme;
|
39678
|
-
//# sourceMappingURL=index-
|
39712
|
+
//# sourceMappingURL=index-pky6z3v4.js.map
|