@cedros/pay-react 1.1.15 → 1.1.17
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--jn-BNmd.mjs +539 -0
- package/dist/AISettingsSection-BrXUD4l_.js +51 -0
- package/dist/AutosaveIndicator-B3T328jH.mjs +35 -0
- package/dist/AutosaveIndicator-BQkm3cn8.js +1 -0
- package/dist/{CedrosContext-D7nh5-Zh.mjs → CedrosContext-BnJ2Cf7R.mjs} +1179 -642
- package/dist/CedrosContext-C26DlvLF.js +6 -0
- package/dist/CryptoButton-B4-oJ8lF.js +1 -0
- package/dist/CryptoButton-Dhxnk9d7.mjs +542 -0
- package/dist/FAQSection-BB1wJRsR.mjs +366 -0
- package/dist/FAQSection-aoAz35MV.js +1 -0
- package/dist/MessagingSection-BG9O62ko.mjs +347 -0
- package/dist/MessagingSection-DId-WJdU.js +1 -0
- package/dist/PaymentSettingsSection-D92IO4xJ.js +1 -0
- package/dist/PaymentSettingsSection-c13RAUxn.mjs +94 -0
- package/dist/SettingsSection-DUxjXl2G.js +1 -0
- package/dist/SettingsSection-htem-WL3.mjs +57 -0
- package/dist/SingleCategorySettings-BIEs6s6Z.mjs +1421 -0
- package/dist/SingleCategorySettings-CQ-osdzb.js +3 -0
- package/dist/StorefrontSection-CKTQt255.mjs +765 -0
- package/dist/StorefrontSection-DcSoDx-k.js +1 -0
- package/dist/SubscriptionsSection-C0hYf7Hr.js +1 -0
- package/dist/SubscriptionsSection-CONwHhT4.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-2N_CMVAv.js +84 -0
- package/dist/index-C1hbnxn0.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-DG4Ws13b.js → sections-D2GMJuKq.js} +1 -1
- package/dist/{sections-Dl8qjlql.mjs → sections-DICaHGhz.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-BjxGupjw.mjs +0 -27893
- package/dist/index-DW6XWuRP.js +0 -136
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useCallback as w, useEffect as W } from "react";
|
|
3
|
+
import { $ as z, a0 as $ } from "./index-C1hbnxn0.mjs";
|
|
4
|
+
import { T as N } from "./Toggle-DAxIdpY4.mjs";
|
|
5
|
+
import { u as M } from "./useAutosave-YwMqRzqy.mjs";
|
|
6
|
+
import { A as F } from "./AutosaveIndicator-B3T328jH.mjs";
|
|
7
|
+
const g = {
|
|
8
|
+
email_enabled: !1,
|
|
9
|
+
smtp_host: "",
|
|
10
|
+
smtp_port: 587,
|
|
11
|
+
smtp_username: "",
|
|
12
|
+
smtp_password: "",
|
|
13
|
+
from_email: "",
|
|
14
|
+
from_name: "",
|
|
15
|
+
webhook_enabled: !1,
|
|
16
|
+
webhook_url: "",
|
|
17
|
+
webhook_secret: "",
|
|
18
|
+
webhook_timeout: 30
|
|
19
|
+
};
|
|
20
|
+
function U({ serverUrl: _, apiKey: n, authManager: r }) {
|
|
21
|
+
const [l, p] = m("messages"), [s, b] = m(g), [k, S] = m(!0), [x, C] = m(!0), [E, f] = m(null), [h, T] = m(/* @__PURE__ */ new Set()), u = w(async () => {
|
|
22
|
+
try {
|
|
23
|
+
f(null);
|
|
24
|
+
let a;
|
|
25
|
+
const d = "/admin/config/messaging";
|
|
26
|
+
if (r?.isAuthenticated())
|
|
27
|
+
a = await r.fetchWithAuth(d);
|
|
28
|
+
else {
|
|
29
|
+
const t = { "Content-Type": "application/json" };
|
|
30
|
+
n && (t["X-API-Key"] = n);
|
|
31
|
+
const c = await fetch(`${_}${d}`, { headers: t });
|
|
32
|
+
if (!c.ok) throw new Error(`Failed to fetch: ${c.status}`);
|
|
33
|
+
a = await c.json();
|
|
34
|
+
}
|
|
35
|
+
b({ ...g, ...a.config });
|
|
36
|
+
} catch {
|
|
37
|
+
b(g), f("Could not load saved settings. Showing defaults.");
|
|
38
|
+
} finally {
|
|
39
|
+
S(!1), setTimeout(() => C(!1), 100);
|
|
40
|
+
}
|
|
41
|
+
}, [_, n, r]);
|
|
42
|
+
W(() => {
|
|
43
|
+
u();
|
|
44
|
+
}, [u]);
|
|
45
|
+
const A = w(async (a) => {
|
|
46
|
+
const d = "/admin/config/messaging", t = { ...a };
|
|
47
|
+
h.has("smtp_password") || delete t.smtp_password, h.has("webhook_secret") || delete t.webhook_secret;
|
|
48
|
+
const c = JSON.stringify({ config: t });
|
|
49
|
+
try {
|
|
50
|
+
if (r?.isAuthenticated())
|
|
51
|
+
await r.fetchWithAuth(d, { method: "PUT", body: c });
|
|
52
|
+
else {
|
|
53
|
+
const v = { "Content-Type": "application/json" };
|
|
54
|
+
n && (v["X-API-Key"] = n);
|
|
55
|
+
const y = await fetch(`${_}${d}`, { method: "PUT", headers: v, body: c });
|
|
56
|
+
if (!y.ok) throw new Error(`Failed to save: ${y.status}`);
|
|
57
|
+
}
|
|
58
|
+
} catch {
|
|
59
|
+
throw f("Failed to save messaging settings"), new Error("Save failed");
|
|
60
|
+
}
|
|
61
|
+
}, [_, n, r, h]), { status: I, error: P } = M({
|
|
62
|
+
data: s,
|
|
63
|
+
onSave: A,
|
|
64
|
+
debounceMs: 1500,
|
|
65
|
+
enabled: !x
|
|
66
|
+
}), o = (a, d) => {
|
|
67
|
+
(a === "smtp_password" || a === "webhook_secret") && T((t) => new Set(t).add(a)), b((t) => ({ ...t, [a]: d }));
|
|
68
|
+
};
|
|
69
|
+
return k ? /* @__PURE__ */ i("div", { className: "cedros-admin__messaging-settings", children: [
|
|
70
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__page-header", children: [
|
|
71
|
+
/* @__PURE__ */ e("h2", { className: "cedros-admin__page-title", children: "Store Messages" }),
|
|
72
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin__page-description", children: "Configure email delivery and webhook notifications." })
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__loading", style: { marginTop: "1rem" }, children: [
|
|
75
|
+
z.loading,
|
|
76
|
+
" Loading message settings..."
|
|
77
|
+
] })
|
|
78
|
+
] }) : /* @__PURE__ */ i("div", { className: "cedros-admin__messaging-settings", children: [
|
|
79
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__page-header", children: [
|
|
80
|
+
/* @__PURE__ */ e("h2", { className: "cedros-admin__page-title", children: "Store Messages" }),
|
|
81
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin__page-description", children: "Configure email delivery and webhook notifications." })
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__tabs cedros-admin__tabs--line", children: [
|
|
84
|
+
/* @__PURE__ */ e(
|
|
85
|
+
"button",
|
|
86
|
+
{
|
|
87
|
+
type: "button",
|
|
88
|
+
className: `cedros-admin__tab ${l === "messages" ? "cedros-admin__tab--active" : ""}`,
|
|
89
|
+
onClick: () => p("messages"),
|
|
90
|
+
children: "Messages"
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ e(
|
|
94
|
+
"button",
|
|
95
|
+
{
|
|
96
|
+
type: "button",
|
|
97
|
+
className: `cedros-admin__tab ${l === "email" ? "cedros-admin__tab--active" : ""}`,
|
|
98
|
+
onClick: () => p("email"),
|
|
99
|
+
children: "Email"
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ e(
|
|
103
|
+
"button",
|
|
104
|
+
{
|
|
105
|
+
type: "button",
|
|
106
|
+
className: `cedros-admin__tab ${l === "webhooks" ? "cedros-admin__tab--active" : ""}`,
|
|
107
|
+
onClick: () => p("webhooks"),
|
|
108
|
+
children: "Webhooks"
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ e("div", { style: { flex: 1 } }),
|
|
112
|
+
/* @__PURE__ */ e(F, { status: I, error: P })
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ e($, { message: E, onRetry: u }),
|
|
115
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__tab-content", style: { marginTop: "1rem" }, children: [
|
|
116
|
+
l === "messages" && /* @__PURE__ */ i("div", { className: "cedros-admin__section", children: [
|
|
117
|
+
/* @__PURE__ */ e("p", { style: { marginBottom: "1.5rem", fontSize: "0.875rem", opacity: 0.7 }, children: "Enable or disable notification types. Configure the delivery settings in the Email or Webhooks tab." }),
|
|
118
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: [
|
|
119
|
+
/* @__PURE__ */ i(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
style: {
|
|
123
|
+
display: "flex",
|
|
124
|
+
alignItems: "flex-start",
|
|
125
|
+
gap: "1rem",
|
|
126
|
+
padding: "1rem",
|
|
127
|
+
border: "1px solid var(--cedros-admin-border, #e5e5e5)",
|
|
128
|
+
borderRadius: "0.5rem"
|
|
129
|
+
},
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ e(
|
|
132
|
+
N,
|
|
133
|
+
{
|
|
134
|
+
checked: s.email_enabled,
|
|
135
|
+
onChange: (a) => o("email_enabled", a)
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ i("div", { style: { flex: 1 }, children: [
|
|
139
|
+
/* @__PURE__ */ e("div", { style: { fontWeight: 500 }, children: "Email Confirmation" }),
|
|
140
|
+
/* @__PURE__ */ e("p", { style: { margin: "0.25rem 0 0", fontSize: "0.8125rem", opacity: 0.6 }, children: "Send order confirmation emails to customers after successful purchase." }),
|
|
141
|
+
/* @__PURE__ */ e("p", { style: { margin: "0.5rem 0 0", fontSize: "0.75rem", opacity: 0.5 }, children: "Requires Email configuration" })
|
|
142
|
+
] })
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
/* @__PURE__ */ i(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
style: {
|
|
150
|
+
display: "flex",
|
|
151
|
+
alignItems: "flex-start",
|
|
152
|
+
gap: "1rem",
|
|
153
|
+
padding: "1rem",
|
|
154
|
+
border: "1px solid var(--cedros-admin-border, #e5e5e5)",
|
|
155
|
+
borderRadius: "0.5rem"
|
|
156
|
+
},
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ e(
|
|
159
|
+
N,
|
|
160
|
+
{
|
|
161
|
+
checked: s.webhook_enabled,
|
|
162
|
+
onChange: (a) => o("webhook_enabled", a)
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
/* @__PURE__ */ i("div", { style: { flex: 1 }, children: [
|
|
166
|
+
/* @__PURE__ */ e("div", { style: { fontWeight: 500 }, children: "Admin Purchase Notification" }),
|
|
167
|
+
/* @__PURE__ */ e("p", { style: { margin: "0.25rem 0 0", fontSize: "0.8125rem", opacity: 0.6 }, children: "Send webhook notifications to your server when a purchase is completed." }),
|
|
168
|
+
/* @__PURE__ */ e("p", { style: { margin: "0.5rem 0 0", fontSize: "0.75rem", opacity: 0.5 }, children: "Requires Webhook configuration" })
|
|
169
|
+
] })
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
] })
|
|
174
|
+
] }),
|
|
175
|
+
l === "email" && /* @__PURE__ */ i("div", { className: "cedros-admin__section", children: [
|
|
176
|
+
/* @__PURE__ */ e("p", { style: { marginBottom: "1.5rem", fontSize: "0.875rem", opacity: 0.7 }, children: "Configure your email provider for sending customer notifications." }),
|
|
177
|
+
!s.email_enabled && /* @__PURE__ */ e(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
style: {
|
|
181
|
+
padding: "1rem",
|
|
182
|
+
marginBottom: "1.5rem",
|
|
183
|
+
background: "var(--cedros-admin-bg-accent, #fef3c7)",
|
|
184
|
+
borderRadius: "0.5rem",
|
|
185
|
+
border: "1px solid var(--cedros-admin-warning, #f59e0b)",
|
|
186
|
+
fontSize: "0.875rem"
|
|
187
|
+
},
|
|
188
|
+
children: "Email notifications are disabled. Enable them in the Messages tab."
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: "1rem", opacity: s.email_enabled ? 1 : 0.5 }, children: [
|
|
192
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__field", children: [
|
|
193
|
+
/* @__PURE__ */ e("label", { className: "cedros-admin__field-label", children: "SMTP Host" }),
|
|
194
|
+
/* @__PURE__ */ e(
|
|
195
|
+
"input",
|
|
196
|
+
{
|
|
197
|
+
type: "text",
|
|
198
|
+
className: "cedros-admin__input",
|
|
199
|
+
value: s.smtp_host,
|
|
200
|
+
onChange: (a) => o("smtp_host", a.target.value),
|
|
201
|
+
placeholder: "smtp.example.com",
|
|
202
|
+
disabled: !s.email_enabled
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
] }),
|
|
206
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__field", children: [
|
|
207
|
+
/* @__PURE__ */ e("label", { className: "cedros-admin__field-label", children: "SMTP Port" }),
|
|
208
|
+
/* @__PURE__ */ e(
|
|
209
|
+
"input",
|
|
210
|
+
{
|
|
211
|
+
type: "number",
|
|
212
|
+
className: "cedros-admin__input",
|
|
213
|
+
value: s.smtp_port,
|
|
214
|
+
onChange: (a) => o("smtp_port", parseInt(a.target.value) || 587),
|
|
215
|
+
placeholder: "587",
|
|
216
|
+
disabled: !s.email_enabled,
|
|
217
|
+
style: { maxWidth: 120 }
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] }),
|
|
221
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__field", children: [
|
|
222
|
+
/* @__PURE__ */ e("label", { className: "cedros-admin__field-label", children: "SMTP Username" }),
|
|
223
|
+
/* @__PURE__ */ e(
|
|
224
|
+
"input",
|
|
225
|
+
{
|
|
226
|
+
type: "text",
|
|
227
|
+
className: "cedros-admin__input",
|
|
228
|
+
value: s.smtp_username,
|
|
229
|
+
onChange: (a) => o("smtp_username", a.target.value),
|
|
230
|
+
placeholder: "username or API key",
|
|
231
|
+
disabled: !s.email_enabled
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
] }),
|
|
235
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__field", children: [
|
|
236
|
+
/* @__PURE__ */ e("label", { className: "cedros-admin__field-label", children: "SMTP Password" }),
|
|
237
|
+
/* @__PURE__ */ e(
|
|
238
|
+
"input",
|
|
239
|
+
{
|
|
240
|
+
type: "password",
|
|
241
|
+
className: "cedros-admin__input",
|
|
242
|
+
value: h.has("smtp_password") ? s.smtp_password : "",
|
|
243
|
+
onChange: (a) => o("smtp_password", a.target.value),
|
|
244
|
+
placeholder: s.smtp_password ? "••••••••" : "Enter password",
|
|
245
|
+
disabled: !s.email_enabled
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
] }),
|
|
249
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__field", children: [
|
|
250
|
+
/* @__PURE__ */ e("label", { className: "cedros-admin__field-label", children: "From Email" }),
|
|
251
|
+
/* @__PURE__ */ e(
|
|
252
|
+
"input",
|
|
253
|
+
{
|
|
254
|
+
type: "email",
|
|
255
|
+
className: "cedros-admin__input",
|
|
256
|
+
value: s.from_email,
|
|
257
|
+
onChange: (a) => o("from_email", a.target.value),
|
|
258
|
+
placeholder: "orders@yourstore.com",
|
|
259
|
+
disabled: !s.email_enabled
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
] }),
|
|
263
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__field", children: [
|
|
264
|
+
/* @__PURE__ */ e("label", { className: "cedros-admin__field-label", children: "From Name" }),
|
|
265
|
+
/* @__PURE__ */ e(
|
|
266
|
+
"input",
|
|
267
|
+
{
|
|
268
|
+
type: "text",
|
|
269
|
+
className: "cedros-admin__input",
|
|
270
|
+
value: s.from_name,
|
|
271
|
+
onChange: (a) => o("from_name", a.target.value),
|
|
272
|
+
placeholder: "Your Store",
|
|
273
|
+
disabled: !s.email_enabled
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
] })
|
|
277
|
+
] })
|
|
278
|
+
] }),
|
|
279
|
+
l === "webhooks" && /* @__PURE__ */ i("div", { className: "cedros-admin__section", children: [
|
|
280
|
+
/* @__PURE__ */ e("p", { style: { marginBottom: "1.5rem", fontSize: "0.875rem", opacity: 0.7 }, children: "Configure webhook endpoint for receiving purchase notifications." }),
|
|
281
|
+
!s.webhook_enabled && /* @__PURE__ */ e(
|
|
282
|
+
"div",
|
|
283
|
+
{
|
|
284
|
+
style: {
|
|
285
|
+
padding: "1rem",
|
|
286
|
+
marginBottom: "1.5rem",
|
|
287
|
+
background: "var(--cedros-admin-bg-accent, #fef3c7)",
|
|
288
|
+
borderRadius: "0.5rem",
|
|
289
|
+
border: "1px solid var(--cedros-admin-warning, #f59e0b)",
|
|
290
|
+
fontSize: "0.875rem"
|
|
291
|
+
},
|
|
292
|
+
children: "Webhook notifications are disabled. Enable them in the Messages tab."
|
|
293
|
+
}
|
|
294
|
+
),
|
|
295
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: "1rem", opacity: s.webhook_enabled ? 1 : 0.5 }, children: [
|
|
296
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__field", children: [
|
|
297
|
+
/* @__PURE__ */ e("label", { className: "cedros-admin__field-label", children: "Webhook URL" }),
|
|
298
|
+
/* @__PURE__ */ e(
|
|
299
|
+
"input",
|
|
300
|
+
{
|
|
301
|
+
type: "url",
|
|
302
|
+
className: "cedros-admin__input",
|
|
303
|
+
value: s.webhook_url,
|
|
304
|
+
onChange: (a) => o("webhook_url", a.target.value),
|
|
305
|
+
placeholder: "https://api.yoursite.com/webhooks/orders",
|
|
306
|
+
disabled: !s.webhook_enabled
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
] }),
|
|
310
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__field", children: [
|
|
311
|
+
/* @__PURE__ */ e("label", { className: "cedros-admin__field-label", children: "Webhook Secret" }),
|
|
312
|
+
/* @__PURE__ */ e(
|
|
313
|
+
"input",
|
|
314
|
+
{
|
|
315
|
+
type: "password",
|
|
316
|
+
className: "cedros-admin__input",
|
|
317
|
+
value: h.has("webhook_secret") ? s.webhook_secret : "",
|
|
318
|
+
onChange: (a) => o("webhook_secret", a.target.value),
|
|
319
|
+
placeholder: s.webhook_secret ? "••••••••" : "Enter secret for HMAC-SHA256",
|
|
320
|
+
disabled: !s.webhook_enabled
|
|
321
|
+
}
|
|
322
|
+
),
|
|
323
|
+
/* @__PURE__ */ e("p", { style: { margin: "0.25rem 0 0", fontSize: "0.75rem", opacity: 0.6 }, children: "Used for HMAC-SHA256 signature verification" })
|
|
324
|
+
] }),
|
|
325
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__field", children: [
|
|
326
|
+
/* @__PURE__ */ e("label", { className: "cedros-admin__field-label", children: "Timeout (seconds)" }),
|
|
327
|
+
/* @__PURE__ */ e(
|
|
328
|
+
"input",
|
|
329
|
+
{
|
|
330
|
+
type: "number",
|
|
331
|
+
className: "cedros-admin__input",
|
|
332
|
+
value: s.webhook_timeout,
|
|
333
|
+
onChange: (a) => o("webhook_timeout", parseInt(a.target.value) || 30),
|
|
334
|
+
placeholder: "30",
|
|
335
|
+
disabled: !s.webhook_enabled,
|
|
336
|
+
style: { maxWidth: 120 }
|
|
337
|
+
}
|
|
338
|
+
)
|
|
339
|
+
] })
|
|
340
|
+
] })
|
|
341
|
+
] })
|
|
342
|
+
] })
|
|
343
|
+
] });
|
|
344
|
+
}
|
|
345
|
+
export {
|
|
346
|
+
U as MessagingSection
|
|
347
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),v=require("./index-2N_CMVAv.js"),j=require("./Toggle-CsPSF8Dr.js"),I=require("./useAutosave-B2p6iwh8.js"),P=require("./AutosaveIndicator-BQkm3cn8.js"),g={email_enabled:!1,smtp_host:"",smtp_port:587,smtp_username:"",smtp_password:"",from_email:"",from_name:"",webhook_enabled:!1,webhook_url:"",webhook_secret:"",webhook_timeout:30};function W({serverUrl:h,apiKey:d,authManager:r}){const[l,_]=o.useState("messages"),[a,p]=o.useState(g),[y,w]=o.useState(!0),[N,S]=o.useState(!0),[k,b]=o.useState(null),[m,C]=o.useState(new Set),u=o.useCallback(async()=>{try{b(null);let s;const n="/admin/config/messaging";if(r?.isAuthenticated())s=await r.fetchWithAuth(n);else{const t={"Content-Type":"application/json"};d&&(t["X-API-Key"]=d);const c=await fetch(`${h}${n}`,{headers:t});if(!c.ok)throw new Error(`Failed to fetch: ${c.status}`);s=await c.json()}p({...g,...s.config})}catch{p(g),b("Could not load saved settings. Showing defaults.")}finally{w(!1),setTimeout(()=>S(!1),100)}},[h,d,r]);o.useEffect(()=>{u()},[u]);const E=o.useCallback(async s=>{const n="/admin/config/messaging",t={...s};m.has("smtp_password")||delete t.smtp_password,m.has("webhook_secret")||delete t.webhook_secret;const c=JSON.stringify({config:t});try{if(r?.isAuthenticated())await r.fetchWithAuth(n,{method:"PUT",body:c});else{const f={"Content-Type":"application/json"};d&&(f["X-API-Key"]=d);const x=await fetch(`${h}${n}`,{method:"PUT",headers:f,body:c});if(!x.ok)throw new Error(`Failed to save: ${x.status}`)}}catch{throw b("Failed to save messaging settings"),new Error("Save failed")}},[h,d,r,m]),{status:T,error:A}=I.useAutosave({data:a,onSave:E,debounceMs:1500,enabled:!N}),i=(s,n)=>{(s==="smtp_password"||s==="webhook_secret")&&C(t=>new Set(t).add(s)),p(t=>({...t,[s]:n}))};return y?e.jsxs("div",{className:"cedros-admin__messaging-settings",children:[e.jsxs("div",{className:"cedros-admin__page-header",children:[e.jsx("h2",{className:"cedros-admin__page-title",children:"Store Messages"}),e.jsx("p",{className:"cedros-admin__page-description",children:"Configure email delivery and webhook notifications."})]}),e.jsxs("div",{className:"cedros-admin__loading",style:{marginTop:"1rem"},children:[v.Icons.loading," Loading message settings..."]})]}):e.jsxs("div",{className:"cedros-admin__messaging-settings",children:[e.jsxs("div",{className:"cedros-admin__page-header",children:[e.jsx("h2",{className:"cedros-admin__page-title",children:"Store Messages"}),e.jsx("p",{className:"cedros-admin__page-description",children:"Configure email delivery and webhook notifications."})]}),e.jsxs("div",{className:"cedros-admin__tabs cedros-admin__tabs--line",children:[e.jsx("button",{type:"button",className:`cedros-admin__tab ${l==="messages"?"cedros-admin__tab--active":""}`,onClick:()=>_("messages"),children:"Messages"}),e.jsx("button",{type:"button",className:`cedros-admin__tab ${l==="email"?"cedros-admin__tab--active":""}`,onClick:()=>_("email"),children:"Email"}),e.jsx("button",{type:"button",className:`cedros-admin__tab ${l==="webhooks"?"cedros-admin__tab--active":""}`,onClick:()=>_("webhooks"),children:"Webhooks"}),e.jsx("div",{style:{flex:1}}),e.jsx(P.AutosaveIndicator,{status:T,error:A})]}),e.jsx(v.ErrorBanner,{message:k,onRetry:u}),e.jsxs("div",{className:"cedros-admin__tab-content",style:{marginTop:"1rem"},children:[l==="messages"&&e.jsxs("div",{className:"cedros-admin__section",children:[e.jsx("p",{style:{marginBottom:"1.5rem",fontSize:"0.875rem",opacity:.7},children:"Enable or disable notification types. Configure the delivery settings in the Email or Webhooks tab."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"1rem",padding:"1rem",border:"1px solid var(--cedros-admin-border, #e5e5e5)",borderRadius:"0.5rem"},children:[e.jsx(j.Toggle,{checked:a.email_enabled,onChange:s=>i("email_enabled",s)}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontWeight:500},children:"Email Confirmation"}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:"0.8125rem",opacity:.6},children:"Send order confirmation emails to customers after successful purchase."}),e.jsx("p",{style:{margin:"0.5rem 0 0",fontSize:"0.75rem",opacity:.5},children:"Requires Email configuration"})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"1rem",padding:"1rem",border:"1px solid var(--cedros-admin-border, #e5e5e5)",borderRadius:"0.5rem"},children:[e.jsx(j.Toggle,{checked:a.webhook_enabled,onChange:s=>i("webhook_enabled",s)}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontWeight:500},children:"Admin Purchase Notification"}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:"0.8125rem",opacity:.6},children:"Send webhook notifications to your server when a purchase is completed."}),e.jsx("p",{style:{margin:"0.5rem 0 0",fontSize:"0.75rem",opacity:.5},children:"Requires Webhook configuration"})]})]})]})]}),l==="email"&&e.jsxs("div",{className:"cedros-admin__section",children:[e.jsx("p",{style:{marginBottom:"1.5rem",fontSize:"0.875rem",opacity:.7},children:"Configure your email provider for sending customer notifications."}),!a.email_enabled&&e.jsx("div",{style:{padding:"1rem",marginBottom:"1.5rem",background:"var(--cedros-admin-bg-accent, #fef3c7)",borderRadius:"0.5rem",border:"1px solid var(--cedros-admin-warning, #f59e0b)",fontSize:"0.875rem"},children:"Email notifications are disabled. Enable them in the Messages tab."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",opacity:a.email_enabled?1:.5},children:[e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"SMTP Host"}),e.jsx("input",{type:"text",className:"cedros-admin__input",value:a.smtp_host,onChange:s=>i("smtp_host",s.target.value),placeholder:"smtp.example.com",disabled:!a.email_enabled})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"SMTP Port"}),e.jsx("input",{type:"number",className:"cedros-admin__input",value:a.smtp_port,onChange:s=>i("smtp_port",parseInt(s.target.value)||587),placeholder:"587",disabled:!a.email_enabled,style:{maxWidth:120}})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"SMTP Username"}),e.jsx("input",{type:"text",className:"cedros-admin__input",value:a.smtp_username,onChange:s=>i("smtp_username",s.target.value),placeholder:"username or API key",disabled:!a.email_enabled})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"SMTP Password"}),e.jsx("input",{type:"password",className:"cedros-admin__input",value:m.has("smtp_password")?a.smtp_password:"",onChange:s=>i("smtp_password",s.target.value),placeholder:a.smtp_password?"••••••••":"Enter password",disabled:!a.email_enabled})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"From Email"}),e.jsx("input",{type:"email",className:"cedros-admin__input",value:a.from_email,onChange:s=>i("from_email",s.target.value),placeholder:"orders@yourstore.com",disabled:!a.email_enabled})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"From Name"}),e.jsx("input",{type:"text",className:"cedros-admin__input",value:a.from_name,onChange:s=>i("from_name",s.target.value),placeholder:"Your Store",disabled:!a.email_enabled})]})]})]}),l==="webhooks"&&e.jsxs("div",{className:"cedros-admin__section",children:[e.jsx("p",{style:{marginBottom:"1.5rem",fontSize:"0.875rem",opacity:.7},children:"Configure webhook endpoint for receiving purchase notifications."}),!a.webhook_enabled&&e.jsx("div",{style:{padding:"1rem",marginBottom:"1.5rem",background:"var(--cedros-admin-bg-accent, #fef3c7)",borderRadius:"0.5rem",border:"1px solid var(--cedros-admin-warning, #f59e0b)",fontSize:"0.875rem"},children:"Webhook notifications are disabled. Enable them in the Messages tab."}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",opacity:a.webhook_enabled?1:.5},children:[e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Webhook URL"}),e.jsx("input",{type:"url",className:"cedros-admin__input",value:a.webhook_url,onChange:s=>i("webhook_url",s.target.value),placeholder:"https://api.yoursite.com/webhooks/orders",disabled:!a.webhook_enabled})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Webhook Secret"}),e.jsx("input",{type:"password",className:"cedros-admin__input",value:m.has("webhook_secret")?a.webhook_secret:"",onChange:s=>i("webhook_secret",s.target.value),placeholder:a.webhook_secret?"••••••••":"Enter secret for HMAC-SHA256",disabled:!a.webhook_enabled}),e.jsx("p",{style:{margin:"0.25rem 0 0",fontSize:"0.75rem",opacity:.6},children:"Used for HMAC-SHA256 signature verification"})]}),e.jsxs("div",{className:"cedros-admin__field",children:[e.jsx("label",{className:"cedros-admin__field-label",children:"Timeout (seconds)"}),e.jsx("input",{type:"number",className:"cedros-admin__input",value:a.webhook_timeout,onChange:s=>i("webhook_timeout",parseInt(s.target.value)||30),placeholder:"30",disabled:!a.webhook_enabled,style:{maxWidth:120}})]})]})]})]})]})}exports.MessagingSection=W;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),p=require("./SingleCategorySettings-CQ-osdzb.js");function r({href:s,children:n}){return e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"},children:n})}const a=[{id:"stripe",label:"Stripe",category:"stripe",description:e.jsxs(e.Fragment,{children:["Configure your Stripe integration for card payments. Get your API keys from the"," ",e.jsx(r,{href:"https://dashboard.stripe.com/apikeys",children:"Stripe Dashboard"}),"."]})},{id:"crypto",label:"Crypto",category:"x402",description:e.jsxs(e.Fragment,{children:["Configure Solana wallet and token settings for crypto payments. Get a fast RPC endpoint from"," ",e.jsx(r,{href:"https://www.helius.dev",children:"Helius"})," or"," ",e.jsx(r,{href:"https://www.quicknode.com/chains/sol",children:"QuickNode"}),". Set up a payment address using"," ",e.jsx(r,{href:"https://phantom.app",children:"Phantom"})," or"," ",e.jsx(r,{href:"https://solflare.com",children:"Solflare"})," wallet."]})},{id:"credits",label:"Credits",category:"cedros_login",description:e.jsxs(e.Fragment,{children:["Configure Cedros Login integration for credits payments. See the"," ",e.jsx(r,{href:"https://docs.cedros.dev/credits",children:"Credits API documentation"}),"."]})}];function h({serverUrl:s,apiKey:n,authManager:c}){const[o,d]=l.useState("stripe"),i=a.find(t=>t.id===o);return e.jsxs("div",{className:"cedros-admin__payment-settings",children:[e.jsxs("div",{className:"cedros-admin__page-header",children:[e.jsx("h2",{className:"cedros-admin__page-title",children:"Payment Options"}),e.jsx("p",{className:"cedros-admin__page-description",children:"Configure payment methods including Stripe, crypto, and credits."})]}),e.jsx("div",{className:"cedros-admin__tabs cedros-admin__tabs--line",children:a.map(t=>e.jsx("button",{type:"button",className:`cedros-admin__tab ${o===t.id?"cedros-admin__tab--active":""}`,onClick:()=>d(t.id),children:t.label},t.id))}),e.jsx("div",{style:{marginTop:"1rem"},children:e.jsx(p.SingleCategorySettings,{serverUrl:s,apiKey:n,authManager:c,category:i.category,title:`${i.label} Settings`,description:i.description,showEnabledToggle:!0},i.category)})]})}exports.PaymentSettingsSection=h;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h } from "react";
|
|
3
|
+
import { S as m } from "./SingleCategorySettings-BIEs6s6Z.mjs";
|
|
4
|
+
function r({ href: o, children: a }) {
|
|
5
|
+
return /* @__PURE__ */ e(
|
|
6
|
+
"a",
|
|
7
|
+
{
|
|
8
|
+
href: o,
|
|
9
|
+
target: "_blank",
|
|
10
|
+
rel: "noopener noreferrer",
|
|
11
|
+
style: { color: "inherit", textDecoration: "underline" },
|
|
12
|
+
children: a
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
const c = [
|
|
17
|
+
{
|
|
18
|
+
id: "stripe",
|
|
19
|
+
label: "Stripe",
|
|
20
|
+
category: "stripe",
|
|
21
|
+
description: /* @__PURE__ */ i(s, { children: [
|
|
22
|
+
"Configure your Stripe integration for card payments. Get your API keys from the",
|
|
23
|
+
" ",
|
|
24
|
+
/* @__PURE__ */ e(r, { href: "https://dashboard.stripe.com/apikeys", children: "Stripe Dashboard" }),
|
|
25
|
+
"."
|
|
26
|
+
] })
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "crypto",
|
|
30
|
+
label: "Crypto",
|
|
31
|
+
category: "x402",
|
|
32
|
+
description: /* @__PURE__ */ i(s, { children: [
|
|
33
|
+
"Configure Solana wallet and token settings for crypto payments. Get a fast RPC endpoint from",
|
|
34
|
+
" ",
|
|
35
|
+
/* @__PURE__ */ e(r, { href: "https://www.helius.dev", children: "Helius" }),
|
|
36
|
+
" or",
|
|
37
|
+
" ",
|
|
38
|
+
/* @__PURE__ */ e(r, { href: "https://www.quicknode.com/chains/sol", children: "QuickNode" }),
|
|
39
|
+
". Set up a payment address using",
|
|
40
|
+
" ",
|
|
41
|
+
/* @__PURE__ */ e(r, { href: "https://phantom.app", children: "Phantom" }),
|
|
42
|
+
" or",
|
|
43
|
+
" ",
|
|
44
|
+
/* @__PURE__ */ e(r, { href: "https://solflare.com", children: "Solflare" }),
|
|
45
|
+
" wallet."
|
|
46
|
+
] })
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "credits",
|
|
50
|
+
label: "Credits",
|
|
51
|
+
category: "cedros_login",
|
|
52
|
+
description: /* @__PURE__ */ i(s, { children: [
|
|
53
|
+
"Configure Cedros Login integration for credits payments. See the",
|
|
54
|
+
" ",
|
|
55
|
+
/* @__PURE__ */ e(r, { href: "https://docs.cedros.dev/credits", children: "Credits API documentation" }),
|
|
56
|
+
"."
|
|
57
|
+
] })
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
function u({ serverUrl: o, apiKey: a, authManager: l }) {
|
|
61
|
+
const [d, p] = h("stripe"), n = c.find((t) => t.id === d);
|
|
62
|
+
return /* @__PURE__ */ i("div", { className: "cedros-admin__payment-settings", children: [
|
|
63
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__page-header", children: [
|
|
64
|
+
/* @__PURE__ */ e("h2", { className: "cedros-admin__page-title", children: "Payment Options" }),
|
|
65
|
+
/* @__PURE__ */ e("p", { className: "cedros-admin__page-description", children: "Configure payment methods including Stripe, crypto, and credits." })
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ e("div", { className: "cedros-admin__tabs cedros-admin__tabs--line", children: c.map((t) => /* @__PURE__ */ e(
|
|
68
|
+
"button",
|
|
69
|
+
{
|
|
70
|
+
type: "button",
|
|
71
|
+
className: `cedros-admin__tab ${d === t.id ? "cedros-admin__tab--active" : ""}`,
|
|
72
|
+
onClick: () => p(t.id),
|
|
73
|
+
children: t.label
|
|
74
|
+
},
|
|
75
|
+
t.id
|
|
76
|
+
)) }),
|
|
77
|
+
/* @__PURE__ */ e("div", { style: { marginTop: "1rem" }, children: /* @__PURE__ */ e(
|
|
78
|
+
m,
|
|
79
|
+
{
|
|
80
|
+
serverUrl: o,
|
|
81
|
+
apiKey: a,
|
|
82
|
+
authManager: l,
|
|
83
|
+
category: n.category,
|
|
84
|
+
title: `${n.label} Settings`,
|
|
85
|
+
description: n.description,
|
|
86
|
+
showEnabledToggle: !0
|
|
87
|
+
},
|
|
88
|
+
n.category
|
|
89
|
+
) })
|
|
90
|
+
] });
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
u as PaymentSettingsSection
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),g=require("./SingleCategorySettings-CQ-osdzb.js"),n=[{id:"logging",label:"Logging",category:"logging",description:"Configure log levels, format, and environment settings."},{id:"metrics",label:"Metrics",category:"metrics",description:"Configure metrics collection and API access for monitoring."},{id:"security",label:"Security",category:"security",description:"Configure CORS, rate limiting, and other security settings."}];function l({serverUrl:r,apiKey:c,authManager:o}){const[s,a]=d.useState("logging"),t=n.find(i=>i.id===s);return e.jsxs("div",{className:"cedros-admin__server-settings",children:[e.jsxs("div",{className:"cedros-admin__page-header",children:[e.jsx("h2",{className:"cedros-admin__page-title",children:"Store Server"}),e.jsx("p",{className:"cedros-admin__page-description",children:"Configure logging, metrics, and security settings."})]}),e.jsx("div",{className:"cedros-admin__tabs cedros-admin__tabs--line",children:n.map(i=>e.jsx("button",{type:"button",className:`cedros-admin__tab ${s===i.id?"cedros-admin__tab--active":""}`,onClick:()=>a(i.id),children:i.label},i.id))}),e.jsx("div",{style:{marginTop:"1rem"},children:e.jsx(g.SingleCategorySettings,{serverUrl:r,apiKey:c,authManager:o,category:t.category,title:`${t.label} Settings`,description:t.description},t.category)})]})}exports.SettingsSection=l;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g } from "react";
|
|
3
|
+
import { S as l } from "./SingleCategorySettings-BIEs6s6Z.mjs";
|
|
4
|
+
const s = [
|
|
5
|
+
{
|
|
6
|
+
id: "logging",
|
|
7
|
+
label: "Logging",
|
|
8
|
+
category: "logging",
|
|
9
|
+
description: "Configure log levels, format, and environment settings."
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "metrics",
|
|
13
|
+
label: "Metrics",
|
|
14
|
+
category: "metrics",
|
|
15
|
+
description: "Configure metrics collection and API access for monitoring."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "security",
|
|
19
|
+
label: "Security",
|
|
20
|
+
category: "security",
|
|
21
|
+
description: "Configure CORS, rate limiting, and other security settings."
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
function u({ serverUrl: c, apiKey: o, authManager: a }) {
|
|
25
|
+
const [r, d] = g("logging"), t = s.find((e) => e.id === r);
|
|
26
|
+
return /* @__PURE__ */ n("div", { className: "cedros-admin__server-settings", children: [
|
|
27
|
+
/* @__PURE__ */ n("div", { className: "cedros-admin__page-header", children: [
|
|
28
|
+
/* @__PURE__ */ i("h2", { className: "cedros-admin__page-title", children: "Store Server" }),
|
|
29
|
+
/* @__PURE__ */ i("p", { className: "cedros-admin__page-description", children: "Configure logging, metrics, and security settings." })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ i("div", { className: "cedros-admin__tabs cedros-admin__tabs--line", children: s.map((e) => /* @__PURE__ */ i(
|
|
32
|
+
"button",
|
|
33
|
+
{
|
|
34
|
+
type: "button",
|
|
35
|
+
className: `cedros-admin__tab ${r === e.id ? "cedros-admin__tab--active" : ""}`,
|
|
36
|
+
onClick: () => d(e.id),
|
|
37
|
+
children: e.label
|
|
38
|
+
},
|
|
39
|
+
e.id
|
|
40
|
+
)) }),
|
|
41
|
+
/* @__PURE__ */ i("div", { style: { marginTop: "1rem" }, children: /* @__PURE__ */ i(
|
|
42
|
+
l,
|
|
43
|
+
{
|
|
44
|
+
serverUrl: c,
|
|
45
|
+
apiKey: o,
|
|
46
|
+
authManager: a,
|
|
47
|
+
category: t.category,
|
|
48
|
+
title: `${t.label} Settings`,
|
|
49
|
+
description: t.description
|
|
50
|
+
},
|
|
51
|
+
t.category
|
|
52
|
+
) })
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
u as SettingsSection
|
|
57
|
+
};
|