@solvapay/react 1.3.0-preview-4fc78fc1b86faff0348e15fb04bb3daa798eaf03 → 1.3.0

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @solvapay/react changelog
2
2
 
3
- ## 1.3.0-preview-4fc78fc1b86faff0348e15fb04bb3daa798eaf03
3
+ ## 1.3.0
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -14,12 +14,10 @@
14
14
  Add an idempotent `solvapay://bootstrap.json` MCP resource so widget remounts on hosts that scrub `structuredContent` (e.g. MCPJam) recover via `readServerResource` instead of replaying intent tools. Explicit refresh paths still use `fetchMcpBootstrap`.
15
15
 
16
16
  - c2a1169: Loosen internal `@solvapay/*` peerDependency ranges from `workspace:*` (exact) to `workspace:^` so a patch/minor bump of a peer no longer forces a major bump on its dependents. Affects `@solvapay/react` → `@solvapay/mcp-core`, `@solvapay/server` → `@solvapay/auth`, and `@solvapay/mcp` → `@solvapay/mcp-core`. This is a widening of the published peer range and is non-breaking for consumers.
17
+ - 7a03c7f: Credit → fiat display helpers (`creditsToDisplayMinorUnits`, `minorUnitsPerMajor`, `isZeroDecimalCurrency`) now live in `@solvapay/core` so Next.js client components can import them without pulling the Node-only `@solvapay/mcp-core` server bundle. `@solvapay/mcp-core` re-exports the same symbols for backward compatibility.
17
18
  - 2de7fd8: Surface server `{ error }` messages from failed plans and checkout fetches instead of generic HTTP status text.
18
- - Updated dependencies [5a9ec8d]
19
- - Updated dependencies [4892771]
20
- - Updated dependencies [0eebbdb]
21
- - Updated dependencies [1ec6297]
22
- - @solvapay/mcp-core@0.2.6-preview-4fc78fc1b86faff0348e15fb04bb3daa798eaf03
19
+ - Updated dependencies [7a03c7f]
20
+ - @solvapay/core@1.1.0
23
21
 
24
22
  ## 1.2.1
25
23
 
@@ -14,7 +14,7 @@ import {
14
14
  usePurchaseStatus,
15
15
  useSolvaPay,
16
16
  useTransport
17
- } from "./chunk-VWU6ILFF.js";
17
+ } from "./chunk-DW5FJUUG.js";
18
18
 
19
19
  // src/components/CancelledPlanNotice.tsx
20
20
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -3922,7 +3922,7 @@ function useTopupForm() {
3922
3922
 
3923
3923
  // src/primitives/BalanceBadge.tsx
3924
3924
  import { forwardRef as forwardRef7, useContext as useContext11 } from "react";
3925
- import { creditsToDisplayMinorUnits, minorUnitsPerMajor } from "@solvapay/mcp-core";
3925
+ import { creditsToDisplayMinorUnits, minorUnitsPerMajor } from "@solvapay/core";
3926
3926
  import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
3927
3927
  var BalanceBadge = forwardRef7(function BalanceBadge2({ asChild, numberOnly, lowThreshold = 10, children, ...rest }, forwardedRef) {
3928
3928
  const solva = useContext11(SolvaPayContext);
@@ -30,7 +30,7 @@ import {
30
30
  useProduct,
31
31
  usePurchase,
32
32
  useTopupAmountSelector
33
- } from "./chunk-VWU6ILFF.js";
33
+ } from "./chunk-DW5FJUUG.js";
34
34
 
35
35
  // src/TopupForm.tsx
36
36
  import { jsx, jsxs } from "react/jsx-runtime";
package/dist/index.cjs CHANGED
@@ -4343,7 +4343,7 @@ var StripePaymentFormWrapper = ({
4343
4343
 
4344
4344
  // src/primitives/BalanceBadge.tsx
4345
4345
  var import_react25 = require("react");
4346
- var import_mcp_core = require("@solvapay/mcp-core");
4346
+ var import_core = require("@solvapay/core");
4347
4347
  var import_jsx_runtime19 = require("react/jsx-runtime");
4348
4348
  var BalanceBadge = (0, import_react25.forwardRef)(function BalanceBadge2({ asChild, numberOnly, lowThreshold = 10, children, ...rest }, forwardedRef) {
4349
4349
  const solva = (0, import_react25.useContext)(SolvaPayContext);
@@ -4372,14 +4372,14 @@ var BalanceBadge = (0, import_react25.forwardRef)(function BalanceBadge2({ asChi
4372
4372
  const formattedCredits = new Intl.NumberFormat(locale).format(credits);
4373
4373
  let currencyEquivalent = "";
4374
4374
  if (!numberOnly && displayCurrency && creditsPerMinorUnit) {
4375
- const displayMinor = (0, import_mcp_core.creditsToDisplayMinorUnits)({
4375
+ const displayMinor = (0, import_core.creditsToDisplayMinorUnits)({
4376
4376
  credits,
4377
4377
  creditsPerMinorUnit,
4378
4378
  displayExchangeRate: displayExchangeRate ?? 1,
4379
4379
  displayCurrency
4380
4380
  });
4381
4381
  if (displayMinor !== null) {
4382
- const minorPerMajor = (0, import_mcp_core.minorUnitsPerMajor)(displayCurrency);
4382
+ const minorPerMajor = (0, import_core.minorUnitsPerMajor)(displayCurrency);
4383
4383
  const formatted = new Intl.NumberFormat(locale, {
4384
4384
  style: "currency",
4385
4385
  currency: displayCurrency,
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  LaunchCustomerPortalButton,
8
8
  UpdatePaymentMethodButton,
9
9
  usePaymentMethod
10
- } from "./chunk-NYA2PGMV.js";
10
+ } from "./chunk-4ISNB3JU.js";
11
11
  import {
12
12
  ActivationFlow,
13
13
  CheckoutSteps,
@@ -20,7 +20,7 @@ import {
20
20
  useCheckoutSteps,
21
21
  useCreditGate,
22
22
  usePaywallResolver
23
- } from "./chunk-CHI3CENW.js";
23
+ } from "./chunk-K7ZUJI26.js";
24
24
  import {
25
25
  AmountPicker,
26
26
  BalanceBadge,
@@ -88,7 +88,7 @@ import {
88
88
  useTopupAmountSelector,
89
89
  useTransport,
90
90
  useUsage
91
- } from "./chunk-VWU6ILFF.js";
91
+ } from "./chunk-DW5FJUUG.js";
92
92
  import {
93
93
  createAnonymousAuthAdapter,
94
94
  defaultAuthAdapter,
@@ -33,7 +33,7 @@ __export(mcp_exports, {
33
33
  AppHeader: () => AppHeader,
34
34
  BackLink: () => BackLink,
35
35
  HOSTS_WITH_MERCHANT_CHROME: () => HOSTS_WITH_MERCHANT_CHROME,
36
- MCP_TOOL_NAMES: () => import_mcp_core6.MCP_TOOL_NAMES,
36
+ MCP_TOOL_NAMES: () => import_mcp_core4.MCP_TOOL_NAMES,
37
37
  McpAccountView: () => McpAccountView,
38
38
  McpApp: () => McpApp,
39
39
  McpAppShell: () => McpAppShell,
@@ -109,7 +109,7 @@ function createMcpAppAdapter(app) {
109
109
  }
110
110
 
111
111
  // src/mcp/index.ts
112
- var import_mcp_core6 = require("@solvapay/mcp-core");
112
+ var import_mcp_core4 = require("@solvapay/mcp-core");
113
113
 
114
114
  // src/mcp/useStripeProbe.ts
115
115
  var import_react = require("react");
@@ -2210,7 +2210,7 @@ function seedMcpCaches(initial, config) {
2210
2210
 
2211
2211
  // src/mcp/McpApp.tsx
2212
2212
  var import_react51 = require("react");
2213
- var import_mcp_core5 = require("@solvapay/mcp-core");
2213
+ var import_mcp_core3 = require("@solvapay/mcp-core");
2214
2214
 
2215
2215
  // src/mcp/McpAppShell.tsx
2216
2216
  var import_react48 = require("react");
@@ -2679,7 +2679,7 @@ var CancelledPlanNotice2 = ({
2679
2679
 
2680
2680
  // src/primitives/BalanceBadge.tsx
2681
2681
  var import_react17 = require("react");
2682
- var import_mcp_core3 = require("@solvapay/mcp-core");
2682
+ var import_core = require("@solvapay/core");
2683
2683
 
2684
2684
  // src/hooks/useBalance.ts
2685
2685
  var import_react16 = require("react");
@@ -2720,14 +2720,14 @@ var BalanceBadge = (0, import_react17.forwardRef)(function BalanceBadge2({ asChi
2720
2720
  const formattedCredits = new Intl.NumberFormat(locale).format(credits);
2721
2721
  let currencyEquivalent = "";
2722
2722
  if (!numberOnly && displayCurrency && creditsPerMinorUnit) {
2723
- const displayMinor = (0, import_mcp_core3.creditsToDisplayMinorUnits)({
2723
+ const displayMinor = (0, import_core.creditsToDisplayMinorUnits)({
2724
2724
  credits,
2725
2725
  creditsPerMinorUnit,
2726
2726
  displayExchangeRate: displayExchangeRate ?? 1,
2727
2727
  displayCurrency
2728
2728
  });
2729
2729
  if (displayMinor !== null) {
2730
- const minorPerMajor = (0, import_mcp_core3.minorUnitsPerMajor)(displayCurrency);
2730
+ const minorPerMajor = (0, import_core.minorUnitsPerMajor)(displayCurrency);
2731
2731
  const formatted = new Intl.NumberFormat(locale, {
2732
2732
  style: "currency",
2733
2733
  currency: displayCurrency,
@@ -3540,7 +3540,7 @@ var CurrentPlanCard = ({
3540
3540
  };
3541
3541
 
3542
3542
  // src/mcp/views/detail-cards.tsx
3543
- var import_mcp_core4 = require("@solvapay/mcp-core");
3543
+ var import_core2 = require("@solvapay/core");
3544
3544
 
3545
3545
  // src/hooks/useCustomer.ts
3546
3546
  function useCustomer() {
@@ -3629,7 +3629,7 @@ function McpCustomerDetailsCard({
3629
3629
  }
3630
3630
  const displayName = name?.trim() || "Customer";
3631
3631
  const showBalance = !hideBalance && typeof credits === "number" && credits > 0;
3632
- const displayMinor = showBalance && typeof creditsPerMinorUnit === "number" && creditsPerMinorUnit > 0 && displayCurrency ? (0, import_mcp_core4.creditsToDisplayMinorUnits)({
3632
+ const displayMinor = showBalance && typeof creditsPerMinorUnit === "number" && creditsPerMinorUnit > 0 && displayCurrency ? (0, import_core2.creditsToDisplayMinorUnits)({
3633
3633
  credits: credits ?? 0,
3634
3634
  creditsPerMinorUnit,
3635
3635
  displayExchangeRate: displayExchangeRate ?? 1,
@@ -8117,7 +8117,7 @@ function McpApp({
8117
8117
  if (toolName && isTransportToolName(toolName)) return;
8118
8118
  if (pendingBootstrapFetchRef.current) return;
8119
8119
  try {
8120
- const intentView = toolName ? import_mcp_core5.VIEW_FOR_TOOL[toolName] : void 0;
8120
+ const intentView = toolName ? import_mcp_core3.VIEW_FOR_TOOL[toolName] : void 0;
8121
8121
  const fallbackView = intentView ?? "checkout";
8122
8122
  const fresh = parseBootstrapFromToolResult(
8123
8123
  params,
package/dist/mcp/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  ExternalLinkGlyph,
4
4
  LaunchCustomerPortalButton,
5
5
  paymentMethodCache
6
- } from "../chunk-NYA2PGMV.js";
6
+ } from "../chunk-4ISNB3JU.js";
7
7
  import {
8
8
  AmountPicker,
9
9
  BalanceBadge,
@@ -38,7 +38,7 @@ import {
38
38
  usePurchase,
39
39
  usePurchaseStatus,
40
40
  useTransport
41
- } from "../chunk-VWU6ILFF.js";
41
+ } from "../chunk-DW5FJUUG.js";
42
42
  import "../chunk-UMXOAUW7.js";
43
43
 
44
44
  // src/mcp/adapter.ts
@@ -554,7 +554,7 @@ import { VIEW_FOR_TOOL as VIEW_FOR_TOOL2 } from "@solvapay/mcp-core";
554
554
  import { useState as useState6 } from "react";
555
555
 
556
556
  // src/mcp/views/detail-cards.tsx
557
- import { creditsToDisplayMinorUnits } from "@solvapay/mcp-core";
557
+ import { creditsToDisplayMinorUnits } from "@solvapay/core";
558
558
 
559
559
  // src/mcp/views/types.ts
560
560
  var DEFAULT_MCP_CLASS_NAMES = {
@@ -3893,7 +3893,7 @@ function useActivationFlow() {
3893
3893
 
3894
3894
  // src/primitives/BalanceBadge.tsx
3895
3895
  var import_react22 = require("react");
3896
- var import_mcp_core = require("@solvapay/mcp-core");
3896
+ var import_core = require("@solvapay/core");
3897
3897
  var import_jsx_runtime15 = require("react/jsx-runtime");
3898
3898
  var BalanceBadge = (0, import_react22.forwardRef)(function BalanceBadge2({ asChild, numberOnly, lowThreshold = 10, children, ...rest }, forwardedRef) {
3899
3899
  const solva = (0, import_react22.useContext)(SolvaPayContext);
@@ -3922,14 +3922,14 @@ var BalanceBadge = (0, import_react22.forwardRef)(function BalanceBadge2({ asChi
3922
3922
  const formattedCredits = new Intl.NumberFormat(locale).format(credits);
3923
3923
  let currencyEquivalent = "";
3924
3924
  if (!numberOnly && displayCurrency && creditsPerMinorUnit) {
3925
- const displayMinor = (0, import_mcp_core.creditsToDisplayMinorUnits)({
3925
+ const displayMinor = (0, import_core.creditsToDisplayMinorUnits)({
3926
3926
  credits,
3927
3927
  creditsPerMinorUnit,
3928
3928
  displayExchangeRate: displayExchangeRate ?? 1,
3929
3929
  displayCurrency
3930
3930
  });
3931
3931
  if (displayMinor !== null) {
3932
- const minorPerMajor = (0, import_mcp_core.minorUnitsPerMajor)(displayCurrency);
3932
+ const minorPerMajor = (0, import_core.minorUnitsPerMajor)(displayCurrency);
3933
3933
  const formatted = new Intl.NumberFormat(locale, {
3934
3934
  style: "currency",
3935
3935
  currency: displayCurrency,
@@ -51,7 +51,7 @@ import {
51
51
  useCreditGate,
52
52
  usePaywallNotice,
53
53
  usePurchaseGate
54
- } from "../chunk-CHI3CENW.js";
54
+ } from "../chunk-K7ZUJI26.js";
55
55
  import {
56
56
  AmountPicker,
57
57
  AmountPickerConfirm,
@@ -130,7 +130,7 @@ import {
130
130
  usePlanSelector,
131
131
  useTopupForm,
132
132
  useUsageMeter
133
- } from "../chunk-VWU6ILFF.js";
133
+ } from "../chunk-DW5FJUUG.js";
134
134
  import "../chunk-UMXOAUW7.js";
135
135
  export {
136
136
  ActivationFlow,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solvapay/react",
3
- "version": "1.3.0-preview-4fc78fc1b86faff0348e15fb04bb3daa798eaf03",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -59,7 +59,7 @@
59
59
  "peerDependencies": {
60
60
  "react": "^18.2.0 || ^19.0.0",
61
61
  "react-dom": "^18.2.0 || ^19.0.0",
62
- "@solvapay/mcp-core": "^0.2.6-preview-4fc78fc1b86faff0348e15fb04bb3daa798eaf03"
62
+ "@solvapay/mcp-core": "^0.2.6"
63
63
  },
64
64
  "peerDependenciesMeta": {
65
65
  "@solvapay/mcp-core": {
@@ -68,7 +68,8 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@stripe/react-stripe-js": "^6.0.0",
71
- "@stripe/stripe-js": "^9.0.0"
71
+ "@stripe/stripe-js": "^9.0.0",
72
+ "@solvapay/core": "1.1.0"
72
73
  },
73
74
  "devDependencies": {
74
75
  "@testing-library/dom": "^10.4.1",
@@ -84,8 +85,8 @@
84
85
  "react-dom": "^19.2.5",
85
86
  "typescript": "^5.9.3",
86
87
  "vitest": "^4.1.2",
87
- "@solvapay/mcp-core": "0.2.6-preview-4fc78fc1b86faff0348e15fb04bb3daa798eaf03",
88
- "@solvapay/server": "1.2.1-preview-4fc78fc1b86faff0348e15fb04bb3daa798eaf03",
88
+ "@solvapay/mcp-core": "0.2.6",
89
+ "@solvapay/server": "1.2.1",
89
90
  "@solvapay/test-utils": "0.0.0"
90
91
  },
91
92
  "scripts": {