@developer_tribe/react-builder 1.2.39 → 1.2.40
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/NavigationBarColor/NavigationBarColorProps.generated.d.ts +1 -40
- package/dist/build-components/StatusBarColor/StatusBarColorProps.generated.d.ts +1 -1
- package/dist/build-components/patterns.generated.d.ts +21 -344
- package/dist/components/BuilderProvider.d.ts +1 -0
- package/dist/components/DeviceButton.d.ts +4 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- 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 +4 -4
- package/dist/index.web.esm.js.map +1 -1
- package/dist/mockOS/context/MockOSContext.d.ts +3 -1
- package/dist/size-matters/index.d.ts +1 -1
- package/dist/store.d.ts +6 -0
- package/dist/styles.css +1 -1
- package/dist/types/Device.d.ts +5 -0
- package/dist/utils/extractTextStyle/extractTextStyle.d.ts +1 -0
- package/dist/utils/extractViewStyle/extractViewStyle.d.ts +1 -0
- package/package.json +1 -1
- package/scripts/prebuild/assets/prompt_scheme.md +7 -0
- package/src/DeviceMockFrame.tsx +8 -0
- package/src/RenderPage.tsx +3 -0
- package/src/assets/devices.json +747 -183
- package/src/assets/meta.json +1 -1
- package/src/assets/prompt-scheme-onboard.generated.ts +1 -1
- package/src/assets/prompt-scheme-paywall.generated.ts +1 -1
- package/src/assets/samples/carousel-sample.json +30 -26
- package/src/assets/samples/paywall-1.json +30 -30
- package/src/assets/samples/paywall-2.json +26 -26
- package/src/assets/samples/paywall-app-delete-offer.json +27 -27
- package/src/assets/samples/paywall-app-open-offer.json +27 -27
- package/src/assets/samples/paywall-back-offer.json +27 -27
- package/src/assets/samples/paywall-notification-offer.json +27 -27
- package/src/assets/samples/simple-1.json +4 -4
- package/src/assets/samples/simple-2.json +25 -25
- package/src/assets/samples/unmigrated-builder-1.1.1.json +7 -7
- package/src/assets/samples/unmigrated-builder1.json +4 -4
- package/src/assets/samples/unvalidated-builder1.json +4 -4
- package/src/assets/samples/unvalidated-crash1.json +2 -2
- package/src/assets/samples/unvalidated-crashcomponent1.json +2 -2
- package/src/assets/samples/vpn-onboard-1.json +30 -30
- package/src/assets/samples/vpn-onboard-2.json +30 -30
- package/src/assets/samples/vpn-onboard-3.json +27 -27
- package/src/assets/samples/vpn-onboard-4.json +27 -27
- package/src/assets/samples/vpn-onboard-5.json +40 -40
- package/src/assets/samples/vpn-onboard-6.json +30 -30
- package/src/assets/samples/vpn-onboard-7.json +29 -29
- package/src/attribute-analyser/style/web/useExtractImageStyle.ts +8 -3
- package/src/attribute-analyser/style/web/useExtractViewStyle.ts +8 -3
- package/src/build-components/CarouselDots/CarouselDots.tsx +8 -3
- package/src/build-components/Main/Main.tsx +3 -1
- package/src/build-components/NavigationBarColor/NavigationBarColor.tsx +15 -1
- package/src/build-components/NavigationBarColor/NavigationBarColorProps.generated.ts +1 -52
- package/src/build-components/NavigationBarColor/pattern.json +11 -2
- package/src/build-components/OnboardDot/OnboardDot.tsx +3 -2
- package/src/build-components/PaywallCloseButton/pattern.json +1 -0
- package/src/build-components/StatusBarColor/StatusBarColor.tsx +15 -1
- package/src/build-components/StatusBarColor/StatusBarColorProps.generated.ts +1 -1
- package/src/build-components/StatusBarColor/pattern.json +10 -1
- package/src/build-components/patterns.generated.ts +25 -364
- package/src/components/BuilderProvider.tsx +1 -0
- package/src/components/DeviceButton.tsx +35 -0
- package/src/components/EditorHeader.tsx +16 -1
- package/src/hooks/useSafeAreaViewStyle.ts +24 -4
- package/src/mockOS/context/MockOSContext.tsx +41 -13
- package/src/modals/DeviceSelectorModal.tsx +94 -10
- package/src/product-base/extractAndroidParams.ts +38 -8
- package/src/size-matters/index.ts +15 -9
- package/src/store.ts +27 -0
- package/src/styles/modals/_product-edit-modal.scss +2 -2
- package/src/types/Device.ts +5 -0
- package/src/utils/analyseNodeByPatterns.ts +6 -2
- package/src/utils/extractTextStyle/extractTextStyle.ts +3 -1
- package/src/utils/extractTextStyle/extractTextStyleNative.ts +1 -1
- package/src/utils/extractViewStyle/extractViewStyle.ts +19 -5
- package/src/utils/extractViewStyle/extractViewStyleNative.ts +5 -1
- package/src/utils/replaceLocalizationParams.ts +5 -7
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"styles": {
|
|
14
14
|
"paddingBottom": 16
|
|
15
15
|
},
|
|
16
|
-
"testID": "Main-test-id"
|
|
16
|
+
"testID": "Main-test-id-1"
|
|
17
17
|
},
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"styles": {
|
|
25
25
|
"backgroundColor": "THEME_COLORS.BACKGROUND"
|
|
26
26
|
},
|
|
27
|
-
"testID": "StatusBarColor-test-id"
|
|
27
|
+
"testID": "StatusBarColor-test-id-1"
|
|
28
28
|
},
|
|
29
29
|
"children": null,
|
|
30
30
|
"key": "StatusBarColor-sxj19suwkrn"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"styles": {
|
|
38
38
|
"backgroundColor": "THEME_COLORS.BACKGROUND"
|
|
39
39
|
},
|
|
40
|
-
"testID": "NavigationBarColor-test-id"
|
|
40
|
+
"testID": "NavigationBarColor-test-id-1"
|
|
41
41
|
},
|
|
42
42
|
"children": null,
|
|
43
43
|
"key": "NavigationBarColor-rhzn570dc5o"
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"marginTop": 40,
|
|
64
64
|
"fontSize": "28@fs"
|
|
65
65
|
},
|
|
66
|
-
"testID": "OnboardTitle-test-id"
|
|
66
|
+
"testID": "OnboardTitle-test-id-1"
|
|
67
67
|
},
|
|
68
68
|
"children": "base.onboard.title.one-page",
|
|
69
69
|
"key": "OnboardTitle-5t0p86nj13m"
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"styles": {
|
|
77
77
|
"height": 350
|
|
78
78
|
},
|
|
79
|
-
"testID": "OnboardImage-test-id",
|
|
79
|
+
"testID": "OnboardImage-test-id-1",
|
|
80
80
|
"fetchStrategy": "highIfItsAppLaunch"
|
|
81
81
|
}
|
|
82
82
|
},
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"textAlign": "center",
|
|
92
92
|
"paddingTop": "30@vs"
|
|
93
93
|
},
|
|
94
|
-
"testID": "OnboardSubtitle-test-id"
|
|
94
|
+
"testID": "OnboardSubtitle-test-id-1"
|
|
95
95
|
},
|
|
96
96
|
"children": "base.onboard.subtitle.one-page",
|
|
97
97
|
"key": "OnboardSubtitle-0max8wno7l5b"
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"attributes": {
|
|
101
101
|
"description": "Onboarding sayfası. (#1)",
|
|
102
102
|
"title": "OnboardItem 1",
|
|
103
|
-
"testID": "OnboardItem-test-id"
|
|
103
|
+
"testID": "OnboardItem-test-id-1"
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
{
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"marginTop": 40,
|
|
119
119
|
"fontSize": "28@fs"
|
|
120
120
|
},
|
|
121
|
-
"testID": "OnboardTitle-test-id"
|
|
121
|
+
"testID": "OnboardTitle-test-id-2"
|
|
122
122
|
},
|
|
123
123
|
"children": "base.onboard.title.two-page",
|
|
124
124
|
"key": "OnboardTitle-ne9iihu925k"
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"styles": {
|
|
132
132
|
"height": 350
|
|
133
133
|
},
|
|
134
|
-
"testID": "OnboardImage-test-id",
|
|
134
|
+
"testID": "OnboardImage-test-id-2",
|
|
135
135
|
"fetchStrategy": "normal"
|
|
136
136
|
}
|
|
137
137
|
},
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"textAlign": "center",
|
|
147
147
|
"paddingTop": "30@vs"
|
|
148
148
|
},
|
|
149
|
-
"testID": "OnboardSubtitle-test-id"
|
|
149
|
+
"testID": "OnboardSubtitle-test-id-2"
|
|
150
150
|
},
|
|
151
151
|
"children": "base.onboard.subtitle.two-page",
|
|
152
152
|
"key": "OnboardSubtitle-jq9469r7c2"
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"attributes": {
|
|
156
156
|
"description": "Onboarding sayfası. (#2)",
|
|
157
157
|
"title": "OnboardItem 2",
|
|
158
|
-
"testID": "OnboardItem-test-id"
|
|
158
|
+
"testID": "OnboardItem-test-id-2"
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
161
|
{
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"marginTop": 40,
|
|
174
174
|
"fontSize": "28@fs"
|
|
175
175
|
},
|
|
176
|
-
"testID": "OnboardTitle-test-id"
|
|
176
|
+
"testID": "OnboardTitle-test-id-3"
|
|
177
177
|
},
|
|
178
178
|
"children": "base.onboard.title.three-page",
|
|
179
179
|
"key": "OnboardTitle-hczvlbg7gqj"
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"styles": {
|
|
187
187
|
"height": 350
|
|
188
188
|
},
|
|
189
|
-
"testID": "OnboardImage-test-id",
|
|
189
|
+
"testID": "OnboardImage-test-id-3",
|
|
190
190
|
"fetchStrategy": "normal"
|
|
191
191
|
}
|
|
192
192
|
},
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
"textAlign": "center",
|
|
202
202
|
"paddingTop": "30@vs"
|
|
203
203
|
},
|
|
204
|
-
"testID": "OnboardSubtitle-test-id"
|
|
204
|
+
"testID": "OnboardSubtitle-test-id-3"
|
|
205
205
|
},
|
|
206
206
|
"children": "base.onboard.subtitle.three-page",
|
|
207
207
|
"key": "OnboardSubtitle-rufjwid9yug"
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
"attributes": {
|
|
211
211
|
"description": "Onboarding sayfası. (#3)",
|
|
212
212
|
"title": "OnboardItem 3",
|
|
213
|
-
"testID": "OnboardItem-test-id"
|
|
213
|
+
"testID": "OnboardItem-test-id-3"
|
|
214
214
|
}
|
|
215
215
|
},
|
|
216
216
|
{
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
"marginTop": 40,
|
|
229
229
|
"fontSize": "28@fs"
|
|
230
230
|
},
|
|
231
|
-
"testID": "OnboardTitle-test-id"
|
|
231
|
+
"testID": "OnboardTitle-test-id-4"
|
|
232
232
|
},
|
|
233
233
|
"children": "base.onboard.title.four-page",
|
|
234
234
|
"key": "OnboardTitle-f2ekfc0wcbl"
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
"styles": {
|
|
242
242
|
"height": 350
|
|
243
243
|
},
|
|
244
|
-
"testID": "OnboardImage-test-id",
|
|
244
|
+
"testID": "OnboardImage-test-id-4",
|
|
245
245
|
"fetchStrategy": "normal"
|
|
246
246
|
}
|
|
247
247
|
},
|
|
@@ -256,7 +256,7 @@
|
|
|
256
256
|
"textAlign": "center",
|
|
257
257
|
"paddingTop": "30@vs"
|
|
258
258
|
},
|
|
259
|
-
"testID": "OnboardSubtitle-test-id"
|
|
259
|
+
"testID": "OnboardSubtitle-test-id-4"
|
|
260
260
|
},
|
|
261
261
|
"children": "base.onboard.subtitle.four-page",
|
|
262
262
|
"key": "OnboardSubtitle-qkw2jn84xem"
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
"attributes": {
|
|
266
266
|
"description": "Onboarding sayfası. (#4)",
|
|
267
267
|
"title": "OnboardItem 4",
|
|
268
|
-
"testID": "OnboardItem-test-id"
|
|
268
|
+
"testID": "OnboardItem-test-id-4"
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
],
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
"styles": {
|
|
276
276
|
"flex": 1
|
|
277
277
|
},
|
|
278
|
-
"testID": "Onboard-test-id"
|
|
278
|
+
"testID": "Onboard-test-id-1"
|
|
279
279
|
},
|
|
280
280
|
"key": "Onboard-dg1zmwdawmg"
|
|
281
281
|
},
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"paddingVertical": 12,
|
|
291
291
|
"dot_thickness": "10@s"
|
|
292
292
|
},
|
|
293
|
-
"testID": "OnboardDot-test-id"
|
|
293
|
+
"testID": "OnboardDot-test-id-1"
|
|
294
294
|
}
|
|
295
295
|
},
|
|
296
296
|
{
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
"flexShrink": 0,
|
|
308
308
|
"paddingBottom": "5@s"
|
|
309
309
|
},
|
|
310
|
-
"testID": "OnboardButtons-test-id"
|
|
310
|
+
"testID": "OnboardButtons-test-id-1"
|
|
311
311
|
},
|
|
312
312
|
"children": [
|
|
313
313
|
{
|
|
@@ -365,7 +365,7 @@
|
|
|
365
365
|
"flexShrink": 0,
|
|
366
366
|
"paddingBottom": "5@s"
|
|
367
367
|
},
|
|
368
|
-
"testID": "OnboardButtons-test-id"
|
|
368
|
+
"testID": "OnboardButtons-test-id-2"
|
|
369
369
|
},
|
|
370
370
|
"children": [
|
|
371
371
|
{
|
|
@@ -431,7 +431,7 @@
|
|
|
431
431
|
"flexShrink": 0,
|
|
432
432
|
"paddingBottom": "5@s"
|
|
433
433
|
},
|
|
434
|
-
"testID": "OnboardButtons-test-id"
|
|
434
|
+
"testID": "OnboardButtons-test-id-3"
|
|
435
435
|
},
|
|
436
436
|
"children": [
|
|
437
437
|
{
|
|
@@ -493,7 +493,7 @@
|
|
|
493
493
|
"flexShrink": 0,
|
|
494
494
|
"paddingBottom": "5@s"
|
|
495
495
|
},
|
|
496
|
-
"testID": "OnboardButtons-test-id"
|
|
496
|
+
"testID": "OnboardButtons-test-id-4"
|
|
497
497
|
},
|
|
498
498
|
"children": [
|
|
499
499
|
{
|
|
@@ -530,7 +530,7 @@
|
|
|
530
530
|
"marginHorizontal": 25,
|
|
531
531
|
"flexShrink": 0
|
|
532
532
|
},
|
|
533
|
-
"testID": "View-test-id"
|
|
533
|
+
"testID": "View-test-id-1"
|
|
534
534
|
},
|
|
535
535
|
"children": [
|
|
536
536
|
{
|
|
@@ -548,7 +548,7 @@
|
|
|
548
548
|
"color": "THEME_COLORS.ONBOARD_FOOTER_TEXT",
|
|
549
549
|
"fontSize": "12@fs"
|
|
550
550
|
},
|
|
551
|
-
"testID": "OnboardFooter-test-id"
|
|
551
|
+
"testID": "OnboardFooter-test-id-1"
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
],
|
|
@@ -559,13 +559,13 @@
|
|
|
559
559
|
"theme": "dark",
|
|
560
560
|
"description": "Onboarding sağlayıcısı. (#1)",
|
|
561
561
|
"title": "OnboardProvider 1",
|
|
562
|
-
"testID": "OnboardProvider-test-id"
|
|
562
|
+
"testID": "OnboardProvider-test-id-1"
|
|
563
563
|
},
|
|
564
564
|
"key": "OnboardProvider-pvc5b6o5gu"
|
|
565
565
|
}
|
|
566
566
|
]
|
|
567
567
|
},
|
|
568
568
|
"attributes": {
|
|
569
|
-
"testID": "onboard-test-id"
|
|
569
|
+
"testID": "onboard-test-id-1"
|
|
570
570
|
}
|
|
571
571
|
}
|
|
@@ -8,10 +8,15 @@ import { extractImageStyle } from '../../../utils/extractImageStyle';
|
|
|
8
8
|
export function useExtractImageStyle<
|
|
9
9
|
T extends ImagePropsGenerated['attributes'],
|
|
10
10
|
>(node: NodeData<T>): CSSProperties {
|
|
11
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
selectedTheme: theme,
|
|
13
|
+
projectColors,
|
|
14
|
+
baseSize,
|
|
15
|
+
device,
|
|
16
|
+
} = useBuilderParams();
|
|
12
17
|
|
|
13
18
|
return useMemo(
|
|
14
|
-
() => extractImageStyle(node, { theme, projectColors, baseSize }),
|
|
15
|
-
[node, theme, projectColors, baseSize],
|
|
19
|
+
() => extractImageStyle(node, { theme, projectColors, baseSize, device }),
|
|
20
|
+
[node, theme, projectColors, baseSize, device],
|
|
16
21
|
);
|
|
17
22
|
}
|
|
@@ -8,10 +8,15 @@ import { extractViewStyle } from '../../../utils/extractViewStyle';
|
|
|
8
8
|
export function useExtractViewStyle<T extends ViewPropsGenerated['attributes']>(
|
|
9
9
|
node: NodeData<T>,
|
|
10
10
|
): CSSProperties {
|
|
11
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
selectedTheme: theme,
|
|
13
|
+
projectColors,
|
|
14
|
+
baseSize,
|
|
15
|
+
device,
|
|
16
|
+
} = useBuilderParams();
|
|
12
17
|
|
|
13
18
|
return useMemo(
|
|
14
|
-
() => extractViewStyle(node, { theme, projectColors, baseSize }),
|
|
15
|
-
[node, theme, projectColors, baseSize],
|
|
19
|
+
() => extractViewStyle(node, { theme, projectColors, baseSize, device }),
|
|
20
|
+
[node, theme, projectColors, baseSize, device],
|
|
16
21
|
);
|
|
17
22
|
}
|
|
@@ -34,7 +34,12 @@ function CarouselDots({ node }: CarouselDotsComponentProps) {
|
|
|
34
34
|
const onboardApi = useContext(onboardContext);
|
|
35
35
|
const emblaApi = isOnboard ? onboardApi?.emblaApi : carouselApi;
|
|
36
36
|
|
|
37
|
-
const {
|
|
37
|
+
const {
|
|
38
|
+
selectedTheme: theme,
|
|
39
|
+
projectColors,
|
|
40
|
+
baseSize,
|
|
41
|
+
device,
|
|
42
|
+
} = useBuilderParams();
|
|
38
43
|
const inactiveDotOpacity =
|
|
39
44
|
(stylesBag?.inactive_dot_opacity as number | undefined) ??
|
|
40
45
|
(attrRecord.inactive_dot_opacity as number | undefined) ??
|
|
@@ -59,12 +64,12 @@ function CarouselDots({ node }: CarouselDotsComponentProps) {
|
|
|
59
64
|
);
|
|
60
65
|
|
|
61
66
|
const dotSizeCss = useMemo(() => {
|
|
62
|
-
const parsed = parseSize(dotThicknessRaw, baseSize);
|
|
67
|
+
const parsed = parseSize(dotThicknessRaw, baseSize, device!);
|
|
63
68
|
if (parsed === undefined) return '10px';
|
|
64
69
|
if (typeof parsed === 'number') return `${parsed}px`;
|
|
65
70
|
if (typeof parsed === 'string' && parsed.trim()) return parsed;
|
|
66
71
|
return '10px';
|
|
67
|
-
}, [dotThicknessRaw, baseSize]);
|
|
72
|
+
}, [dotThicknessRaw, baseSize, device]);
|
|
68
73
|
|
|
69
74
|
const dotGapCss = useMemo((): string => {
|
|
70
75
|
const px =
|
|
@@ -4,6 +4,7 @@ import RenderNode from '../RenderNode.generated';
|
|
|
4
4
|
import type { Node } from '../../types/Node';
|
|
5
5
|
import useNode from '../useNode';
|
|
6
6
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
7
|
+
import { useRenderStore } from '../../store';
|
|
7
8
|
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
8
9
|
import { useLogRender } from '../../utils/useLogRender';
|
|
9
10
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
@@ -19,11 +20,12 @@ function Main({ node }: MainComponentProps) {
|
|
|
19
20
|
const attributeKey = node.key ?? generatedId;
|
|
20
21
|
|
|
21
22
|
const { previewMode, selectedKey } = useBuilderParams();
|
|
23
|
+
const device = useRenderStore((s) => s.device);
|
|
22
24
|
|
|
23
25
|
const baseStyle = useExtractViewStyle(node);
|
|
24
26
|
|
|
25
27
|
const useSafeAreaView = node.attributes?.useSafeAreaView ?? true;
|
|
26
|
-
const layoutStyle = useSafeAreaViewStyle(baseStyle, useSafeAreaView);
|
|
28
|
+
const layoutStyle = useSafeAreaViewStyle(baseStyle, useSafeAreaView, device);
|
|
27
29
|
|
|
28
30
|
const isSelected = isNodeSelected({
|
|
29
31
|
previewMode: !!previewMode,
|
|
@@ -15,6 +15,9 @@ function NavigationBarColor({ node }: NavigationBarColorComponentProps) {
|
|
|
15
15
|
const setNavBarOverrideColor = useRenderStore(
|
|
16
16
|
(s) => s.setNavBarOverrideColor,
|
|
17
17
|
);
|
|
18
|
+
const setNavBarOverrideTranslucent = useRenderStore(
|
|
19
|
+
(s) => s.setNavBarOverrideTranslucent,
|
|
20
|
+
);
|
|
18
21
|
|
|
19
22
|
const rawBg = getStyleBag(node.attributes)?.backgroundColor as
|
|
20
23
|
| string
|
|
@@ -24,14 +27,25 @@ function NavigationBarColor({ node }: NavigationBarColorComponentProps) {
|
|
|
24
27
|
theme,
|
|
25
28
|
});
|
|
26
29
|
|
|
30
|
+
const translucent = node.attributes?.translucent;
|
|
31
|
+
|
|
27
32
|
useEffect(() => {
|
|
28
33
|
if (resolvedColor) {
|
|
29
34
|
setNavBarOverrideColor(resolvedColor);
|
|
30
35
|
}
|
|
36
|
+
if (translucent !== undefined) {
|
|
37
|
+
setNavBarOverrideTranslucent(translucent);
|
|
38
|
+
}
|
|
31
39
|
return () => {
|
|
32
40
|
setNavBarOverrideColor(null);
|
|
41
|
+
setNavBarOverrideTranslucent(null);
|
|
33
42
|
};
|
|
34
|
-
}, [
|
|
43
|
+
}, [
|
|
44
|
+
resolvedColor,
|
|
45
|
+
setNavBarOverrideColor,
|
|
46
|
+
translucent,
|
|
47
|
+
setNavBarOverrideTranslucent,
|
|
48
|
+
]);
|
|
35
49
|
|
|
36
50
|
return null;
|
|
37
51
|
}
|
|
@@ -2,66 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import type { NodeData } from '../../types/Node';
|
|
4
4
|
|
|
5
|
-
export type FlexDirectionOptionType = 'row' | 'column';
|
|
6
|
-
export type FlexWrapOptionType = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
7
|
-
export type AlignItemsOptionType =
|
|
8
|
-
| 'flex-start'
|
|
9
|
-
| 'center'
|
|
10
|
-
| 'flex-end'
|
|
11
|
-
| 'stretch'
|
|
12
|
-
| 'baseline';
|
|
13
|
-
export type JustifyContentOptionType =
|
|
14
|
-
| 'flex-start'
|
|
15
|
-
| 'center'
|
|
16
|
-
| 'flex-end'
|
|
17
|
-
| 'space-between'
|
|
18
|
-
| 'space-around'
|
|
19
|
-
| 'space-evenly';
|
|
20
|
-
export type PositionOptionType = 'relative' | 'absolute';
|
|
21
|
-
|
|
22
5
|
export interface NavigationBarColorStyleGenerated {
|
|
23
|
-
flexDirection?: FlexDirectionOptionType;
|
|
24
|
-
flexWrap?: FlexWrapOptionType;
|
|
25
|
-
alignItems?: AlignItemsOptionType;
|
|
26
|
-
justifyContent?: JustifyContentOptionType;
|
|
27
|
-
gap?: string;
|
|
28
|
-
padding?: string;
|
|
29
|
-
paddingHorizontal?: string;
|
|
30
|
-
paddingVertical?: string;
|
|
31
|
-
paddingTop?: string;
|
|
32
|
-
paddingBottom?: string;
|
|
33
|
-
paddingLeft?: string;
|
|
34
|
-
paddingRight?: string;
|
|
35
|
-
margin?: string;
|
|
36
|
-
marginHorizontal?: string;
|
|
37
|
-
marginVertical?: string;
|
|
38
|
-
marginTop?: string;
|
|
39
|
-
marginBottom?: string;
|
|
40
|
-
marginLeft?: string;
|
|
41
|
-
marginRight?: string;
|
|
42
6
|
backgroundColor?: string;
|
|
43
|
-
borderRadius?: string;
|
|
44
|
-
width?: string;
|
|
45
|
-
minWidth?: string;
|
|
46
|
-
maxWidth?: string;
|
|
47
|
-
height?: string;
|
|
48
|
-
minHeight?: string;
|
|
49
|
-
maxHeight?: string;
|
|
50
|
-
flex?: number;
|
|
51
|
-
position?: PositionOptionType;
|
|
52
|
-
top?: string;
|
|
53
|
-
bottom?: string;
|
|
54
|
-
left?: string;
|
|
55
|
-
right?: string;
|
|
56
|
-
zIndex?: number;
|
|
57
7
|
}
|
|
58
8
|
|
|
59
9
|
export interface NavigationBarColorPropsGenerated {
|
|
60
10
|
child: string;
|
|
61
11
|
attributes: {
|
|
62
12
|
styles?: NavigationBarColorStyleGenerated;
|
|
63
|
-
|
|
64
|
-
testID?: string;
|
|
13
|
+
translucent?: boolean;
|
|
65
14
|
};
|
|
66
15
|
}
|
|
67
16
|
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"title": "title",
|
|
6
6
|
"description": "description",
|
|
7
7
|
"children": "never",
|
|
8
|
-
"extends": "View",
|
|
9
8
|
"attributes": {
|
|
10
9
|
"styles": {
|
|
11
10
|
"backgroundColor": "color"
|
|
12
|
-
}
|
|
11
|
+
},
|
|
12
|
+
"translucent": "boolean"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"meta": {
|
|
@@ -24,6 +24,15 @@
|
|
|
24
24
|
"specialCategory": null,
|
|
25
25
|
"sort": 1
|
|
26
26
|
}
|
|
27
|
+
},
|
|
28
|
+
"attributes": {
|
|
29
|
+
"translucent": {
|
|
30
|
+
"label": "Translucent",
|
|
31
|
+
"description": "Sets the navigation bar to translucent.",
|
|
32
|
+
"category": "style",
|
|
33
|
+
"specialCategory": null,
|
|
34
|
+
"sort": 2
|
|
35
|
+
}
|
|
27
36
|
}
|
|
28
37
|
},
|
|
29
38
|
"defaults": {
|
|
@@ -34,6 +34,7 @@ export function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
|
34
34
|
selectedTheme: theme,
|
|
35
35
|
projectColors,
|
|
36
36
|
baseSize,
|
|
37
|
+
device,
|
|
37
38
|
} = useBuilderParams();
|
|
38
39
|
// OnboardDot specific attributes
|
|
39
40
|
const inactiveDotOpacity =
|
|
@@ -74,12 +75,12 @@ export function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
|
74
75
|
(attrRecord.dot_thickness as string | number | undefined) ??
|
|
75
76
|
(stylesBag?.dot_thickness as string | number | undefined);
|
|
76
77
|
const dotSizeCss = useMemo((): string => {
|
|
77
|
-
const parsed = parseSize(dotThicknessRaw, baseSize);
|
|
78
|
+
const parsed = parseSize(dotThicknessRaw, baseSize, device!);
|
|
78
79
|
if (parsed === undefined) return '10px';
|
|
79
80
|
if (typeof parsed === 'number') return `${parsed}px`;
|
|
80
81
|
if (typeof parsed === 'string' && parsed.trim()) return parsed;
|
|
81
82
|
return '10px';
|
|
82
|
-
}, [dotThicknessRaw, baseSize]);
|
|
83
|
+
}, [dotThicknessRaw, baseSize, device]);
|
|
83
84
|
const dotGapCss = useMemo((): string => {
|
|
84
85
|
// Prefer px math when possible; otherwise fall back to 10px/3.
|
|
85
86
|
const px =
|
|
@@ -15,6 +15,9 @@ function StatusBarColor({ node }: StatusBarColorComponentProps) {
|
|
|
15
15
|
const setStatusBarOverrideColor = useRenderStore(
|
|
16
16
|
(s) => s.setStatusBarOverrideColor,
|
|
17
17
|
);
|
|
18
|
+
const setStatusBarOverrideTranslucent = useRenderStore(
|
|
19
|
+
(s) => s.setStatusBarOverrideTranslucent,
|
|
20
|
+
);
|
|
18
21
|
|
|
19
22
|
const rawBg = getStyleBag(node.attributes)?.backgroundColor as
|
|
20
23
|
| string
|
|
@@ -24,14 +27,25 @@ function StatusBarColor({ node }: StatusBarColorComponentProps) {
|
|
|
24
27
|
theme,
|
|
25
28
|
});
|
|
26
29
|
|
|
30
|
+
const translucent = node.attributes?.translucent;
|
|
31
|
+
|
|
27
32
|
useEffect(() => {
|
|
28
33
|
if (resolvedColor) {
|
|
29
34
|
setStatusBarOverrideColor(resolvedColor);
|
|
30
35
|
}
|
|
36
|
+
if (translucent !== undefined) {
|
|
37
|
+
setStatusBarOverrideTranslucent(translucent);
|
|
38
|
+
}
|
|
31
39
|
return () => {
|
|
32
40
|
setStatusBarOverrideColor(null);
|
|
41
|
+
setStatusBarOverrideTranslucent(null);
|
|
33
42
|
};
|
|
34
|
-
}, [
|
|
43
|
+
}, [
|
|
44
|
+
resolvedColor,
|
|
45
|
+
setStatusBarOverrideColor,
|
|
46
|
+
translucent,
|
|
47
|
+
setStatusBarOverrideTranslucent,
|
|
48
|
+
]);
|
|
35
49
|
|
|
36
50
|
return null;
|
|
37
51
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"styles": {
|
|
10
10
|
"backgroundColor": "color"
|
|
11
11
|
},
|
|
12
|
-
"
|
|
12
|
+
"translucent": "boolean"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"meta": {
|
|
@@ -24,6 +24,15 @@
|
|
|
24
24
|
"specialCategory": null,
|
|
25
25
|
"sort": 1
|
|
26
26
|
}
|
|
27
|
+
},
|
|
28
|
+
"attributes": {
|
|
29
|
+
"translucent": {
|
|
30
|
+
"label": "Translucent",
|
|
31
|
+
"description": "Sets the status bar to translucent.",
|
|
32
|
+
"category": "style",
|
|
33
|
+
"specialCategory": null,
|
|
34
|
+
"sort": 2
|
|
35
|
+
}
|
|
27
36
|
}
|
|
28
37
|
},
|
|
29
38
|
"defaults": {
|