@hivegpt/hiveai-angular 0.0.473 → 0.0.474
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 +27 -26
- 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 +22 -24
- package/esm2015/lib/components/chatbot/chatbot.component.js +4 -3
- package/esm2015/lib/utils/utils.js +4 -2
- package/fesm2015/hivegpt-hiveai-angular.js +27 -26
- 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 +10 -5
- package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -1
- package/lib/components/chatbot/chatbot.component.d.ts +4 -1
- package/lib/components/chatbot/chatbot.component.d.ts.map +1 -1
- package/lib/utils/utils.d.ts +1 -1
- package/lib/utils/utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -811,8 +811,10 @@
|
|
|
811
811
|
hour12: true,
|
|
812
812
|
hour: 'numeric',
|
|
813
813
|
minute: 'numeric',
|
|
814
|
-
timeZone: timezone,
|
|
815
814
|
};
|
|
815
|
+
if (timezone && timezone.trim()) {
|
|
816
|
+
options.timeZone = timezone.trim();
|
|
817
|
+
}
|
|
816
818
|
return date.toLocaleString('en-US', options);
|
|
817
819
|
};
|
|
818
820
|
|
|
@@ -2316,21 +2318,22 @@
|
|
|
2316
2318
|
}, 200);
|
|
2317
2319
|
}, 300);
|
|
2318
2320
|
};
|
|
2319
|
-
/**
|
|
2320
|
-
|
|
2321
|
+
/**
|
|
2322
|
+
* Format session date/time for display.
|
|
2323
|
+
* @param dateTimeRange Session start/end (object with start/end or string with "Start: ... End: ...")
|
|
2324
|
+
* @param displayTimeZone Optional user-selected timezone (e.g. 'America/New_York'); when set, times are shown in this zone.
|
|
2325
|
+
*/
|
|
2326
|
+
ChatDrawerComponent.prototype.formatSessionWhen = function (dateTimeRange, displayTimeZone) {
|
|
2327
|
+
var localeOpts = displayTimeZone ? { timeZone: displayTimeZone } : {};
|
|
2321
2328
|
if (!dateTimeRange)
|
|
2322
2329
|
return '';
|
|
2323
2330
|
if (typeof dateTimeRange === 'object' && (dateTimeRange === null || dateTimeRange === void 0 ? void 0 : dateTimeRange.start) && (dateTimeRange === null || dateTimeRange === void 0 ? void 0 : dateTimeRange.end)) {
|
|
2324
2331
|
try {
|
|
2325
2332
|
var startDt = new Date(dateTimeRange.start);
|
|
2326
2333
|
var endDt = new Date(dateTimeRange.end);
|
|
2327
|
-
var dateFormatted = startDt.toLocaleDateString('en-US', {
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
year: 'numeric',
|
|
2331
|
-
});
|
|
2332
|
-
var startTime = startDt.toTimeString().slice(0, 5);
|
|
2333
|
-
var endTime = endDt.toTimeString().slice(0, 5);
|
|
2334
|
+
var dateFormatted = startDt.toLocaleDateString('en-US', Object.assign({ month: 'short', day: 'numeric', year: 'numeric' }, localeOpts));
|
|
2335
|
+
var startTime = startDt.toLocaleTimeString('en-US', Object.assign({ hour: '2-digit', minute: '2-digit', hour12: false }, localeOpts));
|
|
2336
|
+
var endTime = endDt.toLocaleTimeString('en-US', Object.assign({ hour: '2-digit', minute: '2-digit', hour12: false }, localeOpts));
|
|
2334
2337
|
return dateFormatted + " | " + startTime + " - " + endTime;
|
|
2335
2338
|
}
|
|
2336
2339
|
catch (_a) {
|
|
@@ -2346,17 +2349,11 @@
|
|
|
2346
2349
|
try {
|
|
2347
2350
|
var startStr = startMatch[1];
|
|
2348
2351
|
var endStr = endMatch[1];
|
|
2349
|
-
var
|
|
2350
|
-
var
|
|
2351
|
-
var
|
|
2352
|
-
var
|
|
2353
|
-
var
|
|
2354
|
-
month: 'short',
|
|
2355
|
-
day: 'numeric',
|
|
2356
|
-
year: 'numeric',
|
|
2357
|
-
});
|
|
2358
|
-
var startTimeShort = startTime ? startTime.slice(0, 5) : '';
|
|
2359
|
-
var endTimeShort = endTime ? endTime.slice(0, 5) : '';
|
|
2352
|
+
var startDt = new Date(startStr.replace(' ', 'T') + 'Z');
|
|
2353
|
+
var endDt = new Date(endStr.replace(' ', 'T') + 'Z');
|
|
2354
|
+
var dateFormatted = startDt.toLocaleDateString('en-US', Object.assign({ month: 'short', day: 'numeric', year: 'numeric' }, localeOpts));
|
|
2355
|
+
var startTimeShort = startDt.toLocaleTimeString('en-US', Object.assign({ hour: '2-digit', minute: '2-digit', hour12: false }, localeOpts));
|
|
2356
|
+
var endTimeShort = endDt.toLocaleTimeString('en-US', Object.assign({ hour: '2-digit', minute: '2-digit', hour12: false }, localeOpts));
|
|
2360
2357
|
return dateFormatted + " | " + startTimeShort + " - " + endTimeShort;
|
|
2361
2358
|
}
|
|
2362
2359
|
catch (_b) {
|
|
@@ -2380,20 +2377,23 @@
|
|
|
2380
2377
|
var _this = this;
|
|
2381
2378
|
if (!Array.isArray(sessions))
|
|
2382
2379
|
return [];
|
|
2380
|
+
var userTimezone = this.timezone && String(this.timezone).trim() ? String(this.timezone).trim() : undefined;
|
|
2383
2381
|
return sessions.map(function (s) {
|
|
2384
2382
|
var _a, _b, _c, _d, _e, _f;
|
|
2385
2383
|
var whenRaw = (_a = s.dateTimeRange) !== null && _a !== void 0 ? _a : '';
|
|
2386
|
-
var whenFormatted = _this.formatSessionWhen(whenRaw);
|
|
2384
|
+
var whenFormatted = _this.formatSessionWhen(whenRaw, userTimezone);
|
|
2387
2385
|
var statusText = _this.getStatusTextFromSessionRoles(s.sessionRoles);
|
|
2388
|
-
var
|
|
2386
|
+
var sessionTimeZone = s.timeZone != null
|
|
2389
2387
|
? (typeof s.timeZone === 'object' ? ((_c = (_b = s.timeZone.id) !== null && _b !== void 0 ? _b : s.timeZone.name) !== null && _c !== void 0 ? _c : '') : String(s.timeZone))
|
|
2390
2388
|
: '';
|
|
2389
|
+
// Show user's selected timezone when set, otherwise session's timezone from data
|
|
2390
|
+
var displayTimeZone = (userTimezone || sessionTimeZone || '').trim();
|
|
2391
2391
|
return {
|
|
2392
2392
|
title: String((_d = s.title) !== null && _d !== void 0 ? _d : '').trim(),
|
|
2393
2393
|
organizer: String((_e = s.organizer) !== null && _e !== void 0 ? _e : '').trim(),
|
|
2394
2394
|
room: String((_f = s.roomName) !== null && _f !== void 0 ? _f : '').trim(),
|
|
2395
2395
|
when: whenFormatted || (typeof whenRaw === 'object' ? '' : String(whenRaw)),
|
|
2396
|
-
timeZone:
|
|
2396
|
+
timeZone: displayTimeZone,
|
|
2397
2397
|
statusText: statusText,
|
|
2398
2398
|
session: s,
|
|
2399
2399
|
};
|
|
@@ -4474,12 +4474,14 @@
|
|
|
4474
4474
|
ChatBotComponent.decorators = [
|
|
4475
4475
|
{ type: i0.Component, args: [{
|
|
4476
4476
|
selector: 'hivegpt-chatbot',
|
|
4477
|
-
template: "<button mat-icon-button class=\"chat-button\" color=\"primary\" (click)=\"toggle()\">\n <mat-icon>chat</mat-icon>\n</button>\n\n<ng-container *ngIf=\"visible\">\n <hivegpt-chat-drawer-package\n [apiKey]=\"apiKey\"\n [bgBubbleAi]=\"bgBubbleAi\"\n [bgBubbleUser]=\"bgBubbleUser\"\n [bgGradient]=\"bgGradient\"\n [botName]=\"botName\"\n [closeButtonbgColor]=\"closeButtonbgColor\"\n [closeButtonColor]=\"closeButtonColor\"\n [credentials]=\"credentials\"\n [dateTextColor]=\"dateTextColor\"\n [dateTimeColor]=\"dateTimeColor\"\n [eventId]=\"eventId\"\n [eventName]=\"eventName\"\n [formFieldBgColor]=\"formFieldBgColor\"\n [formFieldTextColor]=\"formFieldTextColor\"\n [fullView]=\"fullView\"\n [greeting]=\"greeting\"\n [gradientColors]=\"gradientColors\"\n [messageTextColorAi]=\"messageTextColorAi\"\n [messageTextColorUser]=\"messageTextColorUser\"\n [sendButtonColor]=\"sendButtonColor\"\n [sendButtonTextColor]=\"sendButtonTextColor\"\n [showClose]=\"showClose\"\n [thumbsDownMessages]=\"thumbsDownMessages\"\n [thumbsUpMessage]=\"thumbsUpMessage\"\n [unknownResponses]=\"unknownResponses\"\n [useOpenAi]=\"useOpenAi\"\n [userId]=\"userId\"\n [botId]=\"botId\"\n [s27Token]=\"s27Token\"\n [workspaceToken]=\"workspaceToken\"\n [isDev]=\"isDev\"\n [baseUrl]=\"baseUrl\"\n >\n </hivegpt-chat-drawer-package>\n</ng-container>\n",
|
|
4477
|
+
template: "<button mat-icon-button class=\"chat-button\" color=\"primary\" (click)=\"toggle()\">\n <mat-icon>chat</mat-icon>\n</button>\n\n<ng-container *ngIf=\"visible\">\n <hivegpt-chat-drawer-package\n [apiKey]=\"apiKey\"\n [bgBubbleAi]=\"bgBubbleAi\"\n [bgBubbleUser]=\"bgBubbleUser\"\n [bgGradient]=\"bgGradient\"\n [botName]=\"botName\"\n [closeButtonbgColor]=\"closeButtonbgColor\"\n [closeButtonColor]=\"closeButtonColor\"\n [credentials]=\"credentials\"\n [dateTextColor]=\"dateTextColor\"\n [dateTimeColor]=\"dateTimeColor\"\n [eventId]=\"eventId\"\n [eventName]=\"eventName\"\n [formFieldBgColor]=\"formFieldBgColor\"\n [formFieldTextColor]=\"formFieldTextColor\"\n [fullView]=\"fullView\"\n [greeting]=\"greeting\"\n [gradientColors]=\"gradientColors\"\n [messageTextColorAi]=\"messageTextColorAi\"\n [messageTextColorUser]=\"messageTextColorUser\"\n [sendButtonColor]=\"sendButtonColor\"\n [sendButtonTextColor]=\"sendButtonTextColor\"\n [showClose]=\"showClose\"\n [thumbsDownMessages]=\"thumbsDownMessages\"\n [thumbsUpMessage]=\"thumbsUpMessage\"\n [unknownResponses]=\"unknownResponses\"\n [useOpenAi]=\"useOpenAi\"\n [userId]=\"userId\"\n [userAvatarUrl]=\"userAvatarUrl\"\n [timezone]=\"timezone\"\n [botId]=\"botId\"\n [s27Token]=\"s27Token\"\n [workspaceToken]=\"workspaceToken\"\n [isDev]=\"isDev\"\n [baseUrl]=\"baseUrl\"\n >\n </hivegpt-chat-drawer-package>\n</ng-container>\n",
|
|
4478
4478
|
styles: ["::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:#f1f1f1}::-webkit-scrollbar-thumb,::-webkit-scrollbar-thumb:hover{background:#e5ccbc}.spinner{align-items:center;display:flex;gap:2px;justify-content:center}.spinner>div{animation:bouncedelay 1.4s ease-in-out infinite;animation-fill-mode:both;background-color:#173330;border-radius:100%;display:inline-block;height:5px;width:5px}.spinner .bounce1{animation-delay:-.32s}.spinner .bounce2{animation-delay:-.16s}@keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}.chat-button{align-items:center;background:#17235b;border:#17235b;border-radius:50%;bottom:20px;color:#fff;display:inline-flex;font-size:24px;height:50px;justify-content:center;position:fixed;right:20px;width:50px}"]
|
|
4479
4479
|
},] }
|
|
4480
4480
|
];
|
|
4481
4481
|
ChatBotComponent.propDecorators = {
|
|
4482
4482
|
userId: [{ type: i0.Input }],
|
|
4483
|
+
userAvatarUrl: [{ type: i0.Input }],
|
|
4484
|
+
timezone: [{ type: i0.Input }],
|
|
4483
4485
|
apiKey: [{ type: i0.Input }],
|
|
4484
4486
|
botName: [{ type: i0.Input }],
|
|
4485
4487
|
botSkills: [{ type: i0.Input }],
|
|
@@ -4504,7 +4506,6 @@
|
|
|
4504
4506
|
formFieldTextColor: [{ type: i0.Input }],
|
|
4505
4507
|
thumbsUpMessage: [{ type: i0.Input }],
|
|
4506
4508
|
thumbsDownMessages: [{ type: i0.Input }],
|
|
4507
|
-
timezone: [{ type: i0.Input }],
|
|
4508
4509
|
eventName: [{ type: i0.Input }],
|
|
4509
4510
|
credentials: [{ type: i0.Input }],
|
|
4510
4511
|
unknownResponses: [{ type: i0.Input }],
|