@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,159 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState, type RefObject } from 'react'
|
|
2
|
+
import { parseSeVideoHeroSource, seVideoHeroEmbedCommand, type SeVideoHeroSource } from './videoSource'
|
|
3
|
+
|
|
4
|
+
export type UseSeVideoHeroPlaybackOptions = {
|
|
5
|
+
/** Start playing (muted) on mount. Defaults to `true`. */
|
|
6
|
+
autoplay?: boolean
|
|
7
|
+
/** The video: a file URL, or a Vimeo or YouTube link. */
|
|
8
|
+
src?: string
|
|
9
|
+
/** The cut for screens under 768px, in the same forms as `src`. */
|
|
10
|
+
mobileSrc?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type UseSeVideoHeroPlaybackResult = {
|
|
14
|
+
videoRef: RefObject<HTMLVideoElement>
|
|
15
|
+
iframeRef: RefObject<HTMLIFrameElement>
|
|
16
|
+
isPlaying: boolean
|
|
17
|
+
/** True when the visitor asked the OS for reduced motion: the video never autoplays. */
|
|
18
|
+
prefersReducedMotion: boolean
|
|
19
|
+
/** True under 768px, once mounted: picks an embed's mobile cut. */
|
|
20
|
+
isMobile: boolean
|
|
21
|
+
/** The source playing on this breakpoint. */
|
|
22
|
+
active?: SeVideoHeroSource
|
|
23
|
+
/** Both sources are files: one `<video>` switches between them with `<source media>`. */
|
|
24
|
+
fileOnly: boolean
|
|
25
|
+
/** The source on this breakpoint is a file, played in a `<video>`; otherwise it is an embed. */
|
|
26
|
+
playsFile: boolean
|
|
27
|
+
/** An embed is loaded with autoplay on: on mount unless reduced motion, or once the visitor presses play. */
|
|
28
|
+
embedStarted: boolean
|
|
29
|
+
/** Width over height of the embed's video, once its player reports it (Vimeo); 16:9 until then. */
|
|
30
|
+
embedRatio: number
|
|
31
|
+
/** Call from the iframe's `onLoad`: asks the player for the video's size. */
|
|
32
|
+
onEmbedLoad: () => void
|
|
33
|
+
toggle: () => void
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const DEFAULT_EMBED_RATIO = 16 / 9
|
|
37
|
+
const VIMEO_ORIGIN = 'https://player.vimeo.com'
|
|
38
|
+
const REDUCED_MOTION = '(prefers-reduced-motion: reduce)'
|
|
39
|
+
const MOBILE = '(max-width: 767px)'
|
|
40
|
+
|
|
41
|
+
function useMediaQuery(query: string): boolean {
|
|
42
|
+
const [matches, setMatches] = useState(false)
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (typeof window === 'undefined' || !window.matchMedia) return
|
|
45
|
+
const list = window.matchMedia(query)
|
|
46
|
+
const update = () => setMatches(list.matches)
|
|
47
|
+
update()
|
|
48
|
+
list.addEventListener?.('change', update)
|
|
49
|
+
return () => list.removeEventListener?.('change', update)
|
|
50
|
+
}, [query])
|
|
51
|
+
return matches
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Play/pause state for a background hero video. Autoplay is muted (browsers block it
|
|
56
|
+
* otherwise) and skipped under `prefers-reduced-motion`; `toggle` backs the visible
|
|
57
|
+
* pause button that WCAG 2.2.2 asks for on motion longer than five seconds. A file plays
|
|
58
|
+
* in a `<video>`; a Vimeo or YouTube embed is paused and resumed through its player API.
|
|
59
|
+
*/
|
|
60
|
+
export function useSeVideoHeroPlayback({ autoplay = true, src, mobileSrc }: UseSeVideoHeroPlaybackOptions = {}): UseSeVideoHeroPlaybackResult {
|
|
61
|
+
const videoRef = useRef<HTMLVideoElement>(null)
|
|
62
|
+
const iframeRef = useRef<HTMLIFrameElement>(null)
|
|
63
|
+
const prefersReducedMotion = useMediaQuery(REDUCED_MOTION)
|
|
64
|
+
const isMobile = useMediaQuery(MOBILE)
|
|
65
|
+
const desktop = src ? parseSeVideoHeroSource(src) : undefined
|
|
66
|
+
const mobile = mobileSrc ? parseSeVideoHeroSource(mobileSrc) : undefined
|
|
67
|
+
// An embed has no <source media>: the mobile cut is picked once mounted.
|
|
68
|
+
const active = isMobile && mobile ? mobile : desktop
|
|
69
|
+
const fileOnly = (desktop?.kind ?? 'file') === 'file' && (mobile?.kind ?? 'file') === 'file'
|
|
70
|
+
const playsFile = fileOnly || active?.kind === 'file'
|
|
71
|
+
const kind = playsFile ? 'file' : active?.kind ?? 'file'
|
|
72
|
+
const activeKey = active ? `${active.kind}:${active.id}` : undefined
|
|
73
|
+
const willAutoplay = autoplay && !prefersReducedMotion
|
|
74
|
+
const [isPlaying, setIsPlaying] = useState(false)
|
|
75
|
+
const [started, setStarted] = useState(false)
|
|
76
|
+
const embedStarted = willAutoplay || started
|
|
77
|
+
const [embedRatio, setEmbedRatio] = useState(DEFAULT_EMBED_RATIO)
|
|
78
|
+
|
|
79
|
+
// Vimeo reports the video's size on request; YouTube has no such message, so it stays 16:9.
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (kind !== 'vimeo') {
|
|
82
|
+
setEmbedRatio(DEFAULT_EMBED_RATIO)
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
const size: { width?: number; height?: number } = {}
|
|
86
|
+
const onMessage = (event: MessageEvent) => {
|
|
87
|
+
if (event.origin !== VIMEO_ORIGIN || event.source !== iframeRef.current?.contentWindow) return
|
|
88
|
+
let data: { method?: string; value?: unknown }
|
|
89
|
+
try {
|
|
90
|
+
data = typeof event.data === 'string' ? JSON.parse(event.data) : event.data
|
|
91
|
+
} catch {
|
|
92
|
+
return
|
|
93
|
+
}
|
|
94
|
+
if (data?.method === 'getVideoWidth' && typeof data.value === 'number') size.width = data.value
|
|
95
|
+
if (data?.method === 'getVideoHeight' && typeof data.value === 'number') size.height = data.value
|
|
96
|
+
if (size.width && size.height) setEmbedRatio(size.width / size.height)
|
|
97
|
+
}
|
|
98
|
+
window.addEventListener('message', onMessage)
|
|
99
|
+
return () => window.removeEventListener('message', onMessage)
|
|
100
|
+
}, [kind, activeKey])
|
|
101
|
+
|
|
102
|
+
const onEmbedLoad = useCallback(() => {
|
|
103
|
+
if (kind !== 'vimeo') return
|
|
104
|
+
for (const method of ['getVideoWidth', 'getVideoHeight']) {
|
|
105
|
+
iframeRef.current?.contentWindow?.postMessage(JSON.stringify({ method }), VIMEO_ORIGIN)
|
|
106
|
+
}
|
|
107
|
+
}, [kind])
|
|
108
|
+
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (kind !== 'file') {
|
|
111
|
+
// The embed URL already carries autoplay; assume it took.
|
|
112
|
+
setIsPlaying(willAutoplay)
|
|
113
|
+
setStarted(false)
|
|
114
|
+
return
|
|
115
|
+
}
|
|
116
|
+
const video = videoRef.current
|
|
117
|
+
if (!video) return
|
|
118
|
+
const onPlay = () => setIsPlaying(true)
|
|
119
|
+
const onPause = () => setIsPlaying(false)
|
|
120
|
+
video.addEventListener('play', onPlay)
|
|
121
|
+
video.addEventListener('pause', onPause)
|
|
122
|
+
if (willAutoplay) {
|
|
123
|
+
video.muted = true
|
|
124
|
+
video.play().catch(() => setIsPlaying(false))
|
|
125
|
+
} else {
|
|
126
|
+
video.pause()
|
|
127
|
+
}
|
|
128
|
+
return () => {
|
|
129
|
+
video.removeEventListener('play', onPlay)
|
|
130
|
+
video.removeEventListener('pause', onPause)
|
|
131
|
+
}
|
|
132
|
+
}, [willAutoplay, activeKey, kind])
|
|
133
|
+
|
|
134
|
+
const toggle = useCallback(() => {
|
|
135
|
+
if (kind !== 'file') {
|
|
136
|
+
if (!embedStarted) {
|
|
137
|
+
// Not loaded with autoplay yet (reduced motion): reload the embed with it on.
|
|
138
|
+
setStarted(true)
|
|
139
|
+
setIsPlaying(true)
|
|
140
|
+
return
|
|
141
|
+
}
|
|
142
|
+
const command = seVideoHeroEmbedCommand(kind, !isPlaying)
|
|
143
|
+
if (!command) return
|
|
144
|
+
iframeRef.current?.contentWindow?.postMessage(command.message, command.origin)
|
|
145
|
+
setIsPlaying(!isPlaying)
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
|
+
const video = videoRef.current
|
|
149
|
+
if (!video) return
|
|
150
|
+
if (video.paused) {
|
|
151
|
+
video.muted = true
|
|
152
|
+
video.play().catch(() => setIsPlaying(false))
|
|
153
|
+
} else {
|
|
154
|
+
video.pause()
|
|
155
|
+
}
|
|
156
|
+
}, [kind, isPlaying, embedStarted])
|
|
157
|
+
|
|
158
|
+
return { videoRef, iframeRef, isPlaying, prefersReducedMotion, isMobile, active, fileOnly, playsFile, embedStarted, embedRatio, onEmbedLoad, toggle }
|
|
159
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export type SeVideoHeroSourceKind = 'file' | 'vimeo' | 'youtube'
|
|
2
|
+
|
|
3
|
+
export type SeVideoHeroSource = {
|
|
4
|
+
kind: SeVideoHeroSourceKind
|
|
5
|
+
/** The URL as given, for a file; the video id, for an embed. */
|
|
6
|
+
id: string
|
|
7
|
+
/** Vimeo's privacy hash of an unlisted video (`vimeo.com/<id>/<hash>`). */
|
|
8
|
+
hash?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type SeVideoHeroEmbedOptions = {
|
|
12
|
+
autoplay: boolean
|
|
13
|
+
loop: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const YOUTUBE_ID = /^[\w-]{11}$/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Tells a direct video file from a Vimeo or YouTube page, share, or embed link. Anything that is
|
|
20
|
+
* not one of those hosts is treated as a file URL for a `<video>` element.
|
|
21
|
+
*/
|
|
22
|
+
export function parseSeVideoHeroSource(src: string): SeVideoHeroSource {
|
|
23
|
+
let url: URL
|
|
24
|
+
try {
|
|
25
|
+
url = new URL(src)
|
|
26
|
+
} catch {
|
|
27
|
+
return { kind: 'file', id: src }
|
|
28
|
+
}
|
|
29
|
+
const host = url.hostname.replace(/^(www\.|m\.)/, '')
|
|
30
|
+
const parts = url.pathname.split('/').filter(Boolean)
|
|
31
|
+
|
|
32
|
+
if (host === 'vimeo.com' || host === 'player.vimeo.com') {
|
|
33
|
+
const at = parts.findIndex((part) => /^\d+$/.test(part))
|
|
34
|
+
const id = parts[at]
|
|
35
|
+
if (id) {
|
|
36
|
+
const next = parts[at + 1]
|
|
37
|
+
const hash = url.searchParams.get('h') ?? (next && /^[\da-f]+$/i.test(next) ? next : undefined)
|
|
38
|
+
return { kind: 'vimeo', id, hash }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const [first = '', second] = parts
|
|
43
|
+
if (host === 'youtu.be' && YOUTUBE_ID.test(first)) return { kind: 'youtube', id: first }
|
|
44
|
+
if (host === 'youtube.com' || host === 'youtube-nocookie.com') {
|
|
45
|
+
const id = url.searchParams.get('v') ?? (['embed', 'shorts', 'live'].includes(first) ? second : undefined)
|
|
46
|
+
if (id && YOUTUBE_ID.test(id)) return { kind: 'youtube', id }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return { kind: 'file', id: src }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The background-mode player URL of an embed: muted, no controls or branding, autoplay and loop as asked. */
|
|
53
|
+
export function seVideoHeroEmbedUrl(source: SeVideoHeroSource, { autoplay, loop }: SeVideoHeroEmbedOptions): string | undefined {
|
|
54
|
+
const flag = (value: boolean) => (value ? '1' : '0')
|
|
55
|
+
if (source.kind === 'vimeo') {
|
|
56
|
+
const params = new URLSearchParams({ background: '1', autoplay: flag(autoplay), loop: flag(loop), muted: '1', autopause: '0', dnt: '1' })
|
|
57
|
+
if (source.hash) params.set('h', source.hash)
|
|
58
|
+
return `https://player.vimeo.com/video/${source.id}?${params}`
|
|
59
|
+
}
|
|
60
|
+
if (source.kind === 'youtube') {
|
|
61
|
+
const params = new URLSearchParams({
|
|
62
|
+
autoplay: flag(autoplay),
|
|
63
|
+
mute: '1',
|
|
64
|
+
controls: '0',
|
|
65
|
+
playsinline: '1',
|
|
66
|
+
rel: '0',
|
|
67
|
+
disablekb: '1',
|
|
68
|
+
iv_load_policy: '3',
|
|
69
|
+
enablejsapi: '1',
|
|
70
|
+
})
|
|
71
|
+
// YouTube loops a single video only as a one-item playlist.
|
|
72
|
+
if (loop) {
|
|
73
|
+
params.set('loop', '1')
|
|
74
|
+
params.set('playlist', source.id)
|
|
75
|
+
}
|
|
76
|
+
return `https://www.youtube-nocookie.com/embed/${source.id}?${params}`
|
|
77
|
+
}
|
|
78
|
+
return undefined
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The origin and message that pause or play an embed through its player's postMessage API. */
|
|
82
|
+
export function seVideoHeroEmbedCommand(kind: SeVideoHeroSourceKind, play: boolean): { origin: string; message: string } | undefined {
|
|
83
|
+
if (kind === 'vimeo') return { origin: 'https://player.vimeo.com', message: JSON.stringify({ method: play ? 'play' : 'pause' }) }
|
|
84
|
+
if (kind === 'youtube') {
|
|
85
|
+
return { origin: 'https://www.youtube-nocookie.com', message: JSON.stringify({ event: 'command', func: play ? 'playVideo' : 'pauseVideo', args: [] }) }
|
|
86
|
+
}
|
|
87
|
+
return undefined
|
|
88
|
+
}
|
package/src/b2c/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './SeBanner'
|
|
2
|
+
export * from './SeAssemblySet'
|
|
3
|
+
export * from './SeMegaMenu'
|
|
4
|
+
export * from './SeBannerCarousel'
|
|
5
|
+
export * from './SeCardsCarousel'
|
|
6
|
+
export * from './SeGridContent'
|
|
7
|
+
export * from './SeHeroSection'
|
|
8
|
+
export * from './SeLearnMoreSection'
|
|
9
|
+
export * from './SeImageTiles'
|
|
10
|
+
export * from './SeProductCardWithButton'
|
|
11
|
+
export * from './SeValuePropCards'
|
|
12
|
+
export * from './SeHeader'
|
|
13
|
+
export * from './shared'
|
|
14
|
+
export * from './SeEditorialSplit'
|
|
15
|
+
export * from './SeProductImageGrid'
|
|
16
|
+
export * from './SeProductReviews'
|
|
17
|
+
export * from './SeFooter'
|
|
18
|
+
export * from './SeVideoHero'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drops CMS items that have no image yet. Editors often add an empty row before uploading
|
|
3
|
+
* its image; rendering it would leave a broken cell in the grid.
|
|
4
|
+
*/
|
|
5
|
+
export function filterItemsWithImage<T extends { image?: string | null }>(
|
|
6
|
+
items: T[] | null | undefined
|
|
7
|
+
): T[] {
|
|
8
|
+
return (items ?? []).filter((item) => Boolean(item?.image))
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './filterItemsWithImage'
|
package/src/global.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// `@faststore/core` ships raw TypeScript source (no compiled .d.ts) whose own types only
|
|
2
|
+
// resolve inside a real FastStore project's build (discovery.config, generated GraphQL
|
|
3
|
+
// types, etc.). This ambient shim covers just the shape we actually use, so `tsc` never
|
|
4
|
+
// tries to physically resolve/typecheck the real module — the real one still gets used at
|
|
5
|
+
// runtime, by whichever @faststore/core the consuming FastStore project's own build
|
|
6
|
+
// provides.
|
|
7
|
+
declare module '@faststore/core/experimental' {
|
|
8
|
+
export type B2bInfo = {
|
|
9
|
+
userName?: string
|
|
10
|
+
[key: string]: unknown
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function useSession_unstable(): {
|
|
14
|
+
b2b?: B2bInfo | null
|
|
15
|
+
channel?: string
|
|
16
|
+
locale?: string
|
|
17
|
+
currency?: { code: string; symbol?: string }
|
|
18
|
+
/** Set once the shopper is signed in; `null`/absent for anonymous sessions. */
|
|
19
|
+
person?: { id?: string; email?: string; [key: string]: unknown } | null
|
|
20
|
+
[key: string]: unknown
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function useNewsletter_unstable(): {
|
|
24
|
+
subscribeUser: (variables: { data: { name: string; email: string } }) => Promise<unknown>
|
|
25
|
+
data: unknown
|
|
26
|
+
error: unknown
|
|
27
|
+
loading: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function useProductLink_unstable(options: {
|
|
31
|
+
index: number
|
|
32
|
+
product: unknown
|
|
33
|
+
selectedOffer: number
|
|
34
|
+
}): { href: string; onClick: () => void; 'data-testid': string }
|
|
35
|
+
|
|
36
|
+
export function useFormattedPrice_unstable(price: number): string
|
|
37
|
+
|
|
38
|
+
export function useLazyQuery_unstable<TData = unknown, TVariables = unknown>(
|
|
39
|
+
query: unknown,
|
|
40
|
+
variables: TVariables,
|
|
41
|
+
): [(variables: TVariables) => Promise<TData | null | undefined>, { data: TData | undefined }]
|
|
42
|
+
|
|
43
|
+
export function useQuery_unstable<TData = unknown, TVariables = unknown>(
|
|
44
|
+
query: unknown,
|
|
45
|
+
variables: TVariables,
|
|
46
|
+
options?: { doNotRun?: boolean; [key: string]: unknown },
|
|
47
|
+
): { data: TData | undefined; isLoading: boolean; isValidating: boolean; error: unknown }
|
|
48
|
+
|
|
49
|
+
export function useCart_unstable(): {
|
|
50
|
+
id?: string
|
|
51
|
+
[key: string]: unknown
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Add-to-cart click handler (plus data attributes) for one or several cart items. */
|
|
55
|
+
export function useBuyButton_unstable(
|
|
56
|
+
item: unknown,
|
|
57
|
+
shouldOpenCart?: boolean,
|
|
58
|
+
): { onClick: (event: { preventDefault(): void }) => void; [key: string]: unknown }
|
|
59
|
+
|
|
60
|
+
/** FastStore's session store; `set` replaces the session and revalidates it with VTEX. */
|
|
61
|
+
export const sessionStore_unstable: {
|
|
62
|
+
set: (session: Record<string, unknown>) => void
|
|
63
|
+
read: () => Record<string, unknown>
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Same rationale as above, for @faststore/core/api: `gql` there reexports from the consuming
|
|
68
|
+
// project's own generated codegen output, which doesn't exist outside a real FastStore project.
|
|
69
|
+
// We only need `gql` to accept a plain query string and hand back something a GraphQL client
|
|
70
|
+
// hook can consume — we never rely on its real generated result/variable types.
|
|
71
|
+
declare module '@faststore/core/api' {
|
|
72
|
+
export function gql(query: string): unknown
|
|
73
|
+
}
|
|
74
|
+
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './b2c'
|