@fayz-ai/storefront 0.83.1 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-OV6DVQMB.js → chunk-7FR6KOW2.js} +43 -7
- package/dist/chunk-7FR6KOW2.js.map +1 -0
- package/dist/{chunk-G2R6OJQA.js → chunk-QU5O4CKY.js} +3 -3
- package/dist/{chunk-G2R6OJQA.js.map → chunk-QU5O4CKY.js.map} +1 -1
- package/dist/components/delivery/StoreCover.d.ts +3 -1
- package/dist/components/delivery/StoreCover.d.ts.map +1 -1
- package/dist/extend/slots.d.ts +48 -0
- package/dist/extend/slots.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/render.js +2 -2
- package/dist/tanstack.js +1 -1
- package/dist/views/MenuPage.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-OV6DVQMB.js.map +0 -1
|
@@ -2288,6 +2288,7 @@ function StorefrontPage({ kind, page, params = {} }) {
|
|
|
2288
2288
|
var PRODUCT_DETAIL_CONTEXT = ["product", "soldOut", "lowStock", "discountPct"];
|
|
2289
2289
|
var PRODUCT_CARD_CONTEXT = ["product", "soldOut", "onSale", "hasOptions"];
|
|
2290
2290
|
var CATALOG_CONTEXT = ["products", "loading"];
|
|
2291
|
+
var MENU_CONTEXT = ["coverSize", "highlights", "section", "openProduct", "quickAdd"];
|
|
2291
2292
|
var CART_CONTEXT = ["lines", "subtotal"];
|
|
2292
2293
|
var CHECKOUT_CONTEXT = ["subtotal", "total"];
|
|
2293
2294
|
var STOREFRONT_SLOTS = [
|
|
@@ -2362,6 +2363,13 @@ var STOREFRONT_SLOTS = [
|
|
|
2362
2363
|
CATALOG_CONTEXT,
|
|
2363
2364
|
"cristinarotondaro-shop/src/storefront/customization.tsx:442-450 (bespoke empty state)"
|
|
2364
2365
|
),
|
|
2366
|
+
// The three menu positions are stable on one store's proof: Artorius put
|
|
2367
|
+
// its cover copy, a highlights carousel and per-category banners into the
|
|
2368
|
+
// SDK menu with portals after mount, and paid for it with a 0.24 layout
|
|
2369
|
+
// shift and a highlight image (its LCP) discovered only after hydration.
|
|
2370
|
+
s("menu", "coverOverlay", "inside the menu cover, after its own content", MENU_CONTEXT, "artorious-shop src/custom/components/DeliveryBanners.tsx (hero copy portal)"),
|
|
2371
|
+
s("menu", "highlights", "inside the highlights section, replacing the default rows", MENU_CONTEXT, "artorious-shop src/custom/components/DeliveryHighlightsCarousel.tsx (carousel portal + CSS hiding the rows)"),
|
|
2372
|
+
s("menu", "sectionIntro", "the top of each menu section, above its heading", MENU_CONTEXT, "artorious-shop src/custom/components/DeliveryBanners.tsx (category banner portals)"),
|
|
2365
2373
|
x("cart", "beforeLines", "above the cart line items", CART_CONTEXT),
|
|
2366
2374
|
x("cart", "beforeSummary", "between the lines and the totals", CART_CONTEXT),
|
|
2367
2375
|
s(
|
|
@@ -2403,6 +2411,10 @@ var SlotContext = createContext(null);
|
|
|
2403
2411
|
function useSlotContext() {
|
|
2404
2412
|
return useContext(SlotContext);
|
|
2405
2413
|
}
|
|
2414
|
+
function useSlotFilled(area, name) {
|
|
2415
|
+
const config = useStorefrontConfigOptional();
|
|
2416
|
+
return Boolean(config?.slots?.[area]?.[name]?.length);
|
|
2417
|
+
}
|
|
2406
2418
|
function Slot({ area, name, context }) {
|
|
2407
2419
|
const config = useStorefrontConfigOptional();
|
|
2408
2420
|
const page = useStorefrontPageOptional();
|
|
@@ -10039,7 +10051,7 @@ function etaParts(minutes) {
|
|
|
10039
10051
|
return { approx: false, text: `${Math.ceil(m / 60)} h` };
|
|
10040
10052
|
}
|
|
10041
10053
|
var COVER_PRIORITY = React38__default.version.startsWith("18.") ? { fetchpriority: "high" } : { fetchPriority: "high" };
|
|
10042
|
-
function StoreCover({ onShowHours, onOpenAccount }) {
|
|
10054
|
+
function StoreCover({ onShowHours, onOpenAccount, children }) {
|
|
10043
10055
|
const sessionName = useSessionStore((s2) => s2.name || s2.email);
|
|
10044
10056
|
const config = useStorefrontConfig();
|
|
10045
10057
|
const t = useT();
|
|
@@ -10149,7 +10161,8 @@ function StoreCover({ onShowHours, onOpenAccount }) {
|
|
|
10149
10161
|
mode
|
|
10150
10162
|
);
|
|
10151
10163
|
}) })
|
|
10152
|
-
] })
|
|
10164
|
+
] }),
|
|
10165
|
+
children
|
|
10153
10166
|
]
|
|
10154
10167
|
}
|
|
10155
10168
|
);
|
|
@@ -11501,11 +11514,23 @@ function MenuPage() {
|
|
|
11501
11514
|
fromPrice: getProductOptionGroups(product).length > 0
|
|
11502
11515
|
};
|
|
11503
11516
|
}
|
|
11517
|
+
const coverSize = useExperimentValue(config.delivery?.coverSize) ?? "full";
|
|
11518
|
+
const highlightsSlot = useSlotFilled("menu", "highlights");
|
|
11519
|
+
const menuSlot = {
|
|
11520
|
+
coverSize,
|
|
11521
|
+
highlights,
|
|
11522
|
+
section: null,
|
|
11523
|
+
openProduct: setOpenProduct,
|
|
11524
|
+
quickAdd: (product) => {
|
|
11525
|
+
const add = rowProps(product).onQuickAdd;
|
|
11526
|
+
return add && product.inventoryCount > 0 ? () => add(product) : void 0;
|
|
11527
|
+
}
|
|
11528
|
+
};
|
|
11504
11529
|
return (
|
|
11505
11530
|
// pb-28 reserva o espaço da barra fixa do carrinho: conteúdo escondido
|
|
11506
11531
|
// atrás de um elemento fixo é a falha mais comum de barra inferior.
|
|
11507
11532
|
/* @__PURE__ */ jsxs("main", { "data-testid": TID.menuPage, className: "w-full pb-28", children: [
|
|
11508
|
-
/* @__PURE__ */ jsx(StoreCover, { onShowHours: () => setShowHours(true), onOpenAccount: () => setShowAccount(true) }),
|
|
11533
|
+
/* @__PURE__ */ jsx(StoreCover, { onShowHours: () => setShowHours(true), onOpenAccount: () => setShowAccount(true), children: /* @__PURE__ */ jsx(Slot, { area: "menu", name: "coverOverlay", context: menuSlot }) }),
|
|
11509
11534
|
/* @__PURE__ */ jsx(
|
|
11510
11535
|
AddressStrip,
|
|
11511
11536
|
{
|
|
@@ -11540,7 +11565,7 @@ function MenuPage() {
|
|
|
11540
11565
|
] }),
|
|
11541
11566
|
!normalized && !featuredPending && highlights.length > 0 && /* @__PURE__ */ jsxs("section", { "data-testid": TID.menuHighlights, className: "mb-10 pt-6", children: [
|
|
11542
11567
|
/* @__PURE__ */ jsx("h2", { className: "text-lg font-bold uppercase tracking-wide", children: "Destaques" }),
|
|
11543
|
-
/* @__PURE__ */ jsx("ul", { className: "mt-2", children: highlights.map((product) => /* @__PURE__ */ jsx(
|
|
11568
|
+
highlightsSlot ? /* @__PURE__ */ jsx(Slot, { area: "menu", name: "highlights", context: menuSlot }) : /* @__PURE__ */ jsx("ul", { className: "mt-2", children: highlights.map((product) => /* @__PURE__ */ jsx(
|
|
11544
11569
|
MenuItemRow,
|
|
11545
11570
|
{
|
|
11546
11571
|
product,
|
|
@@ -11559,6 +11584,17 @@ function MenuPage() {
|
|
|
11559
11584
|
className: "mb-10 scroll-mt-32",
|
|
11560
11585
|
id: `menu-${section.slug}`,
|
|
11561
11586
|
children: [
|
|
11587
|
+
/* @__PURE__ */ jsx(
|
|
11588
|
+
Slot,
|
|
11589
|
+
{
|
|
11590
|
+
area: "menu",
|
|
11591
|
+
name: "sectionIntro",
|
|
11592
|
+
context: {
|
|
11593
|
+
...menuSlot,
|
|
11594
|
+
section: { slug: section.slug, name: section.name, description: section.description, products: section.products }
|
|
11595
|
+
}
|
|
11596
|
+
}
|
|
11597
|
+
),
|
|
11562
11598
|
/* @__PURE__ */ jsx("h2", { className: "text-lg font-bold uppercase tracking-wide", children: section.name }),
|
|
11563
11599
|
section.description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: section.description }),
|
|
11564
11600
|
/* @__PURE__ */ jsx("ul", { className: "mt-2", children: section.products.map((product) => /* @__PURE__ */ jsx(MenuItemRow, { product, ...rowProps(product) }, product.id)) })
|
|
@@ -12908,6 +12944,6 @@ function createStorefront(options) {
|
|
|
12908
12944
|
return createStorefrontApp(config);
|
|
12909
12945
|
}
|
|
12910
12946
|
|
|
12911
|
-
export { AddressForm, AddressSheet, AddressStrip, BEFORE_PLACE_ORDER_VALVE, BUYER_COUNTRY_COOKIE, BenefitsRow, CART_LINE_ANNOTATION_POINT, CHECKOUT_FIELD_POINT, CartDrawer, CatalogPage, CategoryShowcase, CheckoutPage, ClosedStoreDialog, CollectionCta, CollectionHero, ContentPage, CountdownBand, CountrySelect, DeliverToPicker, EmailConfirmationRequiredError, EntityListBlock, ExperimentBlock, ExperimentProvider, ExperimentVariantBlock, FaqSection, FiltersPanel, FormBlock, HeroSection, ImageTiles, ItemSheet, ManifestoBlock, MediaCarousel, MenuItemRow, MenuPage, MenuToolbar, MotifStrip, MyPurchasesPage, NewsletterBand, ORDER_METADATA_POINT, OrderConfirmationPage, OrderTrackingTimeline, PAGE_DATA_SCRIPT_ID, PLACEHOLDER_ASPECTS, PRODUCT_CARD_BADGE_POINT, PaymentTerms, Price, ProductCard, ProductDetailPage, ProductEnquiryForm, ProductGallery, ProductGrid, ProductOptionSelector, ProductRail, ProductReviews, ProductSlider, ProductSpecs, ProductSpotlight, PromoBanner, QuantityInput, Reveal, STOREFRONT_SLOTS, ScheduleSheet, SealsBand, SearchOverlay, ServiceHoursModal, Slot, SmoothImage, StepsSection, StoreCover, StorefrontAnalytics, StorefrontConfigHost, StorefrontFooter, StorefrontHeader, StorefrontPage, StorefrontShell, StorefrontThemeStyle, StoryQuote, THEME_SCALE_FIELDS, THEME_SCALE_VAR_PREFIX, TID, Testimonials, TierCards, applyDeliveryPolicy, applyStoreSettings, bannerPlaceholder, buildEnquiryFromForm, collectOrderMetadata, createStorefront, createStorefrontApp, entityListBlockMeta, establishCustomerSession, formatMoney, formatProductOptionSelection, getCartLineAnnotations, getCheckoutFieldContributions, getCustomerAuthAdapter, getProductCardBadges, getProductOptionGroups, hydratedEntriesFor, identifyStorefrontBuyer, initStorefrontRuntime, isExperimentBinding, listSlots, marketForCountry, marketUnitPrice, matchesFacets, mergeCollectionFacet, nextMilestone, normalizeProductOptionSelection, onStorefrontEvent, orderGalleryImages, overrideComponent, overrideProps, pickProductCardImage, placeStorefrontOrder, prefersReducedMotion, productCardComponentContract, productOptionSelectionKey, productPlaceholder, readHydratedPageData, registerStorefrontBlocks, registerStorefrontEntities, registerStorefrontExtensionPoints, registerStorefrontLoaders, resetPageDiagnostics, resetProductOptionsDeprecationWarnings, resetStorefrontExtensionPoints, resolveAuthAdapter, resolveExperimental, resolveOverride, resolvePaymentTerms, resolveStorefrontProvider, resolveVariantForSelection, roundCents, runBeforePlaceOrderValve, sectionsToBlocks, selectCount, selectDiscountTotal, selectIsOpen, selectRequiresShipping, selectShipping, selectShowsHours, selectSubtotal, selectTotal, selectionPrice, serializePageData, signInByEmail, signOutCustomer, signUpCustomer, startStorefrontPostHog, storeBuyerId, storefrontComponentContracts, themeToCss, toFacetMap, trackStorefront, useBuyerCountry, useBuyerStore, useCartStore, useCatalogStore, useCategories, useDeliveryStore, useDiscountValidator, useEnquiry, useExperiment, useExperimentValue, useInView, useMarketProduct, useMarketStore, useMyOrders, usePopOnChange, useProduct, useProducts, useScrolled, useServiceStore, useSessionStore, useSlotContext, useStorefrontActions, useStorefrontHead, useStorefrontPage, useStorefrontPageOptional, useT, usedSlots, withFacet, withMarketPrice };
|
|
12912
|
-
//# sourceMappingURL=chunk-
|
|
12913
|
-
//# sourceMappingURL=chunk-
|
|
12947
|
+
export { AddressForm, AddressSheet, AddressStrip, BEFORE_PLACE_ORDER_VALVE, BUYER_COUNTRY_COOKIE, BenefitsRow, CART_LINE_ANNOTATION_POINT, CHECKOUT_FIELD_POINT, CartDrawer, CatalogPage, CategoryShowcase, CheckoutPage, ClosedStoreDialog, CollectionCta, CollectionHero, ContentPage, CountdownBand, CountrySelect, DeliverToPicker, EmailConfirmationRequiredError, EntityListBlock, ExperimentBlock, ExperimentProvider, ExperimentVariantBlock, FaqSection, FiltersPanel, FormBlock, HeroSection, ImageTiles, ItemSheet, ManifestoBlock, MediaCarousel, MenuItemRow, MenuPage, MenuToolbar, MotifStrip, MyPurchasesPage, NewsletterBand, ORDER_METADATA_POINT, OrderConfirmationPage, OrderTrackingTimeline, PAGE_DATA_SCRIPT_ID, PLACEHOLDER_ASPECTS, PRODUCT_CARD_BADGE_POINT, PaymentTerms, Price, ProductCard, ProductDetailPage, ProductEnquiryForm, ProductGallery, ProductGrid, ProductOptionSelector, ProductRail, ProductReviews, ProductSlider, ProductSpecs, ProductSpotlight, PromoBanner, QuantityInput, Reveal, STOREFRONT_SLOTS, ScheduleSheet, SealsBand, SearchOverlay, ServiceHoursModal, Slot, SmoothImage, StepsSection, StoreCover, StorefrontAnalytics, StorefrontConfigHost, StorefrontFooter, StorefrontHeader, StorefrontPage, StorefrontShell, StorefrontThemeStyle, StoryQuote, THEME_SCALE_FIELDS, THEME_SCALE_VAR_PREFIX, TID, Testimonials, TierCards, applyDeliveryPolicy, applyStoreSettings, bannerPlaceholder, buildEnquiryFromForm, collectOrderMetadata, createStorefront, createStorefrontApp, entityListBlockMeta, establishCustomerSession, formatMoney, formatProductOptionSelection, getCartLineAnnotations, getCheckoutFieldContributions, getCustomerAuthAdapter, getProductCardBadges, getProductOptionGroups, hydratedEntriesFor, identifyStorefrontBuyer, initStorefrontRuntime, isExperimentBinding, listSlots, marketForCountry, marketUnitPrice, matchesFacets, mergeCollectionFacet, nextMilestone, normalizeProductOptionSelection, onStorefrontEvent, orderGalleryImages, overrideComponent, overrideProps, pickProductCardImage, placeStorefrontOrder, prefersReducedMotion, productCardComponentContract, productOptionSelectionKey, productPlaceholder, readHydratedPageData, registerStorefrontBlocks, registerStorefrontEntities, registerStorefrontExtensionPoints, registerStorefrontLoaders, resetPageDiagnostics, resetProductOptionsDeprecationWarnings, resetStorefrontExtensionPoints, resolveAuthAdapter, resolveExperimental, resolveOverride, resolvePaymentTerms, resolveStorefrontProvider, resolveVariantForSelection, roundCents, runBeforePlaceOrderValve, sectionsToBlocks, selectCount, selectDiscountTotal, selectIsOpen, selectRequiresShipping, selectShipping, selectShowsHours, selectSubtotal, selectTotal, selectionPrice, serializePageData, signInByEmail, signOutCustomer, signUpCustomer, startStorefrontPostHog, storeBuyerId, storefrontComponentContracts, themeToCss, toFacetMap, trackStorefront, useBuyerCountry, useBuyerStore, useCartStore, useCatalogStore, useCategories, useDeliveryStore, useDiscountValidator, useEnquiry, useExperiment, useExperimentValue, useInView, useMarketProduct, useMarketStore, useMyOrders, usePopOnChange, useProduct, useProducts, useScrolled, useServiceStore, useSessionStore, useSlotContext, useSlotFilled, useStorefrontActions, useStorefrontHead, useStorefrontPage, useStorefrontPageOptional, useT, usedSlots, withFacet, withMarketPrice };
|
|
12948
|
+
//# sourceMappingURL=chunk-7FR6KOW2.js.map
|
|
12949
|
+
//# sourceMappingURL=chunk-7FR6KOW2.js.map
|