@nlxai/touchpoint-ui 1.1.7 → 1.1.8-alpha.0

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
@@ -1,10 +1,28 @@
1
- # touchpoint-prototype
1
+ # Touchpoint
2
+
3
+ Touchpoint UI provides a customizable chat interface that you can embed in your web applications. Touchpoint UI allows users to interact with your application and provides a seamless conversational experience.
4
+
5
+ ```js
6
+ import { create } from "@nlxai/touchpoint-ui";
7
+
8
+ const touchpoint = await create({
9
+ config: {
10
+ applicationUrl: "REPLACE_WITH_APPLICATION_URL",
11
+ headers: {
12
+ "nlx-api-key": "REPLACE_WITH_API_KEY",
13
+ },
14
+ languageCode: "en-US",
15
+ userId: "REPLACE_WITH_USER_ID",
16
+ },
17
+ colorMode: "light",
18
+ input: "voice",
19
+ theme: { fontFamily: '"Neue Haas Grotesk", sans-serif', accent: "#AECAFF" },
20
+ });
21
+ ```
22
+
23
+ [Official documentation](https://docs.nlx.ai/platform/touchpoint)
2
24
 
3
25
  ## Run locally
4
26
 
5
27
  `npm install`
6
28
  `npm run dev`
7
-
8
- ## Standalone dev environment and design system
9
-
10
- `npm run design-system`
package/lib/App.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ConversationHandler } from '@nlxai/chat-core';
1
+ import { ConversationHandler } from '@nlxai/core';
2
2
  import { NormalizedTouchpointConfiguration } from './types';
3
3
  /**
4
4
  * Main Touchpoint creation properties object
@@ -1,4 +1,4 @@
1
- import { ConversationHandler } from '@nlxai/chat-core';
1
+ import { ConversationHandler } from '@nlxai/core';
2
2
  export declare const gatherAutomaticContext: (handler: ConversationHandler, setPageState: (state: {
3
3
  formElements: any;
4
4
  links: Record<string, string>;
@@ -1,4 +1,4 @@
1
- import { ConversationHandler } from '@nlxai/chat-core';
1
+ import { ConversationHandler } from '@nlxai/core';
2
2
  import { BidirectionalConfig } from '../types';
3
3
  export declare const commandHandler: (handler: ConversationHandler, bidirectional: BidirectionalConfig, pageState: {
4
4
  current: {
@@ -1,5 +1,5 @@
1
- import { FC, ReactNode } from 'react';
2
- import { Context, ConversationHandler } from '@nlxai/chat-core';
1
+ import { FC } from 'react';
2
+ import { Context, ConversationHandler } from '@nlxai/core';
3
3
  import { ColorMode, InitializeConversation, CustomModalityComponent } from '../types';
4
4
  import { ModalitiesWithContext } from '../voice';
5
5
  interface Props {
@@ -13,10 +13,8 @@ interface Props {
13
13
  customModalities?: Record<string, CustomModalityComponent<unknown>>;
14
14
  }
15
15
  export declare const VoiceModalities: FC<{
16
- Wrapper?: FC<{
17
- children: ReactNode;
18
- }>;
19
- roomData: ModalitiesWithContext;
16
+ className?: string;
17
+ modalities: ModalitiesWithContext[];
20
18
  customModalities: Record<string, CustomModalityComponent<unknown>>;
21
19
  handler: ConversationHandler;
22
20
  }>;
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { ConversationHandler, UploadUrl } from '@nlxai/chat-core';
2
+ import { ConversationHandler, UploadUrl } from '@nlxai/core';
3
3
  interface InputProps {
4
4
  className?: string;
5
5
  handler: ConversationHandler;
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { Response, ConversationHandler, BotMessage } from '@nlxai/chat-core';
2
+ import { Response, ConversationHandler, ApplicationMessage } from '@nlxai/core';
3
3
  import { CustomModalityComponent, ColorMode } from '../types';
4
4
  export interface MessagesProps {
5
5
  isWaiting: boolean;
@@ -10,14 +10,14 @@ export interface MessagesProps {
10
10
  chatMode: boolean;
11
11
  colorMode: ColorMode;
12
12
  uploadedFiles: Record<string, File>;
13
- lastBotResponseIndex?: number;
13
+ lastApplicationResponseIndex?: number;
14
14
  customModalities: Record<string, CustomModalityComponent<unknown>>;
15
15
  className?: string;
16
16
  enabled: boolean;
17
17
  }
18
18
  export declare const MessageChoices: FC<{
19
19
  handler: ConversationHandler;
20
- message: BotMessage;
20
+ message: ApplicationMessage;
21
21
  responseIndex: number;
22
22
  messageIndex: number;
23
23
  }>;
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { ConversationHandler } from '@nlxai/chat-core';
2
+ import { ConversationHandler } from '@nlxai/core';
3
3
  interface SettingsProps {
4
4
  onClose: () => void;
5
5
  reset: () => void;
@@ -1,4 +1,4 @@
1
- import { Context, ConversationHandler } from '@nlxai/chat-core';
1
+ import { Context, ConversationHandler } from '@nlxai/core';
2
2
  import { FC } from 'react';
3
3
  import { CustomModalityComponent } from '../types';
4
4
  export declare const VoiceMini: FC<{
@@ -0,0 +1,3 @@
1
+ import { CustomModalityComponent } from '../../types';
2
+ import { CardData } from './shared';
3
+ export declare const DefaultCard: CustomModalityComponent<CardData>;
@@ -0,0 +1,6 @@
1
+ import { CustomModalityComponent } from '../../types';
2
+ import { SaveAs, CardData } from './shared';
3
+ export declare const DefaultCarousel: CustomModalityComponent<{
4
+ cards: CardData[];
5
+ $saveAs: SaveAs;
6
+ }>;
@@ -0,0 +1,5 @@
1
+ import { SaveAs } from './shared';
2
+ import { CustomModalityComponent } from '../../types';
3
+ export declare const DefaultDateInput: CustomModalityComponent<{
4
+ $saveAs: SaveAs;
5
+ }>;
@@ -0,0 +1,13 @@
1
+ import { ConversationHandler } from '@nlxai/core';
2
+ export interface SaveAs {
3
+ type: "slot" | "context";
4
+ id: string;
5
+ }
6
+ export interface CardData {
7
+ id?: string;
8
+ thumbnail?: string;
9
+ thumbnailAlt?: string;
10
+ label?: string;
11
+ value?: string;
12
+ }
13
+ export declare const saveFn: ($saveAs: SaveAs, conversationHandler: ConversationHandler) => ((val: any) => void);
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  export declare const Carousel: FC<{
3
+ className?: string;
3
4
  children: ReactNode;
4
5
  }>;
@@ -4,6 +4,10 @@ import { Icon } from '../ui/Icons';
4
4
  * Props for the CustomCard component
5
5
  */
6
6
  export interface CustomCardProps {
7
+ /**
8
+ * Class name
9
+ */
10
+ className?: string;
7
11
  /**
8
12
  * Content to be rendered inside the card.
9
13
  */
@@ -8,5 +8,9 @@ export interface DateInputProps {
8
8
  * @param date - The submitted date in YYYY-MM-DD format
9
9
  */
10
10
  onSubmit?: (date: string) => void;
11
+ /**
12
+ * Class name
13
+ */
14
+ className?: string;
11
15
  }
12
16
  export declare const DateInput: FC<DateInputProps>;
@@ -2,7 +2,9 @@ import { FC, ReactNode } from 'react';
2
2
  export declare const BaseText: FC<{
3
3
  children: ReactNode;
4
4
  faded?: boolean;
5
+ className?: string;
5
6
  }>;
6
7
  export declare const SmallText: FC<{
7
8
  children: ReactNode;
9
+ className?: string;
8
10
  }>;
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ConversationHandler } from '@nlxai/chat-core';
1
+ import { ConversationHandler } from '@nlxai/core';
2
2
  import { TextButton } from './components/ui/TextButton';
3
3
  import { IconButton } from './components/ui/IconButton';
4
4
  import { Ripple } from './components/Ripple';