@developer_tribe/react-builder 1.2.15 → 1.2.18
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/dist/build-components/BackgroundImage/BackgroundImageProps.generated.d.ts +1 -1
- package/dist/build-components/Button/ButtonProps.generated.d.ts +1 -1
- package/dist/build-components/Carousel/CarouselProps.generated.d.ts +1 -1
- package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +1 -1
- package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +1 -1
- package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +1 -1
- package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +1 -1
- package/dist/build-components/Image/ImageProps.generated.d.ts +1 -1
- package/dist/build-components/Main/MainProps.generated.d.ts +1 -1
- package/dist/build-components/Onboard/OnboardProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallCloseButton/PaywallCloseButton.d.ts +1 -1
- package/dist/build-components/PaywallOptions/PaywallOptionsProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallProvider/PaywallContext.d.ts +2 -1
- package/dist/build-components/PaywallProvider/PaywallProviderProps.generated.d.ts +2 -1
- package/dist/build-components/RadioButton/RadioButtonProps.generated.d.ts +1 -1
- package/dist/build-components/Text/TextProps.generated.d.ts +1 -1
- package/dist/build-components/View/ViewProps.generated.d.ts +0 -2
- package/dist/build-components/patterns.generated.d.ts +49 -41
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.web.cjs.js +3 -3
- package/dist/index.web.cjs.js.map +1 -1
- package/dist/index.web.esm.js +3 -3
- package/dist/index.web.esm.js.map +1 -1
- package/dist/mockOS/backHandler.d.ts +4 -0
- package/dist/paywall/hooks/index.d.ts +3 -3
- package/dist/paywall/hooks/useChangeDelayByPaywall.d.ts +4 -0
- package/dist/paywall/hooks/useHandleGoBack.d.ts +1 -0
- package/dist/paywall/hooks/useMockOSBackHandler.d.ts +1 -0
- package/package.json +4 -1
- package/src/RenderPage.tsx +0 -24
- package/src/assets/meta.json +1 -1
- package/src/assets/samples/paywall-2.json +3 -2
- package/src/build-components/BackgroundImage/BackgroundImageProps.generated.ts +1 -1
- package/src/build-components/Button/ButtonProps.generated.ts +1 -1
- package/src/build-components/Carousel/CarouselProps.generated.ts +1 -1
- package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +1 -1
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +1 -1
- package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +1 -1
- package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +1 -1
- package/src/build-components/CountDown/CountDown.tsx +9 -1
- package/src/build-components/Image/ImageProps.generated.ts +1 -1
- package/src/build-components/Main/MainProps.generated.ts +1 -1
- package/src/build-components/Onboard/OnboardProps.generated.ts +1 -1
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +1 -1
- package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +1 -1
- package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +1 -1
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +1 -1
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +1 -1
- package/src/build-components/PaywallCloseButton/PaywallCloseButton.tsx +5 -1
- package/src/build-components/PaywallCloseButton/pattern.json +3 -0
- package/src/build-components/PaywallCounter/PaywallCounter.tsx +2 -5
- package/src/build-components/PaywallOptions/PaywallOptions.tsx +2 -2
- package/src/build-components/PaywallOptions/PaywallOptionsProps.generated.ts +1 -1
- package/src/build-components/PaywallProvider/PaywallContext.ts +4 -2
- package/src/build-components/PaywallProvider/PaywallProvider.tsx +45 -7
- package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +2 -1
- package/src/build-components/PaywallProvider/pattern.json +11 -1
- package/src/build-components/RadioButton/RadioButtonProps.generated.ts +1 -1
- package/src/build-components/Text/TextProps.generated.ts +1 -1
- package/src/build-components/View/ViewProps.generated.ts +0 -2
- package/src/build-components/View/pattern.json +0 -2
- package/src/build-components/patterns.generated.ts +50 -41
- package/src/components/BuilderProvider.tsx +0 -9
- package/src/components/DeviceNavigationBar.tsx +5 -0
- package/src/index.ts +1 -3
- package/src/mockOS/backHandler.ts +35 -0
- package/src/mockOS/managers/navigationManager.ts +0 -3
- package/src/pages/ProjectMigrationPage.tsx +3 -1
- package/src/paywall/hooks/index.ts +3 -3
- package/src/paywall/hooks/useChangeDelayByPaywall.ts +25 -0
- package/src/paywall/hooks/useHandleGoBack.ts +60 -0
- package/src/paywall/hooks/useMockOSBackHandler.ts +9 -0
- package/dist/paywall/hooks/useCarouselOptionsSeperator.d.ts +0 -6
- package/dist/paywall/hooks/useCloseStatusPaywall.d.ts +0 -4
- package/dist/paywall/hooks/usePaywallCounter.d.ts +0 -4
- package/src/paywall/hooks/useCarouselOptionsSeperator.ts +0 -8
- package/src/paywall/hooks/useCloseStatusPaywall.ts +0 -6
- package/src/paywall/hooks/usePaywallCounter.ts +0 -6
|
@@ -64,9 +64,9 @@ export interface TextPropsGenerated {
|
|
|
64
64
|
child: string;
|
|
65
65
|
attributes: {
|
|
66
66
|
style?: TextStyleGenerated;
|
|
67
|
+
scrollable?: boolean;
|
|
67
68
|
title?: string;
|
|
68
69
|
description?: string;
|
|
69
|
-
scrollable?: boolean;
|
|
70
70
|
adjustsFontSizeToFit?: boolean;
|
|
71
71
|
showEllipsis?: boolean;
|
|
72
72
|
};
|
|
@@ -466,8 +466,6 @@ export const patterns = [
|
|
|
466
466
|
type: 'BackgroundImage',
|
|
467
467
|
children: 'never',
|
|
468
468
|
attributes: {
|
|
469
|
-
title: 'title',
|
|
470
|
-
description: 'description',
|
|
471
469
|
scrollable: 'boolean',
|
|
472
470
|
style: {
|
|
473
471
|
flexDirection: ['row', 'column'],
|
|
@@ -517,6 +515,8 @@ export const patterns = [
|
|
|
517
515
|
right: 'size',
|
|
518
516
|
zIndex: 'number',
|
|
519
517
|
},
|
|
518
|
+
title: 'title',
|
|
519
|
+
description: 'description',
|
|
520
520
|
src: 'string',
|
|
521
521
|
resizeMode: ['cover', 'contain', 'stretch', 'center'],
|
|
522
522
|
},
|
|
@@ -871,8 +871,6 @@ export const patterns = [
|
|
|
871
871
|
type: 'Button',
|
|
872
872
|
children: 'string',
|
|
873
873
|
attributes: {
|
|
874
|
-
title: 'title',
|
|
875
|
-
description: 'description',
|
|
876
874
|
scrollable: 'boolean',
|
|
877
875
|
style: {
|
|
878
876
|
flexDirection: ['row', 'column'],
|
|
@@ -937,6 +935,8 @@ export const patterns = [
|
|
|
937
935
|
'900',
|
|
938
936
|
],
|
|
939
937
|
},
|
|
938
|
+
title: 'title',
|
|
939
|
+
description: 'description',
|
|
940
940
|
},
|
|
941
941
|
},
|
|
942
942
|
meta: {
|
|
@@ -1281,8 +1281,6 @@ export const patterns = [
|
|
|
1281
1281
|
type: 'Carousel',
|
|
1282
1282
|
children: 'node',
|
|
1283
1283
|
attributes: {
|
|
1284
|
-
title: 'title',
|
|
1285
|
-
description: 'description',
|
|
1286
1284
|
scrollable: 'boolean',
|
|
1287
1285
|
style: {
|
|
1288
1286
|
flexDirection: ['row', 'column'],
|
|
@@ -1332,6 +1330,8 @@ export const patterns = [
|
|
|
1332
1330
|
right: 'size',
|
|
1333
1331
|
zIndex: 'number',
|
|
1334
1332
|
},
|
|
1333
|
+
title: 'title',
|
|
1334
|
+
description: 'description',
|
|
1335
1335
|
loop: 'boolean',
|
|
1336
1336
|
dragFree: 'boolean',
|
|
1337
1337
|
align: ['start', 'center', 'end'],
|
|
@@ -1654,8 +1654,6 @@ export const patterns = [
|
|
|
1654
1654
|
type: 'CarouselButtons',
|
|
1655
1655
|
children: 'never',
|
|
1656
1656
|
attributes: {
|
|
1657
|
-
title: 'title',
|
|
1658
|
-
description: 'description',
|
|
1659
1657
|
scrollable: 'boolean',
|
|
1660
1658
|
style: {
|
|
1661
1659
|
flexDirection: ['row', 'column'],
|
|
@@ -1705,6 +1703,8 @@ export const patterns = [
|
|
|
1705
1703
|
right: 'size',
|
|
1706
1704
|
zIndex: 'number',
|
|
1707
1705
|
},
|
|
1706
|
+
title: 'title',
|
|
1707
|
+
description: 'description',
|
|
1708
1708
|
buttonType: ['previous_button', 'next_button', 'skip_button'],
|
|
1709
1709
|
skipNumber: 'number',
|
|
1710
1710
|
},
|
|
@@ -2040,8 +2040,6 @@ export const patterns = [
|
|
|
2040
2040
|
type: 'CarouselDots',
|
|
2041
2041
|
children: 'never',
|
|
2042
2042
|
attributes: {
|
|
2043
|
-
title: 'title',
|
|
2044
|
-
description: 'description',
|
|
2045
2043
|
scrollable: 'boolean',
|
|
2046
2044
|
style: {
|
|
2047
2045
|
flexDirection: ['row', 'column'],
|
|
@@ -2091,6 +2089,8 @@ export const patterns = [
|
|
|
2091
2089
|
right: 'size',
|
|
2092
2090
|
zIndex: 'number',
|
|
2093
2091
|
},
|
|
2092
|
+
title: 'title',
|
|
2093
|
+
description: 'description',
|
|
2094
2094
|
dotType: [
|
|
2095
2095
|
'expanding_dot',
|
|
2096
2096
|
'normal_dot',
|
|
@@ -2425,8 +2425,6 @@ export const patterns = [
|
|
|
2425
2425
|
type: 'CarouselItem',
|
|
2426
2426
|
children: 'node',
|
|
2427
2427
|
attributes: {
|
|
2428
|
-
title: 'title',
|
|
2429
|
-
description: 'description',
|
|
2430
2428
|
scrollable: 'boolean',
|
|
2431
2429
|
style: {
|
|
2432
2430
|
flexDirection: ['row', 'column'],
|
|
@@ -2476,6 +2474,8 @@ export const patterns = [
|
|
|
2476
2474
|
right: 'size',
|
|
2477
2475
|
zIndex: 'number',
|
|
2478
2476
|
},
|
|
2477
|
+
title: 'title',
|
|
2478
|
+
description: 'description',
|
|
2479
2479
|
},
|
|
2480
2480
|
},
|
|
2481
2481
|
meta: {
|
|
@@ -2795,8 +2795,6 @@ export const patterns = [
|
|
|
2795
2795
|
type: 'CarouselProvider',
|
|
2796
2796
|
children: 'node',
|
|
2797
2797
|
attributes: {
|
|
2798
|
-
title: 'title',
|
|
2799
|
-
description: 'description',
|
|
2800
2798
|
scrollable: 'boolean',
|
|
2801
2799
|
style: {
|
|
2802
2800
|
flexDirection: ['row', 'column'],
|
|
@@ -2846,6 +2844,8 @@ export const patterns = [
|
|
|
2846
2844
|
right: 'size',
|
|
2847
2845
|
zIndex: 'number',
|
|
2848
2846
|
},
|
|
2847
|
+
title: 'title',
|
|
2848
|
+
description: 'description',
|
|
2849
2849
|
},
|
|
2850
2850
|
},
|
|
2851
2851
|
meta: {
|
|
@@ -4044,8 +4044,6 @@ export const patterns = [
|
|
|
4044
4044
|
type: 'Image',
|
|
4045
4045
|
children: 'never',
|
|
4046
4046
|
attributes: {
|
|
4047
|
-
title: 'title',
|
|
4048
|
-
description: 'description',
|
|
4049
4047
|
scrollable: 'boolean',
|
|
4050
4048
|
style: {
|
|
4051
4049
|
flexDirection: ['row', 'column'],
|
|
@@ -4095,6 +4093,8 @@ export const patterns = [
|
|
|
4095
4093
|
right: 'size',
|
|
4096
4094
|
zIndex: 'number',
|
|
4097
4095
|
},
|
|
4096
|
+
title: 'title',
|
|
4097
|
+
description: 'description',
|
|
4098
4098
|
src: 'string',
|
|
4099
4099
|
width: 'size',
|
|
4100
4100
|
height: 'size',
|
|
@@ -4430,8 +4430,6 @@ export const patterns = [
|
|
|
4430
4430
|
type: 'Main',
|
|
4431
4431
|
children: 'node',
|
|
4432
4432
|
attributes: {
|
|
4433
|
-
title: 'title',
|
|
4434
|
-
description: 'description',
|
|
4435
4433
|
scrollable: 'boolean',
|
|
4436
4434
|
style: {
|
|
4437
4435
|
flexDirection: ['row', 'column'],
|
|
@@ -4481,6 +4479,8 @@ export const patterns = [
|
|
|
4481
4479
|
right: 'size',
|
|
4482
4480
|
zIndex: 'number',
|
|
4483
4481
|
},
|
|
4482
|
+
title: 'title',
|
|
4483
|
+
description: 'description',
|
|
4484
4484
|
useSafeAreaView: 'boolean',
|
|
4485
4485
|
},
|
|
4486
4486
|
},
|
|
@@ -4815,8 +4815,6 @@ export const patterns = [
|
|
|
4815
4815
|
type: 'Onboard',
|
|
4816
4816
|
children: 'node',
|
|
4817
4817
|
attributes: {
|
|
4818
|
-
title: 'title',
|
|
4819
|
-
description: 'description',
|
|
4820
4818
|
scrollable: 'boolean',
|
|
4821
4819
|
style: {
|
|
4822
4820
|
flexDirection: ['row', 'column'],
|
|
@@ -4866,6 +4864,8 @@ export const patterns = [
|
|
|
4866
4864
|
right: 'size',
|
|
4867
4865
|
zIndex: 'number',
|
|
4868
4866
|
},
|
|
4867
|
+
title: 'title',
|
|
4868
|
+
description: 'description',
|
|
4869
4869
|
},
|
|
4870
4870
|
},
|
|
4871
4871
|
meta: {
|
|
@@ -5186,8 +5186,6 @@ export const patterns = [
|
|
|
5186
5186
|
type: 'OnboardButton',
|
|
5187
5187
|
children: 'never',
|
|
5188
5188
|
attributes: {
|
|
5189
|
-
title: 'title',
|
|
5190
|
-
description: 'description',
|
|
5191
5189
|
scrollable: 'boolean',
|
|
5192
5190
|
style: {
|
|
5193
5191
|
flexDirection: ['row', 'column'],
|
|
@@ -5237,6 +5235,8 @@ export const patterns = [
|
|
|
5237
5235
|
right: 'size',
|
|
5238
5236
|
zIndex: 'number',
|
|
5239
5237
|
},
|
|
5238
|
+
title: 'title',
|
|
5239
|
+
description: 'description',
|
|
5240
5240
|
labelKey: 'string',
|
|
5241
5241
|
button_text_color: 'color',
|
|
5242
5242
|
animation: [
|
|
@@ -5618,8 +5618,6 @@ export const patterns = [
|
|
|
5618
5618
|
type: 'OnboardButtons',
|
|
5619
5619
|
children: 'node',
|
|
5620
5620
|
attributes: {
|
|
5621
|
-
title: 'title',
|
|
5622
|
-
description: 'description',
|
|
5623
5621
|
scrollable: 'boolean',
|
|
5624
5622
|
style: {
|
|
5625
5623
|
flexDirection: ['row', 'column'],
|
|
@@ -5669,6 +5667,8 @@ export const patterns = [
|
|
|
5669
5667
|
right: 'size',
|
|
5670
5668
|
zIndex: 'number',
|
|
5671
5669
|
},
|
|
5670
|
+
title: 'title',
|
|
5671
|
+
description: 'description',
|
|
5672
5672
|
buttonType: ['previous_button', 'next_button', 'skip_button'],
|
|
5673
5673
|
skipNumber: 'number',
|
|
5674
5674
|
buttons_direction: ['row', 'column'],
|
|
@@ -6044,8 +6044,6 @@ export const patterns = [
|
|
|
6044
6044
|
type: 'OnboardDot',
|
|
6045
6045
|
children: 'never',
|
|
6046
6046
|
attributes: {
|
|
6047
|
-
title: 'title',
|
|
6048
|
-
description: 'description',
|
|
6049
6047
|
scrollable: 'boolean',
|
|
6050
6048
|
style: {
|
|
6051
6049
|
flexDirection: ['row', 'column'],
|
|
@@ -6095,6 +6093,8 @@ export const patterns = [
|
|
|
6095
6093
|
right: 'size',
|
|
6096
6094
|
zIndex: 'number',
|
|
6097
6095
|
},
|
|
6096
|
+
title: 'title',
|
|
6097
|
+
description: 'description',
|
|
6098
6098
|
dotType: [
|
|
6099
6099
|
'expanding_dot',
|
|
6100
6100
|
'normal_dot',
|
|
@@ -7348,8 +7348,6 @@ export const patterns = [
|
|
|
7348
7348
|
type: 'OnboardItem',
|
|
7349
7349
|
children: 'node',
|
|
7350
7350
|
attributes: {
|
|
7351
|
-
title: 'title',
|
|
7352
|
-
description: 'description',
|
|
7353
7351
|
scrollable: 'boolean',
|
|
7354
7352
|
style: {
|
|
7355
7353
|
flexDirection: ['row', 'column'],
|
|
@@ -7399,6 +7397,8 @@ export const patterns = [
|
|
|
7399
7397
|
right: 'size',
|
|
7400
7398
|
zIndex: 'number',
|
|
7401
7399
|
},
|
|
7400
|
+
title: 'title',
|
|
7401
|
+
description: 'description',
|
|
7402
7402
|
display: ['flex', 'block'],
|
|
7403
7403
|
gap: 'size',
|
|
7404
7404
|
flexDirection: ['row', 'column'],
|
|
@@ -7730,8 +7730,6 @@ export const patterns = [
|
|
|
7730
7730
|
type: 'OnboardProvider',
|
|
7731
7731
|
children: 'node',
|
|
7732
7732
|
attributes: {
|
|
7733
|
-
title: 'title',
|
|
7734
|
-
description: 'description',
|
|
7735
7733
|
scrollable: 'boolean',
|
|
7736
7734
|
style: {
|
|
7737
7735
|
flexDirection: ['row', 'column'],
|
|
@@ -7781,6 +7779,8 @@ export const patterns = [
|
|
|
7781
7779
|
right: 'size',
|
|
7782
7780
|
zIndex: 'number',
|
|
7783
7781
|
},
|
|
7782
|
+
title: 'title',
|
|
7783
|
+
description: 'description',
|
|
7784
7784
|
theme: ['light', 'dark', 'all'],
|
|
7785
7785
|
borderRadius: 'never',
|
|
7786
7786
|
},
|
|
@@ -9823,11 +9823,13 @@ export const patterns = [
|
|
|
9823
9823
|
style: {
|
|
9824
9824
|
fontSize: '16',
|
|
9825
9825
|
flexDirection: 'row',
|
|
9826
|
-
position: '
|
|
9826
|
+
position: 'absolute',
|
|
9827
9827
|
zIndex: 1,
|
|
9828
9828
|
alignSelf: 'flex-start',
|
|
9829
9829
|
flexGrow: 0,
|
|
9830
9830
|
flexShrink: 0,
|
|
9831
|
+
top: '35@vs',
|
|
9832
|
+
left: '24@s',
|
|
9831
9833
|
justifyContent: 'center',
|
|
9832
9834
|
alignItems: 'center',
|
|
9833
9835
|
},
|
|
@@ -10281,8 +10283,6 @@ export const patterns = [
|
|
|
10281
10283
|
type: 'PaywallOptions',
|
|
10282
10284
|
children: 'node',
|
|
10283
10285
|
attributes: {
|
|
10284
|
-
title: 'title',
|
|
10285
|
-
description: 'description',
|
|
10286
10286
|
scrollable: 'boolean',
|
|
10287
10287
|
style: {
|
|
10288
10288
|
flexDirection: ['row', 'column'],
|
|
@@ -10332,6 +10332,8 @@ export const patterns = [
|
|
|
10332
10332
|
right: 'size',
|
|
10333
10333
|
zIndex: 'number',
|
|
10334
10334
|
},
|
|
10335
|
+
title: 'title',
|
|
10336
|
+
description: 'description',
|
|
10335
10337
|
},
|
|
10336
10338
|
},
|
|
10337
10339
|
meta: {
|
|
@@ -10654,8 +10656,6 @@ export const patterns = [
|
|
|
10654
10656
|
type: 'PaywallProvider',
|
|
10655
10657
|
children: 'node',
|
|
10656
10658
|
attributes: {
|
|
10657
|
-
title: 'title',
|
|
10658
|
-
description: 'description',
|
|
10659
10659
|
scrollable: 'boolean',
|
|
10660
10660
|
style: {
|
|
10661
10661
|
flexDirection: ['row', 'column'],
|
|
@@ -10705,6 +10705,9 @@ export const patterns = [
|
|
|
10705
10705
|
right: 'size',
|
|
10706
10706
|
zIndex: 'number',
|
|
10707
10707
|
},
|
|
10708
|
+
title: 'title',
|
|
10709
|
+
description: 'description',
|
|
10710
|
+
delay: 'number',
|
|
10708
10711
|
},
|
|
10709
10712
|
},
|
|
10710
10713
|
meta: {
|
|
@@ -11004,6 +11007,14 @@ export const patterns = [
|
|
|
11004
11007
|
specialCategory: null,
|
|
11005
11008
|
sort: 26,
|
|
11006
11009
|
},
|
|
11010
|
+
delay: {
|
|
11011
|
+
label: 'Back Delay (ms)',
|
|
11012
|
+
description:
|
|
11013
|
+
'Milliseconds before the paywall can be dismissed via back/close.',
|
|
11014
|
+
category: 'other',
|
|
11015
|
+
specialCategory: null,
|
|
11016
|
+
sort: 1,
|
|
11017
|
+
},
|
|
11007
11018
|
},
|
|
11008
11019
|
mockableFeatures: { products: true, benefits: true },
|
|
11009
11020
|
},
|
|
@@ -11443,8 +11454,6 @@ export const patterns = [
|
|
|
11443
11454
|
type: 'RadioButton',
|
|
11444
11455
|
children: 'never',
|
|
11445
11456
|
attributes: {
|
|
11446
|
-
title: 'title',
|
|
11447
|
-
description: 'description',
|
|
11448
11457
|
scrollable: 'boolean',
|
|
11449
11458
|
style: {
|
|
11450
11459
|
flexDirection: ['row', 'column'],
|
|
@@ -11494,6 +11503,8 @@ export const patterns = [
|
|
|
11494
11503
|
right: 'size',
|
|
11495
11504
|
zIndex: 'number',
|
|
11496
11505
|
},
|
|
11506
|
+
title: 'title',
|
|
11507
|
+
description: 'description',
|
|
11497
11508
|
selected: 'boolean',
|
|
11498
11509
|
color: 'color',
|
|
11499
11510
|
size: 'number',
|
|
@@ -11837,8 +11848,6 @@ export const patterns = [
|
|
|
11837
11848
|
type: 'Text',
|
|
11838
11849
|
children: 'string',
|
|
11839
11850
|
attributes: {
|
|
11840
|
-
title: 'title',
|
|
11841
|
-
description: 'description',
|
|
11842
11851
|
scrollable: 'boolean',
|
|
11843
11852
|
style: {
|
|
11844
11853
|
flexDirection: ['row', 'column'],
|
|
@@ -11893,6 +11902,8 @@ export const patterns = [
|
|
|
11893
11902
|
fontWeight: 'fontWeight',
|
|
11894
11903
|
textAlign: ['left', 'center', 'right', 'justify'],
|
|
11895
11904
|
},
|
|
11905
|
+
title: 'title',
|
|
11906
|
+
description: 'description',
|
|
11896
11907
|
adjustsFontSizeToFit: 'boolean',
|
|
11897
11908
|
showEllipsis: 'boolean',
|
|
11898
11909
|
},
|
|
@@ -12268,8 +12279,6 @@ export const patterns = [
|
|
|
12268
12279
|
type: 'View',
|
|
12269
12280
|
children: 'node',
|
|
12270
12281
|
attributes: {
|
|
12271
|
-
title: 'title',
|
|
12272
|
-
description: 'description',
|
|
12273
12282
|
scrollable: 'boolean',
|
|
12274
12283
|
style: {
|
|
12275
12284
|
flexDirection: ['row', 'column'],
|
|
@@ -90,15 +90,6 @@ export function BuilderProvider({ params, children }: BuilderProviderProps) {
|
|
|
90
90
|
],
|
|
91
91
|
);
|
|
92
92
|
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
console.info('[preview] BuilderProvider params', {
|
|
95
|
-
previewMode: value.previewMode,
|
|
96
|
-
selectedKey: value.selectedKey,
|
|
97
|
-
platform: value.platform,
|
|
98
|
-
productsCount: Array.isArray(value.products) ? value.products.length : 0,
|
|
99
|
-
});
|
|
100
|
-
}, [value.previewMode, value.selectedKey, value.platform, value.products]);
|
|
101
|
-
|
|
102
93
|
return (
|
|
103
94
|
<BuilderContext.Provider value={value}>{children}</BuilderContext.Provider>
|
|
104
95
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Device } from '../types/Device';
|
|
3
|
+
import { emitMockOSBackPress } from '../mockOS/backHandler';
|
|
3
4
|
import { useMockOSContext } from '../mockOS/context/MockOSContextBase';
|
|
4
5
|
|
|
5
6
|
type DeviceNavigationBarProps = {
|
|
@@ -37,6 +38,10 @@ export function DeviceNavigationBar({
|
|
|
37
38
|
: 'rgba(0, 0, 0, 0.4)';
|
|
38
39
|
|
|
39
40
|
function handleBackButton() {
|
|
41
|
+
if (!emitMockOSBackPress()) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
40
45
|
if (context) {
|
|
41
46
|
const canGoBack = context.goBack();
|
|
42
47
|
// If can't go back, go to launchscreen
|
package/src/index.ts
CHANGED
|
@@ -27,11 +27,9 @@ export type {
|
|
|
27
27
|
|
|
28
28
|
// Paywall hooks (RN-safe placeholders)
|
|
29
29
|
export {
|
|
30
|
-
usePaywallCounter,
|
|
31
|
-
useCloseStatusPaywall,
|
|
32
|
-
useCarouselOptionsSeperator,
|
|
33
30
|
useCalculateLocalizedPrice,
|
|
34
31
|
useDiscountRate,
|
|
32
|
+
useChangeDelayByPaywall,
|
|
35
33
|
} from './paywall/hooks';
|
|
36
34
|
|
|
37
35
|
// Context (RN-safe). In React Native, `products` should come from an IAP wrapper
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type MockOSBackHandler = () => boolean;
|
|
2
|
+
|
|
3
|
+
const backHandlers: MockOSBackHandler[] = [];
|
|
4
|
+
|
|
5
|
+
export function registerMockOSBackHandler(
|
|
6
|
+
handler: MockOSBackHandler,
|
|
7
|
+
): () => void {
|
|
8
|
+
backHandlers.push(handler);
|
|
9
|
+
|
|
10
|
+
return () => {
|
|
11
|
+
const index = backHandlers.lastIndexOf(handler);
|
|
12
|
+
if (index >= 0) {
|
|
13
|
+
backHandlers.splice(index, 1);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function emitMockOSBackPress(): boolean {
|
|
19
|
+
if (backHandlers.length === 0) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
for (let i = backHandlers.length - 1; i >= 0; i -= 1) {
|
|
24
|
+
const allow = backHandlers[i]?.();
|
|
25
|
+
if (!allow) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function clearMockOSBackHandlers(): void {
|
|
34
|
+
backHandlers.length = 0;
|
|
35
|
+
}
|
|
@@ -71,7 +71,9 @@ export function ProjectMigrationPage({
|
|
|
71
71
|
type="button"
|
|
72
72
|
className="editor-button"
|
|
73
73
|
disabled={!!migrating}
|
|
74
|
-
onClick={() =>
|
|
74
|
+
onClick={() => {
|
|
75
|
+
onMigrateNow?.();
|
|
76
|
+
}}
|
|
75
77
|
>
|
|
76
78
|
{migrating ? 'Migrating…' : 'Migrate now'}
|
|
77
79
|
</button>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { usePaywallCounter } from './usePaywallCounter';
|
|
2
|
-
export { useCloseStatusPaywall } from './useCloseStatusPaywall';
|
|
3
|
-
export { useCarouselOptionsSeperator } from './useCarouselOptionsSeperator';
|
|
4
1
|
export { useCalculateLocalizedPrice } from './useCalculateLocalizedPrice';
|
|
5
2
|
export { useDiscountRate } from './useDiscountRate';
|
|
3
|
+
export { useChangeDelayByPaywall } from './useChangeDelayByPaywall';
|
|
4
|
+
export { useHandleGoBack } from './useHandleGoBack';
|
|
5
|
+
export { useMockOSBackHandler } from './useMockOSBackHandler';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect, useMemo } from 'react';
|
|
2
|
+
import type { NodeData } from '../../types/Node';
|
|
3
|
+
|
|
4
|
+
export function useChangeDelayByPaywall(
|
|
5
|
+
node: NodeData<{ delay?: number }> | null | undefined,
|
|
6
|
+
setIsBackAllowed: (value: boolean) => void,
|
|
7
|
+
) {
|
|
8
|
+
const delay = useMemo(() => {
|
|
9
|
+
const delayAttribute = node?.attributes?.delay
|
|
10
|
+
? parseInt(String(node?.attributes?.delay), 10)
|
|
11
|
+
: 1000;
|
|
12
|
+
return delayAttribute;
|
|
13
|
+
}, [node?.attributes?.delay]);
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!delay || delay <= 0) {
|
|
17
|
+
setIsBackAllowed(true);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const timeout = setTimeout(() => {
|
|
21
|
+
setIsBackAllowed(true);
|
|
22
|
+
}, delay);
|
|
23
|
+
return () => clearTimeout(timeout);
|
|
24
|
+
}, [delay, setIsBackAllowed]);
|
|
25
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useMockOSContext } from '../../mockOS/context/MockOSContextBase';
|
|
3
|
+
|
|
4
|
+
export function useHandleGoBack(
|
|
5
|
+
handleGoBack: () => boolean | null | undefined,
|
|
6
|
+
) {
|
|
7
|
+
const mockOS = useMockOSContext();
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!mockOS?.isEnabled) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const handleBackPress = (event?: KeyboardEvent | PopStateEvent) => {
|
|
15
|
+
const result = handleGoBack();
|
|
16
|
+
|
|
17
|
+
// Only allow navigation if result is explicitly true
|
|
18
|
+
if (result !== true) {
|
|
19
|
+
// Prevent navigation
|
|
20
|
+
if (event instanceof KeyboardEvent) {
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
} else if (event instanceof PopStateEvent) {
|
|
24
|
+
// Prevent browser navigation by pushing state back
|
|
25
|
+
window.history.pushState(null, '', window.location.href);
|
|
26
|
+
}
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Allow navigation - execute MockOS goBack
|
|
31
|
+
const canGoBack = mockOS.goBack();
|
|
32
|
+
if (!canGoBack) {
|
|
33
|
+
mockOS.navigation('launchscreen');
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Handle Escape key
|
|
38
|
+
const handleKeyDown = (e: KeyboardEvent) => {
|
|
39
|
+
if (e.key === 'Escape') {
|
|
40
|
+
handleBackPress(e);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// Handle browser back button
|
|
45
|
+
const handlePopState = (e: PopStateEvent) => {
|
|
46
|
+
handleBackPress(e);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Push a state to track back navigation
|
|
50
|
+
window.history.pushState(null, '', window.location.href);
|
|
51
|
+
|
|
52
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
53
|
+
window.addEventListener('popstate', handlePopState);
|
|
54
|
+
|
|
55
|
+
return () => {
|
|
56
|
+
window.removeEventListener('keydown', handleKeyDown);
|
|
57
|
+
window.removeEventListener('popstate', handlePopState);
|
|
58
|
+
};
|
|
59
|
+
}, [handleGoBack, mockOS]);
|
|
60
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { registerMockOSBackHandler } from '../../mockOS/backHandler';
|
|
3
|
+
|
|
4
|
+
export function useMockOSBackHandler(isBackAllowed: boolean) {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const unsubscribe = registerMockOSBackHandler(() => isBackAllowed);
|
|
7
|
+
return unsubscribe;
|
|
8
|
+
}, [isBackAllowed]);
|
|
9
|
+
}
|