@nlxai/touchpoint-ui 1.1.8-alpha.2 → 1.1.8-alpha.4
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/index.html +1 -0
- package/lib/components/FullscreenVoice.d.ts +1 -2
- package/lib/components/RiveAnimation.d.ts +2 -0
- package/lib/index.d.ts +2 -73
- package/lib/index.js +23227 -17698
- package/lib/index.umd.js +107 -100
- package/lib/interface.d.ts +74 -0
- package/package.json +7 -7
package/lib/interface.d.ts
CHANGED
|
@@ -331,6 +331,10 @@ export interface TouchpointConfiguration {
|
|
|
331
331
|
* URL of icon used to display the brand in the chat header
|
|
332
332
|
*/
|
|
333
333
|
brandIcon?: string;
|
|
334
|
+
/**
|
|
335
|
+
* Include border animation. Currently only supported in Voice Mini.
|
|
336
|
+
*/
|
|
337
|
+
animate?: boolean;
|
|
334
338
|
/**
|
|
335
339
|
* URL of icon used on the launch icon in the bottom right when the experience is collapsed.
|
|
336
340
|
*
|
|
@@ -406,3 +410,73 @@ export interface BidirectionalCustomCommand {
|
|
|
406
410
|
*/
|
|
407
411
|
handler: (value: any) => void;
|
|
408
412
|
}
|
|
413
|
+
/**
|
|
414
|
+
* Instance of a Touchpoint UI component
|
|
415
|
+
*/
|
|
416
|
+
export interface TouchpointInstance {
|
|
417
|
+
/**
|
|
418
|
+
* Controls whether the Touchpoint UI is expanded or collapsed
|
|
419
|
+
*/
|
|
420
|
+
expanded: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* The conversation handler instance for interacting with the application
|
|
423
|
+
*/
|
|
424
|
+
conversationHandler: ConversationHandler;
|
|
425
|
+
/**
|
|
426
|
+
* Method to remove the Touchpoint UI from the DOM
|
|
427
|
+
*/
|
|
428
|
+
teardown: () => void;
|
|
429
|
+
/**
|
|
430
|
+
* Sets currently available custom bidirectional commands.
|
|
431
|
+
* This allows you to define custom commands that can be used in the voice bot.
|
|
432
|
+
* The commands will be available in the voice bot and can be used to trigger actions.
|
|
433
|
+
*
|
|
434
|
+
* Example:
|
|
435
|
+
* ```javascript
|
|
436
|
+
* client.setCustomBidirectionalCommands([
|
|
437
|
+
* {
|
|
438
|
+
* action: "Meal",
|
|
439
|
+
* description: "add a meal to your flight",
|
|
440
|
+
* schema: {
|
|
441
|
+
* enum: ["standard", "vegetarian", "vegan", "gluten-free"],
|
|
442
|
+
* },
|
|
443
|
+
* handler: (value) => {
|
|
444
|
+
* console.log("Meal option:", value);
|
|
445
|
+
* },
|
|
446
|
+
* },
|
|
447
|
+
* ]);
|
|
448
|
+
* ```
|
|
449
|
+
*
|
|
450
|
+
* This will allow the voice bot to use the command `Meal` with the value `standard`, `vegetarian`, `vegan`, or `gluten-free`.
|
|
451
|
+
*
|
|
452
|
+
* When using more complex arguments, a library such as [Zod](https://zod.dev) can be useful:
|
|
453
|
+
*
|
|
454
|
+
* ```javascript
|
|
455
|
+
* import * as z from "zod/v4";
|
|
456
|
+
*
|
|
457
|
+
* const schema = z.object({
|
|
458
|
+
* "name": z.string().describe("The customer's name, such as John Doe"),
|
|
459
|
+
* "email": z.string().email().describe("The customer's email address"),
|
|
460
|
+
* });
|
|
461
|
+
*
|
|
462
|
+
* client.setCustomBidirectionalCommands([
|
|
463
|
+
* {
|
|
464
|
+
* action: "Meal",
|
|
465
|
+
* description: "add a meal to your flight",
|
|
466
|
+
* schema: z.toJSONSchema(schema, {io: "input"}),
|
|
467
|
+
* handler: (value) => {
|
|
468
|
+
* const result = z.safeParse(schema, value);
|
|
469
|
+
* if (result.success) {
|
|
470
|
+
* // result.data is now type safe and TypeScript can reason about it
|
|
471
|
+
* console.log("Meal option:", result.data);
|
|
472
|
+
* } else {
|
|
473
|
+
* console.error("Failed to parse Meal option:", result.error);
|
|
474
|
+
* }
|
|
475
|
+
* },
|
|
476
|
+
* },
|
|
477
|
+
* ]);
|
|
478
|
+
* ```
|
|
479
|
+
* @param commands - A list containing the custom commands to set.
|
|
480
|
+
*/
|
|
481
|
+
setCustomBidirectionalCommands: (commands: BidirectionalCustomCommand[]) => void;
|
|
482
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nlxai/touchpoint-ui",
|
|
3
|
-
"version": "1.1.8-alpha.
|
|
3
|
+
"version": "1.1.8-alpha.4",
|
|
4
4
|
"description": "Web UI for Touchpoint",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@nlxai/core": "^1.1.8-alpha.0",
|
|
28
28
|
"@react-hookz/web": "^25.0.1",
|
|
29
29
|
"@react-input/mask": "^2.0.4",
|
|
30
|
+
"@rive-app/webgl2": "^2.31.5",
|
|
30
31
|
"@types/json-schema": "^7.0.15",
|
|
31
32
|
"clsx": "^2.1.1",
|
|
32
|
-
"hast": "^0.0.2",
|
|
33
33
|
"htm": "^3.1.1",
|
|
34
34
|
"livekit-client": "^2.9.9",
|
|
35
35
|
"marked": "^15.0.4",
|
|
@@ -37,8 +37,7 @@
|
|
|
37
37
|
"react": "^18.3.1",
|
|
38
38
|
"react-dom": "^18.3.1",
|
|
39
39
|
"react-indiana-drag-scroll": "^2.2.0",
|
|
40
|
-
"react-textarea-autosize": "^8.5.6"
|
|
41
|
-
"unist": "^0.0.1"
|
|
40
|
+
"react-textarea-autosize": "^8.5.6"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
43
|
"@rollup/plugin-replace": "^6.0.2",
|
|
@@ -55,11 +54,12 @@
|
|
|
55
54
|
"postcss": "^8.4.38",
|
|
56
55
|
"tailwindcss": "^3.4.3",
|
|
57
56
|
"typescript": "^5.4.5",
|
|
58
|
-
"vite": "^
|
|
59
|
-
"vite-plugin-dts": "^4.5.0"
|
|
57
|
+
"vite": "^6.0",
|
|
58
|
+
"vite-plugin-dts": "^4.5.0",
|
|
59
|
+
"zod": "^4.1.5"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "03fe45bd11db28b08c3e4ae431b091df482ccd99"
|
|
65
65
|
}
|