@namiml/web-sdk 1.6.4 → 1.7.0

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