@economist/web-apple-pay 1.7.4 → 1.7.6
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 +61 -26
- package/dist/src/apple-pay-button.d.ts +4 -3
- package/dist/src/apple-pay-button.js +53 -26
- package/dist/src/apple-pay-button.stories.js +53 -26
- package/dist/src/apple-pay-modal.js +28 -12
- package/dist/src/apple-pay-modal.stories.js +53 -26
- package/dist/src/constants.d.ts +4 -0
- package/dist/src/constants.js +9 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +61 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -320,28 +320,41 @@ var apple_pay_modal_template_default = `<style>
|
|
|
320
320
|
cursor: not-allowed;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
.apm__cta
|
|
324
|
-
|
|
323
|
+
.apm__cta-content {
|
|
324
|
+
display: flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
gap: 0.375rem;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.apm__cta-label {
|
|
330
|
+
display: inline-flex;
|
|
331
|
+
align-items: center;
|
|
332
|
+
gap: 0.375rem;
|
|
325
333
|
}
|
|
326
334
|
|
|
327
|
-
.apm__cta
|
|
335
|
+
.apm__cta-loading {
|
|
336
|
+
display: none;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.apm__cta[aria-busy="true"]::before {
|
|
328
340
|
content: '';
|
|
329
341
|
position: absolute;
|
|
330
|
-
left: 50%;
|
|
331
342
|
top: 50%;
|
|
332
|
-
|
|
333
|
-
margin-top: -0.625rem;
|
|
343
|
+
left: 50%;
|
|
334
344
|
width: 1.25rem;
|
|
335
345
|
height: 1.25rem;
|
|
336
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
346
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
337
347
|
border-top-color: #fff;
|
|
338
348
|
border-radius: 50%;
|
|
339
349
|
animation: apm-cta-spinner 0.8s linear infinite;
|
|
340
350
|
}
|
|
341
351
|
|
|
342
352
|
@keyframes apm-cta-spinner {
|
|
353
|
+
from {
|
|
354
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
355
|
+
}
|
|
343
356
|
to {
|
|
344
|
-
transform: rotate(360deg);
|
|
357
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
345
358
|
}
|
|
346
359
|
}
|
|
347
360
|
|
|
@@ -518,11 +531,14 @@ var apple_pay_modal_template_default = `<style>
|
|
|
518
531
|
</div>
|
|
519
532
|
<button class="apm__cta" id="apple-pay-modal-cta" aria-label="Continue with Apple Pay">
|
|
520
533
|
<span class="apm__cta-content">
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
<
|
|
524
|
-
|
|
534
|
+
<span class="apm__cta-label">
|
|
535
|
+
Continue with
|
|
536
|
+
<svg width="51" height="22" aria-hidden="true" role="img">
|
|
537
|
+
<use href="#apple-pay-logo" />
|
|
538
|
+
</svg>
|
|
539
|
+
</span>
|
|
525
540
|
</span>
|
|
541
|
+
<span class="apm__cta-loading" aria-hidden="true">Loading...</span>
|
|
526
542
|
</button>
|
|
527
543
|
</div>
|
|
528
544
|
</div>
|
|
@@ -1035,28 +1051,34 @@ var apple_pay_button_template_default = `<style>
|
|
|
1035
1051
|
cursor: default;
|
|
1036
1052
|
}
|
|
1037
1053
|
|
|
1038
|
-
teg-apple-pay-button .apple-pay-btn.wap-loading
|
|
1039
|
-
visibility: hidden;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
teg-apple-pay-button .apple-pay-btn.wap-loading::after {
|
|
1054
|
+
teg-apple-pay-button .apple-pay-btn.wap-loading::before {
|
|
1043
1055
|
content: '';
|
|
1044
1056
|
position: absolute;
|
|
1045
|
-
left: 50%;
|
|
1046
1057
|
top: 50%;
|
|
1047
|
-
|
|
1048
|
-
margin-top: -0.625rem;
|
|
1058
|
+
left: 50%;
|
|
1049
1059
|
width: 1.25rem;
|
|
1050
1060
|
height: 1.25rem;
|
|
1051
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
1061
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
1052
1062
|
border-top-color: #fff;
|
|
1053
1063
|
border-radius: 50%;
|
|
1054
1064
|
animation: wap-button-spinner 0.8s linear infinite;
|
|
1055
1065
|
}
|
|
1056
1066
|
|
|
1067
|
+
teg-apple-pay-button .apple-pay-btn__logo {
|
|
1068
|
+
display: inline-flex;
|
|
1069
|
+
align-items: center;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
teg-apple-pay-button .apple-pay-btn__loading {
|
|
1073
|
+
display: none;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1057
1076
|
@keyframes wap-button-spinner {
|
|
1077
|
+
from {
|
|
1078
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
1079
|
+
}
|
|
1058
1080
|
to {
|
|
1059
|
-
transform: rotate(360deg);
|
|
1081
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
1060
1082
|
}
|
|
1061
1083
|
}
|
|
1062
1084
|
</style>
|
|
@@ -1068,9 +1090,12 @@ var apple_pay_button_template_default = `<style>
|
|
|
1068
1090
|
aria-label="Pay with Apple Pay"
|
|
1069
1091
|
data-analytics="paywall:apple-pay-checkout"
|
|
1070
1092
|
>
|
|
1071
|
-
<
|
|
1072
|
-
<
|
|
1073
|
-
|
|
1093
|
+
<span class="apple-pay-btn__logo">
|
|
1094
|
+
<svg width="51" height="22" aria-label="Apple Pay" role="img">
|
|
1095
|
+
<use href="#apple-pay-logo" />
|
|
1096
|
+
</svg>
|
|
1097
|
+
</span>
|
|
1098
|
+
<span class="apple-pay-btn__loading" aria-hidden="true">Loading...</span>
|
|
1074
1099
|
</button>
|
|
1075
1100
|
</div>
|
|
1076
1101
|
`;
|
|
@@ -1901,7 +1926,9 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
|
|
|
1901
1926
|
const button = document.createElement(_ApplePayButton.tag);
|
|
1902
1927
|
button.offer = offer;
|
|
1903
1928
|
button.country = country;
|
|
1904
|
-
|
|
1929
|
+
if (entryPoint) {
|
|
1930
|
+
button.entryPoint = entryPoint;
|
|
1931
|
+
}
|
|
1905
1932
|
return button;
|
|
1906
1933
|
}
|
|
1907
1934
|
/**
|
|
@@ -2211,6 +2238,13 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
|
|
|
2211
2238
|
}
|
|
2212
2239
|
};
|
|
2213
2240
|
|
|
2241
|
+
// src/constants.ts
|
|
2242
|
+
var ApplePayEntryPoint = /* @__PURE__ */ ((ApplePayEntryPoint2) => {
|
|
2243
|
+
ApplePayEntryPoint2["PAYWALL"] = "article_paywall";
|
|
2244
|
+
ApplePayEntryPoint2["REGWALL"] = "article_regwall";
|
|
2245
|
+
return ApplePayEntryPoint2;
|
|
2246
|
+
})(ApplePayEntryPoint || {});
|
|
2247
|
+
|
|
2214
2248
|
// src/index.ts
|
|
2215
2249
|
function defineApplePayElements() {
|
|
2216
2250
|
ApplePayButton.define();
|
|
@@ -2219,6 +2253,7 @@ function defineApplePayElements() {
|
|
|
2219
2253
|
export {
|
|
2220
2254
|
APPLE_PAY_EXCLUDED_VARIANTS,
|
|
2221
2255
|
ApplePayButton,
|
|
2256
|
+
ApplePayEntryPoint,
|
|
2222
2257
|
ApplePayModal,
|
|
2223
2258
|
configureApplePay,
|
|
2224
2259
|
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
|
|
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():
|
|
16
|
-
set entryPoint(value:
|
|
16
|
+
get entryPoint(): ApplePayEntryPoint | '';
|
|
17
|
+
set entryPoint(value: ApplePayEntryPoint);
|
|
17
18
|
/**
|
|
18
19
|
* Awaitable contract for the component's current render lifecycle.
|
|
19
20
|
*
|
|
@@ -320,28 +320,41 @@ var apple_pay_modal_template_default = `<style>
|
|
|
320
320
|
cursor: not-allowed;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
.apm__cta
|
|
324
|
-
|
|
323
|
+
.apm__cta-content {
|
|
324
|
+
display: flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
gap: 0.375rem;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.apm__cta-label {
|
|
330
|
+
display: inline-flex;
|
|
331
|
+
align-items: center;
|
|
332
|
+
gap: 0.375rem;
|
|
325
333
|
}
|
|
326
334
|
|
|
327
|
-
.apm__cta
|
|
335
|
+
.apm__cta-loading {
|
|
336
|
+
display: none;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.apm__cta[aria-busy="true"]::before {
|
|
328
340
|
content: '';
|
|
329
341
|
position: absolute;
|
|
330
|
-
left: 50%;
|
|
331
342
|
top: 50%;
|
|
332
|
-
|
|
333
|
-
margin-top: -0.625rem;
|
|
343
|
+
left: 50%;
|
|
334
344
|
width: 1.25rem;
|
|
335
345
|
height: 1.25rem;
|
|
336
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
346
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
337
347
|
border-top-color: #fff;
|
|
338
348
|
border-radius: 50%;
|
|
339
349
|
animation: apm-cta-spinner 0.8s linear infinite;
|
|
340
350
|
}
|
|
341
351
|
|
|
342
352
|
@keyframes apm-cta-spinner {
|
|
353
|
+
from {
|
|
354
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
355
|
+
}
|
|
343
356
|
to {
|
|
344
|
-
transform: rotate(360deg);
|
|
357
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
345
358
|
}
|
|
346
359
|
}
|
|
347
360
|
|
|
@@ -518,11 +531,14 @@ var apple_pay_modal_template_default = `<style>
|
|
|
518
531
|
</div>
|
|
519
532
|
<button class="apm__cta" id="apple-pay-modal-cta" aria-label="Continue with Apple Pay">
|
|
520
533
|
<span class="apm__cta-content">
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
<
|
|
524
|
-
|
|
534
|
+
<span class="apm__cta-label">
|
|
535
|
+
Continue with
|
|
536
|
+
<svg width="51" height="22" aria-hidden="true" role="img">
|
|
537
|
+
<use href="#apple-pay-logo" />
|
|
538
|
+
</svg>
|
|
539
|
+
</span>
|
|
525
540
|
</span>
|
|
541
|
+
<span class="apm__cta-loading" aria-hidden="true">Loading...</span>
|
|
526
542
|
</button>
|
|
527
543
|
</div>
|
|
528
544
|
</div>
|
|
@@ -1030,28 +1046,34 @@ var apple_pay_button_template_default = `<style>
|
|
|
1030
1046
|
cursor: default;
|
|
1031
1047
|
}
|
|
1032
1048
|
|
|
1033
|
-
teg-apple-pay-button .apple-pay-btn.wap-loading
|
|
1034
|
-
visibility: hidden;
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
teg-apple-pay-button .apple-pay-btn.wap-loading::after {
|
|
1049
|
+
teg-apple-pay-button .apple-pay-btn.wap-loading::before {
|
|
1038
1050
|
content: '';
|
|
1039
1051
|
position: absolute;
|
|
1040
|
-
left: 50%;
|
|
1041
1052
|
top: 50%;
|
|
1042
|
-
|
|
1043
|
-
margin-top: -0.625rem;
|
|
1053
|
+
left: 50%;
|
|
1044
1054
|
width: 1.25rem;
|
|
1045
1055
|
height: 1.25rem;
|
|
1046
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
1056
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
1047
1057
|
border-top-color: #fff;
|
|
1048
1058
|
border-radius: 50%;
|
|
1049
1059
|
animation: wap-button-spinner 0.8s linear infinite;
|
|
1050
1060
|
}
|
|
1051
1061
|
|
|
1062
|
+
teg-apple-pay-button .apple-pay-btn__logo {
|
|
1063
|
+
display: inline-flex;
|
|
1064
|
+
align-items: center;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
teg-apple-pay-button .apple-pay-btn__loading {
|
|
1068
|
+
display: none;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1052
1071
|
@keyframes wap-button-spinner {
|
|
1072
|
+
from {
|
|
1073
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
1074
|
+
}
|
|
1053
1075
|
to {
|
|
1054
|
-
transform: rotate(360deg);
|
|
1076
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
1055
1077
|
}
|
|
1056
1078
|
}
|
|
1057
1079
|
</style>
|
|
@@ -1063,9 +1085,12 @@ var apple_pay_button_template_default = `<style>
|
|
|
1063
1085
|
aria-label="Pay with Apple Pay"
|
|
1064
1086
|
data-analytics="paywall:apple-pay-checkout"
|
|
1065
1087
|
>
|
|
1066
|
-
<
|
|
1067
|
-
<
|
|
1068
|
-
|
|
1088
|
+
<span class="apple-pay-btn__logo">
|
|
1089
|
+
<svg width="51" height="22" aria-label="Apple Pay" role="img">
|
|
1090
|
+
<use href="#apple-pay-logo" />
|
|
1091
|
+
</svg>
|
|
1092
|
+
</span>
|
|
1093
|
+
<span class="apple-pay-btn__loading" aria-hidden="true">Loading...</span>
|
|
1069
1094
|
</button>
|
|
1070
1095
|
</div>
|
|
1071
1096
|
`;
|
|
@@ -1896,7 +1921,9 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
|
|
|
1896
1921
|
const button = document.createElement(_ApplePayButton.tag);
|
|
1897
1922
|
button.offer = offer;
|
|
1898
1923
|
button.country = country;
|
|
1899
|
-
|
|
1924
|
+
if (entryPoint) {
|
|
1925
|
+
button.entryPoint = entryPoint;
|
|
1926
|
+
}
|
|
1900
1927
|
return button;
|
|
1901
1928
|
}
|
|
1902
1929
|
/**
|
|
@@ -320,28 +320,41 @@ var apple_pay_modal_template_default = `<style>
|
|
|
320
320
|
cursor: not-allowed;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
.apm__cta
|
|
324
|
-
|
|
323
|
+
.apm__cta-content {
|
|
324
|
+
display: flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
gap: 0.375rem;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.apm__cta-label {
|
|
330
|
+
display: inline-flex;
|
|
331
|
+
align-items: center;
|
|
332
|
+
gap: 0.375rem;
|
|
325
333
|
}
|
|
326
334
|
|
|
327
|
-
.apm__cta
|
|
335
|
+
.apm__cta-loading {
|
|
336
|
+
display: none;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.apm__cta[aria-busy="true"]::before {
|
|
328
340
|
content: '';
|
|
329
341
|
position: absolute;
|
|
330
|
-
left: 50%;
|
|
331
342
|
top: 50%;
|
|
332
|
-
|
|
333
|
-
margin-top: -0.625rem;
|
|
343
|
+
left: 50%;
|
|
334
344
|
width: 1.25rem;
|
|
335
345
|
height: 1.25rem;
|
|
336
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
346
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
337
347
|
border-top-color: #fff;
|
|
338
348
|
border-radius: 50%;
|
|
339
349
|
animation: apm-cta-spinner 0.8s linear infinite;
|
|
340
350
|
}
|
|
341
351
|
|
|
342
352
|
@keyframes apm-cta-spinner {
|
|
353
|
+
from {
|
|
354
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
355
|
+
}
|
|
343
356
|
to {
|
|
344
|
-
transform: rotate(360deg);
|
|
357
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
345
358
|
}
|
|
346
359
|
}
|
|
347
360
|
|
|
@@ -518,11 +531,14 @@ var apple_pay_modal_template_default = `<style>
|
|
|
518
531
|
</div>
|
|
519
532
|
<button class="apm__cta" id="apple-pay-modal-cta" aria-label="Continue with Apple Pay">
|
|
520
533
|
<span class="apm__cta-content">
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
<
|
|
524
|
-
|
|
534
|
+
<span class="apm__cta-label">
|
|
535
|
+
Continue with
|
|
536
|
+
<svg width="51" height="22" aria-hidden="true" role="img">
|
|
537
|
+
<use href="#apple-pay-logo" />
|
|
538
|
+
</svg>
|
|
539
|
+
</span>
|
|
525
540
|
</span>
|
|
541
|
+
<span class="apm__cta-loading" aria-hidden="true">Loading...</span>
|
|
526
542
|
</button>
|
|
527
543
|
</div>
|
|
528
544
|
</div>
|
|
@@ -1038,28 +1054,34 @@ var apple_pay_button_template_default = `<style>
|
|
|
1038
1054
|
cursor: default;
|
|
1039
1055
|
}
|
|
1040
1056
|
|
|
1041
|
-
teg-apple-pay-button .apple-pay-btn.wap-loading
|
|
1042
|
-
visibility: hidden;
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
teg-apple-pay-button .apple-pay-btn.wap-loading::after {
|
|
1057
|
+
teg-apple-pay-button .apple-pay-btn.wap-loading::before {
|
|
1046
1058
|
content: '';
|
|
1047
1059
|
position: absolute;
|
|
1048
|
-
left: 50%;
|
|
1049
1060
|
top: 50%;
|
|
1050
|
-
|
|
1051
|
-
margin-top: -0.625rem;
|
|
1061
|
+
left: 50%;
|
|
1052
1062
|
width: 1.25rem;
|
|
1053
1063
|
height: 1.25rem;
|
|
1054
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
1064
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
1055
1065
|
border-top-color: #fff;
|
|
1056
1066
|
border-radius: 50%;
|
|
1057
1067
|
animation: wap-button-spinner 0.8s linear infinite;
|
|
1058
1068
|
}
|
|
1059
1069
|
|
|
1070
|
+
teg-apple-pay-button .apple-pay-btn__logo {
|
|
1071
|
+
display: inline-flex;
|
|
1072
|
+
align-items: center;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
teg-apple-pay-button .apple-pay-btn__loading {
|
|
1076
|
+
display: none;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1060
1079
|
@keyframes wap-button-spinner {
|
|
1080
|
+
from {
|
|
1081
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
1082
|
+
}
|
|
1061
1083
|
to {
|
|
1062
|
-
transform: rotate(360deg);
|
|
1084
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
1063
1085
|
}
|
|
1064
1086
|
}
|
|
1065
1087
|
</style>
|
|
@@ -1071,9 +1093,12 @@ var apple_pay_button_template_default = `<style>
|
|
|
1071
1093
|
aria-label="Pay with Apple Pay"
|
|
1072
1094
|
data-analytics="paywall:apple-pay-checkout"
|
|
1073
1095
|
>
|
|
1074
|
-
<
|
|
1075
|
-
<
|
|
1076
|
-
|
|
1096
|
+
<span class="apple-pay-btn__logo">
|
|
1097
|
+
<svg width="51" height="22" aria-label="Apple Pay" role="img">
|
|
1098
|
+
<use href="#apple-pay-logo" />
|
|
1099
|
+
</svg>
|
|
1100
|
+
</span>
|
|
1101
|
+
<span class="apple-pay-btn__loading" aria-hidden="true">Loading...</span>
|
|
1077
1102
|
</button>
|
|
1078
1103
|
</div>
|
|
1079
1104
|
`;
|
|
@@ -1904,7 +1929,9 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
|
|
|
1904
1929
|
const button = document.createElement(_ApplePayButton.tag);
|
|
1905
1930
|
button.offer = offer;
|
|
1906
1931
|
button.country = country;
|
|
1907
|
-
|
|
1932
|
+
if (entryPoint) {
|
|
1933
|
+
button.entryPoint = entryPoint;
|
|
1934
|
+
}
|
|
1908
1935
|
return button;
|
|
1909
1936
|
}
|
|
1910
1937
|
/**
|
|
@@ -320,28 +320,41 @@ var apple_pay_modal_template_default = `<style>
|
|
|
320
320
|
cursor: not-allowed;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
.apm__cta
|
|
324
|
-
|
|
323
|
+
.apm__cta-content {
|
|
324
|
+
display: flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
gap: 0.375rem;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.apm__cta-label {
|
|
330
|
+
display: inline-flex;
|
|
331
|
+
align-items: center;
|
|
332
|
+
gap: 0.375rem;
|
|
325
333
|
}
|
|
326
334
|
|
|
327
|
-
.apm__cta
|
|
335
|
+
.apm__cta-loading {
|
|
336
|
+
display: none;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.apm__cta[aria-busy="true"]::before {
|
|
328
340
|
content: '';
|
|
329
341
|
position: absolute;
|
|
330
|
-
left: 50%;
|
|
331
342
|
top: 50%;
|
|
332
|
-
|
|
333
|
-
margin-top: -0.625rem;
|
|
343
|
+
left: 50%;
|
|
334
344
|
width: 1.25rem;
|
|
335
345
|
height: 1.25rem;
|
|
336
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
346
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
337
347
|
border-top-color: #fff;
|
|
338
348
|
border-radius: 50%;
|
|
339
349
|
animation: apm-cta-spinner 0.8s linear infinite;
|
|
340
350
|
}
|
|
341
351
|
|
|
342
352
|
@keyframes apm-cta-spinner {
|
|
353
|
+
from {
|
|
354
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
355
|
+
}
|
|
343
356
|
to {
|
|
344
|
-
transform: rotate(360deg);
|
|
357
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
345
358
|
}
|
|
346
359
|
}
|
|
347
360
|
|
|
@@ -518,11 +531,14 @@ var apple_pay_modal_template_default = `<style>
|
|
|
518
531
|
</div>
|
|
519
532
|
<button class="apm__cta" id="apple-pay-modal-cta" aria-label="Continue with Apple Pay">
|
|
520
533
|
<span class="apm__cta-content">
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
<
|
|
524
|
-
|
|
534
|
+
<span class="apm__cta-label">
|
|
535
|
+
Continue with
|
|
536
|
+
<svg width="51" height="22" aria-hidden="true" role="img">
|
|
537
|
+
<use href="#apple-pay-logo" />
|
|
538
|
+
</svg>
|
|
539
|
+
</span>
|
|
525
540
|
</span>
|
|
541
|
+
<span class="apm__cta-loading" aria-hidden="true">Loading...</span>
|
|
526
542
|
</button>
|
|
527
543
|
</div>
|
|
528
544
|
</div>
|
|
@@ -320,28 +320,41 @@ var apple_pay_modal_template_default = `<style>
|
|
|
320
320
|
cursor: not-allowed;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
.apm__cta
|
|
324
|
-
|
|
323
|
+
.apm__cta-content {
|
|
324
|
+
display: flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
gap: 0.375rem;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.apm__cta-label {
|
|
330
|
+
display: inline-flex;
|
|
331
|
+
align-items: center;
|
|
332
|
+
gap: 0.375rem;
|
|
325
333
|
}
|
|
326
334
|
|
|
327
|
-
.apm__cta
|
|
335
|
+
.apm__cta-loading {
|
|
336
|
+
display: none;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.apm__cta[aria-busy="true"]::before {
|
|
328
340
|
content: '';
|
|
329
341
|
position: absolute;
|
|
330
|
-
left: 50%;
|
|
331
342
|
top: 50%;
|
|
332
|
-
|
|
333
|
-
margin-top: -0.625rem;
|
|
343
|
+
left: 50%;
|
|
334
344
|
width: 1.25rem;
|
|
335
345
|
height: 1.25rem;
|
|
336
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
346
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
337
347
|
border-top-color: #fff;
|
|
338
348
|
border-radius: 50%;
|
|
339
349
|
animation: apm-cta-spinner 0.8s linear infinite;
|
|
340
350
|
}
|
|
341
351
|
|
|
342
352
|
@keyframes apm-cta-spinner {
|
|
353
|
+
from {
|
|
354
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
355
|
+
}
|
|
343
356
|
to {
|
|
344
|
-
transform: rotate(360deg);
|
|
357
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
345
358
|
}
|
|
346
359
|
}
|
|
347
360
|
|
|
@@ -518,11 +531,14 @@ var apple_pay_modal_template_default = `<style>
|
|
|
518
531
|
</div>
|
|
519
532
|
<button class="apm__cta" id="apple-pay-modal-cta" aria-label="Continue with Apple Pay">
|
|
520
533
|
<span class="apm__cta-content">
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
<
|
|
524
|
-
|
|
534
|
+
<span class="apm__cta-label">
|
|
535
|
+
Continue with
|
|
536
|
+
<svg width="51" height="22" aria-hidden="true" role="img">
|
|
537
|
+
<use href="#apple-pay-logo" />
|
|
538
|
+
</svg>
|
|
539
|
+
</span>
|
|
525
540
|
</span>
|
|
541
|
+
<span class="apm__cta-loading" aria-hidden="true">Loading...</span>
|
|
526
542
|
</button>
|
|
527
543
|
</div>
|
|
528
544
|
</div>
|
|
@@ -1030,28 +1046,34 @@ var apple_pay_button_template_default = `<style>
|
|
|
1030
1046
|
cursor: default;
|
|
1031
1047
|
}
|
|
1032
1048
|
|
|
1033
|
-
teg-apple-pay-button .apple-pay-btn.wap-loading
|
|
1034
|
-
visibility: hidden;
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
teg-apple-pay-button .apple-pay-btn.wap-loading::after {
|
|
1049
|
+
teg-apple-pay-button .apple-pay-btn.wap-loading::before {
|
|
1038
1050
|
content: '';
|
|
1039
1051
|
position: absolute;
|
|
1040
|
-
left: 50%;
|
|
1041
1052
|
top: 50%;
|
|
1042
|
-
|
|
1043
|
-
margin-top: -0.625rem;
|
|
1053
|
+
left: 50%;
|
|
1044
1054
|
width: 1.25rem;
|
|
1045
1055
|
height: 1.25rem;
|
|
1046
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
1056
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
1047
1057
|
border-top-color: #fff;
|
|
1048
1058
|
border-radius: 50%;
|
|
1049
1059
|
animation: wap-button-spinner 0.8s linear infinite;
|
|
1050
1060
|
}
|
|
1051
1061
|
|
|
1062
|
+
teg-apple-pay-button .apple-pay-btn__logo {
|
|
1063
|
+
display: inline-flex;
|
|
1064
|
+
align-items: center;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
teg-apple-pay-button .apple-pay-btn__loading {
|
|
1068
|
+
display: none;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1052
1071
|
@keyframes wap-button-spinner {
|
|
1072
|
+
from {
|
|
1073
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
1074
|
+
}
|
|
1053
1075
|
to {
|
|
1054
|
-
transform: rotate(360deg);
|
|
1076
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
1055
1077
|
}
|
|
1056
1078
|
}
|
|
1057
1079
|
</style>
|
|
@@ -1063,9 +1085,12 @@ var apple_pay_button_template_default = `<style>
|
|
|
1063
1085
|
aria-label="Pay with Apple Pay"
|
|
1064
1086
|
data-analytics="paywall:apple-pay-checkout"
|
|
1065
1087
|
>
|
|
1066
|
-
<
|
|
1067
|
-
<
|
|
1068
|
-
|
|
1088
|
+
<span class="apple-pay-btn__logo">
|
|
1089
|
+
<svg width="51" height="22" aria-label="Apple Pay" role="img">
|
|
1090
|
+
<use href="#apple-pay-logo" />
|
|
1091
|
+
</svg>
|
|
1092
|
+
</span>
|
|
1093
|
+
<span class="apple-pay-btn__loading" aria-hidden="true">Loading...</span>
|
|
1069
1094
|
</button>
|
|
1070
1095
|
</div>
|
|
1071
1096
|
`;
|
|
@@ -1896,7 +1921,9 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
|
|
|
1896
1921
|
const button = document.createElement(_ApplePayButton.tag);
|
|
1897
1922
|
button.offer = offer;
|
|
1898
1923
|
button.country = country;
|
|
1899
|
-
|
|
1924
|
+
if (entryPoint) {
|
|
1925
|
+
button.entryPoint = entryPoint;
|
|
1926
|
+
}
|
|
1900
1927
|
return button;
|
|
1901
1928
|
}
|
|
1902
1929
|
/**
|
|
@@ -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
|
+
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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
|
@@ -320,28 +320,41 @@ var apple_pay_modal_template_default = `<style>
|
|
|
320
320
|
cursor: not-allowed;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
.apm__cta
|
|
324
|
-
|
|
323
|
+
.apm__cta-content {
|
|
324
|
+
display: flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
gap: 0.375rem;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.apm__cta-label {
|
|
330
|
+
display: inline-flex;
|
|
331
|
+
align-items: center;
|
|
332
|
+
gap: 0.375rem;
|
|
325
333
|
}
|
|
326
334
|
|
|
327
|
-
.apm__cta
|
|
335
|
+
.apm__cta-loading {
|
|
336
|
+
display: none;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.apm__cta[aria-busy="true"]::before {
|
|
328
340
|
content: '';
|
|
329
341
|
position: absolute;
|
|
330
|
-
left: 50%;
|
|
331
342
|
top: 50%;
|
|
332
|
-
|
|
333
|
-
margin-top: -0.625rem;
|
|
343
|
+
left: 50%;
|
|
334
344
|
width: 1.25rem;
|
|
335
345
|
height: 1.25rem;
|
|
336
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
346
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
337
347
|
border-top-color: #fff;
|
|
338
348
|
border-radius: 50%;
|
|
339
349
|
animation: apm-cta-spinner 0.8s linear infinite;
|
|
340
350
|
}
|
|
341
351
|
|
|
342
352
|
@keyframes apm-cta-spinner {
|
|
353
|
+
from {
|
|
354
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
355
|
+
}
|
|
343
356
|
to {
|
|
344
|
-
transform: rotate(360deg);
|
|
357
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
345
358
|
}
|
|
346
359
|
}
|
|
347
360
|
|
|
@@ -518,11 +531,14 @@ var apple_pay_modal_template_default = `<style>
|
|
|
518
531
|
</div>
|
|
519
532
|
<button class="apm__cta" id="apple-pay-modal-cta" aria-label="Continue with Apple Pay">
|
|
520
533
|
<span class="apm__cta-content">
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
<
|
|
524
|
-
|
|
534
|
+
<span class="apm__cta-label">
|
|
535
|
+
Continue with
|
|
536
|
+
<svg width="51" height="22" aria-hidden="true" role="img">
|
|
537
|
+
<use href="#apple-pay-logo" />
|
|
538
|
+
</svg>
|
|
539
|
+
</span>
|
|
525
540
|
</span>
|
|
541
|
+
<span class="apm__cta-loading" aria-hidden="true">Loading...</span>
|
|
526
542
|
</button>
|
|
527
543
|
</div>
|
|
528
544
|
</div>
|
|
@@ -1035,28 +1051,34 @@ var apple_pay_button_template_default = `<style>
|
|
|
1035
1051
|
cursor: default;
|
|
1036
1052
|
}
|
|
1037
1053
|
|
|
1038
|
-
teg-apple-pay-button .apple-pay-btn.wap-loading
|
|
1039
|
-
visibility: hidden;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
teg-apple-pay-button .apple-pay-btn.wap-loading::after {
|
|
1054
|
+
teg-apple-pay-button .apple-pay-btn.wap-loading::before {
|
|
1043
1055
|
content: '';
|
|
1044
1056
|
position: absolute;
|
|
1045
|
-
left: 50%;
|
|
1046
1057
|
top: 50%;
|
|
1047
|
-
|
|
1048
|
-
margin-top: -0.625rem;
|
|
1058
|
+
left: 50%;
|
|
1049
1059
|
width: 1.25rem;
|
|
1050
1060
|
height: 1.25rem;
|
|
1051
|
-
border: 2px solid rgba(255, 255, 255, 0.
|
|
1061
|
+
border: 2px solid rgba(255, 255, 255, 0.25);
|
|
1052
1062
|
border-top-color: #fff;
|
|
1053
1063
|
border-radius: 50%;
|
|
1054
1064
|
animation: wap-button-spinner 0.8s linear infinite;
|
|
1055
1065
|
}
|
|
1056
1066
|
|
|
1067
|
+
teg-apple-pay-button .apple-pay-btn__logo {
|
|
1068
|
+
display: inline-flex;
|
|
1069
|
+
align-items: center;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
teg-apple-pay-button .apple-pay-btn__loading {
|
|
1073
|
+
display: none;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1057
1076
|
@keyframes wap-button-spinner {
|
|
1077
|
+
from {
|
|
1078
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
1079
|
+
}
|
|
1058
1080
|
to {
|
|
1059
|
-
transform: rotate(360deg);
|
|
1081
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
1060
1082
|
}
|
|
1061
1083
|
}
|
|
1062
1084
|
</style>
|
|
@@ -1068,9 +1090,12 @@ var apple_pay_button_template_default = `<style>
|
|
|
1068
1090
|
aria-label="Pay with Apple Pay"
|
|
1069
1091
|
data-analytics="paywall:apple-pay-checkout"
|
|
1070
1092
|
>
|
|
1071
|
-
<
|
|
1072
|
-
<
|
|
1073
|
-
|
|
1093
|
+
<span class="apple-pay-btn__logo">
|
|
1094
|
+
<svg width="51" height="22" aria-label="Apple Pay" role="img">
|
|
1095
|
+
<use href="#apple-pay-logo" />
|
|
1096
|
+
</svg>
|
|
1097
|
+
</span>
|
|
1098
|
+
<span class="apple-pay-btn__loading" aria-hidden="true">Loading...</span>
|
|
1074
1099
|
</button>
|
|
1075
1100
|
</div>
|
|
1076
1101
|
`;
|
|
@@ -1901,7 +1926,9 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
|
|
|
1901
1926
|
const button = document.createElement(_ApplePayButton.tag);
|
|
1902
1927
|
button.offer = offer;
|
|
1903
1928
|
button.country = country;
|
|
1904
|
-
|
|
1929
|
+
if (entryPoint) {
|
|
1930
|
+
button.entryPoint = entryPoint;
|
|
1931
|
+
}
|
|
1905
1932
|
return button;
|
|
1906
1933
|
}
|
|
1907
1934
|
/**
|
|
@@ -2211,6 +2238,13 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
|
|
|
2211
2238
|
}
|
|
2212
2239
|
};
|
|
2213
2240
|
|
|
2241
|
+
// src/constants.ts
|
|
2242
|
+
var ApplePayEntryPoint = /* @__PURE__ */ ((ApplePayEntryPoint2) => {
|
|
2243
|
+
ApplePayEntryPoint2["PAYWALL"] = "article_paywall";
|
|
2244
|
+
ApplePayEntryPoint2["REGWALL"] = "article_regwall";
|
|
2245
|
+
return ApplePayEntryPoint2;
|
|
2246
|
+
})(ApplePayEntryPoint || {});
|
|
2247
|
+
|
|
2214
2248
|
// src/index.ts
|
|
2215
2249
|
function defineApplePayElements() {
|
|
2216
2250
|
ApplePayButton.define();
|
|
@@ -2219,6 +2253,7 @@ function defineApplePayElements() {
|
|
|
2219
2253
|
export {
|
|
2220
2254
|
APPLE_PAY_EXCLUDED_VARIANTS,
|
|
2221
2255
|
ApplePayButton,
|
|
2256
|
+
ApplePayEntryPoint,
|
|
2222
2257
|
ApplePayModal,
|
|
2223
2258
|
configureApplePay,
|
|
2224
2259
|
defineApplePayElements,
|