@paypal/checkout-components 5.0.422-alpha-564fa49.0 → 5.0.422

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/checkout-components",
3
- "version": "5.0.422-alpha-564fa49.0",
3
+ "version": "5.0.422",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -117,7 +117,7 @@
117
117
  "@krakenjs/jsx-pragmatic": "^3",
118
118
  "@krakenjs/post-robot": "^11.0.0",
119
119
  "@krakenjs/zalgo-promise": "^2.0.0",
120
- "@krakenjs/zoid": "^10.3.1",
120
+ "@krakenjs/zoid": "^10.5.3",
121
121
  "@paypal/fastlane-sdk-loader": "^1.2.1",
122
122
  "@paypal/common-components": "^1.0.35",
123
123
  "@paypal/funding-components": "^1.0.31",
@@ -662,7 +662,6 @@ export type ButtonProps = {|
662
662
  hideSubmitButtonForCardForm?: boolean,
663
663
  userAgent: string,
664
664
  browserContext?: string,
665
- merchantDomain?: string,
666
665
  buttonColor: ButtonColor,
667
666
  |};
668
667
 
@@ -224,6 +224,31 @@ export function SavedPaymentMethods(
224
224
  gap: 8px;
225
225
  min-width: 124px;
226
226
  max-width: 100%;
227
+ position: relative;
228
+ overflow: hidden;
229
+ }
230
+
231
+ .spm-tag-loading::after {
232
+ content: "";
233
+ display: block;
234
+ background-color: #dddfe2;
235
+ position: absolute;
236
+ top: 0;
237
+ bottom: 0;
238
+ width: 100%;
239
+ height: 100%;
240
+ transform: translateX(0);
241
+ box-shadow: 0px 0px 107px 60px #dddfe2;
242
+ animation: 1.5s loading-placeholder ease-in-out infinite;
243
+ }
244
+
245
+ @keyframes loading-placeholder {
246
+ 0% {
247
+ transform: translateX(-150%);
248
+ }
249
+ 100% {
250
+ transform: translateX(150%);
251
+ }
227
252
  }
228
253
 
229
254
  .spm-tag-loading.spm-tag-loading--hidden {
@@ -109,7 +109,6 @@ import {
109
109
  getModal,
110
110
  sendPostRobotMessageToButtonIframe,
111
111
  isEagerOrderCreationEnabled,
112
- resolveMerchantDomain,
113
112
  } from "./util";
114
113
 
115
114
  export type ButtonsComponent = ZoidComponent<
@@ -889,13 +888,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
889
888
  queryParam: true,
890
889
  },
891
890
 
892
- merchantDomain: {
893
- type: "string",
894
- required: false,
895
- sendToChild: true,
896
- value: ({ props }) => resolveMerchantDomain(props.merchantDomain),
897
- },
898
-
899
891
  intent: {
900
892
  type: "string",
901
893
  queryParam: true,
@@ -27,7 +27,6 @@ import {
27
27
  getFundingEligibility,
28
28
  getSDKToken,
29
29
  getIntent,
30
- isPayPalDomain,
31
30
  } from "@paypal/sdk-client/src";
32
31
  import { FUNDING, FPTI_KEY, INTENT } from "@paypal/sdk-constants/src";
33
32
  import { getRefinedFundingEligibility } from "@paypal/funding-components/src";
@@ -427,14 +426,3 @@ export const isEagerOrderCreationEnabled = (
427
426
  experiment.spbEagerOrderCreation
428
427
  );
429
428
  };
430
-
431
- // merchantDomain is only accepted on PayPal-hosted flows (e.g. NCPS).
432
- // There the page origin resolves to a PayPal Domain, so the hosting service must supply
433
- // the true merchant origin. On merchant-hosted pages browser origin is alreadyy the merchant's,
434
- // so an explictly passed value is rejected
435
- export function resolveMerchantDomain(merchantDomain: ?string): ?string {
436
- if (merchantDomain && !isPayPalDomain()) {
437
- throw new Error("merchantDomain can only be passed on PayPal-hosted flows");
438
- }
439
- return merchantDomain || undefined;
440
- }
@@ -1,40 +0,0 @@
1
- /* @flow */
2
-
3
- import { describe, expect, it, vi } from "vitest";
4
- import { isPayPalDomain } from "@paypal/sdk-client/src";
5
-
6
- import { resolveMerchantDomain } from "./util";
7
-
8
- vi.mock("@paypal/sdk-client/src", () => ({
9
- isPayPalDomain: vi.fn(),
10
- }));
11
-
12
- describe("resolveMerchantDomain", () => {
13
- it("returns the merchantDomain on a PayPal-hosted page", () => {
14
- vi.mocked(isPayPalDomain).mockReturnValue(true);
15
-
16
- expect(resolveMerchantDomain("https://merchant.example.com")).toBe(
17
- "https://merchant.example.com"
18
- );
19
- });
20
-
21
- it("returns undefined on a PayPal-hosted page when no merchantDomain is provided", () => {
22
- vi.mocked(isPayPalDomain).mockReturnValue(true);
23
-
24
- expect(resolveMerchantDomain()).toBeUndefined();
25
- });
26
-
27
- it("returns undefined on a merchant-hosted page when no merchantDomain is provided", () => {
28
- vi.mocked(isPayPalDomain).mockReturnValue(false);
29
-
30
- expect(resolveMerchantDomain()).toBeUndefined();
31
- });
32
-
33
- it("throws when a merchantDomain is passed on a non-PayPal (merchant-hosted) page", () => {
34
- vi.mocked(isPayPalDomain).mockReturnValue(false);
35
-
36
- expect(() => resolveMerchantDomain("https://merchant.example.com")).toThrow(
37
- "merchantDomain can only be passed on PayPal-hosted flows"
38
- );
39
- });
40
- });