@azure/communication-react 1.23.0-alpha-202501010018 → 1.23.0-alpha-202501080016

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 (46) hide show
  1. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-C-il3-6g.js → ChatMessageComponentAsRichTextEditBox-DkOxwoZA.js} +2 -2
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-C-il3-6g.js.map → ChatMessageComponentAsRichTextEditBox-DkOxwoZA.js.map} +1 -1
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-C9huyOrM.js → RichTextSendBoxWrapper-BO_44r6-.js} +2 -2
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-C9huyOrM.js.map → RichTextSendBoxWrapper-BO_44r6-.js.map} +1 -1
  5. package/dist/dist-cjs/communication-react/{index-CoXZD7Ml.js → index-BGBPNiPb.js} +29 -21
  6. package/dist/dist-cjs/communication-react/index-BGBPNiPb.js.map +1 -0
  7. package/dist/dist-cjs/communication-react/index.js +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  10. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +0 -5
  11. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  12. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +0 -1
  13. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +0 -1
  15. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  16. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +1 -0
  17. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +12 -11
  18. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +11 -4
  20. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  21. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +0 -1
  22. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +0 -1
  24. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +0 -1
  26. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  27. package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js +0 -1
  28. package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/components/VideoGallery.js +0 -1
  30. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  31. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +0 -1
  32. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +0 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +0 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +0 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  39. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js +0 -1
  40. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js.map +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +0 -1
  42. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  43. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +0 -1
  44. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  45. package/package.json +6 -6
  46. package/dist/dist-cjs/communication-react/index-CoXZD7Ml.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CoXZD7Ml.js');
3
+ var index = require('./index-BGBPNiPb.js');
4
4
  require('react');
5
5
  require('@fluentui/react');
6
6
  require('@fluentui/react-components');
@@ -2,5 +2,5 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT License.
4
4
  // GENERATED FILE. DO NOT EDIT MANUALLY.
5
- module.exports = '1.23.0-alpha-202501010018';
5
+ module.exports = '1.23.0-alpha-202501080016';
6
6
  //# sourceMappingURL=telemetryVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.23.0-alpha-202501010018';\n"]}
1
+ {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.23.0-alpha-202501080016';\n"]}
@@ -12,7 +12,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
12
12
  import { isCommunicationUserIdentifier, isMicrosoftTeamsUserIdentifier, isPhoneNumberIdentifier } from '@azure/communication-common';
13
13
  import { _toCommunicationIdentifier } from "../../../acs-ui-common/src";
14
14
  import memoizeOne from 'memoize-one';
15
- import { isACSCallParticipants } from '../utils/callUtils';
16
15
  import { createLocalVideoStream } from '../utils/callUtils';
17
16
  import { createDefaultCommonCallingHandlers } from './createCommonHandlers';
18
17
  /**
@@ -37,10 +36,6 @@ export const createDefaultCallingHandlers = memoizeOne((...args) => {
37
36
  // FIXME: onStartCall API should use string, not the underlying SDK types.
38
37
  onStartCall: (participants, options) => {
39
38
  return callAgent === null || callAgent === void 0 ? void 0 : callAgent.startCall(participants, options);
40
- if (!isACSCallParticipants(participants)) {
41
- throw new Error('TeamsUserIdentifier in Teams call is not supported!');
42
- }
43
- return callAgent === null || callAgent === void 0 ? void 0 : callAgent.startCall(participants, options);
44
39
  }, onAddParticipant: (userId, options) => __awaiter(void 0, void 0, void 0, function* () {
45
40
  const participant = _toCommunicationIdentifier(userId);
46
41
  if (isPhoneNumberIdentifier(participant)) {
@@ -1 +1 @@
1
- {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,0BAA0B,EAAE,mCAAgC;AAGrE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EA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AAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAC3F,CAAC;YACJ,CAAC;QACH,CAAC,CAAA,EACD,YAAY,EAAE,CAAO,cAAsB,EAAiB,EAAE;YAC5D,MAAM,YAAY,GAAI,SAAkC,aAAlC,SAAS,uBAAT,SAAS,CAA2B,aAAa,CAAC,IAAI,CAC1E,CAAC,YAAgC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,cAAc,CACzE,CAAC;YACF,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC,CAAA;QACD,iDAAiD;QACjD,QAAQ,EAAE,sBAAsB;YAC9B,CAAC,CAAC,GAAS,EAAE,kDAAC,OAAA,sBAAsB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,QAAQ,EAAE,CAAC,CAAA,GAAA;YAC1F,CAAC,CAAC,qBAAqB,CAAC,QAAQ,IAClC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Call, CallAgent, StartCallOptions } from '@azure/communication-calling';\nimport { IncomingCallCommon } from '@azure/communication-calling';\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport {\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { CommunicationIdentifier } from '@azure/communication-common';\n\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { DeclarativeCallAgent } from '@internal/calling-stateful-client';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { isACSCallParticipants } from '../utils/callUtils';\nimport { createLocalVideoStream } from '../utils/callUtils';\nimport { createDefaultCommonCallingHandlers, CommonCallingHandlers } from './createCommonHandlers';\n\nimport { VideoBackgroundEffectsDependency } from './createCommonHandlers';\nimport { DeepNoiseSuppressionEffectDependency } from './createCommonHandlers';\n\n/**\n * Object containing all the handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface CallingHandlers extends CommonCallingHandlers {\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => Call | undefined;\n}\n\n/**\n * Configuration options to include video effect background dependency.\n * @public\n */\nexport type CallingHandlersOptions = {\n onResolveVideoBackgroundEffectsDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n /**\n * Dependency resolver for deep noise suppression effect.\n * @beta\n */\n onResolveDeepNoiseSuppressionDependency?: () => Promise<DeepNoiseSuppressionEffectDependency>;\n};\n\n/**\n * Type of {@link createDefaultCallingHandlers}.\n *\n * @public\n */\nexport type CreateDefaultCallingHandlers = (\n callClient: StatefulCallClient,\n callAgent: CallAgent | undefined,\n deviceManager: StatefulDeviceManager | undefined,\n call: Call | undefined,\n\n options?: CallingHandlersOptions\n) => CallingHandlers;\n\n/**\n * Create the default implementation of {@link CallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultCallingHandlers: CreateDefaultCallingHandlers = memoizeOne((...args) => {\n const [callClient, callAgent, deviceManager, call, options] = args;\n /* @conditional-compile-remove(breakout-rooms) */\n const callState = call?.id ? callClient.getState().calls[call?.id] : undefined;\n /* @conditional-compile-remove(breakout-rooms) */\n const breakoutRoomOriginCallId = callState?.breakoutRooms?.breakoutRoomOriginCallId;\n /* @conditional-compile-remove(breakout-rooms) */\n const breakoutRoomOriginCall = callAgent?.calls.find((call) => call.id === breakoutRoomOriginCallId);\n const commonCallingHandlers = createDefaultCommonCallingHandlers(callClient, deviceManager, call, options);\n return {\n ...commonCallingHandlers,\n // FIXME: onStartCall API should use string, not the underlying SDK types.\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined => {\n return callAgent?.startCall(participants, options);\n if (!isACSCallParticipants(participants)) {\n throw new Error('TeamsUserIdentifier in Teams call is not supported!');\n }\n return callAgent?.startCall(participants, options);\n },\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, options);\n } else if (isCommunicationUserIdentifier(participant) || isMicrosoftTeamsUserIdentifier(participant)) {\n call?.addParticipant(participant);\n }\n },\n onRemoveParticipant: async (userId: string | CommunicationIdentifier): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n await call?.removeParticipant(participant);\n },\n onAcceptCall: async (incomingCallId: string, useVideo?: boolean): Promise<void> => {\n const localVideoStream = useVideo ? await createLocalVideoStream(callClient) : undefined;\n const incomingCall = (callAgent as DeclarativeCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.accept(\n localVideoStream ? { videoOptions: { localVideoStreams: [localVideoStream] } } : undefined\n );\n }\n },\n onRejectCall: async (incomingCallId: string): Promise<void> => {\n const incomingCall = (callAgent as DeclarativeCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.reject();\n }\n },\n /* @conditional-compile-remove(breakout-rooms) */\n onHangUp: breakoutRoomOriginCall\n ? async () => breakoutRoomOriginCall.hangUp().then(() => commonCallingHandlers.onHangUp())\n : commonCallingHandlers.onHangUp\n };\n});\n\n/**\n * Handlers only for calling components\n * @internal\n */\nexport interface _ComponentCallingHandlers {\n /** VideoGallery callback prop to start local spotlight */\n onStartLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to stop local spotlight */\n onStopLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to start remote spotlight */\n onStartRemoteSpotlight: (userIds: string[]) => Promise<void>;\n /** VideoGallery callback prop to stop remote spotlight */\n onStopRemoteSpotlight: (userIds: string[]) => Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,0BAA0B,EAAE,mCAAgC;AAGrE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,kCAAkC,EAAyB,MAAM,wBAAwB,CAAC;AA4CnG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAiC,UAAU,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE;;IAC/F,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACnE,iDAAiD;IACjD,MAAM,SAAS,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,EAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,iDAAiD;IACjD,MAAM,wBAAwB,GAAG,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,aAAa,0CAAE,wBAAwB,CAAC;IACpF,iDAAiD;IACjD,MAAM,sBAAsB,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,wBAAwB,CAAC,CAAC;IACrG,MAAM,qBAAqB,GAAG,kCAAkC,CAA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C,EAAE,KAAK,cAAc,CACzE,CAAC;YACF,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,YAAY,CAAC,MAAM,CACvB,gBAAgB,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,iBAAiB,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAC3F,CAAC;YACJ,CAAC;QACH,CAAC,CAAA,EACD,YAAY,EAAE,CAAO,cAAsB,EAAiB,EAAE;YAC5D,MAAM,YAAY,GAAI,SAAkC,aAAlC,SAAS,uBAAT,SAAS,CAA2B,aAAa,CAAC,IAAI,CAC1E,CAAC,YAAgC,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,cAAc,CACzE,CAAC;YACF,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC,CAAA;QACD,iDAAiD;QACjD,QAAQ,EAAE,sBAAsB;YAC9B,CAAC,CAAC,GAAS,EAAE,kDAAC,OAAA,sBAAsB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,QAAQ,EAAE,CAAC,CAAA,GAAA;YAC1F,CAAC,CAAC,qBAAqB,CAAC,QAAQ,IAClC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Call, CallAgent, StartCallOptions } from '@azure/communication-calling';\nimport { IncomingCallCommon } from '@azure/communication-calling';\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport {\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { CommunicationIdentifier } from '@azure/communication-common';\n\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { DeclarativeCallAgent } from '@internal/calling-stateful-client';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { createLocalVideoStream } from '../utils/callUtils';\nimport { createDefaultCommonCallingHandlers, CommonCallingHandlers } from './createCommonHandlers';\n\nimport { VideoBackgroundEffectsDependency } from './createCommonHandlers';\nimport { DeepNoiseSuppressionEffectDependency } from './createCommonHandlers';\n\n/**\n * Object containing all the handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface CallingHandlers extends CommonCallingHandlers {\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => Call | undefined;\n}\n\n/**\n * Configuration options to include video effect background dependency.\n * @public\n */\nexport type CallingHandlersOptions = {\n onResolveVideoBackgroundEffectsDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n /**\n * Dependency resolver for deep noise suppression effect.\n * @beta\n */\n onResolveDeepNoiseSuppressionDependency?: () => Promise<DeepNoiseSuppressionEffectDependency>;\n};\n\n/**\n * Type of {@link createDefaultCallingHandlers}.\n *\n * @public\n */\nexport type CreateDefaultCallingHandlers = (\n callClient: StatefulCallClient,\n callAgent: CallAgent | undefined,\n deviceManager: StatefulDeviceManager | undefined,\n call: Call | undefined,\n\n options?: CallingHandlersOptions\n) => CallingHandlers;\n\n/**\n * Create the default implementation of {@link CallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultCallingHandlers: CreateDefaultCallingHandlers = memoizeOne((...args) => {\n const [callClient, callAgent, deviceManager, call, options] = args;\n /* @conditional-compile-remove(breakout-rooms) */\n const callState = call?.id ? callClient.getState().calls[call?.id] : undefined;\n /* @conditional-compile-remove(breakout-rooms) */\n const breakoutRoomOriginCallId = callState?.breakoutRooms?.breakoutRoomOriginCallId;\n /* @conditional-compile-remove(breakout-rooms) */\n const breakoutRoomOriginCall = callAgent?.calls.find((call) => call.id === breakoutRoomOriginCallId);\n const commonCallingHandlers = createDefaultCommonCallingHandlers(callClient, deviceManager, call, options);\n return {\n ...commonCallingHandlers,\n // FIXME: onStartCall API should use string, not the underlying SDK types.\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined => {\n return callAgent?.startCall(participants, options);\n },\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, options);\n } else if (isCommunicationUserIdentifier(participant) || isMicrosoftTeamsUserIdentifier(participant)) {\n call?.addParticipant(participant);\n }\n },\n onRemoveParticipant: async (userId: string | CommunicationIdentifier): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n await call?.removeParticipant(participant);\n },\n onAcceptCall: async (incomingCallId: string, useVideo?: boolean): Promise<void> => {\n const localVideoStream = useVideo ? await createLocalVideoStream(callClient) : undefined;\n const incomingCall = (callAgent as DeclarativeCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.accept(\n localVideoStream ? { videoOptions: { localVideoStreams: [localVideoStream] } } : undefined\n );\n }\n },\n onRejectCall: async (incomingCallId: string): Promise<void> => {\n const incomingCall = (callAgent as DeclarativeCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.reject();\n }\n },\n /* @conditional-compile-remove(breakout-rooms) */\n onHangUp: breakoutRoomOriginCall\n ? async () => breakoutRoomOriginCall.hangUp().then(() => commonCallingHandlers.onHangUp())\n : commonCallingHandlers.onHangUp\n };\n});\n\n/**\n * Handlers only for calling components\n * @internal\n */\nexport interface _ComponentCallingHandlers {\n /** VideoGallery callback prop to start local spotlight */\n onStartLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to stop local spotlight */\n onStopLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to start remote spotlight */\n onStartRemoteSpotlight: (userIds: string[]) => Promise<void>;\n /** VideoGallery callback prop to stop remote spotlight */\n onStopRemoteSpotlight: (userIds: string[]) => Promise<void>;\n}\n"]}
@@ -23,7 +23,6 @@ const convertRemoteParticipantsToParticipantListParticipants = (remoteParticipan
23
23
  // Filter out MicrosoftBot participants
24
24
  .filter((participant) => {
25
25
  return !isMicrosoftTeamsAppIdentifier(participant.identifier);
26
- return true;
27
26
  })
28
27
  /**
29
28
  * hiding participants who are inLobby, idle, or connecting in ACS clients till we can admit users through ACS clients.
@@ -1 +1 @@
1
- {"version":3,"file":"participantListSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/participantListSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,UAAU;AAEV,+CAA+C;AAC/C,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,oCAAoC,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC7G,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,uBAA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C/C,OAAO;QACL,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE,MAAM;QAChB,0DAA0D;QAC1D,qBAAqB,EAAE,qBAAqB;KAC7C,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,kCAAkC,GAAG,CAAC,IAAa,EAAW,EAAE;IACpE,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC;AAC1E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallClientState, RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { createSelector } from 'reselect';\nimport {\n getIdentifier,\n getDisplayName,\n getIsScreenSharingOn,\n getIsMuted,\n CallingBaseSelectorProps,\n /* @conditional-compile-remove(media-access) */\n getCapabilities\n} from './baseSelectors';\nimport { getRole } from './baseSelectors';\nimport { isHideAttendeeNamesEnabled } from './baseSelectors';\nimport { CallParticipantListParticipant } from '@internal/react-components';\nimport { _convertParticipantState, _updateUserDisplayNames } from './utils/callUtils';\nimport { memoizedConvertAllremoteParticipants } from './utils/participantListSelectorUtils';\nimport { memoizedConvertToVideoTileReaction, memoizedSpotlight } from './utils/participantListSelectorUtils';\nimport { getLocalParticipantRaisedHand } from './baseSelectors';\nimport { getLocalParticipantReactionState } from './baseSelectors';\nimport { getSpotlightCallFeature } from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { getParticipantCount } from './baseSelectors';\nimport { isMicrosoftTeamsAppIdentifier, isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { ParticipantRole, SpotlightedParticipant } from '@azure/communication-calling';\nimport { maskDisplayNameWithRole } from './utils/callUtils';\nimport { getRemoteParticipantsExcludingConsumers } from './getRemoteParticipantsExcludingConsumers';\n\nconst convertRemoteParticipantsToParticipantListParticipants = (\n remoteParticipants: RemoteParticipantState[],\n localUserCanRemoveOthers: boolean,\n isHideAttendeeNamesEnabled?: boolean,\n localUserRole?: ParticipantRole,\n spotlightedParticipants?: SpotlightedParticipant[]\n): CallParticipantListParticipant[] => {\n const conversionCallback = (\n memoizeFn: (...args: any[]) => CallParticipantListParticipant\n ): CallParticipantListParticipant[] => {\n return (\n remoteParticipants\n // Filter out MicrosoftBot participants\n .filter((participant: RemoteParticipantState) => {\n return !isMicrosoftTeamsAppIdentifier(participant.identifier);\n return true;\n })\n /**\n * hiding participants who are inLobby, idle, or connecting in ACS clients till we can admit users through ACS clients.\n * phone users will be in the connecting state until they are connected to the call.\n */\n .filter((participant) => {\n return (\n !['InLobby', 'Idle', 'Connecting', 'Disconnected'].includes(participant.state) ||\n isPhoneNumberIdentifier(participant.identifier)\n );\n })\n .map((participant: RemoteParticipantState) => {\n const isScreenSharing = Object.values(participant.videoStreams).some(\n (videoStream) => videoStream.mediaStreamType === 'ScreenSharing' && videoStream.isAvailable\n );\n /**\n * We want to check the participant to see if they are a PSTN participant joining the call\n * and mapping their state to be 'Ringing'\n */\n const state = _convertParticipantState(participant);\n const displayName = maskDisplayNameWithRole(\n participant.displayName,\n localUserRole,\n participant.role,\n isHideAttendeeNamesEnabled\n );\n const remoteParticipantReaction = memoizedConvertToVideoTileReaction(participant.reactionState);\n const spotlight = memoizedSpotlight(\n spotlightedParticipants,\n toFlatCommunicationIdentifier(participant.identifier)\n );\n\n return memoizeFn(\n toFlatCommunicationIdentifier(participant.identifier),\n displayName,\n state,\n participant.isMuted,\n isScreenSharing,\n participant.isSpeaking,\n participant.raisedHand,\n localUserCanRemoveOthers,\n remoteParticipantReaction,\n spotlight,\n /* @conditional-compile-remove(media-access) */\n participant.mediaAccess\n );\n })\n .sort((a, b) => {\n const nameA = a.displayName?.toLowerCase() || '';\n const nameB = b.displayName?.toLowerCase() || '';\n if (nameA < nameB) {\n return -1;\n } else if (nameA > nameB) {\n return 1;\n } else {\n return 0;\n }\n })\n );\n };\n return memoizedConvertAllremoteParticipants(conversionCallback);\n};\n\n/**\n * Selector type for {@link ParticipantList} component.\n *\n * @public\n */\nexport type ParticipantListSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n participants: CallParticipantListParticipant[];\n myUserId: string;\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount?: number;\n};\n\n/**\n * Selects data that drives {@link ParticipantList} component.\n *\n * @public\n */\nexport const participantListSelector: ParticipantListSelector = createSelector(\n [\n getIdentifier,\n getDisplayName,\n getRemoteParticipantsExcludingConsumers,\n getIsScreenSharingOn,\n getIsMuted,\n getLocalParticipantRaisedHand,\n getRole,\n getParticipantCount,\n isHideAttendeeNamesEnabled,\n getLocalParticipantReactionState,\n getSpotlightCallFeature,\n /* @conditional-compile-remove(media-access) */\n getCapabilities\n ],\n (\n userId,\n displayName,\n remoteParticipants,\n isScreenSharingOn,\n isMuted,\n raisedHand,\n role,\n partitipantCount,\n isHideAttendeeNamesEnabled,\n localParticipantReactionState,\n spotlightCallFeature,\n /* @conditional-compile-remove(media-access) */\n capabilities\n ): {\n participants: CallParticipantListParticipant[];\n myUserId: string;\n totalParticipantCount?: number;\n } => {\n const localUserCanRemoveOthers = localUserCanRemoveOthersTrampoline(role);\n const participants = remoteParticipants\n ? convertRemoteParticipantsToParticipantListParticipants(\n _updateUserDisplayNames(Object.values(remoteParticipants)),\n localUserCanRemoveOthers,\n isHideAttendeeNamesEnabled,\n role,\n spotlightCallFeature?.spotlightedParticipants\n )\n : [];\n participants.push({\n userId: userId,\n displayName: displayName,\n isScreenSharing: isScreenSharingOn,\n isMuted: isMuted,\n raisedHand: raisedHand,\n state: 'Connected',\n // Local participant can never remove themselves.\n isRemovable: false,\n reaction: memoizedConvertToVideoTileReaction(localParticipantReactionState),\n spotlight: memoizedSpotlight(spotlightCallFeature?.spotlightedParticipants, userId),\n /* @conditional-compile-remove(media-access) */\n mediaAccess: {\n isAudioPermitted: capabilities?.unmuteMic ? capabilities.unmuteMic.isPresent : true,\n isVideoPermitted: capabilities?.turnVideoOn ? capabilities.turnVideoOn.isPresent : true\n }\n });\n /* @conditional-compile-remove(total-participant-count) */\n const totalParticipantCount = partitipantCount;\n return {\n participants: participants,\n myUserId: userId,\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount: totalParticipantCount\n };\n }\n);\n\nconst localUserCanRemoveOthersTrampoline = (role?: string): boolean => {\n return role === 'Presenter' || role === 'Unknown' || role === undefined;\n};\n"]}
1
+ {"version":3,"file":"participantListSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/participantListSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,UAAU;AAEV,+CAA+C;AAC/C,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,oCAAoC,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC7G,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAErG,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,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AAkC,GAAG,CAAC,IAAa,EAAW,EAAE;IACpE,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC;AAC1E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallClientState, RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { createSelector } from 'reselect';\nimport {\n getIdentifier,\n getDisplayName,\n getIsScreenSharingOn,\n getIsMuted,\n CallingBaseSelectorProps,\n /* @conditional-compile-remove(media-access) */\n getCapabilities\n} from './baseSelectors';\nimport { getRole } from './baseSelectors';\nimport { isHideAttendeeNamesEnabled } from './baseSelectors';\nimport { CallParticipantListParticipant } from '@internal/react-components';\nimport { _convertParticipantState, _updateUserDisplayNames } from './utils/callUtils';\nimport { memoizedConvertAllremoteParticipants } from './utils/participantListSelectorUtils';\nimport { memoizedConvertToVideoTileReaction, memoizedSpotlight } from './utils/participantListSelectorUtils';\nimport { getLocalParticipantRaisedHand } from './baseSelectors';\nimport { getLocalParticipantReactionState } from './baseSelectors';\nimport { getSpotlightCallFeature } from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { getParticipantCount } from './baseSelectors';\nimport { isMicrosoftTeamsAppIdentifier, isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { ParticipantRole, SpotlightedParticipant } from '@azure/communication-calling';\nimport { maskDisplayNameWithRole } from './utils/callUtils';\nimport { getRemoteParticipantsExcludingConsumers } from './getRemoteParticipantsExcludingConsumers';\n\nconst convertRemoteParticipantsToParticipantListParticipants = (\n remoteParticipants: RemoteParticipantState[],\n localUserCanRemoveOthers: boolean,\n isHideAttendeeNamesEnabled?: boolean,\n localUserRole?: ParticipantRole,\n spotlightedParticipants?: SpotlightedParticipant[]\n): CallParticipantListParticipant[] => {\n const conversionCallback = (\n memoizeFn: (...args: any[]) => CallParticipantListParticipant\n ): CallParticipantListParticipant[] => {\n return (\n remoteParticipants\n // Filter out MicrosoftBot participants\n .filter((participant: RemoteParticipantState) => {\n return !isMicrosoftTeamsAppIdentifier(participant.identifier);\n })\n /**\n * hiding participants who are inLobby, idle, or connecting in ACS clients till we can admit users through ACS clients.\n * phone users will be in the connecting state until they are connected to the call.\n */\n .filter((participant) => {\n return (\n !['InLobby', 'Idle', 'Connecting', 'Disconnected'].includes(participant.state) ||\n isPhoneNumberIdentifier(participant.identifier)\n );\n })\n .map((participant: RemoteParticipantState) => {\n const isScreenSharing = Object.values(participant.videoStreams).some(\n (videoStream) => videoStream.mediaStreamType === 'ScreenSharing' && videoStream.isAvailable\n );\n /**\n * We want to check the participant to see if they are a PSTN participant joining the call\n * and mapping their state to be 'Ringing'\n */\n const state = _convertParticipantState(participant);\n const displayName = maskDisplayNameWithRole(\n participant.displayName,\n localUserRole,\n participant.role,\n isHideAttendeeNamesEnabled\n );\n const remoteParticipantReaction = memoizedConvertToVideoTileReaction(participant.reactionState);\n const spotlight = memoizedSpotlight(\n spotlightedParticipants,\n toFlatCommunicationIdentifier(participant.identifier)\n );\n\n return memoizeFn(\n toFlatCommunicationIdentifier(participant.identifier),\n displayName,\n state,\n participant.isMuted,\n isScreenSharing,\n participant.isSpeaking,\n participant.raisedHand,\n localUserCanRemoveOthers,\n remoteParticipantReaction,\n spotlight,\n /* @conditional-compile-remove(media-access) */\n participant.mediaAccess\n );\n })\n .sort((a, b) => {\n const nameA = a.displayName?.toLowerCase() || '';\n const nameB = b.displayName?.toLowerCase() || '';\n if (nameA < nameB) {\n return -1;\n } else if (nameA > nameB) {\n return 1;\n } else {\n return 0;\n }\n })\n );\n };\n return memoizedConvertAllremoteParticipants(conversionCallback);\n};\n\n/**\n * Selector type for {@link ParticipantList} component.\n *\n * @public\n */\nexport type ParticipantListSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n participants: CallParticipantListParticipant[];\n myUserId: string;\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount?: number;\n};\n\n/**\n * Selects data that drives {@link ParticipantList} component.\n *\n * @public\n */\nexport const participantListSelector: ParticipantListSelector = createSelector(\n [\n getIdentifier,\n getDisplayName,\n getRemoteParticipantsExcludingConsumers,\n getIsScreenSharingOn,\n getIsMuted,\n getLocalParticipantRaisedHand,\n getRole,\n getParticipantCount,\n isHideAttendeeNamesEnabled,\n getLocalParticipantReactionState,\n getSpotlightCallFeature,\n /* @conditional-compile-remove(media-access) */\n getCapabilities\n ],\n (\n userId,\n displayName,\n remoteParticipants,\n isScreenSharingOn,\n isMuted,\n raisedHand,\n role,\n partitipantCount,\n isHideAttendeeNamesEnabled,\n localParticipantReactionState,\n spotlightCallFeature,\n /* @conditional-compile-remove(media-access) */\n capabilities\n ): {\n participants: CallParticipantListParticipant[];\n myUserId: string;\n totalParticipantCount?: number;\n } => {\n const localUserCanRemoveOthers = localUserCanRemoveOthersTrampoline(role);\n const participants = remoteParticipants\n ? convertRemoteParticipantsToParticipantListParticipants(\n _updateUserDisplayNames(Object.values(remoteParticipants)),\n localUserCanRemoveOthers,\n isHideAttendeeNamesEnabled,\n role,\n spotlightCallFeature?.spotlightedParticipants\n )\n : [];\n participants.push({\n userId: userId,\n displayName: displayName,\n isScreenSharing: isScreenSharingOn,\n isMuted: isMuted,\n raisedHand: raisedHand,\n state: 'Connected',\n // Local participant can never remove themselves.\n isRemovable: false,\n reaction: memoizedConvertToVideoTileReaction(localParticipantReactionState),\n spotlight: memoizedSpotlight(spotlightCallFeature?.spotlightedParticipants, userId),\n /* @conditional-compile-remove(media-access) */\n mediaAccess: {\n isAudioPermitted: capabilities?.unmuteMic ? capabilities.unmuteMic.isPresent : true,\n isVideoPermitted: capabilities?.turnVideoOn ? capabilities.turnVideoOn.isPresent : true\n }\n });\n /* @conditional-compile-remove(total-participant-count) */\n const totalParticipantCount = partitipantCount;\n return {\n participants: participants,\n myUserId: userId,\n /* @conditional-compile-remove(total-participant-count) */\n totalParticipantCount: totalParticipantCount\n };\n }\n);\n\nconst localUserCanRemoveOthersTrampoline = (role?: string): boolean => {\n return role === 'Presenter' || role === 'Unknown' || role === undefined;\n};\n"]}
@@ -125,7 +125,6 @@ export const getAttachmentCountLiveMessage = (attachments, attachmentCardGroupMe
125
125
  return _formatString(attachmentCardGroupMessage, {
126
126
  attachmentCount: `${attachments.length}`
127
127
  });
128
- return '';
129
128
  };
130
129
  const defaultOnRenderInlineImage = (inlineImage) => {
131
130
  return (React.createElement("img", Object.assign({ key: inlineImage.imageAttributes.id, tabIndex: 0, "data-ui-id": inlineImage.imageAttributes.id }, inlineImage.imageAttributes)));
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMessageContent.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/ChatMessage/ChatMessageContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsB,aAAa,EAAE,sCAAgC;AAC5E,OAAO,KAAK,EAAE,EAA0B,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,OAAO,MAAM,eAAe,CAAC;AAIpC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAIvC,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,0CAA0C;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,uDAAuD;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAmD1E,eAAe;AACf,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAe,EAAE;IAChF,QAAQ,KAA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AC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { AttachmentMetadata, _formatString } from '@internal/acs-ui-common';\nimport parse, { HTMLReactParserOptions, Element as DOMElement } from 'html-react-parser';\nimport { attributesToProps } from 'html-react-parser';\nimport Linkify from 'react-linkify';\nimport { ChatMessage } from '../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../types/ChatMessage';\nimport { Link } from '@fluentui/react';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions, Mention } from '../MentionPopover';\n\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { FontIcon, Stack } from '@fluentui/react';\nimport { MessageThreadStrings } from '../MessageThread';\nimport LiveMessage from '../Announcer/LiveMessage';\n/* @conditional-compile-remove(mention) */\nimport { defaultOnMentionRender } from './MentionRenderer';\nimport DOMPurify from 'dompurify';\nimport { _AttachmentDownloadCardsStrings } from '../Attachment/AttachmentDownloadCards';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { dataLossIconStyle } from '../styles/MessageThread.styles';\nimport { messageTextContentStyles } from '../styles/MessageThread.styles';\n\ntype ChatMessageContentProps = {\n message: ChatMessage;\n strings: MessageThreadStrings;\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions?: MentionDisplayOptions;\n inlineImageOptions?: InlineImageOptions;\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\ntype BlockedMessageContentProps = {\n message: BlockedMessage;\n strings: MessageThreadStrings;\n};\n\ntype MessageContentWithLiveAriaProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n liveMessage: string;\n ariaLabel?: string;\n content: JSX.Element;\n className?: string;\n};\n\n/**\n * InlineImage's state, as reflected in the UI.\n *\n * @public\n */\nexport interface InlineImage {\n /** ID of the message that the inline image is belonged to */\n messageId: string;\n /** Attributes of the inline image */\n imageAttributes: React.ImgHTMLAttributes<HTMLImageElement>;\n}\n\n/**\n * Options to display inline image in the inline image scenario.\n *\n * @public\n */\nexport interface InlineImageOptions {\n /**\n * Optional callback to render an inline image of in a message.\n */\n onRenderInlineImage?: (\n inlineImage: InlineImage,\n defaultOnRender: (inlineImage: InlineImage) => JSX.Element\n ) => JSX.Element;\n}\n\n/** @private */\nexport const ChatMessageContent = (props: ChatMessageContentProps): JSX.Element => {\n switch (props.message.contentType) {\n case 'text':\n return MessageContentAsText(props);\n case 'html':\n return MessageContentAsRichTextHTML(props);\n case 'richtext/html':\n return MessageContentAsRichTextHTML(props);\n default:\n console.warn('unknown message content type');\n return <></>;\n }\n};\n\nconst MessageContentWithLiveAria = (props: MessageContentWithLiveAriaProps): JSX.Element => {\n return (\n <div data-ui-status={props.message.status} role=\"text\" aria-label={props.ariaLabel} className={props.className}>\n <LiveMessage message={props.liveMessage} ariaLive=\"polite\" />\n {props.content}\n </div>\n );\n};\n\nconst MessageContentAsRichTextHTML = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n content={processHtmlToReact(props)}\n />\n );\n};\n\nconst MessageContentAsText = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n className={messageTextContentStyles}\n content={\n <Linkify\n componentDecorator={(decoratedHref: string, decoratedText: string, key: number) => {\n return (\n <Link target=\"_blank\" href={decoratedHref} key={key}>\n {decoratedText}\n </Link>\n );\n }}\n >\n {props.message.content}\n </Linkify>\n }\n />\n );\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\n/**\n * @private\n */\nexport const BlockedMessageContent = (props: BlockedMessageContentProps): JSX.Element => {\n const Icon: JSX.Element = <FontIcon className={dataLossIconStyle} iconName={'DataLossPreventionProhibited'} />;\n const blockedMessage =\n props.message.warningText === undefined ? props.strings.blockedWarningText : props.message.warningText;\n const blockedMessageLink = props.message.link;\n const blockedMessageLinkText = blockedMessageLink\n ? props.message.linkText ?? props.strings.blockedWarningLinkText\n : '';\n\n const liveAuthor =\n props.message.mine || props.message.senderDisplayName === undefined ? '' : props.message.senderDisplayName;\n const liveBlockedWarningText = `${liveAuthor} ${blockedMessage} ${blockedMessageLinkText}`;\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={liveBlockedWarningText}\n ariaLabel={liveBlockedWarningText}\n content={\n <Stack horizontal wrap>\n {Icon}\n {blockedMessage && <p>{blockedMessage}</p>}\n {blockedMessageLink && (\n <Link target={'_blank'} href={blockedMessageLink}>\n {blockedMessageLinkText}\n </Link>\n )}\n </Stack>\n }\n />\n );\n};\n\nconst extractContentForAllyMessage = (props: ChatMessageContentProps): string => {\n if (props.message.content || props.message.attachments) {\n // Replace all <img> tags with 'image' for aria.\n const parsedContent = DOMPurify.sanitize(props.message.content ?? '', {\n ALLOWED_TAGS: ['img'],\n RETURN_DOM_FRAGMENT: true\n });\n\n parsedContent.childNodes.forEach((child) => {\n if (child.nodeName.toLowerCase() !== 'img') {\n return;\n }\n const imageTextNode = document.createElement('div');\n imageTextNode.innerHTML = 'image ';\n parsedContent.replaceChild(imageTextNode, child);\n });\n\n // Inject message attachment count for aria.\n // this is only applying to file attachments not for inline images.\n if (props.message.attachments && props.message.attachments.length > 0) {\n const attachmentCardDescription = attachmentCardGroupDescription(props);\n const attachmentTextNode = document.createElement('div');\n attachmentTextNode.innerHTML = `${attachmentCardDescription}`;\n parsedContent.appendChild(attachmentTextNode);\n }\n\n // Strip all html tags from the content for aria.\n let message = DOMPurify.sanitize(parsedContent, { ALLOWED_TAGS: [] });\n // decode HTML entities so that screen reader can read the content properly.\n message = decodeEntities(message);\n return message;\n }\n return '';\n};\n\nconst generateLiveMessage = (props: ChatMessageContentProps): string => {\n const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });\n\n return `${props.message.editedOn ? props.strings.editedTag : ''} ${\n props.message.mine ? '' : liveAuthor\n } ${extractContentForAllyMessage(props)} `;\n};\n\nconst messageContentAriaText = (props: ChatMessageContentProps): string | undefined => {\n const message = extractContentForAllyMessage(props);\n return props.message.mine\n ? _formatString(props.strings.messageContentMineAriaText, {\n status: props.message.status ?? '',\n message: message\n })\n : _formatString(props.strings.messageContentAriaText, {\n status: props.message.status ?? '',\n author: `${props.message.senderDisplayName}`,\n message: message\n });\n};\n\nconst attachmentCardGroupDescription = (props: ChatMessageContentProps): string => {\n const attachments = props.message.attachments;\n return getAttachmentCountLiveMessage(attachments ?? [], props.strings.attachmentCardGroupMessage);\n};\n\n/**\n * @private\n */\nexport const getAttachmentCountLiveMessage = (\n attachments: AttachmentMetadata[],\n attachmentCardGroupMessage: string\n): string => {\n if (attachments.length === 0) {\n return '';\n }\n return _formatString(attachmentCardGroupMessage, {\n attachmentCount: `${attachments.length}`\n });\n return '';\n};\n\nconst defaultOnRenderInlineImage = (inlineImage: InlineImage): JSX.Element => {\n return (\n <img\n key={inlineImage.imageAttributes.id}\n tabIndex={0}\n data-ui-id={inlineImage.imageAttributes.id}\n {...inlineImage.imageAttributes}\n />\n );\n};\n\nconst processHtmlToReact = (props: ChatMessageContentProps): JSX.Element => {\n const options: HTMLReactParserOptions = {\n transform(reactNode, domNode) {\n if (domNode instanceof DOMElement && domNode.attribs) {\n // Transform custom rendering of mentions\n /* @conditional-compile-remove(mention) */\n if (domNode.name === 'msft-mention' && domNode.attribs.id) {\n const { id } = domNode.attribs;\n const mention: Mention = {\n id: id,\n displayText: (domNode.children[0] as unknown as Text).nodeValue ?? ''\n };\n if (props.mentionDisplayOptions?.onRenderMention) {\n return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);\n }\n return defaultOnMentionRender(mention);\n }\n\n // Transform inline images\n if (domNode.name && domNode.name === 'img' && domNode.attribs && domNode.attribs.id) {\n if (domNode.attribs.name) {\n domNode.attribs['aria-label'] = domNode.attribs.name;\n }\n const imgProps = attributesToProps(domNode.attribs);\n const inlineImageProps: InlineImage = { messageId: props.message.messageId, imageAttributes: imgProps };\n\n return props.inlineImageOptions?.onRenderInlineImage\n ? props.inlineImageOptions.onRenderInlineImage(inlineImageProps, defaultOnRenderInlineImage)\n : defaultOnRenderInlineImage(inlineImageProps);\n }\n\n // Transform links to open in new tab\n if (domNode.name === 'a' && React.isValidElement<React.AnchorHTMLAttributes<HTMLAnchorElement>>(reactNode)) {\n return React.cloneElement(reactNode, {\n target: '_blank',\n rel: 'noreferrer noopener'\n });\n }\n }\n // Pass through the original node\n return reactNode as unknown as JSX.Element;\n }\n };\n return <>{parse(props.message.content ?? '', options)}</>;\n};\n\nconst decodeEntities = (encodedString: string): string => {\n // This regular expression matches HTML entities.\n const translate_re = /&(nbsp|amp|quot|lt|gt);/g;\n // This object maps HTML entities to their respective characters.\n const translate: Record<string, string> = {\n nbsp: ' ',\n amp: '&',\n quot: '\"',\n lt: '<',\n gt: '>'\n };\n\n return (\n encodedString\n // Find all matches of HTML entities defined in translate_re and\n // replace them with the corresponding character from the translate object.\n .replace(translate_re, function (match, entity) {\n return translate[entity] ?? match;\n })\n // Find numeric entities (e.g., &#65;)\n // and replace them with the equivalent character using the String.fromCharCode method,\n // which converts Unicode values into characters.\n .replace(/&#(\\d+);/gi, function (match, numStr) {\n const num = parseInt(numStr, 10);\n return String.fromCharCode(num);\n })\n );\n};\n"]}
1
+ {"version":3,"file":"ChatMessageContent.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/ChatMessage/ChatMessageContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsB,aAAa,EAAE,sCAAgC;AAC5E,OAAO,KAAK,EAAE,EAA0B,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,OAAO,MAAM,eAAe,CA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E,GAAG;KACR,CAAC;IAEF,OAAO,CACL,aAAa;QACX,gEAAgE;QAChE,2EAA2E;SAC1E,OAAO,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,MAAM;;QAC5C,OAAO,MAAA,SAAS,CAAC,MAAM,CAAC,mCAAI,KAAK,CAAC;IACpC,CAAC,CAAC;QACF,sCAAsC;QACtC,uFAAuF;QACvF,iDAAiD;SAChD,OAAO,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,MAAM;QAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { AttachmentMetadata, _formatString } from '@internal/acs-ui-common';\nimport parse, { HTMLReactParserOptions, Element as DOMElement } from 'html-react-parser';\nimport { attributesToProps } from 'html-react-parser';\nimport Linkify from 'react-linkify';\nimport { ChatMessage } from '../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../types/ChatMessage';\nimport { Link } from '@fluentui/react';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions, Mention } from '../MentionPopover';\n\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { FontIcon, Stack } from '@fluentui/react';\nimport { MessageThreadStrings } from '../MessageThread';\nimport LiveMessage from '../Announcer/LiveMessage';\n/* @conditional-compile-remove(mention) */\nimport { defaultOnMentionRender } from './MentionRenderer';\nimport DOMPurify from 'dompurify';\nimport { _AttachmentDownloadCardsStrings } from '../Attachment/AttachmentDownloadCards';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { dataLossIconStyle } from '../styles/MessageThread.styles';\nimport { messageTextContentStyles } from '../styles/MessageThread.styles';\n\ntype ChatMessageContentProps = {\n message: ChatMessage;\n strings: MessageThreadStrings;\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions?: MentionDisplayOptions;\n inlineImageOptions?: InlineImageOptions;\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\ntype BlockedMessageContentProps = {\n message: BlockedMessage;\n strings: MessageThreadStrings;\n};\n\ntype MessageContentWithLiveAriaProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n liveMessage: string;\n ariaLabel?: string;\n content: JSX.Element;\n className?: string;\n};\n\n/**\n * InlineImage's state, as reflected in the UI.\n *\n * @public\n */\nexport interface InlineImage {\n /** ID of the message that the inline image is belonged to */\n messageId: string;\n /** Attributes of the inline image */\n imageAttributes: React.ImgHTMLAttributes<HTMLImageElement>;\n}\n\n/**\n * Options to display inline image in the inline image scenario.\n *\n * @public\n */\nexport interface InlineImageOptions {\n /**\n * Optional callback to render an inline image of in a message.\n */\n onRenderInlineImage?: (\n inlineImage: InlineImage,\n defaultOnRender: (inlineImage: InlineImage) => JSX.Element\n ) => JSX.Element;\n}\n\n/** @private */\nexport const ChatMessageContent = (props: ChatMessageContentProps): JSX.Element => {\n switch (props.message.contentType) {\n case 'text':\n return MessageContentAsText(props);\n case 'html':\n return MessageContentAsRichTextHTML(props);\n case 'richtext/html':\n return MessageContentAsRichTextHTML(props);\n default:\n console.warn('unknown message content type');\n return <></>;\n }\n};\n\nconst MessageContentWithLiveAria = (props: MessageContentWithLiveAriaProps): JSX.Element => {\n return (\n <div data-ui-status={props.message.status} role=\"text\" aria-label={props.ariaLabel} className={props.className}>\n <LiveMessage message={props.liveMessage} ariaLive=\"polite\" />\n {props.content}\n </div>\n );\n};\n\nconst MessageContentAsRichTextHTML = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n content={processHtmlToReact(props)}\n />\n );\n};\n\nconst MessageContentAsText = (props: ChatMessageContentProps): JSX.Element => {\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={generateLiveMessage(props)}\n ariaLabel={messageContentAriaText(props)}\n className={messageTextContentStyles}\n content={\n <Linkify\n componentDecorator={(decoratedHref: string, decoratedText: string, key: number) => {\n return (\n <Link target=\"_blank\" href={decoratedHref} key={key}>\n {decoratedText}\n </Link>\n );\n }}\n >\n {props.message.content}\n </Linkify>\n }\n />\n );\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\n/**\n * @private\n */\nexport const BlockedMessageContent = (props: BlockedMessageContentProps): JSX.Element => {\n const Icon: JSX.Element = <FontIcon className={dataLossIconStyle} iconName={'DataLossPreventionProhibited'} />;\n const blockedMessage =\n props.message.warningText === undefined ? props.strings.blockedWarningText : props.message.warningText;\n const blockedMessageLink = props.message.link;\n const blockedMessageLinkText = blockedMessageLink\n ? props.message.linkText ?? props.strings.blockedWarningLinkText\n : '';\n\n const liveAuthor =\n props.message.mine || props.message.senderDisplayName === undefined ? '' : props.message.senderDisplayName;\n const liveBlockedWarningText = `${liveAuthor} ${blockedMessage} ${blockedMessageLinkText}`;\n return (\n <MessageContentWithLiveAria\n message={props.message}\n liveMessage={liveBlockedWarningText}\n ariaLabel={liveBlockedWarningText}\n content={\n <Stack horizontal wrap>\n {Icon}\n {blockedMessage && <p>{blockedMessage}</p>}\n {blockedMessageLink && (\n <Link target={'_blank'} href={blockedMessageLink}>\n {blockedMessageLinkText}\n </Link>\n )}\n </Stack>\n }\n />\n );\n};\n\nconst extractContentForAllyMessage = (props: ChatMessageContentProps): string => {\n if (props.message.content || props.message.attachments) {\n // Replace all <img> tags with 'image' for aria.\n const parsedContent = DOMPurify.sanitize(props.message.content ?? '', {\n ALLOWED_TAGS: ['img'],\n RETURN_DOM_FRAGMENT: true\n });\n\n parsedContent.childNodes.forEach((child) => {\n if (child.nodeName.toLowerCase() !== 'img') {\n return;\n }\n const imageTextNode = document.createElement('div');\n imageTextNode.innerHTML = 'image ';\n parsedContent.replaceChild(imageTextNode, child);\n });\n\n // Inject message attachment count for aria.\n // this is only applying to file attachments not for inline images.\n if (props.message.attachments && props.message.attachments.length > 0) {\n const attachmentCardDescription = attachmentCardGroupDescription(props);\n const attachmentTextNode = document.createElement('div');\n attachmentTextNode.innerHTML = `${attachmentCardDescription}`;\n parsedContent.appendChild(attachmentTextNode);\n }\n\n // Strip all html tags from the content for aria.\n let message = DOMPurify.sanitize(parsedContent, { ALLOWED_TAGS: [] });\n // decode HTML entities so that screen reader can read the content properly.\n message = decodeEntities(message);\n return message;\n }\n return '';\n};\n\nconst generateLiveMessage = (props: ChatMessageContentProps): string => {\n const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });\n\n return `${props.message.editedOn ? props.strings.editedTag : ''} ${\n props.message.mine ? '' : liveAuthor\n } ${extractContentForAllyMessage(props)} `;\n};\n\nconst messageContentAriaText = (props: ChatMessageContentProps): string | undefined => {\n const message = extractContentForAllyMessage(props);\n return props.message.mine\n ? _formatString(props.strings.messageContentMineAriaText, {\n status: props.message.status ?? '',\n message: message\n })\n : _formatString(props.strings.messageContentAriaText, {\n status: props.message.status ?? '',\n author: `${props.message.senderDisplayName}`,\n message: message\n });\n};\n\nconst attachmentCardGroupDescription = (props: ChatMessageContentProps): string => {\n const attachments = props.message.attachments;\n return getAttachmentCountLiveMessage(attachments ?? [], props.strings.attachmentCardGroupMessage);\n};\n\n/**\n * @private\n */\nexport const getAttachmentCountLiveMessage = (\n attachments: AttachmentMetadata[],\n attachmentCardGroupMessage: string\n): string => {\n if (attachments.length === 0) {\n return '';\n }\n return _formatString(attachmentCardGroupMessage, {\n attachmentCount: `${attachments.length}`\n });\n};\n\nconst defaultOnRenderInlineImage = (inlineImage: InlineImage): JSX.Element => {\n return (\n <img\n key={inlineImage.imageAttributes.id}\n tabIndex={0}\n data-ui-id={inlineImage.imageAttributes.id}\n {...inlineImage.imageAttributes}\n />\n );\n};\n\nconst processHtmlToReact = (props: ChatMessageContentProps): JSX.Element => {\n const options: HTMLReactParserOptions = {\n transform(reactNode, domNode) {\n if (domNode instanceof DOMElement && domNode.attribs) {\n // Transform custom rendering of mentions\n /* @conditional-compile-remove(mention) */\n if (domNode.name === 'msft-mention' && domNode.attribs.id) {\n const { id } = domNode.attribs;\n const mention: Mention = {\n id: id,\n displayText: (domNode.children[0] as unknown as Text).nodeValue ?? ''\n };\n if (props.mentionDisplayOptions?.onRenderMention) {\n return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);\n }\n return defaultOnMentionRender(mention);\n }\n\n // Transform inline images\n if (domNode.name && domNode.name === 'img' && domNode.attribs && domNode.attribs.id) {\n if (domNode.attribs.name) {\n domNode.attribs['aria-label'] = domNode.attribs.name;\n }\n const imgProps = attributesToProps(domNode.attribs);\n const inlineImageProps: InlineImage = { messageId: props.message.messageId, imageAttributes: imgProps };\n\n return props.inlineImageOptions?.onRenderInlineImage\n ? props.inlineImageOptions.onRenderInlineImage(inlineImageProps, defaultOnRenderInlineImage)\n : defaultOnRenderInlineImage(inlineImageProps);\n }\n\n // Transform links to open in new tab\n if (domNode.name === 'a' && React.isValidElement<React.AnchorHTMLAttributes<HTMLAnchorElement>>(reactNode)) {\n return React.cloneElement(reactNode, {\n target: '_blank',\n rel: 'noreferrer noopener'\n });\n }\n }\n // Pass through the original node\n return reactNode as unknown as JSX.Element;\n }\n };\n return <>{parse(props.message.content ?? '', options)}</>;\n};\n\nconst decodeEntities = (encodedString: string): string => {\n // This regular expression matches HTML entities.\n const translate_re = /&(nbsp|amp|quot|lt|gt);/g;\n // This object maps HTML entities to their respective characters.\n const translate: Record<string, string> = {\n nbsp: ' ',\n amp: '&',\n quot: '\"',\n lt: '<',\n gt: '>'\n };\n\n return (\n encodedString\n // Find all matches of HTML entities defined in translate_re and\n // replace them with the corresponding character from the translate object.\n .replace(translate_re, function (match, entity) {\n return translate[entity] ?? match;\n })\n // Find numeric entities (e.g., &#65;)\n // and replace them with the equivalent character using the String.fromCharCode method,\n // which converts Unicode values into characters.\n .replace(/&#(\\d+);/gi, function (match, numStr) {\n const num = parseInt(numStr, 10);\n return String.fromCharCode(num);\n })\n );\n};\n"]}
@@ -86,6 +86,7 @@ export type ChatMyMessageComponentProps = {
86
86
  onRemoveInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;
87
87
  onInsertInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;
88
88
  inlineImagesWithProgress?: AttachmentMetadataInProgress[];
89
+ onEditComplete?: () => void;
89
90
  };
90
91
  /**
91
92
  * @private
@@ -19,7 +19,7 @@ import { removeBrokenImageContentAndClearImageSizeStyles } from '../../utils/Sen
19
19
  */
20
20
  export const ChatMyMessageComponent = (props) => {
21
21
  var _a, _b;
22
- const { onDeleteMessage, onSendMessage, message } = props;
22
+ const { onDeleteMessage, onSendMessage, message, onEditComplete, onCancelEditMessage, onUpdateMessage } = props;
23
23
  const [isEditing, setIsEditing] = useState(false);
24
24
  const onEditClick = useCallback(() => setIsEditing(true), [setIsEditing]);
25
25
  const clientMessageId = 'clientMessageId' in message ? message.clientMessageId : undefined;
@@ -66,19 +66,20 @@ export const ChatMyMessageComponent = (props) => {
66
66
  if (`attachments` in message && attachments) {
67
67
  message.attachments = attachments;
68
68
  }
69
- props.onUpdateMessage &&
70
- message.messageId &&
71
- (yield props.onUpdateMessage(message.messageId, text,
72
- /* @conditional-compile-remove(file-sharing-acs) */
73
- { attachments: attachments }));
69
+ yield (onUpdateMessage === null || onUpdateMessage === void 0 ? void 0 : onUpdateMessage(message.messageId, text,
70
+ /* @conditional-compile-remove(file-sharing-acs) */
71
+ { attachments: attachments }));
74
72
  setIsEditing(false);
73
+ onEditComplete === null || onEditComplete === void 0 ? void 0 : onEditComplete();
75
74
  });
76
- }, [message, props]);
75
+ }, [message, onEditComplete, onUpdateMessage]);
76
+ const onCancelHandler = useCallback((messageId) => {
77
+ onCancelEditMessage === null || onCancelEditMessage === void 0 ? void 0 : onCancelEditMessage(messageId);
78
+ setIsEditing(false);
79
+ onEditComplete === null || onEditComplete === void 0 ? void 0 : onEditComplete();
80
+ }, [onEditComplete, onCancelEditMessage]);
77
81
  if (isEditing && message.messageType === 'chat') {
78
- return (React.createElement(ChatMessageComponentAsEditBoxPicker, { message: message, strings: props.strings, onSubmit: onSubmitHandler, onCancel: (messageId) => {
79
- props.onCancelEditMessage && props.onCancelEditMessage(messageId);
80
- setIsEditing(false);
81
- },
82
+ return (React.createElement(ChatMessageComponentAsEditBoxPicker, { message: message, strings: props.strings, onSubmit: onSubmitHandler, onCancel: onCancelHandler,
82
83
  /* @conditional-compile-remove(mention) */
83
84
  mentionLookupOptions: (_a = props.mentionOptions) === null || _a === void 0 ? void 0 : _a.lookupOptions,
84
85
  /* @conditional-compile-remove(rich-text-editor) */
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAcrD,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,gEAAgE;AAChE,OAAO,EAAE,+CAA+C,EAAE,MAAM,0BAA0B,CAAC;AA2F3F;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAe,EAAE;;IACxF,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CA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KAAK,CAAC,wBAAwB;YACxD,gEAAgE;YAChE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,GAC9C,CACH,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CACL,oBAAC,qCAAqC,oBAChC,KAAK,IACT,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,0DAA0D;YAC1D,uBAAuB,EAAE,KAAK,CAAC,uBAAuB,EACtD,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,0CAA0C;YAC1C,qBAAqB,EAAE,MAAA,KAAK,CAAC,cAAc,0CAAE,cAAc,IAC3D,CACH,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useState } from 'react';\nimport { MessageThreadStrings, UpdateMessageCallback } from '../../MessageThread';\nimport { ChatMessage, ComponentSlotStyle, OnRenderAvatarCallback } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\nimport { AttachmentMenuAction } from '../../../types/Attachment';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from '../../MentionPopover';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMyMessageComponentAsMessageBubble } from './ChatMyMessageComponentAsMessageBubble';\nimport { ChatMessageComponentAsEditBoxPicker } from './ChatMessageComponentAsEditBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { removeBrokenImageContentAndClearImageSizeStyles } from '../../utils/SendBoxUtils';\n\n/**\n * Props for the ChatMyMessageComponent component.\n */\nexport type ChatMyMessageComponentProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n userId: string;\n messageContainerStyle?: ComponentSlotStyle;\n showDate?: boolean;\n disableEditing?: boolean;\n onUpdateMessage?: UpdateMessageCallback;\n onCancelEditMessage?: (messageId: string) => void;\n /**\n * Callback to delete a message. Also called before resending a message that failed to send.\n * @param messageId ID of the message to delete\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n /**\n * Callback to send a message\n * @param content The message content to send\n */\n onSendMessage?: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n strings: MessageThreadStrings;\n messageStatus?: string;\n /**\n * Optional text to display when the message status is 'failed'.\n */\n failureReason?: string;\n /**\n * Whether the status indicator for each message is displayed or not.\n */\n showMessageStatus?: boolean;\n /**\n * Whether to overlap avatar and message when the view is width constrained.\n */\n shouldOverlapAvatarAndMessage: boolean;\n remoteParticipantsCount?: number;\n onActionButtonClick: (\n message: ChatMessage,\n setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void\n ) => void;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /* @conditional-compile-remove(date-time-customization) */\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to lookup suggestions and display mentions in the mention scenario.\n * @beta\n */\n mentionOptions?: MentionOptions;\n /**\n * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\n /**\n * Optional callback to render message attachments in the message component.\n * @beta\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to define custom actions for attachments.\n * @beta\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled?: boolean;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress?: AttachmentMetadataInProgress[];\n};\n\n/**\n * @private\n */\nexport const ChatMyMessageComponent = (props: ChatMyMessageComponentProps): JSX.Element => {\n const { onDeleteMessage, onSendMessage, message } = props;\n const [isEditing, setIsEditing] = useState(false);\n\n const onEditClick = useCallback(() => setIsEditing(true), [setIsEditing]);\n\n const clientMessageId = 'clientMessageId' in message ? message.clientMessageId : undefined;\n const content = 'content' in message ? message.content : undefined;\n const onRemoveClick = useCallback(() => {\n if (onDeleteMessage && message.messageId) {\n onDeleteMessage(message.messageId);\n }\n // when fail to send, message does not have message id, delete message using clientMessageId\n else if (onDeleteMessage && message.messageType === 'chat' && clientMessageId) {\n onDeleteMessage(clientMessageId);\n }\n }, [onDeleteMessage, message.messageId, message.messageType, clientMessageId]);\n\n const onResendClick = useCallback(() => {\n onDeleteMessage && clientMessageId && onDeleteMessage(clientMessageId);\n let newContent = content ?? '';\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n newContent = removeBrokenImageContentAndClearImageSizeStyles(newContent);\n onSendMessage &&\n onSendMessage(\n newContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n {\n /* @conditional-compile-remove(file-sharing-acs) */ attachments:\n `attachments` in message ? message.attachments : undefined,\n /* @conditional-compile-remove(rich-text-editor) */\n type: props.isRichTextEditorEnabled ? 'html' : 'text'\n }\n );\n }, [\n message,\n onDeleteMessage,\n clientMessageId,\n onSendMessage,\n content,\n /* @conditional-compile-remove(rich-text-editor) */ props.isRichTextEditorEnabled\n ]);\n\n const onSubmitHandler = useCallback(\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n async function (\n text: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments?: AttachmentMetadata[] | undefined\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n if (`attachments` in message && attachments) {\n message.attachments = attachments;\n }\n props.onUpdateMessage &&\n message.messageId &&\n (await props.onUpdateMessage(\n message.messageId,\n text,\n /* @conditional-compile-remove(file-sharing-acs) */\n { attachments: attachments }\n ));\n setIsEditing(false);\n },\n [message, props]\n );\n if (isEditing && message.messageType === 'chat') {\n return (\n <ChatMessageComponentAsEditBoxPicker\n message={message}\n strings={props.strings}\n onSubmit={onSubmitHandler}\n onCancel={(messageId) => {\n props.onCancelEditMessage && props.onCancelEditMessage(messageId);\n setIsEditing(false);\n }}\n /* @conditional-compile-remove(mention) */\n mentionLookupOptions={props.mentionOptions?.lookupOptions}\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled={props.isRichTextEditorEnabled}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={props.onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage={props.onInsertInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress={props.inlineImagesWithProgress}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage={props.onRemoveInlineImage}\n />\n );\n } else {\n return (\n <ChatMyMessageComponentAsMessageBubble\n {...props}\n onRemoveClick={onRemoveClick}\n onEditClick={onEditClick}\n onResendClick={onResendClick}\n onRenderAvatar={props.onRenderAvatar}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={props.onDisplayDateTimeString}\n strings={props.strings}\n inlineImageOptions={props.inlineImageOptions}\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions={props.mentionOptions?.displayOptions}\n />\n );\n }\n};\n"]}
1
+ {"version":3,"file":"ChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAcrD,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,gEAAgE;AAChE,OAAO,EAAE,+CAA+C,EAAE,MAAM,0BAA0B,CAAC;AA6F3F;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAe,EAAE;;IACxF,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAChH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAE1E,MAAM,eAAe,GAAG,iBAAiB,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,MAAM,OAAO,GAAG,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;QACrC,IAAI,eAAe,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACzC,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,C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xB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,0DAA0D;YAC1D,uBAAuB,EAAE,KAAK,CAAC,uBAAuB,EACtD,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,0CAA0C;YAC1C,qBAAqB,EAAE,MAAA,KAAK,CAAC,cAAc,0CAAE,cAAc,IAC3D,CACH,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useState } from 'react';\nimport { MessageThreadStrings, UpdateMessageCallback } from '../../MessageThread';\nimport { ChatMessage, ComponentSlotStyle, OnRenderAvatarCallback } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\nimport { AttachmentMenuAction } from '../../../types/Attachment';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from '../../MentionPopover';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMyMessageComponentAsMessageBubble } from './ChatMyMessageComponentAsMessageBubble';\nimport { ChatMessageComponentAsEditBoxPicker } from './ChatMessageComponentAsEditBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nimport { removeBrokenImageContentAndClearImageSizeStyles } from '../../utils/SendBoxUtils';\n\n/**\n * Props for the ChatMyMessageComponent component.\n */\nexport type ChatMyMessageComponentProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;\n userId: string;\n messageContainerStyle?: ComponentSlotStyle;\n showDate?: boolean;\n disableEditing?: boolean;\n onUpdateMessage?: UpdateMessageCallback;\n onCancelEditMessage?: (messageId: string) => void;\n /**\n * Callback to delete a message. Also called before resending a message that failed to send.\n * @param messageId ID of the message to delete\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n /**\n * Callback to send a message\n * @param content The message content to send\n */\n onSendMessage?: (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n strings: MessageThreadStrings;\n messageStatus?: string;\n /**\n * Optional text to display when the message status is 'failed'.\n */\n failureReason?: string;\n /**\n * Whether the status indicator for each message is displayed or not.\n */\n showMessageStatus?: boolean;\n /**\n * Whether to overlap avatar and message when the view is width constrained.\n */\n shouldOverlapAvatarAndMessage: boolean;\n remoteParticipantsCount?: number;\n onActionButtonClick: (\n message: ChatMessage,\n setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void\n ) => void;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /* @conditional-compile-remove(date-time-customization) */\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to lookup suggestions and display mentions in the mention scenario.\n * @beta\n */\n mentionOptions?: MentionOptions;\n /**\n * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\n /**\n * Optional callback to render message attachments in the message component.\n * @beta\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to define custom actions for attachments.\n * @beta\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled?: boolean;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste?: (event: { content: DocumentFragment }) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress?: AttachmentMetadataInProgress[];\n // Optional callback called when editing is complete (submitted or cancelled).\n onEditComplete?: () => void;\n};\n\n/**\n * @private\n */\nexport const ChatMyMessageComponent = (props: ChatMyMessageComponentProps): JSX.Element => {\n const { onDeleteMessage, onSendMessage, message, onEditComplete, onCancelEditMessage, onUpdateMessage } = props;\n const [isEditing, setIsEditing] = useState(false);\n\n const onEditClick = useCallback(() => setIsEditing(true), [setIsEditing]);\n\n const clientMessageId = 'clientMessageId' in message ? message.clientMessageId : undefined;\n const content = 'content' in message ? message.content : undefined;\n const onRemoveClick = useCallback(() => {\n if (onDeleteMessage && message.messageId) {\n onDeleteMessage(message.messageId);\n }\n // when fail to send, message does not have message id, delete message using clientMessageId\n else if (onDeleteMessage && message.messageType === 'chat' && clientMessageId) {\n onDeleteMessage(clientMessageId);\n }\n }, [onDeleteMessage, message.messageId, message.messageType, clientMessageId]);\n\n const onResendClick = useCallback(() => {\n onDeleteMessage && clientMessageId && onDeleteMessage(clientMessageId);\n let newContent = content ?? '';\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n newContent = removeBrokenImageContentAndClearImageSizeStyles(newContent);\n onSendMessage &&\n onSendMessage(\n newContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n {\n /* @conditional-compile-remove(file-sharing-acs) */ attachments:\n `attachments` in message ? message.attachments : undefined,\n /* @conditional-compile-remove(rich-text-editor) */\n type: props.isRichTextEditorEnabled ? 'html' : 'text'\n }\n );\n }, [\n message,\n onDeleteMessage,\n clientMessageId,\n onSendMessage,\n content,\n /* @conditional-compile-remove(rich-text-editor) */ props.isRichTextEditorEnabled\n ]);\n\n const onSubmitHandler = useCallback(\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n async function (\n text: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments?: AttachmentMetadata[] | undefined\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n if (`attachments` in message && attachments) {\n message.attachments = attachments;\n }\n await onUpdateMessage?.(\n message.messageId,\n text,\n /* @conditional-compile-remove(file-sharing-acs) */\n { attachments: attachments }\n );\n setIsEditing(false);\n onEditComplete?.();\n },\n [message, onEditComplete, onUpdateMessage]\n );\n\n const onCancelHandler = useCallback(\n (messageId: string) => {\n onCancelEditMessage?.(messageId);\n setIsEditing(false);\n onEditComplete?.();\n },\n [onEditComplete, onCancelEditMessage]\n );\n\n if (isEditing && message.messageType === 'chat') {\n return (\n <ChatMessageComponentAsEditBoxPicker\n message={message}\n strings={props.strings}\n onSubmit={onSubmitHandler}\n onCancel={onCancelHandler}\n /* @conditional-compile-remove(mention) */\n mentionLookupOptions={props.mentionOptions?.lookupOptions}\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled={props.isRichTextEditorEnabled}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={props.onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage={props.onInsertInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress={props.inlineImagesWithProgress}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage={props.onRemoveInlineImage}\n />\n );\n } else {\n return (\n <ChatMyMessageComponentAsMessageBubble\n {...props}\n onRemoveClick={onRemoveClick}\n onEditClick={onEditClick}\n onResendClick={onResendClick}\n onRenderAvatar={props.onRenderAvatar}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={props.onDisplayDateTimeString}\n strings={props.strings}\n inlineImageOptions={props.inlineImageOptions}\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions={props.mentionOptions?.displayOptions}\n />\n );\n }\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import React, { useCallback, useMemo } from 'react';
3
+ import React, { useCallback, useMemo, useRef } from 'react';
4
4
  import { noMessageStatusStyle, useChatMessageRenderStyles } from '../../styles/MessageThread.styles';
5
5
  import { mergeStyles } from '@fluentui/react';
6
6
  import { mergeClasses } from '@fluentui/react-components';
@@ -33,12 +33,17 @@ export const FluentChatMyMessageComponent = (props) => {
33
33
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
34
34
  onInsertInlineImage } = props;
35
35
  const chatMessageRenderStyles = useChatMessageRenderStyles();
36
+ const fluentMessageBodyRef = useRef(null);
37
+ const onEditComplete = useCallback(() => {
38
+ var _a;
39
+ (_a = fluentMessageBodyRef.current) === null || _a === void 0 ? void 0 : _a.focus();
40
+ }, []);
36
41
  // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp
37
42
  // needs to be regenerated), the dependency on "new Date().toDateString()"" is added.
38
43
  const defaultChatMessageRenderer = useCallback((messageProps) => {
39
44
  if (messageProps.message.messageType === 'chat' ||
40
45
  /* @conditional-compile-remove(data-loss-prevention) */ messageProps.message.messageType === 'blocked') {
41
- return (React.createElement(ChatMyMessageComponent, Object.assign({}, messageProps, { onRenderAttachmentDownloads: onRenderAttachmentDownloads, strings: messageProps.strings, message: messageProps.message, userId: userId, remoteParticipantsCount: participantCount ? participantCount - 1 : 0, shouldOverlapAvatarAndMessage: shouldOverlapAvatarAndMessage, onRenderAvatar: onRenderAvatar, showMessageStatus: showMessageStatus, messageStatus: messageProps.message.status, onActionButtonClick: onActionButtonClick,
46
+ return (React.createElement(ChatMyMessageComponent, Object.assign({}, messageProps, { onEditComplete: onEditComplete, onRenderAttachmentDownloads: onRenderAttachmentDownloads, strings: messageProps.strings, message: messageProps.message, userId: userId, remoteParticipantsCount: participantCount ? participantCount - 1 : 0, shouldOverlapAvatarAndMessage: shouldOverlapAvatarAndMessage, onRenderAvatar: onRenderAvatar, showMessageStatus: showMessageStatus, messageStatus: messageProps.message.status, onActionButtonClick: onActionButtonClick,
42
47
  /* @conditional-compile-remove(date-time-customization) */
43
48
  onDisplayDateTimeString: onDisplayDateTimeString, inlineImageOptions: inlineImageOptions,
44
49
  /* @conditional-compile-remove(mention) */
@@ -80,7 +85,8 @@ export const FluentChatMyMessageComponent = (props) => {
80
85
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
81
86
  onInsertInlineImage,
82
87
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
83
- inlineImagesWithProgress
88
+ inlineImagesWithProgress,
89
+ onEditComplete
84
90
  ]);
85
91
  const messageRenderer = useCallback((messageProps) => {
86
92
  return onRenderMessage === undefined
@@ -105,7 +111,8 @@ export const FluentChatMyMessageComponent = (props) => {
105
111
  }, [chatMessageRenderStyles.rootCommon, chatMessageRenderStyles.rootMyMessage, styles === null || styles === void 0 ? void 0 : styles.myChatItemMessageContainer]);
106
112
  const myMessageBodyProps = useMemo(() => {
107
113
  return {
108
- className: mergeClasses(chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage)
114
+ className: mergeClasses(chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage),
115
+ ref: fluentMessageBodyRef
109
116
  };
110
117
  }, [chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage]);
111
118
  const myMessageStatusIcon = useMemo(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"FluentChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKpD,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAi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2EAA2E;IAC3E,OAAO,CACL,oBAAC,mBAAmB,IAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,mBAAmB,IAE9B,eAAe,mBAAM,KAAK,EAAG,CACV,CACvB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MessageStatus, _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo } from 'react';\nimport { MessageProps, _ChatMessageProps } from '../../MessageThread';\nimport { ChatMessage } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\nimport { noMessageStatusStyle, useChatMessageRenderStyles } from '../../styles/MessageThread.styles';\nimport { mergeStyles } from '@fluentui/react';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { MessageStatusIndicatorProps } from '../../MessageStatusIndicator';\nimport { ChatMyMessageComponent } from './ChatMyMessageComponent';\nimport { ChatMyMessage as FluentChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { getFluentUIAttachedValue } from '../../utils/ChatMessageComponentUtils';\nimport type { FluentChatMessageComponentWrapperProps } from '../MessageComponents/FluentChatMessageComponent';\n\n/**\n * The component for rendering a chat message using Fluent UI components\n * and handling default and custom renderers.\n * This component handles rendering for chat message body, avatar and message status.\n * The chat message body, avatar and message status should be shown for both default and custom renderers.\n *\n * @private\n */\nexport const FluentChatMyMessageComponent = (props: FluentChatMessageComponentWrapperProps): JSX.Element => {\n const {\n message,\n styles,\n shouldOverlapAvatarAndMessage,\n onRenderMessage,\n onRenderAvatar,\n showMessageStatus,\n onRenderMessageStatus,\n participantCount,\n readCount,\n onActionButtonClick,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n userId,\n defaultStatusRenderer,\n statusToRender,\n actionsForAttachment,\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage\n } = props;\n const chatMessageRenderStyles = useChatMessageRenderStyles();\n\n // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp\n // needs to be regenerated), the dependency on \"new Date().toDateString()\"\" is added.\n const defaultChatMessageRenderer = useCallback(\n (messageProps: MessageProps) => {\n if (\n messageProps.message.messageType === 'chat' ||\n /* @conditional-compile-remove(data-loss-prevention) */ messageProps.message.messageType === 'blocked'\n ) {\n return (\n <ChatMyMessageComponent\n {...messageProps}\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n strings={messageProps.strings}\n message={messageProps.message}\n userId={userId}\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n shouldOverlapAvatarAndMessage={shouldOverlapAvatarAndMessage}\n onRenderAvatar={onRenderAvatar}\n showMessageStatus={showMessageStatus}\n messageStatus={messageProps.message.status}\n onActionButtonClick={onActionButtonClick}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n inlineImageOptions={inlineImageOptions}\n /* @conditional-compile-remove(mention) */\n mentionOptions={mentionOptions}\n actionsForAttachment={actionsForAttachment}\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled={isRichTextEditorEnabled}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage={onRemoveInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage={onInsertInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress={inlineImagesWithProgress}\n />\n );\n }\n return <></>;\n },\n [\n onActionButtonClick,\n onRenderAvatar,\n participantCount,\n shouldOverlapAvatarAndMessage,\n showMessageStatus,\n userId,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n onRenderAttachmentDownloads,\n actionsForAttachment,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n new Date().toDateString(),\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress\n ]\n );\n\n const messageRenderer = useCallback(\n (messageProps: MessageProps) => {\n return onRenderMessage === undefined\n ? defaultChatMessageRenderer({ ...messageProps })\n : onRenderMessage(messageProps, defaultChatMessageRenderer);\n },\n [defaultChatMessageRenderer, onRenderMessage]\n );\n\n const messageStatusRenderer = useCallback(\n (\n onRenderMessageStatus:\n | ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null)\n | undefined,\n defaultStatusRenderer: (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n participantCount: number,\n readCount: number,\n status?: MessageStatus\n ) => JSX.Element,\n showMessageStatus?: boolean,\n participantCount?: number,\n readCount?: number\n ) => {\n return showMessageStatus && statusToRender ? (\n onRenderMessageStatus ? (\n onRenderMessageStatus({ status: message.status })\n ) : (\n defaultStatusRenderer(message, participantCount ?? 0, readCount ?? 0, message.status)\n )\n ) : (\n <div className={mergeStyles(noMessageStatusStyle)} />\n );\n },\n [message, statusToRender]\n );\n\n const attached = useMemo(() => {\n return getFluentUIAttachedValue(message.attached);\n }, [message.attached]);\n\n const myMessageRootProps = useMemo(() => {\n return {\n // myChatItemMessageContainer used in className and style prop as style prop can't handle CSS selectors\n className: mergeClasses(\n chatMessageRenderStyles.rootMyMessage,\n chatMessageRenderStyles.rootCommon,\n mergeStyles(styles?.myChatItemMessageContainer)\n ),\n style:\n styles?.myChatItemMessageContainer !== undefined\n ? createStyleFromV8Style(styles?.myChatItemMessageContainer)\n : {},\n role: 'none'\n };\n }, [chatMessageRenderStyles.rootCommon, chatMessageRenderStyles.rootMyMessage, styles?.myChatItemMessageContainer]);\n\n const myMessageBodyProps = useMemo(() => {\n return {\n className: mergeClasses(chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage)\n };\n }, [chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage]);\n\n const myMessageStatusIcon = useMemo(() => {\n return (\n <div\n className={mergeStyles(\n { paddingLeft: '0.25rem' },\n styles?.messageStatusContainer ? styles.messageStatusContainer(message.mine ?? false) : ''\n )}\n >\n {message.status\n ? messageStatusRenderer(\n onRenderMessageStatus,\n defaultStatusRenderer,\n showMessageStatus,\n participantCount,\n readCount\n )\n : undefined}\n </div>\n );\n }, [\n defaultStatusRenderer,\n message.mine,\n message.status,\n messageStatusRenderer,\n onRenderMessageStatus,\n participantCount,\n readCount,\n showMessageStatus,\n styles\n ]);\n\n // Fluent UI message components are used here as for default message renderer,\n // timestamp and author name should be shown but they aren't shown for custom renderer.\n // More investigations are needed to check if this can be simplified with states.\n // Status and avatar should be shown for both custom and default renderers.\n return (\n <FluentChatMyMessage\n attached={attached}\n root={myMessageRootProps}\n body={myMessageBodyProps}\n statusIcon={myMessageStatusIcon}\n >\n {messageRenderer({ ...props })}\n </FluentChatMyMessage>\n );\n};\n"]}
1
+ {"version":3,"file":"FluentChatMyMessageComponent.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAA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C,MAAA,OAAO,CAAC,IAAI,mCAAI,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAC3F,IAEA,OAAO,CAAC,MAAM;YACb,CAAC,CAAC,qBAAqB,CACnB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,CACV;YACH,CAAC,CAAC,SAAS,CACT,CACP,CAAC;IACJ,CAAC,EAAE;QACD,qBAAqB;QACrB,OAAO,CAAC,IAAI;QACZ,OAAO,CAAC,MAAM;QACd,qBAAqB;QACrB,qBAAqB;QACrB,gBAAgB;QAChB,SAAS;QACT,iBAAiB;QACjB,MAAM;KACP,CAAC,CAAC;IAEH,8EAA8E;IAC9E,uFAAuF;IACvF,iFAAiF;IACjF,2EAA2E;IAC3E,OAAO,CACL,oBAAC,mBAAmB,IAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,mBAAmB,IAE9B,eAAe,mBAAM,KAAK,EAAG,CACV,CACvB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MessageStatus, _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo, useRef } from 'react';\nimport { MessageProps, _ChatMessageProps } from '../../MessageThread';\nimport { ChatMessage } from '../../../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../../types';\nimport { noMessageStatusStyle, useChatMessageRenderStyles } from '../../styles/MessageThread.styles';\nimport { mergeStyles } from '@fluentui/react';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { MessageStatusIndicatorProps } from '../../MessageStatusIndicator';\nimport { ChatMyMessageComponent } from './ChatMyMessageComponent';\nimport { ChatMyMessage as FluentChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { getFluentUIAttachedValue } from '../../utils/ChatMessageComponentUtils';\nimport type { FluentChatMessageComponentWrapperProps } from '../MessageComponents/FluentChatMessageComponent';\n\n/**\n * The component for rendering a chat message using Fluent UI components\n * and handling default and custom renderers.\n * This component handles rendering for chat message body, avatar and message status.\n * The chat message body, avatar and message status should be shown for both default and custom renderers.\n *\n * @private\n */\nexport const FluentChatMyMessageComponent = (props: FluentChatMessageComponentWrapperProps): JSX.Element => {\n const {\n message,\n styles,\n shouldOverlapAvatarAndMessage,\n onRenderMessage,\n onRenderAvatar,\n showMessageStatus,\n onRenderMessageStatus,\n participantCount,\n readCount,\n onActionButtonClick,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n userId,\n defaultStatusRenderer,\n statusToRender,\n actionsForAttachment,\n onRenderAttachmentDownloads,\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage\n } = props;\n const chatMessageRenderStyles = useChatMessageRenderStyles();\n const fluentMessageBodyRef = useRef<HTMLDivElement>(null);\n\n const onEditComplete = useCallback(() => {\n fluentMessageBodyRef.current?.focus();\n }, []);\n\n // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp\n // needs to be regenerated), the dependency on \"new Date().toDateString()\"\" is added.\n const defaultChatMessageRenderer = useCallback(\n (messageProps: MessageProps) => {\n if (\n messageProps.message.messageType === 'chat' ||\n /* @conditional-compile-remove(data-loss-prevention) */ messageProps.message.messageType === 'blocked'\n ) {\n return (\n <ChatMyMessageComponent\n {...messageProps}\n onEditComplete={onEditComplete}\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n strings={messageProps.strings}\n message={messageProps.message}\n userId={userId}\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n shouldOverlapAvatarAndMessage={shouldOverlapAvatarAndMessage}\n onRenderAvatar={onRenderAvatar}\n showMessageStatus={showMessageStatus}\n messageStatus={messageProps.message.status}\n onActionButtonClick={onActionButtonClick}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n inlineImageOptions={inlineImageOptions}\n /* @conditional-compile-remove(mention) */\n mentionOptions={mentionOptions}\n actionsForAttachment={actionsForAttachment}\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled={isRichTextEditorEnabled}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste={onPaste}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage={onRemoveInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage={onInsertInlineImage}\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress={inlineImagesWithProgress}\n />\n );\n }\n return <></>;\n },\n [\n onActionButtonClick,\n onRenderAvatar,\n participantCount,\n shouldOverlapAvatarAndMessage,\n showMessageStatus,\n userId,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n inlineImageOptions,\n /* @conditional-compile-remove(mention) */\n mentionOptions,\n onRenderAttachmentDownloads,\n actionsForAttachment,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n new Date().toDateString(),\n /* @conditional-compile-remove(rich-text-editor) */\n isRichTextEditorEnabled,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onPaste,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onRemoveInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n onInsertInlineImage,\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n inlineImagesWithProgress,\n onEditComplete\n ]\n );\n\n const messageRenderer = useCallback(\n (messageProps: MessageProps) => {\n return onRenderMessage === undefined\n ? defaultChatMessageRenderer({ ...messageProps })\n : onRenderMessage(messageProps, defaultChatMessageRenderer);\n },\n [defaultChatMessageRenderer, onRenderMessage]\n );\n\n const messageStatusRenderer = useCallback(\n (\n onRenderMessageStatus:\n | ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null)\n | undefined,\n defaultStatusRenderer: (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n participantCount: number,\n readCount: number,\n status?: MessageStatus\n ) => JSX.Element,\n showMessageStatus?: boolean,\n participantCount?: number,\n readCount?: number\n ) => {\n return showMessageStatus && statusToRender ? (\n onRenderMessageStatus ? (\n onRenderMessageStatus({ status: message.status })\n ) : (\n defaultStatusRenderer(message, participantCount ?? 0, readCount ?? 0, message.status)\n )\n ) : (\n <div className={mergeStyles(noMessageStatusStyle)} />\n );\n },\n [message, statusToRender]\n );\n\n const attached = useMemo(() => {\n return getFluentUIAttachedValue(message.attached);\n }, [message.attached]);\n\n const myMessageRootProps = useMemo(() => {\n return {\n // myChatItemMessageContainer used in className and style prop as style prop can't handle CSS selectors\n className: mergeClasses(\n chatMessageRenderStyles.rootMyMessage,\n chatMessageRenderStyles.rootCommon,\n mergeStyles(styles?.myChatItemMessageContainer)\n ),\n style:\n styles?.myChatItemMessageContainer !== undefined\n ? createStyleFromV8Style(styles?.myChatItemMessageContainer)\n : {},\n role: 'none'\n };\n }, [chatMessageRenderStyles.rootCommon, chatMessageRenderStyles.rootMyMessage, styles?.myChatItemMessageContainer]);\n\n const myMessageBodyProps = useMemo(() => {\n return {\n className: mergeClasses(chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage),\n ref: fluentMessageBodyRef\n };\n }, [chatMessageRenderStyles.bodyCommon, chatMessageRenderStyles.bodyMyMessage]);\n\n const myMessageStatusIcon = useMemo(() => {\n return (\n <div\n className={mergeStyles(\n { paddingLeft: '0.25rem' },\n styles?.messageStatusContainer ? styles.messageStatusContainer(message.mine ?? false) : ''\n )}\n >\n {message.status\n ? messageStatusRenderer(\n onRenderMessageStatus,\n defaultStatusRenderer,\n showMessageStatus,\n participantCount,\n readCount\n )\n : undefined}\n </div>\n );\n }, [\n defaultStatusRenderer,\n message.mine,\n message.status,\n messageStatusRenderer,\n onRenderMessageStatus,\n participantCount,\n readCount,\n showMessageStatus,\n styles\n ]);\n\n // Fluent UI message components are used here as for default message renderer,\n // timestamp and author name should be shown but they aren't shown for custom renderer.\n // More investigations are needed to check if this can be simplified with states.\n // Status and avatar should be shown for both custom and default renderers.\n return (\n <FluentChatMyMessage\n attached={attached}\n root={myMessageRootProps}\n body={myMessageBodyProps}\n statusIcon={myMessageStatusIcon}\n >\n {messageRenderer({ ...props })}\n </FluentChatMyMessage>\n );\n};\n"]}
@@ -63,7 +63,6 @@ export const _LocalVideoTile = React.memo((props) => {
63
63
  return {
64
64
  contextualMenu: contextualMenuProps
65
65
  };
66
- return {};
67
66
  }, [contextualMenuProps, menuKind]);
68
67
  const videoTileStyles = useMemo(() => {
69
68
  if (isSpotlighted) {