@namiml/web-sdk 1.6.4 → 1.7.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/CHANGELOG.md +161 -163
- package/dist/components/ContextConsumer.d.ts +4 -2
- package/dist/components/ContextProvider.d.ts +25 -7
- package/dist/components/NamiElement.d.ts +3 -0
- package/dist/components/Paywall.d.ts +27 -16
- package/dist/components/PaywallContext.d.ts +4 -0
- package/dist/components/PaywallScreen.d.ts +23 -0
- package/dist/components/TemplateComponent.d.ts +2 -1
- package/dist/components/containers/BackgroundContainer.d.ts +0 -1
- package/dist/components/containers/CarouselContainer.d.ts +5 -2
- package/dist/components/containers/CollapseContainer.d.ts +1 -1
- package/dist/components/containers/Header.d.ts +1 -0
- package/dist/components/elements/Button.d.ts +1 -1
- package/dist/components/elements/QRCode.d.ts +4 -1
- package/dist/components/elements/RadioButton.d.ts +12 -0
- package/dist/components/elements/SegmentPicker.d.ts +1 -1
- package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
- package/dist/components/elements/ToggleSwitch.d.ts +18 -0
- package/dist/components/elements/Video.d.ts +1 -0
- package/dist/components/index.d.ts +7 -1
- package/dist/components/utils/actionTap.d.ts +15 -7
- package/dist/components/utils/helpers.d.ts +9 -9
- package/dist/components/utils/state.d.ts +5 -5
- package/dist/components/utils/swipe.d.ts +74 -0
- package/dist/nami/campaign.d.ts +3 -3
- package/dist/nami/flow/NamiFlow.d.ts +10 -6
- package/dist/nami/flow/NamiFlowManager.d.ts +1 -1
- package/dist/nami-web-ssr.d.ts +1 -0
- package/dist/nami-web.cjs +100 -38
- package/dist/nami-web.mjs +101 -39
- package/dist/nami-web.umd.js +101 -39
- package/dist/services/video.service.d.ts +8 -6
- package/dist/types/components/containers.d.ts +53 -6
- package/dist/types/components/elements.d.ts +1 -1
- package/dist/types/components/index.d.ts +8 -5
- package/dist/types/conditions.d.ts +16 -14
- package/dist/types/externals/product.d.ts +2 -2
- package/dist/types/flow.d.ts +30 -7
- package/dist/types/paywall.d.ts +5 -6
- package/package.json +19 -13
- package/dist/nami-web.js +0 -96
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
# Changelog
|
|
1
|
+
# Nami Web SDK Changelog
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.7.0
|
|
4
|
+
**Release Date:** August 27, 2025
|
|
5
|
+
|
|
6
|
+
### Enhancements
|
|
7
|
+
- Add new components (Form container, Toggle switch, Radio button)
|
|
8
|
+
- Support Flow Smart Text Variables
|
|
9
|
+
- Support Flow animations / transitions
|
|
10
|
+
- Smart TV Back button support
|
|
11
|
+
- Support for buy / select sku Flow handoffs
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
- QR Code component (scaling and non-hex colors)
|
|
15
|
+
|
|
16
|
+
## 1.6.4
|
|
17
|
+
**Release Date:** August 6, 2025
|
|
4
18
|
|
|
5
19
|
### Enhancements
|
|
6
20
|
- Improved directional navigation support for TV and custom Nami components
|
|
@@ -10,16 +24,18 @@
|
|
|
10
24
|
- Prevent scrolling on TV form factor (Content and Background containers)
|
|
11
25
|
- Fix for handling unexpected SKU smart text variables
|
|
12
26
|
|
|
13
|
-
## 1.6.3
|
|
27
|
+
## 1.6.3
|
|
28
|
+
**Release Date:** July 29, 2025
|
|
14
29
|
|
|
15
30
|
### Enhancements
|
|
16
31
|
- Improved television layout scaling for various viewport sizes
|
|
17
32
|
|
|
18
|
-
## 1.6.2
|
|
33
|
+
## 1.6.2
|
|
34
|
+
**Release Date:** July 28, 2025
|
|
19
35
|
|
|
20
36
|
### New Features
|
|
21
|
-
-
|
|
22
|
-
-
|
|
37
|
+
- `Nami.sdkVersion` method to get the internal SDK version
|
|
38
|
+
- Support for QR Code components
|
|
23
39
|
- On Device Segment Selection for A/B testing
|
|
24
40
|
- Support Base64, Gzipped Initial Configurations
|
|
25
41
|
- Support Fully Uppercase Text Components
|
|
@@ -30,18 +46,20 @@
|
|
|
30
46
|
### Bug Fixes
|
|
31
47
|
- Dynamic widths on Responsive Grid components
|
|
32
48
|
|
|
33
|
-
## 1.6.1
|
|
49
|
+
## 1.6.1
|
|
50
|
+
**Release Date:** July 13, 2025
|
|
34
51
|
|
|
35
52
|
### Improvements
|
|
36
53
|
- Fix type exports in declaration files
|
|
37
54
|
|
|
38
|
-
## 1.6.0
|
|
55
|
+
## 1.6.0
|
|
56
|
+
**Release Date:** July 10, 2025
|
|
39
57
|
|
|
40
58
|
### New Features
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
59
|
+
- Introduced `NamiFlowManager` for orchestrating multi-page flows
|
|
60
|
+
- `NamiFlowManager.registerStepHandoff`: callback when a flow is handed off
|
|
61
|
+
- `NamiFlowManager.registerEventHandler`: callback for flow analytics
|
|
62
|
+
- `NamiFlowManager.resume`: resume a handed-off flow
|
|
45
63
|
|
|
46
64
|
### UI Enhancements
|
|
47
65
|
- Default Focused Buttons
|
|
@@ -49,244 +67,224 @@
|
|
|
49
67
|
|
|
50
68
|
### Accessibility
|
|
51
69
|
- Screenreader support for videos
|
|
52
|
-
- Screenreader hints
|
|
70
|
+
- Screenreader hints added
|
|
53
71
|
|
|
54
72
|
### Performance
|
|
55
73
|
- Better support handling multiple `Nami.configure` calls
|
|
56
74
|
- General stability fixes
|
|
57
75
|
|
|
58
|
-
## 1.5.12
|
|
76
|
+
## 1.5.12
|
|
77
|
+
**Release Date:** July 30, 2025
|
|
59
78
|
|
|
60
|
-
###
|
|
79
|
+
### Bug Fixes
|
|
61
80
|
- Fix race condition when local storage fails
|
|
62
81
|
|
|
63
|
-
## 1.5.11
|
|
82
|
+
## 1.5.11
|
|
83
|
+
**Release Date:** June 18, 2025
|
|
64
84
|
|
|
65
|
-
|
|
85
|
+
### Enhancements
|
|
66
86
|
- Performance improvements for form factor lookups
|
|
67
87
|
|
|
68
|
-
|
|
88
|
+
### Bug Fixes
|
|
69
89
|
- Fix uninterpolated smart text
|
|
70
90
|
- Fix fallback to in-memory storage on localStorage write failures
|
|
71
91
|
|
|
72
|
-
## 1.5.10
|
|
92
|
+
## 1.5.10
|
|
93
|
+
**Release Date:** May 22, 2025
|
|
73
94
|
|
|
74
|
-
|
|
95
|
+
### Enhancements
|
|
75
96
|
- Support focused styling on buttons and toggle
|
|
76
97
|
- Support tab key focus for collapsible component
|
|
77
98
|
- Support alt tags on images
|
|
78
99
|
|
|
79
|
-
|
|
100
|
+
### Bug Fixes
|
|
80
101
|
- Fix toggle switch not preserving state on re-render
|
|
81
102
|
- Fix additional spacing in text list items
|
|
82
103
|
- Fix issue with screenreader and collapsed content
|
|
83
104
|
|
|
84
|
-
## 1.5.9
|
|
105
|
+
## 1.5.9
|
|
106
|
+
**Release Date:** April 2, 2025
|
|
85
107
|
|
|
86
|
-
|
|
108
|
+
### Bug Fixes
|
|
87
109
|
- Resolve incorrect downscaling on 720p TV devices
|
|
88
110
|
|
|
89
|
-
## 1.5.8
|
|
111
|
+
## 1.5.8
|
|
112
|
+
**Release Date:** April 1, 2025
|
|
90
113
|
|
|
91
|
-
|
|
92
|
-
- Resolve
|
|
93
|
-
-
|
|
94
|
-
-
|
|
114
|
+
### Bug Fixes
|
|
115
|
+
- Resolve issue where toggle component event was firing twice
|
|
116
|
+
- Fix toggle switch state re-rendering due to parent page
|
|
117
|
+
- Remove additional unintended spacing
|
|
95
118
|
|
|
96
|
-
## 1.5.7
|
|
119
|
+
## 1.5.7
|
|
120
|
+
**Release Date:** February 20, 2025
|
|
97
121
|
|
|
98
|
-
|
|
122
|
+
### Bug Fixes
|
|
99
123
|
- Resolve additional type issue encountered with certain initial config files
|
|
100
124
|
|
|
101
|
-
## 1.5.6
|
|
125
|
+
## 1.5.6
|
|
126
|
+
**Release Date:** February 19, 2025
|
|
102
127
|
|
|
103
|
-
|
|
128
|
+
### Bug Fixes
|
|
104
129
|
- Resolve type issue encountered with certain initial config files
|
|
105
130
|
|
|
106
|
-
## 1.5.5
|
|
131
|
+
## 1.5.5
|
|
132
|
+
**Release Date:** January 16, 2025
|
|
107
133
|
|
|
108
|
-
|
|
109
|
-
- Add optional `purchaseChannel` to `NamiConfiguration` to pass through to `NamiPaywallEvent`
|
|
134
|
+
### Enhancements
|
|
135
|
+
- Add optional `purchaseChannel` to `NamiConfiguration` to pass through to `NamiPaywallEvent` analytics
|
|
110
136
|
|
|
111
|
-
## 1.5.4
|
|
137
|
+
## 1.5.4
|
|
138
|
+
**Release Date:** November 29, 2024
|
|
112
139
|
|
|
113
|
-
|
|
114
|
-
- Resolve issue with TV focus
|
|
140
|
+
### Bug Fixes
|
|
141
|
+
- Resolve issue with TV focus on containers and product buttons on first load
|
|
115
142
|
|
|
116
|
-
## 1.5.3
|
|
143
|
+
## 1.5.3
|
|
144
|
+
**Release Date:** November 21, 2024
|
|
117
145
|
|
|
118
|
-
|
|
119
|
-
-
|
|
146
|
+
### Bug Fixes
|
|
147
|
+
- Fix collapse component caret icon not updating when expanded
|
|
120
148
|
|
|
121
|
-
|
|
122
|
-
- Support scaling on TV devices
|
|
149
|
+
### Enhancements
|
|
150
|
+
- Support scaling on TV devices (720p, 1080p, 4K, and 8K)
|
|
123
151
|
|
|
124
|
-
## 1.5.2
|
|
152
|
+
## 1.5.2
|
|
153
|
+
**Release Date:** October 24, 2024
|
|
125
154
|
|
|
126
|
-
|
|
127
|
-
- Fix
|
|
128
|
-
- Fix
|
|
129
|
-
- Fix
|
|
130
|
-
- Fix
|
|
131
|
-
- Fix
|
|
132
|
-
- Fix
|
|
133
|
-
- Fix
|
|
155
|
+
### Bug Fixes
|
|
156
|
+
- Fix wrong campaign rule used for placement labels
|
|
157
|
+
- Fix initial config campaign rule mapping
|
|
158
|
+
- Fix background video fullscreen on mobile
|
|
159
|
+
- Fix focus events on connected TV
|
|
160
|
+
- Fix login/logout state handling
|
|
161
|
+
- Fix display of free trials and promotional offers
|
|
162
|
+
- Fix multiple UI issues in carousel and stack components
|
|
134
163
|
|
|
135
|
-
## 1.5.1
|
|
164
|
+
## 1.5.1
|
|
165
|
+
**Release Date:** October 2, 2024
|
|
136
166
|
|
|
137
|
-
|
|
167
|
+
### Enhancements
|
|
138
168
|
- Add `TOGGLE_CHANGE` and `PAGE_CHANGE` paywall events
|
|
139
169
|
|
|
140
|
-
|
|
170
|
+
### Bug Fixes
|
|
141
171
|
- Fix carousel component swiper
|
|
142
|
-
- Fix flex alignment
|
|
143
|
-
- Fix
|
|
172
|
+
- Fix flex alignment issues
|
|
173
|
+
- Fix Safari rendering for hero video
|
|
144
174
|
|
|
145
|
-
## 1.5.0
|
|
175
|
+
## 1.5.0
|
|
176
|
+
**Release Date:** September 26, 2024
|
|
146
177
|
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
178
|
+
### New Features
|
|
179
|
+
- Advanced video feature support
|
|
180
|
+
- Carousel component support
|
|
150
181
|
|
|
151
|
-
|
|
182
|
+
### Enhancements
|
|
152
183
|
- Improve fallback data handling
|
|
153
|
-
- Support repeatable
|
|
154
|
-
- Support vertical alignment
|
|
184
|
+
- Support repeatable lists inside collapse components
|
|
185
|
+
- Support vertical alignment in product container
|
|
155
186
|
- Align `removeAllListeners` behavior with RN SDK
|
|
156
187
|
|
|
157
|
-
|
|
158
|
-
- Fix segment picker cursor
|
|
159
|
-
- Fix hidden component
|
|
188
|
+
### Bug Fixes
|
|
189
|
+
- Fix segment picker cursor behavior
|
|
190
|
+
- Fix hidden component visibility
|
|
160
191
|
- Fix responsive grid spacing and scrolling
|
|
161
|
-
- Fix background video and
|
|
162
|
-
- Fix background video position
|
|
192
|
+
- Fix background video gradient and position
|
|
163
193
|
|
|
164
|
-
## 1.4.0
|
|
194
|
+
## 1.4.0
|
|
195
|
+
**Release Date:** September 5, 2024
|
|
165
196
|
|
|
166
|
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
197
|
+
### New Features
|
|
198
|
+
- HLS support in Video component
|
|
199
|
+
- Responsive Grid component support
|
|
200
|
+
- `NamiCustomerManager.deviceId` added
|
|
201
|
+
- `NamiCustomerManager.registerJourneyStateHandler` and `journeyState` (subscription management)
|
|
202
|
+
- `NamiEntitlementManager.clearProvisionalEntitlementGrants` (subscription management)
|
|
172
203
|
|
|
173
|
-
|
|
174
|
-
-
|
|
204
|
+
### Enhancements
|
|
205
|
+
- Pass product groups to paywall via campaign launch
|
|
175
206
|
|
|
176
|
-
|
|
177
|
-
- Find product by
|
|
178
|
-
- Fix text component
|
|
207
|
+
### Bug Fixes
|
|
208
|
+
- Find product by ID instead of name
|
|
209
|
+
- Fix spacing in text component
|
|
179
210
|
|
|
180
|
-
|
|
181
|
-
-
|
|
211
|
+
### Improvements
|
|
212
|
+
- Update type definitions across paywall manager and customer manager APIs
|
|
182
213
|
|
|
183
|
-
## 1.3.2
|
|
214
|
+
## 1.3.2
|
|
215
|
+
**Release Date:** August 14, 2024
|
|
184
216
|
|
|
185
217
|
### Bug Fixes
|
|
186
|
-
|
|
187
|
-
- Respect conditions based on product groups
|
|
218
|
+
- Conditional component rendering based on product entitlement and product groups
|
|
188
219
|
|
|
189
|
-
## 1.3.1
|
|
220
|
+
## 1.3.1
|
|
221
|
+
**Release Date:** August 12, 2024
|
|
190
222
|
|
|
191
223
|
### Bug Fixes
|
|
192
|
-
|
|
224
|
+
- Fix `SHOW_PAYWALL` event being triggered as `UNKNOWN`
|
|
193
225
|
|
|
194
|
-
## 1.3.0
|
|
226
|
+
## 1.3.0
|
|
227
|
+
**Release Date:** August 12, 2024
|
|
195
228
|
|
|
196
229
|
### New Features
|
|
197
|
-
-
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
- **Support hidden components** - Hide components without removing them from your paywalls.
|
|
204
|
-
- **New components** - Video and collapsable components.
|
|
205
|
-
- **Improved timeout and error handling**
|
|
230
|
+
- `NamiEntitlementManager` to manage entitlements
|
|
231
|
+
- `active`, `isEntitlementActive`, `refresh`, `registerActiveEntitlementsHandler`
|
|
232
|
+
- `NamiEntitlement` object model
|
|
233
|
+
- Hidden component support
|
|
234
|
+
- New components: Video and collapsible
|
|
235
|
+
- Timeout and error handling improvements
|
|
206
236
|
|
|
207
237
|
### Bug Fixes
|
|
208
|
-
-
|
|
209
|
-
-
|
|
238
|
+
- Typing improvements across SDKs
|
|
239
|
+
- ECMAScript 2021 support
|
|
210
240
|
|
|
211
|
-
### Breaking
|
|
212
|
-
- `
|
|
213
|
-
- `NamiPaywallManager.buySkuComplete`
|
|
241
|
+
### Breaking Changes
|
|
242
|
+
- `appPlatformId` renamed to `appPlatformID` in `NamiConfiguration`
|
|
243
|
+
- `NamiPaywallManager.buySkuComplete` interface simplified
|
|
214
244
|
|
|
215
|
-
## 1.2.0
|
|
245
|
+
## 1.2.0
|
|
246
|
+
**Release Date:** July 26, 2024
|
|
216
247
|
|
|
217
248
|
### New Features
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
- **Improved paywall load time** - Paywalls render signficantly faster when immediately displayed.
|
|
249
|
+
- `NamiCampaignManager.launch`: supports `paywallLaunchContext`
|
|
250
|
+
- `NamiPaywallManager.buySKUCancel` and `buySKUComplete`
|
|
251
|
+
- Paywall impression and conversion reporting
|
|
252
|
+
- Faster paywall render time
|
|
223
253
|
|
|
224
254
|
### Bug Fixes
|
|
225
|
-
-
|
|
226
|
-
- Provide consistent APIs with other Nami SDKs.
|
|
255
|
+
- Consistent typing and API alignment across SDKs
|
|
227
256
|
|
|
228
|
-
## 1.1.0
|
|
257
|
+
## 1.1.0
|
|
258
|
+
**Release Date:** June 24, 2024
|
|
229
259
|
|
|
230
260
|
### New Features
|
|
231
|
-
-
|
|
232
|
-
-
|
|
233
|
-
-
|
|
261
|
+
- `NamiCustomerManager.setAnonymousMode`
|
|
262
|
+
- `NamiCampaignManager.launch` with `paywallActionHandler`
|
|
263
|
+
- `NamiPaywallManager.registerBuySkuHandler`
|
|
234
264
|
|
|
235
265
|
### Bug Fixes
|
|
236
|
-
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
266
|
+
- Lit component compatibility and SSR fixes
|
|
267
|
+
- Subscription pricing rendering fixes
|
|
268
|
+
- Custom API host connectivity fixes
|
|
269
|
+
- Icon display improvements
|
|
240
270
|
|
|
241
271
|
### Known Issues
|
|
242
|
-
- `
|
|
243
|
-
- Impression
|
|
244
|
-
- Launch context is not yet implemented.
|
|
272
|
+
- `buySkuComplete`, `buySkuCancel` not fully implemented
|
|
273
|
+
- Impression/conversion reporting and launch context not implemented
|
|
245
274
|
|
|
246
|
-
## 1.0.0
|
|
275
|
+
## 1.0.0
|
|
276
|
+
**Release Date:** June 13, 2024
|
|
247
277
|
|
|
248
278
|
### New Features
|
|
249
|
-
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
- **NamiCampaignManager** - Introduced `NamiCampaignManager` to launch paywalls and manage campaigns.
|
|
255
|
-
- **NamiCampaignManager.launch** - Method to launch paywalls.
|
|
256
|
-
- **NamiCampaignManager.allCampaigns** - Method to get a list of available `NamiCampaign`s.
|
|
257
|
-
- **NamiCampaignManager.isCampaignAvailable** - Method to check if a matching campaign is available, returning a boolean.
|
|
258
|
-
- **NamiCampaignManager.refresh** - Method to request that available campaigns be refreshed.
|
|
259
|
-
- **NamiCampaignManager.registerAvailableCampaignsHandler** - Method to register a callback that is called when campaigns are updated.
|
|
260
|
-
- **NamiCampaign** - Defines the structure of the campaign objects.
|
|
261
|
-
|
|
262
|
-
- **NamiCustomerManager** - Introduced `NamiCustomerManager` to manager customer related functionality.
|
|
263
|
-
- **NamiCustomerManager.isLoggedIn** - Method to check if a customer is logged in, returning a boolean.
|
|
264
|
-
- **NamiCustomerManager.loggedInId** - Method to get the unique customer identifier associated with the current device.
|
|
265
|
-
- **NamiCustomerManager.login** - Method to provide a customer id to link one or more devices to a known customer.
|
|
266
|
-
- **NamiCustomerManager.logout** - Method to disassociate a device from a customer identifier.
|
|
267
|
-
- **NamiCustomerManager.registerAccountStateHandler** - Method to register a callback that is called when a customer is logged in or logged out.
|
|
268
|
-
- **NamiCustomerManager.setCustomerAttribute** - Method to set an attribute in an on-device key/value store for use for paywall personalization uses cases.
|
|
269
|
-
- **NamiCustomerManager.getCustomerAttribute** - Method to get the current stored value, if available, for the provided key in the on-device customer key/value store.
|
|
270
|
-
- **NamiCustomerManager.clearCustomerAttribute** - Method to remove a key from the on-device customer key/value store.
|
|
271
|
-
- **NamiCustomerManager.clearAllCustomerAttributes** - Method to clear all customer attributes in the on-device key/value store.
|
|
272
|
-
- **NamiCustomerManager.setAnonymousMode** - Method to set the anonymous mode for the customer.
|
|
273
|
-
|
|
274
|
-
- **NamiPaywallManager** - Introduce `NamiPaywallManager` to manage paywalls.
|
|
275
|
-
- **NamiPaywallManager.setProductDetails** - Method to set product and price details to be used by the paywall.
|
|
276
|
-
- **NamiPaywallManager.registerSignInHandler** - Method to register a callback for when the customer clicks a sign in button on the paywall.
|
|
277
|
-
- **NamiPaywallManager.registerCloseHandler** - Method to register a callback for when the customer clicks on a close button on the paywall.
|
|
278
|
-
- **NamiPaywallManager.registerDeeplinkActionHandler** - Method to register a callback for when a customer clicks on a deeplink button on the paywall.
|
|
279
|
-
- **NamiPaywallManager.registerBuySkuHandler** - Method to register a callback for when a customer clicks on a buy button on the paywall.
|
|
280
|
-
- **NamiPaywallManager.registerRestoreHandler** - Method to register a callback wfor when a customer clicks to restore a previous purchase.
|
|
281
|
-
- **NamiPaywallManager.buySkuComplete** - Method to notify Nami SDK when a purchase succeeded for conversion reporting.
|
|
282
|
-
- **NamiPaywallManager.buySkuCancel** - Method to notify Nami SDK when a user cancelled the purchase flow, or an error occurred.
|
|
279
|
+
- Core SDK: `Nami`, `Nami.configure`, `NamiConfiguration`, `NamiLanguageCodes`
|
|
280
|
+
- `NamiCampaignManager` for campaign management
|
|
281
|
+
- `NamiCustomerManager` for customer state and attributes
|
|
282
|
+
- `NamiPaywallManager` for paywall and event handler management
|
|
283
283
|
|
|
284
284
|
### Known Issues
|
|
285
|
-
-
|
|
286
|
-
- `
|
|
287
|
-
-
|
|
288
|
-
- Impression or conversion reporting not yet implemented
|
|
289
|
-
- Launch context is not yet implemented
|
|
285
|
+
- Paywall event callbacks not firing
|
|
286
|
+
- `buySkuComplete`, `buySkuCancel`, and `setAnonymousMode` partially implemented
|
|
287
|
+
- Impression/conversion reporting and launch context not yet available
|
|
290
288
|
|
|
291
289
|
### Additional Notes
|
|
292
|
-
|
|
290
|
+
Refer to the documentation for detailed usage instructions and integration examples.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
2
|
import { TPaywallContext } from '../types/paywall';
|
|
3
|
+
import { PaywallContextProvider } from './ContextProvider';
|
|
3
4
|
declare class ContextConsumer implements ReactiveController {
|
|
4
|
-
host
|
|
5
|
+
private host;
|
|
5
6
|
state: TPaywallContext;
|
|
6
|
-
|
|
7
|
+
contextProvider: PaywallContextProvider;
|
|
8
|
+
constructor(host: ReactiveControllerHost, contextProvider: PaywallContextProvider);
|
|
7
9
|
handleStateChange(): void;
|
|
8
10
|
hostConnected(): void;
|
|
9
11
|
hostDisconnected(): void;
|
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
-
import { IPaywall, NamiAppSuppliedVideoDetails, TPaywallContext,
|
|
2
|
+
import { IPaywall, ISkuMenu, NamiAppSuppliedVideoDetails, TPaywallContext, TPaywallMedia } from '../types/paywall';
|
|
3
3
|
import { NamiProductDetails } from '../types/externals/product';
|
|
4
4
|
import { NamiSKU } from '../types/externals/sku';
|
|
5
5
|
import { NamiCampaign } from '../types/externals/campaign';
|
|
6
6
|
import { TDevice } from '../types/device';
|
|
7
7
|
import { Callback } from '../types/components/containers';
|
|
8
8
|
import type { NamiFlow } from '../nami/flow/NamiFlow';
|
|
9
|
+
import { NamiPaywallEvent, NamiPaywallLaunchContext } from '../types/externals/paywall';
|
|
9
10
|
export declare const initialState: TPaywallContext;
|
|
10
|
-
declare class
|
|
11
|
+
export declare class PaywallContextProvider extends EventTarget implements ReactiveController {
|
|
12
|
+
static providers: PaywallContextProvider[];
|
|
11
13
|
host: ReactiveControllerHost | null;
|
|
12
14
|
state: TPaywallContext;
|
|
13
15
|
subscribers: Set<Callback>;
|
|
14
16
|
productDetails: NamiProductDetails[];
|
|
15
17
|
flow?: NamiFlow;
|
|
16
|
-
|
|
18
|
+
filteredSkuMenus: ISkuMenu[];
|
|
19
|
+
static create(paywall: IPaywall, context: NamiPaywallLaunchContext, campaign: NamiCampaign): PaywallContextProvider;
|
|
20
|
+
static remove(provider: PaywallContextProvider): void;
|
|
21
|
+
static setCustomerAttribute(attributes: {
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
}): void;
|
|
24
|
+
static removeCustomerAttribute(key: string): void;
|
|
25
|
+
static setAppSuppliedVideoDetails(details: NamiAppSuppliedVideoDetails): void;
|
|
26
|
+
static getSelectedPaywall(): IPaywall | undefined;
|
|
27
|
+
static setUserInteractionEnabled(enabled: boolean): void;
|
|
28
|
+
static setProductDetails(details: NamiProductDetails[]): void;
|
|
29
|
+
static setPurchaseInProgress(inProgress: boolean): void;
|
|
30
|
+
static setIsLoggedIn(isLoggedIn: boolean): void;
|
|
31
|
+
static setPurchase(inProgress: boolean, product?: NamiSKU): void;
|
|
32
|
+
static getSelectedSlideIndex(): number | undefined;
|
|
33
|
+
constructor(paywall: IPaywall, context: NamiPaywallLaunchContext, campaign: NamiCampaign);
|
|
17
34
|
subscribe(callback: Callback): Callback;
|
|
18
35
|
unsubscribe(callback: Callback): void;
|
|
19
36
|
emitEvent<T = any>(name: string, payload?: T): void;
|
|
@@ -27,15 +44,16 @@ declare class ContextProvider extends EventTarget implements ReactiveController
|
|
|
27
44
|
setCurrentGroupData(currentGroupId: string, currentGroupName: string): void;
|
|
28
45
|
getCurrentGroupId(): string;
|
|
29
46
|
getCurrentGroupName(): string;
|
|
30
|
-
|
|
47
|
+
setSelectedProducts(products: {
|
|
31
48
|
[currentGroupId: string]: string | null;
|
|
32
49
|
}): void;
|
|
33
50
|
selectedProducts(): {
|
|
34
51
|
[currentGroupId: string]: string | null;
|
|
35
52
|
};
|
|
36
|
-
setPaywall(paywall: IPaywall, context
|
|
53
|
+
setPaywall(paywall: IPaywall, context: NamiPaywallLaunchContext, campaign: NamiCampaign): void;
|
|
37
54
|
getSelectedPaywall(): IPaywall | undefined;
|
|
38
55
|
getSelectedCampaign(): NamiCampaign | undefined;
|
|
56
|
+
getPaywallActionEventData(): Partial<NamiPaywallEvent>;
|
|
39
57
|
paywallId(): string;
|
|
40
58
|
setCurrentPage(page: string): void;
|
|
41
59
|
setCustomerAttribute(attributes: {
|
|
@@ -49,6 +67,8 @@ declare class ContextProvider extends EventTarget implements ReactiveController
|
|
|
49
67
|
setFormFactor(formFactor: TDevice): void;
|
|
50
68
|
getFormFactor(): TDevice;
|
|
51
69
|
getTVQuality(): "" | "720p" | "4K" | "1080p";
|
|
70
|
+
getViewportWidth(): number;
|
|
71
|
+
getViewportHeight(): number;
|
|
52
72
|
setPurchaseInProgress(inProgress: boolean): void;
|
|
53
73
|
setPurchase(inProgress: boolean, product?: NamiSKU): void;
|
|
54
74
|
setTimeSpentOnPaywall(time: number): void;
|
|
@@ -61,5 +81,3 @@ declare class ContextProvider extends EventTarget implements ReactiveController
|
|
|
61
81
|
setUserInteractionEnabled(enabled: boolean): void;
|
|
62
82
|
setCurrentSlideIndex(index: number): void;
|
|
63
83
|
}
|
|
64
|
-
declare const contextProvider: ContextProvider;
|
|
65
|
-
export default contextProvider;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CSSResult, LitElement, PropertyValueMap } from "lit";
|
|
2
2
|
import ContextConsumer from "./ContextConsumer";
|
|
3
|
+
import { PaywallContextProvider } from "./ContextProvider";
|
|
3
4
|
export declare class NamiElement extends LitElement {
|
|
4
5
|
contextConsumer: ContextConsumer;
|
|
6
|
+
contextProvider: PaywallContextProvider;
|
|
5
7
|
constructor();
|
|
6
8
|
protected styles(): CSSResult;
|
|
7
9
|
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
10
|
+
protected shouldUpdate(): boolean;
|
|
8
11
|
protected willUpdate(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
9
12
|
disconnectedCallback(): void;
|
|
10
13
|
}
|
|
@@ -1,29 +1,40 @@
|
|
|
1
|
-
import { IPaywall
|
|
2
|
-
import {
|
|
3
|
-
import { PropertyValues, TemplateResult } from 'lit';
|
|
1
|
+
import { IPaywall } from '../types/paywall';
|
|
2
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
4
3
|
import { NamiCampaign } from '../types/externals/campaign';
|
|
5
|
-
import { NamiPaywallEvent } from '../types/externals/paywall';
|
|
6
4
|
import type { NamiFlow } from '../nami/flow/NamiFlow';
|
|
7
|
-
|
|
5
|
+
import { type NamiFlowAnimation } from '../types/flow';
|
|
6
|
+
import { NamiPaywallLaunchContext } from '../nami-web';
|
|
7
|
+
declare class PaywallComponent extends LitElement {
|
|
8
8
|
campaign: NamiCampaign | undefined;
|
|
9
9
|
paywall: IPaywall | undefined;
|
|
10
10
|
flow: NamiFlow | undefined;
|
|
11
|
-
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
|
|
11
|
+
pages: IPaywall[];
|
|
12
|
+
private currentOffset;
|
|
13
|
+
private isAnimating;
|
|
14
|
+
private context;
|
|
15
|
+
private formFactor;
|
|
16
|
+
private timeSpentOnPaywall;
|
|
17
|
+
private type;
|
|
18
|
+
private value;
|
|
19
|
+
private animation;
|
|
20
|
+
private _originalBodyStyles;
|
|
21
|
+
private _swipeHandler;
|
|
22
|
+
constructor(type: string | undefined, value: string, context: NamiPaywallLaunchContext);
|
|
23
|
+
setPaywallData(): void;
|
|
15
24
|
connectedCallback(): void;
|
|
16
25
|
disconnectedCallback(): void;
|
|
26
|
+
private setOriginalStyles;
|
|
27
|
+
private restoreStyles;
|
|
17
28
|
private handleKeyDownEvent;
|
|
18
|
-
private
|
|
19
|
-
setPaywallData(paywall: IPaywall, campaign?: NamiCampaign): void;
|
|
29
|
+
private handleSwipeEvent;
|
|
20
30
|
firstUpdated(): void;
|
|
21
|
-
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
|
|
25
|
-
flowNavigateToScreen(paywall: IPaywall): Promise<void>;
|
|
31
|
+
static styles: import("lit").CSSResult;
|
|
32
|
+
private getAnimationStyles;
|
|
33
|
+
private updatePages;
|
|
34
|
+
flowNavigateToScreen(next: IPaywall, animation: NamiFlowAnimation): Promise<void>;
|
|
26
35
|
getSelectedSlideIndexForCurrentCarousel(): number | undefined;
|
|
36
|
+
private renderFlow;
|
|
37
|
+
private renderPaywall;
|
|
27
38
|
render(): TemplateResult;
|
|
28
39
|
}
|
|
29
40
|
export { PaywallComponent };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IPaywall, TPaywallLaunchContext } from '../types/paywall';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import type { NamiCampaign } from '../types/externals/campaign';
|
|
4
|
+
import type { NamiFlow } from '../nami/flow/NamiFlow';
|
|
5
|
+
export declare class NamiPaywallScreen extends LitElement {
|
|
6
|
+
paywall: IPaywall;
|
|
7
|
+
campaign: NamiCampaign;
|
|
8
|
+
context: TPaywallLaunchContext;
|
|
9
|
+
private contextProvider;
|
|
10
|
+
private contextConsumer;
|
|
11
|
+
timeSpentOnPaywall: number;
|
|
12
|
+
flow?: NamiFlow;
|
|
13
|
+
private teardownEvent;
|
|
14
|
+
static styles: import("lit").CSSResult;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
private userInteractionListener;
|
|
18
|
+
firstUpdated(): void;
|
|
19
|
+
private postImpression;
|
|
20
|
+
private postPaywallScreenData;
|
|
21
|
+
private getTemplate;
|
|
22
|
+
render(): import("lit").TemplateResult<1>;
|
|
23
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { TComponent } from "../types/components";
|
|
2
|
-
|
|
2
|
+
import { PaywallContextProvider } from "./ContextProvider";
|
|
3
|
+
export declare function TemplateComponent(contextProvider: PaywallContextProvider, component: TComponent, scaleFactor: number, inFocusedState?: boolean): any;
|