@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.
Files changed (143) hide show
  1. package/dist/communication-react.d.ts +33 -5
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BkDaUOJU.js → ChatMessageComponentAsRichTextEditBox-BLFNaheX.js} +9 -3
  3. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BLFNaheX.js.map +1 -0
  4. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-BhTpuspw.js +54 -0
  5. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-BhTpuspw.js.map +1 -0
  6. package/dist/dist-cjs/communication-react/{index-DJswSfNy.js → index-C9I6Mcil.js} +291 -139
  7. package/dist/dist-cjs/communication-react/index-C9I6Mcil.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +2 -2
  9. package/dist/dist-esm/acs-ui-common/src/common.d.ts +8 -1
  10. package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
  11. package/dist/dist-esm/acs-ui-common/src/index.d.ts +1 -1
  12. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  13. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  14. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  15. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +1 -6
  16. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +1 -1
  18. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  19. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +1 -1
  20. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  21. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +0 -4
  22. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  23. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +0 -3
  24. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  25. package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -1
  26. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  27. package/dist/dist-esm/calling-stateful-client/src/PPTLiveSubscriber.js +0 -2
  28. package/dist/dist-esm/calling-stateful-client/src/PPTLiveSubscriber.js.map +1 -1
  29. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  30. package/dist/dist-esm/communication-react/src/index.d.ts +1 -1
  31. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.d.ts +4 -0
  33. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js +27 -22
  34. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js.map +1 -1
  35. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCardGroup.d.ts +15 -0
  36. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCardGroup.js +14 -16
  37. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCardGroup.js.map +1 -1
  38. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +16 -15
  39. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
  40. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentUploadCards.js +2 -2
  41. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentUploadCards.js.map +1 -1
  42. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +9 -1
  43. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  44. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +8 -2
  45. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +2 -2
  47. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +8 -2
  49. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  50. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +9 -1
  51. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  52. package/dist/dist-esm/react-components/src/components/ErrorBoundary.d.ts +2 -2
  53. package/dist/dist-esm/react-components/src/components/ErrorBoundary.js +2 -2
  54. package/dist/dist-esm/react-components/src/components/ErrorBoundary.js.map +1 -1
  55. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +5 -3
  56. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  57. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +1 -1
  58. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  59. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +4 -0
  60. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +5 -2
  61. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  62. package/dist/dist-esm/react-components/src/components/SendBox.js +5 -2
  63. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  64. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +6 -4
  65. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -1
  66. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js +3 -6
  67. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js.map +1 -1
  68. package/dist/dist-esm/react-components/src/components/VideoGallery.js +1 -3
  69. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  70. package/dist/dist-esm/react-components/src/components/VideoTile.js +0 -1
  71. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  72. package/dist/dist-esm/react-components/src/components/index.d.ts +1 -0
  73. package/dist/dist-esm/react-components/src/components/index.js +1 -0
  74. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  75. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +9 -1
  76. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js +27 -3
  77. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js.map +1 -1
  78. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.d.ts +17 -0
  79. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.js +47 -0
  80. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.js.map +1 -0
  81. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +2 -2
  82. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +8 -0
  83. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  84. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +4 -0
  85. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +9 -0
  86. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  87. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +22 -1
  88. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +22 -1
  89. package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +22 -1
  90. package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +22 -1
  91. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +3 -1
  92. package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +22 -1
  93. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +23 -2
  94. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +31 -10
  95. package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +22 -1
  96. package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +22 -1
  97. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +31 -10
  98. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +31 -10
  99. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +22 -1
  100. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +22 -1
  101. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +22 -1
  102. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +31 -10
  103. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +22 -1
  104. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +22 -1
  105. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +22 -1
  106. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +30 -9
  107. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +24 -3
  108. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +7 -0
  109. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +6 -2
  110. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  111. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +7 -0
  112. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  113. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +28 -8
  114. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  115. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +10 -0
  116. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +20 -0
  117. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +1 -0
  118. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.d.ts +30 -0
  119. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +44 -0
  120. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -0
  121. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +4 -0
  122. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +4 -0
  123. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +4 -0
  124. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +4 -0
  125. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +4 -0
  126. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +4 -0
  127. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +4 -0
  128. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +4 -0
  129. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +4 -0
  130. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +4 -0
  131. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +4 -0
  132. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +4 -0
  133. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +4 -0
  134. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +4 -0
  135. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +4 -0
  136. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +4 -0
  137. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +4 -0
  138. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +4 -0
  139. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +4 -0
  140. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +4 -0
  141. package/package.json +2 -2
  142. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BkDaUOJU.js.map +0 -1
  143. package/dist/dist-cjs/communication-react/index-DJswSfNy.js.map +0 -1
@@ -3008,7 +3008,7 @@ export declare interface CallState {
3008
3008
  *
3009
3009
  * This property is added by the stateful layer and is not a proxy of SDK state
3010
3010
  *
3011
- *@public
3011
+ * @public
3012
3012
  */
3013
3013
  contentSharingRemoteParticipant?: string;
3014
3014
  /**
@@ -3865,6 +3865,13 @@ export declare type CallWithChatCompositeOptions = {
3865
3865
  */
3866
3866
  hideSpotlightButtons?: boolean;
3867
3867
  };
3868
+ /**
3869
+ * enables rich text editor for the edit box
3870
+ * @defaultValue `false`
3871
+ *
3872
+ * @beta
3873
+ */
3874
+ richTextEditor?: boolean;
3868
3875
  };
3869
3876
 
3870
3877
  /**
@@ -4834,6 +4841,13 @@ export declare type ChatCompositeOptions = {
4834
4841
  * @beta
4835
4842
  */
4836
4843
  attachmentOptions?: AttachmentOptions;
4844
+ /**
4845
+ * enables rich text editor for the edit box
4846
+ * @defaultValue `false`
4847
+ *
4848
+ * @beta
4849
+ */
4850
+ richTextEditor?: boolean;
4837
4851
  };
4838
4852
 
4839
4853
  /**
@@ -4994,6 +5008,12 @@ export declare interface ChatMessage extends MessageCommon {
4994
5008
  attachments?: AttachmentMetadata[];
4995
5009
  }
4996
5010
 
5011
+ /**
5012
+ * @beta
5013
+ * Type of the message content, either 'text' or 'html'.
5014
+ */
5015
+ export declare type ChatMessageType = 'text' | 'html';
5016
+
4997
5017
  /**
4998
5018
  * An extension to {@link @azure/communication-chat#ChatMessage} that stores
4999
5019
  * client-side only metadata for chat messages.
@@ -8077,12 +8097,14 @@ export declare type MessageEditedListener = MessageReceivedListener;
8077
8097
  * @beta
8078
8098
  * Message option that defines properties that can be set when
8079
8099
  * sending or updating a chat message.
8080
- * @property metadata - Metadata that contains additional information about the message to be passed betrween 2 users.
8100
+ * @property metadata - Metadata that contains additional information about the message to be passed between 2 users.
8081
8101
  * @property attachments - Attachments that contains file attachments attached to the message.
8102
+ * @property type - Type of the message content, either 'text' or 'html'.
8082
8103
  */
8083
8104
  export declare type MessageOptions = {
8084
8105
  metadata?: Record<string, string>;
8085
8106
  attachments?: AttachmentMetadata[];
8107
+ type?: ChatMessageType;
8086
8108
  };
8087
8109
 
8088
8110
  /**
@@ -8142,10 +8164,11 @@ export declare type MessageProps = {
8142
8164
  /**
8143
8165
  * Optional callback to send a message.
8144
8166
  *
8145
- * @param messageId - message id from chatClient
8167
+ * @param content - message content from chatClient
8168
+ * @param options - message options to be included in the message
8146
8169
  *
8147
8170
  */
8148
- onSendMessage?: (messageId: string) => Promise<void>;
8171
+ onSendMessage?: (content: string, options?: MessageOptions) => Promise<void>;
8149
8172
  };
8150
8173
 
8151
8174
  /**
@@ -8388,9 +8411,10 @@ export declare type MessageThreadProps = {
8388
8411
  * Optional callback to send a message.
8389
8412
  *
8390
8413
  * @param content - message body to send
8414
+ * @param options - message options to be included in the message
8391
8415
  *
8392
8416
  */
8393
- onSendMessage?: (content: string) => Promise<void>;
8417
+ onSendMessage?: (content: string, options?: MessageOptions) => Promise<void>;
8394
8418
  /**
8395
8419
  /**
8396
8420
  * Disable editing messages.
@@ -9794,6 +9818,10 @@ export declare interface RichTextStrings {
9794
9818
  * Text for the delete table menu.
9795
9819
  */
9796
9820
  richTextDeleteTableMenu: string;
9821
+ /**
9822
+ * Text for the rich text toolbar more button.
9823
+ */
9824
+ richTextToolbarMoreButtonAriaLabel: string;
9797
9825
  }
9798
9826
 
9799
9827
  /**
@@ -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-DJswSfNy.js');
7
+ var index = require('./index-C9I6Mcil.js');
8
8
  var React = require('react');
9
9
  require('reselect');
10
10
  require('@azure/communication-calling');
@@ -70,6 +70,10 @@ const ChatMessageComponentAsRichTextEditBox = (props) => {
70
70
  const onRenderThemedSubmitIcon = React.useCallback((isHover) => {
71
71
  return index.onRenderSubmitIcon(iconClassName(isHover));
72
72
  }, [iconClassName]);
73
+ /* @conditional-compile-remove(attachment-upload) */
74
+ const hasMultipleAttachments = React.useMemo(() => {
75
+ return index.doesMessageContainMultipleAttachments(message);
76
+ }, [message]);
73
77
  const actionButtons = React.useMemo(() => {
74
78
  return (React.createElement(react.Stack, { horizontal: true },
75
79
  React.createElement(index.InputBoxButton, { className: index.richTextActionButtonsStyle, ariaLabel: strings.editBoxCancelButton, tooltipContent: strings.editBoxCancelButton, onRenderIcon: onRenderThemedCancelIcon, onClick: () => {
@@ -127,7 +131,9 @@ const ChatMessageComponentAsRichTextEditBox = (props) => {
127
131
  };
128
132
  const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';
129
133
  return (React.createElement(reactChat.ChatMyMessage, { attached: attached, root: {
130
- className: chatMyMessageStyles.root
134
+ className: reactComponents.mergeClasses(chatMyMessageStyles.root,
135
+ /* @conditional-compile-remove(attachment-upload) */
136
+ hasMultipleAttachments ? chatMyMessageStyles.multipleAttachments : undefined)
131
137
  }, body: {
132
138
  className: reactComponents.mergeClasses(editContainerStyles.body, attached !== 'top' ? editContainerStyles.bodyAttached : undefined)
133
139
  } }, getContent()));
@@ -135,4 +141,4 @@ const ChatMessageComponentAsRichTextEditBox = (props) => {
135
141
 
136
142
  exports.ChatMessageComponentAsRichTextEditBox = ChatMessageComponentAsRichTextEditBox;
137
143
  exports.default = ChatMessageComponentAsRichTextEditBox;
138
- //# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-BkDaUOJU.js.map
144
+ //# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-BLFNaheX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessageComponentAsRichTextEditBox-BLFNaheX.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';\n/* @conditional-compile-remove(attachment-upload) */\nimport { useReducer } 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 '../../Attachment/AttachmentUploadCards';\n/* @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\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 {\n attachmentMetadataReducer,\n getMessageWithAttachmentMetadata,\n doesMessageContainMultipleAttachments\n} 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 /* @conditional-compile-remove(attachment-upload) */\n attachmentMetadata?: AttachmentMetadata[]\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, handleAttachmentAction] = useReducer(\n attachmentMetadataReducer,\n getMessageWithAttachmentMetadata(message) ?? []\n );\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 /* @conditional-compile-remove(attachment-upload) */\n const hasMultipleAttachments = useMemo(() => {\n return doesMessageContainMultipleAttachments(message);\n }, [message]);\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 data-testId={strings.editBoxCancelButton}\n />\n <InputBoxButton\n className={richTextActionButtonsStyle}\n ariaLabel={strings.editBoxSubmitButton}\n tooltipContent={strings.editBoxSubmitButton}\n onRenderIcon={onRenderThemedSubmitIcon}\n onClick={(e) => {\n // it's very important to pass an empty attachment here\n // so when user remvoes all attachments, UI can reflect it instantly\n // if you set it to undefined, the attachments pre-edited would still be there\n // until edit message event is received\n submitEnabled &&\n onSubmit(textValue, /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata);\n e.stopPropagation();\n }}\n id={'submitIconWrapper'}\n data-testId={strings.editBoxSubmitButton}\n />\n </Stack>\n );\n }, [\n /* @conditional-compile-remove(attachment-upload) */\n attachmentMetadata,\n message.messageId,\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, ...strings };\n return locale.sendBox;\n }, [\n /* @conditional-compile-remove(rich-text-editor) */ locale.richTextSendBox,\n /* @conditional-compile-remove(rich-text-editor) */ strings,\n locale.sendBox\n ]);\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const onCancelAttachmentUpload = useCallback((attachmentId: string) => {\n // edit box only capable of removing attachments\n // we need to expand attachment actions\n // if we want to support more actions e.g. add\n handleAttachmentAction({ type: 'remove', id: attachmentId });\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 attachments={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: mergeClasses(\n chatMyMessageStyles.root,\n /* @conditional-compile-remove(attachment-upload) */\n hasMultipleAttachments ? chatMyMessageStyles.multipleAttachments : undefined\n )\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","useReducer","attachmentMetadataReducer","getMessageWithAttachmentMetadata","useTheme","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","useCallback","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","useMemo","doesMessageContainMultipleAttachments","Stack","InputBoxButton","richTextActionButtonsStyle","attachmentUploadCardsStyles","FluentV9ThemeProvider","_AttachmentUploadCards","editBoxWidthStyles","RichTextSendBoxErrors","RichTextInputBoxComponent","editBoxRichTextEditorStyle","ChatMyMessage","mergeClasses"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAqDA;;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,sBAAsB,CAAC,GAAGC,gBAAU,CAC7DC,+BAAyB,EACzB,CAAA,EAAA,GAAAC,sCAAgC,CAAC,OAAO,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,EAAE,CAChD,CAAC;IACF,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAA6B,IAAI,CAAC,CAAC;AACxE,IAAA,MAAM,KAAK,GAAGC,cAAQ,EAAE,CAAC;AACzB,IAAA,MAAM,YAAY,GAAGC,qBAA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kB,CAAC,EAAA;YAC/C,KAAC,CAAA,aAAA,CAAAC,2BAAqB,EAAC,EAAA,kBAAkB,EAAE,kBAAkB,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAI,CAAA;YACvG,KAAC,CAAA,aAAA,CAAAC,+BAAyB,IACxB,eAAe,EAAE,OAAO,CAAC,sBAAsB,EAC/C,QAAQ,EAAE,OAAO,EACjB,kBAAkB,EAAE,gBAAgB,EACpC,cAAc,EAAE,OAAO,CAAC,OAAO,EAC/B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,KAAK,EACf,gBAAgB,EAAE,aAAa,EAC/B,wBAAwB,EAAEC,gCAA0B,EACpD,0BAA0B,EAAE,IAAI;;AAEhC,gBAAA,yBAAyB,EAAE,yBAAyB,EACpD,CAAA,CACI,EACR;AACJ,KAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;IACzG,QACE,oBAACC,uBAAa,EAAA,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE;AACJ,YAAA,SAAS,EAAEC,4BAAY,CACrB,mBAAmB,CAAC,IAAI;;YAExB,sBAAsB,GAAG,mBAAmB,CAAC,mBAAmB,GAAG,SAAS,CAC7E;AACF,SAAA,EACD,IAAI,EAAE;YACJ,SAAS,EAAEA,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;;;;;"}
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var index = require('./index-C9I6Mcil.js');
5
+ require('@fluentui/react');
6
+ require('@fluentui/react-components');
7
+ require('@fluentui-contrib/react-chat');
8
+ require('@azure/communication-common');
9
+ require('@fluentui/react-hooks');
10
+ require('react-use-draggable-scroll');
11
+ require('copy-to-clipboard');
12
+ require('reselect');
13
+ require('@azure/communication-calling');
14
+ require('memoize-one');
15
+ require('@azure/logger');
16
+ require('events');
17
+ require('immer');
18
+ require('@fluentui/react-icons');
19
+ require('textarea-caret-ts');
20
+ require('use-debounce');
21
+ require('@fluentui/react-file-type-icons');
22
+ require('@griffel/react');
23
+ require('roosterjs-editor-plugins');
24
+ require('roosterjs-editor-core');
25
+ require('roosterjs-editor-types-compatible');
26
+ require('roosterjs-react');
27
+ require('roosterjs-editor-dom');
28
+ require('roosterjs-editor-api');
29
+ require('uuid');
30
+ require('html-react-parser');
31
+ require('react-linkify');
32
+ require('dompurify');
33
+ require('@fluentui/react-window-provider');
34
+ require('@azure/communication-chat');
35
+ require('nanoid');
36
+ require('@azure/communication-calling-effects');
37
+
38
+ // Copyright (c) Microsoft Corporation.
39
+ // Licensed under the MIT License.
40
+ /* @conditional-compile-remove(rich-text-editor-composite-support) */
41
+ /* @conditional-compile-remove(rich-text-editor-composite-support) */
42
+ /**
43
+ * @private
44
+ *
45
+ * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox
46
+ * before lazyLoading is done
47
+ */
48
+ const RichTextSendBoxWrapper = (props) => {
49
+ const richTextSendBoxProps = index.usePropsFor(index.RichTextSendBox);
50
+ return React.createElement(index.RichTextSendBox, Object.assign({}, richTextSendBoxProps, props));
51
+ };
52
+
53
+ exports.RichTextSendBoxWrapper = RichTextSendBoxWrapper;
54
+ //# sourceMappingURL=RichTextSendBoxWrapper-BhTpuspw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RichTextSendBoxWrapper-BhTpuspw.js","sources":["../../../../react-composites/src/composites/common/RichTextSendBoxWrapper.tsx"],"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"],"names":["usePropsFor","RichTextSendBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AAOA;AACA;;;;;AAKG;AACU,MAAA,sBAAsB,GAAG,CAAC,KAA2B,KAAiB;AACjF,IAAA,MAAM,oBAAoB,GAAGA,iBAAW,CAACC,qBAAe,CAAC,CAAC;AAE1D,IAAA,OAAO,oBAACA,qBAAe,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,oBAAoB,EAAM,KAAK,EAAI,CAAC;AAClE;;;;"}