@paypal/checkout-components 5.0.226 → 5.0.227

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,3 +1,9 @@
1
+ ## <small>5.0.227 (2022-06-10)</small>
2
+
3
+ * chore: log screen information for SFVC path (#1951) ([6eb2270](https://github.com/paypal/paypal-checkout-components/commit/6eb2270)), closes [#1951](https://github.com/paypal/paypal-checkout-components/issues/1951)
4
+
5
+
6
+
1
7
  ## <small>5.0.226 (2022-06-06)</small>
2
8
 
3
9
  * Inline XO: Fix production eligibility logic ([ad8b0d0](https://github.com/paypal/paypal-checkout-components/commit/ad8b0d0))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/checkout-components",
3
- "version": "5.0.226",
3
+ "version": "5.0.227",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -1,5 +1,5 @@
1
1
  /* @flow */
2
- import { supportsPopups as userAgentSupportsPopups, isAndroid, isChrome, isIos, isSafari, isSFVC, type Experiment, isDevice, isTablet, getElement, isLocalStorageEnabled } from '@krakenjs/belter/src';
2
+ import { supportsPopups as userAgentSupportsPopups, isAndroid, isChrome, isIos, isIOS14, isSafari, isSFVC, type Experiment, isDevice, isTablet, getElement, isLocalStorageEnabled, isStandAlone } from '@krakenjs/belter/src';
3
3
  import { COUNTRY, CURRENCY, ENV, FPTI_KEY, FUNDING, type LocaleType } from '@paypal/sdk-constants/src';
4
4
  import { getEnableFunding, getDisableFunding, getLogger, createExperiment, getFundingEligibility, getPlatform, getComponents, getEnv, type FundingEligibilityType } from '@paypal/sdk-client/src';
5
5
  import { getRefinedFundingEligibility } from '@paypal/funding-components/src';
@@ -15,6 +15,28 @@ type DetermineFlowOptions = {|
15
15
  createSubscription : CreateSubscription
16
16
  |};
17
17
 
18
+ /**
19
+ * log information about screen to debug. currently in use to test if sfvc logic triggers
20
+ *
21
+ * @param {string} key for logging
22
+ */
23
+ function logNativeScreenInformation(key = 'screenInformation') {
24
+ if (window) {
25
+ const height = window.innerHeight;
26
+ const outerHeight = window.outerHeight;
27
+ const scale = Math.round(window.screen.width / window.innerWidth * 100) / 100;
28
+ const computedHeight = Math.round(height * scale);
29
+ const ios14 = isIOS14();
30
+ const standAlone = isStandAlone();
31
+
32
+ const screenInformation = { computedHeight, height, ios14, outerHeight, scale, standAlone };
33
+
34
+ getLogger()
35
+ // $FlowFixMe - object is mixed values when this expects all of the same value types
36
+ .info(key, screenInformation)
37
+ }
38
+ }
39
+
18
40
  export function determineFlow(props : DetermineFlowOptions) : $Values<typeof BUTTON_FLOW> {
19
41
 
20
42
  if (props.createBillingAgreement) {
@@ -36,6 +58,7 @@ export function isSupportedNativeBrowser() : boolean {
36
58
  }
37
59
 
38
60
  if (isSFVC()) {
61
+ logNativeScreenInformation('sfvcScreenInformation');
39
62
  return false;
40
63
  }
41
64