@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
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"pattern": {
|
|
5
5
|
"type": "OnboardDot",
|
|
6
6
|
"children": "node",
|
|
7
|
+
"extends": "View",
|
|
7
8
|
"attributes": {
|
|
8
9
|
"dotType": [
|
|
9
10
|
"expanding_dot",
|
|
@@ -17,7 +18,59 @@
|
|
|
17
18
|
"expanding_dot_width": "number",
|
|
18
19
|
"dot_style": "string",
|
|
19
20
|
"container_style": "string",
|
|
20
|
-
"active_dot_color": "
|
|
21
|
+
"active_dot_color": "color",
|
|
22
|
+
"flexDirection": "never",
|
|
23
|
+
"alignItems": "never",
|
|
24
|
+
"justifyContent": "never"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"meta": {
|
|
28
|
+
"desiredParent": [">OnboardProvider"],
|
|
29
|
+
"label": "Onboard Dot",
|
|
30
|
+
"description": "Renders onboarding progress dots.",
|
|
31
|
+
"attributes": {
|
|
32
|
+
"dotType": {
|
|
33
|
+
"label": "Dot Type",
|
|
34
|
+
"description": "Dot animation style.",
|
|
35
|
+
"category": "style",
|
|
36
|
+
"specialCategory": null,
|
|
37
|
+
"sort": 1
|
|
38
|
+
},
|
|
39
|
+
"inactive_dot_opacity": {
|
|
40
|
+
"label": "Inactive Dot Opacity",
|
|
41
|
+
"description": "Opacity for inactive dots.",
|
|
42
|
+
"category": "style",
|
|
43
|
+
"specialCategory": null,
|
|
44
|
+
"sort": 2
|
|
45
|
+
},
|
|
46
|
+
"expanding_dot_width": {
|
|
47
|
+
"label": "Expanding Dot Width",
|
|
48
|
+
"description": "Width used while expanding.",
|
|
49
|
+
"category": "style",
|
|
50
|
+
"specialCategory": null,
|
|
51
|
+
"sort": 3
|
|
52
|
+
},
|
|
53
|
+
"dot_style": {
|
|
54
|
+
"label": "Dot Style",
|
|
55
|
+
"description": "Custom style for each dot.",
|
|
56
|
+
"category": "style",
|
|
57
|
+
"specialCategory": null,
|
|
58
|
+
"sort": 4
|
|
59
|
+
},
|
|
60
|
+
"container_style": {
|
|
61
|
+
"label": "Container Style",
|
|
62
|
+
"description": "Style for the dot wrapper.",
|
|
63
|
+
"category": "style",
|
|
64
|
+
"specialCategory": null,
|
|
65
|
+
"sort": 5
|
|
66
|
+
},
|
|
67
|
+
"active_dot_color": {
|
|
68
|
+
"label": "Active Dot Color",
|
|
69
|
+
"description": "Color of the active dot.",
|
|
70
|
+
"category": "style",
|
|
71
|
+
"specialCategory": null,
|
|
72
|
+
"sort": 6
|
|
73
|
+
}
|
|
21
74
|
}
|
|
22
75
|
}
|
|
23
76
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import type { OnboardFooterComponentProps } from './OnboardFooterProps.generated';
|
|
3
3
|
import useNode from '../useNode';
|
|
4
4
|
import { useRenderStore } from '../../store';
|
|
5
5
|
import { parseSize } from '../../size-matters';
|
|
6
6
|
import { extractTextStyle } from '../../utils/extractTextStyle';
|
|
7
|
+
import { extractViewStyle } from '../../utils/extractViewStyle';
|
|
8
|
+
import { useLogRender } from '../../utils/useLogRender';
|
|
7
9
|
|
|
8
10
|
type Segment =
|
|
9
11
|
| { type: 'text'; value: string }
|
|
@@ -86,16 +88,20 @@ function buildSegments(
|
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
function OnboardFooter({ node }: OnboardFooterComponentProps) {
|
|
91
|
+
useLogRender('OnboardFooter');
|
|
89
92
|
node = useNode(node);
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
const attributeKey =
|
|
94
|
+
(node as any)?.sourceType ?? node.type ?? 'OnboardFooter';
|
|
95
|
+
const { appConfig } = useRenderStore((s) => ({
|
|
96
|
+
appConfig: s.appConfig,
|
|
93
97
|
}));
|
|
98
|
+
const { localication, defaultLanguage } = appConfig;
|
|
94
99
|
const t = (key?: string) =>
|
|
95
100
|
key ? (localication?.[defaultLanguage ?? 'en']?.[key] ?? key) : '';
|
|
96
101
|
|
|
97
102
|
const text = t(node?.attributes?.textLocalizationKey);
|
|
98
|
-
const
|
|
103
|
+
const textStyle: React.CSSProperties = extractTextStyle(node);
|
|
104
|
+
const viewStyle = useMemo(() => extractViewStyle(node), [node]);
|
|
99
105
|
|
|
100
106
|
const linkStyle = (color?: string): React.CSSProperties => ({
|
|
101
107
|
color,
|
|
@@ -105,8 +111,10 @@ function OnboardFooter({ node }: OnboardFooterComponentProps) {
|
|
|
105
111
|
const paddingHorizontal = parseSize(node?.attributes?.paddingHorizontal);
|
|
106
112
|
return (
|
|
107
113
|
<div
|
|
114
|
+
attribute-key={attributeKey}
|
|
108
115
|
style={{
|
|
109
|
-
...
|
|
116
|
+
...viewStyle,
|
|
117
|
+
...textStyle,
|
|
110
118
|
paddingLeft: paddingHorizontal,
|
|
111
119
|
paddingRight: paddingHorizontal,
|
|
112
120
|
textAlign: 'center',
|
|
@@ -34,7 +34,7 @@ export interface OnboardFooterPropsGenerated {
|
|
|
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 OnboardFooterPropsGenerated {
|
|
|
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 OnboardFooterPropsGenerated {
|
|
|
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 OnboardFooterPropsGenerated {
|
|
|
58
57
|
marginRight?: string;
|
|
59
58
|
backgroundColor?: string;
|
|
60
59
|
borderRadius?: string;
|
|
61
|
-
width?:
|
|
62
|
-
height?:
|
|
60
|
+
width?: string;
|
|
61
|
+
height?: string;
|
|
63
62
|
textLocalizationKey?: string;
|
|
64
63
|
linkedWordFirstLocalizationKey?: string;
|
|
65
64
|
linkedWordFirstColor?: string;
|
|
@@ -8,14 +8,70 @@
|
|
|
8
8
|
"attributes": {
|
|
9
9
|
"textLocalizationKey": "string",
|
|
10
10
|
"linkedWordFirstLocalizationKey": "string",
|
|
11
|
-
"linkedWordFirstColor": "
|
|
11
|
+
"linkedWordFirstColor": "color",
|
|
12
12
|
"linkedWordFirstPage": "string",
|
|
13
13
|
"linkedWordSecondLocalizationKey": "string",
|
|
14
|
-
"linkedWordSecondColor": "
|
|
14
|
+
"linkedWordSecondColor": "color",
|
|
15
15
|
"linkedWordSecondPage": "string"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"defaults": {
|
|
19
19
|
"paddingHorizontal": "24@s"
|
|
20
|
+
},
|
|
21
|
+
"meta": {
|
|
22
|
+
"desiredParent": [">OnboardItem"],
|
|
23
|
+
"label": "Onboard Footer",
|
|
24
|
+
"description": "Footer text with optional links.",
|
|
25
|
+
"attributes": {
|
|
26
|
+
"textLocalizationKey": {
|
|
27
|
+
"label": "Text Localization Key",
|
|
28
|
+
"description": "Localization key for the footer text.",
|
|
29
|
+
"category": "other",
|
|
30
|
+
"specialCategory": null,
|
|
31
|
+
"sort": 1
|
|
32
|
+
},
|
|
33
|
+
"linkedWordFirstLocalizationKey": {
|
|
34
|
+
"label": "Linked Word First Localization Key",
|
|
35
|
+
"description": "Key for the first linked word.",
|
|
36
|
+
"category": "other",
|
|
37
|
+
"specialCategory": null,
|
|
38
|
+
"sort": 2
|
|
39
|
+
},
|
|
40
|
+
"linkedWordFirstColor": {
|
|
41
|
+
"label": "Linked Word First Color",
|
|
42
|
+
"description": "Color of the first linked word.",
|
|
43
|
+
"category": "style",
|
|
44
|
+
"specialCategory": null,
|
|
45
|
+
"sort": 3
|
|
46
|
+
},
|
|
47
|
+
"linkedWordFirstPage": {
|
|
48
|
+
"label": "Linked Word First Page",
|
|
49
|
+
"description": "Page opened by the first link.",
|
|
50
|
+
"category": "other",
|
|
51
|
+
"specialCategory": null,
|
|
52
|
+
"sort": 4
|
|
53
|
+
},
|
|
54
|
+
"linkedWordSecondLocalizationKey": {
|
|
55
|
+
"label": "Linked Word Second Localization Key",
|
|
56
|
+
"description": "Key for the second linked word.",
|
|
57
|
+
"category": "other",
|
|
58
|
+
"specialCategory": null,
|
|
59
|
+
"sort": 5
|
|
60
|
+
},
|
|
61
|
+
"linkedWordSecondColor": {
|
|
62
|
+
"label": "Linked Word Second Color",
|
|
63
|
+
"description": "Color of the second linked word.",
|
|
64
|
+
"category": "style",
|
|
65
|
+
"specialCategory": null,
|
|
66
|
+
"sort": 6
|
|
67
|
+
},
|
|
68
|
+
"linkedWordSecondPage": {
|
|
69
|
+
"label": "Linked Word Second Page",
|
|
70
|
+
"description": "Page opened by the second link.",
|
|
71
|
+
"category": "other",
|
|
72
|
+
"specialCategory": null,
|
|
73
|
+
"sort": 7
|
|
74
|
+
}
|
|
75
|
+
}
|
|
20
76
|
}
|
|
21
77
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import type { OnboardImageComponentProps } from './OnboardImageProps.generated';
|
|
3
3
|
import Image from '../Image/Image';
|
|
4
4
|
import useNode from '../useNode';
|
|
5
5
|
import Lottie from 'lottie-react';
|
|
6
|
+
import { useLogRender } from '../../utils/useLogRender';
|
|
7
|
+
import { extractViewStyle } from '../../utils/extractViewStyle';
|
|
6
8
|
|
|
7
9
|
function OnboardImage({ node }: OnboardImageComponentProps) {
|
|
10
|
+
useLogRender('OnboardImage');
|
|
8
11
|
node = useNode(node);
|
|
12
|
+
const attributeKey = (node as any)?.sourceType ?? node.type ?? 'OnboardImage';
|
|
9
13
|
const [lottie, setLottie] = useState<string | null>(null);
|
|
14
|
+
const viewStyle = useMemo(() => extractViewStyle(node), [node]);
|
|
10
15
|
|
|
11
16
|
useEffect(() => {
|
|
12
17
|
if (node.attributes?.lottie) {
|
|
@@ -17,18 +22,37 @@ function OnboardImage({ node }: OnboardImageComponentProps) {
|
|
|
17
22
|
}, [node.attributes?.lottie]);
|
|
18
23
|
|
|
19
24
|
if (node.attributes?.video_url) {
|
|
20
|
-
return
|
|
25
|
+
return (
|
|
26
|
+
<video
|
|
27
|
+
attribute-key={attributeKey}
|
|
28
|
+
autoPlay
|
|
29
|
+
muted
|
|
30
|
+
loop
|
|
31
|
+
src={node.attributes?.video_url}
|
|
32
|
+
style={viewStyle}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
21
35
|
}
|
|
22
36
|
|
|
23
37
|
if (node.attributes?.lottie) {
|
|
24
38
|
if (lottie) {
|
|
25
|
-
return
|
|
39
|
+
return (
|
|
40
|
+
<div attribute-key={attributeKey} style={viewStyle}>
|
|
41
|
+
<Lottie animationData={lottie} />
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
26
44
|
} else {
|
|
27
|
-
return
|
|
45
|
+
return (
|
|
46
|
+
<div attribute-key={attributeKey} style={viewStyle}>
|
|
47
|
+
Loading...
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
28
50
|
}
|
|
29
51
|
}
|
|
30
52
|
|
|
31
|
-
return
|
|
53
|
+
return (
|
|
54
|
+
<Image node={{ ...node, type: 'image', sourceType: attributeKey } as any} />
|
|
55
|
+
);
|
|
32
56
|
}
|
|
33
57
|
|
|
34
58
|
export default React.memo(OnboardImage);
|
|
@@ -3,15 +3,48 @@
|
|
|
3
3
|
import type { NodeData } from '../../types/Node';
|
|
4
4
|
|
|
5
5
|
export type ResizeModeOptionType = 'cover' | 'contain' | 'stretch' | 'center';
|
|
6
|
+
export type FlexDirectionOptionType = 'row' | 'column';
|
|
7
|
+
export type AlignItemsOptionType =
|
|
8
|
+
| 'flex-start'
|
|
9
|
+
| 'center'
|
|
10
|
+
| 'flex-end'
|
|
11
|
+
| 'stretch'
|
|
12
|
+
| 'baseline';
|
|
13
|
+
export type JustifyContentOptionType =
|
|
14
|
+
| 'flex-start'
|
|
15
|
+
| 'center'
|
|
16
|
+
| 'flex-end'
|
|
17
|
+
| 'space-between'
|
|
18
|
+
| 'space-around'
|
|
19
|
+
| 'space-evenly';
|
|
6
20
|
|
|
7
21
|
export interface OnboardImagePropsGenerated {
|
|
8
22
|
child: string;
|
|
9
23
|
attributes: {
|
|
10
24
|
src?: string;
|
|
11
|
-
width?:
|
|
12
|
-
height?:
|
|
25
|
+
width?: string;
|
|
26
|
+
height?: string;
|
|
13
27
|
resizeMode?: ResizeModeOptionType;
|
|
14
|
-
borderRadius?:
|
|
28
|
+
borderRadius?: string;
|
|
29
|
+
scrollable?: boolean;
|
|
30
|
+
flexDirection?: FlexDirectionOptionType;
|
|
31
|
+
alignItems?: AlignItemsOptionType;
|
|
32
|
+
justifyContent?: JustifyContentOptionType;
|
|
33
|
+
gap?: string;
|
|
34
|
+
padding?: string;
|
|
35
|
+
paddingHorizontal?: string;
|
|
36
|
+
paddingVertical?: string;
|
|
37
|
+
paddingTop?: string;
|
|
38
|
+
paddingBottom?: string;
|
|
39
|
+
paddingLeft?: string;
|
|
40
|
+
paddingRight?: string;
|
|
41
|
+
margin?: string;
|
|
42
|
+
marginVertical?: string;
|
|
43
|
+
marginTop?: string;
|
|
44
|
+
marginBottom?: string;
|
|
45
|
+
marginLeft?: string;
|
|
46
|
+
marginRight?: string;
|
|
47
|
+
backgroundColor?: string;
|
|
15
48
|
video_url?: string;
|
|
16
49
|
lottie?: string;
|
|
17
50
|
};
|
|
@@ -9,5 +9,26 @@
|
|
|
9
9
|
"video_url": "string",
|
|
10
10
|
"lottie": "string"
|
|
11
11
|
}
|
|
12
|
+
},
|
|
13
|
+
"meta": {
|
|
14
|
+
"desiredParent": [">OnboardProvider", ">OnboardItem", "!=Onboard"],
|
|
15
|
+
"label": "Onboard Image",
|
|
16
|
+
"description": "Onboarding hero image with media.",
|
|
17
|
+
"attributes": {
|
|
18
|
+
"video_url": {
|
|
19
|
+
"label": "Video Url",
|
|
20
|
+
"description": "URL for the onboarding video.",
|
|
21
|
+
"category": "other",
|
|
22
|
+
"specialCategory": null,
|
|
23
|
+
"sort": 1
|
|
24
|
+
},
|
|
25
|
+
"lottie": {
|
|
26
|
+
"label": "Lottie",
|
|
27
|
+
"description": "Path to the lottie animation.",
|
|
28
|
+
"category": "other",
|
|
29
|
+
"specialCategory": null,
|
|
30
|
+
"sort": 2
|
|
31
|
+
}
|
|
32
|
+
}
|
|
12
33
|
}
|
|
13
34
|
}
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import type { OnboardItemComponentProps } from './OnboardItemProps.generated';
|
|
3
3
|
import useNode from '../useNode';
|
|
4
4
|
import { RenderNode } from '../..';
|
|
5
5
|
import { parseSize } from '../../size-matters';
|
|
6
|
+
import { useLogRender } from '../../utils/useLogRender';
|
|
7
|
+
import { extractViewStyle } from '../../utils/extractViewStyle';
|
|
6
8
|
|
|
7
9
|
function OnboardItem({ node }: OnboardItemComponentProps) {
|
|
10
|
+
useLogRender('OnboardItem');
|
|
8
11
|
node = useNode(node);
|
|
12
|
+
const attributeKey = (node as any)?.sourceType ?? node.type ?? 'OnboardItem';
|
|
9
13
|
const flexDirection = node.attributes?.flexDirection;
|
|
10
14
|
const display = node.attributes?.display;
|
|
11
15
|
const paddingHorizontal = parseSize(node.attributes?.paddingHorizontal);
|
|
16
|
+
const viewStyle = useMemo(() => extractViewStyle(node), [node]);
|
|
12
17
|
return (
|
|
13
18
|
<div
|
|
19
|
+
attribute-key={attributeKey}
|
|
14
20
|
className="embla__slide"
|
|
15
21
|
style={{
|
|
22
|
+
...viewStyle,
|
|
16
23
|
gap: parseSize(node.attributes?.gap),
|
|
17
24
|
flexDirection,
|
|
18
25
|
display,
|
|
@@ -2,16 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
import type { NodeData } from '../../types/Node';
|
|
4
4
|
|
|
5
|
-
export type DisplayOptionType = 'flex' | 'block';
|
|
6
5
|
export type FlexDirectionOptionType = 'row' | 'column';
|
|
6
|
+
export type AlignItemsOptionType =
|
|
7
|
+
| 'flex-start'
|
|
8
|
+
| 'center'
|
|
9
|
+
| 'flex-end'
|
|
10
|
+
| 'stretch'
|
|
11
|
+
| 'baseline';
|
|
12
|
+
export type JustifyContentOptionType =
|
|
13
|
+
| 'flex-start'
|
|
14
|
+
| 'center'
|
|
15
|
+
| 'flex-end'
|
|
16
|
+
| 'space-between'
|
|
17
|
+
| 'space-around'
|
|
18
|
+
| 'space-evenly';
|
|
19
|
+
export type DisplayOptionType = 'flex' | 'block';
|
|
7
20
|
|
|
8
21
|
export interface OnboardItemPropsGenerated {
|
|
9
22
|
child: string;
|
|
10
23
|
attributes: {
|
|
11
|
-
|
|
12
|
-
gap?: string;
|
|
24
|
+
scrollable?: boolean;
|
|
13
25
|
flexDirection?: FlexDirectionOptionType;
|
|
26
|
+
alignItems?: AlignItemsOptionType;
|
|
27
|
+
justifyContent?: JustifyContentOptionType;
|
|
28
|
+
gap?: string;
|
|
29
|
+
padding?: string;
|
|
14
30
|
paddingHorizontal?: string;
|
|
31
|
+
paddingVertical?: string;
|
|
32
|
+
paddingTop?: string;
|
|
33
|
+
paddingBottom?: string;
|
|
34
|
+
paddingLeft?: string;
|
|
35
|
+
paddingRight?: string;
|
|
36
|
+
margin?: string;
|
|
37
|
+
marginVertical?: string;
|
|
38
|
+
marginTop?: string;
|
|
39
|
+
marginBottom?: string;
|
|
40
|
+
marginLeft?: string;
|
|
41
|
+
marginRight?: string;
|
|
42
|
+
backgroundColor?: string;
|
|
43
|
+
borderRadius?: string;
|
|
44
|
+
width?: string;
|
|
45
|
+
height?: string;
|
|
46
|
+
display?: DisplayOptionType;
|
|
15
47
|
};
|
|
16
48
|
}
|
|
17
49
|
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
"pattern": {
|
|
5
5
|
"type": "OnboardItem",
|
|
6
6
|
"children": "node",
|
|
7
|
+
"extends": "View",
|
|
7
8
|
"attributes": {
|
|
8
9
|
"display": ["flex", "block"],
|
|
9
|
-
"gap": "
|
|
10
|
+
"gap": "size",
|
|
10
11
|
"flexDirection": ["row", "column"],
|
|
11
|
-
"paddingHorizontal": "
|
|
12
|
+
"paddingHorizontal": "size"
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
"defaults": {
|
|
@@ -16,5 +17,40 @@
|
|
|
16
17
|
"display": "flex",
|
|
17
18
|
"flexDirection": "column",
|
|
18
19
|
"paddingHorizontal": "24@s"
|
|
20
|
+
},
|
|
21
|
+
"meta": {
|
|
22
|
+
"desiredParent": ["=Onboard"],
|
|
23
|
+
"label": "Onboard Item",
|
|
24
|
+
"description": "Single onboarding screen section.",
|
|
25
|
+
"attributes": {
|
|
26
|
+
"display": {
|
|
27
|
+
"label": "Display",
|
|
28
|
+
"description": "Controls layout display mode.",
|
|
29
|
+
"category": "container",
|
|
30
|
+
"specialCategory": null,
|
|
31
|
+
"sort": 1
|
|
32
|
+
},
|
|
33
|
+
"gap": {
|
|
34
|
+
"label": "Gap",
|
|
35
|
+
"description": "Space between child blocks.",
|
|
36
|
+
"category": "container",
|
|
37
|
+
"specialCategory": null,
|
|
38
|
+
"sort": 2
|
|
39
|
+
},
|
|
40
|
+
"flexDirection": {
|
|
41
|
+
"label": "Flex Direction",
|
|
42
|
+
"description": "Order of child stacking.",
|
|
43
|
+
"category": "container",
|
|
44
|
+
"specialCategory": null,
|
|
45
|
+
"sort": 3
|
|
46
|
+
},
|
|
47
|
+
"paddingHorizontal": {
|
|
48
|
+
"label": "Padding Horizontal",
|
|
49
|
+
"description": "Left and right padding.",
|
|
50
|
+
"category": "container",
|
|
51
|
+
"specialCategory": "padding",
|
|
52
|
+
"sort": 4
|
|
53
|
+
}
|
|
54
|
+
}
|
|
19
55
|
}
|
|
20
56
|
}
|
|
@@ -11,10 +11,16 @@ import useEmblaCarousel from 'embla-carousel-react';
|
|
|
11
11
|
import RenderNode from '../RenderNode.generated';
|
|
12
12
|
import { useRenderStore } from '../../store';
|
|
13
13
|
import useNode from '../useNode';
|
|
14
|
+
import { useLogRender } from '../../utils/useLogRender';
|
|
15
|
+
import { extractViewStyle } from '../../utils/extractViewStyle';
|
|
16
|
+
import { ViewPropsGenerated } from '../View/ViewProps.generated';
|
|
14
17
|
|
|
15
18
|
export const onboardContext = createContext<any>(undefined);
|
|
16
19
|
function OnboardProvider({ node }: OnboardProviderComponentProps) {
|
|
20
|
+
useLogRender('OnboardProvider');
|
|
17
21
|
node = useNode(node);
|
|
22
|
+
const attributeKey =
|
|
23
|
+
(node as any)?.sourceType ?? node.type ?? 'OnboardProvider';
|
|
18
24
|
const device = useRenderStore((s) => s.device);
|
|
19
25
|
const [emblaRef, emblaApi] = useEmblaCarousel(node.attributes as any);
|
|
20
26
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
@@ -49,19 +55,27 @@ function OnboardProvider({ node }: OnboardProviderComponentProps) {
|
|
|
49
55
|
}
|
|
50
56
|
}, [theme]);*/
|
|
51
57
|
|
|
58
|
+
//TODO: pattern içinde direk gömmek yerine orada da inhertince eklenebilir
|
|
59
|
+
const viewStyle = useMemo(() => {
|
|
60
|
+
const style = extractViewStyle(
|
|
61
|
+
node as NodeData<ViewPropsGenerated['attributes']>,
|
|
62
|
+
);
|
|
63
|
+
//NOTE: Embla için istisna
|
|
64
|
+
style.display = 'block';
|
|
65
|
+
return style;
|
|
66
|
+
}, [node]);
|
|
67
|
+
|
|
52
68
|
return (
|
|
53
69
|
<onboardContext.Provider value={{ emblaApi, selectedIndex }}>
|
|
54
70
|
<div
|
|
71
|
+
attribute-key={attributeKey}
|
|
55
72
|
className="carousel-provider"
|
|
56
73
|
style={{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
paddingRight:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
device?.insets?.[2] + (node.attributes as any)?.paddingBottom,
|
|
63
|
-
paddingLeft:
|
|
64
|
-
device?.insets?.[3] + (node.attributes as any)?.paddingLeft,
|
|
74
|
+
...viewStyle,
|
|
75
|
+
paddingTop: node.attributes?.paddingTop,
|
|
76
|
+
paddingRight: node.attributes?.paddingRight,
|
|
77
|
+
paddingBottom: node.attributes?.paddingBottom,
|
|
78
|
+
paddingLeft: node.attributes?.paddingLeft,
|
|
65
79
|
}}
|
|
66
80
|
>
|
|
67
81
|
<div className="embla">
|
|
@@ -2,15 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
import type { NodeData } from '../../types/Node';
|
|
4
4
|
|
|
5
|
+
export type FlexDirectionOptionType = 'row' | 'column';
|
|
6
|
+
export type AlignItemsOptionType =
|
|
7
|
+
| 'flex-start'
|
|
8
|
+
| 'center'
|
|
9
|
+
| 'flex-end'
|
|
10
|
+
| 'stretch'
|
|
11
|
+
| 'baseline';
|
|
12
|
+
export type JustifyContentOptionType =
|
|
13
|
+
| 'flex-start'
|
|
14
|
+
| 'center'
|
|
15
|
+
| 'flex-end'
|
|
16
|
+
| 'space-between'
|
|
17
|
+
| 'space-around'
|
|
18
|
+
| 'space-evenly';
|
|
19
|
+
|
|
5
20
|
export interface OnboardProviderPropsGenerated {
|
|
6
21
|
child: string;
|
|
7
22
|
attributes: {
|
|
23
|
+
scrollable?: boolean;
|
|
24
|
+
flexDirection?: FlexDirectionOptionType;
|
|
25
|
+
alignItems?: AlignItemsOptionType;
|
|
26
|
+
justifyContent?: JustifyContentOptionType;
|
|
27
|
+
gap?: string;
|
|
28
|
+
padding?: string;
|
|
29
|
+
paddingHorizontal?: string;
|
|
30
|
+
paddingVertical?: string;
|
|
31
|
+
paddingTop?: string;
|
|
32
|
+
paddingBottom?: string;
|
|
33
|
+
paddingLeft?: string;
|
|
34
|
+
paddingRight?: string;
|
|
35
|
+
margin?: string;
|
|
36
|
+
marginVertical?: string;
|
|
37
|
+
marginTop?: string;
|
|
38
|
+
marginBottom?: string;
|
|
39
|
+
marginLeft?: string;
|
|
40
|
+
marginRight?: string;
|
|
41
|
+
backgroundColor?: string;
|
|
42
|
+
borderRadius?: never;
|
|
43
|
+
width?: string;
|
|
44
|
+
height?: string;
|
|
8
45
|
theme?: string;
|
|
9
46
|
use_safe_area_inset?: boolean;
|
|
10
|
-
paddingTop?: number;
|
|
11
|
-
paddingRight?: number;
|
|
12
|
-
paddingBottom?: number;
|
|
13
|
-
paddingLeft?: number;
|
|
14
47
|
};
|
|
15
48
|
}
|
|
16
49
|
|
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
"pattern": {
|
|
5
5
|
"type": "OnboardProvider",
|
|
6
6
|
"children": "node",
|
|
7
|
+
"extends": "View",
|
|
7
8
|
"attributes": {
|
|
8
9
|
"theme": "string",
|
|
9
10
|
"use_safe_area_inset": "boolean",
|
|
10
|
-
"
|
|
11
|
-
"paddingRight": "number",
|
|
12
|
-
"paddingBottom": "number",
|
|
13
|
-
"paddingLeft": "number"
|
|
11
|
+
"borderRadius": "never"
|
|
14
12
|
}
|
|
15
13
|
},
|
|
16
14
|
"defaults": {
|
|
@@ -18,5 +16,54 @@
|
|
|
18
16
|
"paddingRight": 0,
|
|
19
17
|
"paddingBottom": 8,
|
|
20
18
|
"paddingLeft": 0
|
|
19
|
+
},
|
|
20
|
+
"meta": {
|
|
21
|
+
"desiredParent": ["root"],
|
|
22
|
+
"label": "Onboard Provider",
|
|
23
|
+
"description": "Provides shared settings for onboarding.",
|
|
24
|
+
"attributes": {
|
|
25
|
+
"theme": {
|
|
26
|
+
"label": "Theme",
|
|
27
|
+
"description": "Theme key for onboarding screens.",
|
|
28
|
+
"category": "other",
|
|
29
|
+
"specialCategory": null,
|
|
30
|
+
"sort": 1
|
|
31
|
+
},
|
|
32
|
+
"use_safe_area_inset": {
|
|
33
|
+
"label": "Use Safe Area Inset",
|
|
34
|
+
"description": "Adds safe area padding.",
|
|
35
|
+
"category": "container",
|
|
36
|
+
"specialCategory": null,
|
|
37
|
+
"sort": 2
|
|
38
|
+
},
|
|
39
|
+
"paddingTop": {
|
|
40
|
+
"label": "Padding Top",
|
|
41
|
+
"description": "Top padding for the provider.",
|
|
42
|
+
"category": "container",
|
|
43
|
+
"specialCategory": "padding",
|
|
44
|
+
"sort": 3
|
|
45
|
+
},
|
|
46
|
+
"paddingRight": {
|
|
47
|
+
"label": "Padding Right",
|
|
48
|
+
"description": "Right padding for the provider.",
|
|
49
|
+
"category": "container",
|
|
50
|
+
"specialCategory": "padding",
|
|
51
|
+
"sort": 4
|
|
52
|
+
},
|
|
53
|
+
"paddingBottom": {
|
|
54
|
+
"label": "Padding Bottom",
|
|
55
|
+
"description": "Bottom padding for the provider.",
|
|
56
|
+
"category": "container",
|
|
57
|
+
"specialCategory": "padding",
|
|
58
|
+
"sort": 5
|
|
59
|
+
},
|
|
60
|
+
"paddingLeft": {
|
|
61
|
+
"label": "Padding Left",
|
|
62
|
+
"description": "Left padding for the provider.",
|
|
63
|
+
"category": "container",
|
|
64
|
+
"specialCategory": "padding",
|
|
65
|
+
"sort": 6
|
|
66
|
+
}
|
|
67
|
+
}
|
|
21
68
|
}
|
|
22
69
|
}
|