@ecomiq/storefront 3.0.1 → 3.1.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/README.md +21 -0
- package/dist/{account-Dx4e3syi.js → account-CZZ-ku6L.js} +4 -4
- package/dist/account.d.ts +9 -0
- package/dist/analytics/{analytics-CG1Qagwl.js → analytics-CiG_O37p.js} +4 -4
- package/dist/analytics/{config-DJr-GRhs.js → config-DN5B1GOG.js} +3 -3
- package/dist/analytics/{consent-B13rBpBs.js → consent-D0-iQ4bg.js} +1 -1
- package/dist/analytics/{consent-banner-9QvRRy8v.js → consent-banner-D36fpU89.js} +1 -1
- package/dist/analytics/{cookies-pLozllyB.js → cookies-CWsi-zSd.js} +1 -1
- package/dist/analytics/{events-Dt81tIp1.js → events-CWmKY7oX.js} +2 -1
- package/dist/analytics/{tracker-p4yaoOyk.js → tracker-DpfDB2sY.js} +1 -1
- package/dist/{bank-accounts-DlEczQQ5.js → bank-accounts-MpKIxHaX.js} +1 -1
- package/dist/{captcha-DAqaIx8m.js → captcha-CZkpghTO.js} +1 -1
- package/dist/{cart-actions-Bsub_FFG.js → cart-actions-IKRYGqfj.js} +32 -9
- package/dist/{cart-form-y9P1r_EX.js → cart-form-Bq_B-Rh6.js} +6 -4
- package/dist/cart-form.d.ts +2 -1
- package/dist/{cart-summary-ur2VWKr-.js → cart-summary-B6vtRGBO.js} +6 -1
- package/dist/cart-summary.d.ts +2 -1
- package/dist/{catalog-hooks-B7ZP4wYY.js → catalog-hooks-DjmpXROv.js} +1 -1
- package/dist/{checkout-DVWSXANi.js → checkout-DsI1MY14.js} +6 -6
- package/dist/{complaint-book-BvwLvfx0.js → complaint-book-aAQfGBvo.js} +2 -2
- package/dist/{culqi-authentication-BGr20vAJ.js → culqi-authentication-DHxjPJRE.js} +1 -1
- package/dist/{customer-document-fields-C1K-_DAD.js → customer-document-fields-BzLdztjM.js} +1 -1
- package/dist/{customer-login-form-C7AC6vXd.js → customer-login-form-k_q7_7FX.js} +2 -2
- package/dist/{customer-registration-form-BEm_NEfP.js → customer-registration-form-PrBqUuI9.js} +1 -1
- package/dist/entries/account.js +5 -5
- package/dist/entries/analytics.js +4 -4
- package/dist/entries/cart.d.ts +2 -1
- package/dist/entries/cart.js +6 -5
- package/dist/entries/checkout.js +8 -8
- package/dist/entries/order.js +8 -8
- package/dist/{form-contracts-BNpHaTGJ.js → form-contracts-0R112spH.js} +11 -4
- package/dist/form-contracts.d.ts +3 -3
- package/dist/index.js +29 -29
- package/dist/{invoice-fields-BG0HjL6T.js → invoice-fields-BzDfV1nR.js} +1 -1
- package/dist/{mercadopago-dialog-UTQev0MG.js → mercadopago-dialog-CpGlgKBl.js} +2 -2
- package/dist/{optimistic-cart-BveVOHuh.js → optimistic-cart-DcJ8-tCw.js} +1 -1
- package/dist/{order-display-DTt5WBbc.js → order-display-CUXVESaF.js} +19 -10
- package/dist/{order-draft-DxV1Uhm3.js → order-draft-D8sqUUNp.js} +1 -1
- package/dist/{order-payment-continuation-D_d5PGA4.js → order-payment-continuation-CS6omD7E.js} +3 -3
- package/dist/{order-payment-in-review-x4gdLFHZ.js → order-payment-in-review-D5Y8bjGA.js} +1 -1
- package/dist/{order-status-BJXLJwxq.js → order-status-QsmEO-89.js} +3 -3
- package/dist/{page-seo-a5FJl8x5.js → page-seo-BKG-Ta6t.js} +3 -3
- package/dist/{pages-Ca_Gt6mq.js → pages-DyItxkdE.js} +4 -4
- package/dist/{payment-dialog-frame-B-Q_xQ94.js → payment-dialog-frame-xtidt_eM.js} +1 -1
- package/dist/personalization-BSVlktZP.js +94 -0
- package/dist/personalization-fields-CwBR8oGr.js +363 -0
- package/dist/personalization-fields.d.ts +17 -0
- package/dist/{preview-BiIBif3C.js → preview-JWdMO6kX.js} +6 -4
- package/dist/{preview-address-Cf0sJ-9p.js → preview-address-bvieGEKb.js} +1 -1
- package/dist/{preview-cart-Dg2CVktS.js → preview-cart-COIP3Vfh.js} +3 -2
- package/dist/{public-pages-XtwlaLwt.js → public-pages-Byh01h-6.js} +2 -2
- package/dist/{registration-CpDcv8ql.js → registration-h_00PAhj.js} +3 -3
- package/dist/{route-text-DcJw2SsK.js → route-text-B6pWdevi.js} +1 -1
- package/dist/{section-preview-CmsMl3yu.js → section-preview-BiYfeE-d.js} +2 -2
- package/dist/sections/account-addresses.js +2 -2
- package/dist/sections/account-order.js +11 -6
- package/dist/sections/account-orders.js +3 -3
- package/dist/sections/account-profile.js +2 -2
- package/dist/sections/checkout.js +18 -11
- package/dist/sections/complaint-book.js +3 -3
- package/dist/sections/design-system.js +1 -1
- package/dist/sections/draft-invoice.js +7 -2
- package/dist/{sections-CNUMWTF_.js → sections-CgpjubkB.js} +1 -1
- package/dist/{seo-GpDRhAAA.js → seo-D9UdUMg9.js} +2 -2
- package/dist/{session-CKvmFJyg.js → session-DR_9-bcf.js} +30 -6
- package/dist/{store-8Q-_LFrQ.js → store-uU2gWdMY.js} +2 -2
- package/dist/{storefront-language-DrMjVbmk.js → storefront-language-Bnt-TU2F.js} +1 -1
- package/dist/{storefront-text-D25ae1qf.js → storefront-text-Co7iUnLM.js} +2 -2
- package/dist/{storefront-text-en-ljjjSS4q.js → storefront-text-en-DzYmdOuY.js} +6 -1
- package/dist/{storefront-text-pt-BtHaJLcp.js → storefront-text-pt-CizClH0I.js} +6 -1
- package/dist/{stripe-dialog-Ev9s3Z62.js → stripe-dialog-D88qfkUS.js} +2 -2
- package/dist/{templates-CAqoNyTW.js → templates-AgGupnPA.js} +2 -2
- package/dist/{urls-CpGQPxvf.js → urls-D4uinJVd.js} +1 -1
- package/dist/{use-checkout-CZcxXJXi.js → use-checkout-Jdk8P12A.js} +1 -1
- package/dist/{use-checkout-payment-9R-zacrJ.js → use-checkout-payment-BGX-BE6D.js} +1 -1
- package/dist/{voucher-payment-CVFDZ1L8.js → voucher-payment-B3o9ybg6.js} +1 -1
- package/dist/{worker-CNi-gzCu.js → worker-cbXmLvfR.js} +2 -2
- package/package.json +2 -2
- package/src/sections/account-order.tsx +4 -2
- package/src/sections/checkout.tsx +4 -1
- package/src/sections/draft-invoice.tsx +2 -0
package/dist/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { createRequestHandler, worker } from "./worker-
|
|
2
|
-
import { collectionImageCandidates, found, readCountries, store, withImages } from "./store-
|
|
1
|
+
import { createRequestHandler, worker } from "./worker-cbXmLvfR.js";
|
|
2
|
+
import { collectionImageCandidates, found, readCountries, store, withImages } from "./store-uU2gWdMY.js";
|
|
3
3
|
import { cartCookie, cartToken, readCart } from "./cart-D7DxZ2lD.js";
|
|
4
|
-
import { MAX_CART_QUANTITY, cartAction, loadCart } from "./cart-actions-
|
|
5
|
-
import { checkoutAction, checkoutAddressDefaults, checkoutProgress, checkoutStep, defaultPaymentMethod, loadCheckout, needsShipping } from "./checkout-
|
|
4
|
+
import { MAX_CART_QUANTITY, cartAction, loadCart } from "./cart-actions-IKRYGqfj.js";
|
|
5
|
+
import { checkoutAction, checkoutAddressDefaults, checkoutProgress, checkoutStep, defaultPaymentMethod, loadCheckout, needsShipping } from "./checkout-DsI1MY14.js";
|
|
6
6
|
import { paymentMethodSaving } from "./payment-methods-B8ocTgFZ.js";
|
|
7
|
-
import { useCheckout } from "./use-checkout-
|
|
8
|
-
import { addressAction, loadAccount, loadAddresses, loadOrder, loadOrders, loadProfile, profileAction, readCustomerAddress } from "./account-
|
|
9
|
-
import { loadGeo, loadPage, loadReview, loadSearchSuggestions, loadTracking, productReviewAction, readPage, reviewAction } from "./public-pages-
|
|
10
|
-
import { hasOrderPaymentContinuation, loadOrderStatus, orderPaymentAction, orderProgress, orderStepTitle } from "./order-status-
|
|
11
|
-
import { isOrderDraftPayable, loadOrderDraft, orderDraftAction } from "./order-draft-
|
|
7
|
+
import { useCheckout } from "./use-checkout-Jdk8P12A.js";
|
|
8
|
+
import { addressAction, loadAccount, loadAddresses, loadOrder, loadOrders, loadProfile, profileAction, readCustomerAddress } from "./account-CZZ-ku6L.js";
|
|
9
|
+
import { loadGeo, loadPage, loadReview, loadSearchSuggestions, loadTracking, productReviewAction, readPage, reviewAction } from "./public-pages-Byh01h-6.js";
|
|
10
|
+
import { hasOrderPaymentContinuation, loadOrderStatus, orderPaymentAction, orderProgress, orderStepTitle } from "./order-status-QsmEO-89.js";
|
|
11
|
+
import { isOrderDraftPayable, loadOrderDraft, orderDraftAction } from "./order-draft-D8sqUUNp.js";
|
|
12
12
|
import { useOrderPayment } from "./use-order-payment-BKIz_IO0.js";
|
|
13
|
-
import { OrderPaymentContinuation } from "./order-payment-continuation-
|
|
14
|
-
import { OrderPaymentInReview } from "./order-payment-in-review-
|
|
13
|
+
import { OrderPaymentContinuation } from "./order-payment-continuation-CS6omD7E.js";
|
|
14
|
+
import { OrderPaymentInReview } from "./order-payment-in-review-D5Y8bjGA.js";
|
|
15
15
|
import { discountPercent, isVariantAvailable, pickVariant, variantOptions, variantSwatches } from "./product-variants-BNDHvs1y.js";
|
|
16
|
-
import { SORT_OPTIONS, activeFilterChips, activeFilterCount, clearedFiltersHref, filterLabel, filterValueLabel, isSingleChoiceFilter, pageItems, selectedFacetCount, useFacets, useGeoCascade, usePagination, useSearchSuggestions, useSort } from "./catalog-hooks-
|
|
17
|
-
import { completeCustomerLogin, customer, customerCsrfToken, customerHeaders, logout, requireCustomer, requireCustomerRegistration, startCustomerLogin, submitCustomerLogin } from "./session-
|
|
16
|
+
import { SORT_OPTIONS, activeFilterChips, activeFilterCount, clearedFiltersHref, filterLabel, filterValueLabel, isSingleChoiceFilter, pageItems, selectedFacetCount, useFacets, useGeoCascade, usePagination, useSearchSuggestions, useSort } from "./catalog-hooks-DjmpXROv.js";
|
|
17
|
+
import { completeCustomerLogin, customer, customerCsrfToken, customerHeaders, logout, requireCustomer, requireCustomerRegistration, startCustomerLogin, submitCustomerLogin } from "./session-DR_9-bcf.js";
|
|
18
18
|
import { CustomerCsrfField, useCustomerCsrfToken } from "./customer-csrf-C1oDX-Py.js";
|
|
19
|
-
import { CUSTOMER_CSRF_FIELD, FORM_CONTRACTS } from "./form-contracts-
|
|
19
|
+
import { CUSTOMER_CSRF_FIELD, FORM_CONTRACTS } from "./form-contracts-0R112spH.js";
|
|
20
20
|
import { culqiSourceKey } from "./culqi-three-ds-HP3mfrvV.js";
|
|
21
21
|
import { readCatalog, shouldRevalidateCatalogRoot } from "./catalog-7gJ-l5hW.js";
|
|
22
|
-
import { categorySeo, collectionSeo, homeSeo, pageSeo, productSeo, seoMeta } from "./page-seo-
|
|
23
|
-
import { canonicalUrl, loadCategory, loadProduct, requireCanonical, resolveUrl } from "./urls-
|
|
24
|
-
import { collectionPage, productPage, productReviews, resolvePage } from "./pages-
|
|
22
|
+
import { categorySeo, collectionSeo, homeSeo, pageSeo, productSeo, seoMeta } from "./page-seo-BKG-Ta6t.js";
|
|
23
|
+
import { canonicalUrl, loadCategory, loadProduct, requireCanonical, resolveUrl } from "./urls-D4uinJVd.js";
|
|
24
|
+
import { collectionPage, productPage, productReviews, resolvePage } from "./pages-DyItxkdE.js";
|
|
25
25
|
import { money } from "./money-DtGOtDri.js";
|
|
26
26
|
import { readPlace } from "./place-CmW4hBWY.js";
|
|
27
27
|
import { optional, safeNext, text } from "./form-BtQcbXlJ.js";
|
|
@@ -30,21 +30,21 @@ import { Favicon } from "./favicon-YpyhVJ9H.js";
|
|
|
30
30
|
import { Hidden } from "./hidden-CCWtOWKR.js";
|
|
31
31
|
import { SourceProvider, source, sourceValue } from "./sources-B-3JFJfb.js";
|
|
32
32
|
import { RichText } from "./rich-text-M-Ju8RL4.js";
|
|
33
|
-
import { loadSections, sectionKey, useSection, withSectionBoundary, withSections } from "./sections-
|
|
34
|
-
import { templateComponent, templateName, templatePath, templated } from "./templates-
|
|
35
|
-
import { SectionPreview, sectionPreview, sectionPreviewMeta } from "./section-preview-
|
|
33
|
+
import { loadSections, sectionKey, useSection, withSectionBoundary, withSections } from "./sections-CgpjubkB.js";
|
|
34
|
+
import { templateComponent, templateName, templatePath, templated } from "./templates-AgGupnPA.js";
|
|
35
|
+
import { SectionPreview, sectionPreview, sectionPreviewMeta } from "./section-preview-BiYfeE-d.js";
|
|
36
36
|
import { StorefrontAnchor, StorefrontLink, readStorefrontLayout, readStorefrontLinks, storefrontHref, useStorefrontLinkPublished } from "./links-kFxBZfdb.js";
|
|
37
37
|
import { PaymentLogo, paymentLogoCodes } from "./payment-logo-BoPaGJc_.js";
|
|
38
|
-
import { BankAccountList } from "./bank-accounts-
|
|
38
|
+
import { BankAccountList } from "./bank-accounts-MpKIxHaX.js";
|
|
39
39
|
import { CustomerAvatar } from "./customer-avatar-CJXSDroK.js";
|
|
40
|
-
import { CustomerLoginForm } from "./customer-login-form-
|
|
41
|
-
import { Captcha } from "./captcha-
|
|
40
|
+
import { CustomerLoginForm } from "./customer-login-form-k_q7_7FX.js";
|
|
41
|
+
import { Captcha } from "./captcha-CZkpghTO.js";
|
|
42
42
|
import { COMPLAINT_DOCUMENT_TYPES, IDENTITY_DOCUMENT_TYPES, identityDocumentRule } from "./documents-T1mzc_j8.js";
|
|
43
|
-
import { complaintBookAction, complaintBookAttachmentError, complaintBookLinks, complaintBookNumber, loadComplaintBook } from "./complaint-book-
|
|
44
|
-
import { loadCustomerRegistration, submitCustomerRegistration } from "./registration-
|
|
45
|
-
import { CustomerRegistrationForm } from "./customer-registration-form-
|
|
43
|
+
import { complaintBookAction, complaintBookAttachmentError, complaintBookLinks, complaintBookNumber, loadComplaintBook } from "./complaint-book-aAQfGBvo.js";
|
|
44
|
+
import { loadCustomerRegistration, submitCustomerRegistration } from "./registration-h_00PAhj.js";
|
|
45
|
+
import { CustomerRegistrationForm } from "./customer-registration-form-PrBqUuI9.js";
|
|
46
46
|
import { storefrontContact } from "./store-contact--hY6CoFb.js";
|
|
47
|
-
import { loadStorefrontTranslations, storefrontText } from "./storefront-text-
|
|
48
|
-
import { StorefrontLanguageProvider, useStorefrontLocale, useStorefrontText } from "./storefront-language-
|
|
49
|
-
import { storefrontRouteText } from "./route-text-
|
|
47
|
+
import { loadStorefrontTranslations, storefrontText } from "./storefront-text-Co7iUnLM.js";
|
|
48
|
+
import { StorefrontLanguageProvider, useStorefrontLocale, useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
|
|
49
|
+
import { storefrontRouteText } from "./route-text-B6pWdevi.js";
|
|
50
50
|
export { BankAccountList, COMPLAINT_DOCUMENT_TYPES, CUSTOMER_CSRF_FIELD, Captcha, CustomerAvatar, CustomerCsrfField, CustomerLoginForm, CustomerRegistrationForm, FORM_CONTRACTS, Favicon, Hidden, IDENTITY_DOCUMENT_TYPES, MAX_CART_QUANTITY, OrderPaymentContinuation, OrderPaymentInReview, PaymentLogo, RichText, SORT_OPTIONS, SectionPreview, SourceProvider, StorefrontAnchor, StorefrontLanguageProvider, StorefrontLink, activeFilterChips, activeFilterCount, addressAction, canonicalUrl, cartAction, cartCookie, cartToken, categorySeo, checkoutAction, checkoutAddressDefaults, checkoutProgress, checkoutStep, clearedFiltersHref, collectionImageCandidates, collectionPage, collectionSeo, complaintBookAction, complaintBookAttachmentError, complaintBookLinks, complaintBookNumber, completeCustomerLogin, createRequestHandler, culqiSourceKey, customer, customerCsrfToken, customerHeaders, defaultPaymentMethod, discountPercent, filterLabel, filterValueLabel, found, hasOrderPaymentContinuation, homeSeo, identityDocumentRule, isOrderDraftPayable, isSingleChoiceFilter, isVariantAvailable, loadAccount, loadAddresses, loadCart, loadCategory, loadCheckout, loadComplaintBook, loadCustomerRegistration, loadGeo, loadOrder, loadOrderDraft, loadOrderStatus, loadOrders, loadPage, loadProduct, loadProfile, loadReview, loadSearchSuggestions, loadSections, loadStorefrontTranslations, loadTracking, logout, money, needsShipping, optional, orderDraftAction, orderPaymentAction, orderProgress, orderStepTitle, pageItems, pageSeo, paymentLogoCodes, paymentMethodSaving, pickProducts, pickVariant, productPage, productReviewAction, productReviews, productSeo, profileAction, readCart, readCatalog, readCountries, readCustomerAddress, readPage, readPlace, readStorefrontLayout, readStorefrontLinks, requireCanonical, requireCustomer, requireCustomerRegistration, resolvePage, resolveUrl, reviewAction, safeNext, section, sectionKey, sectionPreview, sectionPreviewMeta, selectedFacetCount, seoMeta, setting, shouldRevalidateCatalogRoot, source, sourceValue, startCustomerLogin, store, storefrontContact, storefrontHref, storefrontRouteText, storefrontText, submitCustomerLogin, submitCustomerRegistration, templateComponent, templateName, templatePath, templated, text, useCheckout, useCustomerCsrfToken, useFacets, useGeoCascade, useOrderPayment, usePagination, useSearchSuggestions, useSection, useSort, useStorefrontLinkPublished, useStorefrontLocale, useStorefrontText, variantOptions, variantSwatches, withImages, withSectionBoundary, withSections, worker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useStorefrontText } from "./storefront-language-
|
|
1
|
+
import { useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
|
|
2
2
|
import { IDENTITY_DOCUMENT_TYPES, identityDocumentError, identityDocumentRule, isIdentityDocumentType } from "./documents-T1mzc_j8.js";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useStorefrontLocale, useStorefrontText } from "./storefront-language-
|
|
1
|
+
import { useStorefrontLocale, useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
|
|
2
2
|
import { loadMercadoPago } from "./mercadopago-checkout-DC7RXa8k.js";
|
|
3
3
|
import { money } from "./money-DtGOtDri.js";
|
|
4
4
|
import { PaymentLogo } from "./payment-logo-BoPaGJc_.js";
|
|
5
|
-
import { PaymentDialogFrame } from "./payment-dialog-frame-
|
|
5
|
+
import { PaymentDialogFrame } from "./payment-dialog-frame-xtidt_eM.js";
|
|
6
6
|
import { useEffect, useId, useRef, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
// src/mercadopago-dialog.tsx
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { orderStepLabel, orderStepOf, paymentLabel } from "./order-view-9IlBg5AF.js";
|
|
2
|
+
import { cartModifiers } from "./personalization-BSVlktZP.js";
|
|
2
3
|
import { PaymentLogo, hasPaymentLogo } from "./payment-logo-BoPaGJc_.js";
|
|
3
|
-
import { useStorefrontLocale, useStorefrontText } from "./storefront-language-
|
|
4
|
+
import { useStorefrontLocale, useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
|
|
4
5
|
import { Form } from "react-router";
|
|
5
6
|
import { formatOrderDate } from "@ecomiq/core";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -79,15 +80,23 @@ function ReorderButton({ items, variant = "default" }) {
|
|
|
79
80
|
name: "intent",
|
|
80
81
|
value: "reorder"
|
|
81
82
|
}),
|
|
82
|
-
lines.map((item) => /* @__PURE__ */ jsxs("span", { children: [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
lines.map((item) => /* @__PURE__ */ jsxs("span", { children: [
|
|
84
|
+
/* @__PURE__ */ jsx("input", {
|
|
85
|
+
type: "hidden",
|
|
86
|
+
name: "variantId",
|
|
87
|
+
value: item.variantId ?? ""
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsx("input", {
|
|
90
|
+
type: "hidden",
|
|
91
|
+
name: "quantity",
|
|
92
|
+
value: item.quantity
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsx("input", {
|
|
95
|
+
type: "hidden",
|
|
96
|
+
name: "modifiers",
|
|
97
|
+
value: JSON.stringify(cartModifiers(item.modifiers))
|
|
98
|
+
})
|
|
99
|
+
] }, item.id)),
|
|
91
100
|
/* @__PURE__ */ jsx(Button, {
|
|
92
101
|
type: "submit",
|
|
93
102
|
variant,
|
package/dist/{order-payment-continuation-D_d5PGA4.js → order-payment-continuation-CS6omD7E.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useStorefrontText } from "./storefront-language-
|
|
2
|
-
import { VoucherPayment } from "./voucher-payment-
|
|
1
|
+
import { useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
|
|
2
|
+
import { VoucherPayment } from "./voucher-payment-B3o9ybg6.js";
|
|
3
3
|
import { useCulqiCheckout } from "./use-culqi-checkout-CrjLAipU.js";
|
|
4
|
-
import { CulqiAuthentication } from "./culqi-authentication-
|
|
4
|
+
import { CulqiAuthentication } from "./culqi-authentication-DHxjPJRE.js";
|
|
5
5
|
import { useRevalidator } from "react-router";
|
|
6
6
|
import { useEffect, useRef, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { money } from "./money-DtGOtDri.js";
|
|
2
|
-
import { useStorefrontLocale, useStorefrontText } from "./storefront-language-
|
|
2
|
+
import { useStorefrontLocale, useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
|
|
3
3
|
import { Link, useLocation, useRevalidator } from "react-router";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { orderAnalytics } from "./analytics/events-
|
|
1
|
+
import { orderAnalytics } from "./analytics/events-CWmKY7oX.js";
|
|
2
2
|
import { text } from "./form-BtQcbXlJ.js";
|
|
3
|
-
import { found, store } from "./store-
|
|
4
|
-
import { worker } from "./worker-
|
|
3
|
+
import { found, store } from "./store-uU2gWdMY.js";
|
|
4
|
+
import { worker } from "./worker-cbXmLvfR.js";
|
|
5
5
|
import { PAYMENT_RETURN_CONFIRMING, PAYMENT_RETURN_PARAM } from "./payment-return-5cjypwIw.js";
|
|
6
6
|
import { data, redirect } from "react-router";
|
|
7
7
|
import { ApiError, AuthenticateOrderPaymentInputSchema } from "@ecomiq/core";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { loadStorefrontTranslations, storefrontText } from "./storefront-text-
|
|
2
|
-
import { store } from "./store-
|
|
3
|
-
import { absoluteUrl, canonicalOrigin, requestUrl } from "./urls-
|
|
1
|
+
import { loadStorefrontTranslations, storefrontText } from "./storefront-text-Co7iUnLM.js";
|
|
2
|
+
import { store } from "./store-uU2gWdMY.js";
|
|
3
|
+
import { absoluteUrl, canonicalOrigin, requestUrl } from "./urls-D4uinJVd.js";
|
|
4
4
|
// src/page-seo.ts
|
|
5
5
|
const DESCRIPTION_LENGTH = 160;
|
|
6
6
|
const TITLE_LENGTH = 65;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { categoryAnalytics, collectionAnalytics, productAnalytics } from "./analytics/events-
|
|
1
|
+
import { categoryAnalytics, collectionAnalytics, productAnalytics } from "./analytics/events-CWmKY7oX.js";
|
|
2
2
|
import { readCatalog } from "./catalog-7gJ-l5hW.js";
|
|
3
|
-
import { store } from "./store-
|
|
4
|
-
import { requestUrl, requireCanonical } from "./urls-
|
|
5
|
-
import { worker } from "./worker-
|
|
3
|
+
import { store } from "./store-uU2gWdMY.js";
|
|
4
|
+
import { requestUrl, requireCanonical } from "./urls-D4uinJVd.js";
|
|
5
|
+
import { worker } from "./worker-cbXmLvfR.js";
|
|
6
6
|
import { data, redirect } from "react-router";
|
|
7
7
|
import { CategoryDetailSchema, CollectionSchema, GraphQLResponseError, ProductDetailSchema, ProductSummarySchema, ProductsResponseSchema, graphQLSelection, sanitizeHtml } from "@ecomiq/core";
|
|
8
8
|
import { z } from "zod";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { MODIFIER_FIELD_PREFIX } from "./form-contracts-0R112spH.js";
|
|
2
|
+
// src/personalization.ts
|
|
3
|
+
const MAX_MODIFIER_GROUPS = 50;
|
|
4
|
+
const MAX_OPTION_QUANTITY = 99;
|
|
5
|
+
const VALUE_FIELD = /^modifier\.([^.]+)\.value$/;
|
|
6
|
+
const OPTION_FIELD = /^modifier\.([^.]+)\.option$/;
|
|
7
|
+
/** Field for the text the buyer types in a `text` customization. */
|
|
8
|
+
function modifierValueField(groupId) {
|
|
9
|
+
return `${MODIFIER_FIELD_PREFIX}${groupId}.value`;
|
|
10
|
+
}
|
|
11
|
+
/** Field for each option the buyer chooses; repeat it for several options. */
|
|
12
|
+
function modifierOptionField(groupId) {
|
|
13
|
+
return `${MODIFIER_FIELD_PREFIX}${groupId}.option`;
|
|
14
|
+
}
|
|
15
|
+
/** Units of a chosen option; leave it out to send one. */
|
|
16
|
+
function modifierQuantityField(groupId, optionId) {
|
|
17
|
+
return `${MODIFIER_FIELD_PREFIX}${groupId}.option.${optionId}.quantity`;
|
|
18
|
+
}
|
|
19
|
+
function optionQuantity(form, groupId, optionId) {
|
|
20
|
+
const raw = form.get(modifierQuantityField(groupId, optionId));
|
|
21
|
+
if (typeof raw !== "string" || raw.trim() === "") return void 0;
|
|
22
|
+
const value = Math.floor(Number(raw));
|
|
23
|
+
if (!Number.isFinite(value) || value < 1) return 1;
|
|
24
|
+
return Math.min(MAX_OPTION_QUANTITY, value);
|
|
25
|
+
}
|
|
26
|
+
/** Customizations sent with the form, ready for `addCartItem`. Empty fields are left out. */
|
|
27
|
+
function readPersonalization(form) {
|
|
28
|
+
const values = /* @__PURE__ */ new Map();
|
|
29
|
+
const options = /* @__PURE__ */ new Map();
|
|
30
|
+
for (const [name, entry] of form.entries()) {
|
|
31
|
+
if (typeof entry !== "string") continue;
|
|
32
|
+
const text = entry.trim();
|
|
33
|
+
if (text === "") continue;
|
|
34
|
+
const value = VALUE_FIELD.exec(name);
|
|
35
|
+
if (value?.[1]) {
|
|
36
|
+
values.set(value[1], text);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const option = OPTION_FIELD.exec(name);
|
|
40
|
+
if (option?.[1]) options.set(option[1], [...options.get(option[1]) ?? [], text]);
|
|
41
|
+
}
|
|
42
|
+
const modifiers = [];
|
|
43
|
+
for (const [modifierGroupId, value] of values) modifiers.push({
|
|
44
|
+
modifierGroupId,
|
|
45
|
+
value
|
|
46
|
+
});
|
|
47
|
+
for (const [modifierGroupId, ids] of options) modifiers.push({
|
|
48
|
+
modifierGroupId,
|
|
49
|
+
options: [...new Set(ids)].map((optionId) => ({
|
|
50
|
+
optionId,
|
|
51
|
+
quantity: optionQuantity(form, modifierGroupId, optionId)
|
|
52
|
+
}))
|
|
53
|
+
});
|
|
54
|
+
return modifiers.slice(0, MAX_MODIFIER_GROUPS);
|
|
55
|
+
}
|
|
56
|
+
/** The customizations of an order or cart line, ready to add the line to a cart again. */
|
|
57
|
+
function cartModifiers(modifiers) {
|
|
58
|
+
const groups = /* @__PURE__ */ new Map();
|
|
59
|
+
for (const modifier of modifiers) {
|
|
60
|
+
if (modifier.value !== null) {
|
|
61
|
+
groups.set(modifier.modifierGroupId, {
|
|
62
|
+
modifierGroupId: modifier.modifierGroupId,
|
|
63
|
+
value: modifier.value
|
|
64
|
+
});
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (modifier.modifierOptionId === null) continue;
|
|
68
|
+
const option = modifier.quantity > 1 ? {
|
|
69
|
+
optionId: modifier.modifierOptionId,
|
|
70
|
+
quantity: modifier.quantity
|
|
71
|
+
} : { optionId: modifier.modifierOptionId };
|
|
72
|
+
groups.set(modifier.modifierGroupId, {
|
|
73
|
+
modifierGroupId: modifier.modifierGroupId,
|
|
74
|
+
options: [...groups.get(modifier.modifierGroupId)?.options ?? [], option]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return [...groups.values()];
|
|
78
|
+
}
|
|
79
|
+
/** Form fields for these customizations, in the shape `readPersonalization` reads. */
|
|
80
|
+
function personalizationEntries(modifiers) {
|
|
81
|
+
const entries = [];
|
|
82
|
+
for (const modifier of modifiers) {
|
|
83
|
+
if (modifier.value !== void 0) {
|
|
84
|
+
entries.push([modifierValueField(modifier.modifierGroupId), modifier.value]);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
for (const option of modifier.options ?? []) {
|
|
88
|
+
entries.push([modifierOptionField(modifier.modifierGroupId), option.optionId]);
|
|
89
|
+
if (option.quantity !== void 0) entries.push([modifierQuantityField(modifier.modifierGroupId, option.optionId), String(option.quantity)]);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return entries;
|
|
93
|
+
}
|
|
94
|
+
export { cartModifiers, modifierOptionField, modifierQuantityField, modifierValueField, personalizationEntries, readPersonalization };
|