@economist/web-apple-pay 1.7.4 → 1.7.5

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/dist/index.js CHANGED
@@ -1901,7 +1901,9 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
1901
1901
  const button = document.createElement(_ApplePayButton.tag);
1902
1902
  button.offer = offer;
1903
1903
  button.country = country;
1904
- button.entryPoint = entryPoint;
1904
+ if (entryPoint) {
1905
+ button.entryPoint = entryPoint;
1906
+ }
1905
1907
  return button;
1906
1908
  }
1907
1909
  /**
@@ -2211,6 +2213,13 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2211
2213
  }
2212
2214
  };
2213
2215
 
2216
+ // src/constants.ts
2217
+ var ApplePayEntryPoint = /* @__PURE__ */ ((ApplePayEntryPoint2) => {
2218
+ ApplePayEntryPoint2["PAYWALL"] = "article_paywall";
2219
+ ApplePayEntryPoint2["REGWALL"] = "article_regwall";
2220
+ return ApplePayEntryPoint2;
2221
+ })(ApplePayEntryPoint || {});
2222
+
2214
2223
  // src/index.ts
2215
2224
  function defineApplePayElements() {
2216
2225
  ApplePayButton.define();
@@ -2219,6 +2228,7 @@ function defineApplePayElements() {
2219
2228
  export {
2220
2229
  APPLE_PAY_EXCLUDED_VARIANTS,
2221
2230
  ApplePayButton,
2231
+ ApplePayEntryPoint,
2222
2232
  ApplePayModal,
2223
2233
  configureApplePay,
2224
2234
  defineApplePayElements,
@@ -1,4 +1,5 @@
1
1
  import type { Offer, ProductVariant } from './types/offer.types';
2
+ import { ApplePayEntryPoint } from './constants';
2
3
  export declare const APPLE_PAY_EXCLUDED_VARIANTS: readonly ProductVariant[];
3
4
  export declare class ApplePayButton extends HTMLElement {
4
5
  #private;
@@ -7,13 +8,13 @@ export declare class ApplePayButton extends HTMLElement {
7
8
  /**
8
9
  * Creates and configures an ApplePayButton if the feature flag is present.
9
10
  */
10
- static createIfEnabled(offer: Offer | undefined, country: string, entryPoint: string): ApplePayButton | null;
11
+ static createIfEnabled(offer: Offer | undefined, country: string, entryPoint?: ApplePayEntryPoint): ApplePayButton | null;
11
12
  get offer(): Offer | null;
12
13
  set offer(value: Offer | null);
13
14
  get country(): string;
14
15
  set country(value: string);
15
- get entryPoint(): string;
16
- set entryPoint(value: string);
16
+ get entryPoint(): ApplePayEntryPoint | '';
17
+ set entryPoint(value: ApplePayEntryPoint);
17
18
  /**
18
19
  * Awaitable contract for the component's current render lifecycle.
19
20
  *
@@ -1896,7 +1896,9 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
1896
1896
  const button = document.createElement(_ApplePayButton.tag);
1897
1897
  button.offer = offer;
1898
1898
  button.country = country;
1899
- button.entryPoint = entryPoint;
1899
+ if (entryPoint) {
1900
+ button.entryPoint = entryPoint;
1901
+ }
1900
1902
  return button;
1901
1903
  }
1902
1904
  /**
@@ -1904,7 +1904,9 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
1904
1904
  const button = document.createElement(_ApplePayButton.tag);
1905
1905
  button.offer = offer;
1906
1906
  button.country = country;
1907
- button.entryPoint = entryPoint;
1907
+ if (entryPoint) {
1908
+ button.entryPoint = entryPoint;
1909
+ }
1908
1910
  return button;
1909
1911
  }
1910
1912
  /**
@@ -1896,7 +1896,9 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
1896
1896
  const button = document.createElement(_ApplePayButton.tag);
1897
1897
  button.offer = offer;
1898
1898
  button.country = country;
1899
- button.entryPoint = entryPoint;
1899
+ if (entryPoint) {
1900
+ button.entryPoint = entryPoint;
1901
+ }
1900
1902
  return button;
1901
1903
  }
1902
1904
  /**
@@ -0,0 +1,4 @@
1
+ export declare enum ApplePayEntryPoint {
2
+ PAYWALL = "article_paywall",
3
+ REGWALL = "article_regwall"
4
+ }
@@ -0,0 +1,9 @@
1
+ // src/constants.ts
2
+ var ApplePayEntryPoint = /* @__PURE__ */ ((ApplePayEntryPoint2) => {
3
+ ApplePayEntryPoint2["PAYWALL"] = "article_paywall";
4
+ ApplePayEntryPoint2["REGWALL"] = "article_regwall";
5
+ return ApplePayEntryPoint2;
6
+ })(ApplePayEntryPoint || {});
7
+ export {
8
+ ApplePayEntryPoint
9
+ };
@@ -2,6 +2,7 @@ export { ApplePayButton, APPLE_PAY_EXCLUDED_VARIANTS, } from './apple-pay-button
2
2
  export { ApplePayModal } from './apple-pay-modal';
3
3
  export { ensureApplePayLogoSymbol } from './apple-pay-logo';
4
4
  export { configureApplePay } from './clients/payment-checkout/config';
5
+ export { ApplePayEntryPoint } from './constants';
5
6
  export type { ApplePayRuntimeConfig } from './clients/payment-checkout/config';
6
7
  export type { Offer } from './types/offer.types';
7
8
  export declare function defineApplePayElements(): void;
package/dist/src/index.js CHANGED
@@ -1901,7 +1901,9 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
1901
1901
  const button = document.createElement(_ApplePayButton.tag);
1902
1902
  button.offer = offer;
1903
1903
  button.country = country;
1904
- button.entryPoint = entryPoint;
1904
+ if (entryPoint) {
1905
+ button.entryPoint = entryPoint;
1906
+ }
1905
1907
  return button;
1906
1908
  }
1907
1909
  /**
@@ -2211,6 +2213,13 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2211
2213
  }
2212
2214
  };
2213
2215
 
2216
+ // src/constants.ts
2217
+ var ApplePayEntryPoint = /* @__PURE__ */ ((ApplePayEntryPoint2) => {
2218
+ ApplePayEntryPoint2["PAYWALL"] = "article_paywall";
2219
+ ApplePayEntryPoint2["REGWALL"] = "article_regwall";
2220
+ return ApplePayEntryPoint2;
2221
+ })(ApplePayEntryPoint || {});
2222
+
2214
2223
  // src/index.ts
2215
2224
  function defineApplePayElements() {
2216
2225
  ApplePayButton.define();
@@ -2219,6 +2228,7 @@ function defineApplePayElements() {
2219
2228
  export {
2220
2229
  APPLE_PAY_EXCLUDED_VARIANTS,
2221
2230
  ApplePayButton,
2231
+ ApplePayEntryPoint,
2222
2232
  ApplePayModal,
2223
2233
  configureApplePay,
2224
2234
  defineApplePayElements,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@economist/web-apple-pay",
3
3
  "description": "Web component package for Apple Pay checkout UI",
4
- "version": "1.7.4",
4
+ "version": "1.7.5",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",