@nextblock-cms/ecom 0.18.8 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +1 -1
- package/index.es.js +26 -25
- package/lib/CurrencyProvider.cjs.js +1 -1
- package/lib/CurrencyProvider.es.js +41 -45
- package/lib/PaymentReadinessProvider.cjs.js +1 -1
- package/lib/PaymentReadinessProvider.es.js +15 -19
- package/lib/cart-store.cjs.js +1 -1
- package/lib/cart-store.d.ts +4 -0
- package/lib/cart-store.es.js +77 -69
- package/lib/components/AccountNavigationMenu.cjs.js +1 -1
- package/lib/components/AccountNavigationMenu.es.js +44 -62
- package/lib/components/AddToCartButton.cjs.js +1 -1
- package/lib/components/AddToCartButton.es.js +50 -78
- package/lib/components/Cart.cjs.js +1 -1
- package/lib/components/Cart.es.js +154 -381
- package/lib/components/CartDrawer.cjs.js +1 -1
- package/lib/components/CartDrawer.es.js +143 -297
- package/lib/components/CartIcon.cjs.js +1 -1
- package/lib/components/CartIcon.es.js +21 -47
- package/lib/components/Checkout.cjs.js +1 -1
- package/lib/components/Checkout.es.js +814 -1614
- package/lib/components/CouponForm.cjs.js +1 -1
- package/lib/components/CouponForm.es.js +104 -155
- package/lib/components/CurrencySwitcher.cjs.js +1 -1
- package/lib/components/CurrencySwitcher.es.js +14 -33
- package/lib/components/CustomerProfileForm.cjs.js +1 -1
- package/lib/components/CustomerProfileForm.es.js +264 -672
- package/lib/components/FeaturedProduct.cjs.js +1 -1
- package/lib/components/FeaturedProduct.es.js +46 -125
- package/lib/components/FreemiusLicensePanel.cjs.js +1 -1
- package/lib/components/FreemiusLicensePanel.es.js +45 -125
- package/lib/components/InvoiceDocument.cjs.js +1 -1
- package/lib/components/InvoiceDocument.es.js +148 -487
- package/lib/components/InvoiceViewerShell.cjs.js +2 -2
- package/lib/components/InvoiceViewerShell.d.ts +4 -1
- package/lib/components/InvoiceViewerShell.es.js +59 -142
- package/lib/components/ProductCard.cjs.js +1 -1
- package/lib/components/ProductCard.d.ts +3 -1
- package/lib/components/ProductCard.es.js +128 -242
- package/lib/components/ProductDetailsLayout.cjs.js +1 -1
- package/lib/components/ProductDetailsLayout.es.js +311 -652
- package/lib/components/ProductGallery.cjs.js +1 -1
- package/lib/components/ProductGallery.d.ts +2 -0
- package/lib/components/ProductGallery.es.js +37 -66
- package/lib/components/ProductGrid.cjs.js +1 -1
- package/lib/components/ProductGrid.es.js +23 -32
- package/lib/components/ShippingEstimator.cjs.js +1 -1
- package/lib/components/ShippingEstimator.es.js +118 -231
- package/lib/components/SimpleTiptapRenderer.cjs.js +1 -1
- package/lib/components/SimpleTiptapRenderer.es.js +111 -294
- package/lib/components/SubscriptionSelector.cjs.js +1 -1
- package/lib/components/SubscriptionSelector.es.js +120 -181
- package/lib/freemius-trial-provision.cjs.js +1 -0
- package/lib/freemius-trial-provision.d.ts +85 -0
- package/lib/freemius-trial-provision.es.js +136 -0
- package/lib/invoice.cjs.js +1 -1
- package/lib/invoice.d.ts +1 -1
- package/lib/invoice.es.js +6 -5
- package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +1 -1
- package/lib/pages/cms/coupons/CouponEditorForm.es.js +115 -375
- package/lib/pages/cms/coupons/CouponsPage.cjs.js +2 -2
- package/lib/pages/cms/coupons/CouponsPage.es.js +116 -368
- package/lib/pages/cms/coupons/CreateCouponDialog.cjs.js +1 -1
- package/lib/pages/cms/coupons/CreateCouponDialog.es.js +26 -62
- package/lib/pages/cms/coupons/EditCouponPage.cjs.js +1 -1
- package/lib/pages/cms/coupons/EditCouponPage.es.js +35 -71
- package/lib/pages/cms/coupons/ProductScopePicker.cjs.js +1 -1
- package/lib/pages/cms/coupons/ProductScopePicker.es.js +72 -167
- package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +1 -1
- package/lib/pages/cms/orders/ExportReportsDialog.es.js +87 -247
- package/lib/pages/cms/orders/OrderDetailPage.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderDetailPage.es.js +95 -283
- package/lib/pages/cms/orders/OrderPrintButton.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderPrintButton.es.js +9 -21
- package/lib/pages/cms/orders/OrderStatusForm.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderStatusForm.es.js +46 -106
- package/lib/pages/cms/orders/OrdersPage.cjs.js +1 -1
- package/lib/pages/cms/orders/OrdersPage.es.js +78 -257
- package/lib/pages/cms/payments/PaymentsClient.cjs.js +1 -1
- package/lib/pages/cms/payments/PaymentsClient.es.js +192 -580
- package/lib/pages/cms/payments/PaymentsPage.cjs.js +1 -1
- package/lib/pages/cms/payments/PaymentsPage.es.js +14 -22
- package/lib/pages/cms/products/ProductsPage.cjs.js +1 -1
- package/lib/pages/cms/products/ProductsPage.es.js +47 -87
- package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +1 -1
- package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +97 -177
- package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +1 -1
- package/lib/pages/cms/products/attributes/AttributeManagementPage.es.js +40 -84
- package/lib/pages/cms/products/attributes/components/AttributeManager.cjs.js +1 -1
- package/lib/pages/cms/products/attributes/components/AttributeManager.es.js +192 -455
- package/lib/pages/cms/products/categories/CategoryManagementPage.cjs.js +1 -1
- package/lib/pages/cms/products/categories/CategoryManagementPage.es.js +28 -72
- package/lib/pages/cms/products/categories/components/CategoryManager.cjs.js +1 -1
- package/lib/pages/cms/products/categories/components/CategoryManager.es.js +183 -490
- package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +1 -1
- package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +69 -177
- package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +1 -1
- package/lib/pages/cms/products/components/CurrencyPriceFields.es.js +102 -213
- package/lib/pages/cms/products/components/DeleteProductButton.cjs.js +1 -1
- package/lib/pages/cms/products/components/DeleteProductButton.es.js +25 -45
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs.js +1 -1
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.es.js +58 -202
- package/lib/pages/cms/products/components/ProductCategorySelector.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductCategorySelector.es.js +89 -235
- package/lib/pages/cms/products/components/ProductForm.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductForm.es.js +526 -1110
- package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductMediaManager.es.js +63 -154
- package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductsBulkTable.es.js +213 -544
- package/lib/pages/cms/products/components/SaleScheduleFields.cjs.js +1 -1
- package/lib/pages/cms/products/components/SaleScheduleFields.es.js +91 -207
- package/lib/pages/cms/products/components/SyncFreemiusButton.cjs.js +1 -1
- package/lib/pages/cms/products/components/SyncFreemiusButton.es.js +16 -28
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs.js +2 -2
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.es.js +25 -37
- package/lib/pages/cms/products/components/VariationsEditor.cjs.js +1 -1
- package/lib/pages/cms/products/components/VariationsEditor.es.js +261 -492
- package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +1 -1
- package/lib/pages/cms/products/inventory/InventoryPage.es.js +12 -32
- package/lib/pages/cms/products/inventory/InventoryTableClient.cjs.js +2 -2
- package/lib/pages/cms/products/inventory/InventoryTableClient.es.js +145 -365
- package/lib/pages/cms/products/new/NewProductPage.cjs.js +1 -1
- package/lib/pages/cms/products/new/NewProductPage.es.js +30 -42
- package/lib/pages/cms/shipping/ShippingPage.cjs.js +2 -2
- package/lib/pages/cms/shipping/ShippingPage.es.js +155 -507
- package/lib/pages/cms/shipping/components/RateForm.cjs.js +1 -1
- package/lib/pages/cms/shipping/components/RateForm.es.js +334 -717
- package/lib/pages/cms/shipping/components/ZoneForm.cjs.js +1 -1
- package/lib/pages/cms/shipping/components/ZoneForm.es.js +158 -392
- package/lib/pages/cms/taxes/TaxesPage.cjs.js +1 -1
- package/lib/pages/cms/taxes/TaxesPage.es.js +119 -447
- package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +1 -1
- package/lib/pages/cms/taxes/components/TaxRateForm.es.js +52 -156
- package/lib/product-context.cjs.js +1 -1
- package/lib/product-context.es.js +10 -14
- package/lib/trials.cjs.js +1 -1
- package/lib/trials.d.ts +10 -3
- package/lib/trials.es.js +28 -21
- package/lib/types.d.ts +2 -0
- package/lib/use-price-formatter.cjs.js +1 -0
- package/lib/use-price-formatter.d.ts +11 -0
- package/lib/use-price-formatter.es.js +13 -0
- package/lib/variation-utils.cjs.js +1 -1
- package/lib/variation-utils.d.ts +10 -0
- package/lib/variation-utils.es.js +139 -123
- package/package.json +4 -4
- package/server.cjs.js +1 -1
- package/server.d.ts +1 -0
- package/server.es.js +180 -172
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("@nextblock-cms/ui"),h=require("@nextblock-cms/utils"),c=t=>String(t).padStart(2,"0");function d(t){if(!t)return"";const a=new Date(t);return Number.isNaN(a.getTime())?"":`${a.getFullYear()}-${c(a.getMonth()+1)}-${c(a.getDate())}T${c(a.getHours())}:${c(a.getMinutes())}`}function o(t){if(!t)return null;const a=new Date(t);return Number.isNaN(a.getTime())?null:a.toISOString()}function f({idPrefix:t="product",startAt:a,endAt:x,onChange:n,error:r,disabled:u,description:m,dense:i,bare:p}){const N=Intl.DateTimeFormat().resolvedOptions().timeZone,g=h.cn("h-7 text-xs",i||p?"w-[150px]":"w-[160px] sm:w-[180px]"),j=e.jsxs(e.Fragment,{children:[e.jsx(s.Label,{htmlFor:`${t}-sale-start-at`,className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"Starts"}),e.jsx(s.Input,{id:`${t}-sale-start-at`,type:"datetime-local",value:d(a),disabled:u,onChange:l=>n("sale_start_at",o(l.target.value)),className:g}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),e.jsx(s.Label,{htmlFor:`${t}-sale-end-at`,className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"Ends"}),e.jsx(s.Input,{id:`${t}-sale-end-at`,type:"datetime-local",value:d(x),disabled:u,onChange:l=>n("sale_end_at",o(l.target.value)),className:g})]});return p?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx(s.Label,{htmlFor:`${t}-sale-start-at`,className:"block text-[10px] uppercase font-bold tracking-widest text-muted-foreground",children:"Starts"}),e.jsx(s.Input,{id:`${t}-sale-start-at`,type:"datetime-local",value:d(a),disabled:u,onChange:l=>n("sale_start_at",o(l.target.value)),className:"h-8 w-full text-xs"})]}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx(s.Label,{htmlFor:`${t}-sale-end-at`,className:"block text-[10px] uppercase font-bold tracking-widest text-muted-foreground",children:"Ends"}),e.jsx(s.Input,{id:`${t}-sale-end-at`,type:"datetime-local",value:d(x),disabled:u,onChange:l=>n("sale_end_at",o(l.target.value)),className:"h-8 w-full text-xs"}),r?e.jsx("p",{className:"mt-0.5 text-[10px] text-destructive",children:r}):null]})]}):e.jsxs("div",{className:h.cn("rounded border border-dashed bg-muted/5 space-y-1",i?"p-1.5":"p-2"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5",children:[e.jsx("span",{className:"shrink-0 text-[11px] font-bold uppercase tracking-wider text-muted-foreground",children:"Sale window"}),j,e.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground",children:[N||"local time"," · empty = always on"]})]}),m&&!i?e.jsx("p",{className:"text-[10px] leading-snug text-muted-foreground",children:m}):null,r?e.jsx("p",{className:"text-[11px] text-destructive",children:r}):null]})}exports.SaleScheduleFields=f;
|
|
@@ -1,253 +1,137 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { Label as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
if (!
|
|
2
|
+
import { jsxs as s, Fragment as f, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Label as o, Input as u } from "@nextblock-cms/ui";
|
|
4
|
+
import { cn as w } from "@nextblock-cms/utils";
|
|
5
|
+
const d = (e) => String(e).padStart(2, "0");
|
|
6
|
+
function m(e) {
|
|
7
|
+
if (!e)
|
|
8
8
|
return "";
|
|
9
|
-
const
|
|
10
|
-
return Number.isNaN(
|
|
11
|
-
|
|
12
|
-
)}T${
|
|
9
|
+
const a = new Date(e);
|
|
10
|
+
return Number.isNaN(a.getTime()) ? "" : `${a.getFullYear()}-${d(a.getMonth() + 1)}-${d(
|
|
11
|
+
a.getDate()
|
|
12
|
+
)}T${d(a.getHours())}:${d(a.getMinutes())}`;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
if (!
|
|
14
|
+
function i(e) {
|
|
15
|
+
if (!e)
|
|
16
16
|
return null;
|
|
17
|
-
const
|
|
18
|
-
return Number.isNaN(
|
|
17
|
+
const a = new Date(e);
|
|
18
|
+
return Number.isNaN(a.getTime()) ? null : a.toISOString();
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
idPrefix:
|
|
22
|
-
startAt:
|
|
23
|
-
endAt:
|
|
24
|
-
onChange:
|
|
20
|
+
function k({
|
|
21
|
+
idPrefix: e = "product",
|
|
22
|
+
startAt: a,
|
|
23
|
+
endAt: x,
|
|
24
|
+
onChange: n,
|
|
25
25
|
error: r,
|
|
26
|
-
disabled:
|
|
27
|
-
description:
|
|
28
|
-
dense:
|
|
29
|
-
bare:
|
|
26
|
+
disabled: c,
|
|
27
|
+
description: g,
|
|
28
|
+
dense: p,
|
|
29
|
+
bare: h
|
|
30
30
|
}) {
|
|
31
|
-
const
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
31
|
+
const v = Intl.DateTimeFormat().resolvedOptions().timeZone, N = w("h-7 text-xs", p || h ? "w-[150px]" : "w-[160px] sm:w-[180px]"), $ = /* @__PURE__ */ s(f, { children: [
|
|
32
|
+
/* @__PURE__ */ t(
|
|
33
|
+
o,
|
|
34
34
|
{
|
|
35
|
-
htmlFor: `${
|
|
35
|
+
htmlFor: `${e}-sale-start-at`,
|
|
36
36
|
className: "text-[10px] uppercase tracking-wider text-muted-foreground",
|
|
37
37
|
children: "Starts"
|
|
38
|
-
}
|
|
39
|
-
void 0,
|
|
40
|
-
!1,
|
|
41
|
-
{
|
|
42
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
43
|
-
lineNumber: 72,
|
|
44
|
-
columnNumber: 7
|
|
45
|
-
},
|
|
46
|
-
this
|
|
38
|
+
}
|
|
47
39
|
),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
40
|
+
/* @__PURE__ */ t(
|
|
41
|
+
u,
|
|
50
42
|
{
|
|
51
|
-
id: `${
|
|
43
|
+
id: `${e}-sale-start-at`,
|
|
52
44
|
type: "datetime-local",
|
|
53
|
-
value:
|
|
54
|
-
disabled:
|
|
55
|
-
onChange: (l) =>
|
|
56
|
-
className:
|
|
57
|
-
}
|
|
58
|
-
void 0,
|
|
59
|
-
!1,
|
|
60
|
-
{
|
|
61
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
62
|
-
lineNumber: 78,
|
|
63
|
-
columnNumber: 7
|
|
64
|
-
},
|
|
65
|
-
this
|
|
45
|
+
value: m(a),
|
|
46
|
+
disabled: c,
|
|
47
|
+
onChange: (l) => n("sale_start_at", i(l.target.value)),
|
|
48
|
+
className: N
|
|
49
|
+
}
|
|
66
50
|
),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
columnNumber: 7
|
|
71
|
-
}, this),
|
|
72
|
-
/* @__PURE__ */ e(
|
|
73
|
-
a,
|
|
51
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: "→" }),
|
|
52
|
+
/* @__PURE__ */ t(
|
|
53
|
+
o,
|
|
74
54
|
{
|
|
75
|
-
htmlFor: `${
|
|
55
|
+
htmlFor: `${e}-sale-end-at`,
|
|
76
56
|
className: "text-[10px] uppercase tracking-wider text-muted-foreground",
|
|
77
57
|
children: "Ends"
|
|
78
|
-
}
|
|
79
|
-
void 0,
|
|
80
|
-
!1,
|
|
81
|
-
{
|
|
82
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
83
|
-
lineNumber: 87,
|
|
84
|
-
columnNumber: 7
|
|
85
|
-
},
|
|
86
|
-
this
|
|
58
|
+
}
|
|
87
59
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
60
|
+
/* @__PURE__ */ t(
|
|
61
|
+
u,
|
|
90
62
|
{
|
|
91
|
-
id: `${
|
|
63
|
+
id: `${e}-sale-end-at`,
|
|
92
64
|
type: "datetime-local",
|
|
93
|
-
value:
|
|
94
|
-
disabled:
|
|
95
|
-
onChange: (l) =>
|
|
96
|
-
className:
|
|
97
|
-
}
|
|
98
|
-
void 0,
|
|
99
|
-
!1,
|
|
100
|
-
{
|
|
101
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
102
|
-
lineNumber: 93,
|
|
103
|
-
columnNumber: 7
|
|
104
|
-
},
|
|
105
|
-
this
|
|
65
|
+
value: m(x),
|
|
66
|
+
disabled: c,
|
|
67
|
+
onChange: (l) => n("sale_end_at", i(l.target.value)),
|
|
68
|
+
className: N
|
|
69
|
+
}
|
|
106
70
|
)
|
|
107
|
-
] }
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return b ? /* @__PURE__ */ e(h, { children: [
|
|
113
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 space-y-1", children: [
|
|
114
|
-
/* @__PURE__ */ e(
|
|
115
|
-
a,
|
|
71
|
+
] });
|
|
72
|
+
return h ? /* @__PURE__ */ s(f, { children: [
|
|
73
|
+
/* @__PURE__ */ s("div", { className: "min-w-0 space-y-1", children: [
|
|
74
|
+
/* @__PURE__ */ t(
|
|
75
|
+
o,
|
|
116
76
|
{
|
|
117
|
-
htmlFor: `${
|
|
77
|
+
htmlFor: `${e}-sale-start-at`,
|
|
118
78
|
className: "block text-[10px] uppercase font-bold tracking-widest text-muted-foreground",
|
|
119
79
|
children: "Starts"
|
|
120
|
-
}
|
|
121
|
-
void 0,
|
|
122
|
-
!1,
|
|
123
|
-
{
|
|
124
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
125
|
-
lineNumber: 110,
|
|
126
|
-
columnNumber: 11
|
|
127
|
-
},
|
|
128
|
-
this
|
|
80
|
+
}
|
|
129
81
|
),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
|
|
82
|
+
/* @__PURE__ */ t(
|
|
83
|
+
u,
|
|
132
84
|
{
|
|
133
|
-
id: `${
|
|
85
|
+
id: `${e}-sale-start-at`,
|
|
134
86
|
type: "datetime-local",
|
|
135
|
-
value:
|
|
136
|
-
disabled:
|
|
137
|
-
onChange: (l) =>
|
|
87
|
+
value: m(a),
|
|
88
|
+
disabled: c,
|
|
89
|
+
onChange: (l) => n("sale_start_at", i(l.target.value)),
|
|
138
90
|
className: "h-8 w-full text-xs"
|
|
139
|
-
}
|
|
140
|
-
void 0,
|
|
141
|
-
!1,
|
|
142
|
-
{
|
|
143
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
144
|
-
lineNumber: 116,
|
|
145
|
-
columnNumber: 11
|
|
146
|
-
},
|
|
147
|
-
this
|
|
91
|
+
}
|
|
148
92
|
)
|
|
149
|
-
] },
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}, this),
|
|
154
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 space-y-1", children: [
|
|
155
|
-
/* @__PURE__ */ e(
|
|
156
|
-
a,
|
|
93
|
+
] }),
|
|
94
|
+
/* @__PURE__ */ s("div", { className: "min-w-0 space-y-1", children: [
|
|
95
|
+
/* @__PURE__ */ t(
|
|
96
|
+
o,
|
|
157
97
|
{
|
|
158
|
-
htmlFor: `${
|
|
98
|
+
htmlFor: `${e}-sale-end-at`,
|
|
159
99
|
className: "block text-[10px] uppercase font-bold tracking-widest text-muted-foreground",
|
|
160
100
|
children: "Ends"
|
|
161
|
-
}
|
|
162
|
-
void 0,
|
|
163
|
-
!1,
|
|
164
|
-
{
|
|
165
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
166
|
-
lineNumber: 126,
|
|
167
|
-
columnNumber: 11
|
|
168
|
-
},
|
|
169
|
-
this
|
|
101
|
+
}
|
|
170
102
|
),
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
|
|
103
|
+
/* @__PURE__ */ t(
|
|
104
|
+
u,
|
|
173
105
|
{
|
|
174
|
-
id: `${
|
|
106
|
+
id: `${e}-sale-end-at`,
|
|
175
107
|
type: "datetime-local",
|
|
176
|
-
value:
|
|
177
|
-
disabled:
|
|
178
|
-
onChange: (l) =>
|
|
108
|
+
value: m(x),
|
|
109
|
+
disabled: c,
|
|
110
|
+
onChange: (l) => n("sale_end_at", i(l.target.value)),
|
|
179
111
|
className: "h-8 w-full text-xs"
|
|
180
|
-
}
|
|
181
|
-
void 0,
|
|
182
|
-
!1,
|
|
183
|
-
{
|
|
184
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
185
|
-
lineNumber: 132,
|
|
186
|
-
columnNumber: 11
|
|
187
|
-
},
|
|
188
|
-
this
|
|
112
|
+
}
|
|
189
113
|
),
|
|
190
|
-
r ? /* @__PURE__ */
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
columnNumber: 20
|
|
194
|
-
}, this) : null
|
|
195
|
-
] }, void 0, !0, {
|
|
196
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
197
|
-
lineNumber: 125,
|
|
198
|
-
columnNumber: 9
|
|
199
|
-
}, this)
|
|
200
|
-
] }, void 0, !0, {
|
|
201
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
202
|
-
lineNumber: 108,
|
|
203
|
-
columnNumber: 7
|
|
204
|
-
}, this) : /* @__PURE__ */ e(
|
|
114
|
+
r ? /* @__PURE__ */ t("p", { className: "mt-0.5 text-[10px] text-destructive", children: r }) : null
|
|
115
|
+
] })
|
|
116
|
+
] }) : /* @__PURE__ */ s(
|
|
205
117
|
"div",
|
|
206
118
|
{
|
|
207
|
-
className:
|
|
119
|
+
className: w("rounded border border-dashed bg-muted/5 space-y-1", p ? "p-1.5" : "p-2"),
|
|
208
120
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}, this),
|
|
215
|
-
S,
|
|
216
|
-
/* @__PURE__ */ e("span", { className: "ml-auto text-[10px] text-muted-foreground", children: [
|
|
217
|
-
g || "local time",
|
|
121
|
+
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1.5", children: [
|
|
122
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] font-bold uppercase tracking-wider text-muted-foreground", children: "Sale window" }),
|
|
123
|
+
$,
|
|
124
|
+
/* @__PURE__ */ s("span", { className: "ml-auto text-[10px] text-muted-foreground", children: [
|
|
125
|
+
v || "local time",
|
|
218
126
|
" · empty = always on"
|
|
219
|
-
] }
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}, this)
|
|
224
|
-
] }, void 0, !0, {
|
|
225
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
226
|
-
lineNumber: 150,
|
|
227
|
-
columnNumber: 7
|
|
228
|
-
}, this),
|
|
229
|
-
N && !u ? /* @__PURE__ */ e("p", { className: "text-[10px] leading-snug text-muted-foreground", children: N }, void 0, !1, {
|
|
230
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
231
|
-
lineNumber: 160,
|
|
232
|
-
columnNumber: 9
|
|
233
|
-
}, this) : null,
|
|
234
|
-
r ? /* @__PURE__ */ e("p", { className: "text-[11px] text-destructive", children: r }, void 0, !1, {
|
|
235
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
236
|
-
lineNumber: 162,
|
|
237
|
-
columnNumber: 16
|
|
238
|
-
}, this) : null
|
|
127
|
+
] })
|
|
128
|
+
] }),
|
|
129
|
+
g && !p ? /* @__PURE__ */ t("p", { className: "text-[10px] leading-snug text-muted-foreground", children: g }) : null,
|
|
130
|
+
r ? /* @__PURE__ */ t("p", { className: "text-[11px] text-destructive", children: r }) : null
|
|
239
131
|
]
|
|
240
|
-
}
|
|
241
|
-
void 0,
|
|
242
|
-
!0,
|
|
243
|
-
{
|
|
244
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SaleScheduleFields.tsx",
|
|
245
|
-
lineNumber: 147,
|
|
246
|
-
columnNumber: 5
|
|
247
|
-
},
|
|
248
|
-
this
|
|
132
|
+
}
|
|
249
133
|
);
|
|
250
134
|
}
|
|
251
135
|
export {
|
|
252
|
-
|
|
136
|
+
k as SaleScheduleFields
|
|
253
137
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("react"),u=require("@nextblock-cms/ui"),a=require("lucide-react"),t=require("sonner"),l=require("../actions.cjs.js");function d({title:c="Sync Full Store"}){const[r,s]=i.useState(!1),o=async()=>{s(!0);try{const e=await l.triggerFreemiusSync();e.error?t.toast.error(e.error):t.toast.success(`Full store sync complete! Found ${e.data?.count||0} products.`)}catch(e){t.toast.error(e.message||"An unexpected error occurred during sync")}finally{s(!1)}};return n.jsxs(u.Button,{variant:"secondary",onClick:o,disabled:r,className:"gap-2",children:[n.jsx(a.RefreshCw,{className:`w-4 h-4 ${r?"animate-spin":""}`}),r?"Syncing...":c]})}exports.SyncFreemiusButton=d;
|
|
@@ -1,48 +1,36 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsxs as o, jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { useState as a } from "react";
|
|
4
4
|
import { Button as i } from "@nextblock-cms/ui";
|
|
5
5
|
import { RefreshCw as m } from "lucide-react";
|
|
6
|
-
import { toast as
|
|
7
|
-
import { triggerFreemiusSync as
|
|
8
|
-
function
|
|
9
|
-
const [
|
|
10
|
-
return /* @__PURE__ */
|
|
6
|
+
import { toast as n } from "sonner";
|
|
7
|
+
import { triggerFreemiusSync as l } from "../actions.es.js";
|
|
8
|
+
function h({ title: s = "Sync Full Store" }) {
|
|
9
|
+
const [e, t] = a(!1);
|
|
10
|
+
return /* @__PURE__ */ o(
|
|
11
11
|
i,
|
|
12
12
|
{
|
|
13
13
|
variant: "secondary",
|
|
14
14
|
onClick: async () => {
|
|
15
15
|
t(!0);
|
|
16
16
|
try {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
} catch (
|
|
20
|
-
|
|
17
|
+
const r = await l();
|
|
18
|
+
r.error ? n.error(r.error) : n.success(`Full store sync complete! Found ${r.data?.count || 0} products.`);
|
|
19
|
+
} catch (r) {
|
|
20
|
+
n.error(r.message || "An unexpected error occurred during sync");
|
|
21
21
|
} finally {
|
|
22
22
|
t(!1);
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
disabled:
|
|
25
|
+
disabled: e,
|
|
26
26
|
className: "gap-2",
|
|
27
27
|
children: [
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
lineNumber: 35,
|
|
31
|
-
columnNumber: 7
|
|
32
|
-
}, this),
|
|
33
|
-
r ? "Syncing..." : o
|
|
28
|
+
/* @__PURE__ */ c(m, { className: `w-4 h-4 ${e ? "animate-spin" : ""}` }),
|
|
29
|
+
e ? "Syncing..." : s
|
|
34
30
|
]
|
|
35
|
-
}
|
|
36
|
-
void 0,
|
|
37
|
-
!0,
|
|
38
|
-
{
|
|
39
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SyncFreemiusButton.tsx",
|
|
40
|
-
lineNumber: 29,
|
|
41
|
-
columnNumber: 5
|
|
42
|
-
},
|
|
43
|
-
this
|
|
31
|
+
}
|
|
44
32
|
);
|
|
45
33
|
}
|
|
46
34
|
export {
|
|
47
|
-
|
|
35
|
+
h as SyncFreemiusButton
|
|
48
36
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),u=require("react"),l=require("next/navigation"),d=require("@nextblock-cms/ui"),f=require("lucide-react"),r=require("sonner"),g=require("../actions.cjs.js");function y({productId:t,hasOpenDraft:c=!1}){const o=l.useRouter(),[n,i]=u.useState(!1),a=async()=>{if(!t){r.toast.error("Product ID is missing");return}if(!(c&&!window.confirm(`You have unpublished draft changes for this product.
|
|
2
2
|
|
|
3
3
|
Syncing updates the live pricing now, but publishing your draft afterward will overwrite it with the draft’s older values. Publish or discard your draft first to keep the synced prices.
|
|
4
4
|
|
|
5
|
-
Sync anyway?`))){
|
|
5
|
+
Sync anyway?`))){i(!0);try{const e=await g.triggerSingleProductSync(t);e.error?r.toast.error(e.error):(r.toast.success("Pricing sync complete!"),o.refresh())}catch(e){r.toast.error(e.message||"An unexpected error occurred during sync")}finally{i(!1)}}};return s.jsxs(d.Button,{variant:"outline",onClick:a,disabled:n,className:"gap-2",children:[s.jsx(f.RefreshCw,{className:`w-4 h-4 ${n?"animate-spin":""}`}),n?"Syncing...":"Sync Plans & Pricing from Freemius"]})}exports.SyncFreemiusPricingButton=y;
|
|
@@ -1,61 +1,49 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useRouter as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { RefreshCw as
|
|
7
|
-
import { toast as
|
|
8
|
-
import { triggerSingleProductSync as
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
2
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { useState as u } from "react";
|
|
4
|
+
import { useRouter as f } from "next/navigation";
|
|
5
|
+
import { Button as l } from "@nextblock-cms/ui";
|
|
6
|
+
import { RefreshCw as d } from "lucide-react";
|
|
7
|
+
import { toast as e } from "sonner";
|
|
8
|
+
import { triggerSingleProductSync as m } from "../actions.es.js";
|
|
9
|
+
function v({ productId: i, hasOpenDraft: s = !1 }) {
|
|
10
|
+
const o = f(), [n, t] = u(!1);
|
|
11
|
+
return /* @__PURE__ */ c(
|
|
12
|
+
l,
|
|
13
13
|
{
|
|
14
14
|
variant: "outline",
|
|
15
15
|
onClick: async () => {
|
|
16
|
-
if (!
|
|
17
|
-
|
|
16
|
+
if (!i) {
|
|
17
|
+
e.error("Product ID is missing");
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
if (!(
|
|
20
|
+
if (!(s && !window.confirm(
|
|
21
21
|
`You have unpublished draft changes for this product.
|
|
22
22
|
|
|
23
23
|
Syncing updates the live pricing now, but publishing your draft afterward will overwrite it with the draft’s older values. Publish or discard your draft first to keep the synced prices.
|
|
24
24
|
|
|
25
25
|
Sync anyway?`
|
|
26
26
|
))) {
|
|
27
|
-
|
|
27
|
+
t(!0);
|
|
28
28
|
try {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
} catch (
|
|
32
|
-
|
|
29
|
+
const r = await m(i);
|
|
30
|
+
r.error ? e.error(r.error) : (e.success("Pricing sync complete!"), o.refresh());
|
|
31
|
+
} catch (r) {
|
|
32
|
+
e.error(r.message || "An unexpected error occurred during sync");
|
|
33
33
|
} finally {
|
|
34
|
-
|
|
34
|
+
t(!1);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
disabled:
|
|
38
|
+
disabled: n,
|
|
39
39
|
className: "gap-2",
|
|
40
40
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
lineNumber: 69,
|
|
44
|
-
columnNumber: 7
|
|
45
|
-
}, this),
|
|
46
|
-
s ? "Syncing..." : "Sync Plans & Pricing from Freemius"
|
|
41
|
+
/* @__PURE__ */ a(d, { className: `w-4 h-4 ${n ? "animate-spin" : ""}` }),
|
|
42
|
+
n ? "Syncing..." : "Sync Plans & Pricing from Freemius"
|
|
47
43
|
]
|
|
48
|
-
}
|
|
49
|
-
void 0,
|
|
50
|
-
!0,
|
|
51
|
-
{
|
|
52
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/pages/cms/products/components/SyncFreemiusPricingButton.tsx",
|
|
53
|
-
lineNumber: 63,
|
|
54
|
-
columnNumber: 5
|
|
55
|
-
},
|
|
56
|
-
this
|
|
44
|
+
}
|
|
57
45
|
);
|
|
58
46
|
}
|
|
59
47
|
export {
|
|
60
|
-
|
|
48
|
+
v as SyncFreemiusPricingButton
|
|
61
49
|
};
|