@kompasid/lit-web-components 0.9.40 → 0.9.42

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.
Files changed (26) hide show
  1. package/demo/header.html +3 -3
  2. package/dist/src/components/kompasid-header-account/KompasHeaderAccount.d.ts +3 -7
  3. package/dist/src/components/kompasid-header-account/KompasHeaderAccount.js +9 -29
  4. package/dist/src/components/kompasid-header-account/KompasHeaderAccount.js.map +1 -1
  5. package/dist/src/components/kompasid-header-account-menu/KompasHeaderAccountMenu.d.ts +3 -15
  6. package/dist/src/components/kompasid-header-account-menu/KompasHeaderAccountMenu.js +9 -30
  7. package/dist/src/components/kompasid-header-account-menu/KompasHeaderAccountMenu.js.map +1 -1
  8. package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.d.ts +0 -1
  9. package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.js +0 -4
  10. package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.js.map +1 -1
  11. package/dist/src/components/kompasid-paywall/KompasPaywall.js +4 -0
  12. package/dist/src/components/kompasid-paywall/KompasPaywall.js.map +1 -1
  13. package/dist/src/components/kompasid-paywall/types.d.ts +1 -0
  14. package/dist/src/components/kompasid-paywall/types.js.map +1 -1
  15. package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js +29 -25
  16. package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js.map +1 -1
  17. package/dist/tsconfig.tsbuildinfo +1 -1
  18. package/package.json +1 -1
  19. package/src/components/kompasid-header-account/KompasHeaderAccount.ts +6 -14
  20. package/src/components/kompasid-header-account/readme.md +29 -7
  21. package/src/components/kompasid-header-account-menu/KompasHeaderAccountMenu.ts +8 -24
  22. package/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.ts +0 -1
  23. package/src/components/kompasid-paywall/KompasPaywall.ts +4 -0
  24. package/src/components/kompasid-paywall/readme.md +4 -2
  25. package/src/components/kompasid-paywall/types.ts +1 -0
  26. package/src/components/kompasid-paywall-body/KompasPaywallBody.ts +1 -0
@@ -6,10 +6,9 @@ Ini adalah komponen _header account_ yang akan di implementasi pada header
6
6
  | Property | Attribute | Description | Type | Default | Required |
7
7
  | ------------------------------ | ------------------------------ | --------------------------------------------- | ------------------------- | -------------- | -------- |
8
8
  | `userData` | `userData` | `Object containing user data` | `object` | `{}` | `yes` |
9
- | `logoutUrl` | `logoutUrl` | `URL to log the user out` | `string` | `''` | `no` |
10
- | `manageAccountUrl` | `manageAccountUrl` | `URL to manage user account settings` | `string` | `''` | `no` |
11
- | `notificationUrl` | `notificationUrl` | `URL to view user notifications` | `string` | `''` | `no` |
12
- | `readLaterUrl` | `readLaterUrl` | `URL to access the "Read Later" feature` | `string` | `''` | `no` |
9
+ | `logout_url` | `logout_url` | `URL to log the user out` | `string` | `'https://auth.kompas.id/login'` | `no` |
10
+ | `manage_account_url` | `manage_account_url` | `URL to manage user account settings` | `string` | `'https://manage-account.kompas.id/manage-account/my-account'` | `no` |
11
+ | `read_later_url` | `read_later_url` | `URL to access the "Read Later" feature` | `string` | `'https://www.kompas.id/baca-nanti'` | `no` |
13
12
  | `sidebarTopSpacing` | `sidebarTopSpacing` | `Top spacing for the sidebar (in pixels)` | `number` | `0` | `no` |
14
13
  | `subscriptionUrl` | `subscriptionUrl` | `URL to manage subscriptions` | `string` | `''` | `no` |
15
14
  | `theme` | `theme` | `Component theme` | `'default' \| 'primary'` | `'primary'` | `no` |
@@ -24,6 +23,29 @@ Ini adalah komponen _header account_ yang akan di implementasi pada header
24
23
  | `isGracePeriod` | `isGracePeriod` | Boolean flag indicating whether the user is currently in a grace period. Set to `true` if the grace period array is not empty. **However**, if both active membership and grace period arrays are not empty, this value must be `false`. | `boolean` | `false` | yes |
25
24
  | `isMembership` | `isMembership` | Boolean flag indicating whether the user has an active membership. Set to `true` if the active membership array is not empty. | `boolean` | `false` | yes |
26
25
 
26
+ ## Properties Grace Period Default
27
+ Property dapat dilihat di [Readme Grace Period](https://github.com/pt-kompas-media-nusantara/lit-web-component/tree/master/src/components/kompasid-grace-period).
28
+ Pemakaian kalo memang tidak ada perubahan, lebih baik tidak digunakan atau di konfirmasi lagi ke PM. Kegunaan property ini hanya pada saat status grace period aktif dan biasanya di biarkan secara default kalau di header.
29
+
30
+ | Property | Attribute | Description | Type | Default | Required |
31
+ | ------------------------------ | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | -------------- | -------- |
32
+ | `paywall_location` | `paywall_location` | | `string` | `''` | no |
33
+ | `paywall_subscription_package` | `paywall_subscription_package` | | `string` | `''` | no |
34
+ | `paywall_subscription_id` | `paywall_subscription_id` | | `number` | `0` | no |
35
+ | `paywall_subscription_price` | `paywall_subscription_price` | | `number` | `0` | no |
36
+ | `paywall_position` | `paywall_position` | | `number` | `0` | no |
37
+ | `tracker_page_type` | `tracker_page_type` | | `string` | `''` | no |
38
+ | `tracker_content_id` | `tracker_content_id` | | `string` | `''` | no |
39
+ | `tracker_content_title` | `tracker_content_title` | | `string` | `''` | no |
40
+ | `tracker_content_categories` | `tracker_content_categories` | | `string` | `''` | no |
41
+ | `tracker_content_type` | `tracker_content_type` | | `string` | `''` | no |
42
+ | `tracker_user_type` | `tracker_user_type` | | `string` | `''` | no |
43
+ | `tracker_subscription_status` | `tracker_subscription_status` | | `string` | `''`` | no |
44
+ | `tracker_page_domain` | `tracker_page_domain` | | `string` | `''` | no |
45
+ | `tracker_metered_wall_type` | `tracker_metered_wall_type` | | `string` | `''` | no |
46
+ | `tracker_metered_wall_balance` | `tracker_metered_wall_balance` | | `number` | `0` | no |
47
+
48
+
27
49
  ---
28
50
 
29
51
  ## Usage
@@ -36,12 +58,12 @@ API Last Order = "https://api.kompas.cloud/order/api/v1/product/latest"
36
58
 
37
59
  ```js
38
60
  <kompas-header-account
39
- logoutUrl="https://account.kompas.cloud/logout"
40
- manageAccountUrl="https://account.kompas.cloud/manage-account"
61
+ logout_url="https://account.kompas.cloud/logout"
62
+ manage_account_url="https://account.kompas.cloud/manage-account"
41
63
  notificationUrl="https://account.kompas.cloud/manage-account/notification"
42
64
  :sidebarTopSpacing="48"
43
65
  subscriptionUrl="https://www.kompas.id/berlangganan"
44
- readLaterUrl="https://www.kompas.id/bacananti"
66
+ read_later_url="https://www.kompas.id/bacananti"
45
67
  :paywall_subscription_id="98888"
46
68
  theme="primary"
47
69
  :userData="userData"
@@ -57,38 +57,22 @@ export class KompasHeaderAccountMenu extends LitElement {
57
57
 
58
58
  @state() clipboardClicked: boolean = false
59
59
 
60
- /**
61
- * Cart Url
62
- */
63
- @property({ type: String }) cartUrl = 'https://gerai.kompas.id/cart'
64
-
65
60
  /**
66
61
  * Logout Url
67
62
  */
68
- @property({ type: String }) logoutUrl = 'https://account.kompas.id/logout'
63
+ @property({ type: String }) logout_url = 'https://auth.kompas.id/logout'
69
64
 
70
65
  /**
71
66
  * Manage Account Url
72
67
  */
73
- @property({ type: String }) manageAccountUrl =
74
- 'https://account.kompas.id/manage-account/my-account'
75
-
76
- /**
77
- * Notification Url
78
- */
79
- @property({ type: String }) notificationUrl =
80
- 'https://account.kompas.id/manage-account/notification'
81
-
82
- /**
83
- * Orders Url
84
- */
85
- @property({ type: String }) ordersUrl =
86
- 'https://gerai.kompas.id/my-account/orders'
68
+ @property({ type: String }) manage_account_url =
69
+ 'https://manage-account.kompas.id/manage-account/my-account'
87
70
 
88
71
  /**
89
72
  * Read Later Url
90
73
  */
91
- @property({ type: String }) readLaterUrl = 'https://www.kompas.id/baca-nanti'
74
+ @property({ type: String }) read_later_url =
75
+ 'https://www.kompas.id/baca-nanti'
92
76
 
93
77
  // Render Total Bubble
94
78
  private renderTotalBubble = (total: number) => {
@@ -127,7 +111,7 @@ export class KompasHeaderAccountMenu extends LitElement {
127
111
  <p class="header-account-menu--title">Keranjang</p>
128
112
  </a> -->
129
113
  <!-- Manage Account -->
130
- <a href=${this.manageAccountUrl} class="header-account-menu--item">
114
+ <a href=${this.manage_account_url} class="header-account-menu--item">
131
115
  <div class="icon icon-md icon-blue-600">
132
116
  ${unsafeSVG(getFontAwesomeIcon('fas', 'user-gear'))}
133
117
  </div>
@@ -139,14 +123,14 @@ export class KompasHeaderAccountMenu extends LitElement {
139
123
  <p class="header-account-menu--title">Transaksi</p>
140
124
  </a> -->
141
125
  <!-- Read Later -->
142
- <a href=${this.readLaterUrl} class="header-account-menu--item">
126
+ <a href=${this.read_later_url} class="header-account-menu--item">
143
127
  <div class="icon icon-md icon-blue-600">
144
128
  ${unsafeSVG(getFontAwesomeIcon('fas', 'bookmark'))}
145
129
  </div>
146
130
  <p class="header-account-menu--title">Baca Nanti</p>
147
131
  </a>
148
132
  <!-- Logout -->
149
- <a href=${this.logoutUrl} class="header-account-menu--item">
133
+ <a href=${this.logout_url} class="header-account-menu--item">
150
134
  <div class="icon icon-md icon-blue-600">
151
135
  ${unsafeSVG(getFontAwesomeIcon('fas', 'right-from-bracket'))}
152
136
  </div>
@@ -25,7 +25,6 @@ export class KompasHeaderAccountProfile extends LitElement {
25
25
  @property({ type: String }) userInitialName = ''
26
26
  @property({ type: Object }) userData = {} as User
27
27
  @property({ type: String }) subscriptionUrl = ''
28
- @property({ type: Number }) totalGracePeriod = 0
29
28
  @property({ type: String }) openFrom = ''
30
29
  /**
31
30
  * Props For Grace Period Tracker
@@ -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
  : {