@developer_tribe/react-builder 0.1.0 → 0.1.4

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.
Files changed (137) hide show
  1. package/dist/build-components/Button/Button.d.ts +2 -2
  2. package/dist/build-components/Carousel/Carousel.d.ts +2 -2
  3. package/dist/build-components/CarouselButtons/CarouselButtons.d.ts +2 -2
  4. package/dist/build-components/CarouselDots/CarouselDots.d.ts +2 -2
  5. package/dist/build-components/CarouselItem/CarouselItem.d.ts +2 -2
  6. package/dist/build-components/CarouselProvider/CarouselProvider.d.ts +2 -2
  7. package/dist/build-components/Image/Image.d.ts +2 -2
  8. package/dist/build-components/Onboard/Onboard.d.ts +2 -2
  9. package/dist/build-components/OnboardBoardTitle/OnboardBoardTitle.d.ts +2 -2
  10. package/dist/build-components/OnboardButton/OnboardButton.d.ts +2 -2
  11. package/dist/build-components/OnboardButtons/OnboardButtons.d.ts +2 -2
  12. package/dist/build-components/OnboardExpandingDot/OnboardExpandingDot.d.ts +2 -2
  13. package/dist/build-components/OnboardFooter/OnboardFooter.d.ts +2 -2
  14. package/dist/build-components/OnboardImage/OnboardImage.d.ts +2 -2
  15. package/dist/build-components/OnboardItem/OnboardItem.d.ts +2 -2
  16. package/dist/build-components/OnboardProvider/OnboardProvider.d.ts +2 -2
  17. package/dist/build-components/OnboardSubtitle/OnboardSubtitle.d.ts +2 -2
  18. package/dist/build-components/RenderNode.generated.d.ts +1 -1
  19. package/dist/build-components/Text/Text.d.ts +2 -2
  20. package/dist/build-components/View/View.d.ts +2 -2
  21. package/dist/build-components/other.d.ts +3 -0
  22. package/dist/utils/generateRandomKeyForNode.d.ts +1 -0
  23. package/package.json +12 -5
  24. package/scripts/prebuild/build-components.js +528 -0
  25. package/scripts/prebuild/prebuild.js +11 -0
  26. package/scripts/public/bin.js +57 -0
  27. package/scripts/public/scripts/build/index.js +31 -0
  28. package/scripts/public/scripts/build/info.json +11 -0
  29. package/scripts/public/scripts/build/utils/checkFolderAndFilesValid.js +41 -0
  30. package/scripts/public/scripts/build/utils/checkPathExists.js +9 -0
  31. package/scripts/public/scripts/build/utils/createMissingFoldersAndFiles.js +54 -0
  32. package/scripts/public/scripts/build/utils/createRenderNodeGenerated.js +82 -0
  33. package/scripts/public/scripts/build/utils/getAllComponents.js +11 -0
  34. package/src/AttributesEditor.tsx +107 -0
  35. package/src/RenderMainNode.tsx +37 -0
  36. package/src/RenderPage.tsx +61 -0
  37. package/src/assets/devices.json +730 -0
  38. package/src/assets/samples/carousel-sample.json +108 -0
  39. package/src/assets/samples/getSamples.ts +28 -0
  40. package/src/assets/samples/simple-1.json +46 -0
  41. package/src/assets/samples/simple-2.json +233 -0
  42. package/src/assets/samples/vpn-onboard-1.json +799 -0
  43. package/src/assets/samples/vpn-onboard-2.json +790 -0
  44. package/src/assets/samples/vpn-onboard-3.json +803 -0
  45. package/src/assets/samples/vpn-onboard-4.json +804 -0
  46. package/src/build-components/Button/Button.tsx +13 -0
  47. package/src/build-components/Button/ButtonProps.generated.ts +21 -0
  48. package/src/build-components/Button/pattern.json +25 -0
  49. package/src/build-components/Carousel/Carousel.tsx +27 -0
  50. package/src/build-components/Carousel/CarouselProps.generated.ts +6 -0
  51. package/src/build-components/Carousel/pattern.json +9 -0
  52. package/src/build-components/CarouselButtons/CarouselButtons.tsx +47 -0
  53. package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +9 -0
  54. package/src/build-components/CarouselButtons/pattern.json +12 -0
  55. package/src/build-components/CarouselDots/CarouselDots.tsx +40 -0
  56. package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +14 -0
  57. package/src/build-components/CarouselDots/pattern.json +18 -0
  58. package/src/build-components/CarouselItem/CarouselItem.tsx +18 -0
  59. package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +6 -0
  60. package/src/build-components/CarouselItem/pattern.json +9 -0
  61. package/src/build-components/CarouselProvider/CarouselProvider.tsx +26 -0
  62. package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +6 -0
  63. package/src/build-components/CarouselProvider/pattern.json +9 -0
  64. package/src/build-components/Image/Image.tsx +35 -0
  65. package/src/build-components/Image/ImageProps.generated.ts +12 -0
  66. package/src/build-components/Image/pattern.json +15 -0
  67. package/src/build-components/Onboard/Onboard.tsx +14 -0
  68. package/src/build-components/Onboard/OnboardProps.generated.ts +6 -0
  69. package/src/build-components/Onboard/pattern.json +9 -0
  70. package/src/build-components/OnboardBoardTitle/OnboardBoardTitle.tsx +28 -0
  71. package/src/build-components/OnboardBoardTitle/OnboardBoardTitleProps.generated.ts +21 -0
  72. package/src/build-components/OnboardBoardTitle/pattern.json +25 -0
  73. package/src/build-components/OnboardButton/OnboardButton.tsx +59 -0
  74. package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +13 -0
  75. package/src/build-components/OnboardButton/pattern.json +16 -0
  76. package/src/build-components/OnboardButtons/OnboardButtons.tsx +76 -0
  77. package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +12 -0
  78. package/src/build-components/OnboardButtons/pattern.json +15 -0
  79. package/src/build-components/OnboardExpandingDot/OnboardExpandingDot.tsx +14 -0
  80. package/src/build-components/OnboardExpandingDot/OnboardExpandingDotProps.generated.ts +14 -0
  81. package/src/build-components/OnboardExpandingDot/pattern.json +18 -0
  82. package/src/build-components/OnboardFooter/OnboardFooter.tsx +13 -0
  83. package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +24 -0
  84. package/src/build-components/OnboardFooter/pattern.json +28 -0
  85. package/src/build-components/OnboardImage/OnboardImage.tsx +14 -0
  86. package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +12 -0
  87. package/src/build-components/OnboardImage/pattern.json +15 -0
  88. package/src/build-components/OnboardItem/OnboardItem.tsx +29 -0
  89. package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +6 -0
  90. package/src/build-components/OnboardItem/pattern.json +9 -0
  91. package/src/build-components/OnboardProvider/OnboardProvider.tsx +65 -0
  92. package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +6 -0
  93. package/src/build-components/OnboardProvider/pattern.json +9 -0
  94. package/src/build-components/OnboardSubtitle/OnboardSubtitle.tsx +28 -0
  95. package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +21 -0
  96. package/src/build-components/OnboardSubtitle/pattern.json +25 -0
  97. package/src/build-components/RenderNode.generated.tsx +97 -0
  98. package/src/build-components/Text/Text.tsx +23 -0
  99. package/src/build-components/Text/TextProps.generated.ts +21 -0
  100. package/src/build-components/Text/pattern.json +26 -0
  101. package/src/build-components/View/View.tsx +62 -0
  102. package/src/build-components/View/ViewProps.generated.ts +24 -0
  103. package/src/build-components/View/pattern.json +28 -0
  104. package/src/build-components/other.ts +6 -0
  105. package/src/index.ts +24 -0
  106. package/src/styles/index.scss +114 -0
  107. package/src/types/Device.ts +12 -0
  108. package/src/types/Node.ts +19 -0
  109. package/src/types/PreviewConfig.ts +19 -0
  110. package/src/types/Project.ts +11 -0
  111. package/src/types/TargetedScreenSize.ts +4 -0
  112. package/src/utils/analyseNode.ts +77 -0
  113. package/src/utils/generateRandomKeyForNode.ts +3 -0
  114. package/src/utils/getDevices.ts +6 -0
  115. package/src/utils/isCarousel.ts +36 -0
  116. package/src/utils/isOnboard.ts +54 -0
  117. package/src/utils/novaToJson.ts +253 -0
  118. package/src/utils/patterns.ts +63 -0
  119. package/dist/build-components/Button/ButtonProps.d.ts +0 -3
  120. package/dist/build-components/Carousel/CarouselProps.d.ts +0 -3
  121. package/dist/build-components/CarouselButtons/CarouselButtonsProps.d.ts +0 -3
  122. package/dist/build-components/CarouselDots/CarouselDotsProps.d.ts +0 -3
  123. package/dist/build-components/CarouselItem/CarouselItemProps.d.ts +0 -3
  124. package/dist/build-components/CarouselProvider/CarouselProviderProps.d.ts +0 -3
  125. package/dist/build-components/Image/ImageProps.d.ts +0 -3
  126. package/dist/build-components/Onboard/OnboardProps.d.ts +0 -3
  127. package/dist/build-components/OnboardBoardTitle/OnboardBoardTitleProps.d.ts +0 -3
  128. package/dist/build-components/OnboardButton/OnboardButtonProps.d.ts +0 -3
  129. package/dist/build-components/OnboardButtons/OnboardButtonsProps.d.ts +0 -3
  130. package/dist/build-components/OnboardExpandingDot/OnboardExpandingDotProps.d.ts +0 -3
  131. package/dist/build-components/OnboardFooter/OnboardFooterProps.d.ts +0 -3
  132. package/dist/build-components/OnboardImage/OnboardImageProps.d.ts +0 -3
  133. package/dist/build-components/OnboardItem/OnboardItemProps.d.ts +0 -3
  134. package/dist/build-components/OnboardProvider/OnboardProviderProps.d.ts +0 -3
  135. package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.d.ts +0 -3
  136. package/dist/build-components/Text/TextProps.d.ts +0 -3
  137. package/dist/build-components/View/ViewProps.d.ts +0 -3
@@ -0,0 +1,108 @@
1
+ {
2
+ "name": "carousel-sample",
3
+ "version": "1.0.0",
4
+ "previewConfig": {
5
+ "theme": "light",
6
+ "screenSize": { "width": 375, "height": 812 }
7
+ },
8
+ "data": {
9
+ "type": "carouselProvider",
10
+ "children": [
11
+ {
12
+ "type": "carousel",
13
+ "attributes": {
14
+ "loop": true,
15
+ "align": "center",
16
+ "dragFree": true
17
+ },
18
+ "children": [
19
+ {
20
+ "type": "carouselItem",
21
+ "attributes": {
22
+ "style": {
23
+ "flex": "0 0 100%",
24
+ "minWidth": 0
25
+ }
26
+ },
27
+ "children": {
28
+ "type": "view",
29
+ "attributes": {
30
+ "style": {
31
+ "padding": "20px",
32
+ "backgroundColor": "#f5f5f5",
33
+ "borderRadius": "8px",
34
+ "textAlign": "center"
35
+ }
36
+ },
37
+ "children": {
38
+ "type": "text",
39
+ "children": "Welcome to our app!"
40
+ }
41
+ }
42
+ },
43
+ {
44
+ "type": "carouselItem",
45
+ "attributes": {
46
+ "style": {
47
+ "flex": "0 0 100%",
48
+ "minWidth": 0
49
+ }
50
+ },
51
+ "children": {
52
+ "type": "view",
53
+ "attributes": {
54
+ "style": {
55
+ "padding": "20px",
56
+ "backgroundColor": "#e8f5e9",
57
+ "borderRadius": "8px",
58
+ "textAlign": "center"
59
+ }
60
+ },
61
+ "children": {
62
+ "type": "text",
63
+ "children": "Discover amazing features"
64
+ }
65
+ }
66
+ },
67
+ {
68
+ "type": "carouselItem",
69
+ "attributes": {
70
+ "style": {
71
+ "flex": "0 0 100%",
72
+ "minWidth": 0
73
+ }
74
+ },
75
+ "children": {
76
+ "type": "view",
77
+ "attributes": {
78
+ "style": {
79
+ "padding": "20px",
80
+ "backgroundColor": "#e3f2fd",
81
+ "borderRadius": "8px",
82
+ "textAlign": "center"
83
+ }
84
+ },
85
+ "children": {
86
+ "type": "text",
87
+ "children": "Get started now!"
88
+ }
89
+ }
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "type": "carouselDots",
95
+ "attributes": {
96
+ "dotType": "expanding_dot"
97
+ }
98
+ },
99
+ {
100
+ "type": "carouselButtons",
101
+ "attributes": {
102
+ "buttonType": ["previous_button", "next_button", "skip_button"],
103
+ "skipNumber": 3
104
+ }
105
+ }
106
+ ]
107
+ }
108
+ }
@@ -0,0 +1,28 @@
1
+ import { Project, ProjectBase } from '../../types/Project';
2
+ import simple1 from './simple-1.json';
3
+ import simple2 from './simple-2.json';
4
+ import carouselSample from './carousel-sample.json';
5
+ import vpnOnboard1 from './vpn-onboard-1.json';
6
+ import vpnOnboard2 from './vpn-onboard-2.json';
7
+ import vpnOnboard3 from './vpn-onboard-3.json';
8
+ import vpnOnboard4 from './vpn-onboard-4.json';
9
+ import { novaToJson } from '../../utils/novaToJson';
10
+
11
+ export function getSamples(): Project[] {
12
+ const legacySamples = [
13
+ { ...vpnOnboard1 } as ProjectBase<unknown>,
14
+ { ...vpnOnboard2 } as ProjectBase<unknown>,
15
+ { ...vpnOnboard3 } as ProjectBase<unknown>,
16
+ { ...vpnOnboard4 } as ProjectBase<unknown>,
17
+ ];
18
+ legacySamples.forEach((sample) => {
19
+ sample.data = novaToJson(sample);
20
+ });
21
+
22
+ return [
23
+ simple1 as Project,
24
+ simple2 as Project,
25
+ carouselSample as Project,
26
+ ...legacySamples,
27
+ ];
28
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "hello-world",
3
+ "version": "1.0.0",
4
+ "previewConfig": {
5
+ "theme": "light",
6
+ "screenSize": { "width": 375, "height": 812 },
7
+ "isRtl": false,
8
+ "screenStyle": {
9
+ "light": { "backgroundColor": "#FDFDFD", "color": "#161827" },
10
+ "dark": { "backgroundColor": "#12131A", "color": "#E9EBF9" }
11
+ },
12
+ "defaultLanguage": "en"
13
+ },
14
+ "data": {
15
+ "type": "view",
16
+ "attributes": {
17
+ "scrollable": true,
18
+ "flexDirection": "column",
19
+ "alignItems": "center",
20
+ "justifyContent": "center",
21
+ "gap": 12,
22
+ "padding": 16,
23
+ "backgroundColor": "#F5F7FA"
24
+ },
25
+ "children": [
26
+ {
27
+ "type": "text",
28
+ "children": "Hello, world!",
29
+ "attributes": {
30
+ "color": "#111827",
31
+ "fontSize": 24,
32
+ "fontWeight": "600"
33
+ }
34
+ },
35
+ {
36
+ "type": "text",
37
+ "children": "Welcome to react-native-builder",
38
+ "attributes": {
39
+ "color": "#6B7280",
40
+ "fontSize": 14,
41
+ "fontWeight": "400"
42
+ }
43
+ }
44
+ ]
45
+ }
46
+ }
@@ -0,0 +1,233 @@
1
+ {
2
+ "name": "hello-world-2-advanced",
3
+ "version": "1.0.0",
4
+ "previewConfig": {
5
+ "theme": "light",
6
+ "screenSize": { "width": 390, "height": 844 },
7
+ "isRtl": false,
8
+ "screenStyle": {
9
+ "light": { "backgroundColor": "#FDFDFD", "color": "#161827" },
10
+ "dark": { "backgroundColor": "#12131A", "color": "#E9EBF9" }
11
+ },
12
+ "defaultLanguage": "en"
13
+ },
14
+ "data": {
15
+ "type": "view",
16
+ "attributes": {
17
+ "scrollable": true,
18
+ "flexDirection": "column",
19
+ "alignItems": "stretch",
20
+ "justifyContent": "flex-start",
21
+ "gap": 16,
22
+ "padding": 16,
23
+ "backgroundColor": "#F3F4F6"
24
+ },
25
+ "children": [
26
+ {
27
+ "type": "view",
28
+ "attributes": {
29
+ "flexDirection": "row",
30
+ "alignItems": "center",
31
+ "justifyContent": "space-between",
32
+ "padding": 12,
33
+ "backgroundColor": "#111827",
34
+ "borderRadius": 12
35
+ },
36
+ "children": [
37
+ {
38
+ "type": "text",
39
+ "children": "Dashboard",
40
+ "attributes": {
41
+ "color": "#FFFFFF",
42
+ "fontSize": 20,
43
+ "fontWeight": "600"
44
+ }
45
+ },
46
+ {
47
+ "type": "view",
48
+ "attributes": { "flexDirection": "row", "gap": 8 },
49
+ "children": [
50
+ {
51
+ "type": "text",
52
+ "children": "Help",
53
+ "attributes": { "color": "#D1D5DB", "fontSize": 14 }
54
+ },
55
+ {
56
+ "type": "text",
57
+ "children": "Profile",
58
+ "attributes": { "color": "#D1D5DB", "fontSize": 14 }
59
+ }
60
+ ]
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "type": "image",
66
+ "attributes": {
67
+ "src": "https://picsum.photos/720/320",
68
+ "width": 358,
69
+ "height": 160,
70
+ "borderRadius": 12,
71
+ "resizeMode": "cover"
72
+ },
73
+ "children": null
74
+ },
75
+ {
76
+ "type": "view",
77
+ "attributes": {
78
+ "flexDirection": "column",
79
+ "gap": 8,
80
+ "padding": 12,
81
+ "backgroundColor": "#FFFFFF",
82
+ "borderRadius": 12
83
+ },
84
+ "children": [
85
+ {
86
+ "type": "text",
87
+ "children": "Welcome back!",
88
+ "attributes": {
89
+ "color": "#111827",
90
+ "fontSize": 18,
91
+ "fontWeight": "600"
92
+ }
93
+ },
94
+ {
95
+ "type": "text",
96
+ "children": "Here's what's new today.",
97
+ "attributes": { "color": "#6B7280", "fontSize": 14 }
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "type": "view",
103
+ "attributes": {
104
+ "flexDirection": "column",
105
+ "gap": 12
106
+ },
107
+ "children": [
108
+ {
109
+ "type": "view",
110
+ "attributes": {
111
+ "flexDirection": "row",
112
+ "alignItems": "center",
113
+ "justifyContent": "space-between",
114
+ "padding": 12,
115
+ "backgroundColor": "#FFFFFF",
116
+ "borderRadius": 8
117
+ },
118
+ "children": [
119
+ {
120
+ "type": "text",
121
+ "children": "Task 1",
122
+ "attributes": {
123
+ "color": "#111827",
124
+ "fontSize": 16,
125
+ "fontWeight": "500"
126
+ }
127
+ },
128
+ {
129
+ "type": "text",
130
+ "children": "Due today",
131
+ "attributes": {
132
+ "color": "#059669",
133
+ "fontSize": 12,
134
+ "fontWeight": "600"
135
+ }
136
+ }
137
+ ]
138
+ },
139
+ {
140
+ "type": "view",
141
+ "attributes": {
142
+ "flexDirection": "row",
143
+ "alignItems": "center",
144
+ "justifyContent": "space-between",
145
+ "padding": 12,
146
+ "backgroundColor": "#FFFFFF",
147
+ "borderRadius": 8
148
+ },
149
+ "children": [
150
+ {
151
+ "type": "text",
152
+ "children": "Task 2",
153
+ "attributes": {
154
+ "color": "#111827",
155
+ "fontSize": 16,
156
+ "fontWeight": "500"
157
+ }
158
+ },
159
+ {
160
+ "type": "text",
161
+ "children": "2 days left",
162
+ "attributes": {
163
+ "color": "#D97706",
164
+ "fontSize": 12,
165
+ "fontWeight": "600"
166
+ }
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "type": "view",
172
+ "attributes": {
173
+ "flexDirection": "row",
174
+ "alignItems": "center",
175
+ "justifyContent": "space-between",
176
+ "padding": 12,
177
+ "backgroundColor": "#FFFFFF",
178
+ "borderRadius": 8
179
+ },
180
+ "children": [
181
+ {
182
+ "type": "text",
183
+ "children": "Task 3",
184
+ "attributes": {
185
+ "color": "#111827",
186
+ "fontSize": 16,
187
+ "fontWeight": "500"
188
+ }
189
+ },
190
+ {
191
+ "type": "text",
192
+ "children": "Completed",
193
+ "attributes": {
194
+ "color": "#6B7280",
195
+ "fontSize": 12,
196
+ "fontWeight": "600"
197
+ }
198
+ }
199
+ ]
200
+ }
201
+ ]
202
+ },
203
+ {
204
+ "type": "view",
205
+ "attributes": {
206
+ "flexDirection": "row",
207
+ "alignItems": "center",
208
+ "justifyContent": "space-around",
209
+ "padding": 12,
210
+ "backgroundColor": "#111827",
211
+ "borderRadius": 12
212
+ },
213
+ "children": [
214
+ {
215
+ "type": "text",
216
+ "children": "Home",
217
+ "attributes": { "color": "#FFFFFF", "fontSize": 14 }
218
+ },
219
+ {
220
+ "type": "text",
221
+ "children": "Search",
222
+ "attributes": { "color": "#9CA3AF", "fontSize": 14 }
223
+ },
224
+ {
225
+ "type": "text",
226
+ "children": "Settings",
227
+ "attributes": { "color": "#9CA3AF", "fontSize": 14 }
228
+ }
229
+ ]
230
+ }
231
+ ]
232
+ }
233
+ }