@hivegpt/hiveai-angular 0.0.50 → 0.0.51
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.
- package/bundles/hivegpt-hiveai-angular.umd.js +38 -20
- package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +35 -14
- package/fesm2015/hivegpt-hiveai-angular.js +35 -13
- package/fesm2015/hivegpt-hiveai-angular.js.map +1 -1
- package/hivegpt-hiveai-angular.metadata.json +1 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts +2 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -1
- package/package.json +2 -3
|
@@ -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('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@hivegpt/hiveai-angular', ['exports', '@angular/common/http', '@angular/core', '@angular/platform-browser', 'rxjs', 'rxjs/operators', '
|
|
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.
|
|
5
|
-
}(this, (function (exports, http, i0, platformBrowser, rxjs, operators,
|
|
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,40 @@
|
|
|
1280
1264
|
return rxjs.of(null);
|
|
1281
1265
|
}));
|
|
1282
1266
|
};
|
|
1267
|
+
// events/${eventId}/users-connections
|
|
1268
|
+
ChatDrawerComponent.prototype.simpleMarkdownParser = function (markdown) {
|
|
1269
|
+
// Convert headings
|
|
1270
|
+
markdown = markdown.replace(/^###### (.*$)/gim, '<h6>$1</h6>');
|
|
1271
|
+
markdown = markdown.replace(/^##### (.*$)/gim, '<h5>$1</h5>');
|
|
1272
|
+
markdown = markdown.replace(/^#### (.*$)/gim, '<h4>$1</h4>');
|
|
1273
|
+
markdown = markdown.replace(/^### (.*$)/gim, '<h3>$1</h3>');
|
|
1274
|
+
markdown = markdown.replace(/^## (.*$)/gim, '<h2>$1</h2>');
|
|
1275
|
+
markdown = markdown.replace(/^# (.*$)/gim, '<h1>$1</h1>');
|
|
1276
|
+
// Convert bold and italic
|
|
1277
|
+
markdown = markdown.replace(/\*\*\*(.*?)\*\*\*/gim, '<em><strong>$1</strong></em>');
|
|
1278
|
+
markdown = markdown.replace(/\*\*(.*?)\*\*/gim, '<strong>$1</strong>');
|
|
1279
|
+
markdown = markdown.replace(/\*(.*?)\*/gim, '<em>$1</em>');
|
|
1280
|
+
// Convert links
|
|
1281
|
+
markdown = markdown.replace(/\[(.*?)\]\((.*?)\)/gim, '<a href="$2">$1</a>');
|
|
1282
|
+
// Convert unordered lists
|
|
1283
|
+
markdown = markdown.replace(/^\* (.*)/gim, '<ul><li>$1</li></ul>');
|
|
1284
|
+
markdown = markdown.replace(/^\- (.*)/gim, '<ul><li>$1</li></ul>');
|
|
1285
|
+
markdown = markdown.replace(/^\+ (.*)/gim, '<ul><li>$1</li></ul>');
|
|
1286
|
+
// Convert ordered lists
|
|
1287
|
+
markdown = markdown.replace(/^\d+\. (.*)/gim, '<ol><li>$1</li></ol>');
|
|
1288
|
+
// Convert line breaks
|
|
1289
|
+
markdown = markdown.replace(/\n/gim, '<br/>');
|
|
1290
|
+
return markdown.trim();
|
|
1291
|
+
};
|
|
1292
|
+
ChatDrawerComponent.prototype.handleMarkdown = function (markdownContent) {
|
|
1293
|
+
if (markdownContent) {
|
|
1294
|
+
var htmlContent = this.simpleMarkdownParser(markdownContent);
|
|
1295
|
+
return this.sanitizer.bypassSecurityTrustHtml(htmlContent);
|
|
1296
|
+
}
|
|
1297
|
+
else {
|
|
1298
|
+
return markdownContent;
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1283
1301
|
return ChatDrawerComponent;
|
|
1284
1302
|
}());
|
|
1285
1303
|
ChatDrawerComponent.decorators = [
|