@developer_tribe/react-builder 1.2.8 → 1.2.10
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/AttributesEditor.d.ts +2 -11
- package/dist/attribute-analyser/style/native/useExtractImageStyle.d.ts +10 -0
- package/dist/attribute-analyser/style/native/useExtractTextStyle.d.ts +9 -0
- package/dist/attribute-analyser/style/native/useExtractViewStyle.d.ts +8 -0
- package/dist/attribute-analyser/style/web/useExtractImageStyle.d.ts +4 -0
- package/dist/attribute-analyser/style/web/useExtractTextStyle.d.ts +4 -0
- package/dist/attribute-analyser/style/web/useExtractViewStyle.d.ts +4 -0
- package/dist/attributes-editor/AttributesEditorFields.d.ts +18 -0
- package/dist/attributes-editor/AttributesEditorView.d.ts +4 -0
- package/dist/attributes-editor/attributesEditorModelTypes.d.ts +67 -0
- package/dist/attributes-editor/attributesEditorUtils.d.ts +19 -0
- package/dist/attributes-editor/useAttributesEditorModel.d.ts +2 -0
- package/dist/build-components/BIcon/BIconProps.generated.d.ts +6 -6
- package/dist/build-components/BackgroundImage/BackgroundImageProps.generated.d.ts +3 -3
- package/dist/build-components/Button/ButtonProps.generated.d.ts +1 -1
- package/dist/build-components/Carousel/CarouselProps.generated.d.ts +2 -2
- package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +4 -4
- package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +3 -3
- 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/Image/ImageProps.generated.d.ts +5 -3
- package/dist/build-components/Main/MainProps.generated.d.ts +2 -2
- package/dist/build-components/Onboard/OnboardProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +9 -8
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +11 -11
- package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +15 -9
- package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +10 -10
- package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +8 -6
- package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +6 -3
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +5 -4
- package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +3 -3
- package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +3 -3
- package/dist/build-components/PaywallBackground/PaywallBackgroundProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.d.ts +6 -6
- 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/RadioButton/RadioButtonProps.generated.d.ts +4 -4
- package/dist/build-components/Text/TextProps.generated.d.ts +3 -3
- package/dist/build-components/View/ViewProps.generated.d.ts +1 -1
- package/dist/build-components/patterns.generated.d.ts +2690 -5804
- 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 +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.cjs.js +6 -4
- package/dist/index.native.cjs.js.map +1 -1
- package/dist/index.native.d.ts +5 -6
- package/dist/index.native.esm.js +6 -4
- package/dist/index.native.esm.js.map +1 -1
- package/dist/migrations/migratePipe.d.ts +1 -1
- package/dist/migrations/migrations/1.1.2_extract_component_attributes_from_style.d.ts +2 -0
- package/dist/mockOS/components/PermissionModal.d.ts +1 -2
- package/dist/styles.css +1 -1
- package/dist/types/PreviewConfig.d.ts +1 -5
- package/dist/utils/getMeta.d.ts +5 -0
- package/dist/utils/patterns.d.ts +12 -0
- package/package.json +4 -2
- package/scripts/prebuild/prebuild.js +14 -0
- package/scripts/prebuild/utils/createGeneratedProps.js +19 -13
- package/scripts/prebuild/utils/index.js +1 -0
- package/scripts/prebuild/utils/updateMetaJson.js +66 -0
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +37 -3
- package/scripts/prebuild/utils/validatePatternJson.js +27 -2
- package/scripts/public/scripts/build/index.js +20 -3
- package/scripts/public/scripts/build/info.json +6 -0
- package/scripts/public/scripts/build/utils/createComponentsIndex.js +9 -3
- package/scripts/public/scripts/build/utils/createRenderNodeGenerated.js +66 -8
- package/src/AttributesEditor.tsx +8 -944
- package/src/assets/meta.json +4 -0
- package/src/assets/samples/carousel-sample.json +1 -1
- package/src/assets/samples/getSamples.ts +2 -0
- package/src/assets/samples/paywall-1.json +11 -7
- package/src/assets/samples/simple-1.json +3 -3
- package/src/assets/samples/simple-2.json +3 -3
- package/src/assets/samples/unmigrated-builder-1.1.1.json +87 -0
- package/src/assets/samples/unmigrated-builder1.json +1 -1
- package/src/assets/samples/unvalidated-builder1.json +3 -3
- package/src/assets/samples/unvalidated-crash1.json +1 -1
- package/src/assets/samples/unvalidated-crashcomponent1.json +1 -1
- package/src/assets/samples/vpn-onboard-1.json +1 -1
- package/src/assets/samples/vpn-onboard-2.json +1 -1
- package/src/assets/samples/vpn-onboard-3.json +1 -1
- package/src/assets/samples/vpn-onboard-4.json +1 -1
- package/src/assets/samples/vpn-onboard-5.json +1 -1
- package/src/assets/samples/vpn-onboard-6.json +1 -1
- package/src/attribute-analyser/style/native/useExtractImageStyle.ts +46 -0
- package/src/attribute-analyser/style/native/useExtractTextStyle.ts +50 -0
- package/src/attribute-analyser/style/native/useExtractViewStyle.ts +32 -0
- package/src/attribute-analyser/style/web/useExtractImageStyle.ts +20 -0
- package/src/attribute-analyser/style/web/useExtractTextStyle.ts +27 -0
- package/src/attribute-analyser/style/web/useExtractViewStyle.ts +20 -0
- package/src/attributes-editor/AttributesEditorFields.tsx +248 -0
- package/src/attributes-editor/AttributesEditorView.tsx +360 -0
- package/src/attributes-editor/attributesEditorModelTypes.ts +86 -0
- package/src/attributes-editor/attributesEditorUtils.ts +102 -0
- package/src/attributes-editor/useAttributesEditorModel.ts +477 -0
- package/src/build-components/BIcon/BIcon.tsx +4 -4
- package/src/build-components/BIcon/BIconProps.generated.ts +6 -6
- package/src/build-components/BIcon/pattern.json +5 -6
- package/src/build-components/BackgroundImage/BackgroundImage.tsx +3 -2
- package/src/build-components/BackgroundImage/BackgroundImageProps.generated.ts +3 -3
- package/src/build-components/Button/Button.tsx +2 -2
- package/src/build-components/Button/ButtonProps.generated.ts +1 -1
- package/src/build-components/Button/pattern.json +17 -15
- package/src/build-components/Carousel/Carousel.tsx +1 -1
- package/src/build-components/Carousel/CarouselProps.generated.ts +2 -2
- package/src/build-components/CarouselButtons/CarouselButtons.tsx +4 -7
- package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +7 -7
- package/src/build-components/CarouselButtons/pattern.json +2 -1
- package/src/build-components/CarouselDots/CarouselDots.tsx +2 -2
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +9 -9
- package/src/build-components/CarouselItem/CarouselItem.tsx +1 -1
- package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +1 -1
- package/src/build-components/CarouselProvider/CarouselProvider.tsx +1 -1
- package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +1 -1
- package/src/build-components/Image/Image.tsx +1 -1
- package/src/build-components/Image/ImageProps.generated.ts +5 -3
- package/src/build-components/Image/pattern.json +10 -9
- package/src/build-components/Main/Main.tsx +2 -2
- package/src/build-components/Main/MainProps.generated.ts +2 -2
- package/src/build-components/Main/pattern.json +2 -1
- package/src/build-components/Onboard/OnboardProps.generated.ts +1 -1
- package/src/build-components/OnboardButton/OnboardButton.tsx +7 -6
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +14 -13
- package/src/build-components/OnboardButton/pattern.json +9 -7
- package/src/build-components/OnboardButtons/OnboardButtons.tsx +31 -31
- package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +14 -14
- package/src/build-components/OnboardButtons/pattern.json +9 -7
- package/src/build-components/OnboardDot/OnboardDot.tsx +7 -6
- package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +26 -9
- package/src/build-components/OnboardFooter/OnboardFooter.tsx +17 -16
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +10 -10
- package/src/build-components/OnboardFooter/pattern.json +16 -14
- package/src/build-components/OnboardImage/OnboardImage.tsx +8 -8
- package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +8 -6
- package/src/build-components/OnboardImage/pattern.json +2 -1
- package/src/build-components/OnboardItem/OnboardItem.tsx +1 -1
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +6 -3
- package/src/build-components/OnboardItem/pattern.json +2 -1
- package/src/build-components/OnboardProvider/OnboardProvider.tsx +1 -1
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +5 -4
- package/src/build-components/OnboardProvider/pattern.json +2 -1
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +3 -3
- package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +3 -3
- package/src/build-components/PaywallBackground/PaywallBackground.tsx +1 -1
- package/src/build-components/PaywallBackground/PaywallBackgroundProps.generated.ts +1 -1
- package/src/build-components/PaywallCloseButton/PaywallCloseButton.tsx +5 -4
- package/src/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.ts +6 -6
- package/src/build-components/PaywallOptions/PaywallOptionButton.tsx +1 -1
- package/src/build-components/PaywallOptions/PaywallOptionsProps.generated.ts +1 -1
- package/src/build-components/PaywallProvider/PaywallProvider.tsx +1 -1
- package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +1 -1
- package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButton.tsx +1 -1
- package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.ts +1 -1
- package/src/build-components/RadioButton/RadioButton.tsx +5 -5
- package/src/build-components/RadioButton/RadioButtonProps.generated.ts +4 -4
- package/src/build-components/RadioButton/pattern.json +9 -7
- package/src/build-components/Text/Text.tsx +6 -6
- package/src/build-components/Text/TextProps.generated.ts +3 -3
- package/src/build-components/Text/pattern.json +15 -11
- package/src/build-components/View/View.tsx +1 -1
- package/src/build-components/View/ViewProps.generated.ts +1 -1
- package/src/build-components/View/pattern.json +71 -66
- package/src/build-components/patterns.generated.ts +3059 -6008
- package/src/components/AttributesEditorPanel.tsx +2 -2
- package/src/index.native.ts +6 -9
- package/src/index.ts +1 -0
- package/src/migrations/migratePipe.ts +7 -3
- package/src/migrations/migrations/1.1.2_extract_component_attributes_from_style.ts +211 -0
- package/src/mockOS/components/MockOSRouter.tsx +3 -1
- package/src/mockOS/components/PermissionModal.tsx +20 -160
- package/src/mockOS/components/SubscriptionModal.tsx +41 -278
- package/src/pages/ProjectPage.tsx +12 -6
- package/src/styles/components/_attributes-editor.scss +122 -0
- package/src/styles/components/_mockos-router.scss +388 -0
- package/src/styles/components/_onboard.scss +23 -0
- package/src/styles/index.scss +1 -0
- package/src/types/PreviewConfig.ts +1 -5
- package/src/utils/analyseNodeByPatterns.ts +39 -4
- package/src/utils/extractTextStyle/extractTextStyle.ts +4 -1
- package/src/utils/getMeta.ts +15 -0
- package/src/utils/patterns.ts +47 -4
- package/dist/hooks/useExtractImageStyle.d.ts +0 -5
- package/dist/hooks/useExtractTextStyle.d.ts +0 -3
- package/dist/hooks/useExtractViewStyle.d.ts +0 -3
- package/dist/migrations/migrations/1.1.0_normalize_style_attributes.d.ts +0 -2
- package/src/hooks/useExtractImageStyle.ts +0 -30
- package/src/hooks/useExtractTextStyle.ts +0 -34
- package/src/hooks/useExtractViewStyle.ts +0 -30
- package/src/migrations/migrations/1.1.0_normalize_style_attributes.ts +0 -80
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"label": "Onboard Provider",
|
|
27
27
|
"description": "Provides shared settings for onboarding.",
|
|
28
|
-
"styles": {
|
|
28
|
+
"styles": {},
|
|
29
|
+
"attributes": {
|
|
29
30
|
"theme": {
|
|
30
31
|
"label": "Theme",
|
|
31
32
|
"description": "Controls which app theme(s) this onboarding is intended for.",
|
|
@@ -25,9 +25,6 @@ export interface OnboardSubtitleStyleGenerated {
|
|
|
25
25
|
fontFamily?: string;
|
|
26
26
|
fontWeight?: string;
|
|
27
27
|
textAlign?: TextAlignOptionType;
|
|
28
|
-
adjustsFontSizeToFit?: boolean;
|
|
29
|
-
showEllipsis?: boolean;
|
|
30
|
-
scrollable?: boolean;
|
|
31
28
|
flexDirection?: FlexDirectionOptionType;
|
|
32
29
|
alignItems?: AlignItemsOptionType;
|
|
33
30
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -67,6 +64,9 @@ export interface OnboardSubtitlePropsGenerated {
|
|
|
67
64
|
child: string;
|
|
68
65
|
attributes: {
|
|
69
66
|
style?: OnboardSubtitleStyleGenerated;
|
|
67
|
+
adjustsFontSizeToFit?: boolean;
|
|
68
|
+
showEllipsis?: boolean;
|
|
69
|
+
scrollable?: boolean;
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -25,9 +25,6 @@ export interface OnboardTitleStyleGenerated {
|
|
|
25
25
|
fontFamily?: string;
|
|
26
26
|
fontWeight?: string;
|
|
27
27
|
textAlign?: TextAlignOptionType;
|
|
28
|
-
adjustsFontSizeToFit?: boolean;
|
|
29
|
-
showEllipsis?: boolean;
|
|
30
|
-
scrollable?: boolean;
|
|
31
28
|
flexDirection?: FlexDirectionOptionType;
|
|
32
29
|
alignItems?: AlignItemsOptionType;
|
|
33
30
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -67,6 +64,9 @@ export interface OnboardTitlePropsGenerated {
|
|
|
67
64
|
child: string;
|
|
68
65
|
attributes: {
|
|
69
66
|
style?: OnboardTitleStyleGenerated;
|
|
67
|
+
adjustsFontSizeToFit?: boolean;
|
|
68
|
+
showEllipsis?: boolean;
|
|
69
|
+
scrollable?: boolean;
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -2,7 +2,7 @@ import React, { useId, useMemo } from 'react';
|
|
|
2
2
|
import type { PaywallBackgroundComponentProps } from './PaywallBackgroundProps.generated';
|
|
3
3
|
import useNode from '../useNode';
|
|
4
4
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
5
|
-
import { useExtractViewStyle } from '../../
|
|
5
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
6
6
|
import { useLogRender } from '../../utils/useLogRender';
|
|
7
7
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
8
8
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
|
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
21
|
export interface PaywallBackgroundStyleGenerated {
|
|
22
|
-
scrollable?: boolean;
|
|
23
22
|
flexDirection?: FlexDirectionOptionType;
|
|
24
23
|
alignItems?: AlignItemsOptionType;
|
|
25
24
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -59,6 +58,7 @@ export interface PaywallBackgroundPropsGenerated {
|
|
|
59
58
|
child: string;
|
|
60
59
|
attributes: {
|
|
61
60
|
style?: PaywallBackgroundStyleGenerated;
|
|
61
|
+
scrollable?: boolean;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -2,7 +2,7 @@ import React, { useId, useMemo } from 'react';
|
|
|
2
2
|
import type { PaywallCloseButtonComponentProps } from './PaywallCloseButtonProps.generated';
|
|
3
3
|
import useNode from '../useNode';
|
|
4
4
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
5
|
-
import { useExtractTextStyle } from '../../
|
|
5
|
+
import { useExtractTextStyle } from '../../attribute-analyser/style/web/useExtractTextStyle';
|
|
6
6
|
import { useLogRender } from '../../utils/useLogRender';
|
|
7
7
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
8
8
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
@@ -33,9 +33,10 @@ function PaywallCloseButton({ node }: PaywallCloseButtonComponentProps) {
|
|
|
33
33
|
isSelected ? SELECTED_OUTLINE_STYLE : undefined,
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
36
|
+
const attrs = node.attributes;
|
|
37
|
+
const styleBag = attrs?.style;
|
|
38
|
+
const iconType = attrs?.iconType ?? 'close';
|
|
39
|
+
const size = attrs?.size ?? (style.fontSize as number | undefined) ?? 24;
|
|
39
40
|
const color =
|
|
40
41
|
(style.color as string | undefined) ??
|
|
41
42
|
(styleBag?.color as string | undefined);
|
|
@@ -20,17 +20,11 @@ export type JustifyContentOptionType =
|
|
|
20
20
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
21
21
|
|
|
22
22
|
export interface PaywallCloseButtonStyleGenerated {
|
|
23
|
-
iconType?: string;
|
|
24
|
-
size?: number;
|
|
25
|
-
strokeWidth?: number;
|
|
26
23
|
color?: string;
|
|
27
24
|
fontSize?: string;
|
|
28
25
|
fontFamily?: string;
|
|
29
26
|
fontWeight?: string;
|
|
30
27
|
textAlign?: TextAlignOptionType;
|
|
31
|
-
adjustsFontSizeToFit?: boolean;
|
|
32
|
-
showEllipsis?: boolean;
|
|
33
|
-
scrollable?: boolean;
|
|
34
28
|
flexDirection?: FlexDirectionOptionType;
|
|
35
29
|
alignItems?: AlignItemsOptionType;
|
|
36
30
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -70,6 +64,12 @@ export interface PaywallCloseButtonPropsGenerated {
|
|
|
70
64
|
child: string;
|
|
71
65
|
attributes: {
|
|
72
66
|
style?: PaywallCloseButtonStyleGenerated;
|
|
67
|
+
iconType?: string;
|
|
68
|
+
size?: number;
|
|
69
|
+
strokeWidth?: number;
|
|
70
|
+
adjustsFontSizeToFit?: boolean;
|
|
71
|
+
showEllipsis?: boolean;
|
|
72
|
+
scrollable?: boolean;
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useId, useMemo } from 'react';
|
|
2
2
|
import type { Product } from '../../paywall/types/paywall-types';
|
|
3
|
-
import { useExtractViewStyle } from '../../
|
|
3
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
4
4
|
import type { NodeData } from '../../types/Node';
|
|
5
5
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
6
6
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
|
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
21
|
export interface PaywallOptionsStyleGenerated {
|
|
22
|
-
scrollable?: boolean;
|
|
23
22
|
flexDirection?: FlexDirectionOptionType;
|
|
24
23
|
alignItems?: AlignItemsOptionType;
|
|
25
24
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -59,6 +58,7 @@ export interface PaywallOptionsPropsGenerated {
|
|
|
59
58
|
child: string;
|
|
60
59
|
attributes: {
|
|
61
60
|
style?: PaywallOptionsStyleGenerated;
|
|
61
|
+
scrollable?: boolean;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -3,7 +3,7 @@ import type { PaywallProviderComponentProps } from './PaywallProviderProps.gener
|
|
|
3
3
|
import RenderNode from '../RenderNode.generated';
|
|
4
4
|
import type { Node } from '../../types/Node';
|
|
5
5
|
import useNode from '../useNode';
|
|
6
|
-
import { useExtractViewStyle } from '../../
|
|
6
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
7
7
|
import { useLogRender } from '../../utils/useLogRender';
|
|
8
8
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
9
9
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
|
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
21
|
export interface PaywallProviderStyleGenerated {
|
|
22
|
-
scrollable?: boolean;
|
|
23
22
|
flexDirection?: FlexDirectionOptionType;
|
|
24
23
|
alignItems?: AlignItemsOptionType;
|
|
25
24
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -59,6 +58,7 @@ export interface PaywallProviderPropsGenerated {
|
|
|
59
58
|
child: string;
|
|
60
59
|
attributes: {
|
|
61
60
|
style?: PaywallProviderStyleGenerated;
|
|
61
|
+
scrollable?: boolean;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -3,7 +3,7 @@ import type { PaywallSubscribeButtonComponentProps } from './PaywallSubscribeBut
|
|
|
3
3
|
import useNode from '../useNode';
|
|
4
4
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
5
5
|
import { useLogRender } from '../../utils/useLogRender';
|
|
6
|
-
import { useExtractTextStyle } from '../../
|
|
6
|
+
import { useExtractTextStyle } from '../../attribute-analyser/style/web/useExtractTextStyle';
|
|
7
7
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
8
8
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
9
9
|
import { useLocalize } from '../../hooks/useLocalize';
|
package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.ts
CHANGED
|
@@ -34,7 +34,6 @@ export interface PaywallSubscribeButtonStyleGenerated {
|
|
|
34
34
|
color?: string;
|
|
35
35
|
fontSize?: string;
|
|
36
36
|
fontWeight?: FontWeightOptionType;
|
|
37
|
-
scrollable?: boolean;
|
|
38
37
|
flexDirection?: FlexDirectionOptionType;
|
|
39
38
|
alignItems?: AlignItemsOptionType;
|
|
40
39
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -74,6 +73,7 @@ export interface PaywallSubscribeButtonPropsGenerated {
|
|
|
74
73
|
child: string;
|
|
75
74
|
attributes: {
|
|
76
75
|
style?: PaywallSubscribeButtonStyleGenerated;
|
|
76
|
+
scrollable?: boolean;
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -2,7 +2,7 @@ import React, { useContext, useId, useMemo } from 'react';
|
|
|
2
2
|
import type { RadioButtonComponentProps } from './RadioButtonProps.generated';
|
|
3
3
|
import useNode from '../useNode';
|
|
4
4
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
5
|
-
import { useExtractViewStyle } from '../../
|
|
5
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
6
6
|
import { useLogRender } from '../../utils/useLogRender';
|
|
7
7
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
8
8
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
@@ -96,10 +96,10 @@ function RadioButton({ node }: RadioButtonComponentProps) {
|
|
|
96
96
|
isSelected ? SELECTED_OUTLINE_STYLE : undefined,
|
|
97
97
|
);
|
|
98
98
|
|
|
99
|
-
const
|
|
100
|
-
const selected = Boolean(
|
|
101
|
-
const color =
|
|
102
|
-
const size = parseNumberLike(
|
|
99
|
+
const attrs = node.attributes;
|
|
100
|
+
const selected = Boolean(attrs?.selected);
|
|
101
|
+
const color = attrs?.color;
|
|
102
|
+
const size = parseNumberLike(attrs?.size);
|
|
103
103
|
|
|
104
104
|
return (
|
|
105
105
|
<div
|
|
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
|
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
21
|
export interface RadioButtonStyleGenerated {
|
|
22
|
-
scrollable?: boolean;
|
|
23
22
|
flexDirection?: FlexDirectionOptionType;
|
|
24
23
|
alignItems?: AlignItemsOptionType;
|
|
25
24
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -53,15 +52,16 @@ export interface RadioButtonStyleGenerated {
|
|
|
53
52
|
left?: string;
|
|
54
53
|
right?: string;
|
|
55
54
|
zIndex?: number;
|
|
56
|
-
selected?: boolean;
|
|
57
|
-
color?: string;
|
|
58
|
-
size?: number;
|
|
59
55
|
}
|
|
60
56
|
|
|
61
57
|
export interface RadioButtonPropsGenerated {
|
|
62
58
|
child: string;
|
|
63
59
|
attributes: {
|
|
64
60
|
style?: RadioButtonStyleGenerated;
|
|
61
|
+
scrollable?: boolean;
|
|
62
|
+
selected?: boolean;
|
|
63
|
+
color?: string;
|
|
64
|
+
size?: number;
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -17,13 +17,6 @@
|
|
|
17
17
|
"label": "Radio Button",
|
|
18
18
|
"description": "Generic radio button icon.",
|
|
19
19
|
"styles": {
|
|
20
|
-
"selected": {
|
|
21
|
-
"label": "Selected",
|
|
22
|
-
"description": "Whether the radio is selected.",
|
|
23
|
-
"category": "other",
|
|
24
|
-
"specialCategory": null,
|
|
25
|
-
"sort": 0
|
|
26
|
-
},
|
|
27
20
|
"color": {
|
|
28
21
|
"label": "Color",
|
|
29
22
|
"description": "Radio color.",
|
|
@@ -38,6 +31,15 @@
|
|
|
38
31
|
"specialCategory": null,
|
|
39
32
|
"sort": 2
|
|
40
33
|
}
|
|
34
|
+
},
|
|
35
|
+
"attributes": {
|
|
36
|
+
"selected": {
|
|
37
|
+
"label": "Selected",
|
|
38
|
+
"description": "Whether the radio is selected.",
|
|
39
|
+
"category": "other",
|
|
40
|
+
"specialCategory": null,
|
|
41
|
+
"sort": 0
|
|
42
|
+
}
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
}
|
|
@@ -8,7 +8,7 @@ import React, {
|
|
|
8
8
|
import type { TextComponentProps } from './TextProps.generated';
|
|
9
9
|
import useNode from '../useNode';
|
|
10
10
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
11
|
-
import { useExtractTextStyle } from '../../
|
|
11
|
+
import { useExtractTextStyle } from '../../attribute-analyser/style/web/useExtractTextStyle';
|
|
12
12
|
import { useLogRender } from '../../utils/useLogRender';
|
|
13
13
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
14
14
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
@@ -37,11 +37,11 @@ function Text({ node }: TextComponentProps) {
|
|
|
37
37
|
[localize, keyOrText],
|
|
38
38
|
);
|
|
39
39
|
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const showEllipsis =
|
|
40
|
+
const styleBag = node.attributes?.style as unknown as
|
|
41
|
+
| { adjustsFontSizeToFit?: boolean; showEllipsis?: boolean }
|
|
42
|
+
| undefined;
|
|
43
|
+
const adjustsFontSizeToFit = styleBag?.adjustsFontSizeToFit ?? false;
|
|
44
|
+
const showEllipsis = styleBag?.showEllipsis ?? false;
|
|
45
45
|
|
|
46
46
|
useLayoutEffect(() => {
|
|
47
47
|
if (!adjustsFontSizeToFit) {
|
|
@@ -20,7 +20,6 @@ export type PositionOptionType = 'relative' | 'absolute';
|
|
|
20
20
|
export type TextAlignOptionType = 'left' | 'center' | 'right' | 'justify';
|
|
21
21
|
|
|
22
22
|
export interface TextStyleGenerated {
|
|
23
|
-
scrollable?: boolean;
|
|
24
23
|
flexDirection?: FlexDirectionOptionType;
|
|
25
24
|
alignItems?: AlignItemsOptionType;
|
|
26
25
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -59,14 +58,15 @@ export interface TextStyleGenerated {
|
|
|
59
58
|
fontFamily?: string;
|
|
60
59
|
fontWeight?: string;
|
|
61
60
|
textAlign?: TextAlignOptionType;
|
|
62
|
-
adjustsFontSizeToFit?: boolean;
|
|
63
|
-
showEllipsis?: boolean;
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
export interface TextPropsGenerated {
|
|
67
64
|
child: string;
|
|
68
65
|
attributes: {
|
|
69
66
|
style?: TextStyleGenerated;
|
|
67
|
+
scrollable?: boolean;
|
|
68
|
+
adjustsFontSizeToFit?: boolean;
|
|
69
|
+
showEllipsis?: boolean;
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
"children": "string",
|
|
6
6
|
"extends": "View",
|
|
7
7
|
"attributes": {
|
|
8
|
-
"color": "color",
|
|
9
|
-
"fontSize": "size",
|
|
10
|
-
"fontFamily": "fontFamily",
|
|
11
|
-
"fontWeight": "fontWeight",
|
|
12
|
-
"textAlign": ["left", "center", "right", "justify"],
|
|
13
8
|
"adjustsFontSizeToFit": "boolean",
|
|
14
|
-
"showEllipsis": "boolean"
|
|
9
|
+
"showEllipsis": "boolean",
|
|
10
|
+
"style": {
|
|
11
|
+
"color": "color",
|
|
12
|
+
"fontSize": "size",
|
|
13
|
+
"fontFamily": "fontFamily",
|
|
14
|
+
"fontWeight": "fontWeight",
|
|
15
|
+
"textAlign": ["left", "center", "right", "justify"]
|
|
16
|
+
}
|
|
15
17
|
}
|
|
16
18
|
},
|
|
17
19
|
"meta": {
|
|
@@ -54,20 +56,22 @@
|
|
|
54
56
|
"category": "style",
|
|
55
57
|
"specialCategory": null,
|
|
56
58
|
"sort": 5
|
|
57
|
-
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"attributes": {
|
|
58
62
|
"adjustsFontSizeToFit": {
|
|
59
63
|
"label": "Adjust Font Size To Fit",
|
|
60
64
|
"description": "Automatically reduces font size to fit the available space.",
|
|
61
|
-
"category": "
|
|
65
|
+
"category": "other",
|
|
62
66
|
"specialCategory": null,
|
|
63
|
-
"sort":
|
|
67
|
+
"sort": 1
|
|
64
68
|
},
|
|
65
69
|
"showEllipsis": {
|
|
66
70
|
"label": "Show Ellipsis",
|
|
67
71
|
"description": "If text overflows, show ellipsis (…); applied as single-line truncation.",
|
|
68
|
-
"category": "
|
|
72
|
+
"category": "other",
|
|
69
73
|
"specialCategory": null,
|
|
70
|
-
"sort":
|
|
74
|
+
"sort": 2
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
}
|
|
@@ -4,7 +4,7 @@ import RenderNode from '../RenderNode.generated';
|
|
|
4
4
|
import { Node } from '../../types/Node';
|
|
5
5
|
import useNode from '../useNode';
|
|
6
6
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
7
|
-
import { useExtractViewStyle } from '../../
|
|
7
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
8
8
|
import { useLogRender } from '../../utils/useLogRender';
|
|
9
9
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
10
10
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
|
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
21
|
export interface ViewStyleGenerated {
|
|
22
|
-
scrollable?: boolean;
|
|
23
22
|
flexDirection?: FlexDirectionOptionType;
|
|
24
23
|
alignItems?: AlignItemsOptionType;
|
|
25
24
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -59,6 +58,7 @@ export interface ViewPropsGenerated {
|
|
|
59
58
|
child: string;
|
|
60
59
|
attributes: {
|
|
61
60
|
style?: ViewStyleGenerated;
|
|
61
|
+
scrollable?: boolean;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -5,57 +5,60 @@
|
|
|
5
5
|
"children": "node",
|
|
6
6
|
"attributes": {
|
|
7
7
|
"scrollable": "boolean",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
8
|
+
"style": {
|
|
9
|
+
"flexDirection": [
|
|
10
|
+
"row",
|
|
11
|
+
"column"
|
|
12
|
+
],
|
|
13
|
+
"alignItems": [
|
|
14
|
+
"flex-start",
|
|
15
|
+
"center",
|
|
16
|
+
"flex-end",
|
|
17
|
+
"stretch",
|
|
18
|
+
"baseline"
|
|
19
|
+
],
|
|
20
|
+
"justifyContent": [
|
|
21
|
+
"flex-start",
|
|
22
|
+
"center",
|
|
23
|
+
"flex-end",
|
|
24
|
+
"space-between",
|
|
25
|
+
"space-around",
|
|
26
|
+
"space-evenly"
|
|
27
|
+
],
|
|
28
|
+
"gap": "size",
|
|
29
|
+
"padding": "size",
|
|
30
|
+
"paddingHorizontal": "size",
|
|
31
|
+
"paddingVertical": "size",
|
|
32
|
+
"paddingTop": "size",
|
|
33
|
+
"paddingBottom": "size",
|
|
34
|
+
"paddingLeft": "size",
|
|
35
|
+
"paddingRight": "size",
|
|
36
|
+
"margin": "size",
|
|
37
|
+
"marginHorizontal": "size",
|
|
38
|
+
"marginVertical": "size",
|
|
39
|
+
"marginTop": "size",
|
|
40
|
+
"marginBottom": "size",
|
|
41
|
+
"marginLeft": "size",
|
|
42
|
+
"marginRight": "size",
|
|
43
|
+
"backgroundColor": "color",
|
|
44
|
+
"borderRadius": "size",
|
|
45
|
+
"width": "size",
|
|
46
|
+
"minWidth": "size",
|
|
47
|
+
"maxWidth": "size",
|
|
48
|
+
"height": "size",
|
|
49
|
+
"minHeight": "size",
|
|
50
|
+
"maxHeight": "size",
|
|
51
|
+
"flex": "number",
|
|
52
|
+
"position": [
|
|
53
|
+
"relative",
|
|
54
|
+
"absolute"
|
|
55
|
+
],
|
|
56
|
+
"top": "size",
|
|
57
|
+
"bottom": "size",
|
|
58
|
+
"left": "size",
|
|
59
|
+
"right": "size",
|
|
60
|
+
"zIndex": "number"
|
|
61
|
+
}
|
|
59
62
|
}
|
|
60
63
|
},
|
|
61
64
|
"meta": {
|
|
@@ -91,6 +94,23 @@
|
|
|
91
94
|
}
|
|
92
95
|
},
|
|
93
96
|
"styles": {
|
|
97
|
+
"backgroundColor": {
|
|
98
|
+
"label": "Background Color",
|
|
99
|
+
"description": "Background fill color.",
|
|
100
|
+
"category": "style",
|
|
101
|
+
"specialCategory": null,
|
|
102
|
+
"sort": 20
|
|
103
|
+
},
|
|
104
|
+
"borderRadius": {
|
|
105
|
+
"label": "Border Radius",
|
|
106
|
+
"description": "Corner rounding amount.",
|
|
107
|
+
"category": "style",
|
|
108
|
+
"specialCategory": null,
|
|
109
|
+
"sort": 21,
|
|
110
|
+
"preferedScale": "s"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"attributes": {
|
|
94
114
|
"scrollable": {
|
|
95
115
|
"label": "Scrollable",
|
|
96
116
|
"description": "Turns scroll interaction on.",
|
|
@@ -239,21 +259,6 @@
|
|
|
239
259
|
"sort": 19,
|
|
240
260
|
"preferedScale": "s"
|
|
241
261
|
},
|
|
242
|
-
"backgroundColor": {
|
|
243
|
-
"label": "Background Color",
|
|
244
|
-
"description": "Background fill color.",
|
|
245
|
-
"category": "style",
|
|
246
|
-
"specialCategory": null,
|
|
247
|
-
"sort": 20
|
|
248
|
-
},
|
|
249
|
-
"borderRadius": {
|
|
250
|
-
"label": "Border Radius",
|
|
251
|
-
"description": "Corner rounding amount.",
|
|
252
|
-
"category": "style",
|
|
253
|
-
"specialCategory": null,
|
|
254
|
-
"sort": 21,
|
|
255
|
-
"preferedScale": "s"
|
|
256
|
-
},
|
|
257
262
|
"width": {
|
|
258
263
|
"label": "Width",
|
|
259
264
|
"description": "Fixed width value.",
|