@azure/communication-react 1.18.0-alpha-202407170014 → 1.18.0-alpha-202407180014

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 (28) hide show
  1. package/dist/communication-react.d.ts +5 -3
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BZ2Y7hMk.js → ChatMessageComponentAsRichTextEditBox-Bi4Or6hk.js} +7 -4
  3. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-Bi4Or6hk.js.map +1 -0
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DHxkzYTL.js → RichTextSendBoxWrapper-CaXswhPn.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DHxkzYTL.js.map → RichTextSendBoxWrapper-CaXswhPn.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-BCy65nmk.js → index-B3X0l4SB.js} +116 -84
  7. package/dist/dist-cjs/communication-react/index-B3X0l4SB.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +5 -3
  12. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
  13. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +5 -2
  14. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +0 -1
  16. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +21 -14
  18. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +3 -0
  20. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  21. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +0 -3
  22. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +2 -2
  24. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +39 -13
  25. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  26. package/package.json +1 -1
  27. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BZ2Y7hMk.js.map +0 -1
  28. package/dist/dist-cjs/communication-react/index-BCy65nmk.js.map +0 -1
@@ -176,7 +176,7 @@ function getDefaultExportFromCjs (x) {
176
176
  // Copyright (c) Microsoft Corporation.
177
177
  // Licensed under the MIT License.
178
178
  // GENERATED FILE. DO NOT EDIT MANUALLY.
179
- var telemetryVersion = '1.18.0-alpha-202407170014';
179
+ var telemetryVersion = '1.18.0-alpha-202407180014';
180
180
 
181
181
 
182
182
  var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
@@ -424,7 +424,7 @@ const Constants = {
424
424
  */
425
425
  const chatStatefulLogger = logger.createClientLogger('communication-react:chat-stateful');
426
426
 
427
- var __awaiter$W = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
427
+ var __awaiter$X = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
428
428
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
429
429
  return new (P || (P = Promise))(function (resolve, reject) {
430
430
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -466,7 +466,7 @@ class ResourceDownloadQueue {
466
466
  this._messagesNeedingResourceRetrieval.push(copy);
467
467
  }
468
468
  startQueue(threadId, operation, options) {
469
- return __awaiter$W(this, void 0, void 0, function* () {
469
+ return __awaiter$X(this, void 0, void 0, function* () {
470
470
  if (this.isActive) {
471
471
  return;
472
472
  }
@@ -502,7 +502,7 @@ class ResourceDownloadQueue {
502
502
  }
503
503
  }
504
504
  downloadSingleUrl(message, resourceUrl, operation) {
505
- return __awaiter$W(this, void 0, void 0, function* () {
505
+ return __awaiter$X(this, void 0, void 0, function* () {
506
506
  const response = { sourceUrl: '' };
507
507
  try {
508
508
  const abortController = new AbortController();
@@ -518,7 +518,7 @@ class ResourceDownloadQueue {
518
518
  });
519
519
  }
520
520
  downloadAllPreviewUrls(message, operation) {
521
- return __awaiter$W(this, void 0, void 0, function* () {
521
+ return __awaiter$X(this, void 0, void 0, function* () {
522
522
  var _a;
523
523
  const attachments = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments;
524
524
  if (message.type === 'html' && attachments) {
@@ -545,7 +545,7 @@ class ResourceDownloadQueue {
545
545
  });
546
546
  }
547
547
  downloadResource(operation, url, abortController) {
548
- return __awaiter$W(this, void 0, void 0, function* () {
548
+ return __awaiter$X(this, void 0, void 0, function* () {
549
549
  this._requestsToCancel[url] = { src: url, abortController };
550
550
  const blobUrl = yield operation(url, { credential: this._credential, endpoint: this._endpoint }, { abortController });
551
551
  delete this._requestsToCancel[url];
@@ -556,9 +556,9 @@ class ResourceDownloadQueue {
556
556
  /**
557
557
  * @private
558
558
  */
559
- const fetchImageSource = (src, authentication, options) => __awaiter$W(void 0, void 0, void 0, function* () {
559
+ const fetchImageSource = (src, authentication, options) => __awaiter$X(void 0, void 0, void 0, function* () {
560
560
  function fetchWithAuthentication(url, token, options) {
561
- return __awaiter$W(this, void 0, void 0, function* () {
561
+ return __awaiter$X(this, void 0, void 0, function* () {
562
562
  const headers = new Headers();
563
563
  headers.append('Authorization', `Bearer ${token}`);
564
564
  return yield fetchWithTimeout(url, {
@@ -569,7 +569,7 @@ const fetchImageSource = (src, authentication, options) => __awaiter$W(void 0, v
569
569
  });
570
570
  }
571
571
  function fetchWithTimeout(resource, options) {
572
- return __awaiter$W(this, void 0, void 0, function* () {
572
+ return __awaiter$X(this, void 0, void 0, function* () {
573
573
  // default timeout is 30 seconds
574
574
  const { timeout = 30000, abortController } = options;
575
575
  const id = setTimeout(() => {
@@ -596,7 +596,7 @@ const fetchImageSource = (src, authentication, options) => __awaiter$W(void 0, v
596
596
 
597
597
  // Copyright (c) Microsoft Corporation.
598
598
  // Licensed under the MIT License.
599
- var __awaiter$V = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
599
+ var __awaiter$W = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
600
600
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
601
601
  return new (P || (P = Promise))(function (resolve, reject) {
602
602
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -672,7 +672,7 @@ let ChatContext$1 = class ChatContext {
672
672
  // Any item in queue should be removed.
673
673
  }
674
674
  downloadResourceToCache(threadId, messageId, resourceUrl) {
675
- return __awaiter$V(this, void 0, void 0, function* () {
675
+ return __awaiter$W(this, void 0, void 0, function* () {
676
676
  var _a;
677
677
  let message = (_a = this.getState().threads[threadId]) === null || _a === void 0 ? void 0 : _a.chatMessages[messageId];
678
678
  if (message && this._fullsizeImageQueue) {
@@ -951,7 +951,7 @@ let ChatContext$1 = class ChatContext {
951
951
  * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
952
952
  */
953
953
  withAsyncErrorTeedToState(f, target) {
954
- return (...args) => __awaiter$V(this, void 0, void 0, function* () {
954
+ return (...args) => __awaiter$W(this, void 0, void 0, function* () {
955
955
  try {
956
956
  return yield f(...args);
957
957
  }
@@ -1058,7 +1058,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
1058
1058
 
1059
1059
  // Copyright (c) Microsoft Corporation.
1060
1060
  // Licensed under the MIT License.
1061
- var __awaiter$U = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1061
+ var __awaiter$V = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1062
1062
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1063
1063
  return new (P || (P = Promise))(function (resolve, reject) {
1064
1064
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1148,7 +1148,7 @@ class EventSubscriber {
1148
1148
  };
1149
1149
  // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.
1150
1150
  // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.
1151
- this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$U(this, void 0, void 0, function* () {
1151
+ this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$V(this, void 0, void 0, function* () {
1152
1152
  var _a, e_1, _b, _c;
1153
1153
  try {
1154
1154
  for (var _d = true, _e = __asyncValues$1(this.chatClient
@@ -1242,7 +1242,7 @@ class EventSubscriber {
1242
1242
 
1243
1243
  // Copyright (c) Microsoft Corporation.
1244
1244
  // Licensed under the MIT License.
1245
- var __awaiter$T = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1245
+ var __awaiter$U = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1246
1246
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1247
1247
  return new (P || (P = Promise))(function (resolve, reject) {
1248
1248
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1264,7 +1264,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
1264
1264
  const threadsIterator = iteratorCreator(...args);
1265
1265
  return {
1266
1266
  next() {
1267
- return __awaiter$T(this, void 0, void 0, function* () {
1267
+ return __awaiter$U(this, void 0, void 0, function* () {
1268
1268
  const result = yield threadsIterator.next();
1269
1269
  if (!result.done && result.value) {
1270
1270
  decorateFn(result.value, context);
@@ -1279,7 +1279,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
1279
1279
  const pages = threadsIterator.byPage(settings);
1280
1280
  return {
1281
1281
  next() {
1282
- return __awaiter$T(this, void 0, void 0, function* () {
1282
+ return __awaiter$U(this, void 0, void 0, function* () {
1283
1283
  const result = yield pages.next();
1284
1284
  const page = result.value;
1285
1285
  if (!result.done && result.value) {
@@ -1366,7 +1366,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
1366
1366
 
1367
1367
  // Copyright (c) Microsoft Corporation.
1368
1368
  // Licensed under the MIT License.
1369
- var __awaiter$S = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1369
+ var __awaiter$T = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1370
1370
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1371
1371
  return new (P || (P = Promise))(function (resolve, reject) {
1372
1372
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1385,14 +1385,14 @@ class ProxyChatThreadClient {
1385
1385
  return createDecoratedListMessages(chatThreadClient, this._context);
1386
1386
  }
1387
1387
  case 'getMessage': {
1388
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$S(this, void 0, void 0, function* () {
1388
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$T(this, void 0, void 0, function* () {
1389
1389
  const message = yield chatThreadClient.getMessage(...args);
1390
1390
  this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
1391
1391
  return message;
1392
1392
  }), 'ChatThreadClient.getMessage');
1393
1393
  }
1394
1394
  case 'sendMessage': {
1395
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$S(this, void 0, void 0, function* () {
1395
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$T(this, void 0, void 0, function* () {
1396
1396
  var _a;
1397
1397
  // Retry logic?
1398
1398
  const [request, options] = args;
@@ -1433,7 +1433,7 @@ class ProxyChatThreadClient {
1433
1433
  }), 'ChatThreadClient.sendMessage');
1434
1434
  }
1435
1435
  case 'addParticipants': {
1436
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$S(this, void 0, void 0, function* () {
1436
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$T(this, void 0, void 0, function* () {
1437
1437
  const result = yield chatThreadClient.addParticipants(...args);
1438
1438
  const [addRequest] = args;
1439
1439
  const participantsToAdd = addRequest.participants;
@@ -1442,7 +1442,7 @@ class ProxyChatThreadClient {
1442
1442
  }), 'ChatThreadClient.addParticipants');
1443
1443
  }
1444
1444
  case 'deleteMessage': {
1445
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$S(this, void 0, void 0, function* () {
1445
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$T(this, void 0, void 0, function* () {
1446
1446
  // DeleteMessage is able to either delete local one(for failed message) or synced message
1447
1447
  const [messageId] = args;
1448
1448
  if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
@@ -1460,12 +1460,12 @@ class ProxyChatThreadClient {
1460
1460
  return createDecoratedListReadReceipts(chatThreadClient, this._context);
1461
1461
  }
1462
1462
  case 'sendTypingNotification': {
1463
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$S(this, void 0, void 0, function* () {
1463
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$T(this, void 0, void 0, function* () {
1464
1464
  return yield chatThreadClient.sendTypingNotification(...args);
1465
1465
  }), 'ChatThreadClient.sendTypingNotification');
1466
1466
  }
1467
1467
  case 'removeParticipant': {
1468
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$S(this, void 0, void 0, function* () {
1468
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$T(this, void 0, void 0, function* () {
1469
1469
  const result = yield chatThreadClient.removeParticipant(...args);
1470
1470
  const [removeIdentifier] = args;
1471
1471
  this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
@@ -1473,7 +1473,7 @@ class ProxyChatThreadClient {
1473
1473
  }), 'ChatThreadClient.removeParticipant');
1474
1474
  }
1475
1475
  case 'updateMessage': {
1476
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$S(this, void 0, void 0, function* () {
1476
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$T(this, void 0, void 0, function* () {
1477
1477
  const result = yield chatThreadClient.updateMessage(...args);
1478
1478
  const [messageId, updateOption] = args;
1479
1479
  this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
@@ -1481,7 +1481,7 @@ class ProxyChatThreadClient {
1481
1481
  }), 'ChatThreadClient.updateMessage');
1482
1482
  }
1483
1483
  case 'updateTopic': {
1484
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$S(this, void 0, void 0, function* () {
1484
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$T(this, void 0, void 0, function* () {
1485
1485
  const result = yield chatThreadClient.updateTopic(...args);
1486
1486
  const [topic] = args;
1487
1487
  this._context.updateThreadTopic(chatThreadClient.threadId, topic);
@@ -1489,7 +1489,7 @@ class ProxyChatThreadClient {
1489
1489
  }), 'ChatThreadClient.updateTopic');
1490
1490
  }
1491
1491
  case 'getProperties': {
1492
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$S(this, void 0, void 0, function* () {
1492
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$T(this, void 0, void 0, function* () {
1493
1493
  const result = yield chatThreadClient.getProperties(...args);
1494
1494
  this._context.updateThread(chatThreadClient.threadId, result);
1495
1495
  return result;
@@ -1527,7 +1527,7 @@ const createDecoratedListThreads = (chatClient, context) => {
1527
1527
 
1528
1528
  // Copyright (c) Microsoft Corporation.
1529
1529
  // Licensed under the MIT License.
1530
- var __awaiter$R = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1530
+ var __awaiter$S = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1531
1531
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1532
1532
  return new (P || (P = Promise))(function (resolve, reject) {
1533
1533
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1546,7 +1546,7 @@ const proxyChatClient = {
1546
1546
  switch (prop) {
1547
1547
  case 'createChatThread': {
1548
1548
  return context.withAsyncErrorTeedToState(function (...args) {
1549
- return __awaiter$R(this, void 0, void 0, function* () {
1549
+ return __awaiter$S(this, void 0, void 0, function* () {
1550
1550
  const result = yield chatClient.createChatThread(...args);
1551
1551
  const thread = result.chatThread;
1552
1552
  if (thread) {
@@ -1559,7 +1559,7 @@ const proxyChatClient = {
1559
1559
  }
1560
1560
  case 'deleteChatThread': {
1561
1561
  return context.withAsyncErrorTeedToState(function (...args) {
1562
- return __awaiter$R(this, void 0, void 0, function* () {
1562
+ return __awaiter$S(this, void 0, void 0, function* () {
1563
1563
  const result = yield chatClient.deleteChatThread(...args);
1564
1564
  context.deleteThread(args[0]);
1565
1565
  return result;
@@ -1579,7 +1579,7 @@ const proxyChatClient = {
1579
1579
  }
1580
1580
  case 'startRealtimeNotifications': {
1581
1581
  return context.withAsyncErrorTeedToState(function (...args) {
1582
- return __awaiter$R(this, void 0, void 0, function* () {
1582
+ return __awaiter$S(this, void 0, void 0, function* () {
1583
1583
  const ret = yield chatClient.startRealtimeNotifications(...args);
1584
1584
  if (!receiver.eventSubscriber) {
1585
1585
  receiver.eventSubscriber = new EventSubscriber(chatClient, context);
@@ -1590,7 +1590,7 @@ const proxyChatClient = {
1590
1590
  }
1591
1591
  case 'stopRealtimeNotifications': {
1592
1592
  return context.withAsyncErrorTeedToState(function (...args) {
1593
- return __awaiter$R(this, void 0, void 0, function* () {
1593
+ return __awaiter$S(this, void 0, void 0, function* () {
1594
1594
  const ret = yield chatClient.stopRealtimeNotifications(...args);
1595
1595
  if (receiver.eventSubscriber) {
1596
1596
  receiver.eventSubscriber.unsubscribe();
@@ -1699,7 +1699,7 @@ const getImageAttachmentsFromHTMLContent = (content) => {
1699
1699
 
1700
1700
  // Copyright (c) Microsoft Corporation.
1701
1701
  // Licensed under the MIT License.
1702
- var __awaiter$Q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1702
+ var __awaiter$R = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1703
1703
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1704
1704
  return new (P || (P = Promise))(function (resolve, reject) {
1705
1705
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1725,7 +1725,7 @@ const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {
1725
1725
  // due to a bug in babel, we can't use arrow function here
1726
1726
  // affecting conditional-compile-remove(attachment-upload)
1727
1727
  onSendMessage: function (content, options) {
1728
- return __awaiter$Q(this, void 0, void 0, function* () {
1728
+ return __awaiter$R(this, void 0, void 0, function* () {
1729
1729
  const sendMessageRequest = {
1730
1730
  content,
1731
1731
  senderDisplayName: chatClient.getState().displayName
@@ -1761,14 +1761,14 @@ const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {
1761
1761
  },
1762
1762
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
1763
1763
  onUploadImage: function (image, imageFilename) {
1764
- return __awaiter$Q(this, void 0, void 0, function* () {
1764
+ return __awaiter$R(this, void 0, void 0, function* () {
1765
1765
  const imageResult = yield chatThreadClient.uploadImage(image, imageFilename);
1766
1766
  return imageResult;
1767
1767
  });
1768
1768
  },
1769
1769
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
1770
1770
  onDeleteImage: function (imageId) {
1771
- return __awaiter$Q(this, void 0, void 0, function* () {
1771
+ return __awaiter$R(this, void 0, void 0, function* () {
1772
1772
  yield chatThreadClient.deleteImage(imageId);
1773
1773
  return;
1774
1774
  });
@@ -1778,7 +1778,7 @@ const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {
1778
1778
  onUpdateMessage: function (messageId, content,
1779
1779
  /* @conditional-compile-remove(file-sharing-acs) */
1780
1780
  options) {
1781
- return __awaiter$Q(this, void 0, void 0, function* () {
1781
+ return __awaiter$R(this, void 0, void 0, function* () {
1782
1782
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
1783
1783
  const imageAttachments = getImageAttachmentsFromHTMLContent(content);
1784
1784
  const updateMessageOptions = {
@@ -1791,23 +1791,23 @@ const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {
1791
1791
  yield chatThreadClient.updateMessage(messageId, updateMessageOptions);
1792
1792
  });
1793
1793
  },
1794
- onDeleteMessage: (messageId) => __awaiter$Q(void 0, void 0, void 0, function* () {
1794
+ onDeleteMessage: (messageId) => __awaiter$R(void 0, void 0, void 0, function* () {
1795
1795
  yield chatThreadClient.deleteMessage(messageId);
1796
1796
  }),
1797
1797
  // This handler is designed for chatThread to consume
1798
- onMessageSeen: (chatMessageId) => __awaiter$Q(void 0, void 0, void 0, function* () {
1798
+ onMessageSeen: (chatMessageId) => __awaiter$R(void 0, void 0, void 0, function* () {
1799
1799
  yield chatThreadClient.sendReadReceipt({ chatMessageId });
1800
1800
  }),
1801
- onTyping: () => __awaiter$Q(void 0, void 0, void 0, function* () {
1801
+ onTyping: () => __awaiter$R(void 0, void 0, void 0, function* () {
1802
1802
  yield chatThreadClient.sendTypingNotification();
1803
1803
  }),
1804
- onRemoveParticipant: (userId) => __awaiter$Q(void 0, void 0, void 0, function* () {
1804
+ onRemoveParticipant: (userId) => __awaiter$R(void 0, void 0, void 0, function* () {
1805
1805
  yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
1806
1806
  }),
1807
- updateThreadTopicName: (topicName) => __awaiter$Q(void 0, void 0, void 0, function* () {
1807
+ updateThreadTopicName: (topicName) => __awaiter$R(void 0, void 0, void 0, function* () {
1808
1808
  yield chatThreadClient.updateTopic(topicName);
1809
1809
  }),
1810
- onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$Q(void 0, void 0, void 0, function* () {
1810
+ onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$R(void 0, void 0, void 0, function* () {
1811
1811
  var _a, _b, _c;
1812
1812
  if (messageIterator === undefined) {
1813
1813
  // Lazy definition so that errors in the method call are reported correctly.
@@ -4415,7 +4415,7 @@ const _MentionPopover = (props) => {
4415
4415
 
4416
4416
  // Copyright (c) Microsoft Corporation.
4417
4417
  // Licensed under the MIT License.
4418
- var __awaiter$P = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4418
+ var __awaiter$Q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4419
4419
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4420
4420
  return new (P || (P = Promise))(function (resolve, reject) {
4421
4421
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -4601,7 +4601,7 @@ const TextFieldWithMention = (props) => {
4601
4601
  onSuggestionSelected,
4602
4602
  updateMentionSuggestions
4603
4603
  ]);
4604
- const debouncedQueryUpdate = useDebounce.useDebouncedCallback((query) => __awaiter$P(void 0, void 0, void 0, function* () {
4604
+ const debouncedQueryUpdate = useDebounce.useDebouncedCallback((query) => __awaiter$Q(void 0, void 0, void 0, function* () {
4605
4605
  var _a;
4606
4606
  let suggestions = (_a = (yield (mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.onQueryUpdated(query)))) !== null && _a !== void 0 ? _a : [];
4607
4607
  suggestions = suggestions.filter((suggestion) => suggestion.displayText.trim() !== '');
@@ -4778,7 +4778,7 @@ const TextFieldWithMention = (props) => {
4778
4778
  });
4779
4779
  }
4780
4780
  }, [updateSelectionIndexesWithMentionIfNeeded, setSelectionStartValue, setSelectionEndValue]);
4781
- const handleOnChange = React.useCallback((_b) => __awaiter$P(void 0, [_b], void 0, function* ({ currentSelectionEnd, currentSelectionStart, currentTriggerStartIndex, event, htmlTextValue, inputTextValue, previousSelectionEnd, previousSelectionStart, tagsValue, updatedValue }) {
4781
+ const handleOnChange = React.useCallback((_b) => __awaiter$Q(void 0, [_b], void 0, function* ({ currentSelectionEnd, currentSelectionStart, currentTriggerStartIndex, event, htmlTextValue, inputTextValue, previousSelectionEnd, previousSelectionStart, tagsValue, updatedValue }) {
4782
4782
  var _c;
4783
4783
  debouncedQueryUpdate.cancel();
4784
4784
  if (event.currentTarget === null) {
@@ -5287,7 +5287,7 @@ const ATTACHMENT_CARD_MIN_PROGRESS = 0.05;
5287
5287
 
5288
5288
  // Copyright (c) Microsoft Corporation.
5289
5289
  // Licensed under the MIT License.
5290
- var __awaiter$O = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5290
+ var __awaiter$P = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5291
5291
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5292
5292
  return new (P || (P = Promise))(function (resolve, reject) {
5293
5293
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -5369,7 +5369,7 @@ const MappedMenuItems = (menuActions, attachment, handleOnClickError) => {
5369
5369
  React.createElement(reactComponents.MenuTrigger, null,
5370
5370
  React.createElement(reactComponents.ToolbarButton, { "aria-label": localeStrings.attachmentMoreMenu, role: "button", icon: React.createElement(react.Icon, { iconName: "AttachmentMoreMenu" }) }))),
5371
5371
  React.createElement(reactComponents.MenuPopover, null,
5372
- React.createElement(reactComponents.MenuList, null, menuActions.map((menuItem, index) => (React.createElement(reactComponents.MenuItem, { "aria-label": menuItem.name, key: index, icon: menuItem.icon, onClick: () => __awaiter$O(void 0, void 0, void 0, function* () {
5372
+ React.createElement(reactComponents.MenuList, null, menuActions.map((menuItem, index) => (React.createElement(reactComponents.MenuItem, { "aria-label": menuItem.name, key: index, icon: menuItem.icon, onClick: () => __awaiter$P(void 0, void 0, void 0, function* () {
5373
5373
  try {
5374
5374
  yield menuItem.onClick(attachment);
5375
5375
  }
@@ -5504,6 +5504,15 @@ const _AttachmentUploadCards = (props) => {
5504
5504
 
5505
5505
  // Copyright (c) Microsoft Corporation.
5506
5506
  // Licensed under the MIT License.
5507
+ var __awaiter$O = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5508
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5509
+ return new (P || (P = Promise))(function (resolve, reject) {
5510
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5511
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
5512
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
5513
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
5514
+ });
5515
+ };
5507
5516
  /**
5508
5517
  * @private
5509
5518
  */
@@ -5531,22 +5540,39 @@ const isAttachmentUploadCompleted = (attachmentsWithProgress) => {
5531
5540
  * @internal
5532
5541
  */
5533
5542
  // Before sending the image, we need to add the image id we get back after uploading the images to the message content.
5534
- const addUploadedImagesToMessage = (message, uploadInlineImages) => {
5543
+ const addUploadedImagesToMessage = (message, uploadInlineImages) => __awaiter$O(void 0, void 0, void 0, function* () {
5535
5544
  if (message === '') {
5536
5545
  return message;
5537
5546
  }
5538
5547
  const document = new DOMParser().parseFromString(message !== null && message !== void 0 ? message : '', 'text/html');
5539
- document.querySelectorAll('img').forEach((img) => {
5540
- var _a;
5541
- if (!img.id) {
5548
+ const imagesPromise = Array.from(document.querySelectorAll('img')).map((img) => {
5549
+ return new Promise((resolve, rejects) => {
5542
5550
  const uploadInlineImage = uploadInlineImages.find((imageUpload) => !imageUpload.error && (imageUpload.url === img.src || imageUpload.id === img.id));
5543
- img.id = (_a = uploadInlineImage === null || uploadInlineImage === void 0 ? void 0 : uploadInlineImage.id) !== null && _a !== void 0 ? _a : '';
5544
- img.src = '';
5545
- }
5551
+ const imageElement = new Image();
5552
+ imageElement.src = img.src;
5553
+ imageElement.onload = () => {
5554
+ var _a;
5555
+ // imageElement is a copy of original img element, so changes need to be made to the original img element
5556
+ img.id = (_a = uploadInlineImage === null || uploadInlineImage === void 0 ? void 0 : uploadInlineImage.id) !== null && _a !== void 0 ? _a : '';
5557
+ img.src = '';
5558
+ img.width = imageElement.width;
5559
+ img.height = imageElement.height;
5560
+ img.style.aspectRatio = `${imageElement.width} / ${imageElement.height}`;
5561
+ // Clear maxWidth and maxHeight styles so that they can set in the style attribute
5562
+ img.style.maxWidth = '';
5563
+ img.style.maxHeight = '';
5564
+ resolve();
5565
+ };
5566
+ imageElement.onerror = () => {
5567
+ console.log('Error loading image', img.src);
5568
+ rejects();
5569
+ };
5570
+ });
5546
5571
  });
5572
+ yield Promise.all(imagesPromise);
5547
5573
  const newMessage = document.body.innerHTML;
5548
5574
  return newMessage;
5549
- };
5575
+ });
5550
5576
  /**
5551
5577
  * @private
5552
5578
  */
@@ -5617,13 +5643,13 @@ const toAttachmentMetadata = (attachmentsWithProgress) => {
5617
5643
  /**
5618
5644
  * @internal
5619
5645
  */
5620
- const insertImagesToContentString = (content, imageUploadsInProgress) => {
5646
+ const insertImagesToContentString = (content, imageUploadsInProgress, onCompleted) => __awaiter$O(void 0, void 0, void 0, function* () {
5621
5647
  if (!imageUploadsInProgress || imageUploadsInProgress.length <= 0) {
5622
- return content;
5648
+ onCompleted === null || onCompleted === void 0 ? void 0 : onCompleted(content);
5623
5649
  }
5624
- const newContent = addUploadedImagesToMessage(content, imageUploadsInProgress);
5625
- return newContent;
5626
- };
5650
+ const newContent = yield addUploadedImagesToMessage(content, imageUploadsInProgress !== null && imageUploadsInProgress !== void 0 ? imageUploadsInProgress : []);
5651
+ onCompleted === null || onCompleted === void 0 ? void 0 : onCompleted(newContent);
5652
+ });
5627
5653
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
5628
5654
  /**
5629
5655
  * @internal
@@ -6448,9 +6474,6 @@ const richTextEditorWrapperStyle = (theme) => {
6448
6474
  verticalAlign: 'top'
6449
6475
  }
6450
6476
  }
6451
- },
6452
- '& img': {
6453
- width: '119px'
6454
6477
  }
6455
6478
  });
6456
6479
  };
@@ -6826,7 +6849,6 @@ const handleInlineImage = (event, onUploadInlineImage) => {
6826
6849
  onUploadInlineImage(imageUrl, fileName);
6827
6850
  image.src = imageUrl;
6828
6851
  image.alt = image.alt || 'image';
6829
- image.style.width = '119px'; // TODO: find a way to get the original width and height of the image
6830
6852
  });
6831
6853
  }
6832
6854
  };
@@ -8105,7 +8127,6 @@ const RichTextSendBox = (props) => {
8105
8127
  return sanitizeText(contentValue !== null && contentValue !== void 0 ? contentValue : '').length > 0 && sanitizeText(plainTextContent !== null && plainTextContent !== void 0 ? plainTextContent : '').length > 0;
8106
8128
  }, [contentValue]);
8107
8129
  const sendMessageOnClick = React.useCallback(() => {
8108
- var _a, _b;
8109
8130
  if (disabled || contentValueOverflow) {
8110
8131
  return;
8111
8132
  }
@@ -8120,25 +8141,33 @@ const RichTextSendBox = (props) => {
8120
8141
  setAttachmentUploadsPendingError({ message: strings.attachmentUploadsPendingError, timestamp: Date.now() });
8121
8142
  return;
8122
8143
  }
8123
- let message = contentValue;
8124
8144
  // we don't want to send empty messages including spaces, newlines, tabs
8125
8145
  // Message can be empty if there is a valid attachment upload
8126
8146
  if (hasContent ||
8127
8147
  /* @conditional-compile-remove(file-sharing-acs) */ isAttachmentUploadCompleted(attachments) ||
8128
8148
  /* @conditional-compile-remove(rich-text-editor-image-upload) */ isAttachmentUploadCompleted(imageUploadsInProgress)) {
8149
+ const sendMessage = (content) => {
8150
+ var _a, _b;
8151
+ onSendMessage(content,
8152
+ /* @conditional-compile-remove(file-sharing-acs) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */
8153
+ {
8154
+ /* @conditional-compile-remove(file-sharing-acs) */
8155
+ attachments: toAttachmentMetadata(attachments),
8156
+ /* @conditional-compile-remove(rich-text-editor-composite-support) */
8157
+ type: 'html'
8158
+ });
8159
+ setContentValue('');
8160
+ (_a = editorComponentRef.current) === null || _a === void 0 ? void 0 : _a.setEmptyContent();
8161
+ (_b = editorComponentRef.current) === null || _b === void 0 ? void 0 : _b.focus();
8162
+ };
8129
8163
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
8130
- message = insertImagesToContentString(contentValue, imageUploadsInProgress);
8131
- onSendMessage(message,
8132
- /* @conditional-compile-remove(file-sharing-acs) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */
8133
- {
8134
- /* @conditional-compile-remove(file-sharing-acs) */
8135
- attachments: toAttachmentMetadata(attachments),
8136
- /* @conditional-compile-remove(rich-text-editor-composite-support) */
8137
- type: 'html'
8138
- });
8139
- setContentValue('');
8140
- (_a = editorComponentRef.current) === null || _a === void 0 ? void 0 : _a.setEmptyContent();
8141
- (_b = editorComponentRef.current) === null || _b === void 0 ? void 0 : _b.focus();
8164
+ if (isAttachmentUploadCompleted(imageUploadsInProgress)) {
8165
+ insertImagesToContentString(contentValue, imageUploadsInProgress, (content) => {
8166
+ sendMessage(content);
8167
+ });
8168
+ return;
8169
+ }
8170
+ sendMessage(contentValue);
8142
8171
  }
8143
8172
  }, [
8144
8173
  disabled,
@@ -8477,6 +8506,9 @@ const useChatMyMessageStyles = reactComponents.makeStyles({
8477
8506
  fontWeight: 600
8478
8507
  }, '&:focus-visible': {
8479
8508
  outlineStyle: 'auto'
8509
+ }, '& img': {
8510
+ maxWidth: '100%',
8511
+ height: 'auto'
8480
8512
  } }),
8481
8513
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
8482
8514
  bodyWithPlaceholderImage: {
@@ -10267,7 +10299,7 @@ class _ErrorBoundary extends React.Component {
10267
10299
  // Copyright (c) Microsoft Corporation.
10268
10300
  // Licensed under the MIT License.
10269
10301
  /* @conditional-compile-remove(rich-text-editor) */
10270
- const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-BZ2Y7hMk.js'); }));
10302
+ const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-Bi4Or6hk.js'); }));
10271
10303
  /**
10272
10304
  * @private
10273
10305
  * Use this function to load RoosterJS dependencies early in the lifecycle.
@@ -10275,7 +10307,7 @@ const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve()
10275
10307
  *
10276
10308
  * @conditional-compile-remove(rich-text-editor)
10277
10309
  */
10278
- const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-BZ2Y7hMk.js'); });
10310
+ const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-Bi4Or6hk.js'); });
10279
10311
  /**
10280
10312
  * @private
10281
10313
  */
@@ -22433,7 +22465,7 @@ const AttachmentDownloadErrorBar = (props) => {
22433
22465
  /**
22434
22466
  * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox with lazy loading
22435
22467
  */
22436
- const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-DHxkzYTL.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper })));
22468
+ const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-CaXswhPn.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper })));
22437
22469
  /**
22438
22470
  * @private
22439
22471
  * Use this function to load RoosterJS dependencies early in the lifecycle.
@@ -22441,7 +22473,7 @@ const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function
22441
22473
  *
22442
22474
  /* @conditional-compile-remove(rich-text-editor-composite-support)
22443
22475
  */
22444
- const loadRichTextSendBox = () => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-DHxkzYTL.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper }));
22476
+ const loadRichTextSendBox = () => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-CaXswhPn.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper }));
22445
22477
  /**
22446
22478
  * @private
22447
22479
  */
@@ -42476,4 +42508,4 @@ exports.useTeamsCall = useTeamsCall;
42476
42508
  exports.useTeamsCallAdapter = useTeamsCallAdapter;
42477
42509
  exports.useTeamsCallAgent = useTeamsCallAgent;
42478
42510
  exports.useTheme = useTheme;
42479
- //# sourceMappingURL=index-BCy65nmk.js.map
42511
+ //# sourceMappingURL=index-B3X0l4SB.js.map