@nlxai/touchpoint-ui 1.2.4-alpha.11 → 1.2.4-alpha.12

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/README.md CHANGED
@@ -210,6 +210,14 @@ optional bidirectional: BidirectionalConfig;
210
210
 
211
211
  Enables bidirectional mode of voice+. Will automatically set the bidirectional flag in the config.
212
212
 
213
+ ##### copy?
214
+
215
+ ```ts
216
+ optional copy: Partial<Copy>;
217
+ ```
218
+
219
+ Copy
220
+
213
221
  ---
214
222
 
215
223
  ### TouchpointInstance
@@ -321,15 +329,15 @@ A list containing the custom commands to set.
321
329
 
322
330
  The full theme expressed as CSS custom properties.
323
331
  This means that for instance colors can be made to switch automatically based on the system color mode by using the `light-dark()` CSS function.
324
- Note also that not all colors need to be provided manually. For instance if only `primary80` is provided, the rest of the primary colors will be computed automatically based on it.
325
- Therefore, for a fully custom but minimal theme, you only need to provide `accent`, `primary80`, `secondary80`, `background`, `overlay`, and potentially the warning and error colors.
332
+ Note also that not all colors need to be provided manually. For instance if only `primary` is provided, the rest of the primary colors will be computed automatically based on it.
333
+ Therefore, for a fully custom but minimal theme, you only need to provide `accent`, `primary`, `secondary`, `background`, `overlay`, and potentially the warning and error colors.
326
334
 
327
335
  #### Example
328
336
 
329
337
  ```typescript
330
338
  const theme: Partial<Theme> = {
331
- primary80: "light-dark(rgba(0, 2, 9, 0.8), rgba(255, 255, 255, 0.8))",
332
- secondary80: "light-dark(rgba(255, 255, 255, 0.8), rgba(0, 2, 9, 0.8))",
339
+ primary: "light-dark(rgb(0, 2, 9), rgb(255, 255, 255))",
340
+ secondary: "light-dark(rgb(255, 255, 255), rgb(0, 2, 9))",
333
341
  accent: "light-dark(rgb(28, 99, 218), rgb(174, 202, 255))",
334
342
  background: "light-dark(rgba(220, 220, 220, 0.9), rgba(0, 2, 9, 0.9))",
335
343
  };
@@ -345,6 +353,22 @@ fontFamily: string;
345
353
 
346
354
  Font family
347
355
 
356
+ ##### primary
357
+
358
+ ```ts
359
+ primary: string;
360
+ ```
361
+
362
+ Primary color
363
+
364
+ ##### primary90
365
+
366
+ ```ts
367
+ primary90: string;
368
+ ```
369
+
370
+ Primary color with 90% opacity
371
+
348
372
  ##### primary80
349
373
 
350
374
  ```ts
@@ -401,6 +425,22 @@ primary1: string;
401
425
 
402
426
  Primary color with 1% opacity
403
427
 
428
+ ##### secondary
429
+
430
+ ```ts
431
+ secondary: string;
432
+ ```
433
+
434
+ Secondary color
435
+
436
+ ##### secondary90
437
+
438
+ ```ts
439
+ secondary90: string;
440
+ ```
441
+
442
+ Secondary color with 90% opacity
443
+
404
444
  ##### secondary80
405
445
 
406
446
  ```ts
package/docs/README.md CHANGED
@@ -160,7 +160,7 @@ the context object
160
160
  ##### input?
161
161
 
162
162
  ```ts
163
- optional input: "text" | "voice" | "voiceMini";
163
+ optional input: "text" | "external" | "voice" | "voiceMini";
164
164
  ```
165
165
 
166
166
  Controls the ways in which the user can communicate with the application. Defaults to `"text"`
@@ -181,6 +181,14 @@ optional bidirectional: BidirectionalConfig;
181
181
 
182
182
  Enables bidirectional mode of voice+. Will automatically set the bidirectional flag in the config.
183
183
 
184
+ ##### copy?
185
+
186
+ ```ts
187
+ optional copy: Partial<Copy>;
188
+ ```
189
+
190
+ Copy
191
+
184
192
  ---
185
193
 
186
194
  ### TouchpointInstance
@@ -292,15 +300,15 @@ A list containing the custom commands to set.
292
300
 
293
301
  The full theme expressed as CSS custom properties.
294
302
  This means that for instance colors can be made to switch automatically based on the system color mode by using the `light-dark()` CSS function.
295
- Note also that not all colors need to be provided manually. For instance if only `primary80` is provided, the rest of the primary colors will be computed automatically based on it.
296
- Therefore, for a fully custom but minimal theme, you only need to provide `accent`, `primary80`, `secondary80`, `background`, `overlay`, and potentially the warning and error colors.
303
+ Note also that not all colors need to be provided manually. For instance if only `primary` is provided, the rest of the primary colors will be computed automatically based on it.
304
+ Therefore, for a fully custom but minimal theme, you only need to provide `accent`, `primary`, `secondary`, `background`, `overlay`, and potentially the warning and error colors.
297
305
 
298
306
  #### Example
299
307
 
300
308
  ```typescript
301
309
  const theme: Partial<Theme> = {
302
- primary80: "light-dark(rgba(0, 2, 9, 0.8), rgba(255, 255, 255, 0.8))",
303
- secondary80: "light-dark(rgba(255, 255, 255, 0.8), rgba(0, 2, 9, 0.8))",
310
+ primary: "light-dark(rgb(0, 2, 9), rgb(255, 255, 255))",
311
+ secondary: "light-dark(rgb(255, 255, 255), rgb(0, 2, 9))",
304
312
  accent: "light-dark(rgb(28, 99, 218), rgb(174, 202, 255))",
305
313
  background: "light-dark(rgba(220, 220, 220, 0.9), rgba(0, 2, 9, 0.9))",
306
314
  };
@@ -316,6 +324,22 @@ fontFamily: string;
316
324
 
317
325
  Font family
318
326
 
327
+ ##### primary
328
+
329
+ ```ts
330
+ primary: string;
331
+ ```
332
+
333
+ Primary color
334
+
335
+ ##### primary90
336
+
337
+ ```ts
338
+ primary90: string;
339
+ ```
340
+
341
+ Primary color with 90% opacity
342
+
319
343
  ##### primary80
320
344
 
321
345
  ```ts
@@ -372,6 +396,22 @@ primary1: string;
372
396
 
373
397
  Primary color with 1% opacity
374
398
 
399
+ ##### secondary
400
+
401
+ ```ts
402
+ secondary: string;
403
+ ```
404
+
405
+ Secondary color
406
+
407
+ ##### secondary90
408
+
409
+ ```ts
410
+ secondary90: string;
411
+ ```
412
+
413
+ Secondary color with 90% opacity
414
+
375
415
  ##### secondary80
376
416
 
377
417
  ```ts
@@ -1,21 +1,36 @@
1
- import { FC } from 'react';
2
- import { Context, ConversationHandler } from '@nlxai/core';
1
+ import { FC, Dispatch, SetStateAction } from 'react';
2
+ import { Context, ConversationHandler, Response } from '@nlxai/core';
3
3
  import { ColorMode, CustomModalityComponent } from '../interface';
4
- import { ModalitiesWithContext } from '../voice';
4
+ import { VoiceHandler, VoiceState } from '../voice';
5
5
  interface Props {
6
6
  colorMode: ColorMode;
7
7
  handler: ConversationHandler;
8
+ responses: Response[];
8
9
  speakersEnabled: boolean;
10
+ showTranscript: boolean;
9
11
  brandIcon?: string;
10
12
  className?: string;
11
13
  context?: Context;
12
14
  modalityComponents: Record<string, CustomModalityComponent<unknown>>;
13
15
  }
16
+ export type WidgetVoiceState = null | "loading" | {
17
+ type: "error";
18
+ error: string;
19
+ } | {
20
+ type: "success";
21
+ handler: VoiceHandler;
22
+ state?: VoiceState;
23
+ };
24
+ export declare const useWidgetVoiceState: () => [
25
+ WidgetVoiceState,
26
+ Dispatch<SetStateAction<WidgetVoiceState>>
27
+ ];
14
28
  export declare const VoiceModalities: FC<{
15
29
  className?: string;
16
- modalities: ModalitiesWithContext[];
30
+ responses: Response[];
17
31
  modalityComponents: Record<string, CustomModalityComponent<unknown>>;
18
32
  renderedAsOverlay: boolean;
33
+ showTranscript: boolean;
19
34
  handler: ConversationHandler;
20
35
  }>;
21
36
  export declare const FullscreenVoice: FC<Props>;
@@ -25,4 +25,9 @@ export declare const MessageChoices: FC<{
25
25
  responseIndex: number;
26
26
  messageIndex: number;
27
27
  }>;
28
+ export declare const UserMessage: FC<{
29
+ text: string;
30
+ files?: File[];
31
+ bubble: boolean;
32
+ }>;
28
33
  export declare const Messages: FC<MessagesProps>;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ export declare const Notice: FC<{
3
+ text: string;
4
+ }>;
@@ -1,8 +1,10 @@
1
- import { Context, ConversationHandler } from '@nlxai/core';
1
+ import { Context, ConversationHandler, Response } from '@nlxai/core';
2
2
  import { FC } from 'react';
3
3
  import { CustomModalityComponent } from '../interface';
4
4
  export declare const VoiceMini: FC<{
5
5
  modalityComponents: Record<string, CustomModalityComponent<unknown>>;
6
+ showTranscript: boolean;
7
+ responses: Response[];
6
8
  handler: ConversationHandler;
7
9
  brandIcon?: string;
8
10
  renderCollapse: boolean;