@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.
- package/BillDogReactNative.podspec +30 -0
- package/LICENSE +21 -0
- package/README.md +330 -0
- package/android/build.gradle +99 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/kotlin/io/billdog/reactnative/BillDogABTestModule.kt +317 -0
- package/android/src/main/kotlin/io/billdog/reactnative/BillDogAnalyticsModule.kt +389 -0
- package/android/src/main/kotlin/io/billdog/reactnative/BillDogModule.kt +817 -0
- package/android/src/main/kotlin/io/billdog/reactnative/BillDogPaywallViewManager.kt +383 -0
- package/android/src/main/kotlin/io/billdog/reactnative/BillDogSurveyModule.kt +427 -0
- package/android/src/main/kotlin/io/billdog/reactnative/BillDogVirtualCurrencyModule.kt +407 -0
- package/android/src/main/kotlin/io/billdog/virtualcurrency/BillDogVirtualCurrencyPackage.kt +44 -0
- package/dist/AdvancedPaywallCache.d.ts +70 -0
- package/dist/AdvancedPaywallCache.js +344 -0
- package/dist/BillDog.d.ts +255 -0
- package/dist/BillDog.js +918 -0
- package/dist/BillDogConfiguration.d.ts +145 -0
- package/dist/BillDogConfiguration.js +229 -0
- package/dist/ComponentRenderer.d.ts +17 -0
- package/dist/ComponentRenderer.js +886 -0
- package/dist/LayoutEngine.d.ts +101 -0
- package/dist/LayoutEngine.js +394 -0
- package/dist/LocalizationResolver.d.ts +99 -0
- package/dist/LocalizationResolver.js +266 -0
- package/dist/NativePaywallView.d.ts +36 -0
- package/dist/NativePaywallView.js +59 -0
- package/dist/PaywallCache.d.ts +74 -0
- package/dist/PaywallCache.js +293 -0
- package/dist/PaywallStateManager.d.ts +62 -0
- package/dist/PaywallStateManager.js +147 -0
- package/dist/PaywallView.d.ts +42 -0
- package/dist/PaywallView.js +275 -0
- package/dist/ProductVariableProvider.d.ts +60 -0
- package/dist/ProductVariableProvider.js +239 -0
- package/dist/VariableResolver.d.ts +120 -0
- package/dist/VariableResolver.js +379 -0
- package/dist/WebViewPaywall.d.ts +75 -0
- package/dist/WebViewPaywall.js +360 -0
- package/dist/animations/presets.d.ts +49 -0
- package/dist/animations/presets.js +367 -0
- package/dist/components/AccoladeCpsComponent.d.ts +13 -0
- package/dist/components/AccoladeCpsComponent.js +248 -0
- package/dist/components/AccordionComponent.d.ts +10 -0
- package/dist/components/AccordionComponent.js +187 -0
- package/dist/components/AnimatedWrapper.d.ts +35 -0
- package/dist/components/AnimatedWrapper.js +277 -0
- package/dist/components/CarouselComponent.d.ts +23 -0
- package/dist/components/CarouselComponent.js +484 -0
- package/dist/components/ChartCurveComponent.d.ts +13 -0
- package/dist/components/ChartCurveComponent.js +333 -0
- package/dist/components/CheckboxComponent.d.ts +9 -0
- package/dist/components/CheckboxComponent.js +172 -0
- package/dist/components/ConfettiComponent.d.ts +9 -0
- package/dist/components/ConfettiComponent.js +172 -0
- package/dist/components/CountdownComponent.d.ts +16 -0
- package/dist/components/CountdownComponent.js +414 -0
- package/dist/components/DelayedXComponent.d.ts +12 -0
- package/dist/components/DelayedXComponent.js +240 -0
- package/dist/components/DrawerModalComponent.d.ts +20 -0
- package/dist/components/DrawerModalComponent.js +286 -0
- package/dist/components/GradientView.d.ts +38 -0
- package/dist/components/GradientView.js +126 -0
- package/dist/components/HapticFeedbackComponent.d.ts +16 -0
- package/dist/components/HapticFeedbackComponent.js +64 -0
- package/dist/components/HorizontalProductsComponent.d.ts +17 -0
- package/dist/components/HorizontalProductsComponent.js +284 -0
- package/dist/components/MultiChoiceGridComponent.d.ts +13 -0
- package/dist/components/MultiChoiceGridComponent.js +234 -0
- package/dist/components/NPSScaleComponent.d.ts +16 -0
- package/dist/components/NPSScaleComponent.js +260 -0
- package/dist/components/NavigationComponent.d.ts +26 -0
- package/dist/components/NavigationComponent.js +302 -0
- package/dist/components/OAuthButtonComponent.d.ts +20 -0
- package/dist/components/OAuthButtonComponent.js +237 -0
- package/dist/components/ProgressLoaderComponent.d.ts +13 -0
- package/dist/components/ProgressLoaderComponent.js +308 -0
- package/dist/components/ProgressStepperComponent.d.ts +18 -0
- package/dist/components/ProgressStepperComponent.js +228 -0
- package/dist/components/SegmentedPickerComponent.d.ts +10 -0
- package/dist/components/SegmentedPickerComponent.js +221 -0
- package/dist/components/ShareButtonsComponent.d.ts +21 -0
- package/dist/components/ShareButtonsComponent.js +265 -0
- package/dist/components/ShareCodeComponent.d.ts +16 -0
- package/dist/components/ShareCodeComponent.js +274 -0
- package/dist/components/SingleChoiceGridComponent.d.ts +13 -0
- package/dist/components/SingleChoiceGridComponent.js +210 -0
- package/dist/components/SliderComponent.d.ts +9 -0
- package/dist/components/SliderComponent.js +263 -0
- package/dist/components/StarRatingInputComponent.d.ts +20 -0
- package/dist/components/StarRatingInputComponent.js +198 -0
- package/dist/components/StickerCompositeComponent.d.ts +13 -0
- package/dist/components/StickerCompositeComponent.js +136 -0
- package/dist/components/TabsComponent.d.ts +19 -0
- package/dist/components/TabsComponent.js +431 -0
- package/dist/components/TextInputComponent.d.ts +18 -0
- package/dist/components/TextInputComponent.js +227 -0
- package/dist/components/TimelineComponent.d.ts +19 -0
- package/dist/components/TimelineComponent.js +104 -0
- package/dist/components/ToggleComponent.d.ts +14 -0
- package/dist/components/ToggleComponent.js +132 -0
- package/dist/components/VerticalProductsComponent.d.ts +17 -0
- package/dist/components/VerticalProductsComponent.js +311 -0
- package/dist/dynamicValues.d.ts +36 -0
- package/dist/dynamicValues.js +142 -0
- package/dist/filters/dateFilters.d.ts +50 -0
- package/dist/filters/dateFilters.js +390 -0
- package/dist/filters/index.d.ts +18 -0
- package/dist/filters/index.js +253 -0
- package/dist/hooks/useOfferings.d.ts +76 -0
- package/dist/hooks/useOfferings.js +99 -0
- package/dist/hooks/usePaywall.d.ts +27 -0
- package/dist/hooks/usePaywall.js +114 -0
- package/dist/hooks/usePlacement.d.ts +34 -0
- package/dist/hooks/usePlacement.js +89 -0
- package/dist/hooks/useSubscription.d.ts +40 -0
- package/dist/hooks/useSubscription.js +97 -0
- package/dist/index.d.ts +98 -0
- package/dist/index.js +198 -0
- package/dist/models/BillDogError.d.ts +40 -0
- package/dist/models/BillDogError.js +11 -0
- package/dist/models/CacheFetchPolicy.d.ts +8 -0
- package/dist/models/CacheFetchPolicy.js +4 -0
- package/dist/models/CustomProduct.d.ts +32 -0
- package/dist/models/CustomProduct.js +15 -0
- package/dist/models/CustomerInfo.d.ts +17 -0
- package/dist/models/CustomerInfo.js +11 -0
- package/dist/models/Delegate.d.ts +20 -0
- package/dist/models/Delegate.js +11 -0
- package/dist/models/EntitlementInfo.d.ts +19 -0
- package/dist/models/EntitlementInfo.js +2 -0
- package/dist/models/Placement.d.ts +54 -0
- package/dist/models/Placement.js +15 -0
- package/dist/models/PurchaseParams.d.ts +39 -0
- package/dist/models/PurchaseParams.js +60 -0
- package/dist/models/PurchaseResult.d.ts +30 -0
- package/dist/models/PurchaseResult.js +15 -0
- package/dist/models/RestoreResult.d.ts +30 -0
- package/dist/models/RestoreResult.js +22 -0
- package/dist/models/RestoredItem.d.ts +26 -0
- package/dist/models/RestoredItem.js +13 -0
- package/dist/modules/ABTest.d.ts +65 -0
- package/dist/modules/ABTest.js +113 -0
- package/dist/modules/Analytics.d.ts +91 -0
- package/dist/modules/Analytics.js +182 -0
- package/dist/modules/Survey.d.ts +65 -0
- package/dist/modules/Survey.js +82 -0
- package/dist/modules/VirtualCurrency.d.ts +63 -0
- package/dist/modules/VirtualCurrency.js +147 -0
- package/dist/murmur.d.ts +23 -0
- package/dist/murmur.js +104 -0
- package/dist/notifications/LiveActivitiesManager.d.ts +47 -0
- package/dist/notifications/LiveActivitiesManager.js +106 -0
- package/dist/notifications/NotificationScheduler.d.ts +55 -0
- package/dist/notifications/NotificationScheduler.js +199 -0
- package/dist/notifications/PurchaseNotificationHandler.d.ts +24 -0
- package/dist/notifications/PurchaseNotificationHandler.js +55 -0
- package/dist/notifications/useDeviceToken.d.ts +36 -0
- package/dist/notifications/useDeviceToken.js +97 -0
- package/dist/notifications/useLiveActivity.d.ts +39 -0
- package/dist/notifications/useLiveActivity.js +104 -0
- package/dist/review/ReviewAnalytics.d.ts +34 -0
- package/dist/review/ReviewAnalytics.js +73 -0
- package/dist/review/ReviewManager.d.ts +83 -0
- package/dist/review/ReviewManager.js +339 -0
- package/dist/review/ReviewTimingManager.d.ts +82 -0
- package/dist/review/ReviewTimingManager.js +224 -0
- package/dist/survey-core/types.d.ts +215 -0
- package/dist/survey-core/types.js +8 -0
- package/dist/types.d.ts +438 -0
- package/dist/types.js +158 -0
- package/dist/utils/ApiClient.d.ts +65 -0
- package/dist/utils/ApiClient.js +132 -0
- package/dist/utils/CSSConverter.d.ts +49 -0
- package/dist/utils/CSSConverter.js +470 -0
- package/dist/utils/animations.d.ts +41 -0
- package/dist/utils/animations.js +194 -0
- package/dist/utils/calendarIntegration.d.ts +36 -0
- package/dist/utils/calendarIntegration.js +89 -0
- package/dist/utils/configurationResolver.d.ts +23 -0
- package/dist/utils/configurationResolver.js +78 -0
- package/dist/utils/deviceDetection.d.ts +38 -0
- package/dist/utils/deviceDetection.js +59 -0
- package/dist/utils/hapticFeedback.d.ts +17 -0
- package/dist/utils/hapticFeedback.js +53 -0
- package/dist/utils/iconMapper.d.ts +26 -0
- package/dist/utils/iconMapper.js +113 -0
- package/dist/utils/notificationPermissions.d.ts +13 -0
- package/dist/utils/notificationPermissions.js +51 -0
- package/dist/utils/priceFormatting.d.ts +19 -0
- package/dist/utils/priceFormatting.js +99 -0
- package/dist/utils/shareSheet.d.ts +17 -0
- package/dist/utils/shareSheet.js +42 -0
- package/dist/utils/subscriptionUpgrade.d.ts +84 -0
- package/dist/utils/subscriptionUpgrade.js +100 -0
- package/dist/valueUtils.d.ts +48 -0
- package/dist/valueUtils.js +129 -0
- package/dist/xFlowTags.d.ts +18 -0
- package/dist/xFlowTags.js +385 -0
- package/ios/BillDogABTest.m +50 -0
- package/ios/BillDogABTest.swift +188 -0
- package/ios/BillDogAnalytics.m +105 -0
- package/ios/BillDogAnalytics.swift +324 -0
- package/ios/BillDogBridge.m +222 -0
- package/ios/BillDogBridge.swift +715 -0
- package/ios/BillDogLiveActivities.m +41 -0
- package/ios/BillDogLiveActivities.swift +104 -0
- package/ios/BillDogPaywallViewManager.m +39 -0
- package/ios/BillDogPaywallViewManager.swift +361 -0
- package/ios/BillDogSurvey.m +34 -0
- package/ios/BillDogSurvey.swift +257 -0
- package/ios/BillDogVirtualCurrencyBridge.m +63 -0
- package/ios/BillDogVirtualCurrencyBridge.swift +511 -0
- package/junit.xml +25 -0
- package/package.json +61 -0
- package/react-native.config.js +13 -0
- package/src/AdvancedPaywallCache.ts +433 -0
- package/src/BillDog.ts +983 -0
- package/src/BillDogConfiguration.ts +318 -0
- package/src/ComponentRenderer.tsx +1325 -0
- package/src/LayoutEngine.ts +459 -0
- package/src/LocalizationResolver.ts +311 -0
- package/src/NativePaywallView.tsx +132 -0
- package/src/PaywallCache.ts +358 -0
- package/src/PaywallStateManager.ts +154 -0
- package/src/PaywallView.tsx +328 -0
- package/src/ProductVariableProvider.ts +282 -0
- package/src/VariableResolver.ts +516 -0
- package/src/WebViewPaywall.tsx +454 -0
- package/src/animations/presets.ts +421 -0
- package/src/components/AccoladeCpsComponent.tsx +259 -0
- package/src/components/AccordionComponent.tsx +213 -0
- package/src/components/AnimatedWrapper.tsx +316 -0
- package/src/components/CarouselComponent.tsx +615 -0
- package/src/components/ChartCurveComponent.tsx +452 -0
- package/src/components/CheckboxComponent.tsx +185 -0
- package/src/components/ConfettiComponent.tsx +178 -0
- package/src/components/CountdownComponent.tsx +454 -0
- package/src/components/DelayedXComponent.tsx +266 -0
- package/src/components/DrawerModalComponent.tsx +324 -0
- package/src/components/GradientView.tsx +129 -0
- package/src/components/HapticFeedbackComponent.tsx +39 -0
- package/src/components/HorizontalProductsComponent.tsx +329 -0
- package/src/components/MultiChoiceGridComponent.tsx +265 -0
- package/src/components/NPSScaleComponent.tsx +294 -0
- package/src/components/NavigationComponent.tsx +329 -0
- package/src/components/OAuthButtonComponent.tsx +266 -0
- package/src/components/ProgressLoaderComponent.tsx +366 -0
- package/src/components/ProgressStepperComponent.tsx +250 -0
- package/src/components/SegmentedPickerComponent.tsx +245 -0
- package/src/components/ShareButtonsComponent.tsx +299 -0
- package/src/components/ShareCodeComponent.tsx +303 -0
- package/src/components/SingleChoiceGridComponent.tsx +229 -0
- package/src/components/SliderComponent.tsx +280 -0
- package/src/components/StarRatingInputComponent.tsx +223 -0
- package/src/components/StickerCompositeComponent.tsx +168 -0
- package/src/components/TabsComponent.tsx +496 -0
- package/src/components/TextInputComponent.tsx +258 -0
- package/src/components/TimelineComponent.tsx +129 -0
- package/src/components/ToggleComponent.tsx +142 -0
- package/src/components/VerticalProductsComponent.tsx +357 -0
- package/src/dynamicValues.ts +180 -0
- package/src/filters/dateFilters.ts +411 -0
- package/src/filters/index.ts +281 -0
- package/src/hooks/useOfferings.ts +192 -0
- package/src/hooks/usePaywall.ts +154 -0
- package/src/hooks/usePlacement.ts +143 -0
- package/src/hooks/useSubscription.ts +154 -0
- package/src/index.ts +245 -0
- package/src/models/BillDogError.ts +24 -0
- package/src/models/CacheFetchPolicy.ts +13 -0
- package/src/models/CustomProduct.ts +33 -0
- package/src/models/CustomerInfo.ts +26 -0
- package/src/models/Delegate.ts +22 -0
- package/src/models/EntitlementInfo.ts +27 -0
- package/src/models/Placement.ts +50 -0
- package/src/models/PurchaseParams.ts +81 -0
- package/src/models/PurchaseResult.ts +32 -0
- package/src/models/RestoreResult.ts +27 -0
- package/src/models/RestoredItem.ts +25 -0
- package/src/modules/ABTest.ts +131 -0
- package/src/modules/Analytics.ts +227 -0
- package/src/modules/Survey.ts +126 -0
- package/src/modules/VirtualCurrency.ts +223 -0
- package/src/murmur.ts +102 -0
- package/src/notifications/LiveActivitiesManager.ts +140 -0
- package/src/notifications/NotificationScheduler.ts +292 -0
- package/src/notifications/PurchaseNotificationHandler.ts +67 -0
- package/src/notifications/useDeviceToken.ts +116 -0
- package/src/notifications/useLiveActivity.ts +125 -0
- package/src/review/ReviewAnalytics.ts +89 -0
- package/src/review/ReviewManager.ts +355 -0
- package/src/review/ReviewTimingManager.ts +265 -0
- package/src/survey-core/types.ts +244 -0
- package/src/types/ambient.d.ts +9 -0
- package/src/types.ts +680 -0
- package/src/utils/ApiClient.ts +163 -0
- package/src/utils/CSSConverter.ts +552 -0
- package/src/utils/animations.ts +232 -0
- package/src/utils/calendarIntegration.ts +113 -0
- package/src/utils/configurationResolver.ts +106 -0
- package/src/utils/deviceDetection.ts +83 -0
- package/src/utils/hapticFeedback.ts +55 -0
- package/src/utils/iconMapper.ts +102 -0
- package/src/utils/notificationPermissions.ts +48 -0
- package/src/utils/priceFormatting.ts +119 -0
- package/src/utils/shareSheet.ts +55 -0
- package/src/utils/subscriptionUpgrade.ts +183 -0
- package/src/valueUtils.ts +108 -0
- package/src/xFlowTags.ts +463 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,680 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions matching the web PaywallComponent structure
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type ComponentType =
|
|
6
|
+
| 'text'
|
|
7
|
+
| 'image'
|
|
8
|
+
| 'button'
|
|
9
|
+
| 'stack'
|
|
10
|
+
| 'feature-list'
|
|
11
|
+
| 'price'
|
|
12
|
+
| 'badge'
|
|
13
|
+
| 'divider'
|
|
14
|
+
| 'spacer'
|
|
15
|
+
| 'icon'
|
|
16
|
+
| 'video'
|
|
17
|
+
| 'carousel'
|
|
18
|
+
| 'tabs'
|
|
19
|
+
| 'footer'
|
|
20
|
+
| 'social-proof'
|
|
21
|
+
| 'progress-loader'
|
|
22
|
+
| 'chart-curve'
|
|
23
|
+
| 'single-choice-grid'
|
|
24
|
+
| 'multi-choice-grid'
|
|
25
|
+
// Interactive / composite components rendered by ComponentRenderer
|
|
26
|
+
| 'checkbox'
|
|
27
|
+
| 'toggle'
|
|
28
|
+
| 'segmented-picker'
|
|
29
|
+
| 'countdown'
|
|
30
|
+
| 'accordion'
|
|
31
|
+
| 'accordion-header'
|
|
32
|
+
| 'slider'
|
|
33
|
+
| 'navigation'
|
|
34
|
+
| 'confetti'
|
|
35
|
+
| 'delayed-x'
|
|
36
|
+
| 'haptic-feedback'
|
|
37
|
+
| 'shape'
|
|
38
|
+
| 'webp'
|
|
39
|
+
| 'gif'
|
|
40
|
+
| 'lottie'
|
|
41
|
+
| 'drawer-modal'
|
|
42
|
+
| 'timeline'
|
|
43
|
+
| 'text-input'
|
|
44
|
+
| 'star-rating-input'
|
|
45
|
+
| 'nps-scale'
|
|
46
|
+
| 'oauth-button'
|
|
47
|
+
| 'progress-stepper'
|
|
48
|
+
| 'share-code'
|
|
49
|
+
| 'share-buttons'
|
|
50
|
+
| 'vertical-products'
|
|
51
|
+
| 'horizontal-products'
|
|
52
|
+
| 'accolade-cps'
|
|
53
|
+
| 'sticker-composite';
|
|
54
|
+
|
|
55
|
+
/** Carousel transition animation types */
|
|
56
|
+
export type CarouselTransition = 'scroll' | 'fade' | 'slide' | 'push' | 'none';
|
|
57
|
+
|
|
58
|
+
export type NotificationChannel = 'push' | 'email' | 'sms' | 'live_activity';
|
|
59
|
+
|
|
60
|
+
export type LayoutType = 'fill' | 'fixed' | 'hug' | 'fit';
|
|
61
|
+
|
|
62
|
+
/** Size value as exported by web builder */
|
|
63
|
+
export interface SizeValue {
|
|
64
|
+
type: 'fill' | 'fixed' | 'fit' | 'hug';
|
|
65
|
+
value?: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface Size {
|
|
69
|
+
width: SizeValue | number | string;
|
|
70
|
+
height: SizeValue | number | string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface Position {
|
|
74
|
+
x: number;
|
|
75
|
+
y: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface Layout {
|
|
79
|
+
width?: LayoutType;
|
|
80
|
+
height?: LayoutType;
|
|
81
|
+
padding?: { top?: number; right?: number; bottom?: number; left?: number };
|
|
82
|
+
margin?: { top?: number; right?: number; bottom?: number; left?: number };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Gradient stop definition */
|
|
86
|
+
export interface GradientStop {
|
|
87
|
+
color: string;
|
|
88
|
+
position: number;
|
|
89
|
+
resolvedColor?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Gradient configuration */
|
|
93
|
+
export interface GradientConfig {
|
|
94
|
+
type: 'linear' | 'radial';
|
|
95
|
+
angle?: number;
|
|
96
|
+
stops: GradientStop[];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Image fill configuration */
|
|
100
|
+
export interface ImageFillConfig {
|
|
101
|
+
url: string;
|
|
102
|
+
fit?: 'fill' | 'fit' | 'stretch' | 'tile';
|
|
103
|
+
position?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Fill value from web builder (source of truth) */
|
|
107
|
+
export type FillValue = string | {
|
|
108
|
+
type: 'color' | 'gradient' | 'image';
|
|
109
|
+
color?: string;
|
|
110
|
+
/** Pre-resolved hex color from the web exporter */
|
|
111
|
+
resolvedColor?: string;
|
|
112
|
+
opacity?: number;
|
|
113
|
+
gradient?: GradientConfig;
|
|
114
|
+
image?: ImageFillConfig;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/** Background color object (SDK-compatible format from web exporter) */
|
|
118
|
+
export interface BackgroundColorObject {
|
|
119
|
+
type: 'color' | 'gradient' | 'image';
|
|
120
|
+
color?: string;
|
|
121
|
+
resolvedColor?: string;
|
|
122
|
+
opacity?: number;
|
|
123
|
+
gradient?: GradientConfig;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Background color can be a string or complex object from web builder */
|
|
127
|
+
export type BackgroundColorValue = string | {
|
|
128
|
+
type: 'color' | 'gradient' | 'image';
|
|
129
|
+
color?: string;
|
|
130
|
+
opacity?: number;
|
|
131
|
+
resolvedColor?: string;
|
|
132
|
+
gradient?: {
|
|
133
|
+
type: 'linear' | 'radial';
|
|
134
|
+
angle?: number;
|
|
135
|
+
stops: Array<{ color: string; position: number; resolvedColor?: string }>;
|
|
136
|
+
};
|
|
137
|
+
imageUrl?: string;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export interface Appearance {
|
|
141
|
+
/** Original fill value from web builder (source of truth) */
|
|
142
|
+
fill?: FillValue;
|
|
143
|
+
|
|
144
|
+
/** Pre-resolved background color string for SDK compatibility */
|
|
145
|
+
backgroundColor?: BackgroundColorValue;
|
|
146
|
+
|
|
147
|
+
/** Structured background color object for gradients */
|
|
148
|
+
backgroundColorObj?: BackgroundColorObject;
|
|
149
|
+
|
|
150
|
+
borderColor?: string | { type: string; color?: string; resolvedColor?: string };
|
|
151
|
+
/** Pre-resolved hex border color from the web exporter */
|
|
152
|
+
borderColorResolved?: string;
|
|
153
|
+
borderWidth?: number;
|
|
154
|
+
borderRadius?: number; // Legacy field
|
|
155
|
+
cornerRadius?: number; // Web builder field (preferred)
|
|
156
|
+
opacity?: number;
|
|
157
|
+
shape?: 'rectangle' | 'pill' | 'circle';
|
|
158
|
+
|
|
159
|
+
// Phase 4: New JSON-first properties
|
|
160
|
+
transform?: Transform;
|
|
161
|
+
border?: Border;
|
|
162
|
+
shadow?: Shadow;
|
|
163
|
+
|
|
164
|
+
// Legacy border sides (backward compat)
|
|
165
|
+
borderBottom?: LegacyBorderSide;
|
|
166
|
+
borderTop?: LegacyBorderSide;
|
|
167
|
+
borderLeft?: LegacyBorderSide;
|
|
168
|
+
borderRight?: LegacyBorderSide;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Get effective background color from appearance
|
|
173
|
+
* Priority: fill.color → backgroundColorObj.resolvedColor → backgroundColor
|
|
174
|
+
*/
|
|
175
|
+
export function getEffectiveBackgroundColor(appearance: Appearance): string | undefined {
|
|
176
|
+
// Check fill first
|
|
177
|
+
if (appearance.fill) {
|
|
178
|
+
if (typeof appearance.fill === 'string') {
|
|
179
|
+
return appearance.fill;
|
|
180
|
+
}
|
|
181
|
+
if (appearance.fill.color) {
|
|
182
|
+
return appearance.fill.color;
|
|
183
|
+
}
|
|
184
|
+
if (appearance.fill.gradient?.stops?.[0]?.color) {
|
|
185
|
+
return appearance.fill.gradient.stops[0].color;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Check backgroundColorObj
|
|
190
|
+
if (appearance.backgroundColorObj?.resolvedColor) {
|
|
191
|
+
return appearance.backgroundColorObj.resolvedColor;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Fallback to backgroundColor
|
|
195
|
+
if (appearance.backgroundColor) {
|
|
196
|
+
if (typeof appearance.backgroundColor === 'string') {
|
|
197
|
+
return appearance.backgroundColor;
|
|
198
|
+
}
|
|
199
|
+
return appearance.backgroundColor.resolvedColor ?? appearance.backgroundColor.color;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return undefined;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Check if appearance has a gradient background
|
|
207
|
+
*/
|
|
208
|
+
export function hasGradientBackground(appearance: Appearance): boolean {
|
|
209
|
+
if (appearance.fill && typeof appearance.fill === 'object' && appearance.fill.type === 'gradient') {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
if (appearance.backgroundColorObj?.type === 'gradient') {
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
if (appearance.backgroundColor && typeof appearance.backgroundColor === 'object' && appearance.backgroundColor.type === 'gradient') {
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Get gradient config from appearance
|
|
223
|
+
*/
|
|
224
|
+
export function getGradientConfig(appearance: Appearance): GradientConfig | undefined {
|
|
225
|
+
if (appearance.fill && typeof appearance.fill === 'object' && appearance.fill.gradient) {
|
|
226
|
+
return appearance.fill.gradient;
|
|
227
|
+
}
|
|
228
|
+
if (appearance.backgroundColorObj?.gradient) {
|
|
229
|
+
return appearance.backgroundColorObj.gradient;
|
|
230
|
+
}
|
|
231
|
+
if (appearance.backgroundColor && typeof appearance.backgroundColor === 'object' && appearance.backgroundColor.gradient) {
|
|
232
|
+
return appearance.backgroundColor.gradient;
|
|
233
|
+
}
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// MARK: - Phase 4 JSON-First Model Types
|
|
238
|
+
|
|
239
|
+
/** Text color object for structured text styling */
|
|
240
|
+
export interface TextColorObject {
|
|
241
|
+
type: 'color' | 'gradient';
|
|
242
|
+
color?: string;
|
|
243
|
+
resolvedColor?: string;
|
|
244
|
+
gradient?: GradientConfig;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Typography configuration for text components */
|
|
248
|
+
export interface Typography {
|
|
249
|
+
fontFamily?: string;
|
|
250
|
+
fontSize?: number;
|
|
251
|
+
fontWeight?: number;
|
|
252
|
+
fontStyle?: 'normal' | 'italic';
|
|
253
|
+
lineHeight?: number;
|
|
254
|
+
letterSpacing?: number;
|
|
255
|
+
textAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
256
|
+
textDecoration?: 'none' | 'underline' | 'line-through';
|
|
257
|
+
textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';
|
|
258
|
+
color?: string;
|
|
259
|
+
resolvedColor?: string;
|
|
260
|
+
textColorObj?: TextColorObject;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** Transform configuration for component transformations */
|
|
264
|
+
export interface Transform {
|
|
265
|
+
rotation?: number;
|
|
266
|
+
rotationX?: number;
|
|
267
|
+
rotationY?: number;
|
|
268
|
+
scaleX?: number;
|
|
269
|
+
scaleY?: number;
|
|
270
|
+
translateX?: number;
|
|
271
|
+
translateY?: number;
|
|
272
|
+
skewX?: number;
|
|
273
|
+
skewY?: number;
|
|
274
|
+
anchorX?: number;
|
|
275
|
+
anchorY?: number;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** Border side configuration */
|
|
279
|
+
export interface BorderSide {
|
|
280
|
+
width?: number;
|
|
281
|
+
color?: string;
|
|
282
|
+
resolvedColor?: string;
|
|
283
|
+
style?: 'solid' | 'dashed' | 'dotted' | 'none';
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** Border radius configuration */
|
|
287
|
+
export interface BorderRadius {
|
|
288
|
+
topLeft?: number;
|
|
289
|
+
topRight?: number;
|
|
290
|
+
bottomLeft?: number;
|
|
291
|
+
bottomRight?: number;
|
|
292
|
+
uniform?: number;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** Border configuration */
|
|
296
|
+
export interface Border {
|
|
297
|
+
width?: number;
|
|
298
|
+
color?: string;
|
|
299
|
+
resolvedColor?: string;
|
|
300
|
+
style?: 'solid' | 'dashed' | 'dotted' | 'none';
|
|
301
|
+
top?: BorderSide;
|
|
302
|
+
right?: BorderSide;
|
|
303
|
+
bottom?: BorderSide;
|
|
304
|
+
left?: BorderSide;
|
|
305
|
+
radius?: BorderRadius;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/** Shadow configuration */
|
|
309
|
+
export interface Shadow {
|
|
310
|
+
offsetX?: number;
|
|
311
|
+
offsetY?: number;
|
|
312
|
+
/** Legacy/web-builder aliases for offsetX/offsetY */
|
|
313
|
+
x?: number;
|
|
314
|
+
y?: number;
|
|
315
|
+
blur?: number;
|
|
316
|
+
spread?: number;
|
|
317
|
+
color?: string;
|
|
318
|
+
resolvedColor?: string;
|
|
319
|
+
opacity?: number;
|
|
320
|
+
inset?: boolean;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/** Legacy border side for appearance (backward compat) */
|
|
324
|
+
export interface LegacyBorderSide {
|
|
325
|
+
color?: string;
|
|
326
|
+
width?: number;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** Border configuration from web builder (root-level on component) */
|
|
330
|
+
export interface BorderConfig {
|
|
331
|
+
color?: string;
|
|
332
|
+
/** Pre-resolved hex border color from the web exporter */
|
|
333
|
+
resolvedColor?: string;
|
|
334
|
+
width?: number;
|
|
335
|
+
style?: 'solid' | 'dashed' | 'dotted';
|
|
336
|
+
radius?: BorderRadius;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Helper functions for Phase 4 types
|
|
340
|
+
|
|
341
|
+
/** Get effective typography color */
|
|
342
|
+
export function getEffectiveTypographyColor(typography: Typography): string | undefined {
|
|
343
|
+
return typography.resolvedColor ?? typography.textColorObj?.resolvedColor ?? typography.color;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/** Check if transform has any transformation applied */
|
|
347
|
+
export function hasTransform(transform: Transform): boolean {
|
|
348
|
+
return transform.rotation != null ||
|
|
349
|
+
transform.rotationX != null ||
|
|
350
|
+
transform.rotationY != null ||
|
|
351
|
+
transform.scaleX != null ||
|
|
352
|
+
transform.scaleY != null ||
|
|
353
|
+
transform.translateX != null ||
|
|
354
|
+
transform.translateY != null ||
|
|
355
|
+
transform.skewX != null ||
|
|
356
|
+
transform.skewY != null;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/** Get effective border color */
|
|
360
|
+
export function getEffectiveBorderColor(border: Border): string | undefined {
|
|
361
|
+
return border.resolvedColor ?? border.color;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/** Get effective shadow color */
|
|
365
|
+
export function getEffectiveShadowColor(shadow: Shadow): string | undefined {
|
|
366
|
+
return shadow.resolvedColor ?? shadow.color;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export interface ContainerLayout {
|
|
370
|
+
type?: 'row' | 'column' | 'grid' | 'wrap' | 'absolute';
|
|
371
|
+
axis?: 'horizontal' | 'vertical' | 'layered';
|
|
372
|
+
gap?: { value: number; unit: string } | number;
|
|
373
|
+
horizontalAlignment?: 'start' | 'center' | 'end' | 'stretch' | 'space-between';
|
|
374
|
+
verticalAlignment?: 'start' | 'center' | 'end' | 'stretch';
|
|
375
|
+
distribution?: string;
|
|
376
|
+
overflow?: string;
|
|
377
|
+
columns?: number;
|
|
378
|
+
rows?: number;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export interface PaywallComponent {
|
|
382
|
+
id: string;
|
|
383
|
+
type: ComponentType;
|
|
384
|
+
name: string;
|
|
385
|
+
|
|
386
|
+
// Component hierarchy (Phase 1)
|
|
387
|
+
componentLevel?: 'primitive' | 'composite' | 'custom';
|
|
388
|
+
isSnippet?: boolean;
|
|
389
|
+
shareStatus?: 'private' | 'public';
|
|
390
|
+
createdBy?: string;
|
|
391
|
+
snippetCategory?: string;
|
|
392
|
+
|
|
393
|
+
// Standard positioning
|
|
394
|
+
position: Position;
|
|
395
|
+
size: Size;
|
|
396
|
+
layout: Layout;
|
|
397
|
+
appearance: Appearance;
|
|
398
|
+
properties: Record<string, any>;
|
|
399
|
+
children?: PaywallComponent[];
|
|
400
|
+
visible?: boolean;
|
|
401
|
+
locked?: boolean;
|
|
402
|
+
|
|
403
|
+
// Root-level border (web builder format - migrated to appearance)
|
|
404
|
+
border?: BorderConfig;
|
|
405
|
+
|
|
406
|
+
// Free positioning support
|
|
407
|
+
absolutePosition?: {
|
|
408
|
+
x: number;
|
|
409
|
+
y: number;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
// Z-index for layering
|
|
413
|
+
zIndex?: number;
|
|
414
|
+
|
|
415
|
+
// Composite type preservation (for stack-based composites)
|
|
416
|
+
compositeType?: string;
|
|
417
|
+
|
|
418
|
+
// Container layout for stack rendering
|
|
419
|
+
containerLayout?: ContainerLayout;
|
|
420
|
+
|
|
421
|
+
// Role identifier
|
|
422
|
+
role?: string;
|
|
423
|
+
|
|
424
|
+
// ============= DUAL PROPERTIES SYSTEM =============
|
|
425
|
+
// Selected state properties for selectable components (product cards, segments, tabs, etc.)
|
|
426
|
+
// When a component is in "selected" state, SDK uses these over default properties
|
|
427
|
+
|
|
428
|
+
/** Selected state properties - mirrors the `properties` map structure */
|
|
429
|
+
selectedProperties?: Record<string, any>;
|
|
430
|
+
|
|
431
|
+
/** Selected state appearance - full appearance for selected state */
|
|
432
|
+
selectedAppearance?: Appearance;
|
|
433
|
+
|
|
434
|
+
/** Selected state layout - padding/margin for selected state */
|
|
435
|
+
selectedLayout?: Layout;
|
|
436
|
+
|
|
437
|
+
/** Selected state size - width/height for selected state */
|
|
438
|
+
selectedSize?: Size;
|
|
439
|
+
|
|
440
|
+
/** Selected state container layout - axis/gap/alignment for selected state */
|
|
441
|
+
selectedContainerLayout?: ContainerLayout;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export interface Product {
|
|
445
|
+
id: string;
|
|
446
|
+
product_identifier: string;
|
|
447
|
+
display_name: string;
|
|
448
|
+
description?: string;
|
|
449
|
+
type: string;
|
|
450
|
+
platform: string;
|
|
451
|
+
price_usd?: number;
|
|
452
|
+
currency?: string;
|
|
453
|
+
intro_price_usd?: number;
|
|
454
|
+
intro_duration?: number;
|
|
455
|
+
intro_period?: string;
|
|
456
|
+
intro_cycles?: number;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export interface OfferingPackage {
|
|
460
|
+
id: string;
|
|
461
|
+
package_identifier: string;
|
|
462
|
+
package_type?: string;
|
|
463
|
+
position: number;
|
|
464
|
+
metadata?: Record<string, any>;
|
|
465
|
+
product_id?: string;
|
|
466
|
+
product?: Product;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export type DisplayStyle =
|
|
470
|
+
| 'full_screen'
|
|
471
|
+
| 'sheet'
|
|
472
|
+
| 'push_navigation'
|
|
473
|
+
| 'no_transition'
|
|
474
|
+
| 'side_drawer'
|
|
475
|
+
| 'overlay_popup';
|
|
476
|
+
|
|
477
|
+
export type AccessControl = 'restricted' | 'unrestricted';
|
|
478
|
+
|
|
479
|
+
// Screen-level layout settings (part of theme)
|
|
480
|
+
export interface ScreenLayout {
|
|
481
|
+
alignment: 'start' | 'center' | 'end';
|
|
482
|
+
gap: number;
|
|
483
|
+
padding: {
|
|
484
|
+
top: number;
|
|
485
|
+
bottom: number;
|
|
486
|
+
left: number;
|
|
487
|
+
right: number;
|
|
488
|
+
};
|
|
489
|
+
safeAreaInsets?: boolean;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export interface ControllerMapping {
|
|
493
|
+
upButton?: string;
|
|
494
|
+
downButton?: string;
|
|
495
|
+
selectButton?: string;
|
|
496
|
+
dismissButton?: string;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export interface MobileDisplayConfig {
|
|
500
|
+
displayStyle: DisplayStyle;
|
|
501
|
+
allowScrolling: boolean;
|
|
502
|
+
gameControllerEnabled: boolean;
|
|
503
|
+
controllerMapping?: ControllerMapping;
|
|
504
|
+
interceptBackButton: boolean;
|
|
505
|
+
accessControl: AccessControl;
|
|
506
|
+
requirements?: {
|
|
507
|
+
minIosVersion?: string;
|
|
508
|
+
minAndroidVersion?: string;
|
|
509
|
+
requiredFeatures?: string[];
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
export interface EmailPayload {
|
|
514
|
+
to: string;
|
|
515
|
+
subject: string;
|
|
516
|
+
html_body: string;
|
|
517
|
+
text_body?: string;
|
|
518
|
+
from?: string;
|
|
519
|
+
reply_to?: string;
|
|
520
|
+
notification_id?: string;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export interface SMSPayload {
|
|
524
|
+
to: string;
|
|
525
|
+
body: string;
|
|
526
|
+
from?: string;
|
|
527
|
+
notification_id?: string;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
export interface LiveActivityPayload {
|
|
531
|
+
activity_token: string;
|
|
532
|
+
event: 'start' | 'update' | 'end';
|
|
533
|
+
content_state: Record<string, any>;
|
|
534
|
+
stale_date?: Date;
|
|
535
|
+
dismissal_date?: Date;
|
|
536
|
+
notification_id?: string;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Canonical theme colors — 26 fields matching paywall-renderer ThemeColors.
|
|
541
|
+
* All values are pre-resolved hex strings from the exporter.
|
|
542
|
+
*/
|
|
543
|
+
export interface ThemeColors {
|
|
544
|
+
primary: string;
|
|
545
|
+
primaryForeground: string;
|
|
546
|
+
secondary: string;
|
|
547
|
+
secondaryForeground: string;
|
|
548
|
+
background: string;
|
|
549
|
+
foreground: string;
|
|
550
|
+
card: string;
|
|
551
|
+
cardForeground: string;
|
|
552
|
+
muted: string;
|
|
553
|
+
mutedForeground: string;
|
|
554
|
+
border: string;
|
|
555
|
+
accent: string;
|
|
556
|
+
accentForeground: string;
|
|
557
|
+
destructive: string;
|
|
558
|
+
destructiveForeground: string;
|
|
559
|
+
input: string;
|
|
560
|
+
ring: string;
|
|
561
|
+
popover: string;
|
|
562
|
+
popoverForeground: string;
|
|
563
|
+
success: string;
|
|
564
|
+
successForeground: string;
|
|
565
|
+
warning: string;
|
|
566
|
+
warningForeground: string;
|
|
567
|
+
info: string;
|
|
568
|
+
infoForeground: string;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/** Theme configuration with resolved colors */
|
|
572
|
+
export interface ThemeConfig {
|
|
573
|
+
/** Canonical typed colors (preferred) */
|
|
574
|
+
colors?: Partial<ThemeColors>;
|
|
575
|
+
/** Legacy color fields — mapped to canonical names by normalizeThemeColors() */
|
|
576
|
+
primaryColor?: string;
|
|
577
|
+
secondaryColor?: string;
|
|
578
|
+
backgroundColor?: string;
|
|
579
|
+
textColor?: string;
|
|
580
|
+
cardColor?: string;
|
|
581
|
+
mutedColor?: string;
|
|
582
|
+
borderColor?: string;
|
|
583
|
+
accentColor?: string;
|
|
584
|
+
themingMode?: 'full' | 'component-priority' | 'disabled';
|
|
585
|
+
resolvedColors?: Record<string, string>;
|
|
586
|
+
fonts?: Record<string, any>;
|
|
587
|
+
screenLayout?: ScreenLayout;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/** Default dark theme colors */
|
|
591
|
+
const DARK_DEFAULTS: ThemeColors = {
|
|
592
|
+
primary: '#3B82F6', primaryForeground: '#FFFFFF',
|
|
593
|
+
secondary: '#22C55E', secondaryForeground: '#FFFFFF',
|
|
594
|
+
background: '#141421', foreground: '#FAFAFA',
|
|
595
|
+
card: '#1E1E35', cardForeground: '#FAFAFA',
|
|
596
|
+
muted: '#1E1E35', mutedForeground: '#8B8BA3',
|
|
597
|
+
border: '#2A2A45',
|
|
598
|
+
accent: '#8B5CF6', accentForeground: '#FFFFFF',
|
|
599
|
+
destructive: '#EF4444', destructiveForeground: '#FFFFFF',
|
|
600
|
+
input: '#2A2A45', ring: '#3B82F6',
|
|
601
|
+
popover: '#1E1E35', popoverForeground: '#FAFAFA',
|
|
602
|
+
success: '#22C55E', successForeground: '#FFFFFF',
|
|
603
|
+
warning: '#F59E0B', warningForeground: '#FFFFFF',
|
|
604
|
+
info: '#3B82F6', infoForeground: '#FFFFFF',
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Normalize any theme config (legacy or canonical) into the 26-field ThemeColors.
|
|
609
|
+
* Maps legacy field names (primaryColor, backgroundColor, etc.) to canonical names.
|
|
610
|
+
*/
|
|
611
|
+
export function normalizeThemeColors(config: ThemeConfig | undefined): ThemeColors {
|
|
612
|
+
if (!config) return { ...DARK_DEFAULTS };
|
|
613
|
+
|
|
614
|
+
const colors = config.colors ?? {};
|
|
615
|
+
const resolved = config.resolvedColors ?? {};
|
|
616
|
+
|
|
617
|
+
return {
|
|
618
|
+
primary: colors.primary ?? resolved['primary'] ?? config.primaryColor ?? DARK_DEFAULTS.primary,
|
|
619
|
+
primaryForeground: colors.primaryForeground ?? resolved['primary-foreground'] ?? DARK_DEFAULTS.primaryForeground,
|
|
620
|
+
secondary: colors.secondary ?? resolved['secondary'] ?? config.secondaryColor ?? DARK_DEFAULTS.secondary,
|
|
621
|
+
secondaryForeground: colors.secondaryForeground ?? resolved['secondary-foreground'] ?? DARK_DEFAULTS.secondaryForeground,
|
|
622
|
+
background: colors.background ?? resolved['background'] ?? config.backgroundColor ?? DARK_DEFAULTS.background,
|
|
623
|
+
foreground: colors.foreground ?? resolved['foreground'] ?? config.textColor ?? DARK_DEFAULTS.foreground,
|
|
624
|
+
card: colors.card ?? resolved['card'] ?? config.cardColor ?? DARK_DEFAULTS.card,
|
|
625
|
+
cardForeground: colors.cardForeground ?? resolved['card-foreground'] ?? DARK_DEFAULTS.cardForeground,
|
|
626
|
+
muted: colors.muted ?? resolved['muted'] ?? config.mutedColor ?? DARK_DEFAULTS.muted,
|
|
627
|
+
mutedForeground: colors.mutedForeground ?? resolved['muted-foreground'] ?? DARK_DEFAULTS.mutedForeground,
|
|
628
|
+
border: colors.border ?? resolved['border'] ?? config.borderColor ?? DARK_DEFAULTS.border,
|
|
629
|
+
accent: colors.accent ?? resolved['accent'] ?? config.accentColor ?? DARK_DEFAULTS.accent,
|
|
630
|
+
accentForeground: colors.accentForeground ?? resolved['accent-foreground'] ?? DARK_DEFAULTS.accentForeground,
|
|
631
|
+
destructive: colors.destructive ?? resolved['destructive'] ?? DARK_DEFAULTS.destructive,
|
|
632
|
+
destructiveForeground: colors.destructiveForeground ?? resolved['destructive-foreground'] ?? DARK_DEFAULTS.destructiveForeground,
|
|
633
|
+
input: colors.input ?? resolved['input'] ?? DARK_DEFAULTS.input,
|
|
634
|
+
ring: colors.ring ?? resolved['ring'] ?? DARK_DEFAULTS.ring,
|
|
635
|
+
popover: colors.popover ?? resolved['popover'] ?? DARK_DEFAULTS.popover,
|
|
636
|
+
popoverForeground: colors.popoverForeground ?? resolved['popover-foreground'] ?? DARK_DEFAULTS.popoverForeground,
|
|
637
|
+
success: colors.success ?? resolved['success'] ?? DARK_DEFAULTS.success,
|
|
638
|
+
successForeground: colors.successForeground ?? resolved['success-foreground'] ?? DARK_DEFAULTS.successForeground,
|
|
639
|
+
warning: colors.warning ?? resolved['warning'] ?? DARK_DEFAULTS.warning,
|
|
640
|
+
warningForeground: colors.warningForeground ?? resolved['warning-foreground'] ?? DARK_DEFAULTS.warningForeground,
|
|
641
|
+
info: colors.info ?? resolved['info'] ?? DARK_DEFAULTS.info,
|
|
642
|
+
infoForeground: colors.infoForeground ?? resolved['info-foreground'] ?? DARK_DEFAULTS.infoForeground,
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
export type OfferDisplayMode = 'automatic' | 'always' | 'never';
|
|
647
|
+
|
|
648
|
+
export interface AppStoreIntegration {
|
|
649
|
+
showIntroPrice: OfferDisplayMode;
|
|
650
|
+
showFreeTrial: OfferDisplayMode;
|
|
651
|
+
autoSelectBestOffer?: boolean;
|
|
652
|
+
promoOfferIdentifier?: string;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
export interface PaywallConfiguration {
|
|
656
|
+
components: PaywallComponent[];
|
|
657
|
+
theme?: ThemeConfig;
|
|
658
|
+
variables?: Record<string, string>;
|
|
659
|
+
localizations?: Record<string, Record<string, string>>;
|
|
660
|
+
/** Per-variable locale overrides: { variableName: { locale: value } } */
|
|
661
|
+
variableLocalizations?: Record<string, Record<string, string>>;
|
|
662
|
+
offeringId?: string;
|
|
663
|
+
|
|
664
|
+
/** Base locale for translations (source language), defaults to 'en' */
|
|
665
|
+
baseLocale?: string;
|
|
666
|
+
|
|
667
|
+
// Mobile display settings
|
|
668
|
+
mobileDisplay?: MobileDisplayConfig;
|
|
669
|
+
|
|
670
|
+
// App Store Integration
|
|
671
|
+
appStoreIntegration?: AppStoreIntegration;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Resolved store packages/products bound to this paywall, when available.
|
|
675
|
+
* Shape is store-dependent (StoreKit/Play) and accessed structurally by
|
|
676
|
+
* product components, so it is typed loosely here.
|
|
677
|
+
*/
|
|
678
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
679
|
+
packages?: any[];
|
|
680
|
+
}
|