@debales/ai 1.0.1-canary.0
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 +44 -0
- package/dist/browser/adapter/BaseCartAdapter.d.ts +17 -0
- package/dist/browser/adapter/CartAdapterFactory.d.ts +10 -0
- package/dist/browser/adapter/DefaultCartAdapter.d.ts +15 -0
- package/dist/browser/adapter/MagentoCartAdapter.d.ts +27 -0
- package/dist/browser/adapter/ShopifyCartAdapter.d.ts +20 -0
- package/dist/browser/ai-browser.js +2316 -0
- package/dist/browser/browser.d.ts +9 -0
- package/dist/browser/components/ChatbotComponent.d.ts +17 -0
- package/dist/browser/components/common/AddBulkItemsButton.d.ts +1 -0
- package/dist/browser/components/common/Button.d.ts +2 -0
- package/dist/browser/components/common/CheckoutButton.d.ts +1 -0
- package/dist/browser/components/common/CollectionSlider.d.ts +11 -0
- package/dist/browser/components/common/DiscountModel.d.ts +8 -0
- package/dist/browser/components/common/DiscountPanel.d.ts +8 -0
- package/dist/browser/components/common/DownArrow.d.ts +5 -0
- package/dist/browser/components/common/DynamicSuggestedQuestion.d.ts +15 -0
- package/dist/browser/components/common/ExitModal.d.ts +7 -0
- package/dist/browser/components/common/Input.d.ts +11 -0
- package/dist/browser/components/common/LoadingAnimation.d.ts +7 -0
- package/dist/browser/components/common/NormalizePrice.d.ts +13 -0
- package/dist/browser/components/common/PhoneInput.d.ts +12 -0
- package/dist/browser/components/common/ProductSlider.d.ts +16 -0
- package/dist/browser/components/common/SelectLanguage.d.ts +7 -0
- package/dist/browser/components/common/SuggestedQuestion.d.ts +19 -0
- package/dist/browser/components/common/UserInfoModel.d.ts +15 -0
- package/dist/browser/components/common/VariantSelectionModel.d.ts +18 -0
- package/dist/browser/components/common/loading-dots.d.ts +4 -0
- package/dist/browser/components/common/pop-up.d.ts +2 -0
- package/dist/browser/components/common/shadowWrapper.d.ts +10 -0
- package/dist/browser/components/footer/ChatInputBox.d.ts +7 -0
- package/dist/browser/components/icons/index.d.ts +19 -0
- package/dist/browser/constants/dom.d.ts +2 -0
- package/dist/browser/constants/events.d.ts +29 -0
- package/dist/browser/constants/index.d.ts +6 -0
- package/dist/browser/context/CartContext.d.ts +3 -0
- package/dist/browser/context/ShadowDomContext.d.ts +3 -0
- package/dist/browser/index.d.ts +3 -0
- package/dist/browser/lib/debalesAnalytics.d.ts +37 -0
- package/dist/browser/lib/debalesGlobalObject.d.ts +2 -0
- package/dist/browser/lib/platformDetection.d.ts +4 -0
- package/dist/browser/lib/platfromValidator.d.ts +2 -0
- package/dist/browser/lib/urlHelper.d.ts +18 -0
- package/dist/browser/lib/util.d.ts +63 -0
- package/dist/browser/main.d.ts +1 -0
- package/dist/browser/provider/CartProvider.d.ts +8 -0
- package/dist/browser/provider/index.d.ts +5 -0
- package/dist/browser/types/cart.d.ts +49 -0
- package/dist/browser/types/index.d.ts +141 -0
- package/dist/browser/types/magento.d.ts +37 -0
- package/dist/browser/types/shopify.d.ts +22 -0
- package/dist/module/adapter/BaseCartAdapter.d.ts +17 -0
- package/dist/module/adapter/CartAdapterFactory.d.ts +10 -0
- package/dist/module/adapter/DefaultCartAdapter.d.ts +15 -0
- package/dist/module/adapter/MagentoCartAdapter.d.ts +27 -0
- package/dist/module/adapter/ShopifyCartAdapter.d.ts +20 -0
- package/dist/module/ai.js +64865 -0
- package/dist/module/ai.umd.js +2543 -0
- package/dist/module/browser.d.ts +9 -0
- package/dist/module/components/ChatbotComponent.d.ts +17 -0
- package/dist/module/components/common/AddBulkItemsButton.d.ts +1 -0
- package/dist/module/components/common/Button.d.ts +2 -0
- package/dist/module/components/common/CheckoutButton.d.ts +1 -0
- package/dist/module/components/common/CollectionSlider.d.ts +11 -0
- package/dist/module/components/common/DiscountModel.d.ts +8 -0
- package/dist/module/components/common/DiscountPanel.d.ts +8 -0
- package/dist/module/components/common/DownArrow.d.ts +5 -0
- package/dist/module/components/common/DynamicSuggestedQuestion.d.ts +15 -0
- package/dist/module/components/common/ExitModal.d.ts +7 -0
- package/dist/module/components/common/Input.d.ts +11 -0
- package/dist/module/components/common/LoadingAnimation.d.ts +7 -0
- package/dist/module/components/common/NormalizePrice.d.ts +13 -0
- package/dist/module/components/common/PhoneInput.d.ts +12 -0
- package/dist/module/components/common/ProductSlider.d.ts +16 -0
- package/dist/module/components/common/SelectLanguage.d.ts +7 -0
- package/dist/module/components/common/SuggestedQuestion.d.ts +19 -0
- package/dist/module/components/common/UserInfoModel.d.ts +15 -0
- package/dist/module/components/common/VariantSelectionModel.d.ts +18 -0
- package/dist/module/components/common/loading-dots.d.ts +4 -0
- package/dist/module/components/common/pop-up.d.ts +2 -0
- package/dist/module/components/common/shadowWrapper.d.ts +10 -0
- package/dist/module/components/footer/ChatInputBox.d.ts +7 -0
- package/dist/module/components/icons/index.d.ts +19 -0
- package/dist/module/constants/dom.d.ts +2 -0
- package/dist/module/constants/events.d.ts +29 -0
- package/dist/module/constants/index.d.ts +6 -0
- package/dist/module/context/CartContext.d.ts +3 -0
- package/dist/module/context/ShadowDomContext.d.ts +3 -0
- package/dist/module/index.d.ts +3 -0
- package/dist/module/lib/debalesAnalytics.d.ts +37 -0
- package/dist/module/lib/debalesGlobalObject.d.ts +2 -0
- package/dist/module/lib/platformDetection.d.ts +4 -0
- package/dist/module/lib/platfromValidator.d.ts +2 -0
- package/dist/module/lib/urlHelper.d.ts +18 -0
- package/dist/module/lib/util.d.ts +63 -0
- package/dist/module/main.d.ts +1 -0
- package/dist/module/provider/CartProvider.d.ts +8 -0
- package/dist/module/provider/index.d.ts +5 -0
- package/dist/module/types/cart.d.ts +49 -0
- package/dist/module/types/index.d.ts +141 -0
- package/dist/module/types/magento.d.ts +37 -0
- package/dist/module/types/shopify.d.ts +22 -0
- package/package.json +73 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
interface ChatBoxProps {
|
|
2
|
+
botId: string;
|
|
3
|
+
botName?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface PluginCofig {
|
|
6
|
+
collectedUserInfo: {
|
|
7
|
+
modelHeading: string;
|
|
8
|
+
name: boolean;
|
|
9
|
+
email: boolean;
|
|
10
|
+
phone: boolean;
|
|
11
|
+
isOptional: boolean;
|
|
12
|
+
discount?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
interface CollectedUserInfo {
|
|
16
|
+
modelHeading: string;
|
|
17
|
+
name: boolean;
|
|
18
|
+
email: boolean;
|
|
19
|
+
phone: boolean;
|
|
20
|
+
isOptional: boolean;
|
|
21
|
+
discount?: string;
|
|
22
|
+
}
|
|
23
|
+
interface UiData {
|
|
24
|
+
bot_logo?: string;
|
|
25
|
+
backgroundColor: string;
|
|
26
|
+
botBackgroundColor?: string;
|
|
27
|
+
botMessageColor?: string;
|
|
28
|
+
botFontColor?: string;
|
|
29
|
+
fontColor?: string;
|
|
30
|
+
headerFontColor?: string;
|
|
31
|
+
callToActionBackgroundColor?: string;
|
|
32
|
+
callToActionFontColor?: string;
|
|
33
|
+
footerBackgroundColor?: string;
|
|
34
|
+
fonterInputBorderColor?: string;
|
|
35
|
+
initialMessage?: string;
|
|
36
|
+
userMessageColor?: string;
|
|
37
|
+
userFontColor?: string;
|
|
38
|
+
suggestedQuestionsFontColor?: string;
|
|
39
|
+
suggestedQuestionsBackgroundColor?: string;
|
|
40
|
+
suggestedQuestionsHoverColor?: string;
|
|
41
|
+
suggestedQuestionsCrossButtonColor?: string;
|
|
42
|
+
suggestedQuestionsCrossButtonBackgroundColor?: string;
|
|
43
|
+
suggestedQuestionsHighlightColor?: string;
|
|
44
|
+
chatButtonBackgroundAnimationColor?: string;
|
|
45
|
+
inputPlaceholder?: string[];
|
|
46
|
+
userMessage_logo?: string;
|
|
47
|
+
suggestedQuestions: SuggestedQuestionAnswer[];
|
|
48
|
+
pluginConfig: PluginCofig;
|
|
49
|
+
shopifyShopDomain?: string;
|
|
50
|
+
chatbotName?: string;
|
|
51
|
+
isLeft?: boolean;
|
|
52
|
+
heightOption?: "Normal" | "Higher" | "Highest";
|
|
53
|
+
show_bot?: boolean;
|
|
54
|
+
debales_branding?: boolean;
|
|
55
|
+
fullScreenOnMobile?: boolean;
|
|
56
|
+
mobileDisplayMode?: "normal" | "half-screen" | "full-screen";
|
|
57
|
+
KlaviyoIntegration?: boolean;
|
|
58
|
+
KlaviyoFormIntegration?: boolean;
|
|
59
|
+
enableChatButtonBackgroundAnimation?: boolean;
|
|
60
|
+
chatButtonBackgroundAnimationType?: "Ping" | "Glow" | string;
|
|
61
|
+
removeLogoBackground?: boolean;
|
|
62
|
+
collectedUserInfo: CollectedUserInfo;
|
|
63
|
+
countryCode?: string;
|
|
64
|
+
geoData?: unknown;
|
|
65
|
+
zIndex: number;
|
|
66
|
+
}
|
|
67
|
+
export interface Product {
|
|
68
|
+
name: string;
|
|
69
|
+
price: string;
|
|
70
|
+
image: [string];
|
|
71
|
+
link: string;
|
|
72
|
+
product_id: string;
|
|
73
|
+
compare_at_price?: string;
|
|
74
|
+
handle?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface SuggestedQuestionAnswer {
|
|
77
|
+
question: string;
|
|
78
|
+
answer: string;
|
|
79
|
+
products?: Product[];
|
|
80
|
+
path: string;
|
|
81
|
+
nameSpace: string;
|
|
82
|
+
sortOrder?: number;
|
|
83
|
+
isHighlighted?: boolean;
|
|
84
|
+
enable?: boolean;
|
|
85
|
+
leading_queries?: string[];
|
|
86
|
+
type?: "static" | "dynamic";
|
|
87
|
+
}
|
|
88
|
+
export interface Message {
|
|
89
|
+
text: string;
|
|
90
|
+
leading_queries?: string[];
|
|
91
|
+
collections?: [
|
|
92
|
+
{
|
|
93
|
+
image: string;
|
|
94
|
+
name: string;
|
|
95
|
+
}
|
|
96
|
+
];
|
|
97
|
+
products?: Product[];
|
|
98
|
+
variants?: [
|
|
99
|
+
{
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
price: string;
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
totalprice?: string;
|
|
106
|
+
show_checkout?: boolean;
|
|
107
|
+
rating?: "liked" | "disliked" | "neutral";
|
|
108
|
+
conversationId?: string;
|
|
109
|
+
shop?: string;
|
|
110
|
+
Variants_quantity?: string;
|
|
111
|
+
monthlyChatLimitReached?: boolean | undefined;
|
|
112
|
+
isBot?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export type { ChatBoxProps, UiData };
|
|
115
|
+
export interface ShopifyStoreMeta {
|
|
116
|
+
currency: string;
|
|
117
|
+
money_format: string;
|
|
118
|
+
name: string;
|
|
119
|
+
domain: string;
|
|
120
|
+
}
|
|
121
|
+
export interface VariantQuantity {
|
|
122
|
+
id: string;
|
|
123
|
+
productName: string;
|
|
124
|
+
variantName: string;
|
|
125
|
+
quantity: number;
|
|
126
|
+
price?: string;
|
|
127
|
+
productLink?: string;
|
|
128
|
+
}
|
|
129
|
+
export declare enum EcommercePlatform {
|
|
130
|
+
DEFAULT = "DEFAULT",
|
|
131
|
+
SHOPIFY = "SHOPIFY",
|
|
132
|
+
WOOCOMMERCE = "WOOCOMMERCE",
|
|
133
|
+
MAGENTO = "MAGENTO",
|
|
134
|
+
UNKNOWN = "UNKNOWN"
|
|
135
|
+
}
|
|
136
|
+
export interface ShadowDOMRef {
|
|
137
|
+
shadowRoot: ShadowRoot;
|
|
138
|
+
container: HTMLElement;
|
|
139
|
+
querySelector: (selector: string) => Element | null;
|
|
140
|
+
querySelectorAll: (selector: string) => NodeListOf<Element> | null;
|
|
141
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface MagentoCartItem {
|
|
2
|
+
product_type: string;
|
|
3
|
+
options: unknown[];
|
|
4
|
+
qty: number;
|
|
5
|
+
item_id: string;
|
|
6
|
+
configure_url: string;
|
|
7
|
+
is_visible_in_site_visibility: boolean;
|
|
8
|
+
product_id: string;
|
|
9
|
+
product_name: string;
|
|
10
|
+
product_sku: string;
|
|
11
|
+
product_url: string;
|
|
12
|
+
product_has_url: boolean;
|
|
13
|
+
product_price: string;
|
|
14
|
+
product_price_value: number;
|
|
15
|
+
product_image: {
|
|
16
|
+
src: string;
|
|
17
|
+
alt: string;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
};
|
|
21
|
+
canApplyMsrp: boolean;
|
|
22
|
+
message: string;
|
|
23
|
+
}
|
|
24
|
+
export interface MagentoCart {
|
|
25
|
+
summary_count: number;
|
|
26
|
+
subtotalAmount: string;
|
|
27
|
+
subtotal: string;
|
|
28
|
+
possible_onepage_checkout: boolean;
|
|
29
|
+
items: MagentoCartItem[];
|
|
30
|
+
extra_actions: string;
|
|
31
|
+
isGuestCheckoutAllowed: boolean;
|
|
32
|
+
website_id: string;
|
|
33
|
+
storeId: string;
|
|
34
|
+
subtotal_incl_tax: string;
|
|
35
|
+
subtotal_excl_tax: string;
|
|
36
|
+
data_id: number;
|
|
37
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ShopifyCartResponse {
|
|
2
|
+
token: string;
|
|
3
|
+
note: string | null;
|
|
4
|
+
attributes: Record<string, string>;
|
|
5
|
+
total_price: number;
|
|
6
|
+
total_weight: number;
|
|
7
|
+
item_count: number;
|
|
8
|
+
items: Array<{
|
|
9
|
+
id: number;
|
|
10
|
+
quantity: number;
|
|
11
|
+
variant_id: number;
|
|
12
|
+
title: string;
|
|
13
|
+
price: number;
|
|
14
|
+
properties: Record<string, string>;
|
|
15
|
+
}>;
|
|
16
|
+
currency: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ShopifyErrorResponse {
|
|
19
|
+
status: number;
|
|
20
|
+
message: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@debales/ai",
|
|
3
|
+
"private": false,
|
|
4
|
+
"access": "public",
|
|
5
|
+
"version": "1.0.1-canary.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/module/ai.js",
|
|
8
|
+
"types": "./dist/module/index.d.ts",
|
|
9
|
+
"jsdelivr": "./dist/browser/ai-browser.js",
|
|
10
|
+
"unpkg": "./dist/browser/ai-browser.js",
|
|
11
|
+
"browser": "./dist/browser/ai-browser.js",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/module/index.d.ts",
|
|
15
|
+
"import": "./dist/module/ai.js",
|
|
16
|
+
"require": "./dist/module/ai.umd.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@uidotdev/usehooks": "^2.4.1",
|
|
24
|
+
"embla-carousel-react": "^8.6.0",
|
|
25
|
+
"lucide-react": "^0.487.0",
|
|
26
|
+
"mixpanel-browser": "^2.63.0",
|
|
27
|
+
"posthog-js": "^1.235.0",
|
|
28
|
+
"react-markdown": "^10.1.0",
|
|
29
|
+
"remark-breaks": "^4.0.0",
|
|
30
|
+
"remark-gfm": "^4.0.1",
|
|
31
|
+
"ua-parser-js": "^2.0.0",
|
|
32
|
+
"validator": "^13.15.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@eslint/js": "^9.21.0",
|
|
36
|
+
"@types/mixpanel-browser": "^2.54.0",
|
|
37
|
+
"@types/react": "^19.0.10",
|
|
38
|
+
"@types/react-dom": "^19.0.4",
|
|
39
|
+
"@types/validator": "^13.12.2",
|
|
40
|
+
"@vitejs/plugin-react-swc": "^3.8.0",
|
|
41
|
+
"eslint": "^9.21.0",
|
|
42
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
43
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
44
|
+
"globals": "^15.15.0",
|
|
45
|
+
"styled-components": "^6.1.17",
|
|
46
|
+
"typescript": "~5.7.2",
|
|
47
|
+
"typescript-eslint": "^8.24.1",
|
|
48
|
+
"vite": "^6.2.0",
|
|
49
|
+
"vite-plugin-dts": "^4.5.3",
|
|
50
|
+
"@debales/typescript-config": "0.0.0",
|
|
51
|
+
"@debales/eslint-config": "0.0.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": "^19.0.0",
|
|
55
|
+
"react-dom": "^19.0.0"
|
|
56
|
+
},
|
|
57
|
+
"keywords": [
|
|
58
|
+
"debales",
|
|
59
|
+
"ai",
|
|
60
|
+
"assistant",
|
|
61
|
+
"chatbot"
|
|
62
|
+
],
|
|
63
|
+
"author": "Debales",
|
|
64
|
+
"license": "MIT",
|
|
65
|
+
"scripts": {
|
|
66
|
+
"dev": "vite",
|
|
67
|
+
"build": "npm run build:lib && npm run build:browser",
|
|
68
|
+
"build:lib": "tsc -b && vite build",
|
|
69
|
+
"build:browser": "tsc -b && vite build --config vite.browser.config.ts",
|
|
70
|
+
"lint": "eslint .",
|
|
71
|
+
"preview": "vite preview"
|
|
72
|
+
}
|
|
73
|
+
}
|