@namiruai/angular 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Namiru.ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @namiru/angular
2
+
3
+ Angular wrapper for the [Namiru.ai](https://namiru.ai) chat widget -- add AI customer support to your Angular app.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @namiru/angular
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Import the Component
14
+
15
+ `NamiruChatComponent` is a standalone component -- import it directly in your module or component:
16
+
17
+ ```typescript
18
+ import { NamiruChatComponent } from '@namiru/angular';
19
+
20
+ @Component({
21
+ standalone: true,
22
+ imports: [NamiruChatComponent],
23
+ template: `
24
+ <namiru-chat
25
+ [agentId]="'your-agent-id'"
26
+ [position]="'bottom-right'"
27
+ (leadCapture)="onLeadCapture($event)"
28
+ />
29
+ `,
30
+ })
31
+ export class AppComponent {
32
+ onLeadCapture(lead: any) {
33
+ console.log('Lead captured:', lead);
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### Inline Mode
39
+
40
+ ```html
41
+ <div style="width: 400px; height: 600px">
42
+ <namiru-chat
43
+ [agentId]="'your-agent-id'"
44
+ [mode]="'inline'"
45
+ [width]="'100%'"
46
+ [height]="'100%'"
47
+ />
48
+ </div>
49
+ ```
50
+
51
+ ### Inputs
52
+
53
+ | Input | Type | Description |
54
+ |-------|------|-------------|
55
+ | `agentId` | `string` | **Required.** Your Namiru agent ID. |
56
+ | `serverUrl` | `string` | Custom server URL (defaults to Namiru cloud). |
57
+ | `mode` | `'button' \| 'inline'` | Display mode. Default: `'button'`. |
58
+ | `position` | `'bottom-left' \| 'bottom-right'` | Button position. Default: `'bottom-right'`. |
59
+ | `width` | `string` | Width for inline mode. |
60
+ | `height` | `string` | Height for inline mode. |
61
+
62
+ ### Outputs
63
+
64
+ | Output | Payload | Description |
65
+ |--------|---------|-------------|
66
+ | `leadCapture` | `LeadCaptureData` | Emitted when a lead is captured. |
67
+ | `feedback` | `'up' \| 'down'` | Emitted when user gives feedback. |
68
+ | `sessionStart` | `string` | Emitted with session ID when chat starts. |
69
+ | `sessionEnd` | `string` | Emitted with session ID when chat ends. |
70
+
71
+ ## Requirements
72
+
73
+ Angular 15 or higher.
74
+
75
+ ## Documentation
76
+
77
+ For full documentation, visit [namiru.ai](https://namiru.ai).
78
+
79
+ ## License
80
+
81
+ MIT
@@ -0,0 +1,2 @@
1
+ export { NamiruChatComponent } from "./namiru-chat.component";
2
+ export type { NamiruChatConfig, NamiruChatInstance, LeadCaptureData } from "@namiruai/chat";
@@ -0,0 +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};
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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",
6
+ "names": ["Component", "EventEmitter", "Input", "Output", "ViewChild", "NamiruChatComponent", "EventEmitter", "init", "config", "lead", "rating", "id", "changes", "__decorateClass", "Input", "Output", "ViewChild", "Component"]
7
+ }
package/dist/index.js ADDED
@@ -0,0 +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);
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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",
6
+ "names": ["src_exports", "__export", "NamiruChatComponent", "__toCommonJS", "import_core", "NamiruChatComponent", "init", "config", "lead", "rating", "id", "changes", "__decorateClass"]
7
+ }
@@ -0,0 +1,23 @@
1
+ import { ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core";
2
+ import type { LeadCaptureData, PreChatCustomConfig } from "@namiruai/chat";
3
+ export declare class NamiruChatComponent implements OnInit, OnDestroy, OnChanges {
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
+ leadCapture: EventEmitter<LeadCaptureData>;
15
+ feedback: EventEmitter<"up" | "down">;
16
+ sessionStart: EventEmitter<string>;
17
+ sessionEnd: EventEmitter<string>;
18
+ containerRef: ElementRef;
19
+ private instance;
20
+ ngOnInit(): Promise<void>;
21
+ ngOnChanges(changes: SimpleChanges): void;
22
+ ngOnDestroy(): void;
23
+ }
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@namiruai/angular",
3
+ "version": "1.0.0",
4
+ "description": "Angular wrapper for Namiru AI chat widget",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.esm.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.esm.js",
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": ["dist", "LICENSE", "README.md"],
16
+ "sideEffects": false,
17
+ "license": "MIT",
18
+ "author": "Namiru <hello@namiru.ai>",
19
+ "homepage": "https://namiru.ai",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/namiru-ai/namiru"
23
+ },
24
+ "keywords": ["angular", "chat", "widget", "ai", "customer-support", "chatbot", "namiru"],
25
+ "scripts": {
26
+ "build": "node build.js",
27
+ "dev": "node build.js --watch"
28
+ },
29
+ "peerDependencies": {
30
+ "@angular/core": ">=15.0.0",
31
+ "@angular/common": ">=15.0.0",
32
+ "@namiruai/chat": "^1.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "@angular/core": "^17.0.0",
36
+ "@angular/common": "^17.0.0",
37
+ "esbuild": "^0.20.0",
38
+ "rxjs": "^7.8.0",
39
+ "typescript": "^5.3.0",
40
+ "zone.js": "^0.14.0"
41
+ }
42
+ }