@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.
@@ -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: 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
+ }>;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { ColorMode } from '../interface';
3
+ export declare const MockVoiceMini: FC<{
4
+ colorMode?: ColorMode;
5
+ isExpanded: boolean;
6
+ onClose: () => void;
7
+ onExpand: () => void;
8
+ }>;
@@ -0,0 +1,5 @@
1
+ import { Response, ConversationHandler } from '@nlxai/core';
2
+ import { Theme } from '../interface';
3
+ export declare const mockTheme: Partial<Theme>;
4
+ export declare const mockConversationHandler: ConversationHandler;
5
+ export declare const responses: Response[];
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.6",
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
- "docs": "rm -rf docs/ && typedoc && concat-md --decrease-title-levels --dir-name-as-title docs/ > docs/index.md",
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/ --ext .ts,.tsx,.js,.jsx --fix",
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.6",
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.3.1",
36
+ "dompurify": "^3.4.11",
38
37
  "htm": "^3.1.1",
39
- "livekit-client": "^2.15.14",
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
- "@typescript-eslint/eslint-plugin": "^7.8.0",
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": "^3.2.4",
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.0",
66
+ "vite": "^6.4.3",
68
67
  "vite-plugin-dts": "^4.5.0",
69
- "vitest": "^3.2.4",
68
+ "vitest": "^4.1.0",
70
69
  "zod": "^4.1.5"
71
70
  },
72
71
  "publishConfig": {
73
72
  "access": "public"
74
73
  },
75
- "gitHead": "fb9a0b00ca2184fb69ffd1e11e8f55d30fe1d85e"
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 adjustJsEntryPoint = ({ mode }: { mode: string }): any => {
12
+ const designSystemEntryPoint = (): PluginOption => {
12
13
  return {
13
14
  name: "html-transform",
14
- order: "pre",
15
- transformIndexHtml: (html: string) => {
16
- const entryPoint = "/src/index.tsx";
17
- if (mode === "design-system") {
18
- return html.replace(entryPoint, "/src/design-system.tsx");
19
- }
20
- return html;
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
- plugins: [
28
- react(),
29
- tailwindcss(),
30
- replace(
31
- command === "serve"
32
- ? {}
33
- : {
34
- "process.env.NODE_ENV": JSON.stringify("production"),
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
- adjustJsEntryPoint({ mode }),
38
- dts(),
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
@@ -1,5 +0,0 @@
1
- /** @type {import('eslint').Linter.Config } */
2
- module.exports = {
3
- root: true,
4
- extends: ["@nlxai/eslint-config", "@nlxai/eslint-config/documentation"],
5
- };
File without changes