@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.
Files changed (218) hide show
  1. package/dist/DeviceMockFrame.d.ts +2 -17
  2. package/dist/RenderPage.d.ts +4 -11
  3. package/dist/attributes-editor/Field.d.ts +16 -0
  4. package/dist/attributes-editor/FieldInfoTooltip.d.ts +7 -0
  5. package/dist/attributes-editor/LayoutPreviewPicker.d.ts +12 -0
  6. package/dist/attributes-editor/SpecialCategorySection.d.ts +19 -0
  7. package/dist/attributes-editor/types.d.ts +14 -0
  8. package/dist/background.jpg +0 -0
  9. package/dist/build-components/Button/Button.d.ts +1 -1
  10. package/dist/build-components/Button/ButtonProps.generated.d.ts +26 -1
  11. package/dist/build-components/Carousel/CarouselProps.generated.d.ts +27 -1
  12. package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +25 -0
  13. package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +25 -0
  14. package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +27 -1
  15. package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +27 -1
  16. package/dist/build-components/Image/ImageProps.generated.d.ts +25 -3
  17. package/dist/build-components/Onboard/OnboardProps.generated.d.ts +27 -1
  18. package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +25 -0
  19. package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +25 -0
  20. package/dist/build-components/OnboardDot/OnboardDot.d.ts +1 -1
  21. package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +22 -0
  22. package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +4 -5
  23. package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +25 -3
  24. package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +24 -3
  25. package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +25 -4
  26. package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +4 -5
  27. package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +4 -5
  28. package/dist/build-components/Text/TextProps.generated.d.ts +4 -5
  29. package/dist/build-components/View/ViewProps.generated.d.ts +3 -4
  30. package/dist/build-components/index.d.ts +1 -0
  31. package/dist/build-components/patterns.generated.d.ts +4855 -132
  32. package/dist/components/AttributesEditorPanel.d.ts +9 -0
  33. package/dist/components/Breadcrumb.d.ts +15 -0
  34. package/dist/components/Builder.d.ts +9 -0
  35. package/dist/components/Checkbox.d.ts +17 -0
  36. package/dist/components/DeviceButton.d.ts +8 -0
  37. package/dist/components/DeviceNavigationBar.d.ts +10 -0
  38. package/dist/components/DeviceStatusBar.d.ts +9 -0
  39. package/dist/components/EditorHeader.d.ts +10 -0
  40. package/dist/index.cjs.js +6 -5
  41. package/dist/index.cjs.js.map +1 -0
  42. package/dist/index.d.ts +8 -4
  43. package/dist/index.esm.js +6 -5
  44. package/dist/index.esm.js.map +1 -0
  45. package/dist/mockOS/components/MockLaunchScreenComponent.d.ts +6 -0
  46. package/dist/mockOS/components/MockOSRouter.d.ts +8 -0
  47. package/dist/mockOS/components/PermissionModal.d.ts +9 -0
  48. package/dist/mockOS/context/MockOSContext.d.ts +36 -0
  49. package/dist/mockOS/hooks/useMockNavigation.d.ts +3 -0
  50. package/dist/mockOS/hooks/useMockPermission.d.ts +3 -0
  51. package/dist/mockOS/index.d.ts +9 -0
  52. package/dist/mockOS/managers/mockPermissionManager.d.ts +10 -0
  53. package/dist/mockOS/managers/navigationManager.d.ts +17 -0
  54. package/dist/modals/AddComponentModal.d.ts +8 -0
  55. package/dist/modals/ColorModal.d.ts +9 -0
  56. package/dist/modals/DeviceSelectorModal.d.ts +9 -0
  57. package/dist/modals/LocalicationModal.d.ts +8 -0
  58. package/dist/modals/Modal.d.ts +12 -0
  59. package/dist/modals/index.d.ts +5 -0
  60. package/dist/pages/ProjectPage.d.ts +11 -0
  61. package/dist/pages/tabs/BuilderTab.d.ts +9 -0
  62. package/dist/pages/tabs/DebugTab.d.ts +7 -0
  63. package/dist/pages/tabs/PreviewTab.d.ts +3 -0
  64. package/dist/store.d.ts +15 -18
  65. package/dist/styles.css +1 -1
  66. package/dist/types/PreviewConfig.d.ts +6 -3
  67. package/dist/types/Project.d.ts +12 -2
  68. package/dist/utils/copyNode.d.ts +2 -0
  69. package/dist/utils/logger.d.ts +11 -0
  70. package/dist/utils/patterns.d.ts +24 -0
  71. package/dist/utils/useLogRender.d.ts +1 -0
  72. package/package.json +17 -9
  73. package/scripts/prebuild/utils/createBuildComponentsIndex.js +15 -1
  74. package/scripts/prebuild/utils/createGeneratedProps.js +11 -3
  75. package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +45 -6
  76. package/scripts/prebuild/utils/validatePatternJson.js +13 -5
  77. package/src/AttributesEditor.tsx +434 -311
  78. package/src/DeviceMockFrame.tsx +42 -67
  79. package/src/RenderPage.tsx +8 -44
  80. package/src/assets/images/android.svg +43 -0
  81. package/src/assets/images/apple.svg +16 -0
  82. package/src/assets/images/background.jpg +0 -0
  83. package/src/assets/samples/carousel-sample.json +2 -3
  84. package/src/assets/samples/getSamples.ts +49 -12
  85. package/src/assets/samples/simple-1.json +1 -2
  86. package/src/assets/samples/simple-2.json +1 -2
  87. package/src/assets/samples/vpn-onboard-1.json +1 -2
  88. package/src/assets/samples/vpn-onboard-2.json +1 -2
  89. package/src/assets/samples/vpn-onboard-3.json +1 -2
  90. package/src/assets/samples/vpn-onboard-4.json +1 -2
  91. package/src/assets/samples/vpn-onboard-5.json +1 -2
  92. package/src/assets/samples/vpn-onboard-6.json +1 -2
  93. package/src/attributes-editor/Field.tsx +662 -0
  94. package/src/attributes-editor/FieldInfoTooltip.tsx +49 -0
  95. package/src/attributes-editor/LayoutPreviewPicker.tsx +199 -0
  96. package/src/attributes-editor/SpecialCategorySection.tsx +284 -0
  97. package/src/attributes-editor/types.ts +30 -0
  98. package/src/build-components/Button/Button.tsx +12 -2
  99. package/src/build-components/Button/ButtonProps.generated.ts +37 -1
  100. package/src/build-components/Button/pattern.json +31 -2
  101. package/src/build-components/Carousel/Carousel.tsx +17 -2
  102. package/src/build-components/Carousel/CarouselProps.generated.ts +39 -1
  103. package/src/build-components/Carousel/pattern.json +10 -0
  104. package/src/build-components/CarouselButtons/CarouselButtons.tsx +8 -2
  105. package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +36 -0
  106. package/src/build-components/CarouselButtons/pattern.json +22 -0
  107. package/src/build-components/CarouselDots/CarouselDots.tsx +42 -8
  108. package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +36 -0
  109. package/src/build-components/CarouselDots/pattern.json +15 -0
  110. package/src/build-components/CarouselItem/CarouselItem.tsx +7 -2
  111. package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +39 -1
  112. package/src/build-components/CarouselItem/pattern.json +7 -0
  113. package/src/build-components/CarouselProvider/CarouselProvider.tsx +10 -2
  114. package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +39 -1
  115. package/src/build-components/CarouselProvider/pattern.json +7 -0
  116. package/src/build-components/Image/Image.tsx +10 -2
  117. package/src/build-components/Image/ImageProps.generated.ts +36 -3
  118. package/src/build-components/Image/pattern.json +46 -3
  119. package/src/build-components/Onboard/Onboard.tsx +8 -1
  120. package/src/build-components/Onboard/OnboardProps.generated.ts +39 -1
  121. package/src/build-components/Onboard/pattern.json +11 -0
  122. package/src/build-components/OnboardButton/OnboardButton.tsx +53 -9
  123. package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +36 -0
  124. package/src/build-components/OnboardButton/pattern.json +71 -5
  125. package/src/build-components/OnboardButtons/OnboardButtons.tsx +27 -17
  126. package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +36 -0
  127. package/src/build-components/OnboardButtons/pattern.json +70 -4
  128. package/src/build-components/OnboardDot/OnboardDot.tsx +106 -4
  129. package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +22 -0
  130. package/src/build-components/OnboardDot/pattern.json +54 -1
  131. package/src/build-components/OnboardFooter/OnboardFooter.tsx +14 -6
  132. package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +4 -5
  133. package/src/build-components/OnboardFooter/pattern.json +58 -2
  134. package/src/build-components/OnboardImage/OnboardImage.tsx +29 -5
  135. package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +36 -3
  136. package/src/build-components/OnboardImage/pattern.json +21 -0
  137. package/src/build-components/OnboardItem/OnboardItem.tsx +8 -1
  138. package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +35 -3
  139. package/src/build-components/OnboardItem/pattern.json +38 -2
  140. package/src/build-components/OnboardProvider/OnboardProvider.tsx +22 -8
  141. package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +37 -4
  142. package/src/build-components/OnboardProvider/pattern.json +51 -4
  143. package/src/build-components/OnboardSubtitle/OnboardSubtitle.tsx +2 -0
  144. package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +4 -5
  145. package/src/build-components/OnboardSubtitle/pattern.json +6 -0
  146. package/src/build-components/OnboardTitle/OnboardTitle.tsx +2 -0
  147. package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +4 -5
  148. package/src/build-components/OnboardTitle/pattern.json +6 -0
  149. package/src/build-components/Text/Text.tsx +12 -6
  150. package/src/build-components/Text/TextProps.generated.ts +4 -5
  151. package/src/build-components/Text/pattern.json +38 -2
  152. package/src/build-components/View/View.tsx +11 -6
  153. package/src/build-components/View/ViewProps.generated.ts +3 -4
  154. package/src/build-components/View/pattern.json +227 -19
  155. package/src/build-components/index.ts +22 -0
  156. package/src/build-components/patterns.generated.ts +4905 -139
  157. package/src/components/AttributesEditorPanel.tsx +58 -0
  158. package/src/components/Breadcrumb.tsx +80 -0
  159. package/src/components/Builder.tsx +375 -0
  160. package/src/components/Checkbox.tsx +81 -0
  161. package/src/components/DeviceButton.tsx +39 -0
  162. package/src/components/DeviceNavigationBar.tsx +201 -0
  163. package/src/components/DeviceStatusBar.tsx +85 -0
  164. package/src/components/EditorHeader.tsx +138 -0
  165. package/src/index.ts +8 -4
  166. package/src/mockOS/components/MockLaunchScreenComponent.tsx +43 -0
  167. package/src/mockOS/components/MockOSRouter.tsx +115 -0
  168. package/src/mockOS/components/PermissionModal.tsx +270 -0
  169. package/src/mockOS/context/MockOSContext.tsx +179 -0
  170. package/src/mockOS/hooks/useMockNavigation.ts +11 -0
  171. package/src/mockOS/hooks/useMockPermission.ts +11 -0
  172. package/src/mockOS/index.ts +26 -0
  173. package/src/mockOS/managers/mockPermissionManager.ts +54 -0
  174. package/src/mockOS/managers/navigationManager.ts +91 -0
  175. package/src/modals/AddComponentModal.tsx +313 -0
  176. package/src/modals/ColorModal.tsx +268 -0
  177. package/src/modals/DeviceSelectorModal.tsx +57 -0
  178. package/src/modals/LocalicationModal.tsx +54 -0
  179. package/src/modals/Modal.tsx +57 -0
  180. package/src/modals/index.ts +5 -0
  181. package/src/pages/ProjectPage.tsx +150 -0
  182. package/src/pages/tabs/BuilderTab.tsx +33 -0
  183. package/src/pages/tabs/DebugTab.tsx +64 -0
  184. package/src/pages/tabs/PreviewTab.tsx +206 -0
  185. package/src/size-matters/index.ts +25 -5
  186. package/src/store.ts +56 -38
  187. package/src/styles/base/_global.scss +253 -0
  188. package/src/styles/components/_attributes-editor.scss +261 -0
  189. package/src/styles/components/_editor-shell.scss +189 -0
  190. package/src/styles/components/_mockos-router.scss +140 -0
  191. package/src/styles/components/_ui-components.scss +183 -0
  192. package/src/styles/foundation/_colors.scss +8 -0
  193. package/src/styles/foundation/_mixins.scss +22 -0
  194. package/src/styles/{_reset.scss → foundation/_reset.scss} +5 -2
  195. package/src/styles/foundation/_sizes.scss +37 -0
  196. package/src/styles/foundation/_typography.scss +4 -0
  197. package/src/styles/foundation/_variables.scss +3 -0
  198. package/src/styles/index.scss +22 -129
  199. package/src/styles/layout/_builder.scss +68 -0
  200. package/src/styles/layout/_pages.scss +3 -0
  201. package/src/styles/modals/_add-component.scss +122 -0
  202. package/src/styles/modals/_color-modal.scss +130 -0
  203. package/src/styles/modals/_device-selector.scss +18 -0
  204. package/src/styles/modals/_localication-modal.scss +68 -0
  205. package/src/styles/modals/_modal-shell.scss +46 -0
  206. package/src/styles/utilities/_carousel.scss +125 -0
  207. package/src/types/PreviewConfig.ts +14 -5
  208. package/src/types/Project.ts +15 -2
  209. package/src/types/images.d.ts +8 -0
  210. package/src/utils/copyNode.ts +7 -0
  211. package/src/utils/extractTextStyle.ts +8 -4
  212. package/src/utils/extractViewStyle.ts +51 -7
  213. package/src/utils/getDevices.ts +1 -0
  214. package/src/utils/logger.ts +76 -0
  215. package/src/utils/patterns.ts +33 -0
  216. package/src/utils/useLogRender.ts +13 -0
  217. package/dist/build-components/OnboardDot/OnboardExpandingDotProps.generated.d.ts +0 -10
  218. package/src/build-components/OnboardDot/OnboardExpandingDotProps.generated.ts +0 -20
@@ -0,0 +1,122 @@
1
+ @use '../foundation/colors' as colors;
2
+ @use '../foundation/sizes' as sizes;
3
+
4
+ .add-component-modal {
5
+ display: flex;
6
+ flex-direction: column;
7
+ height: 100%;
8
+ }
9
+
10
+ .add-component-modal__body {
11
+ flex: 1;
12
+ overflow-y: auto;
13
+ padding-bottom: sizes.$spaceRoomy;
14
+ }
15
+
16
+ .add-component-modal__section {
17
+ padding: 0 sizes.$spaceRoomy;
18
+ margin-bottom: sizes.$spaceRoomy;
19
+
20
+ &:first-of-type {
21
+ margin-top: sizes.$spaceRoomy;
22
+ }
23
+ }
24
+
25
+ .add-component-modal__section-title {
26
+ font-size: 16px;
27
+ font-weight: 600;
28
+ margin-bottom: sizes.$spaceCozy;
29
+ }
30
+
31
+ .add-component-modal__toggle {
32
+ display: flex;
33
+ align-items: center;
34
+ gap: sizes.$spaceCozy;
35
+ margin: 0 sizes.$spaceRoomy sizes.$spaceRoomy;
36
+ padding: sizes.$spaceCozy 0;
37
+ font-weight: 500;
38
+ user-select: none;
39
+
40
+ input {
41
+ width: 18px;
42
+ height: 18px;
43
+ }
44
+ }
45
+
46
+ .add-component-modal__group {
47
+ background: colors.$surfaceColor;
48
+ border: 1px solid colors.$borderColor;
49
+ border-radius: 12px;
50
+ padding: sizes.$spaceComfy;
51
+ margin-bottom: sizes.$spaceCozy;
52
+ box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
53
+ }
54
+
55
+ .add-component-modal__group-title {
56
+ font-size: 14px;
57
+ font-weight: 600;
58
+ color: colors.$mutedTextColor;
59
+ margin-bottom: sizes.$spaceCozy;
60
+ }
61
+
62
+ .add-component-modal__grid {
63
+ padding: sizes.$spaceComfy;
64
+ display: grid;
65
+ grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
66
+ gap: sizes.$spaceCozy;
67
+ overflow: auto;
68
+ }
69
+
70
+ .add-component-modal__card {
71
+ display: flex;
72
+ flex-direction: column;
73
+ gap: sizes.$spaceCozy;
74
+ padding: sizes.$spaceCozy;
75
+ border: 1px solid colors.$borderColor;
76
+ border-radius: 10px;
77
+ background: colors.$canvasColor;
78
+ cursor: pointer;
79
+ text-align: left;
80
+ transition:
81
+ border-color 0.2s ease,
82
+ box-shadow 0.2s ease,
83
+ transform 0.2s ease;
84
+ color: inherit;
85
+ }
86
+
87
+ .add-component-modal__card:hover {
88
+ border-color: colors.$accentColor;
89
+ box-shadow: 0 10px 25px rgba(37, 99, 235, 0.15);
90
+ transform: translateY(-2px);
91
+ }
92
+
93
+ .add-component-modal__thumbnail {
94
+ width: 100%;
95
+ aspect-ratio: 4 / 3;
96
+ border-radius: 8px;
97
+ background: colors.$canvasColor;
98
+ border: 1px dashed colors.$borderColor;
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ color: colors.$accentColor;
103
+ font-weight: 600;
104
+ font-size: 12px;
105
+ text-transform: uppercase;
106
+ letter-spacing: 0.05em;
107
+ }
108
+
109
+ .add-component-modal__title {
110
+ font-weight: 600;
111
+ color: colors.$textColor;
112
+ }
113
+
114
+ .add-component-modal__empty {
115
+ margin: sizes.$spaceCozy 0;
116
+ padding: sizes.$spaceComfy;
117
+ border: 1px dashed colors.$borderColor;
118
+ border-radius: 10px;
119
+ color: colors.$mutedTextColor;
120
+ font-size: 14px;
121
+ text-align: center;
122
+ }
@@ -0,0 +1,130 @@
1
+ @use '../foundation/colors' as colors;
2
+ @use '../foundation/sizes' as sizes;
3
+
4
+ .color-modal {
5
+ width: min(520px, calc(100vw - 32px));
6
+ max-height: 90vh;
7
+ padding: sizes.$spaceRoomy;
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: sizes.$spaceComfy;
11
+ overflow-y: auto;
12
+ }
13
+
14
+ .color-modal__selected {
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: space-between;
18
+ background: colors.$canvasColor;
19
+ border-radius: 8px;
20
+ padding: sizes.$spaceCozy sizes.$spaceComfy;
21
+ }
22
+
23
+ .color-modal__selected-info {
24
+ display: flex;
25
+ align-items: center;
26
+ gap: 12px;
27
+ }
28
+
29
+ .color-modal__selected-preview {
30
+ width: 32px;
31
+ height: 32px;
32
+ border-radius: 6px;
33
+ border: 1px solid rgba(0, 0, 0, 0.1);
34
+ }
35
+
36
+ .color-modal__selected-label {
37
+ margin: 0;
38
+ font-size: 12px;
39
+ color: colors.$mutedTextColor;
40
+ }
41
+
42
+ .color-modal__selected-value {
43
+ margin: 0;
44
+ font-weight: 600;
45
+ }
46
+
47
+ .color-modal__link-button {
48
+ border: none;
49
+ background: none;
50
+ color: colors.$accentColor;
51
+ font-weight: 600;
52
+ font-size: 13px;
53
+ cursor: pointer;
54
+ padding: 4px 8px;
55
+ }
56
+
57
+ .color-section {
58
+ display: flex;
59
+ flex-direction: column;
60
+ gap: sizes.$spaceCompact;
61
+ }
62
+
63
+ .color-section__header {
64
+ display: flex;
65
+ align-items: center;
66
+ justify-content: space-between;
67
+ gap: 8px;
68
+ }
69
+
70
+ .color-section__title {
71
+ margin: 0;
72
+ font-weight: 600;
73
+ }
74
+
75
+ .color-section__swatches {
76
+ display: grid;
77
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
78
+ gap: sizes.$spaceCompact;
79
+ }
80
+
81
+ .color-section__empty {
82
+ margin: 0;
83
+ font-size: 12px;
84
+ color: colors.$mutedTextColor;
85
+ }
86
+
87
+ .color-modal__swatch {
88
+ border: 1px solid colors.$borderColor;
89
+ border-radius: 8px;
90
+ padding: 8px;
91
+ background: colors.$surfaceColor;
92
+ display: flex;
93
+ flex-direction: column;
94
+ gap: 6px;
95
+ text-align: left;
96
+ cursor: pointer;
97
+ transition:
98
+ border-color 0.2s ease,
99
+ box-shadow 0.2s ease;
100
+ }
101
+
102
+ .color-modal__swatch--active {
103
+ border-color: colors.$textColor;
104
+ box-shadow: 0 0 0 1px colors.$textColor inset;
105
+ }
106
+
107
+ .color-modal__swatch-preview {
108
+ width: 100%;
109
+ height: 32px;
110
+ border-radius: 6px;
111
+ }
112
+
113
+ .color-modal__swatch-preview--light {
114
+ border: 1px solid rgba(0, 0, 0, 0.1);
115
+ }
116
+
117
+ .color-modal__swatch-label {
118
+ font-size: 12px;
119
+ font-weight: 600;
120
+ color: colors.$textColor;
121
+ }
122
+
123
+ .color-modal__swatch-value {
124
+ font-size: 11px;
125
+ color: colors.$mutedTextColor;
126
+ }
127
+
128
+ .color-modal__input {
129
+ display: none;
130
+ }
@@ -0,0 +1,18 @@
1
+ @use '../foundation/sizes' as sizes;
2
+
3
+ .device-selector-modal {
4
+ padding-bottom: sizes.$spaceRoomy;
5
+ }
6
+
7
+ .device-selector-modal__grid {
8
+ padding: sizes.$spaceRoomy;
9
+ display: grid;
10
+ grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
11
+ gap: sizes.$spaceCozy;
12
+ overflow: auto;
13
+ }
14
+
15
+ .device-selector-modal__grid .editor-device-button {
16
+ height: 80px;
17
+ min-width: unset;
18
+ }
@@ -0,0 +1,68 @@
1
+ @use '../foundation/colors' as colors;
2
+ @use '../foundation/sizes' as sizes;
3
+
4
+ .localication-modal__content {
5
+ width: calc(100vw - 32px);
6
+ height: calc(100vh - 32px);
7
+ max-width: 1600px;
8
+ max-height: calc(100vh - 32px);
9
+ padding: 0;
10
+ display: flex;
11
+ flex-direction: column;
12
+ }
13
+
14
+ .localication-modal__header {
15
+ padding: sizes.$spaceComfy sizes.$spaceRoomy;
16
+ border-bottom: 1px solid colors.$borderColor;
17
+ display: flex;
18
+ align-items: center;
19
+ gap: 16px;
20
+ }
21
+
22
+ .localication-modal__header-main {
23
+ flex: 1;
24
+ display: flex;
25
+ flex-direction: column;
26
+ gap: 4px;
27
+ }
28
+
29
+ .localication-modal__description {
30
+ margin: 0;
31
+ font-size: 13px;
32
+ color: colors.$mutedTextColor;
33
+ }
34
+
35
+ .localication-modal__body {
36
+ flex: 1;
37
+ min-height: 0;
38
+ padding: sizes.$spaceRoomy;
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: sizes.$spaceComfy;
42
+ overflow: auto;
43
+ }
44
+
45
+ .localication-modal__editor {
46
+ flex: 1;
47
+ min-height: 0;
48
+ overflow: auto;
49
+ border: 1px solid colors.$borderColor;
50
+ border-radius: sizes.$radiusRounded;
51
+ background: colors.$canvasColor;
52
+ }
53
+
54
+ .localication-modal__json-editor {
55
+ height: 100%;
56
+ width: 100%;
57
+ display: block;
58
+ padding: sizes.$spaceCozy;
59
+ overflow: auto;
60
+ }
61
+
62
+ .modal--scrollable .localication-modal__content {
63
+ overflow: hidden;
64
+ }
65
+
66
+ .modal--scrollable .localication-modal__body {
67
+ overflow: auto;
68
+ }
@@ -0,0 +1,46 @@
1
+ @use '../foundation/colors' as colors;
2
+ @use '../foundation/sizes' as sizes;
3
+
4
+ .modal {
5
+ position: fixed;
6
+ inset: 0;
7
+ z-index: 10000;
8
+ }
9
+
10
+ .modal__overlay {
11
+ position: absolute;
12
+ inset: 0;
13
+ background: rgba(0, 0, 0, 0.4);
14
+ z-index: 0;
15
+ }
16
+
17
+ .modal__content {
18
+ position: absolute;
19
+ top: 50%;
20
+ left: 50%;
21
+ transform: translate(-50%, -50%);
22
+ background: colors.$surfaceColor;
23
+ border-radius: sizes.$radiusPill;
24
+ box-shadow: sizes.$cardShadow;
25
+ width: min(960px, calc(100vw - 40px));
26
+ max-height: calc(100vh - 120px);
27
+ display: flex;
28
+ flex-direction: column;
29
+ overflow: hidden;
30
+ z-index: 1;
31
+ }
32
+
33
+ .modal__header {
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: space-between;
37
+ padding: sizes.$spaceComfy sizes.$spaceRoomy;
38
+ border-bottom: 1px solid colors.$borderColor;
39
+ gap: 12px;
40
+ }
41
+
42
+ .modal__title {
43
+ margin: 0;
44
+ font-size: 16px;
45
+ font-weight: 700;
46
+ }
@@ -0,0 +1,125 @@
1
+ /* Embla carousel utilities stay isolated from builder core styles. */
2
+ .embla {
3
+ max-width: 48rem;
4
+ margin: auto;
5
+ --slide-height: 19rem;
6
+ --slide-spacing: 1rem;
7
+ --slide-size: 70%;
8
+ }
9
+ .embla__viewport {
10
+ overflow: hidden;
11
+ }
12
+ .embla__container {
13
+ display: flex;
14
+ touch-action: pan-y pinch-zoom;
15
+ margin-left: calc(var(--slide-spacing) * -1);
16
+ }
17
+ .embla__slide {
18
+ transform: translate3d(0, 0, 0);
19
+ min-width: 0;
20
+ padding-left: var(--slide-spacing);
21
+ flex: 0 0 100%;
22
+ }
23
+ .embla__slide__number {
24
+ box-shadow: inset 0 0 0 0.2rem var(--detail-medium-contrast);
25
+ border-radius: 1.8rem;
26
+ font-size: 4rem;
27
+ font-weight: 600;
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ height: var(--slide-height);
32
+ user-select: none;
33
+ }
34
+ .embla__controls {
35
+ display: grid;
36
+ grid-template-columns: auto 1fr;
37
+ justify-content: space-between;
38
+ gap: 1.2rem;
39
+ margin-top: 1.8rem;
40
+ }
41
+ .embla__buttons {
42
+ display: grid;
43
+ grid-template-columns: repeat(2, 1fr);
44
+ gap: 0.6rem;
45
+ align-items: center;
46
+ }
47
+ .embla__button {
48
+ -webkit-tap-highlight-color: rgba(var(--text-high-contrast-rgb-value), 0.5);
49
+ -webkit-appearance: none;
50
+ appearance: none;
51
+ background-color: transparent;
52
+ touch-action: manipulation;
53
+ display: inline-flex;
54
+ text-decoration: none;
55
+ cursor: pointer;
56
+ border: 0;
57
+ padding: 0;
58
+ margin: 0;
59
+ box-shadow: inset 0 0 0 0.2rem var(--detail-medium-contrast);
60
+ width: 3.6rem;
61
+ height: 3.6rem;
62
+ z-index: 1;
63
+ border-radius: 50%;
64
+ color: var(--text-body);
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ }
69
+ .embla__button:disabled {
70
+ color: var(--detail-high-contrast);
71
+ }
72
+ .embla__button__svg {
73
+ width: 35%;
74
+ height: 35%;
75
+ }
76
+ .embla__dots {
77
+ flex-wrap: wrap;
78
+ margin-right: 0;
79
+ height: 50px;
80
+ margin: 0 auto;
81
+ }
82
+ .embla__dot {
83
+ -webkit-tap-highlight-color: rgba(var(--text-high-contrast-rgb-value), 0.5);
84
+ -webkit-appearance: none;
85
+ appearance: none;
86
+ background-color: transparent;
87
+ touch-action: manipulation;
88
+ display: inline-flex;
89
+ text-decoration: none;
90
+ cursor: pointer;
91
+ border: 0;
92
+ padding: 0;
93
+ margin: 0;
94
+ width: 2.6rem;
95
+ height: 2.6rem;
96
+ display: flex;
97
+ align-items: center;
98
+ border-radius: 50%;
99
+ }
100
+ .embla__dot:after {
101
+ box-shadow: inset 0 0 0 0.2rem var(--detail-medium-contrast);
102
+ width: 1.4rem;
103
+ height: 1.4rem;
104
+ border-radius: 50%;
105
+ display: flex;
106
+ align-items: center;
107
+ content: '';
108
+ }
109
+ .embla__dot--selected:after {
110
+ box-shadow: inset 0 0 0 0.2rem var(--text-body);
111
+ }
112
+ .carousel-provider {
113
+ height: 100%;
114
+ }
115
+ .embla {
116
+ height: 100%;
117
+ }
118
+ .embla__viewport {
119
+ height: 100%;
120
+ display: flex;
121
+ flex-direction: column;
122
+ }
123
+ .embla__container {
124
+ flex: 1;
125
+ }
@@ -1,17 +1,26 @@
1
- import { TargetedScreenSize } from './TargetedScreenSize';
2
-
3
- export interface PreviewConfig {
1
+ export interface AppConfig {
4
2
  theme: 'light' | 'dark';
5
- screenSize: TargetedScreenSize;
6
- isRtl: boolean;
3
+ isRtl: boolean; //This could be device in future
7
4
  screenStyle: {
8
5
  light: { backgroundColor: string; color: string; seperatorColor?: string };
9
6
  dark: { backgroundColor: string; color: string; seperatorColor?: string };
10
7
  };
11
8
  localication: Localication;
12
9
  defaultLanguage?: string;
10
+ baseSize: { width: number; height: number };
13
11
  }
14
12
 
13
+ export const defaultAppConfig: AppConfig = {
14
+ theme: 'light',
15
+ isRtl: false,
16
+ screenStyle: {
17
+ light: { backgroundColor: '#FDFDFD', color: '#161827' },
18
+ dark: { backgroundColor: '#12131A', color: '#E9EBF9' },
19
+ },
20
+ localication: {},
21
+ baseSize: { width: 375, height: 812 },
22
+ };
23
+
15
24
  export type Localication = {
16
25
  [key: string]: {
17
26
  [key: string]: string;
@@ -1,11 +1,24 @@
1
1
  import { Node } from '../types/Node';
2
- import { PreviewConfig } from './PreviewConfig';
2
+ import { AppConfig } from './PreviewConfig';
3
3
 
4
4
  export interface ProjectBase<T> {
5
5
  name: string;
6
6
  version: string;
7
7
  data: T;
8
- previewConfig?: PreviewConfig;
8
+ appConfig?: AppConfig;
9
9
  }
10
10
 
11
11
  export interface Project extends ProjectBase<Node> {}
12
+
13
+ export type LogLevel = 'NONE' | 'ERROR' | 'WARN' | 'INFO' | 'VERBOSE';
14
+
15
+ export type LogSource = string;
16
+
17
+ export interface LogEntry {
18
+ id: string;
19
+ timestamp: number;
20
+ level: LogLevel;
21
+ source: LogSource;
22
+ message: string;
23
+ payload?: unknown;
24
+ }
@@ -0,0 +1,8 @@
1
+ declare module '*.svg' {
2
+ const content: string;
3
+ export default content;
4
+ }
5
+ declare module '*.jpg' {
6
+ const content: string;
7
+ export default content;
8
+ }
@@ -0,0 +1,7 @@
1
+ import { useRenderStore } from '../store';
2
+ import { Node } from '../types/Node';
3
+
4
+ export function copyNode(node: Node) {
5
+ const { setCopiedNode } = useRenderStore.getState();
6
+ setCopiedNode(node);
7
+ }
@@ -7,8 +7,10 @@ export function extractTextStyle<T extends TextPropsGenerated['attributes']>(
7
7
  node: NodeData<T>,
8
8
  ) {
9
9
  const attributes = node.attributes;
10
-
11
- const { screenStyle, theme } = useRenderStore.getState();
10
+ //TODO: it should be passed as a prop to the function (need a state)
11
+ const {
12
+ appConfig: { screenStyle, theme },
13
+ } = useRenderStore.getState();
12
14
  const fallbackColor =
13
15
  theme === 'light' ? screenStyle.light.color : screenStyle.dark.color;
14
16
 
@@ -48,8 +50,10 @@ export function extractTextStyle<T extends TextPropsGenerated['attributes']>(
48
50
  style.paddingTop = v as React.CSSProperties['paddingTop'];
49
51
  style.paddingBottom = v as React.CSSProperties['paddingBottom'];
50
52
  }
51
- if (attributes.marginHorizontal !== undefined) {
52
- const v = parseSize(attributes.marginHorizontal);
53
+ const marginHorizontalRaw = (attributes as Record<string, unknown>)
54
+ .marginHorizontal as string | number | undefined;
55
+ if (marginHorizontalRaw !== undefined) {
56
+ const v = parseSize(marginHorizontalRaw);
53
57
  style.marginLeft = v as React.CSSProperties['marginLeft'];
54
58
  style.marginRight = v as React.CSSProperties['marginRight'];
55
59
  }
@@ -1,5 +1,6 @@
1
1
  import { ViewPropsGenerated } from '../build-components/View/ViewProps.generated';
2
2
  import type { NodeData } from '../types/Node';
3
+ import { parseSize } from '../size-matters';
3
4
 
4
5
  export function extractViewStyle<T extends ViewPropsGenerated['attributes']>(
5
6
  node: NodeData<T>,
@@ -31,14 +32,57 @@ export function extractViewStyle<T extends ViewPropsGenerated['attributes']>(
31
32
  if (attributes.justifyContent)
32
33
  style.justifyContent =
33
34
  attributes.justifyContent as React.CSSProperties['justifyContent'];
34
- if (attributes.gap !== undefined) style.gap = attributes.gap;
35
- if (attributes.padding !== undefined) style.padding = attributes.padding;
36
- if (attributes.margin !== undefined) style.margin = attributes.margin;
35
+ const setParsedSize = <K extends keyof React.CSSProperties>(
36
+ property: K,
37
+ rawValue: string | number | undefined,
38
+ ) => {
39
+ if (rawValue === undefined) return;
40
+ const parsed = parseSize(rawValue);
41
+ style[property] = parsed as React.CSSProperties[K];
42
+ };
43
+
44
+ setParsedSize('gap', attributes.gap);
45
+ setParsedSize('padding', attributes.padding);
46
+ setParsedSize('margin', attributes.margin);
47
+
48
+ if (attributes.paddingHorizontal !== undefined) {
49
+ const parsed = parseSize(attributes.paddingHorizontal);
50
+ style.paddingLeft = parsed as React.CSSProperties['paddingLeft'];
51
+ style.paddingRight = parsed as React.CSSProperties['paddingRight'];
52
+ }
53
+ if (attributes.paddingVertical !== undefined) {
54
+ const parsed = parseSize(attributes.paddingVertical);
55
+ style.paddingTop = parsed as React.CSSProperties['paddingTop'];
56
+ style.paddingBottom = parsed as React.CSSProperties['paddingBottom'];
57
+ }
58
+
59
+ const marginHorizontalRaw = (attributes as Record<string, unknown>)
60
+ .marginHorizontal as string | number | undefined;
61
+ if (marginHorizontalRaw !== undefined) {
62
+ const parsed = parseSize(marginHorizontalRaw);
63
+ style.marginLeft = parsed as React.CSSProperties['marginLeft'];
64
+ style.marginRight = parsed as React.CSSProperties['marginRight'];
65
+ }
66
+
67
+ if (attributes.marginVertical !== undefined) {
68
+ const parsed = parseSize(attributes.marginVertical);
69
+ style.marginTop = parsed as React.CSSProperties['marginTop'];
70
+ style.marginBottom = parsed as React.CSSProperties['marginBottom'];
71
+ }
72
+
73
+ setParsedSize('paddingTop', attributes.paddingTop);
74
+ setParsedSize('paddingBottom', attributes.paddingBottom);
75
+ setParsedSize('paddingLeft', attributes.paddingLeft);
76
+ setParsedSize('paddingRight', attributes.paddingRight);
77
+ setParsedSize('marginTop', attributes.marginTop);
78
+ setParsedSize('marginBottom', attributes.marginBottom);
79
+ setParsedSize('marginLeft', attributes.marginLeft);
80
+ setParsedSize('marginRight', attributes.marginRight);
81
+
37
82
  if (attributes.backgroundColor)
38
83
  style.backgroundColor = attributes.backgroundColor;
39
- if (attributes.borderRadius !== undefined)
40
- style.borderRadius = attributes.borderRadius;
41
- if (attributes.width !== undefined) style.width = attributes.width;
42
- if (attributes.height !== undefined) style.height = attributes.height;
84
+ setParsedSize('borderRadius', attributes.borderRadius);
85
+ setParsedSize('width', attributes.width);
86
+ setParsedSize('height', attributes.height);
43
87
  return style;
44
88
  }
@@ -11,6 +11,7 @@ export function getDevices(): Device[] {
11
11
  return deviceList;
12
12
  }
13
13
 
14
+ //TODO: object instead of function
14
15
  export function getDefaultDevice(): Device {
15
16
  return getDevices()[0];
16
17
  }