@nlxai/touchpoint-ui 1.0.5-alpha.7 → 1.0.5-alpha.9

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/lib/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Config, BotMessage, ConversationHandler } from '@nlxai/chat-core';
1
+ import { Config, BotMessage, ConversationHandler, Context } from '@nlxai/chat-core';
2
2
  import { FC } from 'react';
3
3
  /**
4
4
  * Window size configuration
@@ -153,8 +153,9 @@ export interface Theme {
153
153
  /**
154
154
  * Custom conversation init method. Defaults to sending the welcome intent
155
155
  * @param handler - the conversation handler.
156
+ * @param context - context set via TouchpointConfiguration.initialContext
156
157
  */
157
- export type InitializeConversation = (handler: ConversationHandler) => void;
158
+ export type InitializeConversation = (handler: ConversationHandler, context?: Context) => void;
158
159
  /**
159
160
  * Main Touchpoint creation properties object
160
161
  */
@@ -204,10 +205,15 @@ export interface TouchpointConfiguration {
204
205
  /**
205
206
  * Custom conversation init method. Defaults to sending the welcome intent
206
207
  * @param handler - the conversation handler.
208
+ * @param context - the context object
207
209
  */
208
210
  initializeConversation?: InitializeConversation;
209
211
  /**
210
212
  * Controls the ways in which the user can communicate with the application. Defaults to `"text"`
211
213
  */
212
- input?: "text" | "voice";
214
+ input?: "text" | "voice" | "voiceMini";
215
+ /**
216
+ * Context sent with the initial request.
217
+ */
218
+ initialContext?: Context;
213
219
  }
package/lib/voice.d.ts CHANGED
@@ -1,12 +1,22 @@
1
- import { ConversationHandler } from '@nlxai/chat-core';
2
- type VoiceRoomState = "inactive" | "pending" | "active" | "error";
1
+ import { Context, ConversationHandler } from '@nlxai/chat-core';
2
+ type VoiceRoomState = "inactive" | "pending" | "active" | "error" | "terminated";
3
+ export interface SoundCheck {
4
+ micAllowed: boolean;
5
+ micNames: string[];
6
+ speakerNames: string[];
7
+ }
3
8
  interface VoiceHookReturn {
4
9
  roomState: VoiceRoomState;
5
10
  isUserSpeaking: boolean;
6
11
  isApplicationSpeaking: boolean;
12
+ soundCheck: null | SoundCheck;
7
13
  }
8
- export declare const useVoice: ({ active, handler, }: {
14
+ interface UseVoiceParams {
9
15
  active: boolean;
16
+ micEnabled: boolean;
17
+ speakersEnabled: boolean;
10
18
  handler: ConversationHandler;
11
- }) => VoiceHookReturn;
19
+ context?: Context;
20
+ }
21
+ export declare const useVoice: ({ active, micEnabled, speakersEnabled, handler, context, }: UseVoiceParams) => VoiceHookReturn;
12
22
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nlxai/touchpoint-ui",
3
- "version": "1.0.5-alpha.7",
3
+ "version": "1.0.5-alpha.9",
4
4
  "description": "Web UI for Touchpoint",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -24,7 +24,7 @@
24
24
  "tsc": "tsc"
25
25
  },
26
26
  "dependencies": {
27
- "@nlxai/chat-core": "^1.0.5-alpha.4",
27
+ "@nlxai/chat-core": "^1.0.5-alpha.9",
28
28
  "@react-hookz/web": "^25.0.1",
29
29
  "@react-input/mask": "^2.0.4",
30
30
  "clsx": "^2.1.1",
@@ -51,11 +51,11 @@
51
51
  "postcss": "^8.4.38",
52
52
  "tailwindcss": "^3.4.3",
53
53
  "typescript": "^5.4.5",
54
- "vite": "^4.5.6",
54
+ "vite": "^5.4.19",
55
55
  "vite-plugin-dts": "^4.5.0"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "58311dbd2b53f693d7676d9e218a7602111378c0"
60
+ "gitHead": "2d9cdb12e0847e8cad5f21f692b27bd8e6a2ef25"
61
61
  }