nivq-chat-widget 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/README.md +95 -0
- package/dist/VegaRenderer-lp_dbUCo.js +40918 -0
- package/dist/element-D4amUXLj.js +48322 -0
- package/dist/nivq-chat.d.ts +78 -0
- package/dist/nivq-chat.js +5 -0
- package/package.json +53 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Public type definitions for nivq-chat-widget — the <nivq-chat> custom element.
|
|
2
|
+
// Importing the package registers the element as a side effect.
|
|
3
|
+
|
|
4
|
+
export interface NivqChatConfig {
|
|
5
|
+
/** Required. The NivQ agent this widget talks to. */
|
|
6
|
+
agentId: string;
|
|
7
|
+
/** Required. Your token-broker endpoint that returns { access_token, expires_in }. */
|
|
8
|
+
tokenEndpoint: string;
|
|
9
|
+
/** NivQ chat API base URL (e.g. https://api.nivq.ai). */
|
|
10
|
+
apiBaseUrl: string;
|
|
11
|
+
mode?: 'fab' | 'inline';
|
|
12
|
+
/** Inline mode only: CSS selector of the container to mount into. */
|
|
13
|
+
target?: string;
|
|
14
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
15
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
16
|
+
locale?: 'tr' | 'en' | 'auto';
|
|
17
|
+
/** Hex (#rrggbb) or HSL triplet ("356 90% 58%"). */
|
|
18
|
+
primaryColor?: string;
|
|
19
|
+
accentColor?: string;
|
|
20
|
+
radius?: string;
|
|
21
|
+
logoUrl?: string;
|
|
22
|
+
brandName?: string;
|
|
23
|
+
launcherLabel?: string;
|
|
24
|
+
greeting?: string;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
externalUserId?: string;
|
|
28
|
+
persist?: boolean;
|
|
29
|
+
startOpen?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare class NivqChatElement extends HTMLElement {
|
|
33
|
+
/** Programmatic config override; merges over attributes and re-renders. */
|
|
34
|
+
configure(patch: Partial<NivqChatConfig>): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Registers <nivq-chat>. Runs automatically on import; safe to call again. */
|
|
38
|
+
export declare function register(): void;
|
|
39
|
+
|
|
40
|
+
declare global {
|
|
41
|
+
interface HTMLElementTagNameMap {
|
|
42
|
+
'nivq-chat': NivqChatElement;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
namespace JSX {
|
|
46
|
+
interface IntrinsicElements {
|
|
47
|
+
'nivq-chat': {
|
|
48
|
+
'agent-id'?: string;
|
|
49
|
+
'token-endpoint'?: string;
|
|
50
|
+
'api-base-url'?: string;
|
|
51
|
+
mode?: 'fab' | 'inline';
|
|
52
|
+
target?: string;
|
|
53
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
54
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
55
|
+
locale?: 'tr' | 'en' | 'auto';
|
|
56
|
+
'primary-color'?: string;
|
|
57
|
+
'accent-color'?: string;
|
|
58
|
+
radius?: string;
|
|
59
|
+
'logo-url'?: string;
|
|
60
|
+
'brand-name'?: string;
|
|
61
|
+
'launcher-label'?: string;
|
|
62
|
+
greeting?: string;
|
|
63
|
+
placeholder?: string;
|
|
64
|
+
title?: string;
|
|
65
|
+
'external-user-id'?: string;
|
|
66
|
+
persist?: boolean | string;
|
|
67
|
+
'start-open'?: boolean | string;
|
|
68
|
+
class?: string;
|
|
69
|
+
id?: string;
|
|
70
|
+
slot?: string;
|
|
71
|
+
style?: unknown;
|
|
72
|
+
ref?: unknown;
|
|
73
|
+
key?: unknown;
|
|
74
|
+
children?: unknown;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nivq-chat-widget",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Embeddable NivQ chat web component (<nivq-chat>) for any website or framework.",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"homepage": "https://github.com/nivorbit/nivq-chat-widget#readme",
|
|
8
|
+
"keywords": ["nivq", "chat", "widget", "web-component", "custom-element", "ai", "embed"],
|
|
9
|
+
"module": "./dist/nivq-chat.js",
|
|
10
|
+
"types": "./dist/nivq-chat.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/nivq-chat.d.ts",
|
|
14
|
+
"import": "./dist/nivq-chat.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": ["dist"],
|
|
18
|
+
"sideEffects": ["./dist/**"],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "vite",
|
|
24
|
+
"build": "tsc --noEmit && vite build && cp nivq-chat.d.ts dist/nivq-chat.d.ts",
|
|
25
|
+
"preview": "vite preview",
|
|
26
|
+
"type-check": "tsc --noEmit",
|
|
27
|
+
"broker": "node demo/mock-broker.mjs",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@microsoft/fetch-event-source": "^2.0.1",
|
|
32
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
33
|
+
"@types/node": "^22.17.1",
|
|
34
|
+
"@types/react": "^19.2.14",
|
|
35
|
+
"@types/react-dom": "^19.2.3",
|
|
36
|
+
"@vitejs/plugin-react": "^5.1.0",
|
|
37
|
+
"class-variance-authority": "^0.7.1",
|
|
38
|
+
"clsx": "^2.1.1",
|
|
39
|
+
"lucide-react": "^1.7.0",
|
|
40
|
+
"react": "^19.2.4",
|
|
41
|
+
"react-dom": "^19.2.4",
|
|
42
|
+
"react-markdown": "^10.1.0",
|
|
43
|
+
"react-vega": "^7.6.0",
|
|
44
|
+
"rehype-raw": "^7.0.0",
|
|
45
|
+
"remark-gfm": "^4.0.1",
|
|
46
|
+
"tailwind-merge": "^3.5.0",
|
|
47
|
+
"tailwindcss": "^4.2.2",
|
|
48
|
+
"typescript": "~5.9.0",
|
|
49
|
+
"vega": "^5.30.0",
|
|
50
|
+
"vega-lite": "^5.21.0",
|
|
51
|
+
"vite": "^7.1.0"
|
|
52
|
+
}
|
|
53
|
+
}
|