@developer_tribe/react-builder 1.2.6 → 1.2.8
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/BIconProps.generated.d.ts +47 -44
- package/dist/build-components/BackgroundImage/BackgroundImageProps.generated.d.ts +38 -35
- package/dist/build-components/Button/ButtonProps.generated.d.ts +40 -37
- package/dist/build-components/Carousel/CarouselProps.generated.d.ts +37 -34
- package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +39 -36
- package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +38 -35
- package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +37 -34
- package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +37 -34
- package/dist/build-components/Image/ImageProps.generated.d.ts +38 -35
- package/dist/build-components/Main/MainProps.generated.d.ts +38 -35
- package/dist/build-components/Onboard/OnboardProps.generated.d.ts +37 -34
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +43 -40
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +44 -41
- package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +41 -38
- package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +51 -48
- package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +40 -37
- package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +38 -35
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +38 -35
- package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +44 -41
- package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +44 -41
- package/dist/build-components/PaywallBackground/PaywallBackgroundProps.generated.d.ts +37 -34
- package/dist/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.d.ts +47 -44
- package/dist/build-components/PaywallOptions/PaywallOptionsProps.generated.d.ts +37 -34
- package/dist/build-components/PaywallProvider/PaywallProviderProps.generated.d.ts +37 -34
- package/dist/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.d.ts +40 -37
- package/dist/build-components/RadioButton/RadioButtonProps.generated.d.ts +40 -37
- package/dist/build-components/Text/TextProps.generated.d.ts +44 -41
- package/dist/build-components/View/ViewProps.generated.d.ts +37 -34
- package/dist/build-components/patterns.generated.d.ts +21 -21
- package/dist/components/BuilderProvider.d.ts +6 -0
- package/dist/hooks/useExtractImageStyle.d.ts +3 -1
- package/dist/hooks/useExtractTextStyle.d.ts +1 -1
- package/dist/hooks/useExtractViewStyle.d.ts +1 -1
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.cjs.js +2 -2
- package/dist/index.native.cjs.js.map +1 -1
- package/dist/index.native.d.ts +4 -0
- package/dist/index.native.esm.js +2 -2
- package/dist/index.native.esm.js.map +1 -1
- package/dist/utils/extractImageStyle.d.ts +3 -0
- package/dist/utils/extractTextStyle/extractTextStyleNative.d.ts +17 -0
- package/dist/utils/extractTextStyle.d.ts +2 -0
- package/dist/utils/extractViewStyle/extractViewStyleNative.d.ts +12 -0
- package/dist/utils/extractViewStyle.d.ts +2 -0
- package/dist/utils/patterns.d.ts +2 -1
- package/package.json +5 -1
- package/scripts/prebuild/utils/createGeneratedProps.js +45 -3
- package/src/attributes-editor/LayoutPreviewPicker.tsx +4 -3
- package/src/build-components/BIcon/BIcon.tsx +3 -2
- package/src/build-components/BIcon/BIconProps.generated.ts +48 -44
- package/src/build-components/BackgroundImage/BackgroundImage.tsx +5 -3
- package/src/build-components/BackgroundImage/BackgroundImageProps.generated.ts +39 -35
- package/src/build-components/BackgroundImage/pattern.json +9 -17
- package/src/build-components/Button/Button.tsx +5 -4
- package/src/build-components/Button/ButtonProps.generated.ts +41 -37
- package/src/build-components/Carousel/CarouselProps.generated.ts +38 -34
- package/src/build-components/CarouselButtons/CarouselButtons.tsx +3 -2
- package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +40 -36
- package/src/build-components/CarouselDots/CarouselDots.tsx +1 -1
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +39 -35
- package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +38 -34
- package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +38 -34
- package/src/build-components/Image/Image.tsx +3 -2
- package/src/build-components/Image/ImageProps.generated.ts +39 -35
- package/src/build-components/Image/pattern.json +9 -16
- package/src/build-components/Main/Main.tsx +1 -1
- package/src/build-components/Main/MainProps.generated.ts +39 -35
- package/src/build-components/Onboard/OnboardProps.generated.ts +38 -34
- package/src/build-components/OnboardButton/OnboardButton.tsx +6 -5
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +44 -40
- package/src/build-components/OnboardButtons/OnboardButtons.tsx +4 -4
- package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +45 -41
- package/src/build-components/OnboardDot/OnboardDot.tsx +5 -4
- package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +42 -38
- package/src/build-components/OnboardFooter/OnboardFooter.tsx +16 -21
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +52 -48
- package/src/build-components/OnboardImage/OnboardImage.tsx +7 -6
- package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +41 -37
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +39 -35
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +39 -35
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +45 -41
- package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +45 -41
- package/src/build-components/PaywallBackground/PaywallBackgroundProps.generated.ts +38 -34
- package/src/build-components/PaywallCloseButton/PaywallCloseButton.tsx +4 -4
- package/src/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.ts +48 -44
- package/src/build-components/PaywallOptions/PaywallOptionsProps.generated.ts +38 -34
- package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +38 -34
- package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.ts +41 -37
- package/src/build-components/RadioButton/RadioButton.tsx +4 -3
- package/src/build-components/RadioButton/RadioButtonProps.generated.ts +41 -37
- package/src/build-components/Text/Text.tsx +3 -5
- package/src/build-components/Text/TextProps.generated.ts +45 -41
- package/src/build-components/View/ViewProps.generated.ts +38 -34
- package/src/build-components/patterns.generated.ts +21 -21
- package/src/components/BuilderProvider.tsx +15 -1
- package/src/hooks/useExtractImageStyle.ts +15 -4
- package/src/hooks/useExtractTextStyle.ts +11 -3
- package/src/hooks/useExtractViewStyle.ts +15 -4
- package/src/index.native.ts +6 -0
- package/src/index.ts +2 -0
- package/src/utils/extractImageStyle.ts +34 -5
- package/src/utils/extractTextStyle/extractTextStyle.ts +3 -5
- package/src/utils/extractTextStyle/extractTextStyleNative.ts +106 -0
- package/src/utils/extractTextStyle.ts +2 -0
- package/src/utils/extractViewStyle/extractViewStyle.ts +2 -4
- package/src/utils/extractViewStyle/extractViewStyleNative.ts +111 -0
- package/src/utils/extractViewStyle.ts +2 -0
- package/src/utils/patterns.ts +55 -1
|
@@ -18,43 +18,47 @@ export type JustifyContentOptionType =
|
|
|
18
18
|
| 'space-evenly';
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
|
+
export interface PaywallProviderStyleGenerated {
|
|
22
|
+
scrollable?: boolean;
|
|
23
|
+
flexDirection?: FlexDirectionOptionType;
|
|
24
|
+
alignItems?: AlignItemsOptionType;
|
|
25
|
+
justifyContent?: JustifyContentOptionType;
|
|
26
|
+
gap?: string;
|
|
27
|
+
padding?: string;
|
|
28
|
+
paddingHorizontal?: string;
|
|
29
|
+
paddingVertical?: string;
|
|
30
|
+
paddingTop?: string;
|
|
31
|
+
paddingBottom?: string;
|
|
32
|
+
paddingLeft?: string;
|
|
33
|
+
paddingRight?: string;
|
|
34
|
+
margin?: string;
|
|
35
|
+
marginHorizontal?: string;
|
|
36
|
+
marginVertical?: string;
|
|
37
|
+
marginTop?: string;
|
|
38
|
+
marginBottom?: string;
|
|
39
|
+
marginLeft?: string;
|
|
40
|
+
marginRight?: string;
|
|
41
|
+
backgroundColor?: string;
|
|
42
|
+
borderRadius?: string;
|
|
43
|
+
width?: string;
|
|
44
|
+
minWidth?: string;
|
|
45
|
+
maxWidth?: string;
|
|
46
|
+
height?: string;
|
|
47
|
+
minHeight?: string;
|
|
48
|
+
maxHeight?: string;
|
|
49
|
+
flex?: number;
|
|
50
|
+
position?: PositionOptionType;
|
|
51
|
+
top?: string;
|
|
52
|
+
bottom?: string;
|
|
53
|
+
left?: string;
|
|
54
|
+
right?: string;
|
|
55
|
+
zIndex?: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
21
58
|
export interface PaywallProviderPropsGenerated {
|
|
22
59
|
child: string;
|
|
23
60
|
attributes: {
|
|
24
|
-
style?:
|
|
25
|
-
scrollable?: boolean;
|
|
26
|
-
flexDirection?: FlexDirectionOptionType;
|
|
27
|
-
alignItems?: AlignItemsOptionType;
|
|
28
|
-
justifyContent?: JustifyContentOptionType;
|
|
29
|
-
gap?: string;
|
|
30
|
-
padding?: string;
|
|
31
|
-
paddingHorizontal?: string;
|
|
32
|
-
paddingVertical?: string;
|
|
33
|
-
paddingTop?: string;
|
|
34
|
-
paddingBottom?: string;
|
|
35
|
-
paddingLeft?: string;
|
|
36
|
-
paddingRight?: string;
|
|
37
|
-
margin?: string;
|
|
38
|
-
marginVertical?: string;
|
|
39
|
-
marginTop?: string;
|
|
40
|
-
marginBottom?: string;
|
|
41
|
-
marginLeft?: string;
|
|
42
|
-
marginRight?: string;
|
|
43
|
-
backgroundColor?: string;
|
|
44
|
-
borderRadius?: string;
|
|
45
|
-
width?: string;
|
|
46
|
-
minWidth?: string;
|
|
47
|
-
maxWidth?: string;
|
|
48
|
-
height?: string;
|
|
49
|
-
minHeight?: string;
|
|
50
|
-
maxHeight?: string;
|
|
51
|
-
flex?: number;
|
|
52
|
-
position?: PositionOptionType;
|
|
53
|
-
top?: string;
|
|
54
|
-
bottom?: string;
|
|
55
|
-
left?: string;
|
|
56
|
-
right?: string;
|
|
57
|
-
zIndex?: number;
|
|
61
|
+
style?: PaywallProviderStyleGenerated;
|
|
58
62
|
};
|
|
59
63
|
}
|
|
60
64
|
|
package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.ts
CHANGED
|
@@ -30,46 +30,50 @@ export type JustifyContentOptionType =
|
|
|
30
30
|
| 'space-evenly';
|
|
31
31
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
32
32
|
|
|
33
|
+
export interface PaywallSubscribeButtonStyleGenerated {
|
|
34
|
+
color?: string;
|
|
35
|
+
fontSize?: string;
|
|
36
|
+
fontWeight?: FontWeightOptionType;
|
|
37
|
+
scrollable?: boolean;
|
|
38
|
+
flexDirection?: FlexDirectionOptionType;
|
|
39
|
+
alignItems?: AlignItemsOptionType;
|
|
40
|
+
justifyContent?: JustifyContentOptionType;
|
|
41
|
+
gap?: string;
|
|
42
|
+
padding?: string;
|
|
43
|
+
paddingHorizontal?: string;
|
|
44
|
+
paddingVertical?: string;
|
|
45
|
+
paddingTop?: string;
|
|
46
|
+
paddingBottom?: string;
|
|
47
|
+
paddingLeft?: string;
|
|
48
|
+
paddingRight?: string;
|
|
49
|
+
margin?: string;
|
|
50
|
+
marginHorizontal?: string;
|
|
51
|
+
marginVertical?: string;
|
|
52
|
+
marginTop?: string;
|
|
53
|
+
marginBottom?: string;
|
|
54
|
+
marginLeft?: string;
|
|
55
|
+
marginRight?: string;
|
|
56
|
+
backgroundColor?: string;
|
|
57
|
+
borderRadius?: string;
|
|
58
|
+
width?: string;
|
|
59
|
+
minWidth?: string;
|
|
60
|
+
maxWidth?: string;
|
|
61
|
+
height?: string;
|
|
62
|
+
minHeight?: string;
|
|
63
|
+
maxHeight?: string;
|
|
64
|
+
flex?: number;
|
|
65
|
+
position?: PositionOptionType;
|
|
66
|
+
top?: string;
|
|
67
|
+
bottom?: string;
|
|
68
|
+
left?: string;
|
|
69
|
+
right?: string;
|
|
70
|
+
zIndex?: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
33
73
|
export interface PaywallSubscribeButtonPropsGenerated {
|
|
34
74
|
child: string;
|
|
35
75
|
attributes: {
|
|
36
|
-
style?:
|
|
37
|
-
color?: string;
|
|
38
|
-
fontSize?: string;
|
|
39
|
-
fontWeight?: FontWeightOptionType;
|
|
40
|
-
scrollable?: boolean;
|
|
41
|
-
flexDirection?: FlexDirectionOptionType;
|
|
42
|
-
alignItems?: AlignItemsOptionType;
|
|
43
|
-
justifyContent?: JustifyContentOptionType;
|
|
44
|
-
gap?: string;
|
|
45
|
-
padding?: string;
|
|
46
|
-
paddingHorizontal?: string;
|
|
47
|
-
paddingVertical?: string;
|
|
48
|
-
paddingTop?: string;
|
|
49
|
-
paddingBottom?: string;
|
|
50
|
-
paddingLeft?: string;
|
|
51
|
-
paddingRight?: string;
|
|
52
|
-
margin?: string;
|
|
53
|
-
marginVertical?: string;
|
|
54
|
-
marginTop?: string;
|
|
55
|
-
marginBottom?: string;
|
|
56
|
-
marginLeft?: string;
|
|
57
|
-
marginRight?: string;
|
|
58
|
-
backgroundColor?: string;
|
|
59
|
-
borderRadius?: string;
|
|
60
|
-
width?: string;
|
|
61
|
-
minWidth?: string;
|
|
62
|
-
maxWidth?: string;
|
|
63
|
-
height?: string;
|
|
64
|
-
minHeight?: string;
|
|
65
|
-
maxHeight?: string;
|
|
66
|
-
flex?: number;
|
|
67
|
-
position?: PositionOptionType;
|
|
68
|
-
top?: string;
|
|
69
|
-
bottom?: string;
|
|
70
|
-
left?: string;
|
|
71
|
-
right?: string;
|
|
72
|
-
zIndex?: number;
|
|
76
|
+
style?: PaywallSubscribeButtonStyleGenerated;
|
|
73
77
|
};
|
|
74
78
|
}
|
|
75
79
|
|
|
@@ -96,9 +96,10 @@ function RadioButton({ node }: RadioButtonComponentProps) {
|
|
|
96
96
|
isSelected ? SELECTED_OUTLINE_STYLE : undefined,
|
|
97
97
|
);
|
|
98
98
|
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
const
|
|
99
|
+
const styleBag = node.attributes?.style;
|
|
100
|
+
const selected = Boolean(styleBag?.selected);
|
|
101
|
+
const color = styleBag?.color;
|
|
102
|
+
const size = parseNumberLike(styleBag?.size);
|
|
102
103
|
|
|
103
104
|
return (
|
|
104
105
|
<div
|
|
@@ -18,46 +18,50 @@ export type JustifyContentOptionType =
|
|
|
18
18
|
| 'space-evenly';
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
|
+
export interface RadioButtonStyleGenerated {
|
|
22
|
+
scrollable?: boolean;
|
|
23
|
+
flexDirection?: FlexDirectionOptionType;
|
|
24
|
+
alignItems?: AlignItemsOptionType;
|
|
25
|
+
justifyContent?: JustifyContentOptionType;
|
|
26
|
+
gap?: string;
|
|
27
|
+
padding?: string;
|
|
28
|
+
paddingHorizontal?: string;
|
|
29
|
+
paddingVertical?: string;
|
|
30
|
+
paddingTop?: string;
|
|
31
|
+
paddingBottom?: string;
|
|
32
|
+
paddingLeft?: string;
|
|
33
|
+
paddingRight?: string;
|
|
34
|
+
margin?: string;
|
|
35
|
+
marginHorizontal?: string;
|
|
36
|
+
marginVertical?: string;
|
|
37
|
+
marginTop?: string;
|
|
38
|
+
marginBottom?: string;
|
|
39
|
+
marginLeft?: string;
|
|
40
|
+
marginRight?: string;
|
|
41
|
+
backgroundColor?: string;
|
|
42
|
+
borderRadius?: string;
|
|
43
|
+
width?: string;
|
|
44
|
+
minWidth?: string;
|
|
45
|
+
maxWidth?: string;
|
|
46
|
+
height?: string;
|
|
47
|
+
minHeight?: string;
|
|
48
|
+
maxHeight?: string;
|
|
49
|
+
flex?: number;
|
|
50
|
+
position?: PositionOptionType;
|
|
51
|
+
top?: string;
|
|
52
|
+
bottom?: string;
|
|
53
|
+
left?: string;
|
|
54
|
+
right?: string;
|
|
55
|
+
zIndex?: number;
|
|
56
|
+
selected?: boolean;
|
|
57
|
+
color?: string;
|
|
58
|
+
size?: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
21
61
|
export interface RadioButtonPropsGenerated {
|
|
22
62
|
child: string;
|
|
23
63
|
attributes: {
|
|
24
|
-
style?:
|
|
25
|
-
scrollable?: boolean;
|
|
26
|
-
flexDirection?: FlexDirectionOptionType;
|
|
27
|
-
alignItems?: AlignItemsOptionType;
|
|
28
|
-
justifyContent?: JustifyContentOptionType;
|
|
29
|
-
gap?: string;
|
|
30
|
-
padding?: string;
|
|
31
|
-
paddingHorizontal?: string;
|
|
32
|
-
paddingVertical?: string;
|
|
33
|
-
paddingTop?: string;
|
|
34
|
-
paddingBottom?: string;
|
|
35
|
-
paddingLeft?: string;
|
|
36
|
-
paddingRight?: string;
|
|
37
|
-
margin?: string;
|
|
38
|
-
marginVertical?: string;
|
|
39
|
-
marginTop?: string;
|
|
40
|
-
marginBottom?: string;
|
|
41
|
-
marginLeft?: string;
|
|
42
|
-
marginRight?: string;
|
|
43
|
-
backgroundColor?: string;
|
|
44
|
-
borderRadius?: string;
|
|
45
|
-
width?: string;
|
|
46
|
-
minWidth?: string;
|
|
47
|
-
maxWidth?: string;
|
|
48
|
-
height?: string;
|
|
49
|
-
minHeight?: string;
|
|
50
|
-
maxHeight?: string;
|
|
51
|
-
flex?: number;
|
|
52
|
-
position?: PositionOptionType;
|
|
53
|
-
top?: string;
|
|
54
|
-
bottom?: string;
|
|
55
|
-
left?: string;
|
|
56
|
-
right?: string;
|
|
57
|
-
zIndex?: number;
|
|
58
|
-
selected?: boolean;
|
|
59
|
-
color?: string;
|
|
60
|
-
size?: number;
|
|
64
|
+
style?: RadioButtonStyleGenerated;
|
|
61
65
|
};
|
|
62
66
|
}
|
|
63
67
|
|
|
@@ -39,11 +39,9 @@ function Text({ node }: TextComponentProps) {
|
|
|
39
39
|
|
|
40
40
|
const attrs = node.attributes;
|
|
41
41
|
const styleBag = attrs?.style;
|
|
42
|
-
const adjustsFontSizeToFit =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
(styleBag?.showEllipsis as boolean | undefined) ??
|
|
46
|
-
false;
|
|
42
|
+
const adjustsFontSizeToFit =
|
|
43
|
+
(styleBag?.adjustsFontSizeToFit as boolean | undefined) ?? false;
|
|
44
|
+
const showEllipsis = (styleBag?.showEllipsis as boolean | undefined) ?? false;
|
|
47
45
|
|
|
48
46
|
useLayoutEffect(() => {
|
|
49
47
|
if (!adjustsFontSizeToFit) {
|
|
@@ -19,50 +19,54 @@ export type JustifyContentOptionType =
|
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
export type TextAlignOptionType = 'left' | 'center' | 'right' | 'justify';
|
|
21
21
|
|
|
22
|
+
export interface TextStyleGenerated {
|
|
23
|
+
scrollable?: boolean;
|
|
24
|
+
flexDirection?: FlexDirectionOptionType;
|
|
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
|
+
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
|
+
color?: string;
|
|
58
|
+
fontSize?: string;
|
|
59
|
+
fontFamily?: string;
|
|
60
|
+
fontWeight?: string;
|
|
61
|
+
textAlign?: TextAlignOptionType;
|
|
62
|
+
adjustsFontSizeToFit?: boolean;
|
|
63
|
+
showEllipsis?: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
22
66
|
export interface TextPropsGenerated {
|
|
23
67
|
child: string;
|
|
24
68
|
attributes: {
|
|
25
|
-
style?:
|
|
26
|
-
scrollable?: boolean;
|
|
27
|
-
flexDirection?: FlexDirectionOptionType;
|
|
28
|
-
alignItems?: AlignItemsOptionType;
|
|
29
|
-
justifyContent?: JustifyContentOptionType;
|
|
30
|
-
gap?: string;
|
|
31
|
-
padding?: string;
|
|
32
|
-
paddingHorizontal?: string;
|
|
33
|
-
paddingVertical?: string;
|
|
34
|
-
paddingTop?: string;
|
|
35
|
-
paddingBottom?: string;
|
|
36
|
-
paddingLeft?: string;
|
|
37
|
-
paddingRight?: string;
|
|
38
|
-
margin?: string;
|
|
39
|
-
marginVertical?: string;
|
|
40
|
-
marginTop?: string;
|
|
41
|
-
marginBottom?: string;
|
|
42
|
-
marginLeft?: string;
|
|
43
|
-
marginRight?: string;
|
|
44
|
-
backgroundColor?: string;
|
|
45
|
-
borderRadius?: string;
|
|
46
|
-
width?: string;
|
|
47
|
-
minWidth?: string;
|
|
48
|
-
maxWidth?: string;
|
|
49
|
-
height?: string;
|
|
50
|
-
minHeight?: string;
|
|
51
|
-
maxHeight?: string;
|
|
52
|
-
flex?: number;
|
|
53
|
-
position?: PositionOptionType;
|
|
54
|
-
top?: string;
|
|
55
|
-
bottom?: string;
|
|
56
|
-
left?: string;
|
|
57
|
-
right?: string;
|
|
58
|
-
zIndex?: number;
|
|
59
|
-
color?: string;
|
|
60
|
-
fontSize?: string;
|
|
61
|
-
fontFamily?: string;
|
|
62
|
-
fontWeight?: string;
|
|
63
|
-
textAlign?: TextAlignOptionType;
|
|
64
|
-
adjustsFontSizeToFit?: boolean;
|
|
65
|
-
showEllipsis?: boolean;
|
|
69
|
+
style?: TextStyleGenerated;
|
|
66
70
|
};
|
|
67
71
|
}
|
|
68
72
|
|
|
@@ -18,43 +18,47 @@ export type JustifyContentOptionType =
|
|
|
18
18
|
| 'space-evenly';
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
|
+
export interface ViewStyleGenerated {
|
|
22
|
+
scrollable?: boolean;
|
|
23
|
+
flexDirection?: FlexDirectionOptionType;
|
|
24
|
+
alignItems?: AlignItemsOptionType;
|
|
25
|
+
justifyContent?: JustifyContentOptionType;
|
|
26
|
+
gap?: string;
|
|
27
|
+
padding?: string;
|
|
28
|
+
paddingHorizontal?: string;
|
|
29
|
+
paddingVertical?: string;
|
|
30
|
+
paddingTop?: string;
|
|
31
|
+
paddingBottom?: string;
|
|
32
|
+
paddingLeft?: string;
|
|
33
|
+
paddingRight?: string;
|
|
34
|
+
margin?: string;
|
|
35
|
+
marginHorizontal?: string;
|
|
36
|
+
marginVertical?: string;
|
|
37
|
+
marginTop?: string;
|
|
38
|
+
marginBottom?: string;
|
|
39
|
+
marginLeft?: string;
|
|
40
|
+
marginRight?: string;
|
|
41
|
+
backgroundColor?: string;
|
|
42
|
+
borderRadius?: string;
|
|
43
|
+
width?: string;
|
|
44
|
+
minWidth?: string;
|
|
45
|
+
maxWidth?: string;
|
|
46
|
+
height?: string;
|
|
47
|
+
minHeight?: string;
|
|
48
|
+
maxHeight?: string;
|
|
49
|
+
flex?: number;
|
|
50
|
+
position?: PositionOptionType;
|
|
51
|
+
top?: string;
|
|
52
|
+
bottom?: string;
|
|
53
|
+
left?: string;
|
|
54
|
+
right?: string;
|
|
55
|
+
zIndex?: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
21
58
|
export interface ViewPropsGenerated {
|
|
22
59
|
child: string;
|
|
23
60
|
attributes: {
|
|
24
|
-
style?:
|
|
25
|
-
scrollable?: boolean;
|
|
26
|
-
flexDirection?: FlexDirectionOptionType;
|
|
27
|
-
alignItems?: AlignItemsOptionType;
|
|
28
|
-
justifyContent?: JustifyContentOptionType;
|
|
29
|
-
gap?: string;
|
|
30
|
-
padding?: string;
|
|
31
|
-
paddingHorizontal?: string;
|
|
32
|
-
paddingVertical?: string;
|
|
33
|
-
paddingTop?: string;
|
|
34
|
-
paddingBottom?: string;
|
|
35
|
-
paddingLeft?: string;
|
|
36
|
-
paddingRight?: string;
|
|
37
|
-
margin?: string;
|
|
38
|
-
marginVertical?: string;
|
|
39
|
-
marginTop?: string;
|
|
40
|
-
marginBottom?: string;
|
|
41
|
-
marginLeft?: string;
|
|
42
|
-
marginRight?: string;
|
|
43
|
-
backgroundColor?: string;
|
|
44
|
-
borderRadius?: string;
|
|
45
|
-
width?: string;
|
|
46
|
-
minWidth?: string;
|
|
47
|
-
maxWidth?: string;
|
|
48
|
-
height?: string;
|
|
49
|
-
minHeight?: string;
|
|
50
|
-
maxHeight?: string;
|
|
51
|
-
flex?: number;
|
|
52
|
-
position?: PositionOptionType;
|
|
53
|
-
top?: string;
|
|
54
|
-
bottom?: string;
|
|
55
|
-
left?: string;
|
|
56
|
-
right?: string;
|
|
57
|
-
zIndex?: number;
|
|
61
|
+
style?: ViewStyleGenerated;
|
|
58
62
|
};
|
|
59
63
|
}
|
|
60
64
|
|
|
@@ -787,13 +787,6 @@ export const patterns = [
|
|
|
787
787
|
specialCategory: null,
|
|
788
788
|
sort: 26,
|
|
789
789
|
},
|
|
790
|
-
src: {
|
|
791
|
-
label: 'Src',
|
|
792
|
-
description: 'Image source URL.',
|
|
793
|
-
category: 'other',
|
|
794
|
-
specialCategory: null,
|
|
795
|
-
sort: 1,
|
|
796
|
-
},
|
|
797
790
|
resizeMode: {
|
|
798
791
|
label: 'Resize Mode',
|
|
799
792
|
description: 'How the image fits its container.',
|
|
@@ -802,6 +795,13 @@ export const patterns = [
|
|
|
802
795
|
sort: 4,
|
|
803
796
|
},
|
|
804
797
|
},
|
|
798
|
+
src: {
|
|
799
|
+
label: 'Src',
|
|
800
|
+
description: 'Image source URL.',
|
|
801
|
+
category: 'other',
|
|
802
|
+
specialCategory: null,
|
|
803
|
+
sort: 1,
|
|
804
|
+
},
|
|
805
805
|
},
|
|
806
806
|
defaults: {
|
|
807
807
|
style: {
|
|
@@ -3342,13 +3342,6 @@ export const patterns = [
|
|
|
3342
3342
|
specialCategory: null,
|
|
3343
3343
|
sort: 26,
|
|
3344
3344
|
},
|
|
3345
|
-
src: {
|
|
3346
|
-
label: 'Src',
|
|
3347
|
-
description: 'Image source URL.',
|
|
3348
|
-
category: 'other',
|
|
3349
|
-
specialCategory: null,
|
|
3350
|
-
sort: 1,
|
|
3351
|
-
},
|
|
3352
3345
|
resizeMode: {
|
|
3353
3346
|
label: 'Resize Mode',
|
|
3354
3347
|
description: 'How the image fits the frame.',
|
|
@@ -3357,6 +3350,13 @@ export const patterns = [
|
|
|
3357
3350
|
sort: 4,
|
|
3358
3351
|
},
|
|
3359
3352
|
},
|
|
3353
|
+
src: {
|
|
3354
|
+
label: 'Src',
|
|
3355
|
+
description: 'Image source URL.',
|
|
3356
|
+
category: 'other',
|
|
3357
|
+
specialCategory: null,
|
|
3358
|
+
sort: 1,
|
|
3359
|
+
},
|
|
3360
3360
|
},
|
|
3361
3361
|
defaults: {
|
|
3362
3362
|
style: { flexDirection: 'column', position: 'relative', zIndex: 1 },
|
|
@@ -5808,14 +5808,14 @@ export const patterns = [
|
|
|
5808
5808
|
desiredParent: ['>OnboardProvider', '>OnboardItem', '!=Onboard'],
|
|
5809
5809
|
label: 'Onboard Image',
|
|
5810
5810
|
description: 'Onboarding hero image with media.',
|
|
5811
|
+
src: {
|
|
5812
|
+
label: 'Src',
|
|
5813
|
+
description: 'Image source URL.',
|
|
5814
|
+
category: 'other',
|
|
5815
|
+
specialCategory: null,
|
|
5816
|
+
sort: 1,
|
|
5817
|
+
},
|
|
5811
5818
|
styles: {
|
|
5812
|
-
src: {
|
|
5813
|
-
label: 'Src',
|
|
5814
|
-
description: 'Image source URL.',
|
|
5815
|
-
category: 'other',
|
|
5816
|
-
specialCategory: null,
|
|
5817
|
-
sort: 1,
|
|
5818
|
-
},
|
|
5819
5819
|
width: {
|
|
5820
5820
|
label: 'Width',
|
|
5821
5821
|
description: 'Fixed width value.',
|
|
@@ -15,6 +15,12 @@ export type Products = Product;
|
|
|
15
15
|
export type BuilderProviderParams = {
|
|
16
16
|
products: Products[];
|
|
17
17
|
benefits: PaywallBenefits;
|
|
18
|
+
/**
|
|
19
|
+
* Render platform for style extraction + meta filtering.
|
|
20
|
+
* - 'web' (default): returns CSS-friendly styles for DOM rendering.
|
|
21
|
+
* - 'native': returns React Native-friendly styles (no DOM-only props like overflowX/Y).
|
|
22
|
+
*/
|
|
23
|
+
platform?: 'web' | 'native';
|
|
18
24
|
onPaywallClose?: () => void;
|
|
19
25
|
onPaywallSubscribe?: (product?: Product) => void | boolean | Promise<boolean>;
|
|
20
26
|
/**
|
|
@@ -68,6 +74,7 @@ export function BuilderProvider({ params, children }: BuilderProviderProps) {
|
|
|
68
74
|
: undefined,
|
|
69
75
|
fonts: Array.isArray(params?.fonts) ? (params.fonts as Fonts) : undefined,
|
|
70
76
|
appFont: params?.appFont,
|
|
77
|
+
platform: params?.platform === 'native' ? 'native' : 'web',
|
|
71
78
|
previewMode: !!params?.previewMode,
|
|
72
79
|
selectedKey:
|
|
73
80
|
typeof params?.selectedKey === 'string'
|
|
@@ -77,6 +84,7 @@ export function BuilderProvider({ params, children }: BuilderProviderProps) {
|
|
|
77
84
|
[
|
|
78
85
|
params?.benefits,
|
|
79
86
|
params?.products,
|
|
87
|
+
params?.platform,
|
|
80
88
|
params?.onPaywallClose,
|
|
81
89
|
params?.onPaywallSubscribe,
|
|
82
90
|
params?.appConfig,
|
|
@@ -94,5 +102,11 @@ export function BuilderProvider({ params, children }: BuilderProviderProps) {
|
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
export function useBuilderParams(): BuilderProviderParams {
|
|
97
|
-
return
|
|
105
|
+
return (
|
|
106
|
+
useContext(BuilderContext) ?? {
|
|
107
|
+
products: [],
|
|
108
|
+
benefits: {},
|
|
109
|
+
platform: 'web',
|
|
110
|
+
}
|
|
111
|
+
);
|
|
98
112
|
}
|
|
@@ -2,18 +2,29 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import type { NodeData } from '../types/Node';
|
|
3
3
|
import type { ImagePropsGenerated } from '../build-components/Image/ImageProps.generated';
|
|
4
4
|
import { useBuilderParams } from '../components/BuilderProvider';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
extractImageStyle,
|
|
7
|
+
extractImageStyleNative,
|
|
8
|
+
} from '../utils/extractImageStyle';
|
|
6
9
|
import { defaultAppConfig } from '../types/PreviewConfig';
|
|
7
10
|
|
|
8
11
|
export function useExtractImageStyle<
|
|
9
12
|
T extends ImagePropsGenerated['attributes'],
|
|
10
13
|
>(node: NodeData<T>) {
|
|
11
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
appConfig,
|
|
16
|
+
projectColors: builderProjectColors,
|
|
17
|
+
platform,
|
|
18
|
+
} = useBuilderParams();
|
|
12
19
|
const theme = appConfig?.theme ?? defaultAppConfig.theme;
|
|
13
20
|
const projectColors = builderProjectColors;
|
|
21
|
+
const isNative = platform === 'native';
|
|
14
22
|
|
|
15
23
|
return useMemo(
|
|
16
|
-
() =>
|
|
17
|
-
|
|
24
|
+
() =>
|
|
25
|
+
isNative
|
|
26
|
+
? extractImageStyleNative(node, { theme, projectColors })
|
|
27
|
+
: extractImageStyle(node, { theme, projectColors }),
|
|
28
|
+
[node, theme, projectColors, isNative],
|
|
18
29
|
);
|
|
19
30
|
}
|
|
@@ -3,7 +3,10 @@ import type { NodeData } from '../types/Node';
|
|
|
3
3
|
import type { TextPropsGenerated } from '../build-components/Text/TextProps.generated';
|
|
4
4
|
import { defaultAppConfig } from '../types/PreviewConfig';
|
|
5
5
|
import { useBuilderParams } from '../components/BuilderProvider';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
extractTextStyle,
|
|
8
|
+
extractTextStyleNative,
|
|
9
|
+
} from '../utils/extractTextStyle';
|
|
7
10
|
|
|
8
11
|
export function useExtractTextStyle<T extends TextPropsGenerated['attributes']>(
|
|
9
12
|
node: NodeData<T>,
|
|
@@ -12,15 +15,20 @@ export function useExtractTextStyle<T extends TextPropsGenerated['attributes']>(
|
|
|
12
15
|
appConfig: builderAppConfig,
|
|
13
16
|
projectColors: builderProjectColors,
|
|
14
17
|
fonts: builderFonts,
|
|
18
|
+
platform,
|
|
15
19
|
} = useBuilderParams();
|
|
16
20
|
|
|
17
21
|
const appConfig = builderAppConfig ?? defaultAppConfig;
|
|
18
22
|
const projectColors = builderProjectColors;
|
|
19
23
|
const fonts = builderFonts;
|
|
24
|
+
const isNative = platform === 'native';
|
|
20
25
|
|
|
21
26
|
return useMemo(
|
|
22
|
-
() =>
|
|
27
|
+
() =>
|
|
28
|
+
isNative
|
|
29
|
+
? extractTextStyleNative(node, { appConfig, projectColors, fonts })
|
|
30
|
+
: extractTextStyle(node, { appConfig, projectColors, fonts }),
|
|
23
31
|
// fonts is intentionally included: extractTextStyle resolves weights via font definitions.
|
|
24
|
-
[node, appConfig, projectColors, fonts],
|
|
32
|
+
[node, appConfig, projectColors, fonts, isNative],
|
|
25
33
|
);
|
|
26
34
|
}
|
|
@@ -2,18 +2,29 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import type { NodeData } from '../types/Node';
|
|
3
3
|
import type { ViewPropsGenerated } from '../build-components/View/ViewProps.generated';
|
|
4
4
|
import { useBuilderParams } from '../components/BuilderProvider';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
extractViewStyle,
|
|
7
|
+
extractViewStyleNative,
|
|
8
|
+
} from '../utils/extractViewStyle';
|
|
6
9
|
import { defaultAppConfig } from '../types/PreviewConfig';
|
|
7
10
|
|
|
8
11
|
export function useExtractViewStyle<T extends ViewPropsGenerated['attributes']>(
|
|
9
12
|
node: NodeData<T>,
|
|
10
13
|
) {
|
|
11
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
appConfig,
|
|
16
|
+
projectColors: builderProjectColors,
|
|
17
|
+
platform,
|
|
18
|
+
} = useBuilderParams();
|
|
12
19
|
const theme = appConfig?.theme ?? defaultAppConfig.theme;
|
|
13
20
|
const projectColors = builderProjectColors;
|
|
21
|
+
const isNative = platform === 'native';
|
|
14
22
|
|
|
15
23
|
return useMemo(
|
|
16
|
-
() =>
|
|
17
|
-
|
|
24
|
+
() =>
|
|
25
|
+
isNative
|
|
26
|
+
? extractViewStyleNative(node, { theme, projectColors })
|
|
27
|
+
: extractViewStyle(node, { theme, projectColors }),
|
|
28
|
+
[node, theme, projectColors, isNative],
|
|
18
29
|
);
|
|
19
30
|
}
|