@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
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"defaults": {
|
|
14
|
-
"
|
|
14
|
+
"styles": {
|
|
15
15
|
"width": "100%",
|
|
16
16
|
"height": "100%"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"meta": {
|
|
20
|
-
"desiredParent": [
|
|
20
|
+
"desiredParent": [
|
|
21
|
+
"all"
|
|
22
|
+
],
|
|
21
23
|
"label": "Paywall Provider",
|
|
22
24
|
"description": "Provider/wrapper for paywall screen components.",
|
|
23
25
|
"attributes": {
|
package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.ts
CHANGED
|
@@ -74,7 +74,7 @@ export interface PaywallSubscribeButtonStyleGenerated {
|
|
|
74
74
|
export interface PaywallSubscribeButtonPropsGenerated {
|
|
75
75
|
child: string;
|
|
76
76
|
attributes: {
|
|
77
|
-
|
|
77
|
+
styles?: PaywallSubscribeButtonStyleGenerated;
|
|
78
78
|
scrollable?: boolean;
|
|
79
79
|
};
|
|
80
80
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"extends": "Button"
|
|
9
9
|
},
|
|
10
10
|
"defaults": {
|
|
11
|
-
"
|
|
11
|
+
"styles": {
|
|
12
12
|
"paddingHorizontal": "20@s",
|
|
13
13
|
"paddingVertical": "12@vs",
|
|
14
14
|
"borderRadius": "12@s",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"meta": {
|
|
24
|
-
"desiredParent": [
|
|
24
|
+
"desiredParent": [
|
|
25
|
+
">PaywallProvider"
|
|
26
|
+
],
|
|
25
27
|
"label": "Paywall Subscribe Button",
|
|
26
28
|
"description": "Paywall subscribe call-to-action button. Extends Button.",
|
|
27
29
|
"styles": {}
|
|
@@ -68,7 +68,7 @@ export interface PriceTagStyleGenerated {
|
|
|
68
68
|
export interface PriceTagPropsGenerated {
|
|
69
69
|
child: string;
|
|
70
70
|
attributes: {
|
|
71
|
-
|
|
71
|
+
styles?: PriceTagStyleGenerated;
|
|
72
72
|
adjustsFontSizeToFit?: boolean;
|
|
73
73
|
showEllipsis?: boolean;
|
|
74
74
|
translateCounter?: number;
|
|
@@ -9,19 +9,25 @@
|
|
|
9
9
|
"attributes": {
|
|
10
10
|
"showOriginalPricePossible": "boolean",
|
|
11
11
|
"hideIfItsNotDiscount": "boolean",
|
|
12
|
-
"
|
|
13
|
-
"textDecorationLine": [
|
|
12
|
+
"styles": {
|
|
13
|
+
"textDecorationLine": [
|
|
14
|
+
"none",
|
|
15
|
+
"underline",
|
|
16
|
+
"line-through"
|
|
17
|
+
]
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
20
|
},
|
|
17
21
|
"defaults": {
|
|
18
|
-
"
|
|
22
|
+
"styles": {
|
|
19
23
|
"fontSize": "16@fs",
|
|
20
24
|
"fontWeight": "700"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"meta": {
|
|
24
|
-
"desiredParent": [
|
|
28
|
+
"desiredParent": [
|
|
29
|
+
">PaywallProvider"
|
|
30
|
+
],
|
|
25
31
|
"label": "Price Tag",
|
|
26
32
|
"description": "Displays a price tag text. Extends Text.",
|
|
27
33
|
"styles": {
|
|
@@ -63,7 +63,7 @@ export interface PricingStyleGenerated {
|
|
|
63
63
|
export interface PricingPropsGenerated {
|
|
64
64
|
child: string;
|
|
65
65
|
attributes: {
|
|
66
|
-
|
|
66
|
+
styles?: PricingStyleGenerated;
|
|
67
67
|
adjustsFontSizeToFit?: boolean;
|
|
68
68
|
showEllipsis?: boolean;
|
|
69
69
|
translateCounter?: number;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"defaults": {
|
|
11
11
|
"translateCounter": 2,
|
|
12
|
-
"
|
|
12
|
+
"styles": {
|
|
13
13
|
"textAlign": "center",
|
|
14
14
|
"fontSize": "12@fs",
|
|
15
15
|
"fontWeight": "400",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"meta": {
|
|
20
|
-
"desiredParent": [
|
|
20
|
+
"desiredParent": [
|
|
21
|
+
">PaywallProvider"
|
|
22
|
+
],
|
|
21
23
|
"label": "Pricing",
|
|
22
24
|
"description": "Displays pricing details (e.g. promo/trial breakdown). Extends Text.",
|
|
23
25
|
"styles": {}
|
|
@@ -63,7 +63,7 @@ export interface PromoStyleGenerated {
|
|
|
63
63
|
export interface PromoPropsGenerated {
|
|
64
64
|
child: string;
|
|
65
65
|
attributes: {
|
|
66
|
-
|
|
66
|
+
styles?: PromoStyleGenerated;
|
|
67
67
|
adjustsFontSizeToFit?: boolean;
|
|
68
68
|
showEllipsis?: boolean;
|
|
69
69
|
translateCounter?: number;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"defaults": {
|
|
11
11
|
"translateCounter": 2,
|
|
12
|
-
"
|
|
12
|
+
"styles": {
|
|
13
13
|
"textAlign": "center",
|
|
14
14
|
"fontSize": "12@fs",
|
|
15
15
|
"fontWeight": "600",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"meta": {
|
|
20
|
-
"desiredParent": [
|
|
20
|
+
"desiredParent": [
|
|
21
|
+
">PaywallProvider"
|
|
22
|
+
],
|
|
21
23
|
"label": "Promo",
|
|
22
24
|
"description": "Displays promotional badge/text (e.g. discount percentage). Extends Text.",
|
|
23
25
|
"styles": {}
|
|
@@ -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
|
) : (
|
|
@@ -59,7 +59,7 @@ export interface RadioButtonStyleGenerated {
|
|
|
59
59
|
export interface RadioButtonPropsGenerated {
|
|
60
60
|
child: string;
|
|
61
61
|
attributes: {
|
|
62
|
-
|
|
62
|
+
styles?: RadioButtonStyleGenerated;
|
|
63
63
|
scrollable?: boolean;
|
|
64
64
|
selected?: boolean;
|
|
65
65
|
color?: string;
|
|
@@ -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 =
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "description",
|
|
7
7
|
"children": "never",
|
|
8
8
|
"attributes": {
|
|
9
|
-
"
|
|
9
|
+
"styles": {
|
|
10
10
|
"backgroundColor": "color",
|
|
11
11
|
"width": "size",
|
|
12
12
|
"height": "size",
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"meta": {
|
|
21
|
-
"desiredParent": [
|
|
21
|
+
"desiredParent": [
|
|
22
|
+
"all"
|
|
23
|
+
],
|
|
22
24
|
"label": "Separator",
|
|
23
25
|
"description": "Horizontal line separator.",
|
|
24
26
|
"styles": {
|
|
@@ -50,7 +52,7 @@
|
|
|
50
52
|
}
|
|
51
53
|
},
|
|
52
54
|
"defaults": {
|
|
53
|
-
"
|
|
55
|
+
"styles": {
|
|
54
56
|
"width": "100%",
|
|
55
57
|
"height": 2,
|
|
56
58
|
"backgroundColor": "#000000"
|
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
"children": "never",
|
|
8
8
|
"extends": "View",
|
|
9
9
|
"attributes": {
|
|
10
|
-
"
|
|
10
|
+
"styles": {
|
|
11
11
|
"backgroundColor": "color"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"meta": {
|
|
16
|
-
"desiredParent": [
|
|
16
|
+
"desiredParent": [
|
|
17
|
+
"all"
|
|
18
|
+
],
|
|
17
19
|
"label": "Status Bar Color",
|
|
18
20
|
"description": "Sets the OS status bar background color.",
|
|
19
21
|
"styles": {
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
}
|
|
28
30
|
},
|
|
29
31
|
"defaults": {
|
|
30
|
-
"
|
|
32
|
+
"styles": {
|
|
31
33
|
"backgroundColor": "THEME_COLORS.BACKGROUND"
|
|
32
34
|
}
|
|
33
35
|
}
|
|
@@ -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';
|
|
@@ -39,7 +39,7 @@ function Text({ node }: TextComponentProps) {
|
|
|
39
39
|
//Optimzation trade off by readability: could avoid dict lookup on subsequent passes
|
|
40
40
|
}, [localize, keyOrText, translateCounter]);
|
|
41
41
|
|
|
42
|
-
const styleBag = node.attributes?.
|
|
42
|
+
const styleBag = node.attributes?.styles as unknown as
|
|
43
43
|
| { adjustsFontSizeToFit?: boolean; showEllipsis?: boolean }
|
|
44
44
|
| undefined;
|
|
45
45
|
const adjustsFontSizeToFit = styleBag?.adjustsFontSizeToFit ?? false;
|
|
@@ -63,7 +63,7 @@ export interface TextStyleGenerated {
|
|
|
63
63
|
export interface TextPropsGenerated {
|
|
64
64
|
child: string;
|
|
65
65
|
attributes: {
|
|
66
|
-
|
|
66
|
+
styles?: TextStyleGenerated;
|
|
67
67
|
scrollable?: boolean;
|
|
68
68
|
adjustsFontSizeToFit?: boolean;
|
|
69
69
|
showEllipsis?: boolean;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"adjustsFontSizeToFit": "boolean",
|
|
11
11
|
"showEllipsis": "boolean",
|
|
12
12
|
"translateCounter": "number",
|
|
13
|
-
"
|
|
13
|
+
"styles": {
|
|
14
14
|
"color": "color",
|
|
15
15
|
"fontSize": "size",
|
|
16
16
|
"fontFamily": "fontFamily",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"defaults": {
|
|
21
21
|
"translateCounter": 1,
|
|
22
|
-
"
|
|
22
|
+
"styles": {
|
|
23
23
|
"color": "THEME_COLORS.TEXT",
|
|
24
24
|
"fontSize": "16@fs",
|
|
25
25
|
"fontWeight": "400"
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"meta": {
|
|
30
|
-
"desiredParent": [
|
|
30
|
+
"desiredParent": [
|
|
31
|
+
"all"
|
|
32
|
+
],
|
|
31
33
|
"label": "Text",
|
|
32
34
|
"description": "Displays simple text.",
|
|
33
35
|
"styles": {
|
|
@@ -7,9 +7,16 @@
|
|
|
7
7
|
"children": "node",
|
|
8
8
|
"attributes": {
|
|
9
9
|
"scrollable": "boolean",
|
|
10
|
-
"
|
|
11
|
-
"flexDirection": [
|
|
12
|
-
|
|
10
|
+
"styles": {
|
|
11
|
+
"flexDirection": [
|
|
12
|
+
"row",
|
|
13
|
+
"column"
|
|
14
|
+
],
|
|
15
|
+
"flexWrap": [
|
|
16
|
+
"nowrap",
|
|
17
|
+
"wrap",
|
|
18
|
+
"wrap-reverse"
|
|
19
|
+
],
|
|
13
20
|
"alignItems": [
|
|
14
21
|
"flex-start",
|
|
15
22
|
"center",
|
|
@@ -49,7 +56,10 @@
|
|
|
49
56
|
"minHeight": "size",
|
|
50
57
|
"maxHeight": "size",
|
|
51
58
|
"flex": "number",
|
|
52
|
-
"position": [
|
|
59
|
+
"position": [
|
|
60
|
+
"relative",
|
|
61
|
+
"absolute"
|
|
62
|
+
],
|
|
53
63
|
"top": "size",
|
|
54
64
|
"bottom": "size",
|
|
55
65
|
"left": "size",
|
|
@@ -59,7 +69,9 @@
|
|
|
59
69
|
}
|
|
60
70
|
},
|
|
61
71
|
"meta": {
|
|
62
|
-
"desiredParent": [
|
|
72
|
+
"desiredParent": [
|
|
73
|
+
"all"
|
|
74
|
+
],
|
|
63
75
|
"label": "View",
|
|
64
76
|
"description": "Base layout container.",
|
|
65
77
|
"specialCategories": {
|
|
@@ -365,7 +377,7 @@
|
|
|
365
377
|
}
|
|
366
378
|
},
|
|
367
379
|
"defaults": {
|
|
368
|
-
"
|
|
380
|
+
"styles": {
|
|
369
381
|
"flexDirection": "column",
|
|
370
382
|
"position": "relative",
|
|
371
383
|
"zIndex": 1,
|