@hivegpt/hiveai-angular 0.0.251 → 0.0.252

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.
@@ -1518,56 +1518,33 @@
1518
1518
  var contentToCopy = this.chatLog[index].message;
1519
1519
  var resutlt = this.copyText("messageText_" + index, index);
1520
1520
  };
1521
- ChatDrawerComponent.prototype.copyTextForEditor = function (id, index) {
1522
- var _this = this;
1523
- var resultToreturn = '';
1524
- // Get the text element
1525
- var textElement = document.getElementById(id);
1526
- // Create a temporary textarea element to copy the text
1527
- var tempTextArea = document.createElement('textarea');
1528
- tempTextArea.value = textElement.innerText;
1529
- // Append the textarea to the body (necessary for the execCommand to work)
1530
- document.body.appendChild(tempTextArea);
1531
- // Select the text inside the textarea
1532
- tempTextArea.select();
1533
- resultToreturn = tempTextArea.value;
1534
- // Copy the text to the clipboard
1535
- // document.execCommand('copy');
1536
- // Remove the temporary textarea
1537
- document.body.removeChild(tempTextArea);
1538
- this.chatLog[index].isEditor = true;
1539
- this.cdr.detectChanges();
1540
- // Reset the copied state after a delay
1541
- setTimeout(function () {
1542
- _this.chatLog[index].isEditor = false;
1543
- _this.cdr.detectChanges();
1544
- }, 2000); // Reset after 2 seconds
1545
- return resultToreturn;
1546
- };
1547
1521
  ChatDrawerComponent.prototype.handleEditorClick = function (index) {
1522
+ var _this = this;
1548
1523
  if (this.currentIndexForEditor == -1) {
1549
1524
  this.currentIndexForEditor = index;
1550
- this.currentMessageForEditor = this.copyTextForEditor("messageText_" + index, index);
1525
+ this.currentMessageForEditor = this.chatLog[index].message;
1551
1526
  this.cdr.detectChanges();
1552
- console.log("HTML1");
1553
- console.log(this.currentMessageForEditor);
1554
1527
  }
1555
1528
  else {
1556
1529
  if (this.currentIndexForEditor == index) {
1557
- this.currentMessageForEditor += this.copyTextForEditor("messageText_" + index, index);
1530
+ this.currentMessageForEditor += this.chatLog[index].message;
1558
1531
  this.cdr.detectChanges();
1559
- console.log("HTML2");
1560
- console.log(this.currentMessageForEditor);
1561
1532
  }
1562
1533
  else {
1563
1534
  this.currentIndexForEditor = index;
1564
- this.currentMessageForEditor = this.copyTextForEditor("messageText_" + index, index);
1535
+ this.currentMessageForEditor = this.chatLog[index].message;
1565
1536
  this.cdr.detectChanges();
1566
- console.log("HTML3");
1567
- console.log(this.currentMessageForEditor);
1568
1537
  }
1569
1538
  }
1539
+ this.chatLog[index].isEditor = true;
1540
+ this.cdr.detectChanges();
1541
+ // Reset the copied state after a delay
1542
+ setTimeout(function () {
1543
+ _this.chatLog[index].isEditor = false;
1544
+ _this.cdr.detectChanges();
1545
+ }, 2000); // Reset after 2 seconds
1570
1546
  this.editorsDrawer.open();
1547
+ this.cdr.detectChanges();
1571
1548
  };
1572
1549
  ChatDrawerComponent.prototype.scrollToBottom = function () {
1573
1550
  var _this = this;