@hivegpt/hiveai-angular 0.0.233 → 0.0.234

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 (33) hide show
  1. package/bundles/hivegpt-hiveai-angular.umd.js +26 -17
  2. package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -1
  3. package/bundles/hivegpt-hiveai-angular.umd.min.js +1 -1
  4. package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -1
  5. package/environments/environment.d.ts.map +1 -1
  6. package/esm2015/environments/environment.js +1 -1
  7. package/esm2015/hivegpt-hiveai-angular.js +1 -1
  8. package/esm2015/lib/components/NotificationSocket.js +1 -1
  9. package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +27 -18
  10. package/esm2015/lib/components/chatbot/chatbot.component.js +1 -1
  11. package/esm2015/lib/components/conversation.service.js +1 -1
  12. package/esm2015/lib/components/socket-service.service.js +1 -1
  13. package/esm2015/lib/components/video-player/video-player.component.js +1 -1
  14. package/esm2015/lib/hivegpt.module.js +1 -1
  15. package/esm2015/lib/models/video.js +1 -1
  16. package/esm2015/lib/pipes/safe-html.pipe.js +1 -1
  17. package/esm2015/lib/utils/utils.js +1 -1
  18. package/esm2015/public-api.js +1 -1
  19. package/fesm2015/hivegpt-hiveai-angular.js +26 -17
  20. package/fesm2015/hivegpt-hiveai-angular.js.map +1 -1
  21. package/hivegpt-hiveai-angular.d.ts.map +1 -1
  22. package/lib/components/NotificationSocket.d.ts.map +1 -1
  23. package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -1
  24. package/lib/components/chatbot/chatbot.component.d.ts.map +1 -1
  25. package/lib/components/conversation.service.d.ts.map +1 -1
  26. package/lib/components/socket-service.service.d.ts.map +1 -1
  27. package/lib/components/video-player/video-player.component.d.ts.map +1 -1
  28. package/lib/hivegpt.module.d.ts.map +1 -1
  29. package/lib/models/video.d.ts.map +1 -1
  30. package/lib/pipes/safe-html.pipe.d.ts.map +1 -1
  31. package/lib/utils/utils.d.ts.map +1 -1
  32. package/package.json +1 -1
  33. package/public-api.d.ts.map +1 -1
@@ -1485,25 +1485,34 @@
1485
1485
  // }
1486
1486
  ChatDrawerComponent.prototype.handleCopyClick = function (index) {
1487
1487
  var _this = this;
1488
- // Get the message content from the chat log (this can include HTML elements)
1488
+ // Copy the message to the clipboard
1489
1489
  var contentToCopy = this.chatLog[index].message;
1490
- // Create a temporary DOM element to hold the content
1491
- var tempElement = document.createElement('div');
1492
- tempElement.innerHTML = contentToCopy;
1493
- // Get the plain text content, preserving formatting (e.g., replacing <br> with new lines)
1494
- var plainText = tempElement.innerText.replace(/\n/g, '\n');
1495
- console.log('Content to Copy:', plainText);
1496
- // Copy the plain text to the clipboard
1497
- navigator.clipboard.writeText(plainText).then(function () {
1498
- // Indicate that the message was copied
1499
- _this.chatLog[index].copied = true;
1490
+ var textArea = document.createElement('textarea');
1491
+ textArea.style.position = 'fixed';
1492
+ textArea.style.opacity = '0';
1493
+ textArea.value = contentToCopy;
1494
+ // Append the textarea to the body
1495
+ document.body.appendChild(textArea);
1496
+ // Select the content and copy it to the clipboard
1497
+ textArea.select();
1498
+ document.execCommand('copy');
1499
+ this.chatLog[index].copied = true;
1500
+ this.cdr.detectChanges();
1501
+ // Reset the copied state after a delay
1502
+ setTimeout(function () {
1503
+ _this.chatLog[index].copied = false;
1500
1504
  _this.cdr.detectChanges();
1501
- // Reset the copied state after a delay
1502
- setTimeout(function () {
1503
- _this.chatLog[index].copied = false;
1504
- _this.cdr.detectChanges();
1505
- }, 2000); // Reset after 2 seconds
1506
- });
1505
+ }, 2000); // Reset after 2 seconds
1506
+ // navigator.clipboard.writeText(contentToCopy).then(() => {
1507
+ // // Indicate that the message was copied
1508
+ // this.chatLog[index].copied = true;
1509
+ // this.cdr.detectChanges();
1510
+ // // Reset the copied state after a delay
1511
+ // setTimeout(() => {
1512
+ // this.chatLog[index].copied = false;
1513
+ // this.cdr.detectChanges();
1514
+ // }, 2000); // Reset after 2 seconds
1515
+ // });
1507
1516
  };
1508
1517
  ChatDrawerComponent.prototype.scrollToBottom = function () {
1509
1518
  var _this = this;