@namiml/web-sdk 1.6.4 → 1.7.1
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 +171 -163
- package/dist/components/ContextConsumer.d.ts +4 -2
- package/dist/components/ContextProvider.d.ts +25 -7
- package/dist/components/NamiElement.d.ts +13 -1
- 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/Footer.d.ts +2 -2
- package/dist/components/containers/Header.d.ts +3 -2
- 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/styles/animations.d.ts +2 -0
- 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 +14 -6
- package/dist/nami/flow/NamiFlowManager.d.ts +4 -2
- package/dist/nami-web-ssr.d.ts +1 -0
- package/dist/nami-web.cjs +172 -38
- package/dist/nami-web.mjs +173 -39
- package/dist/nami-web.umd.js +173 -39
- package/dist/services/video.service.d.ts +8 -6
- package/dist/types/components/animation.d.ts +40 -0
- 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 +10 -5
- package/dist/types/conditions.d.ts +16 -14
- package/dist/types/externals/flow.d.ts +6 -0
- package/dist/types/externals/product.d.ts +2 -2
- package/dist/types/flow.d.ts +33 -8
- package/dist/types/paywall.d.ts +5 -6
- package/dist/utils/animations.d.ts +2 -0
- package/package.json +19 -13
- package/dist/nami-web.js +0 -96
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
|
-
# Changelog
|
|
1
|
+
# Nami Web SDK Changelog
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.7.1
|
|
4
|
+
**Release Date:** September 3, 2025
|
|
5
|
+
|
|
6
|
+
### Enhancements
|
|
7
|
+
- Add `NamiFlowManager.pause` method
|
|
8
|
+
- Add component animations (pulse/wave)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
- Completed Flows will no longer call registered paywall close handlers
|
|
12
|
+
|
|
13
|
+
## 1.7.0
|
|
14
|
+
**Release Date:** August 27, 2025
|
|
15
|
+
|
|
16
|
+
### Enhancements
|
|
17
|
+
- Add new components (Form container, Toggle switch, Radio button)
|
|
18
|
+
- Support Flow Smart Text Variables
|
|
19
|
+
- Support Flow animations / transitions
|
|
20
|
+
- Smart TV Back button support
|
|
21
|
+
- Support for buy / select sku Flow handoffs
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
- QR Code component (scaling and non-hex colors)
|
|
25
|
+
|
|
26
|
+
## 1.6.4
|
|
27
|
+
**Release Date:** August 6, 2025
|
|
4
28
|
|
|
5
29
|
### Enhancements
|
|
6
30
|
- Improved directional navigation support for TV and custom Nami components
|
|
@@ -10,16 +34,18 @@
|
|
|
10
34
|
- Prevent scrolling on TV form factor (Content and Background containers)
|
|
11
35
|
- Fix for handling unexpected SKU smart text variables
|
|
12
36
|
|
|
13
|
-
## 1.6.3
|
|
37
|
+
## 1.6.3
|
|
38
|
+
**Release Date:** July 29, 2025
|
|
14
39
|
|
|
15
40
|
### Enhancements
|
|
16
41
|
- Improved television layout scaling for various viewport sizes
|
|
17
42
|
|
|
18
|
-
## 1.6.2
|
|
43
|
+
## 1.6.2
|
|
44
|
+
**Release Date:** July 28, 2025
|
|
19
45
|
|
|
20
46
|
### New Features
|
|
21
|
-
-
|
|
22
|
-
-
|
|
47
|
+
- `Nami.sdkVersion` method to get the internal SDK version
|
|
48
|
+
- Support for QR Code components
|
|
23
49
|
- On Device Segment Selection for A/B testing
|
|
24
50
|
- Support Base64, Gzipped Initial Configurations
|
|
25
51
|
- Support Fully Uppercase Text Components
|
|
@@ -30,18 +56,20 @@
|
|
|
30
56
|
### Bug Fixes
|
|
31
57
|
- Dynamic widths on Responsive Grid components
|
|
32
58
|
|
|
33
|
-
## 1.6.1
|
|
59
|
+
## 1.6.1
|
|
60
|
+
**Release Date:** July 13, 2025
|
|
34
61
|
|
|
35
62
|
### Improvements
|
|
36
63
|
- Fix type exports in declaration files
|
|
37
64
|
|
|
38
|
-
## 1.6.0
|
|
65
|
+
## 1.6.0
|
|
66
|
+
**Release Date:** July 10, 2025
|
|
39
67
|
|
|
40
68
|
### New Features
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
69
|
+
- Introduced `NamiFlowManager` for orchestrating multi-page flows
|
|
70
|
+
- `NamiFlowManager.registerStepHandoff`: callback when a flow is handed off
|
|
71
|
+
- `NamiFlowManager.registerEventHandler`: callback for flow analytics
|
|
72
|
+
- `NamiFlowManager.resume`: resume a handed-off flow
|
|
45
73
|
|
|
46
74
|
### UI Enhancements
|
|
47
75
|
- Default Focused Buttons
|
|
@@ -49,244 +77,224 @@
|
|
|
49
77
|
|
|
50
78
|
### Accessibility
|
|
51
79
|
- Screenreader support for videos
|
|
52
|
-
- Screenreader hints
|
|
80
|
+
- Screenreader hints added
|
|
53
81
|
|
|
54
82
|
### Performance
|
|
55
83
|
- Better support handling multiple `Nami.configure` calls
|
|
56
84
|
- General stability fixes
|
|
57
85
|
|
|
58
|
-
## 1.5.12
|
|
86
|
+
## 1.5.12
|
|
87
|
+
**Release Date:** July 30, 2025
|
|
59
88
|
|
|
60
|
-
###
|
|
89
|
+
### Bug Fixes
|
|
61
90
|
- Fix race condition when local storage fails
|
|
62
91
|
|
|
63
|
-
## 1.5.11
|
|
92
|
+
## 1.5.11
|
|
93
|
+
**Release Date:** June 18, 2025
|
|
64
94
|
|
|
65
|
-
|
|
95
|
+
### Enhancements
|
|
66
96
|
- Performance improvements for form factor lookups
|
|
67
97
|
|
|
68
|
-
|
|
98
|
+
### Bug Fixes
|
|
69
99
|
- Fix uninterpolated smart text
|
|
70
100
|
- Fix fallback to in-memory storage on localStorage write failures
|
|
71
101
|
|
|
72
|
-
## 1.5.10
|
|
102
|
+
## 1.5.10
|
|
103
|
+
**Release Date:** May 22, 2025
|
|
73
104
|
|
|
74
|
-
|
|
105
|
+
### Enhancements
|
|
75
106
|
- Support focused styling on buttons and toggle
|
|
76
107
|
- Support tab key focus for collapsible component
|
|
77
108
|
- Support alt tags on images
|
|
78
109
|
|
|
79
|
-
|
|
110
|
+
### Bug Fixes
|
|
80
111
|
- Fix toggle switch not preserving state on re-render
|
|
81
112
|
- Fix additional spacing in text list items
|
|
82
113
|
- Fix issue with screenreader and collapsed content
|
|
83
114
|
|
|
84
|
-
## 1.5.9
|
|
115
|
+
## 1.5.9
|
|
116
|
+
**Release Date:** April 2, 2025
|
|
85
117
|
|
|
86
|
-
|
|
118
|
+
### Bug Fixes
|
|
87
119
|
- Resolve incorrect downscaling on 720p TV devices
|
|
88
120
|
|
|
89
|
-
## 1.5.8
|
|
121
|
+
## 1.5.8
|
|
122
|
+
**Release Date:** April 1, 2025
|
|
90
123
|
|
|
91
|
-
|
|
92
|
-
- Resolve
|
|
93
|
-
-
|
|
94
|
-
-
|
|
124
|
+
### Bug Fixes
|
|
125
|
+
- Resolve issue where toggle component event was firing twice
|
|
126
|
+
- Fix toggle switch state re-rendering due to parent page
|
|
127
|
+
- Remove additional unintended spacing
|
|
95
128
|
|
|
96
|
-
## 1.5.7
|
|
129
|
+
## 1.5.7
|
|
130
|
+
**Release Date:** February 20, 2025
|
|
97
131
|
|
|
98
|
-
|
|
132
|
+
### Bug Fixes
|
|
99
133
|
- Resolve additional type issue encountered with certain initial config files
|
|
100
134
|
|
|
101
|
-
## 1.5.6
|
|
135
|
+
## 1.5.6
|
|
136
|
+
**Release Date:** February 19, 2025
|
|
102
137
|
|
|
103
|
-
|
|
138
|
+
### Bug Fixes
|
|
104
139
|
- Resolve type issue encountered with certain initial config files
|
|
105
140
|
|
|
106
|
-
## 1.5.5
|
|
141
|
+
## 1.5.5
|
|
142
|
+
**Release Date:** January 16, 2025
|
|
107
143
|
|
|
108
|
-
|
|
109
|
-
- Add optional `purchaseChannel` to `NamiConfiguration` to pass through to `NamiPaywallEvent`
|
|
144
|
+
### Enhancements
|
|
145
|
+
- Add optional `purchaseChannel` to `NamiConfiguration` to pass through to `NamiPaywallEvent` analytics
|
|
110
146
|
|
|
111
|
-
## 1.5.4
|
|
147
|
+
## 1.5.4
|
|
148
|
+
**Release Date:** November 29, 2024
|
|
112
149
|
|
|
113
|
-
|
|
114
|
-
- Resolve issue with TV focus
|
|
150
|
+
### Bug Fixes
|
|
151
|
+
- Resolve issue with TV focus on containers and product buttons on first load
|
|
115
152
|
|
|
116
|
-
## 1.5.3
|
|
153
|
+
## 1.5.3
|
|
154
|
+
**Release Date:** November 21, 2024
|
|
117
155
|
|
|
118
|
-
|
|
119
|
-
-
|
|
156
|
+
### Bug Fixes
|
|
157
|
+
- Fix collapse component caret icon not updating when expanded
|
|
120
158
|
|
|
121
|
-
|
|
122
|
-
- Support scaling on TV devices
|
|
159
|
+
### Enhancements
|
|
160
|
+
- Support scaling on TV devices (720p, 1080p, 4K, and 8K)
|
|
123
161
|
|
|
124
|
-
## 1.5.2
|
|
162
|
+
## 1.5.2
|
|
163
|
+
**Release Date:** October 24, 2024
|
|
125
164
|
|
|
126
|
-
|
|
127
|
-
- Fix
|
|
128
|
-
- Fix
|
|
129
|
-
- Fix
|
|
130
|
-
- Fix
|
|
131
|
-
- Fix
|
|
132
|
-
- Fix
|
|
133
|
-
- Fix
|
|
165
|
+
### Bug Fixes
|
|
166
|
+
- Fix wrong campaign rule used for placement labels
|
|
167
|
+
- Fix initial config campaign rule mapping
|
|
168
|
+
- Fix background video fullscreen on mobile
|
|
169
|
+
- Fix focus events on connected TV
|
|
170
|
+
- Fix login/logout state handling
|
|
171
|
+
- Fix display of free trials and promotional offers
|
|
172
|
+
- Fix multiple UI issues in carousel and stack components
|
|
134
173
|
|
|
135
|
-
## 1.5.1
|
|
174
|
+
## 1.5.1
|
|
175
|
+
**Release Date:** October 2, 2024
|
|
136
176
|
|
|
137
|
-
|
|
177
|
+
### Enhancements
|
|
138
178
|
- Add `TOGGLE_CHANGE` and `PAGE_CHANGE` paywall events
|
|
139
179
|
|
|
140
|
-
|
|
180
|
+
### Bug Fixes
|
|
141
181
|
- Fix carousel component swiper
|
|
142
|
-
- Fix flex alignment
|
|
143
|
-
- Fix
|
|
182
|
+
- Fix flex alignment issues
|
|
183
|
+
- Fix Safari rendering for hero video
|
|
144
184
|
|
|
145
|
-
## 1.5.0
|
|
185
|
+
## 1.5.0
|
|
186
|
+
**Release Date:** September 26, 2024
|
|
146
187
|
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
188
|
+
### New Features
|
|
189
|
+
- Advanced video feature support
|
|
190
|
+
- Carousel component support
|
|
150
191
|
|
|
151
|
-
|
|
192
|
+
### Enhancements
|
|
152
193
|
- Improve fallback data handling
|
|
153
|
-
- Support repeatable
|
|
154
|
-
- Support vertical alignment
|
|
194
|
+
- Support repeatable lists inside collapse components
|
|
195
|
+
- Support vertical alignment in product container
|
|
155
196
|
- Align `removeAllListeners` behavior with RN SDK
|
|
156
197
|
|
|
157
|
-
|
|
158
|
-
- Fix segment picker cursor
|
|
159
|
-
- Fix hidden component
|
|
198
|
+
### Bug Fixes
|
|
199
|
+
- Fix segment picker cursor behavior
|
|
200
|
+
- Fix hidden component visibility
|
|
160
201
|
- Fix responsive grid spacing and scrolling
|
|
161
|
-
- Fix background video and
|
|
162
|
-
- Fix background video position
|
|
202
|
+
- Fix background video gradient and position
|
|
163
203
|
|
|
164
|
-
## 1.4.0
|
|
204
|
+
## 1.4.0
|
|
205
|
+
**Release Date:** September 5, 2024
|
|
165
206
|
|
|
166
|
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
207
|
+
### New Features
|
|
208
|
+
- HLS support in Video component
|
|
209
|
+
- Responsive Grid component support
|
|
210
|
+
- `NamiCustomerManager.deviceId` added
|
|
211
|
+
- `NamiCustomerManager.registerJourneyStateHandler` and `journeyState` (subscription management)
|
|
212
|
+
- `NamiEntitlementManager.clearProvisionalEntitlementGrants` (subscription management)
|
|
172
213
|
|
|
173
|
-
|
|
174
|
-
-
|
|
214
|
+
### Enhancements
|
|
215
|
+
- Pass product groups to paywall via campaign launch
|
|
175
216
|
|
|
176
|
-
|
|
177
|
-
- Find product by
|
|
178
|
-
- Fix text component
|
|
217
|
+
### Bug Fixes
|
|
218
|
+
- Find product by ID instead of name
|
|
219
|
+
- Fix spacing in text component
|
|
179
220
|
|
|
180
|
-
|
|
181
|
-
-
|
|
221
|
+
### Improvements
|
|
222
|
+
- Update type definitions across paywall manager and customer manager APIs
|
|
182
223
|
|
|
183
|
-
## 1.3.2
|
|
224
|
+
## 1.3.2
|
|
225
|
+
**Release Date:** August 14, 2024
|
|
184
226
|
|
|
185
227
|
### Bug Fixes
|
|
186
|
-
|
|
187
|
-
- Respect conditions based on product groups
|
|
228
|
+
- Conditional component rendering based on product entitlement and product groups
|
|
188
229
|
|
|
189
|
-
## 1.3.1
|
|
230
|
+
## 1.3.1
|
|
231
|
+
**Release Date:** August 12, 2024
|
|
190
232
|
|
|
191
233
|
### Bug Fixes
|
|
192
|
-
|
|
234
|
+
- Fix `SHOW_PAYWALL` event being triggered as `UNKNOWN`
|
|
193
235
|
|
|
194
|
-
## 1.3.0
|
|
236
|
+
## 1.3.0
|
|
237
|
+
**Release Date:** August 12, 2024
|
|
195
238
|
|
|
196
239
|
### 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**
|
|
240
|
+
- `NamiEntitlementManager` to manage entitlements
|
|
241
|
+
- `active`, `isEntitlementActive`, `refresh`, `registerActiveEntitlementsHandler`
|
|
242
|
+
- `NamiEntitlement` object model
|
|
243
|
+
- Hidden component support
|
|
244
|
+
- New components: Video and collapsible
|
|
245
|
+
- Timeout and error handling improvements
|
|
206
246
|
|
|
207
247
|
### Bug Fixes
|
|
208
|
-
-
|
|
209
|
-
-
|
|
248
|
+
- Typing improvements across SDKs
|
|
249
|
+
- ECMAScript 2021 support
|
|
210
250
|
|
|
211
|
-
### Breaking
|
|
212
|
-
- `
|
|
213
|
-
- `NamiPaywallManager.buySkuComplete`
|
|
251
|
+
### Breaking Changes
|
|
252
|
+
- `appPlatformId` renamed to `appPlatformID` in `NamiConfiguration`
|
|
253
|
+
- `NamiPaywallManager.buySkuComplete` interface simplified
|
|
214
254
|
|
|
215
|
-
## 1.2.0
|
|
255
|
+
## 1.2.0
|
|
256
|
+
**Release Date:** July 26, 2024
|
|
216
257
|
|
|
217
258
|
### New Features
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
- **Improved paywall load time** - Paywalls render signficantly faster when immediately displayed.
|
|
259
|
+
- `NamiCampaignManager.launch`: supports `paywallLaunchContext`
|
|
260
|
+
- `NamiPaywallManager.buySKUCancel` and `buySKUComplete`
|
|
261
|
+
- Paywall impression and conversion reporting
|
|
262
|
+
- Faster paywall render time
|
|
223
263
|
|
|
224
264
|
### Bug Fixes
|
|
225
|
-
-
|
|
226
|
-
- Provide consistent APIs with other Nami SDKs.
|
|
265
|
+
- Consistent typing and API alignment across SDKs
|
|
227
266
|
|
|
228
|
-
## 1.1.0
|
|
267
|
+
## 1.1.0
|
|
268
|
+
**Release Date:** June 24, 2024
|
|
229
269
|
|
|
230
270
|
### New Features
|
|
231
|
-
-
|
|
232
|
-
-
|
|
233
|
-
-
|
|
271
|
+
- `NamiCustomerManager.setAnonymousMode`
|
|
272
|
+
- `NamiCampaignManager.launch` with `paywallActionHandler`
|
|
273
|
+
- `NamiPaywallManager.registerBuySkuHandler`
|
|
234
274
|
|
|
235
275
|
### Bug Fixes
|
|
236
|
-
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
276
|
+
- Lit component compatibility and SSR fixes
|
|
277
|
+
- Subscription pricing rendering fixes
|
|
278
|
+
- Custom API host connectivity fixes
|
|
279
|
+
- Icon display improvements
|
|
240
280
|
|
|
241
281
|
### Known Issues
|
|
242
|
-
- `
|
|
243
|
-
- Impression
|
|
244
|
-
- Launch context is not yet implemented.
|
|
282
|
+
- `buySkuComplete`, `buySkuCancel` not fully implemented
|
|
283
|
+
- Impression/conversion reporting and launch context not implemented
|
|
245
284
|
|
|
246
|
-
## 1.0.0
|
|
285
|
+
## 1.0.0
|
|
286
|
+
**Release Date:** June 13, 2024
|
|
247
287
|
|
|
248
288
|
### 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.
|
|
289
|
+
- Core SDK: `Nami`, `Nami.configure`, `NamiConfiguration`, `NamiLanguageCodes`
|
|
290
|
+
- `NamiCampaignManager` for campaign management
|
|
291
|
+
- `NamiCustomerManager` for customer state and attributes
|
|
292
|
+
- `NamiPaywallManager` for paywall and event handler management
|
|
283
293
|
|
|
284
294
|
### Known Issues
|
|
285
|
-
-
|
|
286
|
-
- `
|
|
287
|
-
-
|
|
288
|
-
- Impression or conversion reporting not yet implemented
|
|
289
|
-
- Launch context is not yet implemented
|
|
295
|
+
- Paywall event callbacks not firing
|
|
296
|
+
- `buySkuComplete`, `buySkuCancel`, and `setAnonymousMode` partially implemented
|
|
297
|
+
- Impression/conversion reporting and launch context not yet available
|
|
290
298
|
|
|
291
299
|
### Additional Notes
|
|
292
|
-
|
|
300
|
+
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,22 @@
|
|
|
1
1
|
import { CSSResult, LitElement, PropertyValueMap } from "lit";
|
|
2
2
|
import ContextConsumer from "./ContextConsumer";
|
|
3
|
-
|
|
3
|
+
import { PaywallContextProvider } from "./ContextProvider";
|
|
4
|
+
import { TBaseComponent } from "../types/components";
|
|
5
|
+
export declare class NamiElementBase extends LitElement {
|
|
4
6
|
contextConsumer: ContextConsumer;
|
|
7
|
+
contextProvider: PaywallContextProvider;
|
|
5
8
|
constructor();
|
|
6
9
|
protected styles(): CSSResult;
|
|
7
10
|
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
11
|
+
protected shouldUpdate(): boolean;
|
|
8
12
|
protected willUpdate(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
9
13
|
disconnectedCallback(): void;
|
|
10
14
|
}
|
|
15
|
+
export declare abstract class NamiElement<C extends TBaseComponent = TBaseComponent> extends NamiElementBase {
|
|
16
|
+
contextConsumer: ContextConsumer;
|
|
17
|
+
contextProvider: PaywallContextProvider;
|
|
18
|
+
abstract component: C;
|
|
19
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
20
|
+
protected willUpdate(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
21
|
+
protected animationStyles(): CSSResult;
|
|
22
|
+
}
|
|
@@ -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 };
|