@developer_tribe/react-builder 1.2.29 → 1.2.31
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/RenderPage.d.ts +7 -2
- package/dist/attributes-editor/attributesEditorModelTypes.d.ts +0 -1
- package/dist/build-components/BIcon/BIcon.d.ts +1 -1
- package/dist/build-components/BackgroundImage/BackgroundImage.d.ts +1 -1
- package/dist/build-components/Button/Button.d.ts +1 -1
- package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +4 -0
- package/dist/build-components/OnboardButton/OnboardButton.d.ts +1 -1
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +0 -2
- package/dist/build-components/OnboardDot/OnboardDot.d.ts +1 -1
- package/dist/build-components/PaywallCloseButton/PaywallCloseButton.d.ts +1 -1
- package/dist/build-components/Text/Text.d.ts +1 -1
- package/dist/build-components/index.generated.d.ts +38 -0
- package/dist/build-components/patterns.generated.d.ts +11 -17
- package/dist/components/BuilderProvider.d.ts +9 -15
- package/dist/hooks/useLocalize.d.ts +3 -2
- package/dist/hooks/usePreviewSelection.d.ts +12 -0
- package/dist/index.cjs.js +1 -28
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +1 -28
- 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/logger.d.ts +3 -6
- package/dist/modals/IconPickerModal.d.ts +1 -1
- package/dist/pages/DebugJsonPage.d.ts +1 -4
- package/dist/size-matters/index.d.ts +15 -6
- package/dist/store.d.ts +5 -3
- package/dist/types/Icons.generated.d.ts +2 -0
- package/dist/types/PreviewConfig.d.ts +6 -8
- package/dist/types/Project.d.ts +4 -3
- package/dist/utils/extractTextStyle/extractTextStyle.d.ts +2 -0
- package/dist/utils/extractTextStyle/extractTextStyleNative.d.ts +2 -0
- package/dist/utils/extractViewStyle/extractViewStyle.d.ts +2 -0
- package/dist/utils/extractViewStyle/extractViewStyleNative.d.ts +2 -0
- package/dist/utils/useMergedStyle.d.ts +1 -1
- package/package.json +1 -1
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +19 -9
- package/src/RenderPage.tsx +66 -57
- package/src/assets/.DS_Store +0 -0
- package/src/assets/meta.json +1 -1
- package/src/assets/samples/carousel-sample.json +2 -6
- package/src/assets/samples/getSamples.ts +14 -4
- package/src/assets/samples/vpn-onboard-1.json +21 -21
- package/src/assets/samples/vpn-onboard-2.json +21 -45
- package/src/assets/samples/vpn-onboard-3.json +21 -53
- package/src/assets/samples/vpn-onboard-4.json +21 -21
- package/src/assets/samples/vpn-onboard-5.json +33 -33
- package/src/assets/samples/vpn-onboard-6.json +21 -21
- package/src/assets/samples/vpn-onboard-7.json +21 -21
- package/src/attribute-analyser/style/native/useExtractImageStyle.ts +3 -3
- package/src/attribute-analyser/style/native/useExtractTextStyle.ts +8 -2
- package/src/attribute-analyser/style/native/useExtractViewStyle.ts +7 -3
- package/src/attribute-analyser/style/web/useExtractImageStyle.ts +3 -3
- package/src/attribute-analyser/style/web/useExtractTextStyle.ts +8 -2
- package/src/attribute-analyser/style/web/useExtractViewStyle.ts +3 -3
- package/src/attributes-editor/AttributesEditorFields.tsx +1 -1
- package/src/attributes-editor/attributesEditorModelTypes.ts +0 -3
- package/src/attributes-editor/useAttributesEditorModel.ts +0 -3
- package/src/build-components/BIcon/BIcon.tsx +2 -2
- package/src/build-components/BackgroundImage/BackgroundImage.tsx +1 -1
- package/src/build-components/Button/Button.tsx +3 -3
- package/src/build-components/CarouselDots/CarouselDots.tsx +10 -19
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +4 -0
- package/src/build-components/CarouselDots/pattern.json +12 -1
- package/src/build-components/Main/Main.tsx +1 -0
- package/src/build-components/OnboardButton/OnboardButton.tsx +13 -11
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +0 -2
- package/src/build-components/OnboardButton/pattern.json +0 -16
- package/src/build-components/OnboardDot/OnboardDot.tsx +19 -25
- package/src/build-components/OnboardDot/pattern.json +2 -1
- package/src/build-components/OnboardFooter/OnboardFooter.tsx +4 -5
- package/src/build-components/PaywallCloseButton/PaywallCloseButton.tsx +2 -2
- package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButton.tsx +2 -2
- package/src/build-components/RadioButton/RadioButton.tsx +6 -3
- package/src/build-components/RenderNode.generated.tsx +7 -7
- package/src/build-components/Text/Text.tsx +3 -3
- package/src/build-components/index.generated.ts +184 -0
- package/src/build-components/patterns.generated.ts +11 -17
- package/src/components/BottomBar.tsx +7 -9
- package/src/components/BuilderProvider.tsx +47 -84
- package/src/components/EditorHeader.tsx +6 -3
- package/src/hooks/useLocalize.ts +14 -10
- package/src/hooks/usePreviewSelection.ts +66 -0
- package/src/index.ts +0 -2
- package/src/logger.ts +4 -20
- package/src/modals/IconPickerModal.tsx +1 -1
- package/src/modals/InspectModal.tsx +6 -7
- package/src/pages/DebugJsonPage.tsx +0 -6
- package/src/pages/ProjectPage.tsx +12 -57
- package/src/pages/tabs/SideTool.tsx +7 -7
- package/src/product-base/extractAndroidParams.ts +4 -11
- package/src/product-base/extractIOSParams.ts +4 -10
- package/src/size-matters/index.ts +44 -31
- package/src/store.ts +12 -6
- package/src/styles/modals/_inspect-modal.scss +7 -3
- package/src/types/Icons.generated.ts +244 -0
- package/src/types/PreviewConfig.ts +5 -9
- package/src/types/Project.ts +4 -3
- package/src/utils/extractImageStyle.ts +4 -2
- package/src/utils/extractTextStyle/extractTextStyle.ts +6 -1
- package/src/utils/extractTextStyle/extractTextStyleNative.ts +4 -1
- package/src/utils/extractViewStyle/extractViewStyle.ts +7 -5
- package/src/utils/extractViewStyle/extractViewStyleNative.ts +3 -1
- package/src/utils/getDefaultProject.ts +0 -1
- package/src/utils/projectColors.ts +3 -2
- package/src/utils/useMergedStyle.ts +9 -7
|
@@ -8,7 +8,7 @@ import { useLogRender } from '../../utils/useLogRender';
|
|
|
8
8
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
9
9
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
10
10
|
|
|
11
|
-
function BackgroundImage({ node }: BackgroundImageComponentProps) {
|
|
11
|
+
export function BackgroundImage({ node }: BackgroundImageComponentProps) {
|
|
12
12
|
useLogRender('BackgroundImage');
|
|
13
13
|
node = useNode(node);
|
|
14
14
|
const generatedId = useId();
|
|
@@ -9,14 +9,14 @@ import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
|
9
9
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
10
10
|
import { useLocalize } from '../../hooks/useLocalize';
|
|
11
11
|
|
|
12
|
-
function Button({ node }: ButtonComponentProps) {
|
|
12
|
+
export function Button({ node }: ButtonComponentProps) {
|
|
13
13
|
useLogRender('Button');
|
|
14
14
|
node = useNode(node);
|
|
15
15
|
const generatedId = useId();
|
|
16
16
|
const attributeName = node.sourceType ?? node.type ?? 'button';
|
|
17
17
|
const attributeKey = node.key ?? generatedId;
|
|
18
|
-
const { previewMode, selectedKey
|
|
19
|
-
const localize = useLocalize(
|
|
18
|
+
const { previewMode, selectedKey } = useBuilderParams();
|
|
19
|
+
const localize = useLocalize();
|
|
20
20
|
const baseStyle = useExtractViewStyle(node);
|
|
21
21
|
const combinedTextStyle = useExtractTextStyle(node);
|
|
22
22
|
const textStyle = useMemo(() => {
|
|
@@ -34,9 +34,7 @@ function CarouselDots({ node }: CarouselDotsComponentProps) {
|
|
|
34
34
|
const onboardApi = useContext(onboardContext);
|
|
35
35
|
const emblaApi = isOnboard ? onboardApi?.emblaApi : carouselApi;
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
const GHOST_DOT_DARK_COLOR = '#E4E5E7';
|
|
39
|
-
const GHOST_DOT_LIGHT_COLOR = '#F7F7F9';
|
|
37
|
+
const { mockTheme: theme, projectColors, baseSize } = useBuilderParams();
|
|
40
38
|
const inactiveDotOpacity =
|
|
41
39
|
(stylesBag?.inactive_dot_opacity as number | undefined) ??
|
|
42
40
|
(attrRecord.inactive_dot_opacity as number | undefined) ??
|
|
@@ -51,31 +49,22 @@ function CarouselDots({ node }: CarouselDotsComponentProps) {
|
|
|
51
49
|
(stylesBag?.dot_thickness as string | number | undefined) ??
|
|
52
50
|
(attrRecord.dot_thickness as string | number | undefined);
|
|
53
51
|
|
|
54
|
-
const { theme, projectColors } = useBuilderParams();
|
|
55
|
-
const isDark = theme === 'dark';
|
|
56
|
-
const inactiveDotColorBase = isDark
|
|
57
|
-
? GHOST_DOT_DARK_COLOR
|
|
58
|
-
: GHOST_DOT_LIGHT_COLOR;
|
|
59
|
-
|
|
60
52
|
const resolvedActiveDotColor = useMemo(
|
|
61
53
|
() => parseColor(activeDotColor, { theme, projectColors }),
|
|
62
54
|
[activeDotColor, theme, projectColors],
|
|
63
55
|
);
|
|
64
|
-
const resolvedInactiveDotColor = useMemo(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
return parsed ?? inactiveDotColorBase;
|
|
70
|
-
}, [inactiveDotColorBase, inactiveDotColorOverride, theme, projectColors]);
|
|
56
|
+
const resolvedInactiveDotColor = useMemo(
|
|
57
|
+
() => parseColor(inactiveDotColorOverride, { theme, projectColors }),
|
|
58
|
+
[inactiveDotColorOverride, theme, projectColors],
|
|
59
|
+
);
|
|
71
60
|
|
|
72
61
|
const dotSizeCss = useMemo(() => {
|
|
73
|
-
const parsed = parseSize(dotThicknessRaw);
|
|
62
|
+
const parsed = parseSize(dotThicknessRaw, baseSize);
|
|
74
63
|
if (parsed === undefined) return '10px';
|
|
75
64
|
if (typeof parsed === 'number') return `${parsed}px`;
|
|
76
65
|
if (typeof parsed === 'string' && parsed.trim()) return parsed;
|
|
77
66
|
return '10px';
|
|
78
|
-
}, [dotThicknessRaw]);
|
|
67
|
+
}, [dotThicknessRaw, baseSize]);
|
|
79
68
|
|
|
80
69
|
const dotGapCss = useMemo((): string => {
|
|
81
70
|
const px =
|
|
@@ -132,7 +121,9 @@ function CarouselDots({ node }: CarouselDotsComponentProps) {
|
|
|
132
121
|
isDotSelected && resolvedActiveDotColor
|
|
133
122
|
? resolvedActiveDotColor
|
|
134
123
|
: resolvedInactiveDotColor;
|
|
135
|
-
const activeFallback =
|
|
124
|
+
const activeFallback =
|
|
125
|
+
resolvedActiveDotColor ??
|
|
126
|
+
parseColor('STATIC_COLORS.ONBOARD_DOT_ACTIVE', { projectColors });
|
|
136
127
|
const dotColor = resolvedColor ?? activeFallback;
|
|
137
128
|
|
|
138
129
|
return (
|
|
@@ -69,6 +69,10 @@ export interface CarouselDotsPropsGenerated {
|
|
|
69
69
|
style?: CarouselDotsStyleGenerated;
|
|
70
70
|
scrollable?: boolean;
|
|
71
71
|
dotType?: DotTypeOptionType;
|
|
72
|
+
dot_thickness?: string;
|
|
73
|
+
inactive_dot_opacity?: number;
|
|
74
|
+
inactive_dot_color?: string;
|
|
75
|
+
active_dot_color?: string;
|
|
72
76
|
};
|
|
73
77
|
}
|
|
74
78
|
|
|
@@ -14,9 +14,20 @@
|
|
|
14
14
|
"sliding_border",
|
|
15
15
|
"sliding_dot",
|
|
16
16
|
"liquid_like"
|
|
17
|
-
]
|
|
17
|
+
],
|
|
18
|
+
"dot_thickness": "size",
|
|
19
|
+
"inactive_dot_opacity": "number",
|
|
20
|
+
"inactive_dot_color": "color",
|
|
21
|
+
"active_dot_color": "color"
|
|
18
22
|
}
|
|
19
23
|
},
|
|
24
|
+
"defaults": {
|
|
25
|
+
"dotType": "expanding_dot",
|
|
26
|
+
"dot_thickness": 10,
|
|
27
|
+
"inactive_dot_opacity": 0.3,
|
|
28
|
+
"active_dot_color": "STATIC_COLORS.ONBOARD_DOT_ACTIVE",
|
|
29
|
+
"inactive_dot_color": "THEME_COLORS.BACKGROUND"
|
|
30
|
+
},
|
|
20
31
|
"meta": {
|
|
21
32
|
"desiredParent": [">CarouselProvider"],
|
|
22
33
|
"label": "Carousel Dots",
|
|
@@ -11,14 +11,15 @@ import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtra
|
|
|
11
11
|
import { useMockOSContext, useMockPermission } from '../../mockOS';
|
|
12
12
|
import { useLocalize } from '../../hooks/useLocalize';
|
|
13
13
|
import { parseColor } from '../../utils/parseColor';
|
|
14
|
+
import { defaultProjectColors } from '../../utils/projectColors';
|
|
14
15
|
import { getStyleBag, toAttributeRecord } from '../../utils/attributeStyle';
|
|
15
16
|
|
|
16
|
-
function OnboardButton({ node }: OnboardButtonComponentProps) {
|
|
17
|
+
export function OnboardButton({ node }: OnboardButtonComponentProps) {
|
|
17
18
|
useLogRender('OnboardButton');
|
|
18
19
|
node = useNode(node);
|
|
19
20
|
const attributeName = node.sourceType ?? node.type ?? 'OnboardButton';
|
|
20
21
|
const { emblaApi } = useContext(onboardContext) ?? {};
|
|
21
|
-
const { theme, projectColors
|
|
22
|
+
const { theme, projectColors } = useBuilderParams();
|
|
22
23
|
|
|
23
24
|
const context = useMockOSContext();
|
|
24
25
|
const mockPermissionManager = useMockPermission(context);
|
|
@@ -30,22 +31,23 @@ function OnboardButton({ node }: OnboardButtonComponentProps) {
|
|
|
30
31
|
const attrRecord = toAttributeRecord(attrs);
|
|
31
32
|
const styleBag = getStyleBag(attrs);
|
|
32
33
|
const labelRaw = attrs?.labelKey ?? '';
|
|
33
|
-
const localize = useLocalize(
|
|
34
|
+
const localize = useLocalize();
|
|
34
35
|
const label = localize(labelRaw);
|
|
35
36
|
|
|
36
37
|
const flex = (attrRecord.flex ?? styleBag?.flex ?? 1) as number;
|
|
37
38
|
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
styleBag?.button_text_color) as string | undefined;
|
|
42
|
-
const rawBgColor = (attrRecord.button_background_color ??
|
|
43
|
-
styleBag?.button_background_color) as string | undefined;
|
|
39
|
+
// color and backgroundColor are now stored inside `styles`
|
|
40
|
+
const rawTextColor = styleBag?.color as string | undefined;
|
|
41
|
+
const rawBgColor = styleBag?.backgroundColor as string | undefined;
|
|
44
42
|
|
|
45
43
|
const textColor =
|
|
46
|
-
parseColor(rawTextColor, { projectColors, theme }) ??
|
|
44
|
+
parseColor(rawTextColor, { projectColors, theme }) ??
|
|
45
|
+
projectColors?.STATIC_COLORS?.ONBOARD_BUTTON_PRIMARY_TEXT ??
|
|
46
|
+
defaultProjectColors.STATIC_COLORS!.ONBOARD_BUTTON_PRIMARY_TEXT;
|
|
47
47
|
const backgroundColor =
|
|
48
|
-
parseColor(rawBgColor, { projectColors, theme }) ??
|
|
48
|
+
parseColor(rawBgColor, { projectColors, theme }) ??
|
|
49
|
+
projectColors?.STATIC_COLORS?.ONBOARD_BUTTON_PRIMARY_BACKGROUND ??
|
|
50
|
+
defaultProjectColors.STATIC_COLORS!.ONBOARD_BUTTON_PRIMARY_BACKGROUND;
|
|
49
51
|
const viewStyle = useExtractViewStyle(node);
|
|
50
52
|
|
|
51
53
|
const handleClick = () => {
|
|
@@ -77,10 +77,8 @@ export interface OnboardButtonPropsGenerated {
|
|
|
77
77
|
style?: OnboardButtonStyleGenerated;
|
|
78
78
|
scrollable?: boolean;
|
|
79
79
|
labelKey?: string;
|
|
80
|
-
button_text_color?: string;
|
|
81
80
|
animation?: AnimationOptionType;
|
|
82
81
|
animation_color?: string;
|
|
83
|
-
button_background_color?: string;
|
|
84
82
|
flex?: number;
|
|
85
83
|
events?: EventObjectGenerated[];
|
|
86
84
|
};
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"extends": "View",
|
|
9
9
|
"attributes": {
|
|
10
10
|
"labelKey": "string",
|
|
11
|
-
"button_text_color": "color",
|
|
12
11
|
"animation": [
|
|
13
12
|
"simple-animation",
|
|
14
13
|
"line-animation",
|
|
@@ -17,7 +16,6 @@
|
|
|
17
16
|
"blur-line-animation"
|
|
18
17
|
],
|
|
19
18
|
"animation_color": "color",
|
|
20
|
-
"button_background_color": "color",
|
|
21
19
|
"flex": "number",
|
|
22
20
|
"events": "EventObject[]"
|
|
23
21
|
},
|
|
@@ -41,13 +39,6 @@
|
|
|
41
39
|
"label": "Onboard Button",
|
|
42
40
|
"description": "Single action button for onboarding.",
|
|
43
41
|
"styles": {
|
|
44
|
-
"button_text_color": {
|
|
45
|
-
"label": "Button Text Color",
|
|
46
|
-
"description": "Text color of the button.",
|
|
47
|
-
"category": "style",
|
|
48
|
-
"specialCategory": null,
|
|
49
|
-
"sort": 2
|
|
50
|
-
},
|
|
51
42
|
"animation": {
|
|
52
43
|
"label": "Animation",
|
|
53
44
|
"description": "Animation style for the button.",
|
|
@@ -61,13 +52,6 @@
|
|
|
61
52
|
"category": "style",
|
|
62
53
|
"specialCategory": null,
|
|
63
54
|
"sort": 4
|
|
64
|
-
},
|
|
65
|
-
"button_background_color": {
|
|
66
|
-
"label": "Button Background Color",
|
|
67
|
-
"description": "Background color of the button.",
|
|
68
|
-
"category": "style",
|
|
69
|
-
"specialCategory": null,
|
|
70
|
-
"sort": 5
|
|
71
55
|
}
|
|
72
56
|
},
|
|
73
57
|
"attributes": {
|
|
@@ -11,7 +11,7 @@ import { parseColor } from '../../utils/parseColor';
|
|
|
11
11
|
import { parseSize } from '../../size-matters';
|
|
12
12
|
import { getStyleBag, toAttributeRecord } from '../../utils/attributeStyle';
|
|
13
13
|
|
|
14
|
-
function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
14
|
+
export function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
15
15
|
useLogRender('OnboardDot');
|
|
16
16
|
|
|
17
17
|
node = useNode(node);
|
|
@@ -26,15 +26,14 @@ function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
|
26
26
|
(stylesBag?.dotType as string | undefined) ??
|
|
27
27
|
(attrRecord.dotType as string | undefined) ??
|
|
28
28
|
'normal_dot';
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const {
|
|
30
|
+
previewMode,
|
|
31
|
+
selectedKey,
|
|
32
|
+
mockTheme: theme,
|
|
33
|
+
projectColors,
|
|
34
|
+
baseSize,
|
|
35
|
+
} = useBuilderParams();
|
|
34
36
|
// OnboardDot specific attributes
|
|
35
|
-
const inactiveDotColor = isDark
|
|
36
|
-
? GHOST_DOT_DARK_COLOR
|
|
37
|
-
: GHOST_DOT_LIGHT_COLOR;
|
|
38
37
|
const inactiveDotOpacity =
|
|
39
38
|
(stylesBag?.inactive_dot_opacity as number | undefined) ??
|
|
40
39
|
(attrRecord.inactive_dot_opacity as number | undefined) ??
|
|
@@ -49,13 +48,10 @@ function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
|
49
48
|
() => parseColor(activeDotColor, { theme, projectColors }),
|
|
50
49
|
[activeDotColor, theme, projectColors],
|
|
51
50
|
);
|
|
52
|
-
const resolvedInactiveDotColor = useMemo(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
return parsed ?? inactiveDotColor;
|
|
58
|
-
}, [inactiveDotColor, inactiveDotColorOverride, theme, projectColors]);
|
|
51
|
+
const resolvedInactiveDotColor = useMemo(
|
|
52
|
+
() => parseColor(inactiveDotColorOverride, { theme, projectColors }),
|
|
53
|
+
[inactiveDotColorOverride, theme, projectColors],
|
|
54
|
+
);
|
|
59
55
|
|
|
60
56
|
const extractedStyle = useExtractViewStyle(node);
|
|
61
57
|
const baseStyle = useMemo(() => {
|
|
@@ -76,12 +72,12 @@ function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
|
76
72
|
(stylesBag?.dot_thickness as string | number | undefined) ??
|
|
77
73
|
(attrRecord.dot_thickness as string | number | undefined);
|
|
78
74
|
const dotSizeCss = useMemo((): string => {
|
|
79
|
-
const parsed = parseSize(dotThicknessRaw);
|
|
75
|
+
const parsed = parseSize(dotThicknessRaw, baseSize);
|
|
80
76
|
if (parsed === undefined) return '10px';
|
|
81
77
|
if (typeof parsed === 'number') return `${parsed}px`;
|
|
82
78
|
if (typeof parsed === 'string' && parsed.trim()) return parsed;
|
|
83
79
|
return '10px';
|
|
84
|
-
}, [dotThicknessRaw]);
|
|
80
|
+
}, [dotThicknessRaw, baseSize]);
|
|
85
81
|
const dotGapCss = useMemo((): string => {
|
|
86
82
|
// Prefer px math when possible; otherwise fall back to 10px/3.
|
|
87
83
|
const px =
|
|
@@ -132,14 +128,12 @@ function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
|
132
128
|
className={`embla__dots embla__dots--${dotType}`}
|
|
133
129
|
style={containerStyle}
|
|
134
130
|
>
|
|
135
|
-
{scrollSnaps.map((
|
|
131
|
+
{scrollSnaps.map((_, index) => {
|
|
136
132
|
const isDotSelected = selectedIndex === index;
|
|
137
|
-
const resolvedColor =
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const activeFallback = '#007AFF';
|
|
142
|
-
const dotColor = resolvedColor ?? activeFallback;
|
|
133
|
+
const resolvedColor = isDotSelected
|
|
134
|
+
? resolvedActiveDotColor
|
|
135
|
+
: resolvedInactiveDotColor;
|
|
136
|
+
const dotColor = resolvedColor ?? undefined;
|
|
143
137
|
|
|
144
138
|
return (
|
|
145
139
|
<button
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"dotType": "expanding_dot",
|
|
29
29
|
"dot_thickness": 10,
|
|
30
30
|
"inactive_dot_opacity": 0.3,
|
|
31
|
-
"active_dot_color": "
|
|
31
|
+
"active_dot_color": "STATIC_COLORS.ONBOARD_DOT_ACTIVE",
|
|
32
|
+
"inactive_dot_color": "THEME_COLORS.BACKGROUND",
|
|
32
33
|
"style": {
|
|
33
34
|
"flexDirection": "row",
|
|
34
35
|
"alignItems": "center",
|
|
@@ -7,7 +7,7 @@ import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtra
|
|
|
7
7
|
import { useLogRender } from '../../utils/useLogRender';
|
|
8
8
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
9
9
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
10
|
-
import {
|
|
10
|
+
import { defaultLocalization } from '../../types/PreviewConfig';
|
|
11
11
|
import { parseColor } from '../../utils/parseColor';
|
|
12
12
|
import { getStyleBag, toAttributeRecord } from '../../utils/attributeStyle';
|
|
13
13
|
|
|
@@ -96,18 +96,17 @@ function OnboardFooter({ node }: OnboardFooterComponentProps) {
|
|
|
96
96
|
node = useNode(node);
|
|
97
97
|
const attributeName = node.sourceType ?? node.type ?? 'OnboardFooter';
|
|
98
98
|
const {
|
|
99
|
-
|
|
99
|
+
localization: builderLocalization,
|
|
100
100
|
theme,
|
|
101
101
|
defaultLanguage,
|
|
102
102
|
previewMode,
|
|
103
103
|
selectedKey,
|
|
104
104
|
projectColors: builderProjectColors,
|
|
105
105
|
} = useBuilderParams();
|
|
106
|
-
const
|
|
106
|
+
const localization = builderLocalization ?? defaultLocalization;
|
|
107
107
|
const projectColors = builderProjectColors;
|
|
108
|
-
const { localication } = appConfig;
|
|
109
108
|
const lang = defaultLanguage ?? 'en';
|
|
110
|
-
const t = (key?: string) => (key ? (
|
|
109
|
+
const t = (key?: string) => (key ? (localization?.[lang]?.[key] ?? key) : '');
|
|
111
110
|
|
|
112
111
|
const attrs = node?.attributes;
|
|
113
112
|
const attrRecord = toAttributeRecord(attrs);
|
|
@@ -8,10 +8,10 @@ import { useLogRender } from '../../utils/useLogRender';
|
|
|
8
8
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
9
9
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
10
10
|
import { Icon } from '../../components/Icon.generated';
|
|
11
|
-
import { IconsType } from '../../types/Icons';
|
|
11
|
+
import { IconsType } from '../../types/Icons.generated';
|
|
12
12
|
import { usePaywallContext } from '../PaywallProvider/PaywallContext';
|
|
13
13
|
|
|
14
|
-
function PaywallCloseButton({ node }: PaywallCloseButtonComponentProps) {
|
|
14
|
+
export function PaywallCloseButton({ node }: PaywallCloseButtonComponentProps) {
|
|
15
15
|
useLogRender('PaywallCloseButton');
|
|
16
16
|
node = useNode(node);
|
|
17
17
|
const { onClose, isBackAllowed } = usePaywallContext();
|
|
@@ -21,7 +21,7 @@ function PaywallSubscribeButton({
|
|
|
21
21
|
node.sourceType ?? node.type ?? 'PaywallSubscribeButton';
|
|
22
22
|
const attributeKey = node.key ?? generatedId;
|
|
23
23
|
|
|
24
|
-
const { previewMode, selectedKey
|
|
24
|
+
const { previewMode, selectedKey } = useBuilderParams();
|
|
25
25
|
|
|
26
26
|
const baseStyle = useExtractTextStyle(node);
|
|
27
27
|
|
|
@@ -35,7 +35,7 @@ function PaywallSubscribeButton({
|
|
|
35
35
|
isSelected ? SELECTED_OUTLINE_STYLE : undefined,
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
-
const localize = useLocalize(
|
|
38
|
+
const localize = useLocalize();
|
|
39
39
|
const label =
|
|
40
40
|
typeof node.children === 'string' && node.children.trim().length > 0
|
|
41
41
|
? node.children
|
|
@@ -28,11 +28,14 @@ export type RadioButtonBaseProps = {
|
|
|
28
28
|
|
|
29
29
|
export function RadioButtonBase({
|
|
30
30
|
selected,
|
|
31
|
-
color
|
|
31
|
+
color,
|
|
32
32
|
size = 24,
|
|
33
33
|
}: RadioButtonBaseProps) {
|
|
34
34
|
const borderWidth = Math.round(size * 0.1);
|
|
35
35
|
const sizeHalf = Math.round(size * 0.5);
|
|
36
|
+
const { projectColors } = useBuilderParams();
|
|
37
|
+
const resolvedColor =
|
|
38
|
+
color ?? projectColors?.STATIC_COLORS?.RADIO_BUTTON_COLOR ?? '#A6A6A6';
|
|
36
39
|
|
|
37
40
|
const paramsContext = useContext(ParamsContext);
|
|
38
41
|
const { singleProductIsSelected: contextIsSelected } =
|
|
@@ -47,7 +50,7 @@ export function RadioButtonBase({
|
|
|
47
50
|
alignItems: 'center',
|
|
48
51
|
borderWidth,
|
|
49
52
|
borderStyle: 'solid',
|
|
50
|
-
borderColor:
|
|
53
|
+
borderColor: resolvedColor,
|
|
51
54
|
width: size,
|
|
52
55
|
height: size,
|
|
53
56
|
borderRadius: sizeHalf,
|
|
@@ -61,7 +64,7 @@ export function RadioButtonBase({
|
|
|
61
64
|
width: sizeHalf,
|
|
62
65
|
height: sizeHalf,
|
|
63
66
|
borderRadius: sizeHalf * 2,
|
|
64
|
-
backgroundColor:
|
|
67
|
+
backgroundColor: resolvedColor,
|
|
65
68
|
}}
|
|
66
69
|
/>
|
|
67
70
|
) : (
|
|
@@ -48,9 +48,9 @@ import type { SeparatorComponentProps } from './Separator/SeparatorProps.generat
|
|
|
48
48
|
import type { StatusBarColorComponentProps } from './StatusBarColor/StatusBarColorProps.generated';
|
|
49
49
|
import type { TextComponentProps } from './Text/TextProps.generated';
|
|
50
50
|
import type { ViewComponentProps } from './View/ViewProps.generated';
|
|
51
|
-
import BIcon from './BIcon/BIcon';
|
|
52
|
-
import BackgroundImage from './BackgroundImage/BackgroundImage';
|
|
53
|
-
import Button from './Button/Button';
|
|
51
|
+
import { BIcon } from './BIcon/BIcon';
|
|
52
|
+
import { BackgroundImage } from './BackgroundImage/BackgroundImage';
|
|
53
|
+
import { Button } from './Button/Button';
|
|
54
54
|
import Carousel from './Carousel/Carousel';
|
|
55
55
|
import CarouselButtons from './CarouselButtons/CarouselButtons';
|
|
56
56
|
import CarouselDots from './CarouselDots/CarouselDots';
|
|
@@ -61,9 +61,9 @@ import Image from './Image/Image';
|
|
|
61
61
|
import Main from './Main/Main';
|
|
62
62
|
import NavigationBarColor from './NavigationBarColor/NavigationBarColor';
|
|
63
63
|
import Onboard from './Onboard/Onboard';
|
|
64
|
-
import OnboardButton from './OnboardButton/OnboardButton';
|
|
64
|
+
import { OnboardButton } from './OnboardButton/OnboardButton';
|
|
65
65
|
import OnboardButtons from './OnboardButtons/OnboardButtons';
|
|
66
|
-
import OnboardDot from './OnboardDot/OnboardDot';
|
|
66
|
+
import { OnboardDot } from './OnboardDot/OnboardDot';
|
|
67
67
|
import OnboardFooter from './OnboardFooter/OnboardFooter';
|
|
68
68
|
import OnboardImage from './OnboardImage/OnboardImage';
|
|
69
69
|
import OnboardItem from './OnboardItem/OnboardItem';
|
|
@@ -71,7 +71,7 @@ import OnboardProvider from './OnboardProvider/OnboardProvider';
|
|
|
71
71
|
import OnboardSubtitle from './OnboardSubtitle/OnboardSubtitle';
|
|
72
72
|
import OnboardTitle from './OnboardTitle/OnboardTitle';
|
|
73
73
|
import PaywallBackground from './PaywallBackground/PaywallBackground';
|
|
74
|
-
import PaywallCloseButton from './PaywallCloseButton/PaywallCloseButton';
|
|
74
|
+
import { PaywallCloseButton } from './PaywallCloseButton/PaywallCloseButton';
|
|
75
75
|
import PaywallOptions from './PaywallOptions/PaywallOptions';
|
|
76
76
|
import PaywallProvider from './PaywallProvider/PaywallProvider';
|
|
77
77
|
import PaywallSubscribeButton from './PaywallSubscribeButton/PaywallSubscribeButton';
|
|
@@ -81,7 +81,7 @@ import Promo from './Promo/Promo';
|
|
|
81
81
|
import RadioButton from './RadioButton/RadioButton';
|
|
82
82
|
import Separator from './Separator/Separator';
|
|
83
83
|
import StatusBarColor from './StatusBarColor/StatusBarColor';
|
|
84
|
-
import Text from './Text/Text';
|
|
84
|
+
import { Text } from './Text/Text';
|
|
85
85
|
import View from './View/View';
|
|
86
86
|
|
|
87
87
|
type BuilderNode =
|
|
@@ -8,7 +8,7 @@ import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
|
8
8
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
9
9
|
import { useLocalize } from '../../hooks/useLocalize';
|
|
10
10
|
|
|
11
|
-
function Text({ node }: TextComponentProps) {
|
|
11
|
+
export function Text({ node }: TextComponentProps) {
|
|
12
12
|
useLogRender('Text');
|
|
13
13
|
node = useNode(node);
|
|
14
14
|
const attributeName = node.sourceType ?? node.type ?? 'text';
|
|
@@ -17,7 +17,7 @@ function Text({ node }: TextComponentProps) {
|
|
|
17
17
|
const attributeKey = node.key;
|
|
18
18
|
const textRef = useRef<HTMLParagraphElement | null>(null);
|
|
19
19
|
const [autoFontSizePx, setAutoFontSizePx] = useState<number | null>(null);
|
|
20
|
-
const {
|
|
20
|
+
const { previewMode, selectedKey } = useBuilderParams();
|
|
21
21
|
const keyOrText: string = node.children as string;
|
|
22
22
|
const textStyle = useExtractTextStyle(node);
|
|
23
23
|
const isSelected = isNodeSelected({
|
|
@@ -25,7 +25,7 @@ function Text({ node }: TextComponentProps) {
|
|
|
25
25
|
current: selectedKey ? { key: selectedKey } : undefined,
|
|
26
26
|
node,
|
|
27
27
|
});
|
|
28
|
-
const localize = useLocalize(
|
|
28
|
+
const localize = useLocalize();
|
|
29
29
|
const translateCounter = (node.attributes as Record<string, unknown>)
|
|
30
30
|
?.translateCounter as number | undefined;
|
|
31
31
|
|