@hivegpt/hiveai-angular 0.0.251 → 0.0.253

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,39 @@
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);
1551
- this.cdr.detectChanges();
1525
+ this.currentMessageForEditor = this.chatLog[index].message;
1552
1526
  console.log("HTML1");
1553
1527
  console.log(this.currentMessageForEditor);
1528
+ this.cdr.detectChanges();
1554
1529
  }
1555
1530
  else {
1556
1531
  if (this.currentIndexForEditor == index) {
1557
- this.currentMessageForEditor += this.copyTextForEditor("messageText_" + index, index);
1532
+ this.currentMessageForEditor += this.chatLog[index].message;
1558
1533
  this.cdr.detectChanges();
1559
1534
  console.log("HTML2");
1560
1535
  console.log(this.currentMessageForEditor);
1561
1536
  }
1562
1537
  else {
1563
1538
  this.currentIndexForEditor = index;
1564
- this.currentMessageForEditor = this.copyTextForEditor("messageText_" + index, index);
1539
+ this.currentMessageForEditor = this.chatLog[index].message;
1565
1540
  this.cdr.detectChanges();
1566
1541
  console.log("HTML3");
1567
1542
  console.log(this.currentMessageForEditor);
1568
1543
  }
1569
1544
  }
1545
+ this.chatLog[index].isEditor = true;
1546
+ this.cdr.detectChanges();
1547
+ // Reset the copied state after a delay
1548
+ setTimeout(function () {
1549
+ _this.chatLog[index].isEditor = false;
1550
+ _this.cdr.detectChanges();
1551
+ }, 2000); // Reset after 2 seconds
1570
1552
  this.editorsDrawer.open();
1553
+ this.cdr.detectChanges();
1571
1554
  };
1572
1555
  ChatDrawerComponent.prototype.scrollToBottom = function () {
1573
1556
  var _this = this;
@@ -2161,7 +2144,6 @@
2161
2144
 
2162
2145
  var BotHtmlEditorComponent = /** @class */ (function () {
2163
2146
  function BotHtmlEditorComponent() {
2164
- this.editorContent = '';
2165
2147
  this.quillConfig = {
2166
2148
  toolbar: [
2167
2149
  [{ header: '1' }, { header: '2' }, { font: [] }],