@developer_tribe/react-builder 1.0.1 → 1.0.3

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