@paypal/checkout-components 5.0.286 → 5.0.287-alpha.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/__sdk__.js +4 -0
- package/package.json +1 -1
- package/src/hosted-buttons/index.js +26 -0
- package/src/interface/hosted-buttons.js +10 -0
package/__sdk__.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
import { getButtonsComponent } from "../zoid/buttons";
|
|
3
|
+
|
|
4
|
+
type HostedButtonsInstance = {|
|
|
5
|
+
render: (string | HTMLElement) => void,
|
|
6
|
+
|};
|
|
7
|
+
|
|
8
|
+
type HostedButtonsProps = {|
|
|
9
|
+
hostedButtonId?: string,
|
|
10
|
+
|};
|
|
11
|
+
|
|
12
|
+
export type HostedButtonsComponent =
|
|
13
|
+
(HostedButtonsProps) => HostedButtonsInstance;
|
|
14
|
+
|
|
15
|
+
export const getHostedButtonsComponent = (): HostedButtonsComponent => {
|
|
16
|
+
function HostedButtons(): HostedButtonsInstance {
|
|
17
|
+
const Buttons = getButtonsComponent();
|
|
18
|
+
const render = (selector) => {
|
|
19
|
+
Buttons().render(selector);
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
render,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return HostedButtons;
|
|
26
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
import type { LazyExport } from "../types";
|
|
3
|
+
import {
|
|
4
|
+
getHostedButtonsComponent,
|
|
5
|
+
type HostedButtonsComponent,
|
|
6
|
+
} from "../hosted-buttons";
|
|
7
|
+
|
|
8
|
+
export const HostedButtons: LazyExport<HostedButtonsComponent> = {
|
|
9
|
+
__get__: () => getHostedButtonsComponent(),
|
|
10
|
+
};
|