@azure/communication-react 1.17.0-alpha-202405240014 → 1.17.0-alpha-202405250013

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 (82) hide show
  1. package/dist/communication-react.d.ts +293 -1
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CeKa8qDu.js → ChatMessageComponentAsRichTextEditBox-D6ea1yzU.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CeKa8qDu.js.map → ChatMessageComponentAsRichTextEditBox-D6ea1yzU.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-xx9t_FzT.js → RichTextSendBoxWrapper-TueLs8OS.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-xx9t_FzT.js.map → RichTextSendBoxWrapper-TueLs8OS.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-qGuuq6Hb.js → index-Bj8WXYGE.js} +241 -37
  7. package/dist/dist-cjs/communication-react/index-Bj8WXYGE.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +3 -1
  9. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  11. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  12. package/dist/dist-esm/communication-react/src/index.d.ts +4 -1
  13. package/dist/dist-esm/communication-react/src/index.js +2 -0
  14. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +1 -0
  16. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/NotificationBar.d.ts +65 -0
  18. package/dist/dist-esm/react-components/src/components/NotificationBar.js +38 -0
  19. package/dist/dist-esm/react-components/src/components/NotificationBar.js.map +1 -0
  20. package/dist/dist-esm/react-components/src/components/Notifications.d.ts +215 -0
  21. package/dist/dist-esm/react-components/src/components/Notifications.js +48 -0
  22. package/dist/dist-esm/react-components/src/components/Notifications.js.map +1 -0
  23. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +2 -0
  24. package/dist/dist-esm/react-components/src/components/VideoGallery.js +3 -3
  25. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +6 -1
  27. package/dist/dist-esm/react-components/src/components/VideoTile.js +3 -1
  28. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/components/index.d.ts +3 -2
  30. package/dist/dist-esm/react-components/src/components/index.js +4 -0
  31. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/components/styles/NotificationBar.styles.d.ts +22 -0
  33. package/dist/dist-esm/react-components/src/components/styles/NotificationBar.styles.js +56 -0
  34. package/dist/dist-esm/react-components/src/components/styles/NotificationBar.styles.js.map +1 -0
  35. package/dist/dist-esm/react-components/src/components/utils.d.ts +13 -0
  36. package/dist/dist-esm/react-components/src/components/utils.js +29 -0
  37. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  38. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +3 -0
  39. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  40. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/ComponentLocale.js +3 -1
  41. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/ComponentLocale.js.map +1 -1
  42. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/ComponentLocale.js +3 -1
  43. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/ComponentLocale.js.map +1 -1
  44. package/dist/dist-esm/react-components/src/localization/locales/de-DE/ComponentLocale.js +3 -1
  45. package/dist/dist-esm/react-components/src/localization/locales/de-DE/ComponentLocale.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/localization/locales/en-GB/ComponentLocale.js +3 -1
  47. package/dist/dist-esm/react-components/src/localization/locales/en-GB/ComponentLocale.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +157 -1
  49. package/dist/dist-esm/react-components/src/localization/locales/es-ES/ComponentLocale.js +3 -1
  50. package/dist/dist-esm/react-components/src/localization/locales/es-ES/ComponentLocale.js.map +1 -1
  51. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/ComponentLocale.js +3 -1
  52. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/ComponentLocale.js.map +1 -1
  53. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/ComponentLocale.js +3 -1
  54. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/ComponentLocale.js.map +1 -1
  55. package/dist/dist-esm/react-components/src/localization/locales/he-IL/ComponentLocale.js +3 -1
  56. package/dist/dist-esm/react-components/src/localization/locales/he-IL/ComponentLocale.js.map +1 -1
  57. package/dist/dist-esm/react-components/src/localization/locales/it-IT/ComponentLocale.js +3 -1
  58. package/dist/dist-esm/react-components/src/localization/locales/it-IT/ComponentLocale.js.map +1 -1
  59. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/ComponentLocale.js +3 -1
  60. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/ComponentLocale.js.map +1 -1
  61. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/ComponentLocale.js +3 -1
  62. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/ComponentLocale.js.map +1 -1
  63. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/ComponentLocale.js +3 -1
  64. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/ComponentLocale.js.map +1 -1
  65. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/ComponentLocale.js +3 -1
  66. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/ComponentLocale.js.map +1 -1
  67. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/ComponentLocale.js +3 -1
  68. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/ComponentLocale.js.map +1 -1
  69. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/ComponentLocale.js +3 -1
  70. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/ComponentLocale.js.map +1 -1
  71. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/ComponentLocale.js +3 -1
  72. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/ComponentLocale.js.map +1 -1
  73. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/ComponentLocale.js +3 -1
  74. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/ComponentLocale.js.map +1 -1
  75. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/ComponentLocale.js +3 -1
  76. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/ComponentLocale.js.map +1 -1
  77. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/ComponentLocale.js +3 -1
  78. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/ComponentLocale.js.map +1 -1
  79. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/ComponentLocale.js +3 -1
  80. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/ComponentLocale.js.map +1 -1
  81. package/package.json +2 -2
  82. package/dist/dist-cjs/communication-react/index-qGuuq6Hb.js.map +0 -1
@@ -62,6 +62,7 @@ import { IContextualMenuItem } from '@fluentui/react';
62
62
  import { IContextualMenuItemStyles } from '@fluentui/react';
63
63
  import { IContextualMenuProps } from '@fluentui/react';
64
64
  import { IContextualMenuStyles } from '@fluentui/react';
65
+ import { IIconProps } from '@fluentui/react';
65
66
  import { ILinkStyles } from '@fluentui/react';
66
67
  import { IMessageBarProps } from '@fluentui/react';
67
68
  import { IncomingCall } from '@azure/communication-calling';
@@ -151,6 +152,30 @@ export declare interface ActiveErrorMessage {
151
152
  timestamp?: Date;
152
153
  }
153
154
 
155
+ /**
156
+ * Active notifications to be shown via {@link Notifications}.
157
+ *
158
+ * @beta
159
+ */
160
+ export declare interface ActiveNotification {
161
+ /**
162
+ * Type of error that is active.
163
+ */
164
+ type: NotificationType;
165
+ /**
166
+ * Callback called when the button inside notification bar is clicked.
167
+ */
168
+ onClick?: () => void;
169
+ /**
170
+ * Callback called when the notification is dismissed.
171
+ */
172
+ onDismiss?: () => void;
173
+ /**
174
+ * If set, notification will automatically dismiss after 5 seconds
175
+ */
176
+ autoDismiss?: boolean;
177
+ }
178
+
154
179
  /**
155
180
  * Error reported via error events and stored in adapter state.
156
181
  *
@@ -5656,6 +5681,8 @@ export declare interface ComponentStrings {
5656
5681
  messageStatusIndicator: MessageStatusIndicatorStrings;
5657
5682
  /** Strings for ErroBar */
5658
5683
  errorBar: ErrorBarStrings;
5684
+ /** Strings for Notifications */
5685
+ notifications: NotificationsStrings;
5659
5686
  /** Strings for VideoGallery */
5660
5687
  videoGallery: VideoGalleryStrings;
5661
5688
  /** Strings for Dialpad */
@@ -8779,6 +8806,264 @@ export declare interface NetworkDiagnosticsState {
8779
8806
  latest: LatestNetworkDiagnostics;
8780
8807
  }
8781
8808
 
8809
+ /**
8810
+ * A component to show notification messages on the UI.
8811
+ *
8812
+ * @beta
8813
+ */
8814
+ export declare const NotificationBar: (props: NotificationBarProps) => JSX.Element;
8815
+
8816
+ /**
8817
+ * Props for {@link NotificationBar}.
8818
+ *
8819
+ * @beta
8820
+ */
8821
+ export declare interface NotificationBarProps {
8822
+ /**
8823
+ * Notification bar strings;
8824
+ */
8825
+ notificationBarStrings?: NotificationBarStrings;
8826
+ /**
8827
+ * Notification bar icon;
8828
+ */
8829
+ notificationBarIconProps?: IIconProps;
8830
+ /**
8831
+ * If set, notifications will automatically dismiss after 5 seconds
8832
+ * @defaultValue false
8833
+ */
8834
+ autoDismiss?: boolean;
8835
+ /**
8836
+ * If set, notifications will be shown in a stacked effect
8837
+ * @defaultValue false
8838
+ */
8839
+ showStackedEffect?: boolean;
8840
+ /**
8841
+ * Callback called when the button inside notification bar is clicked.
8842
+ */
8843
+ onClick?: () => void;
8844
+ /**
8845
+ * Callback called when the notification is dismissed.
8846
+ */
8847
+ onDismiss?: () => void;
8848
+ }
8849
+
8850
+ /**
8851
+ * All strings that may be shown on the UI in the {@link NotificationBar}.
8852
+ *
8853
+ * @beta
8854
+ */
8855
+ export declare interface NotificationBarStrings {
8856
+ /**
8857
+ * Notification bar title.
8858
+ */
8859
+ title: string;
8860
+ /**
8861
+ * Notification bar close button aria label
8862
+ */
8863
+ closeButtonAriaLabel: string;
8864
+ /**
8865
+ * Notification bar message.
8866
+ */
8867
+ message?: string;
8868
+ /**
8869
+ * Notification bar button label
8870
+ */
8871
+ buttonLabel?: string;
8872
+ }
8873
+
8874
+ /**
8875
+ * A component to show notifications on the UI.
8876
+ * All strings that can be shown are accepted as the {@link NotificationsProps.strings} so that they can be localized.
8877
+ * Active notifications are selected by {@link NotificationsProps.activeNotifications}.
8878
+ *
8879
+ * This component internally tracks dismissed by the user.
8880
+ * * Notifications that have an associated timestamp: The notification is shown on the UI again if it occurs after being dismissed.
8881
+ * * Notifications that do not have a timestamp: The notification is dismissed until it disappears from the props.
8882
+ * If the notification recurs, it is shown in the UI.
8883
+ *
8884
+ *
8885
+ * @beta
8886
+ */
8887
+ export declare const Notifications: (props: NotificationsProps) => JSX.Element;
8888
+
8889
+ /**
8890
+ * Props for {@link Notifications}.
8891
+ * @beta
8892
+ */
8893
+ export declare interface NotificationsProps {
8894
+ /**
8895
+ * Strings shown on the UI on errors.
8896
+ */
8897
+ strings?: NotificationsStrings;
8898
+ /**
8899
+ * Currently active notifications.
8900
+ */
8901
+ activeNotifications: ActiveNotification[];
8902
+ /**
8903
+ * Max notifications to show at a time.
8904
+ * @defaultValue 2
8905
+ */
8906
+ maxNotificationsToShow?: number;
8907
+ }
8908
+
8909
+ /**
8910
+ * All strings that may be shown on the UI in the {@link Notifications}.
8911
+ *
8912
+ * @beta
8913
+ */
8914
+ export declare interface NotificationsStrings {
8915
+ /**
8916
+ * Unable to reach Chat service.
8917
+ *
8918
+ * This can mean:
8919
+ * - Incorrect Azure Communication Services endpoint was provided.
8920
+ * - User's network connection is down.
8921
+ */
8922
+ unableToReachChatService: NotificationBarStrings;
8923
+ /**
8924
+ * User does not have access to the Chat service.
8925
+ * This usually means that either the Azure Communication Services endpiont or the token provided are incorrect.
8926
+ */
8927
+ accessDenied: NotificationBarStrings;
8928
+ /**
8929
+ * User is no longer on the thread.
8930
+ *
8931
+ * See also: {@link NotificationsStrings.sendMessageNotInChatThread} for a more specific error.
8932
+ */
8933
+ userNotInChatThread: NotificationBarStrings;
8934
+ /**
8935
+ * Sending message failed because user is no longer on the thread.
8936
+ */
8937
+ sendMessageNotInChatThread: NotificationBarStrings;
8938
+ /**
8939
+ * A generic message when sending message fails.
8940
+ * Prefer more specific error strings when possible.
8941
+ */
8942
+ sendMessageGeneric: NotificationBarStrings;
8943
+ /**
8944
+ * A generic message when starting video fails.
8945
+ */
8946
+ startVideoGeneric: NotificationBarStrings;
8947
+ /**
8948
+ * A generic message when starting video fails.
8949
+ */
8950
+ stopVideoGeneric: NotificationBarStrings;
8951
+ /**
8952
+ * A generic message when muting microphone fails.
8953
+ */
8954
+ muteGeneric: NotificationBarStrings;
8955
+ /**
8956
+ * A generic message when unmuting microphone fails.
8957
+ */
8958
+ unmuteGeneric: NotificationBarStrings;
8959
+ /**
8960
+ * A generic message when starting screenshare fails.
8961
+ */
8962
+ startScreenShareGeneric: NotificationBarStrings;
8963
+ /**
8964
+ * A generic message when stopping screenshare fails.
8965
+ */
8966
+ stopScreenShareGeneric: NotificationBarStrings;
8967
+ /**
8968
+ * Message shown when poor network quality is detected during a call.
8969
+ */
8970
+ callNetworkQualityLow: NotificationBarStrings;
8971
+ /**
8972
+ * Message shown on failure to detect audio output devices.
8973
+ */
8974
+ callNoSpeakerFound: NotificationBarStrings;
8975
+ /**
8976
+ * Message shown on failure to detect audio input devices.
8977
+ */
8978
+ callNoMicrophoneFound: NotificationBarStrings;
8979
+ /**
8980
+ * Message shown when microphone can be enumerated but access is blocked by the system.
8981
+ */
8982
+ callMicrophoneAccessDenied: NotificationBarStrings;
8983
+ /**
8984
+ * Message shown when microphone can be enumerated but access is blocked by the system, for safari browsers
8985
+ */
8986
+ callMicrophoneAccessDeniedSafari: NotificationBarStrings;
8987
+ /**
8988
+ * Message shown when microphone is muted by the system (not by local or remote participants)
8989
+ */
8990
+ callMicrophoneMutedBySystem: NotificationBarStrings;
8991
+ /**
8992
+ * Message shown when microphone is unmuted by the system (not by local or remote participants).
8993
+ * This typically occurs if the system recovers from an unexpected mute.
8994
+ */
8995
+ callMicrophoneUnmutedBySystem: NotificationBarStrings;
8996
+ /**
8997
+ * Mac OS specific message shown when microphone can be enumerated but access is
8998
+ * blocked by the system.
8999
+ */
9000
+ callMacOsMicrophoneAccessDenied: NotificationBarStrings;
9001
+ /**
9002
+ * Message shown when poor network causes local video stream to be frozen.
9003
+ */
9004
+ callLocalVideoFreeze: NotificationBarStrings;
9005
+ /**
9006
+ * Message shown when camera can be enumerated but access is blocked by the system.
9007
+ */
9008
+ callCameraAccessDenied: NotificationBarStrings;
9009
+ /**
9010
+ * Message shown when camera can be enumerated but access is blocked by the system, for safari browsers
9011
+ */
9012
+ callCameraAccessDeniedSafari: NotificationBarStrings;
9013
+ /**
9014
+ * Message shown when local video fails to start because camera is already in use by
9015
+ * another applciation.
9016
+ */
9017
+ callCameraAlreadyInUse: NotificationBarStrings;
9018
+ /**
9019
+ * Message shown when local video is stopped by the system (not by local or remote participants)
9020
+ */
9021
+ callVideoStoppedBySystem: NotificationBarStrings;
9022
+ /**
9023
+ * Message shown when local video was recovered by the system (not by the local participant)
9024
+ */
9025
+ callVideoRecoveredBySystem: NotificationBarStrings;
9026
+ /**
9027
+ * Mac OS specific message shown when system denies access to camera.
9028
+ */
9029
+ callMacOsCameraAccessDenied: NotificationBarStrings;
9030
+ /**
9031
+ * Mac OS specific message shown when system denies sharing local screen on a call.
9032
+ */
9033
+ callMacOsScreenShareAccessDenied: NotificationBarStrings;
9034
+ /**
9035
+ * Dimiss Notifications button aria label read by screen reader accessibility tools
9036
+ */
9037
+ dismissButtonAriaLabel?: NotificationBarStrings;
9038
+ /**
9039
+ * An error message when joining a call fails.
9040
+ */
9041
+ failedToJoinCallGeneric?: NotificationBarStrings;
9042
+ /**
9043
+ * An error message when joining a call fails specifically due to an invalid meeting link.
9044
+ */
9045
+ failedToJoinCallInvalidMeetingLink?: NotificationBarStrings;
9046
+ /**
9047
+ * Error string letting you know remote participants see a frozen stream for you.
9048
+ */
9049
+ cameraFrozenForRemoteParticipants?: NotificationBarStrings;
9050
+ /**
9051
+ * Unable to start effect
9052
+ */
9053
+ unableToStartVideoEffect?: NotificationBarStrings;
9054
+ /**
9055
+ * An error message when starting spotlight while max participants are spotlighted
9056
+ */
9057
+ startSpotlightWhileMaxParticipantsAreSpotlighted: NotificationBarStrings;
9058
+ }
9059
+
9060
+ /**
9061
+ * All notifications that can be shown in the {@link Notifications}.
9062
+ *
9063
+ * @beta
9064
+ */
9065
+ export declare type NotificationType = keyof NotificationsStrings;
9066
+
8782
9067
  /**
8783
9068
  * Callback function used to provide custom data to build profile for a user or bot.
8784
9069
  *
@@ -11608,6 +11893,8 @@ export declare interface VideoGalleryStrings {
11608
11893
  localVideoCameraSwitcherLabel: string;
11609
11894
  /** String for announcing the local video tile can be moved by keyboard controls */
11610
11895
  localVideoMovementLabel: string;
11896
+ /** Aria-label for announcing the local video tile can be moved by keyboard controls */
11897
+ localVideoMovementAriaLabel: string;
11611
11898
  /** String for announcing the selected camera */
11612
11899
  localVideoSelectedDescription: string;
11613
11900
  /** placeholder text for participants who does not have a display name*/
@@ -11815,6 +12102,9 @@ export declare interface VideoTileProps {
11815
12102
  * For example, `Hold` means the participant is on hold.
11816
12103
  */
11817
12104
  participantState?: ParticipantState;
12105
+ /**
12106
+ * Strings to override in the component.
12107
+ */
11818
12108
  strings?: VideoTileStrings;
11819
12109
  /**
11820
12110
  * Display custom menu items in the VideoTile's contextual menu.
@@ -11850,9 +12140,11 @@ export declare interface VideoTilesOptions {
11850
12140
 
11851
12141
  /**
11852
12142
  * Strings of {@link VideoTile} that can be overridden.
11853
- * @beta
12143
+ * @public
11854
12144
  */
11855
12145
  export declare interface VideoTileStrings {
12146
+ /** Aria label for announcing the remote video tile drawer menu */
12147
+ moreOptionsButtonAriaLabel: string;
11856
12148
  participantStateRinging: string;
11857
12149
  participantStateHold: string;
11858
12150
  }
@@ -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-qGuuq6Hb.js');
7
+ var index = require('./index-Bj8WXYGE.js');
8
8
  var React = require('react');
9
9
  require('reselect');
10
10
  require('@azure/communication-calling');
@@ -146,4 +146,4 @@ const ChatMessageComponentAsRichTextEditBox = (props) => {
146
146
 
147
147
  exports.ChatMessageComponentAsRichTextEditBox = ChatMessageComponentAsRichTextEditBox;
148
148
  exports.default = ChatMessageComponentAsRichTextEditBox;
149
- //# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-CeKa8qDu.js.map
149
+ //# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-D6ea1yzU.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMessageComponentAsRichTextEditBox-CeKa8qDu.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, useEffect, 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 = useMemo(() => {\n return getMessageState(textValue, /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata ?? []);\n }, [/* @conditional-compile-remove(attachment-upload) */ attachmentMetadata, textValue]);\n\n const submitEnabled = messageState === 'OK';\n\n const editContainerStyles = useChatMessageRichTextEditContainerStyles();\n const chatMyMessageStyles = useChatMyMessageStyles();\n const locale = useLocale().strings;\n\n const setText = useCallback((newValue?: string): void => {\n setTextValue(newValue ?? '');\n }, []);\n\n useEffect(() => {\n editTextFieldRef.current?.focus();\n }, []);\n\n const textTooLongMessage = useMemo(() => {\n return messageState === 'too long'\n ? _formatString(strings.editBoxTextLimit, { limitNumber: `${MAXIMUM_LENGTH_OF_MESSAGE}` })\n : undefined;\n }, [messageState, strings.editBoxTextLimit]);\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 removes 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 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","useMemo","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","useCallback","useEffect","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","doesMessageContainMultipleAttachments","Stack","InputBoxButton","richTextActionButtonsStyle","attachmentUploadCardsStyles","FluentV9ThemeProvider","_AttachmentUploadCards","editBoxWidthStyles","RichTextSendBoxErrors","RichTextInputBoxComponent","editBoxRichTextEditorSt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EAAE,kBAAkB,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAI,CAAA;AACvG,YAAA,KAAA,CAAA,aAAA,CAACC,+BAAyB,EACxB,EAAA,eAAe,EAAE,OAAO,CAAC,sBAAsB,EAC/C,QAAQ,EAAE,OAAO,EACjB,kBAAkB,EAAE,gBAAgB,EACpC,cAAc,EAAE,OAAO,CAAC,OAAO,EAC/B,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;;;;;"}
1
+ {"version":3,"file":"ChatMessageComponentAsRichTextEditBox-D6ea1yzU.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, useEffect, 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 = useMemo(() => {\n return getMessageState(textValue, /* @conditional-compile-remove(attachment-upload) */ attachmentMetadata ?? []);\n }, [/* @conditional-compile-remove(attachment-upload) */ attachmentMetadata, textValue]);\n\n const submitEnabled = messageState === 'OK';\n\n const editContainerStyles = useChatMessageRichTextEditContainerStyles();\n const chatMyMessageStyles = useChatMyMessageStyles();\n const locale = useLocale().strings;\n\n const setText = useCallback((newValue?: string): void => {\n setTextValue(newValue ?? '');\n }, []);\n\n useEffect(() => {\n editTextFieldRef.current?.focus();\n }, []);\n\n const textTooLongMessage = useMemo(() => {\n return messageState === 'too long'\n ? _formatString(strings.editBoxTextLimit, { limitNumber: `${MAXIMUM_LENGTH_OF_MESSAGE}` })\n : undefined;\n }, [messageState, strings.editBoxTextLimit]);\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 removes 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 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","useMemo","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","useCallback","useEffect","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","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,aAAO,CAAC,MAAK;AAChC,QAAA,OAAOC,qBAAe,CAAC,SAAS,uDAAuD,kBAAkB,KAAlB,IAAA,IAAA,kBAAkB,KAAlB,KAAA,CAAA,GAAA,kBAAkB,GAAI,EAAE,CAAC,CAAC;KAClH,EAAE,sDAAsD,kBAAkB,EAAE,SAAS,CAAC,CAAC,CAAC;AAEzF,IAAA,MAAM,aAAa,GAAG,YAAY,KAAK,IAAI,CAAC;AAE5C,IAAA,MAAM,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;;;"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var index = require('./index-qGuuq6Hb.js');
4
+ var index = require('./index-Bj8WXYGE.js');
5
5
  require('@fluentui/react');
6
6
  require('@fluentui/react-components');
7
7
  require('@fluentui-contrib/react-chat');
@@ -49,4 +49,4 @@ const RichTextSendBoxWrapper = (props) => {
49
49
  };
50
50
 
51
51
  exports.RichTextSendBoxWrapper = RichTextSendBoxWrapper;
52
- //# sourceMappingURL=RichTextSendBoxWrapper-xx9t_FzT.js.map
52
+ //# sourceMappingURL=RichTextSendBoxWrapper-TueLs8OS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextSendBoxWrapper-xx9t_FzT.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;;;;"}
1
+ {"version":3,"file":"RichTextSendBoxWrapper-TueLs8OS.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;;;;"}