@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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { NodeData } from '../../types/Node';
|
|
4
4
|
|
|
5
|
+
export type ResizeModeOptionType = 'cover' | 'contain' | 'stretch' | 'center';
|
|
5
6
|
export type FlexDirectionOptionType = 'row' | 'column';
|
|
6
7
|
export type AlignItemsOptionType =
|
|
7
8
|
| 'flex-start'
|
|
@@ -17,10 +18,8 @@ export type JustifyContentOptionType =
|
|
|
17
18
|
| 'space-around'
|
|
18
19
|
| 'space-evenly';
|
|
19
20
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
|
-
export type ResizeModeOptionType = 'cover' | 'contain' | 'stretch' | 'center';
|
|
21
21
|
|
|
22
22
|
export interface BackgroundImageStyleGenerated {
|
|
23
|
-
scrollable?: boolean;
|
|
24
23
|
flexDirection?: FlexDirectionOptionType;
|
|
25
24
|
alignItems?: AlignItemsOptionType;
|
|
26
25
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -54,14 +53,15 @@ export interface BackgroundImageStyleGenerated {
|
|
|
54
53
|
left?: string;
|
|
55
54
|
right?: string;
|
|
56
55
|
zIndex?: number;
|
|
57
|
-
resizeMode?: ResizeModeOptionType;
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
export interface BackgroundImagePropsGenerated {
|
|
61
59
|
child: string;
|
|
62
60
|
attributes: {
|
|
63
61
|
style?: BackgroundImageStyleGenerated;
|
|
62
|
+
scrollable?: boolean;
|
|
64
63
|
src?: string;
|
|
64
|
+
resizeMode?: ResizeModeOptionType;
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -3,8 +3,8 @@ import type { ButtonComponentProps } from './ButtonProps.generated';
|
|
|
3
3
|
import useNode from '../useNode';
|
|
4
4
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
5
5
|
import { useLogRender } from '../../utils/useLogRender';
|
|
6
|
-
import { useExtractViewStyle } from '../../
|
|
7
|
-
import { useExtractTextStyle } from '../../
|
|
6
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
7
|
+
import { useExtractTextStyle } from '../../attribute-analyser/style/web/useExtractTextStyle';
|
|
8
8
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
9
9
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
10
10
|
import { useLocalize } from '../../hooks/useLocalize';
|
|
@@ -31,7 +31,6 @@ export type FontWeightOptionType =
|
|
|
31
31
|
| '900';
|
|
32
32
|
|
|
33
33
|
export interface ButtonStyleGenerated {
|
|
34
|
-
scrollable?: boolean;
|
|
35
34
|
flexDirection?: FlexDirectionOptionType;
|
|
36
35
|
alignItems?: AlignItemsOptionType;
|
|
37
36
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -74,6 +73,7 @@ export interface ButtonPropsGenerated {
|
|
|
74
73
|
child: string;
|
|
75
74
|
attributes: {
|
|
76
75
|
style?: ButtonStyleGenerated;
|
|
76
|
+
scrollable?: boolean;
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -5,21 +5,23 @@
|
|
|
5
5
|
"children": "string",
|
|
6
6
|
"extends": "View",
|
|
7
7
|
"attributes": {
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
"style": {
|
|
9
|
+
"color": "color",
|
|
10
|
+
"fontSize": "size",
|
|
11
|
+
"fontWeight": [
|
|
12
|
+
"normal",
|
|
13
|
+
"bold",
|
|
14
|
+
"100",
|
|
15
|
+
"200",
|
|
16
|
+
"300",
|
|
17
|
+
"400",
|
|
18
|
+
"500",
|
|
19
|
+
"600",
|
|
20
|
+
"700",
|
|
21
|
+
"800",
|
|
22
|
+
"900"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
23
25
|
}
|
|
24
26
|
},
|
|
25
27
|
"meta": {
|
|
@@ -5,7 +5,7 @@ import { isCarouselItem } from '../../utils/isCarousel';
|
|
|
5
5
|
import useNode from '../useNode';
|
|
6
6
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
7
7
|
import { useLogRender } from '../../utils/useLogRender';
|
|
8
|
-
import { useExtractViewStyle } from '../../
|
|
8
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
9
9
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
10
10
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
11
11
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { NodeData } from '../../types/Node';
|
|
4
4
|
|
|
5
|
+
export type AlignOptionType = 'start' | 'center' | 'end';
|
|
5
6
|
export type FlexDirectionOptionType = 'row' | 'column';
|
|
6
7
|
export type AlignItemsOptionType =
|
|
7
8
|
| 'flex-start'
|
|
@@ -17,10 +18,8 @@ export type JustifyContentOptionType =
|
|
|
17
18
|
| 'space-around'
|
|
18
19
|
| 'space-evenly';
|
|
19
20
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
|
-
export type AlignOptionType = 'start' | 'center' | 'end';
|
|
21
21
|
|
|
22
22
|
export interface CarouselStyleGenerated {
|
|
23
|
-
scrollable?: boolean;
|
|
24
23
|
flexDirection?: FlexDirectionOptionType;
|
|
25
24
|
alignItems?: AlignItemsOptionType;
|
|
26
25
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -60,6 +59,7 @@ export interface CarouselPropsGenerated {
|
|
|
60
59
|
child: string;
|
|
61
60
|
attributes: {
|
|
62
61
|
style?: CarouselStyleGenerated;
|
|
62
|
+
scrollable?: boolean;
|
|
63
63
|
loop?: boolean;
|
|
64
64
|
dragFree?: boolean;
|
|
65
65
|
align?: AlignOptionType;
|
|
@@ -3,7 +3,7 @@ import type { CarouselButtonsComponentProps } from './CarouselButtonsProps.gener
|
|
|
3
3
|
import { carouselContext } from '../CarouselProvider/CarouselProvider';
|
|
4
4
|
import useNode from '../useNode';
|
|
5
5
|
import { useLogRender } from '../../utils/useLogRender';
|
|
6
|
-
import { useExtractViewStyle } from '../../
|
|
6
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
7
7
|
|
|
8
8
|
function CarouselButtons({ node }: CarouselButtonsComponentProps) {
|
|
9
9
|
useLogRender('CarouselButtons');
|
|
@@ -13,11 +13,8 @@ function CarouselButtons({ node }: CarouselButtonsComponentProps) {
|
|
|
13
13
|
const attributeKey = node.key ?? generatedId;
|
|
14
14
|
const style = useExtractViewStyle(node);
|
|
15
15
|
const emblaApi = useContext(carouselContext);
|
|
16
|
-
const
|
|
17
|
-
const buttonTypes =
|
|
18
|
-
'previous_button',
|
|
19
|
-
'next_button',
|
|
20
|
-
];
|
|
16
|
+
const attrs = node.attributes;
|
|
17
|
+
const buttonTypes = attrs?.buttonType || ['previous_button', 'next_button'];
|
|
21
18
|
|
|
22
19
|
return (
|
|
23
20
|
<div
|
|
@@ -44,7 +41,7 @@ function CarouselButtons({ node }: CarouselButtonsComponentProps) {
|
|
|
44
41
|
)}
|
|
45
42
|
{buttonTypes.includes('skip_button') && (
|
|
46
43
|
<button
|
|
47
|
-
onClick={() => emblaApi?.scrollTo(
|
|
44
|
+
onClick={() => emblaApi?.scrollTo(attrs?.skipNumber)}
|
|
48
45
|
className="embla__button embla__button--skip"
|
|
49
46
|
>
|
|
50
47
|
Skip
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import type { NodeData } from '../../types/Node';
|
|
4
4
|
|
|
5
|
+
export type ButtonTypeOptionType =
|
|
6
|
+
| 'previous_button'
|
|
7
|
+
| 'next_button'
|
|
8
|
+
| 'skip_button';
|
|
5
9
|
export type FlexDirectionOptionType = 'row' | 'column';
|
|
6
10
|
export type AlignItemsOptionType =
|
|
7
11
|
| 'flex-start'
|
|
@@ -17,13 +21,8 @@ export type JustifyContentOptionType =
|
|
|
17
21
|
| 'space-around'
|
|
18
22
|
| 'space-evenly';
|
|
19
23
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
|
-
export type ButtonTypeOptionType =
|
|
21
|
-
| 'previous_button'
|
|
22
|
-
| 'next_button'
|
|
23
|
-
| 'skip_button';
|
|
24
24
|
|
|
25
25
|
export interface CarouselButtonsStyleGenerated {
|
|
26
|
-
scrollable?: boolean;
|
|
27
26
|
flexDirection?: FlexDirectionOptionType;
|
|
28
27
|
alignItems?: AlignItemsOptionType;
|
|
29
28
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -57,14 +56,15 @@ export interface CarouselButtonsStyleGenerated {
|
|
|
57
56
|
left?: string;
|
|
58
57
|
right?: string;
|
|
59
58
|
zIndex?: number;
|
|
60
|
-
buttonType?: ButtonTypeOptionType;
|
|
61
|
-
skipNumber?: number;
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
export interface CarouselButtonsPropsGenerated {
|
|
65
62
|
child: string;
|
|
66
63
|
attributes: {
|
|
67
64
|
style?: CarouselButtonsStyleGenerated;
|
|
65
|
+
scrollable?: boolean;
|
|
66
|
+
buttonType?: ButtonTypeOptionType;
|
|
67
|
+
skipNumber?: number;
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -4,7 +4,7 @@ import { carouselContext } from '../CarouselProvider/CarouselProvider';
|
|
|
4
4
|
import { onboardContext } from '../OnboardProvider/OnboardProvider';
|
|
5
5
|
import useNode from '../useNode';
|
|
6
6
|
import { useLogRender } from '../../utils/useLogRender';
|
|
7
|
-
import { useExtractViewStyle } from '../../
|
|
7
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
8
8
|
|
|
9
9
|
function CarouselDots({ node }: CarouselDotsComponentProps) {
|
|
10
10
|
useLogRender('CarouselDots');
|
|
@@ -15,7 +15,7 @@ function CarouselDots({ node }: CarouselDotsComponentProps) {
|
|
|
15
15
|
const attributeName = node.sourceType ?? node.type ?? 'carouselDots';
|
|
16
16
|
const attributeKey = node.key ?? generatedId;
|
|
17
17
|
|
|
18
|
-
const dotType = node.attributes?.
|
|
18
|
+
const dotType = node.attributes?.dotType ?? 'normal_dot';
|
|
19
19
|
const style = useExtractViewStyle(node);
|
|
20
20
|
|
|
21
21
|
// Use the appropriate context based on sourceType
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import type { NodeData } from '../../types/Node';
|
|
4
4
|
|
|
5
|
+
export type DotTypeOptionType =
|
|
6
|
+
| 'expanding_dot'
|
|
7
|
+
| 'normal_dot'
|
|
8
|
+
| 'scaling_dot'
|
|
9
|
+
| 'sliding_border'
|
|
10
|
+
| 'sliding_dot'
|
|
11
|
+
| 'liquid_like';
|
|
5
12
|
export type FlexDirectionOptionType = 'row' | 'column';
|
|
6
13
|
export type AlignItemsOptionType =
|
|
7
14
|
| 'flex-start'
|
|
@@ -17,16 +24,8 @@ export type JustifyContentOptionType =
|
|
|
17
24
|
| 'space-around'
|
|
18
25
|
| 'space-evenly';
|
|
19
26
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
|
-
export type DotTypeOptionType =
|
|
21
|
-
| 'expanding_dot'
|
|
22
|
-
| 'normal_dot'
|
|
23
|
-
| 'scaling_dot'
|
|
24
|
-
| 'sliding_border'
|
|
25
|
-
| 'sliding_dot'
|
|
26
|
-
| 'liquid_like';
|
|
27
27
|
|
|
28
28
|
export interface CarouselDotsStyleGenerated {
|
|
29
|
-
scrollable?: boolean;
|
|
30
29
|
flexDirection?: FlexDirectionOptionType;
|
|
31
30
|
alignItems?: AlignItemsOptionType;
|
|
32
31
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -60,13 +59,14 @@ export interface CarouselDotsStyleGenerated {
|
|
|
60
59
|
left?: string;
|
|
61
60
|
right?: string;
|
|
62
61
|
zIndex?: number;
|
|
63
|
-
dotType?: DotTypeOptionType;
|
|
64
62
|
}
|
|
65
63
|
|
|
66
64
|
export interface CarouselDotsPropsGenerated {
|
|
67
65
|
child: string;
|
|
68
66
|
attributes: {
|
|
69
67
|
style?: CarouselDotsStyleGenerated;
|
|
68
|
+
scrollable?: boolean;
|
|
69
|
+
dotType?: DotTypeOptionType;
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -3,7 +3,7 @@ import type { CarouselItemComponentProps } from './CarouselItemProps.generated';
|
|
|
3
3
|
import RenderNode from '../RenderNode.generated';
|
|
4
4
|
import useNode from '../useNode';
|
|
5
5
|
import { useLogRender } from '../../utils/useLogRender';
|
|
6
|
-
import { useExtractViewStyle } from '../../
|
|
6
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
7
7
|
|
|
8
8
|
export function CarouselItem({ node }: CarouselItemComponentProps) {
|
|
9
9
|
useLogRender('CarouselItem');
|
|
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
|
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
21
|
export interface CarouselItemStyleGenerated {
|
|
22
|
-
scrollable?: boolean;
|
|
23
22
|
flexDirection?: FlexDirectionOptionType;
|
|
24
23
|
alignItems?: AlignItemsOptionType;
|
|
25
24
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -59,6 +58,7 @@ export interface CarouselItemPropsGenerated {
|
|
|
59
58
|
child: string;
|
|
60
59
|
attributes: {
|
|
61
60
|
style?: CarouselItemStyleGenerated;
|
|
61
|
+
scrollable?: boolean;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -3,7 +3,7 @@ import type { CarouselProviderComponentProps } from './CarouselProviderProps.gen
|
|
|
3
3
|
import RenderNode from '../RenderNode.generated';
|
|
4
4
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
5
5
|
import useNode from '../useNode';
|
|
6
|
-
import { useExtractViewStyle } from '../../
|
|
6
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
7
7
|
import { isCarousel } from '../../utils/isCarousel';
|
|
8
8
|
import type { Node, NodeData } from '../../types/Node';
|
|
9
9
|
|
|
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
|
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
21
|
export interface CarouselProviderStyleGenerated {
|
|
22
|
-
scrollable?: boolean;
|
|
23
22
|
flexDirection?: FlexDirectionOptionType;
|
|
24
23
|
alignItems?: AlignItemsOptionType;
|
|
25
24
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -59,6 +58,7 @@ export interface CarouselProviderPropsGenerated {
|
|
|
59
58
|
child: string;
|
|
60
59
|
attributes: {
|
|
61
60
|
style?: CarouselProviderStyleGenerated;
|
|
61
|
+
scrollable?: boolean;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -6,7 +6,7 @@ import { resolveImageSrc } from '../../utils/getImage';
|
|
|
6
6
|
import { useLogRender } from '../../utils/useLogRender';
|
|
7
7
|
import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
8
8
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
9
|
-
import { useExtractImageStyle } from '../../
|
|
9
|
+
import { useExtractImageStyle } from '../../attribute-analyser/style/web/useExtractImageStyle';
|
|
10
10
|
|
|
11
11
|
function Image({ node }: ImageComponentProps) {
|
|
12
12
|
useLogRender('Image');
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { NodeData } from '../../types/Node';
|
|
4
4
|
|
|
5
|
+
export type ResizeModeOptionType = 'cover' | 'contain' | 'stretch' | 'center';
|
|
5
6
|
export type FlexDirectionOptionType = 'row' | 'column';
|
|
6
7
|
export type AlignItemsOptionType =
|
|
7
8
|
| 'flex-start'
|
|
@@ -17,10 +18,8 @@ export type JustifyContentOptionType =
|
|
|
17
18
|
| 'space-around'
|
|
18
19
|
| 'space-evenly';
|
|
19
20
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
|
-
export type ResizeModeOptionType = 'cover' | 'contain' | 'stretch' | 'center';
|
|
21
21
|
|
|
22
22
|
export interface ImageStyleGenerated {
|
|
23
|
-
scrollable?: boolean;
|
|
24
23
|
flexDirection?: FlexDirectionOptionType;
|
|
25
24
|
alignItems?: AlignItemsOptionType;
|
|
26
25
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -54,14 +53,17 @@ export interface ImageStyleGenerated {
|
|
|
54
53
|
left?: string;
|
|
55
54
|
right?: string;
|
|
56
55
|
zIndex?: number;
|
|
57
|
-
resizeMode?: ResizeModeOptionType;
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
export interface ImagePropsGenerated {
|
|
61
59
|
child: string;
|
|
62
60
|
attributes: {
|
|
63
61
|
style?: ImageStyleGenerated;
|
|
62
|
+
scrollable?: boolean;
|
|
64
63
|
src?: string;
|
|
64
|
+
width?: string;
|
|
65
|
+
height?: string;
|
|
66
|
+
resizeMode?: ResizeModeOptionType;
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
69
|
|
|
@@ -15,14 +15,15 @@
|
|
|
15
15
|
"desiredParent": ["all"],
|
|
16
16
|
"label": "Image",
|
|
17
17
|
"description": "Shows an image or graphic.",
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
"styles": {},
|
|
19
|
+
"attributes": {
|
|
20
|
+
"src": {
|
|
21
|
+
"label": "Src",
|
|
22
|
+
"description": "Image source URL.",
|
|
23
|
+
"category": "other",
|
|
24
|
+
"specialCategory": null,
|
|
25
|
+
"sort": 1
|
|
26
|
+
},
|
|
26
27
|
"width": {
|
|
27
28
|
"label": "Width",
|
|
28
29
|
"description": "Image width.",
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
"resizeMode": {
|
|
41
42
|
"label": "Resize Mode",
|
|
42
43
|
"description": "How the image fits the frame.",
|
|
43
|
-
"category": "
|
|
44
|
+
"category": "other",
|
|
44
45
|
"specialCategory": null,
|
|
45
46
|
"sort": 4
|
|
46
47
|
}
|
|
@@ -4,7 +4,7 @@ import RenderNode from '../RenderNode.generated';
|
|
|
4
4
|
import type { 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';
|
|
@@ -22,7 +22,7 @@ function Main({ node }: MainComponentProps) {
|
|
|
22
22
|
|
|
23
23
|
const baseStyle = useExtractViewStyle(node);
|
|
24
24
|
|
|
25
|
-
const useSafeAreaView = node.attributes?.
|
|
25
|
+
const useSafeAreaView = node.attributes?.useSafeAreaView ?? true;
|
|
26
26
|
const layoutStyle = useSafeAreaViewStyle(baseStyle, useSafeAreaView);
|
|
27
27
|
|
|
28
28
|
const isSelected = isNodeSelected({
|
|
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
|
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
21
|
export interface MainStyleGenerated {
|
|
22
|
-
scrollable?: boolean;
|
|
23
22
|
flexDirection?: FlexDirectionOptionType;
|
|
24
23
|
alignItems?: AlignItemsOptionType;
|
|
25
24
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -53,13 +52,14 @@ export interface MainStyleGenerated {
|
|
|
53
52
|
left?: string;
|
|
54
53
|
right?: string;
|
|
55
54
|
zIndex?: number;
|
|
56
|
-
useSafeAreaView?: boolean;
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
export interface MainPropsGenerated {
|
|
60
58
|
child: string;
|
|
61
59
|
attributes: {
|
|
62
60
|
style?: MainStyleGenerated;
|
|
61
|
+
scrollable?: boolean;
|
|
62
|
+
useSafeAreaView?: boolean;
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"label": "Main",
|
|
25
25
|
"description": "Top-level screen wrapper (safe area, base layout).",
|
|
26
26
|
"hideAllAttributes": true,
|
|
27
|
-
"styles": {
|
|
27
|
+
"styles": {},
|
|
28
|
+
"attributes": {
|
|
28
29
|
"useSafeAreaView": {
|
|
29
30
|
"label": "Use Safe Area View",
|
|
30
31
|
"description": "Wraps content with a safe-area-aware container (when supported by the target).",
|
|
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
|
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
20
|
|
|
21
21
|
export interface OnboardStyleGenerated {
|
|
22
|
-
scrollable?: boolean;
|
|
23
22
|
flexDirection?: FlexDirectionOptionType;
|
|
24
23
|
alignItems?: AlignItemsOptionType;
|
|
25
24
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -59,6 +58,7 @@ export interface OnboardPropsGenerated {
|
|
|
59
58
|
child: string;
|
|
60
59
|
attributes: {
|
|
61
60
|
style?: OnboardStyleGenerated;
|
|
61
|
+
scrollable?: boolean;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -7,7 +7,7 @@ import { onboardContext } from '../OnboardProvider/OnboardProvider';
|
|
|
7
7
|
import useNode from '../useNode';
|
|
8
8
|
import { useBuilderParams } from '../../components/BuilderProvider';
|
|
9
9
|
import { useLogRender } from '../../utils/useLogRender';
|
|
10
|
-
import { useExtractViewStyle } from '../../
|
|
10
|
+
import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
|
|
11
11
|
import { useMockOSContext, useMockPermission } from '../../mockOS';
|
|
12
12
|
import { useLocalize } from '../../hooks/useLocalize';
|
|
13
13
|
|
|
@@ -24,19 +24,20 @@ function OnboardButton({ node }: OnboardButtonComponentProps) {
|
|
|
24
24
|
const generatedId = useId();
|
|
25
25
|
const attributeKey = node.key ?? generatedId;
|
|
26
26
|
|
|
27
|
-
const
|
|
28
|
-
const
|
|
27
|
+
const attrs = node.attributes;
|
|
28
|
+
const styleBag = attrs?.style;
|
|
29
|
+
const labelRaw = attrs?.labelKey ?? '';
|
|
29
30
|
const localize = useLocalize({ appConfig });
|
|
30
31
|
const label = localize(labelRaw);
|
|
31
32
|
|
|
32
33
|
const flex = styleBag?.flex ?? 1;
|
|
33
|
-
const textColor =
|
|
34
|
-
const backgroundColor =
|
|
34
|
+
const textColor = attrs?.button_text_color ?? '#FFFFFF';
|
|
35
|
+
const backgroundColor = attrs?.button_background_color ?? '#0066FF';
|
|
35
36
|
const viewStyle = useExtractViewStyle(node);
|
|
36
37
|
|
|
37
38
|
const handleClick = () => {
|
|
38
39
|
//TODO: any ??
|
|
39
|
-
const events: EventObjectGenerated[] =
|
|
40
|
+
const events: EventObjectGenerated[] = attrs?.events ?? [];
|
|
40
41
|
let navigateHandled = false;
|
|
41
42
|
|
|
42
43
|
for (const e of events) {
|
|
@@ -4,6 +4,12 @@ import type { NodeData } from '../../types/Node';
|
|
|
4
4
|
|
|
5
5
|
export type TypeOptionType = 'Permission' | 'Navigate';
|
|
6
6
|
export type PermissionOptionType = 'att' | 'notification' | 'rating' | 'GDPR';
|
|
7
|
+
export type AnimationOptionType =
|
|
8
|
+
| 'simple-animation'
|
|
9
|
+
| 'line-animation'
|
|
10
|
+
| 'blur'
|
|
11
|
+
| 'blur-animation'
|
|
12
|
+
| 'blur-line-animation';
|
|
7
13
|
export type FlexDirectionOptionType = 'row' | 'column';
|
|
8
14
|
export type AlignItemsOptionType =
|
|
9
15
|
| 'flex-start'
|
|
@@ -19,12 +25,6 @@ export type JustifyContentOptionType =
|
|
|
19
25
|
| 'space-around'
|
|
20
26
|
| 'space-evenly';
|
|
21
27
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
22
|
-
export type AnimationOptionType =
|
|
23
|
-
| 'simple-animation'
|
|
24
|
-
| 'line-animation'
|
|
25
|
-
| 'blur'
|
|
26
|
-
| 'blur-animation'
|
|
27
|
-
| 'blur-line-animation';
|
|
28
28
|
|
|
29
29
|
export interface EventObjectGenerated {
|
|
30
30
|
type?: TypeOptionType;
|
|
@@ -34,7 +34,6 @@ export interface EventObjectGenerated {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export interface OnboardButtonStyleGenerated {
|
|
37
|
-
scrollable?: boolean;
|
|
38
37
|
flexDirection?: FlexDirectionOptionType;
|
|
39
38
|
alignItems?: AlignItemsOptionType;
|
|
40
39
|
justifyContent?: JustifyContentOptionType;
|
|
@@ -68,18 +67,20 @@ export interface OnboardButtonStyleGenerated {
|
|
|
68
67
|
left?: string;
|
|
69
68
|
right?: string;
|
|
70
69
|
zIndex?: number;
|
|
71
|
-
labelKey?: string;
|
|
72
|
-
button_text_color?: string;
|
|
73
|
-
animation?: AnimationOptionType;
|
|
74
|
-
animation_color?: string;
|
|
75
|
-
button_background_color?: string;
|
|
76
|
-
events?: EventObjectGenerated[];
|
|
77
70
|
}
|
|
78
71
|
|
|
79
72
|
export interface OnboardButtonPropsGenerated {
|
|
80
73
|
child: string;
|
|
81
74
|
attributes: {
|
|
82
75
|
style?: OnboardButtonStyleGenerated;
|
|
76
|
+
scrollable?: boolean;
|
|
77
|
+
labelKey?: string;
|
|
78
|
+
button_text_color?: string;
|
|
79
|
+
animation?: AnimationOptionType;
|
|
80
|
+
animation_color?: string;
|
|
81
|
+
button_background_color?: string;
|
|
82
|
+
flex?: number;
|
|
83
|
+
events?: EventObjectGenerated[];
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
|
|
@@ -44,13 +44,6 @@
|
|
|
44
44
|
"label": "Onboard Button",
|
|
45
45
|
"description": "Single action button for onboarding.",
|
|
46
46
|
"styles": {
|
|
47
|
-
"labelKey": {
|
|
48
|
-
"label": "Label Key",
|
|
49
|
-
"description": "Localization key for the button text.",
|
|
50
|
-
"category": "other",
|
|
51
|
-
"specialCategory": null,
|
|
52
|
-
"sort": 1
|
|
53
|
-
},
|
|
54
47
|
"button_text_color": {
|
|
55
48
|
"label": "Button Text Color",
|
|
56
49
|
"description": "Text color of the button.",
|
|
@@ -78,6 +71,15 @@
|
|
|
78
71
|
"category": "style",
|
|
79
72
|
"specialCategory": null,
|
|
80
73
|
"sort": 5
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"attributes": {
|
|
77
|
+
"labelKey": {
|
|
78
|
+
"label": "Label Key",
|
|
79
|
+
"description": "Localization key for the button text.",
|
|
80
|
+
"category": "other",
|
|
81
|
+
"specialCategory": null,
|
|
82
|
+
"sort": 1
|
|
81
83
|
},
|
|
82
84
|
"flex": {
|
|
83
85
|
"label": "Flex",
|