@cedros/pay-react 1.1.16 → 1.1.18
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/dist/AISettingsSection-C-thWh51.js +51 -0
- package/dist/AISettingsSection-CD9IRyR1.mjs +539 -0
- package/dist/AutosaveIndicator-DxemlKnX.js +1 -0
- package/dist/AutosaveIndicator-G2CRN8hH.mjs +35 -0
- package/dist/{CedrosContext-D7nh5-Zh.mjs → CedrosContext-BnJ2Cf7R.mjs} +1179 -642
- package/dist/CedrosContext-C26DlvLF.js +6 -0
- package/dist/CryptoButton-BdOtL7w-.mjs +542 -0
- package/dist/CryptoButton-N8kRfNDO.js +1 -0
- package/dist/FAQSection-CyYK9OAN.mjs +366 -0
- package/dist/FAQSection-_pm1ekTe.js +1 -0
- package/dist/MessagingSection-BHzf1Mhu.js +1 -0
- package/dist/MessagingSection-DO2yPTvs.mjs +347 -0
- package/dist/PaymentSettingsSection--Aqlne1F.mjs +94 -0
- package/dist/PaymentSettingsSection-DpENgoca.js +1 -0
- package/dist/SettingsSection-CGKKGXWz.mjs +57 -0
- package/dist/SettingsSection-DNoODw7i.js +1 -0
- package/dist/SingleCategorySettings-8DCtLcow.mjs +1421 -0
- package/dist/SingleCategorySettings-NLBYxM0O.js +3 -0
- package/dist/StorefrontSection-BEOMtSAg.js +1 -0
- package/dist/StorefrontSection-Mzr1H51w.mjs +765 -0
- package/dist/SubscriptionsSection-4b29i-41.js +1 -0
- package/dist/SubscriptionsSection-Dy1e15fe.mjs +616 -0
- package/dist/Toggle-CsPSF8Dr.js +1 -0
- package/dist/Toggle-DAxIdpY4.mjs +48 -0
- package/dist/WalletManager-D6BYTwXn.js +1 -0
- package/dist/{WalletManager-oEjZhaFk.mjs → WalletManager-HXXyARQ7.mjs} +36 -32
- package/dist/components/CedrosPay.d.ts.map +1 -1
- package/dist/components/CryptoSubscribeButton.d.ts.map +1 -1
- package/dist/components/PaymentModal.d.ts.map +1 -1
- package/dist/components/SubscriptionManagementPanel.d.ts.map +1 -1
- package/dist/components/admin/AISettingsSection.d.ts.map +1 -1
- package/dist/components/admin/AdminAuthManager.d.ts +2 -1
- package/dist/components/admin/AdminAuthManager.d.ts.map +1 -1
- package/dist/components/admin/AutosaveIndicator.d.ts +7 -0
- package/dist/components/admin/AutosaveIndicator.d.ts.map +1 -0
- package/dist/components/admin/CedrosPayAdminDashboard.d.ts.map +1 -1
- package/dist/components/admin/ConfigEditor.d.ts +0 -2
- package/dist/components/admin/ConfigEditor.d.ts.map +1 -1
- package/dist/components/admin/MessagingSection.d.ts.map +1 -1
- package/dist/components/admin/ProductsSection.d.ts.map +1 -1
- package/dist/components/admin/RefundsSection.d.ts.map +1 -1
- package/dist/components/admin/SecretArrayEditor.d.ts +16 -0
- package/dist/components/admin/SecretArrayEditor.d.ts.map +1 -0
- package/dist/components/admin/SingleCategorySettings.d.ts.map +1 -1
- package/dist/components/admin/StorefrontSection.d.ts.map +1 -1
- package/dist/components/admin/Toggle.d.ts +14 -0
- package/dist/components/admin/Toggle.d.ts.map +1 -0
- package/dist/components/admin/TokenMintSelector.d.ts +27 -0
- package/dist/components/admin/TokenMintSelector.d.ts.map +1 -0
- package/dist/components/admin/configApi.d.ts +5 -3
- package/dist/components/admin/configApi.d.ts.map +1 -1
- package/dist/components/admin/index.d.ts +8 -9
- package/dist/components/admin/index.d.ts.map +1 -1
- package/dist/components/admin/sections-more.d.ts +2 -9
- package/dist/components/admin/sections-more.d.ts.map +1 -1
- package/dist/context/CedrosContext.d.ts +1 -1
- package/dist/context/CedrosContext.d.ts.map +1 -1
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +391 -380
- package/dist/ecommerce/__tests__/inventoryHooks.test.d.ts +2 -0
- package/dist/ecommerce/__tests__/inventoryHooks.test.d.ts.map +1 -0
- package/dist/ecommerce/__tests__/storage.test.d.ts +2 -0
- package/dist/ecommerce/__tests__/storage.test.d.ts.map +1 -0
- package/dist/ecommerce/adapters/CommerceAdapter.d.ts +5 -0
- package/dist/ecommerce/adapters/CommerceAdapter.d.ts.map +1 -1
- package/dist/ecommerce/adapters/mock/mockAdapter.d.ts.map +1 -1
- package/dist/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -1
- package/dist/ecommerce/adapters/paywall/paywallAdapter.test.d.ts +2 -0
- package/dist/ecommerce/adapters/paywall/paywallAdapter.test.d.ts.map +1 -0
- package/dist/ecommerce/components/catalog/ProductCard.d.ts.map +1 -1
- package/dist/ecommerce/components/catalog/QuickViewDialog.d.ts.map +1 -1
- package/dist/ecommerce/components/chat/ShopChatPanel.d.ts +4 -0
- package/dist/ecommerce/components/chat/ShopChatPanel.d.ts.map +1 -1
- package/dist/ecommerce/components/checkout/PaymentStep.d.ts.map +1 -1
- package/dist/ecommerce/components/faq/FAQItem.d.ts.map +1 -1
- package/dist/ecommerce/config/context.d.ts.map +1 -1
- package/dist/ecommerce/hooks/useAIRelatedProducts.d.ts.map +1 -1
- package/dist/ecommerce/hooks/useCartInventory.d.ts.map +1 -1
- package/dist/ecommerce/hooks/useHoldExpiry.d.ts.map +1 -1
- package/dist/ecommerce/hooks/useInventoryVerification.d.ts.map +1 -1
- package/dist/ecommerce/hooks/useProducts.d.ts.map +1 -1
- package/dist/ecommerce/index.d.ts +2 -0
- package/dist/ecommerce/index.d.ts.map +1 -1
- package/dist/ecommerce/integrations/cedros-pay/useCedrosPayCheckoutAdapter.d.ts.map +1 -1
- package/dist/ecommerce/state/cart/CartProvider.d.ts.map +1 -1
- package/dist/ecommerce/state/checkout/checkoutSchema.d.ts +1 -1
- package/dist/ecommerce/state/checkout/useCheckout.d.ts.map +1 -1
- package/dist/ecommerce/templates/ProductTemplate.d.ts.map +1 -1
- package/dist/ecommerce/utils/storage.d.ts +1 -1
- package/dist/ecommerce/utils/storage.d.ts.map +1 -1
- package/dist/hooks/useCreditsPayment.d.ts.map +1 -1
- package/dist/hooks/useCreditsSubscription.d.ts.map +1 -1
- package/dist/hooks/useCryptoSubscription.d.ts.map +1 -1
- package/dist/hooks/useRefundVerification.d.ts.map +1 -1
- package/dist/hooks/useStripeCheckout.d.ts +1 -1
- package/dist/hooks/useStripeCheckout.d.ts.map +1 -1
- package/dist/hooks/useSubscription.d.ts.map +1 -1
- package/dist/hooks/useSubscriptionManagement.d.ts.map +1 -1
- package/dist/hooks/useX402Payment.d.ts.map +1 -1
- package/dist/index-B-0trqeD.js +84 -0
- package/dist/index-bbSf3B7-.mjs +22915 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +67 -72
- package/dist/managers/CreditsManager.d.ts +6 -0
- package/dist/managers/CreditsManager.d.ts.map +1 -1
- package/dist/managers/ManagerCache.d.ts.map +1 -1
- package/dist/managers/RouteDiscoveryManager.d.ts +3 -0
- package/dist/managers/RouteDiscoveryManager.d.ts.map +1 -1
- package/dist/managers/StripeManager.d.ts +15 -0
- package/dist/managers/StripeManager.d.ts.map +1 -1
- package/dist/managers/SubscriptionChangeManager.d.ts.map +1 -1
- package/dist/managers/SubscriptionManager.d.ts +7 -14
- package/dist/managers/SubscriptionManager.d.ts.map +1 -1
- package/dist/managers/WalletManager.d.ts +2 -1
- package/dist/managers/WalletManager.d.ts.map +1 -1
- package/dist/managers/X402Manager.d.ts.map +1 -1
- package/dist/{sections-CL3lbNui.js → sections-CKwGmrzV.js} +1 -1
- package/dist/{sections-DnmB0qdx.mjs → sections-DpEdFL1B.mjs} +1 -1
- package/dist/stripe-only.js +1 -1
- package/dist/stripe-only.mjs +67 -72
- package/dist/telemetry.js +1 -1
- package/dist/telemetry.mjs +23 -25
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.mjs +1 -1
- package/dist/types/index.d.ts +13 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/useAutosave-B2p6iwh8.js +1 -0
- package/dist/useAutosave-YwMqRzqy.mjs +44 -0
- package/dist/utils/circuitBreaker.d.ts +3 -1
- package/dist/utils/circuitBreaker.d.ts.map +1 -1
- package/dist/utils/cspHelper.d.ts +6 -0
- package/dist/utils/cspHelper.d.ts.map +1 -1
- package/dist/utils/csvHelpers.d.ts +0 -41
- package/dist/utils/csvHelpers.d.ts.map +1 -1
- package/dist/utils/errorHandling.d.ts.map +1 -1
- package/dist/utils/exponentialBackoff.d.ts.map +1 -1
- package/dist/utils/requestDeduplication.d.ts.map +1 -1
- package/dist/utils/telemetry.d.ts.map +1 -1
- package/dist/utils/validateConfig.d.ts +1 -1
- package/dist/utils/validateConfig.d.ts.map +1 -1
- package/dist/walletDetection-JZR3UCOa.mjs +27 -0
- package/dist/walletDetection-bNmV5ItZ.js +1 -0
- package/dist/{walletPool-BR6etEiq.mjs → walletPool-BV_z1lEA.mjs} +1 -1
- package/dist/{walletPool-BZyAG4YS.js → walletPool-DjA7J3a9.js} +1 -1
- package/package.json +8 -7
- package/dist/CedrosContext-C2v_s8cc.js +0 -6
- package/dist/WalletManager-B5KLZK2D.js +0 -1
- package/dist/index-BU0vgA-7.js +0 -136
- package/dist/index-DWXEBUbu.mjs +0 -27912
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useCallback as z, useEffect as j } from "react";
|
|
3
|
+
import { $ as H, a0 as V, a2 as x } from "./index-bbSf3B7-.mjs";
|
|
4
|
+
import { T as d } from "./Toggle-DAxIdpY4.mjs";
|
|
5
|
+
import { u as q } from "./useAutosave-YwMqRzqy.mjs";
|
|
6
|
+
import { A as X } from "./AutosaveIndicator-G2CRN8hH.mjs";
|
|
7
|
+
const C = {
|
|
8
|
+
enabled: !0,
|
|
9
|
+
relatedProducts: {
|
|
10
|
+
mode: "most_recent",
|
|
11
|
+
maxItems: 4,
|
|
12
|
+
layout: {
|
|
13
|
+
layout: "large",
|
|
14
|
+
imageCrop: "center"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
catalog: {
|
|
18
|
+
filters: {
|
|
19
|
+
tags: !0,
|
|
20
|
+
priceRange: !0,
|
|
21
|
+
inStock: !0
|
|
22
|
+
},
|
|
23
|
+
sort: {
|
|
24
|
+
featured: !0,
|
|
25
|
+
priceAsc: !0,
|
|
26
|
+
priceDesc: !0
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
checkout: {
|
|
30
|
+
promoCodes: !0
|
|
31
|
+
},
|
|
32
|
+
shopLayout: {
|
|
33
|
+
layout: "large",
|
|
34
|
+
imageCrop: "center"
|
|
35
|
+
},
|
|
36
|
+
categoryLayout: {
|
|
37
|
+
layout: "large",
|
|
38
|
+
imageCrop: "center"
|
|
39
|
+
},
|
|
40
|
+
sections: {
|
|
41
|
+
showDescription: !0,
|
|
42
|
+
showSpecs: !0,
|
|
43
|
+
showShipping: !0,
|
|
44
|
+
showRelatedProducts: !0
|
|
45
|
+
},
|
|
46
|
+
inventory: {
|
|
47
|
+
preCheckoutVerification: !0,
|
|
48
|
+
holdsEnabled: !1,
|
|
49
|
+
holdDurationMinutes: 15
|
|
50
|
+
},
|
|
51
|
+
shopPage: {
|
|
52
|
+
title: "Shop",
|
|
53
|
+
description: ""
|
|
54
|
+
}
|
|
55
|
+
}, G = [
|
|
56
|
+
{
|
|
57
|
+
value: "most_recent",
|
|
58
|
+
label: "Most Recent",
|
|
59
|
+
description: "Show the most recently added products (excluding current product)."
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "by_category",
|
|
63
|
+
label: "By Category",
|
|
64
|
+
description: "Show products from the same category as the current product."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
value: "manual",
|
|
68
|
+
label: "Manual Selection",
|
|
69
|
+
description: "Specify related products per-product using relatedProductIds in metadata."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
value: "ai",
|
|
73
|
+
label: "AI Recommendations",
|
|
74
|
+
description: "Let AI analyze products and suggest the best matches. Requires AI to be configured in AI Settings."
|
|
75
|
+
}
|
|
76
|
+
], _ = [
|
|
77
|
+
{
|
|
78
|
+
value: "large",
|
|
79
|
+
label: "Large",
|
|
80
|
+
description: "Portrait cards (4:5) with full product info, description, and tags."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: "square",
|
|
84
|
+
label: "Square",
|
|
85
|
+
description: "Square cards (1:1) showing title and price only."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
value: "compact",
|
|
89
|
+
label: "Compact",
|
|
90
|
+
description: "Compact cards (3:4) with smaller text to fit more products."
|
|
91
|
+
}
|
|
92
|
+
], k = [
|
|
93
|
+
{ value: "center", label: "Center" },
|
|
94
|
+
{ value: "top", label: "Top" },
|
|
95
|
+
{ value: "bottom", label: "Bottom" },
|
|
96
|
+
{ value: "left", label: "Left" },
|
|
97
|
+
{ value: "right", label: "Right" }
|
|
98
|
+
], J = [
|
|
99
|
+
{ id: "shop-page", label: "Shop Page" },
|
|
100
|
+
{ id: "catalog", label: "Catalog" },
|
|
101
|
+
{ id: "layouts", label: "Layouts" },
|
|
102
|
+
{ id: "product-pages", label: "Product Pages" },
|
|
103
|
+
{ id: "checkout", label: "Checkout" }
|
|
104
|
+
];
|
|
105
|
+
function te({ serverUrl: g, apiKey: s, authManager: c }) {
|
|
106
|
+
const [m, W] = h("shop-page"), [o, n] = h(C), [B, L] = h(!0), [N, D] = h(!0), [R, y] = h(null), f = z(async () => {
|
|
107
|
+
try {
|
|
108
|
+
y(null);
|
|
109
|
+
let e;
|
|
110
|
+
const r = "/admin/config/shop";
|
|
111
|
+
if (c?.isAuthenticated())
|
|
112
|
+
e = await c.fetchWithAuth(r);
|
|
113
|
+
else {
|
|
114
|
+
const i = { "Content-Type": "application/json" };
|
|
115
|
+
s && (i["X-API-Key"] = s);
|
|
116
|
+
const l = await fetch(`${g}${r}`, { headers: i });
|
|
117
|
+
if (!l.ok) throw new Error(`Failed to fetch settings: ${l.status}`);
|
|
118
|
+
e = await l.json();
|
|
119
|
+
}
|
|
120
|
+
n({ ...C, ...e.config });
|
|
121
|
+
} catch {
|
|
122
|
+
n(C), y("Could not load saved settings. Showing defaults.");
|
|
123
|
+
} finally {
|
|
124
|
+
L(!1), setTimeout(() => D(!1), 100);
|
|
125
|
+
}
|
|
126
|
+
}, [g, s, c]);
|
|
127
|
+
j(() => {
|
|
128
|
+
f();
|
|
129
|
+
}, [f]);
|
|
130
|
+
const A = z(async (e) => {
|
|
131
|
+
const r = "/admin/config/shop", i = JSON.stringify({ config: e });
|
|
132
|
+
try {
|
|
133
|
+
if (c?.isAuthenticated())
|
|
134
|
+
await c.fetchWithAuth(r, { method: "PUT", body: i });
|
|
135
|
+
else {
|
|
136
|
+
const l = { "Content-Type": "application/json" };
|
|
137
|
+
s && (l["X-API-Key"] = s);
|
|
138
|
+
const p = await fetch(`${g}${r}`, { method: "PUT", headers: l, body: i });
|
|
139
|
+
if (!p.ok) throw new Error(`Failed to save settings: ${p.status}`);
|
|
140
|
+
}
|
|
141
|
+
} catch {
|
|
142
|
+
throw y("Failed to save storefront settings"), new Error("Save failed");
|
|
143
|
+
}
|
|
144
|
+
}, [g, s, c]), { status: E, error: O } = q({
|
|
145
|
+
data: o,
|
|
146
|
+
onSave: A,
|
|
147
|
+
debounceMs: 1500,
|
|
148
|
+
enabled: !N
|
|
149
|
+
}), $ = (e) => {
|
|
150
|
+
n((r) => ({
|
|
151
|
+
...r,
|
|
152
|
+
relatedProducts: { ...r.relatedProducts, mode: e }
|
|
153
|
+
}));
|
|
154
|
+
}, F = (e) => {
|
|
155
|
+
n((r) => ({
|
|
156
|
+
...r,
|
|
157
|
+
relatedProducts: { ...r.relatedProducts, maxItems: e }
|
|
158
|
+
}));
|
|
159
|
+
}, P = (e, r) => {
|
|
160
|
+
n((i) => ({
|
|
161
|
+
...i,
|
|
162
|
+
relatedProducts: {
|
|
163
|
+
...i.relatedProducts,
|
|
164
|
+
layout: { ...i.relatedProducts.layout, [e]: r }
|
|
165
|
+
}
|
|
166
|
+
}));
|
|
167
|
+
}, v = (e, r) => {
|
|
168
|
+
n((i) => ({
|
|
169
|
+
...i,
|
|
170
|
+
catalog: {
|
|
171
|
+
...i.catalog,
|
|
172
|
+
filters: { ...i.catalog.filters, [e]: r }
|
|
173
|
+
}
|
|
174
|
+
}));
|
|
175
|
+
}, b = (e, r) => {
|
|
176
|
+
const i = o.catalog.sort, l = Object.values(i).filter(Boolean).length;
|
|
177
|
+
!r && l <= 1 || n((p) => ({
|
|
178
|
+
...p,
|
|
179
|
+
catalog: {
|
|
180
|
+
...p.catalog,
|
|
181
|
+
sort: { ...p.catalog.sort, [e]: r }
|
|
182
|
+
}
|
|
183
|
+
}));
|
|
184
|
+
}, M = (e, r) => {
|
|
185
|
+
n((i) => ({
|
|
186
|
+
...i,
|
|
187
|
+
checkout: { ...i.checkout, [e]: r }
|
|
188
|
+
}));
|
|
189
|
+
}, w = (e, r) => {
|
|
190
|
+
n((i) => ({
|
|
191
|
+
...i,
|
|
192
|
+
shopLayout: { ...i.shopLayout, [e]: r }
|
|
193
|
+
}));
|
|
194
|
+
}, I = (e, r) => {
|
|
195
|
+
n((i) => ({
|
|
196
|
+
...i,
|
|
197
|
+
categoryLayout: { ...i.categoryLayout, [e]: r }
|
|
198
|
+
}));
|
|
199
|
+
}, u = (e, r) => {
|
|
200
|
+
n((i) => ({
|
|
201
|
+
...i,
|
|
202
|
+
sections: { ...i.sections, [e]: r }
|
|
203
|
+
}));
|
|
204
|
+
}, S = (e, r) => {
|
|
205
|
+
n((i) => ({
|
|
206
|
+
...i,
|
|
207
|
+
inventory: { ...i.inventory, [e]: r }
|
|
208
|
+
}));
|
|
209
|
+
}, T = (e, r) => {
|
|
210
|
+
n((i) => ({
|
|
211
|
+
...i,
|
|
212
|
+
shopPage: { ...i.shopPage, [e]: r }
|
|
213
|
+
}));
|
|
214
|
+
};
|
|
215
|
+
return B ? /* @__PURE__ */ t("div", { className: "cedros-admin__section", children: /* @__PURE__ */ a("div", { className: "cedros-admin__loading", children: [
|
|
216
|
+
H.loading,
|
|
217
|
+
" Loading storefront settings..."
|
|
218
|
+
] }) }) : /* @__PURE__ */ a("div", { className: "cedros-admin__storefront-settings", children: [
|
|
219
|
+
/* @__PURE__ */ a("div", { className: "cedros-admin__page-header", style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start" }, children: [
|
|
220
|
+
/* @__PURE__ */ a("div", { children: [
|
|
221
|
+
/* @__PURE__ */ t("h2", { className: "cedros-admin__page-title", children: "Storefront" }),
|
|
222
|
+
/* @__PURE__ */ t("p", { className: "cedros-admin__page-description", children: "Configure catalog filters, product layouts, and checkout settings." })
|
|
223
|
+
] }),
|
|
224
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem", flexShrink: 0 }, children: [
|
|
225
|
+
/* @__PURE__ */ t("span", { style: { fontSize: "0.875rem", color: o.enabled ? "var(--cedros-admin-text, #171717)" : "var(--cedros-admin-muted, #737373)" }, children: o.enabled ? "Enabled" : "Disabled" }),
|
|
226
|
+
/* @__PURE__ */ t(d, { checked: o.enabled, onChange: (e) => n((r) => ({ ...r, enabled: e })) })
|
|
227
|
+
] })
|
|
228
|
+
] }),
|
|
229
|
+
!o.enabled && /* @__PURE__ */ t(
|
|
230
|
+
"div",
|
|
231
|
+
{
|
|
232
|
+
style: {
|
|
233
|
+
padding: "0.75rem 1rem",
|
|
234
|
+
marginBottom: "1rem",
|
|
235
|
+
backgroundColor: "var(--cedros-admin-warning-bg, #fef3c7)",
|
|
236
|
+
border: "1px solid var(--cedros-admin-warning-border, #f59e0b)",
|
|
237
|
+
borderRadius: "0.375rem",
|
|
238
|
+
fontSize: "0.875rem",
|
|
239
|
+
color: "var(--cedros-admin-warning-text, #92400e)"
|
|
240
|
+
},
|
|
241
|
+
children: "The storefront is disabled. Enable it using the toggle above to activate your store."
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ a("div", { className: "cedros-admin__tabs cedros-admin__tabs--line", style: { opacity: o.enabled ? 1 : 0.5, pointerEvents: o.enabled ? "auto" : "none" }, children: [
|
|
245
|
+
J.map((e) => /* @__PURE__ */ t(
|
|
246
|
+
"button",
|
|
247
|
+
{
|
|
248
|
+
type: "button",
|
|
249
|
+
className: `cedros-admin__tab ${m === e.id ? "cedros-admin__tab--active" : ""}`,
|
|
250
|
+
onClick: () => W(e.id),
|
|
251
|
+
children: e.label
|
|
252
|
+
},
|
|
253
|
+
e.id
|
|
254
|
+
)),
|
|
255
|
+
/* @__PURE__ */ t("div", { style: { flex: 1 } }),
|
|
256
|
+
/* @__PURE__ */ t(X, { status: E, error: O })
|
|
257
|
+
] }),
|
|
258
|
+
/* @__PURE__ */ t(V, { message: R, onRetry: f }),
|
|
259
|
+
m === "shop-page" && /* @__PURE__ */ a("div", { className: "cedros-admin__section", style: { marginTop: "1rem" }, children: [
|
|
260
|
+
/* @__PURE__ */ t("h4", { style: { marginBottom: "0.5rem", fontWeight: 600 }, children: "Shop Page Content" }),
|
|
261
|
+
/* @__PURE__ */ t("p", { style: { marginBottom: "1.5rem", fontSize: 14, opacity: 0.7 }, children: "Customize the title and description shown on your shop page." }),
|
|
262
|
+
/* @__PURE__ */ a("div", { className: "cedros-admin__field", style: { marginBottom: "1.5rem" }, children: [
|
|
263
|
+
/* @__PURE__ */ t("label", { className: "cedros-admin__field-label", children: "Page Title" }),
|
|
264
|
+
/* @__PURE__ */ t(
|
|
265
|
+
"input",
|
|
266
|
+
{
|
|
267
|
+
type: "text",
|
|
268
|
+
className: "cedros-admin__input",
|
|
269
|
+
value: o.shopPage.title,
|
|
270
|
+
onChange: (e) => T("title", e.target.value),
|
|
271
|
+
placeholder: "Shop"
|
|
272
|
+
}
|
|
273
|
+
),
|
|
274
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.25rem 0 0", fontSize: 12, opacity: 0.6 }, children: "The main heading displayed on your shop page." })
|
|
275
|
+
] }),
|
|
276
|
+
/* @__PURE__ */ a("div", { className: "cedros-admin__field", children: [
|
|
277
|
+
/* @__PURE__ */ t("label", { className: "cedros-admin__field-label", children: "Page Description" }),
|
|
278
|
+
/* @__PURE__ */ t(
|
|
279
|
+
"textarea",
|
|
280
|
+
{
|
|
281
|
+
className: "cedros-admin__textarea",
|
|
282
|
+
value: o.shopPage.description,
|
|
283
|
+
onChange: (e) => T("description", e.target.value),
|
|
284
|
+
placeholder: "Browse our collection of products...",
|
|
285
|
+
rows: 3,
|
|
286
|
+
style: { resize: "vertical" }
|
|
287
|
+
}
|
|
288
|
+
),
|
|
289
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.25rem 0 0", fontSize: 12, opacity: 0.6 }, children: "A short description or subtitle shown below the title. Leave empty to hide." })
|
|
290
|
+
] })
|
|
291
|
+
] }),
|
|
292
|
+
m === "catalog" && /* @__PURE__ */ a("div", { className: "cedros-admin__section", style: { marginTop: "1rem" }, children: [
|
|
293
|
+
/* @__PURE__ */ a("div", { children: [
|
|
294
|
+
/* @__PURE__ */ t("h4", { style: { marginBottom: "0.5rem", fontWeight: 600 }, children: "Catalog Filters" }),
|
|
295
|
+
/* @__PURE__ */ t("p", { style: { marginBottom: "1rem", fontSize: 14, opacity: 0.7 }, children: "Choose which filters appear in the shop and category page sidebars." }),
|
|
296
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: [
|
|
297
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
298
|
+
/* @__PURE__ */ t(
|
|
299
|
+
d,
|
|
300
|
+
{
|
|
301
|
+
checked: o.catalog.filters.tags,
|
|
302
|
+
onChange: (e) => v("tags", e)
|
|
303
|
+
}
|
|
304
|
+
),
|
|
305
|
+
/* @__PURE__ */ a("div", { children: [
|
|
306
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Tags" }),
|
|
307
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Filter products by tags (multi-select checkboxes)" })
|
|
308
|
+
] })
|
|
309
|
+
] }),
|
|
310
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
311
|
+
/* @__PURE__ */ t(
|
|
312
|
+
d,
|
|
313
|
+
{
|
|
314
|
+
checked: o.catalog.filters.priceRange,
|
|
315
|
+
onChange: (e) => v("priceRange", e)
|
|
316
|
+
}
|
|
317
|
+
),
|
|
318
|
+
/* @__PURE__ */ a("div", { children: [
|
|
319
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Price Range" }),
|
|
320
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Filter by minimum and maximum price" })
|
|
321
|
+
] })
|
|
322
|
+
] }),
|
|
323
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
324
|
+
/* @__PURE__ */ t(
|
|
325
|
+
d,
|
|
326
|
+
{
|
|
327
|
+
checked: o.catalog.filters.inStock,
|
|
328
|
+
onChange: (e) => v("inStock", e)
|
|
329
|
+
}
|
|
330
|
+
),
|
|
331
|
+
/* @__PURE__ */ a("div", { children: [
|
|
332
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "In Stock" }),
|
|
333
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Show only products that are in stock" })
|
|
334
|
+
] })
|
|
335
|
+
] })
|
|
336
|
+
] })
|
|
337
|
+
] }),
|
|
338
|
+
/* @__PURE__ */ a("div", { style: { marginTop: "2rem", paddingTop: "1.5rem", borderTop: "1px solid var(--cedros-admin-border, #e5e5e5)" }, children: [
|
|
339
|
+
/* @__PURE__ */ t("h4", { style: { marginBottom: "0.5rem", fontWeight: 600 }, children: "Sort Options" }),
|
|
340
|
+
/* @__PURE__ */ t("p", { style: { marginBottom: "1rem", fontSize: 14, opacity: 0.7 }, children: "Choose which sort options appear in the shop and category pages. At least one must be enabled." }),
|
|
341
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: [
|
|
342
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
343
|
+
/* @__PURE__ */ t(
|
|
344
|
+
d,
|
|
345
|
+
{
|
|
346
|
+
checked: o.catalog.sort.featured,
|
|
347
|
+
onChange: (e) => b("featured", e)
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
/* @__PURE__ */ a("div", { children: [
|
|
351
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Featured" }),
|
|
352
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Default sort order (as returned by backend)" })
|
|
353
|
+
] })
|
|
354
|
+
] }),
|
|
355
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
356
|
+
/* @__PURE__ */ t(
|
|
357
|
+
d,
|
|
358
|
+
{
|
|
359
|
+
checked: o.catalog.sort.priceAsc,
|
|
360
|
+
onChange: (e) => b("priceAsc", e)
|
|
361
|
+
}
|
|
362
|
+
),
|
|
363
|
+
/* @__PURE__ */ a("div", { children: [
|
|
364
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Price: Low to High" }),
|
|
365
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Sort products by price ascending" })
|
|
366
|
+
] })
|
|
367
|
+
] }),
|
|
368
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
369
|
+
/* @__PURE__ */ t(
|
|
370
|
+
d,
|
|
371
|
+
{
|
|
372
|
+
checked: o.catalog.sort.priceDesc,
|
|
373
|
+
onChange: (e) => b("priceDesc", e)
|
|
374
|
+
}
|
|
375
|
+
),
|
|
376
|
+
/* @__PURE__ */ a("div", { children: [
|
|
377
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Price: High to Low" }),
|
|
378
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Sort products by price descending" })
|
|
379
|
+
] })
|
|
380
|
+
] })
|
|
381
|
+
] })
|
|
382
|
+
] })
|
|
383
|
+
] }),
|
|
384
|
+
m === "layouts" && /* @__PURE__ */ a("div", { className: "cedros-admin__section", style: { marginTop: "1rem" }, children: [
|
|
385
|
+
/* @__PURE__ */ t("h4", { style: { marginBottom: "0.5rem", fontWeight: 600 }, children: "Product Layouts" }),
|
|
386
|
+
/* @__PURE__ */ t("p", { style: { marginBottom: "1.5rem", fontSize: 14, opacity: 0.7 }, children: "Configure product card layouts for shop and category pages." }),
|
|
387
|
+
/* @__PURE__ */ a("div", { style: { marginBottom: "2rem" }, children: [
|
|
388
|
+
/* @__PURE__ */ t("div", { style: { fontWeight: 500, marginBottom: "0.75rem" }, children: "Shop Page" }),
|
|
389
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "1rem" }, children: _.map((e) => {
|
|
390
|
+
const r = o.shopLayout.layout === e.value;
|
|
391
|
+
return /* @__PURE__ */ a(
|
|
392
|
+
"label",
|
|
393
|
+
{
|
|
394
|
+
style: {
|
|
395
|
+
display: "flex",
|
|
396
|
+
alignItems: "flex-start",
|
|
397
|
+
gap: "0.75rem",
|
|
398
|
+
padding: "0.75rem",
|
|
399
|
+
border: `2px solid ${r ? "var(--cedros-admin-primary, #171717)" : "var(--cedros-admin-border, #e5e5e5)"}`,
|
|
400
|
+
borderRadius: 6,
|
|
401
|
+
cursor: "pointer",
|
|
402
|
+
background: r ? "var(--cedros-admin-bg-accent, #f5f5f5)" : void 0,
|
|
403
|
+
transition: "border-color 0.15s, background 0.15s"
|
|
404
|
+
},
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ t(
|
|
407
|
+
"input",
|
|
408
|
+
{
|
|
409
|
+
type: "radio",
|
|
410
|
+
name: "shopLayout",
|
|
411
|
+
value: e.value,
|
|
412
|
+
checked: r,
|
|
413
|
+
onChange: () => w("layout", e.value),
|
|
414
|
+
style: { marginTop: 2 }
|
|
415
|
+
}
|
|
416
|
+
),
|
|
417
|
+
/* @__PURE__ */ a("div", { children: [
|
|
418
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: e.label }),
|
|
419
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 12, opacity: 0.6 }, children: e.description })
|
|
420
|
+
] })
|
|
421
|
+
]
|
|
422
|
+
},
|
|
423
|
+
e.value
|
|
424
|
+
);
|
|
425
|
+
}) }),
|
|
426
|
+
/* @__PURE__ */ t(
|
|
427
|
+
x,
|
|
428
|
+
{
|
|
429
|
+
value: o.shopLayout.imageCrop,
|
|
430
|
+
onChange: (e) => w("imageCrop", e),
|
|
431
|
+
options: k,
|
|
432
|
+
label: "Image Crop",
|
|
433
|
+
style: { maxWidth: 180 }
|
|
434
|
+
}
|
|
435
|
+
)
|
|
436
|
+
] }),
|
|
437
|
+
/* @__PURE__ */ a("div", { style: { paddingTop: "1.5rem", borderTop: "1px solid var(--cedros-admin-border, #e5e5e5)" }, children: [
|
|
438
|
+
/* @__PURE__ */ t("div", { style: { fontWeight: 500, marginBottom: "0.75rem" }, children: "Category Pages" }),
|
|
439
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "1rem" }, children: _.map((e) => {
|
|
440
|
+
const r = o.categoryLayout.layout === e.value;
|
|
441
|
+
return /* @__PURE__ */ a(
|
|
442
|
+
"label",
|
|
443
|
+
{
|
|
444
|
+
style: {
|
|
445
|
+
display: "flex",
|
|
446
|
+
alignItems: "flex-start",
|
|
447
|
+
gap: "0.75rem",
|
|
448
|
+
padding: "0.75rem",
|
|
449
|
+
border: `2px solid ${r ? "var(--cedros-admin-primary, #171717)" : "var(--cedros-admin-border, #e5e5e5)"}`,
|
|
450
|
+
borderRadius: 6,
|
|
451
|
+
cursor: "pointer",
|
|
452
|
+
background: r ? "var(--cedros-admin-bg-accent, #f5f5f5)" : void 0,
|
|
453
|
+
transition: "border-color 0.15s, background 0.15s"
|
|
454
|
+
},
|
|
455
|
+
children: [
|
|
456
|
+
/* @__PURE__ */ t(
|
|
457
|
+
"input",
|
|
458
|
+
{
|
|
459
|
+
type: "radio",
|
|
460
|
+
name: "categoryLayout",
|
|
461
|
+
value: e.value,
|
|
462
|
+
checked: r,
|
|
463
|
+
onChange: () => I("layout", e.value),
|
|
464
|
+
style: { marginTop: 2 }
|
|
465
|
+
}
|
|
466
|
+
),
|
|
467
|
+
/* @__PURE__ */ a("div", { children: [
|
|
468
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: e.label }),
|
|
469
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 12, opacity: 0.6 }, children: e.description })
|
|
470
|
+
] })
|
|
471
|
+
]
|
|
472
|
+
},
|
|
473
|
+
e.value
|
|
474
|
+
);
|
|
475
|
+
}) }),
|
|
476
|
+
/* @__PURE__ */ t(
|
|
477
|
+
x,
|
|
478
|
+
{
|
|
479
|
+
value: o.categoryLayout.imageCrop,
|
|
480
|
+
onChange: (e) => I("imageCrop", e),
|
|
481
|
+
options: k,
|
|
482
|
+
label: "Image Crop",
|
|
483
|
+
style: { maxWidth: 180 }
|
|
484
|
+
}
|
|
485
|
+
)
|
|
486
|
+
] })
|
|
487
|
+
] }),
|
|
488
|
+
m === "product-pages" && /* @__PURE__ */ a("div", { className: "cedros-admin__section", style: { marginTop: "1rem" }, children: [
|
|
489
|
+
/* @__PURE__ */ a("div", { children: [
|
|
490
|
+
/* @__PURE__ */ t("h4", { style: { marginBottom: "0.5rem", fontWeight: 600 }, children: "Related Products" }),
|
|
491
|
+
/* @__PURE__ */ t("p", { style: { marginBottom: "1rem", fontSize: 14, opacity: 0.7 }, children: "Configure how related products are displayed on product detail pages." }),
|
|
492
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem", marginBottom: "1.5rem" }, children: G.map((e) => {
|
|
493
|
+
const r = o.relatedProducts.mode === e.value, i = e.badge === "Coming Soon";
|
|
494
|
+
return /* @__PURE__ */ a(
|
|
495
|
+
"label",
|
|
496
|
+
{
|
|
497
|
+
style: {
|
|
498
|
+
display: "flex",
|
|
499
|
+
alignItems: "flex-start",
|
|
500
|
+
gap: "0.75rem",
|
|
501
|
+
padding: "1rem",
|
|
502
|
+
border: `2px solid ${r ? "var(--cedros-admin-primary, #171717)" : "var(--cedros-admin-border, #e5e5e5)"}`,
|
|
503
|
+
borderRadius: 8,
|
|
504
|
+
cursor: i ? "not-allowed" : "pointer",
|
|
505
|
+
opacity: i ? 0.6 : 1,
|
|
506
|
+
background: r ? "var(--cedros-admin-bg-accent, #f5f5f5)" : void 0,
|
|
507
|
+
transition: "border-color 0.15s, background 0.15s"
|
|
508
|
+
},
|
|
509
|
+
children: [
|
|
510
|
+
/* @__PURE__ */ t(
|
|
511
|
+
"input",
|
|
512
|
+
{
|
|
513
|
+
type: "radio",
|
|
514
|
+
name: "relatedProductsMode",
|
|
515
|
+
value: e.value,
|
|
516
|
+
checked: r,
|
|
517
|
+
onChange: () => !i && $(e.value),
|
|
518
|
+
disabled: i,
|
|
519
|
+
style: { marginTop: 2 }
|
|
520
|
+
}
|
|
521
|
+
),
|
|
522
|
+
/* @__PURE__ */ a("div", { style: { flex: 1 }, children: [
|
|
523
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" }, children: [
|
|
524
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 600 }, children: e.label }),
|
|
525
|
+
e.badge && /* @__PURE__ */ t(
|
|
526
|
+
"span",
|
|
527
|
+
{
|
|
528
|
+
style: {
|
|
529
|
+
fontSize: 11,
|
|
530
|
+
padding: "2px 6px",
|
|
531
|
+
borderRadius: 4,
|
|
532
|
+
background: "#6366f1",
|
|
533
|
+
color: "#fff"
|
|
534
|
+
},
|
|
535
|
+
children: e.badge
|
|
536
|
+
}
|
|
537
|
+
)
|
|
538
|
+
] }),
|
|
539
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.25rem 0 0", fontSize: 13, opacity: 0.75 }, children: e.description })
|
|
540
|
+
] })
|
|
541
|
+
]
|
|
542
|
+
},
|
|
543
|
+
e.value
|
|
544
|
+
);
|
|
545
|
+
}) }),
|
|
546
|
+
o.relatedProducts.mode === "manual" && /* @__PURE__ */ a(
|
|
547
|
+
"div",
|
|
548
|
+
{
|
|
549
|
+
style: {
|
|
550
|
+
padding: "1rem",
|
|
551
|
+
marginBottom: "1.5rem",
|
|
552
|
+
background: "var(--cedros-admin-bg-accent, #f5f5f5)",
|
|
553
|
+
borderRadius: 8,
|
|
554
|
+
border: "1px solid var(--cedros-admin-border, #e5e5e5)"
|
|
555
|
+
},
|
|
556
|
+
children: [
|
|
557
|
+
/* @__PURE__ */ t("strong", { style: { fontSize: 14 }, children: "How to set related products:" }),
|
|
558
|
+
/* @__PURE__ */ a("p", { style: { margin: "0.5rem 0 0", fontSize: 13, opacity: 0.8 }, children: [
|
|
559
|
+
"When editing a product, add a ",
|
|
560
|
+
/* @__PURE__ */ t("code", { style: { background: "rgba(0,0,0,0.1)", padding: "2px 4px", borderRadius: 3 }, children: "relatedProductIds" }),
|
|
561
|
+
" field to its metadata containing a comma-separated list of product IDs."
|
|
562
|
+
] }),
|
|
563
|
+
/* @__PURE__ */ a("p", { style: { margin: "0.5rem 0 0", fontSize: 13, opacity: 0.6 }, children: [
|
|
564
|
+
"Example: ",
|
|
565
|
+
/* @__PURE__ */ t("code", { style: { background: "rgba(0,0,0,0.1)", padding: "2px 4px", borderRadius: 3 }, children: "prod_123,prod_456,prod_789" })
|
|
566
|
+
] })
|
|
567
|
+
]
|
|
568
|
+
}
|
|
569
|
+
),
|
|
570
|
+
/* @__PURE__ */ a("div", { className: "cedros-admin__field", style: { maxWidth: 200 }, children: [
|
|
571
|
+
/* @__PURE__ */ t("label", { className: "cedros-admin__field-label", children: "Max Related Products" }),
|
|
572
|
+
/* @__PURE__ */ t(
|
|
573
|
+
"input",
|
|
574
|
+
{
|
|
575
|
+
type: "number",
|
|
576
|
+
className: "cedros-admin__input",
|
|
577
|
+
value: o.relatedProducts.maxItems,
|
|
578
|
+
onChange: (e) => F(Math.max(1, Math.min(12, parseInt(e.target.value) || 4))),
|
|
579
|
+
min: 1,
|
|
580
|
+
max: 12
|
|
581
|
+
}
|
|
582
|
+
),
|
|
583
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.25rem 0 0", fontSize: 12, opacity: 0.6 }, children: "How many related products to show (1-12)" })
|
|
584
|
+
] }),
|
|
585
|
+
/* @__PURE__ */ a("div", { style: { marginTop: "1.5rem" }, children: [
|
|
586
|
+
/* @__PURE__ */ t("div", { style: { fontWeight: 500, marginBottom: "0.75rem" }, children: "Display Layout" }),
|
|
587
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "1rem" }, children: _.map((e) => {
|
|
588
|
+
const r = o.relatedProducts.layout.layout === e.value;
|
|
589
|
+
return /* @__PURE__ */ a(
|
|
590
|
+
"label",
|
|
591
|
+
{
|
|
592
|
+
style: {
|
|
593
|
+
display: "flex",
|
|
594
|
+
alignItems: "flex-start",
|
|
595
|
+
gap: "0.75rem",
|
|
596
|
+
padding: "0.75rem",
|
|
597
|
+
border: `2px solid ${r ? "var(--cedros-admin-primary, #171717)" : "var(--cedros-admin-border, #e5e5e5)"}`,
|
|
598
|
+
borderRadius: 6,
|
|
599
|
+
cursor: "pointer",
|
|
600
|
+
background: r ? "var(--cedros-admin-bg-accent, #f5f5f5)" : void 0,
|
|
601
|
+
transition: "border-color 0.15s, background 0.15s"
|
|
602
|
+
},
|
|
603
|
+
children: [
|
|
604
|
+
/* @__PURE__ */ t(
|
|
605
|
+
"input",
|
|
606
|
+
{
|
|
607
|
+
type: "radio",
|
|
608
|
+
name: "relatedLayout",
|
|
609
|
+
value: e.value,
|
|
610
|
+
checked: r,
|
|
611
|
+
onChange: () => P("layout", e.value),
|
|
612
|
+
style: { marginTop: 2 }
|
|
613
|
+
}
|
|
614
|
+
),
|
|
615
|
+
/* @__PURE__ */ a("div", { children: [
|
|
616
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: e.label }),
|
|
617
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 12, opacity: 0.6 }, children: e.description })
|
|
618
|
+
] })
|
|
619
|
+
]
|
|
620
|
+
},
|
|
621
|
+
e.value
|
|
622
|
+
);
|
|
623
|
+
}) }),
|
|
624
|
+
/* @__PURE__ */ t(
|
|
625
|
+
x,
|
|
626
|
+
{
|
|
627
|
+
value: o.relatedProducts.layout.imageCrop,
|
|
628
|
+
onChange: (e) => P("imageCrop", e),
|
|
629
|
+
options: k,
|
|
630
|
+
label: "Image Crop",
|
|
631
|
+
style: { maxWidth: 180 }
|
|
632
|
+
}
|
|
633
|
+
)
|
|
634
|
+
] })
|
|
635
|
+
] }),
|
|
636
|
+
/* @__PURE__ */ a("div", { style: { marginTop: "2rem", paddingTop: "1.5rem", borderTop: "1px solid var(--cedros-admin-border, #e5e5e5)" }, children: [
|
|
637
|
+
/* @__PURE__ */ t("h4", { style: { marginBottom: "0.5rem", fontWeight: 600 }, children: "Page Sections" }),
|
|
638
|
+
/* @__PURE__ */ t("p", { style: { marginBottom: "1rem", fontSize: 14, opacity: 0.7 }, children: "Choose which sections appear on product detail pages." }),
|
|
639
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: [
|
|
640
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
641
|
+
/* @__PURE__ */ t(
|
|
642
|
+
d,
|
|
643
|
+
{
|
|
644
|
+
checked: o.sections.showDescription,
|
|
645
|
+
onChange: (e) => u("showDescription", e)
|
|
646
|
+
}
|
|
647
|
+
),
|
|
648
|
+
/* @__PURE__ */ a("div", { children: [
|
|
649
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Description" }),
|
|
650
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Expandable description accordion" })
|
|
651
|
+
] })
|
|
652
|
+
] }),
|
|
653
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
654
|
+
/* @__PURE__ */ t(
|
|
655
|
+
d,
|
|
656
|
+
{
|
|
657
|
+
checked: o.sections.showSpecs,
|
|
658
|
+
onChange: (e) => u("showSpecs", e)
|
|
659
|
+
}
|
|
660
|
+
),
|
|
661
|
+
/* @__PURE__ */ a("div", { children: [
|
|
662
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Specifications" }),
|
|
663
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Product attributes and details" })
|
|
664
|
+
] })
|
|
665
|
+
] }),
|
|
666
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
667
|
+
/* @__PURE__ */ t(
|
|
668
|
+
d,
|
|
669
|
+
{
|
|
670
|
+
checked: o.sections.showShipping,
|
|
671
|
+
onChange: (e) => u("showShipping", e)
|
|
672
|
+
}
|
|
673
|
+
),
|
|
674
|
+
/* @__PURE__ */ a("div", { children: [
|
|
675
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Shipping & Returns" }),
|
|
676
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Shipping and return policy information" })
|
|
677
|
+
] })
|
|
678
|
+
] }),
|
|
679
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
680
|
+
/* @__PURE__ */ t(
|
|
681
|
+
d,
|
|
682
|
+
{
|
|
683
|
+
checked: o.sections.showRelatedProducts,
|
|
684
|
+
onChange: (e) => u("showRelatedProducts", e)
|
|
685
|
+
}
|
|
686
|
+
),
|
|
687
|
+
/* @__PURE__ */ a("div", { children: [
|
|
688
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Related Products" }),
|
|
689
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Product recommendations section" })
|
|
690
|
+
] })
|
|
691
|
+
] })
|
|
692
|
+
] })
|
|
693
|
+
] })
|
|
694
|
+
] }),
|
|
695
|
+
m === "checkout" && /* @__PURE__ */ a("div", { className: "cedros-admin__section", style: { marginTop: "1rem" }, children: [
|
|
696
|
+
/* @__PURE__ */ a("div", { children: [
|
|
697
|
+
/* @__PURE__ */ t("h4", { style: { marginBottom: "0.5rem", fontWeight: 600 }, children: "Checkout Settings" }),
|
|
698
|
+
/* @__PURE__ */ t("p", { style: { marginBottom: "1rem", fontSize: 14, opacity: 0.7 }, children: "Configure checkout and cart page features." }),
|
|
699
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: /* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
700
|
+
/* @__PURE__ */ t(
|
|
701
|
+
d,
|
|
702
|
+
{
|
|
703
|
+
checked: o.checkout.promoCodes,
|
|
704
|
+
onChange: (e) => M("promoCodes", e)
|
|
705
|
+
}
|
|
706
|
+
),
|
|
707
|
+
/* @__PURE__ */ a("div", { children: [
|
|
708
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Promo Codes" }),
|
|
709
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Show promo/coupon code input on cart and checkout pages" })
|
|
710
|
+
] })
|
|
711
|
+
] }) })
|
|
712
|
+
] }),
|
|
713
|
+
/* @__PURE__ */ a("div", { style: { marginTop: "2rem", paddingTop: "1.5rem", borderTop: "1px solid var(--cedros-admin-border, #e5e5e5)" }, children: [
|
|
714
|
+
/* @__PURE__ */ t("h4", { style: { marginBottom: "0.5rem", fontWeight: 600 }, children: "Inventory Settings" }),
|
|
715
|
+
/* @__PURE__ */ t("p", { style: { marginBottom: "1rem", fontSize: 14, opacity: 0.7 }, children: "Configure inventory verification and reservation behavior." }),
|
|
716
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: [
|
|
717
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
718
|
+
/* @__PURE__ */ t(
|
|
719
|
+
d,
|
|
720
|
+
{
|
|
721
|
+
checked: o.inventory.preCheckoutVerification,
|
|
722
|
+
onChange: (e) => S("preCheckoutVerification", e)
|
|
723
|
+
}
|
|
724
|
+
),
|
|
725
|
+
/* @__PURE__ */ a("div", { children: [
|
|
726
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Pre-Checkout Verification" }),
|
|
727
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Verify inventory availability before processing payment" })
|
|
728
|
+
] })
|
|
729
|
+
] }),
|
|
730
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
731
|
+
/* @__PURE__ */ t(
|
|
732
|
+
d,
|
|
733
|
+
{
|
|
734
|
+
checked: o.inventory.holdsEnabled,
|
|
735
|
+
onChange: (e) => S("holdsEnabled", e)
|
|
736
|
+
}
|
|
737
|
+
),
|
|
738
|
+
/* @__PURE__ */ a("div", { children: [
|
|
739
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 500 }, children: "Inventory Holds" }),
|
|
740
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.125rem 0 0", fontSize: 13, opacity: 0.6 }, children: "Reserve inventory when items are added to cart" })
|
|
741
|
+
] })
|
|
742
|
+
] })
|
|
743
|
+
] }),
|
|
744
|
+
o.inventory.holdsEnabled && /* @__PURE__ */ a("div", { className: "cedros-admin__field", style: { maxWidth: 200, marginTop: "1rem" }, children: [
|
|
745
|
+
/* @__PURE__ */ t("label", { className: "cedros-admin__field-label", children: "Hold Duration (minutes)" }),
|
|
746
|
+
/* @__PURE__ */ t(
|
|
747
|
+
"input",
|
|
748
|
+
{
|
|
749
|
+
type: "number",
|
|
750
|
+
className: "cedros-admin__input",
|
|
751
|
+
value: o.inventory.holdDurationMinutes,
|
|
752
|
+
onChange: (e) => S("holdDurationMinutes", Math.max(5, Math.min(60, parseInt(e.target.value) || 15))),
|
|
753
|
+
min: 5,
|
|
754
|
+
max: 60
|
|
755
|
+
}
|
|
756
|
+
),
|
|
757
|
+
/* @__PURE__ */ t("p", { style: { margin: "0.25rem 0 0", fontSize: 12, opacity: 0.6 }, children: "How long to reserve inventory in carts (5-60 minutes)" })
|
|
758
|
+
] })
|
|
759
|
+
] })
|
|
760
|
+
] })
|
|
761
|
+
] });
|
|
762
|
+
}
|
|
763
|
+
export {
|
|
764
|
+
te as StorefrontSection
|
|
765
|
+
};
|