@monology-io/chat-widget 1.0.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/README.md +241 -0
- package/dist/index.esm.js +15 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/types/App.test.d.ts +1 -0
- package/dist/types/components/Chat.d.ts +17 -0
- package/dist/types/components/ChatContainer.d.ts +6 -0
- package/dist/types/components/ChatSuggestions.d.ts +14 -0
- package/dist/types/components/ColorSelector.d.ts +7 -0
- package/dist/types/components/ConversationTitleBadge.d.ts +5 -0
- package/dist/types/components/ConversationsHistory.d.ts +7 -0
- package/dist/types/components/CustomIcons.d.ts +74 -0
- package/dist/types/components/FormRenderer.d.ts +54 -0
- package/dist/types/components/Header.d.ts +13 -0
- package/dist/types/components/MarkdownRenderer.d.ts +5 -0
- package/dist/types/components/MessageLoader.d.ts +2 -0
- package/dist/types/components/RenderWidget.d.ts +15 -0
- package/dist/types/components/Sidebar.d.ts +4 -0
- package/dist/types/components/StatusPopup.d.ts +14 -0
- package/dist/types/components/ThemeContext.d.ts +10 -0
- package/dist/types/components/ThemeToggle.d.ts +5 -0
- package/dist/types/components/UserVerificationPopup.d.ts +23 -0
- package/dist/types/components/Widget.d.ts +15 -0
- package/dist/types/components/axios.d.ts +3 -0
- package/dist/types/components/conversation.service.d.ts +7 -0
- package/dist/types/components/reportWebVitals.d.ts +2 -0
- package/dist/types/components/setupTests.d.ts +1 -0
- package/dist/types/components/token.service.d.ts +2 -0
- package/dist/types/components/types.d.ts +4 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function convertGradientToOpacity(gradient: any, opacity?: number): any;
|
|
2
|
+
export default Chat;
|
|
3
|
+
declare function Chat({ urlId, isInitConversationLoading, selectedColor, config, identity, onClose, }: {
|
|
4
|
+
urlId: any;
|
|
5
|
+
isInitConversationLoading: any;
|
|
6
|
+
selectedColor: any;
|
|
7
|
+
config: any;
|
|
8
|
+
identity?: null | undefined;
|
|
9
|
+
onClose: any;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare namespace Chat {
|
|
12
|
+
namespace propTypes {
|
|
13
|
+
const theme: PropTypes.Requireable<string>;
|
|
14
|
+
const selectedColor: PropTypes.Validator<string>;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
import PropTypes from "prop-types";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default ChatSuggestions;
|
|
2
|
+
declare function ChatSuggestions({ suggestions, onSuggestionClick, theme }: {
|
|
3
|
+
suggestions: any;
|
|
4
|
+
onSuggestionClick: any;
|
|
5
|
+
theme: any;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare namespace ChatSuggestions {
|
|
8
|
+
namespace propTypes {
|
|
9
|
+
const suggestions: PropTypes.Validator<(string | null | undefined)[]>;
|
|
10
|
+
const onSuggestionClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
11
|
+
const theme: PropTypes.Validator<string>;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
import PropTypes from "prop-types";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export function PlayIcon({ size, color, className }: {
|
|
2
|
+
size?: number | undefined;
|
|
3
|
+
color?: string | undefined;
|
|
4
|
+
className: any;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export function SunIcon({ size, color }: {
|
|
7
|
+
size?: number | undefined;
|
|
8
|
+
color?: string | undefined;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export function MoonIcon({ size, color }: {
|
|
11
|
+
size?: number | undefined;
|
|
12
|
+
color?: string | undefined;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export function ChevronDownIcon({ size, color }: {
|
|
15
|
+
size?: number | undefined;
|
|
16
|
+
color?: string | undefined;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export function CloseIcon({ size, color }: {
|
|
19
|
+
size?: number | undefined;
|
|
20
|
+
color?: string | undefined;
|
|
21
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export function ColorPickerIcon({ size, color }: {
|
|
23
|
+
size?: number | undefined;
|
|
24
|
+
color?: string | undefined;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export function LoaderIcon({ size, color, style, className }: {
|
|
27
|
+
size?: number | undefined;
|
|
28
|
+
color?: string | undefined;
|
|
29
|
+
style: any;
|
|
30
|
+
className: any;
|
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export function PlusIcon({ size, color, style }: {
|
|
33
|
+
size?: number | undefined;
|
|
34
|
+
color?: string | undefined;
|
|
35
|
+
style: any;
|
|
36
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export function MessagesSquareIcon({ size, color, style }: {
|
|
38
|
+
size?: number | undefined;
|
|
39
|
+
color?: string | undefined;
|
|
40
|
+
style: any;
|
|
41
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export function FullScreenIcon({ size, color, style }: {
|
|
43
|
+
size?: number | undefined;
|
|
44
|
+
color?: string | undefined;
|
|
45
|
+
style: any;
|
|
46
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export function ExitFullScreenIcon({ size, color, style }: {
|
|
48
|
+
size?: number | undefined;
|
|
49
|
+
color?: string | undefined;
|
|
50
|
+
style: any;
|
|
51
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export function StarIcon({ size, color, style }: {
|
|
53
|
+
size?: number | undefined;
|
|
54
|
+
color?: string | undefined;
|
|
55
|
+
style: any;
|
|
56
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export function CopyIcon({ size, color, className, style }: {
|
|
58
|
+
size?: number | undefined;
|
|
59
|
+
color?: string | undefined;
|
|
60
|
+
className: any;
|
|
61
|
+
style: any;
|
|
62
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
export function CheckIcon({ size, color, className, style }: {
|
|
64
|
+
size?: number | undefined;
|
|
65
|
+
color?: string | undefined;
|
|
66
|
+
className: any;
|
|
67
|
+
style: any;
|
|
68
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
export function CircleStopIcon({ size, color, className, style }: {
|
|
70
|
+
size?: number | undefined;
|
|
71
|
+
color?: string | undefined;
|
|
72
|
+
className: any;
|
|
73
|
+
style: any;
|
|
74
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export default FormRenderer;
|
|
2
|
+
declare function FormRenderer({ form, theme, onSubmit, onCancel, isSubmitting, isCancelling, selectedColor, urlId }: {
|
|
3
|
+
form: any;
|
|
4
|
+
theme?: string | undefined;
|
|
5
|
+
onSubmit: any;
|
|
6
|
+
onCancel: any;
|
|
7
|
+
isSubmitting?: boolean | undefined;
|
|
8
|
+
isCancelling?: boolean | undefined;
|
|
9
|
+
selectedColor: any;
|
|
10
|
+
urlId: any;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare namespace FormRenderer {
|
|
13
|
+
namespace propTypes {
|
|
14
|
+
const form: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
15
|
+
title: PropTypes.Requireable<string>;
|
|
16
|
+
description: PropTypes.Requireable<string>;
|
|
17
|
+
instructions: PropTypes.Requireable<string>;
|
|
18
|
+
fields: PropTypes.Validator<(PropTypes.InferProps<{
|
|
19
|
+
_id: PropTypes.Requireable<string>;
|
|
20
|
+
name: PropTypes.Validator<string>;
|
|
21
|
+
type: PropTypes.Validator<string>;
|
|
22
|
+
label: PropTypes.Validator<string>;
|
|
23
|
+
required: PropTypes.Requireable<boolean>;
|
|
24
|
+
min: PropTypes.Requireable<number>;
|
|
25
|
+
max: PropTypes.Requireable<number>;
|
|
26
|
+
minLength: PropTypes.Requireable<number>;
|
|
27
|
+
maxLength: PropTypes.Requireable<number>;
|
|
28
|
+
minSelections: PropTypes.Requireable<number>;
|
|
29
|
+
maxSelections: PropTypes.Requireable<number>;
|
|
30
|
+
minFiles: PropTypes.Requireable<number>;
|
|
31
|
+
maxFiles: PropTypes.Requireable<number>;
|
|
32
|
+
pattern: PropTypes.Requireable<string>;
|
|
33
|
+
patternMessage: PropTypes.Requireable<string>;
|
|
34
|
+
placeholder: PropTypes.Requireable<string>;
|
|
35
|
+
step: PropTypes.Requireable<number>;
|
|
36
|
+
options: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
37
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
38
|
+
accept: PropTypes.Requireable<string>;
|
|
39
|
+
maxSizeInMB: PropTypes.Requireable<number>;
|
|
40
|
+
instantUpload: PropTypes.Requireable<boolean>;
|
|
41
|
+
}> | null | undefined)[]>;
|
|
42
|
+
submitButtonText: PropTypes.Requireable<string>;
|
|
43
|
+
cancelButtonText: PropTypes.Requireable<string>;
|
|
44
|
+
}>>>;
|
|
45
|
+
const theme: PropTypes.Requireable<string>;
|
|
46
|
+
const onSubmit: PropTypes.Validator<(...args: any[]) => any>;
|
|
47
|
+
const onCancel: PropTypes.Validator<(...args: any[]) => any>;
|
|
48
|
+
const isSubmitting: PropTypes.Requireable<boolean>;
|
|
49
|
+
const isCancelling: PropTypes.Requireable<boolean>;
|
|
50
|
+
const selectedColor: PropTypes.Requireable<string>;
|
|
51
|
+
const urlId: PropTypes.Requireable<string>;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
import PropTypes from "prop-types";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default Header;
|
|
2
|
+
declare function Header({ text, initialTheme, onClose, colors, selectedColor, onColorChange, config, onToggleFullscreen, isFullscreen, isSmallScreen, }: {
|
|
3
|
+
text: any;
|
|
4
|
+
initialTheme: any;
|
|
5
|
+
onClose: any;
|
|
6
|
+
colors: any;
|
|
7
|
+
selectedColor: any;
|
|
8
|
+
onColorChange: any;
|
|
9
|
+
config: any;
|
|
10
|
+
onToggleFullscreen: any;
|
|
11
|
+
isFullscreen: any;
|
|
12
|
+
isSmallScreen: any;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default RenderWidget;
|
|
2
|
+
declare function RenderWidget({ urlId, onClose, hideLauncherButton, identity, }: {
|
|
3
|
+
urlId: any;
|
|
4
|
+
onClose?: (() => void) | undefined;
|
|
5
|
+
hideLauncherButton?: boolean | undefined;
|
|
6
|
+
identity: any;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare namespace RenderWidget {
|
|
9
|
+
namespace propTypes {
|
|
10
|
+
const urlId: PropTypes.Validator<string>;
|
|
11
|
+
const onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
|
+
const hideLauncherButton: PropTypes.Requireable<boolean>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
import PropTypes from "prop-types";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default StatusPopup;
|
|
2
|
+
declare function StatusPopup({ message, type, onClose }: {
|
|
3
|
+
message: any;
|
|
4
|
+
type: any;
|
|
5
|
+
onClose: any;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare namespace StatusPopup {
|
|
8
|
+
namespace propTypes {
|
|
9
|
+
const message: PropTypes.Validator<string>;
|
|
10
|
+
const type: PropTypes.Validator<string>;
|
|
11
|
+
const onClose: PropTypes.Validator<(...args: any[]) => any>;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
import PropTypes from "prop-types";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function ThemeProvider({ children }: {
|
|
2
|
+
children: any;
|
|
3
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export namespace ThemeProvider {
|
|
5
|
+
namespace propTypes {
|
|
6
|
+
const children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function useTheme(): any;
|
|
10
|
+
import PropTypes from "prop-types";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default UserVerificationPopup;
|
|
2
|
+
declare function UserVerificationPopup({ onClose, onValidationResponse, userDetails, urlId, selectedColor }: {
|
|
3
|
+
onClose: any;
|
|
4
|
+
onValidationResponse: any;
|
|
5
|
+
userDetails?: {} | undefined;
|
|
6
|
+
urlId: any;
|
|
7
|
+
selectedColor?: string | undefined;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare namespace UserVerificationPopup {
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
const onClose: PropTypes.Validator<(...args: any[]) => any>;
|
|
12
|
+
const onValidationResponse: PropTypes.Validator<(...args: any[]) => any>;
|
|
13
|
+
const userDetails: PropTypes.Requireable<PropTypes.InferProps<{
|
|
14
|
+
email: PropTypes.Requireable<string>;
|
|
15
|
+
firstName: PropTypes.Requireable<string>;
|
|
16
|
+
lastName: PropTypes.Requireable<string>;
|
|
17
|
+
phone: PropTypes.Requireable<string>;
|
|
18
|
+
}>>;
|
|
19
|
+
const urlId: PropTypes.Validator<string>;
|
|
20
|
+
const selectedColor: PropTypes.Requireable<string>;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
import PropTypes from "prop-types";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default Widget;
|
|
2
|
+
declare function Widget({ config, urlId, hideLauncherButton, onClose, identity, }: {
|
|
3
|
+
config: any;
|
|
4
|
+
urlId: any;
|
|
5
|
+
hideLauncherButton: any;
|
|
6
|
+
onClose: any;
|
|
7
|
+
identity: any;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare namespace Widget {
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
const config: PropTypes.Validator<object>;
|
|
12
|
+
const urlId: PropTypes.Validator<string>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
import PropTypes from "prop-types";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function getCurrentConversation(urlId: string): any;
|
|
2
|
+
export function getLocalConversations(urlId: string): any;
|
|
3
|
+
export function setLocalConversations(urlId: string, conversation: Object): void;
|
|
4
|
+
export function setCurrentConversation(urlId: string, conversation: Object): void;
|
|
5
|
+
export function removeCurrentConversation(urlId: string): void;
|
|
6
|
+
export function removeLocalConversations(urlId: string): void;
|
|
7
|
+
export function createIdentity(identity: Object, urlId: string): Promise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@monology-io/chat-widget",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.esm.js",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"style": "dist/styles.css",
|
|
8
|
+
"author": "Monology",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public",
|
|
12
|
+
"registry": "https://registry.npmjs.org"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/monology-io/chat-widget.git"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "rollup -c && tsc --emitDeclarationOnly",
|
|
23
|
+
"prepublishOnly": "npm run build"
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"description": "Monology Chat Widget",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"axios": "^1.7.8",
|
|
29
|
+
"canvas-confetti": "^1.9.4",
|
|
30
|
+
"react-markdown": "^9.0.1"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": ">=16.8.0",
|
|
34
|
+
"react-dom": ">=16.8.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@babel/core": "^7.26.10",
|
|
38
|
+
"@babel/preset-react": "^7.26.3",
|
|
39
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
40
|
+
"@rollup/plugin-commonjs": "^22.0.0",
|
|
41
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
42
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
43
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
44
|
+
"@rollup/plugin-typescript": "^8.3.2",
|
|
45
|
+
"@testing-library/jest-dom": "^5.17.0",
|
|
46
|
+
"@testing-library/react": "^13.4.0",
|
|
47
|
+
"@testing-library/user-event": "^13.5.0",
|
|
48
|
+
"@types/react": "^18.0.0",
|
|
49
|
+
"@types/react-dom": "^18.0.0",
|
|
50
|
+
"react": "^18.0.0",
|
|
51
|
+
"react-dom": "^18.0.0",
|
|
52
|
+
"react-scripts": "5.0.1",
|
|
53
|
+
"rollup": "^2.75.0",
|
|
54
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
55
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
56
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
57
|
+
"typescript": "^4.7.2",
|
|
58
|
+
"web-vitals": "^2.1.4"
|
|
59
|
+
}
|
|
60
|
+
}
|