@economist/web-apple-pay 1.5.1 → 1.6.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.
Files changed (33) hide show
  1. package/dist/index.js +962 -51
  2. package/dist/src/apple-pay-button.d.ts +13 -1
  3. package/dist/src/apple-pay-button.js +962 -51
  4. package/dist/src/apple-pay-button.stories.js +969 -67
  5. package/dist/src/apple-pay-modal.js +18 -1
  6. package/dist/src/apple-pay-modal.stories.js +962 -51
  7. package/dist/src/clients/payment-checkout/apple-session.d.ts +18 -0
  8. package/dist/src/clients/payment-checkout/apple-session.js +227 -0
  9. package/dist/src/clients/payment-checkout/billing-contact-details.d.ts +21 -0
  10. package/dist/src/clients/payment-checkout/billing-contact-details.js +109 -0
  11. package/dist/src/clients/payment-checkout/config.d.ts +1 -0
  12. package/dist/src/clients/payment-checkout/contact-validation.d.ts +21 -0
  13. package/dist/src/clients/payment-checkout/contact-validation.js +50 -0
  14. package/dist/src/clients/payment-checkout/index.d.ts +4 -0
  15. package/dist/src/clients/payment-checkout/index.js +25 -1
  16. package/dist/src/clients/payment-checkout/messages.d.ts +33 -0
  17. package/dist/src/clients/payment-checkout/messages.js +19 -0
  18. package/dist/src/clients/payment-checkout/payment-handler.d.ts +36 -0
  19. package/dist/src/clients/payment-checkout/payment-handler.js +375 -0
  20. package/dist/src/clients/payment-checkout/shipping-contact-details.d.ts +10 -0
  21. package/dist/src/clients/payment-checkout/shipping-contact-details.js +83 -0
  22. package/dist/src/clients/payment-checkout/types.d.ts +128 -0
  23. package/dist/src/index.d.ts +1 -1
  24. package/dist/src/index.js +962 -51
  25. package/dist/src/utils/billing-countries.d.ts +19 -0
  26. package/dist/src/utils/billing-countries.js +263 -0
  27. package/dist/src/utils/expressCheckoutRedirect.d.ts +55 -0
  28. package/dist/src/utils/expressCheckoutRedirect.js +46 -0
  29. package/dist/src/utils/expressCheckoutTracking.d.ts +64 -0
  30. package/dist/src/utils/expressCheckoutTracking.js +84 -0
  31. package/dist/src/utils/recaptcha.d.ts +22 -0
  32. package/dist/src/utils/recaptcha.js +54 -0
  33. package/package.json +2 -1
@@ -7,11 +7,13 @@ export declare class ApplePayButton extends HTMLElement {
7
7
  /**
8
8
  * Creates and configures an ApplePayButton if the feature flag is present.
9
9
  */
10
- static createIfEnabled(offer: Offer | undefined, country: string): ApplePayButton | null;
10
+ static createIfEnabled(offer: Offer | undefined, country: string, entryPoint: string): ApplePayButton | null;
11
11
  get offer(): Offer | null;
12
12
  set offer(value: Offer | null);
13
13
  get country(): string;
14
14
  set country(value: string);
15
+ get entryPoint(): string;
16
+ set entryPoint(value: string);
15
17
  /**
16
18
  * Awaitable contract for the component's current render lifecycle.
17
19
  *
@@ -30,4 +32,14 @@ export declare class ApplePayButton extends HTMLElement {
30
32
  */
31
33
  whenReady(): Promise<void>;
32
34
  connectedCallback(): Promise<void>;
35
+ /**
36
+ * Resets all render state when the element is removed from the DOM.
37
+ *
38
+ * A shared library component cannot assume it won't be moved in the DOM
39
+ * (e.g. lazy panels, SPA route changes). Resetting on disconnect means
40
+ * reattach always triggers a fresh `#run()` — new session check, new payment
41
+ * options fetch, fresh event listeners — preventing stale data from persisting
42
+ * and eliminating the implicit reliance on the DOM as a render-state flag.
43
+ */
44
+ disconnectedCallback(): void;
33
45
  }