@developer_tribe/react-builder 1.2.22 → 1.2.24

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 (106) hide show
  1. package/dist/attribute-analyser/style/native/useExtractImageStyle.d.ts +6 -6
  2. package/dist/attribute-analyser/style/native/useExtractTextStyle.d.ts +6 -4
  3. package/dist/attribute-analyser/style/native/useExtractViewStyle.d.ts +5 -3
  4. package/dist/build-components/Image/ImageProps.generated.d.ts +2 -4
  5. package/dist/build-components/NavigationBarColor/NavigationBarColor.d.ts +5 -0
  6. package/dist/build-components/NavigationBarColor/NavigationBarColorProps.generated.d.ts +54 -0
  7. package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +1 -3
  8. package/dist/build-components/Separator/Separator.d.ts +5 -0
  9. package/dist/build-components/Separator/SeparatorProps.generated.d.ts +21 -0
  10. package/dist/build-components/StatusBarColor/StatusBarColor.d.ts +5 -0
  11. package/dist/build-components/StatusBarColor/StatusBarColorProps.generated.d.ts +54 -0
  12. package/dist/build-components/index.d.ts +4 -1
  13. package/dist/build-components/patterns.generated.d.ts +2111 -1251
  14. package/dist/components/AttributesEditorPanel.d.ts +1 -1
  15. package/dist/components/BuilderProvider.d.ts +1 -1
  16. package/dist/index.cjs.js +4 -4
  17. package/dist/index.cjs.js.map +1 -1
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.esm.js +4 -4
  20. package/dist/index.esm.js.map +1 -1
  21. package/dist/index.web.cjs.js +6 -6
  22. package/dist/index.web.cjs.js.map +1 -1
  23. package/dist/index.web.esm.js +4 -4
  24. package/dist/index.web.esm.js.map +1 -1
  25. package/dist/store.d.ts +4 -0
  26. package/dist/styles.css +1 -1
  27. package/dist/utils/attributeStyle.d.ts +21 -0
  28. package/dist/utils/extractImageStyle.d.ts +1 -1
  29. package/dist/utils/extractViewStyle/extractViewStyleNative.d.ts +1 -1
  30. package/package.json +7 -2
  31. package/src/DeviceMockFrame.tsx +8 -2
  32. package/src/assets/meta.json +1 -1
  33. package/src/assets/samples/paywall-1.json +44 -39
  34. package/src/assets/samples/paywall-2.json +44 -25
  35. package/src/assets/samples/paywall-app-delete-offer.json +40 -21
  36. package/src/assets/samples/paywall-app-open-offer.json +40 -21
  37. package/src/assets/samples/paywall-back-offer.json +40 -21
  38. package/src/assets/samples/paywall-notification-offer.json +40 -21
  39. package/src/assets/samples/vpn-onboard-1.json +84 -39
  40. package/src/assets/samples/vpn-onboard-2.json +85 -40
  41. package/src/assets/samples/vpn-onboard-3.json +84 -39
  42. package/src/assets/samples/vpn-onboard-4.json +84 -39
  43. package/src/assets/samples/vpn-onboard-5.json +102 -55
  44. package/src/assets/samples/vpn-onboard-6.json +87 -38
  45. package/src/attribute-analyser/style/native/useExtractImageStyle.ts +31 -25
  46. package/src/attribute-analyser/style/native/useExtractTextStyle.ts +26 -11
  47. package/src/attribute-analyser/style/native/useExtractViewStyle.ts +21 -11
  48. package/src/attributes-editor/useAttributesEditorModel.ts +23 -17
  49. package/src/build-components/BackgroundImage/pattern.json +9 -7
  50. package/src/build-components/CarouselDots/CarouselDots.tsx +12 -11
  51. package/src/build-components/CarouselProvider/CarouselProvider.tsx +3 -1
  52. package/src/build-components/Image/ImageProps.generated.ts +2 -4
  53. package/src/build-components/Image/pattern.json +15 -25
  54. package/src/build-components/NavigationBarColor/NavigationBarColor.tsx +39 -0
  55. package/src/build-components/NavigationBarColor/NavigationBarColorProps.generated.ts +71 -0
  56. package/src/build-components/NavigationBarColor/pattern.json +34 -0
  57. package/src/build-components/OnboardButton/OnboardButton.tsx +19 -5
  58. package/src/build-components/OnboardButtons/OnboardButtons.tsx +8 -10
  59. package/src/build-components/OnboardDot/OnboardDot.tsx +12 -10
  60. package/src/build-components/OnboardFooter/OnboardFooter.tsx +15 -4
  61. package/src/build-components/OnboardImage/OnboardImage.tsx +1 -1
  62. package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +1 -3
  63. package/src/build-components/OnboardProvider/OnboardProvider.tsx +3 -1
  64. package/src/build-components/RenderNode.generated.tsx +15 -0
  65. package/src/build-components/Separator/Separator.tsx +41 -0
  66. package/src/build-components/Separator/SeparatorProps.generated.ts +26 -0
  67. package/src/build-components/Separator/pattern.json +59 -0
  68. package/src/build-components/StatusBarColor/StatusBarColor.tsx +39 -0
  69. package/src/build-components/StatusBarColor/StatusBarColorProps.generated.ts +71 -0
  70. package/src/build-components/StatusBarColor/pattern.json +34 -0
  71. package/src/build-components/Text/pattern.json +45 -38
  72. package/src/build-components/index.ts +15 -0
  73. package/src/build-components/patterns.generated.ts +2153 -1272
  74. package/src/build-components/useNode.ts +24 -25
  75. package/src/components/AttributesEditorPanel.tsx +4 -5
  76. package/src/components/Builder.tsx +1 -2
  77. package/src/components/BuilderProvider.tsx +43 -6
  78. package/src/components/JsonTextEditor.tsx +2 -2
  79. package/src/components/LoadingComponent.tsx +1 -1
  80. package/src/components/RenderErrorBoundary.tsx +1 -3
  81. package/src/index.ts +3 -0
  82. package/src/migrations/migrations/1.1.2_extract_component_attributes_from_style.ts +3 -3
  83. package/src/modals/BenefitPresetsModal.tsx +1 -1
  84. package/src/modals/ProductPresetsModal.tsx +1 -1
  85. package/src/pages/DebugJsonPage.tsx +7 -4
  86. package/src/pages/ProjectDebug.tsx +1 -1
  87. package/src/pages/ProjectPage.tsx +31 -32
  88. package/src/pages/ProjectValidationPage.tsx +2 -2
  89. package/src/store.ts +13 -0
  90. package/src/styles/layout/_builder.scss +6 -0
  91. package/src/utils/__special_exceptions.ts +5 -5
  92. package/src/utils/analyseNode.ts +2 -2
  93. package/src/utils/analyseNodeByPatterns.ts +10 -9
  94. package/src/utils/analyseNodeStructural.ts +1 -1
  95. package/src/utils/attributeStyle.ts +104 -0
  96. package/src/utils/extractImageStyle.ts +17 -13
  97. package/src/utils/extractTextStyle/extractTextStyle.ts +7 -7
  98. package/src/utils/extractTextStyle/extractTextStyleNative.ts +10 -10
  99. package/src/utils/extractViewStyle/extractViewStyle.ts +8 -11
  100. package/src/utils/extractViewStyle/extractViewStyleNative.ts +19 -19
  101. package/src/utils/loadFontFamily.ts +14 -19
  102. package/src/utils/logRenderStore.ts +5 -4
  103. package/src/utils/nodeTree.ts +1 -1
  104. package/src/utils/patterns.ts +26 -31
  105. package/src/utils/repairNodeKeys.ts +5 -7
  106. package/src/utils/wrapNodeInMain.ts +3 -3
@@ -0,0 +1,59 @@
1
+ {
2
+ "schemaVersion": 2,
3
+ "pattern": {
4
+ "type": "Separator",
5
+ "children": "never",
6
+ "attributes": {
7
+ "title": "title",
8
+ "description": "description",
9
+ "style": {
10
+ "backgroundColor": "color",
11
+ "width": "size",
12
+ "height": "size",
13
+ "marginHorizontal": "size",
14
+ "marginVertical": "size",
15
+ "marginTop": "size",
16
+ "marginBottom": "size"
17
+ }
18
+ }
19
+ },
20
+ "meta": {
21
+ "desiredParent": ["all"],
22
+ "label": "Separator",
23
+ "description": "Horizontal line separator.",
24
+ "styles": {
25
+ "backgroundColor": {
26
+ "label": "Color",
27
+ "description": "Separator line color.",
28
+ "category": "style",
29
+ "specialCategory": null,
30
+ "sort": 1
31
+ }
32
+ },
33
+ "attributes": {
34
+ "width": {
35
+ "label": "Width",
36
+ "description": "Separator width.",
37
+ "category": "container",
38
+ "specialCategory": null,
39
+ "sort": 1,
40
+ "preferredScale": "s"
41
+ },
42
+ "height": {
43
+ "label": "Height",
44
+ "description": "Separator thickness.",
45
+ "category": "container",
46
+ "specialCategory": null,
47
+ "sort": 2,
48
+ "preferredScale": "vs"
49
+ }
50
+ }
51
+ },
52
+ "defaults": {
53
+ "style": {
54
+ "width": "100%",
55
+ "height": 2,
56
+ "backgroundColor": "#000000"
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,39 @@
1
+ import React, { useEffect } from 'react';
2
+ import type { StatusBarColorComponentProps } from './StatusBarColorProps.generated';
3
+ import useNode from '../useNode';
4
+ import { useBuilderParams } from '../../components/BuilderProvider';
5
+ import { parseColor } from '../../utils/parseColor';
6
+ import { getStyleBag } from '../../utils/attributeStyle';
7
+ import { useLogRender } from '../../utils/useLogRender';
8
+ import { useRenderStore } from '../../store';
9
+
10
+ function StatusBarColor({ node }: StatusBarColorComponentProps) {
11
+ useLogRender('StatusBarColor');
12
+ node = useNode(node);
13
+
14
+ const { appConfig, projectColors } = useBuilderParams();
15
+ const setStatusBarOverrideColor = useRenderStore(
16
+ (s) => s.setStatusBarOverrideColor,
17
+ );
18
+
19
+ const rawBg = getStyleBag(node.attributes)?.backgroundColor as
20
+ | string
21
+ | undefined;
22
+ const resolvedColor = parseColor(rawBg, {
23
+ projectColors,
24
+ theme: appConfig?.theme,
25
+ });
26
+
27
+ useEffect(() => {
28
+ if (resolvedColor) {
29
+ setStatusBarOverrideColor(resolvedColor);
30
+ }
31
+ return () => {
32
+ setStatusBarOverrideColor(null);
33
+ };
34
+ }, [resolvedColor, setStatusBarOverrideColor]);
35
+
36
+ return null;
37
+ }
38
+
39
+ export default React.memo(StatusBarColor);
@@ -0,0 +1,71 @@
1
+ /* AUTO-GENERATED FILE - DO NOT EDIT */
2
+
3
+ import type { NodeData } from '../../types/Node';
4
+
5
+ export type FlexDirectionOptionType = 'row' | 'column';
6
+ export type FlexWrapOptionType = 'nowrap' | 'wrap' | 'wrap-reverse';
7
+ export type AlignItemsOptionType =
8
+ | 'flex-start'
9
+ | 'center'
10
+ | 'flex-end'
11
+ | 'stretch'
12
+ | 'baseline';
13
+ export type JustifyContentOptionType =
14
+ | 'flex-start'
15
+ | 'center'
16
+ | 'flex-end'
17
+ | 'space-between'
18
+ | 'space-around'
19
+ | 'space-evenly';
20
+ export type PositionOptionType = 'relative' | 'absolute';
21
+
22
+ export interface StatusBarColorStyleGenerated {
23
+ flexDirection?: FlexDirectionOptionType;
24
+ flexWrap?: FlexWrapOptionType;
25
+ alignItems?: AlignItemsOptionType;
26
+ justifyContent?: JustifyContentOptionType;
27
+ gap?: string;
28
+ padding?: string;
29
+ paddingHorizontal?: string;
30
+ paddingVertical?: string;
31
+ paddingTop?: string;
32
+ paddingBottom?: string;
33
+ paddingLeft?: string;
34
+ paddingRight?: string;
35
+ margin?: string;
36
+ marginHorizontal?: string;
37
+ marginVertical?: string;
38
+ marginTop?: string;
39
+ marginBottom?: string;
40
+ marginLeft?: string;
41
+ marginRight?: string;
42
+ backgroundColor?: string;
43
+ borderRadius?: string;
44
+ width?: string;
45
+ minWidth?: string;
46
+ maxWidth?: string;
47
+ height?: string;
48
+ minHeight?: string;
49
+ maxHeight?: string;
50
+ flex?: number;
51
+ position?: PositionOptionType;
52
+ top?: string;
53
+ bottom?: string;
54
+ left?: string;
55
+ right?: string;
56
+ zIndex?: number;
57
+ }
58
+
59
+ export interface StatusBarColorPropsGenerated {
60
+ child: string;
61
+ attributes: {
62
+ style?: StatusBarColorStyleGenerated;
63
+ scrollable?: boolean;
64
+ title?: string;
65
+ description?: string;
66
+ };
67
+ }
68
+
69
+ export interface StatusBarColorComponentProps {
70
+ node: NodeData<StatusBarColorPropsGenerated['attributes']>;
71
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "schemaVersion": 2,
3
+ "pattern": {
4
+ "type": "StatusBarColor",
5
+ "children": "never",
6
+ "extends": "View",
7
+ "attributes": {
8
+ "title": "title",
9
+ "description": "description",
10
+ "style": {
11
+ "backgroundColor": "color"
12
+ }
13
+ }
14
+ },
15
+ "meta": {
16
+ "desiredParent": ["all"],
17
+ "label": "Status Bar Color",
18
+ "description": "Sets the OS status bar background color.",
19
+ "styles": {
20
+ "backgroundColor": {
21
+ "label": "Background Color",
22
+ "description": "Status bar background color.",
23
+ "category": "style",
24
+ "specialCategory": null,
25
+ "sort": 1
26
+ }
27
+ }
28
+ },
29
+ "defaults": {
30
+ "style": {
31
+ "backgroundColor": "THEME_COLORS.BACKGROUND"
32
+ }
33
+ }
34
+ }
@@ -16,6 +16,13 @@
16
16
  "fontWeight": "fontWeight",
17
17
  "textAlign": ["left", "center", "right", "justify"]
18
18
  }
19
+ },
20
+ "defaults": {
21
+ "style": {
22
+ "color": "THEME_COLORS.TEXT",
23
+ "fontSize": "16@fs",
24
+ "fontWeight": "400"
25
+ }
19
26
  }
20
27
  },
21
28
  "meta": {
@@ -23,45 +30,45 @@
23
30
  "label": "Text",
24
31
  "description": "Displays simple text.",
25
32
 
26
- "attributes": {
27
- "styles": {
28
- "color": {
29
- "label": "Color",
30
- "description": "Text color.",
31
- "category": "style",
32
- "specialCategory": null,
33
- "sort": 1
34
- },
35
- "fontSize": {
36
- "label": "Font Size",
37
- "description": "Text size.",
38
- "category": "style",
39
- "specialCategory": null,
40
- "sort": 2,
41
- "preferredScale": "s"
42
- },
43
- "fontFamily": {
44
- "label": "Font Family",
45
- "description": "Font family used for the text.",
46
- "category": "style",
47
- "specialCategory": null,
48
- "sort": 3
49
- },
50
- "fontWeight": {
51
- "label": "Font Weight",
52
- "description": "Text weight.",
53
- "category": "style",
54
- "specialCategory": null,
55
- "sort": 4
56
- },
57
- "textAlign": {
58
- "label": "Text Align",
59
- "description": "Text alignment.",
60
- "category": "style",
61
- "specialCategory": null,
62
- "sort": 5
63
- }
33
+ "styles": {
34
+ "color": {
35
+ "label": "Color",
36
+ "description": "Text color.",
37
+ "category": "style",
38
+ "specialCategory": null,
39
+ "sort": 1
40
+ },
41
+ "fontSize": {
42
+ "label": "Font Size",
43
+ "description": "Text size.",
44
+ "category": "style",
45
+ "specialCategory": null,
46
+ "sort": 2,
47
+ "preferredScale": "s"
64
48
  },
49
+ "fontFamily": {
50
+ "label": "Font Family",
51
+ "description": "Font family used for the text.",
52
+ "category": "style",
53
+ "specialCategory": null,
54
+ "sort": 3
55
+ },
56
+ "fontWeight": {
57
+ "label": "Font Weight",
58
+ "description": "Text weight.",
59
+ "category": "style",
60
+ "specialCategory": null,
61
+ "sort": 4
62
+ },
63
+ "textAlign": {
64
+ "label": "Text Align",
65
+ "description": "Text alignment.",
66
+ "category": "style",
67
+ "specialCategory": null,
68
+ "sort": 5
69
+ }
70
+ },
71
+ "attributes": {
65
72
  "adjustsFontSizeToFit": {
66
73
  "label": "Adjust Font Size To Fit",
67
74
  "description": "Automatically reduces font size to fit the available space.",
@@ -17,6 +17,7 @@ export const allcomponentNames = [
17
17
  'Counter',
18
18
  'Image',
19
19
  'Main',
20
+ 'NavigationBarColor',
20
21
  'Onboard',
21
22
  'OnboardButton',
22
23
  'OnboardButtons',
@@ -34,6 +35,8 @@ export const allcomponentNames = [
34
35
  'PaywallProvider',
35
36
  'PaywallSubscribeButton',
36
37
  'RadioButton',
38
+ 'Separator',
39
+ 'StatusBarColor',
37
40
  'Text',
38
41
  'View',
39
42
  ] as const;
@@ -86,6 +89,10 @@ export type {
86
89
  MainPropsGenerated,
87
90
  MainComponentProps,
88
91
  } from './Main/MainProps.generated';
92
+ export type {
93
+ NavigationBarColorPropsGenerated,
94
+ NavigationBarColorComponentProps,
95
+ } from './NavigationBarColor/NavigationBarColorProps.generated';
89
96
  export type {
90
97
  OnboardPropsGenerated,
91
98
  OnboardComponentProps,
@@ -154,6 +161,14 @@ export type {
154
161
  RadioButtonPropsGenerated,
155
162
  RadioButtonComponentProps,
156
163
  } from './RadioButton/RadioButtonProps.generated';
164
+ export type {
165
+ SeparatorPropsGenerated,
166
+ SeparatorComponentProps,
167
+ } from './Separator/SeparatorProps.generated';
168
+ export type {
169
+ StatusBarColorPropsGenerated,
170
+ StatusBarColorComponentProps,
171
+ } from './StatusBarColor/StatusBarColorProps.generated';
157
172
  export type {
158
173
  TextPropsGenerated,
159
174
  TextComponentProps,