@movmo/express-checkout-button 1.8.0 → 1.10.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/dist/dts/MovmoCheckoutButton.d.ts +11 -8
- package/dist/dts/umd.d.ts +22 -0
- package/dist/express-checkout.umd.js +36 -0
- package/dist/express-checkout.umd.js.map +1 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +12 -9
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -2
|
@@ -9,14 +9,17 @@ export interface MovmoCheckoutButtonProps {
|
|
|
9
9
|
isProd?: boolean;
|
|
10
10
|
className?: string;
|
|
11
11
|
/**
|
|
12
|
-
* Fires when the traveler exits the Movmo checkout from inside the overlay
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
12
|
+
* Fires when the traveler exits the Movmo checkout from inside the overlay,
|
|
13
|
+
* after the overlay is removed and the page URL is restored to where the
|
|
14
|
+
* checkout was opened. `info.reason` says why: 'booking_confirmed' — the
|
|
15
|
+
* traveler booked successfully and clicked "Return to {airline}" on the
|
|
16
|
+
* confirmation; 'offer_unavailable' — a dead-end screen's exit;
|
|
17
|
+
* 'search_again' — a non-retryable booking failure. Use it to route the
|
|
18
|
+
* traveler onward (e.g. a post-booking landing for 'booking_confirmed',
|
|
19
|
+
* search results otherwise) or record analytics; without it the traveler
|
|
20
|
+
* is simply returned to the page they clicked the button on. Not invoked
|
|
21
|
+
* for browser-back closes, and it does not survive a page refresh inside
|
|
22
|
+
* the checkout.
|
|
20
23
|
*/
|
|
21
24
|
onExit?: (info: MovmoCheckoutExitInfo) => void;
|
|
22
25
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import { MovmoCheckoutButtonProps } from './MovmoCheckoutButton';
|
|
3
|
+
/** Semver of the bundled Express Checkout button. */
|
|
4
|
+
export declare const version: string;
|
|
5
|
+
/** Handle returned by {@link mount} for tearing the button back down. */
|
|
6
|
+
export interface MovmoMountHandle {
|
|
7
|
+
unmount(): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Render the Movmo Express Checkout button into `target` on a non-React page.
|
|
11
|
+
*
|
|
12
|
+
* @param target A CSS selector (resolved via `document.querySelector`) or an
|
|
13
|
+
* existing DOM element to mount into.
|
|
14
|
+
* @param options The same props accepted by the React `<MovmoCheckoutButton>`.
|
|
15
|
+
* @returns A handle whose `unmount()` removes the rendered button. Calling
|
|
16
|
+
* `mount()` again on an already-mounted element returns the SAME
|
|
17
|
+
* handle instead of creating a second root.
|
|
18
|
+
* @throws If `target` is a selector that matches no element, or if a required
|
|
19
|
+
* option (`apiKey`, `iataCode`, `providerID`, and one of
|
|
20
|
+
* `flightOffer`/`flightOfferID`) is missing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function mount(target: string | Element, options: MovmoCheckoutButtonProps): MovmoMountHandle;
|