@nlxai/touchpoint-ui 1.0.5-alpha.9 → 1.1.1

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
@@ -89,7 +89,8 @@
89
89
  </p>
90
90
  </main>
91
91
  <script type="module">
92
- import { create } from "/src/index.tsx";
92
+ import { create, html } from "/src/index.tsx";
93
+
93
94
  const touchpoint = await create({
94
95
  config: {
95
96
  applicationUrl:
@@ -100,9 +101,9 @@
100
101
  userId: "1234-5678",
101
102
  languageCode: "en-US",
102
103
  },
103
- input: "voice",
104
+ input: "voiceMini",
105
+ initializeConversation: () => {},
104
106
  });
105
- touchpoint.expanded = true;
106
107
  </script>
107
108
  </body>
108
109
  </html>
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Accessibility information
3
+ */
4
+ export type AccessibilityInformation = Record<string, any>;
5
+ /**
6
+ * Accessibility information with ID
7
+ */
8
+ export interface InteractiveElementInfo extends AccessibilityInformation {
9
+ /**
10
+ * Form element ID (assigned by the analysis logic, not necessarily equal to the DOM ID)
11
+ */
12
+ id: string;
13
+ }
14
+ /**
15
+ * Page forms with elements
16
+ */
17
+ export interface PageForms {
18
+ /**
19
+ * Page context
20
+ */
21
+ context: InteractiveElementInfo[];
22
+ /**
23
+ * Form element references
24
+ */
25
+ formElements: Record<string, Element>;
26
+ }
27
+ /**
28
+ * Analyze page forms
29
+ * @returns pageForms
30
+ */
31
+ export declare const analyzePageForms: () => PageForms;
@@ -1,17 +1,29 @@
1
- import { Dispatch, SetStateAction, FC } from 'react';
1
+ import { Dispatch, SetStateAction, FC, ReactNode } from 'react';
2
2
  import { Context, ConversationHandler } from '@nlxai/chat-core';
3
- import { ColorMode } from '../types';
4
- import { SoundCheck } from '../voice';
3
+ import { ColorMode, InitializeConversation, CustomModalityComponent } from '../types';
4
+ import { SoundCheck, ModalitiesWithContext } from '../voice';
5
5
  interface Props {
6
6
  colorMode: ColorMode;
7
7
  handler: ConversationHandler;
8
+ speakersEnabled: boolean;
9
+ brandIcon?: string;
8
10
  className?: string;
9
11
  active: boolean;
10
12
  setActive: Dispatch<SetStateAction<boolean>>;
11
13
  context?: Context;
14
+ initializeConversation: InitializeConversation;
15
+ customModalities?: Record<string, CustomModalityComponent<unknown>>;
12
16
  }
13
17
  export declare const SoundCheckUi: FC<{
14
18
  soundCheck: SoundCheck | null;
15
19
  }>;
20
+ export declare const VoiceModalities: FC<{
21
+ Wrapper?: FC<{
22
+ children: ReactNode;
23
+ }>;
24
+ roomData: ModalitiesWithContext;
25
+ customModalities: Record<string, CustomModalityComponent<unknown>>;
26
+ handler: ConversationHandler;
27
+ }>;
16
28
  export declare const FullscreenVoice: FC<Props>;
17
29
  export {};
@@ -1,8 +1,13 @@
1
- import { FC } from 'react';
1
+ import { SetStateAction, Dispatch, FC } from 'react';
2
2
  import { WindowSize, ColorMode } from '../types';
3
3
  interface HeaderProps {
4
4
  windowSize: WindowSize | "embedded";
5
5
  colorMode: ColorMode;
6
+ errorThemedCloseButton?: boolean;
7
+ speakerControls?: {
8
+ enabled: boolean;
9
+ setEnabled: Dispatch<SetStateAction<boolean>>;
10
+ };
6
11
  brandIcon?: string;
7
12
  renderCollapse: boolean;
8
13
  collapse: (event: Event) => void;
@@ -1,6 +1,5 @@
1
1
  import { FC } from 'react';
2
2
  import { ConversationHandler, UploadUrl } from '@nlxai/chat-core';
3
- import { ChoiceMessage } from '../types';
4
3
  interface InputProps {
5
4
  className?: string;
6
5
  handler: ConversationHandler;
@@ -9,7 +8,6 @@ interface InputProps {
9
8
  uploadId: string;
10
9
  file: File;
11
10
  }) => void;
12
- choiceMessage?: ChoiceMessage;
13
11
  enabled: boolean;
14
12
  }
15
13
  export declare const Input: FC<InputProps>;
@@ -11,7 +11,7 @@ export interface MessagesProps {
11
11
  colorMode: ColorMode;
12
12
  uploadedFiles: Record<string, File>;
13
13
  lastBotResponseIndex?: number;
14
- customModalities: Record<string, CustomModalityComponent<any>>;
14
+ customModalities: Record<string, CustomModalityComponent<unknown>>;
15
15
  className?: string;
16
16
  enabled: boolean;
17
17
  }
@@ -20,6 +20,5 @@ export declare const MessageChoices: FC<{
20
20
  message: BotMessage;
21
21
  responseIndex: number;
22
22
  messageIndex: number;
23
- className?: string;
24
23
  }>;
25
24
  export declare const Messages: FC<MessagesProps>;
@@ -2,6 +2,7 @@ import { FC } from 'react';
2
2
  import { ConversationHandler } from '@nlxai/chat-core';
3
3
  interface SettingsProps {
4
4
  onClose: () => void;
5
+ reset: () => void;
5
6
  handler: ConversationHandler;
6
7
  className?: string;
7
8
  }
@@ -1,6 +1,9 @@
1
1
  import { Context, ConversationHandler } from '@nlxai/chat-core';
2
2
  import { FC } from 'react';
3
+ import { CustomModalityComponent } from '../types';
3
4
  export declare const VoiceMini: FC<{
5
+ customModalities: Record<string, CustomModalityComponent<unknown>>;
4
6
  handler: ConversationHandler;
7
+ onClose: () => void;
5
8
  context?: Context;
6
9
  }>;
@@ -16,6 +16,14 @@ export interface CustomCardProps {
16
16
  * Handler function for when the card is clicked
17
17
  */
18
18
  onClick?: () => void;
19
+ /**
20
+ * Transform the card into an anchor tag with the href specified
21
+ */
22
+ href?: string;
23
+ /**
24
+ * Specify whether the URL should take the user to a new tab
25
+ */
26
+ newTab?: boolean;
19
27
  }
20
28
  export declare const CustomCard: FC<CustomCardProps>;
21
29
  export declare const CustomCardImageRow: FC<{
@@ -35,4 +35,8 @@ export interface IconButtonProps {
35
35
  */
36
36
  Icon: FC<IconProps>;
37
37
  }
38
+ export declare const UnsemanticIconButton: FC<{
39
+ type: IconButtonType;
40
+ Icon: FC<IconProps>;
41
+ }>;
38
42
  export declare const IconButton: FC<IconButtonProps>;
@@ -56,3 +56,4 @@ export declare const Time: Icon;
56
56
  export declare const Undo: Icon;
57
57
  export declare const Refresh: Icon;
58
58
  export declare const Help: Icon;
59
+ export declare const OpenLink: Icon;
package/lib/index.d.ts CHANGED
@@ -7,14 +7,29 @@ import { Carousel } from './components/ui/Carousel';
7
7
  import { DateInput } from './components/ui/DateInput';
8
8
  import { TouchpointConfiguration } from './types';
9
9
  import * as Icons from "./components/ui/Icons";
10
+ export { analyzePageForms, type InteractiveElementInfo, type PageForms, type AccessibilityInformation, } from './analyzePageForms';
11
+ /**
12
+ * If you wish to build custom modalities using JSX, you will want to
13
+ *
14
+ * ```javascript
15
+ * import { React } from "@nlx/touchpoint-ui";
16
+ * ```
17
+ *
18
+ * instead of importing from "react" directly. This ensures that the custom modalities will
19
+ * be running in the same React context as the Touchpoint UI using the correct version of React.
20
+ */
10
21
  export { default as React } from 'react';
22
+ /**
23
+ * Package version
24
+ */
25
+ export declare const version: string;
11
26
  export declare const html: (strings: TemplateStringsArray, ...values: any[]) => unknown;
12
27
  export { TextButton, IconButton, BaseText, SmallText, DateInput, Carousel, CustomCard, CustomCardRow, CustomCardImageRow, Icons, };
13
28
  export { type CustomCardProps, type CustomCardRowProps, } from './components/ui/CustomCard';
14
29
  export { type DateInputProps } from './components/ui/DateInput';
15
30
  export { type IconButtonProps, type IconButtonType, } from './components/ui/IconButton';
16
31
  export { type TextButtonProps } from './components/ui/TextButton';
17
- export { type InitializeConversation, type ColorMode, type Theme, type WindowSize, type CustomModalityComponent, type TouchpointConfiguration, } from './types';
32
+ export { type InitializeConversation, type ColorMode, type Input, type Theme, type WindowSize, type CustomModalityComponent, type TouchpointConfiguration, } from './types';
18
33
  /**
19
34
  * Instance of a Touchpoint UI component
20
35
  */