altio-chat 1.0.19 → 1.0.21
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 +58 -58
- package/dist/widget.js +231 -231
- package/index.d.ts +41 -41
- package/package.json +66 -65
package/index.d.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type declarations for the `altio-chat` widget bundle.
|
|
3
|
-
*
|
|
4
|
-
* The runtime is a single IIFE (dist/widget.js) that registers `window.AltioWidget`
|
|
5
|
-
* as a side effect on import. Consumers typically do:
|
|
6
|
-
* await import("altio-chat"); // runs the IIFE → window.AltioWidget is set
|
|
7
|
-
* window.AltioWidget.mount(el, cfg);
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export type TokenProvider = () =>
|
|
11
|
-
| string
|
|
12
|
-
| null
|
|
13
|
-
| undefined
|
|
14
|
-
| Promise<string | null | undefined>;
|
|
15
|
-
|
|
16
|
-
export interface AltioWidgetConfig {
|
|
17
|
-
/** Main backend base URL (POST /threads). */
|
|
18
|
-
apiUrl?: string;
|
|
19
|
-
/** Agent/widget backend base URL (connect/ask). Falls back to apiUrl. */
|
|
20
|
-
agentApiUrl?: string;
|
|
21
|
-
/** External-DB slot selector sent as `env`. */
|
|
22
|
-
dbEnv?: string;
|
|
23
|
-
/** Host user id — namespaces the persisted conversation per signed-in user. */
|
|
24
|
-
uid?: string;
|
|
25
|
-
/** Returns the host user's current access token (may be async). */
|
|
26
|
-
getToken?: TokenProvider;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface AltioWidgetApi {
|
|
30
|
-
/** Render the chat into `el` (fills it). Returns a handle with destroy(). */
|
|
31
|
-
mount(el: HTMLElement, cfg?: AltioWidgetConfig): { destroy(): void };
|
|
32
|
-
/** Update runtime config later (e.g. after the host user signs in). */
|
|
33
|
-
setConfig(cfg: AltioWidgetConfig): void;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// NOTE: the bundle also assigns `window.AltioWidget` at import time. We intentionally
|
|
37
|
-
// do NOT augment the global `Window` here so consumers can keep their own declaration
|
|
38
|
-
// without a duplicate-property conflict.
|
|
39
|
-
|
|
40
|
-
declare const AltioWidget: AltioWidgetApi;
|
|
41
|
-
export default AltioWidget;
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for the `altio-chat` widget bundle.
|
|
3
|
+
*
|
|
4
|
+
* The runtime is a single IIFE (dist/widget.js) that registers `window.AltioWidget`
|
|
5
|
+
* as a side effect on import. Consumers typically do:
|
|
6
|
+
* await import("altio-chat"); // runs the IIFE → window.AltioWidget is set
|
|
7
|
+
* window.AltioWidget.mount(el, cfg);
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export type TokenProvider = () =>
|
|
11
|
+
| string
|
|
12
|
+
| null
|
|
13
|
+
| undefined
|
|
14
|
+
| Promise<string | null | undefined>;
|
|
15
|
+
|
|
16
|
+
export interface AltioWidgetConfig {
|
|
17
|
+
/** Main backend base URL (POST /threads). */
|
|
18
|
+
apiUrl?: string;
|
|
19
|
+
/** Agent/widget backend base URL (connect/ask). Falls back to apiUrl. */
|
|
20
|
+
agentApiUrl?: string;
|
|
21
|
+
/** External-DB slot selector sent as `env`. */
|
|
22
|
+
dbEnv?: string;
|
|
23
|
+
/** Host user id — namespaces the persisted conversation per signed-in user. */
|
|
24
|
+
uid?: string;
|
|
25
|
+
/** Returns the host user's current access token (may be async). */
|
|
26
|
+
getToken?: TokenProvider;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface AltioWidgetApi {
|
|
30
|
+
/** Render the chat into `el` (fills it). Returns a handle with destroy(). */
|
|
31
|
+
mount(el: HTMLElement, cfg?: AltioWidgetConfig): { destroy(): void };
|
|
32
|
+
/** Update runtime config later (e.g. after the host user signs in). */
|
|
33
|
+
setConfig(cfg: AltioWidgetConfig): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// NOTE: the bundle also assigns `window.AltioWidget` at import time. We intentionally
|
|
37
|
+
// do NOT augment the global `Window` here so consumers can keep their own declaration
|
|
38
|
+
// without a duplicate-property conflict.
|
|
39
|
+
|
|
40
|
+
declare const AltioWidget: AltioWidgetApi;
|
|
41
|
+
export default AltioWidget;
|
package/package.json
CHANGED
|
@@ -1,65 +1,66 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "altio-chat",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Altio embeddable chat widget — single-file, Shadow-DOM isolated, loaded via <script> from a CDN.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist/widget.js",
|
|
8
|
-
"index.d.ts"
|
|
9
|
-
],
|
|
10
|
-
"main": "dist/widget.js",
|
|
11
|
-
"types": "./index.d.ts",
|
|
12
|
-
"unpkg": "dist/widget.js",
|
|
13
|
-
"jsdelivr": "dist/widget.js",
|
|
14
|
-
"exports": {
|
|
15
|
-
".": {
|
|
16
|
-
"types": "./index.d.ts",
|
|
17
|
-
"default": "./dist/widget.js"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"publishConfig": {
|
|
21
|
-
"access": "public"
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"dev": "vite",
|
|
25
|
-
"build": "tsc --noEmit && vite build",
|
|
26
|
-
"build:only": "vite build",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"react
|
|
39
|
-
"react-
|
|
40
|
-
"react-
|
|
41
|
-
"react-
|
|
42
|
-
"
|
|
43
|
-
"rehype-
|
|
44
|
-
"
|
|
45
|
-
"remark-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"@
|
|
52
|
-
"@types/react
|
|
53
|
-
"@types/react-
|
|
54
|
-
"@
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "altio-chat",
|
|
3
|
+
"version": "1.0.21",
|
|
4
|
+
"description": "Altio embeddable chat widget — single-file, Shadow-DOM isolated, loaded via <script> from a CDN.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/widget.js",
|
|
8
|
+
"index.d.ts"
|
|
9
|
+
],
|
|
10
|
+
"main": "dist/widget.js",
|
|
11
|
+
"types": "./index.d.ts",
|
|
12
|
+
"unpkg": "dist/widget.js",
|
|
13
|
+
"jsdelivr": "dist/widget.js",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./index.d.ts",
|
|
17
|
+
"default": "./dist/widget.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"build": "tsc --noEmit && vite build",
|
|
26
|
+
"build:only": "vite build",
|
|
27
|
+
"build:watch": "vite build --watch",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"preview": "vite preview",
|
|
30
|
+
"prepublishOnly": "pnpm build"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
34
|
+
"@tanstack/react-query": "^5.90.2",
|
|
35
|
+
"axios": "^1.12.2",
|
|
36
|
+
"clsx": "^2.1.1",
|
|
37
|
+
"katex": "^0.16.25",
|
|
38
|
+
"react": "19.1.2",
|
|
39
|
+
"react-cookie": "^8.0.1",
|
|
40
|
+
"react-dom": "19.1.2",
|
|
41
|
+
"react-markdown": "^10.1.0",
|
|
42
|
+
"react-syntax-highlighter": "^16.1.0",
|
|
43
|
+
"rehype-katex": "^7.0.1",
|
|
44
|
+
"rehype-raw": "^7.0.0",
|
|
45
|
+
"remark-gfm": "^4.0.1",
|
|
46
|
+
"remark-math": "^6.0.0",
|
|
47
|
+
"tailwind-merge": "^3.3.1",
|
|
48
|
+
"zustand": "^5.0.8"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@tailwindcss/postcss": "^4",
|
|
52
|
+
"@types/react": "^19",
|
|
53
|
+
"@types/react-dom": "^19",
|
|
54
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
55
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
56
|
+
"postcss": "^8.5.6",
|
|
57
|
+
"tailwindcss": "^4",
|
|
58
|
+
"typescript": "^5",
|
|
59
|
+
"vite": "^6.0.0"
|
|
60
|
+
},
|
|
61
|
+
"pnpm": {
|
|
62
|
+
"onlyBuiltDependencies": [
|
|
63
|
+
"esbuild"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|