@nextblock-cms/ecom 0.12.5 → 0.12.7

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("react"),r=require("@nextblock-cms/ui"),u=require("lucide-react"),y=require("react-dom");function v({initialEnabledProviders:s,configStatus:t,credentials:i,saveAction:a,saveCredentialsAction:l}){const[d,m]=f.useState(s),c=t?.stripe?.hasKeys,o=t?.freemius?.hasKeys;return e.jsxs("div",{className:"space-y-6 max-w-3xl p-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Payment Settings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your provider API keys, then enable the providers your store needs. Physical products use Stripe and digital products use Freemius."})]}),e.jsx(g,{credentials:i,saveAction:l}),e.jsxs("form",{action:a,className:"space-y-6",children:[e.jsx("input",{type:"hidden",name:"stripe_enabled",value:d.stripe?"true":"false"}),e.jsx("input",{type:"hidden",name:"freemius_enabled",value:d.freemius?"true":"false"}),e.jsxs(r.Card,{children:[e.jsxs(r.CardHeader,{children:[e.jsx(r.CardTitle,{children:"Payment Providers"}),e.jsx(r.CardDescription,{children:"You can run both providers at the same time. Each product picks its provider from its product type."})]}),e.jsxs(r.CardContent,{className:"space-y-6",children:[e.jsx(x,{id:"stripe-enabled",label:"Stripe for Physical Products",description:"Use Stripe Checkout for physical merchandise and other shippable goods.",checked:d.stripe,disabled:!c,onCheckedChange:h=>m(p=>({...p,stripe:h})),ready:c,children:c?e.jsxs("div",{className:"mt-2 text-sm text-green-600 flex items-center gap-2",children:[e.jsx(u.CheckCircle2,{className:"w-4 h-4"}),e.jsx("span",{children:"Ready to process physical product checkout"})]}):e.jsx(j,{provider:"Stripe",missingKeys:t.stripe.missing,docsUrl:"https://dashboard.stripe.com/apikeys",docsLabel:"Stripe Dashboard -> Developers -> API Keys"})}),e.jsx(x,{id:"freemius-enabled",label:"Freemius for Digital Products",description:"Use Freemius for software licenses, SaaS plans, and other digital products.",checked:d.freemius,disabled:!o,onCheckedChange:h=>m(p=>({...p,freemius:h})),ready:o,children:o?e.jsxs("div",{className:"mt-2 text-sm text-green-600 flex items-center gap-2",children:[e.jsx(u.CheckCircle2,{className:"w-4 h-4"}),e.jsx("span",{children:"Ready to process digital product checkout"})]}):e.jsx(j,{provider:"Freemius",missingKeys:t.freemius.missing,docsUrl:"https://dashboard.freemius.com/",docsLabel:"Freemius Dashboard -> Developers -> Credentials"})}),e.jsx("div",{className:"flex justify-end pt-4",children:e.jsx(b,{})})]})]})]})]})}function b(){const{pending:s}=y.useFormStatus();return e.jsx(r.Button,{type:"submit",disabled:s,children:s?"Saving...":"Save Changes"})}function n({id:s,label:t,type:i="text",defaultValue:a,placeholder:l,hint:d}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r.Label,{htmlFor:s,children:t}),e.jsx(r.Input,{id:s,name:s,type:i,defaultValue:a,placeholder:l,autoComplete:i==="password"?"new-password":"off"}),d&&e.jsx("p",{className:"text-xs text-muted-foreground",children:d})]})}function g({credentials:s,saveAction:t}){const i="•••••••• (stored — leave blank to keep)";return e.jsxs(r.Card,{children:[e.jsxs(r.CardHeader,{children:[e.jsx(r.CardTitle,{children:"Provider API Keys"}),e.jsxs(r.CardDescription,{children:["Keys are encrypted at rest and used DB-first (these override any ",e.jsx("code",{children:".env"})," ","values). Leave a secret blank to keep the stored value."]})]}),e.jsx(r.CardContent,{children:e.jsxs("form",{action:t,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Stripe (physical products)"}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(n,{id:"stripe_publishableKey",label:"Publishable key",defaultValue:s.stripe.publishableKey,placeholder:"pk_live_…"}),e.jsx(n,{id:"stripe_secretKey",label:"Secret key",type:"password",placeholder:s.stripe.hasSecretKey?i:"sk_live_…"}),e.jsx(n,{id:"stripe_webhookSecret",label:"Webhook signing secret",type:"password",placeholder:s.stripe.hasWebhookSecret?i:"whsec_…"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Freemius (digital products)"}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(n,{id:"freemius_developerId",label:"Developer ID",defaultValue:s.freemius.developerId}),e.jsx(n,{id:"freemius_productId",label:"Product ID",defaultValue:s.freemius.productId}),e.jsx(n,{id:"freemius_publicKey",label:"Public key",defaultValue:s.freemius.publicKey,placeholder:"pk_…"}),e.jsx(n,{id:"freemius_secretKey",label:"Secret key",type:"password",placeholder:s.freemius.hasSecretKey?i:"sk_…"}),e.jsx(n,{id:"freemius_apiKey",label:"API key",type:"password",placeholder:s.freemius.hasApiKey?i:"API key"})]})]}),s.envFallbackActive&&e.jsx("p",{className:"text-xs text-amber-700",children:"Stripe keys are currently read from environment variables. Saving here moves them into the database and takes precedence."}),e.jsx("div",{className:"flex justify-end",children:e.jsx(b,{})})]})})]})}function x({id:s,label:t,description:i,checked:a,disabled:l,ready:d,onCheckedChange:m,children:c}){return e.jsx("div",{className:"rounded-md border p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(r.Checkbox,{id:s,checked:a,disabled:l,onCheckedChange:o=>m(!!o),className:"mt-1"}),e.jsxs("div",{className:"grid gap-1.5 leading-none w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsx(r.Label,{htmlFor:s,className:"font-semibold text-base cursor-pointer",children:t}),e.jsx("span",{className:`text-xs font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:a?"Enabled":"Disabled"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i}),!d&&e.jsx("p",{className:"text-xs text-amber-700",children:"This provider cannot be enabled until all required environment variables are present."}),c]})]})})}function j({provider:s,missingKeys:t,docsUrl:i,docsLabel:a}){return e.jsxs("div",{className:"mt-3 text-sm p-4 rounded-md border border-destructive/20 bg-destructive/5 text-foreground",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold text-destructive mb-2",children:[e.jsx(u.AlertCircle,{className:"w-4 h-4"}),e.jsx("span",{children:"Configuration Required"})]}),e.jsxs("p",{className:"mb-2",children:["The ",s," integration still needs the following:"]}),e.jsx("ul",{className:"list-disc list-inside bg-white/50 dark:bg-black/20 p-2 rounded mb-3 text-xs",children:t.map(l=>e.jsx("li",{children:l},l))}),e.jsx("p",{className:"mb-2",children:e.jsx("strong",{children:"How to fix:"})}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-1 mb-3",children:[e.jsxs("li",{children:["Get your API keys from"," ",e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"underline font-medium hover:text-destructive/80",children:a}),"."]}),e.jsxs("li",{children:["Enter them in the ",e.jsx("strong",{children:"Provider API Keys"})," section above and save."]}),e.jsx("li",{children:"This provider can then be enabled."})]})]})}exports.PaymentsClient=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("react"),r=require("@nextblock-cms/ui"),u=require("lucide-react"),y=require("react-dom");function v({initialEnabledProviders:s,configStatus:t,credentials:i,saveAction:a,saveCredentialsAction:l}){const[d,h]=f.useState(s),c=t?.stripe?.hasKeys,o=t?.freemius?.hasKeys;return e.jsxs("div",{className:"space-y-6 max-w-3xl p-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Payment Settings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your provider API keys, then enable the providers your store needs. Physical products use Stripe and digital products use Freemius."})]}),e.jsx(g,{credentials:i,saveAction:l}),e.jsxs("form",{action:a,className:"space-y-6",children:[e.jsx("input",{type:"hidden",name:"stripe_enabled",value:d.stripe?"true":"false"}),e.jsx("input",{type:"hidden",name:"freemius_enabled",value:d.freemius?"true":"false"}),e.jsxs(r.Card,{children:[e.jsxs(r.CardHeader,{children:[e.jsx(r.CardTitle,{children:"Payment Providers"}),e.jsx(r.CardDescription,{children:"You can run both providers at the same time. Each product picks its provider from its product type."})]}),e.jsxs(r.CardContent,{className:"space-y-6",children:[e.jsx(x,{id:"stripe-enabled",label:"Stripe for Physical Products",description:"Use Stripe Checkout for physical merchandise and other shippable goods.",checked:d.stripe,disabled:!c,onCheckedChange:p=>h(m=>({...m,stripe:p})),ready:c,children:c?e.jsxs("div",{className:"mt-2 text-sm text-green-600 flex items-center gap-2",children:[e.jsx(u.CheckCircle2,{className:"w-4 h-4"}),e.jsx("span",{children:"Ready to process physical product checkout"})]}):e.jsx(b,{provider:"Stripe",missingKeys:t.stripe.missing,docsUrl:"https://dashboard.stripe.com/apikeys",docsLabel:"Stripe Dashboard -> Developers -> API Keys"})}),e.jsx(x,{id:"freemius-enabled",label:"Freemius for Digital Products",description:"Use Freemius for software licenses, SaaS plans, and other digital products.",checked:d.freemius,disabled:!o,onCheckedChange:p=>h(m=>({...m,freemius:p})),ready:o,children:o?e.jsxs("div",{className:"mt-2 text-sm text-green-600 flex items-center gap-2",children:[e.jsx(u.CheckCircle2,{className:"w-4 h-4"}),e.jsx("span",{children:"Ready to process digital product checkout"})]}):e.jsx(b,{provider:"Freemius",missingKeys:t.freemius.missing,docsUrl:"https://dashboard.freemius.com/",docsLabel:"Freemius Dashboard -> Developers -> Credentials"})}),e.jsx("div",{className:"flex justify-end pt-4",children:e.jsx(j,{})})]})]})]})]})}function j(){const{pending:s}=y.useFormStatus();return e.jsx(r.Button,{type:"submit",disabled:s,children:s?"Saving...":"Save Changes"})}function n({id:s,label:t,type:i="text",defaultValue:a,placeholder:l,hint:d}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(r.Label,{htmlFor:s,children:t}),e.jsx(r.Input,{id:s,name:s,type:i,defaultValue:a,placeholder:l,autoComplete:i==="password"?"new-password":"off"}),d&&e.jsx("p",{className:"text-xs text-muted-foreground",children:d})]})}function g({credentials:s,saveAction:t}){const i="•••••••• (stored — leave blank to keep)";return e.jsxs(r.Card,{children:[e.jsxs(r.CardHeader,{children:[e.jsx(r.CardTitle,{children:"Provider API Keys"}),e.jsxs(r.CardDescription,{children:["Keys are encrypted at rest and used DB-first (these override any ",e.jsx("code",{children:".env"})," ","values). Leave a secret blank to keep the stored value."]})]}),e.jsx(r.CardContent,{children:e.jsxs("form",{action:t,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Stripe (physical products)"}),e.jsxs("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground space-y-1.5",children:[e.jsxs("p",{children:["In the Stripe Dashboard (Developers → Webhooks → Add endpoint), set the endpoint URL to ",e.jsx("code",{children:"https://your-domain/api/webhooks/stripe"}),", then paste that endpoint's signing secret below."]}),e.jsxs("p",{children:["For local testing, forward events with the Stripe CLI:"," ",e.jsx("code",{children:"stripe listen --forward-to localhost:4200/api/webhooks/stripe"})," ","(or ",e.jsx("code",{children:"npm run stripe"}),"). Use the ",e.jsx("code",{children:"whsec_…"})," secret it prints on startup as the signing secret below — it differs from a Dashboard endpoint's."]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(n,{id:"stripe_publishableKey",label:"Publishable key",defaultValue:s.stripe.publishableKey,placeholder:"pk_live_…"}),e.jsx(n,{id:"stripe_secretKey",label:"Secret key",type:"password",placeholder:s.stripe.hasSecretKey?i:"sk_live_…"}),e.jsx(n,{id:"stripe_webhookSecret",label:"Webhook signing secret",type:"password",placeholder:s.stripe.hasWebhookSecret?i:"whsec_…"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Freemius (digital products)"}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(n,{id:"freemius_developerId",label:"Developer ID",defaultValue:s.freemius.developerId}),e.jsx(n,{id:"freemius_productId",label:"Product ID",defaultValue:s.freemius.productId}),e.jsx(n,{id:"freemius_publicKey",label:"Public key",defaultValue:s.freemius.publicKey,placeholder:"pk_…"}),e.jsx(n,{id:"freemius_secretKey",label:"Secret key",type:"password",placeholder:s.freemius.hasSecretKey?i:"sk_…"}),e.jsx(n,{id:"freemius_apiKey",label:"API key",type:"password",placeholder:s.freemius.hasApiKey?i:"API key"})]})]}),s.envFallbackActive&&e.jsx("p",{className:"text-xs text-amber-700",children:"Stripe keys are currently read from environment variables. Saving here moves them into the database and takes precedence."}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{})})]})})]})}function x({id:s,label:t,description:i,checked:a,disabled:l,ready:d,onCheckedChange:h,children:c}){return e.jsx("div",{className:"rounded-md border p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(r.Checkbox,{id:s,checked:a,disabled:l,onCheckedChange:o=>h(!!o),className:"mt-1"}),e.jsxs("div",{className:"grid gap-1.5 leading-none w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsx(r.Label,{htmlFor:s,className:"font-semibold text-base cursor-pointer",children:t}),e.jsx("span",{className:`text-xs font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:a?"Enabled":"Disabled"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i}),!d&&e.jsx("p",{className:"text-xs text-amber-700",children:"This provider cannot be enabled until all required environment variables are present."}),c]})]})})}function b({provider:s,missingKeys:t,docsUrl:i,docsLabel:a}){return e.jsxs("div",{className:"mt-3 text-sm p-4 rounded-md border border-destructive/20 bg-destructive/5 text-foreground",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold text-destructive mb-2",children:[e.jsx(u.AlertCircle,{className:"w-4 h-4"}),e.jsx("span",{children:"Configuration Required"})]}),e.jsxs("p",{className:"mb-2",children:["The ",s," integration still needs the following:"]}),e.jsx("ul",{className:"list-disc list-inside bg-white/50 dark:bg-black/20 p-2 rounded mb-3 text-xs",children:t.map(l=>e.jsx("li",{children:l},l))}),e.jsx("p",{className:"mb-2",children:e.jsx("strong",{children:"How to fix:"})}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-1 mb-3",children:[e.jsxs("li",{children:["Get your API keys from"," ",e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"underline font-medium hover:text-destructive/80",children:a}),"."]}),e.jsxs("li",{children:["Enter them in the ",e.jsx("strong",{children:"Provider API Keys"})," section above and save."]}),e.jsx("li",{children:"This provider can then be enabled."})]})]})}exports.PaymentsClient=v;
@@ -1,30 +1,30 @@
1
1
  'use client';
2
2
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
3
- import { useState as P } from "react";
4
- import { Card as v, CardHeader as y, CardTitle as g, CardDescription as x, CardContent as N, Checkbox as w, Label as k, Button as S, Input as K } from "@nextblock-cms/ui";
3
+ import { useState as C } from "react";
4
+ import { Card as v, CardHeader as y, CardTitle as g, CardDescription as x, CardContent as N, Checkbox as P, Label as k, Button as S, Input as K } from "@nextblock-cms/ui";
5
5
  import { CheckCircle2 as u, AlertCircle as _ } from "lucide-react";
6
6
  import { useFormStatus as I } from "react-dom";
7
- function T({
7
+ function j({
8
8
  initialEnabledProviders: s,
9
9
  configStatus: t,
10
10
  credentials: i,
11
- saveAction: a,
11
+ saveAction: d,
12
12
  saveCredentialsAction: l
13
13
  }) {
14
- const [d, m] = P(s), c = t?.stripe?.hasKeys, o = t?.freemius?.hasKeys;
14
+ const [a, p] = C(s), o = t?.stripe?.hasKeys, c = t?.freemius?.hasKeys;
15
15
  return /* @__PURE__ */ r("div", { className: "space-y-6 max-w-3xl p-8", children: [
16
16
  /* @__PURE__ */ r("div", { children: [
17
17
  /* @__PURE__ */ e("h1", { className: "text-3xl font-bold tracking-tight", children: "Payment Settings" }),
18
18
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Enter your provider API keys, then enable the providers your store needs. Physical products use Stripe and digital products use Freemius." })
19
19
  ] }),
20
- /* @__PURE__ */ e(F, { credentials: i, saveAction: l }),
21
- /* @__PURE__ */ r("form", { action: a, className: "space-y-6", children: [
20
+ /* @__PURE__ */ e(D, { credentials: i, saveAction: l }),
21
+ /* @__PURE__ */ r("form", { action: d, className: "space-y-6", children: [
22
22
  /* @__PURE__ */ e(
23
23
  "input",
24
24
  {
25
25
  type: "hidden",
26
26
  name: "stripe_enabled",
27
- value: d.stripe ? "true" : "false"
27
+ value: a.stripe ? "true" : "false"
28
28
  }
29
29
  ),
30
30
  /* @__PURE__ */ e(
@@ -32,7 +32,7 @@ function T({
32
32
  {
33
33
  type: "hidden",
34
34
  name: "freemius_enabled",
35
- value: d.freemius ? "true" : "false"
35
+ value: a.freemius ? "true" : "false"
36
36
  }
37
37
  ),
38
38
  /* @__PURE__ */ r(v, { children: [
@@ -47,14 +47,14 @@ function T({
47
47
  id: "stripe-enabled",
48
48
  label: "Stripe for Physical Products",
49
49
  description: "Use Stripe Checkout for physical merchandise and other shippable goods.",
50
- checked: d.stripe,
51
- disabled: !c,
52
- onCheckedChange: (p) => m((h) => ({
53
- ...h,
54
- stripe: p
50
+ checked: a.stripe,
51
+ disabled: !o,
52
+ onCheckedChange: (h) => p((m) => ({
53
+ ...m,
54
+ stripe: h
55
55
  })),
56
- ready: c,
57
- children: c ? /* @__PURE__ */ r("div", { className: "mt-2 text-sm text-green-600 flex items-center gap-2", children: [
56
+ ready: o,
57
+ children: o ? /* @__PURE__ */ r("div", { className: "mt-2 text-sm text-green-600 flex items-center gap-2", children: [
58
58
  /* @__PURE__ */ e(u, { className: "w-4 h-4" }),
59
59
  /* @__PURE__ */ e("span", { children: "Ready to process physical product checkout" })
60
60
  ] }) : /* @__PURE__ */ e(
@@ -74,14 +74,14 @@ function T({
74
74
  id: "freemius-enabled",
75
75
  label: "Freemius for Digital Products",
76
76
  description: "Use Freemius for software licenses, SaaS plans, and other digital products.",
77
- checked: d.freemius,
78
- disabled: !o,
79
- onCheckedChange: (p) => m((h) => ({
80
- ...h,
81
- freemius: p
77
+ checked: a.freemius,
78
+ disabled: !c,
79
+ onCheckedChange: (h) => p((m) => ({
80
+ ...m,
81
+ freemius: h
82
82
  })),
83
- ready: o,
84
- children: o ? /* @__PURE__ */ r("div", { className: "mt-2 text-sm text-green-600 flex items-center gap-2", children: [
83
+ ready: c,
84
+ children: c ? /* @__PURE__ */ r("div", { className: "mt-2 text-sm text-green-600 flex items-center gap-2", children: [
85
85
  /* @__PURE__ */ e(u, { className: "w-4 h-4" }),
86
86
  /* @__PURE__ */ e("span", { children: "Ready to process digital product checkout" })
87
87
  ] }) : /* @__PURE__ */ e(
@@ -95,13 +95,13 @@ function T({
95
95
  )
96
96
  }
97
97
  ),
98
- /* @__PURE__ */ e("div", { className: "flex justify-end pt-4", children: /* @__PURE__ */ e(C, {}) })
98
+ /* @__PURE__ */ e("div", { className: "flex justify-end pt-4", children: /* @__PURE__ */ e(w, {}) })
99
99
  ] })
100
100
  ] })
101
101
  ] })
102
102
  ] });
103
103
  }
104
- function C() {
104
+ function w() {
105
105
  const { pending: s } = I();
106
106
  return /* @__PURE__ */ e(S, { type: "submit", disabled: s, children: s ? "Saving..." : "Save Changes" });
107
107
  }
@@ -109,9 +109,9 @@ function n({
109
109
  id: s,
110
110
  label: t,
111
111
  type: i = "text",
112
- defaultValue: a,
112
+ defaultValue: d,
113
113
  placeholder: l,
114
- hint: d
114
+ hint: a
115
115
  }) {
116
116
  return /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
117
117
  /* @__PURE__ */ e(k, { htmlFor: s, children: t }),
@@ -121,15 +121,15 @@ function n({
121
121
  id: s,
122
122
  name: s,
123
123
  type: i,
124
- defaultValue: a,
124
+ defaultValue: d,
125
125
  placeholder: l,
126
126
  autoComplete: i === "password" ? "new-password" : "off"
127
127
  }
128
128
  ),
129
- d && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: d })
129
+ a && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: a })
130
130
  ] });
131
131
  }
132
- function F({
132
+ function D({
133
133
  credentials: s,
134
134
  saveAction: t
135
135
  }) {
@@ -147,6 +147,24 @@ function F({
147
147
  /* @__PURE__ */ e(N, { children: /* @__PURE__ */ r("form", { action: t, className: "space-y-6", children: [
148
148
  /* @__PURE__ */ r("div", { className: "space-y-4", children: [
149
149
  /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Stripe (physical products)" }),
150
+ /* @__PURE__ */ r("div", { className: "rounded-md border border-dashed p-3 text-xs text-muted-foreground space-y-1.5", children: [
151
+ /* @__PURE__ */ r("p", { children: [
152
+ "In the Stripe Dashboard (Developers → Webhooks → Add endpoint), set the endpoint URL to ",
153
+ /* @__PURE__ */ e("code", { children: "https://your-domain/api/webhooks/stripe" }),
154
+ ", then paste that endpoint's signing secret below."
155
+ ] }),
156
+ /* @__PURE__ */ r("p", { children: [
157
+ "For local testing, forward events with the Stripe CLI:",
158
+ " ",
159
+ /* @__PURE__ */ e("code", { children: "stripe listen --forward-to localhost:4200/api/webhooks/stripe" }),
160
+ " ",
161
+ "(or ",
162
+ /* @__PURE__ */ e("code", { children: "npm run stripe" }),
163
+ "). Use the ",
164
+ /* @__PURE__ */ e("code", { children: "whsec_…" }),
165
+ " secret it prints on startup as the signing secret below — it differs from a Dashboard endpoint's."
166
+ ] })
167
+ ] }),
150
168
  /* @__PURE__ */ r("div", { className: "grid gap-4 sm:grid-cols-2", children: [
151
169
  /* @__PURE__ */ e(
152
170
  n,
@@ -226,7 +244,7 @@ function F({
226
244
  ] })
227
245
  ] }),
228
246
  s.envFallbackActive && /* @__PURE__ */ e("p", { className: "text-xs text-amber-700", children: "Stripe keys are currently read from environment variables. Saving here moves them into the database and takes precedence." }),
229
- /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ e(C, {}) })
247
+ /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ e(w, {}) })
230
248
  ] }) })
231
249
  ] });
232
250
  }
@@ -234,20 +252,20 @@ function b({
234
252
  id: s,
235
253
  label: t,
236
254
  description: i,
237
- checked: a,
255
+ checked: d,
238
256
  disabled: l,
239
- ready: d,
240
- onCheckedChange: m,
241
- children: c
257
+ ready: a,
258
+ onCheckedChange: p,
259
+ children: o
242
260
  }) {
243
261
  return /* @__PURE__ */ e("div", { className: "rounded-md border p-4", children: /* @__PURE__ */ r("div", { className: "flex items-start gap-3", children: [
244
262
  /* @__PURE__ */ e(
245
- w,
263
+ P,
246
264
  {
247
265
  id: s,
248
- checked: a,
266
+ checked: d,
249
267
  disabled: l,
250
- onCheckedChange: (o) => m(!!o),
268
+ onCheckedChange: (c) => p(!!c),
251
269
  className: "mt-1"
252
270
  }
253
271
  ),
@@ -257,14 +275,14 @@ function b({
257
275
  /* @__PURE__ */ e(
258
276
  "span",
259
277
  {
260
- className: `text-xs font-medium ${a ? "text-foreground" : "text-muted-foreground"}`,
261
- children: a ? "Enabled" : "Disabled"
278
+ className: `text-xs font-medium ${d ? "text-foreground" : "text-muted-foreground"}`,
279
+ children: d ? "Enabled" : "Disabled"
262
280
  }
263
281
  )
264
282
  ] }),
265
283
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: i }),
266
- !d && /* @__PURE__ */ e("p", { className: "text-xs text-amber-700", children: "This provider cannot be enabled until all required environment variables are present." }),
267
- c
284
+ !a && /* @__PURE__ */ e("p", { className: "text-xs text-amber-700", children: "This provider cannot be enabled until all required environment variables are present." }),
285
+ o
268
286
  ] })
269
287
  ] }) });
270
288
  }
@@ -272,7 +290,7 @@ function f({
272
290
  provider: s,
273
291
  missingKeys: t,
274
292
  docsUrl: i,
275
- docsLabel: a
293
+ docsLabel: d
276
294
  }) {
277
295
  return /* @__PURE__ */ r("div", { className: "mt-3 text-sm p-4 rounded-md border border-destructive/20 bg-destructive/5 text-foreground", children: [
278
296
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2 font-semibold text-destructive mb-2", children: [
@@ -297,7 +315,7 @@ function f({
297
315
  target: "_blank",
298
316
  rel: "noopener noreferrer",
299
317
  className: "underline font-medium hover:text-destructive/80",
300
- children: a
318
+ children: d
301
319
  }
302
320
  ),
303
321
  "."
@@ -312,5 +330,5 @@ function f({
312
330
  ] });
313
331
  }
314
332
  export {
315
- T as PaymentsClient
333
+ j as PaymentsClient
316
334
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextblock-cms/ecom",
3
- "version": "0.12.5",
3
+ "version": "0.12.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -10,9 +10,9 @@
10
10
  },
11
11
  "type": "module",
12
12
  "dependencies": {
13
- "@nextblock-cms/db": "^0.12.5",
14
- "@nextblock-cms/ui": "^0.12.5",
15
- "@nextblock-cms/utils": "^0.12.5",
13
+ "@nextblock-cms/db": "^0.12.7",
14
+ "@nextblock-cms/ui": "^0.12.7",
15
+ "@nextblock-cms/utils": "^0.12.7",
16
16
  "@freemius/checkout": "^1.4.1",
17
17
  "@freemius/sdk": "^0.3.0",
18
18
  "@hookform/resolvers": "^5.2.2",