@clikvn/agent-widget-embedded 1.1.5-dev-11 → 1.1.5-dev-13
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/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/commons/constants/bookMeeting.d.ts +14 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/commons/constants/bookMeeting.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/commons/constants/bookMeeting.js +70 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/commons/constants/bookMeeting.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/commons/constants/index.d.ts +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/commons/constants/index.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/commons/constants/index.js +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/commons/constants/index.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingForm.d.ts +4 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingForm.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingForm.js +135 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingForm.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Chat.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Chat.js +9 -3
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Chat.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Icons.d.ts +82 -76
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Icons.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Icons.js +101 -82
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Icons.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Message.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Message.js +5 -3
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Message.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/UserContactForm.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/UserContactForm.js +72 -17
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/UserContactForm.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/Button.d.ts +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/DataPickerCustom.d.ts +9 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/DataPickerCustom.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/DataPickerCustom.js +32 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/DataPickerCustom.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/PhoneNumberInput.d.ts +11 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/PhoneNumberInput.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/PhoneNumberInput.js +8 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/PhoneNumberInput.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBox.d.ts +19 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBox.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBox.js +33 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBox.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBoxWithIcon.d.ts +19 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBoxWithIcon.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBoxWithIcon.js +71 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBoxWithIcon.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/constants/form.d.ts +13 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/constants/form.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/constants/form.js +2 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/constants/form.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/features/AgentWidget/index.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/features/AgentWidget/index.js +3 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/features/AgentWidget/index.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useAudioMesseagePlayer.js +2 -2
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useAudioMesseagePlayer.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useConfiguration.d.ts +15 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useConfiguration.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useConfiguration.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useScrollContainer.d.ts +9 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useScrollContainer.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useScrollContainer.js +64 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useScrollContainer.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useScrollToBottom.d.ts +4 -2
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useScrollToBottom.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useScrollToBottom.js +38 -3
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useScrollToBottom.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/apis.d.ts +2 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/apis.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/apis.js +2 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/apis.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/bookMeeting.service.d.ts +3 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/bookMeeting.service.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/bookMeeting.service.js +15 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/bookMeeting.service.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/userContact.service.d.ts +7 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/userContact.service.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/userContact.service.js +26 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/userContact.service.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/bookMeeting.type.d.ts +9 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/bookMeeting.type.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/bookMeeting.type.js +2 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/bookMeeting.type.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/userContact.type.d.ts +16 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/userContact.type.d.ts.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/userContact.type.js +2 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/userContact.type.js.map +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/functionUtils.d.ts +1 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/functionUtils.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/functionUtils.js +4 -0
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/functionUtils.js.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/toolUtils.d.ts.map +1 -1
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/toolUtils.js +4 -2
- package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/toolUtils.js.map +1 -1
- package/dist/components/Chat/Chat.d.ts.map +1 -1
- package/dist/hooks/useScrollContainer.d.ts +9 -0
- package/dist/hooks/useScrollContainer.d.ts.map +1 -0
- package/dist/hooks/useScrollToBottom.d.ts +4 -2
- package/dist/hooks/useScrollToBottom.d.ts.map +1 -1
- package/dist/web.js +1 -1
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userContact.type.d.ts","sourceRoot":"","sources":["../../src/types/userContact.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,uBAAuB,CAAC,EAAE,MAAM,CAAC;KAClC,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userContact.type.js","sourceRoot":"","sources":["../../src/types/userContact.type.ts"],"names":[],"mappings":"","sourcesContent":["export interface UserContactType {\n sessionId: string;\n name: {\n firstName: string;\n lastName?: string;\n };\n emails?: {\n primaryEmail?: string;\n };\n phones?: {\n primaryPhoneNumber?: string;\n primaryPhoneCountryCode?: string;\n primaryPhoneCallingCode?: string;\n };\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const nonNull: (obj: any) => boolean;
|
|
2
2
|
export declare const toQuery: (params: any, delimiter?: string) => string;
|
|
3
3
|
export declare const isEmptyString: (value?: string) => boolean;
|
|
4
|
+
export declare const validateEmail: (email: string) => boolean;
|
|
4
5
|
//# sourceMappingURL=functionUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionUtils.d.ts","sourceRoot":"","sources":["../../src/utils/functionUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,QAAS,GAAG,KAAG,OAElC,CAAC;AAEF,eAAO,MAAM,OAAO,WAAY,GAAG,+BAYlC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,OAE9C,CAAC"}
|
|
1
|
+
{"version":3,"file":"functionUtils.d.ts","sourceRoot":"","sources":["../../src/utils/functionUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,QAAS,GAAG,KAAG,OAElC,CAAC;AAEF,eAAO,MAAM,OAAO,WAAY,GAAG,+BAYlC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,OAE9C,CAAC;AAEF,eAAO,MAAM,aAAa,UAAW,MAAM,YAG1C,CAAC"}
|
|
@@ -14,4 +14,8 @@ export const toQuery = (params, delimiter = '&') => {
|
|
|
14
14
|
export const isEmptyString = (value) => {
|
|
15
15
|
return !value?.trim();
|
|
16
16
|
};
|
|
17
|
+
export const validateEmail = (email) => {
|
|
18
|
+
const emailReg = new RegExp(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);
|
|
19
|
+
return emailReg.test(email);
|
|
20
|
+
};
|
|
17
21
|
//# sourceMappingURL=functionUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionUtils.js","sourceRoot":"","sources":["../../src/utils/functionUtils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAQ,EAAW,EAAE;IAC3C,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAW,EAAE,SAAS,GAAG,GAAG,EAAE,EAAE;IACtD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QACrC,IAAI,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QAE1C,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,KAAK,IAAI,SAAS,CAAC;QACrB,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAW,EAAE;IACvD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC,CAAC","sourcesContent":["export const nonNull = (obj: any): boolean => {\n return obj !== null && obj !== undefined;\n};\n\nexport const toQuery = (params: any, delimiter = '&') => {\n const keys = Object.keys(params);\n\n return keys.reduce((str, key, index) => {\n let query = `${str}${key}=${params[key]}`;\n\n if (index < keys.length - 1) {\n query += delimiter;\n }\n\n return query;\n }, '');\n};\n\nexport const isEmptyString = (value?: string): boolean => {\n return !value?.trim();\n};\n"]}
|
|
1
|
+
{"version":3,"file":"functionUtils.js","sourceRoot":"","sources":["../../src/utils/functionUtils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAQ,EAAW,EAAE;IAC3C,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAW,EAAE,SAAS,GAAG,GAAG,EAAE,EAAE;IACtD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QACrC,IAAI,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QAE1C,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,KAAK,IAAI,SAAS,CAAC;QACrB,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAW,EAAE;IACvD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,EAAE;IAC7C,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,4BAA4B,CAAC,CAAC;IAC1D,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["export const nonNull = (obj: any): boolean => {\n return obj !== null && obj !== undefined;\n};\n\nexport const toQuery = (params: any, delimiter = '&') => {\n const keys = Object.keys(params);\n\n return keys.reduce((str, key, index) => {\n let query = `${str}${key}=${params[key]}`;\n\n if (index < keys.length - 1) {\n query += delimiter;\n }\n\n return query;\n }, '');\n};\n\nexport const isEmptyString = (value?: string): boolean => {\n return !value?.trim();\n};\n\nexport const validateEmail = (email: string) => {\n const emailReg = new RegExp(/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/);\n return emailReg.test(email);\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolUtils.d.ts","sourceRoot":"","sources":["../../src/utils/toolUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toolUtils.d.ts","sourceRoot":"","sources":["../../src/utils/toolUtils.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,eAAe,eAAgB,GAAG,QAM9C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,a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_PREFIXES, DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES, DISPLAY_PRODUCT_LIST_TOOL_PREFIXES, DISPLAY_SCENARIOS_LIST_TOOL_PREFIXES, LOCATION_TOOLS, WEATHER_TOOLS, } from '../constants/toolNames';
|
|
2
2
|
/**
|
|
3
3
|
* Parse tool output data from JSON string
|
|
4
4
|
* @param outputData - The tool output data to parse
|
|
@@ -108,7 +108,9 @@ export const isCustomTool = (tool) => {
|
|
|
108
108
|
isLocationTool(tool) ||
|
|
109
109
|
isDisplayProductListTool(tool) ||
|
|
110
110
|
isDisplayProductDetailTool(tool) ||
|
|
111
|
-
isDisplayScenariosTool(tool)
|
|
111
|
+
isDisplayScenariosTool(tool) ||
|
|
112
|
+
isDisplayBookingFormTool(tool) ||
|
|
113
|
+
isDisplayContactFormTool(tool));
|
|
112
114
|
};
|
|
113
115
|
/**
|
|
114
116
|
* Check if a tool should focus the tool output (hide message content)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolUtils.js","sourceRoot":"","sources":["../../src/utils/toolUtils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,cAAc,EACd,mBAAmB,EAEnB,kCAAkC,EAClC,oCAAoC,EACpC,oCAAoC,EACpC,kCAAkC,EAClC,kCAAkC,GACnC,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAe,EAAE,EAAE;IACjD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAW,EAAE;IACzE,OAAO,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC,CAAC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ToolUsage } from '../types/flowise.type';\nimport {\n WEATHER_TOOLS,\n LOCATION_TOOLS,\n COMMAND_TOOL_VALUES,\n PRODUCT_COMMAND_TOOL_VALUES,\n DISPLAY_PRODUCT_LIST_TOOL_PREFIXES,\n DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES,\n DISPLAY_SCENARIOS_LIST_TOOL_PREFIXES,\n DISPLAY_CONTACT_FORM_TOOL_PREFIXES,\n DISPLAY_BOOKING_FORM_TOOL_PREFIXES,\n} from '../constants/toolNames';\n\n/**\n * Parse tool output data from JSON string\n * @param outputData - The tool output data to parse\n * @returns Parsed JSON object or null if parsing fails\n */\nexport const parseToolOutput = (outputData: any) => {\n try {\n return JSON.parse(outputData);\n } catch (e) {\n return null;\n }\n};\n\n/**\n * Check if a tool name matches a specific prefix\n * @param toolName - Tool name to check\n * @param prefix - Prefix to match against\n * @returns True if the tool name starts with the prefix\n */\nexport const hasToolPrefix = (toolName: string, prefix: string): boolean => {\n return toolName.startsWith(prefix);\n};\n\n/**\n * Check if a tool is a product list tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a product list tool\n */\nexport const isDisplayProductListTool = (toolName: string): boolean => {\n return (\n hasToolPrefix(\n toolName,\n DISPLAY_PRODUCT_LIST_TOOL_PREFIXES.RENDER_PRODUCTS\n ) ||\n hasToolPrefix(toolName, DISPLAY_PRODUCT_LIST_TOOL_PREFIXES.DISPLAY_PRODUCTS)\n );\n};\n\n/**\n * Check if a tool is a product detail tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a product detail tool\n */\nexport const isDisplayProductDetailTool = (toolName: string): boolean => {\n return (\n hasToolPrefix(\n toolName,\n DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES.RENDER_PRODUCT\n ) ||\n hasToolPrefix(\n toolName,\n DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES.DISPLAY_PRODUCT\n )\n );\n};\n\n/**\n * Check if a tool is a scenarios tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a scenarios tool\n */\nexport const isDisplayScenariosTool = (toolName: string): boolean => {\n return (\n hasToolPrefix(\n toolName,\n DISPLAY_SCENARIOS_LIST_TOOL_PREFIXES.RENDER_SCENARIOS\n ) ||\n hasToolPrefix(\n toolName,\n DISPLAY_SCENARIOS_LIST_TOOL_PREFIXES.DISPLAY_SCENARIOS\n )\n );\n};\n\n/**\n * Check if a tool is a display contact form tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a display contact form tool\n */\nexport const isDisplayContactFormTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_CONTACT_FORM_TOOL_PREFIXES.DISPLAY_CONTACT_FORM\n );\n};\n\n/**\n * Check if a tool is a display booking form tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the is a display booking form tool\n */\nexport const isDisplayBookingFormTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_BOOKING_FORM_TOOL_PREFIXES.DISPLAY_BOOKING_FORM\n );\n};\n\n/**\n * Check if a tool is a command tool\n * @param tool - Tool name to check\n * @returns True if the tool is a command tool\n */\nexport const isCommandTool = (tool: string): boolean => {\n return COMMAND_TOOL_VALUES.includes(tool as any);\n};\n\n/**\n * Check if a tool is a weather tool\n * @param tool - Tool name to check\n * @returns True if the tool is a weather tool\n */\nexport const isWeatherTool = (tool: string): boolean => {\n return tool === WEATHER_TOOLS.GET_WEATHER;\n};\n\n/**\n * Check if a tool is a location tool\n * @param tool - Tool name to check\n * @returns True if the tool is a location tool\n */\nexport const isLocationTool = (tool: string): boolean => {\n return (\n tool === LOCATION_TOOLS.GET_ASSIGNED_LOCATION_DETAIL ||\n tool === LOCATION_TOOLS.SEARCH_TRAVELING_PLACES\n );\n};\n\n/**\n * Check if a tool usage contains HTML content\n * @param toolUsage - The tool usage object to check\n * @returns True if the tool contains HTML content\n */\nexport const isHtmlContent = (toolUsage: ToolUsage): boolean => {\n const outputData = parseToolOutput(toolUsage.toolOutput);\n return outputData?.type === 'HTML';\n};\n\n/**\n * Check if a tool should be treated as a custom tool result\n * @param tool - Tool name to check\n * @returns True if the tool is a custom tool\n */\nexport const isCustomTool = (tool: string): boolean => {\n return (\n isWeatherTool(tool) ||\n isLocationTool(tool) ||\n isDisplayProductListTool(tool) ||\n isDisplayProductDetailTool(tool) ||\n isDisplayScenariosTool(tool)\n );\n};\n\n/**\n * Check if a tool should focus the tool output (hide message content)\n * @param tool - Tool name to check\n * @returns True if the tool should focus output\n */\nexport const shouldFocusToolOutput = (tool: string): boolean => {\n return (\n isCommandTool(tool) ||\n isDisplayProductListTool(tool) ||\n isDisplayProductDetailTool(tool) ||\n isDisplayScenariosTool(tool)\n );\n};\n\n/**\n * Categorize tools from a list of tool usages\n * @param usedTools - Array of tool usages\n * @param isNewMessage - Whether this is a new message\n * @returns Categorized tools object\n */\nexport const categorizeTools = (\n usedTools: ToolUsage[],\n isNewMessage: boolean = false\n) => {\n const customToolResults: ToolUsage[] = [];\n const toolResults: ToolUsage[] = [];\n let cmdToolResult: ToolUsage | null = null;\n\n usedTools.forEach((usedTool) => {\n if (isCommandTool(usedTool.tool)) {\n if (isNewMessage) {\n cmdToolResult = usedTool;\n }\n } else if (isCustomTool(usedTool.tool) || isHtmlContent(usedTool)) {\n customToolResults.push(usedTool);\n } else {\n toolResults.push(usedTool);\n }\n });\n return {\n customToolResults,\n toolResults,\n cmdToolResult,\n };\n};\n\n/**\n * Check if any tool in the list should focus output\n * @param usedTools - Array of tool usages\n * @returns True if any tool should focus output\n */\nexport const hasFocusToolOutput = (usedTools: ToolUsage[]): boolean => {\n return usedTools.some(\n (usedTool) =>\n shouldFocusToolOutput(usedTool.tool) || isHtmlContent(usedTool)\n );\n};\n\n/**\n * Remove tool output from message content\n * @param content - Original message content (can be undefined)\n * @param usedTools - Array of tool usages\n * @returns Content with tool outputs removed, or empty string if content is undefined\n */\nexport const removeToolOutputFromContent = (\n content: string | undefined,\n usedTools: ToolUsage[]\n): string => {\n if (!content) {\n return '';\n }\n\n let cleanedContent = content;\n\n usedTools.forEach((tool) => {\n const { toolOutput } = tool;\n cleanedContent = cleanedContent?.replaceAll(toolOutput, '');\n });\n\n return cleanedContent;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"toolUtils.js","sourceRoot":"","sources":["../../src/utils/toolUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kCAAkC,EAClC,kCAAkC,EAClC,oCAAoC,EACpC,kCAAkC,EAClC,oCAAoC,EACpC,cAAc,EACd,aAAa,GACd,MAAM,wBAAwB,CAAC;AAGhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAe,EAAE,EAAE;IACjD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAW,EAAE;IACzE,OAAO,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAW,EAAE;IACpE,OAAO,CACL,aAAa,CACX,QAAQ,EACR,kCAAkC,CAAC,eAAe,CACnD;QACD,aAAa,CAAC,QAAQ,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,CAC7E,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,QAAgB,EAAW,EAAE;IACtE,OAAO,CACL,aAAa,CACX,QAAQ,EACR,oCAAoC,CAAC,cAAc,CACpD;QACD,aAAa,CACX,QAAQ,EACR,oCAAoC,CAAC,eAAe,CACrD,CACF,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAI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AAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO;QACL,iBAAiB;QACjB,WAAW;QACX,aAAa;KACd,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAsB,EAAW,EAAE;IACpE,OAAO,SAAS,CAAC,IAAI,CACnB,CAAC,QAAQ,EAAE,EAAE,CACX,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAClE,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,OAA2B,EAC3B,SAAsB,EACd,EAAE;IACV,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,cAAc,GAAG,OAAO,CAAC;IAE7B,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAC5B,cAAc,GAAG,cAAc,EAAE,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC","sourcesContent":["import {\n COMMAND_TOOL_VALUES,\n DISPLAY_BOOKING_FORM_TOOL_PREFIXES,\n DISPLAY_CONTACT_FORM_TOOL_PREFIXES,\n DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES,\n DISPLAY_PRODUCT_LIST_TOOL_PREFIXES,\n DISPLAY_SCENARIOS_LIST_TOOL_PREFIXES,\n LOCATION_TOOLS,\n WEATHER_TOOLS,\n} from '../constants/toolNames';\nimport { ToolUsage } from '../types/flowise.type';\n\n/**\n * Parse tool output data from JSON string\n * @param outputData - The tool output data to parse\n * @returns Parsed JSON object or null if parsing fails\n */\nexport const parseToolOutput = (outputData: any) => {\n try {\n return JSON.parse(outputData);\n } catch (e) {\n return null;\n }\n};\n\n/**\n * Check if a tool name matches a specific prefix\n * @param toolName - Tool name to check\n * @param prefix - Prefix to match against\n * @returns True if the tool name starts with the prefix\n */\nexport const hasToolPrefix = (toolName: string, prefix: string): boolean => {\n return toolName.startsWith(prefix);\n};\n\n/**\n * Check if a tool is a product list tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a product list tool\n */\nexport const isDisplayProductListTool = (toolName: string): boolean => {\n return (\n hasToolPrefix(\n toolName,\n DISPLAY_PRODUCT_LIST_TOOL_PREFIXES.RENDER_PRODUCTS\n ) ||\n hasToolPrefix(toolName, DISPLAY_PRODUCT_LIST_TOOL_PREFIXES.DISPLAY_PRODUCTS)\n );\n};\n\n/**\n * Check if a tool is a product detail tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a product detail tool\n */\nexport const isDisplayProductDetailTool = (toolName: string): boolean => {\n return (\n hasToolPrefix(\n toolName,\n DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES.RENDER_PRODUCT\n ) ||\n hasToolPrefix(\n toolName,\n DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES.DISPLAY_PRODUCT\n )\n );\n};\n\n/**\n * Check if a tool is a scenarios tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a scenarios tool\n */\nexport const isDisplayScenariosTool = (toolName: string): boolean => {\n return (\n hasToolPrefix(\n toolName,\n DISPLAY_SCENARIOS_LIST_TOOL_PREFIXES.RENDER_SCENARIOS\n ) ||\n hasToolPrefix(\n toolName,\n DISPLAY_SCENARIOS_LIST_TOOL_PREFIXES.DISPLAY_SCENARIOS\n )\n );\n};\n\n/**\n * Check if a tool is a display contact form tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a display contact form tool\n */\nexport const isDisplayContactFormTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_CONTACT_FORM_TOOL_PREFIXES.DISPLAY_CONTACT_FORM\n );\n};\n\n/**\n * Check if a tool is a display booking form tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the is a display booking form tool\n */\nexport const isDisplayBookingFormTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_BOOKING_FORM_TOOL_PREFIXES.DISPLAY_BOOKING_FORM\n );\n};\n\n/**\n * Check if a tool is a command tool\n * @param tool - Tool name to check\n * @returns True if the tool is a command tool\n */\nexport const isCommandTool = (tool: string): boolean => {\n return COMMAND_TOOL_VALUES.includes(tool as any);\n};\n\n/**\n * Check if a tool is a weather tool\n * @param tool - Tool name to check\n * @returns True if the tool is a weather tool\n */\nexport const isWeatherTool = (tool: string): boolean => {\n return tool === WEATHER_TOOLS.GET_WEATHER;\n};\n\n/**\n * Check if a tool is a location tool\n * @param tool - Tool name to check\n * @returns True if the tool is a location tool\n */\nexport const isLocationTool = (tool: string): boolean => {\n return (\n tool === LOCATION_TOOLS.GET_ASSIGNED_LOCATION_DETAIL ||\n tool === LOCATION_TOOLS.SEARCH_TRAVELING_PLACES\n );\n};\n\n/**\n * Check if a tool usage contains HTML content\n * @param toolUsage - The tool usage object to check\n * @returns True if the tool contains HTML content\n */\nexport const isHtmlContent = (toolUsage: ToolUsage): boolean => {\n const outputData = parseToolOutput(toolUsage.toolOutput);\n return outputData?.type === 'HTML';\n};\n\n/**\n * Check if a tool should be treated as a custom tool result\n * @param tool - Tool name to check\n * @returns True if the tool is a custom tool\n */\nexport const isCustomTool = (tool: string): boolean => {\n return (\n isWeatherTool(tool) ||\n isLocationTool(tool) ||\n isDisplayProductListTool(tool) ||\n isDisplayProductDetailTool(tool) ||\n isDisplayScenariosTool(tool) ||\n isDisplayBookingFormTool(tool) ||\n isDisplayContactFormTool(tool)\n );\n};\n\n/**\n * Check if a tool should focus the tool output (hide message content)\n * @param tool - Tool name to check\n * @returns True if the tool should focus output\n */\nexport const shouldFocusToolOutput = (tool: string): boolean => {\n return (\n isCommandTool(tool) ||\n isDisplayProductListTool(tool) ||\n isDisplayProductDetailTool(tool) ||\n isDisplayScenariosTool(tool)\n );\n};\n\n/**\n * Categorize tools from a list of tool usages\n * @param usedTools - Array of tool usages\n * @param isNewMessage - Whether this is a new message\n * @returns Categorized tools object\n */\nexport const categorizeTools = (\n usedTools: ToolUsage[],\n isNewMessage: boolean = false\n) => {\n const customToolResults: ToolUsage[] = [];\n const toolResults: ToolUsage[] = [];\n let cmdToolResult: ToolUsage | null = null;\n\n usedTools.forEach((usedTool) => {\n if (isCommandTool(usedTool.tool)) {\n if (isNewMessage) {\n cmdToolResult = usedTool;\n }\n } else if (isCustomTool(usedTool.tool) || isHtmlContent(usedTool)) {\n customToolResults.push(usedTool);\n } else {\n toolResults.push(usedTool);\n }\n });\n return {\n customToolResults,\n toolResults,\n cmdToolResult,\n };\n};\n\n/**\n * Check if any tool in the list should focus output\n * @param usedTools - Array of tool usages\n * @returns True if any tool should focus output\n */\nexport const hasFocusToolOutput = (usedTools: ToolUsage[]): boolean => {\n return usedTools.some(\n (usedTool) =>\n shouldFocusToolOutput(usedTool.tool) || isHtmlContent(usedTool)\n );\n};\n\n/**\n * Remove tool output from message content\n * @param content - Original message content (can be undefined)\n * @param usedTools - Array of tool usages\n * @returns Content with tool outputs removed, or empty string if content is undefined\n */\nexport const removeToolOutputFromContent = (\n content: string | undefined,\n usedTools: ToolUsage[]\n): string => {\n if (!content) {\n return '';\n }\n\n let cleanedContent = content;\n\n usedTools.forEach((tool) => {\n const { toolOutput } = tool;\n cleanedContent = cleanedContent?.replaceAll(toolOutput, '');\n });\n\n return cleanedContent;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,eAAe,EAAe,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,eAAe,EAAe,MAAM,0BAA0B,CAAC;AAkBxE,KAAK,SAAS,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAkI9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollContainer.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAEpE,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW,KAAK;IAC3D,SAAS,CAAC,CAAC,CAAC;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;IACvB,OAAO;IACP,MAAM,IAAI;CACX,CA0EA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function useScrollContainer<T extends HTMLElement>(): [
|
|
3
3
|
RefObject<T>,
|
|
4
4
|
RefObject<T>,
|
|
5
|
-
(bool: boolean) => void
|
|
5
|
+
(bool: boolean) => void,
|
|
6
|
+
boolean,
|
|
7
|
+
() => void
|
|
6
8
|
];
|
|
7
9
|
//# sourceMappingURL=useScrollToBottom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollToBottom.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollToBottom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"useScrollToBottom.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollToBottom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAEpE,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW,KAAK;IAC3D,SAAS,CAAC,CAAC,CAAC;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;IACvB,OAAO;IACP,MAAM,IAAI;CACX,CA0EA"}
|