@rebuy/rebuy-hydrogen 3.0.0-beta.1 → 3.0.0-beta.11
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/{src/components/AddToCartBtn/types.ts → dist/components/AddToCartBtn/types.d.ts} +2 -2
- 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/{src/components/Title/types.ts → dist/components/Title/types.d.ts} +2 -1
- 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/{src/components/VariantSelect/types.ts → dist/components/VariantSelect/types.d.ts} +3 -1
- 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/{src/context/RebuyContext.tsx → dist/context/RebuyContext.d.ts} +2 -5
- 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/{src/providers/types.ts → dist/providers/types.d.ts} +31 -18
- 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/rebuy-rebuy-hydrogen-3.0.0-beta.11.tgz +0 -0
- package/dist/types/common.d.ts +9 -0
- package/dist/types/common.d.ts.map +1 -0
- package/{src/types/rebuyCustom.ts → dist/types/rebuyCustom.d.ts} +62 -50
- package/dist/types/rebuyCustom.d.ts.map +1 -0
- package/{src/types/rebuySmartCart.ts → dist/types/rebuySmartCart.d.ts} +1 -5
- 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/{src/types/widgets.ts → dist/types/widgets.d.ts} +7 -13
- 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/{src/widgets/RebuyCompleteTheLook/index.ts → dist/widgets/RebuyCompleteTheLook/index.d.ts} +1 -0
- package/dist/widgets/RebuyCompleteTheLook/index.d.ts.map +1 -0
- package/{src/widgets/RebuyCompleteTheLook/types.ts → dist/widgets/RebuyCompleteTheLook/types.d.ts} +1 -1
- 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/{src/widgets/RebuyDynamicBundleProducts/index.ts → dist/widgets/RebuyDynamicBundleProducts/index.d.ts} +1 -0
- package/dist/widgets/RebuyDynamicBundleProducts/index.d.ts.map +1 -0
- package/{src/widgets/RebuyDynamicBundleProducts/types.ts → dist/widgets/RebuyDynamicBundleProducts/types.d.ts} +1 -5
- 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/{src/widgets/RebuyProductAddOns/index.ts → dist/widgets/RebuyProductAddOns/index.d.ts} +1 -0
- package/dist/widgets/RebuyProductAddOns/index.d.ts.map +1 -0
- package/{src/widgets/RebuyProductAddOns/types.ts → dist/widgets/RebuyProductAddOns/types.d.ts} +2 -7
- 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/{src/widgets/RebuyProductRecommendations/index.ts → dist/widgets/RebuyProductRecommendations/index.d.ts} +1 -0
- package/dist/widgets/RebuyProductRecommendations/index.d.ts.map +1 -0
- package/{src/widgets/RebuyProductRecommendations/types.ts → dist/widgets/RebuyProductRecommendations/types.d.ts} +1 -1
- 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 +50 -37
- package/src/components/AddToCartBtn/AddToCartBtn.tsx +0 -45
- package/src/components/AddToCartBtn/HydrogenAddToCartBtn.tsx +0 -43
- package/src/components/AddToCartBtn/HydrogenReactAddToCartBtn.tsx +0 -35
- package/src/components/AddToCartBtn/index.ts +0 -1
- package/src/components/ProductCard/ProductCard.tsx +0 -70
- package/src/components/ProductCard/index.ts +0 -1
- package/src/components/ProductCard/types.ts +0 -10
- package/src/components/ProductPrice/ProductPrice.tsx +0 -49
- package/src/components/ProductPrice/index.ts +0 -1
- package/src/components/Title/Title.tsx +0 -20
- package/src/components/Title/index.ts +0 -1
- package/src/components/VariantSelect/VariantSelect.tsx +0 -45
- package/src/components/VariantSelect/index.ts +0 -1
- package/src/hooks/titleLevel.tsx +0 -42
- package/src/index.ts +0 -7
- package/src/providers/RebuyHydrogenContextProvider.tsx +0 -112
- package/src/providers/RebuyHydrogenReactContextProvider.tsx +0 -192
- package/src/queries/cart.queries.ts +0 -467
- package/src/types/common.ts +0 -8
- package/src/types/css.d.ts +0 -11
- package/src/types/env.d.ts +0 -12
- package/src/types/rebuy.d.ts +0 -31
- package/src/types/shopify.ts +0 -142
- package/src/utils/convertToRebuyProduct.tsx +0 -319
- package/src/utils/createContextParameters.ts +0 -142
- package/src/utils/getEncodedAttributes.ts +0 -11
- package/src/utils/getRebuyConfig.ts +0 -31
- package/src/widgetContainer/RebuyWidgetContainer.tsx +0 -183
- package/src/widgets/RebuyCompleteTheLook/RebuyCompleteTheLook.tsx +0 -50
- package/src/widgets/RebuyDynamicBundleProducts/BundleImages.tsx +0 -62
- package/src/widgets/RebuyDynamicBundleProducts/BundlePrice.tsx +0 -93
- package/src/widgets/RebuyDynamicBundleProducts/BundleSelection.tsx +0 -65
- package/src/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.tsx +0 -118
- package/src/widgets/RebuyDynamicBundleProducts/Select.tsx +0 -41
- package/src/widgets/RebuyProductAddOns/RebuyProductAddOnCard.tsx +0 -66
- package/src/widgets/RebuyProductAddOns/RebuyProductAddOns.tsx +0 -218
- package/src/widgets/RebuyProductRecommendations/RebuyProductRecommendations.tsx +0 -50
@@ -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"}
|
@@ -1,9 +1,6 @@
|
|
1
|
-
import { createContext } from 'react';
|
2
|
-
|
3
1
|
import { type ContextParameters } from '~/types/rebuyCustom';
|
4
|
-
|
5
2
|
export type RebuyContextType = {
|
6
3
|
contextParameters: ContextParameters;
|
7
4
|
};
|
8
|
-
|
9
|
-
|
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"}
|