@developer_tribe/react-builder 1.2.30 → 1.2.32
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/BIcon/BIcon.d.ts +1 -1
- package/dist/build-components/BIcon/BIconProps.generated.d.ts +1 -1
- package/dist/build-components/BackgroundImage/BackgroundImage.d.ts +1 -1
- package/dist/build-components/BackgroundImage/BackgroundImageProps.generated.d.ts +1 -1
- package/dist/build-components/Button/Button.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 +5 -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/CountDown/CountDownProps.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/NavigationBarColor/NavigationBarColorProps.generated.d.ts +1 -1
- package/dist/build-components/Onboard/OnboardProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardButton/OnboardButton.d.ts +1 -1
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +2 -4
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardDot/OnboardDot.d.ts +1 -1
- package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardImage/OnboardImageProps.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/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallBackground/PaywallBackgroundProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallCloseButton/PaywallCloseButton.d.ts +1 -1
- package/dist/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallOptions/PaywallOptionsProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallProvider/PaywallProviderProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.d.ts +1 -1
- package/dist/build-components/PriceTag/PriceTagProps.generated.d.ts +1 -1
- package/dist/build-components/Pricing/PricingProps.generated.d.ts +1 -1
- package/dist/build-components/Promo/PromoProps.generated.d.ts +1 -1
- package/dist/build-components/RadioButton/RadioButtonProps.generated.d.ts +1 -1
- package/dist/build-components/Separator/SeparatorProps.generated.d.ts +1 -1
- package/dist/build-components/StatusBarColor/StatusBarColorProps.generated.d.ts +1 -1
- package/dist/build-components/Text/Text.d.ts +1 -1
- package/dist/build-components/Text/TextProps.generated.d.ts +1 -1
- package/dist/build-components/View/ViewProps.generated.d.ts +1 -1
- package/dist/build-components/patterns.generated.d.ts +73 -69
- 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/utils/attributeStyle.d.ts +2 -2
- package/dist/utils/patterns.d.ts +2 -2
- package/dist/utils/useMergedStyle.d.ts +1 -1
- package/package.json +1 -1
- package/scripts/prebuild/utils/createGeneratedProps.js +9 -9
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +9 -9
- package/src/RenderPage.tsx +42 -1
- package/src/assets/meta.json +1 -1
- package/src/assets/samples/vpn-onboard-1.json +21 -45
- 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/build-components/BIcon/BIcon.tsx +1 -1
- package/src/build-components/BIcon/BIconProps.generated.ts +1 -1
- package/src/build-components/BIcon/pattern.json +4 -2
- package/src/build-components/BackgroundImage/BackgroundImage.tsx +2 -2
- package/src/build-components/BackgroundImage/BackgroundImageProps.generated.ts +1 -1
- package/src/build-components/BackgroundImage/pattern.json +11 -3
- package/src/build-components/Button/Button.tsx +3 -3
- package/src/build-components/Button/ButtonProps.generated.ts +1 -1
- package/src/build-components/Button/pattern.json +5 -3
- package/src/build-components/Carousel/CarouselProps.generated.ts +1 -1
- package/src/build-components/Carousel/pattern.json +9 -3
- package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +1 -1
- package/src/build-components/CarouselDots/CarouselDots.tsx +8 -17
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +5 -1
- package/src/build-components/CarouselDots/pattern.json +12 -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/CarouselProvider/pattern.json +5 -2
- package/src/build-components/CountDown/CountDownProps.generated.ts +1 -1
- package/src/build-components/CountDown/pattern.json +4 -2
- package/src/build-components/Image/ImageProps.generated.ts +1 -1
- package/src/build-components/Image/pattern.json +11 -4
- package/src/build-components/Main/Main.tsx +1 -0
- package/src/build-components/Main/MainProps.generated.ts +1 -1
- package/src/build-components/Main/pattern.json +4 -2
- package/src/build-components/NavigationBarColor/NavigationBarColorProps.generated.ts +1 -1
- package/src/build-components/NavigationBarColor/pattern.json +5 -3
- package/src/build-components/Onboard/OnboardProps.generated.ts +1 -1
- package/src/build-components/Onboard/pattern.json +7 -3
- package/src/build-components/OnboardButton/OnboardButton.tsx +3 -22
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +2 -4
- package/src/build-components/OnboardButton/pattern.json +42 -44
- package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +1 -1
- package/src/build-components/OnboardButtons/pattern.json +16 -5
- package/src/build-components/OnboardDot/OnboardDot.tsx +10 -22
- package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +1 -1
- package/src/build-components/OnboardDot/pattern.json +6 -3
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +1 -1
- package/src/build-components/OnboardFooter/pattern.json +4 -2
- package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +1 -1
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +1 -1
- package/src/build-components/OnboardItem/pattern.json +12 -4
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +1 -1
- package/src/build-components/OnboardProvider/pattern.json +9 -3
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +1 -1
- package/src/build-components/OnboardSubtitle/pattern.json +5 -2
- package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +1 -1
- package/src/build-components/OnboardTitle/pattern.json +5 -2
- package/src/build-components/PaywallBackground/PaywallBackgroundProps.generated.ts +1 -1
- package/src/build-components/PaywallBackground/pattern.json +4 -2
- package/src/build-components/PaywallCloseButton/PaywallCloseButton.tsx +2 -2
- package/src/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.ts +1 -1
- package/src/build-components/PaywallCloseButton/pattern.json +4 -2
- package/src/build-components/PaywallOptions/PaywallOptionsProps.generated.ts +1 -1
- package/src/build-components/PaywallOptions/pattern.json +4 -2
- package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +1 -1
- package/src/build-components/PaywallProvider/pattern.json +4 -2
- package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.ts +1 -1
- package/src/build-components/PaywallSubscribeButton/pattern.json +4 -2
- package/src/build-components/PriceTag/PriceTagProps.generated.ts +1 -1
- package/src/build-components/PriceTag/pattern.json +10 -4
- package/src/build-components/Pricing/PricingProps.generated.ts +1 -1
- package/src/build-components/Pricing/pattern.json +4 -2
- package/src/build-components/Promo/PromoProps.generated.ts +1 -1
- package/src/build-components/Promo/pattern.json +4 -2
- package/src/build-components/RadioButton/RadioButton.tsx +6 -3
- package/src/build-components/RadioButton/RadioButtonProps.generated.ts +1 -1
- package/src/build-components/RenderNode.generated.tsx +7 -7
- package/src/build-components/Separator/SeparatorProps.generated.ts +1 -1
- package/src/build-components/Separator/pattern.json +5 -3
- package/src/build-components/StatusBarColor/StatusBarColorProps.generated.ts +1 -1
- package/src/build-components/StatusBarColor/pattern.json +5 -3
- package/src/build-components/Text/Text.tsx +2 -2
- package/src/build-components/Text/TextProps.generated.ts +1 -1
- package/src/build-components/Text/pattern.json +5 -3
- package/src/build-components/View/ViewProps.generated.ts +1 -1
- package/src/build-components/View/pattern.json +18 -6
- package/src/build-components/patterns.generated.ts +73 -69
- package/src/build-components/useNode.ts +2 -16
- package/src/components/BuilderProvider.tsx +1 -1
- package/src/hooks/useLocalize.ts +1 -1
- package/src/migrations/migrations/1.1.2_extract_component_attributes_from_style.ts +31 -10
- package/src/utils/analyseNodeByPatterns.ts +2 -2
- package/src/utils/attributeStyle.ts +9 -3
- package/src/utils/extractImageStyle.ts +4 -4
- package/src/utils/patterns.ts +3 -3
- package/src/utils/projectColors.ts +3 -2
- package/src/utils/useMergedStyle.ts +9 -7
|
@@ -13,41 +13,24 @@ import { useLocalize } from '../../hooks/useLocalize';
|
|
|
13
13
|
import { parseColor } from '../../utils/parseColor';
|
|
14
14
|
import { getStyleBag, toAttributeRecord } from '../../utils/attributeStyle';
|
|
15
15
|
|
|
16
|
-
function OnboardButton({ node }: OnboardButtonComponentProps) {
|
|
16
|
+
export function OnboardButton({ node }: OnboardButtonComponentProps) {
|
|
17
17
|
useLogRender('OnboardButton');
|
|
18
18
|
node = useNode(node);
|
|
19
19
|
const attributeName = node.sourceType ?? node.type ?? 'OnboardButton';
|
|
20
20
|
const { emblaApi } = useContext(onboardContext) ?? {};
|
|
21
21
|
const { theme, projectColors } = useBuilderParams();
|
|
22
|
-
|
|
23
22
|
const context = useMockOSContext();
|
|
24
23
|
const mockPermissionManager = useMockPermission(context);
|
|
25
24
|
const handledEventsRef = useRef<EventObjectGenerated[]>([]);
|
|
26
25
|
const generatedId = useId();
|
|
27
26
|
const attributeKey = node.key ?? generatedId;
|
|
28
|
-
|
|
29
27
|
const attrs = node.attributes;
|
|
30
|
-
const attrRecord = toAttributeRecord(attrs);
|
|
31
|
-
const styleBag = getStyleBag(attrs);
|
|
32
28
|
const labelRaw = attrs?.labelKey ?? '';
|
|
33
29
|
const localize = useLocalize();
|
|
34
30
|
const label = localize(labelRaw);
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
// The editor saves color attrs inside `styles` (meta category === 'style'),
|
|
39
|
-
// but legacy JSON may have them at the top level.
|
|
40
|
-
const rawTextColor = (attrRecord.button_text_color ??
|
|
41
|
-
styleBag?.button_text_color) as string | undefined;
|
|
42
|
-
const rawBgColor = (attrRecord.button_background_color ??
|
|
43
|
-
styleBag?.button_background_color) as string | undefined;
|
|
44
|
-
|
|
45
|
-
const textColor =
|
|
46
|
-
parseColor(rawTextColor, { projectColors, theme }) ?? '#FFFFFF';
|
|
47
|
-
const backgroundColor =
|
|
48
|
-
parseColor(rawBgColor, { projectColors, theme }) ?? '#0066FF';
|
|
31
|
+
const rawTextColor = attrs?.styles?.color as string | undefined;
|
|
32
|
+
const textColor = parseColor(rawTextColor, { projectColors, theme });
|
|
49
33
|
const viewStyle = useExtractViewStyle(node);
|
|
50
|
-
|
|
51
34
|
const handleClick = () => {
|
|
52
35
|
//TODO: any ??
|
|
53
36
|
const events: EventObjectGenerated[] = attrs?.events ?? [];
|
|
@@ -93,9 +76,7 @@ function OnboardButton({ node }: OnboardButtonComponentProps) {
|
|
|
93
76
|
onClick={handleClick}
|
|
94
77
|
style={{
|
|
95
78
|
...viewStyle,
|
|
96
|
-
flex,
|
|
97
79
|
color: textColor,
|
|
98
|
-
backgroundColor,
|
|
99
80
|
border: 'none',
|
|
100
81
|
display: 'flex',
|
|
101
82
|
justifyContent: 'center',
|
|
@@ -69,19 +69,17 @@ export interface OnboardButtonStyleGenerated {
|
|
|
69
69
|
left?: string;
|
|
70
70
|
right?: string;
|
|
71
71
|
zIndex?: number;
|
|
72
|
+
color?: string;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
export interface OnboardButtonPropsGenerated {
|
|
75
76
|
child: string;
|
|
76
77
|
attributes: {
|
|
77
|
-
|
|
78
|
+
styles?: OnboardButtonStyleGenerated;
|
|
78
79
|
scrollable?: boolean;
|
|
79
80
|
labelKey?: string;
|
|
80
|
-
button_text_color?: string;
|
|
81
81
|
animation?: AnimationOptionType;
|
|
82
82
|
animation_color?: string;
|
|
83
|
-
button_background_color?: string;
|
|
84
|
-
flex?: number;
|
|
85
83
|
events?: EventObjectGenerated[];
|
|
86
84
|
};
|
|
87
85
|
}
|
|
@@ -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,36 +16,56 @@
|
|
|
17
16
|
"blur-line-animation"
|
|
18
17
|
],
|
|
19
18
|
"animation_color": "color",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
19
|
+
"events": "EventObject[]",
|
|
20
|
+
"styles": {
|
|
21
|
+
"color": "color"
|
|
22
|
+
}
|
|
23
23
|
},
|
|
24
24
|
"defaults": {
|
|
25
|
-
"
|
|
25
|
+
"styles": {
|
|
26
26
|
"height": "40@vs",
|
|
27
|
-
"borderRadius": "12@s"
|
|
27
|
+
"borderRadius": "12@s",
|
|
28
|
+
"color": "THEME_COLORS.ONBOARD_BUTTON_PRIMARY_TEXT"
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
},
|
|
31
32
|
"types": {
|
|
32
33
|
"EventObject": {
|
|
33
|
-
"type": [
|
|
34
|
-
|
|
34
|
+
"type": [
|
|
35
|
+
"Permission",
|
|
36
|
+
"Navigate"
|
|
37
|
+
],
|
|
38
|
+
"permission": [
|
|
39
|
+
"att",
|
|
40
|
+
"notification",
|
|
41
|
+
"rating",
|
|
42
|
+
"GDPR",
|
|
43
|
+
"null"
|
|
44
|
+
],
|
|
35
45
|
"navigate_to": "string",
|
|
36
46
|
"targetIndex": "number"
|
|
37
47
|
}
|
|
38
48
|
},
|
|
39
49
|
"meta": {
|
|
40
|
-
"desiredParent": [
|
|
50
|
+
"desiredParent": [
|
|
51
|
+
"=OnboardButtons"
|
|
52
|
+
],
|
|
41
53
|
"label": "Onboard Button",
|
|
42
54
|
"description": "Single action button for onboarding.",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"label": "
|
|
46
|
-
"description": "
|
|
47
|
-
"category": "
|
|
55
|
+
"attributes": {
|
|
56
|
+
"labelKey": {
|
|
57
|
+
"label": "Label Key",
|
|
58
|
+
"description": "Localization key for the button text.",
|
|
59
|
+
"category": "other",
|
|
48
60
|
"specialCategory": null,
|
|
49
|
-
"sort":
|
|
61
|
+
"sort": 1
|
|
62
|
+
},
|
|
63
|
+
"events": {
|
|
64
|
+
"label": "Events",
|
|
65
|
+
"description": "List of events fired by the button.",
|
|
66
|
+
"category": "other",
|
|
67
|
+
"specialCategory": null,
|
|
68
|
+
"sort": 7
|
|
50
69
|
},
|
|
51
70
|
"animation": {
|
|
52
71
|
"label": "Animation",
|
|
@@ -62,35 +81,14 @@
|
|
|
62
81
|
"specialCategory": null,
|
|
63
82
|
"sort": 4
|
|
64
83
|
},
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"attributes": {
|
|
74
|
-
"labelKey": {
|
|
75
|
-
"label": "Label Key",
|
|
76
|
-
"description": "Localization key for the button text.",
|
|
77
|
-
"category": "other",
|
|
78
|
-
"specialCategory": null,
|
|
79
|
-
"sort": 1
|
|
80
|
-
},
|
|
81
|
-
"flex": {
|
|
82
|
-
"label": "Flex",
|
|
83
|
-
"description": "Flex grow value in layout.",
|
|
84
|
-
"category": "container",
|
|
85
|
-
"specialCategory": null,
|
|
86
|
-
"sort": 6
|
|
87
|
-
},
|
|
88
|
-
"events": {
|
|
89
|
-
"label": "Events",
|
|
90
|
-
"description": "List of events fired by the button.",
|
|
91
|
-
"category": "other",
|
|
92
|
-
"specialCategory": null,
|
|
93
|
-
"sort": 7
|
|
84
|
+
"styles": {
|
|
85
|
+
"color": {
|
|
86
|
+
"label": "Color",
|
|
87
|
+
"description": "Text color.",
|
|
88
|
+
"category": "style",
|
|
89
|
+
"specialCategory": null,
|
|
90
|
+
"sort": 1
|
|
91
|
+
}
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
94
|
}
|
|
@@ -65,7 +65,7 @@ export interface OnboardButtonsStyleGenerated {
|
|
|
65
65
|
export interface OnboardButtonsPropsGenerated {
|
|
66
66
|
child: string;
|
|
67
67
|
attributes: {
|
|
68
|
-
|
|
68
|
+
styles?: OnboardButtonsStyleGenerated;
|
|
69
69
|
scrollable?: boolean;
|
|
70
70
|
buttonType?: ButtonTypeOptionType;
|
|
71
71
|
skipNumber?: number;
|
|
@@ -7,16 +7,25 @@
|
|
|
7
7
|
"children": "node",
|
|
8
8
|
"extends": "View",
|
|
9
9
|
"attributes": {
|
|
10
|
-
"buttonType": [
|
|
10
|
+
"buttonType": [
|
|
11
|
+
"previous_button",
|
|
12
|
+
"next_button",
|
|
13
|
+
"skip_button"
|
|
14
|
+
],
|
|
11
15
|
"skipNumber": "number",
|
|
12
|
-
"buttons_direction": [
|
|
16
|
+
"buttons_direction": [
|
|
17
|
+
"row",
|
|
18
|
+
"column"
|
|
19
|
+
],
|
|
13
20
|
"forIndex": "number",
|
|
14
21
|
"seperatorColor": "color",
|
|
15
|
-
"condition": [
|
|
22
|
+
"condition": [
|
|
23
|
+
"carousel-index"
|
|
24
|
+
],
|
|
16
25
|
"conditionVariable": "number"
|
|
17
26
|
},
|
|
18
27
|
"defaults": {
|
|
19
|
-
"
|
|
28
|
+
"styles": {
|
|
20
29
|
"display": "flex",
|
|
21
30
|
"flexDirection": "row",
|
|
22
31
|
"gap": 12,
|
|
@@ -28,7 +37,9 @@
|
|
|
28
37
|
}
|
|
29
38
|
},
|
|
30
39
|
"meta": {
|
|
31
|
-
"desiredParent": [
|
|
40
|
+
"desiredParent": [
|
|
41
|
+
"=OnboardItem"
|
|
42
|
+
],
|
|
32
43
|
"label": "Onboard Buttons",
|
|
33
44
|
"description": "Wrapper for onboarding button set.",
|
|
34
45
|
"styles": {
|
|
@@ -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,8 +26,6 @@ function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
|
26
26
|
(stylesBag?.dotType as string | undefined) ??
|
|
27
27
|
(attrRecord.dotType as string | undefined) ??
|
|
28
28
|
'normal_dot';
|
|
29
|
-
const GHOST_DOT_DARK_COLOR = '#E4E5E7';
|
|
30
|
-
const GHOST_DOT_LIGHT_COLOR = '#F7F7F9';
|
|
31
29
|
const {
|
|
32
30
|
previewMode,
|
|
33
31
|
selectedKey,
|
|
@@ -35,12 +33,7 @@ function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
|
35
33
|
projectColors,
|
|
36
34
|
baseSize,
|
|
37
35
|
} = useBuilderParams();
|
|
38
|
-
const isDark = theme === 'dark';
|
|
39
|
-
|
|
40
36
|
// OnboardDot specific attributes
|
|
41
|
-
const inactiveDotColor = isDark
|
|
42
|
-
? GHOST_DOT_DARK_COLOR
|
|
43
|
-
: GHOST_DOT_LIGHT_COLOR;
|
|
44
37
|
const inactiveDotOpacity =
|
|
45
38
|
(stylesBag?.inactive_dot_opacity as number | undefined) ??
|
|
46
39
|
(attrRecord.inactive_dot_opacity as number | undefined) ??
|
|
@@ -55,13 +48,10 @@ function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
|
55
48
|
() => parseColor(activeDotColor, { theme, projectColors }),
|
|
56
49
|
[activeDotColor, theme, projectColors],
|
|
57
50
|
);
|
|
58
|
-
const resolvedInactiveDotColor = useMemo(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
return parsed ?? inactiveDotColor;
|
|
64
|
-
}, [inactiveDotColor, inactiveDotColorOverride, theme, projectColors]);
|
|
51
|
+
const resolvedInactiveDotColor = useMemo(
|
|
52
|
+
() => parseColor(inactiveDotColorOverride, { theme, projectColors }),
|
|
53
|
+
[inactiveDotColorOverride, theme, projectColors],
|
|
54
|
+
);
|
|
65
55
|
|
|
66
56
|
const extractedStyle = useExtractViewStyle(node);
|
|
67
57
|
const baseStyle = useMemo(() => {
|
|
@@ -138,14 +128,12 @@ function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
|
138
128
|
className={`embla__dots embla__dots--${dotType}`}
|
|
139
129
|
style={containerStyle}
|
|
140
130
|
>
|
|
141
|
-
{scrollSnaps.map((
|
|
131
|
+
{scrollSnaps.map((_, index) => {
|
|
142
132
|
const isDotSelected = selectedIndex === index;
|
|
143
|
-
const resolvedColor =
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const activeFallback = '#007AFF';
|
|
148
|
-
const dotColor = resolvedColor ?? activeFallback;
|
|
133
|
+
const resolvedColor = isDotSelected
|
|
134
|
+
? resolvedActiveDotColor
|
|
135
|
+
: resolvedInactiveDotColor;
|
|
136
|
+
const dotColor = resolvedColor ?? undefined;
|
|
149
137
|
|
|
150
138
|
return (
|
|
151
139
|
<button
|
|
@@ -66,7 +66,7 @@ export interface OnboardDotStyleGenerated {
|
|
|
66
66
|
export interface OnboardDotPropsGenerated {
|
|
67
67
|
child: string;
|
|
68
68
|
attributes: {
|
|
69
|
-
|
|
69
|
+
styles?: OnboardDotStyleGenerated;
|
|
70
70
|
scrollable?: boolean;
|
|
71
71
|
dotType?: DotTypeOptionType;
|
|
72
72
|
dot_thickness?: string;
|
|
@@ -28,8 +28,9 @@
|
|
|
28
28
|
"dotType": "expanding_dot",
|
|
29
29
|
"dot_thickness": 10,
|
|
30
30
|
"inactive_dot_opacity": 0.3,
|
|
31
|
-
"active_dot_color": "
|
|
32
|
-
"
|
|
31
|
+
"active_dot_color": "STATIC_COLORS.ONBOARD_DOT_ACTIVE",
|
|
32
|
+
"inactive_dot_color": "THEME_COLORS.BACKGROUND",
|
|
33
|
+
"styles": {
|
|
33
34
|
"flexDirection": "row",
|
|
34
35
|
"alignItems": "center",
|
|
35
36
|
"justifyContent": "center",
|
|
@@ -37,7 +38,9 @@
|
|
|
37
38
|
}
|
|
38
39
|
},
|
|
39
40
|
"meta": {
|
|
40
|
-
"desiredParent": [
|
|
41
|
+
"desiredParent": [
|
|
42
|
+
">OnboardProvider"
|
|
43
|
+
],
|
|
41
44
|
"label": "Onboard Dot",
|
|
42
45
|
"description": "Renders onboarding progress dots.",
|
|
43
46
|
"styles": {
|
|
@@ -63,7 +63,7 @@ export interface OnboardFooterStyleGenerated {
|
|
|
63
63
|
export interface OnboardFooterPropsGenerated {
|
|
64
64
|
child: string;
|
|
65
65
|
attributes: {
|
|
66
|
-
|
|
66
|
+
styles?: OnboardFooterStyleGenerated;
|
|
67
67
|
adjustsFontSizeToFit?: boolean;
|
|
68
68
|
showEllipsis?: boolean;
|
|
69
69
|
translateCounter?: number;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"defaults": {
|
|
20
|
-
"
|
|
20
|
+
"styles": {
|
|
21
21
|
"flexDirection": "row",
|
|
22
22
|
"flexWrap": "wrap",
|
|
23
23
|
"alignItems": "center",
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"meta": {
|
|
30
|
-
"desiredParent": [
|
|
30
|
+
"desiredParent": [
|
|
31
|
+
">OnboardItem"
|
|
32
|
+
],
|
|
31
33
|
"label": "Onboard Footer",
|
|
32
34
|
"description": "Footer text with optional links.",
|
|
33
35
|
"styles": {
|
|
@@ -61,7 +61,7 @@ export interface OnboardImageStyleGenerated {
|
|
|
61
61
|
export interface OnboardImagePropsGenerated {
|
|
62
62
|
child: string;
|
|
63
63
|
attributes: {
|
|
64
|
-
|
|
64
|
+
styles?: OnboardImageStyleGenerated;
|
|
65
65
|
src?: string;
|
|
66
66
|
scrollable?: boolean;
|
|
67
67
|
video_url?: string;
|
|
@@ -60,7 +60,7 @@ export interface OnboardItemStyleGenerated {
|
|
|
60
60
|
export interface OnboardItemPropsGenerated {
|
|
61
61
|
child: string;
|
|
62
62
|
attributes: {
|
|
63
|
-
|
|
63
|
+
styles?: OnboardItemStyleGenerated;
|
|
64
64
|
scrollable?: boolean;
|
|
65
65
|
display?: DisplayOptionType;
|
|
66
66
|
gap?: string;
|
|
@@ -7,22 +7,30 @@
|
|
|
7
7
|
"children": "node",
|
|
8
8
|
"extends": "View",
|
|
9
9
|
"attributes": {
|
|
10
|
-
"display": [
|
|
10
|
+
"display": [
|
|
11
|
+
"flex",
|
|
12
|
+
"block"
|
|
13
|
+
],
|
|
11
14
|
"gap": "size",
|
|
12
|
-
"flexDirection": [
|
|
15
|
+
"flexDirection": [
|
|
16
|
+
"row",
|
|
17
|
+
"column"
|
|
18
|
+
],
|
|
13
19
|
"paddingHorizontal": "size"
|
|
14
20
|
}
|
|
15
21
|
},
|
|
16
22
|
"defaults": {
|
|
17
23
|
"display": "flex",
|
|
18
|
-
"
|
|
24
|
+
"styles": {
|
|
19
25
|
"gap": "16@vs",
|
|
20
26
|
"flexDirection": "column",
|
|
21
27
|
"paddingHorizontal": "24@s"
|
|
22
28
|
}
|
|
23
29
|
},
|
|
24
30
|
"meta": {
|
|
25
|
-
"desiredParent": [
|
|
31
|
+
"desiredParent": [
|
|
32
|
+
"=Onboard"
|
|
33
|
+
],
|
|
26
34
|
"label": "Onboard Item",
|
|
27
35
|
"description": "Single onboarding screen section.",
|
|
28
36
|
"styles": {},
|
|
@@ -60,7 +60,7 @@ export interface OnboardProviderStyleGenerated {
|
|
|
60
60
|
export interface OnboardProviderPropsGenerated {
|
|
61
61
|
child: string;
|
|
62
62
|
attributes: {
|
|
63
|
-
|
|
63
|
+
styles?: OnboardProviderStyleGenerated;
|
|
64
64
|
scrollable?: boolean;
|
|
65
65
|
theme?: ThemeOptionType;
|
|
66
66
|
borderRadius?: never;
|
|
@@ -7,18 +7,24 @@
|
|
|
7
7
|
"children": "node",
|
|
8
8
|
"extends": "View",
|
|
9
9
|
"attributes": {
|
|
10
|
-
"theme": [
|
|
10
|
+
"theme": [
|
|
11
|
+
"light",
|
|
12
|
+
"dark",
|
|
13
|
+
"all"
|
|
14
|
+
],
|
|
11
15
|
"borderRadius": "never"
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
18
|
"defaults": {
|
|
15
|
-
"
|
|
19
|
+
"styles": {
|
|
16
20
|
"width": "100%",
|
|
17
21
|
"height": "100%"
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
"meta": {
|
|
21
|
-
"desiredParent": [
|
|
25
|
+
"desiredParent": [
|
|
26
|
+
"root"
|
|
27
|
+
],
|
|
22
28
|
"label": "Onboard Provider",
|
|
23
29
|
"description": "Provides shared settings for onboarding.",
|
|
24
30
|
"styles": {},
|
|
@@ -63,7 +63,7 @@ export interface OnboardSubtitleStyleGenerated {
|
|
|
63
63
|
export interface OnboardSubtitlePropsGenerated {
|
|
64
64
|
child: string;
|
|
65
65
|
attributes: {
|
|
66
|
-
|
|
66
|
+
styles?: OnboardSubtitleStyleGenerated;
|
|
67
67
|
adjustsFontSizeToFit?: boolean;
|
|
68
68
|
showEllipsis?: boolean;
|
|
69
69
|
translateCounter?: number;
|
|
@@ -8,13 +8,16 @@
|
|
|
8
8
|
"extends": "Text"
|
|
9
9
|
},
|
|
10
10
|
"defaults": {
|
|
11
|
-
"
|
|
11
|
+
"styles": {
|
|
12
12
|
"fontSize": "14@fs",
|
|
13
13
|
"fontWeight": "600"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"meta": {
|
|
17
|
-
"desiredParent": [
|
|
17
|
+
"desiredParent": [
|
|
18
|
+
">OnboardProvider",
|
|
19
|
+
">OnboardItem"
|
|
20
|
+
],
|
|
18
21
|
"label": "Onboard Subtitle",
|
|
19
22
|
"description": "Subtitle text for an onboarding step.",
|
|
20
23
|
"styles": {}
|
|
@@ -63,7 +63,7 @@ export interface OnboardTitleStyleGenerated {
|
|
|
63
63
|
export interface OnboardTitlePropsGenerated {
|
|
64
64
|
child: string;
|
|
65
65
|
attributes: {
|
|
66
|
-
|
|
66
|
+
styles?: OnboardTitleStyleGenerated;
|
|
67
67
|
adjustsFontSizeToFit?: boolean;
|
|
68
68
|
showEllipsis?: boolean;
|
|
69
69
|
translateCounter?: number;
|
|
@@ -8,14 +8,17 @@
|
|
|
8
8
|
"extends": "Text"
|
|
9
9
|
},
|
|
10
10
|
"defaults": {
|
|
11
|
-
"
|
|
11
|
+
"styles": {
|
|
12
12
|
"fontSize": "24@fs",
|
|
13
13
|
"fontWeight": "700",
|
|
14
14
|
"textAlign": "center"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"meta": {
|
|
18
|
-
"desiredParent": [
|
|
18
|
+
"desiredParent": [
|
|
19
|
+
">OnboardItem",
|
|
20
|
+
">OnboardProvider"
|
|
21
|
+
],
|
|
19
22
|
"label": "Onboard Title",
|
|
20
23
|
"description": "Title text for an onboarding step.",
|
|
21
24
|
"styles": {}
|
|
@@ -60,7 +60,7 @@ export interface PaywallBackgroundStyleGenerated {
|
|
|
60
60
|
export interface PaywallBackgroundPropsGenerated {
|
|
61
61
|
child: string;
|
|
62
62
|
attributes: {
|
|
63
|
-
|
|
63
|
+
styles?: PaywallBackgroundStyleGenerated;
|
|
64
64
|
src?: string;
|
|
65
65
|
resizeMode?: ResizeModeOptionType;
|
|
66
66
|
scrollable?: boolean;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"extends": "BackgroundImage",
|
|
9
9
|
"defaults": {
|
|
10
10
|
"resizeMode": "cover",
|
|
11
|
-
"
|
|
11
|
+
"styles": {
|
|
12
12
|
"width": "100%",
|
|
13
13
|
"height": "100%",
|
|
14
14
|
"position": "absolute",
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"meta": {
|
|
23
|
-
"desiredParent": [
|
|
23
|
+
"desiredParent": [
|
|
24
|
+
">PaywallProvider"
|
|
25
|
+
],
|
|
24
26
|
"label": "Paywall Background",
|
|
25
27
|
"description": "Paywall Background component.",
|
|
26
28
|
"styles": {}
|
|
@@ -11,7 +11,7 @@ import { Icon } from '../../components/Icon.generated';
|
|
|
11
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();
|
|
@@ -40,7 +40,7 @@ function PaywallCloseButton({ node }: PaywallCloseButtonComponentProps) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const attrs = node.attributes;
|
|
43
|
-
const styleBag = attrs?.
|
|
43
|
+
const styleBag = attrs?.styles;
|
|
44
44
|
const iconType = attrs?.iconType ?? 'close';
|
|
45
45
|
const size = attrs?.size ?? (textStyle.fontSize as number | undefined) ?? 24;
|
|
46
46
|
const color =
|
|
@@ -63,7 +63,7 @@ export interface PaywallCloseButtonStyleGenerated {
|
|
|
63
63
|
export interface PaywallCloseButtonPropsGenerated {
|
|
64
64
|
child: string;
|
|
65
65
|
attributes: {
|
|
66
|
-
|
|
66
|
+
styles?: PaywallCloseButtonStyleGenerated;
|
|
67
67
|
iconType?: string;
|
|
68
68
|
size?: number;
|
|
69
69
|
strokeWidth?: number;
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
"extends": "BIcon"
|
|
9
9
|
},
|
|
10
10
|
"meta": {
|
|
11
|
-
"desiredParent": [
|
|
11
|
+
"desiredParent": [
|
|
12
|
+
">PaywallProvider"
|
|
13
|
+
],
|
|
12
14
|
"label": "Paywall Close Button",
|
|
13
15
|
"description": "Paywall Close Button component.",
|
|
14
16
|
"styles": {}
|
|
@@ -16,7 +18,7 @@
|
|
|
16
18
|
"defaults": {
|
|
17
19
|
"iconType": "close",
|
|
18
20
|
"size": 24,
|
|
19
|
-
"
|
|
21
|
+
"styles": {
|
|
20
22
|
"position": "absolute",
|
|
21
23
|
"top": "35@vs",
|
|
22
24
|
"left": "24@s",
|
|
@@ -8,13 +8,15 @@
|
|
|
8
8
|
"children": "node"
|
|
9
9
|
},
|
|
10
10
|
"meta": {
|
|
11
|
-
"desiredParent": [
|
|
11
|
+
"desiredParent": [
|
|
12
|
+
">PaywallProvider"
|
|
13
|
+
],
|
|
12
14
|
"label": "Paywall Options",
|
|
13
15
|
"description": "Paywall options selector component.",
|
|
14
16
|
"styles": {}
|
|
15
17
|
},
|
|
16
18
|
"defaults": {
|
|
17
|
-
"
|
|
19
|
+
"styles": {
|
|
18
20
|
"flexDirection": "row",
|
|
19
21
|
"justifyContent": "space-between",
|
|
20
22
|
"alignItems": "center",
|
|
@@ -59,7 +59,7 @@ export interface PaywallProviderStyleGenerated {
|
|
|
59
59
|
export interface PaywallProviderPropsGenerated {
|
|
60
60
|
child: string;
|
|
61
61
|
attributes: {
|
|
62
|
-
|
|
62
|
+
styles?: PaywallProviderStyleGenerated;
|
|
63
63
|
scrollable?: boolean;
|
|
64
64
|
delay?: number;
|
|
65
65
|
};
|