@kompasid/lit-web-components 0.1.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/.editorconfig +29 -0
- package/.github/workflows/npm-publish.yml +35 -0
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/assets/font-awesome.ts +21 -0
- package/components.d.ts +4 -0
- package/demo/index.html +137 -0
- package/dist/assets/font-awesome.d.ts +2 -0
- package/dist/assets/font-awesome.js +20 -0
- package/dist/assets/font-awesome.js.map +1 -0
- package/dist/src/components/kompas-footer/KompasFooter.d.ts +13 -0
- package/dist/src/components/kompas-footer/KompasFooter.js +304 -0
- package/dist/src/components/kompas-footer/KompasFooter.js.map +1 -0
- package/dist/src/components/kompas-footer/types.d.ts +47 -0
- package/dist/src/components/kompas-footer/types.js +2 -0
- package/dist/src/components/kompas-footer/types.js.map +1 -0
- package/dist/src/components/kompas-metered-paywall/KompasMeteredPaywall.d.ts +50 -0
- package/dist/src/components/kompas-metered-paywall/KompasMeteredPaywall.js +225 -0
- package/dist/src/components/kompas-metered-paywall/KompasMeteredPaywall.js.map +1 -0
- package/dist/src/components/kompas-paywall/KompasPaywall.d.ts +73 -0
- package/dist/src/components/kompas-paywall/KompasPaywall.js +470 -0
- package/dist/src/components/kompas-paywall/KompasPaywall.js.map +1 -0
- package/dist/src/components/kompas-paywall/types.d.ts +53 -0
- package/dist/src/components/kompas-paywall/types.js +2 -0
- package/dist/src/components/kompas-paywall/types.js.map +1 -0
- package/dist/src/components/kompas-paywall-banner-registration/KompasPaywallBannerRegistration.d.ts +11 -0
- package/dist/src/components/kompas-paywall-banner-registration/KompasPaywallBannerRegistration.js +100 -0
- package/dist/src/components/kompas-paywall-banner-registration/KompasPaywallBannerRegistration.js.map +1 -0
- package/dist/src/components/kompas-paywall-body/KompasPaywallBody.d.ts +107 -0
- package/dist/src/components/kompas-paywall-body/KompasPaywallBody.js +843 -0
- package/dist/src/components/kompas-paywall-body/KompasPaywallBody.js.map +1 -0
- package/dist/src/components/kompas-paywall-information-header/KompasPaywallInformationHeader.d.ts +8 -0
- package/dist/src/components/kompas-paywall-information-header/KompasPaywallInformationHeader.js +39 -0
- package/dist/src/components/kompas-paywall-information-header/KompasPaywallInformationHeader.js.map +1 -0
- package/dist/src/components/kompas-paywall-video/KompasPaywallVideo.d.ts +53 -0
- package/dist/src/components/kompas-paywall-video/KompasPaywallVideo.js +245 -0
- package/dist/src/components/kompas-paywall-video/KompasPaywallVideo.js.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.js +5 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/utils/deviceType.d.ts +2 -0
- package/dist/src/utils/deviceType.js +11 -0
- package/dist/src/utils/deviceType.js.map +1 -0
- package/dist/src/utils/fontawesome-setup.d.ts +1 -0
- package/dist/src/utils/fontawesome-setup.js +25 -0
- package/dist/src/utils/fontawesome-setup.js.map +1 -0
- package/dist/tailwind/tailwind.d.ts +1 -0
- package/dist/tailwind/tailwind.js +1654 -0
- package/dist/tailwind/tailwind.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +94 -0
- package/src/components/kompas-footer/KompasFooter.ts +331 -0
- package/src/components/kompas-footer/types.ts +54 -0
- package/src/components/kompas-metered-paywall/KompasMeteredPaywall.ts +174 -0
- package/src/components/kompas-metered-paywall/readme.md +32 -0
- package/src/components/kompas-paywall/KompasPaywall.ts +398 -0
- package/src/components/kompas-paywall/readme.md +166 -0
- package/src/components/kompas-paywall/types.ts +53 -0
- package/src/components/kompas-paywall-banner-registration/KompasPaywallBannerRegistration.ts +92 -0
- package/src/components/kompas-paywall-banner-registration/readme.md +31 -0
- package/src/components/kompas-paywall-body/KompasPaywallBody.ts +844 -0
- package/src/components/kompas-paywall-body/readme.md +54 -0
- package/src/components/kompas-paywall-information-header/KompasPaywallInformationHeader.ts +29 -0
- package/src/components/kompas-paywall-information-header/readme.md +30 -0
- package/src/components/kompas-paywall-video/KompasPaywallVideo.ts +194 -0
- package/src/components/kompas-paywall-video/readme.md +46 -0
- package/src/index.ts +11 -0
- package/src/utils/deviceType.ts +11 -0
- package/src/utils/fontawesome-setup.ts +40 -0
- package/tailwind/tailwind.css +1635 -0
- package/tailwind/tailwind.ts +1654 -0
- package/tailwind/tailwindlib.css +3 -0
- package/tailwind.config.js +96 -0
- package/tsconfig.json +21 -0
- package/web-dev-server.config.mjs +27 -0
- package/web-test-runner.config.mjs +41 -0
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css, LitElement } from 'lit';
|
|
3
|
+
import { property, state, customElement } from 'lit/decorators.js';
|
|
4
|
+
import { TWStyles } from '../../../tailwind/tailwind.js';
|
|
5
|
+
import '../kompas-paywall-body/KompasPaywallBody.js';
|
|
6
|
+
import '../kompas-paywall-banner-registration/KompasPaywallBannerRegistration.js';
|
|
7
|
+
import '../kompas-paywall-information-header/KompasPaywallInformationHeader.js';
|
|
8
|
+
let KompasPaywall = class KompasPaywall extends LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
/**
|
|
12
|
+
* Props
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* property isLogin untuk menghandle apakah user sudah login atau belum
|
|
16
|
+
* property countdownArticle untuk menghandle count artikel
|
|
17
|
+
* property type untuk menghandle tipe epaper
|
|
18
|
+
* property isWithHeader untuk menghandle paywall information header
|
|
19
|
+
* property textHeader digunakan sebagai text pada paywall information header
|
|
20
|
+
* property paywallData untuk menghandle data paywall
|
|
21
|
+
* property userGuid untuk menghandle user Guid
|
|
22
|
+
* property subscriptionStatus untuk menghandle status subscription user
|
|
23
|
+
* property swgEnable untuk menghandle swg apakah di aktifkan atau tidak
|
|
24
|
+
* property paywall_location = The location where user encounter the paywall
|
|
25
|
+
* property paywall_subscription_package = The name of the subscription package viewed by user
|
|
26
|
+
* property paywall_subscription_id = The ID of the subscription package viewed by user
|
|
27
|
+
* property paywall_subscription_price = The price of the subscriprtion package viewed by user
|
|
28
|
+
* property paywall_position = The position of the subscription package viewed by user
|
|
29
|
+
* property page_type = Type of the page
|
|
30
|
+
* property content_id = ID of article (slug)
|
|
31
|
+
* property content_type = Whether it's free article or paid article
|
|
32
|
+
* property content_title = The title of article
|
|
33
|
+
* property tracker_content_categories = The category of the content
|
|
34
|
+
* property user_type = Type of user based on their subscription
|
|
35
|
+
* property subscription_status = Status of their subscription
|
|
36
|
+
* property page_domain = Page Domain
|
|
37
|
+
* property metered_wall_type = The type of Metered Wall
|
|
38
|
+
* property metered_wall_balance = The balance of their metered wall
|
|
39
|
+
* property epaper_edition = The edition of epaper viewed by user
|
|
40
|
+
* property theme = The theme of the paywall component
|
|
41
|
+
*/
|
|
42
|
+
this.paywallData = {};
|
|
43
|
+
this.isLogin = false;
|
|
44
|
+
this.countdownArticle = 0;
|
|
45
|
+
this.type = 'reguler';
|
|
46
|
+
this.isWithHeader = false;
|
|
47
|
+
this.textHeader = '';
|
|
48
|
+
this.userGuid = '';
|
|
49
|
+
this.subscriptionStatus = '';
|
|
50
|
+
this.swgEnable = false;
|
|
51
|
+
this.paywall_location = '';
|
|
52
|
+
this.paywall_subscription_package = '';
|
|
53
|
+
this.paywall_subscription_id = 0;
|
|
54
|
+
this.paywall_subscription_price = 0;
|
|
55
|
+
this.paywall_position = 0;
|
|
56
|
+
this.tracker_page_type = '';
|
|
57
|
+
this.tracker_content_id = '';
|
|
58
|
+
this.tracker_content_title = '';
|
|
59
|
+
this.tracker_content_categories = '';
|
|
60
|
+
this.tracker_content_type = '';
|
|
61
|
+
this.tracker_user_type = '';
|
|
62
|
+
this.tracker_subscription_status = '';
|
|
63
|
+
this.tracker_page_domain = '';
|
|
64
|
+
this.tracker_metered_wall_type = '';
|
|
65
|
+
this.tracker_metered_wall_balance = 0;
|
|
66
|
+
this.tracker_epaper_edition = '';
|
|
67
|
+
this.theme = '';
|
|
68
|
+
this.mockResult = {
|
|
69
|
+
informations: {
|
|
70
|
+
title: 'Langganan untuk Lanjut Membaca',
|
|
71
|
+
description: [
|
|
72
|
+
'Akses tak terbatas Kompas.id (web & app)',
|
|
73
|
+
'Berita digital tanpa iklan pop-up',
|
|
74
|
+
'30 arsip terbaru ePaper Kompas',
|
|
75
|
+
'Artikel Opini eksklusif',
|
|
76
|
+
],
|
|
77
|
+
register: {
|
|
78
|
+
img: 'https://www.kompas.id/img/backgrounds/ilustrasi-banner-registration.png',
|
|
79
|
+
title: 'Ingin Membaca Artikel Ini Secara Utuh?',
|
|
80
|
+
subtitle: 'Daftar akun untuk membaca 5 artikel premium secara gratis ',
|
|
81
|
+
label: 'Daftar Sekarang ',
|
|
82
|
+
},
|
|
83
|
+
meterred: {
|
|
84
|
+
maxQuota: 5,
|
|
85
|
+
label: 'Langganan',
|
|
86
|
+
maxQuotaMessage: 'Akses artikel gratis Anda bulan ini sudah habis.',
|
|
87
|
+
url: 'https://kompas.id/berlangganan',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
packages: {
|
|
91
|
+
title: 'Sekali bayar, tanpa perpanjang otomatis',
|
|
92
|
+
memberships: [
|
|
93
|
+
{
|
|
94
|
+
title: 'Kompas Digital Premium 12 Bulan (Hemat 40%)',
|
|
95
|
+
percentage: 40,
|
|
96
|
+
price: 360000,
|
|
97
|
+
discountPrice: 600000,
|
|
98
|
+
periode: '1 Tahun',
|
|
99
|
+
isHighlight: true,
|
|
100
|
+
url: 'https://checkoutv2.kompas.id/kdp?productId=9802032&referrer=',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
title: 'Kompas Digital Premium 1 Bulan',
|
|
104
|
+
percentage: 0,
|
|
105
|
+
discountPrice: 0,
|
|
106
|
+
price: 50000,
|
|
107
|
+
periode: '1 Bulan',
|
|
108
|
+
isHighlight: false,
|
|
109
|
+
url: 'https://checkoutv2.kompas.id/kdp?productId=9802035&referrer=',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
payment: {
|
|
114
|
+
desktop: [
|
|
115
|
+
{
|
|
116
|
+
name: 'gopay',
|
|
117
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/gopay${this.darkUrl}.svg`,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'ovo',
|
|
121
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/ovo${this.darkUrl}.svg`,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'mastercard',
|
|
125
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/mastercard${this.darkUrl}.svg`,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'bri',
|
|
129
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bri${this.darkUrl}.svg`,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'bcaklikpay',
|
|
133
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bca-klik-pay${this.darkUrl}.svg`,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'indomaret',
|
|
137
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/indomaret${this.darkUrl}.svg`,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'jcb',
|
|
141
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/jcb${this.darkUrl}.svg`,
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'dana',
|
|
145
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/dana${this.darkUrl}.svg`,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'visa',
|
|
149
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/visa${this.darkUrl}.svg`,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'mandiri',
|
|
153
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/mandiri${this.darkUrl}.svg`,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'bca',
|
|
157
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bca${this.darkUrl}.svg`,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'bni',
|
|
161
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bni${this.darkUrl}.svg`,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'akulaku',
|
|
165
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/akulaku${this.darkUrl}.svg`,
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
mobile: [
|
|
169
|
+
{
|
|
170
|
+
name: 'gopay',
|
|
171
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/gopay${this.darkUrl}.svg`,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'ovo',
|
|
175
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/ovo${this.darkUrl}.svg`,
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'visa',
|
|
179
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/visa${this.darkUrl}.svg`,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: 'mastercard',
|
|
183
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/mastercard${this.darkUrl}.svg`,
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
ekstension: [
|
|
187
|
+
{
|
|
188
|
+
name: 'dana',
|
|
189
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/dana${this.darkUrl}.svg`,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'mandiri',
|
|
193
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/mandiri${this.darkUrl}.svg`,
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: 'bri',
|
|
197
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bri${this.darkUrl}.svg`,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: 'bcaklikpay',
|
|
201
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bca-klik-pay${this.darkUrl}.svg`,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'akulaku',
|
|
205
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/akulaku${this.darkUrl}.svg`,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: 'bni',
|
|
209
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bni${this.darkUrl}.svg`,
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'indomaret',
|
|
213
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/indomaret${this.darkUrl}.svg`,
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: 'bca',
|
|
217
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bca${this.darkUrl}.svg`,
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: 'jcb',
|
|
221
|
+
link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/jcb${this.darkUrl}.svg`,
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
this.selectorTypePaywall = (type) => {
|
|
227
|
+
switch (type) {
|
|
228
|
+
case 'epaper':
|
|
229
|
+
return this.renderEpaperPaywallSection();
|
|
230
|
+
case 'reguler':
|
|
231
|
+
return this.renderRegularPaywallSection();
|
|
232
|
+
default:
|
|
233
|
+
return this.renderRegularPaywallSection();
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
get darkUrl() {
|
|
238
|
+
return this.theme === 'dark' ? '-dark' : '';
|
|
239
|
+
}
|
|
240
|
+
connectedCallback() {
|
|
241
|
+
super.connectedCallback();
|
|
242
|
+
this.paywallData = this.mockResult;
|
|
243
|
+
}
|
|
244
|
+
transitionBox() {
|
|
245
|
+
return html `
|
|
246
|
+
<div
|
|
247
|
+
class="h-20 ${this.theme === 'dark'
|
|
248
|
+
? 'transparent-linear-dark'
|
|
249
|
+
: 'transparent-linear'} -mt-24 z-0 w-full"
|
|
250
|
+
></div>
|
|
251
|
+
`;
|
|
252
|
+
}
|
|
253
|
+
renderEpaperPaywallSection() {
|
|
254
|
+
return html `<kompas-paywall-body
|
|
255
|
+
paywall_location=${this.paywall_location}
|
|
256
|
+
paywall_subscription_package=${this.paywall_subscription_package}
|
|
257
|
+
paywall_subscription_id=${this.paywall_subscription_id}
|
|
258
|
+
paywall_subscription_price=${this.paywall_subscription_price}
|
|
259
|
+
paywall_position=${this.paywall_position}
|
|
260
|
+
tracker_page_type=${this.tracker_page_type}
|
|
261
|
+
tracker_content_id=${this.tracker_content_id}
|
|
262
|
+
tracker_content_title=${this.tracker_content_title}
|
|
263
|
+
tracker_content_categories=${this.tracker_content_categories}
|
|
264
|
+
tracker_user_type=${this.tracker_user_type}
|
|
265
|
+
tracker_subscription_status=${this.tracker_subscription_status}
|
|
266
|
+
tracker_page_domain=${this.tracker_page_domain}
|
|
267
|
+
tracker_metered_wall_type=${this.tracker_metered_wall_type}
|
|
268
|
+
tracker_epaper_edition=${this.tracker_epaper_edition}
|
|
269
|
+
tracker_metered_wall_balance=${this.tracker_metered_wall_balance}
|
|
270
|
+
?swgEnable=${this.swgEnable}
|
|
271
|
+
tracker_content_type=${this.tracker_content_type}
|
|
272
|
+
?isLogin=${this.isLogin}
|
|
273
|
+
type=${this.type}
|
|
274
|
+
countdownArticle=${this.countdownArticle}
|
|
275
|
+
.paywallData=${this.paywallData}
|
|
276
|
+
subscriptionStatus=${this.subscriptionStatus}
|
|
277
|
+
userGuid=${this.userGuid}
|
|
278
|
+
theme=${this.theme}
|
|
279
|
+
></kompas-paywall-body>`;
|
|
280
|
+
}
|
|
281
|
+
renderRegularPaywallSection() {
|
|
282
|
+
const defaultHeaderText = this.paywallData.informations.meterred.maxQuotaMessage;
|
|
283
|
+
if (this.isWithHeader) {
|
|
284
|
+
return html `
|
|
285
|
+
<div>
|
|
286
|
+
${this.transitionBox()}
|
|
287
|
+
<div
|
|
288
|
+
class="flex flex-col ${this.theme === 'dark'
|
|
289
|
+
? 'bg-dark-5'
|
|
290
|
+
: 'bg-white'} items-center justify-center mx-4 md:mx-0"
|
|
291
|
+
>
|
|
292
|
+
<div class="flex flex-col w-full max-w-screen-md my-5">
|
|
293
|
+
<kompas-paywall-information-header
|
|
294
|
+
text=${this.textHeader || defaultHeaderText}
|
|
295
|
+
theme=${this.theme}
|
|
296
|
+
></kompas-paywall-information-header>
|
|
297
|
+
<kompas-paywall-body
|
|
298
|
+
paywall_location=${this.paywall_location}
|
|
299
|
+
paywall_subscription_package=${this
|
|
300
|
+
.paywall_subscription_package}
|
|
301
|
+
paywall_subscription_id=${this.paywall_subscription_id}
|
|
302
|
+
paywall_subscription_price=${this.paywall_subscription_price}
|
|
303
|
+
paywall_position=${this.paywall_position}
|
|
304
|
+
tracker_page_type=${this.tracker_page_type}
|
|
305
|
+
tracker_content_id=${this.tracker_content_id}
|
|
306
|
+
tracker_content_title=${this.tracker_content_title}
|
|
307
|
+
tracker_content_categories=${this.tracker_content_categories}
|
|
308
|
+
tracker_user_type=${this.tracker_user_type}
|
|
309
|
+
tracker_subscription_status=${this.tracker_subscription_status}
|
|
310
|
+
tracker_page_domain=${this.tracker_page_domain}
|
|
311
|
+
tracker_metered_wall_type=${this.tracker_metered_wall_type}
|
|
312
|
+
tracker_epaper_edition=${this.tracker_epaper_edition}
|
|
313
|
+
tracker_metered_wall_balance=${this
|
|
314
|
+
.tracker_metered_wall_balance}
|
|
315
|
+
tracker_content_type=${this.tracker_content_type}
|
|
316
|
+
?swgEnable=${this.swgEnable}
|
|
317
|
+
?isLogin=${this.isLogin}
|
|
318
|
+
type=${this.type}
|
|
319
|
+
countdownArticle=${this.countdownArticle}
|
|
320
|
+
.paywallData=${this.paywallData}
|
|
321
|
+
subscriptionStatus=${this.subscriptionStatus}
|
|
322
|
+
userGuid=${this.userGuid}
|
|
323
|
+
theme=${this.theme}
|
|
324
|
+
></kompas-paywall-body>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</div>
|
|
328
|
+
`;
|
|
329
|
+
}
|
|
330
|
+
return html `
|
|
331
|
+
<div>
|
|
332
|
+
${this.transitionBox()}
|
|
333
|
+
<div
|
|
334
|
+
class="flex flex-col ${this.theme === 'dark'
|
|
335
|
+
? 'bg-dark-5'
|
|
336
|
+
: 'bg-white'} items-center justify-center mx-4 md:mx-0"
|
|
337
|
+
>
|
|
338
|
+
<div class="flex flex-col w-full max-w-screen-md my-5">
|
|
339
|
+
<kompas-paywall-banner-registration
|
|
340
|
+
.bannerData=${this.paywallData.informations.register}
|
|
341
|
+
theme=${this.theme}
|
|
342
|
+
></kompas-paywall-banner-registration>
|
|
343
|
+
<kompas-paywall-body
|
|
344
|
+
tracker_content_type=${this.tracker_content_type}
|
|
345
|
+
paywall_location=${this.paywall_location}
|
|
346
|
+
paywall_subscription_package=${this.paywall_subscription_package}
|
|
347
|
+
paywall_subscription_id=${this.paywall_subscription_id}
|
|
348
|
+
paywall_subscription_price=${this.paywall_subscription_price}
|
|
349
|
+
paywall_position=${this.paywall_position}
|
|
350
|
+
tracker_page_type=${this.tracker_page_type}
|
|
351
|
+
tracker_content_id=${this.tracker_content_id}
|
|
352
|
+
tracker_content_title=${this.tracker_content_title}
|
|
353
|
+
tracker_content_categories=${this.tracker_content_categories}
|
|
354
|
+
tracker_user_type=${this.tracker_user_type}
|
|
355
|
+
tracker_subscription_status=${this.tracker_subscription_status}
|
|
356
|
+
tracker_epaper_edition=${this.tracker_epaper_edition}
|
|
357
|
+
tracker_page_domain=${this.tracker_page_domain}
|
|
358
|
+
tracker_metered_wall_type=${this.tracker_metered_wall_type}
|
|
359
|
+
tracker_metered_wall_balance=${this.tracker_metered_wall_balance}
|
|
360
|
+
?swgEnable=${this.swgEnable}
|
|
361
|
+
?isLogin=${this.isLogin}
|
|
362
|
+
type=${this.type}
|
|
363
|
+
countdownArticle=${this.countdownArticle}
|
|
364
|
+
.paywallData=${this.paywallData}
|
|
365
|
+
subscriptionStatus=${this.subscriptionStatus}
|
|
366
|
+
userGuid=${this.userGuid}
|
|
367
|
+
theme=${this.theme}
|
|
368
|
+
></kompas-paywall-body>
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
`;
|
|
373
|
+
}
|
|
374
|
+
render() {
|
|
375
|
+
return html `
|
|
376
|
+
<div class="relative w-full">${this.selectorTypePaywall(this.type)}</div>
|
|
377
|
+
`;
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
KompasPaywall.styles = [
|
|
381
|
+
css `
|
|
382
|
+
:host {
|
|
383
|
+
font-family: 'PT Sans', sans-serif;
|
|
384
|
+
}
|
|
385
|
+
`,
|
|
386
|
+
TWStyles,
|
|
387
|
+
];
|
|
388
|
+
__decorate([
|
|
389
|
+
state()
|
|
390
|
+
], KompasPaywall.prototype, "paywallData", void 0);
|
|
391
|
+
__decorate([
|
|
392
|
+
property({ type: Boolean })
|
|
393
|
+
], KompasPaywall.prototype, "isLogin", void 0);
|
|
394
|
+
__decorate([
|
|
395
|
+
property({ type: Number })
|
|
396
|
+
], KompasPaywall.prototype, "countdownArticle", void 0);
|
|
397
|
+
__decorate([
|
|
398
|
+
property({ type: String })
|
|
399
|
+
], KompasPaywall.prototype, "type", void 0);
|
|
400
|
+
__decorate([
|
|
401
|
+
property({ type: Boolean })
|
|
402
|
+
], KompasPaywall.prototype, "isWithHeader", void 0);
|
|
403
|
+
__decorate([
|
|
404
|
+
property({ type: String })
|
|
405
|
+
], KompasPaywall.prototype, "textHeader", void 0);
|
|
406
|
+
__decorate([
|
|
407
|
+
property({ type: String })
|
|
408
|
+
], KompasPaywall.prototype, "userGuid", void 0);
|
|
409
|
+
__decorate([
|
|
410
|
+
property({ type: String })
|
|
411
|
+
], KompasPaywall.prototype, "subscriptionStatus", void 0);
|
|
412
|
+
__decorate([
|
|
413
|
+
property({ type: Boolean })
|
|
414
|
+
], KompasPaywall.prototype, "swgEnable", void 0);
|
|
415
|
+
__decorate([
|
|
416
|
+
property({ type: String })
|
|
417
|
+
], KompasPaywall.prototype, "paywall_location", void 0);
|
|
418
|
+
__decorate([
|
|
419
|
+
property({ type: String })
|
|
420
|
+
], KompasPaywall.prototype, "paywall_subscription_package", void 0);
|
|
421
|
+
__decorate([
|
|
422
|
+
property({ type: Number })
|
|
423
|
+
], KompasPaywall.prototype, "paywall_subscription_id", void 0);
|
|
424
|
+
__decorate([
|
|
425
|
+
property({ type: Number })
|
|
426
|
+
], KompasPaywall.prototype, "paywall_subscription_price", void 0);
|
|
427
|
+
__decorate([
|
|
428
|
+
property({ type: Number })
|
|
429
|
+
], KompasPaywall.prototype, "paywall_position", void 0);
|
|
430
|
+
__decorate([
|
|
431
|
+
property({ type: String })
|
|
432
|
+
], KompasPaywall.prototype, "tracker_page_type", void 0);
|
|
433
|
+
__decorate([
|
|
434
|
+
property({ type: String })
|
|
435
|
+
], KompasPaywall.prototype, "tracker_content_id", void 0);
|
|
436
|
+
__decorate([
|
|
437
|
+
property({ type: String })
|
|
438
|
+
], KompasPaywall.prototype, "tracker_content_title", void 0);
|
|
439
|
+
__decorate([
|
|
440
|
+
property({ type: String })
|
|
441
|
+
], KompasPaywall.prototype, "tracker_content_categories", void 0);
|
|
442
|
+
__decorate([
|
|
443
|
+
property({ type: String })
|
|
444
|
+
], KompasPaywall.prototype, "tracker_content_type", void 0);
|
|
445
|
+
__decorate([
|
|
446
|
+
property({ type: String })
|
|
447
|
+
], KompasPaywall.prototype, "tracker_user_type", void 0);
|
|
448
|
+
__decorate([
|
|
449
|
+
property({ type: String })
|
|
450
|
+
], KompasPaywall.prototype, "tracker_subscription_status", void 0);
|
|
451
|
+
__decorate([
|
|
452
|
+
property({ type: String })
|
|
453
|
+
], KompasPaywall.prototype, "tracker_page_domain", void 0);
|
|
454
|
+
__decorate([
|
|
455
|
+
property({ type: String })
|
|
456
|
+
], KompasPaywall.prototype, "tracker_metered_wall_type", void 0);
|
|
457
|
+
__decorate([
|
|
458
|
+
property({ type: Number })
|
|
459
|
+
], KompasPaywall.prototype, "tracker_metered_wall_balance", void 0);
|
|
460
|
+
__decorate([
|
|
461
|
+
property({ type: String })
|
|
462
|
+
], KompasPaywall.prototype, "tracker_epaper_edition", void 0);
|
|
463
|
+
__decorate([
|
|
464
|
+
property({ type: String })
|
|
465
|
+
], KompasPaywall.prototype, "theme", void 0);
|
|
466
|
+
KompasPaywall = __decorate([
|
|
467
|
+
customElement('kompas-paywall')
|
|
468
|
+
], KompasPaywall);
|
|
469
|
+
export { KompasPaywall };
|
|
470
|
+
//# sourceMappingURL=KompasPaywall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KompasPaywall.js","sourceRoot":"","sources":["../../../../src/components/kompas-paywall/KompasPaywall.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAExD,OAAO,6CAA6C,CAAA;AACpD,OAAO,0EAA0E,CAAA;AACjF,OAAO,wEAAwE,CAAA;AAGxE,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAUL;;WAEG;QACH;;;;;;;;;;;;;;;;;;;;;;;;;;;WA2BG;QAEc,gBA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AAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAAwB;AACvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iEAAgC;AAC/B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAA0B;AACzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kEAAiC;AAChC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gEAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mEAAiC;AAChC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAA4B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAW;AApE3B,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAoYzB","sourcesContent":["import { html, css, LitElement } from 'lit'\nimport { property, state, customElement } from 'lit/decorators.js'\nimport { TWStyles } from '../../../tailwind/tailwind.js'\nimport { PaywallProduct } from './types.js'\nimport '../kompas-paywall-body/KompasPaywallBody.js'\nimport '../kompas-paywall-banner-registration/KompasPaywallBannerRegistration.js'\nimport '../kompas-paywall-information-header/KompasPaywallInformationHeader.js'\n\n@customElement('kompas-paywall')\nexport class KompasPaywall extends LitElement {\n static styles = [\n css`\n :host {\n font-family: 'PT Sans', sans-serif;\n }\n `,\n TWStyles,\n ]\n\n /**\n * Props\n */\n /**\n * property isLogin untuk menghandle apakah user sudah login atau belum\n * property countdownArticle untuk menghandle count artikel\n * property type untuk menghandle tipe epaper\n * property isWithHeader untuk menghandle paywall information header\n * property textHeader digunakan sebagai text pada paywall information header\n * property paywallData untuk menghandle data paywall\n * property userGuid untuk menghandle user Guid\n * property subscriptionStatus untuk menghandle status subscription user\n * property swgEnable untuk menghandle swg apakah di aktifkan atau tidak\n * property paywall_location = The location where user encounter the paywall\n * property paywall_subscription_package = The name of the subscription package viewed by user\n * property paywall_subscription_id = The ID of the subscription package viewed by user\n * property paywall_subscription_price = The price of the subscriprtion package viewed by user\n * property paywall_position = The position of the subscription package viewed by user\n * property page_type = Type of the page\n * property content_id = ID of article (slug)\n * property content_type = Whether it's free article or paid article\n * property content_title = The title of article\n * property tracker_content_categories = The category of the content\n * property user_type = Type of user based on their subscription\n * property subscription_status = Status of their subscription\n * property page_domain = Page Domain\n * property metered_wall_type = The type of Metered Wall\n * property metered_wall_balance = The balance of their metered wall\n * property epaper_edition = The edition of epaper viewed by user\n * property theme = The theme of the paywall component\n */\n\n @state() private paywallData: PaywallProduct = {} as PaywallProduct\n\n @property({ type: Boolean }) isLogin = false\n @property({ type: Number }) countdownArticle = 0\n @property({ type: String }) type: 'epaper' | 'reguler' = 'reguler'\n @property({ type: Boolean }) isWithHeader = false\n @property({ type: String }) textHeader = ''\n @property({ type: String }) userGuid = ''\n @property({ type: String }) subscriptionStatus = ''\n @property({ type: Boolean }) swgEnable = false\n @property({ type: String }) paywall_location = ''\n @property({ type: String }) paywall_subscription_package = ''\n @property({ type: Number }) paywall_subscription_id = 0\n @property({ type: Number }) paywall_subscription_price = 0\n @property({ type: Number }) paywall_position = 0\n @property({ type: String }) tracker_page_type = ''\n @property({ type: String }) tracker_content_id = ''\n @property({ type: String }) tracker_content_title = ''\n @property({ type: String }) tracker_content_categories = ''\n @property({ type: String }) tracker_content_type = ''\n @property({ type: String }) tracker_user_type = ''\n @property({ type: String }) tracker_subscription_status = ''\n @property({ type: String }) tracker_page_domain = ''\n @property({ type: String }) tracker_metered_wall_type = ''\n @property({ type: Number }) tracker_metered_wall_balance = 0\n @property({ type: String }) tracker_epaper_edition = ''\n @property({ type: String }) theme = ''\n\n mockResult: PaywallProduct = {\n informations: {\n title: 'Langganan untuk Lanjut Membaca',\n description: [\n 'Akses tak terbatas Kompas.id (web & app)',\n 'Berita digital tanpa iklan pop-up',\n '30 arsip terbaru ePaper Kompas',\n 'Artikel Opini eksklusif',\n ],\n register: {\n img: 'https://www.kompas.id/img/backgrounds/ilustrasi-banner-registration.png',\n title: 'Ingin Membaca Artikel Ini Secara Utuh?',\n subtitle: 'Daftar akun untuk membaca 5 artikel premium secara gratis ',\n label: 'Daftar Sekarang ',\n },\n meterred: {\n maxQuota: 5,\n label: 'Langganan',\n maxQuotaMessage: 'Akses artikel gratis Anda bulan ini sudah habis.',\n url: 'https://kompas.id/berlangganan',\n },\n },\n packages: {\n title: 'Sekali bayar, tanpa perpanjang otomatis',\n memberships: [\n {\n title: 'Kompas Digital Premium 12 Bulan (Hemat 40%)',\n percentage: 40,\n price: 360000,\n discountPrice: 600000,\n periode: '1 Tahun',\n isHighlight: true,\n url: 'https://checkoutv2.kompas.id/kdp?productId=9802032&referrer=',\n },\n {\n title: 'Kompas Digital Premium 1 Bulan',\n percentage: 0,\n discountPrice: 0,\n price: 50000,\n periode: '1 Bulan',\n isHighlight: false,\n url: 'https://checkoutv2.kompas.id/kdp?productId=9802035&referrer=',\n },\n ],\n },\n payment: {\n desktop: [\n {\n name: 'gopay',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/gopay${this.darkUrl}.svg`,\n },\n {\n name: 'ovo',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/ovo${this.darkUrl}.svg`,\n },\n {\n name: 'mastercard',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/mastercard${this.darkUrl}.svg`,\n },\n {\n name: 'bri',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bri${this.darkUrl}.svg`,\n },\n {\n name: 'bcaklikpay',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bca-klik-pay${this.darkUrl}.svg`,\n },\n {\n name: 'indomaret',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/indomaret${this.darkUrl}.svg`,\n },\n {\n name: 'jcb',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/jcb${this.darkUrl}.svg`,\n },\n {\n name: 'dana',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/dana${this.darkUrl}.svg`,\n },\n {\n name: 'visa',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/visa${this.darkUrl}.svg`,\n },\n {\n name: 'mandiri',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/mandiri${this.darkUrl}.svg`,\n },\n {\n name: 'bca',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bca${this.darkUrl}.svg`,\n },\n {\n name: 'bni',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bni${this.darkUrl}.svg`,\n },\n {\n name: 'akulaku',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/akulaku${this.darkUrl}.svg`,\n },\n ],\n mobile: [\n {\n name: 'gopay',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/gopay${this.darkUrl}.svg`,\n },\n {\n name: 'ovo',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/ovo${this.darkUrl}.svg`,\n },\n {\n name: 'visa',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/visa${this.darkUrl}.svg`,\n },\n {\n name: 'mastercard',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/mastercard${this.darkUrl}.svg`,\n },\n ],\n ekstension: [\n {\n name: 'dana',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/dana${this.darkUrl}.svg`,\n },\n {\n name: 'mandiri',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/mandiri${this.darkUrl}.svg`,\n },\n {\n name: 'bri',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bri${this.darkUrl}.svg`,\n },\n {\n name: 'bcaklikpay',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bca-klik-pay${this.darkUrl}.svg`,\n },\n {\n name: 'akulaku',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/akulaku${this.darkUrl}.svg`,\n },\n {\n name: 'bni',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bni${this.darkUrl}.svg`,\n },\n {\n name: 'indomaret',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/indomaret${this.darkUrl}.svg`,\n },\n {\n name: 'bca',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/bca${this.darkUrl}.svg`,\n },\n {\n name: 'jcb',\n link: `https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/jcb${this.darkUrl}.svg`,\n },\n ],\n },\n }\n\n get darkUrl() {\n return this.theme === 'dark' ? '-dark' : ''\n }\n\n override connectedCallback() {\n super.connectedCallback()\n this.paywallData = this.mockResult\n }\n\n private transitionBox() {\n return html`\n <div\n class=\"h-20 ${this.theme === 'dark'\n ? 'transparent-linear-dark'\n : 'transparent-linear'} -mt-24 z-0 w-full\"\n ></div>\n `\n }\n\n private renderEpaperPaywallSection() {\n return html`<kompas-paywall-body\n paywall_location=${this.paywall_location}\n paywall_subscription_package=${this.paywall_subscription_package}\n paywall_subscription_id=${this.paywall_subscription_id}\n paywall_subscription_price=${this.paywall_subscription_price}\n paywall_position=${this.paywall_position}\n tracker_page_type=${this.tracker_page_type}\n tracker_content_id=${this.tracker_content_id}\n tracker_content_title=${this.tracker_content_title}\n tracker_content_categories=${this.tracker_content_categories}\n tracker_user_type=${this.tracker_user_type}\n tracker_subscription_status=${this.tracker_subscription_status}\n tracker_page_domain=${this.tracker_page_domain}\n tracker_metered_wall_type=${this.tracker_metered_wall_type}\n tracker_epaper_edition=${this.tracker_epaper_edition}\n tracker_metered_wall_balance=${this.tracker_metered_wall_balance}\n ?swgEnable=${this.swgEnable}\n tracker_content_type=${this.tracker_content_type}\n ?isLogin=${this.isLogin}\n type=${this.type}\n countdownArticle=${this.countdownArticle}\n .paywallData=${this.paywallData}\n subscriptionStatus=${this.subscriptionStatus}\n userGuid=${this.userGuid}\n theme=${this.theme}\n ></kompas-paywall-body>`\n }\n\n private renderRegularPaywallSection() {\n const defaultHeaderText: string =\n this.paywallData.informations.meterred.maxQuotaMessage\n if (this.isWithHeader) {\n return html`\n <div>\n ${this.transitionBox()}\n <div\n class=\"flex flex-col ${this.theme === 'dark'\n ? 'bg-dark-5'\n : 'bg-white'} items-center justify-center mx-4 md:mx-0\"\n >\n <div class=\"flex flex-col w-full max-w-screen-md my-5\">\n <kompas-paywall-information-header\n text=${this.textHeader || defaultHeaderText}\n theme=${this.theme}\n ></kompas-paywall-information-header>\n <kompas-paywall-body\n paywall_location=${this.paywall_location}\n paywall_subscription_package=${this\n .paywall_subscription_package}\n paywall_subscription_id=${this.paywall_subscription_id}\n paywall_subscription_price=${this.paywall_subscription_price}\n paywall_position=${this.paywall_position}\n tracker_page_type=${this.tracker_page_type}\n tracker_content_id=${this.tracker_content_id}\n tracker_content_title=${this.tracker_content_title}\n tracker_content_categories=${this.tracker_content_categories}\n tracker_user_type=${this.tracker_user_type}\n tracker_subscription_status=${this.tracker_subscription_status}\n tracker_page_domain=${this.tracker_page_domain}\n tracker_metered_wall_type=${this.tracker_metered_wall_type}\n tracker_epaper_edition=${this.tracker_epaper_edition}\n tracker_metered_wall_balance=${this\n .tracker_metered_wall_balance}\n tracker_content_type=${this.tracker_content_type}\n ?swgEnable=${this.swgEnable}\n ?isLogin=${this.isLogin}\n type=${this.type}\n countdownArticle=${this.countdownArticle}\n .paywallData=${this.paywallData}\n subscriptionStatus=${this.subscriptionStatus}\n userGuid=${this.userGuid}\n theme=${this.theme}\n ></kompas-paywall-body>\n </div>\n </div>\n </div>\n `\n }\n return html`\n <div>\n ${this.transitionBox()}\n <div\n class=\"flex flex-col ${this.theme === 'dark'\n ? 'bg-dark-5'\n : 'bg-white'} items-center justify-center mx-4 md:mx-0\"\n >\n <div class=\"flex flex-col w-full max-w-screen-md my-5\">\n <kompas-paywall-banner-registration\n .bannerData=${this.paywallData.informations.register}\n theme=${this.theme}\n ></kompas-paywall-banner-registration>\n <kompas-paywall-body\n tracker_content_type=${this.tracker_content_type}\n paywall_location=${this.paywall_location}\n paywall_subscription_package=${this.paywall_subscription_package}\n paywall_subscription_id=${this.paywall_subscription_id}\n paywall_subscription_price=${this.paywall_subscription_price}\n paywall_position=${this.paywall_position}\n tracker_page_type=${this.tracker_page_type}\n tracker_content_id=${this.tracker_content_id}\n tracker_content_title=${this.tracker_content_title}\n tracker_content_categories=${this.tracker_content_categories}\n tracker_user_type=${this.tracker_user_type}\n tracker_subscription_status=${this.tracker_subscription_status}\n tracker_epaper_edition=${this.tracker_epaper_edition}\n tracker_page_domain=${this.tracker_page_domain}\n tracker_metered_wall_type=${this.tracker_metered_wall_type}\n tracker_metered_wall_balance=${this.tracker_metered_wall_balance}\n ?swgEnable=${this.swgEnable}\n ?isLogin=${this.isLogin}\n type=${this.type}\n countdownArticle=${this.countdownArticle}\n .paywallData=${this.paywallData}\n subscriptionStatus=${this.subscriptionStatus}\n userGuid=${this.userGuid}\n theme=${this.theme}\n ></kompas-paywall-body>\n </div>\n </div>\n </div>\n `\n }\n\n private selectorTypePaywall = (type: 'epaper' | 'reguler') => {\n switch (type) {\n case 'epaper':\n return this.renderEpaperPaywallSection()\n case 'reguler':\n return this.renderRegularPaywallSection()\n default:\n return this.renderRegularPaywallSection()\n }\n }\n\n render() {\n return html`\n <div class=\"relative w-full\">${this.selectorTypePaywall(this.type)}</div>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface Product {
|
|
2
|
+
title: string;
|
|
3
|
+
percentage: number;
|
|
4
|
+
price: number;
|
|
5
|
+
discountPrice: number;
|
|
6
|
+
periode: string;
|
|
7
|
+
isHighlight: boolean;
|
|
8
|
+
url: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Metered {
|
|
11
|
+
maxQuota: number;
|
|
12
|
+
label: string;
|
|
13
|
+
maxQuotaMessage: string;
|
|
14
|
+
url: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PaymentImage {
|
|
17
|
+
name: string;
|
|
18
|
+
link: string;
|
|
19
|
+
}
|
|
20
|
+
export interface Registration {
|
|
21
|
+
img: string;
|
|
22
|
+
title: string;
|
|
23
|
+
subtitle: string;
|
|
24
|
+
label: string;
|
|
25
|
+
}
|
|
26
|
+
export interface Informations {
|
|
27
|
+
title: string;
|
|
28
|
+
description: Array<string>;
|
|
29
|
+
register: {
|
|
30
|
+
img: string;
|
|
31
|
+
title: string;
|
|
32
|
+
subtitle: string;
|
|
33
|
+
label: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface Packages {
|
|
37
|
+
title: string;
|
|
38
|
+
memberships: Array<Product>;
|
|
39
|
+
}
|
|
40
|
+
export interface PaywallProduct {
|
|
41
|
+
informations: {
|
|
42
|
+
title: string;
|
|
43
|
+
description: Array<string>;
|
|
44
|
+
register: Registration;
|
|
45
|
+
meterred: Metered;
|
|
46
|
+
};
|
|
47
|
+
packages: Packages;
|
|
48
|
+
payment: {
|
|
49
|
+
desktop: Array<PaymentImage>;
|
|
50
|
+
mobile: Array<PaymentImage>;
|
|
51
|
+
ekstension: Array<PaymentImage>;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/kompas-paywall/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface Product {\n title: string\n percentage: number\n price: number\n discountPrice: number\n periode: string\n isHighlight: boolean\n url: string\n}\nexport interface Metered {\n maxQuota: number\n label: string\n maxQuotaMessage: string\n url: string\n}\nexport interface PaymentImage {\n name: string\n link: string\n}\nexport interface Registration {\n img: string\n title: string\n subtitle: string\n label: string\n}\nexport interface Informations {\n title: string\n description: Array<string>\n register: {\n img: string\n title: string\n subtitle: string\n label: string\n }\n}\nexport interface Packages {\n title: string\n memberships: Array<Product>\n}\nexport interface PaywallProduct {\n informations: {\n title: string\n description: Array<string>\n register: Registration\n meterred: Metered\n }\n packages: Packages\n payment: {\n desktop: Array<PaymentImage>\n mobile: Array<PaymentImage>\n ekstension: Array<PaymentImage>\n }\n}\n"]}
|
package/dist/src/components/kompas-paywall-banner-registration/KompasPaywallBannerRegistration.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Registration } from '../kompas-paywall/types.js';
|
|
3
|
+
export declare class KompasPaywallBannerRegistration extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
theme: string;
|
|
6
|
+
bannerData: Registration | undefined;
|
|
7
|
+
get isDark(): boolean;
|
|
8
|
+
private redirectToRegister;
|
|
9
|
+
private sendDataLayer;
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|