@fayz-ai/storefront 0.6.0 → 0.7.0
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/auth.d.ts +12 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/blocks.d.ts +3 -3
- package/dist/blocks.d.ts.map +1 -1
- package/dist/component-contracts.d.ts +124 -0
- package/dist/component-contracts.d.ts.map +1 -0
- package/dist/component-selectors.d.ts +61 -0
- package/dist/component-selectors.d.ts.map +1 -0
- package/dist/components/CartDrawer.d.ts.map +1 -1
- package/dist/components/ProductCard.d.ts +2 -5
- package/dist/components/ProductCard.d.ts.map +1 -1
- package/dist/components/ProductEnquiryForm.d.ts +8 -0
- package/dist/components/ProductEnquiryForm.d.ts.map +1 -0
- package/dist/components/ProductGrid.d.ts.map +1 -1
- package/dist/components/RelatedProducts.d.ts +1 -1
- package/dist/components/RelatedProducts.d.ts.map +1 -1
- package/dist/components/SmoothImage.d.ts +7 -0
- package/dist/components/SmoothImage.d.ts.map +1 -0
- package/dist/components/StorefrontFooter.d.ts.map +1 -1
- package/dist/components/StorefrontHeader.d.ts.map +1 -1
- package/dist/components/sections/CategoryShowcase.d.ts.map +1 -1
- package/dist/components/sections/HeroSection.d.ts.map +1 -1
- package/dist/components/sections/MediaCarousel.d.ts +11 -0
- package/dist/components/sections/MediaCarousel.d.ts.map +1 -0
- package/dist/components/sections/MiscSections.d.ts.map +1 -1
- package/dist/components/sections/ProductRail.d.ts.map +1 -1
- package/dist/components/sections/ProductSlider.d.ts +15 -0
- package/dist/components/sections/ProductSlider.d.ts.map +1 -0
- package/dist/config.d.ts +38 -21
- package/dist/config.d.ts.map +1 -1
- package/dist/createStorefrontApp.d.ts +12 -0
- package/dist/createStorefrontApp.d.ts.map +1 -1
- package/dist/define.d.ts +17 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useStorefront.d.ts +35 -0
- package/dist/hooks/useStorefront.d.ts.map +1 -0
- package/dist/index.cjs +904 -185
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +20 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +797 -95
- package/dist/index.js.map +1 -1
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/HomePage.d.ts +5 -2
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/MyPurchasesPage.d.ts.map +1 -1
- package/dist/pages/OrderConfirmationPage.d.ts.map +1 -1
- package/dist/pages/ProductDetailPage.d.ts.map +1 -1
- package/dist/sections.d.ts +45 -2
- package/dist/sections.d.ts.map +1 -1
- package/dist/testids.d.ts +20 -0
- package/dist/testids.d.ts.map +1 -1
- package/dist/theme.d.ts +4 -0
- package/dist/theme.d.ts.map +1 -1
- package/package.json +7 -9
- package/src/auth.ts +47 -10
- package/src/blocks.tsx +7 -3
- package/src/component-contracts.ts +140 -0
- package/src/component-selectors.ts +31 -0
- package/src/components/CartDrawer.tsx +2 -1
- package/src/components/ProductCard.tsx +39 -23
- package/src/components/ProductEnquiryForm.tsx +175 -0
- package/src/components/ProductGrid.tsx +12 -3
- package/src/components/RelatedProducts.tsx +13 -4
- package/src/components/SmoothImage.tsx +59 -0
- package/src/components/StorefrontFooter.tsx +24 -14
- package/src/components/StorefrontHeader.tsx +43 -38
- package/src/components/sections/CategoryShowcase.tsx +3 -2
- package/src/components/sections/HeroSection.tsx +18 -2
- package/src/components/sections/MediaCarousel.tsx +141 -0
- package/src/components/sections/MiscSections.tsx +2 -1
- package/src/components/sections/ProductRail.tsx +11 -3
- package/src/components/sections/ProductSlider.tsx +119 -0
- package/src/config.ts +65 -24
- package/src/createStorefrontApp.tsx +62 -9
- package/src/define.ts +34 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useStorefront.ts +58 -0
- package/src/index.ts +61 -11
- package/src/pages/CheckoutPage.tsx +2 -1
- package/src/pages/HomePage.tsx +6 -2
- package/src/pages/MyPurchasesPage.tsx +2 -1
- package/src/pages/OrderConfirmationPage.tsx +2 -1
- package/src/pages/ProductDetailPage.tsx +138 -62
- package/src/scaffold.tsx +1 -1
- package/src/sections.ts +49 -2
- package/src/testids.ts +20 -0
- package/src/theme.ts +4 -0
- package/src/workflows/checkout.ts +1 -1
- package/dist/slot-contracts.d.ts +0 -34
- package/dist/slot-contracts.d.ts.map +0 -1
- package/src/slot-contracts.ts +0 -20
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CreateProductEnquiryInput } from '@fayz-ai/shop/types';
|
|
2
|
+
import { navigateTo } from '../router';
|
|
3
|
+
import type { ProductOptionSelection } from '../product-options';
|
|
4
|
+
import type { Product } from '@fayz-ai/shop/types';
|
|
5
|
+
export declare function useStorefront(): import("..").ResolvedStorefrontConfig;
|
|
6
|
+
export declare function useCatalog(): {
|
|
7
|
+
catalogPath: string;
|
|
8
|
+
config: import("..").ResolvedStorefrontConfig;
|
|
9
|
+
search: string;
|
|
10
|
+
categoryId: string | null;
|
|
11
|
+
priceMin: number | null;
|
|
12
|
+
priceMax: number | null;
|
|
13
|
+
inStockOnly: boolean;
|
|
14
|
+
sort: import("..").CatalogSort;
|
|
15
|
+
setSearch(search: string): void;
|
|
16
|
+
setCategoryId(categoryId: string | null): void;
|
|
17
|
+
setPriceMin(priceMin: number | null): void;
|
|
18
|
+
setPriceMax(priceMax: number | null): void;
|
|
19
|
+
setInStockOnly(inStockOnly: boolean): void;
|
|
20
|
+
setSort(sort: import("..").CatalogSort): void;
|
|
21
|
+
reset(): void;
|
|
22
|
+
};
|
|
23
|
+
export declare function useCart(): import("..").CartState;
|
|
24
|
+
export declare function useEnquiry(): {
|
|
25
|
+
enquiry: Required<Pick<import("..").StorefrontEnquiryConfig, "label" | "successMessage" | "subjectPrefix">> & Omit<import("..").StorefrontEnquiryConfig, "label" | "successMessage" | "subjectPrefix">;
|
|
26
|
+
createProductEnquiry: (input: CreateProductEnquiryInput) => Promise<import("@fayz-ai/shop").ProductEnquiry>;
|
|
27
|
+
};
|
|
28
|
+
export declare function useStorefrontActions(): {
|
|
29
|
+
navigateTo: typeof navigateTo;
|
|
30
|
+
addToCart: (product: Product, quantity?: number, options?: ProductOptionSelection) => void;
|
|
31
|
+
openCart: () => void;
|
|
32
|
+
closeCart: () => void;
|
|
33
|
+
createProductEnquiry: (input: CreateProductEnquiryInput) => Promise<import("@fayz-ai/shop").ProductEnquiry>;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=useStorefront.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStorefront.d.ts","sourceRoot":"","sources":["../../src/hooks/useStorefront.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAGtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,wBAAgB,aAAa,0CAE5B;AAED,wBAAgB,UAAU;;;;;;;;;;;;;;;;EAQzB;AAED,wBAAgB,OAAO,2BAEtB;AAED,wBAAgB,UAAU;;kCAEmB,yBAAyB;EAYrE;AAED,wBAAgB,oBAAoB;;yBAQX,OAAO,aAAa,MAAM,YAAY,sBAAsB;;;kCAtBxC,yBAAyB;EA4BrE"}
|