@se-faststore/components 0.0.0-stage → 0.12.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/LICENSE +21 -0
- package/README.md +129 -2
- package/dist/b2b/SeActionHubBulletinBoard/index.d.ts +2 -0
- package/dist/b2b/SeActionHubBulletinBoard/index.d.ts.map +1 -0
- package/dist/b2b/SeActionHubBulletinBoard/index.js +18 -0
- package/dist/b2b/SeActionHubBulletinBoard/index.js.map +1 -0
- package/dist/b2b/SeActionHubBulletinBoard/types.d.ts +24 -0
- package/dist/b2b/SeActionHubBulletinBoard/types.d.ts.map +1 -0
- package/dist/b2b/SeActionHubBulletinBoard/types.js +3 -0
- package/dist/b2b/SeActionHubBulletinBoard/types.js.map +1 -0
- package/dist/b2b/SeAddToPurchaseList/addToPurchaseListUtils.d.ts +24 -0
- package/dist/b2b/SeAddToPurchaseList/addToPurchaseListUtils.d.ts.map +1 -0
- package/dist/b2b/SeAddToPurchaseList/addToPurchaseListUtils.js +28 -0
- package/dist/b2b/SeAddToPurchaseList/addToPurchaseListUtils.js.map +1 -0
- package/dist/b2b/SeAddToPurchaseList/index.d.ts +3 -0
- package/dist/b2b/SeAddToPurchaseList/index.d.ts.map +1 -0
- package/dist/b2b/SeAddToPurchaseList/index.js +19 -0
- package/dist/b2b/SeAddToPurchaseList/index.js.map +1 -0
- package/dist/b2b/SeAddToPurchaseList/useAddToPurchaseList.d.ts +29 -0
- package/dist/b2b/SeAddToPurchaseList/useAddToPurchaseList.d.ts.map +1 -0
- package/dist/b2b/SeAddToPurchaseList/useAddToPurchaseList.js +86 -0
- package/dist/b2b/SeAddToPurchaseList/useAddToPurchaseList.js.map +1 -0
- package/dist/b2b/SeAddressSelector/index.d.ts +2 -0
- package/dist/b2b/SeAddressSelector/index.d.ts.map +1 -0
- package/dist/b2b/SeAddressSelector/index.js +18 -0
- package/dist/b2b/SeAddressSelector/index.js.map +1 -0
- package/dist/b2b/SeAddressSelector/useAddressSelector.d.ts +34 -0
- package/dist/b2b/SeAddressSelector/useAddressSelector.d.ts.map +1 -0
- package/dist/b2b/SeAddressSelector/useAddressSelector.js +127 -0
- package/dist/b2b/SeAddressSelector/useAddressSelector.js.map +1 -0
- package/dist/b2b/SeCategoryBanners/index.d.ts +2 -0
- package/dist/b2b/SeCategoryBanners/index.d.ts.map +1 -0
- package/dist/b2b/SeCategoryBanners/index.js +18 -0
- package/dist/b2b/SeCategoryBanners/index.js.map +1 -0
- package/dist/b2b/SeCategoryBanners/types.d.ts +9 -0
- package/dist/b2b/SeCategoryBanners/types.d.ts.map +1 -0
- package/dist/b2b/SeCategoryBanners/types.js +3 -0
- package/dist/b2b/SeCategoryBanners/types.js.map +1 -0
- package/dist/b2b/SeCheckStockAndPricing/checkStockAndPricingUtils.d.ts +114 -0
- package/dist/b2b/SeCheckStockAndPricing/checkStockAndPricingUtils.d.ts.map +1 -0
- package/dist/b2b/SeCheckStockAndPricing/checkStockAndPricingUtils.js +85 -0
- package/dist/b2b/SeCheckStockAndPricing/checkStockAndPricingUtils.js.map +1 -0
- package/dist/b2b/SeCheckStockAndPricing/index.d.ts +4 -0
- package/dist/b2b/SeCheckStockAndPricing/index.d.ts.map +1 -0
- package/dist/b2b/SeCheckStockAndPricing/index.js +20 -0
- package/dist/b2b/SeCheckStockAndPricing/index.js.map +1 -0
- package/dist/b2b/SeCheckStockAndPricing/stockCsv.d.ts +22 -0
- package/dist/b2b/SeCheckStockAndPricing/stockCsv.d.ts.map +1 -0
- package/dist/b2b/SeCheckStockAndPricing/stockCsv.js +79 -0
- package/dist/b2b/SeCheckStockAndPricing/stockCsv.js.map +1 -0
- package/dist/b2b/SeCheckStockAndPricing/useCheckStockAndPricing.d.ts +54 -0
- package/dist/b2b/SeCheckStockAndPricing/useCheckStockAndPricing.d.ts.map +1 -0
- package/dist/b2b/SeCheckStockAndPricing/useCheckStockAndPricing.js +209 -0
- package/dist/b2b/SeCheckStockAndPricing/useCheckStockAndPricing.js.map +1 -0
- package/dist/b2b/SeCustomCrossSellingShelf/index.d.ts +2 -0
- package/dist/b2b/SeCustomCrossSellingShelf/index.d.ts.map +1 -0
- package/dist/b2b/SeCustomCrossSellingShelf/index.js +18 -0
- package/dist/b2b/SeCustomCrossSellingShelf/index.js.map +1 -0
- package/dist/b2b/SeCustomCrossSellingShelf/useCrossSellingShelfOverride.d.ts +19 -0
- package/dist/b2b/SeCustomCrossSellingShelf/useCrossSellingShelfOverride.d.ts.map +1 -0
- package/dist/b2b/SeCustomCrossSellingShelf/useCrossSellingShelfOverride.js +21 -0
- package/dist/b2b/SeCustomCrossSellingShelf/useCrossSellingShelfOverride.js.map +1 -0
- package/dist/b2b/SeCustomProductCard/index.d.ts +3 -0
- package/dist/b2b/SeCustomProductCard/index.d.ts.map +1 -0
- package/dist/b2b/SeCustomProductCard/index.js +19 -0
- package/dist/b2b/SeCustomProductCard/index.js.map +1 -0
- package/dist/b2b/SeCustomProductCard/types.d.ts +30 -0
- package/dist/b2b/SeCustomProductCard/types.d.ts.map +1 -0
- package/dist/b2b/SeCustomProductCard/types.js +3 -0
- package/dist/b2b/SeCustomProductCard/types.js.map +1 -0
- package/dist/b2b/SeCustomProductCard/useB2bProductCard.d.ts +21 -0
- package/dist/b2b/SeCustomProductCard/useB2bProductCard.d.ts.map +1 -0
- package/dist/b2b/SeCustomProductCard/useB2bProductCard.js +33 -0
- package/dist/b2b/SeCustomProductCard/useB2bProductCard.js.map +1 -0
- package/dist/b2b/SeCustomShelfProduct/index.d.ts +3 -0
- package/dist/b2b/SeCustomShelfProduct/index.d.ts.map +1 -0
- package/dist/b2b/SeCustomShelfProduct/index.js +19 -0
- package/dist/b2b/SeCustomShelfProduct/index.js.map +1 -0
- package/dist/b2b/SeCustomShelfProduct/types.d.ts +6 -0
- package/dist/b2b/SeCustomShelfProduct/types.d.ts.map +1 -0
- package/dist/b2b/SeCustomShelfProduct/types.js +3 -0
- package/dist/b2b/SeCustomShelfProduct/types.js.map +1 -0
- package/dist/b2b/SeCustomShelfProduct/useB2bShelfProducts.d.ts +15 -0
- package/dist/b2b/SeCustomShelfProduct/useB2bShelfProducts.d.ts.map +1 -0
- package/dist/b2b/SeCustomShelfProduct/useB2bShelfProducts.js +19 -0
- package/dist/b2b/SeCustomShelfProduct/useB2bShelfProducts.js.map +1 -0
- package/dist/b2b/SeDashboards/index.d.ts +2 -0
- package/dist/b2b/SeDashboards/index.d.ts.map +1 -0
- package/dist/b2b/SeDashboards/index.js +18 -0
- package/dist/b2b/SeDashboards/index.js.map +1 -0
- package/dist/b2b/SeDashboards/useDashboards.d.ts +51 -0
- package/dist/b2b/SeDashboards/useDashboards.d.ts.map +1 -0
- package/dist/b2b/SeDashboards/useDashboards.js +172 -0
- package/dist/b2b/SeDashboards/useDashboards.js.map +1 -0
- package/dist/b2b/SeFooterB2B/index.d.ts +3 -0
- package/dist/b2b/SeFooterB2B/index.d.ts.map +1 -0
- package/dist/b2b/SeFooterB2B/index.js +19 -0
- package/dist/b2b/SeFooterB2B/index.js.map +1 -0
- package/dist/b2b/SeFooterB2B/types.d.ts +39 -0
- package/dist/b2b/SeFooterB2B/types.d.ts.map +1 -0
- package/dist/b2b/SeFooterB2B/types.js +3 -0
- package/dist/b2b/SeFooterB2B/types.js.map +1 -0
- package/dist/b2b/SeFooterB2B/useNewsletterSubscription.d.ts +16 -0
- package/dist/b2b/SeFooterB2B/useNewsletterSubscription.d.ts.map +1 -0
- package/dist/b2b/SeFooterB2B/useNewsletterSubscription.js +34 -0
- package/dist/b2b/SeFooterB2B/useNewsletterSubscription.js.map +1 -0
- package/dist/b2b/SeProductGalleryB2B/index.d.ts +2 -0
- package/dist/b2b/SeProductGalleryB2B/index.d.ts.map +1 -0
- package/dist/b2b/SeProductGalleryB2B/index.js +18 -0
- package/dist/b2b/SeProductGalleryB2B/index.js.map +1 -0
- package/dist/b2b/SeProductGalleryB2B/useProductGalleryB2B.d.ts +123 -0
- package/dist/b2b/SeProductGalleryB2B/useProductGalleryB2B.d.ts.map +1 -0
- package/dist/b2b/SeProductGalleryB2B/useProductGalleryB2B.js +159 -0
- package/dist/b2b/SeProductGalleryB2B/useProductGalleryB2B.js.map +1 -0
- package/dist/b2b/SePurchaseLists/index.d.ts +3 -0
- package/dist/b2b/SePurchaseLists/index.d.ts.map +1 -0
- package/dist/b2b/SePurchaseLists/index.js +19 -0
- package/dist/b2b/SePurchaseLists/index.js.map +1 -0
- package/dist/b2b/SePurchaseLists/purchaseListsUtils.d.ts +103 -0
- package/dist/b2b/SePurchaseLists/purchaseListsUtils.d.ts.map +1 -0
- package/dist/b2b/SePurchaseLists/purchaseListsUtils.js +69 -0
- package/dist/b2b/SePurchaseLists/purchaseListsUtils.js.map +1 -0
- package/dist/b2b/SePurchaseLists/usePurchaseLists.d.ts +57 -0
- package/dist/b2b/SePurchaseLists/usePurchaseLists.d.ts.map +1 -0
- package/dist/b2b/SePurchaseLists/usePurchaseLists.js +292 -0
- package/dist/b2b/SePurchaseLists/usePurchaseLists.js.map +1 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/index.d.ts +3 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/index.d.ts.map +1 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/index.js +19 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/index.js.map +1 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/recentOrdersSpendOverviewUtils.d.ts +58 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/recentOrdersSpendOverviewUtils.d.ts.map +1 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/recentOrdersSpendOverviewUtils.js +133 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/recentOrdersSpendOverviewUtils.js.map +1 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/useRecentOrdersSpendOverview.d.ts +21 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/useRecentOrdersSpendOverview.d.ts.map +1 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/useRecentOrdersSpendOverview.js +134 -0
- package/dist/b2b/SeRecentOrdersSpendOverview/useRecentOrdersSpendOverview.js.map +1 -0
- package/dist/b2b/SeRequestToBuy/index.d.ts +2 -0
- package/dist/b2b/SeRequestToBuy/index.d.ts.map +1 -0
- package/dist/b2b/SeRequestToBuy/index.js +18 -0
- package/dist/b2b/SeRequestToBuy/index.js.map +1 -0
- package/dist/b2b/SeRequestToBuy/useRequestToBuyForm.d.ts +23 -0
- package/dist/b2b/SeRequestToBuy/useRequestToBuyForm.d.ts.map +1 -0
- package/dist/b2b/SeRequestToBuy/useRequestToBuyForm.js +64 -0
- package/dist/b2b/SeRequestToBuy/useRequestToBuyForm.js.map +1 -0
- package/dist/b2b/SeWelcomeBackMessage/index.d.ts +2 -0
- package/dist/b2b/SeWelcomeBackMessage/index.d.ts.map +1 -0
- package/dist/b2b/SeWelcomeBackMessage/index.js +18 -0
- package/dist/b2b/SeWelcomeBackMessage/index.js.map +1 -0
- package/dist/b2b/SeWelcomeBackMessage/useB2bSession.d.ts +11 -0
- package/dist/b2b/SeWelcomeBackMessage/useB2bSession.d.ts.map +1 -0
- package/dist/b2b/SeWelcomeBackMessage/useB2bSession.js +15 -0
- package/dist/b2b/SeWelcomeBackMessage/useB2bSession.js.map +1 -0
- package/dist/b2b/index.d.ts +15 -0
- package/dist/b2b/index.d.ts.map +1 -0
- package/dist/b2b/index.js +31 -0
- package/dist/b2b/index.js.map +1 -0
- package/dist/b2c/SeAssemblySet/assemblySetUtils.d.ts +41 -0
- package/dist/b2c/SeAssemblySet/assemblySetUtils.d.ts.map +1 -0
- package/dist/b2c/SeAssemblySet/assemblySetUtils.js +57 -0
- package/dist/b2c/SeAssemblySet/assemblySetUtils.js.map +1 -0
- package/dist/b2c/SeAssemblySet/index.d.ts +4 -0
- package/dist/b2c/SeAssemblySet/index.d.ts.map +1 -0
- package/dist/b2c/SeAssemblySet/index.js +20 -0
- package/dist/b2c/SeAssemblySet/index.js.map +1 -0
- package/dist/b2c/SeAssemblySet/types.d.ts +52 -0
- package/dist/b2c/SeAssemblySet/types.d.ts.map +1 -0
- package/dist/b2c/SeAssemblySet/types.js +3 -0
- package/dist/b2c/SeAssemblySet/types.js.map +1 -0
- package/dist/b2c/SeAssemblySet/useAssemblySet.d.ts +38 -0
- package/dist/b2c/SeAssemblySet/useAssemblySet.d.ts.map +1 -0
- package/dist/b2c/SeAssemblySet/useAssemblySet.js +134 -0
- package/dist/b2c/SeAssemblySet/useAssemblySet.js.map +1 -0
- package/dist/b2c/SeBanner/buildResponsiveImage.d.ts +18 -0
- package/dist/b2c/SeBanner/buildResponsiveImage.d.ts.map +1 -0
- package/dist/b2c/SeBanner/buildResponsiveImage.js +32 -0
- package/dist/b2c/SeBanner/buildResponsiveImage.js.map +1 -0
- package/dist/b2c/SeBanner/getImageUrl.d.ts +3 -0
- package/dist/b2c/SeBanner/getImageUrl.d.ts.map +1 -0
- package/dist/b2c/SeBanner/getImageUrl.js +7 -0
- package/dist/b2c/SeBanner/getImageUrl.js.map +1 -0
- package/dist/b2c/SeBanner/index.d.ts +8 -0
- package/dist/b2c/SeBanner/index.d.ts.map +1 -0
- package/dist/b2c/SeBanner/index.js +24 -0
- package/dist/b2c/SeBanner/index.js.map +1 -0
- package/dist/b2c/SeBanner/types.d.ts +34 -0
- package/dist/b2c/SeBanner/types.d.ts.map +1 -0
- package/dist/b2c/SeBanner/types.js +27 -0
- package/dist/b2c/SeBanner/types.js.map +1 -0
- package/dist/b2c/SeBanner/useBannerContext.d.ts +4 -0
- package/dist/b2c/SeBanner/useBannerContext.d.ts.map +1 -0
- package/dist/b2c/SeBanner/useBannerContext.js +14 -0
- package/dist/b2c/SeBanner/useBannerContext.js.map +1 -0
- package/dist/b2c/SeBanner/useBannerStyles.d.ts +21 -0
- package/dist/b2c/SeBanner/useBannerStyles.d.ts.map +1 -0
- package/dist/b2c/SeBanner/useBannerStyles.js +87 -0
- package/dist/b2c/SeBanner/useBannerStyles.js.map +1 -0
- package/dist/b2c/SeBanner/useIsMobile.d.ts +4 -0
- package/dist/b2c/SeBanner/useIsMobile.d.ts.map +1 -0
- package/dist/b2c/SeBanner/useIsMobile.js +23 -0
- package/dist/b2c/SeBanner/useIsMobile.js.map +1 -0
- package/dist/b2c/SeBanner/useSanitizedHtml.d.ts +13 -0
- package/dist/b2c/SeBanner/useSanitizedHtml.d.ts.map +1 -0
- package/dist/b2c/SeBanner/useSanitizedHtml.js +45 -0
- package/dist/b2c/SeBanner/useSanitizedHtml.js.map +1 -0
- package/dist/b2c/SeBannerCarousel/index.d.ts +5 -0
- package/dist/b2c/SeBannerCarousel/index.d.ts.map +1 -0
- package/dist/b2c/SeBannerCarousel/index.js +21 -0
- package/dist/b2c/SeBannerCarousel/index.js.map +1 -0
- package/dist/b2c/SeBannerCarousel/types.d.ts +17 -0
- package/dist/b2c/SeBannerCarousel/types.d.ts.map +1 -0
- package/dist/b2c/SeBannerCarousel/types.js +3 -0
- package/dist/b2c/SeBannerCarousel/types.js.map +1 -0
- package/dist/b2c/SeBannerCarousel/useCarousel.d.ts +30 -0
- package/dist/b2c/SeBannerCarousel/useCarousel.d.ts.map +1 -0
- package/dist/b2c/SeBannerCarousel/useCarousel.js +53 -0
- package/dist/b2c/SeBannerCarousel/useCarousel.js.map +1 -0
- package/dist/b2c/SeBannerCarousel/useCarouselContext.d.ts +4 -0
- package/dist/b2c/SeBannerCarousel/useCarouselContext.d.ts.map +1 -0
- package/dist/b2c/SeBannerCarousel/useCarouselContext.js +14 -0
- package/dist/b2c/SeBannerCarousel/useCarouselContext.js.map +1 -0
- package/dist/b2c/SeBannerCarousel/useSwipeNavigation.d.ts +19 -0
- package/dist/b2c/SeBannerCarousel/useSwipeNavigation.d.ts.map +1 -0
- package/dist/b2c/SeBannerCarousel/useSwipeNavigation.js +37 -0
- package/dist/b2c/SeBannerCarousel/useSwipeNavigation.js.map +1 -0
- package/dist/b2c/SeCardsCarousel/index.d.ts +3 -0
- package/dist/b2c/SeCardsCarousel/index.d.ts.map +1 -0
- package/dist/b2c/SeCardsCarousel/index.js +19 -0
- package/dist/b2c/SeCardsCarousel/index.js.map +1 -0
- package/dist/b2c/SeCardsCarousel/types.d.ts +8 -0
- package/dist/b2c/SeCardsCarousel/types.d.ts.map +1 -0
- package/dist/b2c/SeCardsCarousel/types.js +3 -0
- package/dist/b2c/SeCardsCarousel/types.js.map +1 -0
- package/dist/b2c/SeCardsCarousel/useCardsCarouselLayout.d.ts +10 -0
- package/dist/b2c/SeCardsCarousel/useCardsCarouselLayout.d.ts.map +1 -0
- package/dist/b2c/SeCardsCarousel/useCardsCarouselLayout.js +13 -0
- package/dist/b2c/SeCardsCarousel/useCardsCarouselLayout.js.map +1 -0
- package/dist/b2c/SeEditorialSplit/index.d.ts +2 -0
- package/dist/b2c/SeEditorialSplit/index.d.ts.map +1 -0
- package/dist/b2c/SeEditorialSplit/index.js +18 -0
- package/dist/b2c/SeEditorialSplit/index.js.map +1 -0
- package/dist/b2c/SeEditorialSplit/types.d.ts +13 -0
- package/dist/b2c/SeEditorialSplit/types.d.ts.map +1 -0
- package/dist/b2c/SeEditorialSplit/types.js +3 -0
- package/dist/b2c/SeEditorialSplit/types.js.map +1 -0
- package/dist/b2c/SeFooter/index.d.ts +3 -0
- package/dist/b2c/SeFooter/index.d.ts.map +1 -0
- package/dist/b2c/SeFooter/index.js +19 -0
- package/dist/b2c/SeFooter/index.js.map +1 -0
- package/dist/b2c/SeFooter/types.d.ts +52 -0
- package/dist/b2c/SeFooter/types.d.ts.map +1 -0
- package/dist/b2c/SeFooter/types.js +3 -0
- package/dist/b2c/SeFooter/types.js.map +1 -0
- package/dist/b2c/SeFooter/utils.d.ts +6 -0
- package/dist/b2c/SeFooter/utils.d.ts.map +1 -0
- package/dist/b2c/SeFooter/utils.js +11 -0
- package/dist/b2c/SeFooter/utils.js.map +1 -0
- package/dist/b2c/SeGridContent/index.d.ts +2 -0
- package/dist/b2c/SeGridContent/index.d.ts.map +1 -0
- package/dist/b2c/SeGridContent/index.js +18 -0
- package/dist/b2c/SeGridContent/index.js.map +1 -0
- package/dist/b2c/SeGridContent/types.d.ts +20 -0
- package/dist/b2c/SeGridContent/types.d.ts.map +1 -0
- package/dist/b2c/SeGridContent/types.js +3 -0
- package/dist/b2c/SeGridContent/types.js.map +1 -0
- package/dist/b2c/SeHeader/index.d.ts +2 -0
- package/dist/b2c/SeHeader/index.d.ts.map +1 -0
- package/dist/b2c/SeHeader/index.js +18 -0
- package/dist/b2c/SeHeader/index.js.map +1 -0
- package/dist/b2c/SeHeader/types.d.ts +35 -0
- package/dist/b2c/SeHeader/types.d.ts.map +1 -0
- package/dist/b2c/SeHeader/types.js +3 -0
- package/dist/b2c/SeHeader/types.js.map +1 -0
- package/dist/b2c/SeHeroSection/index.d.ts +2 -0
- package/dist/b2c/SeHeroSection/index.d.ts.map +1 -0
- package/dist/b2c/SeHeroSection/index.js +18 -0
- package/dist/b2c/SeHeroSection/index.js.map +1 -0
- package/dist/b2c/SeHeroSection/types.d.ts +10 -0
- package/dist/b2c/SeHeroSection/types.d.ts.map +1 -0
- package/dist/b2c/SeHeroSection/types.js +3 -0
- package/dist/b2c/SeHeroSection/types.js.map +1 -0
- package/dist/b2c/SeImageTiles/index.d.ts +2 -0
- package/dist/b2c/SeImageTiles/index.d.ts.map +1 -0
- package/dist/b2c/SeImageTiles/index.js +18 -0
- package/dist/b2c/SeImageTiles/index.js.map +1 -0
- package/dist/b2c/SeImageTiles/types.d.ts +13 -0
- package/dist/b2c/SeImageTiles/types.d.ts.map +1 -0
- package/dist/b2c/SeImageTiles/types.js +3 -0
- package/dist/b2c/SeImageTiles/types.js.map +1 -0
- package/dist/b2c/SeLearnMoreSection/index.d.ts +2 -0
- package/dist/b2c/SeLearnMoreSection/index.d.ts.map +1 -0
- package/dist/b2c/SeLearnMoreSection/index.js +18 -0
- package/dist/b2c/SeLearnMoreSection/index.js.map +1 -0
- package/dist/b2c/SeLearnMoreSection/types.d.ts +10 -0
- package/dist/b2c/SeLearnMoreSection/types.d.ts.map +1 -0
- package/dist/b2c/SeLearnMoreSection/types.js +3 -0
- package/dist/b2c/SeLearnMoreSection/types.js.map +1 -0
- package/dist/b2c/SeMegaMenu/index.d.ts +6 -0
- package/dist/b2c/SeMegaMenu/index.d.ts.map +1 -0
- package/dist/b2c/SeMegaMenu/index.js +22 -0
- package/dist/b2c/SeMegaMenu/index.js.map +1 -0
- package/dist/b2c/SeMegaMenu/types.d.ts +27 -0
- package/dist/b2c/SeMegaMenu/types.d.ts.map +1 -0
- package/dist/b2c/SeMegaMenu/types.js +3 -0
- package/dist/b2c/SeMegaMenu/types.js.map +1 -0
- package/dist/b2c/SeMegaMenu/useCloseMenuOnEscape.d.ts +6 -0
- package/dist/b2c/SeMegaMenu/useCloseMenuOnEscape.d.ts.map +1 -0
- package/dist/b2c/SeMegaMenu/useCloseMenuOnEscape.js +21 -0
- package/dist/b2c/SeMegaMenu/useCloseMenuOnEscape.js.map +1 -0
- package/dist/b2c/SeMegaMenu/useMegaMenuHoverState.d.ts +15 -0
- package/dist/b2c/SeMegaMenu/useMegaMenuHoverState.d.ts.map +1 -0
- package/dist/b2c/SeMegaMenu/useMegaMenuHoverState.js +21 -0
- package/dist/b2c/SeMegaMenu/useMegaMenuHoverState.js.map +1 -0
- package/dist/b2c/SeMegaMenu/useMegaMenuMobileNavigation.d.ts +29 -0
- package/dist/b2c/SeMegaMenu/useMegaMenuMobileNavigation.d.ts.map +1 -0
- package/dist/b2c/SeMegaMenu/useMegaMenuMobileNavigation.js +71 -0
- package/dist/b2c/SeMegaMenu/useMegaMenuMobileNavigation.js.map +1 -0
- package/dist/b2c/SeMegaMenu/useNavbarHamburgerTrigger.d.ts +12 -0
- package/dist/b2c/SeMegaMenu/useNavbarHamburgerTrigger.d.ts.map +1 -0
- package/dist/b2c/SeMegaMenu/useNavbarHamburgerTrigger.js +29 -0
- package/dist/b2c/SeMegaMenu/useNavbarHamburgerTrigger.js.map +1 -0
- package/dist/b2c/SeProductCardWithButton/index.d.ts +3 -0
- package/dist/b2c/SeProductCardWithButton/index.d.ts.map +1 -0
- package/dist/b2c/SeProductCardWithButton/index.js +19 -0
- package/dist/b2c/SeProductCardWithButton/index.js.map +1 -0
- package/dist/b2c/SeProductCardWithButton/types.d.ts +20 -0
- package/dist/b2c/SeProductCardWithButton/types.d.ts.map +1 -0
- package/dist/b2c/SeProductCardWithButton/types.js +3 -0
- package/dist/b2c/SeProductCardWithButton/types.js.map +1 -0
- package/dist/b2c/SeProductCardWithButton/useFormattedPrice.d.ts +13 -0
- package/dist/b2c/SeProductCardWithButton/useFormattedPrice.d.ts.map +1 -0
- package/dist/b2c/SeProductCardWithButton/useFormattedPrice.js +25 -0
- package/dist/b2c/SeProductCardWithButton/useFormattedPrice.js.map +1 -0
- package/dist/b2c/SeProductImageGrid/index.d.ts +2 -0
- package/dist/b2c/SeProductImageGrid/index.d.ts.map +1 -0
- package/dist/b2c/SeProductImageGrid/index.js +18 -0
- package/dist/b2c/SeProductImageGrid/index.js.map +1 -0
- package/dist/b2c/SeProductImageGrid/types.d.ts +15 -0
- package/dist/b2c/SeProductImageGrid/types.d.ts.map +1 -0
- package/dist/b2c/SeProductImageGrid/types.js +3 -0
- package/dist/b2c/SeProductImageGrid/types.js.map +1 -0
- package/dist/b2c/SeProductListing/index.d.ts +3 -0
- package/dist/b2c/SeProductListing/index.d.ts.map +1 -0
- package/dist/b2c/SeProductListing/index.js +19 -0
- package/dist/b2c/SeProductListing/index.js.map +1 -0
- package/dist/b2c/SeProductListing/types.d.ts +40 -0
- package/dist/b2c/SeProductListing/types.d.ts.map +1 -0
- package/dist/b2c/SeProductListing/types.js +3 -0
- package/dist/b2c/SeProductListing/types.js.map +1 -0
- package/dist/b2c/SeProductListing/useSeProductListing.d.ts +8 -0
- package/dist/b2c/SeProductListing/useSeProductListing.d.ts.map +1 -0
- package/dist/b2c/SeProductListing/useSeProductListing.js +27 -0
- package/dist/b2c/SeProductListing/useSeProductListing.js.map +1 -0
- package/dist/b2c/SeProductReviews/index.d.ts +3 -0
- package/dist/b2c/SeProductReviews/index.d.ts.map +1 -0
- package/dist/b2c/SeProductReviews/index.js +19 -0
- package/dist/b2c/SeProductReviews/index.js.map +1 -0
- package/dist/b2c/SeProductReviews/types.d.ts +30 -0
- package/dist/b2c/SeProductReviews/types.d.ts.map +1 -0
- package/dist/b2c/SeProductReviews/types.js +3 -0
- package/dist/b2c/SeProductReviews/types.js.map +1 -0
- package/dist/b2c/SeProductReviews/useSeProductReviews.d.ts +9 -0
- package/dist/b2c/SeProductReviews/useSeProductReviews.d.ts.map +1 -0
- package/dist/b2c/SeProductReviews/useSeProductReviews.js +34 -0
- package/dist/b2c/SeProductReviews/useSeProductReviews.js.map +1 -0
- package/dist/b2c/SeValuePropCards/index.d.ts +3 -0
- package/dist/b2c/SeValuePropCards/index.d.ts.map +1 -0
- package/dist/b2c/SeValuePropCards/index.js +19 -0
- package/dist/b2c/SeValuePropCards/index.js.map +1 -0
- package/dist/b2c/SeValuePropCards/types.d.ts +26 -0
- package/dist/b2c/SeValuePropCards/types.d.ts.map +1 -0
- package/dist/b2c/SeValuePropCards/types.js +3 -0
- package/dist/b2c/SeValuePropCards/types.js.map +1 -0
- package/dist/b2c/SeValuePropCards/useSeValuePropCardsFilter.d.ts +8 -0
- package/dist/b2c/SeValuePropCards/useSeValuePropCardsFilter.d.ts.map +1 -0
- package/dist/b2c/SeValuePropCards/useSeValuePropCardsFilter.js +36 -0
- package/dist/b2c/SeValuePropCards/useSeValuePropCardsFilter.js.map +1 -0
- package/dist/b2c/SeVideoHero/index.d.ts +4 -0
- package/dist/b2c/SeVideoHero/index.d.ts.map +1 -0
- package/dist/b2c/SeVideoHero/index.js +20 -0
- package/dist/b2c/SeVideoHero/index.js.map +1 -0
- package/dist/b2c/SeVideoHero/types.d.ts +19 -0
- package/dist/b2c/SeVideoHero/types.d.ts.map +1 -0
- package/dist/b2c/SeVideoHero/types.js +3 -0
- package/dist/b2c/SeVideoHero/types.js.map +1 -0
- package/dist/b2c/SeVideoHero/useSeVideoHeroPlayback.d.ts +40 -0
- package/dist/b2c/SeVideoHero/useSeVideoHeroPlayback.d.ts.map +1 -0
- package/dist/b2c/SeVideoHero/useSeVideoHeroPlayback.js +135 -0
- package/dist/b2c/SeVideoHero/useSeVideoHeroPlayback.js.map +1 -0
- package/dist/b2c/SeVideoHero/videoSource.d.ts +25 -0
- package/dist/b2c/SeVideoHero/videoSource.d.ts.map +1 -0
- package/dist/b2c/SeVideoHero/videoSource.js +78 -0
- package/dist/b2c/SeVideoHero/videoSource.js.map +1 -0
- package/dist/b2c/index.d.ts +19 -0
- package/dist/b2c/index.d.ts.map +1 -0
- package/dist/b2c/index.js +35 -0
- package/dist/b2c/index.js.map +1 -0
- package/dist/b2c/shared/filterItemsWithImage.d.ts +8 -0
- package/dist/b2c/shared/filterItemsWithImage.d.ts.map +1 -0
- package/dist/b2c/shared/filterItemsWithImage.js +11 -0
- package/dist/b2c/shared/filterItemsWithImage.js.map +1 -0
- package/dist/b2c/shared/index.d.ts +2 -0
- package/dist/b2c/shared/index.d.ts.map +1 -0
- package/dist/b2c/shared/index.js +18 -0
- package/dist/b2c/shared/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/package.json +93 -3
- package/src/b2b/SeActionHubBulletinBoard/index.ts +1 -0
- package/src/b2b/SeActionHubBulletinBoard/types.ts +27 -0
- package/src/b2b/SeAddToPurchaseList/addToPurchaseListUtils.ts +40 -0
- package/src/b2b/SeAddToPurchaseList/index.ts +2 -0
- package/src/b2b/SeAddToPurchaseList/useAddToPurchaseList.ts +130 -0
- package/src/b2b/SeAddressSelector/index.ts +1 -0
- package/src/b2b/SeAddressSelector/useAddressSelector.ts +157 -0
- package/src/b2b/SeCategoryBanners/index.ts +1 -0
- package/src/b2b/SeCategoryBanners/types.ts +8 -0
- package/src/b2b/SeCheckStockAndPricing/checkStockAndPricingUtils.ts +126 -0
- package/src/b2b/SeCheckStockAndPricing/index.ts +3 -0
- package/src/b2b/SeCheckStockAndPricing/stockCsv.ts +77 -0
- package/src/b2b/SeCheckStockAndPricing/useCheckStockAndPricing.ts +272 -0
- package/src/b2b/SeCustomCrossSellingShelf/index.ts +1 -0
- package/src/b2b/SeCustomCrossSellingShelf/useCrossSellingShelfOverride.ts +25 -0
- package/src/b2b/SeCustomProductCard/index.ts +2 -0
- package/src/b2b/SeCustomProductCard/types.ts +16 -0
- package/src/b2b/SeCustomProductCard/useB2bProductCard.ts +53 -0
- package/src/b2b/SeCustomShelfProduct/index.ts +2 -0
- package/src/b2b/SeCustomShelfProduct/types.ts +14 -0
- package/src/b2b/SeCustomShelfProduct/useB2bShelfProducts.ts +31 -0
- package/src/b2b/SeDashboards/index.ts +1 -0
- package/src/b2b/SeDashboards/useDashboards.ts +211 -0
- package/src/b2b/SeFooterB2B/index.ts +2 -0
- package/src/b2b/SeFooterB2B/types.ts +42 -0
- package/src/b2b/SeFooterB2B/useNewsletterSubscription.ts +41 -0
- package/src/b2b/SeProductGalleryB2B/index.ts +1 -0
- package/src/b2b/SeProductGalleryB2B/useProductGalleryB2B.ts +217 -0
- package/src/b2b/SePurchaseLists/index.ts +2 -0
- package/src/b2b/SePurchaseLists/purchaseListsUtils.ts +106 -0
- package/src/b2b/SePurchaseLists/usePurchaseLists.ts +401 -0
- package/src/b2b/SeRecentOrdersSpendOverview/index.ts +2 -0
- package/src/b2b/SeRecentOrdersSpendOverview/recentOrdersSpendOverviewUtils.ts +162 -0
- package/src/b2b/SeRecentOrdersSpendOverview/useRecentOrdersSpendOverview.ts +159 -0
- package/src/b2b/SeRequestToBuy/index.ts +1 -0
- package/src/b2b/SeRequestToBuy/useRequestToBuyForm.ts +96 -0
- package/src/b2b/SeWelcomeBackMessage/index.ts +1 -0
- package/src/b2b/SeWelcomeBackMessage/useB2bSession.ts +16 -0
- package/src/b2b/index.ts +14 -0
- package/src/b2c/SeAssemblySet/assemblySetUtils.ts +67 -0
- package/src/b2c/SeAssemblySet/index.ts +3 -0
- package/src/b2c/SeAssemblySet/types.ts +51 -0
- package/src/b2c/SeAssemblySet/useAssemblySet.ts +198 -0
- package/src/b2c/SeBanner/buildResponsiveImage.ts +44 -0
- package/src/b2c/SeBanner/getImageUrl.ts +9 -0
- package/src/b2c/SeBanner/index.ts +7 -0
- package/src/b2c/SeBanner/types.ts +40 -0
- package/src/b2c/SeBanner/useBannerContext.ts +12 -0
- package/src/b2c/SeBanner/useBannerStyles.ts +120 -0
- package/src/b2c/SeBanner/useIsMobile.ts +24 -0
- package/src/b2c/SeBanner/useSanitizedHtml.ts +49 -0
- package/src/b2c/SeBannerCarousel/index.ts +4 -0
- package/src/b2c/SeBannerCarousel/types.ts +17 -0
- package/src/b2c/SeBannerCarousel/useCarousel.ts +83 -0
- package/src/b2c/SeBannerCarousel/useCarouselContext.ts +12 -0
- package/src/b2c/SeBannerCarousel/useSwipeNavigation.ts +54 -0
- package/src/b2c/SeCardsCarousel/index.ts +2 -0
- package/src/b2c/SeCardsCarousel/types.ts +7 -0
- package/src/b2c/SeCardsCarousel/useCardsCarouselLayout.ts +9 -0
- package/src/b2c/SeEditorialSplit/index.ts +1 -0
- package/src/b2c/SeEditorialSplit/types.ts +15 -0
- package/src/b2c/SeFooter/index.ts +2 -0
- package/src/b2c/SeFooter/types.ts +54 -0
- package/src/b2c/SeFooter/utils.ts +10 -0
- package/src/b2c/SeGridContent/index.ts +1 -0
- package/src/b2c/SeGridContent/types.ts +22 -0
- package/src/b2c/SeHeader/index.ts +1 -0
- package/src/b2c/SeHeader/types.ts +40 -0
- package/src/b2c/SeHeroSection/index.ts +1 -0
- package/src/b2c/SeHeroSection/types.ts +10 -0
- package/src/b2c/SeImageTiles/index.ts +1 -0
- package/src/b2c/SeImageTiles/types.ts +15 -0
- package/src/b2c/SeLearnMoreSection/index.ts +1 -0
- package/src/b2c/SeLearnMoreSection/types.ts +10 -0
- package/src/b2c/SeMegaMenu/index.ts +5 -0
- package/src/b2c/SeMegaMenu/types.ts +31 -0
- package/src/b2c/SeMegaMenu/useCloseMenuOnEscape.ts +18 -0
- package/src/b2c/SeMegaMenu/useMegaMenuHoverState.ts +29 -0
- package/src/b2c/SeMegaMenu/useMegaMenuMobileNavigation.ts +96 -0
- package/src/b2c/SeMegaMenu/useNavbarHamburgerTrigger.ts +29 -0
- package/src/b2c/SeProductCardWithButton/index.ts +2 -0
- package/src/b2c/SeProductCardWithButton/types.ts +21 -0
- package/src/b2c/SeProductCardWithButton/useFormattedPrice.ts +31 -0
- package/src/b2c/SeProductImageGrid/index.ts +1 -0
- package/src/b2c/SeProductImageGrid/types.ts +15 -0
- package/src/b2c/SeProductListing/index.ts +2 -0
- package/src/b2c/SeProductListing/types.ts +44 -0
- package/src/b2c/SeProductListing/useSeProductListing.ts +26 -0
- package/src/b2c/SeProductReviews/index.ts +2 -0
- package/src/b2c/SeProductReviews/types.ts +34 -0
- package/src/b2c/SeProductReviews/useSeProductReviews.ts +52 -0
- package/src/b2c/SeValuePropCards/index.ts +2 -0
- package/src/b2c/SeValuePropCards/types.ts +27 -0
- package/src/b2c/SeValuePropCards/useSeValuePropCardsFilter.ts +44 -0
- package/src/b2c/SeVideoHero/index.ts +3 -0
- package/src/b2c/SeVideoHero/types.ts +22 -0
- package/src/b2c/SeVideoHero/useSeVideoHeroPlayback.ts +159 -0
- package/src/b2c/SeVideoHero/videoSource.ts +88 -0
- package/src/b2c/index.ts +18 -0
- package/src/b2c/shared/filterItemsWithImage.ts +9 -0
- package/src/b2c/shared/index.ts +1 -0
- package/src/global.d.ts +74 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** One SKU to save to a purchase list. */
|
|
2
|
+
export type AddToPurchaseListProduct = { skuId: string; quantity: number }
|
|
3
|
+
|
|
4
|
+
export type AddToPurchaseListVisibility = 'private' | 'organization'
|
|
5
|
+
|
|
6
|
+
/** A list the buyer can add items to: their own, or one their organization shares with them. */
|
|
7
|
+
export type AddToPurchaseListOption = {
|
|
8
|
+
documentId: string
|
|
9
|
+
name: string
|
|
10
|
+
visibility: AddToPurchaseListVisibility
|
|
11
|
+
ownerEmail: string
|
|
12
|
+
isOwner: boolean
|
|
13
|
+
items: AddToPurchaseListProduct[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type AddToPurchaseListError = 'UNAUTHENTICATED' | 'INVALID' | 'NOT_FOUND' | 'FORBIDDEN' | 'CONFLICT' | 'FAILED'
|
|
17
|
+
|
|
18
|
+
/** The text a buyer sees for each error code the resolvers send back. */
|
|
19
|
+
export const ADD_TO_PURCHASE_LIST_ERROR_MESSAGES: Record<AddToPurchaseListError, string> = {
|
|
20
|
+
UNAUTHENTICATED: 'Your session expired. Sign in again to save items to a purchase list.',
|
|
21
|
+
INVALID: 'Please check the name and quantities and try again.',
|
|
22
|
+
NOT_FOUND: 'That purchase list no longer exists.',
|
|
23
|
+
FORBIDDEN: "You can't add items to that list.",
|
|
24
|
+
CONFLICT: 'You already have a purchase list with that name.',
|
|
25
|
+
FAILED: 'Something went wrong. Please try again.',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* What gets sent: whole positive quantities only, one entry per SKU (repeated SKUs summed) --
|
|
30
|
+
* the resolvers answer INVALID to anything else, which would fail the whole request.
|
|
31
|
+
*/
|
|
32
|
+
export function purchaseListItemsFrom(products: AddToPurchaseListProduct[]): AddToPurchaseListProduct[] {
|
|
33
|
+
const quantities = new Map<string, number>()
|
|
34
|
+
for (const { skuId, quantity } of products) {
|
|
35
|
+
const units = Math.floor(Number.isFinite(quantity) ? quantity : 0)
|
|
36
|
+
if (!skuId || units <= 0) continue
|
|
37
|
+
quantities.set(skuId, (quantities.get(skuId) ?? 0) + units)
|
|
38
|
+
}
|
|
39
|
+
return [...quantities].map(([skuId, quantity]) => ({ skuId, quantity }))
|
|
40
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useCallback, useMemo, useRef, useState } from 'react'
|
|
2
|
+
import { usePDP } from '@faststore/core'
|
|
3
|
+
import { gql } from '@faststore/core/api'
|
|
4
|
+
import { useLazyQuery_unstable, useSession_unstable } from '@faststore/core/experimental'
|
|
5
|
+
import {
|
|
6
|
+
SE_ADD_TO_PURCHASE_LIST_ADD_ITEMS_MUTATION,
|
|
7
|
+
SE_ADD_TO_PURCHASE_LIST_CREATE_MUTATION,
|
|
8
|
+
SE_ADD_TO_PURCHASE_LIST_LISTS_QUERY,
|
|
9
|
+
} from '@se-faststore/resolvers/b2b'
|
|
10
|
+
import {
|
|
11
|
+
purchaseListItemsFrom,
|
|
12
|
+
type AddToPurchaseListError,
|
|
13
|
+
type AddToPurchaseListOption,
|
|
14
|
+
type AddToPurchaseListProduct,
|
|
15
|
+
type AddToPurchaseListVisibility,
|
|
16
|
+
} from './addToPurchaseListUtils'
|
|
17
|
+
|
|
18
|
+
const ADD_TO_PURCHASE_LIST_LISTS_QUERY = gql(SE_ADD_TO_PURCHASE_LIST_LISTS_QUERY)
|
|
19
|
+
const ADD_TO_PURCHASE_LIST_ADD_ITEMS_MUTATION = gql(SE_ADD_TO_PURCHASE_LIST_ADD_ITEMS_MUTATION)
|
|
20
|
+
const ADD_TO_PURCHASE_LIST_CREATE_MUTATION = gql(SE_ADD_TO_PURCHASE_LIST_CREATE_MUTATION)
|
|
21
|
+
|
|
22
|
+
type Result = { ok: boolean; error?: AddToPurchaseListError | null; list?: AddToPurchaseListOption | null }
|
|
23
|
+
type Session = { person?: { id?: string } | null }
|
|
24
|
+
|
|
25
|
+
export type AddToPurchaseListOutcome =
|
|
26
|
+
| { ok: true; list: AddToPurchaseListOption }
|
|
27
|
+
| { ok: false; error: AddToPurchaseListError }
|
|
28
|
+
|
|
29
|
+
/** The latest value behind a stable ref (FastStore's lazy `execute` changes every render). */
|
|
30
|
+
function useLatest<T>(value: T) {
|
|
31
|
+
const ref = useRef(value)
|
|
32
|
+
ref.current = value
|
|
33
|
+
return ref
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** One lazy operation whose single root field holds a `SePurchaseListResult`. */
|
|
37
|
+
function useListMutation<V>(query: unknown, field: string) {
|
|
38
|
+
const [execute] = useLazyQuery_unstable<Record<string, Result | null>, V>(query, {} as V)
|
|
39
|
+
const ref = useLatest(execute)
|
|
40
|
+
return useCallback(
|
|
41
|
+
async (variables: V): Promise<AddToPurchaseListOutcome> => {
|
|
42
|
+
try {
|
|
43
|
+
const response: Record<string, Result | null> | null | undefined = await ref.current(variables)
|
|
44
|
+
const result = response?.[field]
|
|
45
|
+
if (result?.ok && result.list) return { ok: true, list: result.list }
|
|
46
|
+
return { ok: false, error: result?.error ?? 'FAILED' }
|
|
47
|
+
} catch {
|
|
48
|
+
return { ok: false, error: 'FAILED' }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
[ref, field],
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Saves `products` to one of the buyer's purchase lists, or to a new one. The lists are only
|
|
57
|
+
* fetched by `load` (when the picker opens), not on mount: the button sits on every PDP, and
|
|
58
|
+
* most visits never open it.
|
|
59
|
+
*/
|
|
60
|
+
export function useAddToPurchaseList(products: AddToPurchaseListProduct[]) {
|
|
61
|
+
const session = useSession_unstable() as Session
|
|
62
|
+
const isLoggedIn = Boolean(session?.person)
|
|
63
|
+
const items = useMemo(() => purchaseListItemsFrom(products), [products])
|
|
64
|
+
const [lists, setLists] = useState<AddToPurchaseListOption[]>([])
|
|
65
|
+
const [state, setState] = useState<'idle' | 'loading' | 'ready' | 'error'>('idle')
|
|
66
|
+
|
|
67
|
+
const [fetchLists] = useLazyQuery_unstable<{ sePurchaseLists?: AddToPurchaseListOption[] | null }, Record<string, never>>(
|
|
68
|
+
ADD_TO_PURCHASE_LIST_LISTS_QUERY,
|
|
69
|
+
{},
|
|
70
|
+
)
|
|
71
|
+
const fetchRef = useLatest(fetchLists)
|
|
72
|
+
const addItemsMutation = useListMutation<{ documentId: string; items: AddToPurchaseListProduct[] }>(
|
|
73
|
+
ADD_TO_PURCHASE_LIST_ADD_ITEMS_MUTATION,
|
|
74
|
+
'sePurchaseListAddItems',
|
|
75
|
+
)
|
|
76
|
+
const createMutation = useListMutation<{
|
|
77
|
+
name: string
|
|
78
|
+
visibility: AddToPurchaseListVisibility
|
|
79
|
+
items: AddToPurchaseListProduct[]
|
|
80
|
+
}>(ADD_TO_PURCHASE_LIST_CREATE_MUTATION, 'sePurchaseListCreate')
|
|
81
|
+
|
|
82
|
+
const load = useCallback(async () => {
|
|
83
|
+
setState('loading')
|
|
84
|
+
try {
|
|
85
|
+
const response: { sePurchaseLists?: AddToPurchaseListOption[] | null } | null | undefined = await fetchRef.current({})
|
|
86
|
+
setLists(response?.sePurchaseLists ?? [])
|
|
87
|
+
setState('ready')
|
|
88
|
+
} catch {
|
|
89
|
+
setState('error')
|
|
90
|
+
}
|
|
91
|
+
}, [fetchRef])
|
|
92
|
+
|
|
93
|
+
const remember = useCallback((outcome: AddToPurchaseListOutcome) => {
|
|
94
|
+
if (!outcome.ok) return outcome
|
|
95
|
+
const updated = outcome.list
|
|
96
|
+
setLists((current) =>
|
|
97
|
+
current.some((list) => list.documentId === updated.documentId)
|
|
98
|
+
? current.map((list) => (list.documentId === updated.documentId ? updated : list))
|
|
99
|
+
: [...current, updated],
|
|
100
|
+
)
|
|
101
|
+
return outcome
|
|
102
|
+
}, [])
|
|
103
|
+
|
|
104
|
+
const addTo = useCallback(
|
|
105
|
+
async (documentId: string): Promise<AddToPurchaseListOutcome> =>
|
|
106
|
+
items.length === 0 ? { ok: false, error: 'INVALID' } : remember(await addItemsMutation({ documentId, items })),
|
|
107
|
+
[items, addItemsMutation, remember],
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
const createWith = useCallback(
|
|
111
|
+
async (name: string, visibility: AddToPurchaseListVisibility): Promise<AddToPurchaseListOutcome> =>
|
|
112
|
+
items.length === 0 ? { ok: false, error: 'INVALID' } : remember(await createMutation({ name, visibility, items })),
|
|
113
|
+
[items, createMutation, remember],
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
return { isLoggedIn, items, lists, state, load, addTo, createWith }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
type PdpContext = { data?: { product?: { sku?: string | null } | null } | null } | null | undefined
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The PDP's current SKU (the variant the shopper has selected), as the one product to save. Empty
|
|
123
|
+
* outside a PDP. Reads FastStore's page context, which only the store's own @faststore/core
|
|
124
|
+
* provides -- fine here: this component is source-copied into the store anyway.
|
|
125
|
+
*/
|
|
126
|
+
export function usePdpPurchaseListProducts(quantity = 1): AddToPurchaseListProduct[] {
|
|
127
|
+
const context = usePDP() as PdpContext
|
|
128
|
+
const skuId = context?.data?.product?.sku ?? ''
|
|
129
|
+
return useMemo(() => (skuId ? [{ skuId, quantity }] : []), [skuId, quantity])
|
|
130
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useAddressSelector'
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
|
+
import { gql } from '@faststore/core/api'
|
|
3
|
+
import { sessionStore_unstable, useLazyQuery_unstable, useSession_unstable } from '@faststore/core/experimental'
|
|
4
|
+
import { SE_SHOPPER_ADDRESSES_QUERY } from '@se-faststore/resolvers/b2b'
|
|
5
|
+
|
|
6
|
+
const SHOPPER_ADDRESSES_QUERY = gql(SE_SHOPPER_ADDRESSES_QUERY)
|
|
7
|
+
|
|
8
|
+
const CACHE_KEY = 'seShopperAddressesCache'
|
|
9
|
+
const CACHE_MAX_AGE = 30 * 60 * 1000
|
|
10
|
+
|
|
11
|
+
export type ShopperAddress = {
|
|
12
|
+
id: string
|
|
13
|
+
addressType: string | null
|
|
14
|
+
isActive: boolean | null
|
|
15
|
+
country: string | null
|
|
16
|
+
state: string | null
|
|
17
|
+
city: string | null
|
|
18
|
+
neighborhood: string | null
|
|
19
|
+
street: string | null
|
|
20
|
+
postalCode: string | null
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type ShopperAddresses = { defaultAddressId: string | null; addresses: ShopperAddress[] }
|
|
24
|
+
|
|
25
|
+
type ShopperAddressesResponse = { seShopperAddresses?: ShopperAddresses | null }
|
|
26
|
+
|
|
27
|
+
type Session = Record<string, unknown> & {
|
|
28
|
+
postalCode?: string | null
|
|
29
|
+
isValidating?: boolean
|
|
30
|
+
b2b?: { userEmail?: string; unitId?: string; customerId?: string } | null
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** "Neighborhood, City, ST 12345" — whichever parts the address has. */
|
|
34
|
+
export function formatShopperAddress(address: ShopperAddress): string {
|
|
35
|
+
const place = [address.neighborhood, address.city].filter(Boolean).join(', ')
|
|
36
|
+
const region = [address.state, address.postalCode].filter(Boolean).join(' ')
|
|
37
|
+
return [place, region].filter(Boolean).join(', ')
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type CacheEntry = { data: ShopperAddresses; timestamp: number; userEmail: string }
|
|
41
|
+
|
|
42
|
+
function readCache(userEmail: string): ShopperAddresses | undefined {
|
|
43
|
+
try {
|
|
44
|
+
const raw = window.localStorage.getItem(CACHE_KEY)
|
|
45
|
+
if (!raw) return undefined
|
|
46
|
+
const entry = JSON.parse(raw) as CacheEntry
|
|
47
|
+
if (entry.userEmail !== userEmail || Date.now() - entry.timestamp > CACHE_MAX_AGE) return undefined
|
|
48
|
+
return entry.data
|
|
49
|
+
} catch {
|
|
50
|
+
return undefined
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function writeCache(userEmail: string, data: ShopperAddresses): void {
|
|
55
|
+
try {
|
|
56
|
+
window.localStorage.setItem(CACHE_KEY, JSON.stringify({ data, timestamp: Date.now(), userEmail } as CacheEntry))
|
|
57
|
+
} catch {
|
|
58
|
+
// Storage full or disabled: the selector still works, it just refetches next time.
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Points FastStore's session (and so regionalization: prices, availability, shipping) at
|
|
64
|
+
* `address`. Mirrors the kit's `submitAddress`, minus the session's transient `isValidating`.
|
|
65
|
+
*/
|
|
66
|
+
function applyAddressToSession(session: Session, address: ShopperAddress): void {
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- dropped on purpose, see above
|
|
68
|
+
const { isValidating, ...current } = session
|
|
69
|
+
sessionStore_unstable.set({
|
|
70
|
+
...current,
|
|
71
|
+
country: address.country ?? current.country,
|
|
72
|
+
addressType: address.addressType ?? current.addressType,
|
|
73
|
+
city: address.city ?? current.city,
|
|
74
|
+
postalCode: address.postalCode ?? current.postalCode,
|
|
75
|
+
} as Parameters<typeof sessionStore_unstable.set>[0])
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The B2B shopper's saved addresses and which one the session ships to, plus `select` to switch.
|
|
80
|
+
*
|
|
81
|
+
* Replaces the kit's `RegionalizationB2B` + `AddressSelector` pair: on first load, a session
|
|
82
|
+
* with no postal code yet is pointed at the shopper's default shipping address (what the kit's
|
|
83
|
+
* navbar used to do on every page).
|
|
84
|
+
*/
|
|
85
|
+
export function useAddressSelector() {
|
|
86
|
+
const session = useSession_unstable() as Session
|
|
87
|
+
const userEmail = session?.b2b?.userEmail
|
|
88
|
+
const [data, setData] = useState<ShopperAddresses | undefined>()
|
|
89
|
+
const [selectedId, setSelectedId] = useState<string | undefined>()
|
|
90
|
+
const [fetchAddresses] = useLazyQuery_unstable<ShopperAddressesResponse, Record<string, never>>(SHOPPER_ADDRESSES_QUERY, {})
|
|
91
|
+
// FastStore's real lazy `execute` (and the session object) change identity every render; read
|
|
92
|
+
// them through refs instead of listing them as effect dependencies (see useRecentOrdersSpendOverview.ts).
|
|
93
|
+
const fetchRef = useRef(fetchAddresses)
|
|
94
|
+
fetchRef.current = fetchAddresses
|
|
95
|
+
const sessionRef = useRef(session)
|
|
96
|
+
sessionRef.current = session
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (!userEmail) return
|
|
100
|
+
let cancelled = false
|
|
101
|
+
|
|
102
|
+
const applyData = (next: ShopperAddresses) => {
|
|
103
|
+
setData(next)
|
|
104
|
+
const current = sessionRef.current
|
|
105
|
+
if (!current.postalCode && next.defaultAddressId) {
|
|
106
|
+
const fallback = next.addresses.find((address) => address.id === next.defaultAddressId)
|
|
107
|
+
if (fallback) applyAddressToSession(current, fallback)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const cached = readCache(userEmail)
|
|
112
|
+
if (cached) {
|
|
113
|
+
applyData(cached)
|
|
114
|
+
return
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
fetchRef
|
|
118
|
+
.current({})
|
|
119
|
+
.then((result: ShopperAddressesResponse | null | undefined) => {
|
|
120
|
+
if (cancelled || !result?.seShopperAddresses) return
|
|
121
|
+
writeCache(userEmail, result.seShopperAddresses)
|
|
122
|
+
applyData(result.seShopperAddresses)
|
|
123
|
+
})
|
|
124
|
+
.catch(() => {
|
|
125
|
+
// Nothing to show; the component renders only its "add address" link.
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
return () => {
|
|
129
|
+
cancelled = true
|
|
130
|
+
}
|
|
131
|
+
}, [userEmail])
|
|
132
|
+
|
|
133
|
+
const addresses = data?.addresses ?? []
|
|
134
|
+
const current =
|
|
135
|
+
addresses.find((address) => address.id === selectedId) ??
|
|
136
|
+
addresses.find((address) => address.postalCode && address.postalCode === session?.postalCode)
|
|
137
|
+
|
|
138
|
+
const select = useCallback(
|
|
139
|
+
(addressId: string) => {
|
|
140
|
+
const address = addresses.find((candidate) => candidate.id === addressId)
|
|
141
|
+
if (!address || address.id === current?.id) return
|
|
142
|
+
setSelectedId(address.id)
|
|
143
|
+
applyAddressToSession(sessionRef.current, address)
|
|
144
|
+
},
|
|
145
|
+
[addresses, current?.id],
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
return {
|
|
149
|
+
isB2b: Boolean(userEmail),
|
|
150
|
+
unitId: session?.b2b?.unitId,
|
|
151
|
+
customerId: session?.b2b?.customerId,
|
|
152
|
+
loaded: data !== undefined,
|
|
153
|
+
addresses,
|
|
154
|
+
current,
|
|
155
|
+
select,
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types'
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export type StockSku = {
|
|
2
|
+
itemId: string
|
|
3
|
+
name: string
|
|
4
|
+
ean?: string | null
|
|
5
|
+
referenceCode?: string | null
|
|
6
|
+
unitMultiplier?: number | null
|
|
7
|
+
imageUrl?: string | null
|
|
8
|
+
imageAlt?: string | null
|
|
9
|
+
variations: Array<{ name: string; values: string[] }>
|
|
10
|
+
sellerId?: string | null
|
|
11
|
+
price?: number | null
|
|
12
|
+
listPrice?: number | null
|
|
13
|
+
availableQuantity: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** A `SeSkuSearch` result product: the native fields the cart needs plus `seSkus`. */
|
|
17
|
+
export type StockProduct = {
|
|
18
|
+
slug: string
|
|
19
|
+
brand?: { name?: string | null } | null
|
|
20
|
+
isVariantOf: { name: string; productGroupID: string }
|
|
21
|
+
additionalProperty?: Array<{ propertyID?: string | null; name: string }> | null
|
|
22
|
+
seSkus?: StockSku[] | null
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type StockStatus = 'In Stock' | 'Low Stock' | 'Out of Stock'
|
|
26
|
+
|
|
27
|
+
export type StockAvailability = {
|
|
28
|
+
status: StockStatus
|
|
29
|
+
/** Null when the simulation only said whether the SKU is available, not how many units. */
|
|
30
|
+
quantity: number | null
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type StockRow = {
|
|
34
|
+
product: StockProduct
|
|
35
|
+
sku: StockSku
|
|
36
|
+
quantity: number
|
|
37
|
+
/** Undefined while the simulation is running; null when it failed. */
|
|
38
|
+
availability?: StockAvailability | null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type StockMoneyFormat = { locale: string; currency: string }
|
|
42
|
+
|
|
43
|
+
export function formatStockMoney(value: number, { locale, currency }: StockMoneyFormat): string {
|
|
44
|
+
return value.toLocaleString(locale, { style: 'currency', currency, currencyDisplay: 'narrowSymbol' })
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Maps a simulation result to a buyer-facing status. `lowStockThreshold` units or more is
|
|
49
|
+
* "In Stock" (the kit used 50); with no unit count, VTEX's own "available" means in stock.
|
|
50
|
+
*/
|
|
51
|
+
export function stockStatus(
|
|
52
|
+
result: { availability?: string | null; availableQuantity?: number | null },
|
|
53
|
+
lowStockThreshold: number,
|
|
54
|
+
): StockAvailability {
|
|
55
|
+
if (typeof result.availableQuantity === 'number') {
|
|
56
|
+
const quantity = result.availableQuantity
|
|
57
|
+
return {
|
|
58
|
+
status: quantity <= 0 ? 'Out of Stock' : quantity >= lowStockThreshold ? 'In Stock' : 'Low Stock',
|
|
59
|
+
quantity,
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return { status: result.availability === 'available' ? 'In Stock' : 'Out of Stock', quantity: null }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** SKUs of `products` whose reference code contains `term` (case-insensitive), or whose id is `term`. */
|
|
66
|
+
export function matchSkus(products: StockProduct[], term: string): Array<{ product: StockProduct; sku: StockSku }> {
|
|
67
|
+
const needle = term.trim().toLowerCase()
|
|
68
|
+
if (!needle) return []
|
|
69
|
+
return products.flatMap((product) =>
|
|
70
|
+
(product.seSkus ?? [])
|
|
71
|
+
.filter((sku) => sku.referenceCode?.toLowerCase().includes(needle) || sku.itemId === term.trim())
|
|
72
|
+
.map((sku) => ({ product, sku })),
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** The SKU whose reference code is exactly `refId` (CSV import), case-insensitive. */
|
|
77
|
+
export function findSkuByRefId(products: StockProduct[], refId: string) {
|
|
78
|
+
const needle = refId.trim().toLowerCase()
|
|
79
|
+
for (const product of products) {
|
|
80
|
+
const sku = product.seSkus?.find((candidate) => candidate.referenceCode?.toLowerCase() === needle)
|
|
81
|
+
if (sku) return { product, sku }
|
|
82
|
+
}
|
|
83
|
+
return undefined
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** FastStore PDP URL of one SKU: `/{product-slug}-{skuId}/p` (search slugs end in the product's own SKU id). */
|
|
87
|
+
export function skuHref(product: StockProduct, sku: StockSku): string {
|
|
88
|
+
return `/${product.slug.replace(/-\d+$/, '')}-${sku.itemId}/p`
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** A cart item in the shape FastStore's `useBuyButton` expects. */
|
|
92
|
+
export function toCartItem({ product, sku, quantity }: StockRow) {
|
|
93
|
+
const price = sku.price ?? 0
|
|
94
|
+
return {
|
|
95
|
+
id: sku.itemId,
|
|
96
|
+
quantity,
|
|
97
|
+
price,
|
|
98
|
+
priceWithTaxes: price,
|
|
99
|
+
listPrice: sku.listPrice ?? price,
|
|
100
|
+
listPriceWithTaxes: sku.listPrice ?? price,
|
|
101
|
+
seller: { identifier: sku.sellerId ?? '1' },
|
|
102
|
+
itemOffered: {
|
|
103
|
+
sku: sku.itemId,
|
|
104
|
+
name: sku.name,
|
|
105
|
+
gtin: sku.ean ?? '',
|
|
106
|
+
image: sku.imageUrl ? [{ url: sku.imageUrl, alternateName: sku.imageAlt ?? sku.name }] : [],
|
|
107
|
+
brand: { name: product.brand?.name ?? '' },
|
|
108
|
+
isVariantOf: {
|
|
109
|
+
name: product.isVariantOf.name,
|
|
110
|
+
productGroupID: product.isVariantOf.productGroupID,
|
|
111
|
+
skuVariants: {
|
|
112
|
+
activeVariations: Object.fromEntries(sku.variations.map((variation) => [variation.name, variation.values[0]])),
|
|
113
|
+
slugsMap: null,
|
|
114
|
+
availableVariations: null,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
additionalProperty: sku.variations.map((variation) => ({
|
|
118
|
+
name: variation.name,
|
|
119
|
+
propertyID: product.additionalProperty?.find((property) => property.name === variation.name)?.propertyID ?? '',
|
|
120
|
+
value: variation.values[0],
|
|
121
|
+
valueReference: 'SPECIFICATION',
|
|
122
|
+
})),
|
|
123
|
+
unitMultiplier: sku.unitMultiplier ?? 1,
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type StockCsvRow = { line: number; refId: string; quantity: number }
|
|
2
|
+
export type StockCsvError = { line: number; refId: string; message: string }
|
|
3
|
+
|
|
4
|
+
/** Splits one CSV line on `delimiter`, honoring double-quoted fields ("a, b" and "" escapes). */
|
|
5
|
+
function splitCsvLine(line: string, delimiter: string): string[] {
|
|
6
|
+
const fields: string[] = []
|
|
7
|
+
let field = ''
|
|
8
|
+
let quoted = false
|
|
9
|
+
|
|
10
|
+
for (let i = 0; i < line.length; i++) {
|
|
11
|
+
const char = line[i]
|
|
12
|
+
if (quoted) {
|
|
13
|
+
if (char === '"' && line[i + 1] === '"') {
|
|
14
|
+
field += '"'
|
|
15
|
+
i++
|
|
16
|
+
} else if (char === '"') {
|
|
17
|
+
quoted = false
|
|
18
|
+
} else {
|
|
19
|
+
field += char
|
|
20
|
+
}
|
|
21
|
+
} else if (char === '"') {
|
|
22
|
+
quoted = true
|
|
23
|
+
} else if (char === delimiter) {
|
|
24
|
+
fields.push(field)
|
|
25
|
+
field = ''
|
|
26
|
+
} else {
|
|
27
|
+
field += char
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
fields.push(field)
|
|
31
|
+
return fields.map((value) => value.trim())
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Parses a `refId,quantity` CSV (header row required, any column order, extra columns ignored;
|
|
36
|
+
* `;` works too, as Excel writes in many locales). Quantity defaults to 1. Replaces the kit's
|
|
37
|
+
* papaparse dependency, which every store installing this component would have had to add.
|
|
38
|
+
*/
|
|
39
|
+
export function parseStockCsv(text: string): { rows: StockCsvRow[]; errors: StockCsvError[] } {
|
|
40
|
+
const lines = text.replace(/^\uFEFF/, '').split(/\r?\n/)
|
|
41
|
+
const headerLine = lines[0] ?? ''
|
|
42
|
+
const delimiter = (headerLine.match(/;/g)?.length ?? 0) > (headerLine.match(/,/g)?.length ?? 0) ? ';' : ','
|
|
43
|
+
const headers = splitCsvLine(headerLine, delimiter).map((header) => header.toLowerCase())
|
|
44
|
+
const refIndex = headers.findIndex((header) => header === 'refid' || header === 'ref id' || header === 'reference')
|
|
45
|
+
const quantityIndex = headers.findIndex((header) => header === 'quantity' || header === 'qty')
|
|
46
|
+
|
|
47
|
+
if (refIndex === -1) {
|
|
48
|
+
return { rows: [], errors: [{ line: 1, refId: '', message: 'Missing "refId" column' }] }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const rows: StockCsvRow[] = []
|
|
52
|
+
const errors: StockCsvError[] = []
|
|
53
|
+
|
|
54
|
+
lines.slice(1).forEach((line, index) => {
|
|
55
|
+
if (!line.trim()) return
|
|
56
|
+
const lineNumber = index + 2
|
|
57
|
+
const fields = splitCsvLine(line, delimiter)
|
|
58
|
+
const refId = fields[refIndex] ?? ''
|
|
59
|
+
const rawQuantity = quantityIndex === -1 ? '' : (fields[quantityIndex] ?? '')
|
|
60
|
+
const quantity = rawQuantity === '' ? 1 : Number(rawQuantity)
|
|
61
|
+
|
|
62
|
+
if (!refId) {
|
|
63
|
+
errors.push({ line: lineNumber, refId: '', message: 'Missing refId' })
|
|
64
|
+
} else if (!Number.isInteger(quantity) || quantity < 1) {
|
|
65
|
+
errors.push({ line: lineNumber, refId, message: 'Invalid quantity' })
|
|
66
|
+
} else {
|
|
67
|
+
rows.push({ line: lineNumber, refId, quantity })
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
return { rows, errors }
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** A starter file for the import, built in the browser (the kit linked to a file on Google Drive). */
|
|
75
|
+
export function stockCsvTemplateHref(): string {
|
|
76
|
+
return `data:text/csv;charset=utf-8,${encodeURIComponent('refId,quantity\nREF-0001,10\nREF-0002,5\n')}`
|
|
77
|
+
}
|