@datarailsshared/datarailsshared 1.5.578 → 1.6.21
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/datarailsshared-datarailsshared-1.6.21.tgz +0 -0
- package/esm2022/lib/dr-chat/chat.module.mjs +10 -4
- package/esm2022/lib/dr-chat/dr-chat-dropped-files/dr-chat-dropped-files.component.mjs +61 -0
- package/esm2022/lib/dr-chat/dr-chat-dropped-files/pipes/shorter-naming.pipe.mjs +29 -0
- package/esm2022/lib/dr-chat/dr-chat-form-with-history/chat-form-with-history.component.mjs +117 -105
- package/esm2022/lib/dr-chat/dr-chat-message/chat-message.component.mjs +18 -18
- package/esm2022/lib/dr-chat/dr-chat-message/dr-chat-message-file/chat-message-file.component.mjs +8 -59
- package/esm2022/lib/models/chat.mjs +4 -1
- package/esm2022/public-api.mjs +1 -1
- package/fesm2022/datarailsshared-datarailsshared.mjs +229 -176
- package/fesm2022/datarailsshared-datarailsshared.mjs.map +1 -1
- package/lib/dr-chat/chat.module.d.ts +10 -8
- package/lib/dr-chat/dr-chat-dropped-files/dr-chat-dropped-files.component.d.ts +12 -0
- package/lib/dr-chat/dr-chat-dropped-files/pipes/shorter-naming.pipe.d.ts +7 -0
- package/lib/dr-chat/dr-chat-form-with-history/chat-form-with-history.component.d.ts +12 -5
- package/lib/dr-chat/dr-chat-message/dr-chat-message-file/chat-message-file.component.d.ts +3 -16
- package/lib/models/chat.d.ts +9 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/datarailsshared-datarailsshared-1.5.578.tgz +0 -0
|
@@ -1022,13 +1022,13 @@ const _c1$h = ["multiLabelTemplate"];
|
|
|
1022
1022
|
const _c2$7 = ["optionTemplate"];
|
|
1023
1023
|
const _c3$6 = ["optionHeaderTemplate"];
|
|
1024
1024
|
const _c4$3 = ["optionFooterTemplate"];
|
|
1025
|
-
const _c5 = function (a0) { return { item: a0 }; };
|
|
1025
|
+
const _c5$1 = function (a0) { return { item: a0 }; };
|
|
1026
1026
|
function DrSelectComponent_2_ng_template_0_Template(rf, ctx) { if (rf & 1) {
|
|
1027
1027
|
i0.ɵɵelementContainer(0, 6);
|
|
1028
1028
|
} if (rf & 2) {
|
|
1029
1029
|
const item_r11 = ctx.item;
|
|
1030
1030
|
const ctx_r10 = i0.ɵɵnextContext(2);
|
|
1031
|
-
i0.ɵɵproperty("ngTemplateOutlet", ctx_r10.optionHeaderTemplate)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c5, item_r11));
|
|
1031
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r10.optionHeaderTemplate)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c5$1, item_r11));
|
|
1032
1032
|
} }
|
|
1033
1033
|
function DrSelectComponent_2_Template(rf, ctx) { if (rf & 1) {
|
|
1034
1034
|
i0.ɵɵtemplate(0, DrSelectComponent_2_ng_template_0_Template, 1, 4, "ng-template", 5);
|
|
@@ -1038,19 +1038,19 @@ function DrSelectComponent_3_ng_template_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
1038
1038
|
} if (rf & 2) {
|
|
1039
1039
|
const item_r13 = ctx.item;
|
|
1040
1040
|
const ctx_r12 = i0.ɵɵnextContext(2);
|
|
1041
|
-
i0.ɵɵproperty("ngTemplateOutlet", ctx_r12.labelTemplate)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c5, item_r13));
|
|
1041
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r12.labelTemplate)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c5$1, item_r13));
|
|
1042
1042
|
} }
|
|
1043
1043
|
function DrSelectComponent_3_Template(rf, ctx) { if (rf & 1) {
|
|
1044
1044
|
i0.ɵɵtemplate(0, DrSelectComponent_3_ng_template_0_Template, 1, 4, "ng-template", 7);
|
|
1045
1045
|
} }
|
|
1046
|
-
const _c6 = function (a0, a1) { return { items: a0, clear: a1 }; };
|
|
1046
|
+
const _c6$1 = function (a0, a1) { return { items: a0, clear: a1 }; };
|
|
1047
1047
|
function DrSelectComponent_4_ng_template_0_Template(rf, ctx) { if (rf & 1) {
|
|
1048
1048
|
i0.ɵɵelementContainer(0, 6);
|
|
1049
1049
|
} if (rf & 2) {
|
|
1050
1050
|
const items_r15 = ctx.items;
|
|
1051
1051
|
const clear_r16 = ctx.clear;
|
|
1052
1052
|
const ctx_r14 = i0.ɵɵnextContext(2);
|
|
1053
|
-
i0.ɵɵproperty("ngTemplateOutlet", ctx_r14.multiLabelTemplate)("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c6, items_r15, clear_r16));
|
|
1053
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r14.multiLabelTemplate)("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c6$1, items_r15, clear_r16));
|
|
1054
1054
|
} }
|
|
1055
1055
|
function DrSelectComponent_4_Template(rf, ctx) { if (rf & 1) {
|
|
1056
1056
|
i0.ɵɵtemplate(0, DrSelectComponent_4_ng_template_0_Template, 1, 5, "ng-template", 8);
|
|
@@ -5463,6 +5463,7 @@ var CHAT_MESSAGE_TYPE;
|
|
|
5463
5463
|
CHAT_MESSAGE_TYPE["EMBED"] = "embed";
|
|
5464
5464
|
CHAT_MESSAGE_TYPE["INPUT"] = "input";
|
|
5465
5465
|
CHAT_MESSAGE_TYPE["CODE"] = "code";
|
|
5466
|
+
CHAT_MESSAGE_TYPE["ERROR"] = "error";
|
|
5466
5467
|
})(CHAT_MESSAGE_TYPE || (CHAT_MESSAGE_TYPE = {}));
|
|
5467
5468
|
var ChatRole;
|
|
5468
5469
|
(function (ChatRole) {
|
|
@@ -5485,6 +5486,8 @@ class ChatMessage {
|
|
|
5485
5486
|
this.parameters = obj?.parameters;
|
|
5486
5487
|
this.avatarUrl = obj?.avatarUrl || null;
|
|
5487
5488
|
this.user = obj?.user;
|
|
5489
|
+
this.files = obj?.files;
|
|
5490
|
+
this.suggestions = obj?.suggestions;
|
|
5488
5491
|
}
|
|
5489
5492
|
}
|
|
5490
5493
|
|
|
@@ -5986,82 +5989,116 @@ class DrChatMessageTextComponent {
|
|
|
5986
5989
|
type: Input
|
|
5987
5990
|
}] }); })();
|
|
5988
5991
|
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
}
|
|
5995
|
-
|
|
5996
|
-
|
|
5992
|
+
class ShorterNamingPipe {
|
|
5993
|
+
transform(fileName, maxLength = 10) {
|
|
5994
|
+
const lastDotIndex = fileName.lastIndexOf('.');
|
|
5995
|
+
if (lastDotIndex === -1 || lastDotIndex === 0) {
|
|
5996
|
+
return fileName.length > maxLength ? fileName.slice(0, maxLength) : fileName;
|
|
5997
|
+
}
|
|
5998
|
+
const namePart = fileName.slice(0, lastDotIndex);
|
|
5999
|
+
const type = fileName.slice(lastDotIndex);
|
|
6000
|
+
if (fileName.length <= maxLength) {
|
|
6001
|
+
return fileName;
|
|
6002
|
+
}
|
|
6003
|
+
const maxNameLength = maxLength - type.length;
|
|
6004
|
+
if (maxNameLength <= 0) {
|
|
6005
|
+
return fileName.slice(0, maxLength);
|
|
6006
|
+
}
|
|
6007
|
+
return namePart.slice(0, maxNameLength) + type;
|
|
6008
|
+
}
|
|
6009
|
+
/** @nocollapse */ static { this.ɵfac = function ShorterNamingPipe_Factory(t) { return new (t || ShorterNamingPipe)(); }; }
|
|
6010
|
+
/** @nocollapse */ static { this.ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "shorterNaming", type: ShorterNamingPipe, pure: true }); }
|
|
6011
|
+
}
|
|
6012
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ShorterNamingPipe, [{
|
|
6013
|
+
type: Pipe,
|
|
6014
|
+
args: [{
|
|
6015
|
+
name: 'shorterNaming',
|
|
6016
|
+
}]
|
|
6017
|
+
}], null, null); })();
|
|
6018
|
+
|
|
6019
|
+
function DrChatDroppedFilesComponent_div_1_i_5_Template(rf, ctx) { if (rf & 1) {
|
|
6020
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
6021
|
+
i0.ɵɵelementStart(0, "i", 6);
|
|
6022
|
+
i0.ɵɵlistener("click", function DrChatDroppedFilesComponent_div_1_i_5_Template_i_click_0_listener($event) { i0.ɵɵrestoreView(_r5); const file_r1 = i0.ɵɵnextContext().$implicit; const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.removeFile(file_r1, $event)); });
|
|
6023
|
+
i0.ɵɵelementEnd();
|
|
5997
6024
|
} }
|
|
5998
|
-
function
|
|
5999
|
-
i0.ɵɵelementStart(0, "
|
|
6000
|
-
i0.ɵɵ
|
|
6001
|
-
i0.ɵɵ
|
|
6025
|
+
function DrChatDroppedFilesComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
6026
|
+
i0.ɵɵelementStart(0, "div", 2);
|
|
6027
|
+
i0.ɵɵelement(1, "i", 3);
|
|
6028
|
+
i0.ɵɵelementStart(2, "div", 4);
|
|
6029
|
+
i0.ɵɵtext(3);
|
|
6030
|
+
i0.ɵɵpipe(4, "shorterNaming");
|
|
6031
|
+
i0.ɵɵelementEnd();
|
|
6032
|
+
i0.ɵɵtemplate(5, DrChatDroppedFilesComponent_div_1_i_5_Template, 1, 0, "i", 5);
|
|
6002
6033
|
i0.ɵɵelementEnd();
|
|
6003
6034
|
} if (rf & 2) {
|
|
6004
6035
|
const file_r1 = ctx.$implicit;
|
|
6005
|
-
|
|
6006
|
-
i0.ɵɵadvance(
|
|
6007
|
-
i0.ɵɵ
|
|
6008
|
-
i0.ɵɵadvance(
|
|
6009
|
-
i0.ɵɵproperty("ngIf",
|
|
6036
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
6037
|
+
i0.ɵɵadvance(3);
|
|
6038
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(4, 2, file_r1.name, ctx_r0.maxLengthText));
|
|
6039
|
+
i0.ɵɵadvance(2);
|
|
6040
|
+
i0.ɵɵproperty("ngIf", ctx_r0.isRemovable);
|
|
6010
6041
|
} }
|
|
6042
|
+
class DrChatDroppedFilesComponent {
|
|
6043
|
+
constructor() {
|
|
6044
|
+
this.isRemovable = false;
|
|
6045
|
+
this.maxLengthText = 18;
|
|
6046
|
+
this.removeFileEvent = new EventEmitter();
|
|
6047
|
+
}
|
|
6048
|
+
removeFile(file, event) {
|
|
6049
|
+
event.preventDefault();
|
|
6050
|
+
event.stopPropagation();
|
|
6051
|
+
this.removeFileEvent.emit(file);
|
|
6052
|
+
}
|
|
6053
|
+
/** @nocollapse */ static { this.ɵfac = function DrChatDroppedFilesComponent_Factory(t) { return new (t || DrChatDroppedFilesComponent)(); }; }
|
|
6054
|
+
/** @nocollapse */ static { this.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DrChatDroppedFilesComponent, selectors: [["dr-chat-dropped-files"]], inputs: { files: "files", isRemovable: "isRemovable", maxLengthText: "maxLengthText" }, outputs: { removeFileEvent: "removeFileEvent" }, decls: 2, vars: 1, consts: [[1, "dropped-files"], ["class", "dropped-files__item", 4, "ngFor", "ngForOf"], [1, "dropped-files__item"], [1, "dr-icon-file"], [1, "dropped-files__item-name"], ["class", "dr-icon-noty-error dropped-files__item-remove", 3, "click", 4, "ngIf"], [1, "dr-icon-noty-error", "dropped-files__item-remove", 3, "click"]], template: function DrChatDroppedFilesComponent_Template(rf, ctx) { if (rf & 1) {
|
|
6055
|
+
i0.ɵɵelementStart(0, "div", 0);
|
|
6056
|
+
i0.ɵɵtemplate(1, DrChatDroppedFilesComponent_div_1_Template, 6, 5, "div", 1);
|
|
6057
|
+
i0.ɵɵelementEnd();
|
|
6058
|
+
} if (rf & 2) {
|
|
6059
|
+
i0.ɵɵadvance(1);
|
|
6060
|
+
i0.ɵɵproperty("ngForOf", ctx.files);
|
|
6061
|
+
} }, dependencies: [i1.NgForOf, i1.NgIf, ShorterNamingPipe], styles: [".dropped-files[_ngcontent-%COMP%]{display:flex;flex-direction:row;margin-bottom:.5rem;flex-wrap:wrap;gap:8px;padding-left:16px}.dropped-files__item[_ngcontent-%COMP%]{max-width:183px;display:flex;flex-direction:row;gap:4px;justify-content:space-between;align-items:center;margin-top:16px;padding:4px 8px;background-color:#f6f7f8;border:1px solid rgb(223,224,227);box-sizing:border-box;border-radius:8px}.dropped-files__item-name[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:Poppins,sans-serif;font-size:12px;line-height:20px;font-weight:500;font-weight:400;color:#6d6e6f}.dropped-files__item-remove[_ngcontent-%COMP%]{cursor:pointer;color:#6d6e6f}"], changeDetection: 0 }); }
|
|
6062
|
+
}
|
|
6063
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DrChatDroppedFilesComponent, [{
|
|
6064
|
+
type: Component,
|
|
6065
|
+
args: [{ selector: 'dr-chat-dropped-files', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"dropped-files\">\n <div class=\"dropped-files__item\" *ngFor=\"let file of files\">\n <i class=\"dr-icon-file\"></i>\n <div class=\"dropped-files__item-name\">{{ file.name | shorterNaming: maxLengthText }}</div>\n <i *ngIf=\"isRemovable\" class=\"dr-icon-noty-error dropped-files__item-remove\" (click)=\"removeFile(file, $event)\"></i>\n </div>\n</div>\n", styles: [".dropped-files{display:flex;flex-direction:row;margin-bottom:.5rem;flex-wrap:wrap;gap:8px;padding-left:16px}.dropped-files__item{max-width:183px;display:flex;flex-direction:row;gap:4px;justify-content:space-between;align-items:center;margin-top:16px;padding:4px 8px;background-color:#f6f7f8;border:1px solid rgb(223,224,227);box-sizing:border-box;border-radius:8px}.dropped-files__item-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:Poppins,sans-serif;font-size:12px;line-height:20px;font-weight:500;font-weight:400;color:#6d6e6f}.dropped-files__item-remove{cursor:pointer;color:#6d6e6f}\n"] }]
|
|
6066
|
+
}], null, { files: [{
|
|
6067
|
+
type: Input
|
|
6068
|
+
}], isRemovable: [{
|
|
6069
|
+
type: Input
|
|
6070
|
+
}], maxLengthText: [{
|
|
6071
|
+
type: Input
|
|
6072
|
+
}], removeFileEvent: [{
|
|
6073
|
+
type: Output
|
|
6074
|
+
}] }); })();
|
|
6075
|
+
|
|
6011
6076
|
/**
|
|
6012
6077
|
* Chat message component.
|
|
6013
6078
|
*/
|
|
6014
6079
|
class DrChatMessageFileComponent {
|
|
6015
|
-
/**
|
|
6016
|
-
* Message file path
|
|
6017
|
-
*
|
|
6018
|
-
* @type {Date}
|
|
6019
|
-
*/
|
|
6020
|
-
set files(files) {
|
|
6021
|
-
this.readyFiles = (files || []).map((file) => {
|
|
6022
|
-
const isImage = this.isImage(file);
|
|
6023
|
-
return {
|
|
6024
|
-
...file,
|
|
6025
|
-
urlStyle: isImage && this.domSanitizer.bypassSecurityTrustStyle(`url(${file.url})`),
|
|
6026
|
-
isImage,
|
|
6027
|
-
};
|
|
6028
|
-
});
|
|
6029
|
-
this.cd.detectChanges();
|
|
6030
|
-
}
|
|
6031
6080
|
constructor(cd, domSanitizer) {
|
|
6032
6081
|
this.cd = cd;
|
|
6033
6082
|
this.domSanitizer = domSanitizer;
|
|
6034
6083
|
}
|
|
6035
|
-
isImage(file) {
|
|
6036
|
-
const type = file.type;
|
|
6037
|
-
if (type) {
|
|
6038
|
-
return IMAGE_TYPES.includes(type);
|
|
6039
|
-
}
|
|
6040
|
-
return false;
|
|
6041
|
-
}
|
|
6042
6084
|
/** @nocollapse */ static { this.ɵfac = function DrChatMessageFileComponent_Factory(t) { return new (t || DrChatMessageFileComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$5.DomSanitizer)); }; }
|
|
6043
|
-
/** @nocollapse */ static { this.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DrChatMessageFileComponent, selectors: [["dr-chat-message-file"]], inputs: {
|
|
6044
|
-
i0.ɵɵ
|
|
6045
|
-
i0.ɵɵtemplate(1, DrChatMessageFileComponent_a_1_Template, 3, 3, "a", 1);
|
|
6046
|
-
i0.ɵɵelementEnd();
|
|
6085
|
+
/** @nocollapse */ static { this.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DrChatMessageFileComponent, selectors: [["dr-chat-message-file"]], inputs: { files: "files" }, decls: 1, vars: 1, consts: [[3, "files"]], template: function DrChatMessageFileComponent_Template(rf, ctx) { if (rf & 1) {
|
|
6086
|
+
i0.ɵɵelement(0, "dr-chat-dropped-files", 0);
|
|
6047
6087
|
} if (rf & 2) {
|
|
6048
|
-
i0.ɵɵ
|
|
6049
|
-
|
|
6050
|
-
} }, dependencies: [i1.NgForOf, i1.NgIf], encapsulation: 2, changeDetection: 0 }); }
|
|
6088
|
+
i0.ɵɵproperty("files", ctx.files);
|
|
6089
|
+
} }, dependencies: [DrChatDroppedFilesComponent], encapsulation: 2, changeDetection: 0 }); }
|
|
6051
6090
|
}
|
|
6052
6091
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DrChatMessageFileComponent, [{
|
|
6053
6092
|
type: Component,
|
|
6054
|
-
args: [{ selector: 'dr-chat-message-file', changeDetection: ChangeDetectionStrategy.OnPush, template: "<
|
|
6055
|
-
}], function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$5.DomSanitizer }]; }, {
|
|
6056
|
-
type: Input
|
|
6057
|
-
}], files: [{
|
|
6093
|
+
args: [{ selector: 'dr-chat-message-file', changeDetection: ChangeDetectionStrategy.OnPush, template: "<dr-chat-dropped-files [files]=\"files\"></dr-chat-dropped-files>\n" }]
|
|
6094
|
+
}], function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$5.DomSanitizer }]; }, { files: [{
|
|
6058
6095
|
type: Input
|
|
6059
6096
|
}] }); })();
|
|
6060
6097
|
|
|
6061
6098
|
const _c0$q = ["drChatMessageActions"];
|
|
6062
6099
|
function DrChatMessageComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
6063
6100
|
i0.ɵɵelementContainerStart(0);
|
|
6064
|
-
i0.ɵɵelement(1, "div",
|
|
6101
|
+
i0.ɵɵelement(1, "div", 8);
|
|
6065
6102
|
i0.ɵɵelementContainerEnd();
|
|
6066
6103
|
} if (rf & 2) {
|
|
6067
6104
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
@@ -6069,19 +6106,19 @@ function DrChatMessageComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
6069
6106
|
i0.ɵɵstyleProp("background-image", "url(" + ctx_r0.message.avatarUrl + ")");
|
|
6070
6107
|
} }
|
|
6071
6108
|
function DrChatMessageComponent_ng_template_1_dr_avatar_0_Template(rf, ctx) { if (rf & 1) {
|
|
6072
|
-
i0.ɵɵelement(0, "dr-avatar",
|
|
6109
|
+
i0.ɵɵelement(0, "dr-avatar", 11);
|
|
6073
6110
|
} if (rf & 2) {
|
|
6074
6111
|
const ctx_r7 = i0.ɵɵnextContext(2);
|
|
6075
6112
|
i0.ɵɵproperty("users", ctx_r7.message.user);
|
|
6076
6113
|
} }
|
|
6077
6114
|
function DrChatMessageComponent_ng_template_1_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
6078
|
-
i0.ɵɵelementStart(0, "div",
|
|
6079
|
-
i0.ɵɵelement(1, "i",
|
|
6115
|
+
i0.ɵɵelementStart(0, "div", 12);
|
|
6116
|
+
i0.ɵɵelement(1, "i", 13);
|
|
6080
6117
|
i0.ɵɵelementEnd();
|
|
6081
6118
|
} }
|
|
6082
6119
|
function DrChatMessageComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
|
|
6083
|
-
i0.ɵɵtemplate(0, DrChatMessageComponent_ng_template_1_dr_avatar_0_Template, 1, 1, "dr-avatar",
|
|
6084
|
-
i0.ɵɵtemplate(1, DrChatMessageComponent_ng_template_1_div_1_Template, 2, 0, "div",
|
|
6120
|
+
i0.ɵɵtemplate(0, DrChatMessageComponent_ng_template_1_dr_avatar_0_Template, 1, 1, "dr-avatar", 9);
|
|
6121
|
+
i0.ɵɵtemplate(1, DrChatMessageComponent_ng_template_1_div_1_Template, 2, 0, "div", 10);
|
|
6085
6122
|
} if (rf & 2) {
|
|
6086
6123
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
6087
6124
|
i0.ɵɵproperty("ngIf", ctx_r2.message.user);
|
|
@@ -6089,20 +6126,20 @@ function DrChatMessageComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
6089
6126
|
i0.ɵɵproperty("ngIf", !ctx_r2.message.user);
|
|
6090
6127
|
} }
|
|
6091
6128
|
function DrChatMessageComponent_dr_chat_message_text_5_Template(rf, ctx) { if (rf & 1) {
|
|
6092
|
-
i0.ɵɵelement(0, "dr-chat-message-text",
|
|
6129
|
+
i0.ɵɵelement(0, "dr-chat-message-text", 14);
|
|
6093
6130
|
} if (rf & 2) {
|
|
6094
6131
|
const ctx_r3 = i0.ɵɵnextContext();
|
|
6095
6132
|
i0.ɵɵproperty("message", ctx_r3.message);
|
|
6096
6133
|
} }
|
|
6097
6134
|
function DrChatMessageComponent_dr_chat_message_file_6_Template(rf, ctx) { if (rf & 1) {
|
|
6098
|
-
i0.ɵɵelement(0, "dr-chat-message-file",
|
|
6135
|
+
i0.ɵɵelement(0, "dr-chat-message-file", 15);
|
|
6099
6136
|
} if (rf & 2) {
|
|
6100
6137
|
const ctx_r4 = i0.ɵɵnextContext();
|
|
6101
|
-
i0.ɵɵproperty("
|
|
6138
|
+
i0.ɵɵproperty("files", ctx_r4.message.files);
|
|
6102
6139
|
} }
|
|
6103
6140
|
function DrChatMessageComponent_ng_container_7_Template(rf, ctx) { if (rf & 1) {
|
|
6104
6141
|
i0.ɵɵelementContainerStart(0);
|
|
6105
|
-
i0.ɵɵelementContainer(1,
|
|
6142
|
+
i0.ɵɵelementContainer(1, 16);
|
|
6106
6143
|
i0.ɵɵelementContainerEnd();
|
|
6107
6144
|
} if (rf & 2) {
|
|
6108
6145
|
const ctx_r5 = i0.ɵɵnextContext();
|
|
@@ -6110,8 +6147,8 @@ function DrChatMessageComponent_ng_container_7_Template(rf, ctx) { if (rf & 1) {
|
|
|
6110
6147
|
i0.ɵɵproperty("ngTemplateOutlet", ctx_r5.getTemplate())("ngTemplateOutletContext", ctx_r5.getTemplateContext());
|
|
6111
6148
|
} }
|
|
6112
6149
|
function DrChatMessageComponent_div_8_Template(rf, ctx) { if (rf & 1) {
|
|
6113
|
-
i0.ɵɵelementStart(0, "div",
|
|
6114
|
-
i0.ɵɵelementContainer(1,
|
|
6150
|
+
i0.ɵɵelementStart(0, "div", 17);
|
|
6151
|
+
i0.ɵɵelementContainer(1, 18);
|
|
6115
6152
|
i0.ɵɵelementEnd();
|
|
6116
6153
|
} if (rf & 2) {
|
|
6117
6154
|
const ctx_r6 = i0.ɵɵnextContext();
|
|
@@ -6167,16 +6204,16 @@ class DrChatMessageComponent {
|
|
|
6167
6204
|
} }, hostVars: 5, hostBindings: function DrChatMessageComponent_HostBindings(rf, ctx) { if (rf & 2) {
|
|
6168
6205
|
i0.ɵɵsyntheticHostProperty("@flyInOut", ctx.flyInOut);
|
|
6169
6206
|
i0.ɵɵclassProp("not-reply", ctx.notReply)("reply", ctx.reply);
|
|
6170
|
-
} }, inputs: { reply: "reply", type: "type", message: "message", customMessageData: "customMessageData", user: "user" }, decls: 9, vars: 9, consts: [[4, "ngIf", "ngIfElse"], ["userAvatar", ""], [1, "message", 3, "ngClass"], [3, "ngSwitch"], [3, "message", 4, "ngSwitchCase"], [4, "ngSwitchDefault"], ["class", "message__actions", 4, "ngIf"], [1, "avatar"], [3, "users", 4, "ngIf"], ["class", "genius-avatar", 4, "ngIf"], [3, "users"], [1, "genius-avatar"], [1, "dr-icon-genius-sparks"], [3, "message"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "message__actions"], [3, "ngTemplateOutlet"]], template: function DrChatMessageComponent_Template(rf, ctx) { if (rf & 1) {
|
|
6207
|
+
} }, inputs: { reply: "reply", type: "type", message: "message", customMessageData: "customMessageData", user: "user" }, decls: 9, vars: 9, consts: [[4, "ngIf", "ngIfElse"], ["userAvatar", ""], [1, "message", 3, "ngClass"], [3, "ngSwitch"], [3, "message", 4, "ngSwitchCase"], [3, "files", 4, "ngSwitchCase"], [4, "ngSwitchDefault"], ["class", "message__actions", 4, "ngIf"], [1, "avatar"], [3, "users", 4, "ngIf"], ["class", "genius-avatar", 4, "ngIf"], [3, "users"], [1, "genius-avatar"], [1, "dr-icon-genius-sparks"], [3, "message"], [3, "files"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "message__actions"], [3, "ngTemplateOutlet"]], template: function DrChatMessageComponent_Template(rf, ctx) { if (rf & 1) {
|
|
6171
6208
|
i0.ɵɵtemplate(0, DrChatMessageComponent_ng_container_0_Template, 2, 2, "ng-container", 0);
|
|
6172
6209
|
i0.ɵɵtemplate(1, DrChatMessageComponent_ng_template_1_Template, 2, 2, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
|
|
6173
6210
|
i0.ɵɵelementStart(3, "div", 2);
|
|
6174
6211
|
i0.ɵɵelementContainerStart(4, 3);
|
|
6175
6212
|
i0.ɵɵtemplate(5, DrChatMessageComponent_dr_chat_message_text_5_Template, 1, 1, "dr-chat-message-text", 4);
|
|
6176
|
-
i0.ɵɵtemplate(6, DrChatMessageComponent_dr_chat_message_file_6_Template, 1, 1, "dr-chat-message-file",
|
|
6177
|
-
i0.ɵɵtemplate(7, DrChatMessageComponent_ng_container_7_Template, 2, 2, "ng-container",
|
|
6213
|
+
i0.ɵɵtemplate(6, DrChatMessageComponent_dr_chat_message_file_6_Template, 1, 1, "dr-chat-message-file", 5);
|
|
6214
|
+
i0.ɵɵtemplate(7, DrChatMessageComponent_ng_container_7_Template, 2, 2, "ng-container", 6);
|
|
6178
6215
|
i0.ɵɵelementContainerEnd();
|
|
6179
|
-
i0.ɵɵtemplate(8, DrChatMessageComponent_div_8_Template, 2, 1, "div",
|
|
6216
|
+
i0.ɵɵtemplate(8, DrChatMessageComponent_div_8_Template, 2, 1, "div", 7);
|
|
6180
6217
|
i0.ɵɵelementEnd();
|
|
6181
6218
|
} if (rf & 2) {
|
|
6182
6219
|
const _r1 = i0.ɵɵreference(2);
|
|
@@ -6208,7 +6245,7 @@ class DrChatMessageComponent {
|
|
|
6208
6245
|
transition('void => *', [style({ transform: 'translateX(-100%)' }), animate(80)]),
|
|
6209
6246
|
transition('* => void', [animate(80, style({ transform: 'translateX(100%)' }))]),
|
|
6210
6247
|
]),
|
|
6211
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"message.avatarUrl; else userAvatar\">\n <div class=\"avatar\" [style.background-image]=\"'url(' + message.avatarUrl + ')'\"></div>\n</ng-container>\n<ng-template #userAvatar>\n <dr-avatar *ngIf=\"message.user\" [users]=\"message.user\"></dr-avatar>\n\n <div *ngIf=\"!message.user\" class=\"genius-avatar\">\n <i class=\"dr-icon-genius-sparks\"></i>\n </div>\n</ng-template>\n<div class=\"message\" [class.message--custom]=\"customMessage\" [ngClass]=\"applyMessageGroupClass(message)\">\n <ng-container [ngSwitch]=\"message.kind\">\n <dr-chat-message-text *ngSwitchCase=\"MESSAGE_TYPE.TEXT\" [message]=\"message\"></dr-chat-message-text>\n <dr-chat-message-file *ngSwitchCase=\"MESSAGE_TYPE.DOWNLOAD_FILE\" [
|
|
6248
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"message.avatarUrl; else userAvatar\">\n <div class=\"avatar\" [style.background-image]=\"'url(' + message.avatarUrl + ')'\"></div>\n</ng-container>\n<ng-template #userAvatar>\n <dr-avatar *ngIf=\"message.user\" [users]=\"message.user\"></dr-avatar>\n\n <div *ngIf=\"!message.user\" class=\"genius-avatar\">\n <i class=\"dr-icon-genius-sparks\"></i>\n </div>\n</ng-template>\n<div class=\"message\" [class.message--custom]=\"customMessage\" [ngClass]=\"applyMessageGroupClass(message)\">\n <ng-container [ngSwitch]=\"message.kind\">\n <dr-chat-message-text *ngSwitchCase=\"MESSAGE_TYPE.TEXT\" [message]=\"message\"></dr-chat-message-text>\n <dr-chat-message-file *ngSwitchCase=\"MESSAGE_TYPE.DOWNLOAD_FILE\" [files]=\"message.files\"></dr-chat-message-file>\n <ng-container *ngSwitchDefault>\n <ng-container [ngTemplateOutlet]=\"getTemplate()\" [ngTemplateOutletContext]=\"getTemplateContext()\"></ng-container>\n </ng-container>\n </ng-container>\n <div class=\"message__actions\" *ngIf=\"drChatMessageActions\">\n <ng-container [ngTemplateOutlet]=\"drChatMessageActions\"></ng-container>\n </div>\n</div>\n", styles: [":host{position:relative;display:flex;flex-direction:row;width:100%;background:#f9faffb3;border-top:1px solid #e5e5e5;padding:16px}:host:first-child{border:none}:host:last-child{border-bottom:1px solid #e5e5e5}.reply+:host.reply,.not-reply+:host.not-reply{border-top:none;padding-top:0;padding-left:60px}.reply+:host.reply .avatar,.reply+:host.reply dr-avatar,.not-reply+:host.not-reply .avatar,.not-reply+:host.not-reply dr-avatar{display:none}:host.not-reply{background-color:#fff}:host .avatar{display:flex;width:28px;height:28px;background-color:#fff;border-radius:16px;flex-shrink:0;border:1px solid #dfe0e3;background-image:url(\"data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22%3F%3E%3Csvg id%3D%22Layer_1%22 data-name%3D%22Layer 1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 viewBox%3D%220 0 74 65%22%3E %3Cdefs%3E %3Cstyle%3E .cls-1%2C .cls-2%2C .cls-3 %7B fill%3A none%3B %7D .cls-4 %7B fill%3A url(%23linear-gradient)%3B %7D .cls-5 %7B fill%3A %234eb7df%3B %7D .cls-2 %7B stroke%3A %23a6a8aa%3B stroke-miterlimit%3A 10%3B stroke-width%3A .37px%3B %7D .cls-6 %7B fill%3A url(%23linear-gradient-3)%3B %7D .cls-7 %7B fill%3A url(%23linear-gradient-2)%3B %7D .cls-3 %7B clip-path%3A url(%23clippath)%3B %7D %3C%2Fstyle%3E %3CclipPath id%3D%22clippath%22%3E %3Crect class%3D%22cls-1%22 width%3D%2274%22 height%3D%2265%22%2F%3E %3C%2FclipPath%3E %3ClinearGradient id%3D%22linear-gradient%22 x1%3D%2224.26%22 y1%3D%22-3.79%22 x2%3D%2295.63%22 y2%3D%2288.82%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%220%22 stop-color%3D%22%237676ff%22%2F%3E %3Cstop offset%3D%22.18%22 stop-color%3D%22%235959ff%22%2F%3E %3Cstop offset%3D%22.35%22 stop-color%3D%22%235757e0%22%2F%3E %3Cstop offset%3D%22.61%22 stop-color%3D%22%234646ce%22%2F%3E %3Cstop offset%3D%22.84%22 stop-color%3D%22%234b4be4%22%2F%3E %3Cstop offset%3D%221%22 stop-color%3D%22%234444eb%22%2F%3E %3C%2FlinearGradient%3E %3ClinearGradient id%3D%22linear-gradient-2%22 x1%3D%2212.05%22 y1%3D%2277.06%22 x2%3D%2210.77%22 y2%3D%2213.85%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%22.45%22 stop-color%3D%22%232f92b8%22%2F%3E %3Cstop offset%3D%22.84%22 stop-color%3D%22%234eb7df%22%2F%3E %3Cstop offset%3D%221%22 stop-color%3D%22%234eb7df%22%2F%3E %3C%2FlinearGradient%3E %3ClinearGradient id%3D%22linear-gradient-3%22 x1%3D%2262.26%22 y1%3D%22-2.54%22 x2%3D%2261.76%22 y2%3D%2285.91%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%220%22 stop-color%3D%22%2336369b%22%2F%3E %3Cstop offset%3D%22.52%22 stop-color%3D%22%234848d0%22%2F%3E %3C%2FlinearGradient%3E %3C%2Fdefs%3E %3Cg class%3D%22cls-3%22%3E %3Cg%3E %3Cpath class%3D%22cls-4%22 d%3D%22m73.32%2C24.79v15.73c0%2C13.12-9.87%2C23.79-22%2C23.79h-21.32c-3.46-.06-6.25-3.11-6.25-6.87s2.79-6.81%2C6.25-6.87h21.32c5.13%2C0%2C9.29-4.51%2C9.29-10.05v-15.73c0-5.54-4.17-10.05-9.29-10.05h-7.46c3.51%2C0%2C6.35-3.08%2C6.35-6.88s-2.79-6.8-6.25-6.87h7.35c12.12%2C0%2C22%2C10.67%2C22%2C23.79h0Z%22%2F%3E %3Cpath class%3D%22cls-5%22 d%3D%22m50.26%2C7.82c0%2C3.8-2.9%2C6.93-6.41%2C6.93h-21.86c-5.13%2C0-9.29%2C4.51-9.29%2C10.05v15.73c0%2C5.54%2C4.17%2C10.05%2C9.29%2C10.05h8.01c-3.46.06-6.25%2C3.11-6.25%2C6.87s2.79%2C6.81%2C6.25%2C6.87h-8.01c-12.12%2C0-22-10.67-22-23.79v-15.73C0%2C11.68%2C9.87%2C1%2C21.99%2C1h21.97c3.46.06%2C6.3%2C3.06%2C6.3%2C6.82Z%22%2F%3E %3Cpath class%3D%22cls-2%22 d%3D%22m66.45%2C1h-.22.22%2C0Z%22%2F%3E %3Cpath class%3D%22cls-2%22 d%3D%22m36.05%2C50.58h-.22.22%2C0Z%22%2F%3E %3Cpath class%3D%22cls-7%22 d%3D%22m0%2C33.78v-2.76C0%2C12.9%2C13.62%2C14.48%2C13.62%2C14.48h8.38c-5.5.46-9.5%2C4.71-9.5%2C9.96l.02%2C15.8c0%2C5.54%2C4.44%2C10.59%2C9.48%2C10.59l-8-.5S0%2C51.88%2C0%2C33.77h0Z%22%2F%3E %3Cpath class%3D%22cls-6%22 d%3D%22m73%2C31.51v2.76c0%2C18.12-13.62%2C16.53-13.62%2C16.53h-7.99c5.61-.85%2C9.09-4.76%2C9.09-10.02l.02-16.33c0-5.54-4.46-10-9.5-10h8s13.99-1.05%2C13.99%2C17.07h0Z%22%2F%3E %3C%2Fg%3E %3C%2Fg%3E%3C%2Fsvg%3E\");background-size:18px;background-repeat:no-repeat;background-position-x:4px;background-position-y:5px}:host .genius-avatar{position:relative;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:16px;flex-shrink:0;border:1px solid #dfe0e3;background:#fff}:host .genius-avatar i{font-size:22px;background:linear-gradient(88.5deg,#4eb7df 10%,#6969ff);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}:host .avatar,:host .genius-avatar,:host dr-avatar{margin:0 16px 0 0}:host .avatar::ng-deep .users-section__user,:host .genius-avatar::ng-deep .users-section__user,:host dr-avatar::ng-deep .users-section__user{border:1px solid #dfe0e3}:host .message{display:flex;align-items:center;flex-grow:1}:host .message__actions{display:flex;align-items:center;margin-top:12px;flex-grow:1;justify-content:flex-start}:host .message__actions::ng-deep button:not(:hover) i[class*=dr-icon]{color:#b9b9ec!important}:host .messageGroup{display:flex;flex-direction:column;align-items:flex-start}\n"] }]
|
|
6212
6249
|
}], function () { return [{ type: DrChatCustomMessageService }]; }, { flyInOut: [{
|
|
6213
6250
|
type: HostBinding,
|
|
6214
6251
|
args: ['@flyInOut']
|
|
@@ -12620,73 +12657,58 @@ class ClickOutsideModule {
|
|
|
12620
12657
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ClickOutsideModule, { declarations: [ClickOutsideDirective], imports: [CommonModule], exports: [ClickOutsideDirective] }); })();
|
|
12621
12658
|
|
|
12622
12659
|
const _c0$2 = ["textAreaElement"];
|
|
12623
|
-
|
|
12624
|
-
|
|
12625
|
-
i0.ɵɵ
|
|
12626
|
-
i0.ɵɵ
|
|
12627
|
-
i0.ɵɵ
|
|
12628
|
-
i0.ɵɵ
|
|
12629
|
-
i0.ɵɵelementEnd();
|
|
12630
|
-
i0.ɵɵelementStart(4, "i", 21);
|
|
12631
|
-
i0.ɵɵlistener("click", function DrChatFormWithHistoryComponent_div_2_div_1_Template_i_click_4_listener() { const restoredCtx = i0.ɵɵrestoreView(_r11); const file_r9 = restoredCtx.$implicit; const ctx_r10 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r10.removeFile(file_r9)); });
|
|
12632
|
-
i0.ɵɵelementEnd()();
|
|
12633
|
-
} if (rf & 2) {
|
|
12634
|
-
const file_r9 = ctx.$implicit;
|
|
12635
|
-
i0.ɵɵadvance(3);
|
|
12636
|
-
i0.ɵɵtextInterpolate(file_r9.name);
|
|
12637
|
-
} }
|
|
12638
|
-
function DrChatFormWithHistoryComponent_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
12639
|
-
i0.ɵɵelementStart(0, "div", 16);
|
|
12640
|
-
i0.ɵɵtemplate(1, DrChatFormWithHistoryComponent_div_2_div_1_Template, 5, 1, "div", 17);
|
|
12660
|
+
const _c1 = ["fileInput"];
|
|
12661
|
+
function DrChatFormWithHistoryComponent_dr_chat_dropped_files_2_Template(rf, ctx) { if (rf & 1) {
|
|
12662
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
12663
|
+
i0.ɵɵelementStart(0, "dr-chat-dropped-files", 15);
|
|
12664
|
+
i0.ɵɵlistener("removeFileEvent", function DrChatFormWithHistoryComponent_dr_chat_dropped_files_2_Template_dr_chat_dropped_files_removeFileEvent_0_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r7.removeFile($event)); });
|
|
12665
|
+
i0.ɵɵpipe(1, "async");
|
|
12641
12666
|
i0.ɵɵelementEnd();
|
|
12642
12667
|
} if (rf & 2) {
|
|
12643
12668
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
12644
|
-
i0.ɵɵ
|
|
12645
|
-
i0.ɵɵproperty("ngForOf", ctx_r0.droppedFiles);
|
|
12669
|
+
i0.ɵɵproperty("files", i0.ɵɵpipeBind1(1, 3, ctx_r0.droppedFiles$))("isRemovable", true)("maxLengthText", 15);
|
|
12646
12670
|
} }
|
|
12647
|
-
function
|
|
12648
|
-
const
|
|
12649
|
-
i0.ɵɵelementStart(0, "i",
|
|
12650
|
-
i0.ɵɵlistener("click", function
|
|
12671
|
+
function DrChatFormWithHistoryComponent_i_14_Template(rf, ctx) { if (rf & 1) {
|
|
12672
|
+
const _r10 = i0.ɵɵgetCurrentView();
|
|
12673
|
+
i0.ɵɵelementStart(0, "i", 16);
|
|
12674
|
+
i0.ɵɵlistener("click", function DrChatFormWithHistoryComponent_i_14_Template_i_click_0_listener($event) { i0.ɵɵrestoreView(_r10); const ctx_r9 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r9.sendMessage($event)); });
|
|
12651
12675
|
i0.ɵɵelementEnd();
|
|
12652
12676
|
} if (rf & 2) {
|
|
12653
12677
|
const ctx_r3 = i0.ɵɵnextContext();
|
|
12654
|
-
const _r1 = i0.ɵɵreference(
|
|
12678
|
+
const _r1 = i0.ɵɵreference(6);
|
|
12655
12679
|
i0.ɵɵstyleMap(ctx_r3.getSendButtonPosition(_r1));
|
|
12656
12680
|
} }
|
|
12657
|
-
function
|
|
12658
|
-
const
|
|
12659
|
-
i0.ɵɵelementStart(0, "i",
|
|
12660
|
-
i0.ɵɵlistener("click", function
|
|
12681
|
+
function DrChatFormWithHistoryComponent_i_15_Template(rf, ctx) { if (rf & 1) {
|
|
12682
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
12683
|
+
i0.ɵɵelementStart(0, "i", 17);
|
|
12684
|
+
i0.ɵɵlistener("click", function DrChatFormWithHistoryComponent_i_15_Template_i_click_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.abortMessage()); });
|
|
12661
12685
|
i0.ɵɵelementEnd();
|
|
12686
|
+
} if (rf & 2) {
|
|
12687
|
+
const ctx_r4 = i0.ɵɵnextContext();
|
|
12688
|
+
const _r1 = i0.ɵɵreference(6);
|
|
12689
|
+
i0.ɵɵstyleMap(ctx_r4.getSendButtonPosition(_r1));
|
|
12662
12690
|
} }
|
|
12663
|
-
function
|
|
12664
|
-
i0.ɵɵelement(0, "dr-dot-flashing",
|
|
12665
|
-
} }
|
|
12666
|
-
function DrChatFormWithHistoryComponent_dr_button_16_Template(rf, ctx) { if (rf & 1) {
|
|
12667
|
-
const _r17 = i0.ɵɵgetCurrentView();
|
|
12668
|
-
i0.ɵɵelementStart(0, "dr-button", 25);
|
|
12669
|
-
i0.ɵɵlistener("click", function DrChatFormWithHistoryComponent_dr_button_16_Template_dr_button_click_0_listener() { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.abortMessage()); });
|
|
12670
|
-
i0.ɵɵtext(1, "Stop generating");
|
|
12671
|
-
i0.ɵɵelementEnd();
|
|
12691
|
+
function DrChatFormWithHistoryComponent_dr_dot_flashing_16_Template(rf, ctx) { if (rf & 1) {
|
|
12692
|
+
i0.ɵɵelement(0, "dr-dot-flashing", 18);
|
|
12672
12693
|
} }
|
|
12673
12694
|
function DrChatFormWithHistoryComponent_ng_container_17_Template(rf, ctx) { if (rf & 1) {
|
|
12674
|
-
const
|
|
12695
|
+
const _r14 = i0.ɵɵgetCurrentView();
|
|
12675
12696
|
i0.ɵɵelementContainerStart(0);
|
|
12676
|
-
i0.ɵɵelementStart(1, "div",
|
|
12677
|
-
i0.ɵɵlistener("clickOutside", function DrChatFormWithHistoryComponent_ng_container_17_Template_div_clickOutside_1_listener() { i0.ɵɵrestoreView(
|
|
12697
|
+
i0.ɵɵelementStart(1, "div", 19);
|
|
12698
|
+
i0.ɵɵlistener("clickOutside", function DrChatFormWithHistoryComponent_ng_container_17_Template_div_clickOutside_1_listener() { i0.ɵɵrestoreView(_r14); const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r13.closeHistory()); });
|
|
12678
12699
|
i0.ɵɵprojection(2);
|
|
12679
12700
|
i0.ɵɵelementEnd();
|
|
12680
12701
|
i0.ɵɵelementContainerEnd();
|
|
12681
12702
|
} if (rf & 2) {
|
|
12682
|
-
const
|
|
12703
|
+
const ctx_r6 = i0.ɵɵnextContext();
|
|
12683
12704
|
i0.ɵɵadvance(1);
|
|
12684
|
-
i0.ɵɵproperty("@dropdownAnimation",
|
|
12705
|
+
i0.ɵɵproperty("@dropdownAnimation", ctx_r6.isShowedHistory ? "visible" : "hidden")("exclude", ".dr-icon-history");
|
|
12685
12706
|
} }
|
|
12686
|
-
const
|
|
12687
|
-
const
|
|
12688
|
-
const
|
|
12689
|
-
const
|
|
12707
|
+
const _c2 = function (a0) { return { "message-row_loading": a0 }; };
|
|
12708
|
+
const _c3 = function (a0) { return { height: a0 }; };
|
|
12709
|
+
const _c4 = function (a0, a1) { return { value: a0, params: a1 }; };
|
|
12710
|
+
const _c5 = function (a0, a1, a2) { return { "message-row__input--focused": a0, "message-row__input--filled": a1, "showed-dropdown": a2 }; };
|
|
12711
|
+
const _c6 = ["*"];
|
|
12690
12712
|
class DrChatFormWithHistoryComponent {
|
|
12691
12713
|
constructor(cdr, domSanitizer) {
|
|
12692
12714
|
this.cdr = cdr;
|
|
@@ -12694,9 +12716,10 @@ class DrChatFormWithHistoryComponent {
|
|
|
12694
12716
|
this._textareaInitialHeight = true;
|
|
12695
12717
|
this.inputFocus = false;
|
|
12696
12718
|
this.inputHover = false;
|
|
12697
|
-
this.droppedFiles = [];
|
|
12719
|
+
this.droppedFiles$ = new BehaviorSubject([]);
|
|
12698
12720
|
this.isShowedHistory = false;
|
|
12699
12721
|
this.isChatMode = false;
|
|
12722
|
+
this.isLoading = false;
|
|
12700
12723
|
/**
|
|
12701
12724
|
* Predefined message text
|
|
12702
12725
|
*
|
|
@@ -12732,12 +12755,13 @@ class DrChatFormWithHistoryComponent {
|
|
|
12732
12755
|
*
|
|
12733
12756
|
* @type {boolean}
|
|
12734
12757
|
*/
|
|
12735
|
-
this.
|
|
12758
|
+
this.showDotFlashing = false;
|
|
12736
12759
|
/**
|
|
12737
12760
|
*
|
|
12738
|
-
* @type {EventEmitter<{ message: string, files:
|
|
12761
|
+
* @type {EventEmitter<{ message: string, files: IFile[] }>}
|
|
12739
12762
|
*/
|
|
12740
12763
|
this.send = new EventEmitter();
|
|
12764
|
+
this.uploadFiles = new EventEmitter();
|
|
12741
12765
|
this.abort = new EventEmitter();
|
|
12742
12766
|
/**
|
|
12743
12767
|
* Emits when message input value has been changed
|
|
@@ -12752,27 +12776,18 @@ class DrChatFormWithHistoryComponent {
|
|
|
12752
12776
|
event.preventDefault();
|
|
12753
12777
|
event.stopPropagation();
|
|
12754
12778
|
this.fileOver = false;
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
if (IMAGE_TYPES.includes(file.type)) {
|
|
12759
|
-
const fr = new FileReader();
|
|
12760
|
-
fr.onload = (e) => {
|
|
12761
|
-
res.src = e.target.result;
|
|
12762
|
-
res.urlStyle = this.domSanitizer.bypassSecurityTrustStyle(`url(${res.src})`);
|
|
12763
|
-
this.cdr.detectChanges();
|
|
12764
|
-
};
|
|
12765
|
-
fr.readAsDataURL(file);
|
|
12766
|
-
}
|
|
12767
|
-
this.droppedFiles.push(res);
|
|
12768
|
-
}
|
|
12779
|
+
const files = event.dataTransfer?.files;
|
|
12780
|
+
if (files) {
|
|
12781
|
+
this.saveFiles(files);
|
|
12769
12782
|
}
|
|
12770
12783
|
}
|
|
12771
12784
|
}
|
|
12772
12785
|
removeFile(file) {
|
|
12773
|
-
const
|
|
12786
|
+
const droppedFiles = this.droppedFiles$.value;
|
|
12787
|
+
const index = droppedFiles.indexOf(file);
|
|
12774
12788
|
if (index >= 0) {
|
|
12775
|
-
|
|
12789
|
+
droppedFiles.splice(index, 1);
|
|
12790
|
+
this.droppedFiles$.next(droppedFiles);
|
|
12776
12791
|
}
|
|
12777
12792
|
}
|
|
12778
12793
|
onDragOver(event) {
|
|
@@ -12791,15 +12806,16 @@ class DrChatFormWithHistoryComponent {
|
|
|
12791
12806
|
}
|
|
12792
12807
|
sendMessage($event) {
|
|
12793
12808
|
if (!$event || !$event.shiftKey) {
|
|
12794
|
-
$event
|
|
12809
|
+
$event?.preventDefault();
|
|
12810
|
+
$event?.stopPropagation();
|
|
12795
12811
|
if (this.waitForReply) {
|
|
12796
12812
|
return;
|
|
12797
12813
|
}
|
|
12798
|
-
if (this.droppedFiles.length || String(this.message).trim().length) {
|
|
12814
|
+
else if (this.droppedFiles$.value.length || String(this.message).trim().length) {
|
|
12799
12815
|
this._textareaInitialHeight = true;
|
|
12800
|
-
this.send.emit({ message: this.message, files: this.droppedFiles });
|
|
12816
|
+
this.send.emit({ message: this.message, files: this.droppedFiles$.value });
|
|
12801
12817
|
this.message = '';
|
|
12802
|
-
this.droppedFiles
|
|
12818
|
+
this.droppedFiles$.next([]);
|
|
12803
12819
|
this.cdr.markForCheck();
|
|
12804
12820
|
}
|
|
12805
12821
|
}
|
|
@@ -12833,52 +12849,80 @@ class DrChatFormWithHistoryComponent {
|
|
|
12833
12849
|
}
|
|
12834
12850
|
onFileSelected(event) {
|
|
12835
12851
|
const input = event.target;
|
|
12852
|
+
this.fileOver = false;
|
|
12853
|
+
if (input.files.length) {
|
|
12854
|
+
this.saveFiles(Array.from(input.files));
|
|
12855
|
+
}
|
|
12856
|
+
this.fileInput.nativeElement.value = '';
|
|
12857
|
+
}
|
|
12858
|
+
async saveFiles(files) {
|
|
12859
|
+
const uploadedFiles = [];
|
|
12860
|
+
for (const file of files) {
|
|
12861
|
+
let res = file;
|
|
12862
|
+
res.data = (await this.base64Convert(res));
|
|
12863
|
+
this.droppedFiles$.next([...this.droppedFiles$.value, res]);
|
|
12864
|
+
uploadedFiles.push(res);
|
|
12865
|
+
this.cdr.markForCheck();
|
|
12866
|
+
this.cdr.detectChanges();
|
|
12867
|
+
}
|
|
12868
|
+
this.uploadFiles.emit(uploadedFiles.map((item) => ({ data: item.data, name: item.name })));
|
|
12869
|
+
}
|
|
12870
|
+
base64Convert(file) {
|
|
12871
|
+
return new Promise((resolve, reject) => {
|
|
12872
|
+
const reader = new FileReader();
|
|
12873
|
+
reader.onload = () => resolve(reader.result);
|
|
12874
|
+
reader.onerror = (error) => reject(error);
|
|
12875
|
+
reader.readAsDataURL(file);
|
|
12876
|
+
});
|
|
12836
12877
|
}
|
|
12837
12878
|
/** @nocollapse */ static { this.ɵfac = function DrChatFormWithHistoryComponent_Factory(t) { return new (t || DrChatFormWithHistoryComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$5.DomSanitizer)); }; }
|
|
12838
12879
|
/** @nocollapse */ static { this.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DrChatFormWithHistoryComponent, selectors: [["dr-chat-form-with-history"]], viewQuery: function DrChatFormWithHistoryComponent_Query(rf, ctx) { if (rf & 1) {
|
|
12839
12880
|
i0.ɵɵviewQuery(_c0$2, 5);
|
|
12881
|
+
i0.ɵɵviewQuery(_c1, 5);
|
|
12840
12882
|
} if (rf & 2) {
|
|
12841
12883
|
let _t;
|
|
12842
12884
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.textAreaElementRef = _t.first);
|
|
12885
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.fileInput = _t.first);
|
|
12843
12886
|
} }, hostVars: 2, hostBindings: function DrChatFormWithHistoryComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
12844
12887
|
i0.ɵɵlistener("drop", function DrChatFormWithHistoryComponent_drop_HostBindingHandler($event) { return ctx.onDrop($event); })("dragover", function DrChatFormWithHistoryComponent_dragover_HostBindingHandler($event) { return ctx.onDragOver($event); })("dragleave", function DrChatFormWithHistoryComponent_dragleave_HostBindingHandler($event) { return ctx.onDragLeave($event); });
|
|
12845
12888
|
} if (rf & 2) {
|
|
12846
12889
|
i0.ɵɵclassProp("file-over", ctx.fileOver);
|
|
12847
|
-
} }, inputs: { isChatMode: "isChatMode", message: "message", messagePlaceholder: "messagePlaceholder", dropFiles: "dropFiles", dropFilePlaceholder: "dropFilePlaceholder", waitForReply: "waitForReply",
|
|
12848
|
-
const
|
|
12890
|
+
} }, inputs: { isChatMode: "isChatMode", isLoading: "isLoading", message: "message", messagePlaceholder: "messagePlaceholder", dropFiles: "dropFiles", dropFilePlaceholder: "dropFilePlaceholder", waitForReply: "waitForReply", showDotFlashing: "showDotFlashing" }, outputs: { send: "send", uploadFiles: "uploadFiles", abort: "abort", inputChange: "inputChange" }, ngContentSelectors: _c6, decls: 18, vars: 27, consts: [[1, "message-row", 3, "ngClass"], [1, "message-row__input", 3, "ngClass"], [3, "files", "isRemovable", "maxLengthText", "removeFileEvent", 4, "ngIf"], [1, "message-row__input-textarea-wrap"], ["type", "text", 3, "ngModel", "rows", "placeholder", "focus", "blur", "mouseenter", "mouseleave", "ngModelChange", "keydown.enter"], ["textAreaElement", ""], [1, "message-input-tmp"], ["type", "file", "hidden", "", "multiple", "", 3, "change"], ["fileInput", ""], [1, "dr-icon-history", 3, "click"], [1, "dr-icon-attachment", 3, "click"], ["class", "dr-icon-send-arrow-up send-button", 3, "style", "click", 4, "ngIf"], ["class", "dr-icon-stop abort-button", 3, "style", "click", 4, "ngIf"], ["class", "wait-reply-dot-flashing", 4, "ngIf"], [4, "ngIf"], [3, "files", "isRemovable", "maxLengthText", "removeFileEvent"], [1, "dr-icon-send-arrow-up", "send-button", 3, "click"], [1, "dr-icon-stop", "abort-button", 3, "click"], [1, "wait-reply-dot-flashing"], [1, "history-dropdown", 3, "exclude", "clickOutside"]], template: function DrChatFormWithHistoryComponent_Template(rf, ctx) { if (rf & 1) {
|
|
12891
|
+
const _r15 = i0.ɵɵgetCurrentView();
|
|
12849
12892
|
i0.ɵɵprojectionDef();
|
|
12850
12893
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
|
|
12851
|
-
i0.ɵɵtemplate(2,
|
|
12852
|
-
i0.ɵɵ
|
|
12853
|
-
i0.ɵɵ
|
|
12854
|
-
i0.ɵɵ
|
|
12894
|
+
i0.ɵɵtemplate(2, DrChatFormWithHistoryComponent_dr_chat_dropped_files_2_Template, 2, 5, "dr-chat-dropped-files", 2);
|
|
12895
|
+
i0.ɵɵpipe(3, "async");
|
|
12896
|
+
i0.ɵɵelementStart(4, "div", 3)(5, "textarea", 4, 5);
|
|
12897
|
+
i0.ɵɵlistener("focus", function DrChatFormWithHistoryComponent_Template_textarea_focus_5_listener() { return ctx.inputFocus = true; })("blur", function DrChatFormWithHistoryComponent_Template_textarea_blur_5_listener() { return ctx.inputFocus = false; })("mouseenter", function DrChatFormWithHistoryComponent_Template_textarea_mouseenter_5_listener() { return ctx.inputHover = true; })("mouseleave", function DrChatFormWithHistoryComponent_Template_textarea_mouseleave_5_listener() { return ctx.inputHover = false; })("ngModelChange", function DrChatFormWithHistoryComponent_Template_textarea_ngModelChange_5_listener($event) { return ctx.message = $event; })("ngModelChange", function DrChatFormWithHistoryComponent_Template_textarea_ngModelChange_5_listener($event) { return ctx.onModelChange($event); })("keydown.enter", function DrChatFormWithHistoryComponent_Template_textarea_keydown_enter_5_listener($event) { return ctx.sendMessage($event); });
|
|
12898
|
+
i0.ɵɵtext(7, " ");
|
|
12855
12899
|
i0.ɵɵelementEnd();
|
|
12856
|
-
i0.ɵɵelementStart(
|
|
12857
|
-
i0.ɵɵtext(
|
|
12900
|
+
i0.ɵɵelementStart(8, "div", 6);
|
|
12901
|
+
i0.ɵɵtext(9);
|
|
12858
12902
|
i0.ɵɵelementEnd();
|
|
12859
|
-
i0.ɵɵelementStart(
|
|
12860
|
-
i0.ɵɵlistener("change", function
|
|
12903
|
+
i0.ɵɵelementStart(10, "input", 7, 8);
|
|
12904
|
+
i0.ɵɵlistener("change", function DrChatFormWithHistoryComponent_Template_input_change_10_listener($event) { return ctx.onFileSelected($event); });
|
|
12861
12905
|
i0.ɵɵelementEnd();
|
|
12862
|
-
i0.ɵɵelementStart(
|
|
12863
|
-
i0.ɵɵlistener("click", function
|
|
12906
|
+
i0.ɵɵelementStart(12, "i", 9);
|
|
12907
|
+
i0.ɵɵlistener("click", function DrChatFormWithHistoryComponent_Template_i_click_12_listener() { return ctx.showHistory(); });
|
|
12864
12908
|
i0.ɵɵelementEnd();
|
|
12865
|
-
i0.ɵɵelementStart(
|
|
12866
|
-
i0.ɵɵlistener("click", function
|
|
12909
|
+
i0.ɵɵelementStart(13, "i", 10);
|
|
12910
|
+
i0.ɵɵlistener("click", function DrChatFormWithHistoryComponent_Template_i_click_13_listener() { i0.ɵɵrestoreView(_r15); const _r2 = i0.ɵɵreference(11); return i0.ɵɵresetView(_r2.click()); });
|
|
12867
12911
|
i0.ɵɵelementEnd();
|
|
12868
|
-
i0.ɵɵtemplate(
|
|
12869
|
-
i0.ɵɵtemplate(
|
|
12870
|
-
i0.ɵɵtemplate(
|
|
12871
|
-
i0.ɵɵtemplate(16, DrChatFormWithHistoryComponent_dr_button_16_Template, 2, 0, "dr-button", 14);
|
|
12912
|
+
i0.ɵɵtemplate(14, DrChatFormWithHistoryComponent_i_14_Template, 1, 2, "i", 11);
|
|
12913
|
+
i0.ɵɵtemplate(15, DrChatFormWithHistoryComponent_i_15_Template, 1, 2, "i", 12);
|
|
12914
|
+
i0.ɵɵtemplate(16, DrChatFormWithHistoryComponent_dr_dot_flashing_16_Template, 1, 0, "dr-dot-flashing", 13);
|
|
12872
12915
|
i0.ɵɵelementEnd();
|
|
12873
|
-
i0.ɵɵtemplate(17, DrChatFormWithHistoryComponent_ng_container_17_Template, 3, 2, "ng-container",
|
|
12916
|
+
i0.ɵɵtemplate(17, DrChatFormWithHistoryComponent_ng_container_17_Template, 3, 2, "ng-container", 14);
|
|
12874
12917
|
i0.ɵɵelementEnd()();
|
|
12875
12918
|
} if (rf & 2) {
|
|
12876
|
-
const _r1 = i0.ɵɵreference(
|
|
12919
|
+
const _r1 = i0.ɵɵreference(6);
|
|
12920
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c2, ctx.isLoading));
|
|
12877
12921
|
i0.ɵɵadvance(1);
|
|
12878
|
-
i0.ɵɵproperty("@containerHeightAnimation", i0.ɵɵpureFunction2(
|
|
12922
|
+
i0.ɵɵproperty("@containerHeightAnimation", i0.ɵɵpureFunction2(20, _c4, ctx.showHistory ? "expanded" : "collapsed", i0.ɵɵpureFunction1(18, _c3, ctx.getTextAreaHeight(_r1))))("ngClass", i0.ɵɵpureFunction3(23, _c5, ctx.inputFocus, !!(ctx.message == null ? null : ctx.message.length), ctx.isShowedHistory));
|
|
12879
12923
|
i0.ɵɵadvance(1);
|
|
12880
|
-
i0.ɵɵproperty("ngIf",
|
|
12881
|
-
i0.ɵɵadvance(
|
|
12924
|
+
i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(3, 14, ctx.droppedFiles$).length);
|
|
12925
|
+
i0.ɵɵadvance(3);
|
|
12882
12926
|
i0.ɵɵstyleMap(ctx.getTextAreaHeight(_r1));
|
|
12883
12927
|
i0.ɵɵpropertyInterpolate("placeholder", ctx.fileOver ? ctx.dropFilePlaceholder : ctx.messagePlaceholder);
|
|
12884
12928
|
i0.ɵɵproperty("ngModel", ctx.message)("rows", 1);
|
|
@@ -12887,14 +12931,12 @@ class DrChatFormWithHistoryComponent {
|
|
|
12887
12931
|
i0.ɵɵadvance(5);
|
|
12888
12932
|
i0.ɵɵproperty("ngIf", !ctx.waitForReply);
|
|
12889
12933
|
i0.ɵɵadvance(1);
|
|
12890
|
-
i0.ɵɵproperty("ngIf", ctx.waitForReply && ctx.
|
|
12891
|
-
i0.ɵɵadvance(1);
|
|
12892
|
-
i0.ɵɵproperty("ngIf", ctx.waitForReply && !ctx.showDisabledButtonInsteadOfDotFlashing);
|
|
12934
|
+
i0.ɵɵproperty("ngIf", ctx.waitForReply && !ctx.showDotFlashing);
|
|
12893
12935
|
i0.ɵɵadvance(1);
|
|
12894
|
-
i0.ɵɵproperty("ngIf", ctx.waitForReply);
|
|
12936
|
+
i0.ɵɵproperty("ngIf", ctx.waitForReply && ctx.showDotFlashing);
|
|
12895
12937
|
i0.ɵɵadvance(1);
|
|
12896
12938
|
i0.ɵɵproperty("ngIf", !ctx.isChatMode);
|
|
12897
|
-
} }, dependencies: [i1$2.DefaultValueAccessor, i1$2.NgControlStatus, i1$2.NgModel, i1.NgClass, i1.
|
|
12939
|
+
} }, dependencies: [i1$2.DefaultValueAccessor, i1$2.NgControlStatus, i1$2.NgModel, i1.NgClass, i1.NgIf, ClickOutsideDirective, DrDotFlashingComponent, DrChatDroppedFilesComponent, i1.AsyncPipe], styles: ["[_nghost-%COMP%] {--send-button-offset: 42px;display:flex;flex-direction:column;align-items:center;padding:0 16px}[_nghost-%COMP%] .message-row{display:flex;justify-content:center;width:100%;padding:0 0 21px;max-width:956px}[_nghost-%COMP%] .message-row__input{flex-direction:column;background-color:#fff;position:relative;display:flex;align-items:center;flex-grow:1;height:auto;overflow:visible;min-width:265px;border-radius:24px;border:1.5px solid transparent;box-shadow:0 2px 16px -10px #603cff29;transition:.35s ease}[_nghost-%COMP%] .message-row__input .abort-button, [_nghost-%COMP%] .message-row__input .send-button{width:32px;height:32px;display:flex;align-items:center;justify-content:center;position:absolute;top:2.5px;right:8px;cursor:pointer;font-size:24px;border-radius:100px;color:#fff;transition:.15s ease-in-out;background:linear-gradient(266deg,#6969ff 25.2%,#4eb7df 90.24%) border-box}[_nghost-%COMP%] .message-row__input .dr-icon-history, [_nghost-%COMP%] .message-row__input .dr-icon-attachment{display:flex;align-items:center;position:absolute;cursor:pointer;width:32px;height:48px;left:16px;top:-1px}[_nghost-%COMP%] .message-row__input .dr-icon-attachment{left:52px}[_nghost-%COMP%] .message-row__input .send-button{opacity:.5;pointer-events:none}[_nghost-%COMP%] .message-row__input--focused{box-shadow:8px 8px 16px #6969ff40,-4px -4px 8px #40b6e340,8px 8px 60px #00000040;height:auto!important;background:#fff}[_nghost-%COMP%] .message-row__input--filled{box-shadow:8px 8px 16px #6969ff40,-4px -4px 8px #40b6e340,8px 8px 60px #00000040;background:#fff}[_nghost-%COMP%] .message-row__input--filled .send-button{opacity:1;pointer-events:all}[_nghost-%COMP%] .message-row__input .message-input-tmp{display:none}[_nghost-%COMP%] .message-row__input.showed-dropdown .send-button{opacity:.5}[_nghost-%COMP%] .message-row__input .wait-reply-dot-flashing{display:flex;position:absolute;align-items:center;width:32px;height:48px;right:25px}[_nghost-%COMP%] .message-row__input:before{content:\"\";position:absolute;inset:-3px;background:linear-gradient(266deg,#6969ff 25.2%,#4eb7df 90.24%);border-radius:25px;z-index:-1}[_nghost-%COMP%] .message-row__input textarea, [_nghost-%COMP%] .message-row__input .message-input-tmp{font-size:14px;color:#333;width:100%;outline:none;min-height:48px;line-height:19px;flex-grow:1;resize:none;padding:13px 55px 13px 88px;margin:auto;border:none;border-radius:22.5px}[_nghost-%COMP%] .message-row__input textarea:focus, [_nghost-%COMP%] .message-row__input .message-input-tmp:focus{border:none}[_nghost-%COMP%] .message-row__input textarea::placeholder, [_nghost-%COMP%] .message-row__input .message-input-tmp::placeholder{color:#9ea1aa}[_nghost-%COMP%] .message-row__input-textarea-wrap{display:flex;width:100%;position:relative}[_nghost-%COMP%] .history-dropdown{width:100%;max-height:220px;overflow-y:auto;padding:12px 16px 0}[_nghost-%COMP%] .showed-dropdown textarea{visibility:hidden;position:absolute}[_nghost-%COMP%] .showed-dropdown .message-input-tmp{display:block;margin-left:inherit;white-space:nowrap;font-family:monospace;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .showed-dropdown .send-button{top:2.5px!important}[_nghost-%COMP%] dr-chat-dropped-files{margin-right:auto}[_nghost-%COMP%] .message-row_loading .send-button, [_nghost-%COMP%] .message-row_loading .dropped-files__item{opacity:.5;pointer-events:none}"], data: { animation: [
|
|
12898
12940
|
trigger('containerHeightAnimation', [
|
|
12899
12941
|
state('collapsed', style({ height: '{{height}}' }), { params: { height: '48px' } }),
|
|
12900
12942
|
state('expanded', style({
|
|
@@ -12950,12 +12992,17 @@ class DrChatFormWithHistoryComponent {
|
|
|
12950
12992
|
style({ display: 'none' }),
|
|
12951
12993
|
]),
|
|
12952
12994
|
]),
|
|
12953
|
-
], template: "<div class=\"message-row\">\n <div\n [@containerHeightAnimation]=\"{\n value: showHistory ? 'expanded' : 'collapsed',\n params: { height: getTextAreaHeight(textAreaElement) },\n }\"\n class=\"message-row__input\"\n [ngClass]=\"{\n 'message-row__input--focused': inputFocus,\n 'message-row__input--filled': !!message?.length,\n 'showed-dropdown': isShowedHistory,\n }\">\n <
|
|
12995
|
+
], template: "<div class=\"message-row\" [ngClass]=\"{ 'message-row_loading': isLoading }\">\n <div\n [@containerHeightAnimation]=\"{\n value: showHistory ? 'expanded' : 'collapsed',\n params: { height: getTextAreaHeight(textAreaElement) },\n }\"\n class=\"message-row__input\"\n [ngClass]=\"{\n 'message-row__input--focused': inputFocus,\n 'message-row__input--filled': !!message?.length,\n 'showed-dropdown': isShowedHistory,\n }\">\n <dr-chat-dropped-files\n *ngIf=\"(droppedFiles$ | async).length\"\n [files]=\"droppedFiles$ | async\"\n [isRemovable]=\"true\"\n [maxLengthText]=\"15\"\n (removeFileEvent)=\"removeFile($event)\"></dr-chat-dropped-files>\n\n <div class=\"message-row__input-textarea-wrap\">\n <textarea\n #textAreaElement\n (focus)=\"inputFocus = true\"\n (blur)=\"inputFocus = false\"\n (mouseenter)=\"inputHover = true\"\n (mouseleave)=\"inputHover = false\"\n [(ngModel)]=\"message\"\n [rows]=\"1\"\n [style]=\"getTextAreaHeight(textAreaElement)\"\n (ngModelChange)=\"onModelChange($event)\"\n type=\"text\"\n placeholder=\"{{ fileOver ? dropFilePlaceholder : messagePlaceholder }}\"\n (keydown.enter)=\"sendMessage($event)\">\n </textarea>\n\n <div class=\"message-input-tmp\">{{ textAreaElement.value }}</div>\n\n <input #fileInput type=\"file\" hidden multiple (change)=\"onFileSelected($event)\" />\n <i (click)=\"showHistory()\" class=\"dr-icon-history\"></i>\n <i (click)=\"fileInput.click()\" class=\"dr-icon-attachment\"></i>\n\n <i\n *ngIf=\"!waitForReply\"\n [style]=\"getSendButtonPosition(textAreaElement)\"\n (click)=\"sendMessage($event)\"\n class=\"dr-icon-send-arrow-up send-button\"></i>\n\n <i\n *ngIf=\"waitForReply && !showDotFlashing\"\n [style]=\"getSendButtonPosition(textAreaElement)\"\n class=\"dr-icon-stop abort-button\"\n (click)=\"abortMessage()\"></i>\n <dr-dot-flashing *ngIf=\"waitForReply && showDotFlashing\" class=\"wait-reply-dot-flashing\"></dr-dot-flashing>\n </div>\n\n <ng-container *ngIf=\"!isChatMode\">\n <div\n [@dropdownAnimation]=\"isShowedHistory ? 'visible' : 'hidden'\"\n class=\"history-dropdown\"\n [exclude]=\"'.dr-icon-history'\"\n (clickOutside)=\"closeHistory()\">\n <ng-content></ng-content>\n </div>\n </ng-container>\n </div>\n</div>\n", styles: [":host::ng-deep{--send-button-offset: 42px;display:flex;flex-direction:column;align-items:center;padding:0 16px}:host::ng-deep .message-row{display:flex;justify-content:center;width:100%;padding:0 0 21px;max-width:956px}:host::ng-deep .message-row__input{flex-direction:column;background-color:#fff;position:relative;display:flex;align-items:center;flex-grow:1;height:auto;overflow:visible;min-width:265px;border-radius:24px;border:1.5px solid transparent;box-shadow:0 2px 16px -10px #603cff29;transition:.35s ease}:host::ng-deep .message-row__input .abort-button,:host::ng-deep .message-row__input .send-button{width:32px;height:32px;display:flex;align-items:center;justify-content:center;position:absolute;top:2.5px;right:8px;cursor:pointer;font-size:24px;border-radius:100px;color:#fff;transition:.15s ease-in-out;background:linear-gradient(266deg,#6969ff 25.2%,#4eb7df 90.24%) border-box}:host::ng-deep .message-row__input .dr-icon-history,:host::ng-deep .message-row__input .dr-icon-attachment{display:flex;align-items:center;position:absolute;cursor:pointer;width:32px;height:48px;left:16px;top:-1px}:host::ng-deep .message-row__input .dr-icon-attachment{left:52px}:host::ng-deep .message-row__input .send-button{opacity:.5;pointer-events:none}:host::ng-deep .message-row__input--focused{box-shadow:8px 8px 16px #6969ff40,-4px -4px 8px #40b6e340,8px 8px 60px #00000040;height:auto!important;background:#fff}:host::ng-deep .message-row__input--filled{box-shadow:8px 8px 16px #6969ff40,-4px -4px 8px #40b6e340,8px 8px 60px #00000040;background:#fff}:host::ng-deep .message-row__input--filled .send-button{opacity:1;pointer-events:all}:host::ng-deep .message-row__input .message-input-tmp{display:none}:host::ng-deep .message-row__input.showed-dropdown .send-button{opacity:.5}:host::ng-deep .message-row__input .wait-reply-dot-flashing{display:flex;position:absolute;align-items:center;width:32px;height:48px;right:25px}:host::ng-deep .message-row__input:before{content:\"\";position:absolute;inset:-3px;background:linear-gradient(266deg,#6969ff 25.2%,#4eb7df 90.24%);border-radius:25px;z-index:-1}:host::ng-deep .message-row__input textarea,:host::ng-deep .message-row__input .message-input-tmp{font-size:14px;color:#333;width:100%;outline:none;min-height:48px;line-height:19px;flex-grow:1;resize:none;padding:13px 55px 13px 88px;margin:auto;border:none;border-radius:22.5px}:host::ng-deep .message-row__input textarea:focus,:host::ng-deep .message-row__input .message-input-tmp:focus{border:none}:host::ng-deep .message-row__input textarea::placeholder,:host::ng-deep .message-row__input .message-input-tmp::placeholder{color:#9ea1aa}:host::ng-deep .message-row__input-textarea-wrap{display:flex;width:100%;position:relative}:host::ng-deep .history-dropdown{width:100%;max-height:220px;overflow-y:auto;padding:12px 16px 0}:host::ng-deep .showed-dropdown textarea{visibility:hidden;position:absolute}:host::ng-deep .showed-dropdown .message-input-tmp{display:block;margin-left:inherit;white-space:nowrap;font-family:monospace;overflow:hidden;text-overflow:ellipsis}:host::ng-deep .showed-dropdown .send-button{top:2.5px!important}:host::ng-deep dr-chat-dropped-files{margin-right:auto}:host::ng-deep .message-row_loading .send-button,:host::ng-deep .message-row_loading .dropped-files__item{opacity:.5;pointer-events:none}\n"] }]
|
|
12954
12996
|
}], function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$5.DomSanitizer }]; }, { textAreaElementRef: [{
|
|
12955
12997
|
type: ViewChild,
|
|
12956
12998
|
args: ['textAreaElement']
|
|
12999
|
+
}], fileInput: [{
|
|
13000
|
+
type: ViewChild,
|
|
13001
|
+
args: ['fileInput']
|
|
12957
13002
|
}], isChatMode: [{
|
|
12958
13003
|
type: Input
|
|
13004
|
+
}], isLoading: [{
|
|
13005
|
+
type: Input
|
|
12959
13006
|
}], message: [{
|
|
12960
13007
|
type: Input
|
|
12961
13008
|
}], messagePlaceholder: [{
|
|
@@ -12966,10 +13013,12 @@ class DrChatFormWithHistoryComponent {
|
|
|
12966
13013
|
type: Input
|
|
12967
13014
|
}], waitForReply: [{
|
|
12968
13015
|
type: Input
|
|
12969
|
-
}],
|
|
13016
|
+
}], showDotFlashing: [{
|
|
12970
13017
|
type: Input
|
|
12971
13018
|
}], send: [{
|
|
12972
13019
|
type: Output
|
|
13020
|
+
}], uploadFiles: [{
|
|
13021
|
+
type: Output
|
|
12973
13022
|
}], abort: [{
|
|
12974
13023
|
type: Output
|
|
12975
13024
|
}], inputChange: [{
|
|
@@ -12998,7 +13047,9 @@ const DR_CHAT_COMPONENTS = [
|
|
|
12998
13047
|
DrChatSuggestionsComponent,
|
|
12999
13048
|
DrDotFlashingComponent,
|
|
13000
13049
|
DrChatAlertComponent,
|
|
13050
|
+
DrChatDroppedFilesComponent,
|
|
13001
13051
|
];
|
|
13052
|
+
const DR_CHAT_PIPES = [ShorterNamingPipe];
|
|
13002
13053
|
const DR_CHAT_DIRECTIVES = [DrChatCustomMessageDirective];
|
|
13003
13054
|
class DrChatModule {
|
|
13004
13055
|
/** @nocollapse */ static { this.ɵfac = function DrChatModule_Factory(t) { return new (t || DrChatModule)(); }; }
|
|
@@ -13023,7 +13074,7 @@ class DrChatModule {
|
|
|
13023
13074
|
DrTooltipModule,
|
|
13024
13075
|
ClickOutsideModule,
|
|
13025
13076
|
],
|
|
13026
|
-
declarations: [...DR_CHAT_COMPONENTS, ...DR_CHAT_DIRECTIVES],
|
|
13077
|
+
declarations: [...DR_CHAT_COMPONENTS, ...DR_CHAT_DIRECTIVES, ...DR_CHAT_PIPES],
|
|
13027
13078
|
exports: [...DR_CHAT_COMPONENTS, ...DR_CHAT_DIRECTIVES],
|
|
13028
13079
|
}]
|
|
13029
13080
|
}], null, null); })();
|
|
@@ -13035,7 +13086,8 @@ class DrChatModule {
|
|
|
13035
13086
|
DrChatMessageFileComponent,
|
|
13036
13087
|
DrChatSuggestionsComponent,
|
|
13037
13088
|
DrDotFlashingComponent,
|
|
13038
|
-
DrChatAlertComponent,
|
|
13089
|
+
DrChatAlertComponent,
|
|
13090
|
+
DrChatDroppedFilesComponent, DrChatCustomMessageDirective, ShorterNamingPipe], imports: [FormsModule,
|
|
13039
13091
|
ReactiveFormsModule,
|
|
13040
13092
|
CommonModule,
|
|
13041
13093
|
DrAvatarModule,
|
|
@@ -13049,7 +13101,8 @@ class DrChatModule {
|
|
|
13049
13101
|
DrChatMessageFileComponent,
|
|
13050
13102
|
DrChatSuggestionsComponent,
|
|
13051
13103
|
DrDotFlashingComponent,
|
|
13052
|
-
DrChatAlertComponent,
|
|
13104
|
+
DrChatAlertComponent,
|
|
13105
|
+
DrChatDroppedFilesComponent, DrChatCustomMessageDirective] }); })();
|
|
13053
13106
|
|
|
13054
13107
|
class DrTagsConstructorModule {
|
|
13055
13108
|
/** @nocollapse */ static { this.ɵfac = function DrTagsConstructorModule_Factory(t) { return new (t || DrTagsConstructorModule)(); }; }
|