@hivegpt/hiveai-angular 0.0.253 → 0.0.255

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.
@@ -846,37 +846,37 @@
846
846
  if (online_search_terms && Array.isArray(online_search_terms)) {
847
847
  console.log('Online Search Terms:', online_search_terms);
848
848
  currentChatMessage.searchTerms = online_search_terms;
849
- _this.cdr.markForCheck();
849
+ _this.cdr.detectChanges();
850
850
  }
851
851
  if (web_results && Array.isArray(web_results)) {
852
852
  console.log('Web Results:', web_results);
853
853
  currentChatMessage.sourcesList = web_results;
854
854
  currentChatMessage.displayedSources = web_results === null || web_results === void 0 ? void 0 : web_results.slice(0, 3); // First 3 cards
855
855
  currentChatMessage.remainingSources = web_results === null || web_results === void 0 ? void 0 : web_results.slice(3); // Remaining items
856
- _this.cdr.markForCheck();
856
+ _this.cdr.detectChanges();
857
857
  }
858
858
  if (answer) {
859
859
  _this.isChatingWithAi = false;
860
860
  console.log('Answer:', answer);
861
861
  currentChatMessage.message =
862
862
  _this.processMessageForDisplay(answer);
863
- _this.cdr.markForCheck();
863
+ _this.cdr.detectChanges();
864
864
  _this.scrollToBottom();
865
865
  }
866
866
  if (graphs && Array.isArray(graphs)) {
867
867
  console.log('Graphs:', graphs);
868
868
  currentChatMessage.graphs = graphs;
869
- _this.cdr.markForCheck();
869
+ _this.cdr.detectChanges();
870
870
  }
871
871
  if (execution_graphs && Array.isArray(execution_graphs)) {
872
872
  console.log('Execution Graphs:', execution_graphs);
873
873
  currentChatMessage.executionGraphs = execution_graphs;
874
- _this.cdr.markForCheck();
874
+ _this.cdr.detectChanges();
875
875
  }
876
876
  if (suggestions && Array.isArray(suggestions)) {
877
877
  console.log('suggestions:', suggestions);
878
878
  currentChatMessage.relatedListItems = suggestions;
879
- _this.cdr.markForCheck();
879
+ _this.cdr.detectChanges();
880
880
  // Process online search terms as needed
881
881
  }
882
882
  // Add any other fields and their processing here
@@ -1518,11 +1518,30 @@
1518
1518
  var contentToCopy = this.chatLog[index].message;
1519
1519
  var resutlt = this.copyText("messageText_" + index, index);
1520
1520
  };
1521
+ ChatDrawerComponent.prototype.sanitizeHTML = function (html) {
1522
+ var doc = new DOMParser().parseFromString(html, 'text/html');
1523
+ // Create a new document fragment to hold the simplified content
1524
+ var fragment = document.createDocumentFragment();
1525
+ // Append the children of the body of the parsed document to the fragment
1526
+ Array.from(doc.body.childNodes).forEach(function (node) {
1527
+ fragment.appendChild(node.cloneNode(true));
1528
+ });
1529
+ // Create a new div element to hold the simplified HTML
1530
+ var simplifiedDiv = document.createElement('div');
1531
+ simplifiedDiv.appendChild(fragment);
1532
+ // Remove complex tags or attributes as needed
1533
+ // Example: remove scripts
1534
+ simplifiedDiv.querySelectorAll('script').forEach(function (script) { return script.remove(); });
1535
+ // Return the simplified HTML as a string
1536
+ return simplifiedDiv.innerHTML;
1537
+ };
1521
1538
  ChatDrawerComponent.prototype.handleEditorClick = function (index) {
1522
1539
  var _this = this;
1540
+ debugger;
1523
1541
  if (this.currentIndexForEditor == -1) {
1524
1542
  this.currentIndexForEditor = index;
1525
- this.currentMessageForEditor = this.chatLog[index].message;
1543
+ debugger;
1544
+ this.currentMessageForEditor = this.sanitizeHTML(this.chatLog[index].message);
1526
1545
  console.log("HTML1");
1527
1546
  console.log(this.currentMessageForEditor);
1528
1547
  this.cdr.detectChanges();