comp-message-area.component.mjs 5.5 KB

12345678910
  1. /**
  2. * @copyright © 未来飞马 © 未来全栈 www.fmode.cn
  3. * 版权所有 © 未来飞马 © 江西脑控科技有限公司 Copyright © Fmode Technology Co., Ltd.
  4. * 保留所有权利 All Rights Reserved.
  5. * /home/ryan/workspace/nova/nova-admin/dist/fmode-ng/esm2022/lib/aigc/chat/chat-message-area/comp-message-area.component.mjs
  6. */
  7. import{CommonModule}from"@angular/common";import{Component,Input}from"@angular/core";import{ChatService,FmodeChat}from"../../service-fmai/service-chat";import{FmChatMessageCard}from"../chat-message-card/comp-message-card.component";import{CompRolePromptComponent}from"../comp-role-prompt/comp-role-prompt.component";import*as i0 from"@angular/core";import*as i1 from"../../service-fmai/service-chat";import*as i2 from"@angular/common";export class FmChatMesssageArea{get messageList(){return this.chatServ.chatMap[this.chatId]?.messageList}constructor(e){this.chatServ=e}ngDoCheck(){}ngAfterViewInit(){console.log("ng gogogo1"),console.log("ng gogogo2"),console.log(this.chat)}static{this.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"17.3.12",ngImport:i0,type:FmChatMesssageArea,deps:[{token:i1.ChatService}],target:i0.ɵɵFactoryTarget.Component})}static{this.ɵcmp=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"17.3.12",type:FmChatMesssageArea,isStandalone:!0,selector:"fm-chat-message-area",inputs:{chatId:"chatId",chat:"chat"},ngImport:i0,template:'\n<div class="message-list">\n <app-comp-role-prompt [chat]="chat" [role]="chat?.role?.id"></app-comp-role-prompt>\n <ng-container *ngFor="let message of chat?.messageList;let index=index;">\n \x3c!-- 内容格式化区域 --\x3e\n <fm-chat-message-card [chat]="chat" *ngIf="!message?.hidden" [index]="index" [message]="message" [role]="chat?.role"></fm-chat-message-card>\n </ng-container>\n\n @if(!chat?.hideInputPreview){\n \x3c!-- 预览无图消息 --\x3e\n <ng-container *ngIf="chat?.userInput&&!chat?.userImage">\n <fm-chat-message-card [chat]="chat" [message]="{role:\'user\',content:chat?.userInput}" [role]="chat?.role"></fm-chat-message-card>\n </ng-container>\n \n \x3c!-- 预览有图消息 --\x3e\n <ng-container *ngIf="chat?.userImage">\n <fm-chat-message-card [chat]="chat" [message]="{role:\'user\',content:[{type:\'text\',text:chat?.userInput},{type:\'image_url\',image_url:{url:chat?.userImage}}]}" [role]="chat?.role"></fm-chat-message-card>\n </ng-container>\n }\n</div>',styles:[".message-list{padding:5px 20px}:host-context(body.dark) .message-list{background-color:#000!important}\n"],dependencies:[{kind:"ngmodule",type:CommonModule},{kind:"directive",type:i2.NgForOf,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{kind:"directive",type:i2.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]},{kind:"component",type:FmChatMessageCard,selector:"fm-chat-message-card",inputs:["index","message","role","chat"]},{kind:"component",type:CompRolePromptComponent,selector:"app-comp-role-prompt",inputs:["chat","role"]}]})}}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"17.3.12",ngImport:i0,type:FmChatMesssageArea,decorators:[{type:Component,args:[{selector:"fm-chat-message-area",standalone:!0,imports:[CommonModule,FmChatMessageCard,CompRolePromptComponent],template:'\n<div class="message-list">\n <app-comp-role-prompt [chat]="chat" [role]="chat?.role?.id"></app-comp-role-prompt>\n <ng-container *ngFor="let message of chat?.messageList;let index=index;">\n \x3c!-- 内容格式化区域 --\x3e\n <fm-chat-message-card [chat]="chat" *ngIf="!message?.hidden" [index]="index" [message]="message" [role]="chat?.role"></fm-chat-message-card>\n </ng-container>\n\n @if(!chat?.hideInputPreview){\n \x3c!-- 预览无图消息 --\x3e\n <ng-container *ngIf="chat?.userInput&&!chat?.userImage">\n <fm-chat-message-card [chat]="chat" [message]="{role:\'user\',content:chat?.userInput}" [role]="chat?.role"></fm-chat-message-card>\n </ng-container>\n \n \x3c!-- 预览有图消息 --\x3e\n <ng-container *ngIf="chat?.userImage">\n <fm-chat-message-card [chat]="chat" [message]="{role:\'user\',content:[{type:\'text\',text:chat?.userInput},{type:\'image_url\',image_url:{url:chat?.userImage}}]}" [role]="chat?.role"></fm-chat-message-card>\n </ng-container>\n }\n</div>',styles:[".message-list{padding:5px 20px}:host-context(body.dark) .message-list{background-color:#000!important}\n"]}]}],ctorParameters:()=>[{type:i1.ChatService}],propDecorators:{chatId:[{type:Input}],chat:[{type:Input}]}});
  8. var MODULE_PATH_NEED = `6K+l5paH5Lu25piv5pys6aG555uu55qE5LiA6YOo5YiGIFRoaXMgZmlsZSBpcyBwYXJ0IG9mIHRoZSBDb21wb25lbnRzIGluIEZtb2RlIEluYy4KICAgIOeJiOadg+aJgOaciSDCqSDmnKrmnaXpo57pqawgwqkg5rGf6KW/6ISR5o6n56eR5oqA5pyJ6ZmQ5YWs5Y+4IENvcHlyaWdodCDCqSBGbW9kZSBUZWNobm9sb2d5IENvLiwgTHRkLgogICAg5L+d55WZ5omA5pyJ5p2D5YipIEFsbCBSaWdodHMgUmVzZXJ2ZWQuCiAgICDkuKXnpoHlnKjmnKrnu4/mjojmnYPnmoTmg4XlhrXkuIvvvIzpgJrov4fku7vkvZXlqpLku4vlpI3liLbmraTmlofku7YgVW5hdXRob3JpemVkIGNvcHlpbmcgb2YgdGhpcyBmaWxlLCB2aWEgYW55IG1lZGl1bSBpcyBzdHJpY3RseSBwcm9oaWJpdGVkCiAgICDor6Xmlofku7bmmK/kuJPmnInnmoTmnLrlr4bmlofku7YgUHJvcHJpZXRhcnkgYW5kIGNvbmZpZGVudGlhbAogICAKICAgIENvcHlyaWdodCAyMDIxLW5vdyBGbW9kZSBJbmMuIHN1cHBvcnRAZm1vZGUuY24uIDE4NjA3MDA3MDczLgogICAg5L+d55WZ5omA5pyJ5p2D5YipIEFsbCByaWdodHMgcmVzZXJ2ZWQuCgogICAgUEFUSDovaG9tZS9yeWFuL3dvcmtzcGFjZS9ub3ZhL25vdmEtYWRtaW4vZGlzdC9mbW9kZS1uZy9lc20yMDIyL2xpYi9haWdjL2NoYXQvY2hhdC1tZXNzYWdlLWFyZWEvY29tcC1tZXNzYWdlLWFyZWEuY29tcG9uZW50Lm1qcw==`