@billdog.io/react-native 1.0.0-beta.2

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 (309) hide show
  1. package/BillDogReactNative.podspec +30 -0
  2. package/LICENSE +21 -0
  3. package/README.md +330 -0
  4. package/android/build.gradle +99 -0
  5. package/android/src/main/AndroidManifest.xml +1 -0
  6. package/android/src/main/kotlin/io/billdog/reactnative/BillDogABTestModule.kt +317 -0
  7. package/android/src/main/kotlin/io/billdog/reactnative/BillDogAnalyticsModule.kt +389 -0
  8. package/android/src/main/kotlin/io/billdog/reactnative/BillDogModule.kt +817 -0
  9. package/android/src/main/kotlin/io/billdog/reactnative/BillDogPaywallViewManager.kt +383 -0
  10. package/android/src/main/kotlin/io/billdog/reactnative/BillDogSurveyModule.kt +427 -0
  11. package/android/src/main/kotlin/io/billdog/reactnative/BillDogVirtualCurrencyModule.kt +407 -0
  12. package/android/src/main/kotlin/io/billdog/virtualcurrency/BillDogVirtualCurrencyPackage.kt +44 -0
  13. package/dist/AdvancedPaywallCache.d.ts +70 -0
  14. package/dist/AdvancedPaywallCache.js +344 -0
  15. package/dist/BillDog.d.ts +255 -0
  16. package/dist/BillDog.js +918 -0
  17. package/dist/BillDogConfiguration.d.ts +145 -0
  18. package/dist/BillDogConfiguration.js +229 -0
  19. package/dist/ComponentRenderer.d.ts +17 -0
  20. package/dist/ComponentRenderer.js +886 -0
  21. package/dist/LayoutEngine.d.ts +101 -0
  22. package/dist/LayoutEngine.js +394 -0
  23. package/dist/LocalizationResolver.d.ts +99 -0
  24. package/dist/LocalizationResolver.js +266 -0
  25. package/dist/NativePaywallView.d.ts +36 -0
  26. package/dist/NativePaywallView.js +59 -0
  27. package/dist/PaywallCache.d.ts +74 -0
  28. package/dist/PaywallCache.js +293 -0
  29. package/dist/PaywallStateManager.d.ts +62 -0
  30. package/dist/PaywallStateManager.js +147 -0
  31. package/dist/PaywallView.d.ts +42 -0
  32. package/dist/PaywallView.js +275 -0
  33. package/dist/ProductVariableProvider.d.ts +60 -0
  34. package/dist/ProductVariableProvider.js +239 -0
  35. package/dist/VariableResolver.d.ts +120 -0
  36. package/dist/VariableResolver.js +379 -0
  37. package/dist/WebViewPaywall.d.ts +75 -0
  38. package/dist/WebViewPaywall.js +360 -0
  39. package/dist/animations/presets.d.ts +49 -0
  40. package/dist/animations/presets.js +367 -0
  41. package/dist/components/AccoladeCpsComponent.d.ts +13 -0
  42. package/dist/components/AccoladeCpsComponent.js +248 -0
  43. package/dist/components/AccordionComponent.d.ts +10 -0
  44. package/dist/components/AccordionComponent.js +187 -0
  45. package/dist/components/AnimatedWrapper.d.ts +35 -0
  46. package/dist/components/AnimatedWrapper.js +277 -0
  47. package/dist/components/CarouselComponent.d.ts +23 -0
  48. package/dist/components/CarouselComponent.js +484 -0
  49. package/dist/components/ChartCurveComponent.d.ts +13 -0
  50. package/dist/components/ChartCurveComponent.js +333 -0
  51. package/dist/components/CheckboxComponent.d.ts +9 -0
  52. package/dist/components/CheckboxComponent.js +172 -0
  53. package/dist/components/ConfettiComponent.d.ts +9 -0
  54. package/dist/components/ConfettiComponent.js +172 -0
  55. package/dist/components/CountdownComponent.d.ts +16 -0
  56. package/dist/components/CountdownComponent.js +414 -0
  57. package/dist/components/DelayedXComponent.d.ts +12 -0
  58. package/dist/components/DelayedXComponent.js +240 -0
  59. package/dist/components/DrawerModalComponent.d.ts +20 -0
  60. package/dist/components/DrawerModalComponent.js +286 -0
  61. package/dist/components/GradientView.d.ts +38 -0
  62. package/dist/components/GradientView.js +126 -0
  63. package/dist/components/HapticFeedbackComponent.d.ts +16 -0
  64. package/dist/components/HapticFeedbackComponent.js +64 -0
  65. package/dist/components/HorizontalProductsComponent.d.ts +17 -0
  66. package/dist/components/HorizontalProductsComponent.js +284 -0
  67. package/dist/components/MultiChoiceGridComponent.d.ts +13 -0
  68. package/dist/components/MultiChoiceGridComponent.js +234 -0
  69. package/dist/components/NPSScaleComponent.d.ts +16 -0
  70. package/dist/components/NPSScaleComponent.js +260 -0
  71. package/dist/components/NavigationComponent.d.ts +26 -0
  72. package/dist/components/NavigationComponent.js +302 -0
  73. package/dist/components/OAuthButtonComponent.d.ts +20 -0
  74. package/dist/components/OAuthButtonComponent.js +237 -0
  75. package/dist/components/ProgressLoaderComponent.d.ts +13 -0
  76. package/dist/components/ProgressLoaderComponent.js +308 -0
  77. package/dist/components/ProgressStepperComponent.d.ts +18 -0
  78. package/dist/components/ProgressStepperComponent.js +228 -0
  79. package/dist/components/SegmentedPickerComponent.d.ts +10 -0
  80. package/dist/components/SegmentedPickerComponent.js +221 -0
  81. package/dist/components/ShareButtonsComponent.d.ts +21 -0
  82. package/dist/components/ShareButtonsComponent.js +265 -0
  83. package/dist/components/ShareCodeComponent.d.ts +16 -0
  84. package/dist/components/ShareCodeComponent.js +274 -0
  85. package/dist/components/SingleChoiceGridComponent.d.ts +13 -0
  86. package/dist/components/SingleChoiceGridComponent.js +210 -0
  87. package/dist/components/SliderComponent.d.ts +9 -0
  88. package/dist/components/SliderComponent.js +263 -0
  89. package/dist/components/StarRatingInputComponent.d.ts +20 -0
  90. package/dist/components/StarRatingInputComponent.js +198 -0
  91. package/dist/components/StickerCompositeComponent.d.ts +13 -0
  92. package/dist/components/StickerCompositeComponent.js +136 -0
  93. package/dist/components/TabsComponent.d.ts +19 -0
  94. package/dist/components/TabsComponent.js +431 -0
  95. package/dist/components/TextInputComponent.d.ts +18 -0
  96. package/dist/components/TextInputComponent.js +227 -0
  97. package/dist/components/TimelineComponent.d.ts +19 -0
  98. package/dist/components/TimelineComponent.js +104 -0
  99. package/dist/components/ToggleComponent.d.ts +14 -0
  100. package/dist/components/ToggleComponent.js +132 -0
  101. package/dist/components/VerticalProductsComponent.d.ts +17 -0
  102. package/dist/components/VerticalProductsComponent.js +311 -0
  103. package/dist/dynamicValues.d.ts +36 -0
  104. package/dist/dynamicValues.js +142 -0
  105. package/dist/filters/dateFilters.d.ts +50 -0
  106. package/dist/filters/dateFilters.js +390 -0
  107. package/dist/filters/index.d.ts +18 -0
  108. package/dist/filters/index.js +253 -0
  109. package/dist/hooks/useOfferings.d.ts +76 -0
  110. package/dist/hooks/useOfferings.js +99 -0
  111. package/dist/hooks/usePaywall.d.ts +27 -0
  112. package/dist/hooks/usePaywall.js +114 -0
  113. package/dist/hooks/usePlacement.d.ts +34 -0
  114. package/dist/hooks/usePlacement.js +89 -0
  115. package/dist/hooks/useSubscription.d.ts +40 -0
  116. package/dist/hooks/useSubscription.js +97 -0
  117. package/dist/index.d.ts +98 -0
  118. package/dist/index.js +198 -0
  119. package/dist/models/BillDogError.d.ts +40 -0
  120. package/dist/models/BillDogError.js +11 -0
  121. package/dist/models/CacheFetchPolicy.d.ts +8 -0
  122. package/dist/models/CacheFetchPolicy.js +4 -0
  123. package/dist/models/CustomProduct.d.ts +32 -0
  124. package/dist/models/CustomProduct.js +15 -0
  125. package/dist/models/CustomerInfo.d.ts +17 -0
  126. package/dist/models/CustomerInfo.js +11 -0
  127. package/dist/models/Delegate.d.ts +20 -0
  128. package/dist/models/Delegate.js +11 -0
  129. package/dist/models/EntitlementInfo.d.ts +19 -0
  130. package/dist/models/EntitlementInfo.js +2 -0
  131. package/dist/models/Placement.d.ts +54 -0
  132. package/dist/models/Placement.js +15 -0
  133. package/dist/models/PurchaseParams.d.ts +39 -0
  134. package/dist/models/PurchaseParams.js +60 -0
  135. package/dist/models/PurchaseResult.d.ts +30 -0
  136. package/dist/models/PurchaseResult.js +15 -0
  137. package/dist/models/RestoreResult.d.ts +30 -0
  138. package/dist/models/RestoreResult.js +22 -0
  139. package/dist/models/RestoredItem.d.ts +26 -0
  140. package/dist/models/RestoredItem.js +13 -0
  141. package/dist/modules/ABTest.d.ts +65 -0
  142. package/dist/modules/ABTest.js +113 -0
  143. package/dist/modules/Analytics.d.ts +91 -0
  144. package/dist/modules/Analytics.js +182 -0
  145. package/dist/modules/Survey.d.ts +65 -0
  146. package/dist/modules/Survey.js +82 -0
  147. package/dist/modules/VirtualCurrency.d.ts +63 -0
  148. package/dist/modules/VirtualCurrency.js +147 -0
  149. package/dist/murmur.d.ts +23 -0
  150. package/dist/murmur.js +104 -0
  151. package/dist/notifications/LiveActivitiesManager.d.ts +47 -0
  152. package/dist/notifications/LiveActivitiesManager.js +106 -0
  153. package/dist/notifications/NotificationScheduler.d.ts +55 -0
  154. package/dist/notifications/NotificationScheduler.js +199 -0
  155. package/dist/notifications/PurchaseNotificationHandler.d.ts +24 -0
  156. package/dist/notifications/PurchaseNotificationHandler.js +55 -0
  157. package/dist/notifications/useDeviceToken.d.ts +36 -0
  158. package/dist/notifications/useDeviceToken.js +97 -0
  159. package/dist/notifications/useLiveActivity.d.ts +39 -0
  160. package/dist/notifications/useLiveActivity.js +104 -0
  161. package/dist/review/ReviewAnalytics.d.ts +34 -0
  162. package/dist/review/ReviewAnalytics.js +73 -0
  163. package/dist/review/ReviewManager.d.ts +83 -0
  164. package/dist/review/ReviewManager.js +339 -0
  165. package/dist/review/ReviewTimingManager.d.ts +82 -0
  166. package/dist/review/ReviewTimingManager.js +224 -0
  167. package/dist/survey-core/types.d.ts +215 -0
  168. package/dist/survey-core/types.js +8 -0
  169. package/dist/types.d.ts +438 -0
  170. package/dist/types.js +158 -0
  171. package/dist/utils/ApiClient.d.ts +65 -0
  172. package/dist/utils/ApiClient.js +132 -0
  173. package/dist/utils/CSSConverter.d.ts +49 -0
  174. package/dist/utils/CSSConverter.js +470 -0
  175. package/dist/utils/animations.d.ts +41 -0
  176. package/dist/utils/animations.js +194 -0
  177. package/dist/utils/calendarIntegration.d.ts +36 -0
  178. package/dist/utils/calendarIntegration.js +89 -0
  179. package/dist/utils/configurationResolver.d.ts +23 -0
  180. package/dist/utils/configurationResolver.js +78 -0
  181. package/dist/utils/deviceDetection.d.ts +38 -0
  182. package/dist/utils/deviceDetection.js +59 -0
  183. package/dist/utils/hapticFeedback.d.ts +17 -0
  184. package/dist/utils/hapticFeedback.js +53 -0
  185. package/dist/utils/iconMapper.d.ts +26 -0
  186. package/dist/utils/iconMapper.js +113 -0
  187. package/dist/utils/notificationPermissions.d.ts +13 -0
  188. package/dist/utils/notificationPermissions.js +51 -0
  189. package/dist/utils/priceFormatting.d.ts +19 -0
  190. package/dist/utils/priceFormatting.js +99 -0
  191. package/dist/utils/shareSheet.d.ts +17 -0
  192. package/dist/utils/shareSheet.js +42 -0
  193. package/dist/utils/subscriptionUpgrade.d.ts +84 -0
  194. package/dist/utils/subscriptionUpgrade.js +100 -0
  195. package/dist/valueUtils.d.ts +48 -0
  196. package/dist/valueUtils.js +129 -0
  197. package/dist/xFlowTags.d.ts +18 -0
  198. package/dist/xFlowTags.js +385 -0
  199. package/ios/BillDogABTest.m +50 -0
  200. package/ios/BillDogABTest.swift +188 -0
  201. package/ios/BillDogAnalytics.m +105 -0
  202. package/ios/BillDogAnalytics.swift +324 -0
  203. package/ios/BillDogBridge.m +222 -0
  204. package/ios/BillDogBridge.swift +715 -0
  205. package/ios/BillDogLiveActivities.m +41 -0
  206. package/ios/BillDogLiveActivities.swift +104 -0
  207. package/ios/BillDogPaywallViewManager.m +39 -0
  208. package/ios/BillDogPaywallViewManager.swift +361 -0
  209. package/ios/BillDogSurvey.m +34 -0
  210. package/ios/BillDogSurvey.swift +257 -0
  211. package/ios/BillDogVirtualCurrencyBridge.m +63 -0
  212. package/ios/BillDogVirtualCurrencyBridge.swift +511 -0
  213. package/junit.xml +25 -0
  214. package/package.json +61 -0
  215. package/react-native.config.js +13 -0
  216. package/src/AdvancedPaywallCache.ts +433 -0
  217. package/src/BillDog.ts +983 -0
  218. package/src/BillDogConfiguration.ts +318 -0
  219. package/src/ComponentRenderer.tsx +1325 -0
  220. package/src/LayoutEngine.ts +459 -0
  221. package/src/LocalizationResolver.ts +311 -0
  222. package/src/NativePaywallView.tsx +132 -0
  223. package/src/PaywallCache.ts +358 -0
  224. package/src/PaywallStateManager.ts +154 -0
  225. package/src/PaywallView.tsx +328 -0
  226. package/src/ProductVariableProvider.ts +282 -0
  227. package/src/VariableResolver.ts +516 -0
  228. package/src/WebViewPaywall.tsx +454 -0
  229. package/src/animations/presets.ts +421 -0
  230. package/src/components/AccoladeCpsComponent.tsx +259 -0
  231. package/src/components/AccordionComponent.tsx +213 -0
  232. package/src/components/AnimatedWrapper.tsx +316 -0
  233. package/src/components/CarouselComponent.tsx +615 -0
  234. package/src/components/ChartCurveComponent.tsx +452 -0
  235. package/src/components/CheckboxComponent.tsx +185 -0
  236. package/src/components/ConfettiComponent.tsx +178 -0
  237. package/src/components/CountdownComponent.tsx +454 -0
  238. package/src/components/DelayedXComponent.tsx +266 -0
  239. package/src/components/DrawerModalComponent.tsx +324 -0
  240. package/src/components/GradientView.tsx +129 -0
  241. package/src/components/HapticFeedbackComponent.tsx +39 -0
  242. package/src/components/HorizontalProductsComponent.tsx +329 -0
  243. package/src/components/MultiChoiceGridComponent.tsx +265 -0
  244. package/src/components/NPSScaleComponent.tsx +294 -0
  245. package/src/components/NavigationComponent.tsx +329 -0
  246. package/src/components/OAuthButtonComponent.tsx +266 -0
  247. package/src/components/ProgressLoaderComponent.tsx +366 -0
  248. package/src/components/ProgressStepperComponent.tsx +250 -0
  249. package/src/components/SegmentedPickerComponent.tsx +245 -0
  250. package/src/components/ShareButtonsComponent.tsx +299 -0
  251. package/src/components/ShareCodeComponent.tsx +303 -0
  252. package/src/components/SingleChoiceGridComponent.tsx +229 -0
  253. package/src/components/SliderComponent.tsx +280 -0
  254. package/src/components/StarRatingInputComponent.tsx +223 -0
  255. package/src/components/StickerCompositeComponent.tsx +168 -0
  256. package/src/components/TabsComponent.tsx +496 -0
  257. package/src/components/TextInputComponent.tsx +258 -0
  258. package/src/components/TimelineComponent.tsx +129 -0
  259. package/src/components/ToggleComponent.tsx +142 -0
  260. package/src/components/VerticalProductsComponent.tsx +357 -0
  261. package/src/dynamicValues.ts +180 -0
  262. package/src/filters/dateFilters.ts +411 -0
  263. package/src/filters/index.ts +281 -0
  264. package/src/hooks/useOfferings.ts +192 -0
  265. package/src/hooks/usePaywall.ts +154 -0
  266. package/src/hooks/usePlacement.ts +143 -0
  267. package/src/hooks/useSubscription.ts +154 -0
  268. package/src/index.ts +245 -0
  269. package/src/models/BillDogError.ts +24 -0
  270. package/src/models/CacheFetchPolicy.ts +13 -0
  271. package/src/models/CustomProduct.ts +33 -0
  272. package/src/models/CustomerInfo.ts +26 -0
  273. package/src/models/Delegate.ts +22 -0
  274. package/src/models/EntitlementInfo.ts +27 -0
  275. package/src/models/Placement.ts +50 -0
  276. package/src/models/PurchaseParams.ts +81 -0
  277. package/src/models/PurchaseResult.ts +32 -0
  278. package/src/models/RestoreResult.ts +27 -0
  279. package/src/models/RestoredItem.ts +25 -0
  280. package/src/modules/ABTest.ts +131 -0
  281. package/src/modules/Analytics.ts +227 -0
  282. package/src/modules/Survey.ts +126 -0
  283. package/src/modules/VirtualCurrency.ts +223 -0
  284. package/src/murmur.ts +102 -0
  285. package/src/notifications/LiveActivitiesManager.ts +140 -0
  286. package/src/notifications/NotificationScheduler.ts +292 -0
  287. package/src/notifications/PurchaseNotificationHandler.ts +67 -0
  288. package/src/notifications/useDeviceToken.ts +116 -0
  289. package/src/notifications/useLiveActivity.ts +125 -0
  290. package/src/review/ReviewAnalytics.ts +89 -0
  291. package/src/review/ReviewManager.ts +355 -0
  292. package/src/review/ReviewTimingManager.ts +265 -0
  293. package/src/survey-core/types.ts +244 -0
  294. package/src/types/ambient.d.ts +9 -0
  295. package/src/types.ts +680 -0
  296. package/src/utils/ApiClient.ts +163 -0
  297. package/src/utils/CSSConverter.ts +552 -0
  298. package/src/utils/animations.ts +232 -0
  299. package/src/utils/calendarIntegration.ts +113 -0
  300. package/src/utils/configurationResolver.ts +106 -0
  301. package/src/utils/deviceDetection.ts +83 -0
  302. package/src/utils/hapticFeedback.ts +55 -0
  303. package/src/utils/iconMapper.ts +102 -0
  304. package/src/utils/notificationPermissions.ts +48 -0
  305. package/src/utils/priceFormatting.ts +119 -0
  306. package/src/utils/shareSheet.ts +55 -0
  307. package/src/utils/subscriptionUpgrade.ts +183 -0
  308. package/src/valueUtils.ts +108 -0
  309. package/src/xFlowTags.ts +463 -0
@@ -0,0 +1,36 @@
1
+ export interface CalendarEvent {
2
+ title: string;
3
+ description?: string;
4
+ location?: string;
5
+ startDate: Date;
6
+ endDate: Date;
7
+ allDay?: boolean;
8
+ url?: string;
9
+ notes?: string;
10
+ }
11
+ export interface CalendarPermissionStatus {
12
+ granted: boolean;
13
+ canRequest: boolean;
14
+ }
15
+ export interface CalendarResult {
16
+ success: boolean;
17
+ eventId?: string;
18
+ error?: string;
19
+ }
20
+ /**
21
+ * Request calendar permissions
22
+ * Note: Requires react-native-calendar-events package
23
+ */
24
+ export declare function requestCalendarPermission(): Promise<CalendarPermissionStatus>;
25
+ /**
26
+ * Check current calendar permission status
27
+ */
28
+ export declare function checkCalendarPermission(): Promise<CalendarPermissionStatus>;
29
+ /**
30
+ * Add event to calendar
31
+ */
32
+ export declare function addCalendarEvent(event: CalendarEvent): Promise<CalendarResult>;
33
+ /**
34
+ * Check if calendar is supported
35
+ */
36
+ export declare function isCalendarSupported(): boolean;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requestCalendarPermission = requestCalendarPermission;
4
+ exports.checkCalendarPermission = checkCalendarPermission;
5
+ exports.addCalendarEvent = addCalendarEvent;
6
+ exports.isCalendarSupported = isCalendarSupported;
7
+ const react_native_1 = require("react-native");
8
+ /**
9
+ * Request calendar permissions
10
+ * Note: Requires react-native-calendar-events package
11
+ */
12
+ async function requestCalendarPermission() {
13
+ try {
14
+ // Dynamic import to avoid errors if package not installed
15
+ const RNCalendarEvents = require('react-native-calendar-events');
16
+ if (react_native_1.Platform.OS === 'android' && react_native_1.Platform.Version >= 23) {
17
+ const granted = await react_native_1.PermissionsAndroid.request(react_native_1.PermissionsAndroid.PERMISSIONS.WRITE_CALENDAR);
18
+ return {
19
+ granted: granted === react_native_1.PermissionsAndroid.RESULTS.GRANTED,
20
+ canRequest: granted !== react_native_1.PermissionsAndroid.RESULTS.NEVER_ASK_AGAIN,
21
+ };
22
+ }
23
+ const status = await RNCalendarEvents.requestPermissions();
24
+ return {
25
+ granted: status === 'authorized',
26
+ canRequest: status === 'undetermined',
27
+ };
28
+ }
29
+ catch (error) {
30
+ console.warn('react-native-calendar-events not installed');
31
+ return { granted: false, canRequest: false };
32
+ }
33
+ }
34
+ /**
35
+ * Check current calendar permission status
36
+ */
37
+ async function checkCalendarPermission() {
38
+ try {
39
+ const RNCalendarEvents = require('react-native-calendar-events');
40
+ const status = await RNCalendarEvents.checkPermissions();
41
+ return {
42
+ granted: status === 'authorized',
43
+ canRequest: status === 'undetermined',
44
+ };
45
+ }
46
+ catch (error) {
47
+ return { granted: false, canRequest: false };
48
+ }
49
+ }
50
+ /**
51
+ * Add event to calendar
52
+ */
53
+ async function addCalendarEvent(event) {
54
+ try {
55
+ const RNCalendarEvents = require('react-native-calendar-events');
56
+ const permission = await checkCalendarPermission();
57
+ if (!permission.granted) {
58
+ return { success: false, error: 'Calendar permission not granted' };
59
+ }
60
+ const eventId = await RNCalendarEvents.saveEvent(event.title, {
61
+ startDate: event.startDate.toISOString(),
62
+ endDate: event.endDate.toISOString(),
63
+ description: event.description,
64
+ location: event.location,
65
+ allDay: event.allDay,
66
+ notes: event.notes,
67
+ url: event.url,
68
+ });
69
+ return { success: true, eventId };
70
+ }
71
+ catch (error) {
72
+ return {
73
+ success: false,
74
+ error: error instanceof Error ? error.message : 'Failed to add event',
75
+ };
76
+ }
77
+ }
78
+ /**
79
+ * Check if calendar is supported
80
+ */
81
+ function isCalendarSupported() {
82
+ try {
83
+ require('react-native-calendar-events');
84
+ return true;
85
+ }
86
+ catch {
87
+ return false;
88
+ }
89
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Configuration resolver for React Native
3
+ * Implements fallback logic for multi-device configurations
4
+ */
5
+ import { PaywallConfiguration } from '../types';
6
+ import { DeviceCategory } from './deviceDetection';
7
+ export interface MultiPaywallConfig {
8
+ phone_portrait?: PaywallConfiguration;
9
+ phone_landscape?: PaywallConfiguration;
10
+ xl_phone_portrait?: PaywallConfiguration;
11
+ xl_phone_landscape?: PaywallConfiguration;
12
+ tablet_portrait?: PaywallConfiguration;
13
+ tablet_landscape?: PaywallConfiguration;
14
+ desktop_web?: PaywallConfiguration;
15
+ }
16
+ /**
17
+ * Find the nearest existing configuration for fallback
18
+ */
19
+ export declare function findNearestConfig(multiConfig: MultiPaywallConfig, targetCategory: DeviceCategory): DeviceCategory | null;
20
+ /**
21
+ * Resolve the appropriate configuration with fallback logic
22
+ */
23
+ export declare function resolveConfiguration(multiConfig: MultiPaywallConfig, targetCategory: DeviceCategory): PaywallConfiguration | null;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ /**
3
+ * Configuration resolver for React Native
4
+ * Implements fallback logic for multi-device configurations
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.findNearestConfig = findNearestConfig;
8
+ exports.resolveConfiguration = resolveConfiguration;
9
+ const DEVICE_GROUPS = {
10
+ phone_portrait: { group: 'phone', orientation: 'portrait' },
11
+ phone_landscape: { group: 'phone', orientation: 'landscape' },
12
+ xl_phone_portrait: { group: 'xl_phone', orientation: 'portrait' },
13
+ xl_phone_landscape: { group: 'xl_phone', orientation: 'landscape' },
14
+ tablet_portrait: { group: 'tablet', orientation: 'portrait' },
15
+ tablet_landscape: { group: 'tablet', orientation: 'landscape' },
16
+ desktop_web: { group: 'desktop', orientation: 'landscape' },
17
+ };
18
+ /**
19
+ * Find the nearest existing configuration for fallback
20
+ */
21
+ function findNearestConfig(multiConfig, targetCategory) {
22
+ const targetInfo = DEVICE_GROUPS[targetCategory];
23
+ // Priority 1: Same device group, same orientation
24
+ const sameGroupSameOrientation = Object.keys(DEVICE_GROUPS)
25
+ .find(cat => cat !== targetCategory &&
26
+ DEVICE_GROUPS[cat].group === targetInfo.group &&
27
+ DEVICE_GROUPS[cat].orientation === targetInfo.orientation &&
28
+ multiConfig[cat]);
29
+ if (sameGroupSameOrientation)
30
+ return sameGroupSameOrientation;
31
+ // Priority 2: Same device group, different orientation
32
+ const sameGroupDiffOrientation = Object.keys(DEVICE_GROUPS)
33
+ .find(cat => cat !== targetCategory &&
34
+ DEVICE_GROUPS[cat].group === targetInfo.group &&
35
+ multiConfig[cat]);
36
+ if (sameGroupDiffOrientation)
37
+ return sameGroupDiffOrientation;
38
+ // Priority 3: Fallback to smaller device in same orientation
39
+ if (targetInfo.group === 'xl_phone') {
40
+ const phoneEquivalent = targetInfo.orientation === 'portrait'
41
+ ? 'phone_portrait'
42
+ : 'phone_landscape';
43
+ if (multiConfig[phoneEquivalent])
44
+ return phoneEquivalent;
45
+ }
46
+ if (targetInfo.group === 'tablet') {
47
+ const xlPhoneEquivalent = targetInfo.orientation === 'portrait'
48
+ ? 'xl_phone_portrait'
49
+ : 'xl_phone_landscape';
50
+ if (multiConfig[xlPhoneEquivalent])
51
+ return xlPhoneEquivalent;
52
+ const phoneEquivalent = targetInfo.orientation === 'portrait'
53
+ ? 'phone_portrait'
54
+ : 'phone_landscape';
55
+ if (multiConfig[phoneEquivalent])
56
+ return phoneEquivalent;
57
+ }
58
+ // Priority 4: Phone portrait (base config - ALWAYS exists)
59
+ if (multiConfig.phone_portrait && targetCategory !== 'phone_portrait') {
60
+ return 'phone_portrait';
61
+ }
62
+ return null;
63
+ }
64
+ /**
65
+ * Resolve the appropriate configuration with fallback logic
66
+ */
67
+ function resolveConfiguration(multiConfig, targetCategory) {
68
+ // Try to get specific configuration
69
+ let config = multiConfig[targetCategory];
70
+ // If not found, use fallback logic
71
+ if (!config) {
72
+ const nearestCategory = findNearestConfig(multiConfig, targetCategory);
73
+ if (nearestCategory) {
74
+ config = multiConfig[nearestCategory];
75
+ }
76
+ }
77
+ return config || null;
78
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Device detection utilities for React Native
3
+ */
4
+ export type DeviceCategory = 'phone_portrait' | 'phone_landscape' | 'xl_phone_portrait' | 'xl_phone_landscape' | 'tablet_portrait' | 'tablet_landscape' | 'desktop_web';
5
+ export interface DeviceCategoryInfo {
6
+ category: DeviceCategory;
7
+ label: string;
8
+ dimensions: {
9
+ width: number;
10
+ height: number;
11
+ };
12
+ orientation: 'portrait' | 'landscape';
13
+ group: 'phone' | 'xl_phone' | 'tablet' | 'desktop';
14
+ osName: string;
15
+ osVersion: string;
16
+ }
17
+ /**
18
+ * Detect device category based on current dimensions
19
+ */
20
+ export declare function detectDeviceCategory(): DeviceCategory;
21
+ /**
22
+ * Get device info including OS details
23
+ */
24
+ export declare function getDeviceInfo(): {
25
+ width: number;
26
+ height: number;
27
+ category: DeviceCategory;
28
+ platform: "ios" | "android" | "windows" | "macos" | "web";
29
+ osName: string;
30
+ osVersion: string;
31
+ isTablet: boolean;
32
+ isPhone: boolean;
33
+ orientation: string;
34
+ };
35
+ /**
36
+ * Check if device is a tablet
37
+ */
38
+ export declare function isTablet(): boolean;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /**
3
+ * Device detection utilities for React Native
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.detectDeviceCategory = detectDeviceCategory;
7
+ exports.getDeviceInfo = getDeviceInfo;
8
+ exports.isTablet = isTablet;
9
+ const react_native_1 = require("react-native");
10
+ /**
11
+ * Detect device category based on current dimensions
12
+ */
13
+ function detectDeviceCategory() {
14
+ const { width, height } = react_native_1.Dimensions.get('window');
15
+ const isLandscape = width > height;
16
+ // Desktop web (viewport >= 1200px)
17
+ if (width >= 1200)
18
+ return 'desktop_web';
19
+ // Tablet range (700-1200px)
20
+ if (width >= 700 && width < 1200) {
21
+ return isLandscape ? 'tablet_landscape' : 'tablet_portrait';
22
+ }
23
+ // XL Phone range (430-700px width)
24
+ if (width >= 430 && width < 700) {
25
+ return isLandscape ? 'xl_phone_landscape' : 'xl_phone_portrait';
26
+ }
27
+ // Standard phone (<430px)
28
+ return isLandscape ? 'phone_landscape' : 'phone_portrait';
29
+ }
30
+ /**
31
+ * Get device info including OS details
32
+ */
33
+ function getDeviceInfo() {
34
+ const { width, height } = react_native_1.Dimensions.get('window');
35
+ const category = detectDeviceCategory();
36
+ // Get OS name (capitalize first letter)
37
+ const osName = react_native_1.Platform.OS === 'ios' ? 'iOS' : react_native_1.Platform.OS === 'android' ? 'Android' : 'Web';
38
+ // Get OS version
39
+ const osVersion = String(react_native_1.Platform.Version || 'Unknown');
40
+ return {
41
+ width,
42
+ height,
43
+ category,
44
+ platform: react_native_1.Platform.OS,
45
+ osName,
46
+ osVersion,
47
+ isTablet: category.includes('tablet'),
48
+ isPhone: category.includes('phone'),
49
+ orientation: width > height ? 'landscape' : 'portrait',
50
+ };
51
+ }
52
+ /**
53
+ * Check if device is a tablet
54
+ */
55
+ function isTablet() {
56
+ const { width, height } = react_native_1.Dimensions.get('window');
57
+ const minDimension = Math.min(width, height);
58
+ return minDimension >= 700;
59
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Haptic feedback utilities for React Native
3
+ */
4
+ export type HapticType = 'light' | 'medium' | 'heavy' | 'success' | 'warning' | 'error';
5
+ /**
6
+ * Trigger haptic feedback
7
+ * Phase 4.5: Integrated with paywall action execution
8
+ */
9
+ export declare function triggerHaptic(type: HapticType, intensity?: number): void;
10
+ /**
11
+ * Trigger haptic from WebView action (Phase 4.5)
12
+ */
13
+ export declare function triggerHapticFromAction(hapticType?: string): void;
14
+ /**
15
+ * Check if haptic feedback is available
16
+ */
17
+ export declare function isHapticAvailable(): boolean;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * Haptic feedback utilities for React Native
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.triggerHaptic = triggerHaptic;
7
+ exports.triggerHapticFromAction = triggerHapticFromAction;
8
+ exports.isHapticAvailable = isHapticAvailable;
9
+ const react_native_1 = require("react-native");
10
+ /**
11
+ * Trigger haptic feedback
12
+ * Phase 4.5: Integrated with paywall action execution
13
+ */
14
+ function triggerHaptic(type, intensity = 1.0) {
15
+ if (react_native_1.Platform.OS === 'ios') {
16
+ // iOS uses native haptic feedback (requires expo-haptics or react-native-haptic-feedback)
17
+ // For now, use basic vibration
18
+ const duration = getHapticDuration(type, intensity);
19
+ react_native_1.Vibration.vibrate(duration);
20
+ }
21
+ else if (react_native_1.Platform.OS === 'android') {
22
+ // Android vibration
23
+ const duration = getHapticDuration(type, intensity);
24
+ react_native_1.Vibration.vibrate(duration);
25
+ }
26
+ }
27
+ /**
28
+ * Trigger haptic from WebView action (Phase 4.5)
29
+ */
30
+ function triggerHapticFromAction(hapticType) {
31
+ const type = (hapticType || 'medium');
32
+ triggerHaptic(type);
33
+ }
34
+ /**
35
+ * Get vibration duration for haptic type
36
+ */
37
+ function getHapticDuration(type, intensity) {
38
+ const baseDurations = {
39
+ light: 10,
40
+ medium: 20,
41
+ heavy: 40,
42
+ success: 15,
43
+ warning: 25,
44
+ error: 30,
45
+ };
46
+ return Math.round(baseDurations[type] * intensity);
47
+ }
48
+ /**
49
+ * Check if haptic feedback is available
50
+ */
51
+ function isHapticAvailable() {
52
+ return react_native_1.Platform.OS === 'ios' || react_native_1.Platform.OS === 'android';
53
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * React Native uses Lucide directly - no mapping needed
3
+ * This file exists for consistency with other platforms
4
+ * and to provide a unified API
5
+ */
6
+ export interface IconMapperResult {
7
+ component: React.ComponentType<any> | null;
8
+ fallback: string | null;
9
+ }
10
+ /**
11
+ * Get Lucide icon component by name
12
+ * React Native renders Lucide icons directly (best cross-platform solution for RN)
13
+ */
14
+ export declare function getLucideIcon(iconName: string): IconMapperResult;
15
+ /**
16
+ * Check if icon exists in Lucide library
17
+ */
18
+ export declare function hasLucideIcon(iconName: string): boolean;
19
+ /**
20
+ * Get all available Lucide icon names
21
+ */
22
+ export declare function getAvailableIcons(): string[];
23
+ /**
24
+ * Recommended cross-platform icons (guaranteed to look good everywhere)
25
+ */
26
+ export declare const RECOMMENDED_ICONS: string[];
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.RECOMMENDED_ICONS = void 0;
37
+ exports.getLucideIcon = getLucideIcon;
38
+ exports.hasLucideIcon = hasLucideIcon;
39
+ exports.getAvailableIcons = getAvailableIcons;
40
+ const LucideIcons = __importStar(require("lucide-react-native"));
41
+ /**
42
+ * Get Lucide icon component by name
43
+ * React Native renders Lucide icons directly (best cross-platform solution for RN)
44
+ */
45
+ function getLucideIcon(iconName) {
46
+ const icons = LucideIcons;
47
+ const IconComponent = icons[iconName];
48
+ if (IconComponent && typeof IconComponent === 'function') {
49
+ return {
50
+ component: IconComponent,
51
+ fallback: null,
52
+ };
53
+ }
54
+ // Return fallback
55
+ return {
56
+ component: null,
57
+ fallback: iconName,
58
+ };
59
+ }
60
+ /**
61
+ * Check if icon exists in Lucide library
62
+ */
63
+ function hasLucideIcon(iconName) {
64
+ const icons = LucideIcons;
65
+ return iconName in icons && typeof icons[iconName] === 'function';
66
+ }
67
+ /**
68
+ * Get all available Lucide icon names
69
+ */
70
+ function getAvailableIcons() {
71
+ const icons = LucideIcons;
72
+ return Object.keys(icons).filter(key => typeof icons[key] === 'function');
73
+ }
74
+ /**
75
+ * Recommended cross-platform icons (guaranteed to look good everywhere)
76
+ */
77
+ exports.RECOMMENDED_ICONS = [
78
+ // Core Navigation & Actions
79
+ 'Star', 'Heart', 'Home', 'Settings', 'User', 'Search', 'Menu', 'X', 'Check',
80
+ 'ChevronRight', 'ChevronLeft', 'ChevronDown', 'ChevronUp', 'Plus', 'Minus',
81
+ 'Edit', 'Trash', 'Calendar', 'Clock', 'Mail', 'Phone', 'Camera', 'Image',
82
+ 'Video', 'Music', 'Download', 'Upload', 'Share', 'Info', 'AlertTriangle',
83
+ 'Lock', 'Eye', 'Bell', 'ShoppingCart', 'Gift', 'Globe', 'ArrowRight', 'ArrowLeft',
84
+ // Forms & Controls (expanded)
85
+ 'CheckSquare', 'Square', 'ToggleRight', 'Bold', 'Italic', 'AlignLeft',
86
+ 'AlignCenter', 'AlignRight', 'List', 'Palette', 'Crop', 'RotateCw',
87
+ // Arrows & Navigation (expanded)
88
+ 'ArrowUp', 'ArrowDown', 'ArrowUpRight', 'ChevronsRight', 'Repeat', 'Undo',
89
+ 'Redo', 'Navigation', 'Compass', 'Expand', 'Minimize',
90
+ // E-commerce (expanded)
91
+ 'Store', 'ShoppingBag', 'Wallet', 'CreditCard', 'Package', 'Truck',
92
+ 'Receipt', 'Barcode', 'QrCode', 'Tag', 'Percent',
93
+ // Communication (expanded)
94
+ 'MessageCircle', 'MessageSquare', 'MailOpen', 'Inbox', 'Send', 'Reply',
95
+ 'Phone', 'Mic', 'Users', 'UserPlus', 'Contact', 'Award',
96
+ // Files & Documents (expanded)
97
+ 'File', 'FileText', 'Folder', 'FolderOpen', 'Save', 'Copy', 'Clipboard',
98
+ 'Paperclip', 'Link', 'Database',
99
+ // Media (expanded)
100
+ 'Play', 'Pause', 'SkipForward', 'Volume2', 'Film', 'Radio', 'Tv',
101
+ // Charts & Data (expanded)
102
+ 'BarChart', 'LineChart', 'PieChart', 'Activity', 'TrendingUp', 'TrendingDown',
103
+ 'Zap', 'Signal', 'Network',
104
+ // Transportation
105
+ 'Car', 'Bus', 'Train', 'Plane', 'Bike', 'MapPin', 'Map',
106
+ // Health & Lifestyle
107
+ 'Heart', 'Pill', 'Coffee', 'Pizza', 'Leaf', 'Accessibility',
108
+ // Weather
109
+ 'Sun', 'Moon', 'Cloud', 'CloudRain', 'CloudSnow', 'Droplet', 'Wind',
110
+ // System & Miscellaneous
111
+ 'Grid', 'Layers', 'Filter', 'RefreshCw', 'Code', 'Power', 'Battery',
112
+ 'Sparkles', 'Crown', 'Shield', 'Timer', 'Flag', 'Target',
113
+ ];
@@ -0,0 +1,13 @@
1
+ export type NotificationPermissionStatus = 'granted' | 'denied' | 'default';
2
+ /**
3
+ * Request push notification permissions
4
+ */
5
+ export declare function requestNotificationPermission(): Promise<NotificationPermissionStatus>;
6
+ /**
7
+ * Check current notification permission status
8
+ */
9
+ export declare function checkNotificationPermission(): Promise<NotificationPermissionStatus>;
10
+ /**
11
+ * Check if notifications are supported
12
+ */
13
+ export declare function isNotificationSupported(): boolean;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.requestNotificationPermission = requestNotificationPermission;
7
+ exports.checkNotificationPermission = checkNotificationPermission;
8
+ exports.isNotificationSupported = isNotificationSupported;
9
+ const react_native_1 = require("react-native");
10
+ const react_native_push_notification_1 = __importDefault(require("react-native-push-notification"));
11
+ /**
12
+ * Request push notification permissions
13
+ */
14
+ async function requestNotificationPermission() {
15
+ if (react_native_1.Platform.OS === 'ios') {
16
+ return new Promise((resolve) => {
17
+ react_native_push_notification_1.default.requestPermissions((permissions) => {
18
+ resolve(permissions.alert ? 'granted' : 'denied');
19
+ });
20
+ });
21
+ }
22
+ else if (react_native_1.Platform.OS === 'android') {
23
+ if (react_native_1.Platform.Version >= 33) {
24
+ const granted = await react_native_1.PermissionsAndroid.request(react_native_1.PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS);
25
+ return granted === react_native_1.PermissionsAndroid.RESULTS.GRANTED ? 'granted' : 'denied';
26
+ }
27
+ return 'granted'; // Granted by default on older Android versions
28
+ }
29
+ return 'denied';
30
+ }
31
+ /**
32
+ * Check current notification permission status
33
+ */
34
+ async function checkNotificationPermission() {
35
+ return new Promise((resolve) => {
36
+ react_native_push_notification_1.default.checkPermissions((permissions) => {
37
+ if (permissions.alert === true || permissions.alert === 1) {
38
+ resolve('granted');
39
+ }
40
+ else {
41
+ resolve('denied');
42
+ }
43
+ });
44
+ });
45
+ }
46
+ /**
47
+ * Check if notifications are supported
48
+ */
49
+ function isNotificationSupported() {
50
+ return true;
51
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Utilities for formatting prices and subscription periods
3
+ */
4
+ /**
5
+ * Format a price with currency
6
+ */
7
+ export declare function formatPrice(price: number, currency?: string, locale?: string): string;
8
+ /**
9
+ * Format a subscription period
10
+ */
11
+ export declare function formatSubscriptionPeriod(duration: number, period: string, locale?: string): string;
12
+ /**
13
+ * Format intro pricing info
14
+ */
15
+ export declare function formatIntroPricing(introPrice: number | null | undefined, introDuration: number | null | undefined, introPeriod: string | null | undefined, introCycles: number | null | undefined, currency?: string, locale?: string): string | null;
16
+ /**
17
+ * Helper to get package type display name
18
+ */
19
+ export declare function getPackageTypeDisplayName(packageType: string): string;