@pybara/pybara-js 0.7.0 → 0.9.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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Accept crypto payments and donations with **Pybara** on any page — a callable checkout, in the same convention as `@stripe/stripe-js` and `@paypal/paypal-js`.
4
4
 
5
- You keep your own UI — payment-method list, amount selector, form fields. `Pybara.checkout()` binds your site once and opens Pybara's own checkout surface (token selection, wallet, settlement, success screen) when the payer clicks.
5
+ You keep your own UI — payment-method list, amount selector, form fields. `Pybara.checkout()` binds your site once; `checkout.buttons()` draws a "Pybara" button beside your other payment methods, or `checkout.open()` opens Pybara's checkout from a button of your own. The checkout itself (wallet, token choice, settlement, success screen) is Pybara's.
6
6
 
7
7
  ## Install
8
8
 
@@ -13,14 +13,59 @@ npm install @pybara/pybara-js
13
13
  No bundler? The IIFE build exposes `window.Pybara` — the same calls as the module:
14
14
 
15
15
  ```html
16
- <script src="https://unpkg.com/@pybara/pybara-js/dist/pybara-js.iife.js"></script>
16
+ <script src="https://cdn.jsdelivr.net/npm/@pybara/pybara-js@0.9/dist/pybara-js.iife.js"></script>
17
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
18
+ const pybara = Pybara.checkout({ siteUrl, siteName, recipientPrincipal, currency: 'EUR' });
19
+ pybara.buttons({ createPayment: () => ({ amount: '25' }) }).render('#pybara-button');
20
20
  </script>
21
21
  ```
22
22
 
23
- ## Add Pybara as a payment method
23
+ ## Add Pybara next to PayPal
24
+
25
+ A page with PayPal Buttons gets a Pybara button beside them in a few lines. Pass the PayPal button's `style` as it is (`color`, `shape`, `height`, `borderRadius`) and the two match:
26
+
27
+ ```html
28
+ <div id="paypal-button-container"></div>
29
+ <div id="pybara-button"></div>
30
+ ```
31
+
32
+ ```ts
33
+ import { Pybara } from '@pybara/pybara-js';
34
+
35
+ const pybara = Pybara.checkout({
36
+ siteUrl: 'https://example.com', // this site, as registered in Pybara Wallet
37
+ siteName: 'Example Org',
38
+ recipientPrincipal: 'aaaaa-bbbbb-…', // the site owner's wallet principal (see "Before it works")
39
+ currency: 'EUR',
40
+ });
41
+
42
+ pybara.buttons({
43
+ style: { color: 'black', shape: 'rect', height: 45 }, // the same style as the PayPal button
44
+ createPayment: () => ({ amount: amountInput.value }), // read on the click; add frequency: 'monthly' for a subscription
45
+ onStateChange: ({ message }) => (hint.textContent = message ?? ''), // e.g. "Minimum €0.70", in the payer's language
46
+ onSuccess: (result) => showThanks(result),
47
+ }).render('#pybara-button');
48
+
49
+ amountInput.addEventListener('input', () => pybara.precheck({ amount: amountInput.value }));
50
+ ```
51
+
52
+ - **The button follows availability by itself:** disabled below the minimum, and its slot left empty when Pybara can't be used on this page yet. It holds no text but "Pybara"; the page around it says what it's for.
53
+ - **One-time and monthly side by side:** call `buttons()` twice on the same checkout, one with `frequency: 'monthly'`.
54
+ - **Everything the payer sees is served by Pybara,** so the button stays current without updating this package.
55
+
56
+ ## Before it works: the site owner's steps
57
+
58
+ Code can't do these; whoever adds Pybara to the site relays them to the site owner, once:
59
+
60
+ > 1. Create a Pybara Wallet at <https://pybara.io>, then open **Manage › Sites › Add a site without a plugin** and enter this site's address.
61
+ > 2. Publish the DNS `TXT` record the wallet shows (`_pybara-payto`, holding the wallet's principal) with the domain's DNS provider, until the wallet shows **Verified**.
62
+ > 3. Accept the widget terms for the site there, and copy the wallet's principal into `recipientPrincipal`.
63
+ >
64
+ > Until then the Pybara button stays hidden, and the browser console says which step is missing. It works on the site's registered domain, not on a preview URL.
65
+
66
+ Full guide: <https://docs.pybara.com/pybara-js/setup/>
67
+
68
+ ## Or your own button: `open()`
24
69
 
25
70
  ```ts
26
71
  import { Pybara } from '@pybara/pybara-js';
@@ -33,7 +78,7 @@ const pybara = Pybara.checkout({
33
78
  currency: 'EUR', // optional default for open(); one currency per site
34
79
  });
35
80
 
36
- // On your "Pybara" payment-option click — opens the checkout over your page:
81
+ // On your own button's click — opens the checkout over your page:
37
82
  await pybara.open({
38
83
  amount: '100', // in EUR, as a decimal string: '12.34', '1000' for JPY
39
84
  donorEmail: 'laurens@example.org', // optional — enables the receipt email + tax receipts
@@ -52,10 +97,6 @@ await pybara.open({ amount: '25', frequency: 'monthly', durationMonths: 12 });
52
97
  // omit durationMonths for an open-ended subscription
53
98
  ```
54
99
 
55
- ## One human step
56
-
57
- The code above is all an AI builder needs. The one thing code can't do: the site owner registers the site in **Pybara Wallet** (Manage › Sites → *Add a site without a plugin*), publishes the `_pybara-payto` DNS record it gives you, and accepts the widget terms — a one-time, two-minute step. Full guide: <https://docs.pybara.com/donate-widget/overview/>
58
-
59
100
  ## Reference
60
101
 
61
102
  ### `Pybara.checkout(config)` → `PybaraCheckout`
@@ -92,6 +133,18 @@ The code above is all an AI builder needs. The one thing code can't do: the site
92
133
  | `onSuccess(result)` | `function` | Payment confirmed — `result` carries block height, token, principals |
93
134
  | `onError(err)` `onClose()` | `function` | Checkout refusals (`EmbeddedError`, `err.code`) / modal closed |
94
135
 
136
+ ### `checkout.buttons(options)` → `{ render(el), destroy() }`
137
+
138
+ | Field | Type | Description |
139
+ |---|---|---|
140
+ | `createPayment()` | `function` | **Required.** Called on the click: the payment from the form, as `open()` takes it (`amount`, `currency`, `frequency`, donor fields), without callbacks. May return a promise |
141
+ | `style` | `{ color, shape, height, borderRadius }` | `color` `'brand'` \| `'black'` \| `'white'` (PayPal's names; its `'gold'`, `'blue'`, `'silver'` read as `'brand'`), `shape` `'pill'` \| `'rect'` \| `'sharp'`, `height` 25–55 px (default 45), `borderRadius` in px, overriding `shape` as PayPal's does. Passed to the button as given |
142
+ | `hideWhenUnavailable` | `boolean` | Collapse the button instead of leaving its slot empty when Pybara is unavailable |
143
+ | `onStateChange(availability)` | `function` | The checkout's availability answer, once per answer — see [Availability](#availability) |
144
+ | `onSuccess(result)` `onError(err)` `onClose()` | `function` | As `open()`'s |
145
+
146
+ `render(el)` takes an element or a selector, draws the button at the element's full width, and may be called again for another button; `destroy()` removes them all. Several `buttons()` calls share the one checkout. From the click until the checkout closes, the button shows "Processing…" in the checkout's `locale`, and takes no second click.
147
+
95
148
  ### Availability
96
149
 
97
150
  With `onAvailability` set, Pybara tells the page — before any click — whether a payment would go through, so you show the option only when it works:
@@ -126,6 +179,8 @@ amountInput.addEventListener('input', () => pybara.precheck({ amount: amountInpu
126
179
 
127
180
  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.
128
181
 
182
+ If pybara.io can't be reached, the checkout doesn't spin forever: after 15 seconds without its first screen it says it couldn't load, with **Try again** and **Close**, and closing reports `FRAME_UNAVAILABLE` to `onError`, so the page can offer another way to pay. A `buttons()` button that doesn't load in that time leaves its slot empty and reports `unavailable` to `onStateChange`.
183
+
129
184
  ## Scope
130
185
 
131
186
  Today `checkout()` runs the **donation** flow (the `siteUrl` resolves a registered recipient; the frame collects donor details, optional anonymity, tax-receipt flag). Merchant payments ride the same surface when they land — the site's registry record decides the flow, the API doesn't change.
@@ -134,7 +189,7 @@ If you want the whole donation *form* — presets, amount selector, frequency pi
134
189
 
135
190
  ## Internal entry points
136
191
 
137
- `@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()`.
192
+ `@pybara/pybara-js/modal`, `@pybara/pybara-js/button` 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()`.
138
193
 
139
194
  ## Links
140
195
 
@@ -159,7 +159,8 @@
159
159
  "properties": {
160
160
  "color": { "type": "string", "description": "'brand' | 'black' | 'white' (PayPal's names; its 'gold', 'blue', 'silver' read as 'brand'). Default 'brand'." },
161
161
  "shape": { "type": "string", "description": "'pill' | 'rect' | 'sharp'. Default 'pill'." },
162
- "height": { "type": "number", "minimum": 25, "maximum": 55, "description": "CSS pixels, PayPal's range. Default 45." }
162
+ "height": { "type": "number", "minimum": 25, "maximum": 55, "description": "CSS pixels, PayPal's range. Default 45." },
163
+ "borderRadius": { "type": "number", "minimum": 0, "description": "CSS pixels, overriding shape's corners, as PayPal's style.borderRadius. Above half the height it draws a pill." }
163
164
  }
164
165
  },
165
166
  "hideWhenUnavailable": { "type": "boolean", "description": "Collapse the button to no height when Pybara is unavailable here; by default its slot stays, empty." },
@@ -0,0 +1,39 @@
1
+ import { Availability } from '../modal/modal';
2
+ import { ButtonsOptions, ButtonStyle, PaymentParams, PybaraButtons } from '../types';
3
+ /** What renderButton() needs: where the button is served, how it looks, the availability answers, and what its click does. */
4
+ export interface RenderButtonOptions {
5
+ /** The wallet the button and its checkout are served from (pybara.io, or staging). */
6
+ walletUrl: string;
7
+ style?: ButtonStyle;
8
+ hideWhenUnavailable?: boolean;
9
+ /** The page's language (BCP 47, e.g. 'fr' or 'fr_FR'), for "Processing…"; English when the wallet doesn't have it. */
10
+ locale?: string;
11
+ /** Subscribes to every availability answer, first with the latest one if there is one; returns the unsubscribe. */
12
+ subscribeAvailability: (listener: (availability: Availability) => void) => () => void;
13
+ /** The payer's click: open the checkout. The button shows "Processing…" until idle() is called, or until this throws or rejects, so handle errors inside it. */
14
+ onClick: () => void | Promise<void>;
15
+ /** Each availability answer, and `unavailable` when the button doesn't load in time. */
16
+ onStateChange?: (availability: Availability) => void;
17
+ }
18
+ /** What renderButton() returns. */
19
+ export interface RenderedButton {
20
+ /** The checkout the click opened has closed or failed: the button shows its mark again and takes clicks. */
21
+ idle(): void;
22
+ /** Remove the button, and stop listening for it. */
23
+ destroy(): void;
24
+ }
25
+ /** What buttons() needs from its checkout: the frame's origin, the page's language, open(), and the availability answers. */
26
+ export interface ButtonsHost {
27
+ walletUrl: string;
28
+ locale?: string;
29
+ /** Resolves true when the checkout is up, false when it opened nothing that will close (a terminal message instead, or one already open). */
30
+ open(payment: PaymentParams): Promise<boolean>;
31
+ subscribeAvailability(listener: (availability: Availability) => void): () => void;
32
+ }
33
+ /**
34
+ * Draw one served Pybara button in the element (or the first element matching the selector), at the style's height and the element's full width.
35
+ * For callers that drive their own checkout, such as the plugins with their CheckoutModal; a page with Pybara.checkout() uses checkout.buttons().
36
+ */
37
+ export declare function renderButton(container: string | HTMLElement, options: RenderButtonOptions): RenderedButton;
38
+ export declare function createButtons(host: ButtonsHost, options: ButtonsOptions): PybaraButtons;
39
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAe,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAEtH,8HAA8H;AAC9H,MAAM,WAAW,mBAAmB;IAClC,sFAAsF;IACtF,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sHAAsH;IACtH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mHAAmH;IACnH,qBAAqB,EAAE,CAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;IACtF,gKAAgK;IAChK,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,wFAAwF;IACxF,aAAa,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;CACtD;AAED,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,4GAA4G;IAC5G,IAAI,IAAI,IAAI,CAAC;IACb,oDAAoD;IACpD,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,6HAA6H;AAC7H,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6IAA6I;IAC7I,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,qBAAqB,CAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACnF;AAqBD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE,OAAO,EAAE,mBAAmB,GAAG,cAAc,CAgF1G;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,GAAG,aAAa,CAoDvF"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @pybara/pybara-js/button
3
+ *
4
+ * The served Pybara button on its own, for a first-party consumer that drives its own checkout (pybara-for-woocommerce's express checkout, with its CheckoutModal): renderButton() draws it and hands its click to the caller.
5
+ * Its own subpath, so a bundle that only draws the button doesn't take the modal with it.
6
+ * Pages use checkout.buttons() on the package root, built on the same renderButton().
7
+ *
8
+ * @internal Not part of the public API: no compatibility promise between versions, even minor ones.
9
+ */
10
+ export { renderButton, type RenderButtonOptions, type RenderedButton } from './button.js';
11
+ export { type ButtonStyle } from '../types.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/button/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ export { n as renderButton } from "../button-BEOTKYpw.js";
@@ -0,0 +1,127 @@
1
+ /* Pybara.js - pybara.com */
2
+ import { t as e } from "./config-9RX2E1N4.js";
3
+ //#region src/types.ts
4
+ var t = class extends Error {
5
+ constructor(e, t) {
6
+ super(t), this.name = "PybaraError", this.code = e;
7
+ }
8
+ };
9
+ //#endregion
10
+ //#region src/button/button.ts
11
+ function n(e) {
12
+ let t = typeof e?.height == "number" && Number.isFinite(e.height) ? Math.round(e.height) : 45;
13
+ return Math.min(55, Math.max(25, t));
14
+ }
15
+ function r(e, t) {
16
+ return typeof e?.borderRadius == "number" && Number.isFinite(e.borderRadius) && e.borderRadius >= 0 ? `${e.borderRadius}px` : e?.shape === "sharp" ? "0" : e?.shape === "rect" ? "4px" : `${t / 2}px`;
17
+ }
18
+ function i(e) {
19
+ let n = typeof e == "string" ? document.querySelector(e) : e;
20
+ if (!n) throw new t("INVALID_CONFIG", `render(): no element matches ${JSON.stringify(e)}`);
21
+ return n;
22
+ }
23
+ function a(t, a) {
24
+ let o = i(t), s = new URL(a.walletUrl).origin, c = n(a.style), l = document.createElement("div");
25
+ l.style.cssText = `position:relative;width:100%;height:${c}px;`;
26
+ let u = document.createElement("div");
27
+ u.setAttribute("aria-hidden", "true"), u.style.cssText = `position:absolute;inset:0;border-radius:${r(a.style, c)};background:rgba(128,128,128,0.16);`;
28
+ let d = document.createElement("iframe");
29
+ d.src = `${s}/button`, d.title = "Pybara", d.style.cssText = "position:absolute;inset:0;width:100%;height:100%;border:0;opacity:0;color-scheme:normal;background:transparent;", l.append(u, d), o.appendChild(l);
30
+ let f = !1, p = null, m = (e) => {
31
+ d.contentWindow?.postMessage(e, s);
32
+ }, h = () => m({
33
+ type: "pybara_button_idle",
34
+ v: 1
35
+ }), g = (e) => {
36
+ p = e, f && m({
37
+ type: "pybara_button_availability",
38
+ v: 1,
39
+ status: e.status
40
+ }), a.onStateChange?.(e);
41
+ }, _ = setTimeout(() => {
42
+ if (f) return;
43
+ u.remove(), a.hideWhenUnavailable === !0 && (l.style.height = "0px");
44
+ let t = `Pybara: the button (${s}/button) did not load within ${e / 1e3} seconds; pybara.io may be unreachable from this browser.`;
45
+ console.warn(t), a.onStateChange?.({
46
+ status: "unavailable",
47
+ reason: "BUTTON_UNAVAILABLE",
48
+ detail: t
49
+ });
50
+ }, e);
51
+ d.addEventListener("load", () => {
52
+ m({
53
+ type: "pybara_button_init",
54
+ v: 1,
55
+ style: a.style ?? {},
56
+ hideWhenUnavailable: a.hideWhenUnavailable === !0,
57
+ locale: a.locale,
58
+ busy: !0
59
+ });
60
+ }, { once: !0 });
61
+ let v = (e) => {
62
+ if (e.origin !== s || e.source !== d.contentWindow) return;
63
+ let t = e.data;
64
+ t?.type === "pybara_button_ready" || t?.type === "pybara_button_resize" ? (typeof t.height == "number" && (l.style.height = `${t.height}px`), f || (f = !0, clearTimeout(_), d.style.opacity = "1", u.remove(), p && m({
65
+ type: "pybara_button_availability",
66
+ v: 1,
67
+ status: p.status
68
+ }))) : t?.type === "pybara_button_click" && (async () => {
69
+ try {
70
+ await a.onClick();
71
+ } catch {
72
+ h();
73
+ }
74
+ })();
75
+ };
76
+ window.addEventListener("message", v);
77
+ let y = a.subscribeAvailability(g);
78
+ return {
79
+ idle: h,
80
+ destroy() {
81
+ clearTimeout(_), window.removeEventListener("message", v), y(), l.remove();
82
+ }
83
+ };
84
+ }
85
+ function o(e, n) {
86
+ if (typeof n?.createPayment != "function") throw new t("INVALID_CONFIG", "buttons(): \"createPayment\" is required, a function returning the payment from the form, e.g. () => ({ amount: form.amount.value, currency: \"EUR\" })");
87
+ let r = [], i = () => {
88
+ for (let e of r) e.idle();
89
+ };
90
+ async function o() {
91
+ try {
92
+ let t = await n.createPayment();
93
+ await e.open({
94
+ ...t,
95
+ onSuccess: n.onSuccess,
96
+ onError: (e) => {
97
+ i(), n.onError?.(e);
98
+ },
99
+ onClose: () => {
100
+ i(), n.onClose?.();
101
+ }
102
+ }) || i();
103
+ } catch (e) {
104
+ i(), n.onError?.(e instanceof Error ? e : Error(String(e)));
105
+ }
106
+ }
107
+ function s(t) {
108
+ let i = r.length === 0;
109
+ r.push(a(t, {
110
+ walletUrl: e.walletUrl,
111
+ style: n.style,
112
+ hideWhenUnavailable: n.hideWhenUnavailable,
113
+ locale: e.locale,
114
+ subscribeAvailability: e.subscribeAvailability,
115
+ onClick: o,
116
+ onStateChange: i ? n.onStateChange : void 0
117
+ }));
118
+ }
119
+ return {
120
+ render: s,
121
+ destroy() {
122
+ for (let e of r.splice(0)) e.destroy();
123
+ }
124
+ };
125
+ }
126
+ //#endregion
127
+ export { a as n, t as r, o as t };
@@ -1 +1 @@
1
- {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"AAMA,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EAEnB,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,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;IACrC,8FAA8F;IAC9F,OAAO,CAAC,YAAY,CAA8C;IAClE,sGAAsG;IACtG,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAmD;IACzF,gEAAgE;IAChE,OAAO,CAAC,kBAAkB,CAA6B;gBAE3C,UAA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8C;IAClE,sGAAsG;IACtG,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAmD;IACzF,gEAAgE;IAChE,OAAO,CAAC,kBAAkB,CAA6B;gBAE3C,UAAU,EAAE,cAAc;IAQtC;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa;IAqB/C,OAAO,CAAC,gBAAgB;IAKxB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI;YAM9D,YAAY;IAkB1B,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;IAyDzB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAmCnB,6FAA6F;IAC7F,OAAO,CAAC,gBAAgB;CAOzB"}
@@ -0,0 +1,16 @@
1
+ /* Pybara.js - pybara.com */
2
+ //#region src/modal/config.ts
3
+ var e = {
4
+ Z_INDEX: 999999,
5
+ BACKGROUND: "rgba(0, 0, 0, 0.7)"
6
+ }, t = {
7
+ OVERLAY_FADE_IN_MS: 200,
8
+ PANEL_OPEN_MS: 300,
9
+ PANEL_CLOSE_MS: 200,
10
+ OVERLAY_FADE_OUT_DELAY_MS: 50,
11
+ OVERLAY_FADE_OUT_MS: 150,
12
+ RESIZE_MS: 600,
13
+ RESIZE_EASING: ""
14
+ }, n = 15e3;
15
+ //#endregion
16
+ export { t as n, e as r, n as t };
package/dist/index.d.ts CHANGED
@@ -11,5 +11,5 @@ export declare const Pybara: {
11
11
  export { PybaraCheckout } from './checkout';
12
12
  export { type Availability } from './modal/modal';
13
13
  export { type WidgetGate } from './gate';
14
- export { type ButtonPayment, type ButtonsOptions, type CheckoutConfig, type CheckoutResult, type Frequency, type PaymentParams, PybaraError, type PybaraButtons, type PybaraErrorCode, } from './types';
14
+ export { type ButtonPayment, type ButtonsOptions, type ButtonStyle, type CheckoutConfig, type CheckoutResult, type Frequency, type PaymentParams, PybaraError, type PybaraButtons, type PybaraErrorCode, } from './types';
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -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;;;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,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,SAAS,CAAC"}
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,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,SAAS,CAAC"}
@@ -15,5 +15,13 @@ export declare const MODAL_MOTION: {
15
15
  /** The backdrop starts fading this long after the panel, for a layered close. */
16
16
  OVERLAY_FADE_OUT_DELAY_MS: number;
17
17
  OVERLAY_FADE_OUT_MS: number;
18
+ /** The frame's height follows each step: short and decelerating, so a step change settles quickly, as the frame may resize several times per checkout. */
19
+ RESIZE_MS: number;
20
+ RESIZE_EASING: string;
18
21
  };
22
+ /**
23
+ * How long the checkout may take to show its first screen after show(), and a button to report ready after render(), before they are treated as unreachable.
24
+ * The frame is preloaded hidden, so this is usually extra time on top of a load that started long before; a frame that is up answers in about a second.
25
+ */
26
+ export declare const FRAME_LOAD_TIMEOUT_MS = 15000;
19
27
  //# sourceMappingURL=config.d.ts.map
@@ -1 +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"}
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;;;IAGjF,0JAA0J;;;CAG1J,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAQ,CAAC"}
@@ -1 +1 @@
1
- export { t as CheckoutModal, n as EmbeddedError } from "../modal-CvQ7qr5d.js";
1
+ export { t as CheckoutModal, n as EmbeddedError } from "../modal-CXTyI_BA.js";
@@ -182,12 +182,13 @@ export interface Checkout {
182
182
  declare const EMBEDDED_ERROR_CODES: readonly ["DESTINATION_REFUSED", "INVALID_BENEFICIARY", "INVALID_CHECKOUT", "NO_WALLET_AVAILABLE", "RATE_UNAVAILABLE", "SITE_MISMATCH"];
183
183
  type EmbeddedErrorCode = typeof EMBEDDED_ERROR_CODES[number];
184
184
  /**
185
- * The error handed to onError() when the frame refuses.
185
+ * The error handed to onError() when the frame refuses, or when it never loaded.
186
186
  * Carries `.code` so a platform branches on it rather than string-matching `.message`, which may be reworded or localised at any time.
187
+ * FRAME_UNAVAILABLE is this package's own: the checkout showed nothing within FRAME_LOAD_TIMEOUT_MS of show() and the buyer closed the message saying so; the page may offer another payment method.
187
188
  */
188
189
  export declare class EmbeddedError extends Error {
189
- readonly code: EmbeddedErrorCode | 'UNKNOWN';
190
- constructor(code: EmbeddedErrorCode | 'UNKNOWN', message: string);
190
+ readonly code: EmbeddedErrorCode | 'FRAME_UNAVAILABLE' | 'UNKNOWN';
191
+ constructor(code: EmbeddedErrorCode | 'FRAME_UNAVAILABLE' | 'UNKNOWN', message: string);
191
192
  }
192
193
  export declare class CheckoutModal {
193
194
  private config;
@@ -204,11 +205,30 @@ export declare class CheckoutModal {
204
205
  private iframeLoaded;
205
206
  /** Held by show() when it runs before `load`; the `load` handler sends it. */
206
207
  private pendingPaymentData;
208
+ /** The last show()'s data, sent again when the buyer retries a frame that never loaded. */
209
+ private lastPaymentData;
210
+ /** Runs from show() until the frame's first screen; when it fires, the checkout is unreachable (FRAME_LOAD_TIMEOUT_MS). */
211
+ private loadTimer;
212
+ /** The "couldn't load" message, while it is up. */
213
+ private unavailableBox;
207
214
  /** Held by precheck() when it runs before `load`; the `load` handler sends the latest. */
208
215
  private pendingPrecheck;
209
216
  constructor(config: CheckoutModalConfig);
210
217
  /** Backdrop and iframe, built at construction and hidden until open() — see the file header for why. */
211
218
  private createIframe;
219
+ private onIframeLoad;
220
+ private clearLoadTimer;
221
+ /** From show(), until the frame's first screen: no screen within FRAME_LOAD_TIMEOUT_MS means pybara.io could not be reached, and the buyer is told so rather than left with a spinner. */
222
+ private startLoadTimer;
223
+ /**
224
+ * In place of the spinner: the checkout could not load, with Try again (reloading the frame) and Close (which reports FRAME_UNAVAILABLE to onError).
225
+ * In English: the frame, which holds the checkout's twelve languages, is exactly what failed to arrive.
226
+ */
227
+ private renderUnavailable;
228
+ /** Reload the frame and send it the last checkout again, with the spinner back and a fresh timeout. */
229
+ private retryLoad;
230
+ /** The buyer gave up on a frame that never loaded: the modal closes and the page hears why, so it can offer another way to pay. */
231
+ private closeUnavailable;
212
232
  /**
213
233
  * Ask the frame whether a payment would go through right now; the answer arrives on onAvailability.
214
234
  * Send it again whenever the amount changes: the frame answers the latest, at a rate it sets.
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/modal/modal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,MAAM,WAAW,SAAS;IACtB,sJAAsJ;IACtJ,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,IAAI,EAAE,MAAM,CAAC;IACb,+JAA+J;IAC/J,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAChC,yFAAyF;IACzF,SAAS,EAAE,MAAM,CAAC;IAClB,6HAA6H;IAC7H,OAAO,EAAE,SAAS,GAAG,UAAU,CAAC;IAChC,2JAA2J;IAC3J,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kJAAkJ;IAClJ,MAAM,CAAC,EAAE,MAAM,CAAC;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