@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,308 @@
1
+ "use strict";
2
+ /**
3
+ * ProgressLoaderComponent - Native React Native implementation
4
+ * Supports 5 display modes: spinner, loading-text, bar, circular, loader-set
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || (function () {
23
+ var ownKeys = function(o) {
24
+ ownKeys = Object.getOwnPropertyNames || function (o) {
25
+ var ar = [];
26
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
+ return ar;
28
+ };
29
+ return ownKeys(o);
30
+ };
31
+ return function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ })();
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.ProgressLoaderComponent = void 0;
41
+ const react_1 = __importStar(require("react"));
42
+ const react_native_1 = require("react-native");
43
+ const react_native_svg_1 = __importStar(require("react-native-svg"));
44
+ // Helper to extract color from fill value (handles gradients by taking first stop)
45
+ const getColorFromFill = (fill, fallback = '#3B82F6') => {
46
+ var _a;
47
+ if (!fill)
48
+ return fallback;
49
+ if (typeof fill === 'string')
50
+ return fill;
51
+ if (typeof fill === 'object') {
52
+ if (fill.type === 'solid' && fill.color)
53
+ return fill.color;
54
+ if (fill.type === 'gradient' && ((_a = fill.stops) === null || _a === void 0 ? void 0 : _a.length) > 0) {
55
+ return fill.stops[0].color || fallback;
56
+ }
57
+ if (fill.color)
58
+ return fill.color;
59
+ }
60
+ return fallback;
61
+ };
62
+ // Animated circle component for spinner
63
+ const AnimatedCircle = react_native_1.Animated.createAnimatedComponent(react_native_svg_1.Circle);
64
+ const ProgressLoaderComponent = ({ component, stateManager, isPreviewMode = false, }) => {
65
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
66
+ const props = component.properties;
67
+ const displayMode = props.displayMode || 'circular';
68
+ const progress = (_a = props.progress) !== null && _a !== void 0 ? _a : 65;
69
+ const animated = props.animated !== false;
70
+ // Spinner properties
71
+ const spinnerSize = (_b = props.spinnerSize) !== null && _b !== void 0 ? _b : 48;
72
+ const spinnerThickness = (_c = props.spinnerThickness) !== null && _c !== void 0 ? _c : 4;
73
+ const spinnerFill = getColorFromFill(props.spinnerFill, '#3B82F6');
74
+ const spinnerTrackFill = getColorFromFill(props.spinnerTrackFill, '#E5E7EB');
75
+ // Bar properties
76
+ const barHeight = (_d = props.barHeight) !== null && _d !== void 0 ? _d : 8;
77
+ const barFill = getColorFromFill(props.barFill, '#3B82F6');
78
+ const barTrackFill = getColorFromFill(props.barTrackFill, '#E5E7EB');
79
+ const barBorderRadius = (_e = props.barBorderRadius) !== null && _e !== void 0 ? _e : 4;
80
+ // Circular properties
81
+ const circularSize = (_f = props.circularSize) !== null && _f !== void 0 ? _f : 80;
82
+ const circularThickness = (_g = props.circularThickness) !== null && _g !== void 0 ? _g : 8;
83
+ const circularFill = getColorFromFill(props.circularFill, '#3B82F6');
84
+ const circularTrackFill = getColorFromFill(props.circularTrackFill, '#E5E7EB');
85
+ const showPercentage = props.showPercentage !== false;
86
+ const percentageFill = getColorFromFill(props.percentageFill, '#1F2937');
87
+ const percentageFontSize = (_h = props.percentageFontSize) !== null && _h !== void 0 ? _h : 18;
88
+ // Loading text properties
89
+ const loadingText = props.loadingText || 'Loading...';
90
+ const loadingTextFill = getColorFromFill(props.loadingTextFill, '#1F2937');
91
+ const loadingTextSize = (_j = props.loadingTextSize) !== null && _j !== void 0 ? _j : 16;
92
+ // Loader-set properties
93
+ const loaderCount = (_k = props.loaderCount) !== null && _k !== void 0 ? _k : 3;
94
+ const loaders = [];
95
+ for (let i = 1; i <= loaderCount; i++) {
96
+ loaders.push({
97
+ label: props[`loader${i}Label`] || `Step ${i}`,
98
+ progress: (_l = props[`loader${i}Progress`]) !== null && _l !== void 0 ? _l : Math.min(100, progress + (i - 1) * 10),
99
+ });
100
+ }
101
+ // Animation values
102
+ const spinRotation = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
103
+ const progressAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
104
+ // Spinner rotation animation
105
+ (0, react_1.useEffect)(() => {
106
+ if (displayMode === 'spinner' && animated) {
107
+ const animation = react_native_1.Animated.loop(react_native_1.Animated.timing(spinRotation, {
108
+ toValue: 1,
109
+ duration: 1000,
110
+ easing: react_native_1.Easing.linear,
111
+ useNativeDriver: true,
112
+ }));
113
+ animation.start();
114
+ return () => animation.stop();
115
+ }
116
+ }, [displayMode, animated, spinRotation]);
117
+ // Progress animation
118
+ (0, react_1.useEffect)(() => {
119
+ if (animated) {
120
+ react_native_1.Animated.timing(progressAnim, {
121
+ toValue: progress,
122
+ duration: 500,
123
+ easing: react_native_1.Easing.out(react_native_1.Easing.quad),
124
+ useNativeDriver: false,
125
+ }).start();
126
+ }
127
+ else {
128
+ progressAnim.setValue(progress);
129
+ }
130
+ }, [progress, animated, progressAnim]);
131
+ // Render spinner mode
132
+ const renderSpinner = () => {
133
+ const rotation = spinRotation.interpolate({
134
+ inputRange: [0, 1],
135
+ outputRange: ['0deg', '360deg'],
136
+ });
137
+ const radius = (spinnerSize - spinnerThickness) / 2;
138
+ const circumference = 2 * Math.PI * radius;
139
+ return (<react_native_1.View style={styles.centered}>
140
+ <react_native_1.Animated.View style={{ transform: [{ rotate: rotation }] }}>
141
+ <react_native_svg_1.default width={spinnerSize} height={spinnerSize}>
142
+ <react_native_svg_1.Circle cx={spinnerSize / 2} cy={spinnerSize / 2} r={radius} stroke={spinnerTrackFill} strokeWidth={spinnerThickness} fill="none"/>
143
+ <react_native_svg_1.Circle cx={spinnerSize / 2} cy={spinnerSize / 2} r={radius} stroke={spinnerFill} strokeWidth={spinnerThickness} fill="none" strokeDasharray={`${circumference * 0.25} ${circumference * 0.75}`} strokeLinecap="round"/>
144
+ </react_native_svg_1.default>
145
+ </react_native_1.Animated.View>
146
+ </react_native_1.View>);
147
+ };
148
+ // Render loading text mode
149
+ const renderLoadingText = () => {
150
+ return (<react_native_1.View style={styles.centered}>
151
+ <react_native_1.Text style={[styles.loadingText, { color: loadingTextFill, fontSize: loadingTextSize }]}>
152
+ {loadingText}
153
+ </react_native_1.Text>
154
+ </react_native_1.View>);
155
+ };
156
+ // Render bar mode
157
+ const renderBar = () => {
158
+ const barWidth = progressAnim.interpolate({
159
+ inputRange: [0, 100],
160
+ outputRange: ['0%', '100%'],
161
+ extrapolate: 'clamp',
162
+ });
163
+ return (<react_native_1.View style={styles.barContainer}>
164
+ <react_native_1.View style={[
165
+ styles.barTrack,
166
+ {
167
+ height: barHeight,
168
+ backgroundColor: barTrackFill,
169
+ borderRadius: barBorderRadius,
170
+ },
171
+ ]}>
172
+ <react_native_1.Animated.View style={[
173
+ styles.barFill,
174
+ {
175
+ width: barWidth,
176
+ backgroundColor: barFill,
177
+ borderRadius: barBorderRadius,
178
+ },
179
+ ]}/>
180
+ </react_native_1.View>
181
+ </react_native_1.View>);
182
+ };
183
+ // Render circular mode
184
+ const renderCircular = () => {
185
+ const radius = (circularSize - circularThickness) / 2;
186
+ const circumference = 2 * Math.PI * radius;
187
+ const strokeDashoffset = progressAnim.interpolate({
188
+ inputRange: [0, 100],
189
+ outputRange: [circumference, 0],
190
+ extrapolate: 'clamp',
191
+ });
192
+ return (<react_native_1.View style={[styles.centered, { width: circularSize, height: circularSize }]}>
193
+ <react_native_svg_1.default width={circularSize} height={circularSize}>
194
+ <react_native_svg_1.G rotation="-90" origin={`${circularSize / 2}, ${circularSize / 2}`}>
195
+ <react_native_svg_1.Circle cx={circularSize / 2} cy={circularSize / 2} r={radius} stroke={circularTrackFill} strokeWidth={circularThickness} fill="none"/>
196
+ <AnimatedCircle cx={circularSize / 2} cy={circularSize / 2} r={radius} stroke={circularFill} strokeWidth={circularThickness} fill="none" strokeDasharray={circumference} strokeDashoffset={strokeDashoffset} strokeLinecap="round"/>
197
+ </react_native_svg_1.G>
198
+ </react_native_svg_1.default>
199
+ {showPercentage && (<react_native_1.View style={react_native_1.StyleSheet.absoluteFill}>
200
+ <react_native_1.View style={styles.percentageContainer}>
201
+ <react_native_1.Text style={[styles.percentageText, { color: percentageFill, fontSize: percentageFontSize }]}>
202
+ {Math.round(progress)}%
203
+ </react_native_1.Text>
204
+ </react_native_1.View>
205
+ </react_native_1.View>)}
206
+ </react_native_1.View>);
207
+ };
208
+ // Render loader-set mode
209
+ const renderLoaderSet = () => {
210
+ return (<react_native_1.View style={styles.loaderSetContainer}>
211
+ {loaders.map((loader, index) => (<react_native_1.View key={index} style={styles.loaderSetItem}>
212
+ <react_native_1.View style={styles.loaderSetHeader}>
213
+ <react_native_1.Text style={styles.loaderSetLabel}>{loader.label}</react_native_1.Text>
214
+ <react_native_1.Text style={styles.loaderSetProgress}>{loader.progress}%</react_native_1.Text>
215
+ </react_native_1.View>
216
+ <react_native_1.View style={[
217
+ styles.barTrack,
218
+ {
219
+ height: barHeight,
220
+ backgroundColor: barTrackFill,
221
+ borderRadius: barBorderRadius,
222
+ },
223
+ ]}>
224
+ <react_native_1.View style={[
225
+ styles.barFill,
226
+ {
227
+ width: `${loader.progress}%`,
228
+ backgroundColor: barFill,
229
+ borderRadius: barBorderRadius,
230
+ },
231
+ ]}/>
232
+ </react_native_1.View>
233
+ </react_native_1.View>))}
234
+ </react_native_1.View>);
235
+ };
236
+ // Render based on display mode
237
+ const renderContent = () => {
238
+ switch (displayMode) {
239
+ case 'spinner':
240
+ return renderSpinner();
241
+ case 'loading-text':
242
+ return renderLoadingText();
243
+ case 'bar':
244
+ return renderBar();
245
+ case 'circular':
246
+ return renderCircular();
247
+ case 'loader-set':
248
+ return renderLoaderSet();
249
+ default:
250
+ return renderCircular();
251
+ }
252
+ };
253
+ return <react_native_1.View style={styles.container}>{renderContent()}</react_native_1.View>;
254
+ };
255
+ exports.ProgressLoaderComponent = ProgressLoaderComponent;
256
+ const styles = react_native_1.StyleSheet.create({
257
+ container: {
258
+ alignItems: 'center',
259
+ justifyContent: 'center',
260
+ },
261
+ centered: {
262
+ alignItems: 'center',
263
+ justifyContent: 'center',
264
+ },
265
+ loadingText: {
266
+ fontWeight: '500',
267
+ },
268
+ barContainer: {
269
+ width: '100%',
270
+ },
271
+ barTrack: {
272
+ width: '100%',
273
+ overflow: 'hidden',
274
+ },
275
+ barFill: {
276
+ height: '100%',
277
+ },
278
+ percentageContainer: {
279
+ flex: 1,
280
+ alignItems: 'center',
281
+ justifyContent: 'center',
282
+ },
283
+ percentageText: {
284
+ fontWeight: '600',
285
+ },
286
+ loaderSetContainer: {
287
+ width: '100%',
288
+ gap: 16,
289
+ },
290
+ loaderSetItem: {
291
+ width: '100%',
292
+ gap: 6,
293
+ },
294
+ loaderSetHeader: {
295
+ flexDirection: 'row',
296
+ justifyContent: 'space-between',
297
+ alignItems: 'center',
298
+ },
299
+ loaderSetLabel: {
300
+ fontSize: 14,
301
+ fontWeight: '500',
302
+ color: '#374151',
303
+ },
304
+ loaderSetProgress: {
305
+ fontSize: 12,
306
+ color: '#6B7280',
307
+ },
308
+ });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ProgressStepperComponent - React Native
3
+ *
4
+ * Multi-step progress indicator with customizable appearance.
5
+ * Features:
6
+ * - Horizontal/vertical orientation
7
+ * - Animated transitions
8
+ * - State manager integration
9
+ */
10
+ import React from 'react';
11
+ import { PaywallComponent } from '../types';
12
+ interface ProgressStepperComponentProps {
13
+ component: PaywallComponent;
14
+ stateManager?: any;
15
+ isPreviewMode?: boolean;
16
+ }
17
+ export declare const ProgressStepperComponent: React.FC<ProgressStepperComponentProps>;
18
+ export {};
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ /**
3
+ * ProgressStepperComponent - React Native
4
+ *
5
+ * Multi-step progress indicator with customizable appearance.
6
+ * Features:
7
+ * - Horizontal/vertical orientation
8
+ * - Animated transitions
9
+ * - State manager integration
10
+ */
11
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
+ desc = { enumerable: true, get: function() { return m[k]; } };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
24
+ }) : function(o, v) {
25
+ o["default"] = v;
26
+ });
27
+ var __importStar = (this && this.__importStar) || (function () {
28
+ var ownKeys = function(o) {
29
+ ownKeys = Object.getOwnPropertyNames || function (o) {
30
+ var ar = [];
31
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
+ return ar;
33
+ };
34
+ return ownKeys(o);
35
+ };
36
+ return function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ })();
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.ProgressStepperComponent = void 0;
46
+ const react_1 = __importStar(require("react"));
47
+ const react_native_1 = require("react-native");
48
+ // Helper to extract color from fill value
49
+ const getColorFromFill = (fill, fallback) => {
50
+ if (!fill)
51
+ return fallback;
52
+ if (typeof fill === 'string')
53
+ return fill;
54
+ if (fill.type === 'color' && fill.color)
55
+ return fill.color;
56
+ return fallback;
57
+ };
58
+ const ProgressStepperComponent = ({ component, stateManager, isPreviewMode = false, }) => {
59
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
60
+ const props = component.properties;
61
+ const componentId = component.id;
62
+ // Configuration
63
+ const totalSteps = Math.max(2, Math.min(10, (_a = props.totalSteps) !== null && _a !== void 0 ? _a : 4));
64
+ const initialStep = Math.max(1, Math.min(totalSteps, (_b = props.currentStep) !== null && _b !== void 0 ? _b : 1));
65
+ const orientation = (_c = props.orientation) !== null && _c !== void 0 ? _c : 'horizontal';
66
+ // Labels
67
+ const showLabels = (_d = props.showLabels) !== null && _d !== void 0 ? _d : false;
68
+ const showNumbers = (_e = props.showNumbers) !== null && _e !== void 0 ? _e : true;
69
+ const labels = [];
70
+ for (let i = 1; i <= totalSteps; i++) {
71
+ labels.push((_f = props[`step${i}Label`]) !== null && _f !== void 0 ? _f : `Step ${i}`);
72
+ }
73
+ // Styling
74
+ const stepSize = (_g = props.stepSize) !== null && _g !== void 0 ? _g : 32;
75
+ const lineThickness = (_h = props.lineThickness) !== null && _h !== void 0 ? _h : 2;
76
+ const stepGap = (_j = props.stepGap) !== null && _j !== void 0 ? _j : 8;
77
+ // Colors
78
+ const completedColor = getColorFromFill(props.completedFill, '#3B82F6');
79
+ const activeColor = getColorFromFill(props.activeFill, '#3B82F6');
80
+ const inactiveColor = getColorFromFill(props.inactiveFill, '#E5E7EB');
81
+ const lineColor = getColorFromFill(props.lineFill, '#E5E7EB');
82
+ const completedLineColor = getColorFromFill(props.completedLineFill, '#3B82F6');
83
+ const textColor = getColorFromFill(props.textFill, '#FFFFFF');
84
+ const labelColor = getColorFromFill(props.labelFill, '#6B7280');
85
+ // Animation
86
+ const animated = (_k = props.animated) !== null && _k !== void 0 ? _k : true;
87
+ const [currentStep, setCurrentStep] = (0, react_1.useState)(initialStep);
88
+ const [animatedValues] = (0, react_1.useState)(() => Array.from({ length: totalSteps }, () => new react_native_1.Animated.Value(1)));
89
+ // Connect to state manager
90
+ (0, react_1.useEffect)(() => {
91
+ if (stateManager) {
92
+ // Initialize state
93
+ stateManager.updateState(`element:${componentId}.currentStep`, currentStep);
94
+ stateManager.updateState(`element:${componentId}.totalSteps`, totalSteps);
95
+ stateManager.updateState(`element:${componentId}.progress`, currentStep / totalSteps);
96
+ stateManager.updateState(`element:${componentId}.isComplete`, currentStep >= totalSteps);
97
+ // Subscribe to external changes
98
+ return stateManager.subscribeToState(`element:${componentId}.currentStep`, (value) => {
99
+ if (typeof value === 'number' && value !== currentStep) {
100
+ setCurrentStep(Math.min(Math.max(1, value), totalSteps));
101
+ }
102
+ });
103
+ }
104
+ }, [componentId, totalSteps, currentStep, stateManager]);
105
+ // Animate when step changes
106
+ (0, react_1.useEffect)(() => {
107
+ if (animated) {
108
+ // Animate current step
109
+ react_native_1.Animated.sequence([
110
+ react_native_1.Animated.timing(animatedValues[currentStep - 1], {
111
+ toValue: 1.15,
112
+ duration: 100,
113
+ useNativeDriver: true,
114
+ }),
115
+ react_native_1.Animated.timing(animatedValues[currentStep - 1], {
116
+ toValue: 1,
117
+ duration: 100,
118
+ useNativeDriver: true,
119
+ }),
120
+ ]).start();
121
+ }
122
+ if (stateManager) {
123
+ stateManager.updateState(`element:${componentId}.currentStep`, currentStep);
124
+ stateManager.updateState(`element:${componentId}.progress`, currentStep / totalSteps);
125
+ stateManager.updateState(`element:${componentId}.isComplete`, currentStep >= totalSteps);
126
+ }
127
+ }, [currentStep, animated, animatedValues, componentId, totalSteps, stateManager]);
128
+ const isHorizontal = orientation === 'horizontal';
129
+ return (<react_native_1.View style={[
130
+ styles.container,
131
+ {
132
+ flexDirection: isHorizontal ? 'row' : 'column',
133
+ gap: stepGap,
134
+ },
135
+ ]}>
136
+ {Array.from({ length: totalSteps }).map((_, index) => {
137
+ const stepNumber = index + 1;
138
+ const isCompleted = stepNumber < currentStep;
139
+ const isActive = stepNumber === currentStep;
140
+ const isLast = index === totalSteps - 1;
141
+ const bgColor = isCompleted ? completedColor : isActive ? activeColor : inactiveColor;
142
+ const currentLineColor = isCompleted ? completedLineColor : lineColor;
143
+ return (<react_native_1.View key={index} style={[
144
+ styles.stepContainer,
145
+ {
146
+ flexDirection: isHorizontal ? 'row' : 'column',
147
+ flex: isLast ? undefined : 1,
148
+ },
149
+ ]}>
150
+ {/* Step with optional label */}
151
+ <react_native_1.View style={styles.stepContent}>
152
+ {/* Step Circle */}
153
+ <react_native_1.Animated.View style={[
154
+ styles.stepCircle,
155
+ {
156
+ width: stepSize,
157
+ height: stepSize,
158
+ borderRadius: stepSize / 2,
159
+ backgroundColor: bgColor,
160
+ transform: [{ scale: animatedValues[index] }],
161
+ },
162
+ ]}>
163
+ {isCompleted ? (<react_native_1.Text style={[styles.stepIcon, { color: textColor, fontSize: stepSize * 0.5 }]}>
164
+
165
+ </react_native_1.Text>) : showNumbers ? (<react_native_1.Text style={[styles.stepNumber, { color: isActive ? textColor : '#6B7280', fontSize: stepSize * 0.4 }]}>
166
+ {stepNumber}
167
+ </react_native_1.Text>) : null}
168
+ </react_native_1.Animated.View>
169
+
170
+ {/* Step Label */}
171
+ {showLabels && (<react_native_1.Text style={[
172
+ styles.stepLabel,
173
+ {
174
+ color: isCompleted || isActive ? textColor : labelColor,
175
+ fontSize: 12,
176
+ },
177
+ ]} numberOfLines={1}>
178
+ {labels[index]}
179
+ </react_native_1.Text>)}
180
+ </react_native_1.View>
181
+
182
+ {/* Connecting Line */}
183
+ {!isLast && (<react_native_1.View style={[
184
+ styles.line,
185
+ {
186
+ backgroundColor: currentLineColor,
187
+ height: isHorizontal ? lineThickness : undefined,
188
+ width: isHorizontal ? undefined : lineThickness,
189
+ flex: 1,
190
+ minWidth: isHorizontal ? 20 : undefined,
191
+ minHeight: isHorizontal ? undefined : 20,
192
+ marginHorizontal: isHorizontal ? stepGap : 0,
193
+ marginVertical: isHorizontal ? 0 : stepGap,
194
+ borderRadius: lineThickness / 2,
195
+ },
196
+ ]}/>)}
197
+ </react_native_1.View>);
198
+ })}
199
+ </react_native_1.View>);
200
+ };
201
+ exports.ProgressStepperComponent = ProgressStepperComponent;
202
+ const styles = react_native_1.StyleSheet.create({
203
+ container: {
204
+ width: '100%',
205
+ alignItems: 'center',
206
+ },
207
+ stepContainer: {
208
+ alignItems: 'center',
209
+ },
210
+ stepContent: {
211
+ alignItems: 'center',
212
+ gap: 4,
213
+ },
214
+ stepCircle: {
215
+ alignItems: 'center',
216
+ justifyContent: 'center',
217
+ },
218
+ stepNumber: {
219
+ fontWeight: '600',
220
+ },
221
+ stepIcon: {
222
+ fontWeight: 'bold',
223
+ },
224
+ stepLabel: {
225
+ textAlign: 'center',
226
+ },
227
+ line: {},
228
+ });
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { PaywallComponent } from '../types';
3
+ interface SegmentedPickerComponentProps {
4
+ component: PaywallComponent;
5
+ stateManager?: any;
6
+ isPreviewMode?: boolean;
7
+ renderChild?: (child: PaywallComponent, index: number, isSelected: boolean) => React.ReactNode;
8
+ }
9
+ export declare const SegmentedPickerComponent: React.FC<SegmentedPickerComponentProps>;
10
+ export {};