@kompasid/lit-web-components 0.5.5 → 0.5.7
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/demo/index.html +26 -1
- package/dist/src/components/kompasid-metered-wall-register/KompasMeteredWallRegister.d.ts +98 -0
- package/dist/src/components/kompasid-metered-wall-register/KompasMeteredWallRegister.js +395 -0
- package/dist/src/components/kompasid-metered-wall-register/KompasMeteredWallRegister.js.map +1 -0
- package/dist/src/components/kompasid-metered-wall-register/types.d.ts +16 -0
- package/dist/src/components/kompasid-metered-wall-register/types.js +2 -0
- package/dist/src/components/kompasid-metered-wall-register/types.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/tailwind/tailwind.js +81 -0
- package/dist/tailwind/tailwind.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/kompasid-metered-wall-register/KompasMeteredWallRegister.ts +349 -0
- package/src/components/kompasid-metered-wall-register/readme.md +77 -0
- package/src/components/kompasid-metered-wall-register/types.ts +16 -0
- package/src/index.ts +1 -0
- package/tailwind/tailwind.css +81 -0
- package/tailwind/tailwind.ts +81 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { html, css, LitElement } from 'lit'
|
|
2
|
+
import { customElement, state, property } from 'lit/decorators.js'
|
|
3
|
+
import { unsafeSVG } from 'lit/directives/unsafe-svg.js'
|
|
4
|
+
import { getFontAwesomeIcon } from '../../utils/fontawesome-setup.js'
|
|
5
|
+
import { TWStyles } from '../../../tailwind/tailwind.js'
|
|
6
|
+
import { meteredRegisterContent } from './types.js'
|
|
7
|
+
|
|
8
|
+
@customElement('kompasid-metered-wall-register')
|
|
9
|
+
export class KompasMeteredWallRegister extends LitElement {
|
|
10
|
+
static styles = [
|
|
11
|
+
css`
|
|
12
|
+
:host {
|
|
13
|
+
font-family: 'PT Sans', sans-serif;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.body {
|
|
17
|
+
position: sticky;
|
|
18
|
+
top: 0;
|
|
19
|
+
height: 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.btn-regis {
|
|
24
|
+
margin-left: 16px;
|
|
25
|
+
width: 127px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.banner-content {
|
|
29
|
+
gap: 55px;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.cont-banner-content {
|
|
34
|
+
gap: 201px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.expanded-btn {
|
|
38
|
+
width: 127px;
|
|
39
|
+
}
|
|
40
|
+
`,
|
|
41
|
+
TWStyles,
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* state
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* state registerUrl untuk memberikan link kemana user akan dialihkan.
|
|
49
|
+
*/
|
|
50
|
+
@state() registerUrl: string =
|
|
51
|
+
'https://account.kompas.id/register?loc=metered_register_wall'
|
|
52
|
+
/**
|
|
53
|
+
* state isShowBanner untuk memunculkan component.
|
|
54
|
+
*/
|
|
55
|
+
@state() isShowBanner: boolean = true
|
|
56
|
+
/**
|
|
57
|
+
* state isExpandBanner untuk menentukan apakah component sedang dalam mode expand.
|
|
58
|
+
*/
|
|
59
|
+
@state() isExpandBanner: boolean = true
|
|
60
|
+
/**
|
|
61
|
+
* state textTemplate untuk menyimpan template yang di berikan.
|
|
62
|
+
*/
|
|
63
|
+
@state() private textTemplate: meteredRegisterContent = {
|
|
64
|
+
default: { title: '', lastArticle: { title: '' } },
|
|
65
|
+
expand: {
|
|
66
|
+
title: '',
|
|
67
|
+
description: '',
|
|
68
|
+
lastArticle: { title: '', description: '' },
|
|
69
|
+
},
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Props
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* prop countdownArticle untuk menghandle sudah berapa artikel gratis yang user baca.
|
|
76
|
+
* prop defaultExpandBanner untuk menentukan keadaan awal komponen apakah dalam mode expand atau tidak.
|
|
77
|
+
* prop tracker_page_title untuk title of the page
|
|
78
|
+
* prop tracker_page_type untuk type of the page
|
|
79
|
+
* prop tracker_content_type untuk whether it's a free article or paid article (will only be sent if the user views article detail page)
|
|
80
|
+
* prop tracker_content_id untuk the ID for the article (will only be sent if the user views article detail page)
|
|
81
|
+
* prop tracker_content_title untuk the title of the article (will only be sent if the user views article detail page)
|
|
82
|
+
* prop tracker_content_authors untuk name of the authors (will only be sent if the user views article detail page)
|
|
83
|
+
* prop tracker_content_editors untuk name of the editors (will only be sent if the user views article detail page)
|
|
84
|
+
* prop tracker_content_tags untuk tags inside the article (will only be sent if the user views article detail page)
|
|
85
|
+
* prop tracker_content_published_date untuk the published date (will only be sent if the user views article detail page)
|
|
86
|
+
* prop tracker_content_categories untuk The main category the content belongs to
|
|
87
|
+
* prop tracker_user_type untuk type of user based on their subscription
|
|
88
|
+
* prop tracker_subscription_status untuk status of their subscription
|
|
89
|
+
* prop tracker_metered_wall_type untuk the type of Metered Wall
|
|
90
|
+
* prop tracker_metered_wall_balance untuk the balance of their metered wall
|
|
91
|
+
* prop tracker_page_domain untuk Page Domain
|
|
92
|
+
* prop next_param untuk page Domain
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
@property({ type: Number }) countdownArticle = 0
|
|
96
|
+
@property({ type: Boolean }) defaultExpandBanner = false
|
|
97
|
+
@property({ type: Boolean }) isDesktop = false
|
|
98
|
+
@property({ type: String }) tracker_page_title = ''
|
|
99
|
+
@property({ type: String }) tracker_page_type = ''
|
|
100
|
+
@property({ type: String }) tracker_content_type = ''
|
|
101
|
+
@property({ type: String }) tracker_content_id = ''
|
|
102
|
+
@property({ type: String }) tracker_content_title = ''
|
|
103
|
+
@property({ type: String }) tracker_content_authors = ''
|
|
104
|
+
@property({ type: String }) tracker_content_editors = ''
|
|
105
|
+
@property({ type: String }) tracker_content_tags = ''
|
|
106
|
+
@property({ type: String }) tracker_content_published_date = ''
|
|
107
|
+
@property({ type: String }) tracker_content_categories = ''
|
|
108
|
+
@property({ type: String }) tracker_user_type = ''
|
|
109
|
+
@property({ type: String }) tracker_subscription_status = ''
|
|
110
|
+
@property({ type: String }) tracker_metered_wall_type = ''
|
|
111
|
+
@property({ type: Number }) tracker_metered_wall_balance = 0
|
|
112
|
+
@property({ type: String }) tracker_page_domain = ''
|
|
113
|
+
@property({ type: String }) next_param =
|
|
114
|
+
'https://www.kompas.id/baca/opini/2023/12/05/masa-depan-wolbachia-sebagai-alternatif-pengendalian-dbd?open_from=Section_Opini'
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* menentukan template yang akan di render
|
|
118
|
+
*/
|
|
119
|
+
private setTemplate(
|
|
120
|
+
prop: string,
|
|
121
|
+
mode: keyof meteredRegisterContent = 'default'
|
|
122
|
+
): string {
|
|
123
|
+
let template = ''
|
|
124
|
+
|
|
125
|
+
// dynamicMode dibuat agar typescript bisa akses data lastArticle
|
|
126
|
+
const dynamicMode = this.textTemplate[mode]
|
|
127
|
+
|
|
128
|
+
if ('lastArticle' in dynamicMode) {
|
|
129
|
+
const lastArticleMode = dynamicMode as {
|
|
130
|
+
lastArticle: { [key: string]: string }
|
|
131
|
+
}
|
|
132
|
+
template = lastArticleMode.lastArticle[prop] || ''
|
|
133
|
+
} else {
|
|
134
|
+
template = dynamicMode[prop] || ''
|
|
135
|
+
}
|
|
136
|
+
return template
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
private checkIsDesktop() {
|
|
140
|
+
if (window.innerWidth >= 960) {
|
|
141
|
+
this.isDesktop = true
|
|
142
|
+
} else {
|
|
143
|
+
this.isDesktop = false
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Render Statement
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
private bannerTemplate() {
|
|
152
|
+
return this.isExpandBanner
|
|
153
|
+
? this.expandedBannerContent()
|
|
154
|
+
: this.defaultBannerContent()
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
private defaultBannerContent() {
|
|
158
|
+
return html`
|
|
159
|
+
<div>
|
|
160
|
+
<div
|
|
161
|
+
class="${this.isDesktop
|
|
162
|
+
? 'cont-banner-content justify-center'
|
|
163
|
+
: null} flex flex-row justify-between"
|
|
164
|
+
>
|
|
165
|
+
<div class="banner-content flex flex-row">
|
|
166
|
+
<div
|
|
167
|
+
class="text-base md:text-lg font-lora mb-3 mt-1 md:mb-0 md:mt-0 pr-14 md:px-0"
|
|
168
|
+
.innerHTML=${this.setTemplate('title')}
|
|
169
|
+
></div>
|
|
170
|
+
<div .hidden="${!this.isDesktop}" class="md:self-center btn-regis">
|
|
171
|
+
${this.isDesktop
|
|
172
|
+
? html`<div class="ml-4"></div>
|
|
173
|
+
${this.registerButtonTemplate()}`
|
|
174
|
+
: null}
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
<div>
|
|
178
|
+
<button
|
|
179
|
+
@click="${this.triggerExpandBanner}"
|
|
180
|
+
class="h-9 w-9 flex ml-2 items-center justify-center text-blue-500 rounded bg-blue-200"
|
|
181
|
+
>
|
|
182
|
+
<div
|
|
183
|
+
class="icon icon-blue-600 ${this.isExpandBanner
|
|
184
|
+
? 'chevron-down'
|
|
185
|
+
: 'rotate-180'}"
|
|
186
|
+
>
|
|
187
|
+
${unsafeSVG(getFontAwesomeIcon('fas', 'chevron-down'))}
|
|
188
|
+
</div>
|
|
189
|
+
</button>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
<div class="md:self-center mt-4">
|
|
193
|
+
${!this.isDesktop ? html`${this.registerButtonTemplate()} ` : null}
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
`
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
private expandedBannerContent() {
|
|
200
|
+
return html`
|
|
201
|
+
<div
|
|
202
|
+
class="flex flex-col-reverse justify-evenly md:flex-row gap-4 md:gap-8"
|
|
203
|
+
>
|
|
204
|
+
<div
|
|
205
|
+
class="flex flex-col justify-evenly md:text-left md:w-5/12 gap-4 md:gap-2"
|
|
206
|
+
>
|
|
207
|
+
<p
|
|
208
|
+
class="text-lg md:text-2xl font-lora"
|
|
209
|
+
.innerHTML=${this.setTemplate('title', 'expand')}
|
|
210
|
+
></p>
|
|
211
|
+
<p
|
|
212
|
+
class="text-sm md:text-base"
|
|
213
|
+
.innerHTML=${this.setTemplate('description', 'expand')}
|
|
214
|
+
></p>
|
|
215
|
+
<div class="${this.isDesktop ? null : 'expanded-btn'} md:self-start">
|
|
216
|
+
${this.registerButtonTemplate()}
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
<div class="flex justify-center">
|
|
220
|
+
<img
|
|
221
|
+
alt="metered-wall-register"
|
|
222
|
+
src="https://d3w4qaq4xm1ncv.cloudfront.net/paywall-asset/paywall_ilustrasi3-03_1.png"
|
|
223
|
+
class="h-40 w-40 md:w-full md:h-full"
|
|
224
|
+
/>
|
|
225
|
+
</div>
|
|
226
|
+
<button
|
|
227
|
+
@click="${this.triggerExpandBanner}"
|
|
228
|
+
class="h-9 w-9 ${this.isDesktop
|
|
229
|
+
? null
|
|
230
|
+
: 'ml-auto'} flex items-center justify-center text-blue-500 rounded bg-blue-200"
|
|
231
|
+
>
|
|
232
|
+
<div
|
|
233
|
+
class="icon icon-blue-600 ${this.isExpandBanner
|
|
234
|
+
? 'chevron-down'
|
|
235
|
+
: 'rotate-180'}"
|
|
236
|
+
>
|
|
237
|
+
${unsafeSVG(getFontAwesomeIcon('fas', 'chevron-down'))}
|
|
238
|
+
</div>
|
|
239
|
+
</button>
|
|
240
|
+
</div>
|
|
241
|
+
`
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* template button register
|
|
246
|
+
*/
|
|
247
|
+
private registerButtonTemplate() {
|
|
248
|
+
return html`
|
|
249
|
+
<button
|
|
250
|
+
onClick=${this.redirectToRegister}
|
|
251
|
+
class="bg-green-500 px-5 py-3 w-full rounded-md font-bold text-grey-100 text-sm md:text-base"
|
|
252
|
+
>
|
|
253
|
+
Daftar Akun
|
|
254
|
+
</button>
|
|
255
|
+
`
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* mengarahkan ke page register
|
|
260
|
+
*/
|
|
261
|
+
private redirectToRegister = (): void => {
|
|
262
|
+
this.pushToDataLayer('mrw_clicked')
|
|
263
|
+
const newUrl = new URL(decodeURIComponent(this.registerUrl))
|
|
264
|
+
if (this.next_param)
|
|
265
|
+
newUrl.searchParams.append('next', decodeURIComponent(this.next_param))
|
|
266
|
+
window.location.href = newUrl.toString()
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* mengirim event ke datalayer
|
|
271
|
+
*/
|
|
272
|
+
private pushToDataLayer(eventName: string) {
|
|
273
|
+
window.dataLayer.push({
|
|
274
|
+
event: eventName,
|
|
275
|
+
page_title: this.tracker_page_title,
|
|
276
|
+
page_type: this.tracker_page_type,
|
|
277
|
+
content_type: this.tracker_content_type,
|
|
278
|
+
content_id: this.tracker_content_id,
|
|
279
|
+
content_title: this.tracker_content_title,
|
|
280
|
+
content_authors: this.tracker_content_authors,
|
|
281
|
+
content_editors: this.tracker_content_editors,
|
|
282
|
+
content_tags: this.tracker_content_tags,
|
|
283
|
+
content_published_date: this.tracker_content_published_date,
|
|
284
|
+
content_categories: this.tracker_content_categories,
|
|
285
|
+
user_type: this.tracker_user_type || 'G',
|
|
286
|
+
subscription_status: this.tracker_subscription_status || '',
|
|
287
|
+
metered_wall_type: this.tracker_metered_wall_type || 'MRW',
|
|
288
|
+
metered_wall_balance: this.tracker_metered_wall_balance,
|
|
289
|
+
page_domain: this.tracker_page_domain || 'Kompas.id',
|
|
290
|
+
})
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* toggle isExpandBanner flag
|
|
295
|
+
*/
|
|
296
|
+
private triggerExpandBanner() {
|
|
297
|
+
this.isExpandBanner = !this.isExpandBanner
|
|
298
|
+
return !this.isExpandBanner && this.pushToDataLayer('mrw_closed')
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Lifecycle
|
|
303
|
+
*/
|
|
304
|
+
|
|
305
|
+
override async connectedCallback() {
|
|
306
|
+
super.connectedCallback()
|
|
307
|
+
await this.updateComplete
|
|
308
|
+
this.loadData()
|
|
309
|
+
this.checkIsDesktop()
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
private async loadData() {
|
|
313
|
+
const req = await fetch(
|
|
314
|
+
`https://d3w4qaq4xm1ncv.cloudfront.net/assets/register_wall.json`
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
if (req.status !== 200) {
|
|
318
|
+
throw new Error(`${req.status} Ada galat saat memproses permintaan.`)
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
this.textTemplate = await req.json()
|
|
322
|
+
|
|
323
|
+
const getCountdown = this.countdownArticle
|
|
324
|
+
|
|
325
|
+
if (!getCountdown) {
|
|
326
|
+
this.isShowBanner = false
|
|
327
|
+
} else {
|
|
328
|
+
this.isExpandBanner = this.defaultExpandBanner
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (this.isShowBanner) {
|
|
332
|
+
this.pushToDataLayer('mrw_viewed')
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
render() {
|
|
337
|
+
return this.isShowBanner
|
|
338
|
+
? html`
|
|
339
|
+
<div class="sticky bottom-0 w-full h-full z-20">
|
|
340
|
+
<div class="w-full bg-blue-100 px-4 xl:px-0 bottom-0 py-4">
|
|
341
|
+
<div class="lg:max-w-7xl m-auto relative">
|
|
342
|
+
<div>${this.bannerTemplate()}</div>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
`
|
|
347
|
+
: null
|
|
348
|
+
}
|
|
349
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# kompas-metered-register
|
|
2
|
+
|
|
3
|
+
### Standar
|
|
4
|
+
|
|
5
|
+
Anda perlu meletakkan _tag_ komponen `<kompas-metered-wall-register />` pada halaman anda.
|
|
6
|
+
|
|
7
|
+
### Elemen
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
<kompas-metered-wall-register countdown-article="1" />
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Detail Props
|
|
14
|
+
|
|
15
|
+
### 1. countdownArticle
|
|
16
|
+
|
|
17
|
+
- Value berapa banyak sisa artikel yang dapat dibaca
|
|
18
|
+
Jika valuenya:
|
|
19
|
+
0 => tidak ada yg muncul
|
|
20
|
+
1 => akan menampilkan text artikel terakhir
|
|
21
|
+
lebih dari 1 => akan menampilkan normal text
|
|
22
|
+
|
|
23
|
+
### Catatan
|
|
24
|
+
|
|
25
|
+
Text pada komponen ini dapat di update dengan mengubah value dari url https://d3w4qaq4xm1ncv.cloudfront.net/assets/register_wall.json
|
|
26
|
+
|
|
27
|
+
Dengan format dibawah ini:
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
{
|
|
31
|
+
"expand": {
|
|
32
|
+
"lastArticle": {
|
|
33
|
+
"title": "<span>Anda Sedang Membaca <b>Artikel Premium Gratis Terakhir</b> dari Kompas.id</span>",
|
|
34
|
+
"description": "<span>Ayo daftar akun untuk akses ke beragam artikel dan fitur premium. Anda juga mendukung jurnalisme berkualitas dengan mendaftar akun.</span>"
|
|
35
|
+
},
|
|
36
|
+
"title": "<b>Tertarik dengan Artikel Ini? Daftar untuk Akses Artikel Menarik Lainnya</b>",
|
|
37
|
+
"description": "<span>Dapatkan akses ke beragam konten dan fitur premium Kompas.id. Anda juga mendukung jurnalisme berkualitas dengan mendaftar akun.</span>"
|
|
38
|
+
},
|
|
39
|
+
"default": {
|
|
40
|
+
"lastArticle": {
|
|
41
|
+
"title": "<span>Ini Adalah <b>Artikel Gratis Terakhir</b> Anda. <b>Daftar Akun untuk Terus Membaca.</b></span>"
|
|
42
|
+
},
|
|
43
|
+
"title": "<b>Dukung jurnalisme berkualitas dengan mendaftar akun Kompas.id.</b>"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
<!-- Auto Generated Below -->
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## Properties
|
|
52
|
+
|
|
53
|
+
| Property | Attribute | Description | Type | Default |
|
|
54
|
+
| -------------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------- | --------- | ----------- |
|
|
55
|
+
| `countdownArticle` | `countdown-article` | prop countdownArticle untuk menghandle sudah berapa artikel gratis yang user baca. | `number` | `0` |
|
|
56
|
+
| `defaultExpandBanner` | `default-expand-banner` | prop defaultExpandBanner untuk menentukan keadaan awal komponen apakah dalam mode expand atau tidak. | `boolean` | `true` |
|
|
57
|
+
| `next_param` | `next_param` | Page Domain | `string` | `undefined` |
|
|
58
|
+
| `tracker_content_authors` | `tracker_content_authors` | Name of the authors (will only be sent if the user views article detail page) | `string` | `undefined` |
|
|
59
|
+
| `tracker_content_categories` | `tracker_content_categories` | The main category the content belongs to | `string` | `undefined` |
|
|
60
|
+
| `tracker_content_editors` | `tracker_content_editors` | Name of the editors (will only be sent if the user views article detail page) | `string` | `undefined` |
|
|
61
|
+
| `tracker_content_id` | `tracker_content_id` | The ID for the article (will only be sent if the user views article detail page) | `string` | `undefined` |
|
|
62
|
+
| `tracker_content_published_date` | `tracker_content_published_date` | The published date (will only be sent if the user views article detail page) | `string` | `undefined` |
|
|
63
|
+
| `tracker_content_tags` | `tracker_content_tags` | Tags inside the article (will only be sent if the user views article detail page) | `string` | `undefined` |
|
|
64
|
+
| `tracker_content_title` | `tracker_content_title` | The title of the article (will only be sent if the user views article detail page) | `string` | `undefined` |
|
|
65
|
+
| `tracker_content_type` | `tracker_content_type` | Whether it's a free article or paid article (will only be sent if the user views article detail page) | `string` | `undefined` |
|
|
66
|
+
| `tracker_metered_wall_balance` | `tracker_metered_wall_balance` | The balance of their metered wall | `number` | `0` |
|
|
67
|
+
| `tracker_metered_wall_type` | `tracker_metered_wall_type` | The type of Metered Wall | `string` | `undefined` |
|
|
68
|
+
| `tracker_page_domain` | `tracker_page_domain` | Page Domain | `string` | `undefined` |
|
|
69
|
+
| `tracker_page_title` | `tracker_page_title` | Title of the page | `string` | `undefined` |
|
|
70
|
+
| `tracker_page_type` | `tracker_page_type` | Type of the page | `string` | `undefined` |
|
|
71
|
+
| `tracker_subscription_status` | `tracker_subscription_status` | Status of their subscription | `string` | `undefined` |
|
|
72
|
+
| `tracker_user_type` | `tracker_user_type` | Type of user based on their subscription | `string` | `undefined` |
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
----------------------------------------------
|
|
76
|
+
|
|
77
|
+
*Terbikin oleh tim front-end kompas.id*
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { KompasFooter } from './components/kompasid-footer/KompasFooter.js'
|
|
|
3
3
|
export { KompasPaywallVideo } from './components/kompasid-paywall-video/KompasPaywallVideo.js'
|
|
4
4
|
export { KompasMeteredPaywall } from './components/kompasid-metered-paywall/KompasMeteredPaywall.js'
|
|
5
5
|
export { KompasFreewall } from './components/kompasid-freewall/KompasFreewall.js'
|
|
6
|
+
export { KompasMeteredWallRegister } from './components/kompasid-metered-wall-register/KompasMeteredWallRegister.js'
|
|
6
7
|
|
|
7
8
|
declare global {
|
|
8
9
|
interface Window {
|
package/tailwind/tailwind.css
CHANGED
|
@@ -602,6 +602,10 @@ video {
|
|
|
602
602
|
grid-column: span 4 / span 4;
|
|
603
603
|
}
|
|
604
604
|
|
|
605
|
+
.m-auto {
|
|
606
|
+
margin: auto;
|
|
607
|
+
}
|
|
608
|
+
|
|
605
609
|
.mx-2 {
|
|
606
610
|
margin-left: 0.5rem;
|
|
607
611
|
margin-right: 0.5rem;
|
|
@@ -656,6 +660,10 @@ video {
|
|
|
656
660
|
margin-bottom: 0.5rem;
|
|
657
661
|
}
|
|
658
662
|
|
|
663
|
+
.mb-3 {
|
|
664
|
+
margin-bottom: 0.75rem;
|
|
665
|
+
}
|
|
666
|
+
|
|
659
667
|
.mb-4 {
|
|
660
668
|
margin-bottom: 1rem;
|
|
661
669
|
}
|
|
@@ -680,6 +688,10 @@ video {
|
|
|
680
688
|
margin-left: 0.75rem;
|
|
681
689
|
}
|
|
682
690
|
|
|
691
|
+
.ml-4 {
|
|
692
|
+
margin-left: 1rem;
|
|
693
|
+
}
|
|
694
|
+
|
|
683
695
|
.ml-8 {
|
|
684
696
|
margin-left: 2rem;
|
|
685
697
|
}
|
|
@@ -728,6 +740,10 @@ video {
|
|
|
728
740
|
margin-top: 2rem;
|
|
729
741
|
}
|
|
730
742
|
|
|
743
|
+
.ml-auto {
|
|
744
|
+
margin-left: auto;
|
|
745
|
+
}
|
|
746
|
+
|
|
731
747
|
.block {
|
|
732
748
|
display: block;
|
|
733
749
|
}
|
|
@@ -760,6 +776,10 @@ video {
|
|
|
760
776
|
height: 1rem;
|
|
761
777
|
}
|
|
762
778
|
|
|
779
|
+
.h-40 {
|
|
780
|
+
height: 10rem;
|
|
781
|
+
}
|
|
782
|
+
|
|
763
783
|
.h-5 {
|
|
764
784
|
height: 1.25rem;
|
|
765
785
|
}
|
|
@@ -865,6 +885,10 @@ video {
|
|
|
865
885
|
width: 100%;
|
|
866
886
|
}
|
|
867
887
|
|
|
888
|
+
.w-\[127px\] {
|
|
889
|
+
width: 127px;
|
|
890
|
+
}
|
|
891
|
+
|
|
868
892
|
.max-w-7xl {
|
|
869
893
|
max-width: 80rem;
|
|
870
894
|
}
|
|
@@ -942,6 +966,10 @@ video {
|
|
|
942
966
|
flex-direction: column;
|
|
943
967
|
}
|
|
944
968
|
|
|
969
|
+
.flex-col-reverse {
|
|
970
|
+
flex-direction: column-reverse;
|
|
971
|
+
}
|
|
972
|
+
|
|
945
973
|
.flex-wrap {
|
|
946
974
|
flex-wrap: wrap;
|
|
947
975
|
}
|
|
@@ -1263,6 +1291,11 @@ video {
|
|
|
1263
1291
|
padding-right: 1rem;
|
|
1264
1292
|
}
|
|
1265
1293
|
|
|
1294
|
+
.px-5 {
|
|
1295
|
+
padding-left: 1.25rem;
|
|
1296
|
+
padding-right: 1.25rem;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1266
1299
|
.px-8 {
|
|
1267
1300
|
padding-left: 2rem;
|
|
1268
1301
|
padding-right: 2rem;
|
|
@@ -1357,6 +1390,10 @@ video {
|
|
|
1357
1390
|
padding-left: 1rem;
|
|
1358
1391
|
}
|
|
1359
1392
|
|
|
1393
|
+
.pr-14 {
|
|
1394
|
+
padding-right: 3.5rem;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1360
1397
|
.pr-2 {
|
|
1361
1398
|
padding-right: 0.5rem;
|
|
1362
1399
|
}
|
|
@@ -1606,6 +1643,10 @@ video {
|
|
|
1606
1643
|
margin-right: 1.25rem;
|
|
1607
1644
|
}
|
|
1608
1645
|
|
|
1646
|
+
.md\:mt-0 {
|
|
1647
|
+
margin-top: 0px;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1609
1650
|
.md\:mt-3 {
|
|
1610
1651
|
margin-top: 0.75rem;
|
|
1611
1652
|
}
|
|
@@ -1638,6 +1679,10 @@ video {
|
|
|
1638
1679
|
height: 68px;
|
|
1639
1680
|
}
|
|
1640
1681
|
|
|
1682
|
+
.md\:h-full {
|
|
1683
|
+
height: 100%;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1641
1686
|
.md\:h-max {
|
|
1642
1687
|
height: -moz-max-content;
|
|
1643
1688
|
height: max-content;
|
|
@@ -1655,6 +1700,10 @@ video {
|
|
|
1655
1700
|
width: 10rem;
|
|
1656
1701
|
}
|
|
1657
1702
|
|
|
1703
|
+
.md\:w-5\/12 {
|
|
1704
|
+
width: 41.666667%;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1658
1707
|
.md\:w-52 {
|
|
1659
1708
|
width: 13rem;
|
|
1660
1709
|
}
|
|
@@ -1715,6 +1764,14 @@ video {
|
|
|
1715
1764
|
justify-content: center;
|
|
1716
1765
|
}
|
|
1717
1766
|
|
|
1767
|
+
.md\:gap-2 {
|
|
1768
|
+
gap: 0.5rem;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
.md\:gap-8 {
|
|
1772
|
+
gap: 2rem;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1718
1775
|
.md\:space-x-0 > :not([hidden]) ~ :not([hidden]) {
|
|
1719
1776
|
--tw-space-x-reverse: 0;
|
|
1720
1777
|
margin-right: calc(0px * var(--tw-space-x-reverse));
|
|
@@ -1745,10 +1802,18 @@ video {
|
|
|
1745
1802
|
margin-bottom: calc(1rem * var(--tw-space-y-reverse));
|
|
1746
1803
|
}
|
|
1747
1804
|
|
|
1805
|
+
.md\:self-start {
|
|
1806
|
+
align-self: flex-start;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1748
1809
|
.md\:self-end {
|
|
1749
1810
|
align-self: flex-end;
|
|
1750
1811
|
}
|
|
1751
1812
|
|
|
1813
|
+
.md\:self-center {
|
|
1814
|
+
align-self: center;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1752
1817
|
.md\:rounded {
|
|
1753
1818
|
border-radius: 0.25rem;
|
|
1754
1819
|
}
|
|
@@ -1826,6 +1891,11 @@ video {
|
|
|
1826
1891
|
text-align: left;
|
|
1827
1892
|
}
|
|
1828
1893
|
|
|
1894
|
+
.md\:text-2xl {
|
|
1895
|
+
font-size: 1.5rem;
|
|
1896
|
+
line-height: 2rem;
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1829
1899
|
.md\:text-base {
|
|
1830
1900
|
font-size: 1rem;
|
|
1831
1901
|
line-height: 1.5rem;
|
|
@@ -1914,6 +1984,10 @@ video {
|
|
|
1914
1984
|
width: 410px;
|
|
1915
1985
|
}
|
|
1916
1986
|
|
|
1987
|
+
.lg\:max-w-7xl {
|
|
1988
|
+
max-width: 80rem;
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1917
1991
|
.lg\:grid-cols-12 {
|
|
1918
1992
|
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
1919
1993
|
}
|
|
@@ -1978,3 +2052,10 @@ video {
|
|
|
1978
2052
|
padding-bottom: 1.5rem;
|
|
1979
2053
|
}
|
|
1980
2054
|
}
|
|
2055
|
+
|
|
2056
|
+
@media (min-width: 1280px) {
|
|
2057
|
+
.xl\:px-0 {
|
|
2058
|
+
padding-left: 0px;
|
|
2059
|
+
padding-right: 0px;
|
|
2060
|
+
}
|
|
2061
|
+
}
|