@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.
Files changed (46) hide show
  1. package/CHANGELOG.md +171 -163
  2. package/dist/components/ContextConsumer.d.ts +4 -2
  3. package/dist/components/ContextProvider.d.ts +25 -7
  4. package/dist/components/NamiElement.d.ts +13 -1
  5. package/dist/components/Paywall.d.ts +27 -16
  6. package/dist/components/PaywallContext.d.ts +4 -0
  7. package/dist/components/PaywallScreen.d.ts +23 -0
  8. package/dist/components/TemplateComponent.d.ts +2 -1
  9. package/dist/components/containers/BackgroundContainer.d.ts +0 -1
  10. package/dist/components/containers/CarouselContainer.d.ts +5 -2
  11. package/dist/components/containers/CollapseContainer.d.ts +1 -1
  12. package/dist/components/containers/Footer.d.ts +2 -2
  13. package/dist/components/containers/Header.d.ts +3 -2
  14. package/dist/components/elements/Button.d.ts +1 -1
  15. package/dist/components/elements/QRCode.d.ts +4 -1
  16. package/dist/components/elements/RadioButton.d.ts +12 -0
  17. package/dist/components/elements/SegmentPicker.d.ts +1 -1
  18. package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
  19. package/dist/components/elements/ToggleSwitch.d.ts +18 -0
  20. package/dist/components/elements/Video.d.ts +1 -0
  21. package/dist/components/index.d.ts +7 -1
  22. package/dist/components/styles/animations.d.ts +2 -0
  23. package/dist/components/utils/actionTap.d.ts +15 -7
  24. package/dist/components/utils/helpers.d.ts +9 -9
  25. package/dist/components/utils/state.d.ts +5 -5
  26. package/dist/components/utils/swipe.d.ts +74 -0
  27. package/dist/nami/campaign.d.ts +3 -3
  28. package/dist/nami/flow/NamiFlow.d.ts +14 -6
  29. package/dist/nami/flow/NamiFlowManager.d.ts +4 -2
  30. package/dist/nami-web-ssr.d.ts +1 -0
  31. package/dist/nami-web.cjs +172 -38
  32. package/dist/nami-web.mjs +173 -39
  33. package/dist/nami-web.umd.js +173 -39
  34. package/dist/services/video.service.d.ts +8 -6
  35. package/dist/types/components/animation.d.ts +40 -0
  36. package/dist/types/components/containers.d.ts +53 -6
  37. package/dist/types/components/elements.d.ts +1 -1
  38. package/dist/types/components/index.d.ts +10 -5
  39. package/dist/types/conditions.d.ts +16 -14
  40. package/dist/types/externals/flow.d.ts +6 -0
  41. package/dist/types/externals/product.d.ts +2 -2
  42. package/dist/types/flow.d.ts +33 -8
  43. package/dist/types/paywall.d.ts +5 -6
  44. package/dist/utils/animations.d.ts +2 -0
  45. package/package.json +19 -13
  46. 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.6.4 (August 6, 2025)
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 (July 29, 2025)
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 (July 28, 2025)
43
+ ## 1.6.2
44
+ **Release Date:** July 28, 2025
19
45
 
20
46
  ### New Features
21
- - **Nami.sdkVersion** - Method to get the internal SDK version
22
- - Added support for QR Code components
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 (July 13, 2025)
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 (July 10, 2025)
65
+ ## 1.6.0
66
+ **Release Date:** July 10, 2025
39
67
 
40
68
  ### New Features
41
- - **NamiFlowManager** - Introduced `NamiFlowManager` for orchestrating multi-page flows.
42
- - **NamiFlowManager.registerStepHandoff** - Method to register a callback that is called when a flow is handed off.
43
- - **NamiFlowManager.registerEventHandler** - Method to register a callback that is called for flow analytics.
44
- - **NamiFlowManager.resume** - Method to call after a flow is handed off, to resume the flow.
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 have been added
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 (July 30, 2025)
86
+ ## 1.5.12
87
+ **Release Date:** July 30, 2025
59
88
 
60
- ### Bugfixes
89
+ ### Bug Fixes
61
90
  - Fix race condition when local storage fails
62
91
 
63
- ## 1.5.11 (June 18, 2025)
92
+ ## 1.5.11
93
+ **Release Date:** June 18, 2025
64
94
 
65
- ## Enhancements
95
+ ### Enhancements
66
96
  - Performance improvements for form factor lookups
67
97
 
68
- ## Bugfixes
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 (May 22, 2025)
102
+ ## 1.5.10
103
+ **Release Date:** May 22, 2025
73
104
 
74
- ## Enhancements
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
- ## Bugfixes
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 (Apr 2, 2025)
115
+ ## 1.5.9
116
+ **Release Date:** April 2, 2025
85
117
 
86
- ## Bugfixes
118
+ ### Bug Fixes
87
119
  - Resolve incorrect downscaling on 720p TV devices
88
120
 
89
- ## 1.5.8 (Apr 1, 2025)
121
+ ## 1.5.8
122
+ **Release Date:** April 1, 2025
90
123
 
91
- ## Bugfixes
92
- - Resolve an issue where toggle component event was firing twice
93
- - Resolve an issue where toogle switch state was re-rendering due to parent page
94
- - Resolve an issue where additional spacing was being applied
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 (Feb 20, 2025)
129
+ ## 1.5.7
130
+ **Release Date:** February 20, 2025
97
131
 
98
- ## Bugfixes
132
+ ### Bug Fixes
99
133
  - Resolve additional type issue encountered with certain initial config files
100
134
 
101
- ## 1.5.6 (Feb 19, 2025)
135
+ ## 1.5.6
136
+ **Release Date:** February 19, 2025
102
137
 
103
- ## Bugfixes
138
+ ### Bug Fixes
104
139
  - Resolve type issue encountered with certain initial config files
105
140
 
106
- ## 1.5.5 (January 16, 2025)
141
+ ## 1.5.5
142
+ **Release Date:** January 16, 2025
107
143
 
108
- ## Enhancements
109
- - Add optional `purchaseChannel` to `NamiConfiguration` to pass through to `NamiPaywallEvent` analytics
144
+ ### Enhancements
145
+ - Add optional `purchaseChannel` to `NamiConfiguration` to pass through to `NamiPaywallEvent` analytics
110
146
 
111
- ## 1.5.4 (November 29, 2024)
147
+ ## 1.5.4
148
+ **Release Date:** November 29, 2024
112
149
 
113
- ## Bugfixes
114
- - Resolve issue with TV focus with containers and product button on first load
150
+ ### Bug Fixes
151
+ - Resolve issue with TV focus on containers and product buttons on first load
115
152
 
116
- ## 1.5.3 (November 21, 2024)
153
+ ## 1.5.3
154
+ **Release Date:** November 21, 2024
117
155
 
118
- ## Bugfixes
119
- - Resolve an issue where the collapse component caret icon was not updating when expanded
156
+ ### Bug Fixes
157
+ - Fix collapse component caret icon not updating when expanded
120
158
 
121
- ## Enhancements
122
- - Support scaling on TV devices for optimal display on 720p, 1080p, 4K, and 8K devices
159
+ ### Enhancements
160
+ - Support scaling on TV devices (720p, 1080p, 4K, and 8K)
123
161
 
124
- ## 1.5.2 (October 24, 2024)
162
+ ## 1.5.2
163
+ **Release Date:** October 24, 2024
125
164
 
126
- ## Bugfixes
127
- - Fix an issue where the wrong campaign rule was being used for a given placement label
128
- - Fix issue where the wrong initial config campaign rule was being used
129
- - Fix an issue where background video on mobile goes into full screen player
130
- - Fix an issue with focus events on connected TV platforms
131
- - Fix an issue with login / logout state handling
132
- - Fix an issue with free trial and promotional offer display
133
- - Fix several UI issues with carousel and stack components
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 (October 2, 2024)
174
+ ## 1.5.1
175
+ **Release Date:** October 2, 2024
136
176
 
137
- ## Enhancements
177
+ ### Enhancements
138
178
  - Add `TOGGLE_CHANGE` and `PAGE_CHANGE` paywall events
139
179
 
140
- ## Bugfixes
180
+ ### Bug Fixes
141
181
  - Fix carousel component swiper
142
- - Fix flex alignment
143
- - Fix hero video not redenering correctly in Safari
182
+ - Fix flex alignment issues
183
+ - Fix Safari rendering for hero video
144
184
 
145
- ## 1.5.0 (September 26, 2024)
185
+ ## 1.5.0
186
+ **Release Date:** September 26, 2024
146
187
 
147
- ## New Features
148
- - Support for advanced video features
149
- - Support for carousel component
188
+ ### New Features
189
+ - Advanced video feature support
190
+ - Carousel component support
150
191
 
151
- ## Enhancements
192
+ ### Enhancements
152
193
  - Improve fallback data handling
153
- - Support repeatable list inside collapse component
154
- - Support vertical alignment on product container
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
- ## Bugfixes
158
- - Fix segment picker cursor
159
- - Fix hidden component handling
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 gradient container
162
- - Fix background video position
202
+ - Fix background video gradient and position
163
203
 
164
- ## 1.4.0 (September 5, 2024)
204
+ ## 1.4.0
205
+ **Release Date:** September 5, 2024
165
206
 
166
- ## New Features
167
- - Support for HLS in Video component
168
- - Support for Responsive Grid component
169
- - Add `NamiCustomerManager.deviceId`
170
- - Add `NamiCustomerManager.registerJourneyStateHandler`, `journeyState` (subscription management-only)
171
- - Add `NamiEntitlementManager.clearProvisionalEntitlementGrants` (subscription management-only)
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
- ## Enhancements
174
- - Allow passing product groups to paywall via campaign launch
214
+ ### Enhancements
215
+ - Pass product groups to paywall via campaign launch
175
216
 
176
- ## Bug Fixes
177
- - Find product by id rather than name
178
- - Fix text component spacing issue
217
+ ### Bug Fixes
218
+ - Find product by ID instead of name
219
+ - Fix spacing in text component
179
220
 
180
- ## Improvements
181
- - Modify type definitions for `NamiPaywallManager.registerSignInHandler`, `NamiPaywallManager.registerCloseHandler`, `NamiPaywallManager.registerBuySkuHandler`, `NamiPaywallManager.registerDeeplinkActionHandler`, `NamiCustomerManager.registerAccountStateHandler`, `NamiCampaignManager.launch` handlers to match Nami React Native SDK
221
+ ### Improvements
222
+ - Update type definitions across paywall manager and customer manager APIs
182
223
 
183
- ## 1.3.2 (August 14, 2024)
224
+ ## 1.3.2
225
+ **Release Date:** August 14, 2024
184
226
 
185
227
  ### Bug Fixes
186
- - Support Conditional components based on product entitlement
187
- - Respect conditions based on product groups
228
+ - Conditional component rendering based on product entitlement and product groups
188
229
 
189
- ## 1.3.1 (August 12, 2024)
230
+ ## 1.3.1
231
+ **Release Date:** August 12, 2024
190
232
 
191
233
  ### Bug Fixes
192
- - `SHOW_PAYWALL` event action is being triggered as `UNKNOWN`
234
+ - Fix `SHOW_PAYWALL` event being triggered as `UNKNOWN`
193
235
 
194
- ## 1.3.0 (August 12, 2024)
236
+ ## 1.3.0
237
+ **Release Date:** August 12, 2024
195
238
 
196
239
  ### New Features
197
- - **NamiEntitlementManager** - Implemented `NamiEntitlementManager` for Nami to manage entitlements.
198
- - **NamiEntitlementManager.active** - Retrieve all active entitlements for a user on the current device.
199
- - **NamiEntitlementManager.isEntitlementActive** - Check if a single entitlement is currently active.
200
- - **NamiEntitlementManager.refresh** - Manually trigger a refresh of the user's latest active entitlements from the Nami services.
201
- - **NamiEntitlementManager.registerActiveEntitlementsHandler** - Register a callback to react to a potential changes to the active entitlements for the user
202
- - **NamiEntitlement** - Object that contains data about an entitlement on the Nami Platform.
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
- - Provide consistent typing with other Nami SDKs.
209
- - Updated the JavaScript version to ECMAScript2021 for better backward compatability.
248
+ - Typing improvements across SDKs
249
+ - ECMAScript 2021 support
210
250
 
211
- ### Breaking changes
212
- - `NamiConfiguration`'s `appPlatformId` is now `appPlatformID` for consistentcy with other Nami SDKs
213
- - `NamiPaywallManager.buySkuComplete` has a much simpler (but modified) interface.
251
+ ### Breaking Changes
252
+ - `appPlatformId` renamed to `appPlatformID` in `NamiConfiguration`
253
+ - `NamiPaywallManager.buySkuComplete` interface simplified
214
254
 
215
- ## 1.2.0 (July 26, 2024)
255
+ ## 1.2.0
256
+ **Release Date:** July 26, 2024
216
257
 
217
258
  ### New Features
218
- - **NamiCampaignManager.launch** - Implemented `paywallLaunchContext` in `NamiCampaignManager.launch` in order to provide the paywall additional details.
219
- - **NamiPaywallManager.buySKUCancel** - Implemented `NamiPaywallManager.buySKUCancel` to let Nami know the user has canceled their paywall purchase.
220
- - **NamiPayallManager.buySKUComplete** - Implemented `NamiPaywallManager.buySKUComplete` to let Nami know the user has completed their paywall purchase.
221
- - **Impression / Conversion Reporting** - Implemented impression / conversion reporting for paywall analytics.
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
- - Provide consistent typing with other Nami SDKs.
226
- - Provide consistent APIs with other Nami SDKs.
265
+ - Consistent typing and API alignment across SDKs
227
266
 
228
- ## 1.1.0 (June 24, 2024)
267
+ ## 1.1.0
268
+ **Release Date:** June 24, 2024
229
269
 
230
270
  ### New Features
231
- - **NamiCustomerManager.setAnonymousMode** - Method to enable anonymous mode for the customer, concealing their identity from system tracking for privacy.
232
- - **NamiCampaignManager.launch** - Implemented the `paywallActionHandler` to allow registering a callback to receive paywall-related events.
233
- - **NamiPaywallManager.registerBuySkuHandler** - Method to register a callback invoked when the user initiates a purchase action.
271
+ - `NamiCustomerManager.setAnonymousMode`
272
+ - `NamiCampaignManager.launch` with `paywallActionHandler`
273
+ - `NamiPaywallManager.registerBuySkuHandler`
234
274
 
235
275
  ### Bug Fixes
236
- - Resolved compatibility issues with the Lit web component library and server-side rendering.
237
- - Fixed rendering issues with subscription periods and pricing in paywalls.
238
- - Fixed connectivity issues related to custom API hosts.
239
- - Enhanced the display for different icons.
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
- - `NamiPaywallManager`'s `buySkuComplete` and `buySkuCancel` methods are not fully implemented.
243
- - Impression or conversion reporting not yet implemented.
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 (June 13, 2024)
285
+ ## 1.0.0
286
+ **Release Date:** June 13, 2024
247
287
 
248
288
  ### New Features
249
- - **Nami** - Introduced `Nami` to provide core functionality to initialize the SDK.
250
- - **Nami.configure** -Method to initialize and configure the SDK using a `NamiConfiguration` object.
251
- - **NamiConfiguration** - Defines the structure of the configuration object used by `Nami.configure`.
252
- - **NamiLanguageCodes** - Defines the languages supported by Nami paywalls.
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
- - When user actions are taken on the paywall, paywall callbacks are not being called.
286
- - `NamiPaywallManager`'s `buySkuComplete` and `buySkuCancel` methods are not fully implemented.
287
- - `NamiCustomerManager`'s `setAnonymousMode` method is not fully implemented.
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
- Please refer to the documentation for detailed usage instructions and examples.
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: ReactiveControllerHost;
5
+ private host;
5
6
  state: TPaywallContext;
6
- constructor(host: ReactiveControllerHost);
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, TPaywallLaunchContext, TPaywallMedia } from '../types/paywall';
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 ContextProvider extends EventTarget implements ReactiveController {
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
- constructor();
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
- setSelectedProdcuts(products: {
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?: TPaywallLaunchContext, campaign?: NamiCampaign): void;
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
- export declare class NamiElement extends LitElement {
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, TPaywallLaunchContext } from '../types/paywall';
2
- import { NamiElement } from './NamiElement';
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
- declare class PaywallComponent extends NamiElement {
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
- private paywallEvent;
12
- private context?;
13
- private teardownEvent;
14
- constructor(paywall?: IPaywall, event?: Partial<NamiPaywallEvent>, campaign?: NamiCampaign, context?: TPaywallLaunchContext);
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 userInteractionListener;
19
- setPaywallData(paywall: IPaywall, campaign?: NamiCampaign): void;
29
+ private handleSwipeEvent;
20
30
  firstUpdated(): void;
21
- updated(changedProps: PropertyValues): void;
22
- private postImpression;
23
- private getTemplate;
24
- styles(): import("lit").CSSResult;
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,4 @@
1
+ import { PaywallContextProvider } from './ContextProvider';
2
+ export declare const PaywallProviderContext: {
3
+ __context__: PaywallContextProvider;
4
+ };