@azure/communication-react 1.17.0-alpha-202406020014 → 1.17.0-alpha-202406050014

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 (106) hide show
  1. package/dist/communication-react.d.ts +7 -8
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BQpOd_cF.js → ChatMessageComponentAsRichTextEditBox-CueWJlOs.js} +12 -12
  3. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-CueWJlOs.js.map +1 -0
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CBQNEhRD.js → RichTextSendBoxWrapper-DORQ6cdT.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CBQNEhRD.js.map → RichTextSendBoxWrapper-DORQ6cdT.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-xYWFdTrM.js → index-B4rHuheV.js} +240 -216
  7. package/dist/dist-cjs/communication-react/index-B4rHuheV.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/common.d.ts +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
  11. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  12. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  13. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +1 -1
  14. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +4 -4
  15. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  16. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +6 -6
  17. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  18. package/dist/dist-esm/communication-react/src/index.d.ts +4 -2
  19. package/dist/dist-esm/communication-react/src/index.js +1 -1
  20. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  21. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.d.ts +1 -1
  22. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +30 -13
  23. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +4 -4
  26. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  27. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +9 -9
  28. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +7 -7
  30. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
  31. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +12 -12
  32. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  34. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +14 -14
  35. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  36. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +2 -1
  37. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +5 -5
  38. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  39. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +9 -9
  40. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  41. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +10 -10
  42. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/components/ErrorBar.js +1 -1
  44. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  45. package/dist/dist-esm/react-components/src/components/MessageThread.js +4 -4
  46. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  47. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +6 -7
  48. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
  49. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +32 -32
  50. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  51. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +6 -6
  52. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +1 -1
  53. package/dist/dist-esm/react-components/src/components/SendBox.js +22 -22
  54. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  55. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  56. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.js +5 -3
  57. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.js.map +1 -1
  58. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +2 -2
  59. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  60. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +7 -7
  61. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  62. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +10 -9
  63. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  64. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +4 -4
  65. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  66. package/dist/dist-esm/react-components/src/components/utils/common.js +2 -2
  67. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  68. package/dist/dist-esm/react-components/src/theming/icons.js +8 -6
  69. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  70. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
  71. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +0 -1
  72. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  73. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +3 -3
  74. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  75. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -1
  76. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +2 -2
  77. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  78. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +2 -2
  79. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  80. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +1 -1
  81. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +2 -2
  82. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  83. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +4 -4
  84. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  85. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +30 -26
  86. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  87. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  88. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +2 -2
  89. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +7 -7
  90. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  91. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -2
  92. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  93. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js +1 -0
  94. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +1 -1
  95. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +11 -4
  96. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +1 -1
  97. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +1 -1
  98. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +4 -4
  99. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  100. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  101. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
  102. package/dist/dist-esm/react-composites/src/composites/common/icons.js +2 -2
  103. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  104. package/package.json +2 -2
  105. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BQpOd_cF.js.map +0 -1
  106. package/dist/dist-cjs/communication-react/index-xYWFdTrM.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-xYWFdTrM.js');
3
+ var index = require('./index-B4rHuheV.js');
4
4
  require('react');
5
5
  require('@fluentui/react');
6
6
  require('@fluentui/react-components');
@@ -35,7 +35,7 @@ export declare function _getKeys<T extends object>(obj: T): (keyof T)[];
35
35
  * a name that represents the name of file, and
36
36
  * a URL to download the attachment.
37
37
  *
38
- * @beta
38
+ * @public
39
39
  */
40
40
  export interface AttachmentMetadata {
41
41
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAU,EAAE;IACrD,OAAO,GAAG,GAAG,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC/E,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAU,EAAU,EAAE;IACpD,OAAO,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC9E,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,EAAqE,EAC5D,EAAE;IACX,OAAO,EAAE,CAAC,IAAI,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC;AACtD,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAmB,GAAM;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAmB,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n * Converts units of rem to units of pixels\n * @param rem - units of rem\n * @returns units of pixels\n */\nexport const _convertRemToPx = (rem: number): number => {\n return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);\n};\n\n/**\n * @internal\n * Converts units of pixels to units of rem\n * @param px - units of px\n * @returns units of rem\n */\nexport const _convertPxToRem = (px: number): number => {\n return px / parseFloat(getComputedStyle(document.documentElement).fontSize);\n};\n\n/**\n * @internal\n * Disable dismiss on resize to work around a couple Fluent UI bugs\n * - The Callout is dismissed whenever *any child of window (inclusive)* is resized. In practice, this\n * happens when we change the VideoGallery layout, or even when the video stream element is internally resized\n * by the headless SDK.\n * - We also want to prevent dismiss when chat pane is scrolling especially a new message is added.\n * A side effect of this workaround is that the context menu stays open when window is resized, and may\n * get detached from original target visually. That bug is preferable to the bug when this value is not set -\n * The Callout (frequently) gets dismissed automatically.\n */\nexport const _preventDismissOnEvent = (\n ev: Event | React.FocusEvent | React.KeyboardEvent | React.MouseEvent\n): boolean => {\n return ev.type === 'resize' || ev.type === 'scroll';\n};\n\n/**\n * @internal\n * Helper function to get the keys of an object\n */\nexport function _getKeys<T extends object>(obj: T): (keyof T)[] {\n return Object.keys(obj) as Array<keyof T>;\n}\n\n/**\n * Data model that represents a chat message attachment\n * where it contains an ID to uniquely identify the attachment,\n * a name that represents the name of file, and\n * a URL to download the attachment.\n *\n * @beta\n */\nexport interface AttachmentMetadata {\n /**\n * Unique ID of the attachment.\n */\n id: string;\n /**\n * Attachment name to be displayed.\n */\n name: string;\n /**\n * Download URL for the attachment.\n */\n url: string;\n}\n\n/**\n * Data model that represents a chat message attachment being uploaded\n * where it contains an ID to uniquely identify the attachment,\n * a name that represents the name of file,\n * an optional URL to download the attachment,\n * an optional progress value between 0 and 1 indicating the progress of the upload, and\n * an optional error object that contains error message would be shown to the user.\n *\n *\n * @beta\n */\nexport interface AttachmentMetadataInProgress {\n /**\n * Unique ID of the attachment.\n */\n id: string;\n /**\n * Attachment name to be displayed.\n */\n name: string;\n /**\n * Download URL for the attachment.\n */\n url?: string;\n /**\n * A number between 0 and 1 indicating the progress of the upload.\n */\n progress?: number;\n /**\n * A object contains error message would be shown to the user.\n */\n error?: AttachmentProgressError;\n}\n\n/**\n * @beta\n * A attachment progress error object that contains message to be shown to\n * the user when upload fails.\n */\nexport interface AttachmentProgressError {\n message: string;\n}\n\n/**\n * @beta\n * Message option that defines properties that can be set when\n * sending or updating a chat message.\n * @property metadata - Metadata that contains additional information about the message to be passed between 2 users.\n * @property attachments - Attachments that contains file attachments attached to the message.\n * @property type - Type of the message content, either 'text' or 'html'.\n */\nexport type MessageOptions = {\n metadata?: Record<string, string>;\n attachments?: AttachmentMetadata[];\n type?: ChatMessageType;\n};\n\n/**\n * @beta\n * Type of the message content, either 'text' or 'html'.\n */\nexport type ChatMessageType = 'text' | 'html';\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAU,EAAE;IACrD,OAAO,GAAG,GAAG,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC/E,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAU,EAAU,EAAE;IACpD,OAAO,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC9E,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,EAAqE,EAC5D,EAAE;IACX,OAAO,EAAE,CAAC,IAAI,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC;AACtD,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAmB,GAAM;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAmB,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n * Converts units of rem to units of pixels\n * @param rem - units of rem\n * @returns units of pixels\n */\nexport const _convertRemToPx = (rem: number): number => {\n return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);\n};\n\n/**\n * @internal\n * Converts units of pixels to units of rem\n * @param px - units of px\n * @returns units of rem\n */\nexport const _convertPxToRem = (px: number): number => {\n return px / parseFloat(getComputedStyle(document.documentElement).fontSize);\n};\n\n/**\n * @internal\n * Disable dismiss on resize to work around a couple Fluent UI bugs\n * - The Callout is dismissed whenever *any child of window (inclusive)* is resized. In practice, this\n * happens when we change the VideoGallery layout, or even when the video stream element is internally resized\n * by the headless SDK.\n * - We also want to prevent dismiss when chat pane is scrolling especially a new message is added.\n * A side effect of this workaround is that the context menu stays open when window is resized, and may\n * get detached from original target visually. That bug is preferable to the bug when this value is not set -\n * The Callout (frequently) gets dismissed automatically.\n */\nexport const _preventDismissOnEvent = (\n ev: Event | React.FocusEvent | React.KeyboardEvent | React.MouseEvent\n): boolean => {\n return ev.type === 'resize' || ev.type === 'scroll';\n};\n\n/**\n * @internal\n * Helper function to get the keys of an object\n */\nexport function _getKeys<T extends object>(obj: T): (keyof T)[] {\n return Object.keys(obj) as Array<keyof T>;\n}\n\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n/**\n * Data model that represents a chat message attachment\n * where it contains an ID to uniquely identify the attachment,\n * a name that represents the name of file, and\n * a URL to download the attachment.\n *\n * @public\n */\nexport interface AttachmentMetadata {\n /**\n * Unique ID of the attachment.\n */\n id: string;\n /**\n * Attachment name to be displayed.\n */\n name: string;\n /**\n * Download URL for the attachment.\n */\n url: string;\n}\n\n/**\n * Data model that represents a chat message attachment being uploaded\n * where it contains an ID to uniquely identify the attachment,\n * a name that represents the name of file,\n * an optional URL to download the attachment,\n * an optional progress value between 0 and 1 indicating the progress of the upload, and\n * an optional error object that contains error message would be shown to the user.\n *\n *\n * @beta\n */\nexport interface AttachmentMetadataInProgress {\n /**\n * Unique ID of the attachment.\n */\n id: string;\n /**\n * Attachment name to be displayed.\n */\n name: string;\n /**\n * Download URL for the attachment.\n */\n url?: string;\n /**\n * A number between 0 and 1 indicating the progress of the upload.\n */\n progress?: number;\n /**\n * A object contains error message would be shown to the user.\n */\n error?: AttachmentProgressError;\n}\n\n/**\n * @beta\n * A attachment progress error object that contains message to be shown to\n * the user when upload fails.\n */\nexport interface AttachmentProgressError {\n message: string;\n}\n\n/**\n * @beta\n * Message option that defines properties that can be set when\n * sending or updating a chat message.\n * @property metadata - Metadata that contains additional information about the message to be passed between 2 users.\n * @property attachments - Attachments that contains file attachments attached to the message.\n * @property type - Type of the message content, either 'text' or 'html'.\n */\nexport type MessageOptions = {\n metadata?: Record<string, string>;\n attachments?: AttachmentMetadata[];\n type?: ChatMessageType;\n};\n\n/**\n * @beta\n * Type of the message content, either 'text' or 'html'.\n */\nexport type ChatMessageType = 'text' | 'html';\n"]}
@@ -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.17.0-alpha-202406020014';
5
+ module.exports = '1.17.0-alpha-202406050014';
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.17.0-alpha-202406020014';\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.17.0-alpha-202406050014';\n"]}
@@ -12,7 +12,7 @@ import { MessageOptions } from "../../../acs-ui-common/src";
12
12
  * @public
13
13
  */
14
14
  export type ChatHandlers = {
15
- onSendMessage: (content: string, options?: SendMessageOptions | /* @conditional-compile-remove(attachment-upload) */ MessageOptions) => Promise<void>;
15
+ onSendMessage: (content: string, options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions) => Promise<void>;
16
16
  onMessageSeen: (chatMessageId: string) => Promise<void>;
17
17
  onTyping: () => Promise<void>;
18
18
  onRemoveParticipant: (userId: string) => Promise<void>;
@@ -33,7 +33,7 @@ export const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClien
33
33
  content,
34
34
  senderDisplayName: chatClient.getState().displayName
35
35
  };
36
- /* @conditional-compile-remove(attachment-upload) */
36
+ /* @conditional-compile-remove(file-sharing-acs) */
37
37
  if (options &&
38
38
  'attachments' in options &&
39
39
  options.attachments &&
@@ -51,16 +51,16 @@ export const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClien
51
51
  // due to a bug in babel, we can't use arrow function here
52
52
  // affecting conditional-compile-remove(attachment-upload)
53
53
  onUpdateMessage: function (messageId, content,
54
- /* @conditional-compile-remove(attachment-upload) */
54
+ /* @conditional-compile-remove(file-sharing-acs) */
55
55
  options) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
- /* @conditional-compile-remove(attachment-upload) */
57
+ /* @conditional-compile-remove(file-sharing-acs) */
58
58
  const updateMessageOptions = {
59
59
  content,
60
60
  metadata: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.metadata), { fileSharingMetadata: JSON.stringify(options === null || options === void 0 ? void 0 : options.attachments) })
61
61
  };
62
62
  yield chatThreadClient.updateMessage(messageId,
63
- /* @conditional-compile-remove(attachment-upload) */
63
+ /* @conditional-compile-remove(file-sharing-acs) */
64
64
  updateMessageOptions);
65
65
  });
66
66
  },
@@ -1 +1 @@
1
- {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../chat-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAIlC,OAAO,EAAU,+BAA+B,EAAE,mCAAgC;AAKlF,OAAO,UAAU,MAAM,aAAa,CAAC;AA+BrC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CACjD,CAAC,UAA8B,EAAE,gBAAkC,EAAgB,EAAE;IACnF,IAAI,eAAe,GAAwD,SAAS,CAAC;IACrF,IAAI,mBAAmB,GAAmE,SAAS,CAAC;IACpG,OAAO;QACL,0DAA0D;QAC1D,0DAA0D;QAC1D,aAAa,EAAE,UACb,OAAe,EACf,OAAkG;;gBAElG,MAAM,kBAAkB,GAAG;oBACzB,OAAO;oBACP,iBAAiB,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC,WAAW;iBACrD,CAAC;gBACF,oDAAoD;gBACpD,IACE,OAAO;oBACP,aAAa,IAAI,OAAO;oBACxB,OAAO,CAAC,WAAW;oBACnB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;oBACtB,CAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAoB,CAAC,cAAc,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;gBAC3B,CAAC;gBAED,gDAAgD;gBAChD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;oBACjB,uBAAuB,GAAG,IAAI,CAAC;oBAC/B,MAAM;gBACR,CAAC;YACH,CAAC;YACD,6EAA6E;YAC7E,IAAI,WAAW,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;YACnD,OAAO,CAAC,WAAW,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,0CAAE,aAAa,CAAC,IAAI,YAAY,EAAE,CAAC;gBACxF,WAAW,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;YACjD,CAAC;YAED,OAAO,uBAAuB,CAAC;QACjC,CAAC,CAAA;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CACnD,UAA8B,EAC9B,gBAAkC,EAClC,CAAwC,EACX,EAAE;IAC/B,OAAO,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;AACjE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { PagedAsyncIterableIterator } from '@azure/core-paging';\nimport { ReactElement } from 'react';\nimport { Common, fromFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulChatClient } from '@internal/chat-stateful-client';\n/* @conditional-compile-remove(attachment-upload) */\nimport { ChatAttachment } from '@azure/communication-chat';\nimport { ChatMessage, ChatMessageReadReceipt, ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';\nimport memoizeOne from 'memoize-one';\n/* @conditional-compile-remove(attachment-upload) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n\n/**\n * Object containing all the handlers required for chat components.\n *\n * Chat 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 type ChatHandlers = {\n onSendMessage: (\n content: string,\n options?: SendMessageOptions | /* @conditional-compile-remove(attachment-upload) */ MessageOptions\n ) => Promise<void>;\n onMessageSeen: (chatMessageId: string) => Promise<void>;\n onTyping: () => Promise<void>;\n onRemoveParticipant: (userId: string) => Promise<void>;\n updateThreadTopicName: (topicName: string) => Promise<void>;\n onLoadPreviousChatMessages: (messagesToLoad: number) => Promise<boolean>;\n onUpdateMessage: (\n messageId: string,\n content: string,\n /* @conditional-compile-remove(attachment-upload) */\n options?: MessageOptions\n ) => Promise<void>;\n onDeleteMessage: (messageId: string) => Promise<void>;\n};\n\n/**\n * Create the default implementation of {@link ChatHandlers}.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * Returned object is memoized to avoid rerenders when used as props for React Components.\n *\n * @public\n */\nexport const createDefaultChatHandlers = memoizeOne(\n (chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient): ChatHandlers => {\n let messageIterator: PagedAsyncIterableIterator<ChatMessage> | undefined = undefined;\n let readReceiptIterator: PagedAsyncIterableIterator<ChatMessageReadReceipt> | undefined = undefined;\n return {\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n onSendMessage: async function (\n content: string,\n options?: SendMessageOptions | /* @conditional-compile-remove(attachment-upload) */ MessageOptions\n ) {\n const sendMessageRequest = {\n content,\n senderDisplayName: chatClient.getState().displayName\n };\n /* @conditional-compile-remove(attachment-upload) */\n if (\n options &&\n 'attachments' in options &&\n options.attachments &&\n options.attachments[0] &&\n !(options.attachments[0] as ChatAttachment).attachmentType\n ) {\n const chatSDKOptions = {\n metadata: {\n ...options?.metadata,\n fileSharingMetadata: JSON.stringify(options?.attachments)\n }\n };\n await chatThreadClient.sendMessage(sendMessageRequest, chatSDKOptions);\n return;\n }\n await chatThreadClient.sendMessage(sendMessageRequest, options as SendMessageOptions);\n },\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n onUpdateMessage: async function (\n messageId: string,\n content: string,\n /* @conditional-compile-remove(attachment-upload) */\n options?: MessageOptions\n ) {\n /* @conditional-compile-remove(attachment-upload) */\n const updateMessageOptions = {\n content,\n metadata: {\n ...options?.metadata,\n fileSharingMetadata: JSON.stringify(options?.attachments)\n }\n };\n await chatThreadClient.updateMessage(\n messageId,\n /* @conditional-compile-remove(attachment-upload) */\n updateMessageOptions\n );\n },\n onDeleteMessage: async (messageId: string) => {\n await chatThreadClient.deleteMessage(messageId);\n },\n // This handler is designed for chatThread to consume\n onMessageSeen: async (chatMessageId: string) => {\n await chatThreadClient.sendReadReceipt({ chatMessageId });\n },\n onTyping: async () => {\n await chatThreadClient.sendTypingNotification();\n },\n onRemoveParticipant: async (userId: string) => {\n await chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));\n },\n updateThreadTopicName: async (topicName: string) => {\n await chatThreadClient.updateTopic(topicName);\n },\n onLoadPreviousChatMessages: async (messagesToLoad: number) => {\n if (messageIterator === undefined) {\n // Lazy definition so that errors in the method call are reported correctly.\n // Also allows recovery via retries in case of transient errors.\n messageIterator = chatThreadClient.listMessages({ maxPageSize: 50 });\n }\n if (readReceiptIterator === undefined) {\n readReceiptIterator = chatThreadClient.listReadReceipts();\n }\n // get the earliest message time\n let remainingMessagesToGet = messagesToLoad;\n let isAllChatMessagesLoaded = false;\n let earliestTime = Number.MAX_SAFE_INTEGER;\n while (remainingMessagesToGet >= 1) {\n const message = await messageIterator.next();\n if (message?.value?.id) {\n if (parseInt(message.value.id) < earliestTime) {\n earliestTime = parseInt(message.value.id);\n }\n }\n\n if (message.value?.type && message.value.type === 'text') {\n remainingMessagesToGet--;\n }\n\n // We have traversed all messages in this thread\n if (message.done) {\n isAllChatMessagesLoaded = true;\n break;\n }\n }\n // keep fetching read receipts until read receipt time < earlist message time\n let readReceipt = await readReceiptIterator.next();\n while (!readReceipt.done && parseInt(readReceipt?.value?.chatMessageId) >= earliestTime) {\n readReceipt = await readReceiptIterator.next();\n }\n\n return isAllChatMessagesLoaded;\n }\n };\n }\n);\n\n/**\n * Create a set of default handlers for given component.\n *\n * Returned object is memoized (with reference to the arguments) to avoid\n * renders when used as props for React Components.\n *\n * @public\n */\nexport const createDefaultChatHandlersForComponent = <Props>(\n chatClient: StatefulChatClient,\n chatThreadClient: ChatThreadClient,\n _: (props: Props) => ReactElement | null\n): Common<ChatHandlers, Props> => {\n return createDefaultChatHandlers(chatClient, chatThreadClient);\n};\n"]}
1
+ {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../chat-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAIlC,OAAO,EAAU,+BAA+B,EAAE,mCAAgC;AAKlF,OAAO,UAAU,MAAM,aAAa,CAAC;AA+BrC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CACjD,CAAC,UAA8B,EAAE,gBAAkC,EAAgB,EAAE;IACnF,IAAI,eAAe,GAAwD,SAAS,CAAC;IACrF,IAAI,mBAAmB,GAAmE,SAAS,CAAC;IACpG,OAAO;QACL,0DAA0D;QAC1D,0DAA0D;QAC1D,aAAa,EAAE,UACb,OAAe,EACf,OAAiG;;gBAEjG,MAAM,kBAAkB,GAAG;oBACzB,OAAO;oBACP,iBAAiB,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC,WAAW;iBACrD,CAAC;gBACF,mDAAmD;gBACnD,IACE,OAAO;oBACP,aAAa,IAAI,OAAO;oBACxB,OAAO,CAAC,WAAW;oBACnB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;oBACtB,CAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAoB,CAAC,cAAc,EAC1D,CAAC;oBACD,MAAM,cAAc,GAAG;wBACrB,QAAQ,kCACH,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KACpB,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CA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G,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;YACnD,OAAO,CAAC,WAAW,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,0CAAE,aAAa,CAAC,IAAI,YAAY,EAAE,CAAC;gBACxF,WAAW,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;YACjD,CAAC;YAED,OAAO,uBAAuB,CAAC;QACjC,CAAC,CAAA;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CACnD,UAA8B,EAC9B,gBAAkC,EAClC,CAAwC,EACX,EAAE;IAC/B,OAAO,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;AACjE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { PagedAsyncIterableIterator } from '@azure/core-paging';\nimport { ReactElement } from 'react';\nimport { Common, fromFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulChatClient } from '@internal/chat-stateful-client';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { ChatAttachment } from '@azure/communication-chat';\nimport { ChatMessage, ChatMessageReadReceipt, ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';\nimport memoizeOne from 'memoize-one';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n\n/**\n * Object containing all the handlers required for chat components.\n *\n * Chat 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 type ChatHandlers = {\n onSendMessage: (\n content: string,\n options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ) => Promise<void>;\n onMessageSeen: (chatMessageId: string) => Promise<void>;\n onTyping: () => Promise<void>;\n onRemoveParticipant: (userId: string) => Promise<void>;\n updateThreadTopicName: (topicName: string) => Promise<void>;\n onLoadPreviousChatMessages: (messagesToLoad: number) => Promise<boolean>;\n onUpdateMessage: (\n messageId: string,\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) => Promise<void>;\n onDeleteMessage: (messageId: string) => Promise<void>;\n};\n\n/**\n * Create the default implementation of {@link ChatHandlers}.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * Returned object is memoized to avoid rerenders when used as props for React Components.\n *\n * @public\n */\nexport const createDefaultChatHandlers = memoizeOne(\n (chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient): ChatHandlers => {\n let messageIterator: PagedAsyncIterableIterator<ChatMessage> | undefined = undefined;\n let readReceiptIterator: PagedAsyncIterableIterator<ChatMessageReadReceipt> | undefined = undefined;\n return {\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n onSendMessage: async function (\n content: string,\n options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ) {\n const sendMessageRequest = {\n content,\n senderDisplayName: chatClient.getState().displayName\n };\n /* @conditional-compile-remove(file-sharing-acs) */\n if (\n options &&\n 'attachments' in options &&\n options.attachments &&\n options.attachments[0] &&\n !(options.attachments[0] as ChatAttachment).attachmentType\n ) {\n const chatSDKOptions = {\n metadata: {\n ...options?.metadata,\n fileSharingMetadata: JSON.stringify(options?.attachments)\n }\n };\n await chatThreadClient.sendMessage(sendMessageRequest, chatSDKOptions);\n return;\n }\n await chatThreadClient.sendMessage(sendMessageRequest, options as SendMessageOptions);\n },\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n onUpdateMessage: async function (\n messageId: string,\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */\n options?: MessageOptions\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n const updateMessageOptions = {\n content,\n metadata: {\n ...options?.metadata,\n fileSharingMetadata: JSON.stringify(options?.attachments)\n }\n };\n await chatThreadClient.updateMessage(\n messageId,\n /* @conditional-compile-remove(file-sharing-acs) */\n updateMessageOptions\n );\n },\n onDeleteMessage: async (messageId: string) => {\n await chatThreadClient.deleteMessage(messageId);\n },\n // This handler is designed for chatThread to consume\n onMessageSeen: async (chatMessageId: string) => {\n await chatThreadClient.sendReadReceipt({ chatMessageId });\n },\n onTyping: async () => {\n await chatThreadClient.sendTypingNotification();\n },\n onRemoveParticipant: async (userId: string) => {\n await chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));\n },\n updateThreadTopicName: async (topicName: string) => {\n await chatThreadClient.updateTopic(topicName);\n },\n onLoadPreviousChatMessages: async (messagesToLoad: number) => {\n if (messageIterator === undefined) {\n // Lazy definition so that errors in the method call are reported correctly.\n // Also allows recovery via retries in case of transient errors.\n messageIterator = chatThreadClient.listMessages({ maxPageSize: 50 });\n }\n if (readReceiptIterator === undefined) {\n readReceiptIterator = chatThreadClient.listReadReceipts();\n }\n // get the earliest message time\n let remainingMessagesToGet = messagesToLoad;\n let isAllChatMessagesLoaded = false;\n let earliestTime = Number.MAX_SAFE_INTEGER;\n while (remainingMessagesToGet >= 1) {\n const message = await messageIterator.next();\n if (message?.value?.id) {\n if (parseInt(message.value.id) < earliestTime) {\n earliestTime = parseInt(message.value.id);\n }\n }\n\n if (message.value?.type && message.value.type === 'text') {\n remainingMessagesToGet--;\n }\n\n // We have traversed all messages in this thread\n if (message.done) {\n isAllChatMessagesLoaded = true;\n break;\n }\n }\n // keep fetching read receipts until read receipt time < earlist message time\n let readReceipt = await readReceiptIterator.next();\n while (!readReceipt.done && parseInt(readReceipt?.value?.chatMessageId) >= earliestTime) {\n readReceipt = await readReceiptIterator.next();\n }\n\n return isAllChatMessagesLoaded;\n }\n };\n }\n);\n\n/**\n * Create a set of default handlers for given component.\n *\n * Returned object is memoized (with reference to the arguments) to avoid\n * renders when used as props for React Components.\n *\n * @public\n */\nexport const createDefaultChatHandlersForComponent = <Props>(\n chatClient: StatefulChatClient,\n chatThreadClient: ChatThreadClient,\n _: (props: Props) => ReactElement | null\n): Common<ChatHandlers, Props> => {\n return createDefaultChatHandlers(chatClient, chatThreadClient);\n};\n"]}
@@ -23,7 +23,7 @@ const memoizedAllConvertChatMessage = memoizeFnAll((_key, chatMessage, userId, i
23
23
  return convertToUiSystemMessage(chatMessage);
24
24
  }
25
25
  });
26
- /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
26
+ /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
27
27
  const extractAttachmentMetadata = (metadata) => {
28
28
  const attachmentMetadata = metadata.fileSharingMetadata;
29
29
  if (!attachmentMetadata) {
@@ -37,7 +37,7 @@ const extractAttachmentMetadata = (metadata) => {
37
37
  return [];
38
38
  }
39
39
  };
40
- /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
40
+ /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
41
41
  const extractTeamsAttachmentsMetadata = (rawAttachments) => {
42
42
  const attachments = [];
43
43
  rawAttachments.forEach((rawAttachment) => {
@@ -71,7 +71,7 @@ const convertToUiBlockedMessage = (message, userId, isSeen, isLargeGroup) => {
71
71
  link: DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL
72
72
  };
73
73
  };
74
- /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
74
+ /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
75
75
  const extractAttachmentUrl = (attachment) => {
76
76
  return attachment.previewUrl ? attachment.previewUrl : attachment.url || '';
77
77
  };
@@ -144,7 +144,7 @@ const extractAttachmentContentTypeFromName = (name) => {
144
144
  const contentType = name.substring(indexOfLastDot + 1);
145
145
  return contentType;
146
146
  };
147
- /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
147
+ /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
148
148
  const extractAttachmentsMetadata = (message) => {
149
149
  var _a, _b;
150
150
  let attachments = [];
@@ -159,7 +159,7 @@ const extractAttachmentsMetadata = (message) => {
159
159
  };
160
160
  const convertToUiChatMessage = (message, userId, isSeen, isLargeGroup) => {
161
161
  const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;
162
- /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
162
+ /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
163
163
  const { attachments } = extractAttachmentsMetadata(message);
164
164
  return {
165
165
  messageType: 'chat',
@@ -175,7 +175,7 @@ const convertToUiChatMessage = (message, userId, isSeen, isLargeGroup) => {
175
175
  deletedOn: message.deletedOn,
176
176
  mine: messageSenderId === userId,
177
177
  metadata: message.metadata,
178
- /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
178
+ /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
179
179
  attachments
180
180
  };
181
181
  };
@@ -1 +1 @@
1
- {"version":3,"file":"messageThreadSelector.js","sourceRoot":"","sources":["../../../../../chat-component-bindings/src/messageThreadSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,YAAY,EAAE,gCAAgC;AAWvD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,uDAAuD;AACvD,OAAO,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAQhF,MAAM,6BAA6B,GAAG,YAAY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,OAAO,CAAC,QAAQ,0CAAE,mBAAmB,MAAI,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,WAAW,0CAAE,MAAM,CAAA,EAAE,CAAC;QAClF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,uDAAuD;IACvD,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,OAAO,MAAK,EAAE,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA0B,+BAA+B,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n ChatBaseSelectorProps,\n getChatMessages,\n getIsLargeGroup,\n getLatestReadTime,\n getParticipants,\n getReadReceipts,\n getUserId\n} from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatClientState, ChatMessageWithStatus, ResourceFetchResult } from '@internal/chat-stateful-client';\nimport { memoizeFnAll } from '@internal/acs-ui-common';\nimport {\n ChatMessage,\n Message,\n CommunicationParticipant,\n SystemMessage,\n MessageContentType,\n ReadReceiptsBySenderId\n} from '@internal/react-components';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '@internal/react-components';\nimport { createSelector } from 'reselect';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL } from './utils/constants';\nimport { ACSKnownMessageType } from './utils/constants';\nimport { updateMessagesWithAttached } from './utils/updateMessagesWithAttached';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { ChatAttachment } from '@azure/communication-chat';\nimport type { ChatParticipant } from '@azure/communication-chat';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { ChatAttachmentType } from '@internal/react-components';\n\nconst memoizedAllConvertChatMessage = memoizeFnAll(\n (\n _key: string,\n chatMessage: ChatMessageWithStatus,\n userId: string,\n isSeen: boolean,\n isLargeGroup: boolean\n ): Message => {\n const messageType = chatMessage.type.toLowerCase();\n /* @conditional-compile-remove(data-loss-prevention) */\n if (chatMessage.policyViolation) {\n return convertToUiBlockedMessage(chatMessage, userId, isSeen, isLargeGroup);\n }\n if (\n messageType === ACSKnownMessageType.text ||\n messageType === ACSKnownMessageType.richtextHtml ||\n messageType === ACSKnownMessageType.html\n ) {\n return convertToUiChatMessage(chatMessage, userId, isSeen, isLargeGroup);\n } else {\n return convertToUiSystemMessage(chatMessage);\n }\n }\n);\n\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nconst extractAttachmentMetadata = (metadata: Record<string, string>): AttachmentMetadata[] => {\n const attachmentMetadata = metadata.fileSharingMetadata;\n if (!attachmentMetadata) {\n return [];\n }\n try {\n return JSON.parse(attachmentMetadata);\n } catch (e) {\n console.error(e);\n return [];\n }\n};\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nconst extractTeamsAttachmentsMetadata = (\n rawAttachments: ChatAttachment[]\n): {\n attachments: AttachmentMetadata[];\n} => {\n const attachments: AttachmentMetadata[] = [];\n rawAttachments.forEach((rawAttachment) => {\n const attachmentType = rawAttachment.attachmentType as ChatAttachmentType;\n if (attachmentType === 'file') {\n attachments.push({\n id: rawAttachment.id,\n name: rawAttachment.name ?? '',\n url: extractAttachmentUrl(rawAttachment)\n });\n }\n });\n return {\n attachments\n };\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\nconst convertToUiBlockedMessage = (\n message: ChatMessageWithStatus,\n userId: string,\n isSeen: boolean,\n isLargeGroup: boolean\n): BlockedMessage => {\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n return {\n messageType: 'blocked',\n createdOn: message.createdOn,\n warningText: undefined,\n status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,\n senderDisplayName: message.senderDisplayName,\n senderId: messageSenderId,\n messageId: message.id,\n deletedOn: message.deletedOn,\n mine: messageSenderId === userId,\n link: DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL\n };\n};\n\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nconst extractAttachmentUrl = (attachment: ChatAttachment): string => {\n return attachment.previewUrl ? attachment.previewUrl : attachment.url || '';\n};\nconst processChatMessageContent = (message: ChatMessageWithStatus): string | undefined => {\n let content = message.content?.message;\n if (\n message.content?.attachments &&\n message.content?.attachments.length > 0 &&\n sanitizedMessageContentType(message.type).includes('html')\n ) {\n const attachments: ChatAttachment[] = message.content?.attachments;\n // Fill in the src here\n if (content) {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n const attachmentPreviewUrl = attachments.find((attachment) => attachment.id === img.id)?.previewUrl;\n if (attachmentPreviewUrl) {\n const resourceCache = message.resourceCache?.[attachmentPreviewUrl];\n img.src = getResourceSourceUrl(resourceCache);\n }\n });\n content = document.body.innerHTML;\n }\n\n const teamsImageHtmlContent = attachments\n .filter(\n (attachment) =>\n attachment.attachmentType === 'image' &&\n attachment.previewUrl !== undefined &&\n !message.content?.message?.includes(attachment.id)\n )\n .map((attachment) => generateImageAttachmentImgHtml(message, attachment))\n .join('');\n if (teamsImageHtmlContent) {\n return (content ?? '') + teamsImageHtmlContent;\n }\n }\n return content;\n};\n\nconst generateImageAttachmentImgHtml = (message: ChatMessageWithStatus, attachment: ChatAttachment): string => {\n if (attachment.previewUrl !== undefined) {\n const contentType = extractAttachmentContentTypeFromName(attachment.name);\n const resourceCache = message.resourceCache?.[attachment.previewUrl];\n const src = getResourceSourceUrl(resourceCache);\n\n return `\\r\\n<p><img alt=\"image\" src=\"${src}\" itemscope=\"${contentType}\" id=\"${attachment.id}\"></p>`;\n }\n\n return '';\n};\n\nconst getResourceSourceUrl = (result?: ResourceFetchResult): string => {\n let src = '';\n if (result) {\n if (result.error || !result.sourceUrl) {\n // In case of an error we set src to some invalid value to show broken image\n src = 'blob://';\n } else {\n src = result.sourceUrl;\n }\n }\n return src;\n};\n\nconst extractAttachmentContentTypeFromName = (name?: string): string => {\n if (name === undefined) {\n return '';\n }\n const indexOfLastDot = name.lastIndexOf('.');\n if (indexOfLastDot === undefined || indexOfLastDot < 0) {\n return '';\n }\n const contentType = name.substring(indexOfLastDot + 1);\n return contentType;\n};\n\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nconst extractAttachmentsMetadata = (message: ChatMessageWithStatus): { attachments?: AttachmentMetadata[] } => {\n let attachments: AttachmentMetadata[] = [];\n if (message.metadata) {\n attachments = attachments.concat(extractAttachmentMetadata(message.metadata));\n }\n if (message.content?.attachments) {\n const teamsAttachments = extractTeamsAttachmentsMetadata(message.content?.attachments);\n attachments = attachments.concat(teamsAttachments.attachments);\n }\n return { attachments: attachments.length > 0 ? attachments : undefined };\n};\nconst convertToUiChatMessage = (\n message: ChatMessageWithStatus,\n userId: string,\n isSeen: boolean,\n isLargeGroup: boolean\n): ChatMessage => {\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const { attachments } = extractAttachmentsMetadata(message);\n return {\n messageType: 'chat',\n createdOn: message.createdOn,\n content: processChatMessageContent(message),\n contentType: sanitizedMessageContentType(message.type),\n status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,\n senderDisplayName: message.senderDisplayName,\n senderId: messageSenderId,\n messageId: message.id,\n clientMessageId: message.clientMessageId,\n editedOn: message.editedOn,\n deletedOn: message.deletedOn,\n mine: messageSenderId === userId,\n metadata: message.metadata,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n attachments\n };\n};\nconst convertToUiSystemMessage = (message: ChatMessageWithStatus): SystemMessage => {\n const systemMessageType = message.type;\n if (systemMessageType === 'participantAdded' || systemMessageType === 'participantRemoved') {\n return {\n messageType: 'system',\n systemMessageType,\n createdOn: message.createdOn,\n participants:\n message.content?.participants\n // TODO: In our moderator logic, we use undefined name as our displayName for moderator, which should be filtered out\n // Once we have a better solution to identify the moderator, remove this line\n ?.filter((participant: ChatParticipant) => participant.displayName && participant.displayName !== '')\n .map(\n (participant: ChatParticipant): CommunicationParticipant => ({\n userId: toFlatCommunicationIdentifier(participant.id),\n displayName: participant.displayName\n })\n ) ?? [],\n messageId: message.id,\n iconName: systemMessageType === 'participantAdded' ? 'PeopleAdd' : 'PeopleBlock'\n };\n } else {\n // Only topic updated type left, according to ACSKnown type\n return {\n messageType: 'system',\n systemMessageType: 'topicUpdated',\n createdOn: message.createdOn,\n topic: message.content?.topic ?? '',\n messageId: message.id,\n iconName: 'Edit'\n };\n }\n};\n\n/**\n * Selector type for {@link MessageThread} component.\n *\n * @public\n */\nexport type MessageThreadSelector = (\n state: ChatClientState,\n props: ChatBaseSelectorProps\n) => {\n userId: string;\n showMessageStatus: boolean;\n messages: Message[];\n};\n\n/** Returns `true` if the message has participants and at least one participant has a display name. */\nconst hasValidParticipant = (chatMessage: ChatMessageWithStatus): boolean =>\n !!chatMessage.content?.participants && chatMessage.content.participants.some((p: ChatParticipant) => !!p.displayName);\n\n/**\n *\n * @private\n */\nexport const messageThreadSelectorWithThread: () => MessageThreadSelector = () =>\n createSelector(\n [getUserId, getChatMessages, getLatestReadTime, getIsLargeGroup, getReadReceipts, getParticipants],\n (userId, chatMessages, latestReadTime, isLargeGroup, readReceipts, participants) => {\n // We can't get displayName in teams meeting interop for now, disable rr feature when it is teams interop\n const isTeamsInterop = Object.values(participants).find((p) => 'microsoftTeamsUserId' in p.id) !== undefined;\n\n // get number of participants\n // filter out the non valid participants (no display name)\n // Read Receipt details will be disabled when participant count is 0\n const participantCount = isTeamsInterop\n ? undefined\n : Object.values(participants).filter((p) => p.displayName && p.displayName !== '').length;\n\n // creating key value pairs of senderID: last read message information\n\n const readReceiptsBySenderId: ReadReceiptsBySenderId = {};\n\n // readReceiptsBySenderId[senderID] gets updated every time a new message is read by this sender\n // in this way we can make sure that we are only saving the latest read message id and read on time for each sender\n readReceipts\n .filter((r) => r.sender && toFlatCommunicationIdentifier(r.sender) !== userId)\n .forEach((r) => {\n readReceiptsBySenderId[toFlatCommunicationIdentifier(r.sender)] = {\n lastReadMessage: r.chatMessageId,\n displayName: participants[toFlatCommunicationIdentifier(r.sender)]?.displayName ?? ''\n };\n });\n\n // A function takes parameter above and generate return value\n const convertedMessages = memoizedAllConvertChatMessage((memoizedFn) =>\n Object.values(chatMessages)\n .filter(\n (message) =>\n message.type.toLowerCase() === ACSKnownMessageType.text ||\n message.type.toLowerCase() === ACSKnownMessageType.richtextHtml ||\n message.type.toLowerCase() === ACSKnownMessageType.html ||\n (message.type === ACSKnownMessageType.participantAdded && hasValidParticipant(message)) ||\n (message.type === ACSKnownMessageType.participantRemoved && hasValidParticipant(message)) ||\n // TODO: Add support for topicUpdated system messages in MessageThread component.\n // message.type === ACSKnownMessageType.topicUpdated ||\n message.clientMessageId !== undefined\n )\n .filter(isMessageValidToRender)\n .map((message) => {\n return memoizedFn(\n message.id ?? message.clientMessageId,\n message,\n userId,\n message.createdOn <= latestReadTime,\n isLargeGroup\n );\n })\n );\n updateMessagesWithAttached(convertedMessages);\n return {\n userId,\n showMessageStatus: true,\n messages: convertedMessages,\n participantCount,\n readReceiptsBySenderId\n };\n }\n );\nconst sanitizedMessageContentType = (type: string): MessageContentType => {\n const lowerCaseType = type.toLowerCase();\n return lowerCaseType === 'text' || lowerCaseType === 'html' || lowerCaseType === 'richtext/html'\n ? lowerCaseType\n : 'unknown';\n};\nconst isMessageValidToRender = (message: ChatMessageWithStatus): boolean => {\n if (message.deletedOn) {\n return false;\n }\n if (message.metadata?.fileSharingMetadata || message.content?.attachments?.length) {\n return true;\n }\n /* @conditional-compile-remove(data-loss-prevention) */\n if (message.policyViolation) {\n return true;\n }\n return !!(message.content && message.content?.message !== '');\n};\n\n/**\n * Selector for {@link MessageThread} component.\n *\n * @public\n */\nexport const messageThreadSelector: MessageThreadSelector = messageThreadSelectorWithThread();\n"]}
1
+ {"version":3,"file":"messageThreadSelector.js","sourceRoot":"","sources":["../../../../../chat-component-bindings/src/messageThreadSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,YAAY,EAAE,gCAAgC;AAWvD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,uDAAuD;AACvD,OAAO,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAQhF,MAAM,6BAA6B,GAAG,YAAY,CAChD,CACE,IAAY,EACZ,WAAkC,EAClC,MAAc,EACd,MAAe,EACf,YAAqB,EACZ,EAAE;IACX,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACnD,uDAAuD;IACvD,IAAI,WAAW,CAAC,eAAe,EAAE,CAAC;QAChC,OAAO,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC9E,CAAC;IACD,IACE,WAAW,KAAK,mBAAmB,CAAC,IAAI;QACxC,WAAW,KAAK,mBAAmB,CAAC,YAAY;QAChD,WAAW,KAAK,mBAAmB,CAAC,IAAI,EACxC,CAAC;QACD,OAAO,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAA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microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n ChatBaseSelectorProps,\n getChatMessages,\n getIsLargeGroup,\n getLatestReadTime,\n getParticipants,\n getReadReceipts,\n getUserId\n} from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatClientState, ChatMessageWithStatus, ResourceFetchResult } from '@internal/chat-stateful-client';\nimport { memoizeFnAll } from '@internal/acs-ui-common';\nimport {\n ChatMessage,\n Message,\n CommunicationParticipant,\n SystemMessage,\n MessageContentType,\n ReadReceiptsBySenderId\n} from '@internal/react-components';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '@internal/react-components';\nimport { createSelector } from 'reselect';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL } from './utils/constants';\nimport { ACSKnownMessageType } from './utils/constants';\nimport { updateMessagesWithAttached } from './utils/updateMessagesWithAttached';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { ChatAttachment } from '@azure/communication-chat';\nimport type { ChatParticipant } from '@azure/communication-chat';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nimport { ChatAttachmentType } from '@internal/react-components';\n\nconst memoizedAllConvertChatMessage = memoizeFnAll(\n (\n _key: string,\n chatMessage: ChatMessageWithStatus,\n userId: string,\n isSeen: boolean,\n isLargeGroup: boolean\n ): Message => {\n const messageType = chatMessage.type.toLowerCase();\n /* @conditional-compile-remove(data-loss-prevention) */\n if (chatMessage.policyViolation) {\n return convertToUiBlockedMessage(chatMessage, userId, isSeen, isLargeGroup);\n }\n if (\n messageType === ACSKnownMessageType.text ||\n messageType === ACSKnownMessageType.richtextHtml ||\n messageType === ACSKnownMessageType.html\n ) {\n return convertToUiChatMessage(chatMessage, userId, isSeen, isLargeGroup);\n } else {\n return convertToUiSystemMessage(chatMessage);\n }\n }\n);\n\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nconst extractAttachmentMetadata = (metadata: Record<string, string>): AttachmentMetadata[] => {\n const attachmentMetadata = metadata.fileSharingMetadata;\n if (!attachmentMetadata) {\n return [];\n }\n try {\n return JSON.parse(attachmentMetadata);\n } catch (e) {\n console.error(e);\n return [];\n }\n};\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nconst extractTeamsAttachmentsMetadata = (\n rawAttachments: ChatAttachment[]\n): {\n attachments: AttachmentMetadata[];\n} => {\n const attachments: AttachmentMetadata[] = [];\n rawAttachments.forEach((rawAttachment) => {\n const attachmentType = rawAttachment.attachmentType as ChatAttachmentType;\n if (attachmentType === 'file') {\n attachments.push({\n id: rawAttachment.id,\n name: rawAttachment.name ?? '',\n url: extractAttachmentUrl(rawAttachment)\n });\n }\n });\n return {\n attachments\n };\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\nconst convertToUiBlockedMessage = (\n message: ChatMessageWithStatus,\n userId: string,\n isSeen: boolean,\n isLargeGroup: boolean\n): BlockedMessage => {\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n return {\n messageType: 'blocked',\n createdOn: message.createdOn,\n warningText: undefined,\n status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,\n senderDisplayName: message.senderDisplayName,\n senderId: messageSenderId,\n messageId: message.id,\n deletedOn: message.deletedOn,\n mine: messageSenderId === userId,\n link: DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL\n };\n};\n\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nconst extractAttachmentUrl = (attachment: ChatAttachment): string => {\n return attachment.previewUrl ? attachment.previewUrl : attachment.url || '';\n};\nconst processChatMessageContent = (message: ChatMessageWithStatus): string | undefined => {\n let content = message.content?.message;\n if (\n message.content?.attachments &&\n message.content?.attachments.length > 0 &&\n sanitizedMessageContentType(message.type).includes('html')\n ) {\n const attachments: ChatAttachment[] = message.content?.attachments;\n // Fill in the src here\n if (content) {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n const attachmentPreviewUrl = attachments.find((attachment) => attachment.id === img.id)?.previewUrl;\n if (attachmentPreviewUrl) {\n const resourceCache = message.resourceCache?.[attachmentPreviewUrl];\n img.src = getResourceSourceUrl(resourceCache);\n }\n });\n content = document.body.innerHTML;\n }\n\n const teamsImageHtmlContent = attachments\n .filter(\n (attachment) =>\n attachment.attachmentType === 'image' &&\n attachment.previewUrl !== undefined &&\n !message.content?.message?.includes(attachment.id)\n )\n .map((attachment) => generateImageAttachmentImgHtml(message, attachment))\n .join('');\n if (teamsImageHtmlContent) {\n return (content ?? '') + teamsImageHtmlContent;\n }\n }\n return content;\n};\n\nconst generateImageAttachmentImgHtml = (message: ChatMessageWithStatus, attachment: ChatAttachment): string => {\n if (attachment.previewUrl !== undefined) {\n const contentType = extractAttachmentContentTypeFromName(attachment.name);\n const resourceCache = message.resourceCache?.[attachment.previewUrl];\n const src = getResourceSourceUrl(resourceCache);\n\n return `\\r\\n<p><img alt=\"image\" src=\"${src}\" itemscope=\"${contentType}\" id=\"${attachment.id}\"></p>`;\n }\n\n return '';\n};\n\nconst getResourceSourceUrl = (result?: ResourceFetchResult): string => {\n let src = '';\n if (result) {\n if (result.error || !result.sourceUrl) {\n // In case of an error we set src to some invalid value to show broken image\n src = 'blob://';\n } else {\n src = result.sourceUrl;\n }\n }\n return src;\n};\n\nconst extractAttachmentContentTypeFromName = (name?: string): string => {\n if (name === undefined) {\n return '';\n }\n const indexOfLastDot = name.lastIndexOf('.');\n if (indexOfLastDot === undefined || indexOfLastDot < 0) {\n return '';\n }\n const contentType = name.substring(indexOfLastDot + 1);\n return contentType;\n};\n\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nconst extractAttachmentsMetadata = (message: ChatMessageWithStatus): { attachments?: AttachmentMetadata[] } => {\n let attachments: AttachmentMetadata[] = [];\n if (message.metadata) {\n attachments = attachments.concat(extractAttachmentMetadata(message.metadata));\n }\n if (message.content?.attachments) {\n const teamsAttachments = extractTeamsAttachmentsMetadata(message.content?.attachments);\n attachments = attachments.concat(teamsAttachments.attachments);\n }\n return { attachments: attachments.length > 0 ? attachments : undefined };\n};\nconst convertToUiChatMessage = (\n message: ChatMessageWithStatus,\n userId: string,\n isSeen: boolean,\n isLargeGroup: boolean\n): ChatMessage => {\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n const { attachments } = extractAttachmentsMetadata(message);\n return {\n messageType: 'chat',\n createdOn: message.createdOn,\n content: processChatMessageContent(message),\n contentType: sanitizedMessageContentType(message.type),\n status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,\n senderDisplayName: message.senderDisplayName,\n senderId: messageSenderId,\n messageId: message.id,\n clientMessageId: message.clientMessageId,\n editedOn: message.editedOn,\n deletedOn: message.deletedOn,\n mine: messageSenderId === userId,\n metadata: message.metadata,\n /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\n attachments\n };\n};\nconst convertToUiSystemMessage = (message: ChatMessageWithStatus): SystemMessage => {\n const systemMessageType = message.type;\n if (systemMessageType === 'participantAdded' || systemMessageType === 'participantRemoved') {\n return {\n messageType: 'system',\n systemMessageType,\n createdOn: message.createdOn,\n participants:\n message.content?.participants\n // TODO: In our moderator logic, we use undefined name as our displayName for moderator, which should be filtered out\n // Once we have a better solution to identify the moderator, remove this line\n ?.filter((participant: ChatParticipant) => participant.displayName && participant.displayName !== '')\n .map(\n (participant: ChatParticipant): CommunicationParticipant => ({\n userId: toFlatCommunicationIdentifier(participant.id),\n displayName: participant.displayName\n })\n ) ?? [],\n messageId: message.id,\n iconName: systemMessageType === 'participantAdded' ? 'PeopleAdd' : 'PeopleBlock'\n };\n } else {\n // Only topic updated type left, according to ACSKnown type\n return {\n messageType: 'system',\n systemMessageType: 'topicUpdated',\n createdOn: message.createdOn,\n topic: message.content?.topic ?? '',\n messageId: message.id,\n iconName: 'Edit'\n };\n }\n};\n\n/**\n * Selector type for {@link MessageThread} component.\n *\n * @public\n */\nexport type MessageThreadSelector = (\n state: ChatClientState,\n props: ChatBaseSelectorProps\n) => {\n userId: string;\n showMessageStatus: boolean;\n messages: Message[];\n};\n\n/** Returns `true` if the message has participants and at least one participant has a display name. */\nconst hasValidParticipant = (chatMessage: ChatMessageWithStatus): boolean =>\n !!chatMessage.content?.participants && chatMessage.content.participants.some((p: ChatParticipant) => !!p.displayName);\n\n/**\n *\n * @private\n */\nexport const messageThreadSelectorWithThread: () => MessageThreadSelector = () =>\n createSelector(\n [getUserId, getChatMessages, getLatestReadTime, getIsLargeGroup, getReadReceipts, getParticipants],\n (userId, chatMessages, latestReadTime, isLargeGroup, readReceipts, participants) => {\n // We can't get displayName in teams meeting interop for now, disable rr feature when it is teams interop\n const isTeamsInterop = Object.values(participants).find((p) => 'microsoftTeamsUserId' in p.id) !== undefined;\n\n // get number of participants\n // filter out the non valid participants (no display name)\n // Read Receipt details will be disabled when participant count is 0\n const participantCount = isTeamsInterop\n ? undefined\n : Object.values(participants).filter((p) => p.displayName && p.displayName !== '').length;\n\n // creating key value pairs of senderID: last read message information\n\n const readReceiptsBySenderId: ReadReceiptsBySenderId = {};\n\n // readReceiptsBySenderId[senderID] gets updated every time a new message is read by this sender\n // in this way we can make sure that we are only saving the latest read message id and read on time for each sender\n readReceipts\n .filter((r) => r.sender && toFlatCommunicationIdentifier(r.sender) !== userId)\n .forEach((r) => {\n readReceiptsBySenderId[toFlatCommunicationIdentifier(r.sender)] = {\n lastReadMessage: r.chatMessageId,\n displayName: participants[toFlatCommunicationIdentifier(r.sender)]?.displayName ?? ''\n };\n });\n\n // A function takes parameter above and generate return value\n const convertedMessages = memoizedAllConvertChatMessage((memoizedFn) =>\n Object.values(chatMessages)\n .filter(\n (message) =>\n message.type.toLowerCase() === ACSKnownMessageType.text ||\n message.type.toLowerCase() === ACSKnownMessageType.richtextHtml ||\n message.type.toLowerCase() === ACSKnownMessageType.html ||\n (message.type === ACSKnownMessageType.participantAdded && hasValidParticipant(message)) ||\n (message.type === ACSKnownMessageType.participantRemoved && hasValidParticipant(message)) ||\n // TODO: Add support for topicUpdated system messages in MessageThread component.\n // message.type === ACSKnownMessageType.topicUpdated ||\n message.clientMessageId !== undefined\n )\n .filter(isMessageValidToRender)\n .map((message) => {\n return memoizedFn(\n message.id ?? message.clientMessageId,\n message,\n userId,\n message.createdOn <= latestReadTime,\n isLargeGroup\n );\n })\n );\n updateMessagesWithAttached(convertedMessages);\n return {\n userId,\n showMessageStatus: true,\n messages: convertedMessages,\n participantCount,\n readReceiptsBySenderId\n };\n }\n );\nconst sanitizedMessageContentType = (type: string): MessageContentType => {\n const lowerCaseType = type.toLowerCase();\n return lowerCaseType === 'text' || lowerCaseType === 'html' || lowerCaseType === 'richtext/html'\n ? lowerCaseType\n : 'unknown';\n};\nconst isMessageValidToRender = (message: ChatMessageWithStatus): boolean => {\n if (message.deletedOn) {\n return false;\n }\n if (message.metadata?.fileSharingMetadata || message.content?.attachments?.length) {\n return true;\n }\n /* @conditional-compile-remove(data-loss-prevention) */\n if (message.policyViolation) {\n return true;\n }\n return !!(message.content && message.content?.message !== '');\n};\n\n/**\n * Selector for {@link MessageThread} component.\n *\n * @public\n */\nexport const messageThreadSelector: MessageThreadSelector = messageThreadSelectorWithThread();\n"]}
@@ -49,8 +49,10 @@ export type { BlockedMessage } from '../../react-components/src';
49
49
  export type { DialpadMode, DialpadProps, DialpadStrings, DialpadStyles, DtmfTone, LongPressTrigger } from '../../react-components/src';
50
50
  export type { AttachmentOptions } from '../../react-components/src';
51
51
  export type { SendBoxErrorBarError } from '../../react-components/src';
52
- export type { AttachmentActionHandler, AttachmentSelectionHandler, AttachmentRemovalHandler, AttachmentUploadOptions, AttachmentUploadTask } from '../../react-components/src';
53
- export type { AttachmentMetadata, AttachmentMetadataInProgress, AttachmentProgressError } from '../../acs-ui-common/src';
52
+ export type { AttachmentActionHandler } from '../../react-components/src';
53
+ export type { AttachmentSelectionHandler, AttachmentRemovalHandler, AttachmentUploadOptions, AttachmentUploadTask } from '../../react-components/src';
54
+ export type { AttachmentMetadata } from '../../acs-ui-common/src';
55
+ export type { AttachmentMetadataInProgress, AttachmentProgressError } from '../../acs-ui-common/src';
54
56
  export type { AttachmentMenuAction, AttachmentDownloadOptions } from '../../react-components/src';
55
57
  export { defaultAttachmentMenuAction } from '../../react-components/src';
56
58
  export type { ChatAttachmentType } from '../../react-components/src';
@@ -31,7 +31,7 @@ export { Dialpad } from '../../react-components/src';
31
31
  export { CameraAndMicrophoneSitePermissions, MicrophoneSitePermissions, CameraSitePermissions } from '../../react-components/src';
32
32
  /* @conditional-compile-remove(rich-text-editor) */
33
33
  export { RichTextSendBox } from '../../react-components/src';
34
- /* @conditional-compile-remove(attachment-download) */
34
+ /* @conditional-compile-remove(file-sharing-acs) */
35
35
  export { defaultAttachmentMenuAction } from '../../react-components/src';
36
36
  export * from '../../react-components/src/localization/locales';
37
37
  export * from '../../react-components/src/theming';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAoCzG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAE9C,yDAAyD;AACzD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iCAAi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C,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAG/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAe1E,cAAc,yCAAyC,CAAC;AACxD,cAAc,eAAe,CAAC;AAE9B,sDAAsD;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,sDAAsD;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,sDAAsD;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAgBxE,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * `@azure/communication-react` is an npm package that exports the functionality of the Azure Communication Services - UI Library.\n *\n * This package makes it easy for you to build modern communications user experiences using Azure Communication Services. It gives you a library of production-ready UI components that you can drop into your applications:\n * - Composites: These components are turn-key solutions that implement common communication scenarios. You can quickly add video calling or chat experiences to your applications. Composites are open-source higher order components built using UI components.\n * - UI Components - These components are open-source building blocks that let you build custom communications experience. Components are offered for both calling and chat capabilities that can be combined to build experiences.\n *\n * These UI client libraries all use Microsoft's Fluent design language and assets. Fluent UI provides a foundational layer for the UI Library and is actively used across Microsoft products.\n *\n * In conjunction with the UI components, the UI Library exposes a stateful client library for calling and chat. This client is agnostic to any specific state management framework and can be integrated with common state managers like Redux or React Context.\n * This stateful client library can be used with the UI Components to pass props and methods for the UI Components to render data. For more information, see Stateful Client Overview.\n *\n * For more information visit: https://aka.ms/acsstorybook\n *\n * @packageDocumentation\n */\n\nexport { fromFlatCommunicationIdentifier, toFlatCommunicationIdentifier } from '../../acs-ui-common/src';\nexport type {\n AreEqual,\n CommonProperties,\n MessageStatus,\n Common,\n AreTypeEqual,\n AreParamEqual\n} from '../../acs-ui-common/src';\n\n// Not to export chat/calling specific hook from binding package\nexport type {\n CallClientProviderProps,\n CallAgentProviderProps,\n CallProviderProps,\n GetCallingSelector,\n CallingHandlers,\n CallingBaseSelectorProps,\n CommonCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type { VideoBackgroundEffectsDependency, CallingHandlersOptions } from '../../calling-component-bindings/src';\n\nexport type { CaptionsOptions } from '../../calling-component-bindings/src';\n\nexport type {\n ChatClientProviderProps,\n ChatThreadClientProviderProps,\n GetChatSelector,\n ChatHandlers,\n ChatBaseSelectorProps\n} from '../../chat-component-bindings/src';\n\n/* @conditional-compile-remove(attachment-upload) */\nexport type { MessageOptions, ChatMessageType } from '../../acs-ui-common/src';\n\nexport {\n CallClientProvider,\n CallAgentProvider,\n CallProvider,\n useCallClient,\n useCallAgent,\n useCall,\n useDeviceManager,\n getCallingSelector,\n createDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport {\n useTeamsCallAgent,\n useTeamsCall,\n createDefaultTeamsCallingHandlers\n} from '../../calling-component-bindings/src';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport type { TeamsCallingHandlers } from '../../calling-component-bindings/src';\n\nexport type {\n ScreenShareButtonSelector,\n CameraButtonSelector,\n VideoGallerySelector,\n DevicesButtonSelector,\n EmptySelector,\n ErrorBarSelector as CallErrorBarSelector,\n ParticipantListSelector,\n MicrophoneButtonSelector,\n ParticipantsButtonSelector,\n CreateDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { RaiseHandButtonSelector } from '../../calling-component-bindings/src';\n\nexport {\n ChatClientProvider,\n ChatThreadClientProvider,\n useChatClient,\n useChatThreadClient,\n getChatSelector,\n createDefaultChatHandlers\n} from '../../chat-component-bindings/src';\n\nexport type {\n MessageThreadSelector,\n TypingIndicatorSelector,\n ChatParticipantListSelector,\n SendBoxSelector,\n ErrorBarSelector as ChatErrorBarSelector\n} from '../../chat-component-bindings/src';\n\nexport {\n _IdentifierProvider,\n CameraButton,\n ControlBar,\n ControlBarButton,\n DevicesButton,\n EndCallButton,\n ErrorBar,\n GridLayout,\n LocalizationProvider,\n MessageStatusIndicator,\n MessageThread,\n MicrophoneButton,\n ParticipantItem,\n ParticipantList,\n ParticipantsButton,\n ScreenShareButton,\n SendBox,\n StreamMedia,\n TypingIndicator,\n VideoGallery,\n VideoTile,\n COMPONENT_LOCALE_EN_GB,\n COMPONENT_LOCALE_AR_SA,\n COMPONENT_LOCALE_CS_CZ,\n COMPONENT_LOCALE_DE_DE,\n COMPONENT_LOCALE_ES_ES,\n COMPONENT_LOCALE_FI_FI,\n COMPONENT_LOCALE_FR_FR,\n COMPONENT_LOCALE_HE_IL,\n COMPONENT_LOCALE_IT_IT,\n COMPONENT_LOCALE_JA_JP,\n COMPONENT_LOCALE_KO_KR,\n COMPONENT_LOCALE_NB_NO,\n COMPONENT_LOCALE_NL_NL,\n COMPONENT_LOCALE_PL_PL,\n COMPONENT_LOCALE_PT_BR,\n COMPONENT_LOCALE_RU_RU,\n COMPONENT_LOCALE_SV_SE,\n COMPONENT_LOCALE_TR_TR,\n COMPONENT_LOCALE_ZH_CN,\n COMPONENT_LOCALE_ZH_TW\n} from '../../react-components/src';\nexport { ImageOverlay } from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport { HoldButton } from '../../react-components/src';\n\nexport { RaiseHandButton } from '../../react-components/src';\n\nexport { Dialpad } from '../../react-components/src';\n\n/* @conditional-compile-remove(call-readiness) */\nexport {\n CameraAndMicrophoneSitePermissions,\n MicrophoneSitePermissions,\n CameraSitePermissions\n} from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n CameraAndMicrophoneSitePermissionsStrings,\n CameraAndMicrophoneSitePermissionsProps,\n CameraSitePermissionsStrings,\n CameraSitePermissionsProps,\n CommonSitePermissionsProps,\n SitePermissionsStrings,\n SitePermissionsStyles,\n MicrophoneSitePermissionsStrings,\n MicrophoneSitePermissionsProps\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(total-participant-count) */\nexport type { ParticipantListStrings } from '../../react-components/src';\n\n/* @conditional-compile-remove(mention) */\nexport type {\n MentionOptions,\n MentionDisplayOptions,\n MentionLookupOptions,\n Mention,\n MentionPopoverStrings\n} from '../../react-components/src';\n\nexport type {\n _IdentifierProviderProps,\n _Identifiers,\n ActiveErrorMessage,\n BaseCustomStyles,\n CallParticipantListParticipant,\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles,\n ChatMessage,\n CommunicationParticipant,\n ComponentLocale,\n ComponentSlotStyle,\n ComponentStrings,\n ContentSystemMessage,\n ControlBarButtonProps,\n ControlBarButtonStrings,\n ControlBarButtonStyles,\n ControlBarLayout,\n ControlBarProps,\n CreateVideoStreamViewResult,\n CustomAvatarOptions,\n CustomMessage,\n DevicesButtonContextualMenuStyles,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n EndCallButtonProps,\n EndCallButtonStrings,\n ErrorBarProps,\n ErrorBarStrings,\n ErrorType,\n GridLayoutProps,\n GridLayoutStyles,\n HorizontalGalleryStyles,\n JumpToNewMessageButtonProps,\n LocalizationProviderProps,\n LocalVideoCameraCycleButtonProps,\n LoadingState,\n Message,\n MessageAttachedStatus,\n MessageCommon,\n MessageContentType,\n MessageProps,\n MessageRenderer,\n MessageStatusIndicatorProps,\n MessageStatusIndicatorStrings,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings,\n MicrophoneButtonStyles,\n OnRenderAvatarCallback,\n OptionsDevice,\n ParticipantAddedSystemMessage,\n ParticipantItemProps,\n ParticipantItemStrings,\n ParticipantItemStyles,\n ParticipantListItemStyles,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback,\n ParticipantRemovedSystemMessage,\n ParticipantState,\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles,\n ReadReceiptsBySenderId,\n ScreenShareButtonProps,\n ScreenShareButtonStrings,\n SendBoxProps,\n SendBoxStrings,\n SendBoxStylesProps,\n StreamMediaProps,\n SystemMessage,\n SystemMessageCommon,\n TopicUpdatedSystemMessage,\n TypingIndicatorProps,\n TypingIndicatorStrings,\n TypingIndicatorStylesProps,\n UpdateMessageCallback,\n CancelEditCallback,\n VideoGalleryLayout,\n VideoGalleryLocalParticipant,\n VideoGalleryParticipant,\n VideoGalleryProps,\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoStreamOptions,\n VideoTileProps,\n VideoTileStylesProps,\n ViewScalingMode,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps,\n VideoTilesOptions\n} from '../../react-components/src';\n\nexport type { RaiseHandButtonProps, RaiseHandButtonStrings, RaisedHand } from '../../react-components/src';\nexport type {\n ReactionButtonStrings,\n Reaction,\n ReactionButtonProps,\n ReactionResources,\n ReactionSprite\n} from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport { RichTextSendBox } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextSendBoxProps, RichTextSendBoxStrings, RichTextStrings } from '../../react-components/src';\n/* @conditional-compile-remove(spotlight) */\nexport type { Spotlight } from '../../react-components/src';\nexport type { ImageOverlayProps, ImageOverlayStrings } from '../../react-components/src';\n/* @conditional-compile-remove(data-loss-prevention) */\nexport type { BlockedMessage } from '../../react-components/src';\nexport type {\n DialpadMode,\n DialpadProps,\n DialpadStrings,\n DialpadStyles,\n DtmfTone,\n LongPressTrigger\n} from '../../react-components/src';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nexport type { AttachmentOptions } from '../../react-components/src';\n/* @conditional-compile-remove(attachment-upload) */\nexport type { SendBoxErrorBarError } from '../../react-components/src';\n/* @conditional-compile-remove(attachment-upload) */\nexport type {\n AttachmentActionHandler,\n AttachmentSelectionHandler,\n AttachmentRemovalHandler,\n AttachmentUploadOptions,\n AttachmentUploadTask\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(attachment-upload) */\nexport type {\n AttachmentMetadata,\n AttachmentMetadataInProgress,\n AttachmentProgressError\n} from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(attachment-download) */\nexport type { AttachmentMenuAction, AttachmentDownloadOptions } from '../../react-components/src';\n/* @conditional-compile-remove(attachment-download) */\nexport { defaultAttachmentMenuAction } from '../../react-components/src';\nexport type { ChatAttachmentType } from '../../react-components/src';\nexport type { InlineImageOptions, InlineImage } from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonProps, HoldButtonStrings } from '../../react-components/src';\nexport type { VideoTileStrings } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type { BrowserPermissionDeniedStrings, BrowserPermissionDeniedProps } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedIOSStrings,\n BrowserPermissionDeniedStyles,\n BrowserPermissionDeniedIOSProps\n} from '../../react-components/src';\nexport type { OverflowGalleryPosition } from '../../react-components/src';\nexport type { LocalVideoTileSize } from '../../react-components/src';\nexport * from '../../react-components/src/localization/locales';\nexport * from '../../react-components/src/theming';\nexport * from '../../calling-stateful-client/src/index-public';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeCallAgent } from '../../calling-stateful-client/src';\nexport { createStatefulChatClient } from '../../chat-stateful-client/src';\nexport type {\n StatefulChatClient,\n StatefulChatClientArgs,\n StatefulChatClientOptions,\n ChatMessageWithStatus,\n ChatClientState,\n ChatError,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget\n} from '../../chat-stateful-client/src';\n\nexport type { ResourceFetchResult } from '../../chat-stateful-client/src';\nexport * from '../../react-composites/src/index-public';\nexport * from './mergedHooks';\n\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowser } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowserVersion } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedOperatingSystem } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from '../../react-components/src';\nexport type {\n VerticalGalleryStyles,\n VerticalGalleryStrings,\n VerticalGalleryControlBarStyles\n} from '../../react-components/src';\n\nexport type { SpokenLanguageStrings, CaptionLanguageStrings } from '../../react-components/src';\n\nexport type { SurveyIssues } from '../../react-components/src';\n\nexport type { SurveyIssuesHeadingStrings } from '../../react-components/src';\n\nexport type { CallSurveyImprovementSuggestions } from '../../react-components/src';\n/* @conditional-compile-remove(notifications) */\nexport { Notifications, NotificationBar } from '../../react-components/src';\n/* @conditional-compile-remove(notifications) */\nexport type {\n NotificationsProps,\n NotificationBarProps,\n NotificationBarStrings,\n NotificationsStrings,\n NotificationType,\n ActiveNotification\n} from '../../react-components/src';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAoCzG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,sCAA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,EAAE,MAAM,4BAA4B,CAAC;AAgBzE,cAAc,iDAAiD,CAAC;AAChE,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAG/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAe1E,cAAc,yCAAyC,CAAC;AACxD,cAAc,eAAe,CAAC;AAE9B,sDAAsD;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,sDAAsD;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,sDAAsD;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAgBxE,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * `@azure/communication-react` is an npm package that exports the functionality of the Azure Communication Services - UI Library.\n *\n * This package makes it easy for you to build modern communications user experiences using Azure Communication Services. It gives you a library of production-ready UI components that you can drop into your applications:\n * - Composites: These components are turn-key solutions that implement common communication scenarios. You can quickly add video calling or chat experiences to your applications. Composites are open-source higher order components built using UI components.\n * - UI Components - These components are open-source building blocks that let you build custom communications experience. Components are offered for both calling and chat capabilities that can be combined to build experiences.\n *\n * These UI client libraries all use Microsoft's Fluent design language and assets. Fluent UI provides a foundational layer for the UI Library and is actively used across Microsoft products.\n *\n * In conjunction with the UI components, the UI Library exposes a stateful client library for calling and chat. This client is agnostic to any specific state management framework and can be integrated with common state managers like Redux or React Context.\n * This stateful client library can be used with the UI Components to pass props and methods for the UI Components to render data. For more information, see Stateful Client Overview.\n *\n * For more information visit: https://aka.ms/acsstorybook\n *\n * @packageDocumentation\n */\n\nexport { fromFlatCommunicationIdentifier, toFlatCommunicationIdentifier } from '../../acs-ui-common/src';\nexport type {\n AreEqual,\n CommonProperties,\n MessageStatus,\n Common,\n AreTypeEqual,\n AreParamEqual\n} from '../../acs-ui-common/src';\n\n// Not to export chat/calling specific hook from binding package\nexport type {\n CallClientProviderProps,\n CallAgentProviderProps,\n CallProviderProps,\n GetCallingSelector,\n CallingHandlers,\n CallingBaseSelectorProps,\n CommonCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type { VideoBackgroundEffectsDependency, CallingHandlersOptions } from '../../calling-component-bindings/src';\n\nexport type { CaptionsOptions } from '../../calling-component-bindings/src';\n\nexport type {\n ChatClientProviderProps,\n ChatThreadClientProviderProps,\n GetChatSelector,\n ChatHandlers,\n ChatBaseSelectorProps\n} from '../../chat-component-bindings/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { MessageOptions, ChatMessageType } from '../../acs-ui-common/src';\n\nexport {\n CallClientProvider,\n CallAgentProvider,\n CallProvider,\n useCallClient,\n useCallAgent,\n useCall,\n useDeviceManager,\n getCallingSelector,\n createDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport {\n useTeamsCallAgent,\n useTeamsCall,\n createDefaultTeamsCallingHandlers\n} from '../../calling-component-bindings/src';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport type { TeamsCallingHandlers } from '../../calling-component-bindings/src';\n\nexport type {\n ScreenShareButtonSelector,\n CameraButtonSelector,\n VideoGallerySelector,\n DevicesButtonSelector,\n EmptySelector,\n ErrorBarSelector as CallErrorBarSelector,\n ParticipantListSelector,\n MicrophoneButtonSelector,\n ParticipantsButtonSelector,\n CreateDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { RaiseHandButtonSelector } from '../../calling-component-bindings/src';\n\nexport {\n ChatClientProvider,\n ChatThreadClientProvider,\n useChatClient,\n useChatThreadClient,\n getChatSelector,\n createDefaultChatHandlers\n} from '../../chat-component-bindings/src';\n\nexport type {\n MessageThreadSelector,\n TypingIndicatorSelector,\n ChatParticipantListSelector,\n SendBoxSelector,\n ErrorBarSelector as ChatErrorBarSelector\n} from '../../chat-component-bindings/src';\n\nexport {\n _IdentifierProvider,\n CameraButton,\n ControlBar,\n ControlBarButton,\n DevicesButton,\n EndCallButton,\n ErrorBar,\n GridLayout,\n LocalizationProvider,\n MessageStatusIndicator,\n MessageThread,\n MicrophoneButton,\n ParticipantItem,\n ParticipantList,\n ParticipantsButton,\n ScreenShareButton,\n SendBox,\n StreamMedia,\n TypingIndicator,\n VideoGallery,\n VideoTile,\n COMPONENT_LOCALE_EN_GB,\n COMPONENT_LOCALE_AR_SA,\n COMPONENT_LOCALE_CS_CZ,\n COMPONENT_LOCALE_DE_DE,\n COMPONENT_LOCALE_ES_ES,\n COMPONENT_LOCALE_FI_FI,\n COMPONENT_LOCALE_FR_FR,\n COMPONENT_LOCALE_HE_IL,\n COMPONENT_LOCALE_IT_IT,\n COMPONENT_LOCALE_JA_JP,\n COMPONENT_LOCALE_KO_KR,\n COMPONENT_LOCALE_NB_NO,\n COMPONENT_LOCALE_NL_NL,\n COMPONENT_LOCALE_PL_PL,\n COMPONENT_LOCALE_PT_BR,\n COMPONENT_LOCALE_RU_RU,\n COMPONENT_LOCALE_SV_SE,\n COMPONENT_LOCALE_TR_TR,\n COMPONENT_LOCALE_ZH_CN,\n COMPONENT_LOCALE_ZH_TW\n} from '../../react-components/src';\nexport { ImageOverlay } from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport { HoldButton } from '../../react-components/src';\n\nexport { RaiseHandButton } from '../../react-components/src';\n\nexport { Dialpad } from '../../react-components/src';\n\n/* @conditional-compile-remove(call-readiness) */\nexport {\n CameraAndMicrophoneSitePermissions,\n MicrophoneSitePermissions,\n CameraSitePermissions\n} from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n CameraAndMicrophoneSitePermissionsStrings,\n CameraAndMicrophoneSitePermissionsProps,\n CameraSitePermissionsStrings,\n CameraSitePermissionsProps,\n CommonSitePermissionsProps,\n SitePermissionsStrings,\n SitePermissionsStyles,\n MicrophoneSitePermissionsStrings,\n MicrophoneSitePermissionsProps\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(total-participant-count) */\nexport type { ParticipantListStrings } from '../../react-components/src';\n\n/* @conditional-compile-remove(mention) */\nexport type {\n MentionOptions,\n MentionDisplayOptions,\n MentionLookupOptions,\n Mention,\n MentionPopoverStrings\n} from '../../react-components/src';\n\nexport type {\n _IdentifierProviderProps,\n _Identifiers,\n ActiveErrorMessage,\n BaseCustomStyles,\n CallParticipantListParticipant,\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles,\n ChatMessage,\n CommunicationParticipant,\n ComponentLocale,\n ComponentSlotStyle,\n ComponentStrings,\n ContentSystemMessage,\n ControlBarButtonProps,\n ControlBarButtonStrings,\n ControlBarButtonStyles,\n ControlBarLayout,\n ControlBarProps,\n CreateVideoStreamViewResult,\n CustomAvatarOptions,\n CustomMessage,\n DevicesButtonContextualMenuStyles,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n EndCallButtonProps,\n EndCallButtonStrings,\n ErrorBarProps,\n ErrorBarStrings,\n ErrorType,\n GridLayoutProps,\n GridLayoutStyles,\n HorizontalGalleryStyles,\n JumpToNewMessageButtonProps,\n LocalizationProviderProps,\n LocalVideoCameraCycleButtonProps,\n LoadingState,\n Message,\n MessageAttachedStatus,\n MessageCommon,\n MessageContentType,\n MessageProps,\n MessageRenderer,\n MessageStatusIndicatorProps,\n MessageStatusIndicatorStrings,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings,\n MicrophoneButtonStyles,\n OnRenderAvatarCallback,\n OptionsDevice,\n ParticipantAddedSystemMessage,\n ParticipantItemProps,\n ParticipantItemStrings,\n ParticipantItemStyles,\n ParticipantListItemStyles,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback,\n ParticipantRemovedSystemMessage,\n ParticipantState,\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles,\n ReadReceiptsBySenderId,\n ScreenShareButtonProps,\n ScreenShareButtonStrings,\n SendBoxProps,\n SendBoxStrings,\n SendBoxStylesProps,\n StreamMediaProps,\n SystemMessage,\n SystemMessageCommon,\n TopicUpdatedSystemMessage,\n TypingIndicatorProps,\n TypingIndicatorStrings,\n TypingIndicatorStylesProps,\n UpdateMessageCallback,\n CancelEditCallback,\n VideoGalleryLayout,\n VideoGalleryLocalParticipant,\n VideoGalleryParticipant,\n VideoGalleryProps,\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoStreamOptions,\n VideoTileProps,\n VideoTileStylesProps,\n ViewScalingMode,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps,\n VideoTilesOptions\n} from '../../react-components/src';\n\nexport type { RaiseHandButtonProps, RaiseHandButtonStrings, RaisedHand } from '../../react-components/src';\nexport type {\n ReactionButtonStrings,\n Reaction,\n ReactionButtonProps,\n ReactionResources,\n ReactionSprite\n} from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport { RichTextSendBox } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextSendBoxProps, RichTextSendBoxStrings, RichTextStrings } from '../../react-components/src';\n/* @conditional-compile-remove(spotlight) */\nexport type { Spotlight } from '../../react-components/src';\nexport type { ImageOverlayProps, ImageOverlayStrings } from '../../react-components/src';\n/* @conditional-compile-remove(data-loss-prevention) */\nexport type { BlockedMessage } from '../../react-components/src';\nexport type {\n DialpadMode,\n DialpadProps,\n DialpadStrings,\n DialpadStyles,\n DtmfTone,\n LongPressTrigger\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { SendBoxErrorBarError } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentActionHandler } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type {\n AttachmentSelectionHandler,\n AttachmentRemovalHandler,\n AttachmentUploadOptions,\n AttachmentUploadTask\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMetadata } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMetadataInProgress, AttachmentProgressError } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMenuAction, AttachmentDownloadOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport { defaultAttachmentMenuAction } from '../../react-components/src';\nexport type { ChatAttachmentType } from '../../react-components/src';\nexport type { InlineImageOptions, InlineImage } from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonProps, HoldButtonStrings } from '../../react-components/src';\nexport type { VideoTileStrings } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type { BrowserPermissionDeniedStrings, BrowserPermissionDeniedProps } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedIOSStrings,\n BrowserPermissionDeniedStyles,\n BrowserPermissionDeniedIOSProps\n} from '../../react-components/src';\nexport type { OverflowGalleryPosition } from '../../react-components/src';\nexport type { LocalVideoTileSize } from '../../react-components/src';\nexport * from '../../react-components/src/localization/locales';\nexport * from '../../react-components/src/theming';\nexport * from '../../calling-stateful-client/src/index-public';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeCallAgent } from '../../calling-stateful-client/src';\nexport { createStatefulChatClient } from '../../chat-stateful-client/src';\nexport type {\n StatefulChatClient,\n StatefulChatClientArgs,\n StatefulChatClientOptions,\n ChatMessageWithStatus,\n ChatClientState,\n ChatError,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget\n} from '../../chat-stateful-client/src';\n\nexport type { ResourceFetchResult } from '../../chat-stateful-client/src';\nexport * from '../../react-composites/src/index-public';\nexport * from './mergedHooks';\n\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowser } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowserVersion } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedOperatingSystem } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from '../../react-components/src';\nexport type {\n VerticalGalleryStyles,\n VerticalGalleryStrings,\n VerticalGalleryControlBarStyles\n} from '../../react-components/src';\n\nexport type { SpokenLanguageStrings, CaptionLanguageStrings } from '../../react-components/src';\n\nexport type { SurveyIssues } from '../../react-components/src';\n\nexport type { SurveyIssuesHeadingStrings } from '../../react-components/src';\n\nexport type { CallSurveyImprovementSuggestions } from '../../react-components/src';\n/* @conditional-compile-remove(notifications) */\nexport { Notifications, NotificationBar } from '../../react-components/src';\n/* @conditional-compile-remove(notifications) */\nexport type {\n NotificationsProps,\n NotificationBarProps,\n NotificationBarStrings,\n NotificationsStrings,\n NotificationType,\n ActiveNotification\n} from '../../react-components/src';\n"]}
@@ -6,7 +6,7 @@ import { ChatMessage } from '../../types';
6
6
  * Represents the type of attachment
7
7
  * @public
8
8
  */
9
- export type ChatAttachmentType = 'unknown' | 'image' | /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ 'file';
9
+ export type ChatAttachmentType = 'unknown' | 'image' | /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */ 'file';
10
10
  /**
11
11
  * Strings of _AttachmentDownloadCards that can be overridden.
12
12
  *
@@ -3,11 +3,11 @@
3
3
  import { Icon } from '@fluentui/react';
4
4
  import React, { useCallback } from 'react';
5
5
  import { useMemo } from 'react';
6
- /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
6
+ /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
7
7
  import { useLocale } from '../../localization';
8
8
  import { _AttachmentCard } from './AttachmentCard';
9
9
  import { _AttachmentCardGroup, _AttachmentCardGroupLayout } from './AttachmentCardGroup';
10
- /* @conditional-compile-remove(attachment-download) */
10
+ /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
11
11
  import { getAttachmentCountLiveMessage } from '../ChatMessage/ChatMessageContent';
12
12
  import { mergeClasses } from '@griffel/react';
13
13
  import { useAttachmentCardGroupStyles } from '../styles/AttachmentCardGroup.styles';
@@ -36,7 +36,7 @@ export const _AttachmentDownloadCards = (props) => {
36
36
  }, []);
37
37
  const attachmentCardGroupDescription = useMemo(() => () => {
38
38
  var _a, _b;
39
- /* @conditional-compile-remove(attachment-download) */
39
+ /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
40
40
  return getAttachmentCountLiveMessage(attachments !== null && attachments !== void 0 ? attachments : [], (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.attachmentCardGroupMessage) !== null && _b !== void 0 ? _b : localeStrings.attachmentCardGroupMessage);
41
41
  return '';
42
42
  }, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.attachmentCardGroupMessage, localeStrings.attachmentCardGroupMessage, attachments]);
@@ -57,26 +57,48 @@ export const _AttachmentDownloadCards = (props) => {
57
57
  * @private
58
58
  */
59
59
  const useLocaleStringsTrampoline = () => {
60
- /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
60
+ /* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */
61
61
  return useLocale().strings.messageThread;
62
- return { downloadAttachment: '', openAttachment: '', attachmentCardGroupMessage: '' };
62
+ return {
63
+ /* @conditional-compile-remove(file-sharing-acs) */
64
+ downloadAttachment: '',
65
+ openAttachment: '',
66
+ attachmentCardGroupMessage: ''
67
+ };
63
68
  };
64
69
  /**
65
70
  * @private
66
71
  */
67
72
  const getDefaultMenuActions = (locale, chatMessage) => {
68
73
  var _a;
74
+ let actionName = locale.openAttachment;
69
75
  // if message is sent by a Teams user, we need to use a different icon ("open")
70
76
  if ((_a = chatMessage === null || chatMessage === void 0 ? void 0 : chatMessage.senderId) === null || _a === void 0 ? void 0 : _a.includes('8:orgid:')) {
71
77
  return [
72
- Object.assign(Object.assign({}, defaultAttachmentMenuAction), { name: locale.openAttachment, icon: React.createElement(Icon, { iconName: "OpenAttachment" }) })
78
+ {
79
+ name: actionName,
80
+ icon: React.createElement(Icon, { iconName: "OpenAttachment" }),
81
+ onClick: defaultOnClickHandler
82
+ }
73
83
  ];
74
84
  }
75
85
  // otherwise, use the default icon ("download")
86
+ /* @conditional-compile-remove(file-sharing-acs) */
87
+ actionName = locale.downloadAttachment;
76
88
  return [
77
- Object.assign(Object.assign({}, defaultAttachmentMenuAction), { name: locale.downloadAttachment })
89
+ Object.assign(Object.assign({}, defaultAttachmentMenuAction), { name: actionName })
78
90
  ];
79
91
  };
92
+ /**
93
+ *
94
+ * The default action handler for downloading attachments. This handler will open the attachment's URL in a new tab.
95
+ */
96
+ const defaultOnClickHandler = (attachment) => {
97
+ return new Promise((resolve) => {
98
+ window.open(attachment.url, '_blank', 'noopener,noreferrer');
99
+ resolve();
100
+ });
101
+ };
80
102
  /**
81
103
  * @beta
82
104
  *
@@ -98,11 +120,6 @@ export const defaultAttachmentMenuAction = {
98
120
  // this is the icon shown on the right of the attachment card
99
121
  icon: React.createElement(Icon, { iconName: "DownloadAttachment", "data-ui-id": "attachment-download-card-download-icon" }),
100
122
  // this is the action that runs when the icon is clicked
101
- onClick: (attachment) => {
102
- return new Promise((resolve) => {
103
- window.open(attachment.url, '_blank', 'noopener,noreferrer');
104
- resolve();
105
- });
106
- }
123
+ onClick: defaultOnClickHandler
107
124
  };
108
125
  //# sourceMappingURL=AttachmentDownloadCards.js.map