@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/docs/.nojekyll +1 -0
- package/docs/README.md +341 -0
- package/docs/interfaces/CustomCardProps.md +47 -0
- package/docs/interfaces/CustomCardRowProps.md +39 -0
- package/docs/interfaces/DateInputProps.md +29 -0
- package/docs/interfaces/IconButtonProps.md +71 -0
- package/docs/interfaces/Icons.IconProps.md +29 -0
- package/docs/interfaces/TextButtonProps.md +72 -0
- package/docs/interfaces/Theme.md +303 -0
- package/docs/interfaces/TouchpointConfiguration.md +89 -0
- package/docs/interfaces/TouchpointInstance.md +47 -0
- package/docs/modules/Icons.md +857 -0
- package/index.html +16 -1
- package/lib/App.d.ts +8 -33
- package/lib/components/Header.d.ts +4 -2
- package/lib/components/Input.d.ts +2 -0
- package/lib/components/Messages.d.ts +1 -0
- package/lib/components/ui/IconButton.d.ts +1 -1
- package/lib/index.d.ts +3 -4
- package/lib/index.js +21948 -6272
- package/lib/index.umd.js +113 -76
- package/lib/types.d.ts +57 -2
- package/lib/voice.d.ts +11 -0
- package/package.json +4 -3
package/index.html
CHANGED
|
@@ -88,6 +88,21 @@
|
|
|
88
88
|
aliquam bibendum.
|
|
89
89
|
</p>
|
|
90
90
|
</main>
|
|
91
|
-
<script type="module"
|
|
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
|
|
2
|
-
import {
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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 {};
|
|
@@ -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
|
|
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:
|
|
40
|
+
export declare const create: (props: TouchpointConfiguration) => Promise<TouchpointInstance>;
|
|
42
41
|
export { Container as PreviewContainer } from './preview';
|