@namiml/web-sdk 1.6.3 → 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.
Files changed (44) hide show
  1. package/CHANGELOG.md +173 -160
  2. package/dist/components/ContextConsumer.d.ts +4 -2
  3. package/dist/components/ContextProvider.d.ts +27 -7
  4. package/dist/components/NamiElement.d.ts +3 -0
  5. package/dist/components/Paywall.d.ts +27 -15
  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/Header.d.ts +1 -0
  13. package/dist/components/elements/Button.d.ts +3 -2
  14. package/dist/components/elements/QRCode.d.ts +4 -1
  15. package/dist/components/elements/RadioButton.d.ts +12 -0
  16. package/dist/components/elements/SegmentPicker.d.ts +1 -1
  17. package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
  18. package/dist/components/elements/ToggleSwitch.d.ts +18 -0
  19. package/dist/components/elements/Video.d.ts +1 -0
  20. package/dist/components/index.d.ts +7 -1
  21. package/dist/components/utils/actionTap.d.ts +15 -7
  22. package/dist/components/utils/helpers.d.ts +9 -9
  23. package/dist/components/utils/state.d.ts +5 -5
  24. package/dist/components/utils/swipe.d.ts +74 -0
  25. package/dist/nami/campaign.d.ts +3 -3
  26. package/dist/nami/flow/NamiFlow.d.ts +10 -6
  27. package/dist/nami/flow/NamiFlowManager.d.ts +1 -1
  28. package/dist/nami/utils/campaign.d.ts +18 -0
  29. package/dist/nami/utils/paywall.d.ts +17 -0
  30. package/dist/nami-web-ssr.d.ts +1 -0
  31. package/dist/nami-web.cjs +100 -38
  32. package/dist/nami-web.mjs +101 -39
  33. package/dist/nami-web.umd.js +101 -39
  34. package/dist/services/storage.service.d.ts +2 -2
  35. package/dist/services/video.service.d.ts +8 -6
  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 +8 -5
  39. package/dist/types/conditions.d.ts +16 -14
  40. package/dist/types/externals/product.d.ts +2 -2
  41. package/dist/types/flow.d.ts +30 -7
  42. package/dist/types/paywall.d.ts +5 -6
  43. package/package.json +19 -13
  44. package/dist/nami-web.js +0 -96
package/CHANGELOG.md CHANGED
@@ -1,15 +1,41 @@
1
- # Changelog
1
+ # Nami Web SDK Changelog
2
2
 
3
- ## 1.6.2 (July 29, 2025)
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
18
+
19
+ ### Enhancements
20
+ - Improved directional navigation support for TV and custom Nami components
21
+ - Pass launch context in flows for better paywall context handling
22
+
23
+ ### Bug Fixes
24
+ - Prevent scrolling on TV form factor (Content and Background containers)
25
+ - Fix for handling unexpected SKU smart text variables
26
+
27
+ ## 1.6.3
28
+ **Release Date:** July 29, 2025
4
29
 
5
30
  ### Enhancements
6
31
  - Improved television layout scaling for various viewport sizes
7
32
 
8
- ## 1.6.2 (July 28, 2025)
33
+ ## 1.6.2
34
+ **Release Date:** July 28, 2025
9
35
 
10
36
  ### New Features
11
- - **Nami.sdkVersion** - Method to get the internal SDK version
12
- - Added support for QR Code components
37
+ - `Nami.sdkVersion` method to get the internal SDK version
38
+ - Support for QR Code components
13
39
  - On Device Segment Selection for A/B testing
14
40
  - Support Base64, Gzipped Initial Configurations
15
41
  - Support Fully Uppercase Text Components
@@ -20,18 +46,20 @@
20
46
  ### Bug Fixes
21
47
  - Dynamic widths on Responsive Grid components
22
48
 
23
- ## 1.6.1 (July 13, 2025)
49
+ ## 1.6.1
50
+ **Release Date:** July 13, 2025
24
51
 
25
52
  ### Improvements
26
53
  - Fix type exports in declaration files
27
54
 
28
- ## 1.6.0 (July 10, 2025)
55
+ ## 1.6.0
56
+ **Release Date:** July 10, 2025
29
57
 
30
58
  ### New Features
31
- - **NamiFlowManager** - Introduced `NamiFlowManager` for orchestrating multi-page flows.
32
- - **NamiFlowManager.registerStepHandoff** - Method to register a callback that is called when a flow is handed off.
33
- - **NamiFlowManager.registerEventHandler** - Method to register a callback that is called for flow analytics.
34
- - **NamiFlowManager.resume** - Method to call after a flow is handed off, to resume the flow.
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
35
63
 
36
64
  ### UI Enhancements
37
65
  - Default Focused Buttons
@@ -39,239 +67,224 @@
39
67
 
40
68
  ### Accessibility
41
69
  - Screenreader support for videos
42
- - Screenreader hints have been added
70
+ - Screenreader hints added
43
71
 
44
72
  ### Performance
45
73
  - Better support handling multiple `Nami.configure` calls
46
74
  - General stability fixes
47
75
 
48
- ## 1.5.11 (June 18, 2025)
76
+ ## 1.5.12
77
+ **Release Date:** July 30, 2025
78
+
79
+ ### Bug Fixes
80
+ - Fix race condition when local storage fails
49
81
 
50
- ## Enhancements
82
+ ## 1.5.11
83
+ **Release Date:** June 18, 2025
84
+
85
+ ### Enhancements
51
86
  - Performance improvements for form factor lookups
52
87
 
53
- ## Bugfixes
88
+ ### Bug Fixes
54
89
  - Fix uninterpolated smart text
55
90
  - Fix fallback to in-memory storage on localStorage write failures
56
91
 
57
- ## 1.5.10 (May 22, 2025)
92
+ ## 1.5.10
93
+ **Release Date:** May 22, 2025
58
94
 
59
- ## Enhancements
95
+ ### Enhancements
60
96
  - Support focused styling on buttons and toggle
61
97
  - Support tab key focus for collapsible component
62
98
  - Support alt tags on images
63
99
 
64
- ## Bugfixes
100
+ ### Bug Fixes
65
101
  - Fix toggle switch not preserving state on re-render
66
102
  - Fix additional spacing in text list items
67
103
  - Fix issue with screenreader and collapsed content
68
104
 
69
- ## 1.5.9 (Apr 2, 2025)
105
+ ## 1.5.9
106
+ **Release Date:** April 2, 2025
70
107
 
71
- ## Bugfixes
108
+ ### Bug Fixes
72
109
  - Resolve incorrect downscaling on 720p TV devices
73
110
 
74
- ## 1.5.8 (Apr 1, 2025)
111
+ ## 1.5.8
112
+ **Release Date:** April 1, 2025
75
113
 
76
- ## Bugfixes
77
- - Resolve an issue where toggle component event was firing twice
78
- - Resolve an issue where toogle switch state was re-rendering due to parent page
79
- - Resolve an issue where additional spacing was being applied
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
80
118
 
81
- ## 1.5.7 (Feb 20, 2025)
119
+ ## 1.5.7
120
+ **Release Date:** February 20, 2025
82
121
 
83
- ## Bugfixes
122
+ ### Bug Fixes
84
123
  - Resolve additional type issue encountered with certain initial config files
85
124
 
86
- ## 1.5.6 (Feb 19, 2025)
125
+ ## 1.5.6
126
+ **Release Date:** February 19, 2025
87
127
 
88
- ## Bugfixes
128
+ ### Bug Fixes
89
129
  - Resolve type issue encountered with certain initial config files
90
130
 
91
- ## 1.5.5 (January 16, 2025)
131
+ ## 1.5.5
132
+ **Release Date:** January 16, 2025
92
133
 
93
- ## Enhancements
94
- - Add optional `purchaseChannel` to `NamiConfiguration` to pass through to `NamiPaywallEvent` analytics
134
+ ### Enhancements
135
+ - Add optional `purchaseChannel` to `NamiConfiguration` to pass through to `NamiPaywallEvent` analytics
95
136
 
96
- ## 1.5.4 (November 29, 2024)
137
+ ## 1.5.4
138
+ **Release Date:** November 29, 2024
97
139
 
98
- ## Bugfixes
99
- - Resolve issue with TV focus with containers and product button on first load
140
+ ### Bug Fixes
141
+ - Resolve issue with TV focus on containers and product buttons on first load
100
142
 
101
- ## 1.5.3 (November 21, 2024)
143
+ ## 1.5.3
144
+ **Release Date:** November 21, 2024
102
145
 
103
- ## Bugfixes
104
- - Resolve an issue where the collapse component caret icon was not updating when expanded
146
+ ### Bug Fixes
147
+ - Fix collapse component caret icon not updating when expanded
105
148
 
106
- ## Enhancements
107
- - Support scaling on TV devices for optimal display on 720p, 1080p, 4K, and 8K devices
149
+ ### Enhancements
150
+ - Support scaling on TV devices (720p, 1080p, 4K, and 8K)
108
151
 
109
- ## 1.5.2 (October 24, 2024)
152
+ ## 1.5.2
153
+ **Release Date:** October 24, 2024
110
154
 
111
- ## Bugfixes
112
- - Fix an issue where the wrong campaign rule was being used for a given placement label
113
- - Fix issue where the wrong initial config campaign rule was being used
114
- - Fix an issue where background video on mobile goes into full screen player
115
- - Fix an issue with focus events on connected TV platforms
116
- - Fix an issue with login / logout state handling
117
- - Fix an issue with free trial and promotional offer display
118
- - Fix several UI issues with carousel and stack components
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
119
163
 
120
- ## 1.5.1 (October 2, 2024)
164
+ ## 1.5.1
165
+ **Release Date:** October 2, 2024
121
166
 
122
- ## Enhancements
167
+ ### Enhancements
123
168
  - Add `TOGGLE_CHANGE` and `PAGE_CHANGE` paywall events
124
169
 
125
- ## Bugfixes
170
+ ### Bug Fixes
126
171
  - Fix carousel component swiper
127
- - Fix flex alignment
128
- - Fix hero video not redenering correctly in Safari
172
+ - Fix flex alignment issues
173
+ - Fix Safari rendering for hero video
129
174
 
130
- ## 1.5.0 (September 26, 2024)
175
+ ## 1.5.0
176
+ **Release Date:** September 26, 2024
131
177
 
132
- ## New Features
133
- - Support for advanced video features
134
- - Support for carousel component
178
+ ### New Features
179
+ - Advanced video feature support
180
+ - Carousel component support
135
181
 
136
- ## Enhancements
182
+ ### Enhancements
137
183
  - Improve fallback data handling
138
- - Support repeatable list inside collapse component
139
- - Support vertical alignment on product container
184
+ - Support repeatable lists inside collapse components
185
+ - Support vertical alignment in product container
140
186
  - Align `removeAllListeners` behavior with RN SDK
141
187
 
142
- ## Bugfixes
143
- - Fix segment picker cursor
144
- - Fix hidden component handling
188
+ ### Bug Fixes
189
+ - Fix segment picker cursor behavior
190
+ - Fix hidden component visibility
145
191
  - Fix responsive grid spacing and scrolling
146
- - Fix background video and gradient container
147
- - Fix background video position
192
+ - Fix background video gradient and position
148
193
 
149
- ## 1.4.0 (September 5, 2024)
194
+ ## 1.4.0
195
+ **Release Date:** September 5, 2024
150
196
 
151
- ## New Features
152
- - Support for HLS in Video component
153
- - Support for Responsive Grid component
154
- - Add `NamiCustomerManager.deviceId`
155
- - Add `NamiCustomerManager.registerJourneyStateHandler`, `journeyState` (subscription management-only)
156
- - Add `NamiEntitlementManager.clearProvisionalEntitlementGrants` (subscription management-only)
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)
157
203
 
158
- ## Enhancements
159
- - Allow passing product groups to paywall via campaign launch
204
+ ### Enhancements
205
+ - Pass product groups to paywall via campaign launch
160
206
 
161
- ## Bug Fixes
162
- - Find product by id rather than name
163
- - Fix text component spacing issue
207
+ ### Bug Fixes
208
+ - Find product by ID instead of name
209
+ - Fix spacing in text component
164
210
 
165
- ## Improvements
166
- - Modify type definitions for `NamiPaywallManager.registerSignInHandler`, `NamiPaywallManager.registerCloseHandler`, `NamiPaywallManager.registerBuySkuHandler`, `NamiPaywallManager.registerDeeplinkActionHandler`, `NamiCustomerManager.registerAccountStateHandler`, `NamiCampaignManager.launch` handlers to match Nami React Native SDK
211
+ ### Improvements
212
+ - Update type definitions across paywall manager and customer manager APIs
167
213
 
168
- ## 1.3.2 (August 14, 2024)
214
+ ## 1.3.2
215
+ **Release Date:** August 14, 2024
169
216
 
170
217
  ### Bug Fixes
171
- - Support Conditional components based on product entitlement
172
- - Respect conditions based on product groups
218
+ - Conditional component rendering based on product entitlement and product groups
173
219
 
174
- ## 1.3.1 (August 12, 2024)
220
+ ## 1.3.1
221
+ **Release Date:** August 12, 2024
175
222
 
176
223
  ### Bug Fixes
177
- - `SHOW_PAYWALL` event action is being triggered as `UNKNOWN`
224
+ - Fix `SHOW_PAYWALL` event being triggered as `UNKNOWN`
178
225
 
179
- ## 1.3.0 (August 12, 2024)
226
+ ## 1.3.0
227
+ **Release Date:** August 12, 2024
180
228
 
181
229
  ### New Features
182
- - **NamiEntitlementManager** - Implemented `NamiEntitlementManager` for Nami to manage entitlements.
183
- - **NamiEntitlementManager.active** - Retrieve all active entitlements for a user on the current device.
184
- - **NamiEntitlementManager.isEntitlementActive** - Check if a single entitlement is currently active.
185
- - **NamiEntitlementManager.refresh** - Manually trigger a refresh of the user's latest active entitlements from the Nami services.
186
- - **NamiEntitlementManager.registerActiveEntitlementsHandler** - Register a callback to react to a potential changes to the active entitlements for the user
187
- - **NamiEntitlement** - Object that contains data about an entitlement on the Nami Platform.
188
- - **Support hidden components** - Hide components without removing them from your paywalls.
189
- - **New components** - Video and collapsable components.
190
- - **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
191
236
 
192
237
  ### Bug Fixes
193
- - Provide consistent typing with other Nami SDKs.
194
- - Updated the JavaScript version to ECMAScript2021 for better backward compatability.
238
+ - Typing improvements across SDKs
239
+ - ECMAScript 2021 support
195
240
 
196
- ### Breaking changes
197
- - `NamiConfiguration`'s `appPlatformId` is now `appPlatformID` for consistentcy with other Nami SDKs
198
- - `NamiPaywallManager.buySkuComplete` has a much simpler (but modified) interface.
241
+ ### Breaking Changes
242
+ - `appPlatformId` renamed to `appPlatformID` in `NamiConfiguration`
243
+ - `NamiPaywallManager.buySkuComplete` interface simplified
199
244
 
200
- ## 1.2.0 (July 26, 2024)
245
+ ## 1.2.0
246
+ **Release Date:** July 26, 2024
201
247
 
202
248
  ### New Features
203
- - **NamiCampaignManager.launch** - Implemented `paywallLaunchContext` in `NamiCampaignManager.launch` in order to provide the paywall additional details.
204
- - **NamiPaywallManager.buySKUCancel** - Implemented `NamiPaywallManager.buySKUCancel` to let Nami know the user has canceled their paywall purchase.
205
- - **NamiPayallManager.buySKUComplete** - Implemented `NamiPaywallManager.buySKUComplete` to let Nami know the user has completed their paywall purchase.
206
- - **Impression / Conversion Reporting** - Implemented impression / conversion reporting for paywall analytics.
207
- - **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
208
253
 
209
254
  ### Bug Fixes
210
- - Provide consistent typing with other Nami SDKs.
211
- - Provide consistent APIs with other Nami SDKs.
255
+ - Consistent typing and API alignment across SDKs
212
256
 
213
- ## 1.1.0 (June 24, 2024)
257
+ ## 1.1.0
258
+ **Release Date:** June 24, 2024
214
259
 
215
260
  ### New Features
216
- - **NamiCustomerManager.setAnonymousMode** - Method to enable anonymous mode for the customer, concealing their identity from system tracking for privacy.
217
- - **NamiCampaignManager.launch** - Implemented the `paywallActionHandler` to allow registering a callback to receive paywall-related events.
218
- - **NamiPaywallManager.registerBuySkuHandler** - Method to register a callback invoked when the user initiates a purchase action.
261
+ - `NamiCustomerManager.setAnonymousMode`
262
+ - `NamiCampaignManager.launch` with `paywallActionHandler`
263
+ - `NamiPaywallManager.registerBuySkuHandler`
219
264
 
220
265
  ### Bug Fixes
221
- - Resolved compatibility issues with the Lit web component library and server-side rendering.
222
- - Fixed rendering issues with subscription periods and pricing in paywalls.
223
- - Fixed connectivity issues related to custom API hosts.
224
- - Enhanced the display for different icons.
266
+ - Lit component compatibility and SSR fixes
267
+ - Subscription pricing rendering fixes
268
+ - Custom API host connectivity fixes
269
+ - Icon display improvements
225
270
 
226
271
  ### Known Issues
227
- - `NamiPaywallManager`'s `buySkuComplete` and `buySkuCancel` methods are not fully implemented.
228
- - Impression or conversion reporting not yet implemented.
229
- - Launch context is not yet implemented.
272
+ - `buySkuComplete`, `buySkuCancel` not fully implemented
273
+ - Impression/conversion reporting and launch context not implemented
230
274
 
231
- ## 1.0.0 (June 13, 2024)
275
+ ## 1.0.0
276
+ **Release Date:** June 13, 2024
232
277
 
233
278
  ### New Features
234
- - **Nami** - Introduced `Nami` to provide core functionality to initialize the SDK.
235
- - **Nami.configure** -Method to initialize and configure the SDK using a `NamiConfiguration` object.
236
- - **NamiConfiguration** - Defines the structure of the configuration object used by `Nami.configure`.
237
- - **NamiLanguageCodes** - Defines the languages supported by Nami paywalls.
238
-
239
- - **NamiCampaignManager** - Introduced `NamiCampaignManager` to launch paywalls and manage campaigns.
240
- - **NamiCampaignManager.launch** - Method to launch paywalls.
241
- - **NamiCampaignManager.allCampaigns** - Method to get a list of available `NamiCampaign`s.
242
- - **NamiCampaignManager.isCampaignAvailable** - Method to check if a matching campaign is available, returning a boolean.
243
- - **NamiCampaignManager.refresh** - Method to request that available campaigns be refreshed.
244
- - **NamiCampaignManager.registerAvailableCampaignsHandler** - Method to register a callback that is called when campaigns are updated.
245
- - **NamiCampaign** - Defines the structure of the campaign objects.
246
-
247
- - **NamiCustomerManager** - Introduced `NamiCustomerManager` to manager customer related functionality.
248
- - **NamiCustomerManager.isLoggedIn** - Method to check if a customer is logged in, returning a boolean.
249
- - **NamiCustomerManager.loggedInId** - Method to get the unique customer identifier associated with the current device.
250
- - **NamiCustomerManager.login** - Method to provide a customer id to link one or more devices to a known customer.
251
- - **NamiCustomerManager.logout** - Method to disassociate a device from a customer identifier.
252
- - **NamiCustomerManager.registerAccountStateHandler** - Method to register a callback that is called when a customer is logged in or logged out.
253
- - **NamiCustomerManager.setCustomerAttribute** - Method to set an attribute in an on-device key/value store for use for paywall personalization uses cases.
254
- - **NamiCustomerManager.getCustomerAttribute** - Method to get the current stored value, if available, for the provided key in the on-device customer key/value store.
255
- - **NamiCustomerManager.clearCustomerAttribute** - Method to remove a key from the on-device customer key/value store.
256
- - **NamiCustomerManager.clearAllCustomerAttributes** - Method to clear all customer attributes in the on-device key/value store.
257
- - **NamiCustomerManager.setAnonymousMode** - Method to set the anonymous mode for the customer.
258
-
259
- - **NamiPaywallManager** - Introduce `NamiPaywallManager` to manage paywalls.
260
- - **NamiPaywallManager.setProductDetails** - Method to set product and price details to be used by the paywall.
261
- - **NamiPaywallManager.registerSignInHandler** - Method to register a callback for when the customer clicks a sign in button on the paywall.
262
- - **NamiPaywallManager.registerCloseHandler** - Method to register a callback for when the customer clicks on a close button on the paywall.
263
- - **NamiPaywallManager.registerDeeplinkActionHandler** - Method to register a callback for when a customer clicks on a deeplink button on the paywall.
264
- - **NamiPaywallManager.registerBuySkuHandler** - Method to register a callback for when a customer clicks on a buy button on the paywall.
265
- - **NamiPaywallManager.registerRestoreHandler** - Method to register a callback wfor when a customer clicks to restore a previous purchase.
266
- - **NamiPaywallManager.buySkuComplete** - Method to notify Nami SDK when a purchase succeeded for conversion reporting.
267
- - **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
268
283
 
269
284
  ### Known Issues
270
- - When user actions are taken on the paywall, paywall callbacks are not being called.
271
- - `NamiPaywallManager`'s `buySkuComplete` and `buySkuCancel` methods are not fully implemented.
272
- - `NamiCustomerManager`'s `setAnonymousMode` method is not fully implemented.
273
- - Impression or conversion reporting not yet implemented
274
- - 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
275
288
 
276
289
  ### Additional Notes
277
- Please refer to the documentation for detailed usage instructions and examples.
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: 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,40 +1,59 @@
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;
20
37
  onEvent<T = any>(name: string, handler: (payload: T) => void): () => void;
21
38
  hostConnected(): void;
22
39
  hostDisconnected(): void;
40
+ private defineDynamicStateProps;
23
41
  private setState;
24
42
  setProductDetails(details: NamiProductDetails[]): void;
25
43
  getProductDetails(): NamiProductDetails[];
26
44
  setCurrentGroupData(currentGroupId: string, currentGroupName: string): void;
27
45
  getCurrentGroupId(): string;
28
46
  getCurrentGroupName(): string;
29
- setSelectedProdcuts(products: {
47
+ setSelectedProducts(products: {
30
48
  [currentGroupId: string]: string | null;
31
49
  }): void;
32
50
  selectedProducts(): {
33
51
  [currentGroupId: string]: string | null;
34
52
  };
35
- setPaywall(paywall: IPaywall, context?: TPaywallLaunchContext, campaign?: NamiCampaign): void;
53
+ setPaywall(paywall: IPaywall, context: NamiPaywallLaunchContext, campaign: NamiCampaign): void;
36
54
  getSelectedPaywall(): IPaywall | undefined;
37
55
  getSelectedCampaign(): NamiCampaign | undefined;
56
+ getPaywallActionEventData(): Partial<NamiPaywallEvent>;
38
57
  paywallId(): string;
39
58
  setCurrentPage(page: string): void;
40
59
  setCustomerAttribute(attributes: {
@@ -47,6 +66,9 @@ declare class ContextProvider extends EventTarget implements ReactiveController
47
66
  setFullScreenPresentation(fullScreenPresentation: boolean): void;
48
67
  setFormFactor(formFactor: TDevice): void;
49
68
  getFormFactor(): TDevice;
69
+ getTVQuality(): "" | "720p" | "4K" | "1080p";
70
+ getViewportWidth(): number;
71
+ getViewportHeight(): number;
50
72
  setPurchaseInProgress(inProgress: boolean): void;
51
73
  setPurchase(inProgress: boolean, product?: NamiSKU): void;
52
74
  setTimeSpentOnPaywall(time: number): void;
@@ -59,5 +81,3 @@ declare class ContextProvider extends EventTarget implements ReactiveController
59
81
  setUserInteractionEnabled(enabled: boolean): void;
60
82
  setCurrentSlideIndex(index: number): void;
61
83
  }
62
- declare const contextProvider: ContextProvider;
63
- 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,28 +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 teardownEvent;
13
- 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;
14
24
  connectedCallback(): void;
15
25
  disconnectedCallback(): void;
26
+ private setOriginalStyles;
27
+ private restoreStyles;
16
28
  private handleKeyDownEvent;
17
- private userInteractionListener;
18
- setPaywallData(paywall: IPaywall, campaign?: NamiCampaign): void;
29
+ private handleSwipeEvent;
19
30
  firstUpdated(): void;
20
- updated(changedProps: PropertyValues): void;
21
- private postImpression;
22
- private getTemplate;
23
- styles(): import("lit").CSSResult;
24
- 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>;
25
35
  getSelectedSlideIndexForCurrentCarousel(): number | undefined;
36
+ private renderFlow;
37
+ private renderPaywall;
26
38
  render(): TemplateResult;
27
39
  }
28
40
  export { PaywallComponent };
@@ -0,0 +1,4 @@
1
+ import { PaywallContextProvider } from './ContextProvider';
2
+ export declare const PaywallProviderContext: {
3
+ __context__: PaywallContextProvider;
4
+ };
@@ -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
- export declare function TemplateComponent(component: TComponent, scaleFactor: number, inFocusedState?: boolean): any;
2
+ import { PaywallContextProvider } from "./ContextProvider";
3
+ export declare function TemplateComponent(contextProvider: PaywallContextProvider, component: TComponent, scaleFactor: number, inFocusedState?: boolean): any;