@fayz-ai/storefront 0.13.1 → 0.14.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/dist/app/router.d.ts.map +1 -1
- package/dist/{chunk-6DWZAAIW.js → chunk-LTAB2QMM.js} +39 -7
- package/dist/chunk-LTAB2QMM.js.map +1 -0
- package/dist/components/SmoothImage.d.ts.map +1 -1
- package/dist/components/product/ProductGallery.d.ts.map +1 -1
- package/dist/document/render.d.ts +0 -11
- package/dist/document/render.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/motion.d.ts +20 -4
- package/dist/lib/motion.d.ts.map +1 -1
- package/dist/render.js +2 -4
- package/dist/render.js.map +1 -1
- package/package.json +7 -7
- package/dist/chunk-6DWZAAIW.js.map +0 -1
package/dist/app/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/app/router.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/app/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAA6E,MAAM,OAAO,CAAA;AACjG,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAwB7F,eAAO,MAAM,wBAAwB,sCAAgC,CAAA;AAuBrE,wBAAgB,gBAAgB,IAAI,aAAa,CAehD;AAED,iEAAiE;AACjE,wBAAgB,YAAY,IAAI,MAAM,CAOrC;AAED;iEACiE;AACjE,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAc3D;AAED,wBAAgB,WAAW,IAAI,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAGlD;AAED,iFAAiF;AACjF,eAAO,MAAM,WAAW,qBAAe,CAAA;AAEvC,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,aAAa,GAAG,aAAa,CAOvG;AAED,gGAAgG;AAChG,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAatF;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC5F,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAG5C,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC;;gBAgBhE"}
|
|
@@ -833,13 +833,36 @@ function useInView(margin = "0px 0px -8% 0px") {
|
|
|
833
833
|
return [ref, inView];
|
|
834
834
|
}
|
|
835
835
|
function Reveal({ delay = 0, children, className, style, ...rest }) {
|
|
836
|
-
const
|
|
836
|
+
const ref = useRef(null);
|
|
837
|
+
const [phase, setPhase] = useState("seen");
|
|
838
|
+
useEffect(() => {
|
|
839
|
+
const el = ref.current;
|
|
840
|
+
if (!el || prefersReducedMotion() || typeof IntersectionObserver === "undefined") return;
|
|
841
|
+
if (el.getBoundingClientRect().top < window.innerHeight) return;
|
|
842
|
+
setPhase("waiting");
|
|
843
|
+
const observer = new IntersectionObserver(
|
|
844
|
+
(entries) => {
|
|
845
|
+
if (entries.some((e) => e.isIntersecting)) {
|
|
846
|
+
setPhase("playing");
|
|
847
|
+
observer.disconnect();
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
{ rootMargin: "0px 0px -8% 0px" }
|
|
851
|
+
);
|
|
852
|
+
observer.observe(el);
|
|
853
|
+
return () => observer.disconnect();
|
|
854
|
+
}, []);
|
|
837
855
|
return /* @__PURE__ */ jsx(
|
|
838
856
|
"div",
|
|
839
857
|
{
|
|
840
858
|
ref,
|
|
841
|
-
className: `${
|
|
842
|
-
style: {
|
|
859
|
+
className: `${phase === "playing" ? "animate-fade-up" : ""} ${className ?? ""}`,
|
|
860
|
+
style: {
|
|
861
|
+
...style,
|
|
862
|
+
// Off screen only. From there the class carries the fade.
|
|
863
|
+
...phase === "waiting" ? { opacity: 0 } : null,
|
|
864
|
+
animationDelay: delay ? `${delay}ms` : void 0
|
|
865
|
+
},
|
|
843
866
|
...rest,
|
|
844
867
|
children
|
|
845
868
|
}
|
|
@@ -897,7 +920,12 @@ function useRoutePath() {
|
|
|
897
920
|
);
|
|
898
921
|
}
|
|
899
922
|
function useScrollToTopOnNavigate(path) {
|
|
923
|
+
const mounted = useRef(false);
|
|
900
924
|
useEffect(() => {
|
|
925
|
+
if (!mounted.current) {
|
|
926
|
+
mounted.current = true;
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
901
929
|
if (typeof window !== "undefined") window.scrollTo(0, 0);
|
|
902
930
|
}, [path]);
|
|
903
931
|
}
|
|
@@ -1117,6 +1145,7 @@ var TID = {
|
|
|
1117
1145
|
purchasesEmpty: "purchases-empty",
|
|
1118
1146
|
signout: "signout"
|
|
1119
1147
|
};
|
|
1148
|
+
var clientMounted = false;
|
|
1120
1149
|
function SmoothImage({
|
|
1121
1150
|
imageLoading,
|
|
1122
1151
|
variant,
|
|
@@ -1140,7 +1169,7 @@ function SmoothImage({
|
|
|
1140
1169
|
const blur = resolved.blur ?? true;
|
|
1141
1170
|
const transform = resolved.transform ?? "none";
|
|
1142
1171
|
const ref = React4.useRef(null);
|
|
1143
|
-
const [loaded, setLoaded] = React4.useState(mode === "none");
|
|
1172
|
+
const [loaded, setLoaded] = React4.useState(() => mode === "none" || !clientMounted);
|
|
1144
1173
|
const delivered = React4.useMemo(() => {
|
|
1145
1174
|
if (transform !== "supabase" || !src || srcSet || !isStorageImageUrl(src)) return { src, srcSet, sizes };
|
|
1146
1175
|
if (variant?.width) {
|
|
@@ -1159,6 +1188,9 @@ function SmoothImage({
|
|
|
1159
1188
|
sizes: variant?.sizes ?? sizes ?? "100vw"
|
|
1160
1189
|
};
|
|
1161
1190
|
}, [transform, src, srcSet, sizes, variant?.width, variant?.sizes, variant?.widths, variant?.quality]);
|
|
1191
|
+
React4.useEffect(() => {
|
|
1192
|
+
clientMounted = true;
|
|
1193
|
+
}, []);
|
|
1162
1194
|
React4.useEffect(() => {
|
|
1163
1195
|
if (mode === "none") {
|
|
1164
1196
|
setLoaded(true);
|
|
@@ -3974,7 +4006,7 @@ function ProductGallery({ product, images, primaryImage, order = "primary" }) {
|
|
|
3974
4006
|
src: current?.url ?? productPlaceholder(product.name),
|
|
3975
4007
|
alt: current?.altText ?? product.name,
|
|
3976
4008
|
"data-testid": TID.pdpGalleryImage,
|
|
3977
|
-
className: "h-full w-full object-
|
|
4009
|
+
className: "h-full w-full object-contain",
|
|
3978
4010
|
variant: { sizes: "(min-width: 1024px) 50vw, 100vw" }
|
|
3979
4011
|
},
|
|
3980
4012
|
current?.id ?? "placeholder"
|
|
@@ -11091,5 +11123,5 @@ ${formatErrors(report.errors)}`;
|
|
|
11091
11123
|
}
|
|
11092
11124
|
|
|
11093
11125
|
export { BEFORE_PLACE_ORDER_VALVE, BLOCK_STRUCTURAL_KEYS, BenefitsRow, BlockDataError, CART_LINE_ANNOTATION_POINT, CATALOG_BODY_BLOCK, CHECKOUT_FIELD_POINT, CartDrawer, CatalogPage, CategoryShowcase, CheckoutPage, CollectionCta, CollectionHero, ContentPage, CountdownBand, EmailConfirmationRequiredError, EntityListBlock, FaqSection, FiltersPanel, FormBlock, HeroSection, ImageTiles, Link, ManifestoBlock, MediaCarousel, MotifStrip, MyPurchasesPage, NewsletterBand, ORDER_METADATA_POINT, OrderConfirmationPage, OrderTrackingTimeline, PAGE_DATA_SCRIPT_ID, PLACEHOLDER_ASPECTS, PRODUCT_BODY_BLOCK, PRODUCT_CARD_BADGE_POINT, PageDataScope, PaymentTerms, Price, ProductCard, ProductDetailPage, ProductEnquiryForm, ProductGallery, ProductGrid, ProductOptionSelector, ProductRail, ProductReviews, ProductSlider, ProductSpecs, ProductSpotlight, PromoBanner, QuantityInput, Reveal, STOREFRONT_COMPONENT_KEYS, STOREFRONT_PAGE_KINDS, STOREFRONT_SLOTS, STORE_BACKEND_PROVIDERS, STORE_COMMERCE_MODES, STORE_DOCUMENT_KIND, STORE_PAYMENT_METHOD_KINDS, STORE_PAYMENT_MODES, STORE_ROUTE_CHROMES, STORE_ROUTE_KINDS, STORE_SECTIONS, STORE_SECTION_NAMES, SealsBand, SearchOverlay, Slot, SmoothImage, StepsSection, StorefrontConfigHost, StorefrontConfigProvider, StorefrontFooter, StorefrontHeader, StorefrontPage, StorefrontRouterProvider, StorefrontShell, StorefrontThemeStyle, StoryQuote, THEME_SCALE_FIELDS, THEME_SCALE_VAR_PREFIX, TID, Testimonials, TierCards, applyStoreSettings, bannerPlaceholder, blockInstanceId, buildEnquiryFromForm, checkPageBlocks, collectDataNeeds, collectOrderMetadata, contentPagePath, createStorefront, createStorefrontApp, currentStaticRenderPass, defaultPageBlocks, entityListBlockMeta, establishCustomerSession, exportStore, formatMoney, formatProductOptionSelection, getCartLineAnnotations, getCheckoutFieldContributions, getCustomerAuthAdapter, getProductCardBadges, getProductOptionGroups, hydrateStoreDocument, hydratedEntriesFor, initStorefrontRuntime, isJsonValue, isKnownPath, isNestedBlockRef, isPublicPath, isRecord, listSlots, matchContentPage, matchPath, matchesFacets, mergeCollectionFacet, mergePageTheme, navigateTo, nextMilestone, normalizeProductOptionSelection, orderGalleryImages, overrideComponent, overrideProps, pageSeo, pageThemeSelector, pickProductCardImage, placeStorefrontOrder, prefersReducedMotion, primaryImageUrl, productCardComponentContract, productJsonLd, productOptionSelectionKey, productPlaceholder, productSeo, readHydratedPageData, registerStorefrontBlocks, registerStorefrontEntities, registerStorefrontExtensionPoints, registerStorefrontLoaders, resetPageDiagnostics, resetProductOptionsDeprecationWarnings, resetStorefrontExtensionPoints, resolveAuthAdapter, resolveConfig, resolveDataParams, resolveOverride, resolvePageData, resolvePageDataNeed, resolvePaymentTerms, resolveStorefrontProvider, resolveStorefrontRoute, resolveVariantForSelection, roundCents, routePathParams, runBeforePlaceOrderValve, sectionToJsonSchema, sectionsToBlocks, selectCount, selectDiscountTotal, selectRequiresShipping, selectShipping, selectSubtotal, selectTotal, selectionPrice, serializePageData, shellRouterAdapter, signInByEmail, signOutCustomer, signUpCustomer, slugifyStoreName, storefrontComponentContracts, storefrontPaths, themeToCss, toBlockNodes, toFacetMap, useBlockData, useCartStore, useCatalogStore, useCategories, useDeliveryStore, useDiscountValidator, useEnquiry, useHashPath, useInView, useLoader, useMyOrders, useNavigate, usePopOnChange, useProduct, useProducts, useRoutePath, useRouterAdapter, useScrollToTopOnNavigate, useScrolled, useSessionStore, useSlotContext, useStorefrontActions, useStorefrontConfig, useStorefrontConfigOptional, useStorefrontHead, useStorefrontPage, useStorefrontPageOptional, usedSlots, validateStore, withFacet, withStaticRenderPass };
|
|
11094
|
-
//# sourceMappingURL=chunk-
|
|
11095
|
-
//# sourceMappingURL=chunk-
|
|
11126
|
+
//# sourceMappingURL=chunk-LTAB2QMM.js.map
|
|
11127
|
+
//# sourceMappingURL=chunk-LTAB2QMM.js.map
|