@kompasid/lit-web-components 0.9.39 → 0.9.41

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.
@@ -36,7 +36,6 @@ export class KompasMeteredPaywall extends LitElement {
36
36
  ]
37
37
 
38
38
  @state() private isLoading: Boolean = true
39
- @state() private maxQuota: number = 3
40
39
  @state() private packageData: PackageData = {
41
40
  subscriptionText: 'Langganan untuk akses tanpa batas',
42
41
  buttonText: 'Langganan',
@@ -48,7 +47,6 @@ export class KompasMeteredPaywall extends LitElement {
48
47
  * Props
49
48
  */
50
49
  /**
51
- * prop countdownArticle untuk menghandle sudah berapa artikel gratis yang user baca.
52
50
  * prop paywall_location = The location where user encounter the paywall
53
51
  * prop paywall_subscription_package = The name of the subscription package viewed by user
54
52
  * prop paywall_subscription_id = The ID of the subscription package viewed by user
@@ -63,10 +61,8 @@ export class KompasMeteredPaywall extends LitElement {
63
61
  * prop tracker_subscription_status = Status of their subscription
64
62
  * prop tracker_page_domain = Page Domain
65
63
  * prop tracker_metered_wall_type = The type of Metered Wall
66
- * prop tracker_epaper_edition = The edition of epaper viewed by user
67
64
  * prop tracker_metered_wall_balance = The balance of their metered wall
68
65
  */
69
- @property({ type: Number }) countdownArticle = 0
70
66
  @property({ type: String }) paywall_location = ''
71
67
  @property({ type: String }) paywall_subscription_package = ''
72
68
  @property({ type: String }) paywall_subscription_id = ''
@@ -83,27 +79,7 @@ export class KompasMeteredPaywall extends LitElement {
83
79
  @property({ type: String }) tracker_metered_wall_type = ''
84
80
  @property({ type: Number }) tracker_metered_wall_balance = 0
85
81
 
86
- private getCountdownArticle() {
87
- // const getCountdown = this.countdownArticle
88
- // const { maxQuota } = this
89
-
90
- // if (getCountdown > 0 && getCountdown < maxQuota) {
91
- // return html`
92
- // <p>
93
- // Anda memiliki sisa
94
- // <b>${maxQuota - getCountdown} dari ${maxQuota}</b> artikel premium
95
- // gratis bulan ini. ${this.packageData.subscriptionText}
96
- // </p>
97
- // `
98
- // }
99
- // return html`
100
- // <p>
101
- // Anda sedang membaca <b>artikel gratis terakhir bulan ini.</b> ${this
102
- // .packageData.subscriptionText}
103
- // </p>
104
- // `
105
-
106
- // Handle tanpa kuota
82
+ private textSubscription() {
107
83
  return html` <p>${this.packageData.subscriptionText}</p> `
108
84
  }
109
85
 
@@ -155,7 +131,7 @@ export class KompasMeteredPaywall extends LitElement {
155
131
  subscription_status: this.tracker_subscription_status,
156
132
  page_domain: this.tracker_page_domain || 'Kompas.id',
157
133
  metered_wall_type: this.tracker_metered_wall_type || 'MP',
158
- metered_wall_balance: this.maxQuota - this.countdownArticle + 1,
134
+ metered_wall_balance: this.tracker_metered_wall_balance || 0,
159
135
  })
160
136
  }
161
137
 
@@ -176,7 +152,7 @@ export class KompasMeteredPaywall extends LitElement {
176
152
  subscription_status: this.tracker_subscription_status,
177
153
  page_domain: this.tracker_page_domain || 'Kompas.id',
178
154
  metered_wall_type: this.tracker_metered_wall_type || 'MP',
179
- metered_wall_balance: this.maxQuota - this.countdownArticle + 1,
155
+ metered_wall_balance: this.tracker_metered_wall_balance || 0,
180
156
  })
181
157
  }
182
158
 
@@ -190,7 +166,7 @@ export class KompasMeteredPaywall extends LitElement {
190
166
  <div
191
167
  class="text-grey-600 text-sm md:text-lg self-center text-left"
192
168
  >
193
- ${this.getCountdownArticle()}
169
+ ${this.textSubscription()}
194
170
  </div>
195
171
  <div class="self-center">
196
172
  <button
@@ -206,3 +182,26 @@ export class KompasMeteredPaywall extends LitElement {
206
182
  : nothing
207
183
  }
208
184
  }
185
+
186
+ // Leftover code sebelum nya
187
+ // @state() private maxQuota: number = 3
188
+ // const getCountdown = this.countdownArticle
189
+ // const { maxQuota } = this
190
+
191
+ // if (getCountdown > 0 && getCountdown < maxQuota) {
192
+ // return html`
193
+ // <p>
194
+ // Anda memiliki sisa
195
+ // <b>${maxQuota - getCountdown} dari ${maxQuota}</b> artikel premium
196
+ // gratis bulan ini. ${this.packageData.subscriptionText}
197
+ // </p>
198
+ // `
199
+ // }
200
+ // return html`
201
+ // <p>
202
+ // Anda sedang membaca <b>artikel gratis terakhir bulan ini.</b> ${this
203
+ // .packageData.subscriptionText}
204
+ // </p>
205
+ // `
206
+
207
+ // Handle tanpa kuota
@@ -4,7 +4,6 @@
4
4
 
5
5
  | Property | Attribute | Description | Type | Default |
6
6
  | ------------------------------ | ------------------------------ | ---------------------------------------------------------------------------------------- | -------- | ------- |
7
- | `countdownArticle` | `countdown-article` | prop countdownArticle untuk menghandle sudah berapa artikel gratis yang user baca (User tidak bisa melihat kuota countdown dari update terbaru lit, namun data tetap di gunakan untuk GTM) | `number` | `0` |
8
7
  | `paywall_location` | `paywall_location` | prop paywall_location = The location where user encounter the paywall | `string` | `''` |
9
8
  | `paywall_position` | `paywall_position` | prop paywall_position = The position of ther subscription package viewed by user | `number` | `0` |
10
9
  | `paywall_subscription_id` | `paywall_subscription_id` | prop paywall_subscription_id = The ID of the subscription package viewed by user | `string` | `''` |
@@ -15,11 +14,11 @@
15
14
  | `tracker_content_title` | `tracker_content_title` | prop tracker_content_title = The title of article | `string` | `''` |
16
15
  | `tracker_content_type` | `tracker_content_type` | prop tracker_content_type = Whether it's free article or paid article | `string` | `''` |
17
16
  | `tracker_metered_wall_balance` | `tracker_metered_wall_balance` | prop tracker_metered_wall_balance = The balance of their metered wall | `number` | `0` |
18
- | `tracker_metered_wall_type` | `tracker_metered_wall_type` | prop tracker_metered_wall_type = The type of Metered Wall | `string` | `''` |
19
- | `tracker_page_domain` | `tracker_page_domain` | prop tracker_page_domain = Page Domain | `string` | `''` |
17
+ | `tracker_metered_wall_type` | `tracker_metered_wall_type` | prop tracker_metered_wall_type = The type of Metered Wall | `string` | `'MP'` |
18
+ | `tracker_page_domain` | `tracker_page_domain` | prop tracker_page_domain = Page Domain | `string` | `'Kompas.id'` |
20
19
  | `tracker_page_type` | `tracker_page_type` | prop tracker_page_type = Type of the page | `string` | `''` |
21
20
  | `tracker_subscription_status` | `tracker_subscription_status` | prop tracker_subscription_status = Status of their subscription | `string` | `''` |
22
- | `tracker_user_type` | `tracker_user_type` | prop tracker_user_type = Type of user based on their subscription | `string` | `''` |
21
+ | `tracker_user_type` | `tracker_user_type` | prop tracker_user_type = Type of user based on their subscription | `string` | `'R'` |
23
22
 
24
23
  ----------------------------------------------
25
24
 
@@ -127,6 +127,7 @@ export class KompasPaywall extends LitElement {
127
127
  text: 'Lihat Paket Lainnya',
128
128
  url: 'https://www.kompas.id/berlangganan/v2',
129
129
  },
130
+ typeVariant: '',
130
131
  },
131
132
  packages: {
132
133
  title: 'Sekali bayar, tanpa perpanjang otomatis',
@@ -309,6 +310,9 @@ export class KompasPaywall extends LitElement {
309
310
  ? json[defaultType][typeContextual].content
310
311
  : json[defaultType].content,
311
312
  cta: json[defaultType].cta,
313
+ typeVariant: json[defaultType][typeContextual]
314
+ ? json[defaultType][typeContextual].variant
315
+ : '',
312
316
  },
313
317
  packages: {
314
318
  ...this.mockResult.packages,
@@ -218,7 +218,8 @@ Example:
218
218
  "subscriptionId": "9891075",
219
219
  "position": 2
220
220
  }
221
- ]
221
+ ],
222
+ "variant": "A"
222
223
  },
223
224
  "typeB": {
224
225
  "head": "Tingkatkan Literasi di Bulan Suci Dengan Artikel Penuh Inspirasi Type B",
@@ -254,7 +255,8 @@ Example:
254
255
  "subscriptionId": "9891075",
255
256
  "position": 2
256
257
  }
257
- ]
258
+ ],
259
+ "variant": "B"
258
260
  },
259
261
  "swgEnable": true,
260
262
  "swgContent": {
@@ -74,6 +74,7 @@ export interface PaywallProduct {
74
74
  register: Registration
75
75
  meterred: Metered
76
76
  cta: ctaPaywall
77
+ typeVariant: string
77
78
  }
78
79
  packages: Packages
79
80
  payment: {
@@ -486,6 +486,7 @@ export class KompasIdPaywallBody extends LitElement {
486
486
  content_tags: this.tracker_content_tags || '',
487
487
  content_published_date: this.tracker_content_published_date || '',
488
488
  content_variant: this.tracker_content_variant || '',
489
+ variant: this.paywallData?.informations?.typeVariant || '',
489
490
  ...(this.type === 'epaper' || this.type === 'proMiningOutlook'
490
491
  ? { epaper_edition: this.tracker_epaper_edition }
491
492
  : {