@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
package/src/DeviceMockFrame.tsx
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useRenderStore } from './store';
|
|
3
|
+
import { useLogRender } from './utils/useLogRender';
|
|
4
|
+
import { DeviceStatusBar } from './components/DeviceStatusBar';
|
|
5
|
+
import { DeviceNavigationBar } from './components/DeviceNavigationBar';
|
|
6
|
+
import { MockOSProvider } from './mockOS';
|
|
3
7
|
|
|
4
8
|
type DeviceMockFrameProps = {
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
isRtl: boolean;
|
|
8
|
-
screenStyle: {
|
|
9
|
-
light: { backgroundColor: string; color: string };
|
|
10
|
-
dark: { backgroundColor: string; color: string };
|
|
11
|
-
};
|
|
12
|
-
theme: 'dark' | 'light';
|
|
13
9
|
children: React.ReactNode;
|
|
14
|
-
|
|
10
|
+
appName?: string;
|
|
15
11
|
};
|
|
16
12
|
|
|
17
|
-
export function DeviceMockFrame({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
device,
|
|
25
|
-
}: DeviceMockFrameProps) {
|
|
26
|
-
const isDark = theme === 'dark';
|
|
13
|
+
export function DeviceMockFrame({ children, appName }: DeviceMockFrameProps) {
|
|
14
|
+
useLogRender('DeviceMockFrame');
|
|
15
|
+
const { appConfig, device } = useRenderStore((s) => ({
|
|
16
|
+
appConfig: s.appConfig,
|
|
17
|
+
device: s.device,
|
|
18
|
+
}));
|
|
19
|
+
const isDark = appConfig.theme === 'dark';
|
|
27
20
|
const [insetTop, insetRight, insetBottom, insetLeft] = device.insets ?? [
|
|
28
21
|
0, 0, 0, 0,
|
|
29
22
|
];
|
|
@@ -46,71 +39,53 @@ export function DeviceMockFrame({
|
|
|
46
39
|
return insetBottom || 0;
|
|
47
40
|
}
|
|
48
41
|
})();
|
|
49
|
-
const statusBarColor = isDark
|
|
50
|
-
|
|
51
|
-
: 'rgba(0, 0, 0, 0.06)';
|
|
52
|
-
const navBarColor = isDark
|
|
53
|
-
? 'rgba(255, 255, 255, 0.06)'
|
|
54
|
-
: 'rgba(0, 0, 0, 0.04)';
|
|
42
|
+
const statusBarColor = isDark ? 'rgb(0, 0, 0)' : 'rgb(255, 255, 255)';
|
|
43
|
+
const navBarColor = isDark ? 'rgb(0, 0, 0)' : 'rgb(255, 255, 255)';
|
|
55
44
|
|
|
56
45
|
return (
|
|
57
46
|
<div className="stage-wrapper" style={{ overflow: 'auto' }}>
|
|
58
47
|
<div
|
|
59
48
|
className="stage"
|
|
60
49
|
style={{
|
|
61
|
-
width: width,
|
|
62
|
-
height: height,
|
|
63
|
-
minWidth: width,
|
|
64
|
-
maxWidth: width,
|
|
65
|
-
minHeight: height,
|
|
66
|
-
maxHeight: height,
|
|
50
|
+
width: device.width,
|
|
51
|
+
height: device.height,
|
|
52
|
+
minWidth: device.width,
|
|
53
|
+
maxWidth: device.width,
|
|
54
|
+
minHeight: device.height,
|
|
55
|
+
maxHeight: device.height,
|
|
67
56
|
overflow: 'hidden',
|
|
68
57
|
position: 'relative',
|
|
69
58
|
padding: 4,
|
|
70
|
-
direction: isRtl ? 'rtl' : 'ltr',
|
|
59
|
+
direction: appConfig.isRtl ? 'rtl' : 'ltr',
|
|
71
60
|
backgroundColor:
|
|
72
|
-
theme === 'dark'
|
|
73
|
-
? screenStyle.dark.backgroundColor
|
|
74
|
-
: screenStyle.light.backgroundColor,
|
|
61
|
+
appConfig.theme === 'dark'
|
|
62
|
+
? appConfig.screenStyle.dark.backgroundColor
|
|
63
|
+
: appConfig.screenStyle.light.backgroundColor,
|
|
75
64
|
color:
|
|
76
|
-
theme === 'dark'
|
|
65
|
+
appConfig.theme === 'dark'
|
|
66
|
+
? appConfig.screenStyle.dark.color
|
|
67
|
+
: appConfig.screenStyle.light.color,
|
|
77
68
|
display: 'flex',
|
|
78
69
|
flexDirection: 'column',
|
|
79
70
|
borderRadius: device.radius ?? 0,
|
|
80
71
|
}}
|
|
81
72
|
>
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
className="device-content"
|
|
96
|
-
style={{
|
|
97
|
-
flex: 1,
|
|
98
|
-
overflow: 'hidden',
|
|
99
|
-
position: 'relative',
|
|
100
|
-
paddingLeft: insetLeft,
|
|
101
|
-
paddingRight: insetRight,
|
|
102
|
-
}}
|
|
73
|
+
<MockOSProvider
|
|
74
|
+
appName={appName}
|
|
75
|
+
statusBarHeight={statusBarHeight}
|
|
76
|
+
statusBarBackgroundColor={statusBarColor}
|
|
77
|
+
statusBarPlatform={device.platform}
|
|
78
|
+
statusBarIsDark={isDark}
|
|
79
|
+
navBarHeight={navBarHeight}
|
|
80
|
+
navBarBackgroundColor={navBarColor}
|
|
81
|
+
navBarPlatform={device.platform}
|
|
82
|
+
navBarNavigationBarType={device.navigationBarType}
|
|
83
|
+
navBarIsDark={isDark}
|
|
84
|
+
insetLeft={insetLeft}
|
|
85
|
+
insetRight={insetRight}
|
|
103
86
|
>
|
|
104
87
|
{children}
|
|
105
|
-
</
|
|
106
|
-
<div
|
|
107
|
-
className="device-navigation-bar"
|
|
108
|
-
style={{
|
|
109
|
-
height: navBarHeight,
|
|
110
|
-
backgroundColor: navBarColor,
|
|
111
|
-
flex: '0 0 auto',
|
|
112
|
-
}}
|
|
113
|
-
/>
|
|
88
|
+
</MockOSProvider>
|
|
114
89
|
</div>
|
|
115
90
|
</div>
|
|
116
91
|
);
|
package/src/RenderPage.tsx
CHANGED
|
@@ -1,33 +1,19 @@
|
|
|
1
|
-
import { Localication } from './types/PreviewConfig';
|
|
2
|
-
import { TargetedScreenSize } from './types/TargetedScreenSize';
|
|
3
1
|
import { DeviceMockFrame } from './DeviceMockFrame';
|
|
4
2
|
import { Node } from './types/Node';
|
|
5
3
|
import { RenderNode } from './build-components';
|
|
6
|
-
import { Device } from './types/Device';
|
|
7
|
-
import { useEffect } from 'react';
|
|
8
4
|
import { useRenderStore } from './store';
|
|
5
|
+
import { useLogRender } from './utils/useLogRender';
|
|
9
6
|
export type ScreenStyle = {
|
|
10
7
|
light: { backgroundColor: string; color: string; seperatorColor?: string };
|
|
11
8
|
dark: { backgroundColor: string; color: string; seperatorColor?: string };
|
|
12
9
|
};
|
|
13
|
-
|
|
10
|
+
interface RenderPageProps {
|
|
14
11
|
data: Node;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
device: Device;
|
|
21
|
-
};
|
|
22
|
-
export function RenderPage({
|
|
23
|
-
data,
|
|
24
|
-
theme,
|
|
25
|
-
isRtl,
|
|
26
|
-
screenStyle,
|
|
27
|
-
localication,
|
|
28
|
-
defaultLanguage,
|
|
29
|
-
device,
|
|
30
|
-
}: RenderPageProps) {
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
export function RenderPage({ data, name }: RenderPageProps) {
|
|
15
|
+
useLogRender('RenderPage');
|
|
16
|
+
const { device } = useRenderStore((s) => ({ device: s.device }));
|
|
31
17
|
const screenPreviewHeight = 800;
|
|
32
18
|
// The calculation is correct for maintaining the aspect ratio of the target screen size.
|
|
33
19
|
// It scales the width proportionally to a fixed preview height.
|
|
@@ -35,30 +21,8 @@ export function RenderPage({
|
|
|
35
21
|
const height = screenPreviewHeight;
|
|
36
22
|
const width = (height * device.width) / device.height;
|
|
37
23
|
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
const {
|
|
40
|
-
setDevice,
|
|
41
|
-
setLocalication,
|
|
42
|
-
setDefaultLanguage,
|
|
43
|
-
setTheme,
|
|
44
|
-
setScreenStyle,
|
|
45
|
-
} = useRenderStore.getState();
|
|
46
|
-
setDevice(device);
|
|
47
|
-
setLocalication(localication);
|
|
48
|
-
setDefaultLanguage(defaultLanguage);
|
|
49
|
-
setTheme(theme);
|
|
50
|
-
setScreenStyle(screenStyle);
|
|
51
|
-
}, [device, localication, defaultLanguage, theme, screenStyle]);
|
|
52
|
-
|
|
53
24
|
return (
|
|
54
|
-
<DeviceMockFrame
|
|
55
|
-
width={width}
|
|
56
|
-
height={height}
|
|
57
|
-
isRtl={isRtl}
|
|
58
|
-
screenStyle={screenStyle}
|
|
59
|
-
theme={theme}
|
|
60
|
-
device={device}
|
|
61
|
-
>
|
|
25
|
+
<DeviceMockFrame appName={name}>
|
|
62
26
|
<RenderNode node={data} />
|
|
63
27
|
</DeviceMockFrame>
|
|
64
28
|
);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
3
|
+
<svg height="800px" width="800px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
4
|
+
viewBox="0 0 502.857 502.857" xml:space="preserve">
|
|
5
|
+
<g>
|
|
6
|
+
<path style="fill:#57C927;" d="M115.428,155.433v217.664c0,17,10.208,30.336,27.704,30.336h22.84c-0.784,0-2.544,5.768-2.544,8.6
|
|
7
|
+
v61.648c0,16.112,15.448,29.176,32,29.176c16.56,0,32-13.064,32-29.176v-61.648c0-2.832-3.088-8.6-3.848-8.6h55.712
|
|
8
|
+
c-0.76,0-3.864,5.768-3.864,8.6v61.648c0,16.112,15.416,29.176,31.968,29.176c16.592,0,32.032-13.064,32.032-29.176v-61.648
|
|
9
|
+
c0-2.832-1.752-8.6-2.536-8.6h22.872c17.496,0,27.664-13.336,27.664-30.336V155.433H113.596H115.428z"/>
|
|
10
|
+
<path style="fill:#57C927;" d="M59.428,158.977c-16.568,0-32,13.072-32,29.176v124.92c0,16.112,15.432,29.176,32,29.176
|
|
11
|
+
c16.56,0,32-13.064,32-29.176V188.161C91.428,172.049,75.988,158.977,59.428,158.977z"/>
|
|
12
|
+
<path style="fill:#57C927;" d="M320.3,42.057l5.584-8.192l5.592-8.096l12.456-18.2c1.56-2.256,0.912-5.264-1.384-6.744
|
|
13
|
+
c-2.272-1.512-5.416-0.88-6.904,1.36l-19.016,27.704l-5.72,8.344c-18.072-6.832-38.208-10.64-59.48-10.64
|
|
14
|
+
c-21.224,0-41.4,3.816-59.472,10.64l-5.688-8.336l-5.624-8.184l-13.36-19.512c-1.544-2.248-4.648-2.84-6.952-1.36
|
|
15
|
+
c-2.28,1.488-2.912,4.496-1.392,6.744l12.448,18.208l5.592,8.104l5.616,8.168c-42.432,19.24-71.144,57.368-71.144,97.368h279.96
|
|
16
|
+
C391.412,99.433,362.708,61.305,320.3,42.057z M191.436,100.593c-8.312,0-15.008-6.536-15.008-14.608s6.696-14.576,15.008-14.576
|
|
17
|
+
c8.288,0,15,6.504,15,14.576S199.732,100.593,191.436,100.593z M311.436,100.593c-8.304,0-15.016-6.536-15.016-14.608
|
|
18
|
+
s6.712-14.576,15.016-14.576c8.288,0,15,6.504,15,14.576S319.724,100.593,311.436,100.593z"/>
|
|
19
|
+
</g>
|
|
20
|
+
<path style="fill:#1CB71C;" d="M60.852,224.193c-12.472,0-25.424-11.768-33.424-30.432v119.32c0,16.112,15.432,29.176,32,29.176
|
|
21
|
+
c16.56,0,32-13.064,32-29.176V199.985C83.428,214.977,71.86,224.193,60.852,224.193z"/>
|
|
22
|
+
<path style="fill:#57C927;" d="M443.428,158.977c-16.568,0-32,13.072-32,29.176v124.92c0,16.112,15.432,29.176,32,29.176
|
|
23
|
+
c16.56,0,32-13.064,32-29.176V188.161C475.428,172.049,459.988,158.977,443.428,158.977z"/>
|
|
24
|
+
<g>
|
|
25
|
+
<path style="fill:#1CB71C;" d="M444.852,224.193c-12.472,0-25.424-11.768-33.424-30.432v119.32c0,16.112,15.432,29.176,32,29.176
|
|
26
|
+
c16.56,0,32-13.064,32-29.176V199.985C467.428,214.977,455.86,224.193,444.852,224.193z"/>
|
|
27
|
+
<path style="fill:#1CB71C;" d="M251.428,179.337c-63.28,0-120-7.32-136-17.712v211.472c0,17,10.208,30.336,27.704,30.336h22.84
|
|
28
|
+
c-0.784,0-2.544,5.768-2.544,8.6v61.648c0,16.112,15.448,29.176,32,29.176c16.56,0,32-13.064,32-29.176v-61.648
|
|
29
|
+
c0-2.832-3.088-8.6-3.848-8.6h55.712c-0.76,0-3.864,5.768-3.864,8.6v61.648c0,16.112,15.416,29.176,31.968,29.176
|
|
30
|
+
c16.592,0,32.032-13.064,32.032-29.176v-61.648c0-2.832-1.752-8.6-2.536-8.6h22.872c17.496,0,27.664-13.336,27.664-30.336v-211.48
|
|
31
|
+
C371.428,172.009,314.716,179.337,251.428,179.337z"/>
|
|
32
|
+
<path style="fill:#1CB71C;" d="M326.436,85.977c0,8.072-6.712,14.608-15,14.608c-8.304,0-15.016-6.536-15.016-14.608
|
|
33
|
+
c0-4.376,2.008-8.24,5.136-10.912c-15.816-2.64-32.64-4.088-50.128-4.088s-34.304,1.448-50.128,4.088
|
|
34
|
+
c3.136,2.664,5.144,6.536,5.144,10.912c0,8.072-6.712,14.608-15,14.608c-8.312,0-15.008-6.536-15.008-14.608
|
|
35
|
+
c0-2.064,0.456-4.024,1.248-5.808c-23.984,6.304-44.592,15.504-60.144,26.808c-3.92,10.296-6.088,24.456-6.088,32.456h279.96
|
|
36
|
+
c0-8-2.168-22.152-6.08-32.44c-15.544-11.32-36.16-20.536-60.128-26.84C325.988,81.937,326.436,83.921,326.436,85.977z"/>
|
|
37
|
+
</g>
|
|
38
|
+
<path style="fill:#049E42;" d="M251.428,262.817c-53.896,0-104-10.632-136-28.056v138.336c0,17,10.208,30.336,27.704,30.336h22.84
|
|
39
|
+
c-0.784,0-2.544,5.768-2.544,8.6v61.648c0,16.112,15.448,29.176,32,29.176c16.56,0,32-13.064,32-29.176v-61.648
|
|
40
|
+
c0-2.832-3.088-8.6-3.848-8.6h55.712c-0.76,0-3.864,5.768-3.864,8.6v61.648c0,16.112,15.416,29.176,31.968,29.176
|
|
41
|
+
c16.592,0,32.032-13.064,32.032-29.176v-61.648c0-2.832-1.752-8.6-2.536-8.6h22.872c17.496,0,27.664-13.336,27.664-30.336V234.761
|
|
42
|
+
C355.428,252.193,305.324,262.817,251.428,262.817z"/>
|
|
43
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
3
|
+
<svg height="800px" width="800px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
4
|
+
viewBox="0 0 496.412 496.412" xml:space="preserve">
|
|
5
|
+
<path d="M317.222,80.584C333.414,59.696,345.686,30.152,341.246,0c-26.472,1.84-57.384,18.768-75.432,40.832
|
|
6
|
+
c-16.456,20-29.976,49.728-24.688,78.608C270.054,120.344,299.91,103.008,317.222,80.584z"/>
|
|
7
|
+
<path style="fill:#1B546B;" d="M445.838,166.544c-25.4-31.872-61.12-50.344-94.848-50.344c-44.512,0-63.352,21.312-94.264,21.312
|
|
8
|
+
c-31.896,0-56.12-21.248-94.624-21.248c-37.832,0-78.112,23.12-103.64,62.64C22.574,234.576,28.694,339.2,86.894,428.336
|
|
9
|
+
c20.808,31.904,48.592,67.744,84.952,68.072c32.36,0.32,41.488-20.752,85.336-20.992c43.832-0.256,52.16,21.264,84.456,20.896
|
|
10
|
+
c36.384-0.288,65.712-40.016,86.512-71.92c14.912-22.848,20.48-34.376,32.056-60.184
|
|
11
|
+
C376.014,332.184,362.518,212.488,445.838,166.544z"/>
|
|
12
|
+
<path d="M394.774,228.08c-63.632,51.52-153.592,83.712-253.44,83.712c-35.776,0-70.288-4.144-102.768-11.808
|
|
13
|
+
c5.496,41.808,21.16,86.736,48.336,128.344c20.808,31.904,48.592,67.744,84.952,68.072c32.36,0.32,41.488-20.752,85.336-20.992
|
|
14
|
+
c43.832-0.256,52.16,21.264,84.456,20.896c36.384-0.288,65.712-40.016,86.512-71.92c14.912-22.848,20.48-34.376,32.056-60.184
|
|
15
|
+
C402.966,342.44,378.454,280.176,394.774,228.08z"/>
|
|
16
|
+
</svg>
|
|
Binary file
|
|
@@ -9,15 +9,34 @@ import vpnOnboard4 from './vpn-onboard-4.json';
|
|
|
9
9
|
import vpnOnboard5 from './vpn-onboard-5.json';
|
|
10
10
|
import vpnOnboard6 from './vpn-onboard-6.json';
|
|
11
11
|
import { novaToJson } from '../../utils/novaToJson';
|
|
12
|
+
import { defaultAppConfig } from '../../types/PreviewConfig';
|
|
12
13
|
|
|
13
14
|
export function getSamples(): Project[] {
|
|
14
15
|
const legacySamples = [
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
|
|
16
|
+
{
|
|
17
|
+
...vpnOnboard1,
|
|
18
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard1.appConfig },
|
|
19
|
+
} as ProjectBase<unknown>,
|
|
20
|
+
{
|
|
21
|
+
...vpnOnboard2,
|
|
22
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard2.appConfig },
|
|
23
|
+
} as ProjectBase<unknown>,
|
|
24
|
+
{
|
|
25
|
+
...vpnOnboard3,
|
|
26
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard3.appConfig },
|
|
27
|
+
} as ProjectBase<unknown>,
|
|
28
|
+
{
|
|
29
|
+
...vpnOnboard4,
|
|
30
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard4.appConfig },
|
|
31
|
+
} as ProjectBase<unknown>,
|
|
32
|
+
{
|
|
33
|
+
...vpnOnboard5,
|
|
34
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard5.appConfig },
|
|
35
|
+
} as ProjectBase<unknown>,
|
|
36
|
+
{
|
|
37
|
+
...vpnOnboard6,
|
|
38
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard6.appConfig },
|
|
39
|
+
} as ProjectBase<unknown>,
|
|
21
40
|
];
|
|
22
41
|
legacySamples.forEach((sample) => {
|
|
23
42
|
sample.data = novaToJson(sample);
|
|
@@ -37,12 +56,30 @@ export function getBasicSamples(): Project[] {
|
|
|
37
56
|
|
|
38
57
|
export function getOnboardSamples(): Project[] {
|
|
39
58
|
const legacySamples = [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
59
|
+
{
|
|
60
|
+
...vpnOnboard1,
|
|
61
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard1.appConfig },
|
|
62
|
+
} as ProjectBase<unknown>,
|
|
63
|
+
{
|
|
64
|
+
...vpnOnboard2,
|
|
65
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard2.appConfig },
|
|
66
|
+
} as ProjectBase<unknown>,
|
|
67
|
+
{
|
|
68
|
+
...vpnOnboard3,
|
|
69
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard3.appConfig },
|
|
70
|
+
} as ProjectBase<unknown>,
|
|
71
|
+
{
|
|
72
|
+
...vpnOnboard4,
|
|
73
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard4.appConfig },
|
|
74
|
+
} as ProjectBase<unknown>,
|
|
75
|
+
{
|
|
76
|
+
...vpnOnboard5,
|
|
77
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard5.appConfig },
|
|
78
|
+
} as ProjectBase<unknown>,
|
|
79
|
+
{
|
|
80
|
+
...vpnOnboard6,
|
|
81
|
+
appConfig: { ...defaultAppConfig, ...vpnOnboard6.appConfig },
|
|
82
|
+
} as ProjectBase<unknown>,
|
|
46
83
|
];
|
|
47
84
|
legacySamples.forEach((sample) => {
|
|
48
85
|
sample.data = novaToJson(sample);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hello-world-2-advanced",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
-
"
|
|
4
|
+
"appConfig": {
|
|
5
5
|
"theme": "light",
|
|
6
|
-
"screenSize": { "width": 390, "height": 844 },
|
|
7
6
|
"isRtl": false,
|
|
8
7
|
"screenStyle": {
|
|
9
8
|
"light": { "backgroundColor": "#FDFDFD", "color": "#161827" },
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vpn-onboard-1 (legacy)",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"
|
|
4
|
+
"appConfig": {
|
|
5
5
|
"theme": "dark",
|
|
6
|
-
"screenSize": { "width": 375, "height": 812 },
|
|
7
6
|
"isRtl": false,
|
|
8
7
|
"screenStyle": {
|
|
9
8
|
"light": { "backgroundColor": "#FDFDFD", "color": "#161827" },
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vpn-onboard-2 (legacy)",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"
|
|
4
|
+
"appConfig": {
|
|
5
5
|
"theme": "light",
|
|
6
|
-
"screenSize": { "width": 375, "height": 812 },
|
|
7
6
|
"isRtl": false,
|
|
8
7
|
"screenStyle": {
|
|
9
8
|
"light": { "backgroundColor": "#FDFDFD", "color": "#161827" },
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vpn-onboard-3 (legacy)",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"
|
|
4
|
+
"appConfig": {
|
|
5
5
|
"theme": "light",
|
|
6
|
-
"screenSize": { "width": 375, "height": 812 },
|
|
7
6
|
"isRtl": false,
|
|
8
7
|
"screenStyle": {
|
|
9
8
|
"light": { "backgroundColor": "#FDFDFD", "color": "#161827" },
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
"name": "vpn-onboard-4 (legacy)",
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"type": "nova",
|
|
5
|
-
"
|
|
5
|
+
"appConfig": {
|
|
6
6
|
"theme": "dark",
|
|
7
|
-
"screenSize": { "width": 375, "height": 812 },
|
|
8
7
|
"isRtl": false,
|
|
9
8
|
"screenStyle": {
|
|
10
9
|
"light": { "backgroundColor": "#FDFDFD", "color": "#161827" },
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
"name": "vpn-onboard-5 (legacy)",
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"type": "nova",
|
|
5
|
-
"
|
|
5
|
+
"appConfig": {
|
|
6
6
|
"theme": "light",
|
|
7
|
-
"screenSize": { "width": 375, "height": 812 },
|
|
8
7
|
"isRtl": false,
|
|
9
8
|
"screenStyle": {
|
|
10
9
|
"light": { "backgroundColor": "#FDFDFD", "color": "#161827" },
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
"name": "vpn-onboard-6 (legacy)",
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"type": "nova",
|
|
5
|
-
"
|
|
5
|
+
"appConfig": {
|
|
6
6
|
"theme": "dark",
|
|
7
|
-
"screenSize": { "width": 375, "height": 812 },
|
|
8
7
|
"isRtl": false,
|
|
9
8
|
"screenStyle": {
|
|
10
9
|
"light": { "backgroundColor": "#FDFDFD", "color": "#161827" },
|