@nextblock-cms/ecom 0.13.10 → 0.13.11
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/index.cjs.js +1 -1
- package/index.es.js +98 -97
- package/lib/CurrencyProvider.cjs.js +1 -1
- package/lib/CurrencyProvider.es.js +23 -23
- package/lib/components/AccountNavigationMenu.cjs.js +1 -1
- package/lib/components/AccountNavigationMenu.es.js +25 -25
- package/lib/components/AddToCartButton.cjs.js +1 -1
- package/lib/components/AddToCartButton.es.js +40 -40
- package/lib/components/Cart.cjs.js +1 -1
- package/lib/components/Cart.es.js +133 -133
- package/lib/components/CartDrawer.cjs.js +1 -1
- package/lib/components/CartDrawer.es.js +83 -83
- package/lib/components/CartIcon.cjs.js +1 -1
- package/lib/components/CartIcon.es.js +17 -17
- package/lib/components/Checkout.cjs.js +1 -1
- package/lib/components/Checkout.es.js +547 -547
- package/lib/components/CouponForm.cjs.js +1 -1
- package/lib/components/CouponForm.es.js +75 -75
- package/lib/components/CurrencySwitcher.cjs.js +1 -1
- package/lib/components/CurrencySwitcher.es.js +16 -16
- package/lib/components/CustomerProfileForm.cjs.js +1 -1
- package/lib/components/CustomerProfileForm.es.js +238 -238
- package/lib/components/FeaturedProduct.cjs.js +1 -1
- package/lib/components/FeaturedProduct.es.js +34 -34
- package/lib/components/FreemiusLicensePanel.cjs.js +1 -1
- package/lib/components/FreemiusLicensePanel.es.js +44 -44
- package/lib/components/InvoiceDocument.cjs.js +1 -1
- package/lib/components/InvoiceDocument.es.js +141 -141
- package/lib/components/InvoiceViewerShell.cjs.js +2 -2
- package/lib/components/InvoiceViewerShell.es.js +49 -49
- package/lib/components/ProductCard.cjs.js +1 -1
- package/lib/components/ProductCard.es.js +76 -76
- package/lib/components/ProductDetailsLayout.cjs.js +1 -1
- package/lib/components/ProductDetailsLayout.es.js +308 -308
- package/lib/components/ProductGallery.cjs.js +1 -1
- package/lib/components/ProductGallery.es.js +22 -22
- package/lib/components/ProductGrid.cjs.js +1 -1
- package/lib/components/ProductGrid.es.js +9 -9
- package/lib/components/ShippingEstimator.cjs.js +1 -1
- package/lib/components/ShippingEstimator.es.js +76 -76
- package/lib/components/SimpleTiptapRenderer.cjs.js +1 -1
- package/lib/components/SimpleTiptapRenderer.d.ts +9 -0
- package/lib/components/SimpleTiptapRenderer.es.js +161 -146
- package/lib/components/SubscriptionSelector.cjs.js +1 -1
- package/lib/components/SubscriptionSelector.es.js +77 -77
- package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +1 -1
- package/lib/pages/cms/coupons/CouponEditorForm.es.js +108 -108
- package/lib/pages/cms/coupons/CouponsPage.cjs.js +2 -2
- package/lib/pages/cms/coupons/CouponsPage.es.js +102 -102
- package/lib/pages/cms/coupons/CreateCouponDialog.cjs.js +1 -1
- package/lib/pages/cms/coupons/CreateCouponDialog.es.js +21 -21
- package/lib/pages/cms/coupons/EditCouponPage.cjs.js +1 -1
- package/lib/pages/cms/coupons/EditCouponPage.es.js +21 -21
- package/lib/pages/cms/coupons/ProductScopePicker.cjs.js +1 -1
- package/lib/pages/cms/coupons/ProductScopePicker.es.js +56 -56
- package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +1 -1
- package/lib/pages/cms/orders/ExportReportsDialog.es.js +67 -67
- package/lib/pages/cms/orders/OrderDetailPage.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderDetailPage.es.js +55 -55
- package/lib/pages/cms/orders/OrderPrintButton.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderPrintButton.es.js +4 -4
- package/lib/pages/cms/orders/OrderStatusForm.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderStatusForm.es.js +28 -28
- package/lib/pages/cms/orders/OrdersPage.cjs.js +1 -1
- package/lib/pages/cms/orders/OrdersPage.es.js +52 -52
- package/lib/pages/cms/payments/PaymentsClient.cjs.js +1 -1
- package/lib/pages/cms/payments/PaymentsClient.es.js +164 -164
- package/lib/pages/cms/payments/PaymentsPage.cjs.js +1 -1
- package/lib/pages/cms/payments/PaymentsPage.es.js +9 -9
- package/lib/pages/cms/products/ProductsPage.cjs.js +1 -1
- package/lib/pages/cms/products/ProductsPage.es.js +25 -25
- package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +1 -1
- package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +48 -48
- package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +1 -1
- package/lib/pages/cms/products/attributes/AttributeManagementPage.es.js +24 -24
- package/lib/pages/cms/products/attributes/components/AttributeManager.cjs.js +1 -1
- package/lib/pages/cms/products/attributes/components/AttributeManager.es.js +118 -118
- package/lib/pages/cms/products/categories/CategoryManagementPage.cjs.js +1 -1
- package/lib/pages/cms/products/categories/CategoryManagementPage.es.js +18 -18
- package/lib/pages/cms/products/categories/components/CategoryManager.cjs.js +1 -1
- package/lib/pages/cms/products/categories/components/CategoryManager.es.js +136 -136
- package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +1 -1
- package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +77 -77
- package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +1 -1
- package/lib/pages/cms/products/components/CurrencyPriceFields.es.js +77 -77
- package/lib/pages/cms/products/components/DeleteProductButton.cjs.js +1 -1
- package/lib/pages/cms/products/components/DeleteProductButton.es.js +10 -10
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs.js +1 -1
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.es.js +60 -60
- package/lib/pages/cms/products/components/ProductCategorySelector.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductCategorySelector.es.js +80 -80
- package/lib/pages/cms/products/components/ProductForm.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductForm.es.js +493 -493
- package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductMediaManager.es.js +50 -50
- package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductsBulkTable.es.js +145 -145
- package/lib/pages/cms/products/components/SaleScheduleFields.cjs.js +1 -1
- package/lib/pages/cms/products/components/SaleScheduleFields.es.js +60 -60
- package/lib/pages/cms/products/components/SyncFreemiusButton.cjs.js +1 -1
- package/lib/pages/cms/products/components/SyncFreemiusButton.es.js +8 -8
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs.js +2 -2
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.es.js +8 -8
- package/lib/pages/cms/products/components/VariationsEditor.cjs.js +1 -1
- package/lib/pages/cms/products/components/VariationsEditor.es.js +228 -228
- package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +1 -1
- package/lib/pages/cms/products/inventory/InventoryPage.es.js +9 -9
- package/lib/pages/cms/products/inventory/InventoryTableClient.cjs.js +2 -2
- package/lib/pages/cms/products/inventory/InventoryTableClient.es.js +135 -135
- package/lib/pages/cms/products/new/NewProductPage.cjs.js +1 -1
- package/lib/pages/cms/products/new/NewProductPage.es.js +24 -24
- package/lib/pages/cms/shipping/ShippingPage.cjs.js +2 -2
- package/lib/pages/cms/shipping/ShippingPage.es.js +162 -162
- package/lib/pages/cms/shipping/components/RateForm.cjs.js +1 -1
- package/lib/pages/cms/shipping/components/RateForm.es.js +296 -296
- package/lib/pages/cms/shipping/components/ZoneForm.cjs.js +1 -1
- package/lib/pages/cms/shipping/components/ZoneForm.es.js +130 -130
- package/lib/pages/cms/taxes/TaxesPage.cjs.js +1 -1
- package/lib/pages/cms/taxes/TaxesPage.es.js +126 -126
- package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +1 -1
- package/lib/pages/cms/taxes/components/TaxRateForm.es.js +54 -54
- package/lib/product-context.cjs.js +1 -1
- package/lib/product-context.es.js +8 -8
- package/package.json +4 -4
package/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./lib/components/CartDrawer.cjs.js"),g=require("./lib/components/Cart.cjs.js"),y=require("./lib/components/Checkout.cjs.js"),v=require("./lib/components/CartIcon.cjs.js"),S=require("./lib/components/CouponForm.cjs.js"),b=require("./lib/components/CurrencySwitcher.cjs.js"),T=require("./lib/components/AddToCartButton.cjs.js"),p=require("./lib/components/ProductCard.cjs.js"),I=require("./lib/components/ProductGrid.cjs.js"),D=require("./lib/components/ProductGallery.cjs.js"),_=require("./lib/components/FeaturedProduct.cjs.js"),R=require("./lib/components/CustomerProfileForm.cjs.js"),F=require("./lib/components/SubscriptionSelector.cjs.js"),q=require("./lib/components/InvoiceDocument.cjs.js"),A=require("./lib/components/InvoiceViewerShell.cjs.js"),E=require("./lib/components/FreemiusLicensePanel.cjs.js"),L=require("./lib/components/AccountNavigationMenu.cjs.js"),l=require("./lib/components/SimpleTiptapRenderer.cjs.js"),O=require("./lib/pages/cms/products/components/ProductForm.cjs.js"),f=require("./lib/pages/cms/products/components/ProductCategorySelector.cjs.js"),u=require("./lib/cart-store.cjs.js"),s=require("./lib/coupons.cjs.js"),d=require("./lib/CurrencyProvider.cjs.js"),e=require("./lib/currency.cjs.js"),z=require("./lib/currency-store.cjs.js"),m=require("./lib/use-cart.cjs.js"),a=require("./lib/customer.cjs.js"),i=require("./lib/types.cjs.js"),n=require("./lib/trials.cjs.js"),t=require("./lib/order-tax-details.cjs.js"),o=require("./lib/invoice.cjs.js"),c=require("./lib/invoice-ui.cjs.js"),N=require("./lib/product-schema.cjs.js"),C=require("./lib/product-context.cjs.js"),V=require("./lib/components/ProductDetailsLayout.cjs.js"),r=require("./lib/variation-utils.cjs.js");exports.CartDrawer=P.CartDrawer;exports.Cart=g.Cart;exports.Checkout=y.Checkout;exports.CartIcon=v.CartIcon;exports.CouponForm=S.CouponForm;exports.CurrencySwitcher=b.CurrencySwitcher;exports.AddToCartButton=T.AddToCartButton;exports.ProductCard=p.ProductCard;exports.ProductGrid=I.ProductGrid;exports.ProductGallery=D.ProductGallery;exports.FeaturedProduct=_.FeaturedProduct;exports.CustomerProfileForm=R.CustomerProfileForm;exports.SubscriptionSelector=F.SubscriptionSelector;exports.InvoiceDocument=q.InvoiceDocument;exports.InvoiceViewerShell=A.InvoiceViewerShell;exports.FreemiusLicensePanel=E.FreemiusLicensePanel;exports.AccountNavigationMenu=L.AccountNavigationMenu;exports.SimpleTiptapRenderer=l.SimpleTiptapRenderer;exports.toNoCookieEmbedSrc=l.toNoCookieEmbedSrc;exports.ProductForm=O.ProductForm;exports.ProductCategorySelector=f.ProductCategorySelector;exports.getCartItemActivePrice=u.getCartItemActivePrice;exports.useCartStore=u.useCartStore;exports.useCartSubtotal=u.useCartSubtotal;exports.useCartTotalItems=u.useCartTotalItems;exports.emptyProviderDiscounts=s.emptyProviderDiscounts;exports.getCartLineCouponKey=s.getCartLineCouponKey;exports.normalizeCouponCode=s.normalizeCouponCode;exports.CurrencyProvider=d.CurrencyProvider;exports.useCurrency=d.useCurrency;exports.CURRENCY_ROUNDING_MODES=e.CURRENCY_ROUNDING_MODES;exports.applyCurrencyRounding=e.applyCurrencyRounding;exports.convertMinorUnitAmount=e.convertMinorUnitAmount;exports.describeCurrencyRoundingRule=e.describeCurrencyRoundingRule;exports.getCurrencyLookup=e.getCurrencyLookup;exports.getDefaultCurrency=e.getDefaultCurrency;exports.getExchangeRateForCurrency=e.getExchangeRateForCurrency;exports.inferCurrencyCodeFromLocale=e.inferCurrencyCodeFromLocale;exports.isSaleWindowActive=e.isSaleWindowActive;exports.isScheduledPriceDue=e.isScheduledPriceDue;exports.normalizeCurrencyRecord=e.normalizeCurrencyRecord;exports.normalizeCurrencyRoundingMode=e.normalizeCurrencyRoundingMode;exports.normalizePriceMap=e.normalizePriceMap;exports.normalizeSalePriceMap=e.normalizeSalePriceMap;exports.resolveEffectivePriceForCurrency=e.resolveEffectivePriceForCurrency;exports.resolvePriceForCurrency=e.resolvePriceForCurrency;exports.resolvePriceRangeForCurrency=e.resolvePriceRangeForCurrency;exports.sortCurrencies=e.sortCurrencies;exports.useCurrencyPreferenceStore=z.useCurrencyPreferenceStore;exports.useCart=m.useCart;exports.useIsCartHydrated=m.useIsCartHydrated;exports.addressesMatch=a.addressesMatch;exports.emptyCustomerAddress=a.emptyCustomerAddress;exports.isCustomerAddressComplete=a.isCustomerAddressComplete;exports.normalizeCustomerAddress=a.normalizeCustomerAddress;exports.normalizeOrderCustomerDetails=a.normalizeOrderCustomerDetails;exports.DEFAULT_ENABLED_PAYMENT_PROVIDERS=i.DEFAULT_ENABLED_PAYMENT_PROVIDERS;exports.derivePaymentProviderFromProductType=i.derivePaymentProviderFromProductType;exports.getProductPaymentProvider=i.getProductPaymentProvider;exports.isDigitalItem=i.isDigitalItem;exports.isDigitalProduct=i.isDigitalProduct;exports.normalizeEnabledPaymentProviders=i.normalizeEnabledPaymentProviders;exports.getTrialCheckoutMode=n.getTrialCheckoutMode;exports.getTrialLabel=n.getTrialLabel;exports.getTrialPaymentRequirementLabel=n.getTrialPaymentRequirementLabel;exports.getTrialPeriodDays=n.getTrialPeriodDays;exports.getTrialSummary=n.getTrialSummary;exports.aggregateOrderTaxLines=t.aggregateOrderTaxLines;exports.buildOrderTaxDetailsFromCalculation=t.buildOrderTaxDetailsFromCalculation;exports.buildOrderTaxDetailsFromStripeSession=t.buildOrderTaxDetailsFromStripeSession;exports.getOrderTaxRateJurisdiction=t.getOrderTaxRateJurisdiction;exports.getOrderTaxRateLabel=t.getOrderTaxRateLabel;exports.getOrderTaxRatePercentage=t.getOrderTaxRatePercentage;exports.normalizeOrderTaxDetails=t.normalizeOrderTaxDetails;exports.DEFAULT_INVOICE_SETTINGS=o.DEFAULT_INVOICE_SETTINGS;exports.INVOICE_SETTINGS_KEY=o.INVOICE_SETTINGS_KEY;exports.formatInvoiceCurrency=o.formatInvoiceCurrency;exports.formatInvoiceDate=o.formatInvoiceDate;exports.getInvoiceAddressLines=o.getInvoiceAddressLines;exports.normalizeInvoiceSettings=o.normalizeInvoiceSettings;exports.serializeInvoiceSettings=o.serializeInvoiceSettings;exports.buildInvoiceDocumentLabels=c.buildInvoiceDocumentLabels;exports.getInvoiceLocale=c.getInvoiceLocale;exports.localizeInvoicePresentationData=c.localizeInvoicePresentationData;exports.translateOrFallback=c.translateOrFallback;exports.translateOrderStatus=c.translateOrderStatus;exports.productSchema=N.productSchema;exports.ProductProvider=C.ProductProvider;exports.useProduct=C.useProduct;exports.ProductDetailsLayout=V.ProductDetailsLayout;exports.buildCombinationKey=r.buildCombinationKey;exports.buildVariantLabel=r.buildVariantLabel;exports.chooseInitialVariantSelections=r.chooseInitialVariantSelections;exports.extractSelectedTermsByAttribute=r.extractSelectedTermsByAttribute;exports.findMatchingVariant=r.findMatchingVariant;exports.generateVariantDrafts=r.generateVariantDrafts;exports.getAvailableTermIdsForAttribute=r.getAvailableTermIdsForAttribute;exports.getVariantEffectivePriceRange=r.getVariantEffectivePriceRange;exports.mapRawVariantRelations=r.mapRawVariantRelations;exports.normalizeSelectionsToAvailableVariants=r.normalizeSelectionsToAvailableVariants;exports.resolveAttributeName=r.resolveAttributeName;exports.resolveTermValue=r.resolveTermValue;exports.resolveTranslatedText=r.resolveTranslatedText;
|
package/index.es.js
CHANGED
|
@@ -8,133 +8,134 @@ import { AddToCartButton as C } from "./lib/components/AddToCartButton.es.js";
|
|
|
8
8
|
import { ProductCard as x } from "./lib/components/ProductCard.es.js";
|
|
9
9
|
import { ProductGrid as g } from "./lib/components/ProductGrid.es.js";
|
|
10
10
|
import { ProductGallery as v } from "./lib/components/ProductGallery.es.js";
|
|
11
|
-
import { FeaturedProduct as
|
|
11
|
+
import { FeaturedProduct as T } from "./lib/components/FeaturedProduct.es.js";
|
|
12
12
|
import { CustomerProfileForm as D } from "./lib/components/CustomerProfileForm.es.js";
|
|
13
13
|
import { SubscriptionSelector as R } from "./lib/components/SubscriptionSelector.es.js";
|
|
14
14
|
import { InvoiceDocument as E } from "./lib/components/InvoiceDocument.es.js";
|
|
15
15
|
import { InvoiceViewerShell as L } from "./lib/components/InvoiceViewerShell.es.js";
|
|
16
16
|
import { FreemiusLicensePanel as z } from "./lib/components/FreemiusLicensePanel.es.js";
|
|
17
|
-
import { AccountNavigationMenu as
|
|
18
|
-
import { SimpleTiptapRenderer as M } from "./lib/components/SimpleTiptapRenderer.es.js";
|
|
17
|
+
import { AccountNavigationMenu as V } from "./lib/components/AccountNavigationMenu.es.js";
|
|
18
|
+
import { SimpleTiptapRenderer as M, toNoCookieEmbedSrc as _ } from "./lib/components/SimpleTiptapRenderer.es.js";
|
|
19
19
|
import { ProductForm as w } from "./lib/pages/cms/products/components/ProductForm.es.js";
|
|
20
20
|
import { ProductCategorySelector as U } from "./lib/pages/cms/products/components/ProductCategorySelector.es.js";
|
|
21
|
-
import { getCartItemActivePrice as
|
|
22
|
-
import { emptyProviderDiscounts as
|
|
23
|
-
import { CurrencyProvider as
|
|
24
|
-
import { CURRENCY_ROUNDING_MODES as
|
|
25
|
-
import { useCurrencyPreferenceStore as
|
|
26
|
-
import { useCart as Te, useIsCartHydrated as
|
|
27
|
-
import { addressesMatch as
|
|
28
|
-
import { DEFAULT_ENABLED_PAYMENT_PROVIDERS as
|
|
29
|
-
import { getTrialCheckoutMode as
|
|
30
|
-
import { aggregateOrderTaxLines as
|
|
31
|
-
import { DEFAULT_INVOICE_SETTINGS as
|
|
32
|
-
import { buildInvoiceDocumentLabels as
|
|
33
|
-
import { productSchema as
|
|
34
|
-
import { ProductProvider as
|
|
35
|
-
import { ProductDetailsLayout as
|
|
36
|
-
import { buildCombinationKey as
|
|
21
|
+
import { getCartItemActivePrice as K, useCartStore as Y, useCartSubtotal as q, useCartTotalItems as H } from "./lib/cart-store.es.js";
|
|
22
|
+
import { emptyProviderDiscounts as W, getCartLineCouponKey as j, normalizeCouponCode as Q } from "./lib/coupons.es.js";
|
|
23
|
+
import { CurrencyProvider as Z, useCurrency as $ } from "./lib/CurrencyProvider.es.js";
|
|
24
|
+
import { CURRENCY_ROUNDING_MODES as re, applyCurrencyRounding as oe, convertMinorUnitAmount as te, describeCurrencyRoundingRule as ae, getCurrencyLookup as ie, getDefaultCurrency as ne, getExchangeRateForCurrency as ce, inferCurrencyCodeFromLocale as me, isSaleWindowActive as ue, isScheduledPriceDue as le, normalizeCurrencyRecord as se, normalizeCurrencyRoundingMode as de, normalizePriceMap as pe, normalizeSalePriceMap as Ce, resolveEffectivePriceForCurrency as fe, resolvePriceForCurrency as xe, resolvePriceRangeForCurrency as Pe, sortCurrencies as ge } from "./lib/currency.es.js";
|
|
25
|
+
import { useCurrencyPreferenceStore as ve } from "./lib/currency-store.es.js";
|
|
26
|
+
import { useCart as Te, useIsCartHydrated as Ie } from "./lib/use-cart.es.js";
|
|
27
|
+
import { addressesMatch as be, emptyCustomerAddress as Re, isCustomerAddressComplete as Ae, normalizeCustomerAddress as Ee, normalizeOrderCustomerDetails as Fe } from "./lib/customer.es.js";
|
|
28
|
+
import { DEFAULT_ENABLED_PAYMENT_PROVIDERS as Oe, derivePaymentProviderFromProductType as ze, getProductPaymentProvider as Ne, isDigitalItem as Ve, isDigitalProduct as he, normalizeEnabledPaymentProviders as Me } from "./lib/types.es.js";
|
|
29
|
+
import { getTrialCheckoutMode as ke, getTrialLabel as we, getTrialPaymentRequirementLabel as Ge, getTrialPeriodDays as Ue, getTrialSummary as Be } from "./lib/trials.es.js";
|
|
30
|
+
import { aggregateOrderTaxLines as Ye, buildOrderTaxDetailsFromCalculation as qe, buildOrderTaxDetailsFromStripeSession as He, getOrderTaxRateJurisdiction as Je, getOrderTaxRateLabel as We, getOrderTaxRatePercentage as je, normalizeOrderTaxDetails as Qe } from "./lib/order-tax-details.es.js";
|
|
31
|
+
import { DEFAULT_INVOICE_SETTINGS as Ze, INVOICE_SETTINGS_KEY as $e, formatInvoiceCurrency as er, formatInvoiceDate as rr, getInvoiceAddressLines as or, normalizeInvoiceSettings as tr, serializeInvoiceSettings as ar } from "./lib/invoice.es.js";
|
|
32
|
+
import { buildInvoiceDocumentLabels as nr, getInvoiceLocale as cr, localizeInvoicePresentationData as mr, translateOrFallback as ur, translateOrderStatus as lr } from "./lib/invoice-ui.es.js";
|
|
33
|
+
import { productSchema as dr } from "./lib/product-schema.es.js";
|
|
34
|
+
import { ProductProvider as Cr, useProduct as fr } from "./lib/product-context.es.js";
|
|
35
|
+
import { ProductDetailsLayout as Pr } from "./lib/components/ProductDetailsLayout.es.js";
|
|
36
|
+
import { buildCombinationKey as yr, buildVariantLabel as vr, chooseInitialVariantSelections as Sr, extractSelectedTermsByAttribute as Tr, findMatchingVariant as Ir, generateVariantDrafts as Dr, getAvailableTermIdsForAttribute as br, getVariantEffectivePriceRange as Rr, mapRawVariantRelations as Ar, normalizeSelectionsToAvailableVariants as Er, resolveAttributeName as Fr, resolveTermValue as Lr, resolveTranslatedText as Or } from "./lib/variation-utils.es.js";
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
V as AccountNavigationMenu,
|
|
39
39
|
C as AddToCartButton,
|
|
40
|
-
|
|
40
|
+
re as CURRENCY_ROUNDING_MODES,
|
|
41
41
|
a as Cart,
|
|
42
42
|
o as CartDrawer,
|
|
43
43
|
m as CartIcon,
|
|
44
44
|
n as Checkout,
|
|
45
45
|
l as CouponForm,
|
|
46
|
-
|
|
46
|
+
Z as CurrencyProvider,
|
|
47
47
|
d as CurrencySwitcher,
|
|
48
48
|
D as CustomerProfileForm,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
Oe as DEFAULT_ENABLED_PAYMENT_PROVIDERS,
|
|
50
|
+
Ze as DEFAULT_INVOICE_SETTINGS,
|
|
51
|
+
T as FeaturedProduct,
|
|
52
52
|
z as FreemiusLicensePanel,
|
|
53
|
-
|
|
53
|
+
$e as INVOICE_SETTINGS_KEY,
|
|
54
54
|
E as InvoiceDocument,
|
|
55
55
|
L as InvoiceViewerShell,
|
|
56
56
|
x as ProductCard,
|
|
57
57
|
U as ProductCategorySelector,
|
|
58
|
-
|
|
58
|
+
Pr as ProductDetailsLayout,
|
|
59
59
|
w as ProductForm,
|
|
60
60
|
v as ProductGallery,
|
|
61
61
|
g as ProductGrid,
|
|
62
|
-
|
|
62
|
+
Cr as ProductProvider,
|
|
63
63
|
M as SimpleTiptapRenderer,
|
|
64
64
|
R as SubscriptionSelector,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
be as addressesMatch,
|
|
66
|
+
Ye as aggregateOrderTaxLines,
|
|
67
|
+
oe as applyCurrencyRounding,
|
|
68
|
+
yr as buildCombinationKey,
|
|
69
|
+
nr as buildInvoiceDocumentLabels,
|
|
70
|
+
qe as buildOrderTaxDetailsFromCalculation,
|
|
71
|
+
He as buildOrderTaxDetailsFromStripeSession,
|
|
72
|
+
vr as buildVariantLabel,
|
|
73
|
+
Sr as chooseInitialVariantSelections,
|
|
74
|
+
te as convertMinorUnitAmount,
|
|
75
|
+
ze as derivePaymentProviderFromProductType,
|
|
76
|
+
ae as describeCurrencyRoundingRule,
|
|
77
|
+
Re as emptyCustomerAddress,
|
|
78
|
+
W as emptyProviderDiscounts,
|
|
79
79
|
Tr as extractSelectedTermsByAttribute,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
80
|
+
Ir as findMatchingVariant,
|
|
81
|
+
er as formatInvoiceCurrency,
|
|
82
|
+
rr as formatInvoiceDate,
|
|
83
|
+
Dr as generateVariantDrafts,
|
|
84
|
+
br as getAvailableTermIdsForAttribute,
|
|
85
|
+
K as getCartItemActivePrice,
|
|
86
|
+
j as getCartLineCouponKey,
|
|
87
|
+
ie as getCurrencyLookup,
|
|
88
|
+
ne as getDefaultCurrency,
|
|
89
|
+
ce as getExchangeRateForCurrency,
|
|
90
|
+
or as getInvoiceAddressLines,
|
|
91
|
+
cr as getInvoiceLocale,
|
|
92
|
+
Je as getOrderTaxRateJurisdiction,
|
|
93
|
+
We as getOrderTaxRateLabel,
|
|
94
|
+
je as getOrderTaxRatePercentage,
|
|
95
|
+
Ne as getProductPaymentProvider,
|
|
96
|
+
ke as getTrialCheckoutMode,
|
|
97
97
|
we as getTrialLabel,
|
|
98
98
|
Ge as getTrialPaymentRequirementLabel,
|
|
99
99
|
Ue as getTrialPeriodDays,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
Be as getTrialSummary,
|
|
101
|
+
Rr as getVariantEffectivePriceRange,
|
|
102
|
+
me as inferCurrencyCodeFromLocale,
|
|
103
|
+
Ae as isCustomerAddressComplete,
|
|
104
104
|
Ve as isDigitalItem,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
ur as
|
|
105
|
+
he as isDigitalProduct,
|
|
106
|
+
ue as isSaleWindowActive,
|
|
107
|
+
le as isScheduledPriceDue,
|
|
108
|
+
mr as localizeInvoicePresentationData,
|
|
109
|
+
Ar as mapRawVariantRelations,
|
|
110
|
+
Q as normalizeCouponCode,
|
|
111
|
+
se as normalizeCurrencyRecord,
|
|
112
|
+
de as normalizeCurrencyRoundingMode,
|
|
113
|
+
Ee as normalizeCustomerAddress,
|
|
114
|
+
Me as normalizeEnabledPaymentProviders,
|
|
115
|
+
tr as normalizeInvoiceSettings,
|
|
116
|
+
Fe as normalizeOrderCustomerDetails,
|
|
117
|
+
Qe as normalizeOrderTaxDetails,
|
|
118
|
+
pe as normalizePriceMap,
|
|
119
|
+
Ce as normalizeSalePriceMap,
|
|
120
|
+
Er as normalizeSelectionsToAvailableVariants,
|
|
121
|
+
dr as productSchema,
|
|
122
|
+
Fr as resolveAttributeName,
|
|
123
|
+
fe as resolveEffectivePriceForCurrency,
|
|
124
|
+
xe as resolvePriceForCurrency,
|
|
125
|
+
Pe as resolvePriceRangeForCurrency,
|
|
126
|
+
Lr as resolveTermValue,
|
|
127
|
+
Or as resolveTranslatedText,
|
|
128
|
+
ar as serializeInvoiceSettings,
|
|
129
|
+
ge as sortCurrencies,
|
|
130
|
+
_ as toNoCookieEmbedSrc,
|
|
131
|
+
ur as translateOrFallback,
|
|
132
|
+
lr as translateOrderStatus,
|
|
132
133
|
Te as useCart,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
Y as useCartStore,
|
|
135
|
+
q as useCartSubtotal,
|
|
136
|
+
H as useCartTotalItems,
|
|
137
|
+
$ as useCurrency,
|
|
138
|
+
ve as useCurrencyPreferenceStore,
|
|
139
|
+
Ie as useIsCartHydrated,
|
|
140
|
+
fr as useProduct
|
|
140
141
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-dev-runtime"),n=require("react"),h=require("@nextblock-cms/utils"),f=require("./currency.cjs.js"),v=require("./currency-store.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-dev-runtime"),n=require("react"),h=require("@nextblock-cms/utils"),f=require("./currency.cjs.js"),v=require("./currency-store.cjs.js"),q=require("./currency-constants.cjs.js"),b=n.createContext(null);function S(o){return f.sortCurrencies(o.filter(r=>r.is_active!==!1))}function z(o){const{currencies:r,storedCurrencyCode:C,hasHydrated:y,initialCurrencyCode:t,locale:l}=o,u=new Set(r.map(a=>h.normalizeCurrencyCode(a.code))),d=f.getDefaultCurrency(r),s=t?h.normalizeCurrencyCode(t):null,e=C?h.normalizeCurrencyCode(C):null;if(y&&e&&u.has(e))return e;if(s&&u.has(s))return s;const i=f.inferCurrencyCodeFromLocale(l,r);return u.has(i)?i:d.code}function M({children:o,initialCurrencies:r,initialCurrencyCode:C,locale:y}){const[t,l]=n.useState(()=>S(r)),u=v.useCurrencyPreferenceStore(c=>c.activeCurrencyCode),d=v.useCurrencyPreferenceStore(c=>c.hasHydrated),s=v.useCurrencyPreferenceStore(c=>c.setActiveCurrencyCode);n.useEffect(()=>{v.useCurrencyPreferenceStore.persist.rehydrate()},[]),n.useEffect(()=>{r.length>0&&l(S(r))},[r]),n.useEffect(()=>{if(r.length>0)return;async function c(){const{fetchActiveCurrenciesFromRest:m}=await Promise.resolve().then(()=>require("./currency-rest-client.cjs.js")),x=await m();x.length>0&&l(S(x.map(P=>f.normalizeCurrencyRecord(P))))}c()},[r.length]);const e=n.useMemo(()=>z({currencies:t,storedCurrencyCode:u,hasHydrated:d,initialCurrencyCode:C,locale:y}),[t,u,d,C,y]);n.useEffect(()=>{e&&u!==e&&s(e)},[e,s,u]),n.useEffect(()=>{!e||typeof document>"u"||(document.cookie=`${q.CURRENCY_COOKIE_NAME}=${e}; Path=/; Max-Age=31536000; SameSite=Lax`)},[e]);const i=n.useMemo(()=>f.getDefaultCurrency(t),[t]),a=n.useMemo(()=>t.find(c=>c.code===e)??i,[t,i,e]),g=n.useMemo(()=>({currencies:t,defaultCurrency:i,activeCurrency:a,activeCurrencyCode:a.code,isHydrated:d,setActiveCurrencyCode:c=>{const m=h.normalizeCurrencyCode(c);t.some(P=>P.code===m)&&s(m)}}),[a,t,i,d,s]);return E.jsxDEV(b.Provider,{value:g,children:o},void 0,!1,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/CurrencyProvider.tsx",lineNumber:192,columnNumber:5},this)}function p(){const o=n.useContext(b);if(!o)throw new Error("useCurrency must be used inside a CurrencyProvider");return o}exports.CurrencyProvider=M;exports.useCurrency=p;
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
import { jsxDEV as A } from "react/jsx-dev-runtime";
|
|
3
3
|
import { createContext as E, useState as w, useEffect as a, useMemo as l, useContext as N } from "react";
|
|
4
4
|
import { normalizeCurrencyCode as h } from "@nextblock-cms/utils";
|
|
5
|
-
import { getDefaultCurrency as
|
|
5
|
+
import { getDefaultCurrency as g, sortCurrencies as z, normalizeCurrencyRecord as H, inferCurrencyCodeFromLocale as R } from "./currency.es.js";
|
|
6
6
|
import { useCurrencyPreferenceStore as v } from "./currency-store.es.js";
|
|
7
|
-
import { CURRENCY_COOKIE_NAME as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
7
|
+
import { CURRENCY_COOKIE_NAME as D } from "./currency-constants.es.js";
|
|
8
|
+
const P = E(null);
|
|
9
|
+
function b(n) {
|
|
10
10
|
return z(
|
|
11
11
|
n.filter((r) => r.is_active !== !1)
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function M(n) {
|
|
15
15
|
const { currencies: r, storedCurrencyCode: i, hasHydrated: f, initialCurrencyCode: t, locale: m } = n, c = new Set(
|
|
16
16
|
r.map((C) => h(C.code))
|
|
17
|
-
), d =
|
|
17
|
+
), d = g(r), s = t ? h(t) : null, e = i ? h(i) : null;
|
|
18
18
|
if (f && e && c.has(e))
|
|
19
19
|
return e;
|
|
20
20
|
if (s && c.has(s))
|
|
@@ -22,14 +22,14 @@ function D(n) {
|
|
|
22
22
|
const u = R(m, r);
|
|
23
23
|
return c.has(u) ? u : d.code;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function $({
|
|
26
26
|
children: n,
|
|
27
27
|
initialCurrencies: r,
|
|
28
28
|
initialCurrencyCode: i,
|
|
29
29
|
locale: f
|
|
30
30
|
}) {
|
|
31
31
|
const [t, m] = w(
|
|
32
|
-
() =>
|
|
32
|
+
() => b(r)
|
|
33
33
|
), c = v(
|
|
34
34
|
(o) => o.activeCurrencyCode
|
|
35
35
|
), d = v((o) => o.hasHydrated), s = v(
|
|
@@ -38,20 +38,20 @@ function U({
|
|
|
38
38
|
a(() => {
|
|
39
39
|
v.persist.rehydrate();
|
|
40
40
|
}, []), a(() => {
|
|
41
|
-
r.length > 0 && m(
|
|
41
|
+
r.length > 0 && m(b(r));
|
|
42
42
|
}, [r]), a(() => {
|
|
43
43
|
if (r.length > 0)
|
|
44
44
|
return;
|
|
45
45
|
async function o() {
|
|
46
|
-
const { fetchActiveCurrenciesFromRest: y } = await import("./currency-rest-client.es.js"),
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
const { fetchActiveCurrenciesFromRest: y } = await import("./currency-rest-client.es.js"), x = await y();
|
|
47
|
+
x.length > 0 && m(
|
|
48
|
+
b(x.map((p) => H(p)))
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
o();
|
|
52
52
|
}, [r.length]);
|
|
53
53
|
const e = l(
|
|
54
|
-
() =>
|
|
54
|
+
() => M({
|
|
55
55
|
currencies: t,
|
|
56
56
|
storedCurrencyCode: c,
|
|
57
57
|
hasHydrated: d,
|
|
@@ -63,15 +63,15 @@ function U({
|
|
|
63
63
|
a(() => {
|
|
64
64
|
e && c !== e && s(e);
|
|
65
65
|
}, [e, s, c]), a(() => {
|
|
66
|
-
!e || typeof document > "u" || (document.cookie = `${
|
|
66
|
+
!e || typeof document > "u" || (document.cookie = `${D}=${e}; Path=/; Max-Age=31536000; SameSite=Lax`);
|
|
67
67
|
}, [e]);
|
|
68
68
|
const u = l(
|
|
69
|
-
() =>
|
|
69
|
+
() => g(t),
|
|
70
70
|
[t]
|
|
71
71
|
), C = l(
|
|
72
72
|
() => t.find((o) => o.code === e) ?? u,
|
|
73
73
|
[t, u, e]
|
|
74
|
-
),
|
|
74
|
+
), S = l(
|
|
75
75
|
() => ({
|
|
76
76
|
currencies: t,
|
|
77
77
|
defaultCurrency: u,
|
|
@@ -80,24 +80,24 @@ function U({
|
|
|
80
80
|
isHydrated: d,
|
|
81
81
|
setActiveCurrencyCode: (o) => {
|
|
82
82
|
const y = h(o);
|
|
83
|
-
t.some((
|
|
83
|
+
t.some((p) => p.code === y) && s(y);
|
|
84
84
|
}
|
|
85
85
|
}),
|
|
86
86
|
[C, t, u, d, s]
|
|
87
87
|
);
|
|
88
|
-
return /* @__PURE__ */ A(
|
|
89
|
-
fileName: "
|
|
88
|
+
return /* @__PURE__ */ A(P.Provider, { value: S, children: n }, void 0, !1, {
|
|
89
|
+
fileName: "D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/CurrencyProvider.tsx",
|
|
90
90
|
lineNumber: 192,
|
|
91
91
|
columnNumber: 5
|
|
92
92
|
}, this);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
const n = N(
|
|
94
|
+
function j() {
|
|
95
|
+
const n = N(P);
|
|
96
96
|
if (!n)
|
|
97
97
|
throw new Error("useCurrency must be used inside a CurrencyProvider");
|
|
98
98
|
return n;
|
|
99
99
|
}
|
|
100
100
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
$ as CurrencyProvider,
|
|
102
|
+
j as useCurrency
|
|
103
103
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-dev-runtime"),b=require("next/link"),d=require("next/navigation"),a=require("lucide-react"),i=require("@nextblock-cms/utils");function u(n,c,o){const s=n(c);return s===c?o:s}function x(n){return n==="password"?a.KeyRound:a.Package2}function N({links:n,title:c,className:o}){const s=d.usePathname(),{t:r}=i.useTranslations();return n.length?t.jsxDEV("div",{className:i.cn("w-full space-y-3",o),children:[t.jsxDEV("div",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:c||u(r,"account_navigation","Account")},void 0,!1,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",lineNumber:55,columnNumber:7},this),t.jsxDEV("div",{className:"space-y-2",children:n.map(e=>{const l=x(e.icon),m=s===e.href||s.startsWith(`${e.href}/`);return t.jsxDEV(b,{href:e.href,className:i.cn("flex items-center gap-3 rounded-xl border px-3 py-2.5 text-sm font-medium transition-colors",m?"border-slate-900 bg-slate-900 text-white":"border-border bg-background hover:bg-muted/40"),children:[t.jsxDEV(l,{className:"h-4 w-4 shrink-0"},void 0,!1,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",lineNumber:76,columnNumber:15},this),t.jsxDEV("span",{children:u(r,e.labelKey,e.fallbackLabel)},void 0,!1,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",lineNumber:77,columnNumber:15},this)]},e.href,!0,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",lineNumber:66,columnNumber:13},this)})},void 0,!1,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",lineNumber:59,columnNumber:7},this)]},void 0,!0,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",lineNumber:54,columnNumber:5},this):null}exports.AccountNavigationMenu=N;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxDEV as
|
|
2
|
+
import { jsxDEV as n } from "react/jsx-dev-runtime";
|
|
3
3
|
import u from "next/link";
|
|
4
4
|
import { usePathname as b } from "next/navigation";
|
|
5
5
|
import { KeyRound as d, Package2 as f } from "lucide-react";
|
|
6
6
|
import { useTranslations as N, cn as i } from "@nextblock-cms/utils";
|
|
7
|
-
function a(
|
|
8
|
-
const
|
|
9
|
-
return
|
|
7
|
+
function a(t, s, c) {
|
|
8
|
+
const o = t(s);
|
|
9
|
+
return o === s ? c : o;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function x(t) {
|
|
12
|
+
return t === "password" ? d : f;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
links:
|
|
16
|
-
title:
|
|
17
|
-
className:
|
|
14
|
+
function D({
|
|
15
|
+
links: t,
|
|
16
|
+
title: s,
|
|
17
|
+
className: c
|
|
18
18
|
}) {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
fileName: "
|
|
19
|
+
const o = b(), { t: r } = N();
|
|
20
|
+
return t.length ? /* @__PURE__ */ n("div", { className: i("w-full space-y-3", c), children: [
|
|
21
|
+
/* @__PURE__ */ n("div", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: s || a(r, "account_navigation", "Account") }, void 0, !1, {
|
|
22
|
+
fileName: "D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",
|
|
23
23
|
lineNumber: 55,
|
|
24
24
|
columnNumber: 7
|
|
25
25
|
}, this),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
const m =
|
|
28
|
-
return /* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: t.map((e) => {
|
|
27
|
+
const m = x(e.icon), l = o === e.href || o.startsWith(`${e.href}/`);
|
|
28
|
+
return /* @__PURE__ */ n(
|
|
29
29
|
u,
|
|
30
30
|
{
|
|
31
31
|
href: e.href,
|
|
@@ -34,13 +34,13 @@ function A({
|
|
|
34
34
|
l ? "border-slate-900 bg-slate-900 text-white" : "border-border bg-background hover:bg-muted/40"
|
|
35
35
|
),
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
fileName: "
|
|
37
|
+
/* @__PURE__ */ n(m, { className: "h-4 w-4 shrink-0" }, void 0, !1, {
|
|
38
|
+
fileName: "D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",
|
|
39
39
|
lineNumber: 76,
|
|
40
40
|
columnNumber: 15
|
|
41
41
|
}, this),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
fileName: "
|
|
42
|
+
/* @__PURE__ */ n("span", { children: a(r, e.labelKey, e.fallbackLabel) }, void 0, !1, {
|
|
43
|
+
fileName: "D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",
|
|
44
44
|
lineNumber: 77,
|
|
45
45
|
columnNumber: 15
|
|
46
46
|
}, this)
|
|
@@ -49,23 +49,23 @@ function A({
|
|
|
49
49
|
e.href,
|
|
50
50
|
!0,
|
|
51
51
|
{
|
|
52
|
-
fileName: "
|
|
52
|
+
fileName: "D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",
|
|
53
53
|
lineNumber: 66,
|
|
54
54
|
columnNumber: 13
|
|
55
55
|
},
|
|
56
56
|
this
|
|
57
57
|
);
|
|
58
58
|
}) }, void 0, !1, {
|
|
59
|
-
fileName: "
|
|
59
|
+
fileName: "D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",
|
|
60
60
|
lineNumber: 59,
|
|
61
61
|
columnNumber: 7
|
|
62
62
|
}, this)
|
|
63
63
|
] }, void 0, !0, {
|
|
64
|
-
fileName: "
|
|
64
|
+
fileName: "D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AccountNavigationMenu.tsx",
|
|
65
65
|
lineNumber: 54,
|
|
66
66
|
columnNumber: 5
|
|
67
67
|
}, this) : null;
|
|
68
68
|
}
|
|
69
69
|
export {
|
|
70
|
-
|
|
70
|
+
D as AccountNavigationMenu
|
|
71
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-dev-runtime"),r=require("@nextblock-cms/ui/button"),o=require("lucide-react"),c=require("sonner"),C=require("next/link"),k=require("../use-cart.cjs.js"),g=require("@nextblock-cms/utils"),m=require("../types.cjs.js"),h=require("../CurrencyProvider.cjs.js"),D=({product:e,className:n,quantity:d})=>{const a=k.useCart(i=>i),{t:s}=g.useTranslations(),{activeCurrencyCode:u}=h.useCurrency(),l=m.isDigitalProduct(e),b=!!e.has_variants&&!e.variant_id&&!l,_=!l&&typeof e.stock=="number"&&e.stock<=0;if(b)return t.jsxDEV(r.Button,{asChild:!0,className:n,children:t.jsxDEV(C,{href:`/product/${e.slug}`,children:"Select Options"},void 0,!1,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AddToCartButton.tsx",lineNumber:37,columnNumber:9},void 0)},void 0,!1,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AddToCartButton.tsx",lineNumber:36,columnNumber:7},void 0);if(_){const i=s("ecommerce.out_of_stock");return t.jsxDEV(r.Button,{disabled:!0,className:n,children:[t.jsxDEV(o.ShoppingCart,{className:"mr-2 h-4 w-4"},void 0,!1,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AddToCartButton.tsx",lineNumber:47,columnNumber:9},void 0),i==="ecommerce.out_of_stock"?"Out of stock":i]},void 0,!0,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AddToCartButton.tsx",lineNumber:46,columnNumber:7},void 0)}if(!a)return t.jsxDEV(r.Button,{disabled:!0,className:n,children:[t.jsxDEV(o.ShoppingCart,{className:"mr-2 h-4 w-4"},void 0,!1,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AddToCartButton.tsx",lineNumber:58,columnNumber:9},void 0),s("ecommerce.add_to_cart")]},void 0,!0,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AddToCartButton.tsx",lineNumber:57,columnNumber:7},void 0);const{addItem:f}=a,x=()=>{const i=m.getProductPaymentProvider(e)??"stripe",{success:v,error:N}=f({id:e.variant_id||e.id,product_id:e.id,title:e.title,price:e.price,prices:e.prices,sale_price:e.sale_price,sale_prices:e.sale_prices,is_taxable:e.is_taxable,image_url:e.image_url,slug:e.slug,sku:e.sku,stock:e.stock,language_id:e.language_id,translation_group_id:e.translation_group_id,product_type:e.product_type,payment_provider:e.payment_provider??i,provider:i,freemius_product_id:e.freemius_product_id,freemius_plan_id:e.freemius_plan_id,trial_period_days:e.trial_period_days??0,trial_requires_payment_method:e.trial_requires_payment_method??!1,has_variants:e.has_variants,variant_id:e.variant_id,variant_label:e.variant_label,selected_options:e.selected_options,currency_code:u,quantity:d});v?c.toast.success(s("ecommerce.added_to_cart_success",{item:e.title})):c.toast.error(N||s("ecommerce.added_to_cart_error"))};return t.jsxDEV(r.Button,{onClick:x,className:n,children:[t.jsxDEV(o.ShoppingCart,{className:"mr-2 h-4 w-4"},void 0,!1,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AddToCartButton.tsx",lineNumber:108,columnNumber:7},void 0),s("ecommerce.add_to_cart")]},void 0,!0,{fileName:"D:/Websites/nextblock-sandbox/libs/ecommerce/src/lib/components/AddToCartButton.tsx",lineNumber:107,columnNumber:5},void 0)};exports.AddToCartButton=D;
|