@nlxai/touchpoint-ui 1.1.3 → 1.1.5
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 +2 -2
- package/lib/App.d.ts +2 -3
- package/lib/bidirectional/automaticContext.d.ts +5 -0
- package/lib/bidirectional/commandHandler.d.ts +8 -0
- package/lib/components/FullscreenVoice.d.ts +2 -8
- package/lib/components/VoiceMini.d.ts +2 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +6165 -6120
- package/lib/index.umd.js +50 -43
- package/lib/types.d.ts +82 -1
- package/lib/voice.d.ts +9 -11
- package/package.json +6 -4
- /package/lib/{analyzePageForms.d.ts → bidirectional/analyzePageForms.d.ts} +0 -0
package/lib/types.d.ts
CHANGED
|
@@ -173,6 +173,78 @@ export type CustomLaunchButton = ComponentType<{
|
|
|
173
173
|
* Input type for the experience
|
|
174
174
|
*/
|
|
175
175
|
export type Input = "text" | "voice" | "voiceMini";
|
|
176
|
+
/**
|
|
177
|
+
* Configuration for bidirectional mode of voice+.
|
|
178
|
+
*/
|
|
179
|
+
export type BidirectionalConfig = {
|
|
180
|
+
/**
|
|
181
|
+
* Attempt to gather and send page context automatically. This will work well on semantically coded pages without too many custom form controls.
|
|
182
|
+
* This enables a number of automatic features.
|
|
183
|
+
*
|
|
184
|
+
* Defaults to `false`.
|
|
185
|
+
*/
|
|
186
|
+
automaticContext?: true;
|
|
187
|
+
/**
|
|
188
|
+
* Navigation handler for bidirectional mode.
|
|
189
|
+
*
|
|
190
|
+
* If automatic context gathering is enabled, the default implementation will navigate to those pages using standard `window.location` APIs.
|
|
191
|
+
* @param action - The navigation action to perform.
|
|
192
|
+
* @param destination - The name of the destination to navigate to if `action` is `"page_custom"`.
|
|
193
|
+
* @param destinations - A map of destination names to URLs for custom navigation. Only present if `automaticContext` is enabled.
|
|
194
|
+
*/
|
|
195
|
+
navigation?: (action: "page_next" | "page_previous" | "page_custom", destination: string | undefined, destinations: Record<string, string>) => void;
|
|
196
|
+
/**
|
|
197
|
+
* A callback for filling out form fields in bidirectional mode.
|
|
198
|
+
*
|
|
199
|
+
* If automatic context gathering is enabled, the default implementation will fill out the form fields using standard DOM APIs.
|
|
200
|
+
* @param fields - An array of field objects with `id` and `value` properties.
|
|
201
|
+
* @param pageFields - A map of field IDs to DOM elements for custom form filling. Only present if `automaticContext` is enabled.
|
|
202
|
+
*/
|
|
203
|
+
input?: (fields: Array<{
|
|
204
|
+
id: string;
|
|
205
|
+
value: string;
|
|
206
|
+
}>, pageFields: Record<string, Element>) => void;
|
|
207
|
+
/**
|
|
208
|
+
* A callback for custom actions in bidirectional mode.
|
|
209
|
+
* @param action - The custom name of your action.
|
|
210
|
+
* @param payload - The payload defined for the custom action.
|
|
211
|
+
* @returns
|
|
212
|
+
*/
|
|
213
|
+
custom?: (action: string, payload: unknown) => void;
|
|
214
|
+
} | {
|
|
215
|
+
/**
|
|
216
|
+
* Attempt to gather and send page context automatically. This will work well on semantically coded pages without too many custom form controls.
|
|
217
|
+
* This enables a number of automatic features.
|
|
218
|
+
*
|
|
219
|
+
* Defaults to `false`.
|
|
220
|
+
*/
|
|
221
|
+
automaticContext: false;
|
|
222
|
+
/**
|
|
223
|
+
* Navigation handler for bidirectional mode.
|
|
224
|
+
*
|
|
225
|
+
* If automatic context gathering is enabled, the default implementation will navigate to those pages using standard `window.location` APIs.
|
|
226
|
+
* @param action - The navigation action to perform.
|
|
227
|
+
* @param destination - The name of the destination to navigate to if `action` is `"page_custom"`.
|
|
228
|
+
*/
|
|
229
|
+
navigation?: (action: "page_next" | "page_previous" | "page_custom", destination?: string) => void;
|
|
230
|
+
/**
|
|
231
|
+
* A callback for filling out form fields in bidirectional mode.
|
|
232
|
+
*
|
|
233
|
+
* If automatic context gathering is enabled, the default implementation will fill out the form fields using standard DOM APIs.
|
|
234
|
+
* @param fields - An array of field objects with `id` and `value` properties.
|
|
235
|
+
*/
|
|
236
|
+
input?: (fields: Array<{
|
|
237
|
+
id: string;
|
|
238
|
+
value: string;
|
|
239
|
+
}>) => void;
|
|
240
|
+
/**
|
|
241
|
+
* A callback for custom actions in bidirectional mode.
|
|
242
|
+
* @param action - The custom name of your action.
|
|
243
|
+
* @param payload - The payload defined for the custom action.
|
|
244
|
+
* @returns
|
|
245
|
+
*/
|
|
246
|
+
custom?: (action: string, payload: unknown) => void;
|
|
247
|
+
};
|
|
176
248
|
/**
|
|
177
249
|
* Main Touchpoint creation properties object
|
|
178
250
|
*/
|
|
@@ -226,11 +298,20 @@ export interface TouchpointConfiguration {
|
|
|
226
298
|
*/
|
|
227
299
|
initializeConversation?: InitializeConversation;
|
|
228
300
|
/**
|
|
229
|
-
* Controls the ways in which
|
|
301
|
+
* Controls the ways in which the user can communicate with the application. Defaults to `"text"`
|
|
230
302
|
*/
|
|
231
303
|
input?: Input;
|
|
232
304
|
/**
|
|
233
305
|
* Context sent with the initial request.
|
|
234
306
|
*/
|
|
235
307
|
initialContext?: Context;
|
|
308
|
+
/**
|
|
309
|
+
* Enables bidirectional mode of voice+. Will automatically set the bidirectional flag in the config.
|
|
310
|
+
*
|
|
311
|
+
*/
|
|
312
|
+
bidirectional?: BidirectionalConfig;
|
|
236
313
|
}
|
|
314
|
+
/**
|
|
315
|
+
* @internal
|
|
316
|
+
*/
|
|
317
|
+
export type NormalizedTouchpointConfiguration = TouchpointConfiguration & Required<Pick<TouchpointConfiguration, "initializeConversation" | "input">>;
|
package/lib/voice.d.ts
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import { Context, ConversationHandler, ModalityPayloads } from '@nlxai/chat-core';
|
|
2
|
-
type VoiceRoomState = "inactive" | "pending" | "active" | "error" | "terminated";
|
|
3
2
|
export interface SoundCheck {
|
|
4
3
|
micAllowed: boolean;
|
|
5
4
|
micNames: string[];
|
|
6
5
|
speakerNames: string[];
|
|
7
6
|
}
|
|
7
|
+
export interface ModalitiesWithContext {
|
|
8
|
+
modalities: ModalityPayloads;
|
|
9
|
+
from?: string;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
}
|
|
12
|
+
type VoiceRoomState = "noAudioPermissions" | "pending" | "active" | "error" | "terminated";
|
|
8
13
|
interface VoiceHookReturn {
|
|
9
14
|
roomState: VoiceRoomState;
|
|
10
15
|
isUserSpeaking: boolean;
|
|
11
16
|
isApplicationSpeaking: boolean;
|
|
12
|
-
soundCheck: null | SoundCheck;
|
|
13
17
|
roomData: null | ModalitiesWithContext;
|
|
14
|
-
|
|
18
|
+
retry: () => Promise<void>;
|
|
15
19
|
}
|
|
16
|
-
interface
|
|
17
|
-
active: boolean;
|
|
20
|
+
interface VoiceHookParams {
|
|
18
21
|
micEnabled: boolean;
|
|
19
22
|
speakersEnabled: boolean;
|
|
20
23
|
handler: ConversationHandler;
|
|
21
24
|
context?: Context;
|
|
22
25
|
}
|
|
23
|
-
export
|
|
24
|
-
modalities: ModalityPayloads;
|
|
25
|
-
from?: string;
|
|
26
|
-
timestamp: number;
|
|
27
|
-
}
|
|
28
|
-
export declare const useVoice: ({ active, micEnabled, speakersEnabled, handler, context, }: UseVoiceParams) => VoiceHookReturn;
|
|
26
|
+
export declare const useVoice: ({ handler, context, speakersEnabled, micEnabled, }: VoiceHookParams) => VoiceHookReturn;
|
|
29
27
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nlxai/touchpoint-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Web UI for Touchpoint",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
"tsc": "tsc"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nlxai/chat-core": "^1.
|
|
27
|
+
"@nlxai/chat-core": "^1.1.4",
|
|
28
28
|
"@react-hookz/web": "^25.0.1",
|
|
29
29
|
"@react-input/mask": "^2.0.4",
|
|
30
30
|
"clsx": "^2.1.1",
|
|
31
|
+
"hast": "^0.0.2",
|
|
31
32
|
"htm": "^3.1.1",
|
|
32
33
|
"livekit-client": "^2.9.9",
|
|
33
34
|
"marked": "^15.0.4",
|
|
@@ -35,7 +36,8 @@
|
|
|
35
36
|
"react": "^18.3.1",
|
|
36
37
|
"react-dom": "^18.3.1",
|
|
37
38
|
"react-indiana-drag-scroll": "^2.2.0",
|
|
38
|
-
"react-textarea-autosize": "^8.5.6"
|
|
39
|
+
"react-textarea-autosize": "^8.5.6",
|
|
40
|
+
"unist": "^0.0.1"
|
|
39
41
|
},
|
|
40
42
|
"devDependencies": {
|
|
41
43
|
"@rollup/plugin-replace": "^6.0.2",
|
|
@@ -58,5 +60,5 @@
|
|
|
58
60
|
"publishConfig": {
|
|
59
61
|
"access": "public"
|
|
60
62
|
},
|
|
61
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "9d7f963d6078df83c94998f4ace8d98e35dfa2aa"
|
|
62
64
|
}
|
|
File without changes
|