@nlxai/touchpoint-ui 1.2.6 → 1.2.7-alpha.1
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/connect-chat.html +197 -0
- package/eslint.config.js +5 -0
- package/index.html +43 -47
- package/lib/ProviderStack.d.ts +0 -21
- package/lib/components/FullscreenVoice.d.ts +4 -6
- package/lib/components/Layout.d.ts +23 -0
- package/lib/components/Messages.d.ts +0 -1
- package/lib/components/VoiceModalities.d.ts +11 -0
- package/lib/components/defaultModalities/index.d.ts +2 -0
- package/lib/components/ui/Radio.d.ts +14 -0
- package/lib/design-system/LightDarkToggle.d.ts +50 -0
- package/lib/design-system/index.d.ts +1 -0
- package/lib/index.js +30333 -27428
- package/lib/index.umd.js +124 -119
- package/lib/interface.d.ts +9 -2
- package/lib/mocks/MockText.d.ts +10 -0
- package/lib/mocks/MockVoice.d.ts +10 -0
- package/lib/mocks/MockVoiceMini.d.ts +8 -0
- package/lib/mocks/shared.d.ts +5 -0
- package/lib/types.d.ts +1 -1
- package/package.json +14 -15
- package/tsdoc.json +15 -2
- package/vite.config.ts +62 -32
- package/.eslintrc.cjs +0 -5
- package/lib/design-system.d.ts +0 -0
package/lib/interface.d.ts
CHANGED
|
@@ -222,9 +222,16 @@ export type BidirectionalConfig = {
|
|
|
222
222
|
*/
|
|
223
223
|
export interface TouchpointConfiguration {
|
|
224
224
|
/**
|
|
225
|
-
* Connection information for the \@nlxai/core conversation handler
|
|
225
|
+
* Connection information for the \@nlxai/core conversation handler.
|
|
226
|
+
* Required unless `conversationHandler` is provided.
|
|
226
227
|
*/
|
|
227
|
-
config
|
|
228
|
+
config?: Config;
|
|
229
|
+
/**
|
|
230
|
+
* A pre-built conversation handler. When provided, Touchpoint will use this
|
|
231
|
+
* instead of creating one from `config`. This enables adapters like
|
|
232
|
+
* \@nlxai/connect-chat-adapter to power the Touchpoint UI.
|
|
233
|
+
*/
|
|
234
|
+
conversationHandler?: ConversationHandler;
|
|
228
235
|
/**
|
|
229
236
|
* Optional window size for the chat window, defaults to `half`
|
|
230
237
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { WindowSize, ColorMode } from '../interface';
|
|
3
|
+
export declare const MockText: FC<{
|
|
4
|
+
embedded: boolean;
|
|
5
|
+
colorMode?: ColorMode;
|
|
6
|
+
isExpanded: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
onExpand: () => void;
|
|
9
|
+
windowSize: WindowSize;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { WindowSize, ColorMode } from '../interface';
|
|
3
|
+
export declare const MockVoice: FC<{
|
|
4
|
+
embedded: boolean;
|
|
5
|
+
colorMode?: ColorMode;
|
|
6
|
+
isExpanded: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
onExpand: () => void;
|
|
9
|
+
windowSize: WindowSize;
|
|
10
|
+
}>;
|
package/lib/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from '@nlxai/core';
|
|
2
2
|
import { TouchpointConfiguration } from './interface';
|
|
3
3
|
export type NormalizedTouchpointConfiguration = TouchpointConfiguration & Required<Pick<TouchpointConfiguration, "initializeConversation" | "input">> & {
|
|
4
|
-
config: Required<Pick<Config, "conversationId" | "userId" | "bidirectional">>;
|
|
4
|
+
config: Config & Required<Pick<Config, "conversationId" | "userId" | "bidirectional" | "languageCode">>;
|
|
5
5
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nlxai/touchpoint-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7-alpha.1",
|
|
4
4
|
"description": "Web UI for Touchpoint",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -11,15 +11,14 @@
|
|
|
11
11
|
"types": "lib/index.d.ts",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"dev": "vite",
|
|
14
|
+
"dev:connect": "vite --open connect-chat.html",
|
|
14
15
|
"design-system": "vite --mode design-system",
|
|
16
|
+
"build:design-system": "vite build --mode design-system",
|
|
15
17
|
"build": "tsc && vite build",
|
|
16
|
-
"
|
|
17
|
-
"lint:check": "eslint src/ --ext .ts,.tsx,.js,.jsx --max-warnings 0",
|
|
18
|
+
"lint:check": "eslint src/",
|
|
18
19
|
"prepublish": "npm run build",
|
|
19
|
-
"lint": "eslint src/ --
|
|
20
|
+
"lint": "eslint src/ --fix",
|
|
20
21
|
"format": "git ls-files | grep -E '\\.(js|jsx|ts|tsx|css|html)$' | xargs prettier --write",
|
|
21
|
-
"preview-docs": "npm run docs && comrak --unsafe --gfm -o docs/index.html docs/index.md && open docs/index.html",
|
|
22
|
-
"publish-docs": "npm run docs && mv docs/index.md ../website/src/content/touchpoint-ui-api-reference.md",
|
|
23
22
|
"test": "typedoc --emit none && vitest run",
|
|
24
23
|
"tsc": "tsc",
|
|
25
24
|
"update-readme:docs": "rm -rf docs/ && typedoc --excludeExternals --externalPattern src/components/ui/Icons.tsx",
|
|
@@ -28,15 +27,15 @@
|
|
|
28
27
|
},
|
|
29
28
|
"dependencies": {
|
|
30
29
|
"@base-ui/react": "^1.1.0",
|
|
31
|
-
"@nlxai/core": "^1.2.
|
|
30
|
+
"@nlxai/core": "^1.2.7-alpha.1",
|
|
32
31
|
"@react-hookz/web": "^25.0.1",
|
|
33
32
|
"@react-input/mask": "^2.0.4",
|
|
34
33
|
"@rive-app/webgl2": "^2.31.5",
|
|
35
34
|
"@types/json-schema": "^7.0.15",
|
|
36
35
|
"clsx": "^2.1.1",
|
|
37
|
-
"dompurify": "^3.
|
|
36
|
+
"dompurify": "^3.4.11",
|
|
38
37
|
"htm": "^3.1.1",
|
|
39
|
-
"livekit-client": "^2.
|
|
38
|
+
"livekit-client": "^2.18.9",
|
|
40
39
|
"marked": "^15.0.4",
|
|
41
40
|
"ramda": "^0.32.0",
|
|
42
41
|
"react": "^18.3.1",
|
|
@@ -46,6 +45,7 @@
|
|
|
46
45
|
"react-textarea-autosize": "^8.5.6"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
48
|
+
"@livekit/throws-transformer": "^0.1.8",
|
|
49
49
|
"@nlxai/eslint-config": "*",
|
|
50
50
|
"@rollup/plugin-replace": "^6.0.2",
|
|
51
51
|
"@tailwindcss/vite": "^4.1.16",
|
|
@@ -54,23 +54,22 @@
|
|
|
54
54
|
"@types/ramda": "^0.31.1",
|
|
55
55
|
"@types/react": "^18.3.1",
|
|
56
56
|
"@types/react-dom": "^18.3.0",
|
|
57
|
-
"@
|
|
58
|
-
"@typescript-eslint/parser": "^7.8.0",
|
|
57
|
+
"@types/sdp-transform": "^2.4.9",
|
|
59
58
|
"@vitejs/plugin-react": "^4.2.1",
|
|
60
|
-
"@vitest/ui": "^
|
|
59
|
+
"@vitest/ui": "^4.1.0",
|
|
61
60
|
"dom-accessibility-api": "^0.7.0",
|
|
62
61
|
"jsdom": "^27.0.1",
|
|
63
62
|
"tailwindcss": "^4.1.16",
|
|
64
63
|
"typedoc": "^0.28.14",
|
|
65
64
|
"typedoc-plugin-markdown": "^4.9.0",
|
|
66
65
|
"typescript": "^5.4.5",
|
|
67
|
-
"vite": "^6.
|
|
66
|
+
"vite": "^6.4.3",
|
|
68
67
|
"vite-plugin-dts": "^4.5.0",
|
|
69
|
-
"vitest": "^
|
|
68
|
+
"vitest": "^4.1.0",
|
|
70
69
|
"zod": "^4.1.5"
|
|
71
70
|
},
|
|
72
71
|
"publishConfig": {
|
|
73
72
|
"access": "public"
|
|
74
73
|
},
|
|
75
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "548c2c6c876cf86572aeb63a6810ed87c9b0382a"
|
|
76
75
|
}
|
package/tsdoc.json
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
|
|
3
|
-
"extends": ["typedoc/tsdoc.json"],
|
|
4
3
|
"noStandardTags": false,
|
|
5
|
-
"tagDefinitions": [
|
|
4
|
+
"tagDefinitions": [
|
|
5
|
+
{
|
|
6
|
+
"tagName": "@category",
|
|
7
|
+
"syntaxKind": "block",
|
|
8
|
+
"allowMultiple": true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"tagName": "@hidden",
|
|
12
|
+
"syntaxKind": "modifier"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"tagName": "@inline",
|
|
16
|
+
"syntaxKind": "modifier"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
6
19
|
}
|
package/vite.config.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { resolve } from "path";
|
|
2
2
|
import tailwindcss from "@tailwindcss/vite";
|
|
3
|
+
import { type PluginOption } from "vite";
|
|
3
4
|
import react from "@vitejs/plugin-react";
|
|
4
5
|
import replace from "@rollup/plugin-replace";
|
|
5
6
|
import { defineConfig } from "vite";
|
|
@@ -8,43 +9,72 @@ import dts from "vite-plugin-dts";
|
|
|
8
9
|
/**
|
|
9
10
|
* Adjust the JS entry point if the app is run in prototype or review modes
|
|
10
11
|
*/
|
|
11
|
-
const
|
|
12
|
+
const designSystemEntryPoint = (): PluginOption => {
|
|
12
13
|
return {
|
|
13
14
|
name: "html-transform",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
transformIndexHtml: {
|
|
16
|
+
order: "pre",
|
|
17
|
+
handler: () => {
|
|
18
|
+
return {
|
|
19
|
+
html: `<!doctype html>
|
|
20
|
+
<html lang="en">
|
|
21
|
+
<head>
|
|
22
|
+
<meta charset="UTF-8" />
|
|
23
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
24
|
+
<title>Design System</title>
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
<main></main>
|
|
28
|
+
<script type="module">
|
|
29
|
+
import { renderDesignSystem } from "./src/design-system/index.tsx";
|
|
30
|
+
|
|
31
|
+
renderDesignSystem(document.querySelector("main"));
|
|
32
|
+
</script>
|
|
33
|
+
</body>
|
|
34
|
+
</html>
|
|
35
|
+
`,
|
|
36
|
+
tags: [],
|
|
37
|
+
};
|
|
38
|
+
},
|
|
21
39
|
},
|
|
22
40
|
};
|
|
23
41
|
};
|
|
24
42
|
|
|
43
|
+
const sharedPlugins = (command: "serve" | "build"): PluginOption[] => [
|
|
44
|
+
react(),
|
|
45
|
+
tailwindcss(),
|
|
46
|
+
replace(
|
|
47
|
+
command === "serve"
|
|
48
|
+
? {}
|
|
49
|
+
: {
|
|
50
|
+
"process.env.NODE_ENV": JSON.stringify("production"),
|
|
51
|
+
},
|
|
52
|
+
),
|
|
53
|
+
dts(),
|
|
54
|
+
];
|
|
55
|
+
|
|
25
56
|
// https://vitejs.dev/config/
|
|
26
|
-
export default defineConfig(({ mode, command }) =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
57
|
+
export default defineConfig(({ mode, command }) =>
|
|
58
|
+
mode === "design-system"
|
|
59
|
+
? {
|
|
60
|
+
plugins: [designSystemEntryPoint(), ...sharedPlugins(command)],
|
|
61
|
+
base: "./",
|
|
62
|
+
build: {
|
|
63
|
+
outDir: "build",
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
: {
|
|
67
|
+
plugins: sharedPlugins(command),
|
|
68
|
+
resolve: {},
|
|
69
|
+
build: {
|
|
70
|
+
outDir: "lib",
|
|
71
|
+
lib: {
|
|
72
|
+
entry: resolve(__dirname, "./src/index.tsx"),
|
|
73
|
+
type: ["umd", "es"],
|
|
74
|
+
name: "nlxai.touchpointUi",
|
|
75
|
+
fileName: (format) =>
|
|
76
|
+
format === "umd" ? "index.umd.js" : "index.js",
|
|
35
77
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
],
|
|
40
|
-
resolve: {},
|
|
41
|
-
build: {
|
|
42
|
-
outDir: "lib",
|
|
43
|
-
lib: {
|
|
44
|
-
entry: resolve(__dirname, "./src/index.tsx"),
|
|
45
|
-
type: ["umd", "es"],
|
|
46
|
-
name: "nlxai.touchpointUi",
|
|
47
|
-
fileName: (format) => (format === "umd" ? "index.umd.js" : "index.js"),
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
}));
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
);
|
package/.eslintrc.cjs
DELETED
package/lib/design-system.d.ts
DELETED
|
File without changes
|