@developer_tribe/react-builder 1.2.42 → 1.2.43
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 +1 -1
- package/dist/build-components/CountDown/CountDownProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardFooter/OnboardFooterProps.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/PaywallCloseButton/PaywallCloseButtonProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallFooter/PaywallFooterProps.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/Text/TextProps.generated.d.ts +1 -1
- package/dist/build-components/patterns.generated.d.ts +22 -11
- 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/package.json +1 -1
- package/src/RenderPage.tsx +4 -1
- package/src/assets/meta.json +1 -1
- package/src/assets/prompt-scheme-onboard.generated.ts +1 -1
- package/src/assets/prompt-scheme-paywall.generated.ts +1 -1
- package/src/assets/samples/paywall-1.json +2 -2
- package/src/attributes-editor/FallbackLocalizationField.tsx +725 -250
- package/src/build-components/BIcon/BIconProps.generated.ts +1 -1
- package/src/build-components/CountDown/CountDownProps.generated.ts +1 -1
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +1 -1
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +1 -1
- package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +1 -1
- package/src/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.ts +1 -1
- package/src/build-components/PaywallFooter/PaywallFooterProps.generated.ts +1 -1
- package/src/build-components/PriceTag/PriceTagProps.generated.ts +1 -1
- package/src/build-components/Pricing/PricingProps.generated.ts +1 -1
- package/src/build-components/Promo/PromoProps.generated.ts +1 -1
- package/src/build-components/Text/Text.tsx +5 -4
- package/src/build-components/Text/TextProps.generated.ts +1 -1
- package/src/build-components/Text/pattern.json +2 -1
- package/src/build-components/patterns.generated.ts +22 -11
- package/src/hooks/useSafeAreaViewStyle.ts +1 -11
- package/src/utils/extractViewStyle/extractViewStyle.ts +0 -1
- package/src/utils/useMergedStyle.ts +1 -1
|
@@ -66,7 +66,7 @@ export interface CountDownPropsGenerated {
|
|
|
66
66
|
attributes: {
|
|
67
67
|
styles?: CountDownStyleGenerated;
|
|
68
68
|
adjustsFontSizeToFit?: boolean;
|
|
69
|
-
|
|
69
|
+
numberOfLines?: number;
|
|
70
70
|
translateCounter?: number;
|
|
71
71
|
scrollable?: boolean;
|
|
72
72
|
testID?: string;
|
|
@@ -66,7 +66,7 @@ export interface OnboardFooterPropsGenerated {
|
|
|
66
66
|
attributes: {
|
|
67
67
|
styles?: OnboardFooterStyleGenerated;
|
|
68
68
|
adjustsFontSizeToFit?: boolean;
|
|
69
|
-
|
|
69
|
+
numberOfLines?: number;
|
|
70
70
|
translateCounter?: number;
|
|
71
71
|
scrollable?: boolean;
|
|
72
72
|
testID?: string;
|
|
@@ -66,7 +66,7 @@ export interface OnboardSubtitlePropsGenerated {
|
|
|
66
66
|
attributes: {
|
|
67
67
|
styles?: OnboardSubtitleStyleGenerated;
|
|
68
68
|
adjustsFontSizeToFit?: boolean;
|
|
69
|
-
|
|
69
|
+
numberOfLines?: number;
|
|
70
70
|
translateCounter?: number;
|
|
71
71
|
scrollable?: boolean;
|
|
72
72
|
testID?: string;
|
|
@@ -66,7 +66,7 @@ export interface OnboardTitlePropsGenerated {
|
|
|
66
66
|
attributes: {
|
|
67
67
|
styles?: OnboardTitleStyleGenerated;
|
|
68
68
|
adjustsFontSizeToFit?: boolean;
|
|
69
|
-
|
|
69
|
+
numberOfLines?: number;
|
|
70
70
|
translateCounter?: number;
|
|
71
71
|
scrollable?: boolean;
|
|
72
72
|
testID?: string;
|
|
@@ -66,7 +66,7 @@ export interface PaywallFooterPropsGenerated {
|
|
|
66
66
|
attributes: {
|
|
67
67
|
styles?: PaywallFooterStyleGenerated;
|
|
68
68
|
adjustsFontSizeToFit?: boolean;
|
|
69
|
-
|
|
69
|
+
numberOfLines?: number;
|
|
70
70
|
translateCounter?: number;
|
|
71
71
|
scrollable?: boolean;
|
|
72
72
|
testID?: string;
|
|
@@ -44,9 +44,10 @@ export function Text({ node }: TextComponentProps) {
|
|
|
44
44
|
| undefined;
|
|
45
45
|
const adjustsFontSizeToFit = styleBag?.adjustsFontSizeToFit ?? false;
|
|
46
46
|
const showEllipsis = styleBag?.showEllipsis ?? false;
|
|
47
|
+
const numberOfLines = (node.attributes as any)?.numberOfLines;
|
|
47
48
|
|
|
48
49
|
useLayoutEffect(() => {
|
|
49
|
-
if (!adjustsFontSizeToFit) {
|
|
50
|
+
if (numberOfLines !== 1 || !adjustsFontSizeToFit) {
|
|
50
51
|
setAutoFontSizePx(null);
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
@@ -95,12 +96,12 @@ export function Text({ node }: TextComponentProps) {
|
|
|
95
96
|
ro?.disconnect();
|
|
96
97
|
window.removeEventListener('resize', compute);
|
|
97
98
|
};
|
|
98
|
-
}, [adjustsFontSizeToFit, localizedText]);
|
|
99
|
+
}, [adjustsFontSizeToFit, localizedText, numberOfLines]);
|
|
99
100
|
|
|
100
101
|
const extraStyle = useMemo((): React.CSSProperties | undefined => {
|
|
101
102
|
let next: React.CSSProperties | undefined;
|
|
102
103
|
|
|
103
|
-
if (
|
|
104
|
+
if (numberOfLines == 1 && adjustsFontSizeToFit) {
|
|
104
105
|
next = {
|
|
105
106
|
...(next ?? {}),
|
|
106
107
|
overflow: 'hidden',
|
|
@@ -117,7 +118,7 @@ export function Text({ node }: TextComponentProps) {
|
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
return next;
|
|
120
|
-
}, [showEllipsis, autoFontSizePx]);
|
|
121
|
+
}, [showEllipsis, autoFontSizePx, numberOfLines, adjustsFontSizeToFit]);
|
|
121
122
|
|
|
122
123
|
const style = useMergedStyle(
|
|
123
124
|
useMergedStyle(textStyle, extraStyle),
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"extends": "View",
|
|
9
9
|
"attributes": {
|
|
10
10
|
"adjustsFontSizeToFit": "boolean",
|
|
11
|
-
"
|
|
11
|
+
"numberOfLines": "number",
|
|
12
12
|
"translateCounter": "number",
|
|
13
13
|
"styles": {
|
|
14
14
|
"color": "color",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"defaults": {
|
|
22
22
|
"translateCounter": 1,
|
|
23
|
+
"numberOfLines": 1,
|
|
23
24
|
"styles": {
|
|
24
25
|
"color": "THEME_COLORS.TEXT",
|
|
25
26
|
"fontSize": "16@fs",
|
|
@@ -11,7 +11,7 @@ export const patterns = [
|
|
|
11
11
|
children: 'never',
|
|
12
12
|
attributes: {
|
|
13
13
|
adjustsFontSizeToFit: 'boolean',
|
|
14
|
-
|
|
14
|
+
numberOfLines: 'number',
|
|
15
15
|
translateCounter: 'number',
|
|
16
16
|
styles: {
|
|
17
17
|
color: 'color',
|
|
@@ -457,6 +457,7 @@ export const patterns = [
|
|
|
457
457
|
},
|
|
458
458
|
defaults: {
|
|
459
459
|
translateCounter: 1,
|
|
460
|
+
numberOfLines: 1,
|
|
460
461
|
styles: {
|
|
461
462
|
color: 'THEME_COLORS.TEXT',
|
|
462
463
|
fontSize: '16',
|
|
@@ -3252,7 +3253,7 @@ export const patterns = [
|
|
|
3252
3253
|
children: 'never',
|
|
3253
3254
|
attributes: {
|
|
3254
3255
|
adjustsFontSizeToFit: 'boolean',
|
|
3255
|
-
|
|
3256
|
+
numberOfLines: 'number',
|
|
3256
3257
|
translateCounter: 'number',
|
|
3257
3258
|
styles: {
|
|
3258
3259
|
color: 'color',
|
|
@@ -3682,6 +3683,7 @@ export const patterns = [
|
|
|
3682
3683
|
},
|
|
3683
3684
|
defaults: {
|
|
3684
3685
|
translateCounter: 1,
|
|
3686
|
+
numberOfLines: 1,
|
|
3685
3687
|
styles: {
|
|
3686
3688
|
color: 'THEME_COLORS.TEXT',
|
|
3687
3689
|
fontSize: '16@fs',
|
|
@@ -6242,7 +6244,7 @@ export const patterns = [
|
|
|
6242
6244
|
children: 'never',
|
|
6243
6245
|
attributes: {
|
|
6244
6246
|
adjustsFontSizeToFit: 'boolean',
|
|
6245
|
-
|
|
6247
|
+
numberOfLines: 'number',
|
|
6246
6248
|
translateCounter: 'number',
|
|
6247
6249
|
styles: {
|
|
6248
6250
|
color: 'color',
|
|
@@ -6720,6 +6722,7 @@ export const patterns = [
|
|
|
6720
6722
|
},
|
|
6721
6723
|
defaults: {
|
|
6722
6724
|
translateCounter: 1,
|
|
6725
|
+
numberOfLines: 1,
|
|
6723
6726
|
styles: {
|
|
6724
6727
|
color: 'THEME_COLORS.TEXT',
|
|
6725
6728
|
fontSize: '16@fs',
|
|
@@ -7950,7 +7953,7 @@ export const patterns = [
|
|
|
7950
7953
|
children: 'string',
|
|
7951
7954
|
attributes: {
|
|
7952
7955
|
adjustsFontSizeToFit: 'boolean',
|
|
7953
|
-
|
|
7956
|
+
numberOfLines: 'number',
|
|
7954
7957
|
translateCounter: 'number',
|
|
7955
7958
|
styles: {
|
|
7956
7959
|
color: 'color',
|
|
@@ -8372,6 +8375,7 @@ export const patterns = [
|
|
|
8372
8375
|
},
|
|
8373
8376
|
defaults: {
|
|
8374
8377
|
translateCounter: 1,
|
|
8378
|
+
numberOfLines: 1,
|
|
8375
8379
|
styles: {
|
|
8376
8380
|
color: 'THEME_COLORS.TEXT',
|
|
8377
8381
|
fontSize: '14@fs',
|
|
@@ -8395,7 +8399,7 @@ export const patterns = [
|
|
|
8395
8399
|
children: 'string',
|
|
8396
8400
|
attributes: {
|
|
8397
8401
|
adjustsFontSizeToFit: 'boolean',
|
|
8398
|
-
|
|
8402
|
+
numberOfLines: 'number',
|
|
8399
8403
|
translateCounter: 'number',
|
|
8400
8404
|
styles: {
|
|
8401
8405
|
color: 'color',
|
|
@@ -8817,6 +8821,7 @@ export const patterns = [
|
|
|
8817
8821
|
},
|
|
8818
8822
|
defaults: {
|
|
8819
8823
|
translateCounter: 1,
|
|
8824
|
+
numberOfLines: 1,
|
|
8820
8825
|
styles: {
|
|
8821
8826
|
color: 'THEME_COLORS.TEXT',
|
|
8822
8827
|
fontSize: '24@fs',
|
|
@@ -9247,7 +9252,7 @@ export const patterns = [
|
|
|
9247
9252
|
size: 'number',
|
|
9248
9253
|
strokeWidth: 'number',
|
|
9249
9254
|
adjustsFontSizeToFit: 'boolean',
|
|
9250
|
-
|
|
9255
|
+
numberOfLines: 'number',
|
|
9251
9256
|
translateCounter: 'number',
|
|
9252
9257
|
styles: {
|
|
9253
9258
|
color: 'color',
|
|
@@ -9707,6 +9712,7 @@ export const patterns = [
|
|
|
9707
9712
|
alignItems: 'center',
|
|
9708
9713
|
},
|
|
9709
9714
|
translateCounter: 1,
|
|
9715
|
+
numberOfLines: 1,
|
|
9710
9716
|
testID: 'paywall-close-button',
|
|
9711
9717
|
size: 24,
|
|
9712
9718
|
},
|
|
@@ -9721,7 +9727,7 @@ export const patterns = [
|
|
|
9721
9727
|
children: 'never',
|
|
9722
9728
|
attributes: {
|
|
9723
9729
|
adjustsFontSizeToFit: 'boolean',
|
|
9724
|
-
|
|
9730
|
+
numberOfLines: 'number',
|
|
9725
9731
|
translateCounter: 'number',
|
|
9726
9732
|
styles: {
|
|
9727
9733
|
color: 'color',
|
|
@@ -10199,6 +10205,7 @@ export const patterns = [
|
|
|
10199
10205
|
},
|
|
10200
10206
|
defaults: {
|
|
10201
10207
|
translateCounter: 1,
|
|
10208
|
+
numberOfLines: 1,
|
|
10202
10209
|
styles: {
|
|
10203
10210
|
color: 'THEME_COLORS.TEXT',
|
|
10204
10211
|
fontSize: '16@fs',
|
|
@@ -11430,7 +11437,7 @@ export const patterns = [
|
|
|
11430
11437
|
children: 'string',
|
|
11431
11438
|
attributes: {
|
|
11432
11439
|
adjustsFontSizeToFit: 'boolean',
|
|
11433
|
-
|
|
11440
|
+
numberOfLines: 'number',
|
|
11434
11441
|
translateCounter: 'number',
|
|
11435
11442
|
styles: {
|
|
11436
11443
|
color: 'color',
|
|
@@ -11878,6 +11885,7 @@ export const patterns = [
|
|
|
11878
11885
|
},
|
|
11879
11886
|
defaults: {
|
|
11880
11887
|
translateCounter: 1,
|
|
11888
|
+
numberOfLines: 1,
|
|
11881
11889
|
styles: {
|
|
11882
11890
|
color: 'THEME_COLORS.TEXT',
|
|
11883
11891
|
fontSize: '16@fs',
|
|
@@ -11901,7 +11909,7 @@ export const patterns = [
|
|
|
11901
11909
|
children: 'string',
|
|
11902
11910
|
attributes: {
|
|
11903
11911
|
adjustsFontSizeToFit: 'boolean',
|
|
11904
|
-
|
|
11912
|
+
numberOfLines: 'number',
|
|
11905
11913
|
translateCounter: 'number',
|
|
11906
11914
|
styles: {
|
|
11907
11915
|
color: 'color',
|
|
@@ -12324,6 +12332,7 @@ export const patterns = [
|
|
|
12324
12332
|
},
|
|
12325
12333
|
defaults: {
|
|
12326
12334
|
translateCounter: 2,
|
|
12335
|
+
numberOfLines: 1,
|
|
12327
12336
|
styles: {
|
|
12328
12337
|
color: 'rgba(255,255,255,0.6)',
|
|
12329
12338
|
fontSize: '12@fs',
|
|
@@ -12348,7 +12357,7 @@ export const patterns = [
|
|
|
12348
12357
|
children: 'string',
|
|
12349
12358
|
attributes: {
|
|
12350
12359
|
adjustsFontSizeToFit: 'boolean',
|
|
12351
|
-
|
|
12360
|
+
numberOfLines: 'number',
|
|
12352
12361
|
translateCounter: 'number',
|
|
12353
12362
|
styles: {
|
|
12354
12363
|
color: 'color',
|
|
@@ -12771,6 +12780,7 @@ export const patterns = [
|
|
|
12771
12780
|
},
|
|
12772
12781
|
defaults: {
|
|
12773
12782
|
translateCounter: 2,
|
|
12783
|
+
numberOfLines: 1,
|
|
12774
12784
|
styles: {
|
|
12775
12785
|
color: '#34D399',
|
|
12776
12786
|
fontSize: '12@fs',
|
|
@@ -13348,7 +13358,7 @@ export const patterns = [
|
|
|
13348
13358
|
},
|
|
13349
13359
|
testID: 'string',
|
|
13350
13360
|
adjustsFontSizeToFit: 'boolean',
|
|
13351
|
-
|
|
13361
|
+
numberOfLines: 'number',
|
|
13352
13362
|
translateCounter: 'number',
|
|
13353
13363
|
},
|
|
13354
13364
|
},
|
|
@@ -13725,6 +13735,7 @@ export const patterns = [
|
|
|
13725
13735
|
fontWeight: '400',
|
|
13726
13736
|
},
|
|
13727
13737
|
translateCounter: 1,
|
|
13738
|
+
numberOfLines: 1,
|
|
13728
13739
|
},
|
|
13729
13740
|
types: {},
|
|
13730
13741
|
},
|
|
@@ -34,10 +34,6 @@ export function useSafeAreaViewStyle(
|
|
|
34
34
|
const statusBarOverrideTranslucent = useRenderStore(
|
|
35
35
|
(s) => s.statusBarOverrideTranslucent,
|
|
36
36
|
);
|
|
37
|
-
const navBarOverrideTranslucent = useRenderStore(
|
|
38
|
-
(s) => s.navBarOverrideTranslucent,
|
|
39
|
-
);
|
|
40
|
-
|
|
41
37
|
return useMemo(() => {
|
|
42
38
|
if (!enabled) return baseStyle;
|
|
43
39
|
|
|
@@ -74,11 +70,5 @@ export function useSafeAreaViewStyle(
|
|
|
74
70
|
width: subtractInset(baseStyle.width ?? '100%', horizontal),
|
|
75
71
|
height: subtractInset(baseStyle.height ?? '100%', vertical),
|
|
76
72
|
};
|
|
77
|
-
}, [
|
|
78
|
-
enabled,
|
|
79
|
-
baseStyle,
|
|
80
|
-
device,
|
|
81
|
-
statusBarOverrideTranslucent,
|
|
82
|
-
navBarOverrideTranslucent,
|
|
83
|
-
]);
|
|
73
|
+
}, [enabled, baseStyle, device, statusBarOverrideTranslucent]);
|
|
84
74
|
}
|
|
@@ -8,7 +8,6 @@ import type { BaseSize } from '../../types/PreviewConfig';
|
|
|
8
8
|
import { parseSize } from '../../size-matters';
|
|
9
9
|
import { parseColor } from '../parseColor';
|
|
10
10
|
import { getStyleBag, toAttributeRecord } from '../attributeStyle';
|
|
11
|
-
import { getDefaultDevice } from '../getDevices';
|
|
12
11
|
|
|
13
12
|
export type ExtractViewStyleOptions = {
|
|
14
13
|
projectColors?: ProjectColors;
|
|
@@ -6,7 +6,6 @@ const EMPTY_STYLE: CSSProperties = {};
|
|
|
6
6
|
export function useMergedStyle(
|
|
7
7
|
...args: (CSSProperties | undefined | null | false)[]
|
|
8
8
|
): CSSProperties {
|
|
9
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- spread args intentionally
|
|
10
9
|
return useMemo(() => {
|
|
11
10
|
const validStyles = args.filter((arg): arg is CSSProperties => !!arg);
|
|
12
11
|
|
|
@@ -14,5 +13,6 @@ export function useMergedStyle(
|
|
|
14
13
|
if (validStyles.length === 1) return validStyles[0];
|
|
15
14
|
|
|
16
15
|
return Object.assign({}, ...validStyles);
|
|
16
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
17
17
|
}, args);
|
|
18
18
|
}
|