@shophost/react 2.0.47 → 2.0.48

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/admin-client.js CHANGED
@@ -2306,7 +2306,7 @@ const lu = Sa.object({ paymentMethods: Sa.array(Sa.enum(["card", "blik"])), secr
2306
2306
  };
2307
2307
  function cu() {
2308
2308
  var y;
2309
- const { client: a, baseUrl: t } = E(), r = j(), n = _(), s = q(), l = `${t.replace(/\/$/, "")}/webhook/payment/stripe/${r}`, o = ue({ resolver: pe(lu), defaultValues: { paymentMethods: ["card"], secretKey: "", webhookSecret: "" } }), d = ((y = T({ queryKey: ["organization-integrations", r], queryFn: async () => {
2309
+ const { client: a, baseUrl: t } = E(), r = j(), n = _(), s = q(), l = `${t.replace(/\/$/, "")}/api/webhook/payment/stripe/${r}`, o = ue({ resolver: pe(lu), defaultValues: { paymentMethods: ["card"], secretKey: "", webhookSecret: "" } }), d = ((y = T({ queryKey: ["organization-integrations", r], queryFn: async () => {
2310
2310
  const { body: x, status: v } = await a.integration.getIntegrations({ params: { organizationId: r } });
2311
2311
  if (v !== 200) throw new Error("Failed to load integrations.");
2312
2312
  return x;
@@ -2341,7 +2341,7 @@ function cu() {
2341
2341
  let v = !1;
2342
2342
  !(u != null && u.hasSecretKey) && !x.secretKey.trim() && (o.setError("secretKey", { type: "manual", message: "Stripe API key is required." }), v = !0), !(u != null && u.hasWebhookSecret) && !x.webhookSecret.trim() && (o.setError("webhookSecret", { type: "manual", message: "Stripe webhook secret is required." }), v = !0), !v && p.mutate(x);
2343
2343
  };
2344
- return i("form", { onSubmit: o.handleSubmit(k), className: "space-y-14", children: [e("section", { "aria-labelledby": "stripe-payment-methods", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "stripe-payment-methods", className: "scroll-mt-10 text-lg font-semibold text-gray-900 dark:text-gray-50", children: "Payment Methods" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Choose which Stripe payment methods should be available at checkout." })] }), e("div", { className: "space-y-4 md:col-span-2", children: ou.map((x) => i("label", { className: "flex items-start gap-3 rounded-lg border border-gray-200 p-4 dark:border-gray-800", children: [e(Be, { checked: b.includes(x.value), onCheckedChange: (v) => f(x.value, v), className: "mt-0.5" }), i("div", { children: [e("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-50", children: x.label }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: x.description })] })] }, x.value)) })] }) }), e(L, {}), e("section", { "aria-labelledby": "stripe-api-access", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "stripe-api-access", className: "scroll-mt-10 text-lg font-semibold text-gray-900 dark:text-gray-50", children: "API Access" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Save the Stripe secret API key used to create checkout sessions." })] }), e("div", { className: "space-y-5 md:col-span-2", children: i("div", { children: [i("div", { className: "flex items-center gap-2", children: [e(ce, { htmlFor: "stripe-secret-key", children: "Secret API Key" }), u != null && u.hasSecretKey ? e(ia, { variant: "success", children: "Configured" }) : e(ia, { variant: "warning", children: "Required" })] }), e(de, { id: "stripe-secret-key", type: "password", className: "mt-2", placeholder: u != null && u.hasSecretKey ? "Leave blank to keep the saved API key" : "sk_live_...", hasError: !!o.formState.errors.secretKey, ...o.register("secretKey") }), e("p", { className: "mt-2 text-sm leading-6 text-gray-500", children: "Saved API keys are never returned to the browser. Leave this blank to keep the currently stored key." }), o.formState.errors.secretKey && e("p", { className: "mt-2 text-sm text-red-500", children: o.formState.errors.secretKey.message })] }) })] }) }), e(L, {}), e("section", { "aria-labelledby": "stripe-webhooks", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "stripe-webhooks", className: "scroll-mt-10 text-lg font-semibold text-gray-900 dark:text-gray-50", children: "Stripe Webhooks" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Copy the endpoint into Stripe, then paste the webhook secret here to save it as the Stripe integration config." })] }), i("div", { className: "space-y-5 md:col-span-2", children: [i("div", { children: [e(ce, { htmlFor: "stripe-webhook-endpoint", children: "Webhook Endpoint" }), e(de, { id: "stripe-webhook-endpoint", value: l, disabled: !0, readOnly: !0, className: "mt-2", copyValue: l, copySuccessMessage: "Stripe webhook endpoint copied to clipboard.", copyErrorMessage: "Failed to copy Stripe webhook endpoint. Please try again." })] }), i("div", { children: [i("div", { className: "flex items-center gap-2", children: [e(ce, { htmlFor: "stripe-webhook-secret", children: "Webhook Secret" }), u != null && u.hasWebhookSecret ? e(ia, { variant: "success", children: "Configured" }) : e(ia, { variant: "warning", children: "Required" })] }), e(de, { id: "stripe-webhook-secret", type: "password", className: "mt-2", placeholder: u != null && u.hasWebhookSecret ? "Leave blank to keep the saved webhook secret" : "whsec_...", hasError: !!o.formState.errors.webhookSecret, ...o.register("webhookSecret") }), i("p", { className: "mt-2 text-sm leading-6 text-gray-500", children: ["Stripe config is validated server-side for the ", e("code", { children: "stripe" }), " ", "integration type before it is saved. Saved secrets are never returned in API responses."] }), o.formState.errors.webhookSecret && e("p", { className: "mt-2 text-sm text-red-500", children: o.formState.errors.webhookSecret.message })] })] })] }) }), e(L, {}), i("div", { className: "flex justify-end gap-3", children: [i(I, { type: "button", variant: "secondary", onClick: () => n.push(m), children: [e(ga, { className: "mr-2 h-4 w-4" }), " Cancel"] }), d && i(I, { type: "button", variant: "secondary", className: "text-red-600 dark:text-red-400", onClick: () => h.mutate(), isLoading: h.isPending, loadingText: "Removing...", children: [e($s, { className: "mr-2 h-4 w-4" }), " Remove"] }), i(I, { type: "submit", isLoading: p.isPending, loadingText: "Saving...", children: [e(Ma, { className: "mr-2 h-4 w-4" }), " Save Integration"] })] })] });
2344
+ return i("form", { onSubmit: o.handleSubmit(k), className: "space-y-14", children: [e("section", { "aria-labelledby": "stripe-payment-methods", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "stripe-payment-methods", className: "scroll-mt-10 text-lg font-semibold text-gray-900 dark:text-gray-50", children: "Payment Methods" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Choose which Stripe payment methods should be available at checkout." })] }), e("div", { className: "space-y-4 md:col-span-2", children: ou.map((x) => i("label", { className: "flex items-start gap-3 rounded-lg border border-gray-200 p-4 dark:border-gray-800", children: [e(Be, { checked: b.includes(x.value), onCheckedChange: (v) => f(x.value, v), className: "mt-0.5" }), i("div", { children: [e("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-50", children: x.label }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: x.description })] })] }, x.value)) })] }) }), e(L, {}), e("section", { "aria-labelledby": "stripe-api-access", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "stripe-api-access", className: "scroll-mt-10 text-lg font-semibold text-gray-900 dark:text-gray-50", children: "API Access" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Save the Stripe secret API key used to create checkout sessions." })] }), e("div", { className: "space-y-5 md:col-span-2", children: i("div", { children: [i("div", { className: "flex items-center gap-2", children: [e(ce, { htmlFor: "stripe-secret-key", children: "Secret API Key" }), u != null && u.hasSecretKey ? e(ia, { variant: "success", children: "Configured" }) : e(ia, { variant: "warning", children: "Required" })] }), e(de, { id: "stripe-secret-key", type: "password", className: "mt-2", placeholder: u != null && u.hasSecretKey ? "Leave blank to keep the saved API key" : "sk_live_...", hasError: !!o.formState.errors.secretKey, ...o.register("secretKey") }), e("p", { className: "mt-2 text-sm leading-6 text-gray-500", children: "Saved API keys are never returned to the browser. Leave this blank to keep the currently stored key." }), o.formState.errors.secretKey && e("p", { className: "mt-2 text-sm text-red-500", children: o.formState.errors.secretKey.message })] }) })] }) }), e(L, {}), e("section", { "aria-labelledby": "stripe-webhooks", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "stripe-webhooks", className: "scroll-mt-10 text-lg font-semibold text-gray-900 dark:text-gray-50", children: "Stripe Webhooks" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Copy the endpoint into Stripe, then paste the webhook secret here to save it as the Stripe integration config." })] }), i("div", { className: "space-y-5 md:col-span-2", children: [i("div", { children: [e(ce, { htmlFor: "stripe-webhook-endpoint", children: "Webhook Endpoint" }), e(de, { id: "stripe-webhook-endpoint", value: l, disabled: !0, readOnly: !0, className: "mt-2", copyValue: l, copySuccessMessage: "Stripe webhook endpoint copied to clipboard.", copyErrorMessage: "Failed to copy Stripe webhook endpoint. Please try again." })] }), i("div", { children: [i("div", { className: "flex items-center gap-2", children: [e(ce, { htmlFor: "stripe-webhook-secret", children: "Webhook Secret" }), u != null && u.hasWebhookSecret ? e(ia, { variant: "success", children: "Configured" }) : e(ia, { variant: "warning", children: "Required" })] }), e(de, { id: "stripe-webhook-secret", type: "password", className: "mt-2", placeholder: u != null && u.hasWebhookSecret ? "Leave blank to keep the saved webhook secret" : "whsec_...", hasError: !!o.formState.errors.webhookSecret, ...o.register("webhookSecret") }), i("p", { className: "mt-2 text-sm leading-6 text-gray-500", children: ["Stripe config is validated server-side for the", " ", e("code", { children: "stripe" }), " integration type before it is saved. Saved secrets are never returned in API responses."] }), o.formState.errors.webhookSecret && e("p", { className: "mt-2 text-sm text-red-500", children: o.formState.errors.webhookSecret.message })] })] })] }) }), e(L, {}), i("div", { className: "flex justify-end gap-3", children: [i(I, { type: "button", variant: "secondary", onClick: () => n.push(m), children: [e(ga, { className: "mr-2 h-4 w-4" }), " Cancel"] }), d && i(I, { type: "button", variant: "secondary", className: "text-red-600 dark:text-red-400", onClick: () => h.mutate(), isLoading: h.isPending, loadingText: "Removing...", children: [e($s, { className: "mr-2 h-4 w-4" }), " Remove"] }), i(I, { type: "submit", isLoading: p.isPending, loadingText: "Saving...", children: [e(Ma, { className: "mr-2 h-4 w-4" }), " Save Integration"] })] })] });
2345
2345
  }
2346
2346
  function mu() {
2347
2347
  const a = wa(), t = j(), r = q(), n = _(), s = Lr(a);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shophost/react",
3
- "version": "2.0.47",
3
+ "version": "2.0.48",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.mjs",
@@ -82,8 +82,8 @@
82
82
  "@react-aria/datepicker": "^3.16.1",
83
83
  "@react-stately/datepicker": "^3.16.1",
84
84
  "@remixicon/react": "^4.6.0",
85
- "@shophost/client": "^2.0.47",
86
- "@shophost/rest-api": "^2.0.47",
85
+ "@shophost/client": "^2.0.48",
86
+ "@shophost/rest-api": "^2.0.48",
87
87
  "@tanstack/react-query": "^5.67.2",
88
88
  "@tanstack/react-table": "^8.21.3",
89
89
  "@vercel/blob": "^0.27.2",