@solvapay/react 1.1.3 → 1.1.4-preview-8dc1786bbc8d3879570dcfec066948f40e3b9a73

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,5 +1,31 @@
1
1
  # @solvapay/react changelog
2
2
 
3
+ ## 1.1.4-preview-8dc1786bbc8d3879570dcfec066948f40e3b9a73
4
+
5
+ ### Patch Changes
6
+
7
+ - 0240670: Fix `<McpApp>` shell content width on wide-iframe hosts. The previous CSS-only "fill iframe width" change removed the `max-width: 520px` cap from `.solvapay-mcp-main` so unbounded-iframe hosts (MCP Inspector, MCP Jam, full-browser previews) could use the column they hand us, but it overshot — at iframe widths beyond ~700px the AppHeader, body card, and LegalFooter all stretched to the iframe edges, splaying receipt rows with hundreds of pixels of dead air, blowing up the `width: 100%` button to ~800px, and producing >95-character body-copy line lengths.
8
+
9
+ Re-introduce a single `max-inline-size: 520px` on `.solvapay-mcp-main` so the whole shell renders as one visually unified block centred in the iframe. The earlier `@media (min-width: 900px) { max-width: 960px }` sidebar-mode override is intentionally not carried forward — it was the cause of the felt-cramped problem on 1200px+ iframes.
10
+
11
+ Also convert the wide-shell sidebar `@media (min-width: 900px)` query (`.solvapay-mcp-shell-sidebar` + `.solvapay-mcp-shell-layout` grid switch) to a `@container (min-width: 900px)` query, with `container-type: inline-size` on `.solvapay-mcp-main`. Without this, the sidebar grid would still fire on iframe viewport width — meaning at iframe widths ≥900px the `1fr + 320px` grid would activate inside the 520px capped shell, squeezing the body column to ~184px and breaking payment forms. Container queries fire on the shell's own width.
12
+
13
+ When the shell renders the sidebar (authenticated customers — `isShellSidebarEligible` in `McpAppShell.tsx`), lift the cap to 900px via `.solvapay-mcp-main:has(.solvapay-mcp-shell-sidebar)`. Without this lift, `McpAppShell` would suppress the inline customer/seller detail cards in the body (assuming the sidebar takes them) while the sidebar would stay `display: none` (because the container threshold is never reached inside the 520 cap) — both copies hidden, customer details invisible for every authenticated user. With the lift, the 1fr + 320 sidebar grid has room and the container query fires correctly. Unauthenticated flows keep the tighter 520 cap.
14
+
15
+ Below 520px (Claude Desktop ~400-500px, ChatGPT inline ~400px, Mobile Claude ~300-360px) the cap is a no-op and content fills the host's container, matching Anthropic's "apps fill the container width" guidance for the primary use cases. Above 520px the cap activates.
16
+
17
+ Source-grounded basis for 520:
18
+ - SEP-1865 §"Container Dimensions" — when the host omits `containerDimensions.width`/`maxWidth` (Unbounded mode) the spec delegates the size choice to the View.
19
+ - OpenAI Apps SDK guidelines mandate "set a max width and design layouts that collapse gracefully on small screens".
20
+ - OpenAI's `apps-sdk-ui` reservation card uses `max-w-sm` (384px); `openai-apps-sdk-examples` cluster sits at 220-360px.
21
+ - Anthropic's PRIMARY use case is Desktop Claude at 400-500px. 520 is a small composite-flow buffer above that range — our `PlanStep → AmountStep → PaymentStep → SuccessStep` is slightly larger than a single-tool inline card.
22
+ - At our 14px body, 520px ≈ 62ch — inside the 65-75ch optimal reading line length.
23
+
24
+ - 8dd8638: Fix `McpAppFull.addEventListener`/`removeEventListener` types to accept the tighter `K extends keyof AppEventMap` shape introduced in `@modelcontextprotocol/ext-apps@^1.7`. Previously the loose `(evt: string, …)` signature on the interface didn't match what ext-apps exposes from 1.7+, so consumers seeing types from both `@solvapay/react` and `ext-apps@^1.7` would hit `TS2322: Type 'App' is not assignable to type 'McpAppFull'` at every `<McpApp app={...} />` mount site.
25
+
26
+ The interface now declares `(evt: any, …)` for both event-listener fields, which is permissive enough to satisfy the new tightened generic without giving up the legacy `ontoolresult` setter fallback. Fixes [PR #169](https://github.com/solvapay/solvapay-sdk/pull/169).
27
+ - @solvapay/mcp-core@0.2.4
28
+
3
29
  ## 1.1.3
4
30
 
5
31
  ### Patch Changes
@@ -801,8 +801,8 @@ interface McpAppFull extends McpAppBootstrapLike, McpAppLike, McpBridgeAppLike {
801
801
  * Kept optional so minimal test adapters can omit it — the code falls
802
802
  * back to the legacy `ontoolresult` setter.
803
803
  */
804
- addEventListener?: (evt: string, handler: (params: any) => void) => void;
805
- removeEventListener?: (evt: string, handler: (params: any) => void) => void;
804
+ addEventListener?: (evt: any, handler: (params: any) => void) => void;
805
+ removeEventListener?: (evt: any, handler: (params: any) => void) => void;
806
806
  ontoolresult?: any;
807
807
  /**
808
808
  * Fire-and-forget request asking the host to unmount the app. When
@@ -801,8 +801,8 @@ interface McpAppFull extends McpAppBootstrapLike, McpAppLike, McpBridgeAppLike {
801
801
  * Kept optional so minimal test adapters can omit it — the code falls
802
802
  * back to the legacy `ontoolresult` setter.
803
803
  */
804
- addEventListener?: (evt: string, handler: (params: any) => void) => void;
805
- removeEventListener?: (evt: string, handler: (params: any) => void) => void;
804
+ addEventListener?: (evt: any, handler: (params: any) => void) => void;
805
+ removeEventListener?: (evt: any, handler: (params: any) => void) => void;
806
806
  ontoolresult?: any;
807
807
  /**
808
808
  * Fire-and-forget request asking the host to unmount the app. When
@@ -41,20 +41,56 @@ body {
41
41
  padding: 16px;
42
42
  }
43
43
 
44
+ /* Cap the whole shell at a chat-card width so the AppHeader, body
45
+ * card stack, and LegalFooter all align as one visually unified
46
+ * block centred in the iframe. Capping individual children
47
+ * (`.solvapay-mcp-shell-body` only) leaves the merchant pill orphaned
48
+ * to the iframe-left and the footer's `space-between` splayed across
49
+ * the full iframe — both look disjointed on wide hosts.
50
+ *
51
+ * Why 520:
52
+ * - SEP-1865 §"Container Dimensions" — when the host omits
53
+ * `containerDimensions.width`/`maxWidth` (Unbounded mode) the
54
+ * spec delegates the size choice to the View. We must pick.
55
+ * - OpenAI Apps SDK guidelines mandate "set a max width and design
56
+ * layouts that collapse gracefully on small screens".
57
+ * - OpenAI's `apps-sdk-ui` reservation card uses `max-w-sm` (384px);
58
+ * `openai-apps-sdk-examples` cluster sits at 220-360px.
59
+ * - Anthropic's PRIMARY use case is Desktop Claude at 400-500px.
60
+ * 520 is a small composite-flow buffer above that range — our
61
+ * PlanStep → AmountStep → PaymentStep → SuccessStep is slightly
62
+ * larger than a single-tool inline card.
63
+ * - At our 14px body, 520px ≈ 62ch — inside the 65-75ch optimal
64
+ * reading line length.
65
+ *
66
+ * On hosts narrower than 520 (Claude Desktop ~400-500px, ChatGPT
67
+ * inline ~400px, Mobile Claude ~300-360px) the cap is a no-op and
68
+ * content fills, matching Anthropic's "apps fill the container
69
+ * width" guidance for the primary cases. The previous `@media
70
+ * (min-width: 900px) { max-width: 960px }` sidebar-mode override
71
+ * is intentionally NOT carried forward — it was the cause of the
72
+ * felt-cramped problem on 1200px+ iframes. Surfaces that genuinely
73
+ * need more horizontal room should request `displayMode: "fullscreen"`
74
+ * per Anthropic's design guidance, not stretch the inline shell. */
44
75
  .solvapay-mcp-main {
45
76
  display: flex;
46
77
  flex-direction: column;
47
78
  gap: 12px;
48
- max-width: 520px;
49
- margin: 0 auto;
79
+ max-inline-size: 520px;
80
+ margin-inline: auto;
50
81
  }
51
82
 
52
- /* Widen the container at the sidebar breakpoint so the two-column
53
- * layout has room to breathe. */
54
- @media (min-width: 900px) {
55
- .solvapay-mcp-main {
56
- max-width: 960px;
57
- }
83
+ /* When the shell renders the sidebar (authenticated customers,
84
+ * `isShellSidebarEligible` in McpAppShell.tsx), lift the cap so the
85
+ * 1fr + 320px sidebar grid fits AND the `@container (min-width: 900px)`
86
+ * query below can fire. 900 = body (520) + gap (16) + sidebar (320)
87
+ * + small buffer. Without this lift, McpAppShell would suppress the
88
+ * inline detail cards (assuming the sidebar takes them) while the
89
+ * sidebar stays `display: none` (because the @container threshold is
90
+ * never reached inside the 520 cap) — both copies hidden, customer
91
+ * details invisible for every authed user. */
92
+ .solvapay-mcp-main:has(.solvapay-mcp-shell-sidebar) {
93
+ max-inline-size: 900px;
58
94
  }
59
95
 
60
96
  .solvapay-mcp-header h1 {
@@ -458,6 +494,16 @@ body {
458
494
  display: flex;
459
495
  flex-direction: column;
460
496
  gap: 16px;
497
+ /* Inline-size container for the sidebar layout below
498
+ * (`.solvapay-mcp-shell-sidebar` / `.solvapay-mcp-shell-layout` use
499
+ * `@container (min-width: 900px)`). Scoped here rather than on
500
+ * `.solvapay-mcp-main` so dormant fixed-positioned overlays
501
+ * (`.solvapay-mcp-tour-overlay`, `.solvapay-mcp-tour-popover`) that
502
+ * render as siblings of `<McpAppShell>` inside `.solvapay-mcp-main`
503
+ * stay anchored to the iframe viewport — `container-type` makes the
504
+ * element a containing block for `position: fixed` descendants per
505
+ * the CSS containment spec, so we keep that scope tight. */
506
+ container-type: inline-size;
461
507
  }
462
508
 
463
509
  .solvapay-mcp-tablist {
@@ -516,15 +562,21 @@ body {
516
562
  gap: 16px;
517
563
  }
518
564
 
519
- /* Wide-iframe sidebar: visible at >= 900px. Hosts with narrow iframes
520
- * (ChatGPT ~400px, compact Claude Desktop) fall through to the
521
- * single-column layout with Account in the tab strip. */
565
+ /* Wide-shell sidebar: visible when `.solvapay-mcp-main` itself is
566
+ * ≥900px wide. Container query (not media query) so the layout fires
567
+ * on the shell's own size, not the iframe viewport — important
568
+ * because `.solvapay-mcp-main` is capped at 520px by default, and
569
+ * we don't want the sidebar grid activating inside that cap on wide
570
+ * iframes (MCP Inspector full browser, MCP Jam) which would squeeze
571
+ * the body column. Hosts with narrow iframes (ChatGPT ~400px,
572
+ * compact Claude Desktop) and the default capped shell fall through
573
+ * to the single-column layout with Account in the tab strip. */
522
574
 
523
575
  .solvapay-mcp-shell-sidebar {
524
576
  display: none;
525
577
  }
526
578
 
527
- @media (min-width: 900px) {
579
+ @container (min-width: 900px) {
528
580
  .solvapay-mcp-shell-layout {
529
581
  grid-template-columns: minmax(0, 1fr) 320px;
530
582
  }
@@ -535,9 +587,9 @@ body {
535
587
  gap: 12px;
536
588
  }
537
589
 
538
- /* Account tab is hidden at wide viewports — its content lives in
539
- * the sidebar. Stays in the DOM so the arrow-key nav is stable;
540
- * CSS just takes it out of flow. */
590
+ /* Account tab is hidden in the wide-shell layout — its content
591
+ * lives in the sidebar. Stays in the DOM so the arrow-key nav is
592
+ * stable; CSS just takes it out of flow. */
541
593
  .solvapay-mcp-tab[data-hide-wide='true'] {
542
594
  display: none;
543
595
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solvapay/react",
3
- "version": "1.1.3",
3
+ "version": "1.1.4-preview-8dc1786bbc8d3879570dcfec066948f40e3b9a73",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -75,12 +75,12 @@
75
75
  "@vitejs/plugin-react": "^6.0.1",
76
76
  "@vitest/coverage-v8": "^4.1.2",
77
77
  "jsdom": "^29.0.1",
78
- "react": "^19.2.4",
79
- "react-dom": "^19.2.4",
78
+ "react": "^19.2.5",
79
+ "react-dom": "^19.2.5",
80
80
  "typescript": "^5.9.3",
81
81
  "vitest": "^4.1.2",
82
82
  "@solvapay/mcp-core": "0.2.4",
83
- "@solvapay/server": "1.0.11",
83
+ "@solvapay/server": "1.0.12-preview-8dc1786bbc8d3879570dcfec066948f40e3b9a73",
84
84
  "@solvapay/test-utils": "0.0.0"
85
85
  },
86
86
  "scripts": {