@namiruai/chat 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 +21 -0
- package/README.md +71 -0
- package/dist/core/api-client.d.ts +54 -0
- package/dist/core/env.d.ts +7 -0
- package/dist/core/inactivity-timer.d.ts +9 -0
- package/dist/core/markdown.d.ts +1 -0
- package/dist/core/pre-chat-templates.d.ts +3 -0
- package/dist/core/state-machine.d.ts +54 -0
- package/dist/core/types.d.ts +92 -0
- package/dist/core/websocket-client.d.ts +40 -0
- package/dist/index.d.ts +3 -0
- package/dist/namiru-chat.esm.js +1091 -0
- package/dist/namiru-chat.esm.js.map +7 -0
- package/dist/namiru-chat.umd.js +1091 -0
- package/dist/namiru-chat.umd.js.map +7 -0
- package/dist/ui/components/button-bubble.d.ts +9 -0
- package/dist/ui/components/chat-header.d.ts +11 -0
- package/dist/ui/components/chat-input.d.ts +4 -0
- package/dist/ui/components/chat-window.d.ts +26 -0
- package/dist/ui/components/contact-form.d.ts +8 -0
- package/dist/ui/components/email-form.d.ts +6 -0
- package/dist/ui/components/feedback-prompt.d.ts +5 -0
- package/dist/ui/components/limit-overlay.d.ts +8 -0
- package/dist/ui/components/message-bubble.d.ts +12 -0
- package/dist/ui/components/pre-chat-form.d.ts +7 -0
- package/dist/ui/icons.d.ts +22 -0
- package/dist/ui/styles.d.ts +19 -0
- package/package.json +33 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChatMessage } from "../../core/types";
|
|
2
|
+
export interface MessageBubbleOptions {
|
|
3
|
+
textColor?: string;
|
|
4
|
+
bubbleStyle?: "modern" | "rounded" | "square" | "classic";
|
|
5
|
+
agentAvatar?: string;
|
|
6
|
+
presetTheme?: "light" | "dark" | "custom";
|
|
7
|
+
}
|
|
8
|
+
export declare function createMessageBubbleFactory(opts: MessageBubbleOptions): {
|
|
9
|
+
createBubble(message: ChatMessage): HTMLElement;
|
|
10
|
+
createStreaming(): HTMLElement;
|
|
11
|
+
createLoading(): HTMLElement;
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PreChatOption } from "../../core/types";
|
|
2
|
+
export interface PreChatFormOptions {
|
|
3
|
+
question: string;
|
|
4
|
+
options: PreChatOption[];
|
|
5
|
+
onSelect: (label: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createPreChatForm(options: PreChatFormOptions): HTMLElement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function headerBotIcon(fill?: string): SVGElement;
|
|
2
|
+
export declare function namiruBirdIcon(fill?: string): SVGElement;
|
|
3
|
+
export declare function paperPlaneIcon(): SVGElement;
|
|
4
|
+
export declare function chatBubbleIcon(): SVGElement;
|
|
5
|
+
export declare function closeIcon(): SVGElement;
|
|
6
|
+
export declare function sendIcon(): SVGElement;
|
|
7
|
+
export declare function thumbsUpIcon(): SVGElement;
|
|
8
|
+
export declare function thumbsDownIcon(): SVGElement;
|
|
9
|
+
export declare function emailIcon(): SVGElement;
|
|
10
|
+
export declare function shoppingBagIcon(): SVGElement;
|
|
11
|
+
export declare function packageIcon(): SVGElement;
|
|
12
|
+
export declare function creditCardIcon(): SVGElement;
|
|
13
|
+
export declare function chatCircleIcon(): SVGElement;
|
|
14
|
+
export declare function rocketIcon(): SVGElement;
|
|
15
|
+
export declare function wrenchIcon(): SVGElement;
|
|
16
|
+
export declare function briefcaseIcon(): SVGElement;
|
|
17
|
+
export declare function userCircleIcon(): SVGElement;
|
|
18
|
+
export declare function dotsThreeIcon(): SVGElement;
|
|
19
|
+
export declare function transcriptIcon(): SVGElement;
|
|
20
|
+
export declare function newChatIcon(): SVGElement;
|
|
21
|
+
export declare function openInNewWindowIcon(): SVGElement;
|
|
22
|
+
export declare function getIconByName(name: string): SVGElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface StyleOptions {
|
|
2
|
+
primaryColor: string;
|
|
3
|
+
accentColor?: string;
|
|
4
|
+
headerColor?: string;
|
|
5
|
+
fontFamily?: string;
|
|
6
|
+
presetTheme?: "light" | "dark" | "custom";
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
textColor?: string;
|
|
9
|
+
fontSize?: "small" | "medium" | "large";
|
|
10
|
+
userMessageColor?: string;
|
|
11
|
+
agentMessageColor?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Inject widget styles into the given render root (Shadow DOM or fallback element).
|
|
15
|
+
* When `useImportant` is true (fallback mode), key properties get !important
|
|
16
|
+
* to resist host-page CSS bleed-through.
|
|
17
|
+
*/
|
|
18
|
+
export declare function injectStyles(options: string | StyleOptions, renderRoot: ShadowRoot | HTMLElement, useImportant?: boolean): void;
|
|
19
|
+
export declare function removeStyles(): void;
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@namiruai/chat",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Namiru AI chat widget - embeddable customer support chat",
|
|
5
|
+
"main": "dist/namiru-chat.umd.js",
|
|
6
|
+
"module": "dist/namiru-chat.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/namiru-chat.esm.js",
|
|
11
|
+
"require": "./dist/namiru-chat.umd.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": ["dist", "LICENSE", "README.md"],
|
|
16
|
+
"sideEffects": true,
|
|
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": ["chat", "widget", "ai", "customer-support", "chatbot", "namiru"],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "node build.js",
|
|
27
|
+
"dev": "node build.js --watch"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"esbuild": "^0.20.0",
|
|
31
|
+
"typescript": "^5.3.0"
|
|
32
|
+
}
|
|
33
|
+
}
|