@azure/communication-react 1.19.0-alpha-202408030014 → 1.19.0-alpha-202408070015

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 (21) hide show
  1. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BBTJIosO.js → ChatMessageComponentAsRichTextEditBox-BMVUY7HX.js} +2 -2
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BBTJIosO.js.map → ChatMessageComponentAsRichTextEditBox-BMVUY7HX.js.map} +1 -1
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-C1Ev6MKx.js → RichTextSendBoxWrapper-UkjXSVQH.js} +2 -2
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-C1Ev6MKx.js.map → RichTextSendBoxWrapper-UkjXSVQH.js.map} +1 -1
  5. package/dist/dist-cjs/communication-react/{index-B74o7NiP.js → index-D46R0M5v.js} +116 -93
  6. package/dist/dist-cjs/communication-react/index-D46R0M5v.js.map +1 -0
  7. package/dist/dist-cjs/communication-react/index.js +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  10. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +2 -5
  11. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +48 -31
  12. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +1 -1
  13. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +1 -0
  14. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +1 -0
  15. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +1 -1
  16. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +7 -3
  17. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  18. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +4 -2
  19. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +1 -1
  20. package/package.json +1 -1
  21. package/dist/dist-cjs/communication-react/index-B74o7NiP.js.map +0 -1
@@ -189,7 +189,7 @@ function getDefaultExportFromCjs (x) {
189
189
  // Copyright (c) Microsoft Corporation.
190
190
  // Licensed under the MIT License.
191
191
  // GENERATED FILE. DO NOT EDIT MANUALLY.
192
- var telemetryVersion = '1.19.0-alpha-202408030014';
192
+ var telemetryVersion = '1.19.0-alpha-202408070015';
193
193
 
194
194
 
195
195
  var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
@@ -485,7 +485,7 @@ const Constants = {
485
485
  */
486
486
  const chatStatefulLogger = logger.createClientLogger('communication-react:chat-stateful');
487
487
 
488
- var __awaiter$Z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
488
+ var __awaiter$_ = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
489
489
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
490
490
  return new (P || (P = Promise))(function (resolve, reject) {
491
491
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -527,7 +527,7 @@ class ResourceDownloadQueue {
527
527
  this._messagesNeedingResourceRetrieval.push(copy);
528
528
  }
529
529
  startQueue(threadId, operation, options) {
530
- return __awaiter$Z(this, void 0, void 0, function* () {
530
+ return __awaiter$_(this, void 0, void 0, function* () {
531
531
  if (this.isActive) {
532
532
  return;
533
533
  }
@@ -563,7 +563,7 @@ class ResourceDownloadQueue {
563
563
  }
564
564
  }
565
565
  downloadSingleUrl(message, resourceUrl, operation) {
566
- return __awaiter$Z(this, void 0, void 0, function* () {
566
+ return __awaiter$_(this, void 0, void 0, function* () {
567
567
  const response = { sourceUrl: '' };
568
568
  try {
569
569
  const abortController = new AbortController();
@@ -579,7 +579,7 @@ class ResourceDownloadQueue {
579
579
  });
580
580
  }
581
581
  downloadAllPreviewUrls(message, operation) {
582
- return __awaiter$Z(this, void 0, void 0, function* () {
582
+ return __awaiter$_(this, void 0, void 0, function* () {
583
583
  var _a;
584
584
  const attachments = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments;
585
585
  if (message.type === 'html' && attachments) {
@@ -606,7 +606,7 @@ class ResourceDownloadQueue {
606
606
  });
607
607
  }
608
608
  downloadResource(operation, url, abortController) {
609
- return __awaiter$Z(this, void 0, void 0, function* () {
609
+ return __awaiter$_(this, void 0, void 0, function* () {
610
610
  this._requestsToCancel[url] = { src: url, abortController };
611
611
  const blobUrl = yield operation(url, { credential: this._credential, endpoint: this._endpoint }, { abortController });
612
612
  delete this._requestsToCancel[url];
@@ -617,9 +617,9 @@ class ResourceDownloadQueue {
617
617
  /**
618
618
  * @private
619
619
  */
620
- const fetchImageSource = (src, authentication, options) => __awaiter$Z(void 0, void 0, void 0, function* () {
620
+ const fetchImageSource = (src, authentication, options) => __awaiter$_(void 0, void 0, void 0, function* () {
621
621
  function fetchWithAuthentication(url, token, options) {
622
- return __awaiter$Z(this, void 0, void 0, function* () {
622
+ return __awaiter$_(this, void 0, void 0, function* () {
623
623
  const headers = new Headers();
624
624
  headers.append('Authorization', `Bearer ${token}`);
625
625
  return yield fetchWithTimeout(url, {
@@ -630,7 +630,7 @@ const fetchImageSource = (src, authentication, options) => __awaiter$Z(void 0, v
630
630
  });
631
631
  }
632
632
  function fetchWithTimeout(resource, options) {
633
- return __awaiter$Z(this, void 0, void 0, function* () {
633
+ return __awaiter$_(this, void 0, void 0, function* () {
634
634
  // default timeout is 30 seconds
635
635
  const { timeout = 30000, abortController } = options;
636
636
  const id = setTimeout(() => {
@@ -657,7 +657,7 @@ const fetchImageSource = (src, authentication, options) => __awaiter$Z(void 0, v
657
657
 
658
658
  // Copyright (c) Microsoft Corporation.
659
659
  // Licensed under the MIT License.
660
- var __awaiter$Y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
660
+ var __awaiter$Z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
661
661
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
662
662
  return new (P || (P = Promise))(function (resolve, reject) {
663
663
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -733,7 +733,7 @@ let ChatContext$1 = class ChatContext {
733
733
  // Any item in queue should be removed.
734
734
  }
735
735
  downloadResourceToCache(threadId, messageId, resourceUrl) {
736
- return __awaiter$Y(this, void 0, void 0, function* () {
736
+ return __awaiter$Z(this, void 0, void 0, function* () {
737
737
  var _a;
738
738
  let message = (_a = this.getState().threads[threadId]) === null || _a === void 0 ? void 0 : _a.chatMessages[messageId];
739
739
  if (message && this._fullsizeImageQueue) {
@@ -1012,7 +1012,7 @@ let ChatContext$1 = class ChatContext {
1012
1012
  * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
1013
1013
  */
1014
1014
  withAsyncErrorTeedToState(f, target) {
1015
- return (...args) => __awaiter$Y(this, void 0, void 0, function* () {
1015
+ return (...args) => __awaiter$Z(this, void 0, void 0, function* () {
1016
1016
  try {
1017
1017
  return yield f(...args);
1018
1018
  }
@@ -1119,7 +1119,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
1119
1119
 
1120
1120
  // Copyright (c) Microsoft Corporation.
1121
1121
  // Licensed under the MIT License.
1122
- var __awaiter$X = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1122
+ var __awaiter$Y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1123
1123
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1124
1124
  return new (P || (P = Promise))(function (resolve, reject) {
1125
1125
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1209,7 +1209,7 @@ class EventSubscriber {
1209
1209
  };
1210
1210
  // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.
1211
1211
  // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.
1212
- this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$X(this, void 0, void 0, function* () {
1212
+ this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$Y(this, void 0, void 0, function* () {
1213
1213
  var _a, e_1, _b, _c;
1214
1214
  try {
1215
1215
  for (var _d = true, _e = __asyncValues$1(this.chatClient
@@ -1303,7 +1303,7 @@ class EventSubscriber {
1303
1303
 
1304
1304
  // Copyright (c) Microsoft Corporation.
1305
1305
  // Licensed under the MIT License.
1306
- var __awaiter$W = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1306
+ var __awaiter$X = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1307
1307
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1308
1308
  return new (P || (P = Promise))(function (resolve, reject) {
1309
1309
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1325,7 +1325,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
1325
1325
  const threadsIterator = iteratorCreator(...args);
1326
1326
  return {
1327
1327
  next() {
1328
- return __awaiter$W(this, void 0, void 0, function* () {
1328
+ return __awaiter$X(this, void 0, void 0, function* () {
1329
1329
  const result = yield threadsIterator.next();
1330
1330
  if (!result.done && result.value) {
1331
1331
  decorateFn(result.value, context);
@@ -1340,7 +1340,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
1340
1340
  const pages = threadsIterator.byPage(settings);
1341
1341
  return {
1342
1342
  next() {
1343
- return __awaiter$W(this, void 0, void 0, function* () {
1343
+ return __awaiter$X(this, void 0, void 0, function* () {
1344
1344
  const result = yield pages.next();
1345
1345
  const page = result.value;
1346
1346
  if (!result.done && result.value) {
@@ -1427,7 +1427,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
1427
1427
 
1428
1428
  // Copyright (c) Microsoft Corporation.
1429
1429
  // Licensed under the MIT License.
1430
- var __awaiter$V = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1430
+ var __awaiter$W = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1431
1431
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1432
1432
  return new (P || (P = Promise))(function (resolve, reject) {
1433
1433
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1446,14 +1446,14 @@ class ProxyChatThreadClient {
1446
1446
  return createDecoratedListMessages(chatThreadClient, this._context);
1447
1447
  }
1448
1448
  case 'getMessage': {
1449
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$V(this, void 0, void 0, function* () {
1449
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$W(this, void 0, void 0, function* () {
1450
1450
  const message = yield chatThreadClient.getMessage(...args);
1451
1451
  this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
1452
1452
  return message;
1453
1453
  }), 'ChatThreadClient.getMessage');
1454
1454
  }
1455
1455
  case 'sendMessage': {
1456
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$V(this, void 0, void 0, function* () {
1456
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$W(this, void 0, void 0, function* () {
1457
1457
  var _a;
1458
1458
  // Retry logic?
1459
1459
  const [request, options] = args;
@@ -1494,7 +1494,7 @@ class ProxyChatThreadClient {
1494
1494
  }), 'ChatThreadClient.sendMessage');
1495
1495
  }
1496
1496
  case 'addParticipants': {
1497
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$V(this, void 0, void 0, function* () {
1497
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$W(this, void 0, void 0, function* () {
1498
1498
  const result = yield chatThreadClient.addParticipants(...args);
1499
1499
  const [addRequest] = args;
1500
1500
  const participantsToAdd = addRequest.participants;
@@ -1503,7 +1503,7 @@ class ProxyChatThreadClient {
1503
1503
  }), 'ChatThreadClient.addParticipants');
1504
1504
  }
1505
1505
  case 'deleteMessage': {
1506
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$V(this, void 0, void 0, function* () {
1506
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$W(this, void 0, void 0, function* () {
1507
1507
  // DeleteMessage is able to either delete local one(for failed message) or synced message
1508
1508
  const [messageId] = args;
1509
1509
  if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
@@ -1521,12 +1521,12 @@ class ProxyChatThreadClient {
1521
1521
  return createDecoratedListReadReceipts(chatThreadClient, this._context);
1522
1522
  }
1523
1523
  case 'sendTypingNotification': {
1524
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$V(this, void 0, void 0, function* () {
1524
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$W(this, void 0, void 0, function* () {
1525
1525
  return yield chatThreadClient.sendTypingNotification(...args);
1526
1526
  }), 'ChatThreadClient.sendTypingNotification');
1527
1527
  }
1528
1528
  case 'removeParticipant': {
1529
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$V(this, void 0, void 0, function* () {
1529
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$W(this, void 0, void 0, function* () {
1530
1530
  const result = yield chatThreadClient.removeParticipant(...args);
1531
1531
  const [removeIdentifier] = args;
1532
1532
  this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
@@ -1534,7 +1534,7 @@ class ProxyChatThreadClient {
1534
1534
  }), 'ChatThreadClient.removeParticipant');
1535
1535
  }
1536
1536
  case 'updateMessage': {
1537
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$V(this, void 0, void 0, function* () {
1537
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$W(this, void 0, void 0, function* () {
1538
1538
  const result = yield chatThreadClient.updateMessage(...args);
1539
1539
  const [messageId, updateOption] = args;
1540
1540
  this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
@@ -1542,7 +1542,7 @@ class ProxyChatThreadClient {
1542
1542
  }), 'ChatThreadClient.updateMessage');
1543
1543
  }
1544
1544
  case 'updateTopic': {
1545
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$V(this, void 0, void 0, function* () {
1545
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$W(this, void 0, void 0, function* () {
1546
1546
  const result = yield chatThreadClient.updateTopic(...args);
1547
1547
  const [topic] = args;
1548
1548
  this._context.updateThreadTopic(chatThreadClient.threadId, topic);
@@ -1550,7 +1550,7 @@ class ProxyChatThreadClient {
1550
1550
  }), 'ChatThreadClient.updateTopic');
1551
1551
  }
1552
1552
  case 'getProperties': {
1553
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$V(this, void 0, void 0, function* () {
1553
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$W(this, void 0, void 0, function* () {
1554
1554
  const result = yield chatThreadClient.getProperties(...args);
1555
1555
  this._context.updateThread(chatThreadClient.threadId, result);
1556
1556
  return result;
@@ -1588,7 +1588,7 @@ const createDecoratedListThreads = (chatClient, context) => {
1588
1588
 
1589
1589
  // Copyright (c) Microsoft Corporation.
1590
1590
  // Licensed under the MIT License.
1591
- var __awaiter$U = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1591
+ var __awaiter$V = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1592
1592
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1593
1593
  return new (P || (P = Promise))(function (resolve, reject) {
1594
1594
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1607,7 +1607,7 @@ const proxyChatClient = {
1607
1607
  switch (prop) {
1608
1608
  case 'createChatThread': {
1609
1609
  return context.withAsyncErrorTeedToState(function (...args) {
1610
- return __awaiter$U(this, void 0, void 0, function* () {
1610
+ return __awaiter$V(this, void 0, void 0, function* () {
1611
1611
  const result = yield chatClient.createChatThread(...args);
1612
1612
  const thread = result.chatThread;
1613
1613
  if (thread) {
@@ -1620,7 +1620,7 @@ const proxyChatClient = {
1620
1620
  }
1621
1621
  case 'deleteChatThread': {
1622
1622
  return context.withAsyncErrorTeedToState(function (...args) {
1623
- return __awaiter$U(this, void 0, void 0, function* () {
1623
+ return __awaiter$V(this, void 0, void 0, function* () {
1624
1624
  const result = yield chatClient.deleteChatThread(...args);
1625
1625
  context.deleteThread(args[0]);
1626
1626
  return result;
@@ -1640,7 +1640,7 @@ const proxyChatClient = {
1640
1640
  }
1641
1641
  case 'startRealtimeNotifications': {
1642
1642
  return context.withAsyncErrorTeedToState(function (...args) {
1643
- return __awaiter$U(this, void 0, void 0, function* () {
1643
+ return __awaiter$V(this, void 0, void 0, function* () {
1644
1644
  const ret = yield chatClient.startRealtimeNotifications(...args);
1645
1645
  if (!receiver.eventSubscriber) {
1646
1646
  receiver.eventSubscriber = new EventSubscriber(chatClient, context);
@@ -1651,7 +1651,7 @@ const proxyChatClient = {
1651
1651
  }
1652
1652
  case 'stopRealtimeNotifications': {
1653
1653
  return context.withAsyncErrorTeedToState(function (...args) {
1654
- return __awaiter$U(this, void 0, void 0, function* () {
1654
+ return __awaiter$V(this, void 0, void 0, function* () {
1655
1655
  const ret = yield chatClient.stopRealtimeNotifications(...args);
1656
1656
  if (receiver.eventSubscriber) {
1657
1657
  receiver.eventSubscriber.unsubscribe();
@@ -1760,7 +1760,7 @@ const getImageAttachmentsFromHTMLContent = (content) => {
1760
1760
 
1761
1761
  // Copyright (c) Microsoft Corporation.
1762
1762
  // Licensed under the MIT License.
1763
- var __awaiter$T = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1763
+ var __awaiter$U = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1764
1764
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1765
1765
  return new (P || (P = Promise))(function (resolve, reject) {
1766
1766
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1786,7 +1786,7 @@ const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {
1786
1786
  // due to a bug in babel, we can't use arrow function here
1787
1787
  // affecting conditional-compile-remove(attachment-upload)
1788
1788
  onSendMessage: function (content, options) {
1789
- return __awaiter$T(this, void 0, void 0, function* () {
1789
+ return __awaiter$U(this, void 0, void 0, function* () {
1790
1790
  const sendMessageRequest = {
1791
1791
  content,
1792
1792
  senderDisplayName: chatClient.getState().displayName
@@ -1822,14 +1822,14 @@ const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {
1822
1822
  },
1823
1823
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
1824
1824
  onUploadImage: function (image, imageFilename) {
1825
- return __awaiter$T(this, void 0, void 0, function* () {
1825
+ return __awaiter$U(this, void 0, void 0, function* () {
1826
1826
  const imageResult = yield chatThreadClient.uploadImage(image, imageFilename);
1827
1827
  return imageResult;
1828
1828
  });
1829
1829
  },
1830
1830
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
1831
1831
  onDeleteImage: function (imageId) {
1832
- return __awaiter$T(this, void 0, void 0, function* () {
1832
+ return __awaiter$U(this, void 0, void 0, function* () {
1833
1833
  try {
1834
1834
  yield chatThreadClient.deleteImage(imageId);
1835
1835
  }
@@ -1844,7 +1844,7 @@ const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {
1844
1844
  onUpdateMessage: function (messageId, content,
1845
1845
  /* @conditional-compile-remove(file-sharing-acs) */
1846
1846
  options) {
1847
- return __awaiter$T(this, void 0, void 0, function* () {
1847
+ return __awaiter$U(this, void 0, void 0, function* () {
1848
1848
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
1849
1849
  const imageAttachments = getImageAttachmentsFromHTMLContent(content);
1850
1850
  const updateMessageOptions = {
@@ -1857,23 +1857,23 @@ const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {
1857
1857
  yield chatThreadClient.updateMessage(messageId, updateMessageOptions);
1858
1858
  });
1859
1859
  },
1860
- onDeleteMessage: (messageId) => __awaiter$T(void 0, void 0, void 0, function* () {
1860
+ onDeleteMessage: (messageId) => __awaiter$U(void 0, void 0, void 0, function* () {
1861
1861
  yield chatThreadClient.deleteMessage(messageId);
1862
1862
  }),
1863
1863
  // This handler is designed for chatThread to consume
1864
- onMessageSeen: (chatMessageId) => __awaiter$T(void 0, void 0, void 0, function* () {
1864
+ onMessageSeen: (chatMessageId) => __awaiter$U(void 0, void 0, void 0, function* () {
1865
1865
  yield chatThreadClient.sendReadReceipt({ chatMessageId });
1866
1866
  }),
1867
- onTyping: () => __awaiter$T(void 0, void 0, void 0, function* () {
1867
+ onTyping: () => __awaiter$U(void 0, void 0, void 0, function* () {
1868
1868
  yield chatThreadClient.sendTypingNotification();
1869
1869
  }),
1870
- onRemoveParticipant: (userId) => __awaiter$T(void 0, void 0, void 0, function* () {
1870
+ onRemoveParticipant: (userId) => __awaiter$U(void 0, void 0, void 0, function* () {
1871
1871
  yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
1872
1872
  }),
1873
- updateThreadTopicName: (topicName) => __awaiter$T(void 0, void 0, void 0, function* () {
1873
+ updateThreadTopicName: (topicName) => __awaiter$U(void 0, void 0, void 0, function* () {
1874
1874
  yield chatThreadClient.updateTopic(topicName);
1875
1875
  }),
1876
- onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$T(void 0, void 0, void 0, function* () {
1876
+ onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$U(void 0, void 0, void 0, function* () {
1877
1877
  var _a, _b, _c;
1878
1878
  if (messageIterator === undefined) {
1879
1879
  // Lazy definition so that errors in the method call are reported correctly.
@@ -4481,7 +4481,7 @@ const _MentionPopover = (props) => {
4481
4481
 
4482
4482
  // Copyright (c) Microsoft Corporation.
4483
4483
  // Licensed under the MIT License.
4484
- var __awaiter$S = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4484
+ var __awaiter$T = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4485
4485
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4486
4486
  return new (P || (P = Promise))(function (resolve, reject) {
4487
4487
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -4667,7 +4667,7 @@ const TextFieldWithMention = (props) => {
4667
4667
  onSuggestionSelected,
4668
4668
  updateMentionSuggestions
4669
4669
  ]);
4670
- const debouncedQueryUpdate = useDebounce.useDebouncedCallback((query) => __awaiter$S(void 0, void 0, void 0, function* () {
4670
+ const debouncedQueryUpdate = useDebounce.useDebouncedCallback((query) => __awaiter$T(void 0, void 0, void 0, function* () {
4671
4671
  var _a;
4672
4672
  let suggestions = (_a = (yield (mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.onQueryUpdated(query)))) !== null && _a !== void 0 ? _a : [];
4673
4673
  suggestions = suggestions.filter((suggestion) => suggestion.displayText.trim() !== '');
@@ -4844,7 +4844,7 @@ const TextFieldWithMention = (props) => {
4844
4844
  });
4845
4845
  }
4846
4846
  }, [updateSelectionIndexesWithMentionIfNeeded, setSelectionStartValue, setSelectionEndValue]);
4847
- const handleOnChange = React.useCallback((_b) => __awaiter$S(void 0, [_b], void 0, function* ({ currentSelectionEnd, currentSelectionStart, currentTriggerStartIndex, event, htmlTextValue, inputTextValue, previousSelectionEnd, previousSelectionStart, tagsValue, updatedValue }) {
4847
+ const handleOnChange = React.useCallback((_b) => __awaiter$T(void 0, [_b], void 0, function* ({ currentSelectionEnd, currentSelectionStart, currentTriggerStartIndex, event, htmlTextValue, inputTextValue, previousSelectionEnd, previousSelectionStart, tagsValue, updatedValue }) {
4848
4848
  var _c;
4849
4849
  debouncedQueryUpdate.cancel();
4850
4850
  if (event.currentTarget === null) {
@@ -5397,7 +5397,7 @@ const ATTACHMENT_CARD_MIN_PROGRESS = 0.05;
5397
5397
 
5398
5398
  // Copyright (c) Microsoft Corporation.
5399
5399
  // Licensed under the MIT License.
5400
- var __awaiter$R = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5400
+ var __awaiter$S = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5401
5401
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5402
5402
  return new (P || (P = Promise))(function (resolve, reject) {
5403
5403
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -5485,7 +5485,7 @@ const MappedMenuItems = (menuActions, attachment, handleOnClickError) => {
5485
5485
  React.createElement(reactComponents.MenuTrigger, null,
5486
5486
  React.createElement(reactComponents.ToolbarButton, { "aria-label": localeStrings.attachmentMoreMenu, role: "button", icon: React.createElement(react.Icon, { iconName: "AttachmentMoreMenu" }) }))),
5487
5487
  React.createElement(reactComponents.MenuPopover, null,
5488
- React.createElement(reactComponents.MenuList, null, menuActions.map((menuItem, index) => (React.createElement(reactComponents.MenuItem, { "aria-label": menuItem.name, key: index, icon: menuItem.icon, onClick: () => __awaiter$R(void 0, void 0, void 0, function* () {
5488
+ React.createElement(reactComponents.MenuList, null, menuActions.map((menuItem, index) => (React.createElement(reactComponents.MenuItem, { "aria-label": menuItem.name, key: index, icon: menuItem.icon, onClick: () => __awaiter$S(void 0, void 0, void 0, function* () {
5489
5489
  try {
5490
5490
  yield menuItem.onClick(attachment);
5491
5491
  }
@@ -5620,7 +5620,7 @@ const _AttachmentUploadCards = (props) => {
5620
5620
 
5621
5621
  // Copyright (c) Microsoft Corporation.
5622
5622
  // Licensed under the MIT License.
5623
- var __awaiter$Q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5623
+ var __awaiter$R = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5624
5624
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5625
5625
  return new (P || (P = Promise))(function (resolve, reject) {
5626
5626
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -5669,7 +5669,7 @@ const hasInlineImageContent = (content) => {
5669
5669
  *
5670
5670
  * @returns The updated message content.
5671
5671
  */
5672
- const updateStylesOfInlineImages = (message, initialInlineImages) => __awaiter$Q(void 0, void 0, void 0, function* () {
5672
+ const updateStylesOfInlineImages = (message, initialInlineImages) => __awaiter$R(void 0, void 0, void 0, function* () {
5673
5673
  if (message === '') {
5674
5674
  return message;
5675
5675
  }
@@ -5697,8 +5697,7 @@ const updateStylesOfInlineImages = (message, initialInlineImages) => __awaiter$Q
5697
5697
  resolve();
5698
5698
  };
5699
5699
  imageElement.onerror = () => {
5700
- console.log('Error loading image', img.src);
5701
- rejects();
5700
+ rejects(`Error loading image ${img.id}`);
5702
5701
  };
5703
5702
  });
5704
5703
  });
@@ -5762,10 +5761,15 @@ const toAttachmentMetadata = (attachmentsWithProgress) => {
5762
5761
  /**
5763
5762
  * @internal
5764
5763
  */
5765
- const modifyInlineImagesInContentString = (content, initialInlineImages, onCompleted) => __awaiter$Q(void 0, void 0, void 0, function* () {
5764
+ const modifyInlineImagesInContentString = (content, initialInlineImages, onCompleted) => __awaiter$R(void 0, void 0, void 0, function* () {
5766
5765
  let newContent = content;
5767
5766
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
5768
- newContent = yield updateStylesOfInlineImages(content, initialInlineImages);
5767
+ try {
5768
+ newContent = yield updateStylesOfInlineImages(content, initialInlineImages);
5769
+ }
5770
+ catch (error) {
5771
+ console.error('Error updating inline images: ', error);
5772
+ }
5769
5773
  onCompleted === null || onCompleted === void 0 ? void 0 : onCompleted(newContent);
5770
5774
  });
5771
5775
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
@@ -6883,6 +6887,7 @@ var PluginEventType;
6883
6887
  PluginEventType["BeforeSetContent"] = "beforeSetContent";
6884
6888
  PluginEventType["Input"] = "input";
6885
6889
  PluginEventType["KeyDown"] = "keyDown";
6890
+ PluginEventType["BeforeCutCopy"] = "beforeCutCopy";
6886
6891
  PluginEventType["BeforePaste"] = "beforePaste";
6887
6892
  PluginEventType["ZoomChanged"] = "zoomChanged";
6888
6893
  PluginEventType["MouseUp"] = "mouseUp";
@@ -7042,13 +7047,50 @@ const removeSingleLocalBlob = (currentLocalBlobMap, imageId) => {
7042
7047
  }
7043
7048
  };
7044
7049
 
7045
- /* @conditional-compile-remove(rich-text-editor) */
7050
+ var __awaiter$Q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7051
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7052
+ return new (P || (P = Promise))(function (resolve, reject) {
7053
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7054
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7055
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7056
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
7057
+ });
7058
+ };
7046
7059
  /**
7047
7060
  * CopyPastePlugin is a plugin for handling copy and paste events in the editor.
7048
7061
  */
7049
7062
  class CopyPastePlugin {
7050
7063
  constructor() {
7051
7064
  this.editor = null;
7065
+ /* @conditional-compile-remove(rich-text-editor-image-upload) */
7066
+ this.imageBase64DataMap = {};
7067
+ /* @conditional-compile-remove(rich-text-editor-image-upload) */
7068
+ this.handleInlineImage = (event) => {
7069
+ if (event.eventType === PluginEventType.BeforePaste && event.pasteType === 'normal' && this.onInsertInlineImage) {
7070
+ event.fragment.querySelectorAll('img').forEach((image) => {
7071
+ // Assign a unique id to the image element so Contosos can identify the image element.
7072
+ // We also use it internally such as in getRemovedInlineImages to compare images in the content with previous images
7073
+ image.id = uuid.v1();
7074
+ const clipboardImage = event.clipboardData.image;
7075
+ const fileName = (clipboardImage === null || clipboardImage === void 0 ? void 0 : clipboardImage.name) ||
7076
+ (clipboardImage === null || clipboardImage === void 0 ? void 0 : clipboardImage.type.replace('/', '.')) ||
7077
+ image.getAttribute(_IMAGE_ATTRIBUTE_INLINE_IMAGE_FILE_NAME_KEY) ||
7078
+ '';
7079
+ // If the image src is an external url, call the onInsertInlineImage callback with the url.
7080
+ let imageUrl = image.src;
7081
+ if (image.src.startsWith('data:image/')) {
7082
+ this.imageBase64DataMap[image.id] = image.src;
7083
+ const blobImage = _base64ToBlob(image.src);
7084
+ imageUrl = URL.createObjectURL(blobImage);
7085
+ }
7086
+ image.src = imageUrl;
7087
+ image.alt = image.alt || 'image';
7088
+ image.dataset.imageFileName = fileName;
7089
+ const imageAttributes = getInlineImageAttributes(image);
7090
+ this.onInsertInlineImage && this.onInsertInlineImage(imageAttributes);
7091
+ });
7092
+ }
7093
+ };
7052
7094
  }
7053
7095
  getName() {
7054
7096
  return 'CopyPastePlugin';
@@ -7058,6 +7100,15 @@ class CopyPastePlugin {
7058
7100
  }
7059
7101
  dispose() { }
7060
7102
  onPluginEvent(event) {
7103
+ /* @conditional-compile-remove(rich-text-editor-image-upload) */
7104
+ if (event.eventType === PluginEventType.BeforeCutCopy) {
7105
+ event.clonedRoot.querySelectorAll('img').forEach((image) => __awaiter$Q(this, void 0, void 0, function* () {
7106
+ if (image.src.startsWith('blob:')) {
7107
+ const base64Data = this.imageBase64DataMap[image.id];
7108
+ image.src = base64Data || image.src;
7109
+ }
7110
+ }));
7111
+ }
7061
7112
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
7062
7113
  // If onInsertInlineImage is not provided, we should remove the image tags before calling the onPaste callback
7063
7114
  if (event.eventType === PluginEventType.BeforePaste && event.pasteType === 'normal' && !this.onInsertInlineImage) {
@@ -7067,7 +7118,7 @@ class CopyPastePlugin {
7067
7118
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
7068
7119
  // We should handle the onInsertInlineImage after the onPaste callback in case Contosos want to modify the image tags, especially the src attribute.
7069
7120
  if (this.onInsertInlineImage) {
7070
- handleInlineImage(event, this.onInsertInlineImage);
7121
+ this.handleInlineImage(event);
7071
7122
  }
7072
7123
  if (this.editor !== null && !this.editor.isDisposed()) {
7073
7124
  // scroll the editor to the correct position after pasting content
@@ -7088,36 +7139,6 @@ const handleBeforePasteEvent = (event,
7088
7139
  return;
7089
7140
  }
7090
7141
  };
7091
- /* @conditional-compile-remove(rich-text-editor-image-upload) */
7092
- /**
7093
- * @internal
7094
- * Exported only for unit testing
7095
- */
7096
- const handleInlineImage = (event, onInsertInlineImage) => {
7097
- if (event.eventType === PluginEventType.BeforePaste && event.pasteType === 'normal' && onInsertInlineImage) {
7098
- event.fragment.querySelectorAll('img').forEach((image) => {
7099
- const clipboardImage = event.clipboardData.image;
7100
- const fileName = (clipboardImage === null || clipboardImage === void 0 ? void 0 : clipboardImage.name) ||
7101
- (clipboardImage === null || clipboardImage === void 0 ? void 0 : clipboardImage.type.replace('/', '.')) ||
7102
- image.getAttribute(_IMAGE_ATTRIBUTE_INLINE_IMAGE_FILE_NAME_KEY) ||
7103
- '';
7104
- // If the image src is an external url, call the onInsertInlineImage callback with the url.
7105
- let imageUrl = image.src;
7106
- if (image.src.startsWith('data:image/')) {
7107
- const blobImage = _base64ToBlob(image.src);
7108
- imageUrl = URL.createObjectURL(blobImage);
7109
- }
7110
- image.src = imageUrl;
7111
- image.alt = image.alt || 'image';
7112
- // Assign a unique id to the image element so Contosos can identify the image element.
7113
- // We also use it internally such as in getRemovedInlineImages to compare images in the content with previous images
7114
- image.id = uuid.v1();
7115
- image.dataset.imageFileName = fileName;
7116
- const imageAttributes = getInlineImageAttributes(image);
7117
- onInsertInlineImage(imageAttributes);
7118
- });
7119
- }
7120
- };
7121
7142
  /**
7122
7143
  * Update the scroll position of the editor after pasting content to ensure the content is visible.
7123
7144
  * @param event - The plugin event.
@@ -10721,7 +10742,7 @@ class _ErrorBoundary extends React.Component {
10721
10742
  // Copyright (c) Microsoft Corporation.
10722
10743
  // Licensed under the MIT License.
10723
10744
  /* @conditional-compile-remove(rich-text-editor) */
10724
- const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-BBTJIosO.js'); }));
10745
+ const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-BMVUY7HX.js'); }));
10725
10746
  /**
10726
10747
  * @private
10727
10748
  * Use this function to load RoosterJS dependencies early in the lifecycle.
@@ -10729,7 +10750,7 @@ const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve()
10729
10750
  *
10730
10751
  * @conditional-compile-remove(rich-text-editor)
10731
10752
  */
10732
- const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-BBTJIosO.js'); });
10753
+ const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-BMVUY7HX.js'); });
10733
10754
  /**
10734
10755
  * @private
10735
10756
  */
@@ -22943,7 +22964,7 @@ const AttachmentDownloadErrorBar = (props) => {
22943
22964
  /**
22944
22965
  * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox with lazy loading
22945
22966
  */
22946
- const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-C1Ev6MKx.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper })));
22967
+ const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-UkjXSVQH.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper })));
22947
22968
  /**
22948
22969
  * @private
22949
22970
  * Use this function to load RoosterJS dependencies early in the lifecycle.
@@ -22951,7 +22972,7 @@ const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function
22951
22972
  *
22952
22973
  /* @conditional-compile-remove(rich-text-editor-composite-support)
22953
22974
  */
22954
- const loadRichTextSendBox = () => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-C1Ev6MKx.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper }));
22975
+ const loadRichTextSendBox = () => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-UkjXSVQH.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper }));
22955
22976
  /**
22956
22977
  * @private
22957
22978
  */
@@ -23182,8 +23203,10 @@ const cancelInlineImageUpload = (imageAttributes, imageUploads, messageId, inlin
23182
23203
  id: imageUpload === null || imageUpload === void 0 ? void 0 : imageUpload.metadata.id,
23183
23204
  messageId
23184
23205
  });
23185
- if ((imageUpload === null || imageUpload === void 0 ? void 0 : imageUpload.metadata.progress) === 1) {
23186
- deleteInlineImageFromServer(imageUpload === null || imageUpload === void 0 ? void 0 : imageUpload.metadata.id, adapter);
23206
+ if ((imageUpload === null || imageUpload === void 0 ? void 0 : imageUpload.metadata.progress) === 1 && (imageUpload === null || imageUpload === void 0 ? void 0 : imageUpload.metadata.url)) {
23207
+ // The image id that we got back from the ChatSDK response is stored in the image src attribute,
23208
+ // while the metadata id is the internal image id that we assigned to the image when it was pasted in.
23209
+ deleteInlineImageFromServer(imageUpload === null || imageUpload === void 0 ? void 0 : imageUpload.metadata.url, adapter);
23187
23210
  }
23188
23211
  };
23189
23212
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
@@ -43594,4 +43617,4 @@ exports.useTeamsCall = useTeamsCall;
43594
43617
  exports.useTeamsCallAdapter = useTeamsCallAdapter;
43595
43618
  exports.useTeamsCallAgent = useTeamsCallAgent;
43596
43619
  exports.useTheme = useTheme;
43597
- //# sourceMappingURL=index-B74o7NiP.js.map
43620
+ //# sourceMappingURL=index-D46R0M5v.js.map