@hivegpt/hiveai-angular 0.0.50 → 0.0.52

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('@angular/platform-browser'), require('rxjs'), require('rxjs/operators'), require('marked'), require('@angular/common'), require('@angular/forms'), require('@angular/material/icon'), require('@angular/material/sidenav')) :
3
- typeof define === 'function' && define.amd ? define('@hivegpt/hiveai-angular', ['exports', '@angular/common/http', '@angular/core', '@angular/platform-browser', 'rxjs', 'rxjs/operators', 'marked', '@angular/common', '@angular/forms', '@angular/material/icon', '@angular/material/sidenav'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.hivegpt = global.hivegpt || {}, global.hivegpt['hiveai-angular'] = {}), global.ng.common.http, global.ng.core, global.ng.platformBrowser, global.rxjs, global.rxjs.operators, global.marked, global.ng.common, global.ng.forms, global.ng.material.icon, global.ng.material.sidenav));
5
- }(this, (function (exports, http, i0, platformBrowser, rxjs, operators, marked, common, forms, icon, sidenav) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('@angular/platform-browser'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/material/icon'), require('@angular/material/sidenav')) :
3
+ typeof define === 'function' && define.amd ? define('@hivegpt/hiveai-angular', ['exports', '@angular/common/http', '@angular/core', '@angular/platform-browser', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/material/icon', '@angular/material/sidenav'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.hivegpt = global.hivegpt || {}, global.hivegpt['hiveai-angular'] = {}), global.ng.common.http, global.ng.core, global.ng.platformBrowser, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.material.icon, global.ng.material.sidenav));
5
+ }(this, (function (exports, http, i0, platformBrowser, rxjs, operators, common, forms, icon, sidenav) { 'use strict';
6
6
 
7
7
  /******************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -1156,22 +1156,6 @@
1156
1156
  ChatDrawerComponent.prototype.removeBodyOverflow = function () {
1157
1157
  this.renderer.removeClass(document.body, this.bodyOverflowClass);
1158
1158
  };
1159
- ChatDrawerComponent.prototype.handleMarkdown = function (markdownContent) {
1160
- return __awaiter(this, void 0, void 0, function () {
1161
- var htmlContent;
1162
- return __generator(this, function (_e) {
1163
- switch (_e.label) {
1164
- case 0:
1165
- if (!markdownContent) return [3 /*break*/, 2];
1166
- return [4 /*yield*/, marked.parse(markdownContent)];
1167
- case 1:
1168
- htmlContent = _e.sent();
1169
- return [2 /*return*/, this.sanitizer.bypassSecurityTrustHtml(htmlContent)];
1170
- case 2: return [2 /*return*/, markdownContent];
1171
- }
1172
- });
1173
- });
1174
- };
1175
1159
  ChatDrawerComponent.prototype.getSpeakersByStaffIds = function (ids) {
1176
1160
  var _this = this;
1177
1161
  var url = this.environment.USERS_API + "/events/" + this.eventId + "/users/get-by-staff-ids";
@@ -1280,6 +1264,37 @@
1280
1264
  return rxjs.of(null);
1281
1265
  }));
1282
1266
  };
1267
+ // events/${eventId}/users-connections
1268
+ ChatDrawerComponent.prototype.simpleMarkdownParser = function (markdownContent) {
1269
+ // Ensure markdownContent is a string
1270
+ var markdown = String(markdownContent);
1271
+ // Convert headings
1272
+ var html = markdown.replace(/^###### (.*$)/gim, '<h6>$1</h6>');
1273
+ html = html.replace(/^##### (.*$)/gim, '<h5>$1</h5>');
1274
+ html = html.replace(/^#### (.*$)/gim, '<h4>$1</h4>');
1275
+ html = html.replace(/^### (.*$)/gim, '<h3>$1</h3>');
1276
+ html = html.replace(/^## (.*$)/gim, '<h2>$1</h2>');
1277
+ html = html.replace(/^# (.*$)/gim, '<h1>$1</h1>');
1278
+ // Convert bold and italic
1279
+ html = html.replace(/\*\*\*(.*?)\*\*\*/gim, '<em><strong>$1</strong></em>');
1280
+ html = html.replace(/\*\*(.*?)\*\*/gim, '<strong>$1</strong>');
1281
+ html = html.replace(/\*(.*?)\*/gim, '<em>$1</em>');
1282
+ // Convert links
1283
+ html = html.replace(/\[(.*?)\]\((.*?)\)/gim, '<a href="$2">$1</a>');
1284
+ // Convert unordered lists
1285
+ html = html.replace(/^\* (.*)/gim, '<ul><li>$1</li></ul>');
1286
+ html = html.replace(/^\- (.*)/gim, '<ul><li>$1</li></ul>');
1287
+ html = html.replace(/^\+ (.*)/gim, '<ul><li>$1</li></ul>');
1288
+ // Convert ordered lists
1289
+ html = html.replace(/^\d+\. (.*)/gim, '<ol><li>$1</li></ol>');
1290
+ // Convert line breaks
1291
+ html = html.replace(/\n/gim, '<br/>');
1292
+ return html.trim();
1293
+ };
1294
+ ChatDrawerComponent.prototype.handleMarkdown = function (markdownContent) {
1295
+ var htmlContent = this.simpleMarkdownParser(markdownContent);
1296
+ return this.sanitizer.bypassSecurityTrustHtml(htmlContent);
1297
+ };
1283
1298
  return ChatDrawerComponent;
1284
1299
  }());
1285
1300
  ChatDrawerComponent.decorators = [