@developer_tribe/react-builder 0.1.32 → 1.0.2
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/DeviceMockFrame.d.ts +2 -17
- package/dist/RenderPage.d.ts +4 -11
- package/dist/attributes-editor/Field.d.ts +16 -0
- package/dist/attributes-editor/FieldInfoTooltip.d.ts +7 -0
- package/dist/attributes-editor/LayoutPreviewPicker.d.ts +12 -0
- package/dist/attributes-editor/SpecialCategorySection.d.ts +19 -0
- package/dist/attributes-editor/types.d.ts +14 -0
- package/dist/background.jpg +0 -0
- package/dist/build-components/Button/Button.d.ts +1 -1
- package/dist/build-components/Button/ButtonProps.generated.d.ts +26 -1
- package/dist/build-components/Carousel/CarouselProps.generated.d.ts +27 -1
- package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +25 -0
- package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +25 -0
- package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +27 -1
- package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +27 -1
- package/dist/build-components/Image/ImageProps.generated.d.ts +25 -3
- package/dist/build-components/Onboard/OnboardProps.generated.d.ts +27 -1
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +25 -0
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +25 -0
- package/dist/build-components/OnboardDot/OnboardDot.d.ts +1 -1
- package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +22 -0
- package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +4 -5
- package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +25 -3
- package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +24 -3
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +25 -4
- package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +4 -5
- package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +4 -5
- package/dist/build-components/Text/TextProps.generated.d.ts +4 -5
- package/dist/build-components/View/ViewProps.generated.d.ts +3 -4
- package/dist/build-components/index.d.ts +1 -0
- package/dist/build-components/patterns.generated.d.ts +4855 -132
- package/dist/components/AttributesEditorPanel.d.ts +9 -0
- package/dist/components/Breadcrumb.d.ts +15 -0
- package/dist/components/Builder.d.ts +9 -0
- package/dist/components/Checkbox.d.ts +17 -0
- package/dist/components/DeviceButton.d.ts +8 -0
- package/dist/components/DeviceNavigationBar.d.ts +10 -0
- package/dist/components/DeviceStatusBar.d.ts +9 -0
- package/dist/components/EditorHeader.d.ts +10 -0
- package/dist/index.cjs.js +6 -5
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.esm.js +6 -5
- package/dist/index.esm.js.map +1 -0
- package/dist/mockOS/components/MockLaunchScreenComponent.d.ts +6 -0
- package/dist/mockOS/components/MockOSRouter.d.ts +8 -0
- package/dist/mockOS/components/PermissionModal.d.ts +9 -0
- package/dist/mockOS/context/MockOSContext.d.ts +36 -0
- package/dist/mockOS/hooks/useMockNavigation.d.ts +3 -0
- package/dist/mockOS/hooks/useMockPermission.d.ts +3 -0
- package/dist/mockOS/index.d.ts +9 -0
- package/dist/mockOS/managers/mockPermissionManager.d.ts +10 -0
- package/dist/mockOS/managers/navigationManager.d.ts +17 -0
- package/dist/modals/AddComponentModal.d.ts +8 -0
- package/dist/modals/ColorModal.d.ts +9 -0
- package/dist/modals/DeviceSelectorModal.d.ts +9 -0
- package/dist/modals/LocalicationModal.d.ts +8 -0
- package/dist/modals/Modal.d.ts +12 -0
- package/dist/modals/index.d.ts +5 -0
- package/dist/pages/ProjectPage.d.ts +11 -0
- package/dist/pages/tabs/BuilderTab.d.ts +9 -0
- package/dist/pages/tabs/DebugTab.d.ts +7 -0
- package/dist/pages/tabs/PreviewTab.d.ts +3 -0
- package/dist/store.d.ts +15 -18
- package/dist/styles.css +1 -1
- package/dist/types/PreviewConfig.d.ts +6 -3
- package/dist/types/Project.d.ts +12 -2
- package/dist/utils/copyNode.d.ts +2 -0
- package/dist/utils/logger.d.ts +11 -0
- package/dist/utils/patterns.d.ts +24 -0
- package/dist/utils/useLogRender.d.ts +1 -0
- package/package.json +17 -9
- package/scripts/prebuild/utils/createBuildComponentsIndex.js +15 -1
- package/scripts/prebuild/utils/createGeneratedProps.js +11 -3
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +45 -6
- package/scripts/prebuild/utils/validatePatternJson.js +13 -5
- package/src/AttributesEditor.tsx +434 -311
- package/src/DeviceMockFrame.tsx +42 -67
- package/src/RenderPage.tsx +8 -44
- package/src/assets/images/android.svg +43 -0
- package/src/assets/images/apple.svg +16 -0
- package/src/assets/images/background.jpg +0 -0
- package/src/assets/samples/carousel-sample.json +2 -3
- package/src/assets/samples/getSamples.ts +49 -12
- package/src/assets/samples/simple-1.json +1 -2
- package/src/assets/samples/simple-2.json +1 -2
- package/src/assets/samples/vpn-onboard-1.json +1 -2
- package/src/assets/samples/vpn-onboard-2.json +1 -2
- package/src/assets/samples/vpn-onboard-3.json +1 -2
- package/src/assets/samples/vpn-onboard-4.json +1 -2
- package/src/assets/samples/vpn-onboard-5.json +1 -2
- package/src/assets/samples/vpn-onboard-6.json +1 -2
- package/src/attributes-editor/Field.tsx +662 -0
- package/src/attributes-editor/FieldInfoTooltip.tsx +49 -0
- package/src/attributes-editor/LayoutPreviewPicker.tsx +199 -0
- package/src/attributes-editor/SpecialCategorySection.tsx +284 -0
- package/src/attributes-editor/types.ts +30 -0
- package/src/build-components/Button/Button.tsx +12 -2
- package/src/build-components/Button/ButtonProps.generated.ts +37 -1
- package/src/build-components/Button/pattern.json +31 -2
- package/src/build-components/Carousel/Carousel.tsx +17 -2
- package/src/build-components/Carousel/CarouselProps.generated.ts +39 -1
- package/src/build-components/Carousel/pattern.json +10 -0
- package/src/build-components/CarouselButtons/CarouselButtons.tsx +8 -2
- package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +36 -0
- package/src/build-components/CarouselButtons/pattern.json +22 -0
- package/src/build-components/CarouselDots/CarouselDots.tsx +42 -8
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +36 -0
- package/src/build-components/CarouselDots/pattern.json +15 -0
- package/src/build-components/CarouselItem/CarouselItem.tsx +7 -2
- package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +39 -1
- package/src/build-components/CarouselItem/pattern.json +7 -0
- package/src/build-components/CarouselProvider/CarouselProvider.tsx +10 -2
- package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +39 -1
- package/src/build-components/CarouselProvider/pattern.json +7 -0
- package/src/build-components/Image/Image.tsx +10 -2
- package/src/build-components/Image/ImageProps.generated.ts +36 -3
- package/src/build-components/Image/pattern.json +46 -3
- package/src/build-components/Onboard/Onboard.tsx +8 -1
- package/src/build-components/Onboard/OnboardProps.generated.ts +39 -1
- package/src/build-components/Onboard/pattern.json +11 -0
- package/src/build-components/OnboardButton/OnboardButton.tsx +53 -9
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +36 -0
- package/src/build-components/OnboardButton/pattern.json +71 -5
- package/src/build-components/OnboardButtons/OnboardButtons.tsx +27 -17
- package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +36 -0
- package/src/build-components/OnboardButtons/pattern.json +70 -4
- package/src/build-components/OnboardDot/OnboardDot.tsx +106 -4
- package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +22 -0
- package/src/build-components/OnboardDot/pattern.json +54 -1
- package/src/build-components/OnboardFooter/OnboardFooter.tsx +14 -6
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +4 -5
- package/src/build-components/OnboardFooter/pattern.json +58 -2
- package/src/build-components/OnboardImage/OnboardImage.tsx +29 -5
- package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +36 -3
- package/src/build-components/OnboardImage/pattern.json +21 -0
- package/src/build-components/OnboardItem/OnboardItem.tsx +8 -1
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +35 -3
- package/src/build-components/OnboardItem/pattern.json +38 -2
- package/src/build-components/OnboardProvider/OnboardProvider.tsx +22 -8
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +37 -4
- package/src/build-components/OnboardProvider/pattern.json +51 -4
- package/src/build-components/OnboardSubtitle/OnboardSubtitle.tsx +2 -0
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +4 -5
- package/src/build-components/OnboardSubtitle/pattern.json +6 -0
- package/src/build-components/OnboardTitle/OnboardTitle.tsx +2 -0
- package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +4 -5
- package/src/build-components/OnboardTitle/pattern.json +6 -0
- package/src/build-components/Text/Text.tsx +12 -6
- package/src/build-components/Text/TextProps.generated.ts +4 -5
- package/src/build-components/Text/pattern.json +38 -2
- package/src/build-components/View/View.tsx +11 -6
- package/src/build-components/View/ViewProps.generated.ts +3 -4
- package/src/build-components/View/pattern.json +227 -19
- package/src/build-components/index.ts +22 -0
- package/src/build-components/patterns.generated.ts +4905 -139
- package/src/components/AttributesEditorPanel.tsx +58 -0
- package/src/components/Breadcrumb.tsx +80 -0
- package/src/components/Builder.tsx +375 -0
- package/src/components/Checkbox.tsx +81 -0
- package/src/components/DeviceButton.tsx +39 -0
- package/src/components/DeviceNavigationBar.tsx +201 -0
- package/src/components/DeviceStatusBar.tsx +85 -0
- package/src/components/EditorHeader.tsx +138 -0
- package/src/index.ts +8 -4
- package/src/mockOS/components/MockLaunchScreenComponent.tsx +43 -0
- package/src/mockOS/components/MockOSRouter.tsx +115 -0
- package/src/mockOS/components/PermissionModal.tsx +270 -0
- package/src/mockOS/context/MockOSContext.tsx +179 -0
- package/src/mockOS/hooks/useMockNavigation.ts +11 -0
- package/src/mockOS/hooks/useMockPermission.ts +11 -0
- package/src/mockOS/index.ts +26 -0
- package/src/mockOS/managers/mockPermissionManager.ts +54 -0
- package/src/mockOS/managers/navigationManager.ts +91 -0
- package/src/modals/AddComponentModal.tsx +313 -0
- package/src/modals/ColorModal.tsx +268 -0
- package/src/modals/DeviceSelectorModal.tsx +57 -0
- package/src/modals/LocalicationModal.tsx +54 -0
- package/src/modals/Modal.tsx +57 -0
- package/src/modals/index.ts +5 -0
- package/src/pages/ProjectPage.tsx +150 -0
- package/src/pages/tabs/BuilderTab.tsx +33 -0
- package/src/pages/tabs/DebugTab.tsx +64 -0
- package/src/pages/tabs/PreviewTab.tsx +206 -0
- package/src/size-matters/index.ts +25 -5
- package/src/store.ts +56 -38
- package/src/styles/base/_global.scss +253 -0
- package/src/styles/components/_attributes-editor.scss +261 -0
- package/src/styles/components/_editor-shell.scss +189 -0
- package/src/styles/components/_mockos-router.scss +140 -0
- package/src/styles/components/_ui-components.scss +183 -0
- package/src/styles/foundation/_colors.scss +8 -0
- package/src/styles/foundation/_mixins.scss +22 -0
- package/src/styles/{_reset.scss → foundation/_reset.scss} +5 -2
- package/src/styles/foundation/_sizes.scss +37 -0
- package/src/styles/foundation/_typography.scss +4 -0
- package/src/styles/foundation/_variables.scss +3 -0
- package/src/styles/index.scss +22 -129
- package/src/styles/layout/_builder.scss +68 -0
- package/src/styles/layout/_pages.scss +3 -0
- package/src/styles/modals/_add-component.scss +122 -0
- package/src/styles/modals/_color-modal.scss +130 -0
- package/src/styles/modals/_device-selector.scss +18 -0
- package/src/styles/modals/_localication-modal.scss +68 -0
- package/src/styles/modals/_modal-shell.scss +46 -0
- package/src/styles/utilities/_carousel.scss +125 -0
- package/src/types/PreviewConfig.ts +14 -5
- package/src/types/Project.ts +15 -2
- package/src/types/images.d.ts +8 -0
- package/src/utils/copyNode.ts +7 -0
- package/src/utils/extractTextStyle.ts +8 -4
- package/src/utils/extractViewStyle.ts +51 -7
- package/src/utils/getDevices.ts +1 -0
- package/src/utils/logger.ts +76 -0
- package/src/utils/patterns.ts +33 -0
- package/src/utils/useLogRender.ts +13 -0
- package/dist/build-components/OnboardDot/OnboardExpandingDotProps.generated.d.ts +0 -10
- package/src/build-components/OnboardDot/OnboardExpandingDotProps.generated.ts +0 -20
|
@@ -2,8 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import type { OnboardSubtitleComponentProps } from './OnboardSubtitleProps.generated';
|
|
3
3
|
import Text from '../Text/Text';
|
|
4
4
|
import useNode from '../useNode';
|
|
5
|
+
import { useLogRender } from '../../utils/useLogRender';
|
|
5
6
|
|
|
6
7
|
function OnboardSubtitle({ node }: OnboardSubtitleComponentProps) {
|
|
8
|
+
useLogRender('OnboardSubtitle');
|
|
7
9
|
node = useNode(node);
|
|
8
10
|
return <Text node={node} />;
|
|
9
11
|
}
|
|
@@ -34,7 +34,7 @@ export interface OnboardSubtitlePropsGenerated {
|
|
|
34
34
|
child: string;
|
|
35
35
|
attributes: {
|
|
36
36
|
color?: string;
|
|
37
|
-
fontSize?:
|
|
37
|
+
fontSize?: string;
|
|
38
38
|
fontWeight?: FontWeightOptionType;
|
|
39
39
|
textAlign?: TextAlignOptionType;
|
|
40
40
|
scrollable?: boolean;
|
|
@@ -42,7 +42,7 @@ export interface OnboardSubtitlePropsGenerated {
|
|
|
42
42
|
alignItems?: AlignItemsOptionType;
|
|
43
43
|
justifyContent?: JustifyContentOptionType;
|
|
44
44
|
gap?: string;
|
|
45
|
-
padding?:
|
|
45
|
+
padding?: string;
|
|
46
46
|
paddingHorizontal?: string;
|
|
47
47
|
paddingVertical?: string;
|
|
48
48
|
paddingTop?: string;
|
|
@@ -50,7 +50,6 @@ export interface OnboardSubtitlePropsGenerated {
|
|
|
50
50
|
paddingLeft?: string;
|
|
51
51
|
paddingRight?: string;
|
|
52
52
|
margin?: string;
|
|
53
|
-
marginHorizontal?: string;
|
|
54
53
|
marginVertical?: string;
|
|
55
54
|
marginTop?: string;
|
|
56
55
|
marginBottom?: string;
|
|
@@ -58,8 +57,8 @@ export interface OnboardSubtitlePropsGenerated {
|
|
|
58
57
|
marginRight?: string;
|
|
59
58
|
backgroundColor?: string;
|
|
60
59
|
borderRadius?: string;
|
|
61
|
-
width?:
|
|
62
|
-
height?:
|
|
60
|
+
width?: string;
|
|
61
|
+
height?: string;
|
|
63
62
|
};
|
|
64
63
|
}
|
|
65
64
|
|
|
@@ -10,5 +10,11 @@
|
|
|
10
10
|
"defaults": {
|
|
11
11
|
"fontSize": "14@fs",
|
|
12
12
|
"fontWeight": "600"
|
|
13
|
+
},
|
|
14
|
+
"meta": {
|
|
15
|
+
"desiredParent": [">OnboardProvider", ">OnboardItem"],
|
|
16
|
+
"label": "Onboard Subtitle",
|
|
17
|
+
"description": "Subtitle text for an onboarding step.",
|
|
18
|
+
"attributes": {}
|
|
13
19
|
}
|
|
14
20
|
}
|
|
@@ -2,8 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import type { OnboardTitleComponentProps } from './OnboardTitleProps.generated';
|
|
3
3
|
import Text from '../Text/Text';
|
|
4
4
|
import useNode from '../useNode';
|
|
5
|
+
import { useLogRender } from '../../utils/useLogRender';
|
|
5
6
|
|
|
6
7
|
function OnboardTitle({ node }: OnboardTitleComponentProps) {
|
|
8
|
+
useLogRender('OnboardTitle');
|
|
7
9
|
node = useNode(node);
|
|
8
10
|
return <Text node={node} />;
|
|
9
11
|
}
|
|
@@ -34,7 +34,7 @@ export interface OnboardTitlePropsGenerated {
|
|
|
34
34
|
child: string;
|
|
35
35
|
attributes: {
|
|
36
36
|
color?: string;
|
|
37
|
-
fontSize?:
|
|
37
|
+
fontSize?: string;
|
|
38
38
|
fontWeight?: FontWeightOptionType;
|
|
39
39
|
textAlign?: TextAlignOptionType;
|
|
40
40
|
scrollable?: boolean;
|
|
@@ -42,7 +42,7 @@ export interface OnboardTitlePropsGenerated {
|
|
|
42
42
|
alignItems?: AlignItemsOptionType;
|
|
43
43
|
justifyContent?: JustifyContentOptionType;
|
|
44
44
|
gap?: string;
|
|
45
|
-
padding?:
|
|
45
|
+
padding?: string;
|
|
46
46
|
paddingHorizontal?: string;
|
|
47
47
|
paddingVertical?: string;
|
|
48
48
|
paddingTop?: string;
|
|
@@ -50,7 +50,6 @@ export interface OnboardTitlePropsGenerated {
|
|
|
50
50
|
paddingLeft?: string;
|
|
51
51
|
paddingRight?: string;
|
|
52
52
|
margin?: string;
|
|
53
|
-
marginHorizontal?: string;
|
|
54
53
|
marginVertical?: string;
|
|
55
54
|
marginTop?: string;
|
|
56
55
|
marginBottom?: string;
|
|
@@ -58,8 +57,8 @@ export interface OnboardTitlePropsGenerated {
|
|
|
58
57
|
marginRight?: string;
|
|
59
58
|
backgroundColor?: string;
|
|
60
59
|
borderRadius?: string;
|
|
61
|
-
width?:
|
|
62
|
-
height?:
|
|
60
|
+
width?: string;
|
|
61
|
+
height?: string;
|
|
63
62
|
};
|
|
64
63
|
}
|
|
65
64
|
|
|
@@ -11,5 +11,11 @@
|
|
|
11
11
|
"fontSize": "24@fs",
|
|
12
12
|
"fontWeight": "700",
|
|
13
13
|
"textAlign": "center"
|
|
14
|
+
},
|
|
15
|
+
"meta": {
|
|
16
|
+
"desiredParent": [">OnboardItem", ">OnboardProvider"],
|
|
17
|
+
"label": "Onboard Title",
|
|
18
|
+
"description": "Title text for an onboarding step.",
|
|
19
|
+
"attributes": {}
|
|
14
20
|
}
|
|
15
21
|
}
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import type { TextComponentProps } from './TextProps.generated';
|
|
3
3
|
import useNode from '../useNode';
|
|
4
4
|
import { useRenderStore } from '../../store';
|
|
5
5
|
import { extractTextStyle } from '../../utils/extractTextStyle';
|
|
6
|
+
import { extractViewStyle } from '../../utils/extractViewStyle';
|
|
7
|
+
import { useLogRender } from '../../utils/useLogRender';
|
|
6
8
|
|
|
7
9
|
function Text({ node }: TextComponentProps) {
|
|
10
|
+
useLogRender('Text');
|
|
8
11
|
node = useNode(node);
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const attributeKey = (node as any)?.sourceType ?? node.type ?? 'text';
|
|
13
|
+
const { appConfig } = useRenderStore((s) => ({
|
|
14
|
+
appConfig: s.appConfig,
|
|
12
15
|
}));
|
|
16
|
+
const { defaultLanguage, localication } = appConfig;
|
|
13
17
|
const keyOrText: string = node.children as string;
|
|
14
|
-
const
|
|
18
|
+
const textStyle = extractTextStyle(node);
|
|
19
|
+
const viewStyle = useMemo(() => extractViewStyle(node), [node]);
|
|
20
|
+
const style = { ...viewStyle, ...textStyle };
|
|
15
21
|
|
|
16
22
|
return (
|
|
17
|
-
<p style={style}>
|
|
23
|
+
<p attribute-key={attributeKey} style={style}>
|
|
18
24
|
{localication?.[defaultLanguage ?? 'en']?.[keyOrText] ?? keyOrText}
|
|
19
25
|
</p>
|
|
20
26
|
);
|
|
@@ -38,7 +38,7 @@ export interface TextPropsGenerated {
|
|
|
38
38
|
alignItems?: AlignItemsOptionType;
|
|
39
39
|
justifyContent?: JustifyContentOptionType;
|
|
40
40
|
gap?: string;
|
|
41
|
-
padding?:
|
|
41
|
+
padding?: string;
|
|
42
42
|
paddingHorizontal?: string;
|
|
43
43
|
paddingVertical?: string;
|
|
44
44
|
paddingTop?: string;
|
|
@@ -46,7 +46,6 @@ export interface TextPropsGenerated {
|
|
|
46
46
|
paddingLeft?: string;
|
|
47
47
|
paddingRight?: string;
|
|
48
48
|
margin?: string;
|
|
49
|
-
marginHorizontal?: string;
|
|
50
49
|
marginVertical?: string;
|
|
51
50
|
marginTop?: string;
|
|
52
51
|
marginBottom?: string;
|
|
@@ -54,10 +53,10 @@ export interface TextPropsGenerated {
|
|
|
54
53
|
marginRight?: string;
|
|
55
54
|
backgroundColor?: string;
|
|
56
55
|
borderRadius?: string;
|
|
57
|
-
width?:
|
|
58
|
-
height?:
|
|
56
|
+
width?: string;
|
|
57
|
+
height?: string;
|
|
59
58
|
color?: string;
|
|
60
|
-
fontSize?:
|
|
59
|
+
fontSize?: string;
|
|
61
60
|
fontWeight?: FontWeightOptionType;
|
|
62
61
|
textAlign?: TextAlignOptionType;
|
|
63
62
|
};
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"children": "string",
|
|
7
7
|
"extends": "View",
|
|
8
8
|
"attributes": {
|
|
9
|
-
"color": "
|
|
10
|
-
"fontSize": "
|
|
9
|
+
"color": "color",
|
|
10
|
+
"fontSize": "size",
|
|
11
11
|
"fontWeight": [
|
|
12
12
|
"normal",
|
|
13
13
|
"bold",
|
|
@@ -23,5 +23,41 @@
|
|
|
23
23
|
],
|
|
24
24
|
"textAlign": ["left", "center", "right", "justify"]
|
|
25
25
|
}
|
|
26
|
+
},
|
|
27
|
+
"meta": {
|
|
28
|
+
"desiredParent": ["all"],
|
|
29
|
+
"label": "Text",
|
|
30
|
+
"description": "Displays simple text.",
|
|
31
|
+
"attributes": {
|
|
32
|
+
"color": {
|
|
33
|
+
"label": "Color",
|
|
34
|
+
"description": "Text color.",
|
|
35
|
+
"category": "style",
|
|
36
|
+
"specialCategory": null,
|
|
37
|
+
"sort": 1
|
|
38
|
+
},
|
|
39
|
+
"fontSize": {
|
|
40
|
+
"label": "Font Size",
|
|
41
|
+
"description": "Text size.",
|
|
42
|
+
"category": "style",
|
|
43
|
+
"specialCategory": null,
|
|
44
|
+
"sort": 2,
|
|
45
|
+
"preferedScale": "s"
|
|
46
|
+
},
|
|
47
|
+
"fontWeight": {
|
|
48
|
+
"label": "Font Weight",
|
|
49
|
+
"description": "Text weight.",
|
|
50
|
+
"category": "style",
|
|
51
|
+
"specialCategory": null,
|
|
52
|
+
"sort": 3
|
|
53
|
+
},
|
|
54
|
+
"textAlign": {
|
|
55
|
+
"label": "Text Align",
|
|
56
|
+
"description": "Text alignment.",
|
|
57
|
+
"category": "style",
|
|
58
|
+
"specialCategory": null,
|
|
59
|
+
"sort": 4
|
|
60
|
+
}
|
|
61
|
+
}
|
|
26
62
|
}
|
|
27
63
|
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
ViewComponentProps,
|
|
4
|
-
ViewPropsGenerated,
|
|
5
|
-
} from './ViewProps.generated';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import type { ViewComponentProps } from './ViewProps.generated';
|
|
6
3
|
import RenderNode from '../RenderNode.generated';
|
|
7
4
|
import { Node } from '../../types/Node';
|
|
8
5
|
import useNode from '../useNode';
|
|
9
6
|
import { extractViewStyle } from '../../utils/extractViewStyle';
|
|
7
|
+
import { useLogRender } from '../../utils/useLogRender';
|
|
10
8
|
|
|
11
9
|
export function View({ node }: ViewComponentProps) {
|
|
10
|
+
useLogRender('View');
|
|
12
11
|
node = useNode(node);
|
|
12
|
+
const attributeKey = (node as any)?.sourceType ?? node.type ?? 'view';
|
|
13
|
+
const viewStyle = useMemo(() => extractViewStyle(node), [node]);
|
|
13
14
|
return (
|
|
14
|
-
<div
|
|
15
|
+
<div
|
|
16
|
+
attribute-key={attributeKey}
|
|
17
|
+
style={viewStyle}
|
|
18
|
+
className="scroll-container"
|
|
19
|
+
>
|
|
15
20
|
<RenderNode node={node.children as Node} />
|
|
16
21
|
</div>
|
|
17
22
|
);
|
|
@@ -25,7 +25,7 @@ export interface ViewPropsGenerated {
|
|
|
25
25
|
alignItems?: AlignItemsOptionType;
|
|
26
26
|
justifyContent?: JustifyContentOptionType;
|
|
27
27
|
gap?: string;
|
|
28
|
-
padding?:
|
|
28
|
+
padding?: string;
|
|
29
29
|
paddingHorizontal?: string;
|
|
30
30
|
paddingVertical?: string;
|
|
31
31
|
paddingTop?: string;
|
|
@@ -33,7 +33,6 @@ export interface ViewPropsGenerated {
|
|
|
33
33
|
paddingLeft?: string;
|
|
34
34
|
paddingRight?: string;
|
|
35
35
|
margin?: string;
|
|
36
|
-
marginHorizontal?: string;
|
|
37
36
|
marginVertical?: string;
|
|
38
37
|
marginTop?: string;
|
|
39
38
|
marginBottom?: string;
|
|
@@ -41,8 +40,8 @@ export interface ViewPropsGenerated {
|
|
|
41
40
|
marginRight?: string;
|
|
42
41
|
backgroundColor?: string;
|
|
43
42
|
borderRadius?: string;
|
|
44
|
-
width?:
|
|
45
|
-
height?:
|
|
43
|
+
width?: string;
|
|
44
|
+
height?: string;
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
47
|
|
|
@@ -16,25 +16,233 @@
|
|
|
16
16
|
"space-around",
|
|
17
17
|
"space-evenly"
|
|
18
18
|
],
|
|
19
|
-
"gap": "
|
|
20
|
-
"padding": "
|
|
21
|
-
"paddingHorizontal": "
|
|
22
|
-
"paddingVertical": "
|
|
23
|
-
"paddingTop": "
|
|
24
|
-
"paddingBottom": "
|
|
25
|
-
"paddingLeft": "
|
|
26
|
-
"paddingRight": "
|
|
27
|
-
"margin": "
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
19
|
+
"gap": "size",
|
|
20
|
+
"padding": "size",
|
|
21
|
+
"paddingHorizontal": "size",
|
|
22
|
+
"paddingVertical": "size",
|
|
23
|
+
"paddingTop": "size",
|
|
24
|
+
"paddingBottom": "size",
|
|
25
|
+
"paddingLeft": "size",
|
|
26
|
+
"paddingRight": "size",
|
|
27
|
+
"margin": "size",
|
|
28
|
+
"marginVertical": "size",
|
|
29
|
+
"marginTop": "size",
|
|
30
|
+
"marginBottom": "size",
|
|
31
|
+
"marginLeft": "size",
|
|
32
|
+
"marginRight": "size",
|
|
33
|
+
"backgroundColor": "color",
|
|
34
|
+
"borderRadius": "size",
|
|
35
|
+
"width": "size",
|
|
36
|
+
"height": "size"
|
|
37
|
+
},
|
|
38
|
+
"defaults": {
|
|
39
|
+
"flexDirection": "column"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"meta": {
|
|
43
|
+
"desiredParent": ["all"],
|
|
44
|
+
"label": "View",
|
|
45
|
+
"description": "Base layout container.",
|
|
46
|
+
"specialCategories": {
|
|
47
|
+
"padding": {
|
|
48
|
+
"label": "Padding",
|
|
49
|
+
"description": "Uniform padding on all sides.",
|
|
50
|
+
"category": "container",
|
|
51
|
+
"sort": 1
|
|
52
|
+
},
|
|
53
|
+
"margin": {
|
|
54
|
+
"label": "Margin",
|
|
55
|
+
"description": "Uniform margin on all sides.",
|
|
56
|
+
"category": "container",
|
|
57
|
+
"sort": 2
|
|
58
|
+
},
|
|
59
|
+
"size": {
|
|
60
|
+
"label": "Size",
|
|
61
|
+
"description": "Fixed dimensions.",
|
|
62
|
+
"category": "container",
|
|
63
|
+
"sort": 3
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"attributes": {
|
|
67
|
+
"scrollable": {
|
|
68
|
+
"label": "Scrollable",
|
|
69
|
+
"description": "Turns scroll interaction on.",
|
|
70
|
+
"category": "container",
|
|
71
|
+
"specialCategory": null,
|
|
72
|
+
"sort": -1
|
|
73
|
+
},
|
|
74
|
+
"flexDirection": {
|
|
75
|
+
"label": "Flex Direction",
|
|
76
|
+
"description": "Sets row or column layout.",
|
|
77
|
+
"category": "container",
|
|
78
|
+
"specialCategory": null,
|
|
79
|
+
"sort": 4
|
|
80
|
+
},
|
|
81
|
+
"alignItems": {
|
|
82
|
+
"label": "Align Items",
|
|
83
|
+
"description": "Controls cross-axis alignment.",
|
|
84
|
+
"category": "container",
|
|
85
|
+
"specialCategory": null,
|
|
86
|
+
"sort": 3
|
|
87
|
+
},
|
|
88
|
+
"justifyContent": {
|
|
89
|
+
"label": "Justify Content",
|
|
90
|
+
"description": "Controls main-axis alignment.",
|
|
91
|
+
"category": "container",
|
|
92
|
+
"specialCategory": null,
|
|
93
|
+
"sort": 5
|
|
94
|
+
},
|
|
95
|
+
"gap": {
|
|
96
|
+
"label": "Gap",
|
|
97
|
+
"description": "Space between children.",
|
|
98
|
+
"category": "container",
|
|
99
|
+
"specialCategory": null,
|
|
100
|
+
"sort": 10,
|
|
101
|
+
"preferedScale": "s"
|
|
102
|
+
},
|
|
103
|
+
"padding": {
|
|
104
|
+
"label": "Padding",
|
|
105
|
+
"description": "Uniform padding on all sides.",
|
|
106
|
+
"category": "container",
|
|
107
|
+
"specialCategory": "padding",
|
|
108
|
+
"sort": 6,
|
|
109
|
+
"preferedScale": "s"
|
|
110
|
+
},
|
|
111
|
+
"paddingHorizontal": {
|
|
112
|
+
"label": "Padding Horizontal",
|
|
113
|
+
"description": "Left and right padding.",
|
|
114
|
+
"category": "container",
|
|
115
|
+
"specialCategory": "padding",
|
|
116
|
+
"sort": 7,
|
|
117
|
+
"preferedScale": "s"
|
|
118
|
+
},
|
|
119
|
+
"paddingVertical": {
|
|
120
|
+
"label": "Padding Vertical",
|
|
121
|
+
"description": "Top and bottom padding.",
|
|
122
|
+
"category": "container",
|
|
123
|
+
"specialCategory": "padding",
|
|
124
|
+
"sort": 8,
|
|
125
|
+
"preferedScale": "vs"
|
|
126
|
+
},
|
|
127
|
+
"paddingTop": {
|
|
128
|
+
"label": "Padding Top",
|
|
129
|
+
"description": "Top padding only.",
|
|
130
|
+
"category": "container",
|
|
131
|
+
"specialCategory": "padding",
|
|
132
|
+
"sort": 9,
|
|
133
|
+
"preferedScale": "vs"
|
|
134
|
+
},
|
|
135
|
+
"paddingBottom": {
|
|
136
|
+
"label": "Padding Bottom",
|
|
137
|
+
"description": "Bottom padding only.",
|
|
138
|
+
"category": "container",
|
|
139
|
+
"specialCategory": "padding",
|
|
140
|
+
"sort": 10,
|
|
141
|
+
"preferedScale": "vs"
|
|
142
|
+
},
|
|
143
|
+
"paddingLeft": {
|
|
144
|
+
"label": "Padding Left",
|
|
145
|
+
"description": "Left padding only.",
|
|
146
|
+
"category": "container",
|
|
147
|
+
"specialCategory": "padding",
|
|
148
|
+
"sort": 11,
|
|
149
|
+
"preferedScale": "s"
|
|
150
|
+
},
|
|
151
|
+
"paddingRight": {
|
|
152
|
+
"label": "Padding Right",
|
|
153
|
+
"description": "Right padding only.",
|
|
154
|
+
"category": "container",
|
|
155
|
+
"specialCategory": "padding",
|
|
156
|
+
"sort": 12,
|
|
157
|
+
"preferedScale": "s"
|
|
158
|
+
},
|
|
159
|
+
"margin": {
|
|
160
|
+
"label": "Margin",
|
|
161
|
+
"description": "Uniform margin on all sides.",
|
|
162
|
+
"category": "container",
|
|
163
|
+
"specialCategory": "margin",
|
|
164
|
+
"sort": 13,
|
|
165
|
+
"preferedScale": "s"
|
|
166
|
+
},
|
|
167
|
+
"marginHorizontal": {
|
|
168
|
+
"label": "Margin Horizontal",
|
|
169
|
+
"description": "Left and right margin.",
|
|
170
|
+
"category": "container",
|
|
171
|
+
"specialCategory": "margin",
|
|
172
|
+
"sort": 14,
|
|
173
|
+
"preferedScale": "s"
|
|
174
|
+
},
|
|
175
|
+
"marginVertical": {
|
|
176
|
+
"label": "Margin Vertical",
|
|
177
|
+
"description": "Top and bottom margin.",
|
|
178
|
+
"category": "container",
|
|
179
|
+
"specialCategory": "margin",
|
|
180
|
+
"sort": 15,
|
|
181
|
+
"preferedScale": "vs"
|
|
182
|
+
},
|
|
183
|
+
"marginTop": {
|
|
184
|
+
"label": "Margin Top",
|
|
185
|
+
"description": "Top margin only.",
|
|
186
|
+
"category": "container",
|
|
187
|
+
"specialCategory": "margin",
|
|
188
|
+
"sort": 16,
|
|
189
|
+
"preferedScale": "vs"
|
|
190
|
+
},
|
|
191
|
+
"marginBottom": {
|
|
192
|
+
"label": "Margin Bottom",
|
|
193
|
+
"description": "Bottom margin only.",
|
|
194
|
+
"category": "container",
|
|
195
|
+
"specialCategory": "margin",
|
|
196
|
+
"sort": 17,
|
|
197
|
+
"preferedScale": "vs"
|
|
198
|
+
},
|
|
199
|
+
"marginLeft": {
|
|
200
|
+
"label": "Margin Left",
|
|
201
|
+
"description": "Left margin only.",
|
|
202
|
+
"category": "container",
|
|
203
|
+
"specialCategory": "margin",
|
|
204
|
+
"sort": 18,
|
|
205
|
+
"preferedScale": "s"
|
|
206
|
+
},
|
|
207
|
+
"marginRight": {
|
|
208
|
+
"label": "Margin Right",
|
|
209
|
+
"description": "Right margin only.",
|
|
210
|
+
"category": "container",
|
|
211
|
+
"specialCategory": "margin",
|
|
212
|
+
"sort": 19,
|
|
213
|
+
"preferedScale": "s"
|
|
214
|
+
},
|
|
215
|
+
"backgroundColor": {
|
|
216
|
+
"label": "Background Color",
|
|
217
|
+
"description": "Background fill color.",
|
|
218
|
+
"category": "style",
|
|
219
|
+
"specialCategory": null,
|
|
220
|
+
"sort": 20
|
|
221
|
+
},
|
|
222
|
+
"borderRadius": {
|
|
223
|
+
"label": "Border Radius",
|
|
224
|
+
"description": "Corner rounding amount.",
|
|
225
|
+
"category": "style",
|
|
226
|
+
"specialCategory": null,
|
|
227
|
+
"sort": 21,
|
|
228
|
+
"preferedScale": "s"
|
|
229
|
+
},
|
|
230
|
+
"width": {
|
|
231
|
+
"label": "Width",
|
|
232
|
+
"description": "Fixed width value.",
|
|
233
|
+
"category": "container",
|
|
234
|
+
"specialCategory": "size",
|
|
235
|
+
"sort": 0,
|
|
236
|
+
"preferedScale": "s"
|
|
237
|
+
},
|
|
238
|
+
"height": {
|
|
239
|
+
"label": "Height",
|
|
240
|
+
"description": "Fixed height value.",
|
|
241
|
+
"category": "container",
|
|
242
|
+
"specialCategory": "size",
|
|
243
|
+
"sort": 1,
|
|
244
|
+
"preferedScale": "vs"
|
|
245
|
+
}
|
|
38
246
|
}
|
|
39
247
|
}
|
|
40
248
|
}
|
|
@@ -4,6 +4,28 @@ export { default as RenderNode } from './RenderNode.generated';
|
|
|
4
4
|
|
|
5
5
|
export { patterns } from './patterns.generated';
|
|
6
6
|
|
|
7
|
+
export const allcomponentNames = [
|
|
8
|
+
'button',
|
|
9
|
+
'carousel',
|
|
10
|
+
'carouselButtons',
|
|
11
|
+
'carouselDots',
|
|
12
|
+
'carouselItem',
|
|
13
|
+
'carouselProvider',
|
|
14
|
+
'image',
|
|
15
|
+
'Onboard',
|
|
16
|
+
'OnboardButton',
|
|
17
|
+
'OnboardButtons',
|
|
18
|
+
'OnboardDot',
|
|
19
|
+
'OnboardFooter',
|
|
20
|
+
'OnboardImage',
|
|
21
|
+
'OnboardItem',
|
|
22
|
+
'OnboardProvider',
|
|
23
|
+
'OnboardSubtitle',
|
|
24
|
+
'OnboardTitle',
|
|
25
|
+
'text',
|
|
26
|
+
'view',
|
|
27
|
+
] as const;
|
|
28
|
+
|
|
7
29
|
export type {
|
|
8
30
|
ButtonPropsGenerated,
|
|
9
31
|
ButtonComponentProps,
|