@debales/ai 1.1.3-canary.5 → 1.1.4
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/dist/browser/ai-browser.js +253 -253
- package/dist/browser/components/common/UserInfoModel.d.ts +9 -1
- package/dist/browser/components/footer/ChatInputBox.d.ts +4 -1
- package/dist/browser/constants/index.d.ts +1 -1
- package/dist/browser/constants/storage-key.d.ts +0 -2
- package/dist/browser/lib/util.d.ts +1 -12
- package/dist/browser/types/debales.d.ts +4 -9
- package/dist/browser/types/index.d.ts +2 -1
- package/dist/module/ai.js +15638 -15691
- package/dist/module/ai.umd.js +279 -279
- package/dist/module/components/common/UserInfoModel.d.ts +9 -1
- package/dist/module/components/footer/ChatInputBox.d.ts +4 -1
- package/dist/module/constants/index.d.ts +1 -1
- package/dist/module/constants/storage-key.d.ts +0 -2
- package/dist/module/lib/util.d.ts +1 -12
- package/dist/module/types/debales.d.ts +4 -9
- package/dist/module/types/index.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Product, SuggestedQuestionAnswer, UiData } from '../../types';
|
|
1
2
|
import { default as React } from 'react';
|
|
2
3
|
declare global {
|
|
3
4
|
interface Window {
|
|
@@ -6,9 +7,16 @@ declare global {
|
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
interface Props {
|
|
10
|
+
uidata: UiData;
|
|
11
|
+
botName?: string;
|
|
12
|
+
botId: string;
|
|
13
|
+
botNameColor: string | undefined;
|
|
14
|
+
showModel: boolean;
|
|
9
15
|
setShowModel: React.Dispatch<React.SetStateAction<boolean>>;
|
|
16
|
+
selectedSuggestedQuestionAnswer: SuggestedQuestionAnswer | null;
|
|
17
|
+
sendMessage: (message: string, answer?: string, products?: Product[]) => Promise<void>;
|
|
10
18
|
inChat?: boolean;
|
|
11
19
|
showFormInstructions?: boolean;
|
|
12
20
|
}
|
|
13
|
-
export declare const UserInfoModel: ({
|
|
21
|
+
export declare const UserInfoModel: ({ uidata, botId, showModel, setShowModel, selectedSuggestedQuestionAnswer, sendMessage, botNameColor, inChat, showFormInstructions, }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
14
22
|
export {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { UiData } from '../../types';
|
|
2
|
+
export default function ChatInputBox({ uiData, onSendMessage, disabled, inputState, }: {
|
|
3
|
+
uiData: UiData;
|
|
4
|
+
onSendMessage: (message: string) => Promise<void>;
|
|
2
5
|
disabled: boolean;
|
|
3
6
|
inputState: boolean;
|
|
4
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -59,16 +59,5 @@ export declare function splitMessageIntoParagraphs(markdownText: string): string
|
|
|
59
59
|
export declare const isAthflex: (botId: string) => botId is "athflex" | "athflex-2";
|
|
60
60
|
export declare const isGaiabay: (botId: string) => boolean;
|
|
61
61
|
export declare const splitQuestionsIntoGroups: (questions: SuggestedQuestionAnswer[]) => (SuggestedQuestionAnswer | SuggestedQuestionAnswer[])[];
|
|
62
|
-
|
|
63
|
-
* Creates a storage key with optional botId scoping
|
|
64
|
-
*
|
|
65
|
-
* @param {string} purpose - The purpose identifier for the storage key
|
|
66
|
-
* @param {object} options - Optional configuration
|
|
67
|
-
* @param {string} options.botId - Bot ID for project-specific storage (optional)
|
|
68
|
-
* @param {boolean} options.shared - Whether this is shared across all instances (optional)
|
|
69
|
-
* @return {string} The generated storage key
|
|
70
|
-
*/
|
|
71
|
-
export declare function createStorageKey(purpose: string, options?: {
|
|
72
|
-
botId?: string;
|
|
73
|
-
}): string;
|
|
62
|
+
export declare function createStorageKey(botId: string, purpose: string): string;
|
|
74
63
|
export {};
|
|
@@ -9,19 +9,17 @@ export interface DebalesContextType {
|
|
|
9
9
|
showUserInfoModel: boolean;
|
|
10
10
|
pendingBulkItems: VariantQuantity[];
|
|
11
11
|
lastedBotmessageId: string | null;
|
|
12
|
+
isFormClosedByUser: boolean;
|
|
12
13
|
uiData: UiData | null;
|
|
13
14
|
storeMetaData: ShopifyStoreMeta | null;
|
|
14
15
|
suggestedQuestions: SuggestedQuestionAnswer[];
|
|
15
|
-
|
|
16
|
-
userInfo: UserInfo | null;
|
|
17
|
-
input: string;
|
|
18
|
-
pendingQuestion: SuggestedQuestionAnswer | null;
|
|
19
|
-
isFormClosedByUser: boolean;
|
|
16
|
+
needUserInfo: boolean;
|
|
20
17
|
onSendMessage: (message: string, answer?: string, products?: Product[], fromKlaviyo?: boolean, leading_queries?: string[]) => Promise<void>;
|
|
21
18
|
setIsKlaviyoMessage: React.Dispatch<React.SetStateAction<boolean>>;
|
|
22
19
|
setShowUserInfoModel: React.Dispatch<React.SetStateAction<boolean>>;
|
|
23
20
|
setPendingBulkItems: React.Dispatch<React.SetStateAction<VariantQuantity[]>>;
|
|
24
21
|
setLastedBotmessageId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
22
|
+
setIsFormClosedByUser: React.Dispatch<React.SetStateAction<boolean>>;
|
|
25
23
|
fetchUiInfo: () => Promise<void>;
|
|
26
24
|
setIsLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
27
25
|
setIsMessageLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -30,10 +28,7 @@ export interface DebalesContextType {
|
|
|
30
28
|
saveConversation: (messages: Message[]) => void;
|
|
31
29
|
loadConversation: () => Message[];
|
|
32
30
|
setSuggestedQuestions: React.Dispatch<React.SetStateAction<SuggestedQuestionAnswer[]>>;
|
|
33
|
-
|
|
34
|
-
setPendingQuestion: React.Dispatch<React.SetStateAction<SuggestedQuestionAnswer | null>>;
|
|
35
|
-
setUserInfo: React.Dispatch<React.SetStateAction<UserInfo>>;
|
|
36
|
-
setIsFormClosedByUser: React.Dispatch<React.SetStateAction<boolean>>;
|
|
31
|
+
setNeedUserInfo: React.Dispatch<React.SetStateAction<boolean>>;
|
|
37
32
|
}
|
|
38
33
|
export interface WebsocketMessageEvent extends MessageEvent {
|
|
39
34
|
type: typeof EventType.MESSAGE | typeof EventType.USER_ACTION;
|
|
@@ -78,7 +78,7 @@ export interface Product {
|
|
|
78
78
|
}
|
|
79
79
|
export interface SuggestedQuestionAnswer {
|
|
80
80
|
question: string;
|
|
81
|
-
answer
|
|
81
|
+
answer: string;
|
|
82
82
|
products?: Product[];
|
|
83
83
|
path: string;
|
|
84
84
|
nameSpace: string;
|
|
@@ -114,6 +114,7 @@ export interface Message {
|
|
|
114
114
|
Variants_quantity?: string;
|
|
115
115
|
monthlyChatLimitReached?: boolean | undefined;
|
|
116
116
|
isBot?: boolean;
|
|
117
|
+
hideConfirmation?: boolean;
|
|
117
118
|
}
|
|
118
119
|
export type { ChatBoxProps, UiData };
|
|
119
120
|
export interface ShopifyStoreMeta {
|