@nlxai/touchpoint-ui 1.0.5-alpha.0 → 1.0.5-alpha.2

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 { BotMessage, ConversationHandler } from '@nlxai/chat-core';
1
+ import { Config, BotMessage, ConversationHandler } from '@nlxai/chat-core';
2
2
  import { FC } from 'react';
3
3
  /**
4
4
  * Window size configuration
@@ -27,7 +27,7 @@ export interface ChoiceMessage {
27
27
  }
28
28
  /**
29
29
  * Custom Modalities allow rendering of rich components from nodes.
30
- * See: https://docs.studio.nlx.ai/intentflows/documentation-flows/flows-build-mode/advanced-messaging-+-functionality#modalities
30
+ * See: https://docs.studio.nlx.ai/build/resources/modalities
31
31
  */
32
32
  export type CustomModalityComponent<Data> = FC<{
33
33
  /**
@@ -38,6 +38,12 @@ export type CustomModalityComponent<Data> = FC<{
38
38
  * Conversation handler instance
39
39
  */
40
40
  conversationHandler: ConversationHandler;
41
+ /**
42
+ * Whether the component is enabled
43
+ * We should probably use context and handle disabling interactive components automatically for the user
44
+ * @internal
45
+ */
46
+ enabled: boolean;
41
47
  }>;
42
48
  /**
43
49
  * The full theme expressed as CSS custom properties
@@ -144,3 +150,52 @@ export interface Theme {
144
150
  */
145
151
  outerBorderRadius: string;
146
152
  }
153
+ /**
154
+ * Custom conversation init method. Defaults to sending the welcome intent
155
+ * @param handler - the conversation handler.
156
+ */
157
+ export type InitializeConversation = (handler: ConversationHandler) => void;
158
+ /**
159
+ * Main Touchpoint creation properties object
160
+ */
161
+ export interface TouchpointConfiguration {
162
+ /**
163
+ * Connection information for the \@nlxai/chat-core conversation handler
164
+ */
165
+ config: Config;
166
+ /**
167
+ * Optional window size for the chat window, defaults to `half`
168
+ */
169
+ windowSize?: WindowSize;
170
+ /**
171
+ * Optional color mode for the chat window, defaults to `dark`
172
+ */
173
+ colorMode?: ColorMode;
174
+ /**
175
+ * URL of icon used to display the brand in the chat header
176
+ */
177
+ brandIcon?: string;
178
+ /**
179
+ * URL of icon used on the launch icon in the bottom right when the experience is collapsed.
180
+ *
181
+ * When set to `false`, no launch button is shown at all. When not set or set to `true`, the default launch icon is rendered.
182
+ */
183
+ launchIcon?: string | boolean;
184
+ /**
185
+ * Optional theme object to override default theme values
186
+ */
187
+ theme?: Partial<Theme>;
188
+ /**
189
+ * Optional custom modality components to render in Touchpoint
190
+ */
191
+ customModalities?: Record<string, CustomModalityComponent<any>>;
192
+ /**
193
+ * Custom conversation init method. Defaults to sending the welcome intent
194
+ * @param handler - the conversation handler.
195
+ */
196
+ initializeConversation?: InitializeConversation;
197
+ /**
198
+ * Controls the ways in which the user can communicate with the application. Defaults to `"text"`
199
+ */
200
+ input?: "text" | "textAndVoice";
201
+ }
package/lib/voice.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { ConversationHandler } from '@nlxai/chat-core';
2
+ type VoiceRoomState = "inactive" | "pending" | "active" | "error";
3
+ interface VoiceHookReturn {
4
+ roomState: VoiceRoomState;
5
+ isUserSpeaking: boolean;
6
+ }
7
+ export declare const useVoice: ({ active, handler, }: {
8
+ active: boolean;
9
+ handler: ConversationHandler;
10
+ }) => VoiceHookReturn;
11
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nlxai/touchpoint-ui",
3
- "version": "1.0.5-alpha.0",
3
+ "version": "1.0.5-alpha.2",
4
4
  "description": "Web UI for Touchpoint",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -24,11 +24,12 @@
24
24
  "tsc": "tsc"
25
25
  },
26
26
  "dependencies": {
27
- "@nlxai/chat-core": "^1.0.5-alpha.0",
27
+ "@nlxai/chat-core": "^1.0.5-alpha.2",
28
28
  "@react-hookz/web": "^25.0.1",
29
29
  "@react-input/mask": "^2.0.4",
30
30
  "clsx": "^2.1.1",
31
31
  "htm": "^3.1.1",
32
+ "livekit-client": "^2.9.9",
32
33
  "marked": "^15.0.4",
33
34
  "ramda": "^0.30.1",
34
35
  "react": "^18.3.1",
@@ -56,5 +57,5 @@
56
57
  "publishConfig": {
57
58
  "access": "public"
58
59
  },
59
- "gitHead": "97ea824c481708936aae75fb9a051ec0e651ea39"
60
+ "gitHead": "af2fea91300ecfab6c3ca8832dc3b13971ba5f46"
60
61
  }