@paypal/checkout-components 5.0.256-alpha.1 → 5.0.257
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 +76 -76
- package/dist/button.js +1 -1
- package/globals.js +28 -30
- package/package.json +7 -5
- package/src/actions/save/index.js +17 -12
- package/src/constants/button.js +36 -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 -49
- package/src/funding/applepay/index.js +1 -1
- package/src/funding/applepay/style.scoped.scss +1 -1
- package/src/funding/applepay/template.jsx +16 -9
- package/src/funding/bancontact/config.jsx +48 -36
- package/src/funding/bancontact/index.js +1 -2
- package/src/funding/blik/config.jsx +48 -36
- package/src/funding/blik/index.js +1 -2
- package/src/funding/boleto/config.jsx +50 -38
- package/src/funding/boleto/index.js +1 -2
- package/src/funding/card/amex/config.js +9 -7
- package/src/funding/card/amex/index.js +1 -2
- package/src/funding/card/config.jsx +246 -178
- package/src/funding/card/discover/config.js +9 -6
- package/src/funding/card/discover/index.js +1 -2
- package/src/funding/card/elo/config.js +6 -6
- package/src/funding/card/elo/index.js +1 -2
- package/src/funding/card/hiper/config.js +9 -6
- 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 -6
- package/src/funding/card/jcb/index.js +1 -2
- package/src/funding/card/mastercard/config.js +9 -6
- package/src/funding/card/mastercard/index.js +1 -2
- package/src/funding/card/visa/config.js +9 -6
- 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 -54
- package/src/funding/credit/index.js +1 -2
- package/src/funding/eps/config.jsx +45 -36
- package/src/funding/eps/index.js +1 -2
- package/src/funding/funding.js +193 -100
- package/src/funding/giropay/config.jsx +48 -37
- package/src/funding/giropay/index.js +1 -2
- package/src/funding/ideal/config.jsx +48 -36
- package/src/funding/ideal/index.js +1 -2
- package/src/funding/index.js +2 -2
- package/src/funding/itau/config.jsx +41 -40
- package/src/funding/itau/index.js +1 -1
- package/src/funding/maxima/config.jsx +25 -18
- package/src/funding/maxima/index.js +1 -2
- package/src/funding/mercadopago/config.jsx +48 -36
- package/src/funding/mercadopago/index.js +1 -2
- package/src/funding/multibanco/config.jsx +50 -38
- package/src/funding/multibanco/index.js +1 -2
- package/src/funding/mybank/config.jsx +48 -36
- package/src/funding/mybank/index.js +1 -2
- package/src/funding/oxxo/config.jsx +50 -38
- package/src/funding/oxxo/index.js +1 -2
- package/src/funding/p24/config.jsx +45 -36
- package/src/funding/p24/index.js +1 -2
- package/src/funding/paidy/config.jsx +50 -38
- package/src/funding/paidy/index.js +1 -1
- package/src/funding/paylater/config.jsx +118 -110
- package/src/funding/paylater/index.js +1 -2
- package/src/funding/paypal/config.jsx +43 -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 -355
- package/src/funding/payu/config.jsx +50 -38
- package/src/funding/payu/index.js +1 -1
- package/src/funding/satispay/config.jsx +50 -38
- package/src/funding/satispay/index.js +1 -1
- package/src/funding/sepa/config.jsx +19 -12
- package/src/funding/sepa/index.js +1 -2
- package/src/funding/sofort/config.jsx +48 -36
- package/src/funding/sofort/index.js +1 -2
- package/src/funding/trustly/config.jsx +50 -38
- package/src/funding/trustly/index.js +1 -2
- package/src/funding/venmo/config.jsx +80 -74
- package/src/funding/venmo/index.js +1 -2
- package/src/funding/venmo/style.scoped.scss +30 -32
- package/src/funding/venmo/template.jsx +56 -56
- package/src/funding/verkkopankki/config.jsx +50 -38
- package/src/funding/verkkopankki/index.js +1 -1
- package/src/funding/wechatpay/config.jsx +48 -36
- package/src/funding/wechatpay/index.js +1 -2
- package/src/funding/zimpler/config.jsx +19 -12
- package/src/funding/zimpler/index.js +1 -2
- package/src/interface/actions.js +1 -1
- 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 +677 -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 +820 -677
- 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 +346 -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/README.md
CHANGED
|
@@ -123,3 +123,11 @@ Checks to make sure that the compiled & gzipped bundle doesn't exceed the recomm
|
|
|
123
123
|
## Releasing
|
|
124
124
|
|
|
125
125
|
This package is published weekly, **Every Wednesday**. Please [view our Changelog](CHANGELOG.md) to stay updated with bug fixes and new features.
|
|
126
|
+
|
|
127
|
+
## Logo Strategy with paypal-sdk-logos
|
|
128
|
+
|
|
129
|
+
Our usage of svg logos is optimized for performance. Here's how it works for the two-phased render for the Buttons component:
|
|
130
|
+
|
|
131
|
+
- First Render - Buttons are first rendered on the client-side inside an `<iframe>` tag using the code bundled inside the JS SDK script. This `<iframe>` tag has no src attribute at this point in the rendering life cycle. We leverage the `__WEB__` global variable to determine if we are rendering client-side or server-side. The `__WEB__` global variable will equal true when rendering client-side. To minimize the bundle size of the JS SDK script, we load these svg logos from the www.paypalobjects.com CDN as external images (ex: `<PayPalLogoExternalImage />`).
|
|
132
|
+
|
|
133
|
+
- Second Render - The second phase of rendering happens on the server-side. This `<iframe>` tag is fully rendered by setting the src attribute and making an http request to the server to populate the contents which are securely hosted by PayPal's servers on www.paypal.com. The same code in this repo is used to render the buttons on the server-side. To ensure there are no issues with the logos, we have decided to inline the svg code for this server-side render (ex: `<PayPalLogoInlineSVG />`). The `__WEB__` global variable is set to false to control what code executes during the server render.
|
package/__sdk__.js
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
/* eslint unicorn/filename-case: 0, import/unambiguous: 0, import/no-commonjs: 0 */
|
|
3
3
|
|
|
4
|
-
const { FUNDING, CARD } = require(
|
|
4
|
+
const { FUNDING, CARD } = require("@paypal/sdk-constants");
|
|
5
5
|
|
|
6
|
-
const globals = require(
|
|
6
|
+
const globals = require("./globals");
|
|
7
7
|
|
|
8
8
|
const SMART_FUNDING_SOURCES = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
9
|
+
FUNDING.PAYPAL,
|
|
10
|
+
FUNDING.VENMO,
|
|
11
|
+
FUNDING.ITAU,
|
|
12
|
+
FUNDING.CREDIT,
|
|
13
|
+
FUNDING.PAYLATER,
|
|
14
|
+
FUNDING.APPLEPAY,
|
|
15
|
+
FUNDING.IDEAL,
|
|
16
|
+
FUNDING.SEPA,
|
|
17
|
+
FUNDING.BANCONTACT,
|
|
18
|
+
FUNDING.GIROPAY,
|
|
19
|
+
FUNDING.EPS,
|
|
20
|
+
FUNDING.SOFORT,
|
|
21
|
+
FUNDING.MYBANK,
|
|
22
|
+
FUNDING.BLIK,
|
|
23
|
+
FUNDING.P24,
|
|
24
|
+
FUNDING.ZIMPLER,
|
|
25
|
+
FUNDING.WECHATPAY,
|
|
26
|
+
FUNDING.PAYU,
|
|
27
|
+
FUNDING.VERKKOPANKKI,
|
|
28
|
+
FUNDING.TRUSTLY,
|
|
29
|
+
FUNDING.OXXO,
|
|
30
|
+
FUNDING.BOLETO,
|
|
31
|
+
FUNDING.BOLETOBANCARIO,
|
|
32
|
+
FUNDING.MULTIBANCO,
|
|
33
|
+
FUNDING.MAXIMA,
|
|
34
|
+
FUNDING.MERCADOPAGO,
|
|
35
|
+
FUNDING.SATISPAY,
|
|
36
|
+
FUNDING.PAIDY,
|
|
37
|
+
FUNDING.CARD,
|
|
38
38
|
];
|
|
39
39
|
|
|
40
40
|
const SMART_CARDS = [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
CARD.VISA,
|
|
42
|
+
CARD.MASTERCARD,
|
|
43
|
+
CARD.AMEX,
|
|
44
|
+
CARD.DISCOVER,
|
|
45
|
+
CARD.HIPER,
|
|
46
|
+
CARD.ELO,
|
|
47
|
+
CARD.JCB,
|
|
48
48
|
];
|
|
49
49
|
|
|
50
50
|
module.exports = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
51
|
+
actions: {
|
|
52
|
+
automatic: true,
|
|
53
|
+
entry: "./src/interface/actions",
|
|
54
|
+
},
|
|
55
|
+
buttons: {
|
|
56
|
+
entry: "./src/interface/button",
|
|
57
|
+
setupHandler: "setupButtons",
|
|
58
|
+
globals,
|
|
59
|
+
fundingSources: SMART_FUNDING_SOURCES,
|
|
60
|
+
cards: SMART_CARDS,
|
|
61
|
+
},
|
|
62
|
+
marks: {
|
|
63
|
+
entry: "./src/interface/marks",
|
|
64
|
+
globals,
|
|
65
|
+
fundingSources: SMART_FUNDING_SOURCES,
|
|
66
|
+
cards: SMART_CARDS,
|
|
67
|
+
},
|
|
68
|
+
wallet: {
|
|
69
|
+
entry: "./src/interface/wallet",
|
|
70
|
+
globals,
|
|
71
|
+
},
|
|
72
|
+
// @deprecated - renamed to payment-fields to be removed
|
|
73
|
+
fields: {
|
|
74
|
+
entry: "./src/interface/fields",
|
|
75
|
+
globals,
|
|
76
|
+
fundingSources: SMART_FUNDING_SOURCES,
|
|
77
|
+
cards: SMART_CARDS,
|
|
78
|
+
},
|
|
79
|
+
"payment-fields": {
|
|
80
|
+
entry: "./src/interface/payment-fields",
|
|
81
|
+
globals,
|
|
82
|
+
fundingSources: SMART_FUNDING_SOURCES,
|
|
83
|
+
cards: SMART_CARDS,
|
|
84
|
+
},
|
|
85
|
+
"card-fields": {
|
|
86
|
+
entry: "./src/interface/card-fields",
|
|
87
|
+
globals,
|
|
88
|
+
},
|
|
89
89
|
};
|