@pybara/pybara-js 0.1.0 → 0.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/README.md +23 -11
- package/checkout.schema.json +143 -0
- package/dist/admin/core/PybaraAdminClient.d.ts +5 -0
- package/dist/admin/core/PybaraAdminClient.d.ts.map +1 -1
- package/dist/admin/index.d.ts +7 -2
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/{admin-D2vUTEg1.js → admin-B1pVP25-.js} +29 -7
- package/dist/checkout.d.ts +16 -10
- package/dist/checkout.d.ts.map +1 -1
- package/dist/gate.d.ts +13 -7
- package/dist/gate.d.ts.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/modal/config.d.ts +19 -0
- package/dist/modal/config.d.ts.map +1 -0
- package/dist/modal/index.d.ts +16 -0
- package/dist/modal/index.d.ts.map +1 -0
- package/dist/modal/index.js +1 -0
- package/dist/modal/lock-page-scroll.d.ts +9 -0
- package/dist/modal/lock-page-scroll.d.ts.map +1 -0
- package/dist/modal/modal.d.ts +160 -0
- package/dist/modal/modal.d.ts.map +1 -0
- package/dist/modal-BCDMoDW9.js +192 -0
- package/dist/pybara-js.iife.js +3 -3
- package/dist/pybara-js.js +177 -325
- package/dist/types.d.ts +16 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +22 -5
- package/dist/constants.d.ts +0 -13
- package/dist/constants.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -10,10 +10,14 @@ You keep your own UI — payment-method list, amount selector, form fields. `Pyb
|
|
|
10
10
|
npm install @pybara/pybara-js
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
No bundler? The IIFE build exposes `window.Pybara
|
|
13
|
+
No bundler? The IIFE build exposes `window.Pybara` — the same calls as the module:
|
|
14
14
|
|
|
15
15
|
```html
|
|
16
16
|
<script src="https://unpkg.com/@pybara/pybara-js/dist/pybara-js.iife.js"></script>
|
|
17
|
+
<script>
|
|
18
|
+
const pybara = Pybara.checkout({ siteUrl, siteName, recipientPrincipal });
|
|
19
|
+
// await pybara.open({ amount: '100', currency: 'EUR' }) on click — identical to the ESM surface
|
|
20
|
+
</script>
|
|
17
21
|
```
|
|
18
22
|
|
|
19
23
|
## Add Pybara as a payment method
|
|
@@ -26,12 +30,12 @@ const pybara = Pybara.checkout({
|
|
|
26
30
|
siteUrl: 'https://example.com', // your site, as registered in Pybara Wallet
|
|
27
31
|
siteName: 'Example Org',
|
|
28
32
|
recipientPrincipal: 'aaaaa-bbbbb-…', // the wallet principal in your _pybara-payto DNS record
|
|
29
|
-
currency: 'EUR',
|
|
33
|
+
currency: 'EUR', // optional default for open(); one currency per site
|
|
30
34
|
});
|
|
31
35
|
|
|
32
36
|
// On your "Pybara" payment-option click — opens the checkout over your page:
|
|
33
37
|
await pybara.open({
|
|
34
|
-
amount: 100,
|
|
38
|
+
amount: '100', // in EUR, as a decimal string: '12.34', '1000' for JPY
|
|
35
39
|
donorEmail: 'laurens@example.org', // optional — enables the receipt email + tax receipts
|
|
36
40
|
onSuccess: (result) => showThanks(result),
|
|
37
41
|
});
|
|
@@ -39,10 +43,12 @@ await pybara.open({
|
|
|
39
43
|
|
|
40
44
|
That's the whole integration. `open()` resolves once the checkout is up; the result arrives on `onSuccess`.
|
|
41
45
|
|
|
46
|
+
**Amounts** are decimal strings in the currency's major units — `'12.34'` for €12.34, `'1000'` for ¥1,000 — as PayPal's API takes them; a number is accepted too (`12.34`). The checkout reads them with the currency's ISO 4217 minor units, so your page never needs to know how many decimals a currency has, and it refuses an amount the currency can't hold (`'12.345'` EUR, `'1000.5'` JPY). It converts to USD itself, with Pybara's own rates, and shows the minimum in the payer's currency if the amount is below it.
|
|
47
|
+
|
|
42
48
|
**Recurring** — same call, two extra params:
|
|
43
49
|
|
|
44
50
|
```ts
|
|
45
|
-
await pybara.open({ amount: 25, frequency: 'monthly', durationMonths: 12 });
|
|
51
|
+
await pybara.open({ amount: '25', frequency: 'monthly', durationMonths: 12 });
|
|
46
52
|
// omit durationMonths for an open-ended subscription
|
|
47
53
|
```
|
|
48
54
|
|
|
@@ -59,12 +65,13 @@ The code above is all an AI builder needs. The one thing code can't do: the site
|
|
|
59
65
|
| `recipientPrincipal` | `string` | ✓ | The recipient's wallet principal — the one in the `_pybara-payto` DNS record |
|
|
60
66
|
| `siteUrl` | `string` | ✓ | Site registry key, e.g. `'https://example.com'` |
|
|
61
67
|
| `siteName` | `string` | ✓ | Display name — shown in the checkout and stored on subscriptions |
|
|
62
|
-
| `currency` | `string` | |
|
|
68
|
+
| `currency` | `string` | | Default currency for `open()`, ISO 4217 uppercase (`'EUR'`) — no default of its own |
|
|
63
69
|
| `thankYouMessage` | `string` | | Success-screen title override |
|
|
64
70
|
| `thankYouRedirectUrl` | `string` | | Redirect after the payer closes the success screen |
|
|
65
71
|
| `siteCountry` | `string` | | ISO 3166-1 alpha-2 |
|
|
66
72
|
| `notifyEmail` | `string` | | Operator email — terms warnings, payment notifications |
|
|
67
73
|
| `notifyDonations` | `boolean` | | `false` silences per-payment emails (default `true`) |
|
|
74
|
+
| `platform` | `string` | | Your integration's slug in the payment log, `a-z 0-9 -` (default `'pybara-js'`) |
|
|
68
75
|
| `pluginVersion` | `string` | | Set by plugins — skips the autonomous-embed terms gate |
|
|
69
76
|
| `staging` / `debug` | `boolean` | | Staging canisters + wallet / console logging |
|
|
70
77
|
|
|
@@ -72,8 +79,8 @@ The code above is all an AI builder needs. The one thing code can't do: the site
|
|
|
72
79
|
|
|
73
80
|
| Field | Type | Description |
|
|
74
81
|
|---|---|---|
|
|
75
|
-
| `amount` | `number` |
|
|
76
|
-
| `currency` | `string` |
|
|
82
|
+
| `amount` | `string` \| `number` | Decimal string in the currency's major units: `'12.34'`, `'1000'` (JPY) |
|
|
83
|
+
| `currency` | `string` | ISO 4217 — required here unless set in `Pybara.checkout()`; a multi-currency site passes it on every call |
|
|
77
84
|
| `frequency` | `'weekly' \| 'monthly' \| 'yearly'` | Omit for one-time |
|
|
78
85
|
| `durationMonths` | `3 \| 6 \| 12 \| 24` | Omit for unlimited |
|
|
79
86
|
| `donorEmail` `donorFirstName` `donorLastName` `donorCompany` `donorCountry` `donorAddress*` | `string` | Donor identity — pass what your form already collects |
|
|
@@ -81,7 +88,7 @@ The code above is all an AI builder needs. The one thing code can't do: the site
|
|
|
81
88
|
| `donorMessage` | `string` | Stored with the payment log |
|
|
82
89
|
| `wantsTaxReceipt` | `boolean` | Prefills the receipt checkbox (eligible sites only) |
|
|
83
90
|
| `onSuccess(result)` | `function` | Payment confirmed — `result` carries block height, token, principals |
|
|
84
|
-
| `onError(err)` `onClose()` | `function` |
|
|
91
|
+
| `onError(err)` `onClose()` | `function` | Checkout refusals (`EmbeddedError`, `err.code`) / modal closed |
|
|
85
92
|
|
|
86
93
|
### Errors
|
|
87
94
|
|
|
@@ -91,9 +98,10 @@ The code above is all an AI builder needs. The one thing code can't do: the site
|
|
|
91
98
|
|---|---|
|
|
92
99
|
| `GATE_REFUSED` | Site hasn't accepted the widget terms, or a kill switch is on — `err.message` says which |
|
|
93
100
|
| `RECIPIENT_SUSPENDED` | Recipient can't accept payments right now |
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
|
|
101
|
+
| `INVALID_CONFIG` | Missing or malformed config or params — `err.message` names the field, e.g. `open(): "currency" is required` |
|
|
102
|
+
| `CHECKOUT_FAILED` | The checkout modal couldn't initialise |
|
|
103
|
+
|
|
104
|
+
Once open, the checkout reports a refusal to `onError` as an `EmbeddedError`, also with `err.code`. The ones an integration can cause: `INVALID_CHECKOUT` (the message names the field and what it must be, e.g. `checkout.amount "12.345" has more decimals than EUR has (2)`) and `RATE_UNAVAILABLE` (Pybara's rate for the currency couldn't be loaded — let the payer try again). An amount below the minimum isn't an error: the checkout shows the minimum itself.
|
|
97
105
|
|
|
98
106
|
## Scope
|
|
99
107
|
|
|
@@ -101,6 +109,10 @@ Today `checkout()` runs the **donation** flow (the `siteUrl` resolves a register
|
|
|
101
109
|
|
|
102
110
|
If you want the whole donation *form* — presets, amount selector, frequency picker, styled button — that's [`@pybara/donate-widget`](https://github.com/pybara/pybara-widget), a product built on the same machinery.
|
|
103
111
|
|
|
112
|
+
## Internal entry points
|
|
113
|
+
|
|
114
|
+
`@pybara/pybara-js/modal` and `@pybara/pybara-js/admin` are Pybara's own machinery for its plugins: not part of the public API, with no compatibility promise between versions. Integrate with `Pybara.checkout()`.
|
|
115
|
+
|
|
104
116
|
## Links
|
|
105
117
|
|
|
106
118
|
- Docs — <https://docs.pybara.com>
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://docs.pybara.com/pybara-js/checkout.schema.json",
|
|
4
|
+
"title": "Pybara.checkout() config",
|
|
5
|
+
"description": "Config object for Pybara.checkout() in @pybara/pybara-js — bind once per site. The checkout refuses to open until the site is verified in Pybara Wallet (_pybara-payto DNS record) and the widget terms are accepted. The open() payment params are under #/$defs/payment.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["recipientPrincipal", "siteUrl", "siteName"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"recipientPrincipal": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"description": "Recipient's wallet principal — the same one the site's _pybara-payto DNS record lists. The registry does not serve it; the integrator passes it."
|
|
14
|
+
},
|
|
15
|
+
"siteUrl": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 1,
|
|
18
|
+
"description": "The site's URL as registered in Pybara Wallet, e.g. 'https://example.com'. Normalized by the SDK: a bare domain reads as https, query/fragment/default ports/trailing slashes drop, a path is kept."
|
|
19
|
+
},
|
|
20
|
+
"siteName": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"description": "Site display name — shown in the checkout frame and stored as the subscription name on recurring payments."
|
|
24
|
+
},
|
|
25
|
+
"currency": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"pattern": "^[A-Z]{3}$",
|
|
28
|
+
"description": "The currency open() charges in when its own currency is absent (ISO 4217, uppercase, e.g. 'EUR'): set it once on a single-currency site. No default — open() refuses when neither is set."
|
|
29
|
+
},
|
|
30
|
+
"platform": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"pattern": "^[a-z0-9-]{1,64}$",
|
|
33
|
+
"default": "pybara-js",
|
|
34
|
+
"description": "The integration surface reported in the payment log's platform field: a lowercase slug — first-party consumers set their own (e.g. 'pybara-donate'). A label, never used for a decision."
|
|
35
|
+
},
|
|
36
|
+
"siteCountry": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"pattern": "^[A-Za-z]{2}$",
|
|
39
|
+
"description": "Site base country (ISO 3166-1 alpha-2)."
|
|
40
|
+
},
|
|
41
|
+
"notifyEmail": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "Site operator's contact email — terms warnings, per-payment notification emails."
|
|
44
|
+
},
|
|
45
|
+
"notifyDonations": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"default": true,
|
|
48
|
+
"description": "false silences the per-payment notification email at notifyEmail."
|
|
49
|
+
},
|
|
50
|
+
"thankYouMessage": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "Replaces the success screen's default title."
|
|
53
|
+
},
|
|
54
|
+
"thankYouRedirectUrl": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"format": "uri",
|
|
57
|
+
"description": "Redirect target once the payer leaves the success screen (PDF receipt, member area)."
|
|
58
|
+
},
|
|
59
|
+
"recipientTosVersion": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"description": "The terms version the recipient (site operator) accepted, e.g. '1-0' — forwarded so settle stores it with the payment log."
|
|
62
|
+
},
|
|
63
|
+
"recipientTosAcceptedAt": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"format": "date-time",
|
|
66
|
+
"description": "Recipient terms acceptance timestamp (ISO 8601 UTC) — same forwarding role as recipientTosVersion."
|
|
67
|
+
},
|
|
68
|
+
"pluginVersion": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "The integration version forwarding the payment — set by Pybara plugins only. When set, the widget terms gate is skipped: plugins check their own terms server-side."
|
|
71
|
+
},
|
|
72
|
+
"staging": {
|
|
73
|
+
"type": "boolean",
|
|
74
|
+
"default": false,
|
|
75
|
+
"description": "Staging environment — staging canisters and staging.pybara.io. Never on a live site."
|
|
76
|
+
},
|
|
77
|
+
"debug": {
|
|
78
|
+
"type": "boolean",
|
|
79
|
+
"default": false,
|
|
80
|
+
"description": "Console diagnostics."
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"$defs": {
|
|
84
|
+
"payment": {
|
|
85
|
+
"title": "checkout.open() params",
|
|
86
|
+
"description": "One payment attempt — the params of a single open() call.",
|
|
87
|
+
"type": "object",
|
|
88
|
+
"additionalProperties": false,
|
|
89
|
+
"required": ["amount"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"amount": {
|
|
92
|
+
"oneOf": [
|
|
93
|
+
{ "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$" },
|
|
94
|
+
{ "type": "number", "exclusiveMinimum": 0 }
|
|
95
|
+
],
|
|
96
|
+
"examples": ["12.34", "1000", "5"],
|
|
97
|
+
"description": "The amount in the currency's major units, as a decimal string ('12.34' for €12.34, '1000' for ¥1,000); a number is accepted and turned into its decimal text. The checkout reads it with the currency's ISO 4217 minor units and refuses more decimals than the currency holds ('12.345' EUR, '1000.5' JPY), so the page never needs to know them. No minimum is checked here: the checkout shows its own, in the payer's currency."
|
|
98
|
+
},
|
|
99
|
+
"currency": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"pattern": "^[A-Z]{3}$",
|
|
102
|
+
"description": "The currency charged (ISO 4217, uppercase) — the checkout config's when absent; one of the two is required. A multi-currency site passes it on every call."
|
|
103
|
+
},
|
|
104
|
+
"frequency": {
|
|
105
|
+
"enum": ["weekly", "monthly", "yearly", "every2min"],
|
|
106
|
+
"description": "Recurring pull interval — omit for a one-time payment. 'every2min' exists for testing."
|
|
107
|
+
},
|
|
108
|
+
"durationMonths": {
|
|
109
|
+
"enum": [3, 6, 12, 24],
|
|
110
|
+
"description": "Recurring length in months, checked by the checkout — omit with frequency for an unlimited subscription."
|
|
111
|
+
},
|
|
112
|
+
"donorIsAnonymous": {
|
|
113
|
+
"type": "boolean",
|
|
114
|
+
"description": "Hide the payer's identity on the public record."
|
|
115
|
+
},
|
|
116
|
+
"donorMessage": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Message from the payer to the recipient — seeds the field the payer can edit on the confirm screen."
|
|
119
|
+
},
|
|
120
|
+
"wantsTaxReceipt": {
|
|
121
|
+
"type": "boolean",
|
|
122
|
+
"description": "Prefills the 'I'd like a tax receipt' checkbox — shown only when the recipient is registered and issues receipts."
|
|
123
|
+
},
|
|
124
|
+
"donorFirstName": { "type": "string" },
|
|
125
|
+
"donorLastName": { "type": "string" },
|
|
126
|
+
"donorEmail": { "type": "string", "description": "Prefills the receipt-address field — a payer who leaves an email gets a payment record." },
|
|
127
|
+
"donorCompany": { "type": "string" },
|
|
128
|
+
"donorCountry": { "type": "string" },
|
|
129
|
+
"donorAddressLine1": { "type": "string" },
|
|
130
|
+
"donorAddressLine2": { "type": "string" },
|
|
131
|
+
"donorAddressCity": { "type": "string" },
|
|
132
|
+
"donorAddressState": { "type": "string" },
|
|
133
|
+
"donorAddressPostalCode": { "type": "string" },
|
|
134
|
+
"donorAddressCountry": { "type": "string" },
|
|
135
|
+
"donorTosVersion": { "type": "string", "description": "Terms version the payer accepted, if the host collected one." },
|
|
136
|
+
"donorTosAcceptedAt": { "type": "string", "format": "date-time" },
|
|
137
|
+
"onSuccess": { "description": "function (CheckoutResult) => void — called once the payment is confirmed on-chain; not expressible in JSON." },
|
|
138
|
+
"onError": { "description": "function (Error) => void — called on frame-level errors; not expressible in JSON." },
|
|
139
|
+
"onClose": { "description": "function () => void — called when the payer closes the checkout; not expressible in JSON." }
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -10,6 +10,9 @@ export declare class PybaraAdminClient {
|
|
|
10
10
|
/** null is cached too: a site not registered yet (before its first payment) is the common case on a new store, and would otherwise cost a regs query on every click. */
|
|
11
11
|
private merchantDataCache;
|
|
12
12
|
private recipientDataCache;
|
|
13
|
+
/** In-flight fetches — a click during the page-load prewarm shares the one query instead of issuing a second. */
|
|
14
|
+
private merchantDataInFlight;
|
|
15
|
+
private recipientDataInFlight;
|
|
13
16
|
private readonly adminCoreCanisterId;
|
|
14
17
|
/** The admin regs of adminCoreCanisterId's environment: staging's for staging's core, prod's otherwise. */
|
|
15
18
|
private readonly adminRegsCanisterId;
|
|
@@ -48,6 +51,7 @@ export declare class PybaraAdminClient {
|
|
|
48
51
|
* @throws Error if the merchant is suspended.
|
|
49
52
|
*/
|
|
50
53
|
getMerchantDataWithCache(siteUrl: string): Promise<MerchantRecord | null>;
|
|
54
|
+
private fetchMerchantData;
|
|
51
55
|
/**
|
|
52
56
|
* Recipient record for a site, with a 5-minute in-memory cache. Same cache-before-validate reasoning as getMerchantDataWithCache().
|
|
53
57
|
*
|
|
@@ -56,6 +60,7 @@ export declare class PybaraAdminClient {
|
|
|
56
60
|
* @throws Error if a registered recipient is suspended.
|
|
57
61
|
*/
|
|
58
62
|
getRecipientDataWithCache(siteUrl: string): Promise<RecipientRecord | null>;
|
|
63
|
+
private fetchRecipientData;
|
|
59
64
|
/**
|
|
60
65
|
* The kill switch. Call early in the checkout flow, before showing any payment UI.
|
|
61
66
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PybaraAdminClient.d.ts","sourceRoot":"","sources":["../../../src/admin/core/PybaraAdminClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAKN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAKrE,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,KAAK,CAAU;IACvB,oGAAoG;IACpG,OAAO,CAAC,WAAW,CAA4B;IAC/C,wKAAwK;IACxK,OAAO,CAAC,iBAAiB,CAGX;IACd,OAAO,CAAC,kBAAkB,CAGZ;
|
|
1
|
+
{"version":3,"file":"PybaraAdminClient.d.ts","sourceRoot":"","sources":["../../../src/admin/core/PybaraAdminClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAKN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAKrE,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,KAAK,CAAU;IACvB,oGAAoG;IACpG,OAAO,CAAC,WAAW,CAA4B;IAC/C,wKAAwK;IACxK,OAAO,CAAC,iBAAiB,CAGX;IACd,OAAO,CAAC,kBAAkB,CAGZ;IACd,iHAAiH;IACjH,OAAO,CAAC,oBAAoB,CAA0D;IACtF,OAAO,CAAC,qBAAqB,CAA2D;IAExF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAC7C,2GAA2G;IAC3G,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;gBAEjC,OAAO,EAAE,wBAAwB;IAS7C;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3B;;;;;OAKG;YACW,YAAY;IAuB1B,+DAA+D;IACzD,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAqB3D;;;;OAIG;IACG,oBAAoB,IAAI,OAAO,CAAC,WAAW,CAAC;IA+ClD;;;;;;;;;;;OAWG;IACG,wBAAwB,CAC7B,OAAO,EAAE,MAAM,GACb,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;YAqBnB,iBAAiB;IAiB/B;;;;;;OAMG;IACG,yBAAyB,CAC9B,OAAO,EAAE,MAAM,GACb,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;YAqBpB,kBAAkB;IAehC;;;;;;OAMG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBvE,sEAAsE;YACxD,QAAQ;YAMR,aAAa;YAab,YAAY;IAa1B;;;OAGG;YACW,sBAAsB;IAsBpC,OAAO,CAAC,sBAAsB;IAQ9B,qEAAqE;IACrE,OAAO,CAAC,uBAAuB;CAO/B"}
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @pybara/pybara-js/admin
|
|
3
3
|
*
|
|
4
|
-
* Read client for pybara-admin's `core` and `regs` canisters
|
|
4
|
+
* Read client for pybara-admin's `core` and `regs` canisters — internal machinery for
|
|
5
|
+
* first-party consumers (the plugins). Integrations taking payments or donations use
|
|
6
|
+
* `Pybara.checkout()` on the package root, not this subpath.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
8
|
+
* @internal Not part of the public API: no compatibility promise between versions, even minor ones.
|
|
9
|
+
*
|
|
10
|
+
* It signs nothing and moves no funds. Payments and donations are executed by the buyer's
|
|
11
|
+
* own wallet inside pybara-wallet's checkout frame, which `Pybara.checkout()` opens.
|
|
7
12
|
*
|
|
8
13
|
* This was `@pybara/pybara-sdk` — absorbed into pybara-js so the browser SDK and its machinery version together.
|
|
9
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/admin/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as CANISTER_IDS, r as PYBARA_WALLET_URLS, t as PybaraAdminClient } from "../admin-
|
|
1
|
+
export { n as CANISTER_IDS, r as PYBARA_WALLET_URLS, t as PybaraAdminClient } from "../admin-B1pVP25-.js";
|
|
@@ -7958,7 +7958,7 @@ var Fu = ({ IDL: e }) => e.Service({
|
|
|
7958
7958
|
});
|
|
7959
7959
|
}, Lu = "https://icp-api.io", Ru = class {
|
|
7960
7960
|
constructor(e) {
|
|
7961
|
-
this.agent = null, this.adminCoreActor = null, this.adminRegsActor = null, this.adminConfig = null, this.merchantDataCache = /* @__PURE__ */ new Map(), this.recipientDataCache = /* @__PURE__ */ new Map(), this.adminCoreCanisterId = e.adminCoreCanisterId, this.adminRegsCanisterId = e.adminCoreCanisterId === r.staging.admin_core ? r.staging.admin_regs : r.prod.admin_regs, this.debug = e.debug ?? !1;
|
|
7961
|
+
this.agent = null, this.adminCoreActor = null, this.adminRegsActor = null, this.adminConfig = null, this.merchantDataCache = /* @__PURE__ */ new Map(), this.recipientDataCache = /* @__PURE__ */ new Map(), this.merchantDataInFlight = /* @__PURE__ */ new Map(), this.recipientDataInFlight = /* @__PURE__ */ new Map(), this.adminCoreCanisterId = e.adminCoreCanisterId, this.adminRegsCanisterId = e.adminCoreCanisterId === r.staging.admin_core ? r.staging.admin_regs : r.prod.admin_regs, this.debug = e.debug ?? !1;
|
|
7962
7962
|
}
|
|
7963
7963
|
async init() {
|
|
7964
7964
|
this.agent = await Tu.create({ host: Lu }), this.adminCoreActor = ku.createActor(Fu, {
|
|
@@ -8019,20 +8019,42 @@ var Fu = ({ IDL: e }) => e.Service({
|
|
|
8019
8019
|
async getMerchantDataWithCache(e) {
|
|
8020
8020
|
let t = Date.now(), n = this.merchantDataCache.get(e);
|
|
8021
8021
|
if (n && t - n.timestamp < 3e5) return this.validateMerchantAccess(n.data), n.data;
|
|
8022
|
-
let r =
|
|
8022
|
+
let r = this.merchantDataInFlight.get(e);
|
|
8023
|
+
if (r) return r;
|
|
8024
|
+
let i = this.fetchMerchantData(e, t);
|
|
8025
|
+
this.merchantDataInFlight.set(e, i);
|
|
8026
|
+
try {
|
|
8027
|
+
return await i;
|
|
8028
|
+
} finally {
|
|
8029
|
+
this.merchantDataInFlight.delete(e);
|
|
8030
|
+
}
|
|
8031
|
+
}
|
|
8032
|
+
async fetchMerchantData(e, t) {
|
|
8033
|
+
let n = (await (await this.getRegsActor()).get_merchant(e))?.[0] ?? null;
|
|
8023
8034
|
return this.merchantDataCache.set(e, {
|
|
8024
|
-
data:
|
|
8035
|
+
data: n,
|
|
8025
8036
|
timestamp: t
|
|
8026
|
-
}), this.validateMerchantAccess(
|
|
8037
|
+
}), this.validateMerchantAccess(n), n;
|
|
8027
8038
|
}
|
|
8028
8039
|
async getRecipientDataWithCache(e) {
|
|
8029
8040
|
let t = Date.now(), n = this.recipientDataCache.get(e);
|
|
8030
8041
|
if (n && t - n.timestamp < 3e5) return this.validateRecipientAccess(n.data), n.data;
|
|
8031
|
-
let r =
|
|
8042
|
+
let r = this.recipientDataInFlight.get(e);
|
|
8043
|
+
if (r) return r;
|
|
8044
|
+
let i = this.fetchRecipientData(e, t);
|
|
8045
|
+
this.recipientDataInFlight.set(e, i);
|
|
8046
|
+
try {
|
|
8047
|
+
return await i;
|
|
8048
|
+
} finally {
|
|
8049
|
+
this.recipientDataInFlight.delete(e);
|
|
8050
|
+
}
|
|
8051
|
+
}
|
|
8052
|
+
async fetchRecipientData(e, t) {
|
|
8053
|
+
let n = (await (await this.getRegsActor()).get_recipient(e))?.[0] ?? null;
|
|
8032
8054
|
return this.recipientDataCache.set(e, {
|
|
8033
|
-
data:
|
|
8055
|
+
data: n,
|
|
8034
8056
|
timestamp: t
|
|
8035
|
-
}), this.validateRecipientAccess(
|
|
8057
|
+
}), this.validateRecipientAccess(n), n;
|
|
8036
8058
|
}
|
|
8037
8059
|
async validatePlugin(e, t) {
|
|
8038
8060
|
this.adminConfig || await this.getPybaraAdminConfig();
|
package/dist/checkout.d.ts
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
|
+
import { WidgetGate } from './gate';
|
|
1
2
|
import { CheckoutConfig, PaymentParams } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* A bound checkout — what Pybara.checkout() returns.
|
|
4
5
|
*
|
|
5
|
-
* checkout() is the "mount": it resolves the admin client,
|
|
6
|
-
* for autonomous embeds, and loads the hidden checkout iframe, so open() is instant on the payer's click.
|
|
6
|
+
* checkout() is the "mount": it resolves the admin client, runs the terms/kill-switch gate for autonomous embeds, and loads the hidden checkout iframe, so open() is instant on the payer's click.
|
|
7
7
|
* The host keeps its own DOM entirely — there is nothing to render here.
|
|
8
|
+
* open() sends what the page knows, in its own terms (a `checkout`); the checkout frame converts the amount with core's rate and records the payment, so this package holds neither a rate nor the log's field format.
|
|
8
9
|
*/
|
|
9
10
|
export declare class PybaraCheckout {
|
|
10
11
|
private readonly config;
|
|
11
12
|
private adminClient;
|
|
12
|
-
private fiatRate;
|
|
13
13
|
private modal;
|
|
14
|
-
private
|
|
14
|
+
private gateOutcome;
|
|
15
15
|
private isOpen;
|
|
16
|
+
/** Set by onSuccess while the success screen is up — the close that follows redirects instead of counting as a cancellation. */
|
|
17
|
+
private completedPayment;
|
|
16
18
|
private activePayment;
|
|
17
|
-
/** All async binding work — open() awaits it so the gate
|
|
18
|
-
|
|
19
|
+
/** All async binding work — open() awaits it so the gate and the iframe prewarm are resolved first. */
|
|
20
|
+
readonly ready: Promise<void>;
|
|
19
21
|
constructor(userConfig: CheckoutConfig);
|
|
22
|
+
/** The autonomous-embed gate outcome once `ready` resolves — null while pending or under plugin terms (a plugin's host checks its own). */
|
|
23
|
+
get gate(): WidgetGate | null;
|
|
20
24
|
/**
|
|
21
25
|
* Open the Pybara checkout for one payment attempt.
|
|
22
26
|
* Resolves once the checkout surface is up; the payment result arrives on the params' onSuccess/onError/onClose callbacks.
|
|
23
|
-
* Rejects with a PybaraError when the checkout cannot open at all (gate, invalid params
|
|
27
|
+
* Rejects with a PybaraError when the checkout cannot open at all (gate, invalid params).
|
|
28
|
+
* The params' shape is checked here, so a typo fails at the call; the checkout checks everything again, plus what only it knows (the currency's decimals, the minimum), and reports a refusal to onError.
|
|
24
29
|
*/
|
|
25
30
|
open(payment: PaymentParams): Promise<void>;
|
|
26
31
|
/** Close an open modal — teardown is final, the next open() rebuilds it. */
|
|
@@ -28,10 +33,11 @@ export declare class PybaraCheckout {
|
|
|
28
33
|
private init;
|
|
29
34
|
private initCheckoutModal;
|
|
30
35
|
/**
|
|
31
|
-
* The
|
|
32
|
-
*
|
|
36
|
+
* The checkout as the frame reads it (pybara-wallet's EmbeddedCheckout, version 1): what the page knows, in its own terms.
|
|
37
|
+
* The frame turns it into the payment log's fields; their names and encodings live there, not here, so no installed version of this package can drift from them.
|
|
38
|
+
* Values are passed as given, nulls included — a config read from JSON (pybara-donate's, from PHP) carries null for a setting that is not set, which the frame reads as absent.
|
|
33
39
|
*/
|
|
34
|
-
private
|
|
40
|
+
private checkoutFor;
|
|
35
41
|
/** Warm the TLS handshake to the wallet origin so the iframe's first real load is faster. */
|
|
36
42
|
private preconnectWallet;
|
|
37
43
|
}
|
package/dist/checkout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"AAMA,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,aAAa,EAEnB,MAAM,SAAS,CAAC;AAcjB;;;;;;GAMG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAChD,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,MAAM,CAAS;IACvB,gIAAgI;IAChI,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,aAAa,CAA8B;IACnD,uGAAuG;IACvG,SAAgB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;gBAEzB,UAAU,EAAE,cAAc;IAKtC,2IAA2I;IAC3I,IAAI,IAAI,IAAI,UAAU,GAAG,IAAI,CAE5B;IAED;;;;;OAKG;IACG,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA8EjD,4EAA4E;IAC5E,KAAK,IAAI,IAAI;YAIC,IAAI;IA8ClB,OAAO,CAAC,iBAAiB;IAqDzB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAmCnB,6FAA6F;IAC7F,OAAO,CAAC,gBAAgB;CAOzB"}
|
package/dist/gate.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Gate for autonomous embeds (no plugin):
|
|
2
|
+
* Gate for autonomous embeds (no plugin): the widget terms + the donate kill switches.
|
|
3
3
|
*
|
|
4
4
|
* A custom form built on Pybara.checkout() is the same product surface as the donate widget — a site embeds it under the widget's terms.
|
|
5
5
|
* The two packages share no code, so the gate is duplicated on each side: keep the response shape and the semantics in sync with widget-core/src/gate.ts.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
show: boolean;
|
|
9
|
-
reason: string | null;
|
|
10
|
-
}
|
|
11
|
-
/** Old signature pages are superseded by the floor — a signature below the floor counts as unsigned. */
|
|
7
|
+
/** The widget terms version this release requires: raised only by a release that needs new terms, so most updates keep showing on sites that accepted older ones. */
|
|
12
8
|
export declare const REQUIRED_WIDGET_TERMS_VERSION = "1-0";
|
|
13
|
-
export
|
|
9
|
+
export type WidgetGate = {
|
|
10
|
+
show: false;
|
|
11
|
+
reason: string;
|
|
12
|
+
} | {
|
|
13
|
+
show: true;
|
|
14
|
+
recurring: boolean;
|
|
15
|
+
};
|
|
16
|
+
/** Whether `accepted` is at least `required`, both `major-minor`, compared as numbers. */
|
|
17
|
+
export declare function versionAtLeast(accepted: string, required: string): boolean;
|
|
18
|
+
/** Reads core's /widget-config and regs' /widget-terms in parallel, and says whether the checkout may open, and with recurring. */
|
|
19
|
+
export declare function checkWidgetGate(env: 'prod' | 'staging', siteUrl: string, recipientPrincipal: string): Promise<WidgetGate>;
|
|
14
20
|
//# sourceMappingURL=gate.d.ts.map
|
package/dist/gate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,MAAM,
|
|
1
|
+
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,qKAAqK;AACrK,eAAO,MAAM,6BAA6B,QAAQ,CAAC;AAKnD,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAW9F,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAS1E;AAQD,mIAAmI;AACnI,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,OAAO,EAAE,MAAM,EACf,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,UAAU,CAAC,CAkCrB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { PybaraCheckout } from './checkout';
|
|
2
2
|
import { CheckoutConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Bind a site once — resolves the recipient record, the fiat rate and the terms gate,
|
|
5
|
+
* and prewarms the checkout iframe so open() is instant on the payer's click.
|
|
6
|
+
*/
|
|
7
|
+
export declare function checkout(config: CheckoutConfig): PybaraCheckout;
|
|
3
8
|
export declare const Pybara: {
|
|
4
|
-
|
|
5
|
-
* Bind a site once — resolves the recipient record, the fiat rate and the terms gate,
|
|
6
|
-
* and prewarms the checkout iframe so open() is instant on the payer's click.
|
|
7
|
-
*/
|
|
8
|
-
checkout(config: CheckoutConfig): PybaraCheckout;
|
|
9
|
+
checkout: typeof checkout;
|
|
9
10
|
};
|
|
10
11
|
export { PybaraCheckout } from './checkout';
|
|
12
|
+
export { type WidgetGate } from './gate';
|
|
11
13
|
export { type CheckoutConfig, type CheckoutResult, type Frequency, type PaymentParams, PybaraError, type PybaraErrorCode, } from './types';
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAE/D;AAID,eAAO,MAAM,MAAM;;CAAe,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,eAAe,GACrB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal Configuration
|
|
3
|
+
*/
|
|
4
|
+
export declare const OVERLAY_STYLES: {
|
|
5
|
+
Z_INDEX: number;
|
|
6
|
+
BACKGROUND: string;
|
|
7
|
+
};
|
|
8
|
+
/** Show/hide motion, the same timings as pybara-ux-v0's modal (its styles/animations.css and MODAL_TIMINGS). */
|
|
9
|
+
export declare const MODAL_MOTION: {
|
|
10
|
+
OVERLAY_FADE_IN_MS: number;
|
|
11
|
+
/** The panel slides up 20px while fading in, once the frame has content to show. */
|
|
12
|
+
PANEL_OPEN_MS: number;
|
|
13
|
+
/** The panel scales down to 95% while fading out. */
|
|
14
|
+
PANEL_CLOSE_MS: number;
|
|
15
|
+
/** The backdrop starts fading this long after the panel, for a layered close. */
|
|
16
|
+
OVERLAY_FADE_OUT_DELAY_MS: number;
|
|
17
|
+
OVERLAY_FADE_OUT_MS: number;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/modal/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,cAAc;;;CAG1B,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,YAAY;;IAExB,oFAAoF;;IAEpF,qDAAqD;;IAErD,iFAAiF;;;CAGjF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @pybara/pybara-js/modal
|
|
3
|
+
*
|
|
4
|
+
* The checkout surface itself: a backdrop and an iframe onto Pybara Wallet's
|
|
5
|
+
* mode-2 frame, plus the error type its callbacks report. Internal machinery —
|
|
6
|
+
* integrations use `Pybara.checkout()` on the package root; first-party
|
|
7
|
+
* consumers that drive the modal directly (the plugins) import it from here.
|
|
8
|
+
*
|
|
9
|
+
* @internal Not part of the public API: no compatibility promise between versions, even minor ones.
|
|
10
|
+
* Its raw `sdkFields` are the payment log's own field format, which `Pybara.checkout()` never asks an integrator to hold.
|
|
11
|
+
*
|
|
12
|
+
* This was `@pybara/pybara-ux` — absorbed into pybara-js so the SDK and its
|
|
13
|
+
* modal kit version together.
|
|
14
|
+
*/
|
|
15
|
+
export { CheckoutModal, EmbeddedError, type Checkout, type CheckoutModalConfig, type ModalData, type PaymentData, } from './modal.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modal/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as CheckoutModal, n as EmbeddedError } from "../modal-BCDMoDW9.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Freezes the host page under a checkout overlay without hiding the page scrollbar.
|
|
3
|
+
* overflow:hidden + padding compensation never matches OS scrollbar width exactly, so the page still jumps.
|
|
4
|
+
* Wheel/touch/keys on the parent document are cancelled. Wheel inside the wallet iframe never reaches those listeners (separate document) and overscroll-chains to the parent instead — a scroll listener pins window.scrollX/Y so that chain cannot move the page.
|
|
5
|
+
* Locks are counted, so two checkouts on one page (a WooCommerce checkout and a donation widget, say) never unlock each other.
|
|
6
|
+
*/
|
|
7
|
+
export declare function lockPageScroll(): void;
|
|
8
|
+
export declare function unlockPageScroll(): void;
|
|
9
|
+
//# sourceMappingURL=lock-page-scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock-page-scroll.d.ts","sourceRoot":"","sources":["../../src/modal/lock-page-scroll.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH,wBAAgB,cAAc,IAAI,IAAI,CAUrC;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CASvC"}
|