@owlmeans/web-payment 0.1.18-rc.30 → 0.1.18-rc.31
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/README.md +1 -1
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/web-payment/SKILL.md +22 -9
- package/build/checkout-limit.d.ts.map +1 -1
- package/build/checkout-limit.js +4 -5
- package/build/checkout-limit.js.map +1 -1
- package/build/consts.d.ts +3 -0
- package/build/consts.d.ts.map +1 -0
- package/build/consts.js +3 -0
- package/build/consts.js.map +1 -0
- package/build/consts.local.d.ts +8 -0
- package/build/consts.local.d.ts.map +1 -0
- package/build/consts.local.js +17 -0
- package/build/consts.local.js.map +1 -0
- package/build/consumer/cancellation.d.ts.map +1 -1
- package/build/consumer/cancellation.js +4 -4
- package/build/consumer/cancellation.js.map +1 -1
- package/build/consumer/consts.d.ts +3 -0
- package/build/consumer/consts.d.ts.map +1 -0
- package/build/consumer/consts.js +3 -0
- package/build/consumer/consts.js.map +1 -0
- package/build/consumer/consts.local.d.ts +7 -0
- package/build/consumer/consts.local.d.ts.map +1 -0
- package/build/consumer/consts.local.js +7 -0
- package/build/consumer/consts.local.js.map +1 -0
- package/build/consumer/copy.d.ts +3 -5
- package/build/consumer/copy.d.ts.map +1 -1
- package/build/consumer/copy.js +4 -4
- package/build/consumer/copy.js.map +1 -1
- package/build/consumer/ensure.d.ts +1 -42
- package/build/consumer/ensure.d.ts.map +1 -1
- package/build/consumer/ensure.js.map +1 -1
- package/build/consumer/fields.d.ts +1 -32
- package/build/consumer/fields.d.ts.map +1 -1
- package/build/consumer/fields.js +1 -2
- package/build/consumer/fields.js.map +1 -1
- package/build/consumer/hooks.d.ts +3 -86
- package/build/consumer/hooks.d.ts.map +1 -1
- package/build/consumer/hooks.js +1 -1
- package/build/consumer/hooks.js.map +1 -1
- package/build/consumer/index.d.ts +1 -1
- package/build/consumer/legal.d.ts +2 -25
- package/build/consumer/legal.d.ts.map +1 -1
- package/build/consumer/legal.js.map +1 -1
- package/build/consumer/performance-consent-dialog.d.ts +4 -2
- package/build/consumer/performance-consent-dialog.d.ts.map +1 -1
- package/build/consumer/performance-consent-dialog.js +14 -10
- package/build/consumer/performance-consent-dialog.js.map +1 -1
- package/build/consumer/provider.d.ts +3 -17
- package/build/consumer/provider.d.ts.map +1 -1
- package/build/consumer/provider.js.map +1 -1
- package/build/consumer/refusal.d.ts.map +1 -1
- package/build/consumer/refusal.js +1 -6
- package/build/consumer/refusal.js.map +1 -1
- package/build/consumer/subscription-start-dialog.d.ts +7 -4
- package/build/consumer/subscription-start-dialog.d.ts.map +1 -1
- package/build/consumer/subscription-start-dialog.js +11 -8
- package/build/consumer/subscription-start-dialog.js.map +1 -1
- package/build/consumer/types.d.ts +191 -1
- package/build/consumer/types.d.ts.map +1 -1
- package/build/consumer/types.local.d.ts +21 -0
- package/build/consumer/types.local.d.ts.map +1 -0
- package/build/consumer/types.local.js +2 -0
- package/build/consumer/types.local.js.map +1 -0
- package/build/consumer/withdrawal.d.ts.map +1 -1
- package/build/consumer/withdrawal.js +5 -5
- package/build/consumer/withdrawal.js.map +1 -1
- package/build/copy.d.ts +1 -5
- package/build/copy.d.ts.map +1 -1
- package/build/copy.js.map +1 -1
- package/build/dialog.d.ts.map +1 -1
- package/build/dialog.js +17 -9
- package/build/dialog.js.map +1 -1
- package/build/entitlement.d.ts +2 -3
- package/build/entitlement.d.ts.map +1 -1
- package/build/entitlement.js.map +1 -1
- package/build/estimate-summary.d.ts +1 -33
- package/build/estimate-summary.d.ts.map +1 -1
- package/build/estimate-summary.js +3 -3
- package/build/estimate-summary.js.map +1 -1
- package/build/estimate.d.ts +1 -15
- package/build/estimate.d.ts.map +1 -1
- package/build/estimate.js +1 -1
- package/build/estimate.js.map +1 -1
- package/build/format.d.ts +20 -5
- package/build/format.d.ts.map +1 -1
- package/build/format.js +7 -5
- package/build/format.js.map +1 -1
- package/build/hooks.d.ts +1 -2
- package/build/hooks.d.ts.map +1 -1
- package/build/hooks.js.map +1 -1
- package/build/i18n/be.json +1 -1
- package/build/i18n/de.json +1 -1
- package/build/i18n/en.json +1 -1
- package/build/i18n/es.json +1 -1
- package/build/i18n/fr.json +1 -1
- package/build/i18n/pl.json +1 -1
- package/build/i18n/ru.json +1 -1
- package/build/i18n/uk.json +1 -1
- package/build/i18n.d.ts +1 -2
- package/build/i18n.d.ts.map +1 -1
- package/build/i18n.js +1 -2
- package/build/i18n.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/plan-card.d.ts.map +1 -1
- package/build/plan-card.js +1 -6
- package/build/plan-card.js.map +1 -1
- package/build/selectors.d.ts +1 -1
- package/build/selectors.d.ts.map +1 -1
- package/build/selectors.js +1 -6
- package/build/selectors.js.map +1 -1
- package/build/service.d.ts +1 -1
- package/build/service.d.ts.map +1 -1
- package/build/service.js +0 -1
- package/build/service.js.map +1 -1
- package/build/types.d.ts +53 -0
- package/build/types.d.ts.map +1 -1
- package/package.json +25 -25
- package/src/checkout-limit.tsx +4 -6
- package/src/consts.local.ts +21 -0
- package/src/consts.ts +2 -0
- package/src/consumer/cancellation.tsx +7 -8
- package/src/consumer/consts.local.ts +9 -0
- package/src/consumer/consts.ts +2 -0
- package/src/consumer/copy.ts +8 -14
- package/src/consumer/ensure.ts +1 -46
- package/src/consumer/fields.tsx +2 -36
- package/src/consumer/hooks.ts +5 -101
- package/src/consumer/index.ts +1 -1
- package/src/consumer/legal.tsx +3 -29
- package/src/consumer/performance-consent-dialog.tsx +16 -11
- package/src/consumer/provider.tsx +6 -17
- package/src/consumer/refusal.ts +1 -10
- package/src/consumer/subscription-start-dialog.tsx +13 -9
- package/src/consumer/types.local.ts +22 -0
- package/src/consumer/types.ts +215 -5
- package/src/consumer/withdrawal.tsx +9 -21
- package/src/copy.tsx +1 -6
- package/src/dialog.tsx +55 -37
- package/src/entitlement.ts +3 -4
- package/src/estimate-summary.tsx +5 -39
- package/src/estimate.ts +2 -18
- package/src/format.ts +9 -5
- package/src/hooks.ts +2 -2
- package/src/i18n/be.json +1 -1
- package/src/i18n/de.json +1 -1
- package/src/i18n/en.json +1 -1
- package/src/i18n/es.json +1 -1
- package/src/i18n/fr.json +1 -1
- package/src/i18n/pl.json +1 -1
- package/src/i18n/ru.json +1 -1
- package/src/i18n/uk.json +1 -1
- package/src/i18n.ts +1 -3
- package/src/index.ts +1 -1
- package/src/plan-card.tsx +2 -8
- package/src/selectors.ts +2 -9
- package/src/service.ts +2 -1
- package/src/types.ts +60 -0
- package/tests/consumer.spec.ts +81 -0
- package/tests/dialog.spec.ts +15 -1
- package/tests/harness/consumer-fixtures.ts +5 -4
- package/tests/harness/consumer.tsx +2 -2
- package/tests/harness/mount.tsx +4 -0
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
65
65
|
your project's skill store (`.agents/skills/`):
|
|
66
66
|
|
|
67
67
|
```sh
|
|
68
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
68
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.48
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/web-payment",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.31",
|
|
5
|
+
"generatedAt": "2026-10-05T08:32:19.126Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -7,7 +7,7 @@ user-invocable: false
|
|
|
7
7
|
|
|
8
8
|
# @owlmeans/web-payment
|
|
9
9
|
|
|
10
|
-
**Install:** `bun add @owlmeans/web-payment@^0.1.18-rc.
|
|
10
|
+
**Install:** `bun add @owlmeans/web-payment@^0.1.18-rc.31`
|
|
11
11
|
|
|
12
12
|
Public MIT web package paired with `@owlmeans/server-payment`. It incorporates checkout, balance,
|
|
13
13
|
entitlement and shallow-auth helpers over the underlying `@owlmeans/client-payment` service, plus
|
|
@@ -88,7 +88,9 @@ and action text come from the application). Every one accepts `className`.
|
|
|
88
88
|
The dialog takes `{ open, onOpenChange, policy, pending, disabled?, onConfirm, estimate?, limit?, legalNote?, details? }`.
|
|
89
89
|
It keeps integer minor units, accepts locale decimal separators and at most two decimals, shows
|
|
90
90
|
configured presets plus custom input, and reports below/above-bound errors without clamping.
|
|
91
|
-
Confirmation is disabled when invalid or pending.
|
|
91
|
+
Confirmation is disabled when invalid or pending. The dialog body scrolls (`max-h-[90vh]
|
|
92
|
+
overflow-y-auto`, like the consent dialogs): the tier `details`, the estimate and the legal note can
|
|
93
|
+
outgrow a short screen, and the confirm button must stay reachable — never render it outside.
|
|
92
94
|
|
|
93
95
|
It shows net credit value, processing adjustment and pre-tax subtotal from `chargeAmountMinor`.
|
|
94
96
|
With no `estimate`, the plain note that Stripe calculates applicable tax; with one, `PriceEstimateSummary`
|
|
@@ -104,7 +106,17 @@ tax-inclusive debit.
|
|
|
104
106
|
`policy` may be the plan's or one already narrowed (`AmountPolicyView.policy`) — narrowing is
|
|
105
107
|
idempotent. **`blocked`** disables the presets, the input and the confirm button; the pinned
|
|
106
108
|
policy `narrowAmountPolicy` returns for a block is never an offer of the minimum.
|
|
107
|
-
- **`details`** is a reusable application-owned React slot
|
|
109
|
+
- **`details`** is a reusable application-owned React slot (`[data-amount-details]`), the dialog's
|
|
110
|
+
SIDE column, holding the `CheckoutLimitNote` ("You can add up to …") above the details. With it the
|
|
111
|
+
dialog is sized by the window — `w-[90vw]`, `lg:w-[50vw]` from a landscape tablet up — and every
|
|
112
|
+
base cap is replaced by its twin (`max-w-none`, `sm:max-w-none`). The two blocks are a WRAPPING
|
|
113
|
+
flex row filling the content box: purchase `flex-3 min-w-60`, side `flex-2 min-w-44` (basis 0, so
|
|
114
|
+
side : purchase is exactly 2 : 3), `gap-x-6` (the dialog's padding) between them. The whole side
|
|
115
|
+
column drops under the purchase block, above the `legalNote` and the buttons, once the dialog
|
|
116
|
+
cannot hold both minimums — never a viewport breakpoint — so the confirm button's right edge is
|
|
117
|
+
the side column's, or the purchase block's when it is alone. The preset buttons answer to their
|
|
118
|
+
own container (`@container` + `@sm:grid-cols-4`). No `details` keeps the single narrow column with
|
|
119
|
+
the limit note above the presets.
|
|
108
120
|
`disabled` prevents amount selection and submission while application reads are unavailable;
|
|
109
121
|
cancel remains usable. Applications own loading, failed-read, retry and refreshed-limit details.
|
|
110
122
|
- **`legalNote`** is a slot right above the buttons for the application's legal line (the EU
|
|
@@ -177,7 +189,8 @@ plan title and the price line are the view's or the application's.
|
|
|
177
189
|
**The language rule.** A consent or statutory function is shown in the CONTRACT language — the
|
|
178
190
|
billing country's (`view.language`, `list.language`, the `language` prop) — with a toggle to the
|
|
179
191
|
interface language and back (`useShownLanguage`, `LanguageToggle`). The whole piece switches: the
|
|
180
|
-
legal copy through `legalTextOf(lng)
|
|
192
|
+
legal copy through `legalTextOf(lng)` (a `LegalText`: `(path, values?, context?)`, the context
|
|
193
|
+
reading the `<path>_<context>` variant first), the interface strings through `paymentTextOf(lng)` (both
|
|
181
194
|
read any language without i18next and without draining a bundle — `resolveI18nResource`), dates
|
|
182
195
|
and amounts through `Intl` in that language. The toggle alone is phrased in the INTERFACE language
|
|
183
196
|
("Show in German") — the reader who needs it reads that one. The links follow the shown language
|
|
@@ -187,8 +200,8 @@ the recorded body names the language shown.
|
|
|
187
200
|
|
|
188
201
|
| Piece | Props | Behaviour |
|
|
189
202
|
|---|---|---|
|
|
190
|
-
| `PerformanceConsentDialog` | `open, onOpenChange, view: PerformanceConsentView \| null, onConfirm(body: PerformanceConsentBody), onDecline?, uiLanguage?, pending?, error?, links?, onWithdraw?, formatAmount?` | Title and intro (count, last deadline), the purchases with date, amount and last withdrawal day (`performance-consent.purchase`), ONE checkbox carrying the whole statement (`performance-consent.checkbox` with `view.trader`), **unchecked by default**; confirm ("Start now" / "Jetzt beginnen" …) disabled until it is ticked; decline ("Not now"); links Billing Terms · Withdrawal information · the withdrawal function (a button when `onWithdraw`, else the links' `withdrawalFunction` page). `onConfirm` gets `{ purchaseIds, textVersion, language: <shown>, acknowledged: true, uiLanguage }`. |
|
|
191
|
-
| `SubscriptionStartDialog` | `open, onOpenChange, view: SubscriptionStartView \| null, planTitle, price?: ReactNode, onConfirm(body: SubscriptionStartBody), onDecline?, uiLanguage?, pending?, error?, links?, onWithdraw?` | The same shape before a subscription checkout; confirm is "Continue to payment" — the step before the paygate's own order button. |
|
|
203
|
+
| `PerformanceConsentDialog` | `open, onOpenChange, view: PerformanceConsentView \| null, onConfirm(body: PerformanceConsentBody), onDecline?, uiLanguage?, pending?, error?, links?, onWithdraw?, formatAmount?` | Title and intro (count, last deadline), the purchases with date, amount and last withdrawal day (`performance-consent.purchase`), ONE checkbox carrying the whole statement (`performance-consent.checkbox` with `view.trader`), **unchecked by default**; a `view.context` shows the `_<context>` variants of the title, the intro and the checkbox — exactly the statement `consentStatementOf(lng, Performance, { trader, context })` records — and marks the dialog `data-consent-context`; confirm ("Start now" / "Jetzt beginnen" …) disabled until it is ticked; decline ("Not now"); links Billing Terms · Withdrawal information · the withdrawal function (a button when `onWithdraw`, else the links' `withdrawalFunction` page). `onConfirm` gets `{ purchaseIds, textVersion, language: <shown>, acknowledged: true, uiLanguage }`. |
|
|
204
|
+
| `SubscriptionStartDialog` | `open, onOpenChange, view: SubscriptionStartView \| null, planTitle, price?: ReactNode, onConfirm(body: SubscriptionStartBody), onDecline?, uiLanguage?, pending?, error?, links?, onWithdraw?` | The same shape before a subscription checkout; confirm is "Continue to payment" — the step before the paygate's own order button. The statement follows the plan's withdrawal arithmetic: a `view.context` (`startContextOf(plan)` on the server, `'units'`) shows the `_<context>` texts — exactly the statement `consentStatementOf(lng, SubscriptionStart, { trader, plan, context })` records — and marks the dialog `data-start-context`; without one the base (time-only) statement. |
|
|
192
205
|
| `WithdrawalFunctionButton` | `language, onClick, uiLanguage?, disabled?, variant? = 'outline'` | The statutory entry ("Withdraw from contract here", "Vertrag widerrufen", "Renoncer au contrat ici", "Odstąp od umowy tutaj") in the contract language; the interface language's label as `title` when they differ. |
|
|
193
206
|
| `WithdrawalForm` / `WithdrawalDialog` | `mode: 'in-app' \| 'public', language, onSubmit(body: WithdrawalBody), list?, defaults?, uiLanguage?, pending?, error?, receipt?, formatAmount?` (+ `open, onOpenChange` for the dialog; `onClose` for the form) | Three steps. **Form**: in-app a contract picker over `list.candidates` (bought, paid, last day, estimated refund), publicly a contract-reference field — plus name and e-mail, NOTHING else is asked (a public form also carries the honeypot). **Review**: the summary and the statutory confirm ("Confirm withdrawal", "Widerruf bestätigen", "Confirmer la rétractation", "Potwierdź odstąpienie od umowy"). **Receipt** (whenever `receipt` is set): the received sentence with date AND time in UTC, reference, status, refund. The dialog does not clear the receipt the application holds — reset it on close. |
|
|
194
207
|
| `CancellationForm` | `mode, language, onSubmit(body: CancellationBody), defaults?, uiLanguage?, pending?, error?, receipt?, onPrint?, onClose?` | **Form**: kind (ordinary / extraordinary — the reason becomes required), name, contract or customer reference, effective (earliest / a date from today), e-mail, and a honeypot. **Summary** with the statutory confirm ("Cancel now", "Jetzt kündigen", "Notification de la résiliation", "Wypowiedz teraz"). **Receipt**: received date and time in UTC, the effective date when known, status, a print button (`onPrint`, default `window.print()`). |
|
|
@@ -249,9 +262,9 @@ unknown — never a subscription start).
|
|
|
249
262
|
|
|
250
263
|
| Piece | Selectors |
|
|
251
264
|
|---|---|
|
|
252
|
-
| Spend consent | `[data-consent-dialog]` (also `[data-performance-consent]`) with `data-language` (shown), `data-contract-language`, `data-text-version
|
|
265
|
+
| Spend consent | `[data-consent-dialog]` (also `[data-performance-consent]`) with `data-language` (shown), `data-contract-language`, `data-text-version`, `data-consent-context` (only when the view has a context); `[data-consent-purchase]` with `data-purchase-id`, `data-deadline` (ISO); `[data-consent-statement]`; `[data-consent-checkbox]` (Radix `data-state`); `[data-consent-confirm]`; `[data-consent-decline]`; `[data-consent-language-toggle]` (also `[data-language-toggle]` with `data-target-language`) |
|
|
253
266
|
| Legal links (both dialogs) | `[data-legal-links]`, `[data-legal-link="billing-terms" \| "withdrawal-information" \| "withdrawal-function"]` |
|
|
254
|
-
| Subscription start | `[data-start-dialog]` (also `[data-subscription-start]`) with `data-language`, `data-contract-language`, `data-plan-sku
|
|
267
|
+
| Subscription start | `[data-start-dialog]` (also `[data-subscription-start]`) with `data-language`, `data-contract-language`, `data-plan-sku`, `data-start-context` (only when the view has a context); `[data-start-statement]`, `[data-start-price]`, `[data-start-checkbox]`, `[data-start-confirm]`, `[data-start-decline]`, `[data-start-language-toggle]` |
|
|
255
268
|
| Withdrawal | `[data-withdrawal-function]` (`data-language`); `[data-withdrawal-dialog]` (`data-language`, `data-step`); `[data-withdrawal-form]` with `data-withdrawal-step="form\|review\|receipt"` (also `data-step`, `data-mode`, `data-language`); `[data-withdrawal-candidate]` (`data-purchase-id`, `data-contract-ref`) and its radio `[data-withdrawal-candidate-input="<purchaseId>"]`; `[data-withdrawal-estimate]` (`data-refund-minor`); `[data-withdrawal-field="contract\|name\|email"]`; `[data-withdrawal-continue]`, `[data-withdrawal-back]`, `[data-withdrawal-confirm]`; `[data-withdrawal-receipt]` (`data-status`, `data-declaration-id`, `data-received-at`), `[data-withdrawal-reference]`, `[data-withdrawal-received-at]`, `[data-withdrawal-refund]`; `[data-withdrawal-language-toggle]` |
|
|
256
269
|
| Cancellation | `[data-cancellation-form]` with `data-cancellation-step="form\|review\|receipt"` (also `data-step`, `data-mode`, `data-language`); `[data-cancellation-field="kind\|reason\|name\|contract\|effective\|date\|email"]` (kind radios carry `data-kind`, effective radios `data-effective`); `[data-cancellation-continue]`, `[data-cancellation-back]`, `[data-cancellation-confirm]`, `[data-cancellation-summary]`; `[data-cancellation-receipt]` (`data-status`, `data-declaration-id`, `data-received-at`, `data-effective-at`), `[data-cancellation-effective]`, `[data-cancellation-print]`; `[data-cancellation-language-toggle]` |
|
|
257
270
|
| Honeypot | `[data-honeypot]` |
|
|
@@ -309,7 +322,7 @@ stamped status, `cause`/`error`/aggregate nesting, a `CommitFailed`-shaped messa
|
|
|
309
322
|
asker/gate (`consumer-hooks.spec.ts`: `makeAsker` sharing and failing open, `withConsent` retrying
|
|
310
323
|
exactly once, first-render hook shapes with `react-dom/server`) specs, the 8-language parity spec,
|
|
311
324
|
and drives chromium through the Vite harness, which picks a surface by `?case=` (none = the dialog,
|
|
312
|
-
`pieces`, `hook`, `shared-estimate`; `consent
|
|
325
|
+
`pieces`, `hook`, `shared-estimate`; `consent` (`&context=` a consent copy variant), `start` (`&context=units`), `withdrawal`, `withdrawal-public`,
|
|
313
326
|
`cancellation`, `limit` (`&blocked=true`), `country-locked`, `consent-gate`), with `?lng=` the
|
|
314
327
|
contract language and `?ui=` the interface language, and for the dialog an `?estimate=<name>`
|
|
315
328
|
canned `PriceEstimateControl` fixture (`tests/harness/estimate-fixtures.ts`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-limit.d.ts","sourceRoot":"","sources":["../src/checkout-limit.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkout-limit.d.ts","sourceRoot":"","sources":["../src/checkout-limit.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAIxD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,sCAAuC,sBAAsB,uCA+B1F,CAAA"}
|
package/build/checkout-limit.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18nLib, useLanguage } from '@owlmeans/client-i18n';
|
|
3
3
|
import { cn } from '@/lib/utils';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const KNOWN_REASONS = ['per-purchase', 'window', 'total', 'hold'];
|
|
4
|
+
import { KNOWN_REASONS } from './consts.local.js';
|
|
5
|
+
import { formatHelper } from './format.js';
|
|
7
6
|
/**
|
|
8
7
|
* What an amount checkout is narrowed to for this entity now: the largest amount (or that nothing
|
|
9
8
|
* may be bought), why, and when it rises again — the same `CheckoutLimitView` the server refuses
|
|
@@ -25,10 +24,10 @@ export const CheckoutLimitNote = ({ limit, reasonLabel, className }) => {
|
|
|
25
24
|
: t(`reason.${KNOWN_REASONS.includes(reason) ? reason : 'other'}`);
|
|
26
25
|
const resetsAt = limit.resetsAt != null ? new Date(limit.resetsAt) : null;
|
|
27
26
|
const resets = resetsAt != null && !Number.isNaN(resetsAt.getTime())
|
|
28
|
-
? t('resets', { date: shortMomentUtc(resetsAt, locale), interpolation: { escapeValue: false } })
|
|
27
|
+
? t('resets', { date: formatHelper.shortMomentUtc(resetsAt, locale), interpolation: { escapeValue: false } })
|
|
29
28
|
: null;
|
|
30
29
|
return _jsxs("div", { "data-checkout-limit": "", "data-max-minor": limit.maximumMinor, "data-blocked": limit.blocked ? 'true' : 'false', "data-reason": reason, "data-resets-at": resetsAt?.toISOString(), role: limit.blocked ? 'alert' : 'note', className: cn('grid gap-1 rounded-lg border p-3 text-sm', limit.blocked ? 'border-destructive/50' : 'bg-muted/30', className), children: [_jsx("p", { className: limit.blocked ? 'text-destructive font-medium' : 'font-medium', "data-checkout-limit-headline": "", children: limit.blocked
|
|
31
30
|
? t('blocked')
|
|
32
|
-
: t('note', { amount: money(limit.maximumMinor, limit.currency, locale), interpolation: { escapeValue: false } }) }), _jsx("p", { className: "text-muted-foreground text-xs", "data-checkout-limit-reason": "", children: explained }), resets != null && _jsx("p", { className: "text-muted-foreground text-xs", "data-checkout-limit-resets": "", children: resets })] });
|
|
31
|
+
: t('note', { amount: formatHelper.money(limit.maximumMinor, limit.currency, locale), interpolation: { escapeValue: false } }) }), _jsx("p", { className: "text-muted-foreground text-xs", "data-checkout-limit-reason": "", children: explained }), resets != null && _jsx("p", { className: "text-muted-foreground text-xs", "data-checkout-limit-resets": "", children: resets })] });
|
|
33
32
|
};
|
|
34
33
|
//# sourceMappingURL=checkout-limit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-limit.js","sourceRoot":"","sources":["../src/checkout-limit.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"checkout-limit.js","sourceRoot":"","sources":["../src/checkout-limit.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAA0B,EAAE,EAAE;IAC7F,MAAM,CAAC,GAAG,UAAU,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAA;IACrD,MAAM,CAAC,MAAM,CAAC,GAAG,WAAW,EAAE,CAAA;IAC9B,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAA;IACjC,MAAM,MAAM,GAAG,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAA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;oBACZ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;oBACd,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,aAAa,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,GAC9H,EACJ,YAAG,SAAS,EAAC,+BAA+B,gCAA4B,EAAE,YAAE,SAAS,GAAK,EACzF,MAAM,IAAI,IAAI,IAAI,YAAG,SAAS,EAAC,+BAA+B,gCAA4B,EAAE,YAAE,MAAM,GAAK,IACtG,CAAA;AACR,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,eAAO,MAAM,oBAAoB,gBAAgB,CAAA"}
|
package/build/consts.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PlanStatusTone, PlanStatusLineKind } from './types.js';
|
|
2
|
+
import { SubscriptionStatus } from '@owlmeans/payment';
|
|
3
|
+
/** The reasons the package phrases itself; any other reads the generic sentence. */
|
|
4
|
+
export declare const KNOWN_REASONS: string[];
|
|
5
|
+
export declare const DEFAULT_TTL_MS: number;
|
|
6
|
+
export declare const TONE_DOT: Record<PlanStatusTone, string>;
|
|
7
|
+
export declare const INACTIVE: Partial<Record<SubscriptionStatus, PlanStatusLineKind>>;
|
|
8
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEtD,oFAAoF;AACpF,eAAO,MAAM,aAAa,UAA8C,CAAA;AAExE,eAAO,MAAM,cAAc,QAAa,CAAA;AAExC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAKnD,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAK5E,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SubscriptionStatus } from '@owlmeans/payment';
|
|
2
|
+
/** The reasons the package phrases itself; any other reads the generic sentence. */
|
|
3
|
+
export const KNOWN_REASONS = ['per-purchase', 'window', 'total', 'hold'];
|
|
4
|
+
export const DEFAULT_TTL_MS = 5 * 60_000;
|
|
5
|
+
export const TONE_DOT = {
|
|
6
|
+
ok: 'bg-primary',
|
|
7
|
+
warning: 'bg-destructive/60',
|
|
8
|
+
critical: 'bg-destructive',
|
|
9
|
+
inactive: 'bg-muted-foreground',
|
|
10
|
+
};
|
|
11
|
+
export const INACTIVE = {
|
|
12
|
+
[SubscriptionStatus.Created]: 'created',
|
|
13
|
+
[SubscriptionStatus.Canceled]: 'canceled',
|
|
14
|
+
[SubscriptionStatus.Expired]: 'expired',
|
|
15
|
+
[SubscriptionStatus.Ended]: 'ended',
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEtD,oFAAoF;AACpF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAExE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,MAAM,CAAA;AAExC,MAAM,CAAC,MAAM,QAAQ,GAAmC;IACtD,EAAE,EAAE,YAAY;IAChB,OAAO,EAAE,mBAAmB;IAC5B,QAAQ,EAAE,gBAAgB;IAC1B,QAAQ,EAAE,qBAAqB;CAChC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAA4D;IAC/E,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS;IACvC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,UAAU;IACzC,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS;IACvC,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,OAAO;CACpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancellation.d.ts","sourceRoot":"","sources":["../../src/consumer/cancellation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cancellation.d.ts","sourceRoot":"","sources":["../../src/consumer/cancellation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAmB,MAAM,YAAY,CAAA;AAQxE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,gIAG1B,qBAAqB,gCAiLvB,CAAA"}
|
|
@@ -3,10 +3,10 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { CancellationKind } from '@owlmeans/payment';
|
|
4
4
|
import { cn } from '@/lib/utils';
|
|
5
5
|
import { Button } from '@/components/ui/button';
|
|
6
|
-
import { dayUtc, momentUtc } from '../format.js';
|
|
7
6
|
import { useLegalText, usePaymentText } from './copy.js';
|
|
8
7
|
import { Choice, Field, Honeypot, isEmail } from './fields.js';
|
|
9
8
|
import { ErrorLine, LanguageToggle, useShownLanguage } from './legal.js';
|
|
9
|
+
import { formatHelper } from '../format.js';
|
|
10
10
|
const isCancellationReceipt = (receipt) => 'status' in receipt;
|
|
11
11
|
/** Today as a UTC calendar day, `YYYY-MM-DD` — the earliest date a termination may name. */
|
|
12
12
|
const todayUtc = () => new Date().toISOString().slice(0, 10);
|
|
@@ -91,7 +91,7 @@ export const CancellationForm = ({ mode, language: contractLanguage, uiLanguage,
|
|
|
91
91
|
const kindLabel = (value) => legal(value === CancellationKind.Extraordinary
|
|
92
92
|
? 'cancellation.kind-extraordinary' : 'cancellation.kind-ordinary');
|
|
93
93
|
const effectiveLabel = (declared) => declared.effective === 'date' && declared.date != null
|
|
94
|
-
? dayUtc(`${declared.date}T00:00:00Z`, language.shown) : legal('cancellation.effective-earliest');
|
|
94
|
+
? formatHelper.dayUtc(`${declared.date}T00:00:00Z`, language.shown) : legal('cancellation.effective-earliest');
|
|
95
95
|
const summary = (declared, hook) => _jsxs("dl", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 rounded-lg border bg-muted/30 p-4 text-sm", ...(hook != null ? { [hook]: '' } : {}), children: [_jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.kind') }), _jsx("dd", { "data-summary": "kind", children: kindLabel(declared.kind) }), declared.reason != null && _jsxs(_Fragment, { children: [_jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.reason') }), _jsx("dd", { "data-summary": "reason", className: "whitespace-pre-wrap", children: declared.reason })] }), _jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.name') }), _jsx("dd", { "data-summary": "name", children: declared.name }), _jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.contract') }), _jsx("dd", { "data-summary": "contract", children: declared.contractRef ?? '—' }), _jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.effective') }), _jsx("dd", { "data-summary": "effective", children: effectiveLabel(declared) }), _jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.email') }), _jsx("dd", { "data-summary": "email", children: declared.email })] });
|
|
96
96
|
let content;
|
|
97
97
|
if (current === 'receipt' && receipt != null) {
|
|
@@ -101,8 +101,8 @@ export const CancellationForm = ({ mode, language: contractLanguage, uiLanguage,
|
|
|
101
101
|
const effectiveAt = isCancellationReceipt(receipt) && receipt.effectiveAt != null ? new Date(receipt.effectiveAt) : null;
|
|
102
102
|
const effectiveKnown = effectiveAt != null && !Number.isNaN(effectiveAt.getTime());
|
|
103
103
|
content = _jsxs("div", { className: "grid gap-4", "data-cancellation-receipt": "", "data-status": status ?? 'received', "data-declaration-id": receipt.declarationId, "data-received-at": Number.isNaN(receivedAt.getTime()) ? undefined : receivedAt.toISOString(), "data-effective-at": effectiveKnown ? effectiveAt.toISOString() : undefined, children: [_jsx("h3", { className: "text-sm font-medium", children: text('consumer.receipt') }), _jsx("p", { className: "text-sm", children: receipt.mailed
|
|
104
|
-
? legal('cancellation.received', { date: momentUtc(receivedAt, language.shown), email: declared.email })
|
|
105
|
-
: `${text('consumer.received-at')}: ${momentUtc(receivedAt, language.shown)} (UTC). ${text('consumer.not-mailed')}` }), effectiveKnown && _jsx("p", { className: "text-sm font-medium", "data-cancellation-effective": "", children: text('cancellation.effective-at', { date: dayUtc(effectiveAt, language.shown) }) }), _jsxs("dl", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 rounded-lg border p-4 text-sm", children: [_jsx("dt", { className: "text-muted-foreground", children: text('consumer.reference') }), _jsx("dd", { "data-cancellation-reference": "", children: receipt.declarationId }), _jsx("dt", { className: "text-muted-foreground", children: text('consumer.received-at') }), _jsxs("dd", { "data-cancellation-received-at": "", children: [momentUtc(receivedAt, language.shown), " (UTC)"] }), status != null && _jsxs(_Fragment, { children: [_jsx("dt", { className: "text-muted-foreground", children: text('consumer.status') }), _jsx("dd", { "data-cancellation-status": "", children: text(`cancellation.status.${status}`) })] })] }), summary(declared), _jsxs("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end print:hidden", children: [onClose != null && _jsx(Button, { type: "button", variant: "outline", onClick: onClose, children: text('consumer.close') }), _jsx(Button, { type: "button", variant: "outline", onClick: print, "data-cancellation-print": "", children: text('consumer.print') })] })] });
|
|
104
|
+
? legal('cancellation.received', { date: formatHelper.momentUtc(receivedAt, language.shown), email: declared.email })
|
|
105
|
+
: `${text('consumer.received-at')}: ${formatHelper.momentUtc(receivedAt, language.shown)} (UTC). ${text('consumer.not-mailed')}` }), effectiveKnown && _jsx("p", { className: "text-sm font-medium", "data-cancellation-effective": "", children: text('cancellation.effective-at', { date: formatHelper.dayUtc(effectiveAt, language.shown) }) }), _jsxs("dl", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 rounded-lg border p-4 text-sm", children: [_jsx("dt", { className: "text-muted-foreground", children: text('consumer.reference') }), _jsx("dd", { "data-cancellation-reference": "", children: receipt.declarationId }), _jsx("dt", { className: "text-muted-foreground", children: text('consumer.received-at') }), _jsxs("dd", { "data-cancellation-received-at": "", children: [formatHelper.momentUtc(receivedAt, language.shown), " (UTC)"] }), status != null && _jsxs(_Fragment, { children: [_jsx("dt", { className: "text-muted-foreground", children: text('consumer.status') }), _jsx("dd", { "data-cancellation-status": "", children: text(`cancellation.status.${status}`) })] })] }), summary(declared), _jsxs("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end print:hidden", children: [onClose != null && _jsx(Button, { type: "button", variant: "outline", onClick: onClose, children: text('consumer.close') }), _jsx(Button, { type: "button", variant: "outline", onClick: print, "data-cancellation-print": "", children: text('consumer.print') })] })] });
|
|
106
106
|
}
|
|
107
107
|
else if (current === 'review') {
|
|
108
108
|
content = _jsxs("div", { className: "grid gap-4", children: [_jsx("h3", { className: "text-sm font-medium", children: text('consumer.review') }), _jsx("p", { className: "text-sm", children: legal('cancellation.summary') }), summary(body(), 'data-cancellation-summary'), _jsx(ErrorLine, { error: error, text: text }), _jsxs("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [_jsx(Button, { type: "button", variant: "outline", disabled: pending, onClick: () => setStep('form'), "data-cancellation-back": "", children: text('consumer.back') }), _jsx(Button, { type: "button", disabled: pending || !valid, onClick: () => void confirm(), "data-cancellation-confirm": "", children: pending ? text('consumer.pending') : legal('cancellation.confirm') })] })] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancellation.js","sourceRoot":"","sources":["../../src/consumer/cancellation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAGxE,MAAM,qBAAqB,GAAG,CAAC,OAAe,EAAkC,EAAE,CAAC,QAAQ,IAAI,OAAO,CAAA;AAEtG,4FAA4F;AAC5F,MAAM,QAAQ,GAAG,GAAW,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAEpE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,GAAG,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EACnH,SAAS,GACa,EAAE,EAAE;IAC1B,MAAM,QAAQ,GAAG,gBAAgB,CAAC,gBAAgB,EAAE,UAA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;IACT,CAAC;IAED,OAAO,mBAAS,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,+BAA4B,EAAE,mBAAgB,QAAQ,CAAC,KAAK,aAChH,kBAAQ,SAAS,EAAC,cAAc,EAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,aACnD,aAAI,SAAS,EAAC,oCAAoC,YAAE,KAAK,CAAC,oBAAoB,CAAC,GAAM,EACpF,OAAO,KAAK,MAAM,IAAI,YAAG,SAAS,EAAC,+BAA+B,YAAE,KAAK,CAAC,oBAAoB,CAAC,GAAK,IAC9F,EACT,KAAC,cAAc,IAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAC,mCAAmC,GAAG,EAC/E,wCAA4B,EAAE,4BAAyB,OAAO,eAAa,OAAO,eAAa,IAAI,mBAClF,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAC,YAAY,YAC1E,OAAO,GACJ,IACE,CAAA;AACZ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/consumer/consts.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,eAAO,MAAM,aAAa,QAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/consumer/consts.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Where a wrapping error keeps the one it wraps — `cause`, and the fields frameworks use for it. */
|
|
2
|
+
export declare const NESTED_FIELDS: readonly ['cause', 'error', 'original', 'originalError', 'inner', 'reason'];
|
|
3
|
+
/** How deep a wrapped chain is followed — a planning `CommitFailed` inside a transport error is two. */
|
|
4
|
+
export declare const MAX_DEPTH = 5;
|
|
5
|
+
export declare const PRECONDITION_REQUIRED = 428;
|
|
6
|
+
export declare const DECLINED_MARKER = "consent-declined:";
|
|
7
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/consumer/consts.local.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,eAAO,MAAM,aAAa,YAAI,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAA;AAExG,wGAAwG;AACxG,eAAO,MAAM,SAAS,IAAI,CAAA;AAE1B,eAAO,MAAM,qBAAqB,MAAM,CAAA;AAExC,eAAO,MAAM,eAAe,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Where a wrapping error keeps the one it wraps — `cause`, and the fields frameworks use for it. */
|
|
2
|
+
export const NESTED_FIELDS = ['cause', 'error', 'original', 'originalError', 'inner', 'reason'];
|
|
3
|
+
/** How deep a wrapped chain is followed — a planning `CommitFailed` inside a transport error is two. */
|
|
4
|
+
export const MAX_DEPTH = 5;
|
|
5
|
+
export const PRECONDITION_REQUIRED = 428;
|
|
6
|
+
export const DECLINED_MARKER = 'consent-declined:';
|
|
7
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/consumer/consts.local.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAA;AAExG,wGAAwG;AACxG,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAA;AAE1B,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAA;AAExC,MAAM,CAAC,MAAM,eAAe,GAAG,mBAAmB,CAAA"}
|
package/build/consumer/copy.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/** A translator bound to ONE language, whatever the active i18n language is. */
|
|
3
|
-
export type FixedText = (key: string, values?: CopyValues) => string;
|
|
1
|
+
import type { FixedText, LegalText } from './types.js';
|
|
4
2
|
/**
|
|
5
3
|
* The package's own interface strings (`web-payment`, library tier, any application override
|
|
6
4
|
* included) in a FIXED language, merged key by key over English — no i18next instance and no
|
|
@@ -13,11 +11,11 @@ export declare const paymentTextOf: (lng: string) => FixedText;
|
|
|
13
11
|
* that cannot be rendered in the language (a broken application override) falls back to English
|
|
14
12
|
* rather than blanking the page; one that cannot be rendered at all is `''`.
|
|
15
13
|
*/
|
|
16
|
-
export declare const legalTextOf: (lng: string) =>
|
|
14
|
+
export declare const legalTextOf: (lng: string) => LegalText;
|
|
17
15
|
/** `paymentTextOf(lng)`, memoised for the language. */
|
|
18
16
|
export declare const usePaymentText: (lng: string) => FixedText;
|
|
19
17
|
/** `legalTextOf(lng)`, memoised for the language. */
|
|
20
|
-
export declare const useLegalText: (lng: string) =>
|
|
18
|
+
export declare const useLegalText: (lng: string) => LegalText;
|
|
21
19
|
/** A language's own name in another language (`de` in `en` → "German"); the code when unknown. */
|
|
22
20
|
export declare const languageNameOf: (lng: string, inLanguage: string) => string;
|
|
23
21
|
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../src/consumer/copy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../src/consumer/copy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAmCtD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,QAAS,MAAM,KAAG,SAQ3C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAS,MAAM,KAAG,SAUzC,CAAA;AAED,uDAAuD;AACvD,eAAO,MAAM,cAAc,QAAS,MAAM,KAAG,SAAqD,CAAA;AAElG,qDAAqD;AACrD,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,SAAmD,CAAA;AAE9F,kGAAkG;AAClG,eAAO,MAAM,cAAc,QAAS,MAAM,cAAc,MAAM,KAAG,MAMhE,CAAA"}
|
package/build/consumer/copy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { LIB_NAMESPACE, resolveI18nResource } from '@owlmeans/i18n';
|
|
3
3
|
import { baseLanguageOf, consumerText } from '@owlmeans/payment';
|
|
4
|
-
import { WEB_PAYMENT_RESOURCE } from '../
|
|
4
|
+
import { WEB_PAYMENT_RESOURCE } from '../consts.js';
|
|
5
5
|
const isTree = (value) => value != null && typeof value === 'object' && !Array.isArray(value);
|
|
6
6
|
const merge = (base, over) => {
|
|
7
7
|
const result = { ...base };
|
|
@@ -46,13 +46,13 @@ export const paymentTextOf = (lng) => {
|
|
|
46
46
|
* that cannot be rendered in the language (a broken application override) falls back to English
|
|
47
47
|
* rather than blanking the page; one that cannot be rendered at all is `''`.
|
|
48
48
|
*/
|
|
49
|
-
export const legalTextOf = (lng) => (path, values) => {
|
|
49
|
+
export const legalTextOf = (lng) => (path, values, context) => {
|
|
50
50
|
try {
|
|
51
|
-
return consumerText(lng, path, values);
|
|
51
|
+
return consumerText(lng, path, values, context);
|
|
52
52
|
}
|
|
53
53
|
catch {
|
|
54
54
|
try {
|
|
55
|
-
return consumerText('en', path, values);
|
|
55
|
+
return consumerText('en', path, values, context);
|
|
56
56
|
}
|
|
57
57
|
catch {
|
|
58
58
|
return '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../src/consumer/copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,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AE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,CAAA;IACjF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAA;IACZ,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -1,51 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
/** Read the current view. */
|
|
3
|
-
load: (...args: Args) => Promise<View>;
|
|
4
|
-
/** Whether the view asks the person anything. */
|
|
5
|
-
required: (view: View) => boolean;
|
|
6
|
-
/** Show the view to the person (open the dialog). */
|
|
7
|
-
show: (view: View) => void;
|
|
8
|
-
/**
|
|
9
|
-
* The answer when nothing needs asking — and when the read FAILS: the server's refusal stays
|
|
10
|
-
* the authority, and a flaky read must never block work that needs no consent.
|
|
11
|
-
*/
|
|
12
|
-
skip: Answer;
|
|
13
|
-
}
|
|
14
|
-
export interface Asker<Args extends unknown[], Answer> {
|
|
15
|
-
/** Read, and ask only when the view requires it. Concurrent calls share ONE pending answer. */
|
|
16
|
-
ask: (...args: Args) => Promise<Answer>;
|
|
17
|
-
/** Answer the pending `ask` (the dialog confirmed or was declined); nothing when none waits. */
|
|
18
|
-
settle: (answer: Answer) => void;
|
|
19
|
-
/** Whether an `ask` is waiting for the person. */
|
|
20
|
-
waiting: () => boolean;
|
|
21
|
-
}
|
|
1
|
+
import type { Asker, AskerOptions, ConsentGate } from './types.js';
|
|
22
2
|
/**
|
|
23
3
|
* Read a view, show it when it asks for something, and answer once the person has — the state
|
|
24
4
|
* machine behind `usePerformanceConsent().ensure` and `useSubscriptionStart().ensure`, free of
|
|
25
5
|
* React so it is testable on its own. A burst of calls opens one dialog: they all get its answer.
|
|
26
6
|
*/
|
|
27
7
|
export declare const makeAsker: <Args extends unknown[], View, Answer>(opts: AskerOptions<Args, View, Answer>) => Asker<Args, Answer>;
|
|
28
|
-
export interface EnsureOptions {
|
|
29
|
-
/**
|
|
30
|
-
* Asked after the server refused with a 428 although the last answer said nothing was needed.
|
|
31
|
-
* The view is always read fresh; `force` records why the caller asks.
|
|
32
|
-
*/
|
|
33
|
-
force?: boolean;
|
|
34
|
-
}
|
|
35
|
-
export interface ConsentGate {
|
|
36
|
-
/**
|
|
37
|
-
* `true` when nothing needs consent or the person confirmed and it was recorded; `false` when
|
|
38
|
-
* they declined or closed the dialog. A failed read answers `true`. One pending answer is shared.
|
|
39
|
-
*/
|
|
40
|
-
ensure: (opts?: EnsureOptions) => Promise<boolean>;
|
|
41
|
-
/**
|
|
42
|
-
* Run `action`; when it is refused for the spend consent (`isPerformanceConsentRefusal` — the
|
|
43
|
-
* class, its marker, or a bare 428, also wrapped inside another error), ask with
|
|
44
|
-
* `ensure({ force: true })` and run it again exactly ONCE. A decline throws `ConsentDeclined`;
|
|
45
|
-
* a second refusal, or any other failure, propagates as it is.
|
|
46
|
-
*/
|
|
47
|
-
withConsent: <T>(action: () => Promise<T>) => Promise<T>;
|
|
48
|
-
}
|
|
49
8
|
/** A gate over an `ensure` — what `useConsentGate` answers inside a `PerformanceConsentProvider`. */
|
|
50
9
|
export declare const makeConsentGate: (ensure: ConsentGate['ensure']) => ConsentGate;
|
|
51
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure.d.ts","sourceRoot":"","sources":["../../src/consumer/ensure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ensure.d.ts","sourceRoot":"","sources":["../../src/consumer/ensure.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAElE;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,IAAI,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,QACtD,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,KACrC,KAAK,CAAC,IAAI,EAAE,MAAM,CAuCpB,CAAA;AAED,qGAAqG;AACrG,eAAO,MAAM,eAAe,WAAY,WAAW,CAAC,QAAQ,CAAC,KAAG,WAgB9D,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,WAG7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure.js","sourceRoot":"","sources":["../../src/consumer/ensure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"ensure.js","sourceRoot":"","sources":["../../src/consumer/ensure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAA;AAG3E;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,IAAsC,EACjB,EAAE;IACvB,IAAI,QAAQ,GAA2B,IAAI,CAAA;IAC3C,IAAI,QAAQ,GAAsC,IAAI,CAAA;IAEtD,MAAM,GAAG,GAAG,KAAK,EAAE,IAAU,EAAmB,EAAE;QAChD,IAAI,IAAU,CAAA;QACd,IAAI,CAAC;YACH,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;QACjC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC,IAAI,CAAA;QAClB,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,IAAI,CAAA;QAClB,CAAC;QAED,OAAO,MAAM,IAAI,OAAO,CAAS,OAAO,CAAC,EAAE;YACzC,QAAQ,GAAG,OAAO,CAAA;YAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO;QACL,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,EA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AM,MAAM,EAAE;CAC5C,CAAA"}
|
|
@@ -1,39 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/** The shape the platform validates an e-mail address with (`@owlmeans/payment` `EmailSchema`). */
|
|
3
|
-
export declare const EMAIL_PATTERN: RegExp;
|
|
1
|
+
import type { ChoiceProps, FieldProps, HoneypotProps } from './types.js';
|
|
4
2
|
export declare const isEmail: (value: string) => boolean;
|
|
5
|
-
export interface FieldProps {
|
|
6
|
-
id: string;
|
|
7
|
-
label: string;
|
|
8
|
-
value: string;
|
|
9
|
-
onChange: (value: string) => void;
|
|
10
|
-
error?: string | null;
|
|
11
|
-
type?: 'text' | 'email' | 'date';
|
|
12
|
-
autoComplete?: string;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
min?: string;
|
|
15
|
-
/** A `data-*` hook for tests (`data-withdrawal-field="name"`). */
|
|
16
|
-
hook?: Record<string, string>;
|
|
17
|
-
multiline?: boolean;
|
|
18
|
-
}
|
|
19
3
|
export declare const Field: ({ id, label, value, onChange, error, type, autoComplete, disabled, min, hook, multiline, }: FieldProps) => import("react").JSX.Element;
|
|
20
|
-
export interface ChoiceProps {
|
|
21
|
-
id: string;
|
|
22
|
-
name: string;
|
|
23
|
-
checked: boolean;
|
|
24
|
-
onSelect: () => void;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
hook?: Record<string, string>;
|
|
27
|
-
children: ReactNode;
|
|
28
|
-
}
|
|
29
4
|
/** One option of a radio group — a native radio, so the group needs no extra primitive. */
|
|
30
5
|
export declare const Choice: ({ id, name, checked, onSelect, disabled, hook, children }: ChoiceProps) => import("react").JSX.Element;
|
|
31
|
-
export interface HoneypotProps {
|
|
32
|
-
id: string;
|
|
33
|
-
label: string;
|
|
34
|
-
value: string;
|
|
35
|
-
onChange: (value: string) => void;
|
|
36
|
-
}
|
|
37
6
|
/**
|
|
38
7
|
* A field a person never sees or reaches: off screen, out of the tab order and hidden from
|
|
39
8
|
* assistive technology, with a plausible name a form-filling bot completes. A filled one marks the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/consumer/fields.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/consumer/fields.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAExE,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,OAAgF,CAAA;AAExH,eAAO,MAAM,KAAK,+FAEf,UAAU,gCAkBP,CAAA;AAEN,2FAA2F;AAC3F,eAAO,MAAM,MAAM,8DAA+D,WAAW,gCASrF,CAAA;AAER;;;;GAIG;AACH,eAAO,MAAM,QAAQ,mCAAoC,aAAa,gCAOhE,CAAA"}
|
package/build/consumer/fields.js
CHANGED
|
@@ -2,8 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from '@/lib/utils';
|
|
3
3
|
import { Input } from '@/components/ui/input';
|
|
4
4
|
import { Label } from '@/components/ui/label';
|
|
5
|
-
|
|
6
|
-
export const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+$/;
|
|
5
|
+
import { EMAIL_PATTERN } from './consts.js';
|
|
7
6
|
export const isEmail = (value) => value.length >= 3 && value.length <= 254 && EMAIL_PATTERN.test(value);
|
|
8
7
|
export const Field = ({ id, label, value, onChange, error, type = 'text', autoComplete, disabled, min, hook, multiline = false, }) => _jsxs("div", { className: "grid gap-1.5", children: [_jsx(Label, { htmlFor: id, children: label }), multiline
|
|
9
8
|
? _jsx("textarea", { id: id, value: value, disabled: disabled, rows: 3, maxLength: 2000, "aria-invalid": error != null, "aria-describedby": error != null ? `${id}-error` : undefined, onChange: event => onChange(event.target.value), className: cn('border-input bg-background placeholder:text-muted-foreground w-full min-w-0 rounded-md border px-3 py-2 text-sm shadow-xs outline-none', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] disabled:opacity-50 aria-invalid:border-destructive'), ...hook })
|