@datarailsshared/datarailsshared 1.4.102 → 1.4.103
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/datarailsshared-datarailsshared.umd.js +38 -3
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.103.tgz +0 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/lib/dr-chat/chat.component.js +17 -1
- package/esm2015/lib/dr-chat/dr-chat-message/chat-message.component.js +16 -3
- package/esm2015/lib/models/chat.js +1 -2
- package/fesm2015/datarailsshared-datarailsshared.js +29 -3
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-chat/chat.component.d.ts +6 -2
- package/lib/dr-chat/dr-chat-message/chat-message.component.d.ts +8 -0
- package/lib/models/chat.d.ts +0 -1
- package/package.json +1 -1
- package/datarailsshared-datarailsshared-1.4.102.tgz +0 -0
|
@@ -3938,7 +3938,6 @@
|
|
|
3938
3938
|
CHAT_MESSAGE_TYPE["DOWNLOAD_FILE"] = "download-file";
|
|
3939
3939
|
CHAT_MESSAGE_TYPE["MAILTO"] = "mailto";
|
|
3940
3940
|
CHAT_MESSAGE_TYPE["EMBED"] = "embed";
|
|
3941
|
-
CHAT_MESSAGE_TYPE["WIDGET"] = "widget";
|
|
3942
3941
|
CHAT_MESSAGE_TYPE["INPUT"] = "input";
|
|
3943
3942
|
CHAT_MESSAGE_TYPE["CODE"] = "code";
|
|
3944
3943
|
})(exports.CHAT_MESSAGE_TYPE || (exports.CHAT_MESSAGE_TYPE = {}));
|
|
@@ -5334,6 +5333,7 @@
|
|
|
5334
5333
|
this.MESSAGE_TYPE = exports.CHAT_MESSAGE_TYPE;
|
|
5335
5334
|
this.MESSAGE_TYPE_CUSTOM = exports.CHAT_MESSAGE_TYPE.EMBED;
|
|
5336
5335
|
this._reply = false;
|
|
5336
|
+
this._isEmpty = false;
|
|
5337
5337
|
}
|
|
5338
5338
|
Object.defineProperty(DrChatMessageComponent.prototype, "flyInOut", {
|
|
5339
5339
|
get: function () {
|
|
@@ -5362,6 +5362,21 @@
|
|
|
5362
5362
|
enumerable: false,
|
|
5363
5363
|
configurable: true
|
|
5364
5364
|
});
|
|
5365
|
+
Object.defineProperty(DrChatMessageComponent.prototype, "isEmpty", {
|
|
5366
|
+
/**
|
|
5367
|
+
* The outer flag is whether the message is empty. Needed if it is impossible to calculate it inside.
|
|
5368
|
+
*
|
|
5369
|
+
* @type {boolean}
|
|
5370
|
+
*/
|
|
5371
|
+
get: function () {
|
|
5372
|
+
return this._isEmpty;
|
|
5373
|
+
},
|
|
5374
|
+
set: function (value) {
|
|
5375
|
+
this._isEmpty = !!value;
|
|
5376
|
+
},
|
|
5377
|
+
enumerable: false,
|
|
5378
|
+
configurable: true
|
|
5379
|
+
});
|
|
5365
5380
|
DrChatMessageComponent.prototype.getTemplate = function () {
|
|
5366
5381
|
this.customMessage = true;
|
|
5367
5382
|
var customMessage = this.getCustomMessage(this.type);
|
|
@@ -5392,7 +5407,7 @@
|
|
|
5392
5407
|
]),
|
|
5393
5408
|
],
|
|
5394
5409
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5395
|
-
styles: [":host{display:flex;flex-direction:row}:host:not(:first-child){margin-top:8px}.reply+:host.reply,.not-reply+:host.not-reply{margin-top:3px}:host.not-reply{justify-content:flex-end}:host.not-reply .message{color:#fff;background-color:#4646ce}:host .message{display:flex;background-color:#f3f7ff;border-radius:8px;padding:16px;max-width:60%;width:auto}
|
|
5410
|
+
styles: [":host{display:flex;flex-direction:row}:host.empty{display:none}:host:not(:first-child){margin-top:8px}.reply+:host.reply,.not-reply+:host.not-reply{margin-top:3px}:host.not-reply{justify-content:flex-end}:host.not-reply .message{color:#fff;background-color:#4646ce}:host .message{display:flex;background-color:#f3f7ff;border-radius:8px;padding:16px;max-width:60%;width:auto}\n"]
|
|
5396
5411
|
},] }
|
|
5397
5412
|
];
|
|
5398
5413
|
DrChatMessageComponent.ctorParameters = function () { return [
|
|
@@ -5404,17 +5419,32 @@
|
|
|
5404
5419
|
reply: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.reply',] }],
|
|
5405
5420
|
type: [{ type: i0.Input }],
|
|
5406
5421
|
message: [{ type: i0.Input }],
|
|
5407
|
-
customMessageData: [{ type: i0.Input }]
|
|
5422
|
+
customMessageData: [{ type: i0.Input }],
|
|
5423
|
+
isEmpty: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.empty',] }]
|
|
5408
5424
|
};
|
|
5409
5425
|
|
|
5410
5426
|
var DrChatComponent = /** @class */ (function () {
|
|
5411
5427
|
function DrChatComponent(cdr) {
|
|
5412
5428
|
this.cdr = cdr;
|
|
5429
|
+
this.destroy$ = new rxjs.Subject();
|
|
5413
5430
|
this.showClearButton = true;
|
|
5414
5431
|
this.noMessagesPlaceholder = 'No messages yet.';
|
|
5415
5432
|
this._scrollBottom = true;
|
|
5416
5433
|
this.clear = new i0.EventEmitter();
|
|
5417
5434
|
}
|
|
5435
|
+
Object.defineProperty(DrChatComponent.prototype, "contentUpdateSubject", {
|
|
5436
|
+
set: function (value) {
|
|
5437
|
+
var _this = this;
|
|
5438
|
+
if (value) {
|
|
5439
|
+
value.pipe(operators.takeUntil(this.destroy$)).subscribe(function () {
|
|
5440
|
+
_this.updateView();
|
|
5441
|
+
});
|
|
5442
|
+
}
|
|
5443
|
+
},
|
|
5444
|
+
enumerable: false,
|
|
5445
|
+
configurable: true
|
|
5446
|
+
});
|
|
5447
|
+
;
|
|
5418
5448
|
Object.defineProperty(DrChatComponent.prototype, "scrollBottom", {
|
|
5419
5449
|
/**
|
|
5420
5450
|
* Scroll chat to the bottom of the list when a new message arrives
|
|
@@ -5448,6 +5478,10 @@
|
|
|
5448
5478
|
_this.cdr.markForCheck();
|
|
5449
5479
|
});
|
|
5450
5480
|
};
|
|
5481
|
+
DrChatComponent.prototype.ngOnDestroy = function () {
|
|
5482
|
+
this.destroy$.next();
|
|
5483
|
+
this.destroy$.complete();
|
|
5484
|
+
};
|
|
5451
5485
|
return DrChatComponent;
|
|
5452
5486
|
}());
|
|
5453
5487
|
DrChatComponent.decorators = [
|
|
@@ -5465,6 +5499,7 @@
|
|
|
5465
5499
|
title: [{ type: i0.Input }],
|
|
5466
5500
|
showClearButton: [{ type: i0.Input }],
|
|
5467
5501
|
noMessagesPlaceholder: [{ type: i0.Input }],
|
|
5502
|
+
contentUpdateSubject: [{ type: i0.Input }],
|
|
5468
5503
|
scrollBottom: [{ type: i0.Input }],
|
|
5469
5504
|
messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer',] }],
|
|
5470
5505
|
messages: [{ type: i0.ContentChildren, args: [DrChatMessageComponent,] }],
|