@namiruai/angular 1.0.0 → 1.2.0

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/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- var p=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var t=(l,n,r,i)=>{for(var a=i>1?void 0:i?c(n,r):n,o=l.length-1,g;o>=0;o--)(g=l[o])&&(a=(i?g(n,r,a):g(a))||a);return i&&a&&p(n,r,a),a};import{Component as m,EventEmitter as h,Input as s,Output as d,ViewChild as f}from"@angular/core";var e=class{constructor(){this.leadCapture=new h;this.feedback=new h;this.sessionStart=new h;this.sessionEnd=new h;this.instance=null}async ngOnInit(){let{init:n}=await import("@namiruai/chat"),r={agentId:this.agentId,serverUrl:this.serverUrl,mode:this.mode,position:this.position,container:this.mode==="inline"?this.containerRef.nativeElement:void 0,preChatEnabled:this.preChatEnabled,preChatTemplate:this.preChatTemplate,preChatCustom:this.preChatCustom,greetingDelay:this.greetingDelay,width:this.width,height:this.height,onLeadCapture:i=>this.leadCapture.emit(i),onFeedback:i=>this.feedback.emit(i),onSessionStart:i=>this.sessionStart.emit(i),onSessionEnd:i=>this.sessionEnd.emit(i)};this.instance=n(r)}ngOnChanges(n){if(this.instance){if(n.agentId&&!n.agentId.firstChange){this.instance.destroy(),this.ngOnInit();return}this.instance.updateConfig({serverUrl:this.serverUrl,mode:this.mode,position:this.position,preChatEnabled:this.preChatEnabled,preChatTemplate:this.preChatTemplate,preChatCustom:this.preChatCustom,greetingDelay:this.greetingDelay,width:this.width,height:this.height})}}ngOnDestroy(){this.instance?.destroy(),this.instance=null}};t([s()],e.prototype,"agentId",2),t([s()],e.prototype,"serverUrl",2),t([s()],e.prototype,"mode",2),t([s()],e.prototype,"position",2),t([s()],e.prototype,"preChatEnabled",2),t([s()],e.prototype,"preChatTemplate",2),t([s()],e.prototype,"preChatCustom",2),t([s()],e.prototype,"greetingDelay",2),t([s()],e.prototype,"width",2),t([s()],e.prototype,"height",2),t([d()],e.prototype,"leadCapture",2),t([d()],e.prototype,"feedback",2),t([d()],e.prototype,"sessionStart",2),t([d()],e.prototype,"sessionEnd",2),t([f("container",{static:!0})],e.prototype,"containerRef",2),e=t([m({selector:"namiru-chat",standalone:!0,template:`<div #container [style.width]="mode === 'inline' ? '100%' : ''" [style.height]="mode === 'inline' ? '100%' : ''"></div>`})],e);export{e as NamiruChatComponent};
1
+ var h=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var i=(o,n,s,t)=>{for(var a=t>1?void 0:t?l(n,s):n,c=o.length-1,g;c>=0;c--)(g=o[c])&&(a=(t?g(n,s,a):g(a))||a);return t&&a&&h(n,s,a),a};import{Component as u,EventEmitter as r,Input as f,Output as d,ViewChild as p}from"@angular/core";var e=class{constructor(){this.leadCapture=new r;this.feedback=new r;this.sessionStart=new r;this.sessionEnd=new r;this.instance=null}async ngOnInit(){let{init:n}=await import("@namiruai/chat"),s={agentId:this.agentId,onLeadCapture:t=>this.leadCapture.emit(t),onFeedback:t=>this.feedback.emit(t),onSessionStart:t=>this.sessionStart.emit(t),onSessionEnd:t=>this.sessionEnd.emit(t)};this.instance=n(s)}ngOnChanges(n){this.instance&&n.agentId&&!n.agentId.firstChange&&(this.instance.destroy(),this.ngOnInit())}ngOnDestroy(){this.instance?.destroy(),this.instance=null}};i([f()],e.prototype,"agentId",2),i([d()],e.prototype,"leadCapture",2),i([d()],e.prototype,"feedback",2),i([d()],e.prototype,"sessionStart",2),i([d()],e.prototype,"sessionEnd",2),i([p("container",{static:!0})],e.prototype,"containerRef",2),e=i([u({selector:"namiru-chat",standalone:!0,template:"<div #container></div>"})],e);export{e as NamiruChatComponent};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/namiru-chat.component.ts"],
4
- "sourcesContent": ["import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from \"@angular/core\";\nimport type {\n NamiruChatConfig,\n NamiruChatInstance,\n LeadCaptureData,\n PreChatCustomConfig,\n} from \"@namiruai/chat\";\n\n@Component({\n selector: \"namiru-chat\",\n standalone: true,\n template: `<div #container [style.width]=\"mode === 'inline' ? '100%' : ''\" [style.height]=\"mode === 'inline' ? '100%' : ''\"></div>`,\n})\nexport class NamiruChatComponent implements OnInit, OnDestroy, OnChanges {\n @Input() agentId!: string;\n @Input() serverUrl?: string;\n @Input() mode?: \"button\" | \"inline\";\n @Input() position?: \"bottom-left\" | \"bottom-right\";\n @Input() preChatEnabled?: boolean;\n @Input() preChatTemplate?:\n | \"ecommerce\"\n | \"saas\"\n | \"services\"\n | \"custom\"\n | null;\n @Input() preChatCustom?: PreChatCustomConfig;\n @Input() greetingDelay?: number;\n @Input() width?: string;\n @Input() height?: string;\n\n @Output() leadCapture = new EventEmitter<LeadCaptureData>();\n @Output() feedback = new EventEmitter<\"up\" | \"down\">();\n @Output() sessionStart = new EventEmitter<string>();\n @Output() sessionEnd = new EventEmitter<string>();\n\n @ViewChild(\"container\", { static: true }) containerRef!: ElementRef;\n\n private instance: NamiruChatInstance | null = null;\n\n async ngOnInit(): Promise<void> {\n const { init } = await import(\"@namiruai/chat\");\n\n const config: NamiruChatConfig = {\n agentId: this.agentId,\n serverUrl: this.serverUrl,\n mode: this.mode,\n position: this.position,\n container:\n this.mode === \"inline\" ? this.containerRef.nativeElement : undefined,\n preChatEnabled: this.preChatEnabled,\n preChatTemplate: this.preChatTemplate,\n preChatCustom: this.preChatCustom,\n greetingDelay: this.greetingDelay,\n width: this.width,\n height: this.height,\n onLeadCapture: (lead) => this.leadCapture.emit(lead),\n onFeedback: (rating) => this.feedback.emit(rating),\n onSessionStart: (id) => this.sessionStart.emit(id),\n onSessionEnd: (id) => this.sessionEnd.emit(id),\n };\n\n this.instance = init(config);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.instance) return;\n\n // agentId change requires full re-init\n if (changes[\"agentId\"] && !changes[\"agentId\"].firstChange) {\n this.instance.destroy();\n this.ngOnInit();\n return;\n }\n\n this.instance.updateConfig({\n serverUrl: this.serverUrl,\n mode: this.mode,\n position: this.position,\n preChatEnabled: this.preChatEnabled,\n preChatTemplate: this.preChatTemplate,\n preChatCustom: this.preChatCustom,\n greetingDelay: this.greetingDelay,\n width: this.width,\n height: this.height,\n });\n }\n\n ngOnDestroy(): void {\n this.instance?.destroy();\n this.instance = null;\n }\n}\n"],
5
- "mappings": "wMAAA,OACE,aAAAA,EAEA,gBAAAC,EACA,SAAAC,EAIA,UAAAC,EAEA,aAAAC,MACK,gBAaA,IAAMC,EAAN,KAAkE,CAAlE,cAiBK,iBAAc,IAAIC,EAClB,cAAW,IAAIA,EACf,kBAAe,IAAIA,EACnB,gBAAa,IAAIA,EAI3B,KAAQ,SAAsC,KAE9C,MAAM,UAA0B,CAC9B,GAAM,CAAE,KAAAC,CAAK,EAAI,KAAM,QAAO,gBAAgB,EAExCC,EAA2B,CAC/B,QAAS,KAAK,QACd,UAAW,KAAK,UAChB,KAAM,KAAK,KACX,SAAU,KAAK,SACf,UACE,KAAK,OAAS,SAAW,KAAK,aAAa,cAAgB,OAC7D,eAAgB,KAAK,eACrB,gBAAiB,KAAK,gBACtB,cAAe,KAAK,cACpB,cAAe,KAAK,cACpB,MAAO,KAAK,MACZ,OAAQ,KAAK,OACb,cAAgBC,GAAS,KAAK,YAAY,KAAKA,CAAI,EACnD,WAAaC,GAAW,KAAK,SAAS,KAAKA,CAAM,EACjD,eAAiBC,GAAO,KAAK,aAAa,KAAKA,CAAE,EACjD,aAAeA,GAAO,KAAK,WAAW,KAAKA,CAAE,CAC/C,EAEA,KAAK,SAAWJ,EAAKC,CAAM,CAC7B,CAEA,YAAYI,EAA8B,CACxC,GAAK,KAAK,SAGV,IAAIA,EAAQ,SAAc,CAACA,EAAQ,QAAW,YAAa,CACzD,KAAK,SAAS,QAAQ,EACtB,KAAK,SAAS,EACd,MACF,CAEA,KAAK,SAAS,aAAa,CACzB,UAAW,KAAK,UAChB,KAAM,KAAK,KACX,SAAU,KAAK,SACf,eAAgB,KAAK,eACrB,gBAAiB,KAAK,gBACtB,cAAe,KAAK,cACpB,cAAe,KAAK,cACpB,MAAO,KAAK,MACZ,OAAQ,KAAK,MACf,CAAC,EACH,CAEA,aAAoB,CAClB,KAAK,UAAU,QAAQ,EACvB,KAAK,SAAW,IAClB,CACF,EA7EWC,EAAA,CAARC,EAAM,GADIT,EACF,uBACAQ,EAAA,CAARC,EAAM,GAFIT,EAEF,yBACAQ,EAAA,CAARC,EAAM,GAHIT,EAGF,oBACAQ,EAAA,CAARC,EAAM,GAJIT,EAIF,wBACAQ,EAAA,CAARC,EAAM,GALIT,EAKF,8BACAQ,EAAA,CAARC,EAAM,GANIT,EAMF,+BAMAQ,EAAA,CAARC,EAAM,GAZIT,EAYF,6BACAQ,EAAA,CAARC,EAAM,GAbIT,EAaF,6BACAQ,EAAA,CAARC,EAAM,GAdIT,EAcF,qBACAQ,EAAA,CAARC,EAAM,GAfIT,EAeF,sBAECQ,EAAA,CAATE,EAAO,GAjBGV,EAiBD,2BACAQ,EAAA,CAATE,EAAO,GAlBGV,EAkBD,wBACAQ,EAAA,CAATE,EAAO,GAnBGV,EAmBD,4BACAQ,EAAA,CAATE,EAAO,GApBGV,EAoBD,0BAEgCQ,EAAA,CAAzCG,EAAU,YAAa,CAAE,OAAQ,EAAK,CAAC,GAtB7BX,EAsB+B,4BAtB/BA,EAANQ,EAAA,CALNI,EAAU,CACT,SAAU,cACV,WAAY,GACZ,SAAU,yHACZ,CAAC,GACYZ",
4
+ "sourcesContent": ["import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from \"@angular/core\";\nimport type {\n NamiruChatConfig,\n NamiruChatInstance,\n LeadCaptureData,\n} from \"@namiruai/chat\";\n\n@Component({\n selector: \"namiru-chat\",\n standalone: true,\n template: `<div #container></div>`,\n})\nexport class NamiruChatComponent implements OnInit, OnDestroy, OnChanges {\n @Input() agentId!: string;\n\n @Output() leadCapture = new EventEmitter<LeadCaptureData>();\n @Output() feedback = new EventEmitter<\"up\" | \"down\">();\n @Output() sessionStart = new EventEmitter<string>();\n @Output() sessionEnd = new EventEmitter<string>();\n\n @ViewChild(\"container\", { static: true }) containerRef!: ElementRef;\n\n private instance: NamiruChatInstance | null = null;\n\n async ngOnInit(): Promise<void> {\n const { init } = await import(\"@namiruai/chat\");\n\n const config: NamiruChatConfig = {\n agentId: this.agentId,\n onLeadCapture: (lead) => this.leadCapture.emit(lead),\n onFeedback: (rating) => this.feedback.emit(rating),\n onSessionStart: (id) => this.sessionStart.emit(id),\n onSessionEnd: (id) => this.sessionEnd.emit(id),\n };\n\n this.instance = init(config);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.instance) return;\n\n // agentId change requires full re-init\n if (changes[\"agentId\"] && !changes[\"agentId\"].firstChange) {\n this.instance.destroy();\n this.ngOnInit();\n }\n }\n\n ngOnDestroy(): void {\n this.instance?.destroy();\n this.instance = null;\n }\n}\n"],
5
+ "mappings": "wMAAA,OACE,aAAAA,EAEA,gBAAAC,EACA,SAAAC,EAIA,UAAAC,EAEA,aAAAC,MACK,gBAYA,IAAMC,EAAN,KAAkE,CAAlE,cAGK,iBAAc,IAAIC,EAClB,cAAW,IAAIA,EACf,kBAAe,IAAIA,EACnB,gBAAa,IAAIA,EAI3B,KAAQ,SAAsC,KAE9C,MAAM,UAA0B,CAC9B,GAAM,CAAE,KAAAC,CAAK,EAAI,KAAM,QAAO,gBAAgB,EAExCC,EAA2B,CAC/B,QAAS,KAAK,QACd,cAAgBC,GAAS,KAAK,YAAY,KAAKA,CAAI,EACnD,WAAaC,GAAW,KAAK,SAAS,KAAKA,CAAM,EACjD,eAAiBC,GAAO,KAAK,aAAa,KAAKA,CAAE,EACjD,aAAeA,GAAO,KAAK,WAAW,KAAKA,CAAE,CAC/C,EAEA,KAAK,SAAWJ,EAAKC,CAAM,CAC7B,CAEA,YAAYI,EAA8B,CACnC,KAAK,UAGNA,EAAQ,SAAc,CAACA,EAAQ,QAAW,cAC5C,KAAK,SAAS,QAAQ,EACtB,KAAK,SAAS,EAElB,CAEA,aAAoB,CAClB,KAAK,UAAU,QAAQ,EACvB,KAAK,SAAW,IAClB,CACF,EAvCWC,EAAA,CAARC,EAAM,GADIT,EACF,uBAECQ,EAAA,CAATE,EAAO,GAHGV,EAGD,2BACAQ,EAAA,CAATE,EAAO,GAJGV,EAID,wBACAQ,EAAA,CAATE,EAAO,GALGV,EAKD,4BACAQ,EAAA,CAATE,EAAO,GANGV,EAMD,0BAEgCQ,EAAA,CAAzCG,EAAU,YAAa,CAAE,OAAQ,EAAK,CAAC,GAR7BX,EAQ+B,4BAR/BA,EAANQ,EAAA,CALNI,EAAU,CACT,SAAU,cACV,WAAY,GACZ,SAAU,wBACZ,CAAC,GACYZ",
6
6
  "names": ["Component", "EventEmitter", "Input", "Output", "ViewChild", "NamiruChatComponent", "EventEmitter", "init", "config", "lead", "rating", "id", "changes", "__decorateClass", "Input", "Output", "ViewChild", "Component"]
7
7
  }
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.create;var d=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var C=(s,t)=>{for(var r in t)d(s,r,{get:t[r],enumerable:!0})},p=(s,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of m(t))!u.call(s,h)&&h!==r&&d(s,h,{get:()=>t[h],enumerable:!(a=g(t,h))||a.enumerable});return s};var y=(s,t,r)=>(r=s!=null?c(f(s)):{},p(t||!s||!s.__esModule?d(r,"default",{value:s,enumerable:!0}):r,s)),v=s=>p(d({},"__esModule",{value:!0}),s),n=(s,t,r,a)=>{for(var h=a>1?void 0:a?g(t,r):t,l=s.length-1,o;l>=0;l--)(o=s[l])&&(h=(a?o(t,r,h):o(h))||h);return a&&h&&d(t,r,h),h};var b={};C(b,{NamiruChatComponent:()=>i});module.exports=v(b);var e=require("@angular/core");var i=class{constructor(){this.leadCapture=new e.EventEmitter;this.feedback=new e.EventEmitter;this.sessionStart=new e.EventEmitter;this.sessionEnd=new e.EventEmitter;this.instance=null}async ngOnInit(){let{init:t}=await import("@namiruai/chat"),r={agentId:this.agentId,serverUrl:this.serverUrl,mode:this.mode,position:this.position,container:this.mode==="inline"?this.containerRef.nativeElement:void 0,preChatEnabled:this.preChatEnabled,preChatTemplate:this.preChatTemplate,preChatCustom:this.preChatCustom,greetingDelay:this.greetingDelay,width:this.width,height:this.height,onLeadCapture:a=>this.leadCapture.emit(a),onFeedback:a=>this.feedback.emit(a),onSessionStart:a=>this.sessionStart.emit(a),onSessionEnd:a=>this.sessionEnd.emit(a)};this.instance=t(r)}ngOnChanges(t){if(this.instance){if(t.agentId&&!t.agentId.firstChange){this.instance.destroy(),this.ngOnInit();return}this.instance.updateConfig({serverUrl:this.serverUrl,mode:this.mode,position:this.position,preChatEnabled:this.preChatEnabled,preChatTemplate:this.preChatTemplate,preChatCustom:this.preChatCustom,greetingDelay:this.greetingDelay,width:this.width,height:this.height})}}ngOnDestroy(){this.instance?.destroy(),this.instance=null}};n([(0,e.Input)()],i.prototype,"agentId",2),n([(0,e.Input)()],i.prototype,"serverUrl",2),n([(0,e.Input)()],i.prototype,"mode",2),n([(0,e.Input)()],i.prototype,"position",2),n([(0,e.Input)()],i.prototype,"preChatEnabled",2),n([(0,e.Input)()],i.prototype,"preChatTemplate",2),n([(0,e.Input)()],i.prototype,"preChatCustom",2),n([(0,e.Input)()],i.prototype,"greetingDelay",2),n([(0,e.Input)()],i.prototype,"width",2),n([(0,e.Input)()],i.prototype,"height",2),n([(0,e.Output)()],i.prototype,"leadCapture",2),n([(0,e.Output)()],i.prototype,"feedback",2),n([(0,e.Output)()],i.prototype,"sessionStart",2),n([(0,e.Output)()],i.prototype,"sessionEnd",2),n([(0,e.ViewChild)("container",{static:!0})],i.prototype,"containerRef",2),i=n([(0,e.Component)({selector:"namiru-chat",standalone:!0,template:`<div #container [style.width]="mode === 'inline' ? '100%' : ''" [style.height]="mode === 'inline' ? '100%' : ''"></div>`})],i);
1
+ "use strict";var u=Object.create;var o=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var a in t)o(e,a,{get:t[a],enumerable:!0})},l=(e,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of f(t))!m.call(e,s)&&s!==a&&o(e,s,{get:()=>t[s],enumerable:!(i=h(t,s))||i.enumerable});return e};var O=(e,t,a)=>(a=e!=null?u(p(e)):{},l(t||!e||!e.__esModule?o(a,"default",{value:e,enumerable:!0}):a,e)),y=e=>l(o({},"__esModule",{value:!0}),e),d=(e,t,a,i)=>{for(var s=i>1?void 0:i?h(t,a):t,c=e.length-1,g;c>=0;c--)(g=e[c])&&(s=(i?g(t,a,s):g(s))||s);return i&&s&&o(t,a,s),s};var v={};I(v,{NamiruChatComponent:()=>r});module.exports=y(v);var n=require("@angular/core");var r=class{constructor(){this.leadCapture=new n.EventEmitter;this.feedback=new n.EventEmitter;this.sessionStart=new n.EventEmitter;this.sessionEnd=new n.EventEmitter;this.instance=null}async ngOnInit(){let{init:t}=await import("@namiruai/chat"),a={agentId:this.agentId,onLeadCapture:i=>this.leadCapture.emit(i),onFeedback:i=>this.feedback.emit(i),onSessionStart:i=>this.sessionStart.emit(i),onSessionEnd:i=>this.sessionEnd.emit(i)};this.instance=t(a)}ngOnChanges(t){this.instance&&t.agentId&&!t.agentId.firstChange&&(this.instance.destroy(),this.ngOnInit())}ngOnDestroy(){this.instance?.destroy(),this.instance=null}};d([(0,n.Input)()],r.prototype,"agentId",2),d([(0,n.Output)()],r.prototype,"leadCapture",2),d([(0,n.Output)()],r.prototype,"feedback",2),d([(0,n.Output)()],r.prototype,"sessionStart",2),d([(0,n.Output)()],r.prototype,"sessionEnd",2),d([(0,n.ViewChild)("container",{static:!0})],r.prototype,"containerRef",2),r=d([(0,n.Component)({selector:"namiru-chat",standalone:!0,template:"<div #container></div>"})],r);
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/namiru-chat.component.ts"],
4
- "sourcesContent": ["export { NamiruChatComponent } from \"./namiru-chat.component\";\nexport type { NamiruChatConfig, NamiruChatInstance, LeadCaptureData } from \"@namiruai/chat\";\n", "import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from \"@angular/core\";\nimport type {\n NamiruChatConfig,\n NamiruChatInstance,\n LeadCaptureData,\n PreChatCustomConfig,\n} from \"@namiruai/chat\";\n\n@Component({\n selector: \"namiru-chat\",\n standalone: true,\n template: `<div #container [style.width]=\"mode === 'inline' ? '100%' : ''\" [style.height]=\"mode === 'inline' ? '100%' : ''\"></div>`,\n})\nexport class NamiruChatComponent implements OnInit, OnDestroy, OnChanges {\n @Input() agentId!: string;\n @Input() serverUrl?: string;\n @Input() mode?: \"button\" | \"inline\";\n @Input() position?: \"bottom-left\" | \"bottom-right\";\n @Input() preChatEnabled?: boolean;\n @Input() preChatTemplate?:\n | \"ecommerce\"\n | \"saas\"\n | \"services\"\n | \"custom\"\n | null;\n @Input() preChatCustom?: PreChatCustomConfig;\n @Input() greetingDelay?: number;\n @Input() width?: string;\n @Input() height?: string;\n\n @Output() leadCapture = new EventEmitter<LeadCaptureData>();\n @Output() feedback = new EventEmitter<\"up\" | \"down\">();\n @Output() sessionStart = new EventEmitter<string>();\n @Output() sessionEnd = new EventEmitter<string>();\n\n @ViewChild(\"container\", { static: true }) containerRef!: ElementRef;\n\n private instance: NamiruChatInstance | null = null;\n\n async ngOnInit(): Promise<void> {\n const { init } = await import(\"@namiruai/chat\");\n\n const config: NamiruChatConfig = {\n agentId: this.agentId,\n serverUrl: this.serverUrl,\n mode: this.mode,\n position: this.position,\n container:\n this.mode === \"inline\" ? this.containerRef.nativeElement : undefined,\n preChatEnabled: this.preChatEnabled,\n preChatTemplate: this.preChatTemplate,\n preChatCustom: this.preChatCustom,\n greetingDelay: this.greetingDelay,\n width: this.width,\n height: this.height,\n onLeadCapture: (lead) => this.leadCapture.emit(lead),\n onFeedback: (rating) => this.feedback.emit(rating),\n onSessionStart: (id) => this.sessionStart.emit(id),\n onSessionEnd: (id) => this.sessionEnd.emit(id),\n };\n\n this.instance = init(config);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.instance) return;\n\n // agentId change requires full re-init\n if (changes[\"agentId\"] && !changes[\"agentId\"].firstChange) {\n this.instance.destroy();\n this.ngOnInit();\n return;\n }\n\n this.instance.updateConfig({\n serverUrl: this.serverUrl,\n mode: this.mode,\n position: this.position,\n preChatEnabled: this.preChatEnabled,\n preChatTemplate: this.preChatTemplate,\n preChatCustom: this.preChatCustom,\n greetingDelay: this.greetingDelay,\n width: this.width,\n height: this.height,\n });\n }\n\n ngOnDestroy(): void {\n this.instance?.destroy();\n this.instance = null;\n }\n}\n"],
5
- "mappings": "4rBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GCAA,IAAAI,EAWO,yBAaA,IAAMC,EAAN,KAAkE,CAAlE,cAiBK,iBAAc,IAAI,eAClB,cAAW,IAAI,eACf,kBAAe,IAAI,eACnB,gBAAa,IAAI,eAI3B,KAAQ,SAAsC,KAE9C,MAAM,UAA0B,CAC9B,GAAM,CAAE,KAAAC,CAAK,EAAI,KAAM,QAAO,gBAAgB,EAExCC,EAA2B,CAC/B,QAAS,KAAK,QACd,UAAW,KAAK,UAChB,KAAM,KAAK,KACX,SAAU,KAAK,SACf,UACE,KAAK,OAAS,SAAW,KAAK,aAAa,cAAgB,OAC7D,eAAgB,KAAK,eACrB,gBAAiB,KAAK,gBACtB,cAAe,KAAK,cACpB,cAAe,KAAK,cACpB,MAAO,KAAK,MACZ,OAAQ,KAAK,OACb,cAAgBC,GAAS,KAAK,YAAY,KAAKA,CAAI,EACnD,WAAaC,GAAW,KAAK,SAAS,KAAKA,CAAM,EACjD,eAAiBC,GAAO,KAAK,aAAa,KAAKA,CAAE,EACjD,aAAeA,GAAO,KAAK,WAAW,KAAKA,CAAE,CAC/C,EAEA,KAAK,SAAWJ,EAAKC,CAAM,CAC7B,CAEA,YAAYI,EAA8B,CACxC,GAAK,KAAK,SAGV,IAAIA,EAAQ,SAAc,CAACA,EAAQ,QAAW,YAAa,CACzD,KAAK,SAAS,QAAQ,EACtB,KAAK,SAAS,EACd,MACF,CAEA,KAAK,SAAS,aAAa,CACzB,UAAW,KAAK,UAChB,KAAM,KAAK,KACX,SAAU,KAAK,SACf,eAAgB,KAAK,eACrB,gBAAiB,KAAK,gBACtB,cAAe,KAAK,cACpB,cAAe,KAAK,cACpB,MAAO,KAAK,MACZ,OAAQ,KAAK,MACf,CAAC,EACH,CAEA,aAAoB,CAClB,KAAK,UAAU,QAAQ,EACvB,KAAK,SAAW,IAClB,CACF,EA7EWC,EAAA,IAAR,SAAM,GADIP,EACF,uBACAO,EAAA,IAAR,SAAM,GAFIP,EAEF,yBACAO,EAAA,IAAR,SAAM,GAHIP,EAGF,oBACAO,EAAA,IAAR,SAAM,GAJIP,EAIF,wBACAO,EAAA,IAAR,SAAM,GALIP,EAKF,8BACAO,EAAA,IAAR,SAAM,GANIP,EAMF,+BAMAO,EAAA,IAAR,SAAM,GAZIP,EAYF,6BACAO,EAAA,IAAR,SAAM,GAbIP,EAaF,6BACAO,EAAA,IAAR,SAAM,GAdIP,EAcF,qBACAO,EAAA,IAAR,SAAM,GAfIP,EAeF,sBAECO,EAAA,IAAT,UAAO,GAjBGP,EAiBD,2BACAO,EAAA,IAAT,UAAO,GAlBGP,EAkBD,wBACAO,EAAA,IAAT,UAAO,GAnBGP,EAmBD,4BACAO,EAAA,IAAT,UAAO,GApBGP,EAoBD,0BAEgCO,EAAA,IAAzC,aAAU,YAAa,CAAE,OAAQ,EAAK,CAAC,GAtB7BP,EAsB+B,4BAtB/BA,EAANO,EAAA,IALN,aAAU,CACT,SAAU,cACV,WAAY,GACZ,SAAU,yHACZ,CAAC,GACYP",
4
+ "sourcesContent": ["export { NamiruChatComponent } from \"./namiru-chat.component\";\nexport type { NamiruChatConfig, NamiruChatInstance, LeadCaptureData } from \"@namiruai/chat\";\n", "import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from \"@angular/core\";\nimport type {\n NamiruChatConfig,\n NamiruChatInstance,\n LeadCaptureData,\n} from \"@namiruai/chat\";\n\n@Component({\n selector: \"namiru-chat\",\n standalone: true,\n template: `<div #container></div>`,\n})\nexport class NamiruChatComponent implements OnInit, OnDestroy, OnChanges {\n @Input() agentId!: string;\n\n @Output() leadCapture = new EventEmitter<LeadCaptureData>();\n @Output() feedback = new EventEmitter<\"up\" | \"down\">();\n @Output() sessionStart = new EventEmitter<string>();\n @Output() sessionEnd = new EventEmitter<string>();\n\n @ViewChild(\"container\", { static: true }) containerRef!: ElementRef;\n\n private instance: NamiruChatInstance | null = null;\n\n async ngOnInit(): Promise<void> {\n const { init } = await import(\"@namiruai/chat\");\n\n const config: NamiruChatConfig = {\n agentId: this.agentId,\n onLeadCapture: (lead) => this.leadCapture.emit(lead),\n onFeedback: (rating) => this.feedback.emit(rating),\n onSessionStart: (id) => this.sessionStart.emit(id),\n onSessionEnd: (id) => this.sessionEnd.emit(id),\n };\n\n this.instance = init(config);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.instance) return;\n\n // agentId change requires full re-init\n if (changes[\"agentId\"] && !changes[\"agentId\"].firstChange) {\n this.instance.destroy();\n this.ngOnInit();\n }\n }\n\n ngOnDestroy(): void {\n this.instance?.destroy();\n this.instance = null;\n }\n}\n"],
5
+ "mappings": "4rBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GCAA,IAAAI,EAWO,yBAYA,IAAMC,EAAN,KAAkE,CAAlE,cAGK,iBAAc,IAAI,eAClB,cAAW,IAAI,eACf,kBAAe,IAAI,eACnB,gBAAa,IAAI,eAI3B,KAAQ,SAAsC,KAE9C,MAAM,UAA0B,CAC9B,GAAM,CAAE,KAAAC,CAAK,EAAI,KAAM,QAAO,gBAAgB,EAExCC,EAA2B,CAC/B,QAAS,KAAK,QACd,cAAgBC,GAAS,KAAK,YAAY,KAAKA,CAAI,EACnD,WAAaC,GAAW,KAAK,SAAS,KAAKA,CAAM,EACjD,eAAiBC,GAAO,KAAK,aAAa,KAAKA,CAAE,EACjD,aAAeA,GAAO,KAAK,WAAW,KAAKA,CAAE,CAC/C,EAEA,KAAK,SAAWJ,EAAKC,CAAM,CAC7B,CAEA,YAAYI,EAA8B,CACnC,KAAK,UAGNA,EAAQ,SAAc,CAACA,EAAQ,QAAW,cAC5C,KAAK,SAAS,QAAQ,EACtB,KAAK,SAAS,EAElB,CAEA,aAAoB,CAClB,KAAK,UAAU,QAAQ,EACvB,KAAK,SAAW,IAClB,CACF,EAvCWC,EAAA,IAAR,SAAM,GADIP,EACF,uBAECO,EAAA,IAAT,UAAO,GAHGP,EAGD,2BACAO,EAAA,IAAT,UAAO,GAJGP,EAID,wBACAO,EAAA,IAAT,UAAO,GALGP,EAKD,4BACAO,EAAA,IAAT,UAAO,GANGP,EAMD,0BAEgCO,EAAA,IAAzC,aAAU,YAAa,CAAE,OAAQ,EAAK,CAAC,GAR7BP,EAQ+B,4BAR/BA,EAANO,EAAA,IALN,aAAU,CACT,SAAU,cACV,WAAY,GACZ,SAAU,wBACZ,CAAC,GACYP",
6
6
  "names": ["src_exports", "__export", "NamiruChatComponent", "__toCommonJS", "import_core", "NamiruChatComponent", "init", "config", "lead", "rating", "id", "changes", "__decorateClass"]
7
7
  }
@@ -1,16 +1,7 @@
1
1
  import { ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core";
2
- import type { LeadCaptureData, PreChatCustomConfig } from "@namiruai/chat";
2
+ import type { LeadCaptureData } from "@namiruai/chat";
3
3
  export declare class NamiruChatComponent implements OnInit, OnDestroy, OnChanges {
4
4
  agentId: string;
5
- serverUrl?: string;
6
- mode?: "button" | "inline";
7
- position?: "bottom-left" | "bottom-right";
8
- preChatEnabled?: boolean;
9
- preChatTemplate?: "ecommerce" | "saas" | "services" | "custom" | null;
10
- preChatCustom?: PreChatCustomConfig;
11
- greetingDelay?: number;
12
- width?: string;
13
- height?: string;
14
5
  leadCapture: EventEmitter<LeadCaptureData>;
15
6
  feedback: EventEmitter<"up" | "down">;
16
7
  sessionStart: EventEmitter<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namiruai/angular",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Angular wrapper for Namiru AI chat widget",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -12,7 +12,11 @@
12
12
  "types": "./dist/index.d.ts"
13
13
  }
14
14
  },
15
- "files": ["dist", "LICENSE", "README.md"],
15
+ "files": [
16
+ "dist",
17
+ "LICENSE",
18
+ "README.md"
19
+ ],
16
20
  "sideEffects": false,
17
21
  "license": "MIT",
18
22
  "author": "Namiru <hello@namiru.ai>",
@@ -21,7 +25,15 @@
21
25
  "type": "git",
22
26
  "url": "https://github.com/namiru-ai/namiru"
23
27
  },
24
- "keywords": ["angular", "chat", "widget", "ai", "customer-support", "chatbot", "namiru"],
28
+ "keywords": [
29
+ "angular",
30
+ "chat",
31
+ "widget",
32
+ "ai",
33
+ "customer-support",
34
+ "chatbot",
35
+ "namiru"
36
+ ],
25
37
  "scripts": {
26
38
  "build": "node build.js",
27
39
  "dev": "node build.js --watch"