@azure/communication-react 1.16.0-alpha-202404200012 → 1.16.0-alpha-202404240013

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.
Files changed (31) hide show
  1. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DpYUiI1l.js → ChatMessageComponentAsRichTextEditBox-BBE_BEmy.js} +2 -2
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DpYUiI1l.js.map → ChatMessageComponentAsRichTextEditBox-BBE_BEmy.js.map} +1 -1
  3. package/dist/dist-cjs/communication-react/{index-C2GfkUGz.js → index-DKwz_uvr.js} +90 -35
  4. package/dist/dist-cjs/communication-react/index-DKwz_uvr.js.map +1 -0
  5. package/dist/dist-cjs/communication-react/index.js +1 -1
  6. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  7. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +6 -6
  9. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  10. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.js +8 -0
  11. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.js.map +1 -1
  12. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +2 -1
  13. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +3 -1
  15. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  16. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +7 -3
  17. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  18. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +13 -2
  19. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  20. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +1 -0
  21. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +3 -2
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  23. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +22 -2
  24. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +4 -0
  26. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +1 -0
  28. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +4 -2
  29. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/dist-cjs/communication-react/index-C2GfkUGz.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-C2GfkUGz.js');
7
+ var index = require('./index-DKwz_uvr.js');
8
8
  var React = require('react');
9
9
  require('reselect');
10
10
  require('@azure/communication-calling');
@@ -126,4 +126,4 @@ const ChatMessageComponentAsRichTextEditBox = (props) => {
126
126
 
127
127
  exports.ChatMessageComponentAsRichTextEditBox = ChatMessageComponentAsRichTextEditBox;
128
128
  exports.default = ChatMessageComponentAsRichTextEditBox;
129
- //# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-DpYUiI1l.js.map
129
+ //# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-BBE_BEmy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMessageComponentAsRichTextEditBox-DpYUiI1l.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 attachmentsWithProgress={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,K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mB,CAAC,YAAY,GAAG,SAAS,CAClE;AACF,SAAA,EAAA,EAEA,UAAU,EAAE,CACC,EAChB;AACJ;;;;;"}
1
+ {"version":3,"file":"ChatMessageComponentAsRichTextEditBox-BBE_BEmy.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 attachmentsWithProgress={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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rB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,GAAG,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAClE;AACF,SAAA,EAAA,EAEA,UAAU,EAAE,CACC,EAChB;AACJ;;;;;"}
@@ -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-202404200012';
179
+ var telemetryVersion = '1.16.0-alpha-202404240013';
180
180
 
181
181
 
182
182
  var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
@@ -9986,7 +9986,9 @@ const insertTableMenuCellButtonStyles = (theme) => {
9986
9986
  border: `solid 0.0625rem ${theme.palette.neutralTertiaryAlt}`,
9987
9987
  display: 'inline-block',
9988
9988
  cursor: 'pointer',
9989
- background: 'transparent'
9989
+ background: 'transparent',
9990
+ // include border into width value as the parent element has fixed width
9991
+ boxSizing: 'border-box'
9990
9992
  };
9991
9993
  };
9992
9994
  /**
@@ -10011,9 +10013,11 @@ const insertTableMenuTablePane = react.mergeStyles({
10011
10013
  const insertTableMenuFocusZone = (theme) => {
10012
10014
  return react.mergeStyles({
10013
10015
  lineHeight: '12px',
10014
- width: '5.125rem',
10016
+ // fixed width is required to show columns in a grid correctly
10017
+ width: '5rem',
10015
10018
  border: `solid 0.0625rem ${theme.palette.neutralTertiaryAlt}`,
10016
- boxSizing: 'border-box'
10019
+ // don't include border into width value as otherwise it may be broken when zoom value is changed
10020
+ boxSizing: 'content-box'
10017
10021
  });
10018
10022
  };
10019
10023
  /**
@@ -10061,6 +10065,14 @@ const insertTable = (editor, columns, rows) => {
10061
10065
  const vTable = new roosterjsEditorDom.VTable(table);
10062
10066
  vTable.writeBack();
10063
10067
  editor.insertNode(table);
10068
+ const nextElementAfterTable = table.nextElementSibling;
10069
+ // insert br only if there is no next element after the table
10070
+ if (nextElementAfterTable === null) {
10071
+ // insert br after the table
10072
+ // so users can easily input content after table
10073
+ editor.select(new roosterjsEditorDom.Position(table, roosterjsEditorTypesCompatible.CompatiblePositionType.After));
10074
+ editor.insertNode(document.createElement('br'));
10075
+ }
10064
10076
  editor.runAsync((editor) => editor.select(new roosterjsEditorDom.Position(table, roosterjsEditorTypesCompatible.CompatiblePositionType.Begin).normalize()));
10065
10077
  }, roosterjsEditorTypesCompatible.CompatibleChangeSource.Format, undefined /* canUndoByBackspace */, {
10066
10078
  formatApiName: 'insertTable'
@@ -10587,7 +10599,8 @@ const focusAndUpdateContent = (editor, content) => {
10587
10599
  editor.setContent(content);
10588
10600
  // this is a recommended way (by RoosterJS team) to set focus at the end of the text
10589
10601
  // RoosterJS v9 has this issue fixed and this code can be removed
10590
- editor.insertContent('<span id="focus-position-span"></span>', { position: roosterjsEditorTypesCompatible.CompatibleContentPosition.DomEnd });
10602
+ // CompatibleContentPosition.DomEnd shouldn't be used here as it set focus after the editor div
10603
+ editor.insertContent('<span id="focus-position-span"></span>', { position: roosterjsEditorTypesCompatible.CompatibleContentPosition.End });
10591
10604
  const elements = editor.queryElements('#focus-position-span');
10592
10605
  if (elements.length > 0) {
10593
10606
  const placeholder = editor.queryElements('#focus-position-span')[0];
@@ -11080,7 +11093,9 @@ const noMessageStatusStyle = react.mergeStyles({
11080
11093
  * @private
11081
11094
  */
11082
11095
  const useChatStyles = reactComponents.makeStyles({
11083
- root: Object.assign(Object.assign(Object.assign({ paddingTop: '0.8rem', paddingBottom: '0.5rem', paddingRight: '0.6rem', paddingLeft: '0.6rem' }, reactComponents.shorthands.border('none')), reactComponents.shorthands.overflow('auto')), {
11096
+ root: Object.assign(Object.assign(Object.assign({
11097
+ // chat components sets max width value to 1056px, override it to 100%
11098
+ maxWidth: '100%', paddingTop: '0.8rem', paddingBottom: '0.5rem', paddingRight: '0.6rem', paddingLeft: '0.6rem' }, reactComponents.shorthands.border('none')), reactComponents.shorthands.overflow('auto')), {
11084
11099
  // `height: 100%` ensures that the Chat component covers 100% of it's parents height
11085
11100
  // to prevent intermittent scrollbars when GIFs are present in the chat.
11086
11101
  height: '100%', '& a:link': {
@@ -12168,13 +12183,13 @@ const extractContentForAllyMessage = (props) => {
12168
12183
  imageTextNode.innerHTML = 'image ';
12169
12184
  parsedContent.replaceChild(imageTextNode, child);
12170
12185
  });
12171
- // Inject attachment names for aria.
12172
- if (attachments) {
12173
- let attachmentList = '';
12174
- /* @conditional-compile-remove(attachment-download) */
12175
- attachmentList = attachmentCardGroupDescription(props);
12186
+ // Inject message attachment count for aria.
12187
+ // this is only applying to file attachments not for inline images.
12188
+ /* @conditional-compile-remove(attachment-download) */
12189
+ if (attachments && attachments.length > 0) {
12190
+ const attachmentCardDescription = attachmentCardGroupDescription(props);
12176
12191
  const attachmentTextNode = document.createElement('div');
12177
- attachmentTextNode.innerHTML = ` ${attachmentList} `;
12192
+ attachmentTextNode.innerHTML = `${attachmentCardDescription}`;
12178
12193
  parsedContent.appendChild(attachmentTextNode);
12179
12194
  }
12180
12195
  // Strip all html tags from the content for aria.
@@ -12785,7 +12800,7 @@ class ErrorBoundary extends React.Component {
12785
12800
  // Copyright (c) Microsoft Corporation.
12786
12801
  // Licensed under the MIT License.
12787
12802
  /* @conditional-compile-remove(rich-text-editor) */
12788
- const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-DpYUiI1l.js'); }));
12803
+ const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-BBE_BEmy.js'); }));
12789
12804
  /**
12790
12805
  * @private
12791
12806
  * Use this function to load RoosterJS dependencies early in the lifecycle.
@@ -12793,7 +12808,7 @@ const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve()
12793
12808
  *
12794
12809
  * @conditional-compile-remove(rich-text-editor)
12795
12810
  */
12796
- const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-DpYUiI1l.js'); });
12811
+ const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-BBE_BEmy.js'); });
12797
12812
  /**
12798
12813
  * @private
12799
12814
  */
@@ -25798,6 +25813,23 @@ const convertObservableAttachmentUploadToAttachmentUploadsUiState = (attachmentU
25798
25813
  }, {});
25799
25814
  };
25800
25815
 
25816
+ // Copyright (c) Microsoft Corporation.
25817
+ // Licensed under the MIT License.
25818
+ /**
25819
+ * @private
25820
+ */
25821
+ const UNSUPPORTED_CHAT_THREAD_TYPE = ['@thread.tacv2', '@thread.skype'];
25822
+ /**
25823
+ * @private
25824
+ */
25825
+ const TEAMS_LIMITATION_LEARN_MORE = 'https://learn.microsoft.com/en-us/azure/communication-services/concepts/join-teams-meeting#limitations-and-known-issues';
25826
+ /**
25827
+ * @remarks
25828
+ * This value is publicly documented in the ChatComposite API documentation.
25829
+ * Changing this value will require updating the API documentation.
25830
+ */
25831
+ const CHAT_CONTAINER_MIN_WIDTH_REM = 17.5;
25832
+
25801
25833
  // Copyright (c) Microsoft Corporation.
25802
25834
  // Licensed under the MIT License.
25803
25835
  var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -26257,6 +26289,9 @@ const _createLazyAzureCommunicationChatAdapterInner = (endpoint_2, userId_2, dis
26257
26289
  credential
26258
26290
  }, undefined, telemetryImplementationHint);
26259
26291
  return threadId.then((threadId) => __awaiter$o(void 0, void 0, void 0, function* () {
26292
+ if (UNSUPPORTED_CHAT_THREAD_TYPE.some((t) => threadId.includes(t))) {
26293
+ console.error(`Invalid Chat ThreadId: ${threadId}. Please note with Teams Channel Meetings, only Calling is supported and Chat is not currently supported. Read more: ${TEAMS_LIMITATION_LEARN_MORE}.`);
26294
+ }
26260
26295
  const chatThreadClient = yield chatClient.getChatThreadClient(threadId);
26261
26296
  yield chatClient.startRealtimeNotifications();
26262
26297
  const adapter = yield createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);
@@ -26480,18 +26515,6 @@ const useAdapter$1 = () => {
26480
26515
  return adapter;
26481
26516
  };
26482
26517
 
26483
- // Copyright (c) Microsoft Corporation.
26484
- // Licensed under the MIT License.
26485
- /**
26486
- * @private
26487
- */
26488
- /**
26489
- * @remarks
26490
- * This value is publicly documented in the ChatComposite API documentation.
26491
- * Changing this value will require updating the API documentation.
26492
- */
26493
- const CHAT_CONTAINER_MIN_WIDTH_REM = 17.5;
26494
-
26495
26518
  // Copyright (c) Microsoft Corporation.
26496
26519
  // Licensed under the MIT License.
26497
26520
  const CHAT_CONTAINER_MAX_WIDTH_REM = 41.25;
@@ -31463,7 +31486,7 @@ var __awaiter$f = (window && window.__awaiter) || function (thisArg, _arguments,
31463
31486
  * @private
31464
31487
  */
31465
31488
  const PeoplePaneContent = (props) => {
31466
- const { inviteLink, onFetchParticipantMenuItems, setDrawerMenuItems,
31489
+ const { inviteLink, onFetchParticipantMenuItems, setDrawerMenuItems, setParticipantActioned,
31467
31490
  /* @conditional-compile-remove(spotlight) */ participantListHeadingMoreButtonProps } = props;
31468
31491
  const adapter = useAdapter();
31469
31492
  const localeStrings = useLocale();
@@ -31487,6 +31510,7 @@ const PeoplePaneContent = (props) => {
31487
31510
  const setDrawerMenuItemsForParticipant = React.useMemo(() => {
31488
31511
  return (participant) => {
31489
31512
  if (participant) {
31513
+ setParticipantActioned === null || setParticipantActioned === void 0 ? void 0 : setParticipantActioned(participant.userId);
31490
31514
  let contextualMenuItems = createDefaultContextualMenuItems(participant, strings, removeButtonAllowed && participant.isRemovable ? participantListDefaultProps.onRemoveParticipant : undefined, participantListDefaultProps.myUserId);
31491
31515
  if (onFetchParticipantMenuItems) {
31492
31516
  contextualMenuItems = onFetchParticipantMenuItems(participant.userId, participantListDefaultProps.myUserId, contextualMenuItems);
@@ -31501,7 +31525,8 @@ const PeoplePaneContent = (props) => {
31501
31525
  participantListDefaultProps.myUserId,
31502
31526
  removeButtonAllowed,
31503
31527
  onFetchParticipantMenuItems,
31504
- setDrawerMenuItems
31528
+ setDrawerMenuItems,
31529
+ setParticipantActioned
31505
31530
  ]);
31506
31531
  /* @conditional-compile-remove(spotlight) */
31507
31532
  const setDrawerMenuItemsForParticipantListHeadingMoreButton = React.useMemo(() => {
@@ -31581,7 +31606,7 @@ const canRemoveParticipants = (adapter) => {
31581
31606
  const PEOPLE_SIDE_PANE_ID = 'people';
31582
31607
  /** @private */
31583
31608
  const usePeoplePane = (props) => {
31584
- const { updateSidePaneRenderer, inviteLink, onFetchAvatarPersonaData, onFetchParticipantMenuItems, setDrawerMenuItems, mobileView, peopleButtonRef,
31609
+ const { updateSidePaneRenderer, inviteLink, onFetchAvatarPersonaData, onFetchParticipantMenuItems, setDrawerMenuItems, mobileView, peopleButtonRef, setParticipantActioned,
31585
31610
  /* @conditional-compile-remove(spotlight) */
31586
31611
  spotlightedParticipantUserIds,
31587
31612
  /* @conditional-compile-remove(spotlight) */
@@ -31702,7 +31727,7 @@ const usePeoplePane = (props) => {
31702
31727
  /* @conditional-compile-remove(spotlight) */
31703
31728
  _onFetchParticipantMenuItems = onFetchParticipantMenuItemsForCallComposite;
31704
31729
  const onRenderContent = React.useCallback(() => {
31705
- return (React.createElement(PeoplePaneContent, { inviteLink: inviteLink, onFetchAvatarPersonaData: onFetchAvatarPersonaData, onFetchParticipantMenuItems: _onFetchParticipantMenuItems, setDrawerMenuItems: setDrawerMenuItems, mobileView: mobileView,
31730
+ return (React.createElement(PeoplePaneContent, { inviteLink: inviteLink, onFetchAvatarPersonaData: onFetchAvatarPersonaData, onFetchParticipantMenuItems: _onFetchParticipantMenuItems, setDrawerMenuItems: setDrawerMenuItems, mobileView: mobileView, setParticipantActioned: setParticipantActioned,
31706
31731
  /* @conditional-compile-remove(spotlight) */
31707
31732
  participantListHeadingMoreButtonProps: sidePaneHeaderMenuProps }));
31708
31733
  }, [
@@ -31711,6 +31736,7 @@ const usePeoplePane = (props) => {
31711
31736
  onFetchAvatarPersonaData,
31712
31737
  _onFetchParticipantMenuItems,
31713
31738
  setDrawerMenuItems,
31739
+ setParticipantActioned,
31714
31740
  /* @conditional-compile-remove(spotlight) */ sidePaneHeaderMenuProps
31715
31741
  ]);
31716
31742
  const sidePaneRenderer = React.useMemo(() => ({
@@ -32472,7 +32498,15 @@ const CallArrangement = (props) => {
32472
32498
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
32473
32499
  const isInLocalHold = useSelector$1(getPage) === 'hold';
32474
32500
  const adapter = useAdapter();
32501
+ const [participantActioned, setParticipantActioned] = React.useState();
32502
+ const remoteParticipants = useSelector$1(getRemoteParticipants);
32475
32503
  const [drawerMenuItems, setDrawerMenuItems] = React.useState([]);
32504
+ React.useEffect(() => {
32505
+ const participantIsActionedButIsNotPresent = participantActioned && (remoteParticipants === null || remoteParticipants === void 0 ? void 0 : remoteParticipants[participantActioned]) === undefined;
32506
+ if (participantIsActionedButIsNotPresent) {
32507
+ setDrawerMenuItems([]);
32508
+ }
32509
+ }, [participantActioned, remoteParticipants]);
32476
32510
  const peoplePaneProps = React.useMemo(() => {
32477
32511
  var _a;
32478
32512
  return ({
@@ -32482,7 +32516,8 @@ const CallArrangement = (props) => {
32482
32516
  onFetchAvatarPersonaData: props.onFetchAvatarPersonaData,
32483
32517
  onFetchParticipantMenuItems: (_a = props.callControlProps) === null || _a === void 0 ? void 0 : _a.onFetchParticipantMenuItems,
32484
32518
  mobileView: props.mobileView,
32485
- peopleButtonRef
32519
+ peopleButtonRef,
32520
+ setParticipantActioned
32486
32521
  });
32487
32522
  }, [
32488
32523
  updateSidePaneRenderer,
@@ -32490,7 +32525,8 @@ const CallArrangement = (props) => {
32490
32525
  (_a = props.callControlProps) === null || _a === void 0 ? void 0 : _a.onFetchParticipantMenuItems,
32491
32526
  props.onFetchAvatarPersonaData,
32492
32527
  props.mobileView,
32493
- peopleButtonRef
32528
+ peopleButtonRef,
32529
+ setParticipantActioned
32494
32530
  ]);
32495
32531
  const locale = useLocale();
32496
32532
  /* @conditional-compile-remove(spotlight) */
@@ -37454,7 +37490,7 @@ class CallWithChatBackedChatAdapter {
37454
37490
  this.dispose = () => this.callWithChatAdapter.dispose();
37455
37491
  this.onStateChange = (handler) => {
37456
37492
  const convertedHandler = (state) => {
37457
- handler(chatAdapterStateFromCallWithChatAdapterState(state));
37493
+ !!state.chat && handler(chatAdapterStateFromCallWithChatAdapterState(state));
37458
37494
  };
37459
37495
  this.callWithChatAdapter.onStateChange(convertedHandler);
37460
37496
  this.eventStore.set(handler, convertedHandler);
@@ -37542,7 +37578,26 @@ class CallWithChatBackedChatAdapter {
37542
37578
  }
37543
37579
  function chatAdapterStateFromCallWithChatAdapterState(callWithChatAdapterState) {
37544
37580
  if (!callWithChatAdapterState.chat) {
37545
- throw new Error('Chat thread state id undefined.');
37581
+ // Return some empty state if chat is not initialized yet
37582
+ return {
37583
+ userId: callWithChatAdapterState.userId,
37584
+ displayName: callWithChatAdapterState.displayName || '',
37585
+ thread: {
37586
+ chatMessages: {},
37587
+ participants: {
37588
+ [toFlatCommunicationIdentifier(callWithChatAdapterState.userId)]: {
37589
+ id: callWithChatAdapterState.userId
37590
+ }
37591
+ },
37592
+ threadId: '',
37593
+ readReceipts: [],
37594
+ typingIndicators: [],
37595
+ latestReadTime: new Date()
37596
+ },
37597
+ latestErrors: callWithChatAdapterState.latestChatErrors,
37598
+ /* @conditional-compile-remove(attachment-upload) */
37599
+ _attachmentUploads: callWithChatAdapterState._attachmentUploads
37600
+ };
37546
37601
  }
37547
37602
  return {
37548
37603
  userId: callWithChatAdapterState.userId,
@@ -39542,4 +39597,4 @@ exports.useTeamsCall = useTeamsCall;
39542
39597
  exports.useTeamsCallAdapter = useTeamsCallAdapter;
39543
39598
  exports.useTeamsCallAgent = useTeamsCallAgent;
39544
39599
  exports.useTheme = useTheme;
39545
- //# sourceMappingURL=index-C2GfkUGz.js.map
39600
+ //# sourceMappingURL=index-DKwz_uvr.js.map