@paypal/checkout-components 5.0.256 → 5.0.258
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 +8 -0
- package/__sdk__.js +72 -76
- package/dist/button.js +1 -1
- package/globals.js +28 -30
- package/package.json +6 -4
- package/src/constants/button.js +37 -36
- package/src/constants/class.js +32 -30
- package/src/constants/index.js +3 -3
- package/src/constants/misc.js +14 -12
- package/src/declarations.js +19 -19
- package/src/funding/applepay/config.jsx +51 -50
- package/src/funding/applepay/index.js +1 -1
- package/src/funding/applepay/style.scoped.scss +1 -1
- package/src/funding/applepay/template.jsx +16 -11
- package/src/funding/bancontact/config.jsx +48 -37
- package/src/funding/bancontact/index.js +1 -2
- package/src/funding/blik/config.jsx +48 -37
- package/src/funding/blik/index.js +1 -2
- package/src/funding/boleto/config.jsx +50 -39
- package/src/funding/boleto/index.js +1 -2
- package/src/funding/card/amex/config.js +9 -8
- package/src/funding/card/amex/index.js +1 -2
- package/src/funding/card/config.jsx +246 -177
- package/src/funding/card/discover/config.js +9 -7
- package/src/funding/card/discover/index.js +1 -2
- package/src/funding/card/elo/config.js +6 -7
- package/src/funding/card/elo/index.js +1 -2
- package/src/funding/card/hiper/config.js +9 -7
- package/src/funding/card/hiper/index.js +1 -2
- package/src/funding/card/index.js +1 -1
- package/src/funding/card/jcb/config.js +6 -7
- package/src/funding/card/jcb/index.js +1 -2
- package/src/funding/card/mastercard/config.js +9 -7
- package/src/funding/card/mastercard/index.js +1 -2
- package/src/funding/card/visa/config.js +9 -7
- package/src/funding/card/visa/index.js +1 -2
- package/src/funding/common.jsx +242 -216
- package/src/funding/config.js +212 -65
- package/src/funding/content.jsx +1946 -337
- package/src/funding/credit/config.jsx +74 -57
- package/src/funding/credit/index.js +1 -2
- package/src/funding/eps/config.jsx +45 -37
- package/src/funding/eps/index.js +1 -2
- package/src/funding/funding.js +193 -100
- package/src/funding/giropay/config.jsx +48 -38
- package/src/funding/giropay/index.js +1 -2
- package/src/funding/ideal/config.jsx +48 -37
- package/src/funding/ideal/index.js +1 -2
- package/src/funding/index.js +2 -2
- package/src/funding/itau/config.jsx +41 -41
- package/src/funding/itau/index.js +1 -1
- package/src/funding/maxima/config.jsx +25 -19
- package/src/funding/maxima/index.js +1 -2
- package/src/funding/mercadopago/config.jsx +48 -37
- package/src/funding/mercadopago/index.js +1 -2
- package/src/funding/multibanco/config.jsx +50 -39
- package/src/funding/multibanco/index.js +1 -2
- package/src/funding/mybank/config.jsx +48 -37
- package/src/funding/mybank/index.js +1 -2
- package/src/funding/oxxo/config.jsx +50 -39
- package/src/funding/oxxo/index.js +1 -2
- package/src/funding/p24/config.jsx +45 -37
- package/src/funding/p24/index.js +1 -2
- package/src/funding/paidy/config.jsx +50 -39
- package/src/funding/paidy/index.js +1 -1
- package/src/funding/paylater/config.jsx +118 -111
- package/src/funding/paylater/index.js +1 -2
- package/src/funding/paypal/config.jsx +44 -46
- package/src/funding/paypal/index.js +1 -2
- package/src/funding/paypal/style.scoped.scss +80 -74
- package/src/funding/paypal/template.jsx +450 -354
- package/src/funding/payu/config.jsx +50 -39
- package/src/funding/payu/index.js +1 -1
- package/src/funding/satispay/config.jsx +50 -39
- package/src/funding/satispay/index.js +1 -1
- package/src/funding/sepa/config.jsx +19 -13
- package/src/funding/sepa/index.js +1 -2
- package/src/funding/sofort/config.jsx +48 -37
- package/src/funding/sofort/index.js +1 -2
- package/src/funding/trustly/config.jsx +50 -39
- package/src/funding/trustly/index.js +1 -2
- package/src/funding/venmo/config.jsx +80 -75
- package/src/funding/venmo/index.js +1 -2
- package/src/funding/venmo/style.scoped.scss +30 -32
- package/src/funding/venmo/template.jsx +56 -57
- package/src/funding/verkkopankki/config.jsx +50 -39
- package/src/funding/verkkopankki/index.js +1 -1
- package/src/funding/wechatpay/config.jsx +48 -37
- package/src/funding/wechatpay/index.js +1 -2
- package/src/funding/zimpler/config.jsx +19 -13
- package/src/funding/zimpler/index.js +1 -2
- package/src/interface/button.js +60 -44
- package/src/interface/card-fields.js +11 -8
- package/src/interface/fields.js +7 -4
- package/src/interface/marks.js +4 -4
- package/src/interface/payment-fields.js +7 -4
- package/src/interface/wallet.js +4 -4
- package/src/lib/errors.js +7 -7
- package/src/lib/index.js +5 -5
- package/src/lib/isRTLLanguage.js +3 -3
- package/src/lib/perceived-latency-instrumentation.js +54 -36
- package/src/lib/security.js +21 -17
- package/src/lib/session.js +39 -35
- package/src/marks/component.jsx +114 -65
- package/src/marks/index.js +1 -2
- package/src/marks/template.jsx +79 -65
- package/src/types.js +48 -48
- package/src/ui/buttons/button.jsx +311 -249
- package/src/ui/buttons/buttonDesigns/control.jsx +3 -5
- package/src/ui/buttons/buttonDesigns/divideLogoAnimation.jsx +127 -99
- package/src/ui/buttons/buttonDesigns/index.js +78 -75
- package/src/ui/buttons/buttonDesigns/inlineLogoTextDesign.jsx +102 -82
- package/src/ui/buttons/buttonDesigns/script.jsx +24 -18
- package/src/ui/buttons/buttonDesigns/types.js +6 -7
- package/src/ui/buttons/buttons.jsx +318 -212
- package/src/ui/buttons/config.js +62 -59
- package/src/ui/buttons/content.jsx +304 -119
- package/src/ui/buttons/index.js +1 -1
- package/src/ui/buttons/menu-button/index.js +1 -1
- package/src/ui/buttons/menu-button/menu-button.jsx +29 -22
- package/src/ui/buttons/menu-button/menu-button.scoped.scss +16 -17
- package/src/ui/buttons/poweredBy.jsx +23 -23
- package/src/ui/buttons/props.js +680 -529
- package/src/ui/buttons/script.jsx +182 -160
- package/src/ui/buttons/spinner.jsx +4 -6
- package/src/ui/buttons/style.jsx +15 -14
- package/src/ui/buttons/styles/base.js +24 -16
- package/src/ui/buttons/styles/button.js +24 -22
- package/src/ui/buttons/styles/color.js +118 -118
- package/src/ui/buttons/styles/custom.js +30 -24
- package/src/ui/buttons/styles/index.js +1 -1
- package/src/ui/buttons/styles/labels.js +17 -13
- package/src/ui/buttons/styles/page.js +3 -3
- package/src/ui/buttons/styles/responsive.js +226 -118
- package/src/ui/buttons/tagline.jsx +53 -54
- package/src/ui/chevron.jsx +27 -16
- package/src/ui/index.js +3 -3
- package/src/ui/loading.jsx +25 -18
- package/src/ui/text/index.js +1 -1
- package/src/ui/text/style.scoped.scss +25 -26
- package/src/ui/text/text.jsx +42 -20
- package/src/ui/tracking.jsx +18 -11
- package/src/zoid/buttons/component.jsx +836 -684
- package/src/zoid/buttons/container.jsx +140 -107
- package/src/zoid/buttons/index.js +1 -1
- package/src/zoid/buttons/prerender.jsx +84 -64
- package/src/zoid/buttons/util.js +355 -254
- package/src/zoid/card-fields/component.jsx +581 -549
- package/src/zoid/card-fields/index.js +1 -1
- package/src/zoid/card-fields/prerender.jsx +20 -17
- package/src/zoid/card-form/component.js +155 -141
- package/src/zoid/card-form/index.js +1 -1
- package/src/zoid/checkout/component.jsx +314 -282
- package/src/zoid/checkout/config.js +2 -2
- package/src/zoid/checkout/content.js +190 -154
- package/src/zoid/checkout/hacks.js +31 -28
- package/src/zoid/checkout/index.js +2 -2
- package/src/zoid/checkout/props.js +27 -33
- package/src/zoid/installments/component.jsx +83 -70
- package/src/zoid/installments/index.js +1 -1
- package/src/zoid/installments/props.js +1 -1
- package/src/zoid/menu/component.jsx +53 -48
- package/src/zoid/menu/index.js +1 -1
- package/src/zoid/menu/props.js +1 -3
- package/src/zoid/modal/component.jsx +119 -106
- package/src/zoid/modal/index.js +1 -1
- package/src/zoid/modal/props.js +1 -3
- package/src/zoid/payment-fields/component.jsx +215 -191
- package/src/zoid/payment-fields/container.jsx +73 -64
- package/src/zoid/payment-fields/index.js +1 -1
- package/src/zoid/payment-fields/prerender.jsx +16 -14
- package/src/zoid/payment-fields/props.js +6 -6
- package/src/zoid/qr-code/component.jsx +131 -115
- package/src/zoid/qr-code/container.jsx +74 -68
- package/src/zoid/qr-code/index.js +1 -1
- package/src/zoid/qr-code/prerender.jsx +17 -12
- package/src/zoid/qr-code/types.js +2 -2
- package/src/zoid/wallet/component.jsx +298 -260
- package/src/zoid/wallet/container.jsx +73 -64
- package/src/zoid/wallet/index.js +1 -1
- package/src/zoid/wallet/prerender.jsx +14 -14
- package/src/zoid/wallet/props.js +4 -4
- package/src/actions/save/index.js +0 -40
- package/src/interface/actions.js +0 -14
- package/src/lib/getLogoCDNExperiment.js +0 -25
|
@@ -2,86 +2,99 @@
|
|
|
2
2
|
/** @jsx node */
|
|
3
3
|
/* eslint max-lines: 0 */
|
|
4
4
|
|
|
5
|
-
import { node, dom } from
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { node, dom } from "@krakenjs/jsx-pragmatic/src";
|
|
6
|
+
import {
|
|
7
|
+
getLogger,
|
|
8
|
+
getPayPalDomainRegex,
|
|
9
|
+
getSDKMeta,
|
|
10
|
+
getPayPalDomain,
|
|
11
|
+
getLocale,
|
|
12
|
+
getCSPNonce,
|
|
13
|
+
} from "@paypal/sdk-client/src";
|
|
14
|
+
import { create, type ZoidComponent } from "@krakenjs/zoid/src";
|
|
15
|
+
import { inlineMemoize } from "@krakenjs/belter/src";
|
|
16
|
+
import { Overlay, SpinnerPage } from "@paypal/common-components/src";
|
|
10
17
|
|
|
11
|
-
import { type InstallmentsProps } from
|
|
18
|
+
import { type InstallmentsProps } from "./props";
|
|
12
19
|
|
|
13
20
|
export type InstallmentsComponent = ZoidComponent<InstallmentsProps>;
|
|
14
21
|
|
|
15
|
-
export function getInstallmentsComponent()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
export function getInstallmentsComponent(): InstallmentsComponent {
|
|
23
|
+
return inlineMemoize(getInstallmentsComponent, () => {
|
|
24
|
+
return create({
|
|
25
|
+
tag: "paypal-installments",
|
|
26
|
+
url: () =>
|
|
27
|
+
`${getPayPalDomain()}${__PAYPAL_CHECKOUT__.__URI__.__INSTALLMENTS__}`,
|
|
20
28
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
autoResize: {
|
|
24
|
-
width: false,
|
|
25
|
-
height: true
|
|
26
|
-
},
|
|
29
|
+
domain: getPayPalDomainRegex(),
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
autoResize: {
|
|
32
|
+
width: false,
|
|
33
|
+
height: true,
|
|
34
|
+
},
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
dimensions: {
|
|
37
|
+
width: "100%",
|
|
38
|
+
height: "100%",
|
|
39
|
+
},
|
|
34
40
|
|
|
35
|
-
|
|
36
|
-
const nonce = props.nonce || getCSPNonce();
|
|
37
|
-
return (
|
|
38
|
-
<SpinnerPage
|
|
39
|
-
nonce={ nonce }
|
|
40
|
-
/>
|
|
41
|
-
).render(dom({ doc }));
|
|
42
|
-
},
|
|
41
|
+
logger: getLogger(),
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
context={ context }
|
|
49
|
-
close={ close }
|
|
50
|
-
focus={ focus }
|
|
51
|
-
event={ event }
|
|
52
|
-
frame={ frame }
|
|
53
|
-
prerenderFrame={ prerenderFrame }
|
|
54
|
-
autoResize={ true }
|
|
55
|
-
hideCloseButton={ true }
|
|
56
|
-
nonce={ nonce }
|
|
57
|
-
/>
|
|
58
|
-
).render(dom({ doc }));
|
|
59
|
-
},
|
|
43
|
+
prerenderTemplate: ({ doc, props }) => {
|
|
44
|
+
const nonce = props.nonce || getCSPNonce();
|
|
45
|
+
return (<SpinnerPage nonce={nonce} />).render(dom({ doc }));
|
|
46
|
+
},
|
|
60
47
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
48
|
+
containerTemplate: ({
|
|
49
|
+
context,
|
|
50
|
+
close,
|
|
51
|
+
focus,
|
|
52
|
+
doc,
|
|
53
|
+
event,
|
|
54
|
+
frame,
|
|
55
|
+
prerenderFrame,
|
|
56
|
+
props,
|
|
57
|
+
}) => {
|
|
58
|
+
const { nonce } = props;
|
|
59
|
+
return (
|
|
60
|
+
<Overlay
|
|
61
|
+
context={context}
|
|
62
|
+
close={close}
|
|
63
|
+
focus={focus}
|
|
64
|
+
event={event}
|
|
65
|
+
frame={frame}
|
|
66
|
+
prerenderFrame={prerenderFrame}
|
|
67
|
+
autoResize={true}
|
|
68
|
+
hideCloseButton={true}
|
|
69
|
+
nonce={nonce}
|
|
70
|
+
/>
|
|
71
|
+
).render(dom({ doc }));
|
|
72
|
+
},
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
74
|
+
props: {
|
|
75
|
+
sdkMeta: {
|
|
76
|
+
type: "string",
|
|
77
|
+
queryParam: true,
|
|
78
|
+
sendToChild: false,
|
|
79
|
+
value: getSDKMeta,
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
clientID: {
|
|
83
|
+
type: "string",
|
|
84
|
+
queryParam: true,
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
locale: {
|
|
88
|
+
type: "object",
|
|
89
|
+
queryParam: true,
|
|
90
|
+
value: getLocale,
|
|
91
|
+
},
|
|
92
|
+
nonce: {
|
|
93
|
+
type: "string",
|
|
94
|
+
default: getCSPNonce,
|
|
95
|
+
required: false,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
86
98
|
});
|
|
99
|
+
});
|
|
87
100
|
}
|
|
@@ -2,57 +2,62 @@
|
|
|
2
2
|
/** @jsx node */
|
|
3
3
|
/* eslint max-lines: 0 */
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import {
|
|
6
|
+
getLogger,
|
|
7
|
+
getPayPalDomainRegex,
|
|
8
|
+
getSDKMeta,
|
|
9
|
+
getPayPalDomain,
|
|
10
|
+
} from "@paypal/sdk-client/src";
|
|
11
|
+
import { create, type ZoidComponent } from "@krakenjs/zoid/src";
|
|
12
|
+
import { inlineMemoize } from "@krakenjs/belter/src";
|
|
8
13
|
|
|
9
|
-
import { type MenuProps } from
|
|
14
|
+
import { type MenuProps } from "./props";
|
|
10
15
|
|
|
11
16
|
export type MenuComponent = ZoidComponent<MenuProps>;
|
|
12
17
|
|
|
13
|
-
export function getMenuComponent()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
18
|
+
export function getMenuComponent(): MenuComponent {
|
|
19
|
+
return inlineMemoize(getMenuComponent, () => {
|
|
20
|
+
return create({
|
|
21
|
+
tag: "paypal-menu",
|
|
22
|
+
url: () => `${getPayPalDomain()}${__PAYPAL_CHECKOUT__.__URI__.__MENU__}`,
|
|
23
|
+
|
|
24
|
+
domain: getPayPalDomainRegex(),
|
|
25
|
+
|
|
26
|
+
autoResize: {
|
|
27
|
+
width: false,
|
|
28
|
+
height: true,
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
dimensions: {
|
|
32
|
+
width: "100%",
|
|
33
|
+
height: "150px",
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
logger: getLogger(),
|
|
37
|
+
|
|
38
|
+
prerenderTemplate: () => {
|
|
39
|
+
return null;
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
attributes: {
|
|
43
|
+
iframe: {
|
|
44
|
+
scrolling: "no",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
props: {
|
|
49
|
+
sdkMeta: {
|
|
50
|
+
type: "string",
|
|
51
|
+
queryParam: true,
|
|
52
|
+
sendToChild: false,
|
|
53
|
+
value: getSDKMeta,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
clientID: {
|
|
57
|
+
type: "string",
|
|
58
|
+
queryParam: true,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
57
61
|
});
|
|
62
|
+
});
|
|
58
63
|
}
|
package/src/zoid/menu/index.js
CHANGED
package/src/zoid/menu/props.js
CHANGED
|
@@ -2,74 +2,86 @@
|
|
|
2
2
|
/** @jsx node */
|
|
3
3
|
/* eslint max-lines: 0 */
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import {
|
|
6
|
+
getLogger,
|
|
7
|
+
getPayPalDomainRegex,
|
|
8
|
+
getSDKMeta,
|
|
9
|
+
getPayPalDomain,
|
|
10
|
+
} from "@paypal/sdk-client/src";
|
|
11
|
+
import { create, EVENT, type ZoidComponent } from "@krakenjs/zoid/src";
|
|
12
|
+
import { inlineMemoize, destroyElement, toCSS } from "@krakenjs/belter/src";
|
|
13
|
+
import { node, dom } from "@krakenjs/jsx-pragmatic/src";
|
|
14
|
+
|
|
15
|
+
import { type ModalProps } from "./props";
|
|
11
16
|
|
|
12
17
|
const CLASS = {
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
VISIBLE: "visible",
|
|
19
|
+
INVISIBLE: "invisible",
|
|
15
20
|
};
|
|
16
21
|
|
|
17
22
|
export type ModalComponent = ZoidComponent<ModalProps>;
|
|
18
23
|
|
|
19
|
-
export function getModalComponent()
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
24
|
+
export function getModalComponent(): ModalComponent {
|
|
25
|
+
return inlineMemoize(getModalComponent, () => {
|
|
26
|
+
return create({
|
|
27
|
+
tag: "paypal-modal",
|
|
28
|
+
url: () => `${getPayPalDomain()}${__PAYPAL_CHECKOUT__.__URI__.__MODAL__}`,
|
|
29
|
+
domain: getPayPalDomainRegex(),
|
|
30
|
+
|
|
31
|
+
dimensions: {
|
|
32
|
+
width: "100%",
|
|
33
|
+
height: "100%",
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
logger: getLogger(),
|
|
37
|
+
|
|
38
|
+
containerTemplate: ({
|
|
39
|
+
frame,
|
|
40
|
+
prerenderFrame,
|
|
41
|
+
props,
|
|
42
|
+
doc,
|
|
43
|
+
uid,
|
|
44
|
+
event,
|
|
45
|
+
}) => {
|
|
46
|
+
if (!frame || !prerenderFrame) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const { cspNonce } = props;
|
|
51
|
+
|
|
52
|
+
prerenderFrame.classList.add(CLASS.VISIBLE);
|
|
53
|
+
frame.classList.add(CLASS.INVISIBLE);
|
|
54
|
+
|
|
55
|
+
event.on(EVENT.RENDERED, () => {
|
|
56
|
+
prerenderFrame.classList.remove(CLASS.VISIBLE);
|
|
57
|
+
prerenderFrame.classList.add(CLASS.INVISIBLE);
|
|
58
|
+
|
|
59
|
+
frame.classList.remove(CLASS.INVISIBLE);
|
|
60
|
+
frame.classList.add(CLASS.VISIBLE);
|
|
61
|
+
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
destroyElement(prerenderFrame);
|
|
64
|
+
}, 1);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const setupResize = (div) => {
|
|
68
|
+
event.on(EVENT.RESIZE, ({ width: newWidth, height: newHeight }) => {
|
|
69
|
+
if (typeof newWidth === "number") {
|
|
70
|
+
div.style.width = toCSS(newWidth);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (typeof newHeight === "number") {
|
|
74
|
+
div.style.height = toCSS(newHeight);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div id={uid} onRender={setupResize}>
|
|
81
|
+
<style
|
|
82
|
+
nonce={cspNonce}
|
|
83
|
+
innerHTML={`
|
|
84
|
+
#${uid} {
|
|
73
85
|
display: block;
|
|
74
86
|
position: fixed;
|
|
75
87
|
width: 100%;
|
|
@@ -79,7 +91,7 @@ export function getModalComponent() : ModalComponent {
|
|
|
79
91
|
z-index: 200000;
|
|
80
92
|
}
|
|
81
93
|
|
|
82
|
-
#${
|
|
94
|
+
#${uid} > iframe {
|
|
83
95
|
display: inline-block;
|
|
84
96
|
position: absolute;
|
|
85
97
|
width: 100%;
|
|
@@ -88,52 +100,53 @@ export function getModalComponent() : ModalComponent {
|
|
|
88
100
|
left: 0;
|
|
89
101
|
transition: opacity .2s ease-in-out;
|
|
90
102
|
}
|
|
91
|
-
#${
|
|
103
|
+
#${uid} > iframe.${CLASS.INVISIBLE} {
|
|
92
104
|
opacity: 0;
|
|
93
105
|
}
|
|
94
|
-
#${
|
|
106
|
+
#${uid} > iframe.${CLASS.VISIBLE} {
|
|
95
107
|
opacity: 1;
|
|
96
108
|
}
|
|
97
|
-
`
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
109
|
+
`}
|
|
110
|
+
/>
|
|
111
|
+
<node el={frame} />
|
|
112
|
+
<node el={prerenderFrame} />
|
|
113
|
+
</div>
|
|
114
|
+
).render(dom({ doc }));
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
prerenderTemplate: () => {
|
|
118
|
+
return null;
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
attributes: {
|
|
122
|
+
iframe: {
|
|
123
|
+
scrolling: "no",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
props: {
|
|
128
|
+
sdkMeta: {
|
|
129
|
+
type: "string",
|
|
130
|
+
queryParam: true,
|
|
131
|
+
sendToChild: false,
|
|
132
|
+
value: getSDKMeta,
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
clientID: {
|
|
136
|
+
type: "string",
|
|
137
|
+
queryParam: true,
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
orderID: {
|
|
141
|
+
type: "string",
|
|
142
|
+
queryParam: true,
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
customerID: {
|
|
146
|
+
type: "string",
|
|
147
|
+
queryParam: true,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
138
150
|
});
|
|
151
|
+
});
|
|
139
152
|
}
|
package/src/zoid/modal/index.js
CHANGED
package/src/zoid/modal/props.js
CHANGED