@fayz-ai/storefront 0.15.0 → 0.17.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-AEV2QRRH.js → chunk-STL6MATQ.js} +264 -20
- package/dist/chunk-STL6MATQ.js.map +1 -0
- package/dist/components/cart/CartDrawer.d.ts.map +1 -1
- package/dist/components/checkout/CardBrick.d.ts +64 -0
- package/dist/components/checkout/CardBrick.d.ts.map +1 -0
- package/dist/components/checkout/CheckoutPayment.d.ts +10 -1
- package/dist/components/checkout/CheckoutPayment.d.ts.map +1 -1
- package/dist/hooks/use-checkout.d.ts.map +1 -1
- package/dist/hooks/use-discount-validator.d.ts +2 -0
- package/dist/hooks/use-discount-validator.d.ts.map +1 -1
- package/dist/hooks/use-shipping.d.ts.map +1 -1
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/render.js +1 -1
- package/dist/stores/cart.store.d.ts +12 -3
- package/dist/stores/cart.store.d.ts.map +1 -1
- package/dist/views/CheckoutPage.d.ts.map +1 -1
- package/dist/workflows/checkout.d.ts +1 -1
- package/dist/workflows/checkout.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-AEV2QRRH.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/cart/CartDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAmDlD,wBAAgB,UAAU,
|
|
1
|
+
{"version":3,"file":"CartDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/cart/CartDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAmDlD,wBAAgB,UAAU,6BA6SzB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Mercado Pago's Card Payment Brick, mounted in the store's own checkout.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS COMPONENT EXISTS AT ALL
|
|
6
|
+
*
|
|
7
|
+
* Every other acquirer in this repo sends a card buyer to a hosted page, and not
|
|
8
|
+
* for taste: AbacatePay's and Vindi's transparent calls want the card number (or
|
|
9
|
+
* the CVV) inside a request the edge function makes, which would put the pool in
|
|
10
|
+
* PCI scope. Mercado Pago tokenises HERE — the fields below live in their
|
|
11
|
+
* iframes, not in this DOM — so the store never touches a card number and the
|
|
12
|
+
* buyer never leaves. The only thing this component hands upward is a
|
|
13
|
+
* single-use token.
|
|
14
|
+
*
|
|
15
|
+
* So the guarantee is structural, not a promise: there is no state in this file
|
|
16
|
+
* that could hold a PAN, because the inputs are not ours to read.
|
|
17
|
+
*/
|
|
18
|
+
/** The slice of their SDK this file uses. Declared rather than `any`, so a
|
|
19
|
+
* change in their shape is a type error here and not a runtime one. */
|
|
20
|
+
interface BricksBuilder {
|
|
21
|
+
create(brick: 'cardPayment', containerId: string, settings: Record<string, unknown>): Promise<{
|
|
22
|
+
unmount: () => void;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
interface MercadoPagoSdk {
|
|
26
|
+
bricks(): BricksBuilder;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface Window {
|
|
30
|
+
MercadoPago?: new (publicKey: string, options?: {
|
|
31
|
+
locale?: string;
|
|
32
|
+
}) => MercadoPagoSdk;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
var MP_DEVICE_SESSION_ID: string | undefined;
|
|
37
|
+
}
|
|
38
|
+
/** Whatever the script has produced by now — never a fabricated value. */
|
|
39
|
+
export declare function deviceSessionId(): string | null;
|
|
40
|
+
export interface CardBrickResult {
|
|
41
|
+
token: string;
|
|
42
|
+
paymentMethodId: string | null;
|
|
43
|
+
issuerId: string | null;
|
|
44
|
+
installments: number;
|
|
45
|
+
/** What the Brick collected, which may differ from the checkout's own copy. */
|
|
46
|
+
email: string | null;
|
|
47
|
+
document: {
|
|
48
|
+
type: string;
|
|
49
|
+
number: string;
|
|
50
|
+
} | null;
|
|
51
|
+
}
|
|
52
|
+
export interface CardBrickProps {
|
|
53
|
+
publicKey: string;
|
|
54
|
+
/** In reais, as their SDK wants it — it prices the installment options. */
|
|
55
|
+
amount: number;
|
|
56
|
+
/** Prefilled so the buyer does not retype what the checkout already asked. */
|
|
57
|
+
email?: string | null;
|
|
58
|
+
/** Called with the token. Rejecting keeps the Brick mounted and its form filled. */
|
|
59
|
+
onSubmit: (result: CardBrickResult) => Promise<void>;
|
|
60
|
+
onError?: (message: string) => void;
|
|
61
|
+
}
|
|
62
|
+
export declare function CardBrick({ publicKey, amount, email, onSubmit, onError }: CardBrickProps): React.JSX.Element;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=CardBrick.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardBrick.d.ts","sourceRoot":"","sources":["../../../src/components/checkout/CardBrick.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAG1D;;;;;;;;;;;;;;;GAeG;AAEH;wEACwE;AACxE,UAAU,aAAa;IACrB,MAAM,CACJ,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAA;CACpC;AACD,UAAU,cAAc;IACtB,MAAM,IAAI,aAAa,CAAA;CACxB;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,WAAW,CAAC,EAAE,KAAK,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;YAAE,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,KAAK,cAAc,CAAA;KACvF;CACF;AAiBD,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7C;AAaD,0EAA0E;AAC1E,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAI/C;AA+BD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,+EAA+E;IAC/E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAClD;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAA;IACd,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,oFAAoF;IACpF,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACpD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,cAAc,qBA4GxF"}
|
|
@@ -27,6 +27,15 @@ export interface CheckoutPaymentProps {
|
|
|
27
27
|
* um erro na tela avisamos o checkout para oferecer o pedido sem cobrança.
|
|
28
28
|
*/
|
|
29
29
|
onUnavailable?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* The cart total as the page already shows it.
|
|
32
|
+
*
|
|
33
|
+
* Only an in-store card form needs it: that mounts before any charge exists,
|
|
34
|
+
* and the acquirer's SDK prices installments from the amount it was created
|
|
35
|
+
* with. Every other flow learns the total from the opened session, which is
|
|
36
|
+
* the figure the server will actually charge.
|
|
37
|
+
*/
|
|
38
|
+
amount?: number;
|
|
30
39
|
}
|
|
31
|
-
export declare function CheckoutPayment({ input, onPaid, onBack, money, onUnavailable, resume }: CheckoutPaymentProps): React.JSX.Element;
|
|
40
|
+
export declare function CheckoutPayment({ input, onPaid, onBack, money, onUnavailable, resume, amount }: CheckoutPaymentProps): React.JSX.Element;
|
|
32
41
|
//# sourceMappingURL=CheckoutPayment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutPayment.d.ts","sourceRoot":"","sources":["../../../src/components/checkout/CheckoutPayment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"CheckoutPayment.d.ts","sourceRoot":"","sources":["../../../src/components/checkout/CheckoutPayment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAKvE,OAAO,KAAK,EAAE,oBAAoB,EAAiB,MAAM,qBAAqB,CAAA;AAkH9E,yEAAyE;AACzE,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOtE;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,oBAAoB,CAAA;IAC3B,0DAA0D;IAC1D,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAChC;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAA;IAC5F;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAID,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,oBAAoB,qBA4hBpH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-checkout.d.ts","sourceRoot":"","sources":["../../src/hooks/use-checkout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAYlF,OAAO,KAAK,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,0BAA0B,CAAA;IACpC,OAAO,CAAC,EAAE,yBAAyB,CAAA;IACnC,eAAe,CAAC,EAAE,oBAAoB,CAAA;IACtC,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,yFAAyF;IACzF,OAAO,EAAE,OAAO,CAAA;IAChB,iGAAiG;IACjG,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,cAAc,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAA;CACtF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,IAAI,WAAW,
|
|
1
|
+
{"version":3,"file":"use-checkout.d.ts","sourceRoot":"","sources":["../../src/hooks/use-checkout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAYlF,OAAO,KAAK,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,0BAA0B,CAAA;IACpC,OAAO,CAAC,EAAE,yBAAyB,CAAA;IACnC,eAAe,CAAC,EAAE,oBAAoB,CAAA;IACtC,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,yFAAyF;IACzF,OAAO,EAAE,OAAO,CAAA;IAChB,iGAAiG;IACjG,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,cAAc,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAA;CACtF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,IAAI,WAAW,CAyDzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-discount-validator.d.ts","sourceRoot":"","sources":["../../src/hooks/use-discount-validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-discount-validator.d.ts","sourceRoot":"","sources":["../../src/hooks/use-discount-validator.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,qEAAqE;IACrE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAgCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAkEpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-shipping.d.ts","sourceRoot":"","sources":["../../src/hooks/use-shipping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAI9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,cAAc,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,OAAO,EAAE,mBAAmB,EAAE,CAAA;IAC9B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAA;IACZ;8EAC0E;IAC1E,gBAAgB,EAAE,OAAO,CAAA;IACzB,mEAAmE;IACnE,IAAI,EAAE,OAAO,CAAA;IACb,2FAA2F;IAC3F,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,WAAW,
|
|
1
|
+
{"version":3,"file":"use-shipping.d.ts","sourceRoot":"","sources":["../../src/hooks/use-shipping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAI9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,cAAc,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,OAAO,EAAE,mBAAmB,EAAE,CAAA;IAC9B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAA;IACZ;8EAC0E;IAC1E,gBAAgB,EAAE,OAAO,CAAA;IACzB,mEAAmE;IACnE,IAAI,EAAE,OAAO,CAAA;IACb,2FAA2F;IAC3F,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,WAAW,CAyBzC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { STORE_SECTION_NAMES, isRecord, STORE_SECTIONS, slugifyStoreName, exportStore, resolveConfig, initStorefrontRuntime, StorefrontConfigHost, StorefrontShell, validateStore, isJsonValue, registerStorefrontBlocks, registerStorefrontExtensionPoints, sectionToJsonSchema, STOREFRONT_PAGE_KINDS, STOREFRONT_COMPONENT_KEYS, STOREFRONT_SLOTS, useStorefrontConfig, useCatalogStore, formatMoney, useCartStore, useSessionStore, selectTotal, selectShipping, selectDiscountTotal, selectSubtotal, selectCount, placeStorefrontOrder, useDeliveryStore, selectRequiresShipping, isNestedBlockRef, BLOCK_STRUCTURAL_KEYS, StorefrontPage, hydrateStoreDocument, blockInstanceId } from './chunk-
|
|
2
|
-
export { BEFORE_PLACE_ORDER_VALVE, 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, buildEnquiryFromForm, checkPageBlocks, collectDataNeeds, collectOrderMetadata, contentPagePath, createStorefront, createStorefrontApp, currentStaticRenderPass, defaultPageBlocks, entityListBlockMeta, establishCustomerSession, exportStore, formatMoney, formatProductOptionSelection, getCartLineAnnotations, getCheckoutFieldContributions, getCustomerAuthAdapter, getProductCardBadges, getProductOptionGroups, hydrateStoreDocument, hydratedEntriesFor, initStorefrontRuntime, isKnownPath, isPublicPath, 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, selectShipping, selectSubtotal, selectTotal, selectionPrice, serializePageData, shellRouterAdapter, signInByEmail, signOutCustomer, signUpCustomer, slugifyStoreName, storefrontComponentContracts, storefrontPaths, themeToCss, toBlockNodes, toFacetMap, useBlockData, useCartStore, useCatalogStore, useCategories, 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 } from './chunk-
|
|
1
|
+
import { STORE_SECTION_NAMES, isRecord, STORE_SECTIONS, slugifyStoreName, exportStore, resolveConfig, initStorefrontRuntime, StorefrontConfigHost, StorefrontShell, validateStore, isJsonValue, registerStorefrontBlocks, registerStorefrontExtensionPoints, sectionToJsonSchema, STOREFRONT_PAGE_KINDS, STOREFRONT_COMPONENT_KEYS, STOREFRONT_SLOTS, useStorefrontConfig, useCatalogStore, formatMoney, useCartStore, useSessionStore, selectTotal, selectShipping, selectDiscountTotal, selectSubtotal, selectCount, placeStorefrontOrder, useDeliveryStore, selectRequiresShipping, isNestedBlockRef, BLOCK_STRUCTURAL_KEYS, StorefrontPage, hydrateStoreDocument, blockInstanceId } from './chunk-STL6MATQ.js';
|
|
2
|
+
export { BEFORE_PLACE_ORDER_VALVE, 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, buildEnquiryFromForm, checkPageBlocks, collectDataNeeds, collectOrderMetadata, contentPagePath, createStorefront, createStorefrontApp, currentStaticRenderPass, defaultPageBlocks, entityListBlockMeta, establishCustomerSession, exportStore, formatMoney, formatProductOptionSelection, getCartLineAnnotations, getCheckoutFieldContributions, getCustomerAuthAdapter, getProductCardBadges, getProductOptionGroups, hydrateStoreDocument, hydratedEntriesFor, initStorefrontRuntime, isKnownPath, isPublicPath, 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, selectShipping, selectSubtotal, selectTotal, selectionPrice, serializePageData, shellRouterAdapter, signInByEmail, signOutCustomer, signUpCustomer, slugifyStoreName, storefrontComponentContracts, storefrontPaths, themeToCss, toBlockNodes, toFacetMap, useBlockData, useCartStore, useCatalogStore, useCategories, 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 } from './chunk-STL6MATQ.js';
|
|
3
3
|
export { auditStorefrontSeo, collectSeoAuditInput } from './chunk-6IXTENLB.js';
|
|
4
4
|
import React3 from 'react';
|
|
5
5
|
import { defineApp, registerScaffold, describeExtensionPoints, handleRegistry, describeEntities, describeLoaders, describeBlocks, ENTITY_FIELD_TYPES, BLOCK_SETTING_TYPES, normalizePostalCode, lookupPostalCode, formatPostalCode, BLOCK_PATH_ATTRIBUTE, BLOCK_TYPE_ATTRIBUTE, setBlockEditorMode, renderApp as renderApp$1 } from '@fayz-ai/core';
|
|
@@ -1001,8 +1001,11 @@ function useCheckout() {
|
|
|
1001
1001
|
count: selectCount({ lines }),
|
|
1002
1002
|
subtotal: selectSubtotal({ lines }),
|
|
1003
1003
|
discountTotal: selectDiscountTotal({ lines, discountPercent: cart.discountPercent }),
|
|
1004
|
-
shipping: selectShipping({ lines }, config),
|
|
1005
|
-
total: selectTotal(
|
|
1004
|
+
shipping: selectShipping({ lines, discountFreeShipping: cart.discountFreeShipping }, config),
|
|
1005
|
+
total: selectTotal(
|
|
1006
|
+
{ lines, discountPercent: cart.discountPercent, discountFreeShipping: cart.discountFreeShipping },
|
|
1007
|
+
config
|
|
1008
|
+
)
|
|
1006
1009
|
};
|
|
1007
1010
|
const placeOrder = React3.useCallback(
|
|
1008
1011
|
async (input) => {
|
|
@@ -1016,7 +1019,8 @@ function useCheckout() {
|
|
|
1016
1019
|
cart: {
|
|
1017
1020
|
lines: useCartStore.getState().lines,
|
|
1018
1021
|
discountCode: useCartStore.getState().discountCode,
|
|
1019
|
-
discountPercent: useCartStore.getState().discountPercent
|
|
1022
|
+
discountPercent: useCartStore.getState().discountPercent,
|
|
1023
|
+
discountFreeShipping: useCartStore.getState().discountFreeShipping
|
|
1020
1024
|
},
|
|
1021
1025
|
session: { customerId: session.customerId, email: session.email },
|
|
1022
1026
|
...input
|
|
@@ -1056,9 +1060,10 @@ function usePaymentMethods() {
|
|
|
1056
1060
|
function useShipping() {
|
|
1057
1061
|
const config = useStorefrontConfig();
|
|
1058
1062
|
const lines = useCartStore((state) => state.lines);
|
|
1063
|
+
const freeShipping = useCartStore((state) => state.discountFreeShipping);
|
|
1059
1064
|
const delivery = useDeliveryStore();
|
|
1060
1065
|
const subtotal = selectSubtotal({ lines });
|
|
1061
|
-
const rate = selectShipping({ lines }, config);
|
|
1066
|
+
const rate = selectShipping({ lines, discountFreeShipping: freeShipping }, config);
|
|
1062
1067
|
const threshold = config.shipping.freeAbove ?? null;
|
|
1063
1068
|
return {
|
|
1064
1069
|
postalCode: delivery.postalCode,
|