@envive-ai/react-hooks 0.1.0 → 0.1.1
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/{GridInsertionService-CS_bnPh0.cjs → GridInsertionService-C00upKLB.js} +18 -6
- package/dist/{GridInsertionService-CEYo9pGj.js → GridInsertionService-CMJVhD6q.cjs} +31 -1
- package/dist/{bandolier-Bm2xAt_j.cjs → bandolier-3rHPPhkF.cjs} +27 -28
- package/dist/{bandolier-Ble8jEa8.js → bandolier-DpF-HUG_.js} +7 -8
- package/dist/{carpe-Da7b-LCW.cjs → carpe-BG7Q_KCG.cjs} +14 -15
- package/dist/{carpe-W13mhRRP.js → carpe-DLuc07V7.js} +7 -8
- package/dist/contexts/index.cjs +9 -4
- package/dist/contexts/index.d.cts +8 -22
- package/dist/contexts/index.d.ts +11 -26
- package/dist/contexts/index.js +5 -5
- package/dist/contexts-C4Iz162H.cjs +11631 -0
- package/dist/contexts-Dq7tO_0y.js +11459 -0
- package/dist/{coterie-3y0D9ko4.cjs → coterie-DUdvJvAs.cjs} +10 -10
- package/dist/{coterie-DOWcJAYv.js → coterie-FybYN_xE.js} +7 -7
- package/dist/{default-D_KPZdPJ.cjs → default-CKyjzyLc.cjs} +1 -1
- package/dist/{default-C2fEZKXk.js → default-CL94oJfj.js} +1 -1
- package/dist/default-DMtAjA62.cjs +4 -0
- package/dist/default-zcmT2032.js +4 -0
- package/dist/{divIds-DnZNd7rA.cjs → divIds-BOqjn3bE.cjs} +0 -20
- package/dist/{divIds-Bss-btao.js → divIds-Cfp3v_rG.js} +1 -15
- package/dist/{models-DHdb7QWn.js → domInsertionService-BtzuH2Sc.js} +15 -1
- package/dist/{models-ixxUsGL_.cjs → domInsertionService-Cb9814oM.cjs} +20 -0
- package/dist/{dreamlandBaby-DCIsuU9R.cjs → dreamlandBaby-C8yzW4Nl.cjs} +11 -12
- package/dist/{dreamlandBaby-DvSaZGrz.js → dreamlandBaby-WXcbsTXO.js} +7 -8
- package/dist/{fiveCbd-CkOlVby_.cjs → fiveCbd-CZYzZPl3.cjs} +10 -11
- package/dist/{fiveCbd-B1SESMCO.js → fiveCbd-kl6CoxoF.js} +7 -8
- package/dist/{forLoveAndLemons-DmwYZIk0.js → forLoveAndLemons-BD2qh-6B.js} +5 -5
- package/dist/{forLoveAndLemons-CfYPMnKS.cjs → forLoveAndLemons-BNu-PfFB.cjs} +7 -7
- package/dist/{greenpan-Bsl3ir59.cjs → greenpan-D6fDmjU8.cjs} +11 -12
- package/dist/{greenpan-BtOi45lf.js → greenpan-LDDXZTsh.js} +7 -8
- package/dist/{grooveLife-Cmm1PSCL.cjs → grooveLife-CcylXabB.cjs} +12 -13
- package/dist/{grooveLife-6_dtYsRk.js → grooveLife-D-1qfxwj.js} +8 -9
- package/dist/{homegrownCannabis-CO0uY_mp.cjs → homegrownCannabis-BEZzwFlm.cjs} +10 -10
- package/dist/{homegrownCannabis-C-kw-74X.js → homegrownCannabis-BScZhy9v.js} +6 -6
- package/dist/hooks/index.cjs +16 -4
- package/dist/hooks/index.d.cts +256 -45
- package/dist/hooks/index.d.ts +257 -45
- package/dist/hooks/index.js +5 -5
- package/dist/{jackArcher-DdYTIzAV.cjs → jackArcher-BwMClqMP.cjs} +11 -12
- package/dist/{jackArcher-CLVmwwpI.js → jackArcher-cJJVulZ9.js} +7 -8
- package/dist/{jordanCraig-_u3-w4Hp.cjs → jordanCraig-DGsCO2o1.cjs} +19 -20
- package/dist/{jordanCraig-Am-Oor-O.js → jordanCraig-DNDMT0hn.js} +7 -8
- package/dist/{kindredBravely-eWp-ud_E.js → kindredBravely-ROyesnVk.js} +6 -7
- package/dist/{kindredBravely-CWovIDSc.cjs → kindredBravely-wV2XT1r_.cjs} +10 -11
- package/dist/{kutFromTheKloth-Q589bAOC.cjs → kutFromTheKloth-B6GR8tO9.cjs} +11 -12
- package/dist/{kutFromTheKloth-BMV4BuGQ.js → kutFromTheKloth-BCUOHegv.js} +7 -8
- package/dist/{larryAndSerges-CEau764j.cjs → larryAndSerges-CIqB9tKz.cjs} +8 -8
- package/dist/{larryAndSerges-BMUlTgI-.js → larryAndSerges-CqS02fnX.js} +5 -5
- package/dist/{leapsAndRebounds-DHAtRTJD.cjs → leapsAndRebounds-CFj9F_z1.cjs} +12 -13
- package/dist/{leapsAndRebounds-DGMzPO7T.js → leapsAndRebounds-j4YqSvNb.js} +7 -8
- package/dist/{longevityrx-jH2JLhNH.js → longevityrx-9sUQZCVZ.js} +7 -8
- package/dist/{longevityrx-CZW8Hxzi.cjs → longevityrx-C-Yc5LPR.cjs} +10 -11
- package/dist/{lookOptic-BGXP5P_V.js → lookOptic-CQryypdM.js} +7 -8
- package/dist/{lookOptic-CA6RwLbG.cjs → lookOptic-dbaaorhR.cjs} +10 -11
- package/dist/{mantraBrand-Cm9_PBCT.js → mantraBrand-CifBQtHp.js} +8 -9
- package/dist/{mantraBrand-DByNqpnL.cjs → mantraBrand-D5MTZ6Mj.cjs} +23 -24
- package/dist/{medterra-DnPN2ksU.cjs → medterra-BCrXdmFE.cjs} +12 -13
- package/dist/{medterra-B0wxj_PV.js → medterra-DhENCf-m.js} +7 -8
- package/dist/{modells-CoYgkLSp.cjs → modells-C_P_894S.cjs} +10 -11
- package/dist/{modells-Bmz8Ag5M.js → modells-aQrV10D7.js} +7 -8
- package/dist/{pressedFloral-DSKs_oVG.js → pressedFloral-D-amnTQK.js} +7 -8
- package/dist/{pressedFloral-DjBiSoUl.cjs → pressedFloral-DErfwwl0.cjs} +13 -14
- package/dist/{skinPerfection-B_3xzVNS.cjs → skinPerfection-DF6nQXjh.cjs} +10 -11
- package/dist/{skinPerfection-IDrBuAPt.js → skinPerfection-DRVPJp3h.js} +7 -8
- package/dist/{snapSupplements-BStTsdOZ.cjs → snapSupplements-CLZjItJi.cjs} +10 -11
- package/dist/{snapSupplements-BJk5T5ba.js → snapSupplements-Yxs4jgC-.js} +7 -8
- package/dist/{spanx-LwU1zSzq.cjs → spanx-Cpbot5J5.cjs} +14 -15
- package/dist/{spanx-BYg0LE7R.js → spanx-DVDyAyFC.js} +9 -10
- package/dist/{spanxStaging-CfSmuKYB.js → spanxStaging-DAiFEMRU.js} +9 -10
- package/dist/{spanxStaging-OZLV9qix.cjs → spanxStaging-DbaVonN6.cjs} +20 -21
- package/dist/{supergoop-BqPXDnKk.cjs → supergoop-B5VQlsoe.cjs} +11 -12
- package/dist/{supergoop-CIlrHND_.js → supergoop-C4McrZPT.js} +7 -8
- package/dist/types-D4vlfTd0.d.ts +1026 -0
- package/dist/types-DGoFEos_.d.cts +1026 -0
- package/dist/{types-CYNvLeSA.js → types-DZzSQ5a6.js} +33 -33
- package/dist/{types-C4T5UOIW.cjs → types-QJObznro.cjs} +33 -33
- package/dist/{uniqueVintage-B30mOqbH.cjs → uniqueVintage-BLp_UtBR.cjs} +22 -23
- package/dist/{uniqueVintage-CFueJOhO.js → uniqueVintage-CS4TgOJW.js} +7 -8
- package/dist/{venaCbd-DHGZy49P.cjs → venaCbd-BxmadOeJ.cjs} +11 -12
- package/dist/{venaCbd-T0CqVD4k.js → venaCbd-DfnFV7Qp.js} +7 -8
- package/dist/{westonJonBoucher-BdMzs_Yg.cjs → westonJonBoucher-BZdusJgo.cjs} +12 -13
- package/dist/{westonJonBoucher-b4TCQ4ev.js → westonJonBoucher-C0FE4Wup.js} +7 -8
- package/dist/{wineEnthusiast-BqR0i_54.js → wineEnthusiast-CmhNg47M.js} +7 -8
- package/dist/{wineEnthusiast-BLGlOjgr.cjs → wineEnthusiast-DQxdV8Yg.cjs} +12 -13
- package/dist/{wolfMattress-DNGZOivg.cjs → wolfMattress-CqyOUgPB.cjs} +11 -11
- package/dist/{wolfMattress-CyyO-LoC.js → wolfMattress-vMvqmwgI.js} +6 -6
- package/dist/{wolfTactical-3Mm2fvVF.js → wolfTactical-DvqxZtoA.js} +7 -8
- package/dist/{wolfTactical-BmXYlFjr.cjs → wolfTactical-q3TVDP85.cjs} +11 -12
- package/package.json +1 -1
- package/src/atoms/org/org.ts +2 -2
- package/src/hooks/useSearch.tsx +1 -4
- package/src/initialize.ts +1 -1
- package/src/main.tsx +10 -25
- package/dist/chatElementDisplayLocation-CX8fuNao.d.cts +0 -239
- package/dist/chatElementDisplayLocation-CwptS9tx.d.ts +0 -239
- package/dist/contexts-BRjfVq_k.js +0 -5064
- package/dist/contexts-BYArqZtK.cjs +0 -5164
- package/dist/default-CBUq6Q6G.cjs +0 -4
- package/dist/default-CGIFZK6m.js +0 -4
- package/dist/logger-Dln20ans.cjs +0 -25
- package/dist/logger-pdEEY8T2.js +0 -19
- package/src/main.ts +0 -85
- /package/dist/{cdnService-zQfKk3Eb.js → cdnService-CAyO3axV.js} +0 -0
- /package/dist/{cdnService-CZ-aXcY6.cjs → cdnService-DIF1i7VC.cjs} +0 -0
- /package/dist/{custservice-types-CkfxZiHY.cjs → custservice-types-BgjGHCtD.cjs} +0 -0
- /package/dist/{custservice-types-CFIFwZ-r.js → custservice-types-V6FWABp4.js} +0 -0
- /package/dist/{entrypoints-D_JUvkgy.cjs → entrypoints-C8JwiMYA.cjs} +0 -0
- /package/dist/{entrypoints-YLQsbBRD.js → entrypoints-RmIbdYxh.js} +0 -0
- /package/dist/{socialProofClasses-CrQBWdSA.cjs → socialProofClasses-CaA83vI4.cjs} +0 -0
- /package/dist/{socialProofClasses-Bhv2Vulz.js → socialProofClasses-KB7zOMmg.js} +0 -0
- /package/dist/{suggestionBarV2-types-CaovchMP.cjs → suggestionBarV2-types-XHYD3j8E.cjs} +0 -0
- /package/dist/{suggestionBarV2-types-BllzwsBD.js → suggestionBarV2-types-aiQmVx5m.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { ColorNames, CustomerServiceIntegrationMode, CustomerServiceType, OrgShortName, PageVariantTestType, WidgetType, colorVar } from "./types-
|
|
1
|
+
import { DOMInsertionType } from "./domInsertionService-BtzuH2Sc.js";
|
|
2
|
+
import { ColorNames, CustomerServiceIntegrationMode, CustomerServiceType, OrgShortName, PageVariantTestType, WidgetType, colorVar } from "./types-DZzSQ5a6.js";
|
|
3
3
|
import "./enviveConfigContext-CUGLpPGU.js";
|
|
4
|
-
import { BOTTOM_REVIEWS_BAR_ID, BOTTOM_SUGGESTION_BAR_TESTID, CHAT_PREVIEW_CONTAINER_ID, CHAT_PREVIEW_TESTID,
|
|
5
|
-
import { ChatElementDisplayLocation, SuggestionBarLocationForMetrics } from "./suggestionBarV2-types-
|
|
6
|
-
import { CdnService } from "./cdnService-
|
|
7
|
-
import { defaultOrgUIConfig } from "./default-
|
|
4
|
+
import { BOTTOM_REVIEWS_BAR_ID, BOTTOM_SUGGESTION_BAR_TESTID, CHAT_PREVIEW_CONTAINER_ID, CHAT_PREVIEW_TESTID, TOP_SUGGESTION_BAR_PDP_ID, TOP_SUGGESTION_BAR_TESTID } from "./divIds-Cfp3v_rG.js";
|
|
5
|
+
import { ChatElementDisplayLocation, SuggestionBarLocationForMetrics } from "./suggestionBarV2-types-aiQmVx5m.js";
|
|
6
|
+
import { CdnService } from "./cdnService-CAyO3axV.js";
|
|
7
|
+
import { defaultOrgUIConfig } from "./default-CL94oJfj.js";
|
|
8
8
|
|
|
9
9
|
//#region src/merchants/homegrownCannabis/homegrownCannabis.ts
|
|
10
10
|
const homegrownCannabisColors = {
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
require('../
|
|
2
|
-
const require_contexts = require('../contexts-
|
|
3
|
-
require('../
|
|
4
|
-
require('../types-
|
|
1
|
+
require('../GridInsertionService-CMJVhD6q.cjs');
|
|
2
|
+
const require_contexts = require('../contexts-C4Iz162H.cjs');
|
|
3
|
+
require('../domInsertionService-Cb9814oM.cjs');
|
|
4
|
+
require('../types-QJObznro.cjs');
|
|
5
5
|
require('../enviveConfigContext-Dfr2VH6u.cjs');
|
|
6
6
|
|
|
7
|
+
exports.useBlockBackButton = require_contexts.useBlockBackButton;
|
|
7
8
|
exports.useChatToggle = require_contexts.useChatToggle;
|
|
9
|
+
exports.useCustomerSupportHandoff = require_contexts.useCustomerSupportHandoff;
|
|
10
|
+
exports.useDebounce = require_contexts.useDebounce;
|
|
8
11
|
exports.useDynamicVariants = require_contexts.useDynamicVariants;
|
|
9
12
|
exports.useElementObserver = require_contexts.useElementObserver;
|
|
13
|
+
exports.useFileUpload = require_contexts.useFileUpload;
|
|
14
|
+
exports.useGrabAndScroll = require_contexts.useGrabAndScroll;
|
|
10
15
|
exports.useHideElements = require_contexts.useHideElements;
|
|
16
|
+
exports.useHorizontalScrollAnimation = require_contexts.useHorizontalScrollAnimation;
|
|
17
|
+
exports.useImageResolver = require_contexts.useImageResolver;
|
|
11
18
|
exports.useIntersection = require_contexts.useIntersection;
|
|
12
19
|
exports.useIsSmallScreen = require_contexts.useIsSmallScreen;
|
|
13
20
|
exports.useMessageFilter = require_contexts.useMessageFilter;
|
|
21
|
+
exports.useMessageScrollObserver = require_contexts.useMessageScrollObserver;
|
|
22
|
+
exports.useReducedMotionWithOverride = require_contexts.useReducedMotionWithOverride;
|
|
23
|
+
exports.useSearch = require_contexts.useSearch;
|
|
24
|
+
exports.useSnapCalculator = require_contexts.useSnapCalculator;
|
|
25
|
+
exports.useSnapControl = require_contexts.useSnapControl;
|
|
14
26
|
exports.useSystemSettingsContext = require_contexts.useSystemSettingsContext;
|
|
15
27
|
exports.useTrackComponentVisibleEvent = require_contexts.useTrackComponentVisibleEvent;
|
|
16
28
|
exports.useUpdateAnalyticsProps = require_contexts.useUpdateAnalyticsProps;
|
package/dist/hooks/index.d.cts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { CamelCasedPropertiesDeep, ChatElementDisplayLocation, GenerationParams as GenerationParams$1 } from "../
|
|
1
|
+
import { CamelCasedPropertiesDeep, ChatElementDisplayLocation, GenerationParams as GenerationParams$1, ProductCardConfig } from "../types-DGoFEos_.cjs";
|
|
2
2
|
import * as react1 from "react";
|
|
3
3
|
import { ReactElement, RefObject } from "react";
|
|
4
|
-
import { CustServiceAttachment, FormType, FulfillmentDisplayStatus, ProductSearchResponseAttributes, ResponseCategory, ResponseProductAttributes } from "@spiffy-ai/commerce-api-client";
|
|
4
|
+
import { AttachmentRequest, CustServiceAttachment, FormType, FulfillmentDisplayStatus, ProductSearchResponseAttributes, ResponseCategory, ResponseProductAttributes, SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
|
|
5
|
+
import * as motion_dom0 from "motion-dom";
|
|
6
|
+
import * as framer_motion0 from "framer-motion";
|
|
7
|
+
import { MotionValue, ValueAnimationTransition } from "framer-motion";
|
|
5
8
|
|
|
6
9
|
//#region src/application/models/api/responseGenerics.d.ts
|
|
7
10
|
interface ApiReviewRichInformation {
|
|
@@ -200,33 +203,37 @@ type OrderMessageMetadata = {
|
|
|
200
203
|
metadata: OrderResponseAttributes['attributes'];
|
|
201
204
|
};
|
|
202
205
|
//#endregion
|
|
203
|
-
//#region src/hooks/
|
|
204
|
-
declare const
|
|
206
|
+
//#region src/hooks/useBlockBackButton.d.ts
|
|
207
|
+
declare const useBlockBackButton: (enabled: boolean, callback: () => void) => void;
|
|
205
208
|
//#endregion
|
|
206
|
-
//#region src/hooks/
|
|
207
|
-
declare const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
//#region src/hooks/useChatToggle.d.ts
|
|
210
|
+
declare const useChatToggle: () => {
|
|
211
|
+
toggle: (triggerLocation: ChatElementDisplayLocation, triggerId?: string) => void;
|
|
212
|
+
isOpen: boolean;
|
|
213
|
+
openChat: (triggerLocation: ChatElementDisplayLocation, triggerId?: string) => void;
|
|
214
|
+
closeChat: (triggerLocation: ChatElementDisplayLocation, triggerId?: string) => void;
|
|
212
215
|
};
|
|
213
216
|
//#endregion
|
|
214
|
-
//#region src/hooks/
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
removePreviousDiscussions: (msgs: Message[][], index: number) => Message[][];
|
|
227
|
-
getFilteredMessages: (msgs: Message[][], skipFilter?: boolean) => Message[][];
|
|
217
|
+
//#region src/hooks/useCustomerSupportHandoff.d.ts
|
|
218
|
+
/**
|
|
219
|
+
* Hook to call the `click` method of the merchant's customer support chat widget.
|
|
220
|
+
*
|
|
221
|
+
* @param onSwitchToAgent a function to override the function returned by the hook. This is mainly to
|
|
222
|
+
* preserve backward compatibility for merchants not using Kustomer and will be removed when all
|
|
223
|
+
* CS integrations are handled.
|
|
224
|
+
*
|
|
225
|
+
* @returns a function that searches for the customer support chat widget and calls the `click` method.
|
|
226
|
+
*/
|
|
227
|
+
declare const useCustomerSupportHandoff: (onSwitchToAgent?: () => void) => {
|
|
228
|
+
onSwitch: () => void;
|
|
228
229
|
};
|
|
229
230
|
//#endregion
|
|
231
|
+
//#region src/hooks/useDebounce.d.ts
|
|
232
|
+
declare function useDebounce<T>(value: T, delay: number): T;
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region src/hooks/useDynamicVariants.d.ts
|
|
235
|
+
declare const useDynamicVariants: () => void;
|
|
236
|
+
//#endregion
|
|
230
237
|
//#region src/application/utils/mouseEventTypes.d.ts
|
|
231
238
|
type MouseEventTypes = 'click' | 'dblclick' | 'mouseup' | 'mousedown';
|
|
232
239
|
//#endregion
|
|
@@ -265,6 +272,230 @@ interface ElementObserverUtility {
|
|
|
265
272
|
}
|
|
266
273
|
declare const useElementObserver: (selector: NodeSelector) => ElementObserverUtility;
|
|
267
274
|
//#endregion
|
|
275
|
+
//#region src/hooks/useFileUpload.d.ts
|
|
276
|
+
declare const useFileUpload: () => {
|
|
277
|
+
error: string;
|
|
278
|
+
fileInputRef: react1.MutableRefObject<null>;
|
|
279
|
+
attachment: AttachmentRequest | undefined;
|
|
280
|
+
handleFileSelect: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
281
|
+
handleFileRemove: () => void;
|
|
282
|
+
prepareAttachment: () => AttachmentRequest | undefined;
|
|
283
|
+
};
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/hooks/useGrabAndScroll.d.ts
|
|
286
|
+
declare const useGrabAndScroll: (enabled: boolean, chunkWidth: number, speed?: number, offset?: number) => {
|
|
287
|
+
containerRef: react1.RefObject<HTMLDivElement>;
|
|
288
|
+
leftArrow: boolean;
|
|
289
|
+
rightArrow: boolean;
|
|
290
|
+
animationTrigger: () => void;
|
|
291
|
+
onNext: (cardsToSlide: number) => void;
|
|
292
|
+
onPrevious: (cardsToSlide: number) => void;
|
|
293
|
+
};
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/hooks/useHideElements.d.ts
|
|
296
|
+
/**
|
|
297
|
+
* This hook hides/shows elements that could overlap with the chat when the chat is opened/closed.
|
|
298
|
+
*/
|
|
299
|
+
declare const useHideElements: () => void;
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region src/hooks/useHorizontalScrollAnimation.d.ts
|
|
302
|
+
interface UseHorizontalScrollAnimationOptions {
|
|
303
|
+
scrollContainerRef: RefObject<HTMLDivElement>;
|
|
304
|
+
animationSpeed?: 'standard' | 'slow' | 'none';
|
|
305
|
+
}
|
|
306
|
+
declare function useHorizontalScrollAnimation({
|
|
307
|
+
scrollContainerRef,
|
|
308
|
+
animationSpeed
|
|
309
|
+
}: UseHorizontalScrollAnimationOptions): void;
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region src/hooks/useImageResolver.d.ts
|
|
312
|
+
declare const useImageResolver: () => {
|
|
313
|
+
resolve: (image?: string, size?: number) => string | undefined;
|
|
314
|
+
};
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/hooks/useIntersection.d.ts
|
|
317
|
+
declare const useIntersection: (element: RefObject<HTMLElement>, rootMargin: string) => boolean;
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/hooks/useIsSmallScreen.d.ts
|
|
320
|
+
declare const useIsSmallScreen: () => boolean;
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region src/hooks/useMessageFilter.d.ts
|
|
323
|
+
type MessageFinder = {
|
|
324
|
+
msgs: Message[][];
|
|
325
|
+
type?: MessageType;
|
|
326
|
+
role?: MessageRole;
|
|
327
|
+
};
|
|
328
|
+
declare const useMessageFilter: () => {
|
|
329
|
+
findMessageIndex: ({
|
|
330
|
+
msgs,
|
|
331
|
+
type,
|
|
332
|
+
role
|
|
333
|
+
}: MessageFinder) => number;
|
|
334
|
+
removePreviousDiscussions: (msgs: Message[][], index: number) => Message[][];
|
|
335
|
+
getFilteredMessages: (msgs: Message[][], skipFilter?: boolean) => Message[][];
|
|
336
|
+
};
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region src/hooks/useMessageScrollObserver.d.ts
|
|
339
|
+
declare const useMessageScrollObserver: (boxRef: React.RefObject<HTMLDivElement>, scrollRef: React.RefObject<HTMLDivElement>, onScrollChange: (position: number) => void) => void;
|
|
340
|
+
//#endregion
|
|
341
|
+
//#region src/hooks/useReducedMotionWithOverride.d.ts
|
|
342
|
+
declare const useReducedMotionWithOverride: () => any;
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/application/models/api/search.d.ts
|
|
345
|
+
interface SearchResult {
|
|
346
|
+
products: SearchResponseProduct[];
|
|
347
|
+
filters: string[];
|
|
348
|
+
generatedQuery?: string;
|
|
349
|
+
totalProductCount: number;
|
|
350
|
+
searchResponseId: string;
|
|
351
|
+
}
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region src/atoms/search/searchAPI.d.ts
|
|
354
|
+
type SelectedFilterOption = {
|
|
355
|
+
id: string;
|
|
356
|
+
displayName: string;
|
|
357
|
+
filterId: string;
|
|
358
|
+
filterItemId: string;
|
|
359
|
+
};
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/types/search-filter-types.d.ts
|
|
362
|
+
type SelectFilterItem = ({
|
|
363
|
+
filterId,
|
|
364
|
+
filterItemId,
|
|
365
|
+
isSelected,
|
|
366
|
+
displayName
|
|
367
|
+
}: {
|
|
368
|
+
filterId: string;
|
|
369
|
+
filterItemId: string;
|
|
370
|
+
isSelected: boolean;
|
|
371
|
+
displayName: string;
|
|
372
|
+
}) => void;
|
|
373
|
+
type SearchFilter = {
|
|
374
|
+
filterId: string;
|
|
375
|
+
displayName: string;
|
|
376
|
+
items: SearchFilterItem[];
|
|
377
|
+
};
|
|
378
|
+
type SearchFilterItem = {
|
|
379
|
+
filterItemId: string;
|
|
380
|
+
displayName: string;
|
|
381
|
+
productCount: number;
|
|
382
|
+
isSelected: boolean;
|
|
383
|
+
};
|
|
384
|
+
//#endregion
|
|
385
|
+
//#region src/hooks/utils.d.ts
|
|
386
|
+
declare const enum SearchResultsState {
|
|
387
|
+
Loading = 0,
|
|
388
|
+
Results = 1,
|
|
389
|
+
NoResults = 2,
|
|
390
|
+
}
|
|
391
|
+
//#endregion
|
|
392
|
+
//#region src/hooks/useSearch.d.ts
|
|
393
|
+
interface SearchResultsHocProps {
|
|
394
|
+
searchData: SearchResult | null;
|
|
395
|
+
searchResponseId: string;
|
|
396
|
+
merchantShortName: string;
|
|
397
|
+
productCardConfig: ProductCardConfig;
|
|
398
|
+
productList: SearchResponseProduct[];
|
|
399
|
+
autocompleteResults: string[];
|
|
400
|
+
searchFilters: SearchFilter[];
|
|
401
|
+
availableDynamicFilters: {
|
|
402
|
+
name: string;
|
|
403
|
+
displayName: string;
|
|
404
|
+
}[];
|
|
405
|
+
selectedFilterOptions: SelectedFilterOption[];
|
|
406
|
+
searchText: string;
|
|
407
|
+
searchResultsState: SearchResultsState;
|
|
408
|
+
isLoadingAutocomplete: boolean;
|
|
409
|
+
isLoadingSearch: boolean;
|
|
410
|
+
isFilterOpen: boolean;
|
|
411
|
+
isDirty: boolean;
|
|
412
|
+
focusedIndex: number;
|
|
413
|
+
focusedOptionId: string | undefined;
|
|
414
|
+
filterButtonText: string;
|
|
415
|
+
onSearchInputChange: (value: string) => void;
|
|
416
|
+
onSubmitSearch: () => void;
|
|
417
|
+
onAutocompleteSelect: (suggestion: string) => void;
|
|
418
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
419
|
+
onToggleDynamicFilter: ({
|
|
420
|
+
filter,
|
|
421
|
+
dynamicFilterDisplayName
|
|
422
|
+
}: {
|
|
423
|
+
filter: string;
|
|
424
|
+
dynamicFilterDisplayName: string;
|
|
425
|
+
}) => void;
|
|
426
|
+
onSelectFilterItem: SelectFilterItem;
|
|
427
|
+
onRemoveFilter: (filter: SelectedFilterOption) => void;
|
|
428
|
+
onClearAllFilters: () => void;
|
|
429
|
+
setIsFilterOpen: (isFilterOpen: boolean) => void;
|
|
430
|
+
searchResultsRef: React.RefObject<HTMLDivElement>;
|
|
431
|
+
}
|
|
432
|
+
declare const useSearch: () => SearchResultsHocProps;
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region src/hooks/useSnapCalculator.d.ts
|
|
435
|
+
type Unit = 'percent' | 'pixel';
|
|
436
|
+
declare const useSnapCalculator: (snaps: number[], maxHeight: number, unit: Unit) => {
|
|
437
|
+
viewportHeightPx: number;
|
|
438
|
+
snapsToPixels: number[];
|
|
439
|
+
swipeviewHeightPx: number;
|
|
440
|
+
getPixelToSnap: (pixels: number) => number;
|
|
441
|
+
getSnapToPixel: (snap: number) => number;
|
|
442
|
+
};
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/hooks/useSnapControl.d.ts
|
|
445
|
+
type SnapControl = {
|
|
446
|
+
animationKey?: MotionValue;
|
|
447
|
+
animation: ValueAnimationTransition;
|
|
448
|
+
height: number;
|
|
449
|
+
unit: Unit;
|
|
450
|
+
snaps: number[];
|
|
451
|
+
initSnap: number;
|
|
452
|
+
threshold?: number;
|
|
453
|
+
overlayOpacity: number;
|
|
454
|
+
onSnapComplete: (currentSnap: number, nextSnap: number, collapsed: boolean) => void;
|
|
455
|
+
};
|
|
456
|
+
declare const useSnapControl: ({
|
|
457
|
+
animationKey,
|
|
458
|
+
animation,
|
|
459
|
+
height,
|
|
460
|
+
unit,
|
|
461
|
+
snaps,
|
|
462
|
+
initSnap,
|
|
463
|
+
onSnapComplete,
|
|
464
|
+
overlayOpacity
|
|
465
|
+
}: SnapControl) => {
|
|
466
|
+
scope: motion_dom0.AnimationScope<any>;
|
|
467
|
+
animatedY: MotionValue<any> | MotionValue<number>;
|
|
468
|
+
animate: {
|
|
469
|
+
(sequence: framer_motion0.AnimationSequence, options?: framer_motion0.SequenceOptions | undefined): motion_dom0.AnimationPlaybackControlsWithThen;
|
|
470
|
+
(value: string | MotionValue<string>, keyframes: string | motion_dom0.UnresolvedValueKeyframe<string>[], options?: ValueAnimationTransition<string> | undefined): motion_dom0.AnimationPlaybackControlsWithThen;
|
|
471
|
+
(value: number | MotionValue<number>, keyframes: number | motion_dom0.UnresolvedValueKeyframe<number>[], options?: ValueAnimationTransition<number> | undefined): motion_dom0.AnimationPlaybackControlsWithThen;
|
|
472
|
+
<V extends string | number>(value: V | MotionValue<V>, keyframes: V | motion_dom0.UnresolvedValueKeyframe<V>[], options?: ValueAnimationTransition<V> | undefined): motion_dom0.AnimationPlaybackControlsWithThen;
|
|
473
|
+
(element: motion_dom0.ElementOrSelector, keyframes: motion_dom0.DOMKeyframesDefinition, options?: motion_dom0.AnimationOptions | undefined): motion_dom0.AnimationPlaybackControlsWithThen;
|
|
474
|
+
<O extends {}>(object: O | O[], keyframes: framer_motion0.ObjectTarget<O>, options?: motion_dom0.AnimationOptions | undefined): motion_dom0.AnimationPlaybackControlsWithThen;
|
|
475
|
+
};
|
|
476
|
+
swipeviewHeightPx: number;
|
|
477
|
+
initSnapInPixels: number;
|
|
478
|
+
contentHeight: MotionValue<number>;
|
|
479
|
+
currentSnap: number;
|
|
480
|
+
displayOverlay: MotionValue<string>;
|
|
481
|
+
opacityOverlay: MotionValue<number>;
|
|
482
|
+
getSnapToPixel: (snap: number) => number;
|
|
483
|
+
jumpTo: (snapPx: number) => {
|
|
484
|
+
nextSnap: number;
|
|
485
|
+
collapsed: boolean;
|
|
486
|
+
};
|
|
487
|
+
defineNextSnapByPosition: () => number;
|
|
488
|
+
resetControls: () => number;
|
|
489
|
+
};
|
|
490
|
+
//#endregion
|
|
491
|
+
//#region src/hooks/useSystemSettingsContext.d.ts
|
|
492
|
+
declare const useSystemSettingsContext: () => {
|
|
493
|
+
generationParams?: GenerationParams$1;
|
|
494
|
+
showDebugBar?: boolean;
|
|
495
|
+
endpointURL?: string;
|
|
496
|
+
setGenerationParams: react1.Dispatch<react1.SetStateAction<GenerationParams$1 | undefined>>;
|
|
497
|
+
};
|
|
498
|
+
//#endregion
|
|
268
499
|
//#region src/application/models/spiffyWidgets.d.ts
|
|
269
500
|
/**
|
|
270
501
|
* Enum of all widget names. These are widgets that are rendered and integrated into
|
|
@@ -327,9 +558,6 @@ declare enum SpiffyMetricsEventName {
|
|
|
327
558
|
*/
|
|
328
559
|
declare const useTrackComponentVisibleEvent: (component: SpiffyWidgets, element: RefObject<HTMLElement>, eventProps?: Record<string, unknown>, eventName?: SpiffyMetricsEventName) => void;
|
|
329
560
|
//#endregion
|
|
330
|
-
//#region src/hooks/useIntersection.d.ts
|
|
331
|
-
declare const useIntersection: (element: RefObject<HTMLElement>, rootMargin: string) => boolean;
|
|
332
|
-
//#endregion
|
|
333
561
|
//#region src/hooks/useUpdateAnalyticsProps.d.ts
|
|
334
562
|
/**
|
|
335
563
|
* Updates the default analytics properties whenever the variant info changes. This hook also
|
|
@@ -337,21 +565,4 @@ declare const useIntersection: (element: RefObject<HTMLElement>, rootMargin: str
|
|
|
337
565
|
*/
|
|
338
566
|
declare const useUpdateAnalyticsProps: () => void;
|
|
339
567
|
//#endregion
|
|
340
|
-
|
|
341
|
-
declare const useChatToggle: () => {
|
|
342
|
-
toggle: (triggerLocation: ChatElementDisplayLocation, triggerId?: string) => void;
|
|
343
|
-
isOpen: boolean;
|
|
344
|
-
openChat: (triggerLocation: ChatElementDisplayLocation, triggerId?: string) => void;
|
|
345
|
-
closeChat: (triggerLocation: ChatElementDisplayLocation, triggerId?: string) => void;
|
|
346
|
-
};
|
|
347
|
-
//#endregion
|
|
348
|
-
//#region src/hooks/useDynamicVariants.d.ts
|
|
349
|
-
declare const useDynamicVariants: () => void;
|
|
350
|
-
//#endregion
|
|
351
|
-
//#region src/hooks/useHideElements.d.ts
|
|
352
|
-
/**
|
|
353
|
-
* This hook hides/shows elements that could overlap with the chat when the chat is opened/closed.
|
|
354
|
-
*/
|
|
355
|
-
declare const useHideElements: () => void;
|
|
356
|
-
//#endregion
|
|
357
|
-
export { ElementObserverUtility, useChatToggle, useDynamicVariants, useElementObserver, useHideElements, useIntersection, useIsSmallScreen, useMessageFilter, useSystemSettingsContext, useTrackComponentVisibleEvent, useUpdateAnalyticsProps };
|
|
568
|
+
export { ElementObserverUtility, SearchResultsHocProps, Unit, useBlockBackButton, useChatToggle, useCustomerSupportHandoff, useDebounce, useDynamicVariants, useElementObserver, useFileUpload, useGrabAndScroll, useHideElements, useHorizontalScrollAnimation, useImageResolver, useIntersection, useIsSmallScreen, useMessageFilter, useMessageScrollObserver, useReducedMotionWithOverride, useSearch, useSnapCalculator, useSnapControl, useSystemSettingsContext, useTrackComponentVisibleEvent, useUpdateAnalyticsProps };
|