@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/index.html CHANGED
@@ -88,6 +88,21 @@
88
88
  aliquam bibendum.
89
89
  </p>
90
90
  </main>
91
- <script type="module" src="/src/index.tsx"></script>
91
+ <script type="module">
92
+ import { create } from "/src/index.tsx";
93
+ const touchpoint = await create({
94
+ config: {
95
+ applicationUrl:
96
+ "https://bots.dev.studio.nlx.ai/c/kQwAgKCx86vJ4r0PUSxYR/ON4zgwWnVofsz2NaiD38Z",
97
+ headers: {
98
+ "nlx-api-key": "XDE2Th70VhBSlhz2YA",
99
+ },
100
+ userId: "1234-5678",
101
+ languageCode: "en-US",
102
+ },
103
+ input: "textAndVoice",
104
+ });
105
+ touchpoint.expanded = true;
106
+ </script>
92
107
  </body>
93
108
  </html>
package/lib/App.d.ts CHANGED
@@ -1,39 +1,14 @@
1
- import { ConversationHandler, Config } from '@nlxai/chat-core';
2
- import { ColorMode, WindowSize, Theme, CustomModalityComponent } from './types';
1
+ import { ConversationHandler } from '@nlxai/chat-core';
2
+ import { TouchpointConfiguration, InitializeConversation } from './types';
3
3
  /**
4
4
  * Main Touchpoint creation properties object
5
5
  */
6
- export interface Props {
7
- /**
8
- * Configuration object for Touchpoint
9
- */
10
- config: Config;
11
- /**
12
- * Optional window size for the chat window, defaults to `half`
13
- */
14
- windowSize?: WindowSize;
15
- /**
16
- * Optional color mode for the chat window, defaults to `dark`
17
- */
18
- colorMode?: ColorMode;
19
- /**
20
- * URL of icon used to display the brand in the chat header
21
- */
22
- brandIcon?: string;
23
- /**
24
- * URL of icon used on the launch icon in the bottom right when the experience is collapsed.
25
- *
26
- * When set to `false`, no launch button is shown at all. When not set or set to `true`, the default launch icon is rendered.
27
- */
28
- launchIcon?: string | boolean;
29
- /**
30
- * Optional theme object to override default theme values
31
- */
32
- theme?: Partial<Theme>;
33
- /**
34
- * Optional custom modality components to render in Touchpoint
35
- */
36
- customModalities?: Record<string, CustomModalityComponent<any>>;
6
+ interface Props extends TouchpointConfiguration {
7
+ embedded: boolean;
8
+ onClose: ((event: Event) => void) | null;
9
+ enableSettings: boolean;
10
+ enabled: boolean;
11
+ initializeConversation: InitializeConversation;
37
12
  }
38
13
  export interface AppRef {
39
14
  setExpanded: (val: boolean) => void;
@@ -1,13 +1,15 @@
1
1
  import { FC } from 'react';
2
2
  import { WindowSize, ColorMode } from '../types';
3
3
  interface HeaderProps {
4
- windowSize: WindowSize;
4
+ windowSize: WindowSize | "embedded";
5
5
  colorMode: ColorMode;
6
6
  brandIcon?: string;
7
- collapse: () => void;
7
+ renderCollapse: boolean;
8
+ collapse: (event: Event) => void;
8
9
  reset: () => void;
9
10
  toggleSettings?: () => void;
10
11
  isSettingsOpen: boolean;
12
+ enabled: boolean;
11
13
  }
12
14
  export declare const Header: FC<HeaderProps>;
13
15
  export {};
@@ -10,6 +10,8 @@ interface InputProps {
10
10
  file: File;
11
11
  }) => void;
12
12
  choiceMessage?: ChoiceMessage;
13
+ voiceEnabled: boolean;
14
+ enabled: boolean;
13
15
  }
14
16
  export declare const Input: FC<InputProps>;
15
17
  export {};
@@ -10,6 +10,7 @@ export interface MessagesProps {
10
10
  lastBotResponseIndex?: number;
11
11
  customModalities: Record<string, CustomModalityComponent<any>>;
12
12
  className?: string;
13
+ enabled: boolean;
13
14
  }
14
15
  export declare const MessageChoices: FC<{
15
16
  handler: ConversationHandler;
@@ -9,7 +9,7 @@ import { IconProps } from './Icons';
9
9
  * - `coverup`: An icon button used to cover up or mask something.
10
10
  * - `overlay`: An icon button that appears over other content.
11
11
  */
12
- export type IconButtonType = "main" | "ghost" | "activated" | "coverup" | "overlay";
12
+ export type IconButtonType = "main" | "ghost" | "activated" | "coverup" | "error" | "overlay";
13
13
  /**
14
14
  * Props for the IconButton component
15
15
  */
package/lib/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { ConversationHandler } from '@nlxai/chat-core';
2
- import { Props } from './App';
3
2
  import { TextButton } from './components/ui/TextButton';
4
3
  import { IconButton } from './components/ui/IconButton';
5
4
  import { BaseText, SmallText } from './components/ui/Typography';
6
5
  import { CustomCard, CustomCardRow, CustomCardImageRow } from './components/ui/CustomCard';
7
6
  import { Carousel } from './components/ui/Carousel';
8
7
  import { DateInput } from './components/ui/DateInput';
8
+ import { TouchpointConfiguration } from './types';
9
9
  import * as Icons from "./components/ui/Icons";
10
10
  export { default as React } from 'react';
11
11
  export declare const html: (strings: TemplateStringsArray, ...values: any[]) => unknown;
@@ -14,8 +14,7 @@ export { type CustomCardProps, type CustomCardRowProps, } from './components/ui/
14
14
  export { type DateInputProps } from './components/ui/DateInput';
15
15
  export { type IconButtonProps, type IconButtonType, } from './components/ui/IconButton';
16
16
  export { type TextButtonProps } from './components/ui/TextButton';
17
- export { type Props } from './App';
18
- export { type ColorMode, type Theme, type WindowSize, type CustomModalityComponent, } from './types';
17
+ export { type InitializeConversation, type ColorMode, type Theme, type WindowSize, type CustomModalityComponent, type TouchpointConfiguration, } from './types';
19
18
  /**
20
19
  * Instance of a Touchpoint UI component
21
20
  */
@@ -38,5 +37,5 @@ export interface TouchpointInstance {
38
37
  * @param props - Configuration props for Touchpoint
39
38
  * @returns A promise that resolves to a TouchpointInstance
40
39
  */
41
- export declare const create: (props: Props) => Promise<TouchpointInstance>;
40
+ export declare const create: (props: TouchpointConfiguration) => Promise<TouchpointInstance>;
42
41
  export { Container as PreviewContainer } from './preview';