@nextblock-cms/ecom 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_virtual/_rolldown/runtime.cjs.js +1 -0
- package/index.cjs.js +1 -1
- package/index.es.js +38 -146
- package/lib/CurrencyProvider.cjs.js +1 -1
- package/lib/CurrencyProvider.d.ts +1 -1
- package/lib/CurrencyProvider.es.js +85 -95
- package/lib/PaymentReadinessProvider.cjs.js +1 -1
- package/lib/PaymentReadinessProvider.d.ts +1 -1
- package/lib/PaymentReadinessProvider.es.js +24 -27
- package/lib/cart-store.cjs.js +1 -1
- package/lib/cart-store.es.js +109 -121
- package/lib/components/AccountNavigationMenu.cjs.js +1 -1
- package/lib/components/AccountNavigationMenu.d.ts +1 -1
- package/lib/components/AccountNavigationMenu.es.js +36 -50
- package/lib/components/AddToCartButton.cjs.js +1 -1
- package/lib/components/AddToCartButton.d.ts +1 -1
- package/lib/components/AddToCartButton.es.js +94 -89
- package/lib/components/Cart.cjs.js +1 -1
- package/lib/components/Cart.d.ts +1 -1
- package/lib/components/Cart.es.js +261 -180
- package/lib/components/CartDrawer.cjs.js +1 -1
- package/lib/components/CartDrawer.d.ts +1 -1
- package/lib/components/CartDrawer.es.js +218 -148
- package/lib/components/CartIcon.cjs.js +1 -1
- package/lib/components/CartIcon.d.ts +1 -1
- package/lib/components/CartIcon.es.js +33 -35
- package/lib/components/Checkout.cjs.js +1 -1
- package/lib/components/Checkout.d.ts +1 -1
- package/lib/components/Checkout.es.js +1092 -1108
- package/lib/components/CouponForm.cjs.js +1 -1
- package/lib/components/CouponForm.d.ts +1 -1
- package/lib/components/CouponForm.es.js +136 -148
- package/lib/components/CurrencySwitcher.cjs.js +1 -1
- package/lib/components/CurrencySwitcher.d.ts +1 -1
- package/lib/components/CurrencySwitcher.es.js +22 -18
- package/lib/components/CustomerProfileForm.cjs.js +1 -1
- package/lib/components/CustomerProfileForm.es.js +454 -313
- package/lib/components/FeaturedProduct.cjs.js +1 -1
- package/lib/components/FeaturedProduct.d.ts +1 -1
- package/lib/components/FeaturedProduct.es.js +98 -83
- package/lib/components/FreemiusLicensePanel.cjs.js +1 -1
- package/lib/components/FreemiusLicensePanel.d.ts +1 -1
- package/lib/components/FreemiusLicensePanel.es.js +70 -65
- package/lib/components/InvoiceDocument.cjs.js +1 -1
- package/lib/components/InvoiceDocument.es.js +256 -192
- package/lib/components/InvoiceViewerShell.cjs.js +2 -2
- package/lib/components/InvoiceViewerShell.d.ts +1 -1
- package/lib/components/InvoiceViewerShell.es.js +75 -106
- package/lib/components/ProductCard.cjs.js +1 -1
- package/lib/components/ProductCard.d.ts +1 -1
- package/lib/components/ProductCard.es.js +186 -171
- package/lib/components/ProductDetailsLayout.cjs.js +1 -1
- package/lib/components/ProductDetailsLayout.es.js +405 -404
- package/lib/components/ProductGallery.cjs.js +1 -1
- package/lib/components/ProductGallery.d.ts +1 -1
- package/lib/components/ProductGallery.es.js +51 -54
- package/lib/components/ProductGrid.cjs.js +1 -1
- package/lib/components/ProductGrid.d.ts +1 -1
- package/lib/components/ProductGrid.es.js +23 -25
- package/lib/components/ShippingEstimator.cjs.js +1 -1
- package/lib/components/ShippingEstimator.d.ts +1 -1
- package/lib/components/ShippingEstimator.es.js +158 -153
- package/lib/components/ShortDescription.cjs.js +1 -1
- package/lib/components/ShortDescription.es.js +17 -17
- package/lib/components/SimpleTiptapRenderer.cjs.js +1 -1
- package/lib/components/SimpleTiptapRenderer.es.js +238 -211
- package/lib/components/SubscriptionSelector.cjs.js +1 -1
- package/lib/components/SubscriptionSelector.es.js +159 -154
- package/lib/countries.cjs.js +1 -1
- package/lib/countries.es.js +232 -75
- package/lib/coupon-server.cjs.js +1 -1
- package/lib/coupon-server.es.js +180 -224
- package/lib/coupons.cjs.js +1 -1
- package/lib/coupons.es.js +12 -14
- package/lib/currency-constants.cjs.js +1 -1
- package/lib/currency-constants.es.js +4 -4
- package/lib/currency-rest-client.cjs.js +1 -1
- package/lib/currency-rest-client.es.js +15 -22
- package/lib/currency-store.cjs.js +1 -1
- package/lib/currency-store.es.js +20 -27
- package/lib/currency-sync.cjs.js +1 -1
- package/lib/currency-sync.es.js +124 -170
- package/lib/currency.cjs.js +1 -1
- package/lib/currency.es.js +242 -310
- package/lib/customer-addresses.cjs.js +1 -1
- package/lib/customer-addresses.es.js +80 -109
- package/lib/customer-orders.cjs.js +1 -1
- package/lib/customer-orders.es.js +31 -43
- package/lib/customer.cjs.js +1 -1
- package/lib/customer.es.js +43 -52
- package/lib/export-helpers.cjs.js +1 -1
- package/lib/export-helpers.es.js +53 -52
- package/lib/factory.cjs.js +1 -1
- package/lib/factory.es.js +10 -7
- package/lib/freemius-coupons.cjs.js +1 -1
- package/lib/freemius-coupons.es.js +245 -262
- package/lib/freemius-license-claim.cjs.js +1 -1
- package/lib/freemius-license-claim.es.js +87 -71
- package/lib/freemius-license.cjs.js +1 -1
- package/lib/freemius-license.es.js +32 -39
- package/lib/freemius-order-sync.cjs.js +1 -1
- package/lib/freemius-order-sync.es.js +226 -290
- package/lib/freemius-trial-provision.cjs.js +1 -1
- package/lib/freemius-trial-provision.es.js +136 -130
- package/lib/inventory-settings.cjs.js +1 -1
- package/lib/inventory-settings.es.js +69 -77
- package/lib/invoice-server.cjs.js +3 -3
- package/lib/invoice-server.es.js +94 -141
- package/lib/invoice-ui.cjs.js +1 -1
- package/lib/invoice-ui.es.js +50 -66
- package/lib/invoice.cjs.js +1 -1
- package/lib/invoice.es.js +85 -94
- package/lib/order-inventory.cjs.js +25 -25
- package/lib/order-inventory.es.js +67 -79
- package/lib/order-tax-details.cjs.js +1 -1
- package/lib/order-tax-details.es.js +142 -153
- package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +1 -1
- 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.js +2 -2
- 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.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/lib/pages/cms/coupons/actions.es.js +112 -115
- package/lib/pages/cms/coupons/index.cjs.js +1 -0
- package/lib/pages/cms/coupons/index.es.js +3 -0
- package/lib/pages/cms/coupons/product-options.cjs.js +1 -1
- package/lib/pages/cms/coupons/product-options.es.js +21 -23
- package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- 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.js +3 -3
- package/lib/pages/cms/orders/actions.es.js +53 -69
- package/lib/pages/cms/orders/export-actions.cjs.js +1 -1
- package/lib/pages/cms/orders/export-actions.es.js +23 -26
- package/lib/pages/cms/orders/index.cjs.js +1 -0
- package/lib/pages/cms/orders/index.es.js +6 -0
- package/lib/pages/cms/orders/server-actions.cjs.js +1 -1
- package/lib/pages/cms/orders/server-actions.es.js +60 -51
- package/lib/pages/cms/payments/PaymentsClient.cjs.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/lib/pages/cms/payments/actions.es.js +38 -48
- package/lib/pages/cms/payments/index.cjs.js +1 -0
- package/lib/pages/cms/payments/index.es.js +3 -0
- package/lib/pages/cms/payments/queries.cjs.js +1 -1
- package/lib/pages/cms/payments/queries.es.js +38 -48
- package/lib/pages/cms/products/ProductsPage.cjs.js +1 -1
- 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.d.ts +1 -1
- package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +1 -1
- package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +138 -155
- package/lib/pages/cms/products/actions.cjs.js +4 -4
- package/lib/pages/cms/products/actions.es.js +121 -162
- package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/lib/pages/cms/products/categories/components/CategoryManager.es.js +315 -262
- package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +1 -1
- package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +115 -113
- package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/lib/pages/cms/products/components/ProductCategorySelector.es.js +156 -159
- package/lib/pages/cms/products/components/ProductForm.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductForm.es.js +872 -693
- package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductMediaManager.es.js +106 -103
- package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- 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.js +2 -2
- 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.js +1 -1
- 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.js +1 -0
- package/lib/pages/cms/products/index.es.js +8 -0
- package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +1 -1
- 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.js +2 -2
- 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.js +3 -3
- package/lib/pages/cms/products/inventory/actions.es.js +83 -91
- package/lib/pages/cms/products/new/NewProductPage.cjs.js +1 -1
- 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.js +1 -1
- package/lib/pages/cms/products/product-price-sync.es.js +74 -89
- package/lib/pages/cms/products/server-actions.cjs.js +1 -1
- package/lib/pages/cms/products/server-actions.es.js +250 -233
- package/lib/pages/cms/shipping/ShippingPage.cjs.js +2 -2
- package/lib/pages/cms/shipping/ShippingPage.es.js +287 -209
- package/lib/pages/cms/shipping/components/RateForm.cjs.js +1 -1
- 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.js +1 -1
- package/lib/pages/cms/shipping/components/ZoneForm.es.js +245 -224
- package/lib/pages/cms/shipping/index.cjs.js +1 -0
- package/lib/pages/cms/shipping/index.es.js +3 -0
- package/lib/pages/cms/shipping/server-actions.cjs.js +1 -1
- package/lib/pages/cms/shipping/server-actions.es.js +131 -149
- package/lib/pages/cms/taxes/TaxesPage.cjs.js +1 -1
- 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.js +1 -1
- package/lib/pages/cms/taxes/actions.es.js +41 -53
- package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +1 -1
- 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.js +1 -0
- package/lib/pages/cms/taxes/index.es.js +3 -0
- package/lib/payment-config.cjs.js +1 -1
- package/lib/payment-config.es.js +110 -126
- package/lib/product-actions.cjs.js +4 -4
- package/lib/product-actions.es.js +289 -544
- package/lib/product-context.cjs.js +1 -1
- package/lib/product-context.es.js +13 -15
- package/lib/product-schema.cjs.js +1 -1
- package/lib/product-schema.es.js +99 -134
- package/lib/providers/freemius.cjs.js +1 -5
- package/lib/providers/freemius.es.js +446 -530
- package/lib/providers/stripe.cjs.js +1 -1
- package/lib/providers/stripe.es.js +417 -477
- package/lib/server-actions/coupon-actions.cjs.js +1 -1
- package/lib/server-actions/coupon-actions.es.js +22 -22
- package/lib/server-actions/customer-actions.cjs.js +1 -1
- package/lib/server-actions/customer-actions.es.js +26 -28
- package/lib/server-actions/product-actions.cjs.js +1 -1
- package/lib/server-actions/product-actions.es.js +9 -15
- package/lib/server-actions/shipping-actions.cjs.js +1 -1
- package/lib/server-actions/shipping-actions.es.js +27 -24
- package/lib/server-actions/tax-actions.cjs.js +1 -1
- package/lib/server-actions/tax-actions.es.js +33 -39
- package/lib/shared-inventory.cjs.js +2 -2
- package/lib/shared-inventory.es.js +111 -160
- package/lib/shipping/resolver.cjs.js +2 -2
- package/lib/shipping/resolver.es.js +44 -61
- package/lib/shipping-rate-currency.cjs.js +1 -1
- package/lib/shipping-rate-currency.es.js +52 -67
- package/lib/states.cjs.js +1 -1
- package/lib/states.es.js +333 -154
- package/lib/stripe/checkout.cjs.js +1 -1
- package/lib/stripe/checkout.es.js +125 -181
- package/lib/stripe/client.cjs.js +1 -1
- package/lib/stripe/client.es.js +14 -19
- package/lib/stripe/order-sync.cjs.js +1 -1
- package/lib/stripe/order-sync.es.js +106 -126
- package/lib/stripe/webhooks.cjs.js +1 -1
- package/lib/stripe/webhooks.es.js +37 -31
- package/lib/tax-calculation.cjs.js +1 -1
- package/lib/tax-calculation.es.js +84 -98
- package/lib/trials.cjs.js +1 -1
- package/lib/trials.es.js +24 -30
- package/lib/types.cjs.js +1 -1
- package/lib/types.es.js +21 -27
- package/lib/use-cart.cjs.js +1 -1
- package/lib/use-cart.es.js +38 -40
- package/lib/use-price-formatter.cjs.js +1 -1
- package/lib/use-price-formatter.es.js +10 -11
- package/lib/variation-utils.cjs.js +1 -1
- package/lib/variation-utils.es.js +199 -261
- package/lib/zod-config.cjs.js +1 -1
- package/lib/zod-config.es.js +5 -6
- package/package.json +16 -16
- package/server.cjs.js +1 -1
- package/server.es.js +56 -211
|
@@ -1,196 +1,260 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
1
|
+
import { formatInvoiceCurrency as e, formatInvoiceDate as t, getInvoiceAddressLines as n } from "../invoice.es.js";
|
|
2
|
+
import { getOrderTaxRateJurisdiction as r, getOrderTaxRateLabel as i, getOrderTaxRatePercentage as a } from "../order-tax-details.es.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import c from "next/image";
|
|
6
|
+
//#region libs/ecommerce/src/lib/components/InvoiceDocument.tsx
|
|
7
|
+
function l({ data: l, labels: p, locale: m = "en-US", className: h = "" }) {
|
|
8
|
+
let g = n(l.settings.address), _ = n(l.order.customer_details?.billing), v = n(l.order.customer_details?.shipping);
|
|
9
|
+
return /* @__PURE__ */ s("section", {
|
|
10
|
+
className: `rounded-2xl border bg-white text-slate-900 shadow-sm print:rounded-none print:border-0 print:text-[10px] print:shadow-none ${h}`,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ o("div", {
|
|
13
|
+
className: "border-b px-6 py-6 print:px-0",
|
|
14
|
+
children: /* @__PURE__ */ s("div", {
|
|
15
|
+
className: "grid gap-6 md:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] md:items-start print:grid-cols-[minmax(0,1fr)_72px_280px] print:items-start print:gap-4",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ s("div", {
|
|
18
|
+
className: "order-2 max-w-md space-y-4 print:order-none print:max-w-none print:space-y-2 md:order-none",
|
|
19
|
+
children: [/* @__PURE__ */ s("div", {
|
|
20
|
+
className: "space-y-1 text-sm print:text-[10px]",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ o("p", {
|
|
23
|
+
className: "text-xs font-semibold uppercase tracking-[0.2em] text-slate-500",
|
|
24
|
+
children: p.from
|
|
25
|
+
}),
|
|
26
|
+
l.settings.businessName ? /* @__PURE__ */ o("p", {
|
|
27
|
+
className: "text-base font-semibold",
|
|
28
|
+
children: l.settings.businessName
|
|
29
|
+
}) : null,
|
|
30
|
+
g.map((e, t) => /* @__PURE__ */ o("p", { children: e }, `seller-${t}-${e}`)),
|
|
31
|
+
l.settings.email ? /* @__PURE__ */ o("p", { children: l.settings.email }) : null,
|
|
32
|
+
l.settings.phone ? /* @__PURE__ */ o("p", { children: l.settings.phone }) : null
|
|
33
|
+
]
|
|
34
|
+
}), l.settings.taxRegistrations.length > 0 ? /* @__PURE__ */ s("div", {
|
|
35
|
+
className: "rounded-xl border bg-slate-50 px-4 py-3 text-sm print:px-3 print:py-2 print:text-[10px]",
|
|
36
|
+
children: [/* @__PURE__ */ o("p", {
|
|
37
|
+
className: "mb-2 font-semibold",
|
|
38
|
+
children: p.taxRegistrations
|
|
39
|
+
}), /* @__PURE__ */ o("div", {
|
|
40
|
+
className: "space-y-1",
|
|
41
|
+
children: l.settings.taxRegistrations.map((e, t) => /* @__PURE__ */ s("p", { children: [
|
|
42
|
+
/* @__PURE__ */ o("span", {
|
|
43
|
+
className: "font-medium",
|
|
44
|
+
children: e.label
|
|
45
|
+
}),
|
|
46
|
+
e.label && e.value ? ": " : "",
|
|
47
|
+
e.value
|
|
48
|
+
] }, `${e.label}-${e.value}-${t}`))
|
|
49
|
+
})]
|
|
50
|
+
}) : null]
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ o("div", {
|
|
53
|
+
className: "order-1 flex justify-center md:order-none md:pt-2 print:order-none print:pt-1",
|
|
54
|
+
children: l.logo?.url ? /* @__PURE__ */ o(c, {
|
|
55
|
+
src: l.logo.url,
|
|
56
|
+
alt: l.logo.name || l.settings.businessName || "Logo",
|
|
57
|
+
className: "mx-auto h-24 w-auto object-contain print:h-14",
|
|
58
|
+
width: l.logo.width || 320,
|
|
59
|
+
height: l.logo.height || 120
|
|
60
|
+
}) : null
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ o("div", {
|
|
63
|
+
className: "order-3 flex justify-start md:order-none md:justify-end print:order-none",
|
|
64
|
+
children: /* @__PURE__ */ s("div", {
|
|
65
|
+
className: "w-full max-w-[380px] rounded-2xl bg-slate-950 px-5 py-5 text-white print:max-w-none print:border print:border-slate-300 print:bg-white print:px-3 print:py-3 print:text-[10px] print:text-slate-950",
|
|
66
|
+
children: [/* @__PURE__ */ o("p", {
|
|
67
|
+
className: "text-xs uppercase tracking-[0.2em] text-white/70 print:text-slate-500",
|
|
68
|
+
children: p.invoice
|
|
69
|
+
}), /* @__PURE__ */ s("div", {
|
|
70
|
+
className: "mt-4 space-y-3 text-sm print:mt-3 print:space-y-2 print:text-[10px]",
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ o(d, {
|
|
73
|
+
label: p.invoiceNumber,
|
|
74
|
+
value: l.order.invoice_number || "--"
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ o(d, {
|
|
77
|
+
label: p.orderNumber,
|
|
78
|
+
value: l.order.id
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ o(d, {
|
|
81
|
+
label: p.paidOn,
|
|
82
|
+
value: t(l.order.paid_at || l.order.created_at, m) || "--"
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ o(d, {
|
|
85
|
+
label: p.status,
|
|
86
|
+
value: l.order.status
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
})
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ s("div", {
|
|
96
|
+
className: "grid gap-4 border-b px-6 py-6 md:grid-cols-2 print:grid-cols-2 print:gap-3 print:px-0 print:py-3",
|
|
97
|
+
children: [/* @__PURE__ */ o(u, {
|
|
98
|
+
title: p.billTo,
|
|
99
|
+
lines: _
|
|
100
|
+
}), /* @__PURE__ */ o(u, {
|
|
101
|
+
title: p.shipTo,
|
|
102
|
+
lines: v
|
|
103
|
+
})]
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ s("div", {
|
|
106
|
+
className: "px-6 py-6 print:px-0 print:py-3",
|
|
107
|
+
children: [/* @__PURE__ */ o("div", {
|
|
108
|
+
className: "overflow-x-auto rounded-2xl border print:overflow-visible",
|
|
109
|
+
children: /* @__PURE__ */ s("table", {
|
|
110
|
+
className: "w-full border-collapse text-sm tabular-nums print:table-fixed print:text-[9px]",
|
|
111
|
+
children: [/* @__PURE__ */ o("thead", {
|
|
112
|
+
className: "bg-slate-50",
|
|
113
|
+
children: /* @__PURE__ */ s("tr", { children: [
|
|
114
|
+
/* @__PURE__ */ o("th", {
|
|
115
|
+
className: "px-4 py-3 text-left font-semibold print:w-[22%] print:px-2 print:py-1.5",
|
|
116
|
+
children: p.item
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ o("th", {
|
|
119
|
+
className: "px-4 py-3 text-left font-semibold print:w-[38%] print:px-2 print:py-1.5",
|
|
120
|
+
children: p.details
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ o("th", {
|
|
123
|
+
className: "px-4 py-3 text-right font-semibold print:w-[10%] print:px-2 print:py-1.5",
|
|
124
|
+
children: p.quantity
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ o("th", {
|
|
127
|
+
className: "px-4 py-3 text-right font-semibold print:w-[15%] print:px-2 print:py-1.5",
|
|
128
|
+
children: p.price
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ o("th", {
|
|
131
|
+
className: "px-4 py-3 text-right font-semibold print:w-[15%] print:px-2 print:py-1.5",
|
|
132
|
+
children: p.amount
|
|
133
|
+
})
|
|
134
|
+
] })
|
|
135
|
+
}), /* @__PURE__ */ o("tbody", { children: l.order.items.map((t) => /* @__PURE__ */ s("tr", {
|
|
136
|
+
className: "border-t",
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ o("td", {
|
|
139
|
+
className: "px-4 py-4 font-medium print:px-2 print:py-1.5",
|
|
140
|
+
children: t.title
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ o("td", {
|
|
143
|
+
className: "px-4 py-4 text-slate-600 print:px-2 print:py-1.5",
|
|
144
|
+
children: t.description || "--"
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ o("td", {
|
|
147
|
+
className: "px-4 py-4 text-right print:px-2 print:py-1.5",
|
|
148
|
+
children: t.quantity
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ o("td", {
|
|
151
|
+
className: "px-4 py-4 text-right print:px-2 print:py-1.5",
|
|
152
|
+
children: e(t.unit_amount, l.order.currency, m)
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ o("td", {
|
|
155
|
+
className: "px-4 py-4 text-right font-medium print:px-2 print:py-1.5",
|
|
156
|
+
children: e(t.total_amount, l.order.currency, m)
|
|
157
|
+
})
|
|
158
|
+
]
|
|
159
|
+
}, t.id)) })]
|
|
160
|
+
})
|
|
161
|
+
}), /* @__PURE__ */ s("div", {
|
|
162
|
+
className: "mt-6 grid gap-6 md:grid-cols-[minmax(0,1fr)_320px] print:mt-4 print:grid-cols-[minmax(0,1fr)_220px] print:items-start print:gap-4",
|
|
163
|
+
children: [/* @__PURE__ */ o("div", { children: l.order.tax_details?.lines?.length ? /* @__PURE__ */ s("div", {
|
|
164
|
+
className: "rounded-xl border bg-slate-50 px-5 py-4 print:break-inside-avoid print:px-3 print:py-2.5 print:text-[10px]",
|
|
165
|
+
children: [/* @__PURE__ */ o("p", {
|
|
166
|
+
className: "mb-3 font-semibold",
|
|
167
|
+
children: p.taxBreakdown
|
|
168
|
+
}), /* @__PURE__ */ o("div", {
|
|
169
|
+
className: "space-y-3 text-sm print:space-y-2 print:text-[10px]",
|
|
170
|
+
children: l.order.tax_details.lines.map((t, n) => {
|
|
171
|
+
let c = a(t.rate);
|
|
172
|
+
return /* @__PURE__ */ s("div", {
|
|
173
|
+
className: "flex items-start justify-between gap-4",
|
|
174
|
+
children: [/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ s("p", {
|
|
175
|
+
className: "font-medium",
|
|
176
|
+
children: [i(t.rate), typeof c == "number" ? ` - ${c.toFixed(4)}%` : ""]
|
|
177
|
+
}), r(t.rate) ? /* @__PURE__ */ o("p", {
|
|
178
|
+
className: "text-xs text-slate-500 print:text-[9px]",
|
|
179
|
+
children: r(t.rate)
|
|
180
|
+
}) : null] }), /* @__PURE__ */ o("span", { children: e(t.amount, l.order.currency, m) })]
|
|
181
|
+
}, `${t.rate.display_name}-${t.description || "tax"}-${n}`);
|
|
182
|
+
})
|
|
183
|
+
})]
|
|
184
|
+
}) : null }), /* @__PURE__ */ s("div", {
|
|
185
|
+
className: "rounded-xl border bg-slate-950 px-5 py-5 text-sm text-white print:break-inside-avoid print:border-slate-300 print:bg-white print:px-3 print:py-3 print:text-[10px] print:text-slate-950",
|
|
186
|
+
children: [/* @__PURE__ */ s("div", {
|
|
187
|
+
className: "space-y-3 print:space-y-2",
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ o(f, {
|
|
190
|
+
label: p.subtotal,
|
|
191
|
+
value: e(l.order.subtotal, l.order.currency, m)
|
|
192
|
+
}),
|
|
193
|
+
l.order.discount_total > 0 ? /* @__PURE__ */ o(f, {
|
|
194
|
+
label: l.order.coupon_code ? `${p.discount} (${l.order.coupon_code})` : p.discount,
|
|
195
|
+
value: `-${e(l.order.discount_total, l.order.currency, m)}`
|
|
196
|
+
}) : null,
|
|
197
|
+
/* @__PURE__ */ o(f, {
|
|
198
|
+
label: p.shipping,
|
|
199
|
+
value: e(l.order.shipping_total, l.order.currency, m)
|
|
200
|
+
}),
|
|
201
|
+
/* @__PURE__ */ o(f, {
|
|
202
|
+
label: p.tax,
|
|
203
|
+
value: e(l.order.tax_total, l.order.currency, m)
|
|
204
|
+
})
|
|
205
|
+
]
|
|
206
|
+
}), /* @__PURE__ */ o("div", {
|
|
207
|
+
className: "mt-4 border-t border-white/15 pt-4 print:mt-3 print:border-slate-300 print:pt-3",
|
|
208
|
+
children: /* @__PURE__ */ o(f, {
|
|
209
|
+
label: p.total,
|
|
210
|
+
value: e(l.order.total, l.order.currency, m),
|
|
211
|
+
strong: !0
|
|
212
|
+
})
|
|
213
|
+
})]
|
|
214
|
+
})]
|
|
215
|
+
})]
|
|
216
|
+
})
|
|
217
|
+
]
|
|
218
|
+
});
|
|
165
219
|
}
|
|
166
|
-
function
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
220
|
+
function u({ title: e, lines: t }) {
|
|
221
|
+
return /* @__PURE__ */ s("div", {
|
|
222
|
+
className: "rounded-xl border bg-slate-50 px-5 py-4 print:break-inside-avoid print:px-3 print:py-2.5 print:text-[10px]",
|
|
223
|
+
children: [/* @__PURE__ */ o("p", {
|
|
224
|
+
className: "mb-3 text-xs font-semibold uppercase tracking-[0.2em] text-slate-500",
|
|
225
|
+
children: e
|
|
226
|
+
}), t.length ? /* @__PURE__ */ o("div", {
|
|
227
|
+
className: "space-y-1 text-sm print:text-[10px]",
|
|
228
|
+
children: t.map((t, n) => /* @__PURE__ */ o("p", { children: t }, `${e}-${n}-${t}`))
|
|
229
|
+
}) : /* @__PURE__ */ o("p", {
|
|
230
|
+
className: "text-sm text-slate-500",
|
|
231
|
+
children: "--"
|
|
232
|
+
})]
|
|
233
|
+
});
|
|
171
234
|
}
|
|
172
|
-
function
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
235
|
+
function d({ label: e, value: t }) {
|
|
236
|
+
return /* @__PURE__ */ s("div", {
|
|
237
|
+
className: "flex items-center justify-between gap-4",
|
|
238
|
+
children: [/* @__PURE__ */ o("span", {
|
|
239
|
+
className: "text-white/70 print:text-[9px] print:text-slate-500",
|
|
240
|
+
children: e
|
|
241
|
+
}), /* @__PURE__ */ o("span", {
|
|
242
|
+
className: "text-right font-medium",
|
|
243
|
+
children: t
|
|
244
|
+
})]
|
|
245
|
+
});
|
|
177
246
|
}
|
|
178
|
-
function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
),
|
|
191
|
-
/* @__PURE__ */ e("span", { className: p ? "text-lg font-semibold print:text-base" : "font-medium", children: r })
|
|
192
|
-
] });
|
|
247
|
+
function f({ label: e, value: t, strong: n = !1 }) {
|
|
248
|
+
return /* @__PURE__ */ s("div", {
|
|
249
|
+
className: "flex items-center justify-between gap-4",
|
|
250
|
+
children: [/* @__PURE__ */ o("span", {
|
|
251
|
+
className: n ? "text-base font-semibold print:text-sm" : "text-white/75 print:text-[9px] print:text-slate-500",
|
|
252
|
+
children: e
|
|
253
|
+
}), /* @__PURE__ */ o("span", {
|
|
254
|
+
className: n ? "text-lg font-semibold print:text-base" : "font-medium",
|
|
255
|
+
children: t
|
|
256
|
+
})]
|
|
257
|
+
});
|
|
193
258
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
};
|
|
259
|
+
//#endregion
|
|
260
|
+
export { l as InvoiceDocument };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("./InvoiceDocument.cjs.js");let n=require("@nextblock-cms/ui/button"),r=require("next/link");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");function o({invoice:e,labels:o,locale:s,title:c,description:l,printLabel:u,headerVisual:d,action:f,loading:p=!1,loadingMessage:m,error:h,onRetry:g,retryLabel:_,emptyMessage:v,className:y=``,showHeader:b=!0,beforeInvoice:x}){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`style`,{children:`
|
|
2
2
|
@media print {
|
|
3
3
|
@page {
|
|
4
4
|
size: portrait;
|
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
padding: 0;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
`}),
|
|
29
|
+
`}),(0,a.jsxs)(`div`,{className:`mx-auto max-w-6xl px-4 py-10 md:px-6 print:max-w-none print:px-0 print:py-0 ${y}`,children:[b?(0,a.jsxs)(`div`,{className:`mb-6 flex flex-col gap-4 md:flex-row md:items-center md:justify-between print:hidden`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-4`,children:[d?(0,a.jsx)(`div`,{className:`shrink-0`,children:d}):null,(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h1`,{className:`text-3xl font-bold`,children:c}),l?(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}):null]})]}),(0,a.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,a.jsxs)(n.Button,{type:`button`,variant:`outline`,onClick:()=>window.print(),disabled:!e,children:[(0,a.jsx)(i.Printer,{className:`mr-2 h-4 w-4`}),u]}),f?(0,a.jsx)(n.Button,{asChild:!0,variant:f.variant||`default`,children:(0,a.jsx)(r.default,{href:f.href,children:f.label})}):null]})]}):null,p?(0,a.jsx)(`div`,{role:`status`,className:`mb-6 flex items-center justify-center gap-3 rounded-2xl border bg-background px-5 py-4 text-sm text-muted-foreground print:hidden`,children:m}):null,h?(0,a.jsxs)(`div`,{role:`alert`,className:`mb-6 flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-amber-200 bg-amber-50 px-5 py-4 text-sm text-amber-800 print:hidden dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200`,children:[(0,a.jsx)(`span`,{children:h}),g&&_?(0,a.jsx)(n.Button,{type:`button`,size:`sm`,variant:`outline`,onClick:g,children:_}):null]}):null,x,e?(0,a.jsx)(`div`,{"data-print-invoice-root":!0,children:(0,a.jsx)(t.InvoiceDocument,{data:e,labels:o,locale:s})}):!p&&!h?(0,a.jsx)(`div`,{className:`rounded-2xl border bg-background px-6 py-12 text-center text-muted-foreground print:hidden`,children:v}):null]})]})}exports.InvoiceViewerShell=o;
|
|
@@ -27,5 +27,5 @@ interface InvoiceViewerShellProps {
|
|
|
27
27
|
/** Optional content rendered above the invoice (and hidden when printing). */
|
|
28
28
|
beforeInvoice?: ReactNode;
|
|
29
29
|
}
|
|
30
|
-
export declare function InvoiceViewerShell({ invoice, labels, locale, title, description, printLabel, headerVisual, action, loading, loadingMessage, error, onRetry, retryLabel, emptyMessage, className, showHeader, beforeInvoice, }: InvoiceViewerShellProps): import(
|
|
30
|
+
export declare function InvoiceViewerShell({ invoice, labels, locale, title, description, printLabel, headerVisual, action, loading, loadingMessage, error, onRetry, retryLabel, emptyMessage, className, showHeader, beforeInvoice, }: InvoiceViewerShellProps): import('react').JSX.Element;
|
|
31
31
|
export {};
|