@nextblock-cms/ecom 0.20.3 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -0
- package/_virtual/_rolldown/runtime.cjs +1 -0
- package/index.cjs +1 -0
- package/index.es.js +38 -146
- package/lib/CurrencyProvider.cjs +1 -0
- package/lib/CurrencyProvider.d.ts +1 -1
- package/lib/CurrencyProvider.es.js +85 -95
- package/lib/PaymentReadinessProvider.cjs +1 -0
- package/lib/PaymentReadinessProvider.d.ts +1 -1
- package/lib/PaymentReadinessProvider.es.js +24 -27
- package/lib/cart-store.cjs +1 -0
- package/lib/cart-store.es.js +109 -121
- package/lib/components/AccountNavigationMenu.cjs +1 -0
- package/lib/components/AccountNavigationMenu.d.ts +1 -1
- package/lib/components/AccountNavigationMenu.es.js +36 -50
- package/lib/components/AddToCartButton.cjs +1 -0
- package/lib/components/AddToCartButton.d.ts +1 -1
- package/lib/components/AddToCartButton.es.js +94 -89
- package/lib/components/Cart.cjs +1 -0
- package/lib/components/Cart.d.ts +1 -1
- package/lib/components/Cart.es.js +261 -180
- package/lib/components/CartDrawer.cjs +1 -0
- package/lib/components/CartDrawer.d.ts +1 -1
- package/lib/components/CartDrawer.es.js +218 -148
- package/lib/components/CartIcon.cjs +1 -0
- package/lib/components/CartIcon.d.ts +1 -1
- package/lib/components/CartIcon.es.js +33 -35
- package/lib/components/Checkout.cjs +1 -0
- package/lib/components/Checkout.d.ts +1 -1
- package/lib/components/Checkout.es.js +1092 -1108
- package/lib/components/CouponForm.cjs +1 -0
- package/lib/components/CouponForm.d.ts +1 -1
- package/lib/components/CouponForm.es.js +136 -148
- package/lib/components/CurrencySwitcher.cjs +1 -0
- package/lib/components/CurrencySwitcher.d.ts +1 -1
- package/lib/components/CurrencySwitcher.es.js +22 -18
- package/lib/components/CustomerProfileForm.cjs +1 -0
- package/lib/components/CustomerProfileForm.es.js +454 -313
- package/lib/components/FeaturedProduct.cjs +1 -0
- package/lib/components/FeaturedProduct.d.ts +1 -1
- package/lib/components/FeaturedProduct.es.js +98 -83
- package/lib/components/FreemiusLicensePanel.cjs +1 -0
- package/lib/components/FreemiusLicensePanel.d.ts +1 -1
- package/lib/components/FreemiusLicensePanel.es.js +70 -65
- package/lib/components/InvoiceDocument.cjs +1 -0
- package/lib/components/InvoiceDocument.es.js +256 -192
- package/lib/components/InvoiceViewerShell.cjs +29 -0
- package/lib/components/InvoiceViewerShell.d.ts +1 -1
- package/lib/components/InvoiceViewerShell.es.js +75 -106
- package/lib/components/ProductCard.cjs +1 -0
- package/lib/components/ProductCard.d.ts +1 -1
- package/lib/components/ProductCard.es.js +186 -171
- package/lib/components/ProductDetailsLayout.cjs +1 -0
- package/lib/components/ProductDetailsLayout.es.js +405 -404
- package/lib/components/ProductGallery.cjs +1 -0
- package/lib/components/ProductGallery.d.ts +1 -1
- package/lib/components/ProductGallery.es.js +51 -54
- package/lib/components/ProductGrid.cjs +1 -0
- package/lib/components/ProductGrid.d.ts +1 -1
- package/lib/components/ProductGrid.es.js +23 -25
- package/lib/components/ShippingEstimator.cjs +1 -0
- package/lib/components/ShippingEstimator.d.ts +1 -1
- package/lib/components/ShippingEstimator.es.js +158 -153
- package/lib/components/ShortDescription.cjs +1 -0
- package/lib/components/ShortDescription.es.js +17 -17
- package/lib/components/SimpleTiptapRenderer.cjs +1 -0
- package/lib/components/SimpleTiptapRenderer.es.js +238 -211
- package/lib/components/SubscriptionSelector.cjs +1 -0
- package/lib/components/SubscriptionSelector.es.js +159 -154
- package/lib/countries.cjs +1 -0
- package/lib/countries.es.js +232 -75
- package/lib/coupon-server.cjs +1 -0
- package/lib/coupon-server.es.js +180 -224
- package/lib/coupons.cjs +1 -0
- package/lib/coupons.es.js +12 -14
- package/lib/currency-constants.cjs +1 -0
- package/lib/currency-constants.es.js +4 -4
- package/lib/currency-rest-client.cjs +1 -0
- package/lib/currency-rest-client.es.js +15 -22
- package/lib/currency-store.cjs +1 -0
- package/lib/currency-store.es.js +20 -27
- package/lib/currency-sync.cjs +1 -0
- package/lib/currency-sync.es.js +124 -170
- package/lib/currency.cjs +1 -0
- package/lib/currency.es.js +242 -310
- package/lib/customer-addresses.cjs +1 -0
- package/lib/customer-addresses.es.js +80 -109
- package/lib/customer-orders.cjs +1 -0
- package/lib/customer-orders.es.js +31 -43
- package/lib/customer.cjs +1 -0
- package/lib/customer.es.js +43 -52
- package/lib/export-helpers.cjs +1 -0
- package/lib/export-helpers.es.js +53 -52
- package/lib/factory.cjs +1 -0
- package/lib/factory.es.js +10 -7
- package/lib/freemius-coupons.cjs +1 -0
- package/lib/freemius-coupons.es.js +245 -262
- package/lib/freemius-license-claim.cjs +1 -0
- package/lib/freemius-license-claim.es.js +87 -71
- package/lib/freemius-license.cjs +1 -0
- package/lib/freemius-license.es.js +32 -39
- package/lib/freemius-order-sync.cjs +1 -0
- package/lib/freemius-order-sync.es.js +226 -290
- package/lib/freemius-trial-provision.cjs +1 -0
- package/lib/freemius-trial-provision.es.js +136 -130
- package/lib/inventory-settings.cjs +1 -0
- package/lib/inventory-settings.es.js +69 -77
- package/lib/invoice-server.cjs +33 -0
- package/lib/invoice-server.es.js +94 -141
- package/lib/invoice-ui.cjs +1 -0
- package/lib/invoice-ui.es.js +50 -66
- package/lib/invoice.cjs +1 -0
- package/lib/invoice.es.js +85 -94
- package/lib/order-inventory.cjs +61 -0
- package/lib/order-inventory.es.js +67 -79
- package/lib/order-tax-details.cjs +1 -0
- package/lib/order-tax-details.es.js +142 -153
- package/lib/pages/cms/coupons/CouponEditorForm.cjs +1 -0
- package/lib/pages/cms/coupons/CouponEditorForm.d.ts +1 -1
- package/lib/pages/cms/coupons/CouponEditorForm.es.js +227 -185
- package/lib/pages/cms/coupons/CouponsPage.cjs +5 -0
- package/lib/pages/cms/coupons/CouponsPage.d.ts +1 -1
- package/lib/pages/cms/coupons/CouponsPage.es.js +235 -166
- package/lib/pages/cms/coupons/CreateCouponDialog.cjs +1 -0
- package/lib/pages/cms/coupons/CreateCouponDialog.d.ts +1 -1
- package/lib/pages/cms/coupons/CreateCouponDialog.es.js +35 -34
- package/lib/pages/cms/coupons/EditCouponPage.cjs +1 -0
- package/lib/pages/cms/coupons/EditCouponPage.d.ts +1 -1
- package/lib/pages/cms/coupons/EditCouponPage.es.js +47 -47
- package/lib/pages/cms/coupons/ProductScopePicker.cjs +1 -0
- package/lib/pages/cms/coupons/ProductScopePicker.d.ts +1 -1
- package/lib/pages/cms/coupons/ProductScopePicker.es.js +128 -117
- package/lib/pages/cms/coupons/actions.cjs +1 -0
- package/lib/pages/cms/coupons/actions.es.js +112 -115
- package/lib/pages/cms/coupons/index.cjs +1 -0
- package/lib/pages/cms/coupons/index.es.js +3 -0
- package/lib/pages/cms/coupons/product-options.cjs +1 -0
- package/lib/pages/cms/coupons/product-options.es.js +21 -23
- package/lib/pages/cms/orders/ExportReportsDialog.cjs +1 -0
- package/lib/pages/cms/orders/ExportReportsDialog.es.js +135 -129
- package/lib/pages/cms/orders/MarkPaidButton.d.ts +1 -1
- package/lib/pages/cms/orders/OrderDetailPage.cjs +1 -0
- package/lib/pages/cms/orders/OrderDetailPage.d.ts +1 -1
- package/lib/pages/cms/orders/OrderDetailPage.es.js +186 -134
- package/lib/pages/cms/orders/OrderPrintButton.cjs +1 -0
- package/lib/pages/cms/orders/OrderPrintButton.d.ts +1 -1
- package/lib/pages/cms/orders/OrderPrintButton.es.js +15 -21
- package/lib/pages/cms/orders/OrderStatusForm.cjs +1 -0
- package/lib/pages/cms/orders/OrderStatusForm.d.ts +1 -1
- package/lib/pages/cms/orders/OrderStatusForm.es.js +85 -69
- package/lib/pages/cms/orders/OrdersPage.cjs +1 -0
- package/lib/pages/cms/orders/OrdersPage.d.ts +1 -1
- package/lib/pages/cms/orders/OrdersPage.es.js +170 -102
- package/lib/pages/cms/orders/actions.cjs +7 -0
- package/lib/pages/cms/orders/actions.es.js +53 -69
- package/lib/pages/cms/orders/export-actions.cjs +1 -0
- package/lib/pages/cms/orders/export-actions.es.js +23 -26
- package/lib/pages/cms/orders/index.cjs +1 -0
- package/lib/pages/cms/orders/index.es.js +6 -0
- package/lib/pages/cms/orders/server-actions.cjs +1 -0
- package/lib/pages/cms/orders/server-actions.es.js +60 -51
- package/lib/pages/cms/payments/PaymentsClient.cjs +1 -0
- package/lib/pages/cms/payments/PaymentsClient.d.ts +1 -1
- package/lib/pages/cms/payments/PaymentsClient.es.js +316 -346
- package/lib/pages/cms/payments/PaymentsPage.cjs +1 -0
- package/lib/pages/cms/payments/PaymentsPage.d.ts +1 -1
- package/lib/pages/cms/payments/PaymentsPage.es.js +29 -32
- package/lib/pages/cms/payments/actions.cjs +1 -0
- package/lib/pages/cms/payments/actions.es.js +38 -48
- package/lib/pages/cms/payments/index.cjs +1 -0
- package/lib/pages/cms/payments/index.es.js +3 -0
- package/lib/pages/cms/payments/queries.cjs +1 -0
- package/lib/pages/cms/payments/queries.es.js +38 -48
- package/lib/pages/cms/products/ProductsPage.cjs +1 -0
- package/lib/pages/cms/products/ProductsPage.d.ts +1 -1
- package/lib/pages/cms/products/ProductsPage.es.js +63 -66
- package/lib/pages/cms/products/[id]/edit/EditProductPage.cjs +1 -0
- package/lib/pages/cms/products/[id]/edit/EditProductPage.d.ts +1 -1
- package/lib/pages/cms/products/[id]/edit/EditProductPage.es.js +139 -0
- package/lib/pages/cms/products/actions.cjs +44 -0
- package/lib/pages/cms/products/actions.es.js +121 -162
- package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs +1 -0
- package/lib/pages/cms/products/attributes/AttributeManagementPage.d.ts +1 -1
- package/lib/pages/cms/products/attributes/AttributeManagementPage.es.js +55 -47
- package/lib/pages/cms/products/attributes/components/AttributeManager.cjs +1 -0
- package/lib/pages/cms/products/attributes/components/AttributeManager.d.ts +1 -1
- package/lib/pages/cms/products/attributes/components/AttributeManager.es.js +285 -290
- package/lib/pages/cms/products/categories/CategoryManagementPage.cjs +1 -0
- package/lib/pages/cms/products/categories/CategoryManagementPage.d.ts +1 -1
- package/lib/pages/cms/products/categories/CategoryManagementPage.es.js +43 -35
- package/lib/pages/cms/products/categories/components/CategoryManager.cjs +1 -0
- package/lib/pages/cms/products/categories/components/CategoryManager.es.js +315 -262
- package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs +1 -0
- package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +115 -113
- package/lib/pages/cms/products/components/CurrencyPriceFields.cjs +1 -0
- package/lib/pages/cms/products/components/CurrencyPriceFields.d.ts +1 -1
- package/lib/pages/cms/products/components/CurrencyPriceFields.es.js +136 -145
- package/lib/pages/cms/products/components/DeleteProductButton.cjs +1 -0
- package/lib/pages/cms/products/components/DeleteProductButton.d.ts +1 -1
- package/lib/pages/cms/products/components/DeleteProductButton.es.js +35 -47
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs +1 -0
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.d.ts +1 -1
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.es.js +106 -84
- package/lib/pages/cms/products/components/ProductCategorySelector.cjs +1 -0
- package/lib/pages/cms/products/components/ProductCategorySelector.es.js +156 -159
- package/lib/pages/cms/products/components/ProductForm.cjs +1 -0
- package/lib/pages/cms/products/components/ProductForm.es.js +872 -693
- package/lib/pages/cms/products/components/ProductMediaManager.cjs +1 -0
- package/lib/pages/cms/products/components/ProductMediaManager.es.js +106 -103
- package/lib/pages/cms/products/components/ProductsBulkTable.cjs +1 -0
- package/lib/pages/cms/products/components/ProductsBulkTable.d.ts +1 -1
- package/lib/pages/cms/products/components/ProductsBulkTable.es.js +303 -294
- package/lib/pages/cms/products/components/SaleScheduleFields.cjs +1 -0
- package/lib/pages/cms/products/components/SaleScheduleFields.d.ts +1 -1
- package/lib/pages/cms/products/components/SaleScheduleFields.es.js +111 -134
- package/lib/pages/cms/products/components/SyncFreemiusButton.cjs +1 -0
- package/lib/pages/cms/products/components/SyncFreemiusButton.d.ts +1 -1
- package/lib/pages/cms/products/components/SyncFreemiusButton.es.js +29 -35
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs +5 -0
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.d.ts +1 -1
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.es.js +36 -48
- package/lib/pages/cms/products/components/SyncProductForm.d.ts +1 -1
- package/lib/pages/cms/products/components/VariationsEditor.cjs +1 -0
- package/lib/pages/cms/products/components/VariationsEditor.d.ts +1 -1
- package/lib/pages/cms/products/components/VariationsEditor.es.js +396 -405
- package/lib/pages/cms/products/index.cjs +1 -0
- package/lib/pages/cms/products/index.es.js +8 -0
- package/lib/pages/cms/products/inventory/InventoryPage.cjs +1 -0
- package/lib/pages/cms/products/inventory/InventoryPage.d.ts +1 -1
- package/lib/pages/cms/products/inventory/InventoryPage.es.js +21 -15
- package/lib/pages/cms/products/inventory/InventoryTableClient.cjs +2 -0
- package/lib/pages/cms/products/inventory/InventoryTableClient.d.ts +1 -1
- package/lib/pages/cms/products/inventory/InventoryTableClient.es.js +230 -209
- package/lib/pages/cms/products/inventory/actions.cjs +3 -0
- package/lib/pages/cms/products/inventory/actions.es.js +83 -91
- package/lib/pages/cms/products/new/NewProductPage.cjs +1 -0
- package/lib/pages/cms/products/new/NewProductPage.d.ts +1 -1
- package/lib/pages/cms/products/new/NewProductPage.es.js +58 -74
- package/lib/pages/cms/products/product-price-sync.cjs +1 -0
- package/lib/pages/cms/products/product-price-sync.es.js +74 -89
- package/lib/pages/cms/products/server-actions.cjs +1 -0
- package/lib/pages/cms/products/server-actions.es.js +250 -233
- package/lib/pages/cms/shipping/ShippingPage.cjs +5 -0
- package/lib/pages/cms/shipping/ShippingPage.es.js +287 -209
- package/lib/pages/cms/shipping/components/RateForm.cjs +1 -0
- package/lib/pages/cms/shipping/components/RateForm.d.ts +1 -1
- package/lib/pages/cms/shipping/components/RateForm.es.js +439 -436
- package/lib/pages/cms/shipping/components/ZoneForm.cjs +1 -0
- package/lib/pages/cms/shipping/components/ZoneForm.es.js +245 -224
- package/lib/pages/cms/shipping/index.cjs +1 -0
- package/lib/pages/cms/shipping/index.es.js +3 -0
- package/lib/pages/cms/shipping/server-actions.cjs +1 -0
- package/lib/pages/cms/shipping/server-actions.es.js +131 -149
- package/lib/pages/cms/taxes/TaxesPage.cjs +1 -0
- package/lib/pages/cms/taxes/TaxesPage.d.ts +1 -1
- package/lib/pages/cms/taxes/TaxesPage.es.js +211 -169
- package/lib/pages/cms/taxes/actions.cjs +1 -0
- package/lib/pages/cms/taxes/actions.es.js +41 -53
- package/lib/pages/cms/taxes/components/TaxRateForm.cjs +1 -0
- package/lib/pages/cms/taxes/components/TaxRateForm.d.ts +1 -1
- package/lib/pages/cms/taxes/components/TaxRateForm.es.js +112 -99
- package/lib/pages/cms/taxes/index.cjs +1 -0
- package/lib/pages/cms/taxes/index.es.js +3 -0
- package/lib/payment-config.cjs +1 -0
- package/lib/payment-config.es.js +110 -126
- package/lib/product-actions.cjs +238 -0
- package/lib/product-actions.es.js +289 -544
- package/lib/product-context.cjs +1 -0
- package/lib/product-context.es.js +13 -15
- package/lib/product-schema.cjs +1 -0
- package/lib/product-schema.es.js +99 -134
- package/lib/providers/freemius.cjs +1 -0
- package/lib/providers/freemius.es.js +446 -530
- package/lib/providers/stripe.cjs +1 -0
- package/lib/providers/stripe.es.js +417 -477
- package/lib/server-actions/coupon-actions.cjs +1 -0
- package/lib/server-actions/coupon-actions.es.js +22 -22
- package/lib/server-actions/customer-actions.cjs +1 -0
- package/lib/server-actions/customer-actions.es.js +26 -28
- package/lib/server-actions/product-actions.cjs +1 -0
- package/lib/server-actions/product-actions.es.js +9 -15
- package/lib/server-actions/shipping-actions.cjs +1 -0
- package/lib/server-actions/shipping-actions.es.js +27 -24
- package/lib/server-actions/tax-actions.cjs +1 -0
- package/lib/server-actions/tax-actions.es.js +33 -39
- package/lib/shared-inventory.cjs +15 -0
- package/lib/shared-inventory.es.js +111 -160
- package/lib/shipping/resolver.cjs +7 -0
- package/lib/shipping/resolver.es.js +44 -61
- package/lib/shipping-rate-currency.cjs +1 -0
- package/lib/shipping-rate-currency.es.js +52 -67
- package/lib/states.cjs +1 -0
- package/lib/states.es.js +333 -154
- package/lib/stripe/checkout.cjs +1 -0
- package/lib/stripe/checkout.es.js +125 -181
- package/lib/stripe/client.cjs +1 -0
- package/lib/stripe/client.es.js +14 -19
- package/lib/stripe/order-sync.cjs +1 -0
- package/lib/stripe/order-sync.es.js +106 -126
- package/lib/stripe/webhooks.cjs +1 -0
- package/lib/stripe/webhooks.es.js +37 -31
- package/lib/tax-calculation.cjs +1 -0
- package/lib/tax-calculation.es.js +84 -98
- package/lib/trials.cjs +1 -0
- package/lib/trials.es.js +24 -30
- package/lib/types.cjs +1 -0
- package/lib/types.es.js +21 -27
- package/lib/use-cart.cjs +1 -0
- package/lib/use-cart.es.js +38 -40
- package/lib/use-price-formatter.cjs +1 -0
- package/lib/use-price-formatter.es.js +10 -11
- package/lib/variation-utils.cjs +1 -0
- package/lib/variation-utils.es.js +199 -261
- package/lib/zod-config.cjs +1 -0
- package/lib/zod-config.es.js +5 -6
- package/package.json +22 -21
- package/server.cjs +1 -0
- package/server.es.js +56 -211
- package/index.cjs.js +0 -1
- package/lib/CurrencyProvider.cjs.js +0 -1
- package/lib/PaymentReadinessProvider.cjs.js +0 -1
- package/lib/cart-store.cjs.js +0 -1
- package/lib/components/AccountNavigationMenu.cjs.js +0 -1
- package/lib/components/AddToCartButton.cjs.js +0 -1
- package/lib/components/Cart.cjs.js +0 -1
- package/lib/components/CartDrawer.cjs.js +0 -1
- package/lib/components/CartIcon.cjs.js +0 -1
- package/lib/components/Checkout.cjs.js +0 -1
- package/lib/components/CouponForm.cjs.js +0 -1
- package/lib/components/CurrencySwitcher.cjs.js +0 -1
- package/lib/components/CustomerProfileForm.cjs.js +0 -1
- package/lib/components/FeaturedProduct.cjs.js +0 -1
- package/lib/components/FreemiusLicensePanel.cjs.js +0 -1
- package/lib/components/InvoiceDocument.cjs.js +0 -1
- package/lib/components/InvoiceViewerShell.cjs.js +0 -29
- package/lib/components/ProductCard.cjs.js +0 -1
- package/lib/components/ProductDetailsLayout.cjs.js +0 -1
- package/lib/components/ProductGallery.cjs.js +0 -1
- package/lib/components/ProductGrid.cjs.js +0 -1
- package/lib/components/ShippingEstimator.cjs.js +0 -1
- package/lib/components/ShortDescription.cjs.js +0 -1
- package/lib/components/SimpleTiptapRenderer.cjs.js +0 -1
- package/lib/components/SubscriptionSelector.cjs.js +0 -1
- package/lib/countries.cjs.js +0 -1
- package/lib/coupon-server.cjs.js +0 -1
- package/lib/coupons.cjs.js +0 -1
- package/lib/currency-constants.cjs.js +0 -1
- package/lib/currency-rest-client.cjs.js +0 -1
- package/lib/currency-store.cjs.js +0 -1
- package/lib/currency-sync.cjs.js +0 -1
- package/lib/currency.cjs.js +0 -1
- package/lib/customer-addresses.cjs.js +0 -1
- package/lib/customer-orders.cjs.js +0 -1
- package/lib/customer.cjs.js +0 -1
- package/lib/export-helpers.cjs.js +0 -1
- package/lib/factory.cjs.js +0 -1
- package/lib/freemius-coupons.cjs.js +0 -1
- package/lib/freemius-license-claim.cjs.js +0 -1
- package/lib/freemius-license.cjs.js +0 -1
- package/lib/freemius-order-sync.cjs.js +0 -1
- package/lib/freemius-trial-provision.cjs.js +0 -1
- package/lib/inventory-settings.cjs.js +0 -1
- package/lib/invoice-server.cjs.js +0 -33
- package/lib/invoice-ui.cjs.js +0 -1
- package/lib/invoice.cjs.js +0 -1
- package/lib/order-inventory.cjs.js +0 -61
- package/lib/order-tax-details.cjs.js +0 -1
- package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +0 -1
- package/lib/pages/cms/coupons/CouponsPage.cjs.js +0 -5
- package/lib/pages/cms/coupons/CreateCouponDialog.cjs.js +0 -1
- package/lib/pages/cms/coupons/EditCouponPage.cjs.js +0 -1
- package/lib/pages/cms/coupons/ProductScopePicker.cjs.js +0 -1
- package/lib/pages/cms/coupons/actions.cjs.js +0 -1
- package/lib/pages/cms/coupons/product-options.cjs.js +0 -1
- package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +0 -1
- package/lib/pages/cms/orders/OrderDetailPage.cjs.js +0 -1
- package/lib/pages/cms/orders/OrderPrintButton.cjs.js +0 -1
- package/lib/pages/cms/orders/OrderStatusForm.cjs.js +0 -1
- package/lib/pages/cms/orders/OrdersPage.cjs.js +0 -1
- package/lib/pages/cms/orders/actions.cjs.js +0 -7
- package/lib/pages/cms/orders/export-actions.cjs.js +0 -1
- package/lib/pages/cms/orders/server-actions.cjs.js +0 -1
- package/lib/pages/cms/payments/PaymentsClient.cjs.js +0 -1
- package/lib/pages/cms/payments/PaymentsPage.cjs.js +0 -1
- package/lib/pages/cms/payments/actions.cjs.js +0 -1
- package/lib/pages/cms/payments/queries.cjs.js +0 -1
- package/lib/pages/cms/products/ProductsPage.cjs.js +0 -1
- package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +0 -1
- package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +0 -156
- package/lib/pages/cms/products/actions.cjs.js +0 -44
- package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +0 -1
- package/lib/pages/cms/products/attributes/components/AttributeManager.cjs.js +0 -1
- package/lib/pages/cms/products/categories/CategoryManagementPage.cjs.js +0 -1
- package/lib/pages/cms/products/categories/components/CategoryManager.cjs.js +0 -1
- package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +0 -1
- package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +0 -1
- package/lib/pages/cms/products/components/DeleteProductButton.cjs.js +0 -1
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs.js +0 -1
- package/lib/pages/cms/products/components/ProductCategorySelector.cjs.js +0 -1
- package/lib/pages/cms/products/components/ProductForm.cjs.js +0 -1
- package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +0 -1
- package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +0 -1
- package/lib/pages/cms/products/components/SaleScheduleFields.cjs.js +0 -1
- package/lib/pages/cms/products/components/SyncFreemiusButton.cjs.js +0 -1
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs.js +0 -5
- package/lib/pages/cms/products/components/VariationsEditor.cjs.js +0 -1
- package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +0 -1
- package/lib/pages/cms/products/inventory/InventoryTableClient.cjs.js +0 -2
- package/lib/pages/cms/products/inventory/actions.cjs.js +0 -3
- package/lib/pages/cms/products/new/NewProductPage.cjs.js +0 -1
- package/lib/pages/cms/products/product-price-sync.cjs.js +0 -1
- package/lib/pages/cms/products/server-actions.cjs.js +0 -1
- package/lib/pages/cms/shipping/ShippingPage.cjs.js +0 -5
- package/lib/pages/cms/shipping/components/RateForm.cjs.js +0 -1
- package/lib/pages/cms/shipping/components/ZoneForm.cjs.js +0 -1
- package/lib/pages/cms/shipping/server-actions.cjs.js +0 -1
- package/lib/pages/cms/taxes/TaxesPage.cjs.js +0 -1
- package/lib/pages/cms/taxes/actions.cjs.js +0 -1
- package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +0 -1
- package/lib/payment-config.cjs.js +0 -1
- package/lib/product-actions.cjs.js +0 -238
- package/lib/product-context.cjs.js +0 -1
- package/lib/product-schema.cjs.js +0 -1
- package/lib/providers/freemius.cjs.js +0 -5
- package/lib/providers/stripe.cjs.js +0 -1
- package/lib/server-actions/coupon-actions.cjs.js +0 -1
- package/lib/server-actions/customer-actions.cjs.js +0 -1
- package/lib/server-actions/product-actions.cjs.js +0 -1
- package/lib/server-actions/shipping-actions.cjs.js +0 -1
- package/lib/server-actions/tax-actions.cjs.js +0 -1
- package/lib/shared-inventory.cjs.js +0 -15
- package/lib/shipping/resolver.cjs.js +0 -7
- package/lib/shipping-rate-currency.cjs.js +0 -1
- package/lib/states.cjs.js +0 -1
- package/lib/stripe/checkout.cjs.js +0 -1
- package/lib/stripe/client.cjs.js +0 -1
- package/lib/stripe/order-sync.cjs.js +0 -1
- package/lib/stripe/webhooks.cjs.js +0 -1
- package/lib/tax-calculation.cjs.js +0 -1
- package/lib/trials.cjs.js +0 -1
- package/lib/types.cjs.js +0 -1
- package/lib/use-cart.cjs.js +0 -1
- package/lib/use-price-formatter.cjs.js +0 -1
- package/lib/variation-utils.cjs.js +0 -1
- package/lib/zod-config.cjs.js +0 -1
- package/server.cjs.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require("../invoice-ui.cjs");let t=require("react"),n=require("@nextblock-cms/utils"),r=require("react/jsx-runtime");var i=({images:i=[],className:a})=>{let{t:o}=(0,n.useTranslations)(),[s,c]=(0,t.useState)(0);if(!i.length)return(0,r.jsx)(`div`,{className:(0,n.cn)(`relative aspect-square w-full overflow-hidden rounded-lg bg-secondary`,a),children:(0,r.jsx)(`div`,{className:`flex h-full items-center justify-center text-muted-foreground`,children:e.translateOrFallback(o,`ecommerce.no_image`,`No image`)})});let l=s<i.length?s:0,u=i[l];return(0,r.jsxs)(`div`,{className:(0,n.cn)(`flex flex-col gap-4`,a),children:[(0,r.jsx)(`div`,{className:`relative aspect-square w-full overflow-hidden rounded-lg border bg-white`,children:(0,r.jsx)(`img`,{src:u.url,alt:u.alt??``,width:u.width??1e3,height:u.height??1e3,fetchPriority:`high`,decoding:`async`,className:`h-full w-full object-cover object-center`})}),i.length>1&&(0,r.jsx)(`div`,{className:`flex gap-4 overflow-x-auto p-1 pb-2`,children:i.map((t,a)=>(0,r.jsx)(`button`,{type:`button`,onClick:()=>c(a),"aria-current":l===a?`true`:void 0,"aria-label":e.translateOrFallback(o,`ecommerce.gallery_show_image`,`Show image {index} of {total}`).replace(`{index}`,String(a+1)).replace(`{total}`,String(i.length)),className:(0,n.cn)(`relative aspect-square w-20 flex-shrink-0 overflow-hidden rounded-md border focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring`,l===a?`ring-2 ring-primary`:`ring-1 ring-transparent hover:ring-primary/50`),children:(0,r.jsx)(`img`,{src:t.url,alt:``,width:80,height:80,loading:`lazy`,decoding:`async`,className:`h-full w-full object-cover object-center`})},a))})]})};exports.ProductGallery=i;
|
|
@@ -7,5 +7,5 @@ interface ProductGalleryProps {
|
|
|
7
7
|
}[];
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const ProductGallery: ({ images, className }: ProductGalleryProps) => import(
|
|
10
|
+
export declare const ProductGallery: ({ images, className }: ProductGalleryProps) => import('react').JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,55 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
)) })
|
|
51
|
-
] });
|
|
52
|
-
};
|
|
53
|
-
export {
|
|
54
|
-
w as ProductGallery
|
|
1
|
+
"use client";
|
|
2
|
+
import { translateOrFallback as e } from "../invoice-ui.es.js";
|
|
3
|
+
import { useState as t } from "react";
|
|
4
|
+
import { cn as n, useTranslations as r } from "@nextblock-cms/utils";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/lib/components/ProductGallery.tsx
|
|
7
|
+
var o = ({ images: o = [], className: s }) => {
|
|
8
|
+
let { t: c } = r(), [l, u] = t(0);
|
|
9
|
+
if (!o.length) return /* @__PURE__ */ i("div", {
|
|
10
|
+
className: n("relative aspect-square w-full overflow-hidden rounded-lg bg-secondary", s),
|
|
11
|
+
children: /* @__PURE__ */ i("div", {
|
|
12
|
+
className: "flex h-full items-center justify-center text-muted-foreground",
|
|
13
|
+
children: e(c, "ecommerce.no_image", "No image")
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
let d = l < o.length ? l : 0, f = o[d];
|
|
17
|
+
return /* @__PURE__ */ a("div", {
|
|
18
|
+
className: n("flex flex-col gap-4", s),
|
|
19
|
+
children: [/* @__PURE__ */ i("div", {
|
|
20
|
+
className: "relative aspect-square w-full overflow-hidden rounded-lg border bg-white",
|
|
21
|
+
children: /* @__PURE__ */ i("img", {
|
|
22
|
+
src: f.url,
|
|
23
|
+
alt: f.alt ?? "",
|
|
24
|
+
width: f.width ?? 1e3,
|
|
25
|
+
height: f.height ?? 1e3,
|
|
26
|
+
fetchPriority: "high",
|
|
27
|
+
decoding: "async",
|
|
28
|
+
className: "h-full w-full object-cover object-center"
|
|
29
|
+
})
|
|
30
|
+
}), o.length > 1 && /* @__PURE__ */ i("div", {
|
|
31
|
+
className: "flex gap-4 overflow-x-auto p-1 pb-2",
|
|
32
|
+
children: o.map((t, r) => /* @__PURE__ */ i("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
onClick: () => u(r),
|
|
35
|
+
"aria-current": d === r ? "true" : void 0,
|
|
36
|
+
"aria-label": e(c, "ecommerce.gallery_show_image", "Show image {index} of {total}").replace("{index}", String(r + 1)).replace("{total}", String(o.length)),
|
|
37
|
+
className: n("relative aspect-square w-20 flex-shrink-0 overflow-hidden rounded-md border focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring", d === r ? "ring-2 ring-primary" : "ring-1 ring-transparent hover:ring-primary/50"),
|
|
38
|
+
children: /* @__PURE__ */ i("img", {
|
|
39
|
+
src: t.url,
|
|
40
|
+
alt: "",
|
|
41
|
+
width: 80,
|
|
42
|
+
height: 80,
|
|
43
|
+
loading: "lazy",
|
|
44
|
+
decoding: "async",
|
|
45
|
+
className: "h-full w-full object-cover object-center"
|
|
46
|
+
})
|
|
47
|
+
}, r))
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
55
50
|
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { o as ProductGallery };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./ProductCard.cjs");let t=require("@nextblock-cms/utils"),n=require("react/jsx-runtime");var r=({products:r,columns:i=3,className:a})=>{let{t:o}=(0,t.useTranslations)();if(!r.length){let e=o(`ecommerce.no_products_found`);return(0,n.jsx)(`div`,{className:`py-12 text-center text-muted-foreground`,children:e===`ecommerce.no_products_found`?`No products found.`:e})}return(0,n.jsx)(`div`,{className:(0,t.cn)(`grid gap-6 sm:grid-cols-2`,i===3&&`lg:grid-cols-3`,i===4&&`lg:grid-cols-4`,a),children:r.map((t,r)=>(0,n.jsx)(e.ProductCard,{product:t,priority:r<i},t.id))})};exports.ProductGrid=r;
|
|
@@ -4,5 +4,5 @@ interface ProductGridProps {
|
|
|
4
4
|
columns?: 2 | 3 | 4;
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const ProductGrid: ({ products, columns, className }: ProductGridProps) => import(
|
|
7
|
+
export declare const ProductGrid: ({ products, columns, className }: ProductGridProps) => import('react').JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
g as ProductGrid
|
|
1
|
+
"use client";
|
|
2
|
+
import { ProductCard as e } from "./ProductCard.es.js";
|
|
3
|
+
import { cn as t, useTranslations as n } from "@nextblock-cms/utils";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/lib/components/ProductGrid.tsx
|
|
6
|
+
var i = ({ products: i, columns: a = 3, className: o }) => {
|
|
7
|
+
let { t: s } = n();
|
|
8
|
+
if (!i.length) {
|
|
9
|
+
let e = s("ecommerce.no_products_found");
|
|
10
|
+
return /* @__PURE__ */ r("div", {
|
|
11
|
+
className: "py-12 text-center text-muted-foreground",
|
|
12
|
+
children: e === "ecommerce.no_products_found" ? "No products found." : e
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return /* @__PURE__ */ r("div", {
|
|
16
|
+
className: t("grid gap-6 sm:grid-cols-2", a === 3 && "lg:grid-cols-3", a === 4 && "lg:grid-cols-4", o),
|
|
17
|
+
children: i.map((t, n) => /* @__PURE__ */ r(e, {
|
|
18
|
+
product: t,
|
|
19
|
+
priority: n < a
|
|
20
|
+
}, t.id))
|
|
21
|
+
});
|
|
26
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as ProductGrid };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require("../CurrencyProvider.cjs"),t=require("../use-price-formatter.cjs"),n=require("../countries.cjs"),r=require("../states.cjs"),i=require("../server-actions/shipping-actions.cjs");let a=require("@nextblock-cms/ui/button"),o=require("react"),s=require("lucide-react"),c=require("@nextblock-cms/utils"),l=require("react/jsx-runtime"),u=require("@nextblock-cms/ui/input"),d=require("@nextblock-cms/ui/label");var f=({physicalSubtotal:f})=>{let p=t.usePriceFormatter(),[m,h]=(0,o.useState)(`CA`),[g,_]=(0,o.useState)(``),[v,y]=(0,o.useState)(``),[b,x]=(0,o.useState)(!1),[S,C]=(0,o.useState)(null),[w,T]=(0,o.useState)(null),{t:E,lang:D}=(0,c.useTranslations)(),{activeCurrencyCode:O}=e.useCurrency(),k=(e,t)=>{let n=E(e);return n===e?t:n},A=r.getStatesForCountry(m),j=r.countryUsesStructuredStates(m),M=(0,o.useMemo)(()=>{try{return new Intl.DisplayNames([D],{type:`region`})}catch{return null}},[D]),N=k(`select_an_option`,`Select an option`),P=k(`state_province`,`State / Province`),F=async()=>{x(!0),T(null),C(null);try{let e=await i.getShippingEstimates(f,{country:m,state:g||void 0,postal_code:v},D,O);e.success&&e.methods?C(e.methods):T(e.errorKey?k(e.errorKey,e.error||E(`ecommerce.no_rates_found`)):e.error||E(`ecommerce.no_rates_found`))}catch(e){console.error(`[ShippingEstimator] Failed to load rates:`,e),T(k(`ecommerce.shipping_calculation_failed`,`We couldn't calculate shipping right now. Please try again.`))}finally{x(!1)}};return(0,l.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-muted/30 p-4 mt-6`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 font-semibold text-sm`,children:[(0,l.jsx)(s.Truck,{className:`h-4 w-4`}),(0,l.jsx)(`span`,{children:E(`ecommerce.estimate_shipping`)})]}),(0,l.jsxs)(`div`,{className:`grid gap-3`,children:[(0,l.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,l.jsx)(d.Label,{htmlFor:`estimate-country`,className:`text-xs uppercase tracking-wider text-muted-foreground`,children:E(`ecommerce.country`)}),(0,l.jsx)(`select`,{id:`estimate-country`,name:`estimate-country`,autoComplete:`shipping country`,value:m,onChange:e=>{let t=e.target.value,n=r.getStatesForCountry(t);h(t),_(n.some(e=>e.code===g)?g:``)},className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm`,children:n.countries.map(e=>(0,l.jsx)(`option`,{value:e.code,children:M?.of(e.code)??e.name},e.code))})]}),j&&(0,l.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,l.jsx)(d.Label,{htmlFor:`estimate-state`,className:`text-xs uppercase tracking-wider text-muted-foreground`,children:E(`state_province`)}),(0,l.jsxs)(`select`,{id:`estimate-state`,name:`estimate-state`,autoComplete:`shipping address-level1`,value:g,onChange:e=>_(e.target.value),className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm`,children:[(0,l.jsx)(`option`,{value:``,children:`${N}: ${P}`}),A.map(e=>(0,l.jsx)(`option`,{value:e.code,children:r.getSubdivisionLabel(m,e,D)},e.code))]})]}),(0,l.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,l.jsx)(d.Label,{htmlFor:`estimate-postal`,className:`text-xs uppercase tracking-wider text-muted-foreground`,children:E(`ecommerce.postal_code`)}),(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[(0,l.jsx)(u.Input,{id:`estimate-postal`,name:`estimate-postal`,autoComplete:`shipping postal-code`,placeholder:m===`CA`?`A1A 1A1`:void 0,value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!b&&(e.preventDefault(),F())},className:`h-9 text-sm bg-background`}),(0,l.jsxs)(a.Button,{size:`sm`,variant:`secondary`,onClick:F,disabled:b,className:`shrink-0`,children:[b?(0,l.jsx)(s.Loader2,{className:`h-4 w-4 mr-1.5 animate-spin`}):(0,l.jsx)(s.Calculator,{className:`h-4 w-4 mr-1.5`}),E(`ecommerce.calculate`)]})]})]})]}),w&&(0,l.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive mt-2`,children:w}),(0,l.jsxs)(`div`,{"aria-live":`polite`,children:[S&&S.length>0&&(0,l.jsxs)(`div`,{className:`mt-4 space-y-2 border-t pt-3`,children:[(0,l.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground uppercase`,children:[E(`ecommerce.available_rates`),`:`]}),S.map(e=>(0,l.jsxs)(`div`,{className:`flex justify-between items-center p-3 border rounded-lg bg-muted/30`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(s.Truck,{className:`h-4 w-4 text-muted-foreground`}),(0,l.jsx)(`span`,{className:`text-sm font-medium`,children:e.name})]}),(0,l.jsx)(`span`,{className:`text-sm font-bold tabular-nums`,children:e.amount===0?E(`ecommerce.free`):p(e.amount,O)})]},e.id))]}),S&&S.length===0&&!w&&(0,l.jsx)(`p`,{className:`text-xs text-muted-foreground mt-2 italic`,children:E(`ecommerce.no_rates_found`)})]})]})};exports.ShippingEstimator=f;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface ShippingEstimatorProps {
|
|
2
2
|
physicalSubtotal: number;
|
|
3
3
|
}
|
|
4
|
-
export declare const ShippingEstimator: ({ physicalSubtotal }: ShippingEstimatorProps) => import(
|
|
4
|
+
export declare const ShippingEstimator: ({ physicalSubtotal }: ShippingEstimatorProps) => import('react').JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,154 +1,159 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useTranslations as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCurrency as e } from "../CurrencyProvider.es.js";
|
|
3
|
+
import { usePriceFormatter as t } from "../use-price-formatter.es.js";
|
|
4
|
+
import { countries as n } from "../countries.es.js";
|
|
5
|
+
import { countryUsesStructuredStates as r, getStatesForCountry as i, getSubdivisionLabel as a } from "../states.es.js";
|
|
6
|
+
import { getShippingEstimates as o } from "../server-actions/shipping-actions.es.js";
|
|
7
|
+
import { Button as s } from "@nextblock-cms/ui/button";
|
|
8
|
+
import { useMemo as c, useState as l } from "react";
|
|
9
|
+
import { Calculator as u, Loader2 as d, Truck as f } from "lucide-react";
|
|
10
|
+
import { useTranslations as p } from "@nextblock-cms/utils";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { Input as g } from "@nextblock-cms/ui/input";
|
|
13
|
+
import { Label as _ } from "@nextblock-cms/ui/label";
|
|
14
|
+
//#region src/lib/components/ShippingEstimator.tsx
|
|
15
|
+
var v = ({ physicalSubtotal: v }) => {
|
|
16
|
+
let y = t(), [b, x] = l("CA"), [S, C] = l(""), [w, T] = l(""), [E, D] = l(!1), [O, k] = l(null), [A, j] = l(null), { t: M, lang: N } = p(), { activeCurrencyCode: P } = e(), F = (e, t) => {
|
|
17
|
+
let n = M(e);
|
|
18
|
+
return n === e ? t : n;
|
|
19
|
+
}, I = i(b), L = r(b), R = c(() => {
|
|
20
|
+
try {
|
|
21
|
+
return new Intl.DisplayNames([N], { type: "region" });
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}, [N]), z = F("select_an_option", "Select an option"), B = F("state_province", "State / Province"), V = async () => {
|
|
26
|
+
D(!0), j(null), k(null);
|
|
27
|
+
try {
|
|
28
|
+
let e = await o(v, {
|
|
29
|
+
country: b,
|
|
30
|
+
state: S || void 0,
|
|
31
|
+
postal_code: w
|
|
32
|
+
}, N, P);
|
|
33
|
+
e.success && e.methods ? k(e.methods) : j(e.errorKey ? F(e.errorKey, e.error || M("ecommerce.no_rates_found")) : e.error || M("ecommerce.no_rates_found"));
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.error("[ShippingEstimator] Failed to load rates:", e), j(F("ecommerce.shipping_calculation_failed", "We couldn't calculate shipping right now. Please try again."));
|
|
36
|
+
} finally {
|
|
37
|
+
D(!1);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ h("div", {
|
|
41
|
+
className: "space-y-4 rounded-lg border bg-muted/30 p-4 mt-6",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ h("div", {
|
|
44
|
+
className: "flex items-center gap-2 font-semibold text-sm",
|
|
45
|
+
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), /* @__PURE__ */ m("span", { children: M("ecommerce.estimate_shipping") })]
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ h("div", {
|
|
48
|
+
className: "grid gap-3",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ h("div", {
|
|
51
|
+
className: "space-y-1.5",
|
|
52
|
+
children: [/* @__PURE__ */ m(_, {
|
|
53
|
+
htmlFor: "estimate-country",
|
|
54
|
+
className: "text-xs uppercase tracking-wider text-muted-foreground",
|
|
55
|
+
children: M("ecommerce.country")
|
|
56
|
+
}), /* @__PURE__ */ m("select", {
|
|
57
|
+
id: "estimate-country",
|
|
58
|
+
name: "estimate-country",
|
|
59
|
+
autoComplete: "shipping country",
|
|
60
|
+
value: b,
|
|
61
|
+
onChange: (e) => {
|
|
62
|
+
let t = e.target.value, n = i(t);
|
|
63
|
+
x(t), C(n.some((e) => e.code === S) ? S : "");
|
|
64
|
+
},
|
|
65
|
+
className: "flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
66
|
+
children: n.map((e) => /* @__PURE__ */ m("option", {
|
|
67
|
+
value: e.code,
|
|
68
|
+
children: R?.of(e.code) ?? e.name
|
|
69
|
+
}, e.code))
|
|
70
|
+
})]
|
|
71
|
+
}),
|
|
72
|
+
L && /* @__PURE__ */ h("div", {
|
|
73
|
+
className: "space-y-1.5",
|
|
74
|
+
children: [/* @__PURE__ */ m(_, {
|
|
75
|
+
htmlFor: "estimate-state",
|
|
76
|
+
className: "text-xs uppercase tracking-wider text-muted-foreground",
|
|
77
|
+
children: M("state_province")
|
|
78
|
+
}), /* @__PURE__ */ h("select", {
|
|
79
|
+
id: "estimate-state",
|
|
80
|
+
name: "estimate-state",
|
|
81
|
+
autoComplete: "shipping address-level1",
|
|
82
|
+
value: S,
|
|
83
|
+
onChange: (e) => C(e.target.value),
|
|
84
|
+
className: "flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
85
|
+
children: [/* @__PURE__ */ m("option", {
|
|
86
|
+
value: "",
|
|
87
|
+
children: `${z}: ${B}`
|
|
88
|
+
}), I.map((e) => /* @__PURE__ */ m("option", {
|
|
89
|
+
value: e.code,
|
|
90
|
+
children: a(b, e, N)
|
|
91
|
+
}, e.code))]
|
|
92
|
+
})]
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ h("div", {
|
|
95
|
+
className: "space-y-1.5",
|
|
96
|
+
children: [/* @__PURE__ */ m(_, {
|
|
97
|
+
htmlFor: "estimate-postal",
|
|
98
|
+
className: "text-xs uppercase tracking-wider text-muted-foreground",
|
|
99
|
+
children: M("ecommerce.postal_code")
|
|
100
|
+
}), /* @__PURE__ */ h("div", {
|
|
101
|
+
className: "flex gap-2",
|
|
102
|
+
children: [/* @__PURE__ */ m(g, {
|
|
103
|
+
id: "estimate-postal",
|
|
104
|
+
name: "estimate-postal",
|
|
105
|
+
autoComplete: "shipping postal-code",
|
|
106
|
+
placeholder: b === "CA" ? "A1A 1A1" : void 0,
|
|
107
|
+
value: w,
|
|
108
|
+
onChange: (e) => T(e.target.value),
|
|
109
|
+
onKeyDown: (e) => {
|
|
110
|
+
e.key === "Enter" && !E && (e.preventDefault(), V());
|
|
111
|
+
},
|
|
112
|
+
className: "h-9 text-sm bg-background"
|
|
113
|
+
}), /* @__PURE__ */ h(s, {
|
|
114
|
+
size: "sm",
|
|
115
|
+
variant: "secondary",
|
|
116
|
+
onClick: V,
|
|
117
|
+
disabled: E,
|
|
118
|
+
className: "shrink-0",
|
|
119
|
+
children: [E ? /* @__PURE__ */ m(d, { className: "h-4 w-4 mr-1.5 animate-spin" }) : /* @__PURE__ */ m(u, { className: "h-4 w-4 mr-1.5" }), M("ecommerce.calculate")]
|
|
120
|
+
})]
|
|
121
|
+
})]
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
}),
|
|
125
|
+
A && /* @__PURE__ */ m("p", {
|
|
126
|
+
role: "alert",
|
|
127
|
+
className: "text-xs text-destructive mt-2",
|
|
128
|
+
children: A
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ h("div", {
|
|
131
|
+
"aria-live": "polite",
|
|
132
|
+
children: [O && O.length > 0 && /* @__PURE__ */ h("div", {
|
|
133
|
+
className: "mt-4 space-y-2 border-t pt-3",
|
|
134
|
+
children: [/* @__PURE__ */ h("p", {
|
|
135
|
+
className: "text-xs font-medium text-muted-foreground uppercase",
|
|
136
|
+
children: [M("ecommerce.available_rates"), ":"]
|
|
137
|
+
}), O.map((e) => /* @__PURE__ */ h("div", {
|
|
138
|
+
className: "flex justify-between items-center p-3 border rounded-lg bg-muted/30",
|
|
139
|
+
children: [/* @__PURE__ */ h("div", {
|
|
140
|
+
className: "flex items-center gap-2",
|
|
141
|
+
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ m("span", {
|
|
142
|
+
className: "text-sm font-medium",
|
|
143
|
+
children: e.name
|
|
144
|
+
})]
|
|
145
|
+
}), /* @__PURE__ */ m("span", {
|
|
146
|
+
className: "text-sm font-bold tabular-nums",
|
|
147
|
+
children: e.amount === 0 ? M("ecommerce.free") : y(e.amount, P)
|
|
148
|
+
})]
|
|
149
|
+
}, e.id))]
|
|
150
|
+
}), O && O.length === 0 && !A && /* @__PURE__ */ m("p", {
|
|
151
|
+
className: "text-xs text-muted-foreground mt-2 italic",
|
|
152
|
+
children: M("ecommerce.no_rates_found")
|
|
153
|
+
})]
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
});
|
|
154
157
|
};
|
|
158
|
+
//#endregion
|
|
159
|
+
export { v as ShippingEstimator };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("./SimpleTiptapRenderer.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("@nextblock-cms/utils"),i=require("react/jsx-runtime");var a=/<\/?[a-z][^>]*>/i,o=e=>a.test(e);function s({value:e,className:n}){let a=e?.trim();return a?o(a)?(0,i.jsx)(`div`,{className:n,dangerouslySetInnerHTML:{__html:t.toNoCookieEmbedSrc(a)??a}}):(0,i.jsx)(`p`,{className:(0,r.cn)(`whitespace-pre-line`,n),children:a}):null}exports.ShortDescription=s,exports.isHtmlShortDescription=o;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { toNoCookieEmbedSrc as e } from "./SimpleTiptapRenderer.es.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn as t } from "@nextblock-cms/utils";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/lib/components/ShortDescription.tsx
|
|
6
|
+
var r = /<\/?[a-z][^>]*>/i, i = (e) => r.test(e);
|
|
7
|
+
function a({ value: r, className: a }) {
|
|
8
|
+
let o = r?.trim();
|
|
9
|
+
return o ? i(o) ? /* @__PURE__ */ n("div", {
|
|
10
|
+
className: a,
|
|
11
|
+
dangerouslySetInnerHTML: { __html: e(o) ?? o }
|
|
12
|
+
}) : /* @__PURE__ */ n("p", {
|
|
13
|
+
className: t("whitespace-pre-line", a),
|
|
14
|
+
children: o
|
|
15
|
+
}) : null;
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
m as isHtmlShortDescription
|
|
18
|
-
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { a as ShortDescription, i as isHtmlShortDescription };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs");let t=require("react");t=e.__toESM(t,1);let n=require("react/jsx-runtime");var r=(e,t)=>t.reduce((e,t)=>{switch(t.type){case`bold`:return(0,n.jsx)(`strong`,{children:e});case`italic`:return(0,n.jsx)(`em`,{children:e});case`underline`:case`u`:return(0,n.jsx)(`u`,{children:e});case`strike`:return(0,n.jsx)(`s`,{children:e});case`code`:return(0,n.jsx)(`code`,{className:`bg-muted px-1.5 py-0.5 rounded text-[0.875em] font-mono`,children:e});case`link`:{let r=t.attrs?.href||`#`,i=t.attrs?.target||`_blank`;return(0,n.jsx)(`a`,{href:r,target:i,rel:`noopener noreferrer`,className:`underline text-primary hover:text-primary/80`,children:e})}case`highlight`:{let r=t.attrs?.color;return(0,n.jsx)(`mark`,{style:r?{backgroundColor:r}:{},className:r?void 0:`bg-yellow-200 dark:bg-yellow-800/50`,children:e})}case`subscript`:return(0,n.jsx)(`sub`,{children:e});case`superscript`:return(0,n.jsx)(`sup`,{children:e});case`textStyle`:{let r={};return t.attrs?.color&&(r.color=t.attrs.color),t.attrs?.fontSize&&(r.fontSize=t.attrs.fontSize),t.attrs?.fontFamily&&(r.fontFamily=t.attrs.fontFamily),Object.keys(r).length>0?(0,n.jsx)(`span`,{style:r,children:e}):(0,n.jsx)(n.Fragment,{children:e})}default:return e}},e),i=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],a=(e,n,r,a)=>{let o=i[Math.max(1,Math.min(6,e))-1],s=a?.id;return t.default.createElement(o,{key:r,className:`font-bold my-4`,id:s},n)},o=e=>{let t={},n={},r=e?.colspan,i=e?.rowspan,a=e?.colwidth;return r&&r>1&&(t.colSpan=r),i&&i>1&&(t.rowSpan=i),a&&Array.isArray(a)&&a[0]&&(n.minWidth=a[0]),Object.keys(n).length>0&&(t.style=n),t},s=(e,i)=>{if(e.type===`text`){let a=e.text??``;return(0,n.jsx)(t.default.Fragment,{children:e.marks?.length?r(a,e.marks):a},i)}let l=e.content?.map((e,t)=>s(e,t))??null;switch(e.type){case`doc`:return(0,n.jsx)(`div`,{children:l},i);case`paragraph`:{if(!e.content?.length||e.content.every(e=>e.type===`text`&&(!e.text||!e.text.trim())))return null;let t=e.attrs?.textAlign,r=t?{textAlign:t}:{};return(0,n.jsx)(`p`,{className:`mb-4`,style:Object.keys(r).length?r:void 0,children:l},i)}case`heading`:return a(e.attrs?.level||1,l,i,e.attrs??void 0);case`bulletList`:return(0,n.jsx)(`ul`,{className:`list-disc pl-5 mb-4`,children:l},i);case`orderedList`:{let t=e.attrs?.start??1;return(0,n.jsx)(`ol`,{className:`list-decimal pl-5 mb-4`,start:t===1?void 0:t,children:l},i)}case`listItem`:return(0,n.jsx)(`li`,{children:l},i);case`taskList`:return(0,n.jsx)(`ul`,{className:`list-none pl-0 mb-4 space-y-1`,children:l},i);case`taskItem`:{let t=!!e.attrs?.checked;return(0,n.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,n.jsx)(`input`,{type:`checkbox`,checked:t,readOnly:!0,className:`mt-1.5 rounded`}),(0,n.jsx)(`div`,{className:t?`line-through text-muted-foreground`:``,children:l})]},i)}case`blockquote`:return(0,n.jsx)(`blockquote`,{className:`border-l-4 border-border pl-4 italic my-4`,children:l},i);case`codeBlock`:{let t=e.attrs?.language;return(0,n.jsx)(`pre`,{className:`bg-muted rounded-lg p-4 mb-4 overflow-x-auto`,"data-language":t||void 0,children:(0,n.jsx)(`code`,{className:`text-sm font-mono`,children:l})},i)}case`horizontalRule`:return(0,n.jsx)(`hr`,{className:`my-6 border-border`},i);case`hardBreak`:return(0,n.jsx)(`br`,{},i);case`image`:{let t=e.attrs?.src,r=e.attrs?.alt||``,a=e.attrs?.title,o=e.attrs?.width,s=e.attrs?.height,c={};return o&&(c.width=typeof o==`number`?`${o}px`:o),s&&(c.height=typeof s==`number`?`${s}px`:s),(0,n.jsx)(`img`,{src:t,alt:r??``,title:a,width:typeof o==`number`?o:void 0,height:typeof s==`number`?s:void 0,loading:`lazy`,decoding:`async`,style:Object.keys(c).length?c:void 0,className:`max-w-full h-auto rounded my-4`},i)}case`table`:return(0,n.jsx)(`div`,{className:`overflow-x-auto my-4`,children:(0,n.jsx)(`table`,{className:`w-full border-collapse border border-gray-300 dark:border-gray-700`,style:{minWidth:500},children:(0,n.jsx)(`tbody`,{children:l})})},i);case`tableRow`:return(0,n.jsx)(`tr`,{className:`border-b border-gray-300 dark:border-gray-700`,children:l},i);case`tableHeader`:return(0,n.jsx)(`th`,{...o(e.attrs??void 0),className:`bg-gray-100 dark:bg-gray-800 font-bold p-3 text-left border border-gray-300 dark:border-gray-700`,children:l},i);case`tableCell`:return(0,n.jsx)(`td`,{...o(e.attrs??void 0),className:`p-3 border border-gray-300 dark:border-gray-700`,children:l},i);case`details`:return(0,n.jsx)(`details`,{className:`my-4 border rounded-lg overflow-hidden`,children:l},i);case`detailsSummary`:return(0,n.jsx)(`summary`,{className:`cursor-pointer p-3 font-semibold bg-muted/30 hover:bg-muted/50`,children:l},i);case`detailsContent`:return(0,n.jsx)(`div`,{className:`p-3 border-t`,children:l},i);case`youtube`:{let t=c(e.attrs?.src),r=e.attrs?.width||640,a=e.attrs?.height||480;return(0,n.jsx)(`div`,{className:`relative my-4 overflow-hidden rounded-lg`,style:{aspectRatio:`${r}/${a}`,maxWidth:r},children:(0,n.jsx)(`iframe`,{src:t,title:e.attrs?.title||`Embedded video`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,loading:`lazy`,className:`absolute inset-0 w-full h-full`})},i)}case`iframe`:{let t=c(e.attrs?.src);return(0,n.jsx)(`div`,{className:`my-4 overflow-hidden rounded-lg`,style:{aspectRatio:`16/9`},children:(0,n.jsx)(`iframe`,{src:t,title:e.attrs?.title||`Embedded content`,allowFullScreen:!0,loading:`lazy`,className:`w-full h-full border-0`})},i)}case`mention`:{let t=e.attrs?.label||e.attrs?.id||``;return(0,n.jsxs)(`span`,{className:`text-primary font-medium`,children:[`@`,t]},i)}default:return(0,n.jsx)(`div`,{children:l},i)}},c=e=>e?.replace(/(?:https?:)?\/\/(?:www\.|m\.|music\.)?youtube\.com\/embed\//gi,`https://www.youtube-nocookie.com/embed/`),l=({content:e,className:t})=>{if(!e)return null;if(typeof e==`string`){if(e.trim().startsWith(`{`)||e.trim().startsWith(`[`))try{let r=JSON.parse(e);return(0,n.jsx)(l,{content:r,className:t})}catch{}return(0,n.jsx)(`div`,{className:t,dangerouslySetInnerHTML:{__html:c(e)??e}})}let r=e;return!r.content||!Array.isArray(r.content)?null:(0,n.jsx)(`div`,{className:t,children:r.content.map((e,t)=>s(e,t))})};exports.SimpleTiptapRenderer=l,exports.toNoCookieEmbedSrc=c;
|