@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,291 +1,286 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
] }, `translations-${s.id}`)) })
|
|
285
|
-
] })
|
|
286
|
-
] }, e.id)) })
|
|
287
|
-
] });
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as e } from "react";
|
|
3
|
+
import { ChevronDown as t, ChevronUp as n, Plus as r, Trash2 as i } from "lucide-react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { useRouter as s } from "next/navigation";
|
|
6
|
+
import { Badge as c, Button as l, Input as u, Label as d } from "@nextblock-cms/ui";
|
|
7
|
+
//#region libs/ecommerce/src/lib/pages/cms/products/attributes/components/AttributeManager.tsx
|
|
8
|
+
function f({ attributes: f, languages: p, createAttributeAction: m, deleteAttributeAction: h, createTermAction: g, deleteTermAction: _, reorderTermsAction: v, updateTranslationsAction: y }) {
|
|
9
|
+
let b = s(), [x, S] = e(""), [C, w] = e(null), [T, E] = e(null), [D, O] = e(null), [k, A] = e(null), [j, M] = e({}), [N, P] = e(() => f.reduce((e, t) => (e[t.id] = t.name_translations || {}, e), {})), [F, I] = e(() => f.reduce((e, t) => {
|
|
10
|
+
for (let n of t.terms) e[n.id] = n.value_translations || {};
|
|
11
|
+
return e;
|
|
12
|
+
}, {})), L = p.filter((e) => !e.is_default), R = async (e) => {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
let t = await m({ name: x });
|
|
15
|
+
if (!t.success) {
|
|
16
|
+
alert(t.error || "Failed to create attribute.");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
S(""), b.refresh();
|
|
20
|
+
}, z = async (e, t) => {
|
|
21
|
+
e.preventDefault(), w(t);
|
|
22
|
+
let n = await g({
|
|
23
|
+
attributeId: t,
|
|
24
|
+
value: j[t] || ""
|
|
25
|
+
});
|
|
26
|
+
if (w(null), !n.success) {
|
|
27
|
+
alert(n.error || "Failed to create term.");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
M((e) => ({
|
|
31
|
+
...e,
|
|
32
|
+
[t]: ""
|
|
33
|
+
})), b.refresh();
|
|
34
|
+
}, B = async (e) => {
|
|
35
|
+
if (!window.confirm("Delete this attribute and all of its terms?")) return;
|
|
36
|
+
let t = await h(e);
|
|
37
|
+
if (!t.success) {
|
|
38
|
+
alert(t.error || "Failed to delete attribute.");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
b.refresh();
|
|
42
|
+
}, V = async (e) => {
|
|
43
|
+
E(e);
|
|
44
|
+
let t = await _(e);
|
|
45
|
+
if (E(null), !t.success) {
|
|
46
|
+
alert(t.error || "Failed to delete term.");
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
b.refresh();
|
|
50
|
+
}, H = async (e, t, n) => {
|
|
51
|
+
let r = e.terms.findIndex((e) => e.id === t), i = r + n;
|
|
52
|
+
if (r === -1 || i < 0 || i >= e.terms.length) return;
|
|
53
|
+
let a = [...e.terms], [o] = a.splice(r, 1);
|
|
54
|
+
a.splice(i, 0, o), O(e.id);
|
|
55
|
+
let s = await v({
|
|
56
|
+
attributeId: e.id,
|
|
57
|
+
orderedTermIds: a.map((e) => e.id)
|
|
58
|
+
});
|
|
59
|
+
if (O(null), !s.success) {
|
|
60
|
+
alert(s.error || "Failed to reorder terms.");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
b.refresh();
|
|
64
|
+
}, U = async (e) => {
|
|
65
|
+
A(e.id);
|
|
66
|
+
let t = await y({
|
|
67
|
+
attributeId: e.id,
|
|
68
|
+
nameTranslations: N[e.id] || {},
|
|
69
|
+
termTranslations: e.terms.map((e) => ({
|
|
70
|
+
termId: e.id,
|
|
71
|
+
valueTranslations: F[e.id] || {}
|
|
72
|
+
}))
|
|
73
|
+
});
|
|
74
|
+
if (A(null), !t.success) {
|
|
75
|
+
alert(t.error || "Failed to save translations.");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
b.refresh();
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ o("div", {
|
|
81
|
+
className: "space-y-6",
|
|
82
|
+
children: [/* @__PURE__ */ a("form", {
|
|
83
|
+
onSubmit: R,
|
|
84
|
+
className: "rounded-lg border bg-card p-6 shadow-sm",
|
|
85
|
+
children: /* @__PURE__ */ o("div", {
|
|
86
|
+
className: "flex flex-wrap items-end gap-4",
|
|
87
|
+
children: [/* @__PURE__ */ o("div", {
|
|
88
|
+
className: "flex-1 min-w-[220px] space-y-2",
|
|
89
|
+
children: [/* @__PURE__ */ a(d, {
|
|
90
|
+
htmlFor: "attribute-name",
|
|
91
|
+
children: "New Attribute"
|
|
92
|
+
}), /* @__PURE__ */ a(u, {
|
|
93
|
+
id: "attribute-name",
|
|
94
|
+
value: x,
|
|
95
|
+
onChange: (e) => S(e.target.value),
|
|
96
|
+
placeholder: "Material, Size, Color..."
|
|
97
|
+
})]
|
|
98
|
+
}), /* @__PURE__ */ o(l, {
|
|
99
|
+
type: "submit",
|
|
100
|
+
disabled: !x.trim(),
|
|
101
|
+
children: [/* @__PURE__ */ a(r, { className: "mr-2 h-4 w-4" }), "Create Attribute"]
|
|
102
|
+
})]
|
|
103
|
+
})
|
|
104
|
+
}), f.length === 0 ? /* @__PURE__ */ a("div", {
|
|
105
|
+
className: "rounded-lg border border-dashed p-6 text-sm text-muted-foreground",
|
|
106
|
+
children: "No global attributes have been created yet."
|
|
107
|
+
}) : /* @__PURE__ */ a("div", {
|
|
108
|
+
className: "grid gap-6",
|
|
109
|
+
children: f.map((e) => /* @__PURE__ */ o("div", {
|
|
110
|
+
className: "rounded-lg border bg-card p-6 shadow-sm",
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ o("div", {
|
|
113
|
+
className: "flex flex-wrap items-start justify-between gap-4",
|
|
114
|
+
children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("h2", {
|
|
115
|
+
className: "text-lg font-semibold",
|
|
116
|
+
children: e.name
|
|
117
|
+
}), /* @__PURE__ */ a("p", {
|
|
118
|
+
className: "text-sm text-muted-foreground",
|
|
119
|
+
children: e.slug
|
|
120
|
+
})] }), /* @__PURE__ */ a(l, {
|
|
121
|
+
type: "button",
|
|
122
|
+
variant: "ghost",
|
|
123
|
+
size: "icon",
|
|
124
|
+
onClick: () => B(e.id),
|
|
125
|
+
className: "text-muted-foreground hover:text-destructive",
|
|
126
|
+
children: /* @__PURE__ */ a(i, { className: "h-4 w-4" })
|
|
127
|
+
})]
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ a("div", {
|
|
130
|
+
className: "mt-4 space-y-2",
|
|
131
|
+
children: e.terms.map((r, s) => /* @__PURE__ */ o("div", {
|
|
132
|
+
className: "flex flex-wrap items-center justify-between gap-3 rounded-lg border bg-muted/20 px-3 py-2",
|
|
133
|
+
children: [/* @__PURE__ */ o("div", {
|
|
134
|
+
className: "flex items-center gap-2",
|
|
135
|
+
children: [/* @__PURE__ */ a(c, {
|
|
136
|
+
variant: "secondary",
|
|
137
|
+
className: "py-1.5",
|
|
138
|
+
children: r.value
|
|
139
|
+
}), /* @__PURE__ */ o("span", {
|
|
140
|
+
className: "text-xs text-muted-foreground",
|
|
141
|
+
children: ["Position ", s + 1]
|
|
142
|
+
})]
|
|
143
|
+
}), /* @__PURE__ */ o("div", {
|
|
144
|
+
className: "flex items-center gap-1",
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ a(l, {
|
|
147
|
+
type: "button",
|
|
148
|
+
variant: "ghost",
|
|
149
|
+
size: "icon",
|
|
150
|
+
className: "h-8 w-8",
|
|
151
|
+
onClick: () => H(e, r.id, -1),
|
|
152
|
+
disabled: s === 0 || D === e.id,
|
|
153
|
+
children: /* @__PURE__ */ a(n, { className: "h-4 w-4" })
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ a(l, {
|
|
156
|
+
type: "button",
|
|
157
|
+
variant: "ghost",
|
|
158
|
+
size: "icon",
|
|
159
|
+
className: "h-8 w-8",
|
|
160
|
+
onClick: () => H(e, r.id, 1),
|
|
161
|
+
disabled: s === e.terms.length - 1 || D === e.id,
|
|
162
|
+
children: /* @__PURE__ */ a(t, { className: "h-4 w-4" })
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ a(l, {
|
|
165
|
+
type: "button",
|
|
166
|
+
variant: "ghost",
|
|
167
|
+
size: "icon",
|
|
168
|
+
onClick: () => V(r.id),
|
|
169
|
+
className: "h-8 w-8 text-muted-foreground hover:text-destructive",
|
|
170
|
+
disabled: T === r.id,
|
|
171
|
+
children: /* @__PURE__ */ a(i, { className: "h-4 w-4" })
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
})]
|
|
175
|
+
}, r.id))
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ o("form", {
|
|
178
|
+
onSubmit: (t) => z(t, e.id),
|
|
179
|
+
className: "mt-6 flex flex-wrap items-end gap-3",
|
|
180
|
+
children: [/* @__PURE__ */ o("div", {
|
|
181
|
+
className: "flex-1 min-w-[220px] space-y-2",
|
|
182
|
+
children: [/* @__PURE__ */ a(d, {
|
|
183
|
+
htmlFor: `term-input-${e.id}`,
|
|
184
|
+
children: "Add Term"
|
|
185
|
+
}), /* @__PURE__ */ a(u, {
|
|
186
|
+
id: `term-input-${e.id}`,
|
|
187
|
+
value: j[e.id] || "",
|
|
188
|
+
onChange: (t) => M((n) => ({
|
|
189
|
+
...n,
|
|
190
|
+
[e.id]: t.target.value
|
|
191
|
+
})),
|
|
192
|
+
placeholder: `Add a term for ${e.name}`
|
|
193
|
+
})]
|
|
194
|
+
}), /* @__PURE__ */ o(l, {
|
|
195
|
+
type: "submit",
|
|
196
|
+
variant: "outline",
|
|
197
|
+
disabled: !j[e.id]?.trim() || C === e.id,
|
|
198
|
+
children: [/* @__PURE__ */ a(r, { className: "mr-2 h-4 w-4" }), C === e.id ? "Saving..." : "Add Term"]
|
|
199
|
+
})]
|
|
200
|
+
}),
|
|
201
|
+
L.length > 0 && /* @__PURE__ */ o("div", {
|
|
202
|
+
className: "mt-6 border-t pt-6 space-y-4",
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ o("div", {
|
|
205
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
206
|
+
children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("h3", {
|
|
207
|
+
className: "font-medium",
|
|
208
|
+
children: "Translations"
|
|
209
|
+
}), /* @__PURE__ */ a("p", {
|
|
210
|
+
className: "text-sm text-muted-foreground",
|
|
211
|
+
children: "Translate the attribute label and each term for every active site language."
|
|
212
|
+
})] }), /* @__PURE__ */ a(l, {
|
|
213
|
+
type: "button",
|
|
214
|
+
variant: "outline",
|
|
215
|
+
onClick: () => U(e),
|
|
216
|
+
disabled: k === e.id,
|
|
217
|
+
children: k === e.id ? "Saving..." : "Save Translations"
|
|
218
|
+
})]
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ a("div", {
|
|
221
|
+
className: "grid gap-4 md:grid-cols-2",
|
|
222
|
+
children: L.map((t) => /* @__PURE__ */ o("div", {
|
|
223
|
+
className: "space-y-2",
|
|
224
|
+
children: [/* @__PURE__ */ o(d, {
|
|
225
|
+
htmlFor: `attribute-translation-${e.id}-${t.code}`,
|
|
226
|
+
children: [
|
|
227
|
+
"Attribute Name (",
|
|
228
|
+
t.name,
|
|
229
|
+
")"
|
|
230
|
+
]
|
|
231
|
+
}), /* @__PURE__ */ a(u, {
|
|
232
|
+
id: `attribute-translation-${e.id}-${t.code}`,
|
|
233
|
+
value: N[e.id]?.[t.code] || "",
|
|
234
|
+
onChange: (n) => P((r) => ({
|
|
235
|
+
...r,
|
|
236
|
+
[e.id]: {
|
|
237
|
+
...r[e.id] || {},
|
|
238
|
+
[t.code]: n.target.value
|
|
239
|
+
}
|
|
240
|
+
})),
|
|
241
|
+
placeholder: e.name
|
|
242
|
+
})]
|
|
243
|
+
}, `${e.id}-${t.code}`))
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ a("div", {
|
|
246
|
+
className: "space-y-3",
|
|
247
|
+
children: e.terms.map((e) => /* @__PURE__ */ o("div", {
|
|
248
|
+
className: "rounded-lg border p-4 space-y-3",
|
|
249
|
+
children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("p", {
|
|
250
|
+
className: "font-medium",
|
|
251
|
+
children: e.value
|
|
252
|
+
}), /* @__PURE__ */ a("p", {
|
|
253
|
+
className: "text-xs text-muted-foreground",
|
|
254
|
+
children: "Translate this term for each language."
|
|
255
|
+
})] }), /* @__PURE__ */ a("div", {
|
|
256
|
+
className: "grid gap-4 md:grid-cols-2",
|
|
257
|
+
children: L.map((t) => /* @__PURE__ */ o("div", {
|
|
258
|
+
className: "space-y-2",
|
|
259
|
+
children: [/* @__PURE__ */ a(d, {
|
|
260
|
+
htmlFor: `term-translation-${e.id}-${t.code}`,
|
|
261
|
+
children: t.name
|
|
262
|
+
}), /* @__PURE__ */ a(u, {
|
|
263
|
+
id: `term-translation-${e.id}-${t.code}`,
|
|
264
|
+
value: F[e.id]?.[t.code] || "",
|
|
265
|
+
onChange: (n) => I((r) => ({
|
|
266
|
+
...r,
|
|
267
|
+
[e.id]: {
|
|
268
|
+
...r[e.id] || {},
|
|
269
|
+
[t.code]: n.target.value
|
|
270
|
+
}
|
|
271
|
+
})),
|
|
272
|
+
placeholder: e.value
|
|
273
|
+
})]
|
|
274
|
+
}, `${e.id}-${t.code}`))
|
|
275
|
+
})]
|
|
276
|
+
}, `translations-${e.id}`))
|
|
277
|
+
})
|
|
278
|
+
]
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
}, e.id))
|
|
282
|
+
})]
|
|
283
|
+
});
|
|
288
284
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
};
|
|
285
|
+
//#endregion
|
|
286
|
+
export { f as AttributeManager };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require("../../../../../_virtual/_rolldown/runtime.cjs.js"),t=require("../actions.cjs.js"),n=require("../server-actions.cjs.js"),r=require("./components/CategoryManager.cjs.js");let i=require("next/link");i=e.__toESM(i,1);let a=require("lucide-react"),o=require("react/jsx-runtime"),s=require("@nextblock-cms/db/server"),c=require("@nextblock-cms/ui");async function l(){let[e,l]=await Promise.all([t.getCategoriesWithCount(),(0,s.getActiveLanguagesServerSide)()]);return(0,o.jsxs)(`div`,{className:`space-y-8 w-full max-w-[1200px] mx-auto px-6 py-8`,children:[(0,o.jsx)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,o.jsx)(c.Button,{variant:`outline`,size:`icon`,asChild:!0,children:(0,o.jsx)(i.default,{href:`/cms/products`,children:(0,o.jsx)(a.ArrowLeft,{className:`h-4 w-4`})})}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Category Management`}),(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Create and manage product categories for organizing your e-commerce catalog.`})]})]})}),(0,o.jsx)(r.CategoryManager,{initialCategories:e,createCategory:n.createCategoryAction,updateCategory:n.updateCategoryAction,deleteCategory:n.deleteCategoryAction,languages:l})]})}exports.CategoryManagementPage=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function CategoryManagementPage(): Promise<import(
|
|
1
|
+
export declare function CategoryManagementPage(): Promise<import('react').JSX.Element>;
|