@paypal/checkout-components 5.0.198-alpha.0 → 5.0.200

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/CHANGELOG.md CHANGED
@@ -1,7 +1,24 @@
1
- ## <small>5.0.198-alpha.0 (2022-02-22)</small>
1
+ ## <small>5.0.200 (2022-02-24)</small>
2
2
 
3
- * Bump version for testing publishing from a fork ([edb29ef](https://github.com/paypal/paypal-checkout-components/commit/edb29ef))
4
- * Export tag before npm version (#1877) ([29e4d4a](https://github.com/paypal/paypal-checkout-components/commit/29e4d4a)), closes [#1877](https://github.com/paypal/paypal-checkout-components/issues/1877)
3
+ * fix(typo): Update FPTI event tracking name (#1881) ([1e2fd45](https://github.com/paypal/paypal-checkout-components/commit/1e2fd45)), closes [#1881](https://github.com/paypal/paypal-checkout-components/issues/1881)
4
+
5
+
6
+
7
+ ## <small>5.0.199 (2022-02-23)</small>
8
+
9
+ * chore(deps): update dependency karma to v6 [security] (#1876) ([0d1c628](https://github.com/paypal/paypal-checkout-components/commit/0d1c628)), closes [#1876](https://github.com/paypal/paypal-checkout-components/issues/1876)
10
+
11
+
12
+
13
+ ## <small>5.0.198 (2022-02-22)</small>
14
+
15
+ * chore(release): 5.0.197 🎉 ([47eecc1](https://github.com/paypal/paypal-checkout-components/commit/47eecc1))
16
+
17
+
18
+
19
+ ## <small>5.0.197 (2022-02-22)</small>
20
+
21
+ * Revert "use new kraken org prefix for cross-domain-utils (#1875)" (#1879) ([35f3860](https://github.com/paypal/paypal-checkout-components/commit/35f3860)), closes [#1875](https://github.com/paypal/paypal-checkout-components/issues/1875) [#1879](https://github.com/paypal/paypal-checkout-components/issues/1879)
5
22
 
6
23
 
7
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/checkout-components",
3
- "version": "5.0.198-alpha.0",
3
+ "version": "5.0.200",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,7 +26,8 @@
26
26
  "jest-ssr": "jest test/ssr --env=node --no-cache --collectCoverage --collectCoverageFrom='src/' --coverageDirectory='coverage/jest'",
27
27
  "jest-e2e": "rm -f ./test/e2e/screenshots/*.png && jest test/e2e",
28
28
  "check-size": "npm run webpack-size && bundlemon && npm run delete-size",
29
- "delete-size": "rm dist/size.* dist/report.html"
29
+ "delete-size": "rm dist/size.* dist/report.html",
30
+ "prepare": "husky install"
30
31
  },
31
32
  "files": [
32
33
  "src/",
@@ -63,30 +64,37 @@
63
64
  "flow-bin": "0.155.0",
64
65
  "fs-extra": "^10.0.0",
65
66
  "grumbler-scripts": "^5.0.1",
67
+ "husky": "^7.0.4",
66
68
  "imagemagick": "^0.1.3",
67
69
  "imgur": "^0.3.1",
68
- "karma": "^5.2.3",
70
+ "karma": "^6.0.0",
69
71
  "karma-coverage": "^2.0.3",
72
+ "lint-staged": "^12.3.4",
70
73
  "memory-fs": "^0.5.0",
71
74
  "mocha": "^4.1.0",
72
75
  "mocketeer": "^0.3.1",
73
76
  "pixelmatch": "^5.2.1",
74
77
  "pngjs": "^6.0.0",
78
+ "prettier": "^2.5.1",
79
+ "prettier-plugin-sh": "^0.8.1",
75
80
  "puppeteer": "^1.20.0",
76
81
  "serve": "^13.0.0",
77
82
  "sync-browser-mocks": "^2.0.8"
78
83
  },
79
84
  "dependencies": {
80
- "@krakenjs/cross-domain-utils": "^3.0.2",
81
85
  "@paypal/common-components": "^1.0.16",
82
86
  "@paypal/funding-components": "^1.0.17",
83
87
  "@paypal/sdk-client": "^4.0.156",
84
88
  "@paypal/sdk-constants": "^1.0.107",
85
89
  "@paypal/sdk-logos": "^1.0.26",
86
90
  "belter": "^1.0.2",
91
+ "cross-domain-utils": "^2.0.1",
87
92
  "jsx-pragmatic": "^2",
88
93
  "post-robot": "^10.0.0",
89
94
  "zalgo-promise": "^1.0.10",
90
95
  "zoid": "^9.0.0"
96
+ },
97
+ "lint-staged": {
98
+ "*.sh": "prettier --write"
91
99
  }
92
100
  }
@@ -1,6 +1,6 @@
1
1
  /* @flow */
2
2
 
3
- import { isSameDomain } from '@krakenjs/cross-domain-utils/src';
3
+ import { isSameDomain } from 'cross-domain-utils/src';
4
4
  import { supportsPopups } from 'belter/src';
5
5
  import { isPayPalDomain } from '@paypal/sdk-client/src';
6
6
 
@@ -7,7 +7,7 @@ import { type OrderCreateRequest, type FundingEligibilityType,
7
7
  type OrderGetResponse, type OrderCaptureResponse, type OrderAuthorizeResponse } from '@paypal/sdk-client/src';
8
8
  import { FUNDING, PLATFORM, INTENT, COMMIT, VAULT,
9
9
  ENV, COUNTRY, LANG, COUNTRY_LANGS, type LocaleType, CARD, COMPONENTS } from '@paypal/sdk-constants/src';
10
- import { type CrossDomainWindowType } from '@krakenjs/cross-domain-utils/src';
10
+ import { type CrossDomainWindowType } from 'cross-domain-utils/src';
11
11
  import { LOGO_COLOR } from '@paypal/sdk-logos/src';
12
12
  import { SUPPORTED_FUNDING_SOURCES } from '@paypal/funding-components/src';
13
13
  import type { ComponentFunctionType } from 'jsx-pragmatic/src';
@@ -9,7 +9,7 @@ import { getLogger, getLocale, getClientID, getEnv, getIntent, getCommit, getVau
9
9
  import { rememberFunding, getRememberedFunding, getRefinedFundingEligibility } from '@paypal/funding-components/src';
10
10
  import { ZalgoPromise } from 'zalgo-promise/src';
11
11
  import { create, type ZoidComponent } from 'zoid/src';
12
- import { uniqueID, memoize, isApplePaySupported, supportsPopups as userAgentSupportsPopups, noop } from 'belter/src';
12
+ import { uniqueID, memoize, isApplePaySupported, supportsPopups as userAgentSupportsPopups, noop, isLocalStorageEnabled } from 'belter/src';
13
13
  import { FUNDING, FUNDING_BRAND_LABEL, QUERY_BOOL, ENV, FPTI_KEY } from '@paypal/sdk-constants/src';
14
14
  import { node, dom } from 'jsx-pragmatic/src';
15
15
 
@@ -42,6 +42,17 @@ export const getButtonsComponent : () => ButtonsComponent = memoize(() => {
42
42
  logger: getLogger(),
43
43
 
44
44
  prerenderTemplate: ({ state, props, doc }) => {
45
+ const { buttonSessionID } = props;
46
+
47
+ if (!isLocalStorageEnabled()) {
48
+ getLogger().info('localstorage_inaccessible_possible_private_browsing').track({
49
+ [ FPTI_KEY.BUTTON_SESSION_UID ]: buttonSessionID,
50
+ [ FPTI_KEY.CONTEXT_TYPE ]: 'button_session_id',
51
+ [ FPTI_KEY.CONTEXT_ID ]: buttonSessionID,
52
+ [ FPTI_KEY.TRANSITION ]: 'localstorage_inaccessible_possible_private_browsing'
53
+ });
54
+ }
55
+
45
56
  return (
46
57
  <PrerenderedButtons
47
58
  nonce={ props.nonce }
@@ -4,7 +4,7 @@
4
4
  import { node, dom, type ChildType } from 'jsx-pragmatic/src';
5
5
  import { FUNDING, CARD, FPTI_KEY } from '@paypal/sdk-constants/src';
6
6
  import { popup, supportsPopups, writeElementToWindow } from 'belter/src';
7
- import { assertSameDomain, type CrossDomainWindowType } from '@krakenjs/cross-domain-utils/src';
7
+ import { assertSameDomain, type CrossDomainWindowType } from 'cross-domain-utils/src';
8
8
  import { SpinnerPage } from '@paypal/common-components/src';
9
9
  import { getLogger } from '@paypal/sdk-client/src';
10
10
  import type { ZoidProps } from 'zoid/src';
@@ -1,5 +1,5 @@
1
1
  /* @flow */
2
- import { supportsPopups as userAgentSupportsPopups, isAndroid, isChrome, isIos, isSafari, isSFVC, type Experiment, isDevice, isTablet, getElement } from 'belter/src';
2
+ import { supportsPopups as userAgentSupportsPopups, isAndroid, isChrome, isIos, isSafari, isSFVC, type Experiment, isDevice, isTablet, getElement, isLocalStorageEnabled } from 'belter/src';
3
3
  import { ENV, FUNDING } from '@paypal/sdk-constants/src';
4
4
  import { getEnableFunding, getDisableFunding, createExperiment, getFundingEligibility, getPlatform, getComponents, getEnv } from '@paypal/sdk-client/src';
5
5
  import { getRefinedFundingEligibility } from '@paypal/funding-components/src';
@@ -138,7 +138,13 @@ export function getNoPaylaterExperiment(fundingSource : ?$Values<typeof FUNDING>
138
138
 
139
139
  export function getVenmoAppLabelExperiment() : EligibilityExperiment {
140
140
  const isEnvForTest = getEnv() === ENV.LOCAL || getEnv() === ENV.TEST || getEnv() === ENV.STAGE;
141
- const isEnabledForTest = isEnvForTest ? window.localStorage.getItem('enable_venmo_app_label') : false;
141
+
142
+ let isEnabledForTest = false;
143
+
144
+ if (isLocalStorageEnabled() && isEnvForTest) {
145
+ isEnabledForTest = window.localStorage.getItem('enable_venmo_app_label');
146
+ }
147
+
142
148
  return {
143
149
  enableVenmoAppLabel: isEnabledForTest
144
150
  };
@@ -5,7 +5,7 @@
5
5
  import { node, dom } from 'jsx-pragmatic/src';
6
6
  import { ZalgoPromise } from 'zalgo-promise/src';
7
7
  import { create, type ZoidComponent } from 'zoid/src';
8
- import type { CrossDomainWindowType } from '@krakenjs/cross-domain-utils/src';
8
+ import type { CrossDomainWindowType } from 'cross-domain-utils/src';
9
9
  import { memoize, uniqueID } from 'belter/src';
10
10
  import { getLocale, getEnv, getSDKMeta, getDisableCard, getPayPalDomain, getClientID, getDebug, getCurrency, getIntent,
11
11
  getCommit, getVault } from '@paypal/sdk-client/src';
@@ -5,7 +5,7 @@
5
5
  import { LANG } from '@paypal/sdk-constants/src';
6
6
  import { ZalgoPromise } from 'zalgo-promise/src';
7
7
  import { create, type ZoidComponent } from 'zoid/src';
8
- import type { CrossDomainWindowType } from '@krakenjs/cross-domain-utils/src';
8
+ import type { CrossDomainWindowType } from 'cross-domain-utils/src';
9
9
  import { inlineMemoize } from 'belter/src';
10
10
  import { getLocale, getEnv, getCommit, getSDKMeta, getDisableCard, getPayPalDomain } from '@paypal/sdk-client/src';
11
11