@movmo/express-checkout-button 0.1.2 → 0.1.4

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
@@ -1,102 +1,102 @@
1
- # Movmo Express Checkout Button
2
-
3
- A React component for integrating Movmo's Express Checkout functionality into airline websites.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @movmo/express-checkout-button
9
- ```
10
-
11
- or
12
-
13
- ```bash
14
- yarn add @movmo/express-checkout-button
15
- ```
16
-
17
- ## Usage
18
-
19
- ### Basic Example
20
-
21
- ```jsx
22
- import React from 'react';
23
- import { MovmoCheckoutButton } from '@movmo/express-checkout-button';
24
- import { DataSource } from '@movmo/express-checkout-button';
25
-
26
- function MyBookingPage() {
27
- // Flight offer data retrieved from your booking system
28
- const flightOffer = {
29
- // Your flight offer data
30
- };
31
-
32
- return (
33
- <div className="booking-page">
34
- <h1>Complete your booking</h1>
35
-
36
- <MovmoCheckoutButton
37
- customerId="your-airline-id"
38
- apiKey="your-movmo-api-key"
39
- dataSource={DataSource.AMADEUS}
40
- flightOffer={flightOffer}
41
- isProd={false} // Set to true for production
42
- />
43
- </div>
44
- );
45
- }
46
-
47
- export default MyBookingPage;
48
- ```
49
-
50
- ## Props
51
-
52
- | Prop | Type | Required | Description |
53
- |------|------|----------|-------------|
54
- | `customerId` | string | Yes | The unique identifier for your airline |
55
- | `apiKey` | string | Yes | Your Movmo API key |
56
- | `dataSource` | DataSource | Yes | The source of flight data (AMADEUS, SABRE) |
57
- | `flightOffer` | object | Yes | The flight offer data object |
58
- | `isProd` | boolean | No | Whether to use production environment (default: false) |
59
-
60
- ## Data Source Options
61
-
62
- ```jsx
63
- import { DataSource } from '@movmo/express-checkout-button';
64
-
65
- // Available options
66
- DataSource.AMADEUS // For Amadeus flight data
67
- ```
68
-
69
- ## Development
70
-
71
- ### Running Storybook
72
-
73
- To run the component in a local development environment with interactive documentation:
74
-
75
- ```bash
76
- # Install dependencies
77
- npm install
78
-
79
- # Start Storybook
80
- npm run storybook
81
- ```
82
-
83
- This will launch Storybook at [http://localhost:6006](http://localhost:6006) where you can explore and interact with the component.
84
-
85
- ### Building the Component
86
-
87
- ```bash
88
- npm run build
89
- ```
90
-
91
- ### Storybook Examples
92
-
93
- The Storybook includes several examples:
94
-
95
- 1. **Default**: Standard implementation of the checkout button
96
- 2. **Development Environment**: Example configured for development environment
97
- 3. **Production Environment**: Example configured for production environment
98
- 4. **Custom-Styled Button**: Example showing how to create a custom styled button
99
-
100
- ## License
101
-
102
- MIT
1
+ # Movmo Express Checkout Button
2
+
3
+ A React component for integrating Movmo's Express Checkout functionality into airline websites.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @movmo/express-checkout-button
9
+ ```
10
+
11
+ or
12
+
13
+ ```bash
14
+ yarn add @movmo/express-checkout-button
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ### Basic Example
20
+
21
+ ```jsx
22
+ import React from 'react';
23
+ import { MovmoCheckoutButton } from '@movmo/express-checkout-button';
24
+ import { DataSource } from '@movmo/express-checkout-button';
25
+
26
+ function MyBookingPage() {
27
+ // Flight offer data retrieved from your booking system
28
+ const flightOffer = {
29
+ // Your flight offer data
30
+ };
31
+
32
+ return (
33
+ <div className="booking-page">
34
+ <h1>Complete your booking</h1>
35
+
36
+ <MovmoCheckoutButton
37
+ customerId="your-airline-id"
38
+ apiKey="your-movmo-api-key"
39
+ dataSource={DataSource.AMADEUS}
40
+ flightOffer={flightOffer}
41
+ isProd={false} // Set to true for production
42
+ />
43
+ </div>
44
+ );
45
+ }
46
+
47
+ export default MyBookingPage;
48
+ ```
49
+
50
+ ## Props
51
+
52
+ | Prop | Type | Required | Description |
53
+ |------|------|----------|-------------|
54
+ | `customerId` | string | Yes | The unique identifier for your airline |
55
+ | `apiKey` | string | Yes | Your Movmo API key |
56
+ | `dataSource` | DataSource | Yes | The source of flight data (AMADEUS, SABRE) |
57
+ | `flightOffer` | object | Yes | The flight offer data object |
58
+ | `isProd` | boolean | No | Whether to use production environment (default: false) |
59
+
60
+ ## Data Source Options
61
+
62
+ ```jsx
63
+ import { DataSource } from '@movmo/express-checkout-button';
64
+
65
+ // Available options
66
+ DataSource.AMADEUS // For Amadeus flight data
67
+ ```
68
+
69
+ ## Development
70
+
71
+ ### Running Storybook
72
+
73
+ To run the component in a local development environment with interactive documentation:
74
+
75
+ ```bash
76
+ # Install dependencies
77
+ npm install
78
+
79
+ # Start Storybook
80
+ npm run storybook
81
+ ```
82
+
83
+ This will launch Storybook at [http://localhost:6006](http://localhost:6006) where you can explore and interact with the component.
84
+
85
+ ### Building the Component
86
+
87
+ ```bash
88
+ npm run build
89
+ ```
90
+
91
+ ### Storybook Examples
92
+
93
+ The Storybook includes several examples:
94
+
95
+ 1. **Default**: Standard implementation of the checkout button
96
+ 2. **Development Environment**: Example configured for development environment
97
+ 3. **Production Environment**: Example configured for production environment
98
+ 4. **Custom-Styled Button**: Example showing how to create a custom styled button
99
+
100
+ ## License
101
+
102
+ MIT
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
- import { DataSource } from './api';
3
2
  interface MovmoCheckoutButtonProps {
4
3
  customerId: string;
5
4
  apiKey: string;
6
- dataSource: DataSource;
5
+ dataSource: "amadeus" | "sabre";
7
6
  flightOffer: object;
8
7
  isProd?: boolean;
9
8
  }
package/dist/dts/api.d.ts CHANGED
@@ -1,10 +1,7 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  export declare const createAxiosClient: (apiKey: string, isProd?: boolean) => AxiosInstance;
3
- export declare enum DataSource {
4
- AMADEUS = "amadeus"
5
- }
6
3
  export interface FlightOfferRequest {
7
- dataSource: DataSource;
4
+ dataSource: string;
8
5
  rawOffer: object;
9
6
  }
10
7
  export declare const saveFlightOffer: (payload: FlightOfferRequest, client: AxiosInstance) => Promise<string | null>;
@@ -1,3 +1 @@
1
- import { DataSource } from './api';
2
- export { DataSource };
3
1
  export { MovmoCheckoutButton } from './MovmoCheckoutButton';
package/dist/index.cjs.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @movmo/express-checkout-button v0.1.2
2
+ * @movmo/express-checkout-button v0.1.4
3
3
  * React component plugin for embedding Movmo Express Checkout on airline websites.
4
4
  * (c) 2025 Movmo
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("axios"),t=require("react/jsx-runtime"),n=require("react");exports.DataSource=void 0,(exports.DataSource||(exports.DataSource={})).AMADEUS="amadeus";function o(e){if(document.getElementById("movmo-checkout"))return;const t=document.createElement("div");t.id="movmo-checkout",t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n ",t.innerHTML=`\n <iframe \n src="https://booking.e2e.movmo.io/booking?${e}"\n width="100%" \n height="100%" \n style="border: none;">\n </iframe>\n `,document.body.appendChild(t)}window.addEventListener("popstate",(()=>{const e=document.getElementById("movmo-checkout");!window.history.state?.checkoutOpen&&e&&e.remove()})),window.addEventListener("DOMContentLoaded",(()=>{if(window.location.pathname.startsWith("/movmo/checkout")){const e=window.location.search.substring(1);window.history.replaceState({checkoutOpen:!0},"",window.location.href),o(e)}}));!function(){if("undefined"!=typeof document){const e=document.createElement("link");e.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",e.rel="stylesheet",document.head.appendChild(e)}}(),exports.MovmoCheckoutButton=({customerId:i,apiKey:r,dataSource:a,flightOffer:s,isProd:c=!1})=>{const[d,u]=n.useState(!1),h=((t,n=!1)=>{const o=n?"https://api.movmo.io":"https://e2e.api.movmo.io";return e.create({baseURL:o,headers:{Accept:"application/json","Content-Type":"application/json","x-api-key":t},withCredentials:!0,timeout:3e4})})(r,c),m=`\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${d?"bg-gradient-hover":"bg-gradient-normal"}\n `.trim(),p="\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n ".trim();return t.jsxs("button",{onClick:async()=>{const e={dataSource:a,rawOffer:s},t=await(async(e,t)=>await t.post("/v1/flight_offers",e).then((e=>e.data.id)).catch((e=>null)))(e,h);if(!t)return;const n=new URLSearchParams({offerId:t,airlineRef:i}).toString();window.history.pushState({checkoutOpen:!0},"",`/movmo/checkout?${n}`),o(n)},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:m,children:["Express Checkout",t.jsx("span",{className:p,children:"Movmo"})]})};
7
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("axios");function o(e){if(document.getElementById("movmo-checkout"))return;const t=document.createElement("div");t.id="movmo-checkout",t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n ",t.innerHTML=`\n <iframe \n src="https://booking.e2e.movmo.io/booking?${e}"\n width="100%" \n height="100%" \n style="border: none;">\n </iframe>\n `,document.body.appendChild(t)}window.addEventListener("popstate",(()=>{const e=document.getElementById("movmo-checkout");!window.history.state?.checkoutOpen&&e&&e.remove()})),window.addEventListener("DOMContentLoaded",(()=>{if(window.location.pathname.startsWith("/movmo/checkout")){const e=window.location.search.substring(1);window.history.replaceState({checkoutOpen:!0},"",window.location.href),o(e)}}));!function(){if("undefined"!=typeof document){const e=document.createElement("link");e.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",e.rel="stylesheet",document.head.appendChild(e)}}(),exports.MovmoCheckoutButton=({customerId:i,apiKey:r,dataSource:a,flightOffer:s,isProd:c=!1})=>{const[d,u]=t.useState(!1),h=((e,t=!1)=>{const o=t?"https://api.movmo.io":"https://e2e.api.movmo.io";return n.create({baseURL:o,headers:{Accept:"application/json","Content-Type":"application/json","x-api-key":e},withCredentials:!0,timeout:3e4})})(r,c),m=`\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${d?"bg-gradient-hover":"bg-gradient-normal"}\n `.trim(),p="\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n ".trim();return e.jsxs("button",{onClick:async()=>{const e={dataSource:a,rawOffer:s},t=await(async(e,t)=>await t.post("/v1/flight_offers",e).then((e=>e.data.id)).catch((e=>null)))(e,h);if(!t)return;const n=new URLSearchParams({offerId:t,airlineRef:i}).toString();window.history.pushState({checkoutOpen:!0},"",`/movmo/checkout?${n}`),o(n)},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:m,children:["Express Checkout",e.jsx("span",{className:p,children:"Movmo"})]})};
8
8
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/api.ts","../src/MovmoCheckoutOverlay.tsx","../src/index.ts","../src/MovmoCheckoutButton.tsx"],"sourcesContent":[null,null,null,null],"names":["DataSource","showMovmoOverlay","queryParams","document","getElementById","container","createElement","id","style","cssText","innerHTML","body","appendChild","window","addEventListener","history","state","checkoutOpen","remove","location","pathname","startsWith","search","substring","replaceState","href","link","rel","head","loadInterFont","customerId","apiKey","dataSource","flightOffer","isProd","isHovered","setIsHovered","useState","client","baseUrl","axios","create","baseURL","headers","Accept","withCredentials","timeout","createAxiosClient","buttonClasses","trim","badgeClasses","_jsxs","onClick","async","payload","rawOffer","offerId","post","then","res","data","catch","err","saveFlightOffer","URLSearchParams","airlineRef","toString","pushState","onMouseEnter","onMouseLeave","className","children","_jsx"],"mappings":";;;;;;sFAqBYA,QAAAA,gBAAAA,GAAAA,QAAUA,aAAVA,mBAEX,CAAA,IADG,QAAA,UCtBE,SAAUC,EAAiBC,GAC7B,GAAIC,SAASC,eAAe,kBAAmB,OAE/C,MAAMC,EAAYF,SAASG,cAAc,OACzCD,EAAUE,GAAK,iBACfF,EAAUG,MAAMC,QAAU,yKAU1BJ,EAAUK,UAAY,6EAE8BR,yHAOpDC,SAASQ,KAAKC,YAAYP,EAC9B,CAGAQ,OAAOC,iBAAiB,YAAY,KAChC,MAAMT,EAAYF,SAASC,eAAe,mBACrCS,OAAOE,QAAQC,OAAOC,cAAgBZ,GACvCA,EAAUa,YAKlBL,OAAOC,iBAAiB,oBAAoB,KAExC,GADoBD,OAAOM,SAASC,SAASC,WAAW,mBACvC,CACb,MAAMnB,EAAcW,OAAOM,SAASG,OAAOC,UAAU,GACrDV,OAAOE,QAAQS,aAAa,CAAEP,cAAc,GAAQ,GAAIJ,OAAOM,SAASM,MACxExB,EAAiBC,QCzCzB,WACI,GAAwB,oBAAbC,SAA0B,CACjC,MAAMuB,EAAOvB,SAASG,cAAc,QACpCoB,EAAKD,KAAO,mFACZC,EAAKC,IAAM,aACXxB,SAASyB,KAAKhB,YAAYc,GAElC,CAEAG,+BCKuE,EACnEC,aACAC,SACAC,aACAC,cACAC,UAAS,MAET,MAAOC,EAAWC,GAAgBC,EAAAA,UAAS,GACrCC,EHnBuB,EAACP,EAAgBG,GAAkB,KAChE,MAAMK,EAAUL,EAAS,uBAAyB,2BAclD,OAZeM,EAAMC,OAAO,CACxBC,QAASH,EACTI,QAAS,CACLC,OAAQ,mBACR,eAAgB,mBAChB,YAAab,GAGjBc,iBAAiB,EACjBC,QAAS,KAGA,EGIEC,CAAkBhB,EAAQG,GAsBnCc,EAAgB,sRAShBb,EAAY,oBAAsB,6BACtCc,OAEIC,EAAe,mHAMnBD,OAEF,OACIE,OACI,SAAA,CAAAC,QA1CYC,UAChB,MAAMC,EAA8B,CAChCtB,aACAuB,SAAUtB,GAERuB,OHEiBH,OAAOC,EAA6BhB,UAClDA,EAAOmB,KAAK,oBAAqBH,GACzCI,MAAMC,GAAQA,EAAIC,KAAKrD,KACvBsD,OAAOC,GAEG,OGPWC,CAAgBT,EAAShB,GAC/C,IAAKkB,EAED,OAGJ,MAAMtD,EAAc,IAAI8D,gBAAgB,CACpCR,UACAS,WAAYnC,IACboC,WAEHrD,OAAOE,QAAQoD,UAAU,CAAElD,cAAc,GAAQ,GAAI,mBAAmBf,KACxED,EAAiBC,EAAY,EA0BzBkE,aAAc,IAAMhC,GAAa,GACjCiC,aAAc,IAAMjC,GAAa,GACjCkC,UAAWtB,EAAauB,SAAA,CAAA,mBAGxBC,cAAMF,UAAWpB,EAEVqB,SAAA,YACF"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/MovmoCheckoutOverlay.tsx","../src/index.ts","../src/MovmoCheckoutButton.tsx","../src/api.ts"],"sourcesContent":["export function showMovmoOverlay(queryParams: string) {\r\n if (document.getElementById('movmo-checkout')) return;\r\n\r\n const container = document.createElement('div');\r\n container.id = 'movmo-checkout';\r\n container.style.cssText = `\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100vw;\r\n height: 100vh;\r\n background: white;\r\n z-index: 9999;\r\n `;\r\n\r\n container.innerHTML = `\r\n <iframe \r\n src=\"https://booking.e2e.movmo.io/booking?${queryParams}\"\r\n width=\"100%\" \r\n height=\"100%\" \r\n style=\"border: none;\">\r\n </iframe>\r\n `;\r\n\r\n document.body.appendChild(container);\r\n}\r\n\r\n// Clean up when back button is used\r\nwindow.addEventListener('popstate', () => {\r\n const container = document.getElementById('movmo-checkout');\r\n if (!window.history.state?.checkoutOpen && container) {\r\n container.remove();\r\n }\r\n});\r\n\r\n// Show overlay again if loaded directly\r\nwindow.addEventListener('DOMContentLoaded', () => {\r\n const isMovmoPath = window.location.pathname.startsWith('/movmo/checkout');\r\n if (isMovmoPath) {\r\n const queryParams = window.location.search.substring(1);\r\n window.history.replaceState({ checkoutOpen: true }, '', window.location.href);\r\n showMovmoOverlay(queryParams);\r\n }\r\n});\r\n","function loadInterFont() {\r\n if (typeof document !== 'undefined') {\r\n const link = document.createElement('link');\r\n link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap';\r\n link.rel = 'stylesheet';\r\n document.head.appendChild(link);\r\n }\r\n}\r\n\r\nloadInterFont();\r\n\r\n// Export components\r\nexport { MovmoCheckoutButton } from './MovmoCheckoutButton';\r\n","import React, { useState } from 'react';\r\n\r\nimport { createAxiosClient, FlightOfferRequest, saveFlightOffer } from './api';\r\nimport { showMovmoOverlay } from './MovmoCheckoutOverlay';\r\n\r\ninterface MovmoCheckoutButtonProps {\r\n customerId: string;\r\n apiKey: string;\r\n dataSource: \"amadeus\" | \"sabre\";\r\n // TODO: support fare splitting\r\n flightOffer: object;\r\n isProd?: boolean;\r\n}\r\n\r\nexport const MovmoCheckoutButton: React.FC<MovmoCheckoutButtonProps> = ({\r\n customerId,\r\n apiKey,\r\n dataSource,\r\n flightOffer,\r\n isProd = false,\r\n}) => {\r\n const [isHovered, setIsHovered] = useState(false);\r\n const client = createAxiosClient(apiKey, isProd);\r\n\r\n const handleClick = async () => {\r\n const payload: FlightOfferRequest = {\r\n dataSource,\r\n rawOffer: flightOffer,\r\n };\r\n const offerId = await saveFlightOffer(payload, client);\r\n if (!offerId) {\r\n // TODO: handle error by displaying a message to the user\r\n return;\r\n }\r\n\r\n const queryParams = new URLSearchParams({\r\n offerId,\r\n airlineRef: customerId,\r\n }).toString();\r\n\r\n window.history.pushState({ checkoutOpen: true }, '', `/movmo/checkout?${queryParams}`);\r\n showMovmoOverlay(queryParams);\r\n };\r\n\r\n const buttonClasses = `\r\n px-7 py-5 \r\n font-inter font-semibold text-lg \r\n rounded-xl \r\n text-white \r\n border-none\r\n cursor-pointer\r\n transition-all duration-200\r\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\r\n ${isHovered ? 'bg-gradient-hover' : 'bg-gradient-normal'}\r\n `.trim();\r\n\r\n const badgeClasses = `\r\n ml-2 px-2 py-1\r\n bg-white \r\n text-[#171412] \r\n rounded-md \r\n text-lg\r\n `.trim();\r\n\r\n return (\r\n <button\r\n onClick={handleClick}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n className={buttonClasses}\r\n >\r\n Express Checkout\r\n <span className={badgeClasses}>\r\n Movmo\r\n </span>\r\n </button>\r\n );\r\n};\r\n","import axios, { AxiosInstance } from \"axios\";\r\n\r\n\r\nexport const createAxiosClient = (apiKey: string, isProd: boolean = false) => {\r\n const baseUrl = isProd ? \"https://api.movmo.io\" : \"https://e2e.api.movmo.io\";\r\n\r\n const client = axios.create({\r\n baseURL: baseUrl,\r\n headers: {\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n \"x-api-key\": apiKey,\r\n },\r\n // Allow cookies to be sent with requests\r\n withCredentials: true,\r\n timeout: 30000,\r\n });\r\n\r\n return client;\r\n};\r\n\r\nexport interface FlightOfferRequest {\r\n dataSource: string;\r\n // The raw offer object from the data source; does not currently support fare splitting\r\n rawOffer: object;\r\n}\r\n\r\nexport const saveFlightOffer = async (payload: FlightOfferRequest, client: AxiosInstance): Promise<string | null> => {\r\n return await client.post(\"/v1/flight_offers\", payload)\r\n .then((res) => res.data.id)\r\n .catch((err) => {\r\n console.error(err);\r\n return null;\r\n });\r\n};\r\n"],"names":["showMovmoOverlay","queryParams","document","getElementById","container","createElement","id","style","cssText","innerHTML","body","appendChild","window","addEventListener","history","state","checkoutOpen","remove","location","pathname","startsWith","search","substring","replaceState","href","link","rel","head","loadInterFont","customerId","apiKey","dataSource","flightOffer","isProd","isHovered","setIsHovered","useState","client","baseUrl","axios","create","baseURL","headers","Accept","withCredentials","timeout","createAxiosClient","buttonClasses","trim","badgeClasses","_jsxs","onClick","async","payload","rawOffer","offerId","post","then","res","data","catch","err","saveFlightOffer","URLSearchParams","airlineRef","toString","pushState","onMouseEnter","onMouseLeave","className","children","_jsx"],"mappings":";;;;;;sFAAM,SAAUA,EAAiBC,GAC7B,GAAIC,SAASC,eAAe,kBAAmB,OAE/C,MAAMC,EAAYF,SAASG,cAAc,OACzCD,EAAUE,GAAK,iBACfF,EAAUG,MAAMC,QAAU,yKAU1BJ,EAAUK,UAAY,6EAE8BR,yHAOpDC,SAASQ,KAAKC,YAAYP,EAC9B,CAGAQ,OAAOC,iBAAiB,YAAY,KAChC,MAAMT,EAAYF,SAASC,eAAe,mBACrCS,OAAOE,QAAQC,OAAOC,cAAgBZ,GACvCA,EAAUa,YAKlBL,OAAOC,iBAAiB,oBAAoB,KAExC,GADoBD,OAAOM,SAASC,SAASC,WAAW,mBACvC,CACb,MAAMnB,EAAcW,OAAOM,SAASG,OAAOC,UAAU,GACrDV,OAAOE,QAAQS,aAAa,CAAEP,cAAc,GAAQ,GAAIJ,OAAOM,SAASM,MACxExB,EAAiBC,QCzCzB,WACI,GAAwB,oBAAbC,SAA0B,CACjC,MAAMuB,EAAOvB,SAASG,cAAc,QACpCoB,EAAKD,KAAO,mFACZC,EAAKC,IAAM,aACXxB,SAASyB,KAAKhB,YAAYc,GAElC,CAEAG,+BCKuE,EACnEC,aACAC,SACAC,aACAC,cACAC,UAAS,MAET,MAAOC,EAAWC,GAAgBC,EAAAA,UAAS,GACrCC,ECnBuB,EAACP,EAAgBG,GAAkB,KAChE,MAAMK,EAAUL,EAAS,uBAAyB,2BAclD,OAZeM,EAAMC,OAAO,CACxBC,QAASH,EACTI,QAAS,CACLC,OAAQ,mBACR,eAAgB,mBAChB,YAAab,GAGjBc,iBAAiB,EACjBC,QAAS,KAGA,EDIEC,CAAkBhB,EAAQG,GAsBnCc,EAAgB,sRAShBb,EAAY,oBAAsB,6BACtCc,OAEIC,EAAe,mHAMnBD,OAEF,OACIE,OACI,SAAA,CAAAC,QA1CYC,UAChB,MAAMC,EAA8B,CAChCtB,aACAuB,SAAUtB,GAERuB,OCFiBH,OAAOC,EAA6BhB,UAClDA,EAAOmB,KAAK,oBAAqBH,GACzCI,MAAMC,GAAQA,EAAIC,KAAKrD,KACvBsD,OAAOC,GAEG,ODHWC,CAAgBT,EAAShB,GAC/C,IAAKkB,EAED,OAGJ,MAAMtD,EAAc,IAAI8D,gBAAgB,CACpCR,UACAS,WAAYnC,IACboC,WAEHrD,OAAOE,QAAQoD,UAAU,CAAElD,cAAc,GAAQ,GAAI,mBAAmBf,KACxED,EAAiBC,EAAY,EA0BzBkE,aAAc,IAAMhC,GAAa,GACjCiC,aAAc,IAAMjC,GAAa,GACjCkC,UAAWtB,EAAauB,SAAA,CAAA,mBAGxBC,cAAMF,UAAWpB,EAEVqB,SAAA,YACF"}
package/dist/index.d.ts CHANGED
@@ -1,22 +1,18 @@
1
1
  /**
2
- * @movmo/express-checkout-button v0.1.2
2
+ * @movmo/express-checkout-button v0.1.4
3
3
  * React component plugin for embedding Movmo Express Checkout on airline websites.
4
4
  * (c) 2025 Movmo
5
5
  * @license MIT
6
6
  */
7
7
  import React from 'react';
8
8
 
9
- declare enum DataSource {
10
- AMADEUS = "amadeus"
11
- }
12
-
13
9
  interface MovmoCheckoutButtonProps {
14
10
  customerId: string;
15
11
  apiKey: string;
16
- dataSource: DataSource;
12
+ dataSource: "amadeus" | "sabre";
17
13
  flightOffer: object;
18
14
  isProd?: boolean;
19
15
  }
20
16
  declare const MovmoCheckoutButton: React.FC<MovmoCheckoutButtonProps>;
21
17
 
22
- export { DataSource, MovmoCheckoutButton };
18
+ export { MovmoCheckoutButton };
package/dist/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @movmo/express-checkout-button v0.1.2
2
+ * @movmo/express-checkout-button v0.1.4
3
3
  * React component plugin for embedding Movmo Express Checkout on airline websites.
4
4
  * (c) 2025 Movmo
5
5
  * @license MIT
6
6
  */
7
- import e from"axios";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as o}from"react";var i;!function(e){e.AMADEUS="amadeus"}(i||(i={}));function r(e){if(document.getElementById("movmo-checkout"))return;const t=document.createElement("div");t.id="movmo-checkout",t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n ",t.innerHTML=`\n <iframe \n src="https://booking.e2e.movmo.io/booking?${e}"\n width="100%" \n height="100%" \n style="border: none;">\n </iframe>\n `,document.body.appendChild(t)}window.addEventListener("popstate",(()=>{const e=document.getElementById("movmo-checkout");!window.history.state?.checkoutOpen&&e&&e.remove()})),window.addEventListener("DOMContentLoaded",(()=>{if(window.location.pathname.startsWith("/movmo/checkout")){const e=window.location.search.substring(1);window.history.replaceState({checkoutOpen:!0},"",window.location.href),r(e)}}));const a=({customerId:i,apiKey:a,dataSource:c,flightOffer:s,isProd:d=!1})=>{const[m,h]=o(!1),p=((t,n=!1)=>{const o=n?"https://api.movmo.io":"https://e2e.api.movmo.io";return e.create({baseURL:o,headers:{Accept:"application/json","Content-Type":"application/json","x-api-key":t},withCredentials:!0,timeout:3e4})})(a,d),u=`\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${m?"bg-gradient-hover":"bg-gradient-normal"}\n `.trim(),l="\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n ".trim();return t("button",{onClick:async()=>{const e={dataSource:c,rawOffer:s},t=await(async(e,t)=>await t.post("/v1/flight_offers",e).then((e=>e.data.id)).catch((e=>null)))(e,p);if(!t)return;const n=new URLSearchParams({offerId:t,airlineRef:i}).toString();window.history.pushState({checkoutOpen:!0},"",`/movmo/checkout?${n}`),r(n)},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),className:u,children:["Express Checkout",n("span",{className:l,children:"Movmo"})]})};!function(){if("undefined"!=typeof document){const e=document.createElement("link");e.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",e.rel="stylesheet",document.head.appendChild(e)}}();export{i as DataSource,a as MovmoCheckoutButton};
7
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import o from"axios";function i(e){if(document.getElementById("movmo-checkout"))return;const t=document.createElement("div");t.id="movmo-checkout",t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: white;\n z-index: 9999;\n ",t.innerHTML=`\n <iframe \n src="https://booking.e2e.movmo.io/booking?${e}"\n width="100%" \n height="100%" \n style="border: none;">\n </iframe>\n `,document.body.appendChild(t)}window.addEventListener("popstate",(()=>{const e=document.getElementById("movmo-checkout");!window.history.state?.checkoutOpen&&e&&e.remove()})),window.addEventListener("DOMContentLoaded",(()=>{if(window.location.pathname.startsWith("/movmo/checkout")){const e=window.location.search.substring(1);window.history.replaceState({checkoutOpen:!0},"",window.location.href),i(e)}}));const r=({customerId:r,apiKey:a,dataSource:c,flightOffer:s,isProd:d=!1})=>{const[m,h]=n(!1),p=((e,t=!1)=>{const n=t?"https://api.movmo.io":"https://e2e.api.movmo.io";return o.create({baseURL:n,headers:{Accept:"application/json","Content-Type":"application/json","x-api-key":e},withCredentials:!0,timeout:3e4})})(a,d),u=`\n px-7 py-5 \n font-inter font-semibold text-lg \n rounded-xl \n text-white \n border-none\n cursor-pointer\n transition-all duration-200\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\n ${m?"bg-gradient-hover":"bg-gradient-normal"}\n `.trim(),l="\n ml-2 px-2 py-1\n bg-white \n text-[#171412] \n rounded-md \n text-lg\n ".trim();return e("button",{onClick:async()=>{const e={dataSource:c,rawOffer:s},t=await(async(e,t)=>await t.post("/v1/flight_offers",e).then((e=>e.data.id)).catch((e=>null)))(e,p);if(!t)return;const n=new URLSearchParams({offerId:t,airlineRef:r}).toString();window.history.pushState({checkoutOpen:!0},"",`/movmo/checkout?${n}`),i(n)},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),className:u,children:["Express Checkout",t("span",{className:l,children:"Movmo"})]})};!function(){if("undefined"!=typeof document){const e=document.createElement("link");e.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",e.rel="stylesheet",document.head.appendChild(e)}}();export{r as MovmoCheckoutButton};
8
8
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/api.ts","../src/MovmoCheckoutOverlay.tsx","../src/MovmoCheckoutButton.tsx","../src/index.ts"],"sourcesContent":[null,null,null,null],"names":["DataSource","showMovmoOverlay","queryParams","document","getElementById","container","createElement","id","style","cssText","innerHTML","body","appendChild","window","addEventListener","history","state","checkoutOpen","remove","location","pathname","startsWith","search","substring","replaceState","href","MovmoCheckoutButton","customerId","apiKey","dataSource","flightOffer","isProd","isHovered","setIsHovered","useState","client","baseUrl","axios","create","baseURL","headers","Accept","withCredentials","timeout","createAxiosClient","buttonClasses","trim","badgeClasses","_jsxs","onClick","async","payload","rawOffer","offerId","post","then","res","data","catch","err","saveFlightOffer","URLSearchParams","airlineRef","toString","pushState","onMouseEnter","onMouseLeave","className","children","_jsx","link","rel","head","loadInterFont"],"mappings":";;;;;;4GAqBYA,GAAZ,SAAYA,GACRA,EAAA,QAAA,SACH,CAFD,CAAYA,IAAAA,EAEX,CAAA,ICvBK,SAAUC,EAAiBC,GAC7B,GAAIC,SAASC,eAAe,kBAAmB,OAE/C,MAAMC,EAAYF,SAASG,cAAc,OACzCD,EAAUE,GAAK,iBACfF,EAAUG,MAAMC,QAAU,yKAU1BJ,EAAUK,UAAY,6EAE8BR,yHAOpDC,SAASQ,KAAKC,YAAYP,EAC9B,CAGAQ,OAAOC,iBAAiB,YAAY,KAChC,MAAMT,EAAYF,SAASC,eAAe,mBACrCS,OAAOE,QAAQC,OAAOC,cAAgBZ,GACvCA,EAAUa,YAKlBL,OAAOC,iBAAiB,oBAAoB,KAExC,GADoBD,OAAOM,SAASC,SAASC,WAAW,mBACvC,CACb,MAAMnB,EAAcW,OAAOM,SAASG,OAAOC,UAAU,GACrDV,OAAOE,QAAQS,aAAa,CAAEP,cAAc,GAAQ,GAAIJ,OAAOM,SAASM,MACxExB,EAAiBC,OC3BZ,MAAAwB,EAA0D,EACnEC,aACAC,SACAC,aACAC,cACAC,UAAS,MAET,MAAOC,EAAWC,GAAgBC,GAAS,GACrCC,EFnBuB,EAACP,EAAgBG,GAAkB,KAChE,MAAMK,EAAUL,EAAS,uBAAyB,2BAclD,OAZeM,EAAMC,OAAO,CACxBC,QAASH,EACTI,QAAS,CACLC,OAAQ,mBACR,eAAgB,mBAChB,YAAab,GAGjBc,iBAAiB,EACjBC,QAAS,KAGA,EEIEC,CAAkBhB,EAAQG,GAsBnCc,EAAgB,sRAShBb,EAAY,oBAAsB,6BACtCc,OAEIC,EAAe,mHAMnBD,OAEF,OACIE,EACI,SAAA,CAAAC,QA1CYC,UAChB,MAAMC,EAA8B,CAChCtB,aACAuB,SAAUtB,GAERuB,OFEiBH,OAAOC,EAA6BhB,UAClDA,EAAOmB,KAAK,oBAAqBH,GACzCI,MAAMC,GAAQA,EAAIC,KAAKlD,KACvBmD,OAAOC,GAEG,OEPWC,CAAgBT,EAAShB,GAC/C,IAAKkB,EAED,OAGJ,MAAMnD,EAAc,IAAI2D,gBAAgB,CACpCR,UACAS,WAAYnC,IACboC,WAEHlD,OAAOE,QAAQiD,UAAU,CAAE/C,cAAc,GAAQ,GAAI,mBAAmBf,KACxED,EAAiBC,EAAY,EA0BzB+D,aAAc,IAAMhC,GAAa,GACjCiC,aAAc,IAAMjC,GAAa,GACjCkC,UAAWtB,EAAauB,SAAA,CAAA,mBAGxBC,UAAMF,UAAWpB,EAEVqB,SAAA,YACF,GC3EjB,WACI,GAAwB,oBAAbjE,SAA0B,CACjC,MAAMmE,EAAOnE,SAASG,cAAc,QACpCgE,EAAK7C,KAAO,mFACZ6C,EAAKC,IAAM,aACXpE,SAASqE,KAAK5D,YAAY0D,GAElC,CAEAG"}
1
+ {"version":3,"file":"index.es.js","sources":["../src/MovmoCheckoutOverlay.tsx","../src/MovmoCheckoutButton.tsx","../src/api.ts","../src/index.ts"],"sourcesContent":["export function showMovmoOverlay(queryParams: string) {\r\n if (document.getElementById('movmo-checkout')) return;\r\n\r\n const container = document.createElement('div');\r\n container.id = 'movmo-checkout';\r\n container.style.cssText = `\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100vw;\r\n height: 100vh;\r\n background: white;\r\n z-index: 9999;\r\n `;\r\n\r\n container.innerHTML = `\r\n <iframe \r\n src=\"https://booking.e2e.movmo.io/booking?${queryParams}\"\r\n width=\"100%\" \r\n height=\"100%\" \r\n style=\"border: none;\">\r\n </iframe>\r\n `;\r\n\r\n document.body.appendChild(container);\r\n}\r\n\r\n// Clean up when back button is used\r\nwindow.addEventListener('popstate', () => {\r\n const container = document.getElementById('movmo-checkout');\r\n if (!window.history.state?.checkoutOpen && container) {\r\n container.remove();\r\n }\r\n});\r\n\r\n// Show overlay again if loaded directly\r\nwindow.addEventListener('DOMContentLoaded', () => {\r\n const isMovmoPath = window.location.pathname.startsWith('/movmo/checkout');\r\n if (isMovmoPath) {\r\n const queryParams = window.location.search.substring(1);\r\n window.history.replaceState({ checkoutOpen: true }, '', window.location.href);\r\n showMovmoOverlay(queryParams);\r\n }\r\n});\r\n","import React, { useState } from 'react';\r\n\r\nimport { createAxiosClient, FlightOfferRequest, saveFlightOffer } from './api';\r\nimport { showMovmoOverlay } from './MovmoCheckoutOverlay';\r\n\r\ninterface MovmoCheckoutButtonProps {\r\n customerId: string;\r\n apiKey: string;\r\n dataSource: \"amadeus\" | \"sabre\";\r\n // TODO: support fare splitting\r\n flightOffer: object;\r\n isProd?: boolean;\r\n}\r\n\r\nexport const MovmoCheckoutButton: React.FC<MovmoCheckoutButtonProps> = ({\r\n customerId,\r\n apiKey,\r\n dataSource,\r\n flightOffer,\r\n isProd = false,\r\n}) => {\r\n const [isHovered, setIsHovered] = useState(false);\r\n const client = createAxiosClient(apiKey, isProd);\r\n\r\n const handleClick = async () => {\r\n const payload: FlightOfferRequest = {\r\n dataSource,\r\n rawOffer: flightOffer,\r\n };\r\n const offerId = await saveFlightOffer(payload, client);\r\n if (!offerId) {\r\n // TODO: handle error by displaying a message to the user\r\n return;\r\n }\r\n\r\n const queryParams = new URLSearchParams({\r\n offerId,\r\n airlineRef: customerId,\r\n }).toString();\r\n\r\n window.history.pushState({ checkoutOpen: true }, '', `/movmo/checkout?${queryParams}`);\r\n showMovmoOverlay(queryParams);\r\n };\r\n\r\n const buttonClasses = `\r\n px-7 py-5 \r\n font-inter font-semibold text-lg \r\n rounded-xl \r\n text-white \r\n border-none\r\n cursor-pointer\r\n transition-all duration-200\r\n outline-none focus:ring-2 focus:ring-[#F63D68] focus:ring-opacity-50\r\n ${isHovered ? 'bg-gradient-hover' : 'bg-gradient-normal'}\r\n `.trim();\r\n\r\n const badgeClasses = `\r\n ml-2 px-2 py-1\r\n bg-white \r\n text-[#171412] \r\n rounded-md \r\n text-lg\r\n `.trim();\r\n\r\n return (\r\n <button\r\n onClick={handleClick}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n className={buttonClasses}\r\n >\r\n Express Checkout\r\n <span className={badgeClasses}>\r\n Movmo\r\n </span>\r\n </button>\r\n );\r\n};\r\n","import axios, { AxiosInstance } from \"axios\";\r\n\r\n\r\nexport const createAxiosClient = (apiKey: string, isProd: boolean = false) => {\r\n const baseUrl = isProd ? \"https://api.movmo.io\" : \"https://e2e.api.movmo.io\";\r\n\r\n const client = axios.create({\r\n baseURL: baseUrl,\r\n headers: {\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n \"x-api-key\": apiKey,\r\n },\r\n // Allow cookies to be sent with requests\r\n withCredentials: true,\r\n timeout: 30000,\r\n });\r\n\r\n return client;\r\n};\r\n\r\nexport interface FlightOfferRequest {\r\n dataSource: string;\r\n // The raw offer object from the data source; does not currently support fare splitting\r\n rawOffer: object;\r\n}\r\n\r\nexport const saveFlightOffer = async (payload: FlightOfferRequest, client: AxiosInstance): Promise<string | null> => {\r\n return await client.post(\"/v1/flight_offers\", payload)\r\n .then((res) => res.data.id)\r\n .catch((err) => {\r\n console.error(err);\r\n return null;\r\n });\r\n};\r\n","function loadInterFont() {\r\n if (typeof document !== 'undefined') {\r\n const link = document.createElement('link');\r\n link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap';\r\n link.rel = 'stylesheet';\r\n document.head.appendChild(link);\r\n }\r\n}\r\n\r\nloadInterFont();\r\n\r\n// Export components\r\nexport { MovmoCheckoutButton } from './MovmoCheckoutButton';\r\n"],"names":["showMovmoOverlay","queryParams","document","getElementById","container","createElement","id","style","cssText","innerHTML","body","appendChild","window","addEventListener","history","state","checkoutOpen","remove","location","pathname","startsWith","search","substring","replaceState","href","MovmoCheckoutButton","customerId","apiKey","dataSource","flightOffer","isProd","isHovered","setIsHovered","useState","client","baseUrl","axios","create","baseURL","headers","Accept","withCredentials","timeout","createAxiosClient","buttonClasses","trim","badgeClasses","_jsxs","onClick","async","payload","rawOffer","offerId","post","then","res","data","catch","err","saveFlightOffer","URLSearchParams","airlineRef","toString","pushState","onMouseEnter","onMouseLeave","className","children","_jsx","link","rel","head","loadInterFont"],"mappings":";;;;;;wGAAM,SAAUA,EAAiBC,GAC7B,GAAIC,SAASC,eAAe,kBAAmB,OAE/C,MAAMC,EAAYF,SAASG,cAAc,OACzCD,EAAUE,GAAK,iBACfF,EAAUG,MAAMC,QAAU,yKAU1BJ,EAAUK,UAAY,6EAE8BR,yHAOpDC,SAASQ,KAAKC,YAAYP,EAC9B,CAGAQ,OAAOC,iBAAiB,YAAY,KAChC,MAAMT,EAAYF,SAASC,eAAe,mBACrCS,OAAOE,QAAQC,OAAOC,cAAgBZ,GACvCA,EAAUa,YAKlBL,OAAOC,iBAAiB,oBAAoB,KAExC,GADoBD,OAAOM,SAASC,SAASC,WAAW,mBACvC,CACb,MAAMnB,EAAcW,OAAOM,SAASG,OAAOC,UAAU,GACrDV,OAAOE,QAAQS,aAAa,CAAEP,cAAc,GAAQ,GAAIJ,OAAOM,SAASM,MACxExB,EAAiBC,OC3BZ,MAAAwB,EAA0D,EACnEC,aACAC,SACAC,aACAC,cACAC,UAAS,MAET,MAAOC,EAAWC,GAAgBC,GAAS,GACrCC,ECnBuB,EAACP,EAAgBG,GAAkB,KAChE,MAAMK,EAAUL,EAAS,uBAAyB,2BAclD,OAZeM,EAAMC,OAAO,CACxBC,QAASH,EACTI,QAAS,CACLC,OAAQ,mBACR,eAAgB,mBAChB,YAAab,GAGjBc,iBAAiB,EACjBC,QAAS,KAGA,EDIEC,CAAkBhB,EAAQG,GAsBnCc,EAAgB,sRAShBb,EAAY,oBAAsB,6BACtCc,OAEIC,EAAe,mHAMnBD,OAEF,OACIE,EACI,SAAA,CAAAC,QA1CYC,UAChB,MAAMC,EAA8B,CAChCtB,aACAuB,SAAUtB,GAERuB,OCFiBH,OAAOC,EAA6BhB,UAClDA,EAAOmB,KAAK,oBAAqBH,GACzCI,MAAMC,GAAQA,EAAIC,KAAKlD,KACvBmD,OAAOC,GAEG,ODHWC,CAAgBT,EAAShB,GAC/C,IAAKkB,EAED,OAGJ,MAAMnD,EAAc,IAAI2D,gBAAgB,CACpCR,UACAS,WAAYnC,IACboC,WAEHlD,OAAOE,QAAQiD,UAAU,CAAE/C,cAAc,GAAQ,GAAI,mBAAmBf,KACxED,EAAiBC,EAAY,EA0BzB+D,aAAc,IAAMhC,GAAa,GACjCiC,aAAc,IAAMjC,GAAa,GACjCkC,UAAWtB,EAAauB,SAAA,CAAA,mBAGxBC,UAAMF,UAAWpB,EAEVqB,SAAA,YACF,GE3EjB,WACI,GAAwB,oBAAbjE,SAA0B,CACjC,MAAMmE,EAAOnE,SAASG,cAAc,QACpCgE,EAAK7C,KAAO,mFACZ6C,EAAKC,IAAM,aACXpE,SAASqE,KAAK5D,YAAY0D,GAElC,CAEAG"}
package/package.json CHANGED
@@ -1,82 +1,82 @@
1
- {
2
- "name": "@movmo/express-checkout-button",
3
- "version": "0.1.2",
4
- "description": "React component plugin for embedding Movmo Express Checkout on airline websites.",
5
- "type": "module",
6
- "main": "dist/index.cjs.js",
7
- "module": "dist/index.es.js",
8
- "types": "dist/index.d.ts",
9
- "publishConfig": {
10
- "access": "public"
11
- },
12
- "files": [
13
- "/dist"
14
- ],
15
- "scripts": {
16
- "build": "rollup -c && tsc --emitDeclarationOnly",
17
- "storybook": "storybook dev -p 6006",
18
- "build-storybook": "storybook build"
19
- },
20
- "keywords": [
21
- "movmo",
22
- "checkout",
23
- "plugin",
24
- "airline",
25
- "react",
26
- "iframe"
27
- ],
28
- "dependencies": {
29
- "axios": "^1.0.0"
30
- },
31
- "devDependencies": {
32
- "@chromatic-com/storybook": "^3.0.0",
33
- "@rollup/plugin-commonjs": "^25.0.0",
34
- "@rollup/plugin-node-resolve": "^15.0.0",
35
- "@rollup/plugin-terser": "^0.4.0",
36
- "@rollup/plugin-typescript": "^11.0.0",
37
- "@storybook/addon-essentials": "^8.6.0",
38
- "@storybook/addon-interactions": "^8.6.0",
39
- "@storybook/addon-links": "^8.6.0",
40
- "@storybook/addon-onboarding": "^8.6.0",
41
- "@storybook/blocks": "^8.6.0",
42
- "@storybook/react": "^8.6.0",
43
- "@storybook/react-vite": "^8.6.0",
44
- "@storybook/test": "^8.6.0",
45
- "@types/node": "^22.15.3",
46
- "@types/react": "^17.0.0 || ^18.0.0",
47
- "@types/react-dom": "^17.0.0 || ^18.0.0",
48
- "autoprefixer": "^10.4.16",
49
- "postcss": "^8.4.32",
50
- "rollup": "^4.0.0",
51
- "rollup-plugin-dts": "^6.0.0",
52
- "rollup-plugin-peer-deps-external": "^2.2.4",
53
- "storybook": "^8.6.0",
54
- "tailwindcss": "^3.4.0",
55
- "tailwindcss-animate": "^1.0.0",
56
- "tailwindcss-font-inter": "^4.0.0",
57
- "typescript": "^4.0.0 || ^5.0.0",
58
- "vite": "^6.2.1"
59
- },
60
- "peerDependencies": {
61
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
62
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
63
- },
64
- "peerDependenciesMeta": {
65
- "react": {
66
- "optional": false
67
- },
68
- "react-dom": {
69
- "optional": false
70
- }
71
- },
72
- "repository": {
73
- "type": "git",
74
- "url": "git+https://github.com/movmo-app/react-js-packages.git"
75
- },
76
- "author": "Movmo",
77
- "license": "MIT",
78
- "bugs": {
79
- "url": "https://github.com/movmo-app/react-js-packages/issues"
80
- },
81
- "homepage": "https://github.com/movmo-app/react-js-packages/blob/main/packages/@movmo/express-checkout-button/README.md"
82
- }
1
+ {
2
+ "name": "@movmo/express-checkout-button",
3
+ "version": "0.1.4",
4
+ "description": "React component plugin for embedding Movmo Express Checkout on airline websites.",
5
+ "type": "module",
6
+ "main": "dist/index.cjs.js",
7
+ "module": "dist/index.es.js",
8
+ "types": "dist/index.d.ts",
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "files": [
13
+ "/dist"
14
+ ],
15
+ "scripts": {
16
+ "build": "rollup -c && tsc --emitDeclarationOnly",
17
+ "storybook": "storybook dev -p 6006",
18
+ "build-storybook": "storybook build"
19
+ },
20
+ "keywords": [
21
+ "movmo",
22
+ "checkout",
23
+ "plugin",
24
+ "airline",
25
+ "react",
26
+ "iframe"
27
+ ],
28
+ "dependencies": {
29
+ "axios": "^1.0.0"
30
+ },
31
+ "devDependencies": {
32
+ "@chromatic-com/storybook": "^3.0.0",
33
+ "@rollup/plugin-commonjs": "^25.0.0",
34
+ "@rollup/plugin-node-resolve": "^15.0.0",
35
+ "@rollup/plugin-terser": "^0.4.0",
36
+ "@rollup/plugin-typescript": "^11.0.0",
37
+ "@storybook/addon-essentials": "^8.6.0",
38
+ "@storybook/addon-interactions": "^8.6.0",
39
+ "@storybook/addon-links": "^8.6.0",
40
+ "@storybook/addon-onboarding": "^8.6.0",
41
+ "@storybook/blocks": "^8.6.0",
42
+ "@storybook/react": "^8.6.0",
43
+ "@storybook/react-vite": "^8.6.0",
44
+ "@storybook/test": "^8.6.0",
45
+ "@types/node": "^22.15.3",
46
+ "@types/react": "^17.0.0 || ^18.0.0",
47
+ "@types/react-dom": "^17.0.0 || ^18.0.0",
48
+ "autoprefixer": "^10.4.16",
49
+ "postcss": "^8.4.32",
50
+ "rollup": "^4.0.0",
51
+ "rollup-plugin-dts": "^6.0.0",
52
+ "rollup-plugin-peer-deps-external": "^2.2.4",
53
+ "storybook": "^8.6.0",
54
+ "tailwindcss": "^3.4.0",
55
+ "tailwindcss-animate": "^1.0.0",
56
+ "tailwindcss-font-inter": "^4.0.0",
57
+ "typescript": "^4.0.0 || ^5.0.0",
58
+ "vite": "^6.2.1"
59
+ },
60
+ "peerDependencies": {
61
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
62
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
63
+ },
64
+ "peerDependenciesMeta": {
65
+ "react": {
66
+ "optional": false
67
+ },
68
+ "react-dom": {
69
+ "optional": false
70
+ }
71
+ },
72
+ "repository": {
73
+ "type": "git",
74
+ "url": "git+https://github.com/movmo-app/react-js-packages.git"
75
+ },
76
+ "author": "Movmo",
77
+ "license": "MIT",
78
+ "bugs": {
79
+ "url": "https://github.com/movmo-app/react-js-packages/issues"
80
+ },
81
+ "homepage": "https://github.com/movmo-app/react-js-packages/blob/main/packages/@movmo/express-checkout-button/README.md"
82
+ }