@developer_tribe/react-builder 1.2.24 → 1.2.25
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/attributes-editor/SpecialCategorySection.d.ts +2 -1
- package/dist/attributes-editor/attributesEditorModelTypes.d.ts +2 -0
- package/dist/build-components/BIcon/BIconProps.generated.d.ts +0 -2
- package/dist/build-components/BackgroundImage/BackgroundImageProps.generated.d.ts +0 -2
- package/dist/build-components/Button/ButtonProps.generated.d.ts +0 -2
- package/dist/build-components/Carousel/CarouselProps.generated.d.ts +0 -2
- package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +0 -2
- package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +0 -2
- package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +0 -2
- package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +0 -2
- package/dist/build-components/CountDown/CountDownProps.generated.d.ts +0 -2
- package/dist/build-components/Counter/CounterProps.generated.d.ts +0 -2
- package/dist/build-components/Image/ImageProps.generated.d.ts +0 -2
- package/dist/build-components/Main/MainProps.generated.d.ts +0 -2
- package/dist/build-components/NavigationBarColor/NavigationBarColorProps.generated.d.ts +0 -2
- package/dist/build-components/Onboard/OnboardProps.generated.d.ts +0 -2
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +0 -2
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +0 -2
- package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +0 -2
- package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +0 -2
- package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +0 -2
- package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +0 -2
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +0 -2
- package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +0 -2
- package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +0 -2
- package/dist/build-components/PaywallBackground/PaywallBackgroundProps.generated.d.ts +0 -2
- package/dist/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.d.ts +0 -2
- package/dist/build-components/PaywallCounter/PaywallCounterProps.generated.d.ts +0 -2
- package/dist/build-components/PaywallOptions/PaywallOptionsProps.generated.d.ts +0 -2
- package/dist/build-components/PaywallProvider/PaywallProviderProps.generated.d.ts +0 -2
- package/dist/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.d.ts +0 -2
- package/dist/build-components/RadioButton/RadioButtonProps.generated.d.ts +0 -2
- package/dist/build-components/Separator/SeparatorProps.generated.d.ts +0 -2
- package/dist/build-components/StatusBarColor/StatusBarColorProps.generated.d.ts +0 -2
- package/dist/build-components/Text/TextProps.generated.d.ts +0 -2
- package/dist/build-components/patterns.generated.d.ts +76 -70
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.web.cjs.js +4 -4
- package/dist/index.web.cjs.js.map +1 -1
- package/dist/index.web.esm.js +2 -2
- package/dist/index.web.esm.js.map +1 -1
- package/dist/pages/ProjectPage.d.ts +2 -2
- package/dist/pages/projectPageUtils.d.ts +7 -1
- package/dist/types/Project.d.ts +6 -0
- package/dist/utils/patterns.d.ts +2 -0
- package/package.json +1 -1
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +11 -2
- package/src/AttributesEditor.tsx +15 -4
- package/src/assets/meta.json +1 -1
- package/src/assets/samples/paywall-app-delete-offer.json +0 -1
- package/src/assets/samples/paywall-app-open-offer.json +0 -1
- package/src/assets/samples/paywall-back-offer.json +0 -1
- package/src/assets/samples/paywall-notification-offer.json +0 -1
- package/src/assets/samples/simple-2.json +0 -1
- package/src/attributes-editor/AttributesEditorView.tsx +43 -36
- package/src/attributes-editor/SpecialCategorySection.tsx +5 -3
- package/src/attributes-editor/attributesEditorModelTypes.ts +2 -0
- package/src/attributes-editor/useAttributesEditorModel.ts +6 -0
- package/src/build-components/BIcon/BIconProps.generated.ts +0 -2
- package/src/build-components/BIcon/pattern.json +5 -3
- package/src/build-components/BackgroundImage/BackgroundImageProps.generated.ts +0 -2
- package/src/build-components/BackgroundImage/pattern.json +12 -4
- package/src/build-components/Button/ButtonProps.generated.ts +0 -2
- package/src/build-components/Button/pattern.json +5 -3
- package/src/build-components/Carousel/CarouselProps.generated.ts +0 -2
- package/src/build-components/Carousel/pattern.json +11 -5
- package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +0 -2
- package/src/build-components/CarouselButtons/pattern.json +11 -4
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +0 -2
- package/src/build-components/CarouselDots/pattern.json +5 -3
- package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +0 -2
- package/src/build-components/CarouselItem/pattern.json +6 -6
- package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +0 -2
- package/src/build-components/CarouselProvider/pattern.json +6 -5
- package/src/build-components/CountDown/CountDownProps.generated.ts +0 -2
- package/src/build-components/CountDown/pattern.json +6 -3
- package/src/build-components/Counter/CounterProps.generated.ts +0 -2
- package/src/build-components/Counter/pattern.json +5 -1
- package/src/build-components/Image/ImageProps.generated.ts +0 -2
- package/src/build-components/Image/pattern.json +5 -3
- package/src/build-components/Main/MainProps.generated.ts +0 -2
- package/src/build-components/Main/pattern.json +5 -3
- package/src/build-components/NavigationBarColor/NavigationBarColorProps.generated.ts +0 -2
- package/src/build-components/NavigationBarColor/pattern.json +5 -3
- package/src/build-components/Onboard/OnboardProps.generated.ts +0 -2
- package/src/build-components/Onboard/pattern.json +9 -7
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +0 -2
- package/src/build-components/OnboardButton/pattern.json +16 -5
- package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +0 -2
- package/src/build-components/OnboardButtons/pattern.json +17 -6
- package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +0 -2
- package/src/build-components/OnboardDot/pattern.json +5 -3
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +0 -2
- package/src/build-components/OnboardFooter/pattern.json +5 -3
- package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +0 -2
- package/src/build-components/OnboardImage/pattern.json +7 -3
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +0 -2
- package/src/build-components/OnboardItem/pattern.json +13 -5
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +0 -2
- package/src/build-components/OnboardProvider/pattern.json +10 -4
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +0 -2
- package/src/build-components/OnboardSubtitle/pattern.json +7 -6
- package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +0 -2
- package/src/build-components/OnboardTitle/pattern.json +7 -6
- package/src/build-components/PaywallBackground/PaywallBackgroundProps.generated.ts +0 -2
- package/src/build-components/PaywallBackground/pattern.json +5 -5
- package/src/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.ts +0 -2
- package/src/build-components/PaywallCloseButton/pattern.json +6 -6
- package/src/build-components/PaywallCounter/PaywallCounterProps.generated.ts +0 -2
- package/src/build-components/PaywallCounter/pattern.json +6 -3
- package/src/build-components/PaywallOptions/PaywallOptionsProps.generated.ts +0 -2
- package/src/build-components/PaywallOptions/pattern.json +6 -6
- package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +0 -2
- package/src/build-components/PaywallProvider/pattern.json +5 -3
- package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.ts +0 -2
- package/src/build-components/PaywallSubscribeButton/pattern.json +6 -6
- package/src/build-components/RadioButton/RadioButtonProps.generated.ts +0 -2
- package/src/build-components/RadioButton/pattern.json +5 -3
- package/src/build-components/Separator/SeparatorProps.generated.ts +0 -2
- package/src/build-components/Separator/pattern.json +5 -3
- package/src/build-components/StatusBarColor/StatusBarColorProps.generated.ts +0 -2
- package/src/build-components/StatusBarColor/pattern.json +5 -3
- package/src/build-components/Text/TextProps.generated.ts +0 -2
- package/src/build-components/Text/pattern.json +11 -5
- package/src/build-components/View/pattern.json +18 -4
- package/src/build-components/patterns.generated.ts +72 -70
- package/src/components/AttributesEditorPanel.tsx +48 -32
- package/src/components/Builder.tsx +4 -1
- package/src/index.ts +1 -1
- package/src/pages/ProjectPage.tsx +45 -22
- package/src/pages/projectPageUtils.ts +15 -1
- package/src/types/Project.ts +7 -0
- package/src/utils/patterns.ts +2 -0
|
@@ -6,10 +6,10 @@ export const patterns = [
|
|
|
6
6
|
schemaVersion: 2,
|
|
7
7
|
pattern: {
|
|
8
8
|
type: 'BIcon',
|
|
9
|
+
title: 'title',
|
|
10
|
+
description: 'description',
|
|
9
11
|
children: 'never',
|
|
10
12
|
attributes: {
|
|
11
|
-
title: 'title',
|
|
12
|
-
description: 'description',
|
|
13
13
|
adjustsFontSizeToFit: 'boolean',
|
|
14
14
|
showEllipsis: 'boolean',
|
|
15
15
|
style: {
|
|
@@ -479,6 +479,8 @@ export const patterns = [
|
|
|
479
479
|
schemaVersion: 2,
|
|
480
480
|
pattern: {
|
|
481
481
|
type: 'BackgroundImage',
|
|
482
|
+
title: 'title',
|
|
483
|
+
description: 'description',
|
|
482
484
|
children: 'never',
|
|
483
485
|
attributes: {
|
|
484
486
|
scrollable: 'boolean',
|
|
@@ -531,8 +533,6 @@ export const patterns = [
|
|
|
531
533
|
right: 'size',
|
|
532
534
|
zIndex: 'number',
|
|
533
535
|
},
|
|
534
|
-
title: 'title',
|
|
535
|
-
description: 'description',
|
|
536
536
|
src: 'string',
|
|
537
537
|
resizeMode: ['cover', 'contain', 'stretch', 'center'],
|
|
538
538
|
},
|
|
@@ -892,6 +892,8 @@ export const patterns = [
|
|
|
892
892
|
schemaVersion: 2,
|
|
893
893
|
pattern: {
|
|
894
894
|
type: 'Button',
|
|
895
|
+
title: 'title',
|
|
896
|
+
description: 'description',
|
|
895
897
|
children: 'string',
|
|
896
898
|
attributes: {
|
|
897
899
|
scrollable: 'boolean',
|
|
@@ -959,8 +961,6 @@ export const patterns = [
|
|
|
959
961
|
'900',
|
|
960
962
|
],
|
|
961
963
|
},
|
|
962
|
-
title: 'title',
|
|
963
|
-
description: 'description',
|
|
964
964
|
},
|
|
965
965
|
},
|
|
966
966
|
meta: {
|
|
@@ -1310,6 +1310,8 @@ export const patterns = [
|
|
|
1310
1310
|
schemaVersion: 2,
|
|
1311
1311
|
pattern: {
|
|
1312
1312
|
type: 'Carousel',
|
|
1313
|
+
title: 'title',
|
|
1314
|
+
description: 'description',
|
|
1313
1315
|
children: 'node',
|
|
1314
1316
|
attributes: {
|
|
1315
1317
|
scrollable: 'boolean',
|
|
@@ -1362,8 +1364,6 @@ export const patterns = [
|
|
|
1362
1364
|
right: 'size',
|
|
1363
1365
|
zIndex: 'number',
|
|
1364
1366
|
},
|
|
1365
|
-
title: 'title',
|
|
1366
|
-
description: 'description',
|
|
1367
1367
|
loop: 'boolean',
|
|
1368
1368
|
dragFree: 'boolean',
|
|
1369
1369
|
align: ['start', 'center', 'end'],
|
|
@@ -1691,6 +1691,8 @@ export const patterns = [
|
|
|
1691
1691
|
schemaVersion: 2,
|
|
1692
1692
|
pattern: {
|
|
1693
1693
|
type: 'CarouselButtons',
|
|
1694
|
+
title: 'title',
|
|
1695
|
+
description: 'description',
|
|
1694
1696
|
children: 'never',
|
|
1695
1697
|
attributes: {
|
|
1696
1698
|
scrollable: 'boolean',
|
|
@@ -1743,8 +1745,6 @@ export const patterns = [
|
|
|
1743
1745
|
right: 'size',
|
|
1744
1746
|
zIndex: 'number',
|
|
1745
1747
|
},
|
|
1746
|
-
title: 'title',
|
|
1747
|
-
description: 'description',
|
|
1748
1748
|
buttonType: ['previous_button', 'next_button', 'skip_button'],
|
|
1749
1749
|
skipNumber: 'number',
|
|
1750
1750
|
},
|
|
@@ -2085,6 +2085,8 @@ export const patterns = [
|
|
|
2085
2085
|
schemaVersion: 2,
|
|
2086
2086
|
pattern: {
|
|
2087
2087
|
type: 'CarouselDots',
|
|
2088
|
+
title: 'title',
|
|
2089
|
+
description: 'description',
|
|
2088
2090
|
children: 'never',
|
|
2089
2091
|
attributes: {
|
|
2090
2092
|
scrollable: 'boolean',
|
|
@@ -2137,8 +2139,6 @@ export const patterns = [
|
|
|
2137
2139
|
right: 'size',
|
|
2138
2140
|
zIndex: 'number',
|
|
2139
2141
|
},
|
|
2140
|
-
title: 'title',
|
|
2141
|
-
description: 'description',
|
|
2142
2142
|
dotType: [
|
|
2143
2143
|
'expanding_dot',
|
|
2144
2144
|
'normal_dot',
|
|
@@ -2478,6 +2478,8 @@ export const patterns = [
|
|
|
2478
2478
|
schemaVersion: 2,
|
|
2479
2479
|
pattern: {
|
|
2480
2480
|
type: 'CarouselItem',
|
|
2481
|
+
title: 'title',
|
|
2482
|
+
description: 'description',
|
|
2481
2483
|
children: 'node',
|
|
2482
2484
|
attributes: {
|
|
2483
2485
|
scrollable: 'boolean',
|
|
@@ -2530,8 +2532,6 @@ export const patterns = [
|
|
|
2530
2532
|
right: 'size',
|
|
2531
2533
|
zIndex: 'number',
|
|
2532
2534
|
},
|
|
2533
|
-
title: 'title',
|
|
2534
|
-
description: 'description',
|
|
2535
2535
|
},
|
|
2536
2536
|
},
|
|
2537
2537
|
meta: {
|
|
@@ -2856,6 +2856,8 @@ export const patterns = [
|
|
|
2856
2856
|
schemaVersion: 1,
|
|
2857
2857
|
pattern: {
|
|
2858
2858
|
type: 'CarouselProvider',
|
|
2859
|
+
title: 'title',
|
|
2860
|
+
description: 'description',
|
|
2859
2861
|
children: 'node',
|
|
2860
2862
|
attributes: {
|
|
2861
2863
|
scrollable: 'boolean',
|
|
@@ -2908,8 +2910,6 @@ export const patterns = [
|
|
|
2908
2910
|
right: 'size',
|
|
2909
2911
|
zIndex: 'number',
|
|
2910
2912
|
},
|
|
2911
|
-
title: 'title',
|
|
2912
|
-
description: 'description',
|
|
2913
2913
|
},
|
|
2914
2914
|
defaults: { style: { width: '100%', height: '100%' } },
|
|
2915
2915
|
},
|
|
@@ -3238,11 +3238,11 @@ export const patterns = [
|
|
|
3238
3238
|
schemaVersion: 2,
|
|
3239
3239
|
pattern: {
|
|
3240
3240
|
type: 'CountDown',
|
|
3241
|
+
title: 'title',
|
|
3242
|
+
description: 'description',
|
|
3241
3243
|
children: 'never',
|
|
3242
3244
|
attributes: {
|
|
3243
3245
|
count: 'number',
|
|
3244
|
-
title: 'title',
|
|
3245
|
-
description: 'description',
|
|
3246
3246
|
adjustsFontSizeToFit: 'boolean',
|
|
3247
3247
|
showEllipsis: 'boolean',
|
|
3248
3248
|
style: {
|
|
@@ -3693,10 +3693,10 @@ export const patterns = [
|
|
|
3693
3693
|
schemaVersion: 2,
|
|
3694
3694
|
pattern: {
|
|
3695
3695
|
type: 'Counter',
|
|
3696
|
+
title: 'title',
|
|
3697
|
+
description: 'description',
|
|
3696
3698
|
children: 'never',
|
|
3697
3699
|
attributes: {
|
|
3698
|
-
title: 'title',
|
|
3699
|
-
description: 'description',
|
|
3700
3700
|
adjustsFontSizeToFit: 'boolean',
|
|
3701
3701
|
showEllipsis: 'boolean',
|
|
3702
3702
|
style: {
|
|
@@ -4148,6 +4148,8 @@ export const patterns = [
|
|
|
4148
4148
|
schemaVersion: 2,
|
|
4149
4149
|
pattern: {
|
|
4150
4150
|
type: 'Image',
|
|
4151
|
+
title: 'title',
|
|
4152
|
+
description: 'description',
|
|
4151
4153
|
children: 'never',
|
|
4152
4154
|
attributes: {
|
|
4153
4155
|
scrollable: 'boolean',
|
|
@@ -4201,11 +4203,9 @@ export const patterns = [
|
|
|
4201
4203
|
zIndex: 'number',
|
|
4202
4204
|
resizeMode: ['cover', 'contain', 'stretch', 'center'],
|
|
4203
4205
|
},
|
|
4204
|
-
title: 'title',
|
|
4205
|
-
description: 'description',
|
|
4206
4206
|
src: 'string',
|
|
4207
4207
|
},
|
|
4208
|
-
defaults: { resizeMode: 'contain' },
|
|
4208
|
+
defaults: { style: { resizeMode: 'contain' } },
|
|
4209
4209
|
},
|
|
4210
4210
|
meta: {
|
|
4211
4211
|
desiredParent: ['all'],
|
|
@@ -4528,7 +4528,6 @@ export const patterns = [
|
|
|
4528
4528
|
},
|
|
4529
4529
|
},
|
|
4530
4530
|
defaults: {
|
|
4531
|
-
resizeMode: 'contain',
|
|
4532
4531
|
style: {
|
|
4533
4532
|
flexDirection: 'column',
|
|
4534
4533
|
position: 'relative',
|
|
@@ -4536,6 +4535,7 @@ export const patterns = [
|
|
|
4536
4535
|
alignSelf: 'flex-start',
|
|
4537
4536
|
flexGrow: 0,
|
|
4538
4537
|
flexShrink: 0,
|
|
4538
|
+
resizeMode: 'contain',
|
|
4539
4539
|
},
|
|
4540
4540
|
},
|
|
4541
4541
|
types: {},
|
|
@@ -4544,6 +4544,8 @@ export const patterns = [
|
|
|
4544
4544
|
schemaVersion: 2,
|
|
4545
4545
|
pattern: {
|
|
4546
4546
|
type: 'Main',
|
|
4547
|
+
title: 'title',
|
|
4548
|
+
description: 'description',
|
|
4547
4549
|
children: 'node',
|
|
4548
4550
|
attributes: {
|
|
4549
4551
|
scrollable: 'boolean',
|
|
@@ -4596,8 +4598,6 @@ export const patterns = [
|
|
|
4596
4598
|
right: 'size',
|
|
4597
4599
|
zIndex: 'number',
|
|
4598
4600
|
},
|
|
4599
|
-
title: 'title',
|
|
4600
|
-
description: 'description',
|
|
4601
4601
|
useSafeAreaView: 'boolean',
|
|
4602
4602
|
},
|
|
4603
4603
|
},
|
|
@@ -4937,6 +4937,8 @@ export const patterns = [
|
|
|
4937
4937
|
schemaVersion: 2,
|
|
4938
4938
|
pattern: {
|
|
4939
4939
|
type: 'NavigationBarColor',
|
|
4940
|
+
title: 'title',
|
|
4941
|
+
description: 'description',
|
|
4940
4942
|
children: 'never',
|
|
4941
4943
|
attributes: {
|
|
4942
4944
|
scrollable: 'boolean',
|
|
@@ -4989,8 +4991,6 @@ export const patterns = [
|
|
|
4989
4991
|
right: 'size',
|
|
4990
4992
|
zIndex: 'number',
|
|
4991
4993
|
},
|
|
4992
|
-
title: 'title',
|
|
4993
|
-
description: 'description',
|
|
4994
4994
|
},
|
|
4995
4995
|
},
|
|
4996
4996
|
meta: {
|
|
@@ -5316,6 +5316,8 @@ export const patterns = [
|
|
|
5316
5316
|
schemaVersion: 2,
|
|
5317
5317
|
pattern: {
|
|
5318
5318
|
type: 'Onboard',
|
|
5319
|
+
title: 'title',
|
|
5320
|
+
description: 'description',
|
|
5319
5321
|
children: 'node',
|
|
5320
5322
|
attributes: {
|
|
5321
5323
|
scrollable: 'boolean',
|
|
@@ -5368,8 +5370,6 @@ export const patterns = [
|
|
|
5368
5370
|
right: 'size',
|
|
5369
5371
|
zIndex: 'number',
|
|
5370
5372
|
},
|
|
5371
|
-
title: 'title',
|
|
5372
|
-
description: 'description',
|
|
5373
5373
|
},
|
|
5374
5374
|
},
|
|
5375
5375
|
meta: {
|
|
@@ -5695,6 +5695,8 @@ export const patterns = [
|
|
|
5695
5695
|
schemaVersion: 2,
|
|
5696
5696
|
pattern: {
|
|
5697
5697
|
type: 'OnboardButton',
|
|
5698
|
+
title: 'title',
|
|
5699
|
+
description: 'description',
|
|
5698
5700
|
children: 'never',
|
|
5699
5701
|
attributes: {
|
|
5700
5702
|
scrollable: 'boolean',
|
|
@@ -5747,8 +5749,6 @@ export const patterns = [
|
|
|
5747
5749
|
right: 'size',
|
|
5748
5750
|
zIndex: 'number',
|
|
5749
5751
|
},
|
|
5750
|
-
title: 'title',
|
|
5751
|
-
description: 'description',
|
|
5752
5752
|
labelKey: 'string',
|
|
5753
5753
|
button_text_color: 'color',
|
|
5754
5754
|
animation: [
|
|
@@ -6138,6 +6138,8 @@ export const patterns = [
|
|
|
6138
6138
|
schemaVersion: 2,
|
|
6139
6139
|
pattern: {
|
|
6140
6140
|
type: 'OnboardButtons',
|
|
6141
|
+
title: 'title',
|
|
6142
|
+
description: 'description',
|
|
6141
6143
|
children: 'node',
|
|
6142
6144
|
attributes: {
|
|
6143
6145
|
scrollable: 'boolean',
|
|
@@ -6190,8 +6192,6 @@ export const patterns = [
|
|
|
6190
6192
|
right: 'size',
|
|
6191
6193
|
zIndex: 'number',
|
|
6192
6194
|
},
|
|
6193
|
-
title: 'title',
|
|
6194
|
-
description: 'description',
|
|
6195
6195
|
buttonType: ['previous_button', 'next_button', 'skip_button'],
|
|
6196
6196
|
skipNumber: 'number',
|
|
6197
6197
|
buttons_direction: ['row', 'column'],
|
|
@@ -6589,6 +6589,8 @@ export const patterns = [
|
|
|
6589
6589
|
schemaVersion: 2,
|
|
6590
6590
|
pattern: {
|
|
6591
6591
|
type: 'OnboardDot',
|
|
6592
|
+
title: 'title',
|
|
6593
|
+
description: 'description',
|
|
6592
6594
|
children: 'never',
|
|
6593
6595
|
attributes: {
|
|
6594
6596
|
scrollable: 'boolean',
|
|
@@ -6641,8 +6643,6 @@ export const patterns = [
|
|
|
6641
6643
|
right: 'size',
|
|
6642
6644
|
zIndex: 'number',
|
|
6643
6645
|
},
|
|
6644
|
-
title: 'title',
|
|
6645
|
-
description: 'description',
|
|
6646
6646
|
dotType: [
|
|
6647
6647
|
'expanding_dot',
|
|
6648
6648
|
'normal_dot',
|
|
@@ -7024,10 +7024,10 @@ export const patterns = [
|
|
|
7024
7024
|
schemaVersion: 2,
|
|
7025
7025
|
pattern: {
|
|
7026
7026
|
type: 'OnboardFooter',
|
|
7027
|
+
title: 'title',
|
|
7028
|
+
description: 'description',
|
|
7027
7029
|
children: 'node',
|
|
7028
7030
|
attributes: {
|
|
7029
|
-
title: 'title',
|
|
7030
|
-
description: 'description',
|
|
7031
7031
|
adjustsFontSizeToFit: 'boolean',
|
|
7032
7032
|
showEllipsis: 'boolean',
|
|
7033
7033
|
style: {
|
|
@@ -7532,10 +7532,10 @@ export const patterns = [
|
|
|
7532
7532
|
schemaVersion: 2,
|
|
7533
7533
|
pattern: {
|
|
7534
7534
|
type: 'OnboardImage',
|
|
7535
|
+
title: 'title',
|
|
7536
|
+
description: 'description',
|
|
7535
7537
|
children: 'node',
|
|
7536
7538
|
attributes: {
|
|
7537
|
-
title: 'title',
|
|
7538
|
-
description: 'description',
|
|
7539
7539
|
src: 'string',
|
|
7540
7540
|
style: {
|
|
7541
7541
|
resizeMode: ['cover', 'contain', 'stretch', 'center'],
|
|
@@ -7591,7 +7591,7 @@ export const patterns = [
|
|
|
7591
7591
|
video_url: 'string',
|
|
7592
7592
|
lottie: 'string',
|
|
7593
7593
|
},
|
|
7594
|
-
defaults: { resizeMode: 'contain' },
|
|
7594
|
+
defaults: { style: { resizeMode: 'contain' } },
|
|
7595
7595
|
},
|
|
7596
7596
|
meta: {
|
|
7597
7597
|
desiredParent: ['>OnboardProvider', '>OnboardItem', '!=Onboard'],
|
|
@@ -7928,8 +7928,8 @@ export const patterns = [
|
|
|
7928
7928
|
},
|
|
7929
7929
|
},
|
|
7930
7930
|
defaults: {
|
|
7931
|
-
resizeMode: 'contain',
|
|
7932
7931
|
style: {
|
|
7932
|
+
resizeMode: 'contain',
|
|
7933
7933
|
flexDirection: 'column',
|
|
7934
7934
|
position: 'relative',
|
|
7935
7935
|
zIndex: 1,
|
|
@@ -7944,6 +7944,8 @@ export const patterns = [
|
|
|
7944
7944
|
schemaVersion: 2,
|
|
7945
7945
|
pattern: {
|
|
7946
7946
|
type: 'OnboardItem',
|
|
7947
|
+
title: 'title',
|
|
7948
|
+
description: 'description',
|
|
7947
7949
|
children: 'node',
|
|
7948
7950
|
attributes: {
|
|
7949
7951
|
scrollable: 'boolean',
|
|
@@ -7996,8 +7998,6 @@ export const patterns = [
|
|
|
7996
7998
|
right: 'size',
|
|
7997
7999
|
zIndex: 'number',
|
|
7998
8000
|
},
|
|
7999
|
-
title: 'title',
|
|
8000
|
-
description: 'description',
|
|
8001
8001
|
display: ['flex', 'block'],
|
|
8002
8002
|
gap: 'size',
|
|
8003
8003
|
flexDirection: ['row', 'column'],
|
|
@@ -8334,6 +8334,8 @@ export const patterns = [
|
|
|
8334
8334
|
schemaVersion: 2,
|
|
8335
8335
|
pattern: {
|
|
8336
8336
|
type: 'OnboardProvider',
|
|
8337
|
+
title: 'title',
|
|
8338
|
+
description: 'description',
|
|
8337
8339
|
children: 'node',
|
|
8338
8340
|
attributes: {
|
|
8339
8341
|
scrollable: 'boolean',
|
|
@@ -8386,8 +8388,6 @@ export const patterns = [
|
|
|
8386
8388
|
right: 'size',
|
|
8387
8389
|
zIndex: 'number',
|
|
8388
8390
|
},
|
|
8389
|
-
title: 'title',
|
|
8390
|
-
description: 'description',
|
|
8391
8391
|
theme: ['light', 'dark', 'all'],
|
|
8392
8392
|
borderRadius: 'never',
|
|
8393
8393
|
},
|
|
@@ -8720,10 +8720,10 @@ export const patterns = [
|
|
|
8720
8720
|
schemaVersion: 2,
|
|
8721
8721
|
pattern: {
|
|
8722
8722
|
type: 'OnboardSubtitle',
|
|
8723
|
+
title: 'title',
|
|
8724
|
+
description: 'description',
|
|
8723
8725
|
children: 'string',
|
|
8724
8726
|
attributes: {
|
|
8725
|
-
title: 'title',
|
|
8726
|
-
description: 'description',
|
|
8727
8727
|
adjustsFontSizeToFit: 'boolean',
|
|
8728
8728
|
showEllipsis: 'boolean',
|
|
8729
8729
|
style: {
|
|
@@ -9167,10 +9167,10 @@ export const patterns = [
|
|
|
9167
9167
|
schemaVersion: 2,
|
|
9168
9168
|
pattern: {
|
|
9169
9169
|
type: 'OnboardTitle',
|
|
9170
|
+
title: 'title',
|
|
9171
|
+
description: 'description',
|
|
9170
9172
|
children: 'string',
|
|
9171
9173
|
attributes: {
|
|
9172
|
-
title: 'title',
|
|
9173
|
-
description: 'description',
|
|
9174
9174
|
adjustsFontSizeToFit: 'boolean',
|
|
9175
9175
|
showEllipsis: 'boolean',
|
|
9176
9176
|
style: {
|
|
@@ -9615,10 +9615,10 @@ export const patterns = [
|
|
|
9615
9615
|
schemaVersion: 2,
|
|
9616
9616
|
pattern: {
|
|
9617
9617
|
type: 'PaywallBackground',
|
|
9618
|
+
title: 'title',
|
|
9619
|
+
description: 'description',
|
|
9618
9620
|
children: 'never',
|
|
9619
9621
|
attributes: {
|
|
9620
|
-
title: 'title',
|
|
9621
|
-
description: 'description',
|
|
9622
9622
|
src: 'string',
|
|
9623
9623
|
resizeMode: ['cover', 'contain', 'stretch', 'center'],
|
|
9624
9624
|
scrollable: 'boolean',
|
|
@@ -10028,10 +10028,10 @@ export const patterns = [
|
|
|
10028
10028
|
schemaVersion: 2,
|
|
10029
10029
|
pattern: {
|
|
10030
10030
|
type: 'PaywallCloseButton',
|
|
10031
|
+
title: 'title',
|
|
10032
|
+
description: 'description',
|
|
10031
10033
|
children: 'never',
|
|
10032
10034
|
attributes: {
|
|
10033
|
-
title: 'title',
|
|
10034
|
-
description: 'description',
|
|
10035
10035
|
iconType: 'iconType',
|
|
10036
10036
|
size: 'number',
|
|
10037
10037
|
strokeWidth: 'number',
|
|
@@ -10506,11 +10506,11 @@ export const patterns = [
|
|
|
10506
10506
|
schemaVersion: 2,
|
|
10507
10507
|
pattern: {
|
|
10508
10508
|
type: 'PaywallCounter',
|
|
10509
|
+
title: 'title',
|
|
10510
|
+
description: 'description',
|
|
10509
10511
|
children: 'never',
|
|
10510
10512
|
attributes: {
|
|
10511
10513
|
count: 'number',
|
|
10512
|
-
title: 'title',
|
|
10513
|
-
description: 'description',
|
|
10514
10514
|
adjustsFontSizeToFit: 'boolean',
|
|
10515
10515
|
showEllipsis: 'boolean',
|
|
10516
10516
|
style: {
|
|
@@ -10962,6 +10962,8 @@ export const patterns = [
|
|
|
10962
10962
|
schemaVersion: 2,
|
|
10963
10963
|
pattern: {
|
|
10964
10964
|
type: 'PaywallOptions',
|
|
10965
|
+
title: 'title',
|
|
10966
|
+
description: 'description',
|
|
10965
10967
|
children: 'node',
|
|
10966
10968
|
attributes: {
|
|
10967
10969
|
scrollable: 'boolean',
|
|
@@ -11014,8 +11016,6 @@ export const patterns = [
|
|
|
11014
11016
|
right: 'size',
|
|
11015
11017
|
zIndex: 'number',
|
|
11016
11018
|
},
|
|
11017
|
-
title: 'title',
|
|
11018
|
-
description: 'description',
|
|
11019
11019
|
},
|
|
11020
11020
|
},
|
|
11021
11021
|
meta: {
|
|
@@ -11343,6 +11343,8 @@ export const patterns = [
|
|
|
11343
11343
|
schemaVersion: 2,
|
|
11344
11344
|
pattern: {
|
|
11345
11345
|
type: 'PaywallProvider',
|
|
11346
|
+
title: 'title',
|
|
11347
|
+
description: 'description',
|
|
11346
11348
|
children: 'node',
|
|
11347
11349
|
attributes: {
|
|
11348
11350
|
scrollable: 'boolean',
|
|
@@ -11395,8 +11397,6 @@ export const patterns = [
|
|
|
11395
11397
|
right: 'size',
|
|
11396
11398
|
zIndex: 'number',
|
|
11397
11399
|
},
|
|
11398
|
-
title: 'title',
|
|
11399
|
-
description: 'description',
|
|
11400
11400
|
delay: 'number',
|
|
11401
11401
|
},
|
|
11402
11402
|
},
|
|
@@ -11733,10 +11733,10 @@ export const patterns = [
|
|
|
11733
11733
|
schemaVersion: 2,
|
|
11734
11734
|
pattern: {
|
|
11735
11735
|
type: 'PaywallSubscribeButton',
|
|
11736
|
+
title: 'title',
|
|
11737
|
+
description: 'description',
|
|
11736
11738
|
children: 'string',
|
|
11737
11739
|
attributes: {
|
|
11738
|
-
title: 'title',
|
|
11739
|
-
description: 'description',
|
|
11740
11740
|
style: {
|
|
11741
11741
|
color: 'color',
|
|
11742
11742
|
fontSize: 'size',
|
|
@@ -12157,6 +12157,8 @@ export const patterns = [
|
|
|
12157
12157
|
schemaVersion: 2,
|
|
12158
12158
|
pattern: {
|
|
12159
12159
|
type: 'RadioButton',
|
|
12160
|
+
title: 'title',
|
|
12161
|
+
description: 'description',
|
|
12160
12162
|
children: 'never',
|
|
12161
12163
|
attributes: {
|
|
12162
12164
|
scrollable: 'boolean',
|
|
@@ -12209,8 +12211,6 @@ export const patterns = [
|
|
|
12209
12211
|
right: 'size',
|
|
12210
12212
|
zIndex: 'number',
|
|
12211
12213
|
},
|
|
12212
|
-
title: 'title',
|
|
12213
|
-
description: 'description',
|
|
12214
12214
|
selected: 'boolean',
|
|
12215
12215
|
color: 'color',
|
|
12216
12216
|
size: 'number',
|
|
@@ -12559,10 +12559,10 @@ export const patterns = [
|
|
|
12559
12559
|
schemaVersion: 2,
|
|
12560
12560
|
pattern: {
|
|
12561
12561
|
type: 'Separator',
|
|
12562
|
+
title: 'title',
|
|
12563
|
+
description: 'description',
|
|
12562
12564
|
children: 'never',
|
|
12563
12565
|
attributes: {
|
|
12564
|
-
title: 'title',
|
|
12565
|
-
description: 'description',
|
|
12566
12566
|
style: {
|
|
12567
12567
|
backgroundColor: 'color',
|
|
12568
12568
|
width: 'size',
|
|
@@ -12614,6 +12614,8 @@ export const patterns = [
|
|
|
12614
12614
|
schemaVersion: 2,
|
|
12615
12615
|
pattern: {
|
|
12616
12616
|
type: 'StatusBarColor',
|
|
12617
|
+
title: 'title',
|
|
12618
|
+
description: 'description',
|
|
12617
12619
|
children: 'never',
|
|
12618
12620
|
attributes: {
|
|
12619
12621
|
scrollable: 'boolean',
|
|
@@ -12666,8 +12668,6 @@ export const patterns = [
|
|
|
12666
12668
|
right: 'size',
|
|
12667
12669
|
zIndex: 'number',
|
|
12668
12670
|
},
|
|
12669
|
-
title: 'title',
|
|
12670
|
-
description: 'description',
|
|
12671
12671
|
},
|
|
12672
12672
|
},
|
|
12673
12673
|
meta: {
|
|
@@ -12993,6 +12993,8 @@ export const patterns = [
|
|
|
12993
12993
|
schemaVersion: 2,
|
|
12994
12994
|
pattern: {
|
|
12995
12995
|
type: 'Text',
|
|
12996
|
+
title: 'title',
|
|
12997
|
+
description: 'description',
|
|
12996
12998
|
children: 'string',
|
|
12997
12999
|
attributes: {
|
|
12998
13000
|
scrollable: 'boolean',
|
|
@@ -13050,8 +13052,6 @@ export const patterns = [
|
|
|
13050
13052
|
fontWeight: 'fontWeight',
|
|
13051
13053
|
textAlign: ['left', 'center', 'right', 'justify'],
|
|
13052
13054
|
},
|
|
13053
|
-
title: 'title',
|
|
13054
|
-
description: 'description',
|
|
13055
13055
|
adjustsFontSizeToFit: 'boolean',
|
|
13056
13056
|
showEllipsis: 'boolean',
|
|
13057
13057
|
},
|
|
@@ -13440,6 +13440,8 @@ export const patterns = [
|
|
|
13440
13440
|
schemaVersion: 2,
|
|
13441
13441
|
pattern: {
|
|
13442
13442
|
type: 'View',
|
|
13443
|
+
title: 'title',
|
|
13444
|
+
description: 'description',
|
|
13443
13445
|
children: 'node',
|
|
13444
13446
|
attributes: {
|
|
13445
13447
|
scrollable: 'boolean',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
1
2
|
import { AttributesEditor } from '../AttributesEditor';
|
|
2
3
|
import type { Node, NodeData } from '../types/Node';
|
|
3
4
|
import type { ProjectColors } from '../types/Project';
|
|
@@ -11,6 +12,32 @@ interface AttributesEditorPanelProps {
|
|
|
11
12
|
projectColors?: ProjectColors;
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
function replaceNode(root: Node, target: Node, next: Node): Node {
|
|
16
|
+
if (root === target) return next;
|
|
17
|
+
if (root === null || root === undefined) return root;
|
|
18
|
+
if (typeof root === 'string') return root;
|
|
19
|
+
if (Array.isArray(root)) {
|
|
20
|
+
let changed = false;
|
|
21
|
+
const arr = root.map((item) => {
|
|
22
|
+
const r = replaceNode(item, target, next);
|
|
23
|
+
if (r !== item) changed = true;
|
|
24
|
+
return r;
|
|
25
|
+
});
|
|
26
|
+
return changed ? arr : root;
|
|
27
|
+
}
|
|
28
|
+
const data = root as NodeData;
|
|
29
|
+
if ('children' in data) {
|
|
30
|
+
const prev = data.children;
|
|
31
|
+
const replaced = Array.isArray(prev)
|
|
32
|
+
? prev.map((c: Node) => replaceNode(c, target, next))
|
|
33
|
+
: replaceNode(prev as Node, target, next);
|
|
34
|
+
if (replaced !== prev) {
|
|
35
|
+
return { ...data, children: replaced } as Node;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return root;
|
|
39
|
+
}
|
|
40
|
+
|
|
14
41
|
export function AttributesEditorPanel({
|
|
15
42
|
attributes,
|
|
16
43
|
onChange,
|
|
@@ -21,6 +48,27 @@ export function AttributesEditorPanel({
|
|
|
21
48
|
current: s.current,
|
|
22
49
|
setCurrent: s.setCurrent,
|
|
23
50
|
}));
|
|
51
|
+
|
|
52
|
+
// Stable refs so the onChange callback doesn't change identity every render.
|
|
53
|
+
const attributesRef = useRef(attributes);
|
|
54
|
+
attributesRef.current = attributes;
|
|
55
|
+
const currentRef = useRef(current);
|
|
56
|
+
currentRef.current = current;
|
|
57
|
+
const onChangeRef = useRef(onChange);
|
|
58
|
+
onChangeRef.current = onChange;
|
|
59
|
+
|
|
60
|
+
const handleAttributesChange = useCallback(
|
|
61
|
+
(next: Node) => {
|
|
62
|
+
const root = attributesRef.current as Node;
|
|
63
|
+
const target = currentRef.current;
|
|
64
|
+
if (!target) return;
|
|
65
|
+
const updated = replaceNode(root, target, next);
|
|
66
|
+
onChangeRef.current(updated);
|
|
67
|
+
setCurrent(next);
|
|
68
|
+
},
|
|
69
|
+
[setCurrent],
|
|
70
|
+
);
|
|
71
|
+
|
|
24
72
|
if (!current) return null;
|
|
25
73
|
|
|
26
74
|
const currentKey =
|
|
@@ -33,38 +81,6 @@ export function AttributesEditorPanel({
|
|
|
33
81
|
: null;
|
|
34
82
|
const nodeForEditor = resolvedCurrent ?? current;
|
|
35
83
|
|
|
36
|
-
function replaceNode(root: Node, target: Node, next: Node): Node {
|
|
37
|
-
if (root === target) return next;
|
|
38
|
-
if (root === null || root === undefined) return root;
|
|
39
|
-
if (typeof root === 'string') return root;
|
|
40
|
-
if (Array.isArray(root)) {
|
|
41
|
-
let changed = false;
|
|
42
|
-
const arr = root.map((item) => {
|
|
43
|
-
const r = replaceNode(item, target, next);
|
|
44
|
-
if (r !== item) changed = true;
|
|
45
|
-
return r;
|
|
46
|
-
});
|
|
47
|
-
return changed ? arr : root;
|
|
48
|
-
}
|
|
49
|
-
const data = root as NodeData;
|
|
50
|
-
if ('children' in data) {
|
|
51
|
-
const prev = data.children;
|
|
52
|
-
const replaced = Array.isArray(prev)
|
|
53
|
-
? prev.map((c: Node) => replaceNode(c, target, next))
|
|
54
|
-
: replaceNode(prev as Node, target, next);
|
|
55
|
-
if (replaced !== prev) {
|
|
56
|
-
return { ...data, children: replaced } as Node;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return root;
|
|
60
|
-
}
|
|
61
|
-
const handleAttributesChange = (next: Node) => {
|
|
62
|
-
const root = attributes as Node;
|
|
63
|
-
const updated = replaceNode(root, current, next);
|
|
64
|
-
onChange(updated);
|
|
65
|
-
setCurrent(next);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
84
|
return (
|
|
69
85
|
<div className="attributes-editor-panel">
|
|
70
86
|
<AttributesEditor
|
|
@@ -603,7 +603,10 @@ function getNodeLabel(node: Node): string {
|
|
|
603
603
|
if (isNodeNullOrUndefined(node)) return 'Empty';
|
|
604
604
|
if (isNodeString(node)) return node as string;
|
|
605
605
|
if (isNodeArray(node)) return 'Collection';
|
|
606
|
-
|
|
606
|
+
const nodeData = node as NodeData<NodeDefaultAttribute>;
|
|
607
|
+
const title = (nodeData.attributes as Record<string, unknown>)?.title;
|
|
608
|
+
if (typeof title === 'string' && title.trim().length > 0) return title;
|
|
609
|
+
return nodeData.type ?? 'Node';
|
|
607
610
|
}
|
|
608
611
|
|
|
609
612
|
function findNodePath(root: Node, target: Node): Node[] {
|
package/src/index.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// Types
|
|
14
14
|
export type { TargetedScreenSize } from './types/TargetedScreenSize';
|
|
15
15
|
export type { Node, NodeData, NodeDefaultAttribute } from './types/Node';
|
|
16
|
-
export type { Project, ProjectColors } from './types/Project';
|
|
16
|
+
export type { Project, ProjectColors, ProjectMeta } from './types/Project';
|
|
17
17
|
export type { Device } from './types/Device';
|
|
18
18
|
export type { AppConfig, Localication } from './types/PreviewConfig';
|
|
19
19
|
export { defaultAppConfig } from './types/PreviewConfig';
|