lulichat 1.0.3 → 1.0.5
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/package.json +7 -3
- package/dist/components/ChatIcon.d.ts +0 -5
- package/dist/components/ChatInterface.d.ts +0 -9
- package/dist/components/ChatWidget.d.ts +0 -7
- package/dist/components/ChatWidget.test.d.ts +0 -1
- package/dist/components/ContactForm.d.ts +0 -11
- package/dist/components/LuliChat.test.d.ts +0 -1
- package/dist/components/ui/Button.d.ts +0 -8
- package/dist/components/ui/Form.d.ts +0 -33
- package/dist/components/ui/Icons.d.ts +0 -10
- package/dist/components/ui/Input.d.ts +0 -9
- package/dist/constants.d.ts +0 -32
- package/dist/hooks/useSocket.d.ts +0 -4
- package/dist/lib/socket.d.ts +0 -17
- package/dist/main.d.ts +0 -1
- package/dist/style.css +0 -1
- package/dist/utils/api.d.ts +0 -15
- package/dist/utils/index.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lulichat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "A React library for integrating a support chat feature into web applications.",
|
|
5
5
|
"main": "dist/lulichat-support.umd.js",
|
|
6
6
|
"module": "dist/lulichat-support.es.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"class-variance-authority": "^0.7.1",
|
|
26
|
-
"lulichat": "^1.0.
|
|
26
|
+
"lulichat": "^1.0.3",
|
|
27
27
|
"react": "^18.0.0",
|
|
28
28
|
"react-dom": "^18.0.0",
|
|
29
29
|
"socket.io-client": "^4.5.0"
|
|
@@ -52,7 +52,11 @@
|
|
|
52
52
|
"react-dom": "^18.0.0"
|
|
53
53
|
},
|
|
54
54
|
"files": [
|
|
55
|
-
"dist"
|
|
55
|
+
"dist/index.d.ts",
|
|
56
|
+
"dist/types",
|
|
57
|
+
"dist/lulichat-support.es.js",
|
|
58
|
+
"dist/components/LuliChat.js",
|
|
59
|
+
"dist/components/LuliChat.d.ts"
|
|
56
60
|
],
|
|
57
61
|
"homepage": "https://github.com/tjdibbs/lulichat-support",
|
|
58
62
|
"repository": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ChatSession, CompanyInfo } from "../types";
|
|
3
|
-
interface ChatInterfaceProps {
|
|
4
|
-
session: ChatSession;
|
|
5
|
-
companyInfo: CompanyInfo["data"];
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const ChatInterface: React.FC<ChatInterfaceProps>;
|
|
9
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ContactInfo } from "@/types";
|
|
2
|
-
import React from "react";
|
|
3
|
-
interface ContactFormProps {
|
|
4
|
-
companyName: string;
|
|
5
|
-
onSubmit: (contactInfo: ContactInfo) => void;
|
|
6
|
-
onSkip?: () => void;
|
|
7
|
-
allowAnonymous: boolean;
|
|
8
|
-
isLoading: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare const ContactForm: React.FC<ContactFormProps>;
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "@testing-library/jest-dom";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
-
variant?: "primary" | "destructive" | "outline" | "secondary" | "ghost" | "link";
|
|
4
|
-
size?: "md" | "sm" | "lg" | "icon";
|
|
5
|
-
shape?: "circle" | "rounded" | "none";
|
|
6
|
-
}
|
|
7
|
-
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
-
export default Button;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface FormProps<T> extends React.FormHTMLAttributes<HTMLFormElement> {
|
|
3
|
-
onValuesChange?: (values: T) => void;
|
|
4
|
-
initialValues?: T;
|
|
5
|
-
onFinish?: (values: T) => void;
|
|
6
|
-
}
|
|
7
|
-
export interface FormRefObject<T> {
|
|
8
|
-
getValues(): T;
|
|
9
|
-
getFieldValue: <K extends keyof T>(fieldName: K) => T[K];
|
|
10
|
-
elementRef: () => HTMLFormElement | null;
|
|
11
|
-
setFieldValue: <K extends keyof T>(fieldName: K, value: T[K]) => void;
|
|
12
|
-
}
|
|
13
|
-
type FormComponent = React.ForwardRefExoticComponent<FormProps<Record<string, any>> & React.RefAttributes<FormRefObject<Record<string, any>>>> & {
|
|
14
|
-
Item: typeof FormItem;
|
|
15
|
-
Label: typeof FormLabel;
|
|
16
|
-
useForm: typeof useForm;
|
|
17
|
-
};
|
|
18
|
-
declare const Form: FormComponent;
|
|
19
|
-
interface FormItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
20
|
-
name?: string;
|
|
21
|
-
children?: React.ReactNode;
|
|
22
|
-
label?: string;
|
|
23
|
-
required?: boolean;
|
|
24
|
-
error?: string;
|
|
25
|
-
}
|
|
26
|
-
declare const FormItem: React.ForwardRefExoticComponent<FormItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
-
interface FormLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
28
|
-
required?: boolean;
|
|
29
|
-
htmlFor?: string;
|
|
30
|
-
}
|
|
31
|
-
declare const FormLabel: React.ForwardRefExoticComponent<FormLabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
32
|
-
declare const useForm: <T>(initialValues: T) => FormRefObject<T>[];
|
|
33
|
-
export default Form;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const Uploading: React.FC<React.SVGProps<any>>;
|
|
2
|
-
export declare const DropdownArrow: React.FC<React.SVGProps<any>>;
|
|
3
|
-
export declare const Attachment: React.FC<React.SVGProps<any>>;
|
|
4
|
-
export declare const Close: React.FC<React.SVGProps<any>>;
|
|
5
|
-
export declare const Hello: React.FC<React.SVGProps<any>>;
|
|
6
|
-
export declare const Headphones: React.FC<React.SVGProps<any>>;
|
|
7
|
-
export declare const User: React.FC<React.SVGProps<any>>;
|
|
8
|
-
export declare const Send: React.FC<React.SVGProps<any>>;
|
|
9
|
-
export declare const Loader: React.FC<React.SVGProps<any>>;
|
|
10
|
-
export declare const MessageCircle: React.FC<React.SVGProps<any>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
-
}
|
|
4
|
-
type InputComponent = React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>> & {
|
|
5
|
-
Password: typeof Password;
|
|
6
|
-
};
|
|
7
|
-
declare const Input: InputComponent;
|
|
8
|
-
declare const Password: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
-
export default Input;
|
package/dist/constants.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare const Colors: {
|
|
2
|
-
readonly primary: "#0E0E2C";
|
|
3
|
-
readonly secondary: "#755AE2";
|
|
4
|
-
readonly dark: "#0D0D0D";
|
|
5
|
-
readonly mood2: "#131313";
|
|
6
|
-
readonly dark2: "#8770E6";
|
|
7
|
-
readonly light_Dark: "#D3D3F1";
|
|
8
|
-
readonly secondary_dark: "#9278FA";
|
|
9
|
-
readonly helper: "#F5F3FF";
|
|
10
|
-
readonly cod: "#E4E4E4";
|
|
11
|
-
readonly yellow_500: "#BF6700";
|
|
12
|
-
readonly darkgreen: "#099976";
|
|
13
|
-
readonly light_gray: "#F8F9FB";
|
|
14
|
-
readonly orange: "#FF6B00";
|
|
15
|
-
readonly text: "#242424";
|
|
16
|
-
readonly BodyText: "#4A4A68";
|
|
17
|
-
readonly BodyTextAlpha: "#56566A";
|
|
18
|
-
readonly BodyTextLight: "#8C8CA1";
|
|
19
|
-
readonly green: "#12B669";
|
|
20
|
-
readonly blue: "#24214E";
|
|
21
|
-
readonly white: "#fff";
|
|
22
|
-
readonly gray: "#F5F7F9";
|
|
23
|
-
readonly sand: "#818181";
|
|
24
|
-
readonly icon: "#4E4E4E";
|
|
25
|
-
readonly tag: "#F3F4F6";
|
|
26
|
-
readonly outline: "#F1F8FF";
|
|
27
|
-
readonly modal: "#F9FAFB";
|
|
28
|
-
readonly border: "#E9E9E9";
|
|
29
|
-
readonly flat: "#F6F6F6";
|
|
30
|
-
readonly pale: "#EAEDF0;";
|
|
31
|
-
readonly grey: "#F8F8F8";
|
|
32
|
-
};
|
package/dist/lib/socket.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ChatMessage } from "../types";
|
|
2
|
-
export declare class ChatSocket {
|
|
3
|
-
private socket;
|
|
4
|
-
private token;
|
|
5
|
-
private sessionId;
|
|
6
|
-
private onMessageCallback?;
|
|
7
|
-
private onStatusCallback?;
|
|
8
|
-
private reconnectAttempts;
|
|
9
|
-
private maxReconnectAttempts;
|
|
10
|
-
constructor(token: string, sessionId: string, baseUrl?: string);
|
|
11
|
-
private connect;
|
|
12
|
-
private handleReconnect;
|
|
13
|
-
sendMessage(content: string): void;
|
|
14
|
-
onMessage(callback: (message: ChatMessage) => void): void;
|
|
15
|
-
onStatus(callback: (status: "connected" | "disconnected" | "error") => void): void;
|
|
16
|
-
disconnect(): void;
|
|
17
|
-
}
|
package/dist/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./index.css";
|
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inclusive+Sans:ital@0;1&family=Outfit:wght@100..900&display=swap";:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary-color: #755ae2;--primary: 251.91deg 70.1% 61.96%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%}.lulichat,.lulichat *{box-sizing:border-box;margin:0;padding:0;border:none;outline:none}.lulichat button{-moz-appearance:none;appearance:none;-webkit-appearance:none;outline:none}.lulichat{position:fixed;z-index:50;display:flex;flex-direction:column;row-gap:10px;font-family:Outfit,sans-serif;font-optical-sizing:auto;font-weight:300;max-width:400px}.lulichat-main{background-color:var(--background);color:var(--foreground);border-radius:12px;border:4px solid hsl(var(--primary));box-shadow:4px 4px 20px 4px #0000001a;display:flex;flex-direction:column}.lulichat-bottom-right{bottom:1rem;right:1rem}.lulichat-bottom-left{bottom:1rem;left:1rem}.lulichat-top-right{top:1rem;right:1rem}.lulichat-container-top-left{top:1rem;left:1rem}.lulichat-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;white-space:nowrap;font-size:1rem;font-weight:500;transition:background-color .2s,color .2s;outline:none;cursor:pointer}.lulichat-btn.lulichat-contact-form-btn{background-color:#fff;color:hsl(var(--primary))}.lulichat-btn-group{display:flex;gap:.4rem}.lulichat-btn:disabled{cursor:not-allowed;opacity:.5}.lulichat-btn-rounded{border-radius:1.5rem}.lulichat-btn-none{border-radius:0rem}.lulichat-btn-circle{border-radius:50%}.lulichat-btn:focus-visible{outline:2px solid var(--ring);outline-offset:2px}.lulichat-btn:disabled{pointer-events:none;opacity:.5}.lulichat-btn-primary{background-color:hsl(var(--primary));color:#fff}.lulichat-btn-primary:hover:not(:disabled){background-color:#000}.lulichat-btn-default{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.lulichat-btn-default:hover{background:rgba(var(--primary),.9)}.lulichat-btn-destructive{background:hsl(var(--destructive));color:hsl(var(--destructive-foreground))}.lulichat-btn-destructive:hover{background:rgba(var(--destructive),.9)}.lulichat-btn-outline{border:1px solid hsl(var(--border));background:hsl(var(--background));color:inherit}.lulichat-btn-outline:hover{background:hsl(var(--accent));color:hsl(var(--accent-foreground))}.lulichat-btn-secondary{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground))}.lulichat-btn-secondary:hover{background:hsl(var(--accent))}.lulichat-btn-ghost:hover{background:hsl(var(--accent));color:hsl(var(--accent-foreground))}.lulichat-btn-link{color:hsl(var(--primary));text-underline-offset:4px}.lulichat-btn-link:hover{text-decoration:underline}.lulichat-btn-md{height:2.5rem;padding:.5rem 1rem}.lulichat-btn-sm{height:2.25rem;padding:0 .75rem}.lulichat-btn-lg{height:2.75rem;padding:0 2rem}.lulichat-btn-icon{height:2.5rem;width:2.5rem}.lulichat-contact-form{background-color:hsl(var(--primary));padding:16px;color:#fff}.lulichat-form-group{max-height:0;opacity:0;overflow:hidden;transition:max-height .7s cubic-bezier(.22,1,.36,1),opacity .7s cubic-bezier(.22,1,.36,1)}.lulichat-form-group.open{opacity:1;max-height:500px}.lulichat-form-header{margin-bottom:1.5rem}.lulichat-form-item{margin-bottom:1rem;display:block;flex-direction:column;gap:.5rem}.lulichat-form-label{font-size:1rem;font-weight:500;display:block;margin-bottom:.25rem}.lulichat-form-item input,.lulichat-form-item textarea,.lulichat-input{padding:.7rem .75rem;border:1px solid #d1d5db;border-radius:.5rem;font-size:1rem;width:100%;transition:border-color .2s;transition:background-color .5s;background-color:#fff;color:#222}input:-internal-autofill-selected,textarea:-webkit-autofill{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#0003!important;color:fieldtext!important}.lulichat-form-item input.transparent{background-color:#0003!important;color:#fff}.lulichat-form-item input.error{border-color:red}.lulichat-form-item input.transparent:hover,.lulichat-form-item input.transparent:focus{background-color:#0006!important}.lulichat-form-item input.transparent::placeholder{color:#fff}.lulichat-form-item input:focus,.lulichat-form-item textarea:focus{border-color:#ceced2;outline:none}.lulichat-form-item input:focus::placeholder,.lulichat-form-item textarea:focus::placeholder{opacity:.5}.lulichat-form-item input[aria-invalid=true],.lulichat-form-item textarea[aria-invalid=true]{border-color:#ef4444}.lulichat-form-item .error{color:#fd8989;font-size:.875rem;margin-top:.25rem;font-weight:400}.lulichat-tag{padding:5px 8px;font-weight:500;border-radius:24px;font-size:.75rem;text-transform:capitalize!important;background-color:#e7e6e6;cursor:pointer;transition:background-color .4s,color .2s}.lulichat-tag:hover{background-color:var(--primary-color);color:#fff}
|
package/dist/utils/api.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { LuliChatConfig, ContactInfo, CompanyInfo } from "../types";
|
|
2
|
-
export declare class LuliChatAPI {
|
|
3
|
-
private config;
|
|
4
|
-
private baseUrl;
|
|
5
|
-
constructor(config: LuliChatConfig);
|
|
6
|
-
getCompanyInfo(): Promise<CompanyInfo>;
|
|
7
|
-
submitContactInfo(contactInfo?: ContactInfo): Promise<{
|
|
8
|
-
token: string;
|
|
9
|
-
sessionId: string;
|
|
10
|
-
}>;
|
|
11
|
-
startAnonymousChat(): Promise<{
|
|
12
|
-
token: string;
|
|
13
|
-
sessionId: string;
|
|
14
|
-
}>;
|
|
15
|
-
}
|
package/dist/utils/index.d.ts
DELETED