@rebuy/rebuy-hydrogen 2.3.1 → 3.0.0-alpha.3
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 +195 -17
- package/dist/assets/Close.d.ts +2 -0
- package/dist/assets/Close.d.ts.map +1 -0
- package/dist/components/AddToCartBtn/AddToCartBtn.d.ts +3 -0
- package/dist/components/AddToCartBtn/AddToCartBtn.d.ts.map +1 -0
- package/dist/components/AddToCartBtn/HydrogenAddToCartBtn.d.ts +3 -0
- package/dist/components/AddToCartBtn/HydrogenAddToCartBtn.d.ts.map +1 -0
- package/dist/components/AddToCartBtn/HydrogenReactAddToCartBtn.d.ts +3 -0
- package/dist/components/AddToCartBtn/HydrogenReactAddToCartBtn.d.ts.map +1 -0
- package/dist/components/AddToCartBtn/index.d.ts +2 -0
- package/dist/components/AddToCartBtn/index.d.ts.map +1 -0
- package/dist/components/AddToCartBtn/types.d.ts +27 -0
- package/dist/components/AddToCartBtn/types.d.ts.map +1 -0
- package/dist/components/ProductCard/ProductCard.d.ts +3 -0
- package/dist/components/ProductCard/ProductCard.d.ts.map +1 -0
- package/dist/components/ProductCard/defaultSettings.d.ts +3 -0
- package/dist/components/ProductCard/defaultSettings.d.ts.map +1 -0
- package/dist/components/ProductCard/index.d.ts +3 -0
- package/dist/components/ProductCard/index.d.ts.map +1 -0
- package/dist/components/ProductCard/types.d.ts +52 -0
- package/dist/components/ProductCard/types.d.ts.map +1 -0
- package/dist/components/ProductCarousel/ProductCarousel.d.ts +16 -0
- package/dist/components/ProductCarousel/ProductCarousel.d.ts.map +1 -0
- package/dist/components/ProductCarousel/index.d.ts +2 -0
- package/dist/components/ProductCarousel/index.d.ts.map +1 -0
- package/dist/components/ProductPrice/ProductPrice.d.ts +3 -0
- package/dist/components/ProductPrice/ProductPrice.d.ts.map +1 -0
- package/dist/components/ProductPrice/index.d.ts +2 -0
- package/dist/components/ProductPrice/index.d.ts.map +1 -0
- package/dist/components/ProductPrice/types.d.ts +23 -0
- package/dist/components/ProductPrice/types.d.ts.map +1 -0
- package/dist/components/QuantityInput/QuantityInput.d.ts +3 -0
- package/dist/components/QuantityInput/QuantityInput.d.ts.map +1 -0
- package/dist/components/QuantityInput/index.d.ts +3 -0
- package/dist/components/QuantityInput/index.d.ts.map +1 -0
- package/dist/components/QuantityInput/types.d.ts +7 -0
- package/dist/components/QuantityInput/types.d.ts.map +1 -0
- package/dist/components/Timer/Timer.d.ts +3 -0
- package/dist/components/Timer/Timer.d.ts.map +1 -0
- package/dist/components/Timer/index.d.ts +3 -0
- package/dist/components/Timer/index.d.ts.map +1 -0
- package/dist/components/Timer/types.d.ts +16 -0
- package/dist/components/Timer/types.d.ts.map +1 -0
- package/dist/components/Title/Title.d.ts +3 -0
- package/dist/components/Title/Title.d.ts.map +1 -0
- package/dist/components/Title/index.d.ts +2 -0
- package/dist/components/Title/index.d.ts.map +1 -0
- package/dist/components/Title/types.d.ts +8 -0
- package/dist/components/Title/types.d.ts.map +1 -0
- package/dist/components/VariantSelect/VariantSelect.d.ts +3 -0
- package/dist/components/VariantSelect/VariantSelect.d.ts.map +1 -0
- package/dist/components/VariantSelect/index.d.ts +2 -0
- package/dist/components/VariantSelect/index.d.ts.map +1 -0
- package/dist/components/VariantSelect/types.d.ts +8 -0
- package/dist/components/VariantSelect/types.d.ts.map +1 -0
- package/dist/constants/api.d.ts +2 -0
- package/dist/constants/api.d.ts.map +1 -0
- package/dist/context/RebuyConfigContext.d.ts +21 -0
- package/dist/context/RebuyConfigContext.d.ts.map +1 -0
- package/dist/context/RebuyContext.d.ts +6 -0
- package/dist/context/RebuyContext.d.ts.map +1 -0
- package/dist/hooks/titleLevel.d.ts +3 -0
- package/dist/hooks/titleLevel.d.ts.map +1 -0
- package/dist/hooks/useBreakpoint.d.ts +5 -0
- package/dist/hooks/useBreakpoint.d.ts.map +1 -0
- package/dist/hooks/usePopupTrigger.d.ts +3 -0
- package/dist/hooks/usePopupTrigger.d.ts.map +1 -0
- package/dist/hooks/useRebuyTheme.d.ts +21 -0
- package/dist/hooks/useRebuyTheme.d.ts.map +1 -0
- package/dist/index.css +853 -0
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3211 -0
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +3178 -0
- package/dist/index.mjs.map +7 -0
- package/dist/providers/RebuyHydrogenContextProvider.d.ts +3 -0
- package/dist/providers/RebuyHydrogenContextProvider.d.ts.map +1 -0
- package/dist/providers/RebuyHydrogenReactContextProvider.d.ts +8 -0
- package/dist/providers/RebuyHydrogenReactContextProvider.d.ts.map +1 -0
- package/dist/providers/types.d.ts +71 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/queries/cart.queries.d.ts +5 -0
- package/dist/queries/cart.queries.d.ts.map +1 -0
- package/dist/types/common.d.ts +9 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/rebuyCustom.d.ts +275 -0
- package/dist/types/rebuyCustom.d.ts.map +1 -0
- package/dist/types/rebuySmartCart.d.ts +184 -0
- package/dist/types/rebuySmartCart.d.ts.map +1 -0
- package/dist/types/shopify.d.ts +85 -0
- package/dist/types/shopify.d.ts.map +1 -0
- package/dist/types/widgets.d.ts +23 -0
- package/dist/types/widgets.d.ts.map +1 -0
- package/dist/utils/convertToRebuyProduct.d.ts +156 -0
- package/dist/utils/convertToRebuyProduct.d.ts.map +1 -0
- package/dist/utils/createContextParameters.d.ts +3 -0
- package/dist/utils/createContextParameters.d.ts.map +1 -0
- package/dist/utils/csp.d.ts +16 -0
- package/dist/utils/csp.d.ts.map +1 -0
- package/dist/utils/getEncodedAttributes.d.ts +3 -0
- package/dist/utils/getEncodedAttributes.d.ts.map +1 -0
- package/dist/utils/getRebuyConfig.d.ts +3 -0
- package/dist/utils/getRebuyConfig.d.ts.map +1 -0
- package/dist/utils/theme.d.ts +20 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/widgetContainer/RebuyWidgetContainer.d.ts +8 -0
- package/dist/widgetContainer/RebuyWidgetContainer.d.ts.map +1 -0
- package/dist/widgets/RebuyCompleteTheLook/RebuyCompleteTheLook.d.ts +3 -0
- package/dist/widgets/RebuyCompleteTheLook/RebuyCompleteTheLook.d.ts.map +1 -0
- package/dist/widgets/RebuyCompleteTheLook/index.d.ts +2 -0
- package/dist/widgets/RebuyCompleteTheLook/index.d.ts.map +1 -0
- package/dist/widgets/RebuyCompleteTheLook/types.d.ts +5 -0
- package/dist/widgets/RebuyCompleteTheLook/types.d.ts.map +1 -0
- package/dist/widgets/RebuyDynamicBundleProducts/BundleImages.d.ts +5 -0
- package/dist/widgets/RebuyDynamicBundleProducts/BundleImages.d.ts.map +1 -0
- package/dist/widgets/RebuyDynamicBundleProducts/BundlePrice.d.ts +5 -0
- package/dist/widgets/RebuyDynamicBundleProducts/BundlePrice.d.ts.map +1 -0
- package/dist/widgets/RebuyDynamicBundleProducts/BundleSelection.d.ts +3 -0
- package/dist/widgets/RebuyDynamicBundleProducts/BundleSelection.d.ts.map +1 -0
- package/dist/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.d.ts +3 -0
- package/dist/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.d.ts.map +1 -0
- package/dist/widgets/RebuyDynamicBundleProducts/Select.d.ts +3 -0
- package/dist/widgets/RebuyDynamicBundleProducts/Select.d.ts.map +1 -0
- package/dist/widgets/RebuyDynamicBundleProducts/index.d.ts +2 -0
- package/dist/widgets/RebuyDynamicBundleProducts/index.d.ts.map +1 -0
- package/dist/widgets/RebuyDynamicBundleProducts/types.d.ts +19 -0
- package/dist/widgets/RebuyDynamicBundleProducts/types.d.ts.map +1 -0
- package/dist/widgets/RebuyProductAddOns/RebuyProductAddOnCard.d.ts +3 -0
- package/dist/widgets/RebuyProductAddOns/RebuyProductAddOnCard.d.ts.map +1 -0
- package/dist/widgets/RebuyProductAddOns/RebuyProductAddOns.d.ts +3 -0
- package/dist/widgets/RebuyProductAddOns/RebuyProductAddOns.d.ts.map +1 -0
- package/dist/widgets/RebuyProductAddOns/index.d.ts +2 -0
- package/dist/widgets/RebuyProductAddOns/index.d.ts.map +1 -0
- package/dist/widgets/RebuyProductAddOns/types.d.ts +19 -0
- package/dist/widgets/RebuyProductAddOns/types.d.ts.map +1 -0
- package/dist/widgets/RebuyProductRecommendations/RebuyProductRecommendations.d.ts +3 -0
- package/dist/widgets/RebuyProductRecommendations/RebuyProductRecommendations.d.ts.map +1 -0
- package/dist/widgets/RebuyProductRecommendations/index.d.ts +2 -0
- package/dist/widgets/RebuyProductRecommendations/index.d.ts.map +1 -0
- package/dist/widgets/RebuyProductRecommendations/types.d.ts +5 -0
- package/dist/widgets/RebuyProductRecommendations/types.d.ts.map +1 -0
- package/dist/widgets/RebuyWidget/RebuyWidget.d.ts +3 -0
- package/dist/widgets/RebuyWidget/RebuyWidget.d.ts.map +1 -0
- package/dist/widgets/RebuyWidget/WidgetContent.d.ts +3 -0
- package/dist/widgets/RebuyWidget/WidgetContent.d.ts.map +1 -0
- package/dist/widgets/RebuyWidget/index.d.ts +2 -0
- package/dist/widgets/RebuyWidget/index.d.ts.map +1 -0
- package/dist/widgets/RebuyWidget/types.d.ts +335 -0
- package/dist/widgets/RebuyWidget/types.d.ts.map +1 -0
- package/package.json +85 -47
- package/RebuyCompleteTheLook.client.jsx +0 -188
- package/RebuyContextProvider.client.jsx +0 -222
- package/RebuyContexts.client.jsx +0 -3
- package/RebuyDynamicBundleProducts.client.jsx +0 -415
- package/RebuyProductAddOnCard.client.jsx +0 -89
- package/RebuyProductAddOns.client.jsx +0 -227
- package/RebuyProductRecommendations.client.jsx +0 -68
- package/RebuyProductViewed.client.jsx +0 -62
- package/RebuyRecentlyViewedProducts.client.jsx +0 -68
- package/RebuyWidgetContainer.client.jsx +0 -136
@@ -0,0 +1,21 @@
|
|
1
|
+
import { type ReactNode } from 'react';
|
2
|
+
import type { RebuyConfig } from '~/types/rebuyCustom';
|
3
|
+
export type RebuyConfigLoadingStatus = 'idle' | 'loading' | 'success' | 'error';
|
4
|
+
export type RebuyConfigContextType = {
|
5
|
+
apiKey: string | null;
|
6
|
+
fetchError: Error | string | null;
|
7
|
+
fetchRebuyConfig: (domain: string) => Promise<void>;
|
8
|
+
loadingStatus: RebuyConfigLoadingStatus;
|
9
|
+
rebuyConfig: RebuyConfig | null;
|
10
|
+
shopDomain: string | null;
|
11
|
+
};
|
12
|
+
export type RebuyConfigProviderProps = {
|
13
|
+
children: ReactNode;
|
14
|
+
/** The Shopify store domain (e.g., example-brand.myshopify.com) used to fetch the config. */
|
15
|
+
initialShopDomain?: string;
|
16
|
+
/** Optional API key to override environment variable or config-derived one. */
|
17
|
+
overrideApiKey?: string;
|
18
|
+
};
|
19
|
+
export declare const RebuyConfigProvider: ({ children, initialShopDomain, overrideApiKey }: RebuyConfigProviderProps) => import("react/jsx-runtime").JSX.Element;
|
20
|
+
export declare const useRebuyConfig: () => RebuyConfigContextType;
|
21
|
+
//# sourceMappingURL=RebuyConfigContext.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RebuyConfigContext.d.ts","sourceRoot":"","sources":["../../src/context/RebuyConfigContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,aAAa,EAAE,wBAAwB,CAAC;IACxC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAIF,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,6FAA6F;IAC7F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,iDAAiD,wBAAwB,4CAyE5G,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,sBAQjC,CAAC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { type ContextParameters } from '~/types/rebuyCustom';
|
2
|
+
export type RebuyContextType = {
|
3
|
+
contextParameters: ContextParameters;
|
4
|
+
};
|
5
|
+
export declare const RebuyContext: import("react").Context<RebuyContextType | null>;
|
6
|
+
//# sourceMappingURL=RebuyContext.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RebuyContext.d.ts","sourceRoot":"","sources":["../../src/context/RebuyContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG;IAC3B,iBAAiB,EAAE,iBAAiB,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,YAAY,kDAA+C,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"titleLevel.d.ts","sourceRoot":"","sources":["../../src/hooks/titleLevel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,gBAAe,OAAe,KAAG,qBAyC7E,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/useBreakpoint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,KAAK,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/C,eAAO,MAAM,aAAa,GAAI,UAAU,cAAc,GAAG,IAAI,KAAG,UA4C/D,CAAC"}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { WidgetSettings } from '~/widgets/RebuyWidget/types';
|
2
|
+
export declare const usePopupTrigger: (settings: WidgetSettings | null, popupTriggerId: string | undefined, widgetId: string, popupShownOnce: boolean, showPopup: boolean, setShowPopup: (show: boolean) => void, setPopupShownOnce: (shown: boolean) => void) => void;
|
3
|
+
//# sourceMappingURL=usePopupTrigger.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"usePopupTrigger.d.ts","sourceRoot":"","sources":["../../src/hooks/usePopupTrigger.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,eAAO,MAAM,eAAe,GACxB,UAAU,cAAc,GAAG,IAAI,EAC/B,gBAAgB,MAAM,GAAG,SAAS,EAClC,UAAU,MAAM,EAChB,gBAAgB,OAAO,EACvB,WAAW,OAAO,EAClB,cAAc,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EACrC,mBAAmB,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,SAoI9C,CAAC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export type RebuyThemeLinkOptions = {
|
2
|
+
/**
|
3
|
+
* Override the API key from the RebuyConfigContext.
|
4
|
+
* Useful if you need to specify a different key for styles
|
5
|
+
* than the one used for general API calls.
|
6
|
+
*/
|
7
|
+
overrideApiKey?: string;
|
8
|
+
};
|
9
|
+
/**
|
10
|
+
* A hook that returns an array of link objects for the Rebuy theme stylesheet,
|
11
|
+
* suitable for Remix's links function. It attempts to use the API key from
|
12
|
+
* the RebuyConfigContext.
|
13
|
+
*
|
14
|
+
* @param {RebuyThemeLinkOptions} options - Optional override for apiKey.
|
15
|
+
* @returns {Array<{ href: string; rel: string }>} An array containing the link object, or an empty array if prerequisites are not met.
|
16
|
+
*/
|
17
|
+
export declare const useRebuyTheme: (options?: RebuyThemeLinkOptions) => {
|
18
|
+
href: string;
|
19
|
+
rel: string;
|
20
|
+
}[];
|
21
|
+
//# sourceMappingURL=useRebuyTheme.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useRebuyTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useRebuyTheme.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,UAAS,qBAA0B;;;GAsChE,CAAC"}
|