@namiruai/angular 1.2.0 → 1.4.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/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # @namiru/angular
1
+ # @namiruai/angular
2
2
 
3
3
  Angular wrapper for the [Namiru.ai](https://namiru.ai) chat widget -- add AI customer support to your Angular app.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @namiru/angular
8
+ npm install @namiruai/angular
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -15,7 +15,7 @@ npm install @namiru/angular
15
15
  `NamiruChatComponent` is a standalone component -- import it directly in your module or component:
16
16
 
17
17
  ```typescript
18
- import { NamiruChatComponent } from '@namiru/angular';
18
+ import { NamiruChatComponent } from '@namiruai/angular';
19
19
 
20
20
  @Component({
21
21
  standalone: true,
@@ -53,7 +53,6 @@ export class AppComponent {
53
53
  | Input | Type | Description |
54
54
  |-------|------|-------------|
55
55
  | `agentId` | `string` | **Required.** Your Namiru agent ID. |
56
- | `serverUrl` | `string` | Custom server URL (defaults to Namiru cloud). |
57
56
  | `mode` | `'button' \| 'inline'` | Display mode. Default: `'button'`. |
58
57
  | `position` | `'bottom-left' \| 'bottom-right'` | Button position. Default: `'bottom-right'`. |
59
58
  | `width` | `string` | Width for inline mode. |
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
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};
1
+ var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var e=(o,n,a,i)=>{for(var s=i>1?void 0:i?f(n,a):n,g=o.length-1,l;g>=0;g--)(l=o[g])&&(s=(i?l(n,a,s):l(s))||s);return i&&s&&c(n,a,s),s};import{Component as u,EventEmitter as d,Input as h,Output as r,ViewChild as p}from"@angular/core";var t=class{constructor(){this.leadCapture=new d;this.feedback=new d;this.sessionStart=new d;this.sessionEnd=new d;this.instance=null}async ngOnInit(){let{init:n}=await import("@namiruai/chat"),a={agentId:this.agentId,...this.mode&&{mode:this.mode},...this.position&&{position:this.position},...this.width&&{width:this.width},...this.height&&{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(a)}ngOnChanges(n){this.instance&&n.agentId&&!n.agentId.firstChange&&(this.instance.destroy(),this.ngOnInit())}ngOnDestroy(){this.instance?.destroy(),this.instance=null}};e([h()],t.prototype,"agentId",2),e([h()],t.prototype,"mode",2),e([h()],t.prototype,"position",2),e([h()],t.prototype,"width",2),e([h()],t.prototype,"height",2),e([r()],t.prototype,"leadCapture",2),e([r()],t.prototype,"feedback",2),e([r()],t.prototype,"sessionStart",2),e([r()],t.prototype,"sessionEnd",2),e([p("container",{static:!0})],t.prototype,"containerRef",2),t=e([u({selector:"namiru-chat",standalone:!0,template:`<div #container [style.width]="mode === 'inline' ? width : null" [style.height]="mode === 'inline' ? height : null"></div>`})],t);export{t 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} 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",
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 [style.width]=\"mode === 'inline' ? width : null\" [style.height]=\"mode === 'inline' ? height : null\"></div>`,\n})\nexport class NamiruChatComponent implements OnInit, OnDestroy, OnChanges {\n @Input() agentId!: string;\n @Input() mode?: \"button\" | \"inline\";\n @Input() position?: \"bottom-right\" | \"bottom-left\";\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 ...(this.mode && { mode: this.mode }),\n ...(this.position && { position: this.position }),\n ...(this.width && { width: this.width }),\n ...(this.height && { 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 }\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,cAOK,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,GAAI,KAAK,MAAQ,CAAE,KAAM,KAAK,IAAK,EACnC,GAAI,KAAK,UAAY,CAAE,SAAU,KAAK,QAAS,EAC/C,GAAI,KAAK,OAAS,CAAE,MAAO,KAAK,KAAM,EACtC,GAAI,KAAK,QAAU,CAAE,OAAQ,KAAK,MAAO,EACzC,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,EA/CWC,EAAA,CAARC,EAAM,GADIT,EACF,uBACAQ,EAAA,CAARC,EAAM,GAFIT,EAEF,oBACAQ,EAAA,CAARC,EAAM,GAHIT,EAGF,wBACAQ,EAAA,CAARC,EAAM,GAJIT,EAIF,qBACAQ,EAAA,CAARC,EAAM,GALIT,EAKF,sBAECQ,EAAA,CAATE,EAAO,GAPGV,EAOD,2BACAQ,EAAA,CAATE,EAAO,GARGV,EAQD,wBACAQ,EAAA,CAATE,EAAO,GATGV,EASD,4BACAQ,EAAA,CAATE,EAAO,GAVGV,EAUD,0BAEgCQ,EAAA,CAAzCG,EAAU,YAAa,CAAE,OAAQ,EAAK,CAAC,GAZ7BX,EAY+B,4BAZ/BA,EAANQ,EAAA,CALNI,EAAU,CACT,SAAU,cACV,WAAY,GACZ,SAAU,4HACZ,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 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);
1
+ "use strict";var f=Object.create;var r=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var a in t)r(e,a,{get:t[a],enumerable:!0})},c=(e,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of u(t))!m.call(e,h)&&h!==a&&r(e,h,{get:()=>t[h],enumerable:!(s=l(t,h))||s.enumerable});return e};var I=(e,t,a)=>(a=e!=null?f(p(e)):{},c(t||!e||!e.__esModule?r(a,"default",{value:e,enumerable:!0}):a,e)),O=e=>c(r({},"__esModule",{value:!0}),e),d=(e,t,a,s)=>{for(var h=s>1?void 0:s?l(t,a):t,o=e.length-1,g;o>=0;o--)(g=e[o])&&(h=(s?g(t,a,h):g(h))||h);return s&&h&&r(t,a,h),h};var y={};w(y,{NamiruChatComponent:()=>n});module.exports=O(y);var i=require("@angular/core");var n=class{constructor(){this.leadCapture=new i.EventEmitter;this.feedback=new i.EventEmitter;this.sessionStart=new i.EventEmitter;this.sessionEnd=new i.EventEmitter;this.instance=null}async ngOnInit(){let{init:t}=await import("@namiruai/chat"),a={agentId:this.agentId,...this.mode&&{mode:this.mode},...this.position&&{position:this.position},...this.width&&{width:this.width},...this.height&&{height:this.height},onLeadCapture:s=>this.leadCapture.emit(s),onFeedback:s=>this.feedback.emit(s),onSessionStart:s=>this.sessionStart.emit(s),onSessionEnd:s=>this.sessionEnd.emit(s)};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,i.Input)()],n.prototype,"agentId",2),d([(0,i.Input)()],n.prototype,"mode",2),d([(0,i.Input)()],n.prototype,"position",2),d([(0,i.Input)()],n.prototype,"width",2),d([(0,i.Input)()],n.prototype,"height",2),d([(0,i.Output)()],n.prototype,"leadCapture",2),d([(0,i.Output)()],n.prototype,"feedback",2),d([(0,i.Output)()],n.prototype,"sessionStart",2),d([(0,i.Output)()],n.prototype,"sessionEnd",2),d([(0,i.ViewChild)("container",{static:!0})],n.prototype,"containerRef",2),n=d([(0,i.Component)({selector:"namiru-chat",standalone:!0,template:`<div #container [style.width]="mode === 'inline' ? width : null" [style.height]="mode === 'inline' ? height : null"></div>`})],n);
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} 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",
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 [style.width]=\"mode === 'inline' ? width : null\" [style.height]=\"mode === 'inline' ? height : null\"></div>`,\n})\nexport class NamiruChatComponent implements OnInit, OnDestroy, OnChanges {\n @Input() agentId!: string;\n @Input() mode?: \"button\" | \"inline\";\n @Input() position?: \"bottom-right\" | \"bottom-left\";\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 ...(this.mode && { mode: this.mode }),\n ...(this.position && { position: this.position }),\n ...(this.width && { width: this.width }),\n ...(this.height && { 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 }\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,cAOK,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,GAAI,KAAK,MAAQ,CAAE,KAAM,KAAK,IAAK,EACnC,GAAI,KAAK,UAAY,CAAE,SAAU,KAAK,QAAS,EAC/C,GAAI,KAAK,OAAS,CAAE,MAAO,KAAK,KAAM,EACtC,GAAI,KAAK,QAAU,CAAE,OAAQ,KAAK,MAAO,EACzC,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,EA/CWC,EAAA,IAAR,SAAM,GADIP,EACF,uBACAO,EAAA,IAAR,SAAM,GAFIP,EAEF,oBACAO,EAAA,IAAR,SAAM,GAHIP,EAGF,wBACAO,EAAA,IAAR,SAAM,GAJIP,EAIF,qBACAO,EAAA,IAAR,SAAM,GALIP,EAKF,sBAECO,EAAA,IAAT,UAAO,GAPGP,EAOD,2BACAO,EAAA,IAAT,UAAO,GARGP,EAQD,wBACAO,EAAA,IAAT,UAAO,GATGP,EASD,4BACAO,EAAA,IAAT,UAAO,GAVGP,EAUD,0BAEgCO,EAAA,IAAzC,aAAU,YAAa,CAAE,OAAQ,EAAK,CAAC,GAZ7BP,EAY+B,4BAZ/BA,EAANO,EAAA,IALN,aAAU,CACT,SAAU,cACV,WAAY,GACZ,SAAU,4HACZ,CAAC,GACYP",
6
6
  "names": ["src_exports", "__export", "NamiruChatComponent", "__toCommonJS", "import_core", "NamiruChatComponent", "init", "config", "lead", "rating", "id", "changes", "__decorateClass"]
7
7
  }
@@ -2,6 +2,10 @@ import { ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges }
2
2
  import type { LeadCaptureData } from "@namiruai/chat";
3
3
  export declare class NamiruChatComponent implements OnInit, OnDestroy, OnChanges {
4
4
  agentId: string;
5
+ mode?: "button" | "inline";
6
+ position?: "bottom-right" | "bottom-left";
7
+ width?: string;
8
+ height?: string;
5
9
  leadCapture: EventEmitter<LeadCaptureData>;
6
10
  feedback: EventEmitter<"up" | "down">;
7
11
  sessionStart: EventEmitter<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namiruai/angular",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Angular wrapper for Namiru AI chat widget",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",