@paypal/messaging-components 1.34.0 → 1.34.1-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/globals.js CHANGED
@@ -1,5 +1,5 @@
1
- const postRobotGlobals = require('post-robot/globals');
2
- const zoidGlobals = require('zoid/globals');
1
+ const postRobotGlobals = require('@krakenjs/post-robot/globals');
2
+ const zoidGlobals = require('@krakenjs/zoid/globals');
3
3
 
4
4
  const { version } = require('./package.json');
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/messaging-components",
3
- "version": "1.34.0",
3
+ "version": "1.34.1-alpha.0",
4
4
  "description": "PayPal messaging library for integrating PayPal Credit messaging on merchant websites",
5
5
  "homepage": "https://github.com/paypal/paypal-messaging-components",
6
6
  "repository": {
@@ -42,21 +42,23 @@
42
42
  "test:func:snapshots:ciupdate": "jest --verbose --config tests/functional/v2/jest.snapshotTests.config.js --updateSnapshot"
43
43
  },
44
44
  "dependencies": {
45
- "@paypal/common-components": "^1.0.18",
46
- "@paypal/sdk-client": "^4.0.80",
47
- "@paypal/sdk-constants": "^1.0.75",
48
- "@paypal/sdk-logos": "^1.0.26",
49
- "beaver-logger": "^4.0.14",
50
- "belter": "^1.0.112",
51
- "core-js-pure": "^3.0.1",
52
- "jsx-pragmatic": "^2.0.7",
53
- "post-robot": "^10.0.29",
54
- "zalgo-promise": "^1.0.38",
55
- "zoid": "^9.0.46"
45
+ "@krakenjs/beaver-logger": "^5.0.0",
46
+ "@krakenjs/belter": "^2.0.0",
47
+ "@krakenjs/jsx-pragmatic": "^3.0.0",
48
+ "@krakenjs/post-robot": "^11.0.0",
49
+ "@krakenjs/zalgo-promise": "^2.0.0",
50
+ "@krakenjs/zoid": "^10.0.0",
51
+ "@paypal/common-components": "^1.0.27",
52
+ "@paypal/sdk-client": "^4.0.166",
53
+ "@paypal/sdk-constants": "^1.0.118",
54
+ "@paypal/sdk-logos": "^1.0.45",
55
+ "core-js-pure": "^3.0.1"
56
56
  },
57
57
  "devDependencies": {
58
+ "@babel/eslint-parser": "^7.17.0",
58
59
  "@babel/register": "^7.10.4",
59
60
  "@babel/runtime": "7.12.18",
61
+ "@krakenjs/grumbler-scripts": "^6.0.2",
60
62
  "@semantic-release/changelog": "^6.0.1",
61
63
  "@semantic-release/exec": "^6.0.3",
62
64
  "@semantic-release/git": "^10.0.1",
@@ -64,23 +66,21 @@
64
66
  "@testing-library/jest-dom": "^4.1.0",
65
67
  "@testing-library/preact": "^2.0.0",
66
68
  "@testing-library/preact-hooks": "^1.0.6",
67
- "babel-eslint": "^10.0.1",
68
- "babel-jest": "^25.1.0",
69
- "babel-plugin-module-resolver": "^4.0.0",
69
+ "babel-jest": "^27.5.1",
70
+ "babel-plugin-module-resolver": "^4.1.0",
70
71
  "conventional-changelog-conventionalcommits": "^4.6.0",
71
- "eslint": "^6.8.0",
72
+ "eslint": "^8.12.0",
72
73
  "eslint-config-airbnb": "^18.0.1",
73
74
  "eslint-config-airbnb-base": "^14.0.0",
74
- "eslint-config-prettier": "^6.9.0",
75
- "eslint-import-resolver-babel-module": "^5.1.2",
76
- "eslint-import-resolver-jest": "^3.0.0",
77
- "eslint-plugin-import": "2.22.1",
78
- "eslint-plugin-jsx-a11y": "^6.2.3",
79
- "eslint-plugin-prettier": "^3.1.2",
75
+ "eslint-config-prettier": "^8.5.0",
76
+ "eslint-import-resolver-babel-module": "^5.3.1",
77
+ "eslint-import-resolver-jest": "^3.0.2",
78
+ "eslint-plugin-import": "2.25.4",
79
+ "eslint-plugin-jsx-a11y": "^6.5.1",
80
+ "eslint-plugin-prettier": "^4.0.0",
80
81
  "eslint-plugin-react": "^7.17.0",
81
82
  "eslint-plugin-react-hooks": "^1.7.0",
82
83
  "got": "^9.6.0",
83
- "grumbler-scripts": "^3.0.46",
84
84
  "husky": "^2.3.0",
85
85
  "imgur": "^0.3.1",
86
86
  "jest": "^26.1.0",
@@ -1,5 +1,5 @@
1
1
  import objectEntries from 'core-js-pure/stable/object/entries';
2
- import { ZalgoPromise } from 'zalgo-promise/src';
2
+ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
3
3
 
4
4
  import {
5
5
  objectMerge,
@@ -1,5 +1,5 @@
1
1
  import arrayFind from 'core-js-pure/stable/array/find';
2
- import { ZalgoPromise } from 'zalgo-promise/src';
2
+ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
3
3
 
4
4
  import {
5
5
  logger,
@@ -1,5 +1,5 @@
1
1
  // TODO: use this file as entry point after experiment removed
2
- import { destroy as zoidDestroy } from 'zoid/src';
2
+ import { destroy as zoidDestroy } from '@krakenjs/zoid/src';
3
3
 
4
4
  import { setup as setupMessages, destroy as destroyMessages } from '../controllers/message';
5
5
  import { setup as setupModal } from '../controllers/modal';
@@ -1,10 +1,8 @@
1
1
  import stringStartsWith from 'core-js-pure/stable/string/starts-with';
2
- import { ZalgoPromise } from 'zalgo-promise/src';
3
-
4
2
  import { SDK_SETTINGS } from '@paypal/sdk-constants/src';
5
-
6
- import { uniqueID, getCurrentScriptUID } from 'belter/src';
7
- import { create } from 'zoid/src';
3
+ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
4
+ import { uniqueID, getCurrentScriptUID } from '@krakenjs/belter/src';
5
+ import { create } from '@krakenjs/zoid/src';
8
6
 
9
7
  import {
10
8
  getMeta,
@@ -208,8 +206,8 @@ export default createGlobalVariableGetter('__paypal_credit_message__', () =>
208
206
  queryParam: false,
209
207
  value: ({ props }) => {
210
208
  const { onReady } = props;
211
- return ({ meta, activeTags, deviceID, requestDuration }) => {
212
- const { account, merchantId, index, modal, getContainer, messageRequestId } = props;
209
+ return ({ meta, activeTags, deviceID, requestDuration, messageRequestId }) => {
210
+ const { account, merchantId, index, modal, getContainer } = props;
213
211
  const { trackingDetails, offerType, ppDebugId } = meta;
214
212
 
215
213
  ppDebug(`Message Correlation ID: ${ppDebugId}`);
@@ -1,6 +1,6 @@
1
1
  /** @jsx node */
2
- import { node, dom } from 'jsx-pragmatic/src';
3
- import { EVENT } from 'zoid/src';
2
+ import { node, dom } from '@krakenjs/jsx-pragmatic/src';
3
+ import { EVENT } from '@krakenjs/zoid/src';
4
4
 
5
5
  import { getOverflowObserver, createTitleGenerator } from '../../../utils';
6
6
 
@@ -1,8 +1,8 @@
1
1
  import stringIncludes from 'core-js-pure/stable/string/includes';
2
2
  import stringStartsWith from 'core-js-pure/stable/string/starts-with';
3
3
  import { SDK_SETTINGS } from '@paypal/sdk-constants';
4
- import { create } from 'zoid/src';
5
- import { uniqueID, getCurrentScriptUID } from 'belter/src';
4
+ import { create } from '@krakenjs/zoid/src';
5
+ import { uniqueID, getCurrentScriptUID } from '@krakenjs/belter/src';
6
6
 
7
7
  import {
8
8
  getMeta,
@@ -2,10 +2,10 @@
2
2
  /* eslint-disable react/no-unknown-property */
3
3
  /* eslint-disable no-param-reassign */
4
4
  /** @jsx node */
5
- import { destroyElement } from 'belter/src';
6
- import { node, dom } from 'jsx-pragmatic/src';
7
- import { ZalgoPromise } from 'zalgo-promise/src';
8
- import { EVENT } from 'zoid/src';
5
+ import { destroyElement } from '@krakenjs/belter/src';
6
+ import { node, dom } from '@krakenjs/jsx-pragmatic/src';
7
+ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
8
+ import { EVENT } from '@krakenjs/zoid/src';
9
9
 
10
10
  import { createTitleGenerator, viewportHijack } from '../../../utils';
11
11
 
@@ -6,9 +6,9 @@
6
6
  /* eslint-disable jsx-a11y/no-static-element-interactions */
7
7
  /* eslint-disable react/no-unknown-property */
8
8
  /** @jsx node */
9
- import { node, dom } from 'jsx-pragmatic/src';
9
+ import { node, dom } from '@krakenjs/jsx-pragmatic/src';
10
10
  import { Spinner } from '@paypal/common-components';
11
- import { ZalgoPromise } from 'zalgo-promise/src';
11
+ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
12
12
 
13
13
  export default ({ doc, props, event }) => {
14
14
  const ERROR_DELAY = 15000;
@@ -1,10 +1,11 @@
1
- import { ZalgoPromise } from 'zalgo-promise/src';
1
+ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
2
2
  import { memoize } from './functional';
3
3
 
4
4
  /**
5
5
  * Check whether or not the current user is running an ad blocker
6
6
  * @returns {Promise<Boolean>} Whether adblock is running or not
7
7
  */
8
+ // eslint-disable-next-line prefer-arrow-callback
8
9
  export const checkAdblock = memoize(function check() {
9
10
  const loops = 5;
10
11
  const checkTime = 50;
@@ -3,7 +3,7 @@ import arrayFrom from 'core-js-pure/stable/array/from';
3
3
  import arrayFlatMap from 'core-js-pure/stable/array/flat-map';
4
4
  import arrayIncludes from 'core-js-pure/stable/array/includes';
5
5
  import stringStartsWith from 'core-js-pure/stable/string/starts-with';
6
- import { ZalgoPromise } from 'zalgo-promise/src';
6
+ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
7
7
 
8
8
  import { curry } from './functional';
9
9
  import { objectMerge, flattenedToObject } from './objects';
@@ -1,4 +1,4 @@
1
- import { ZalgoPromise } from 'zalgo-promise/src';
1
+ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
2
2
 
3
3
  import { globalEvent } from './global';
4
4
 
@@ -1,7 +1,7 @@
1
1
  import objectKeys from 'core-js-pure/stable/object/keys';
2
2
  import objectAssign from 'core-js-pure/stable/object/assign';
3
3
  import Map from 'core-js-pure/stable/map';
4
- import { eventEmitter } from 'belter/src';
4
+ import { eventEmitter } from '@krakenjs/belter/src';
5
5
 
6
6
  import { getLibraryVersion, getPayPalDomain } from './sdk';
7
7
  import { createState } from './miscellaneous';
@@ -1,6 +1,6 @@
1
1
  import objectKeys from 'core-js-pure/stable/object/keys';
2
2
  import arrayIncludes from 'core-js-pure/stable/array/includes';
3
- import { Logger, LOG_LEVEL } from 'beaver-logger/src';
3
+ import { Logger, LOG_LEVEL } from '@krakenjs/beaver-logger/src';
4
4
 
5
5
  import { getGlobalUrl } from './global';
6
6
  import { request } from './miscellaneous';
@@ -4,8 +4,8 @@ import arrayIncludes from 'core-js-pure/stable/array/includes';
4
4
  import stringIncludes from 'core-js-pure/stable/string/includes';
5
5
  import objectAssign from 'core-js-pure/stable/object/assign';
6
6
  import objectEntries from 'core-js-pure/stable/object/entries';
7
- import { node, dom } from 'jsx-pragmatic/src';
8
- import { ZalgoPromise } from 'zalgo-promise/src';
7
+ import { node, dom } from '@krakenjs/jsx-pragmatic/src';
8
+ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
9
9
 
10
10
  import { partial, memoize } from './functional';
11
11
  import { OFFER } from './constants';
@@ -51,6 +51,7 @@ export function request(method, url, { data, headers, withCredentials } = {}) {
51
51
  xhttp.withCredentials = true;
52
52
  }
53
53
 
54
+ // eslint-disable-next-line unicorn/prefer-add-event-listener
54
55
  xhttp.onreadystatechange = () => {
55
56
  if (xhttp.readyState === 4) {
56
57
  const responseHeaders = xhttp
@@ -1,5 +1,5 @@
1
1
  import stringStartsWith from 'core-js-pure/stable/string/starts-with';
2
- import { ZalgoPromise } from 'zalgo-promise/src';
2
+ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
3
3
  import arrayFrom from 'core-js-pure/stable/array/from';
4
4
 
5
5
  import { getGlobalState, createGlobalVariableGetter } from './global';
@@ -1,4 +1,4 @@
1
- import { getPerformance, isIE } from 'belter/src';
1
+ import { getPerformance, isIE } from '@krakenjs/belter/src';
2
2
 
3
3
  const namespaced = name => `__paypal_messaging_performance__${name}`;
4
4
 
package/src/utils/sdk.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import stringStartsWith from 'core-js-pure/stable/string/starts-with';
3
3
  import arrayFrom from 'core-js-pure/stable/array/from';
4
4
 
5
- import { isLocalStorageEnabled, getStorage as getBelterStorage } from 'belter/src';
5
+ import { isLocalStorageEnabled, getStorage as getBelterStorage } from '@krakenjs/belter/src';
6
6
  import { SDK_QUERY_KEYS, SDK_SETTINGS } from '@paypal/sdk-constants/src';
7
7
  import {
8
8
  getClientID,
@@ -159,7 +159,6 @@ function getRawStorage() {
159
159
  export function writeStorageID(storageID) {
160
160
  if (isLocalStorageEnabled()) {
161
161
  try {
162
- /* eslint-disable no-unused-expressions, flowtype/no-unused-expressions */
163
162
  window.localStorage?.setItem(
164
163
  `__${getNamespace()}_storage__`,
165
164
  JSON.stringify({