@molecule/app-plan-updated-page-solid 0.0.1-stage → 1.1.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.
Files changed (2) hide show
  1. package/README.md +150 -4
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,11 +1,157 @@
1
+ <!--
2
+ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
+ Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
+ Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
+ To change this document, edit the module-level JSDoc in src/index.ts.
6
+ Generated: 2026-11-21T12:46:56.575Z
7
+ -->
8
+
1
9
  # @molecule/app-plan-updated-page-solid
2
10
 
3
- Post-purchase confirmation page shown after a plan upgrade. Reads auth state and displays a localized thank-you message + Return Home button.
11
+ Solid post-purchase confirmation page.
12
+
13
+ Exports `PlanUpdated` — the Solid counterpart of
14
+ `@molecule/app-plan-updated-page-react` with the same props (React names)
15
+ and the same DOM for the same input: a thank-you headline plus a Return
16
+ Home button, rendered after the user completes a plan upgrade. It reads
17
+ auth state to show a spinner while the session is still hydrating, so the
18
+ page is safe to navigate to directly from a webhook redirect or a fresh
19
+ page load.
20
+
21
+ **It also completes the purchase.** A hosted checkout returns the buyer
22
+ here with the payment id in the query
23
+ (`/plan-updated?provider=stripe&sessionId=…`), and this page confirms it
24
+ with `POST /users/:id/verify-payment/:provider` — a same-origin call, so
25
+ the session cookie applies. Route it at the path your API's
26
+ `PAYMENTS_PLAN_UPDATED_PATH` points to (default `/plan-updated`) and the
27
+ upgrade completes on the redirect instead of waiting on a webhook.
28
+
29
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
30
+ > It is written to be read by coding agents as much as by people, and is generated from this
31
+ > package's source — edit `src/index.ts` JSDoc, not this file.
32
+
33
+ ## Quick Start
34
+
35
+ ```tsx
36
+ import { PlanUpdated } from '@molecule/app-plan-updated-page-solid'
37
+
38
+ ;<Route path="/plan-updated" component={PlanUpdated} />
39
+ ```
40
+
41
+ ## Type
42
+
43
+ `feature`
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ npm install @molecule/app-plan-updated-page-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js
49
+ ```
50
+
51
+ ## API
52
+
53
+ ### Interfaces
54
+
55
+ #### `PlanUpdatedProps`
4
56
 
57
+ Props for {@link PlanUpdated}. All optional — defaults reproduce the
58
+ original hardcoded copy, so existing `<PlanUpdated />` usages are unchanged.
59
+
60
+ ```typescript
61
+ interface PlanUpdatedProps {
62
+ /** i18n key for the confirmation message. */
63
+ messageKey?: string
64
+ /** Default confirmation message when the key is missing. */
65
+ messageDefault?: string
66
+ /** i18n key for the thank-you line. */
67
+ thankYouKey?: string
68
+ /** Default thank-you line when the key is missing. */
69
+ thankYouDefault?: string
70
+ /** i18n key for the return-home action label. */
71
+ actionKey?: string
72
+ /** Default action label when the key is missing. */
73
+ actionDefault?: string
74
+ /** Href the return-home action navigates to. Defaults to `/`. */
75
+ actionHref?: string
76
+ /**
77
+ * Provider name to verify the purchase with when the return URL carries no
78
+ * `provider` parameter (older checkout sessions). Verification is skipped
79
+ * when neither names one.
80
+ */
81
+ provider?: string
82
+ /**
83
+ * Set `false` to render the confirmation without verifying the purchase —
84
+ * only for apps that grant the plan some other way (a provider webhook you
85
+ * know is configured, or a manual back-office flow).
86
+ */
87
+ verify?: boolean
88
+ }
5
89
  ```
6
- npm install @molecule/app-plan-updated-page-solid
90
+
91
+ ### Functions
92
+
93
+ #### `PlanUpdated(props)`
94
+
95
+ Post-purchase confirmation page rendered after a plan upgrade.
96
+
97
+ Solid counterpart of `@molecule/app-plan-updated-page-react`'s
98
+ `PlanUpdated` — the same props (React names), the same DOM for the same
99
+ input. Reads auth state via `useAuth`; while it's still initializing, shows
100
+ a centered spinner. Once ready, renders a celebratory layout: a large
101
+ success glyph in a soft circular halo, a two-line thank-you
102
+ (`planUpdated.message`, `planUpdated.thankYou`), and a Return Home button
103
+ styled with the app's primary color tokens.
104
+
105
+ Those three translation keys are part of the universal common-locale bond
106
+ (`@molecule/app-locales-common`); the always-rendered "View receipt" link
107
+ uses `planUpdated.viewReceipt` from the companion bond
108
+ `@molecule/app-locales-plan-updated-page` and navigates to the hardcoded
109
+ `/billing` route. Visual layout uses only ClassMap tokens so it inherits the
110
+ app's theme (radius, color tokens, spacing) with no per-app override.
111
+
112
+ ```typescript
113
+ function PlanUpdated(props: PlanUpdatedProps): JSX.Element
7
114
  ```
8
115
 
9
- Part of the [Molecule](https://www.molecule.dev) package fleet. This page carries the manifest summary; the full generated documentation ships with the package's first committed version.
116
+ - `props` — Component props (see {@link PlanUpdatedProps}).
117
+
118
+ **Returns:** The rendered plan-updated confirmation page.
119
+
120
+ ## Injection Notes
121
+
122
+ ### Requirements
123
+
124
+ Peer dependencies:
125
+
126
+ - `@molecule/app-solid` ^3.6.0
127
+ - `@molecule/app-ui` ^1.0.1
128
+ - `@molecule/app-ui-solid` ^1.1.0
129
+ - `solid-js` ^1.8.0
130
+
131
+ ### Runtime Dependencies
132
+
133
+ - `@molecule/app-solid`
134
+ - `@molecule/app-ui`
135
+ - `@molecule/app-ui-solid`
136
+ - `solid-js`
137
+
138
+ Requires the app's `MoleculeProvider` (`@molecule/app-solid`) configured with
139
+ `auth` and `i18n` (`useAuth` drives the hydration spinner,
140
+ `useVerifyPaymentReturn` the confirmation call), plus its `router` (the page
141
+ renders `Link`, so it must sit inside the app's router). Never point a
142
+ provider's `success_url` straight at the API's
143
+ `/api/users/:id/verify-payment/:provider`: that top-level redirect crosses
144
+ to a host the session cookie is not set for, so it answers 401 and the paid
145
+ plan is never granted — send the buyer to THIS page instead. While the
146
+ confirmation is in flight the page shows the spinner; if it fails it shows a
147
+ retry (`data-mol-id="plan-updated-retry"`) rather than a false thank-you.
148
+ Pass `verify={false}` only if some other path grants the plan. Keys
149
+ `planUpdated.message` / `planUpdated.thankYou` / `planUpdated.returnHome`
150
+ come from `@molecule/app-locales-common`; the "View receipt" link uses
151
+ `planUpdated.viewReceipt` from the companion bond
152
+ `@molecule/app-locales-plan-updated-page` and always navigates to
153
+ `/billing` — ensure that route exists.
154
+
155
+ ## Translations
10
156
 
11
- License: Apache-2.0
157
+ Translation strings are provided by `@molecule/app-locales-plan-updated-page`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-plan-updated-page-solid",
3
- "version": "0.0.1-stage",
3
+ "version": "1.1.0",
4
4
  "description": "Post-purchase confirmation page shown after a plan upgrade. Reads auth state and displays a localized thank-you message + Return Home button.",
5
5
  "homepage": "https://www.molecule.dev/packages/app-plan-updated-page-solid",
6
6
  "type": "module",
@@ -53,10 +53,10 @@
53
53
  "@molecule/app-framework-conformance": "0.0.0",
54
54
  "@molecule/app-i18n": "1.2.2",
55
55
  "@molecule/app-icons": "1.0.4",
56
- "@molecule/app-locales-common": "1.0.7",
57
- "@molecule/app-solid": "3.7.2",
58
- "@molecule/app-ui": "1.4.0",
59
- "@molecule/app-ui-solid": "1.1.5",
56
+ "@molecule/app-locales-common": "1.0.8",
57
+ "@molecule/app-solid": "3.9.0",
58
+ "@molecule/app-ui": "1.5.0",
59
+ "@molecule/app-ui-solid": "1.2.1",
60
60
  "@types/node": "26.6.5",
61
61
  "jsdom": "30.1.3",
62
62
  "solid-js": "1.9.17",