@kompasid/lit-web-components 0.9.23 → 0.9.25

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.
@@ -99,6 +99,7 @@ export class KompasPaywall extends LitElement {
99
99
  @property({ type: String }) tracker_metered_wall_type = ''
100
100
  @property({ type: Number }) tracker_metered_wall_balance = 0
101
101
  @property({ type: String }) tracker_epaper_edition = ''
102
+ @property({ type: String }) tracker_content_publisher = ''
102
103
  @property({ type: String }) theme = ''
103
104
 
104
105
  mockResult: PaywallProduct = {
@@ -117,6 +118,11 @@ export class KompasPaywall extends LitElement {
117
118
  maxQuotaMessage: 'Akses artikel gratis Anda bulan ini sudah habis.',
118
119
  url: 'https://kompas.id/berlangganan',
119
120
  },
121
+ cta: {
122
+ show: true,
123
+ text: 'Lihat Paket Lainnya',
124
+ url: 'https://www.kompas.id/berlangganan/v2',
125
+ },
120
126
  },
121
127
  packages: {
122
128
  title: 'Sekali bayar, tanpa perpanjang otomatis',
@@ -271,19 +277,30 @@ export class KompasPaywall extends LitElement {
271
277
  'https://cdn-www.kompas.id/web-component/paywall.json'
272
278
  )
273
279
  const json = await response.json()
280
+ const listType = [
281
+ 'reguler',
282
+ 'audio',
283
+ 'proMiningOutlook',
284
+ 'proMiningArticle',
285
+ 'epaper',
286
+ 'custom',
287
+ ]
288
+ const findTypeOnTheList = listType.includes(this.type)
289
+ const defaultType = findTypeOnTheList ? this.type : 'reguler'
274
290
  this.paywallData = {
275
291
  ...this.mockResult,
276
292
  informations: {
277
293
  ...this.mockResult.informations,
278
- title: json[this.type].head,
279
- description: json[this.type].content,
294
+ title: json[defaultType].head,
295
+ description: json[defaultType].content,
296
+ cta: json[defaultType].cta,
280
297
  },
281
298
  packages: {
282
299
  ...this.mockResult.packages,
283
- memberships: json[this.type].memberships,
284
- swgEnable: json[this.type].swgEnable,
285
- freeTrial: json[this.type].freeTrial,
286
- swgContent: json[this.type].swgContent,
300
+ memberships: json[defaultType].memberships,
301
+ swgEnable: json[defaultType].swgEnable,
302
+ freeTrial: json[defaultType].freeTrial,
303
+ swgContent: json[defaultType].swgContent,
287
304
  },
288
305
  }
289
306
  } catch (error) {
@@ -320,6 +337,7 @@ export class KompasPaywall extends LitElement {
320
337
  tracker_metered_wall_type=${this.tracker_metered_wall_type}
321
338
  tracker_epaper_edition=${this.tracker_epaper_edition}
322
339
  tracker_metered_wall_balance=${this.tracker_metered_wall_balance}
340
+ tracker_content_publisher=${this.tracker_content_publisher}
323
341
  ?swgEnable=${this.swgEnable}
324
342
  tracker_content_type=${this.tracker_content_type}
325
343
  ?isLogin=${this.isLogin}
@@ -368,6 +386,7 @@ export class KompasPaywall extends LitElement {
368
386
  tracker_metered_wall_balance=${this
369
387
  .tracker_metered_wall_balance}
370
388
  tracker_content_type=${this.tracker_content_type}
389
+ tracker_content_publisher=${this.tracker_content_publisher}
371
390
  ?swgEnable=${this.swgEnable}
372
391
  ?isLogin=${this.isLogin}
373
392
  type=${this.type}
@@ -408,6 +427,7 @@ export class KompasPaywall extends LitElement {
408
427
  tracker_page_domain=${this.tracker_page_domain}
409
428
  tracker_metered_wall_type=${this.tracker_metered_wall_type}
410
429
  tracker_metered_wall_balance=${this.tracker_metered_wall_balance}
430
+ tracker_content_publisher=${this.tracker_content_publisher}
411
431
  ?swgEnable=${this.swgEnable}
412
432
  ?isLogin=${this.isLogin}
413
433
  type=${this.type}
@@ -459,6 +479,7 @@ export class KompasPaywall extends LitElement {
459
479
  tracker_metered_wall_balance=${this
460
480
  .tracker_metered_wall_balance}
461
481
  tracker_content_type=${this.tracker_content_type}
482
+ tracker_content_publisher=${this.tracker_content_publisher}
462
483
  ?swgEnable=${this.swgEnable}
463
484
  ?isLogin=${this.isLogin}
464
485
  type=${this.type}
@@ -500,6 +521,7 @@ export class KompasPaywall extends LitElement {
500
521
  tracker_page_domain=${this.tracker_page_domain}
501
522
  tracker_metered_wall_type=${this.tracker_metered_wall_type}
502
523
  tracker_metered_wall_balance=${this.tracker_metered_wall_balance}
524
+ tracker_content_publisher=${this.tracker_content_publisher}
503
525
  ?swgEnable=${this.swgEnable}
504
526
  ?isLogin=${this.isLogin}
505
527
  type=${this.type}
@@ -519,6 +541,8 @@ export class KompasPaywall extends LitElement {
519
541
  private selectorTypePaywall = (type: PaywallType) => {
520
542
  switch (type) {
521
543
  case 'epaper':
544
+ case 'proMiningArticle':
545
+ case 'proMiningOutlook':
522
546
  return this.renderEpaperPaywallSection()
523
547
  case 'audio':
524
548
  return this.renderAudioPaywallSection()
@@ -61,12 +61,19 @@ export interface Packages {
61
61
  swgContent: SwgContent
62
62
  }
63
63
 
64
+ export interface ctaPaywall {
65
+ show: boolean
66
+ text: string
67
+ url: string
68
+ }
69
+
64
70
  export interface PaywallProduct {
65
71
  informations: {
66
72
  title: string
67
73
  description: Array<string>
68
74
  register: Registration
69
75
  meterred: Metered
76
+ cta: ctaPaywall
70
77
  }
71
78
  packages: Packages
72
79
  payment: {
@@ -75,4 +82,10 @@ export interface PaywallProduct {
75
82
  ekstension: Array<PaymentImage>
76
83
  }
77
84
  }
78
- export type PaywallType = 'epaper' | 'reguler' | 'audio' | 'custom'
85
+ export type PaywallType =
86
+ | 'proMiningArticle'
87
+ | 'proMiningOutlook'
88
+ | 'epaper'
89
+ | 'reguler'
90
+ | 'audio'
91
+ | 'custom'
@@ -98,6 +98,7 @@ export class KompasIdPaywallBody extends LitElement {
98
98
  @property({ type: String }) tracker_metered_wall_type = ''
99
99
  @property({ type: Number }) tracker_metered_wall_balance = 0
100
100
  @property({ type: String }) tracker_epaper_edition = ''
101
+ @property({ type: String }) tracker_content_publisher = ''
101
102
  @property({ type: String }) theme = ''
102
103
  @property() togglePaywall = () => {}
103
104
 
@@ -182,8 +183,13 @@ export class KompasIdPaywallBody extends LitElement {
182
183
 
183
184
  private redirectToSubscriber(): void {
184
185
  this.sendDataLayer()
186
+ const getCtaUrl = this.paywallData?.informations?.cta
187
+ ? this.paywallData?.informations?.cta.url
188
+ : ''
189
+ // TODO: Hendy
190
+ // Bisa jadi ini nanti open from nya beda, untuk sekarang biarkan dulu, note 25 08 2025 (tolong tanya ke PM bersangkutan)
185
191
  const openFrom = `${this.type === 'epaper' ? 'ePaper' : 'Hard'}_Paywall`
186
- window.open(`https://www.kompas.id/berlangganan?open_from=${openFrom}`)
192
+ window.open(`${getCtaUrl}?open_from=${openFrom}`)
187
193
  }
188
194
 
189
195
  private redirectToHelpdesk(): void {
@@ -472,7 +478,7 @@ export class KompasIdPaywallBody extends LitElement {
472
478
  page_domain: this.tracker_page_domain || 'Kompas.id',
473
479
  metered_wall_type: this.tracker_metered_wall_type || 'HP',
474
480
  metered_wall_balance: this.tracker_metered_wall_balance,
475
- ...(this.type === 'epaper'
481
+ ...(this.type === 'epaper' || this.type === 'proMiningOutlook'
476
482
  ? { epaper_edition: this.tracker_epaper_edition }
477
483
  : {
478
484
  page_type: this.tracker_page_type,
@@ -480,6 +486,7 @@ export class KompasIdPaywallBody extends LitElement {
480
486
  content_title: this.tracker_content_title,
481
487
  content_categories: this.tracker_content_categories,
482
488
  content_type: this.tracker_content_type,
489
+ content_publisher: this.tracker_content_publisher,
483
490
  }),
484
491
  })),
485
492
  }
@@ -542,6 +549,7 @@ export class KompasIdPaywallBody extends LitElement {
542
549
  gtmParams.content_id = this.tracker_content_id
543
550
  gtmParams.content_categories = this.tracker_content_categories
544
551
  gtmParams.content_type = this.tracker_content_type
552
+ gtmParams.content_publisher = this.tracker_content_publisher
545
553
  gtmParams.page_type = this.tracker_page_type
546
554
  } else {
547
555
  gtmParams.epaper_edition = this.tracker_epaper_edition
@@ -682,18 +690,26 @@ export class KompasIdPaywallBody extends LitElement {
682
690
  </div>`
683
691
  }
684
692
 
685
- private informationPackages() {
693
+ private ctaPackages() {
686
694
  const marginTopClass = this.type === 'audio' ? 'mt-4 md:mt-2' : 'mt-4'
687
695
  const textColorClass = this.isDark ? 'text-blue-300' : 'text-blue-600'
688
-
689
- return html` <div class="flex justify-center ${marginTopClass}">
690
- <button
691
- @click=${this.otherPackagesClicked}
692
- class="text-sm md:text-base font-bold underline ${textColorClass}"
693
- >
694
- Lihat Paket Lainnya
695
- </button>
696
- </div>`
696
+ const getCtaText = this.paywallData?.informations?.cta
697
+ ? this.paywallData?.informations?.cta.text
698
+ : ''
699
+ const showCta = this.paywallData?.informations?.cta
700
+ ? this.paywallData?.informations?.cta.show
701
+ : false
702
+
703
+ return showCta
704
+ ? html` <div class="flex justify-center ${marginTopClass}">
705
+ <button
706
+ @click=${this.otherPackagesClicked}
707
+ class="text-sm md:text-base font-bold underline ${textColorClass}"
708
+ >
709
+ ${getCtaText}
710
+ </button>
711
+ </div>`
712
+ : nothing
697
713
  }
698
714
 
699
715
  private epaperRegistrationSection() {
@@ -1253,7 +1269,7 @@ export class KompasIdPaywallBody extends LitElement {
1253
1269
  ${this.packagesSection(
1254
1270
  this.paywallData?.packages ?? ({} as Packages)
1255
1271
  )}
1256
- ${this.informationPackages()}
1272
+ ${this.ctaPackages()}
1257
1273
  ${!isLogin
1258
1274
  ? html`
1259
1275
  <div
@@ -20,6 +20,7 @@
20
20
  | `tracker_content_id` | `tracker_content_id` | | `string` | `''` |
21
21
  | `tracker_content_title` | `tracker_content_title` | | `string` | `''` |
22
22
  | `tracker_content_type` | `tracker_content_type` | | `string` | `''` |
23
+ | `tracker_content_publisher` | `tracker_content_publisher` | | `string` | `''` |
23
24
  | `tracker_epaper_edition` | `tracker_epaper_edition` | | `string` | `''` |
24
25
  | `tracker_metered_wall_balance` | `tracker_metered_wall_balance` | | `number` | `0` |
25
26
  | `tracker_metered_wall_type` | `tracker_metered_wall_type` | | `string` | `''` |
@@ -27,7 +28,7 @@
27
28
  | `tracker_page_type` | `tracker_page_type` | | `string` | `''` |
28
29
  | `tracker_subscription_status` | `tracker_subscription_status` | | `string` | `''` |
29
30
  | `tracker_user_type` | `tracker_user_type` | | `string` | `''` |
30
- | `type` | `type` | | `"epaper" \| "reguler" \| "audio" \| "custom"` | `'reguler'` | `'reguler'` |
31
+ | `type` | `type` | | `"epaper" \| "reguler" \| "audio" \| "proMiningArticle" \| "proMiningOutlook" \| "custom"` | `'reguler'` | `'reguler'` |
31
32
  | `userGuid` | `user-guid` | | `string` | `''` |
32
33
 
33
34
 
@@ -642,10 +642,6 @@ video {
642
642
  grid-column: span 4 / span 4;
643
643
  }
644
644
 
645
- .m-6 {
646
- margin: 1.5rem;
647
- }
648
-
649
645
  .m-auto {
650
646
  margin: auto;
651
647
  }
@@ -665,16 +661,16 @@ video {
665
661
  margin-right: 1rem;
666
662
  }
667
663
 
664
+ .mx-6 {
665
+ margin-left: 1.5rem;
666
+ margin-right: 1.5rem;
667
+ }
668
+
668
669
  .mx-auto {
669
670
  margin-left: auto;
670
671
  margin-right: auto;
671
672
  }
672
673
 
673
- .my-1 {
674
- margin-top: 0.25rem;
675
- margin-bottom: 0.25rem;
676
- }
677
-
678
674
  .my-4 {
679
675
  margin-top: 1rem;
680
676
  margin-bottom: 1rem;
@@ -854,10 +850,6 @@ video {
854
850
  height: 4rem;
855
851
  }
856
852
 
857
- .h-2 {
858
- height: 0.5rem;
859
- }
860
-
861
853
  .h-20 {
862
854
  height: 5rem;
863
855
  }
@@ -951,10 +943,6 @@ video {
951
943
  width: 4rem;
952
944
  }
953
945
 
954
- .w-2 {
955
- width: 0.5rem;
956
- }
957
-
958
946
  .w-2\/3 {
959
947
  width: 66.666667%;
960
948
  }
@@ -1027,10 +1015,6 @@ video {
1027
1015
  width: 296px;
1028
1016
  }
1029
1017
 
1030
- .w-\[312px\] {
1031
- width: 312px;
1032
- }
1033
-
1034
1018
  .w-\[328px\] {
1035
1019
  width: 328px;
1036
1020
  }
@@ -1438,14 +1422,14 @@ video {
1438
1422
  background-color: rgb(44 44 44 / var(--tw-bg-opacity, 1));
1439
1423
  }
1440
1424
 
1441
- .bg-\[\#FFFFFF\] {
1425
+ .bg-\[\#D71920\] {
1442
1426
  --tw-bg-opacity: 1;
1443
- background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
1427
+ background-color: rgb(215 25 32 / var(--tw-bg-opacity, 1));
1444
1428
  }
1445
1429
 
1446
- .bg-\[\#e1f0ff\] {
1430
+ .bg-\[\#FFFFFF\] {
1447
1431
  --tw-bg-opacity: 1;
1448
- background-color: rgb(225 240 255 / var(--tw-bg-opacity, 1));
1432
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
1449
1433
  }
1450
1434
 
1451
1435
  .bg-black {
@@ -1724,14 +1708,6 @@ video {
1724
1708
  padding-left: 0.25rem;
1725
1709
  }
1726
1710
 
1727
- .pl-11 {
1728
- padding-left: 2.75rem;
1729
- }
1730
-
1731
- .pl-14 {
1732
- padding-left: 3.5rem;
1733
- }
1734
-
1735
1711
  .pl-2 {
1736
1712
  padding-left: 0.5rem;
1737
1713
  }
@@ -1740,6 +1716,10 @@ video {
1740
1716
  padding-left: 1rem;
1741
1717
  }
1742
1718
 
1719
+ .pl-8 {
1720
+ padding-left: 2rem;
1721
+ }
1722
+
1743
1723
  .pl-px {
1744
1724
  padding-left: 1px;
1745
1725
  }
@@ -1764,10 +1744,6 @@ video {
1764
1744
  padding-top: 0.125rem;
1765
1745
  }
1766
1746
 
1767
- .pt-1 {
1768
- padding-top: 0.25rem;
1769
- }
1770
-
1771
1747
  .pt-10 {
1772
1748
  padding-top: 2.5rem;
1773
1749
  }
@@ -1907,11 +1883,6 @@ video {
1907
1883
  color: rgb(0 85 154 / var(--tw-text-opacity, 1));
1908
1884
  }
1909
1885
 
1910
- .text-\[\#333\] {
1911
- --tw-text-opacity: 1;
1912
- color: rgb(51 51 51 / var(--tw-text-opacity, 1));
1913
- }
1914
-
1915
1886
  .text-\[\#666666\] {
1916
1887
  --tw-text-opacity: 1;
1917
1888
  color: rgb(102 102 102 / var(--tw-text-opacity, 1));
@@ -2052,6 +2023,10 @@ video {
2052
2023
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
2053
2024
  }
2054
2025
 
2026
+ .filter {
2027
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2028
+ }
2029
+
2055
2030
  .transition {
2056
2031
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
2057
2032
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
@@ -649,10 +649,6 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
649
649
  grid-column: span 4 / span 4;
650
650
  }
651
651
 
652
- .m-6 {
653
- margin: 1.5rem;
654
- }
655
-
656
652
  .m-auto {
657
653
  margin: auto;
658
654
  }
@@ -682,11 +678,6 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
682
678
  margin-right: auto;
683
679
  }
684
680
 
685
- .my-1 {
686
- margin-top: 0.25rem;
687
- margin-bottom: 0.25rem;
688
- }
689
-
690
681
  .my-4 {
691
682
  margin-top: 1rem;
692
683
  margin-bottom: 1rem;
@@ -866,10 +857,6 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
866
857
  height: 4rem;
867
858
  }
868
859
 
869
- .h-2 {
870
- height: 0.5rem;
871
- }
872
-
873
860
  .h-20 {
874
861
  height: 5rem;
875
862
  }
@@ -963,10 +950,6 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
963
950
  width: 4rem;
964
951
  }
965
952
 
966
- .w-2 {
967
- width: 0.5rem;
968
- }
969
-
970
953
  .w-2\\/3 {
971
954
  width: 66.666667%;
972
955
  }
@@ -1039,10 +1022,6 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
1039
1022
  width: 296px;
1040
1023
  }
1041
1024
 
1042
- .w-\\[312px\\] {
1043
- width: 312px;
1044
- }
1045
-
1046
1025
  .w-\\[328px\\] {
1047
1026
  width: 328px;
1048
1027
  }
@@ -1454,14 +1433,14 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
1454
1433
  background-color: rgb(44 44 44 / var(--tw-bg-opacity, 1));
1455
1434
  }
1456
1435
 
1457
- .bg-\\[\\#FFFFFF\\] {
1436
+ .bg-\\[\\#D71920\\] {
1458
1437
  --tw-bg-opacity: 1;
1459
- background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
1438
+ background-color: rgb(215 25 32 / var(--tw-bg-opacity, 1));
1460
1439
  }
1461
1440
 
1462
- .bg-\\[\\#e1f0ff\\] {
1441
+ .bg-\\[\\#FFFFFF\\] {
1463
1442
  --tw-bg-opacity: 1;
1464
- background-color: rgb(225 240 255 / var(--tw-bg-opacity, 1));
1443
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
1465
1444
  }
1466
1445
 
1467
1446
  .bg-black {
@@ -1740,18 +1719,6 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
1740
1719
  padding-left: 0.25rem;
1741
1720
  }
1742
1721
 
1743
- .pl-8 {
1744
- padding-left: 2rem;
1745
- }
1746
-
1747
- .pl-11 {
1748
- padding-left: 2.75rem;
1749
- }
1750
-
1751
- .pl-14 {
1752
- padding-left: 3.5rem;
1753
- }
1754
-
1755
1722
  .pl-2 {
1756
1723
  padding-left: 0.5rem;
1757
1724
  }
@@ -1760,6 +1727,10 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
1760
1727
  padding-left: 1rem;
1761
1728
  }
1762
1729
 
1730
+ .pl-8 {
1731
+ padding-left: 2rem;
1732
+ }
1733
+
1763
1734
  .pl-px {
1764
1735
  padding-left: 1px;
1765
1736
  }
@@ -1784,10 +1755,6 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
1784
1755
  padding-top: 0.125rem;
1785
1756
  }
1786
1757
 
1787
- .pt-1 {
1788
- padding-top: 0.25rem;
1789
- }
1790
-
1791
1758
  .pt-10 {
1792
1759
  padding-top: 2.5rem;
1793
1760
  }
@@ -1927,11 +1894,6 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
1927
1894
  color: rgb(0 85 154 / var(--tw-text-opacity, 1));
1928
1895
  }
1929
1896
 
1930
- .text-\\[\\#333\\] {
1931
- --tw-text-opacity: 1;
1932
- color: rgb(51 51 51 / var(--tw-text-opacity, 1));
1933
- }
1934
-
1935
1897
  .text-\\[\\#666666\\] {
1936
1898
  --tw-text-opacity: 1;
1937
1899
  color: rgb(102 102 102 / var(--tw-text-opacity, 1));
@@ -2076,6 +2038,12 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
2076
2038
  var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
2077
2039
  }
2078
2040
 
2041
+ .filter {
2042
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast)
2043
+ var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert)
2044
+ var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2045
+ }
2046
+
2079
2047
  .transition {
2080
2048
  transition-property: color, background-color, border-color,
2081
2049
  text-decoration-color, fill, stroke, opacity, box-shadow, transform,