@developer_tribe/react-builder 1.2.8 → 1.2.10

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 (192) hide show
  1. package/dist/AttributesEditor.d.ts +2 -11
  2. package/dist/attribute-analyser/style/native/useExtractImageStyle.d.ts +10 -0
  3. package/dist/attribute-analyser/style/native/useExtractTextStyle.d.ts +9 -0
  4. package/dist/attribute-analyser/style/native/useExtractViewStyle.d.ts +8 -0
  5. package/dist/attribute-analyser/style/web/useExtractImageStyle.d.ts +4 -0
  6. package/dist/attribute-analyser/style/web/useExtractTextStyle.d.ts +4 -0
  7. package/dist/attribute-analyser/style/web/useExtractViewStyle.d.ts +4 -0
  8. package/dist/attributes-editor/AttributesEditorFields.d.ts +18 -0
  9. package/dist/attributes-editor/AttributesEditorView.d.ts +4 -0
  10. package/dist/attributes-editor/attributesEditorModelTypes.d.ts +67 -0
  11. package/dist/attributes-editor/attributesEditorUtils.d.ts +19 -0
  12. package/dist/attributes-editor/useAttributesEditorModel.d.ts +2 -0
  13. package/dist/build-components/BIcon/BIconProps.generated.d.ts +6 -6
  14. package/dist/build-components/BackgroundImage/BackgroundImageProps.generated.d.ts +3 -3
  15. package/dist/build-components/Button/ButtonProps.generated.d.ts +1 -1
  16. package/dist/build-components/Carousel/CarouselProps.generated.d.ts +2 -2
  17. package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +4 -4
  18. package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +3 -3
  19. package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +1 -1
  20. package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +1 -1
  21. package/dist/build-components/Image/ImageProps.generated.d.ts +5 -3
  22. package/dist/build-components/Main/MainProps.generated.d.ts +2 -2
  23. package/dist/build-components/Onboard/OnboardProps.generated.d.ts +1 -1
  24. package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +9 -8
  25. package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +11 -11
  26. package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +15 -9
  27. package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +10 -10
  28. package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +8 -6
  29. package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +6 -3
  30. package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +5 -4
  31. package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +3 -3
  32. package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +3 -3
  33. package/dist/build-components/PaywallBackground/PaywallBackgroundProps.generated.d.ts +1 -1
  34. package/dist/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.d.ts +6 -6
  35. package/dist/build-components/PaywallOptions/PaywallOptionsProps.generated.d.ts +1 -1
  36. package/dist/build-components/PaywallProvider/PaywallProviderProps.generated.d.ts +1 -1
  37. package/dist/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.d.ts +1 -1
  38. package/dist/build-components/RadioButton/RadioButtonProps.generated.d.ts +4 -4
  39. package/dist/build-components/Text/TextProps.generated.d.ts +3 -3
  40. package/dist/build-components/View/ViewProps.generated.d.ts +1 -1
  41. package/dist/build-components/patterns.generated.d.ts +2690 -5804
  42. package/dist/index.cjs.js +5 -5
  43. package/dist/index.cjs.js.map +1 -1
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.esm.js +5 -5
  46. package/dist/index.esm.js.map +1 -1
  47. package/dist/index.native.cjs.js +6 -4
  48. package/dist/index.native.cjs.js.map +1 -1
  49. package/dist/index.native.d.ts +5 -6
  50. package/dist/index.native.esm.js +6 -4
  51. package/dist/index.native.esm.js.map +1 -1
  52. package/dist/migrations/migratePipe.d.ts +1 -1
  53. package/dist/migrations/migrations/1.1.2_extract_component_attributes_from_style.d.ts +2 -0
  54. package/dist/mockOS/components/PermissionModal.d.ts +1 -2
  55. package/dist/styles.css +1 -1
  56. package/dist/types/PreviewConfig.d.ts +1 -5
  57. package/dist/utils/getMeta.d.ts +5 -0
  58. package/dist/utils/patterns.d.ts +12 -0
  59. package/package.json +4 -2
  60. package/scripts/prebuild/prebuild.js +14 -0
  61. package/scripts/prebuild/utils/createGeneratedProps.js +19 -13
  62. package/scripts/prebuild/utils/index.js +1 -0
  63. package/scripts/prebuild/utils/updateMetaJson.js +66 -0
  64. package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +37 -3
  65. package/scripts/prebuild/utils/validatePatternJson.js +27 -2
  66. package/scripts/public/scripts/build/index.js +20 -3
  67. package/scripts/public/scripts/build/info.json +6 -0
  68. package/scripts/public/scripts/build/utils/createComponentsIndex.js +9 -3
  69. package/scripts/public/scripts/build/utils/createRenderNodeGenerated.js +66 -8
  70. package/src/AttributesEditor.tsx +8 -944
  71. package/src/assets/meta.json +4 -0
  72. package/src/assets/samples/carousel-sample.json +1 -1
  73. package/src/assets/samples/getSamples.ts +2 -0
  74. package/src/assets/samples/paywall-1.json +11 -7
  75. package/src/assets/samples/simple-1.json +3 -3
  76. package/src/assets/samples/simple-2.json +3 -3
  77. package/src/assets/samples/unmigrated-builder-1.1.1.json +87 -0
  78. package/src/assets/samples/unmigrated-builder1.json +1 -1
  79. package/src/assets/samples/unvalidated-builder1.json +3 -3
  80. package/src/assets/samples/unvalidated-crash1.json +1 -1
  81. package/src/assets/samples/unvalidated-crashcomponent1.json +1 -1
  82. package/src/assets/samples/vpn-onboard-1.json +1 -1
  83. package/src/assets/samples/vpn-onboard-2.json +1 -1
  84. package/src/assets/samples/vpn-onboard-3.json +1 -1
  85. package/src/assets/samples/vpn-onboard-4.json +1 -1
  86. package/src/assets/samples/vpn-onboard-5.json +1 -1
  87. package/src/assets/samples/vpn-onboard-6.json +1 -1
  88. package/src/attribute-analyser/style/native/useExtractImageStyle.ts +46 -0
  89. package/src/attribute-analyser/style/native/useExtractTextStyle.ts +50 -0
  90. package/src/attribute-analyser/style/native/useExtractViewStyle.ts +32 -0
  91. package/src/attribute-analyser/style/web/useExtractImageStyle.ts +20 -0
  92. package/src/attribute-analyser/style/web/useExtractTextStyle.ts +27 -0
  93. package/src/attribute-analyser/style/web/useExtractViewStyle.ts +20 -0
  94. package/src/attributes-editor/AttributesEditorFields.tsx +248 -0
  95. package/src/attributes-editor/AttributesEditorView.tsx +360 -0
  96. package/src/attributes-editor/attributesEditorModelTypes.ts +86 -0
  97. package/src/attributes-editor/attributesEditorUtils.ts +102 -0
  98. package/src/attributes-editor/useAttributesEditorModel.ts +477 -0
  99. package/src/build-components/BIcon/BIcon.tsx +4 -4
  100. package/src/build-components/BIcon/BIconProps.generated.ts +6 -6
  101. package/src/build-components/BIcon/pattern.json +5 -6
  102. package/src/build-components/BackgroundImage/BackgroundImage.tsx +3 -2
  103. package/src/build-components/BackgroundImage/BackgroundImageProps.generated.ts +3 -3
  104. package/src/build-components/Button/Button.tsx +2 -2
  105. package/src/build-components/Button/ButtonProps.generated.ts +1 -1
  106. package/src/build-components/Button/pattern.json +17 -15
  107. package/src/build-components/Carousel/Carousel.tsx +1 -1
  108. package/src/build-components/Carousel/CarouselProps.generated.ts +2 -2
  109. package/src/build-components/CarouselButtons/CarouselButtons.tsx +4 -7
  110. package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +7 -7
  111. package/src/build-components/CarouselButtons/pattern.json +2 -1
  112. package/src/build-components/CarouselDots/CarouselDots.tsx +2 -2
  113. package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +9 -9
  114. package/src/build-components/CarouselItem/CarouselItem.tsx +1 -1
  115. package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +1 -1
  116. package/src/build-components/CarouselProvider/CarouselProvider.tsx +1 -1
  117. package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +1 -1
  118. package/src/build-components/Image/Image.tsx +1 -1
  119. package/src/build-components/Image/ImageProps.generated.ts +5 -3
  120. package/src/build-components/Image/pattern.json +10 -9
  121. package/src/build-components/Main/Main.tsx +2 -2
  122. package/src/build-components/Main/MainProps.generated.ts +2 -2
  123. package/src/build-components/Main/pattern.json +2 -1
  124. package/src/build-components/Onboard/OnboardProps.generated.ts +1 -1
  125. package/src/build-components/OnboardButton/OnboardButton.tsx +7 -6
  126. package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +14 -13
  127. package/src/build-components/OnboardButton/pattern.json +9 -7
  128. package/src/build-components/OnboardButtons/OnboardButtons.tsx +31 -31
  129. package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +14 -14
  130. package/src/build-components/OnboardButtons/pattern.json +9 -7
  131. package/src/build-components/OnboardDot/OnboardDot.tsx +7 -6
  132. package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +26 -9
  133. package/src/build-components/OnboardFooter/OnboardFooter.tsx +17 -16
  134. package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +10 -10
  135. package/src/build-components/OnboardFooter/pattern.json +16 -14
  136. package/src/build-components/OnboardImage/OnboardImage.tsx +8 -8
  137. package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +8 -6
  138. package/src/build-components/OnboardImage/pattern.json +2 -1
  139. package/src/build-components/OnboardItem/OnboardItem.tsx +1 -1
  140. package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +6 -3
  141. package/src/build-components/OnboardItem/pattern.json +2 -1
  142. package/src/build-components/OnboardProvider/OnboardProvider.tsx +1 -1
  143. package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +5 -4
  144. package/src/build-components/OnboardProvider/pattern.json +2 -1
  145. package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +3 -3
  146. package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +3 -3
  147. package/src/build-components/PaywallBackground/PaywallBackground.tsx +1 -1
  148. package/src/build-components/PaywallBackground/PaywallBackgroundProps.generated.ts +1 -1
  149. package/src/build-components/PaywallCloseButton/PaywallCloseButton.tsx +5 -4
  150. package/src/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.ts +6 -6
  151. package/src/build-components/PaywallOptions/PaywallOptionButton.tsx +1 -1
  152. package/src/build-components/PaywallOptions/PaywallOptionsProps.generated.ts +1 -1
  153. package/src/build-components/PaywallProvider/PaywallProvider.tsx +1 -1
  154. package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +1 -1
  155. package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButton.tsx +1 -1
  156. package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.ts +1 -1
  157. package/src/build-components/RadioButton/RadioButton.tsx +5 -5
  158. package/src/build-components/RadioButton/RadioButtonProps.generated.ts +4 -4
  159. package/src/build-components/RadioButton/pattern.json +9 -7
  160. package/src/build-components/Text/Text.tsx +6 -6
  161. package/src/build-components/Text/TextProps.generated.ts +3 -3
  162. package/src/build-components/Text/pattern.json +15 -11
  163. package/src/build-components/View/View.tsx +1 -1
  164. package/src/build-components/View/ViewProps.generated.ts +1 -1
  165. package/src/build-components/View/pattern.json +71 -66
  166. package/src/build-components/patterns.generated.ts +3059 -6008
  167. package/src/components/AttributesEditorPanel.tsx +2 -2
  168. package/src/index.native.ts +6 -9
  169. package/src/index.ts +1 -0
  170. package/src/migrations/migratePipe.ts +7 -3
  171. package/src/migrations/migrations/1.1.2_extract_component_attributes_from_style.ts +211 -0
  172. package/src/mockOS/components/MockOSRouter.tsx +3 -1
  173. package/src/mockOS/components/PermissionModal.tsx +20 -160
  174. package/src/mockOS/components/SubscriptionModal.tsx +41 -278
  175. package/src/pages/ProjectPage.tsx +12 -6
  176. package/src/styles/components/_attributes-editor.scss +122 -0
  177. package/src/styles/components/_mockos-router.scss +388 -0
  178. package/src/styles/components/_onboard.scss +23 -0
  179. package/src/styles/index.scss +1 -0
  180. package/src/types/PreviewConfig.ts +1 -5
  181. package/src/utils/analyseNodeByPatterns.ts +39 -4
  182. package/src/utils/extractTextStyle/extractTextStyle.ts +4 -1
  183. package/src/utils/getMeta.ts +15 -0
  184. package/src/utils/patterns.ts +47 -4
  185. package/dist/hooks/useExtractImageStyle.d.ts +0 -5
  186. package/dist/hooks/useExtractTextStyle.d.ts +0 -3
  187. package/dist/hooks/useExtractViewStyle.d.ts +0 -3
  188. package/dist/migrations/migrations/1.1.0_normalize_style_attributes.d.ts +0 -2
  189. package/src/hooks/useExtractImageStyle.ts +0 -30
  190. package/src/hooks/useExtractTextStyle.ts +0 -34
  191. package/src/hooks/useExtractViewStyle.ts +0 -30
  192. package/src/migrations/migrations/1.1.0_normalize_style_attributes.ts +0 -80
@@ -25,7 +25,8 @@
25
25
  ],
26
26
  "label": "Onboard Provider",
27
27
  "description": "Provides shared settings for onboarding.",
28
- "styles": {
28
+ "styles": {},
29
+ "attributes": {
29
30
  "theme": {
30
31
  "label": "Theme",
31
32
  "description": "Controls which app theme(s) this onboarding is intended for.",
@@ -25,9 +25,6 @@ export interface OnboardSubtitleStyleGenerated {
25
25
  fontFamily?: string;
26
26
  fontWeight?: string;
27
27
  textAlign?: TextAlignOptionType;
28
- adjustsFontSizeToFit?: boolean;
29
- showEllipsis?: boolean;
30
- scrollable?: boolean;
31
28
  flexDirection?: FlexDirectionOptionType;
32
29
  alignItems?: AlignItemsOptionType;
33
30
  justifyContent?: JustifyContentOptionType;
@@ -67,6 +64,9 @@ export interface OnboardSubtitlePropsGenerated {
67
64
  child: string;
68
65
  attributes: {
69
66
  style?: OnboardSubtitleStyleGenerated;
67
+ adjustsFontSizeToFit?: boolean;
68
+ showEllipsis?: boolean;
69
+ scrollable?: boolean;
70
70
  };
71
71
  }
72
72
 
@@ -25,9 +25,6 @@ export interface OnboardTitleStyleGenerated {
25
25
  fontFamily?: string;
26
26
  fontWeight?: string;
27
27
  textAlign?: TextAlignOptionType;
28
- adjustsFontSizeToFit?: boolean;
29
- showEllipsis?: boolean;
30
- scrollable?: boolean;
31
28
  flexDirection?: FlexDirectionOptionType;
32
29
  alignItems?: AlignItemsOptionType;
33
30
  justifyContent?: JustifyContentOptionType;
@@ -67,6 +64,9 @@ export interface OnboardTitlePropsGenerated {
67
64
  child: string;
68
65
  attributes: {
69
66
  style?: OnboardTitleStyleGenerated;
67
+ adjustsFontSizeToFit?: boolean;
68
+ showEllipsis?: boolean;
69
+ scrollable?: boolean;
70
70
  };
71
71
  }
72
72
 
@@ -2,7 +2,7 @@ import React, { useId, useMemo } from 'react';
2
2
  import type { PaywallBackgroundComponentProps } from './PaywallBackgroundProps.generated';
3
3
  import useNode from '../useNode';
4
4
  import { useBuilderParams } from '../../components/BuilderProvider';
5
- import { useExtractViewStyle } from '../../hooks/useExtractViewStyle';
5
+ import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
6
6
  import { useLogRender } from '../../utils/useLogRender';
7
7
  import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
8
8
  import { useMergedStyle } from '../../utils/useMergedStyle';
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
19
19
  export type PositionOptionType = 'relative' | 'absolute';
20
20
 
21
21
  export interface PaywallBackgroundStyleGenerated {
22
- scrollable?: boolean;
23
22
  flexDirection?: FlexDirectionOptionType;
24
23
  alignItems?: AlignItemsOptionType;
25
24
  justifyContent?: JustifyContentOptionType;
@@ -59,6 +58,7 @@ export interface PaywallBackgroundPropsGenerated {
59
58
  child: string;
60
59
  attributes: {
61
60
  style?: PaywallBackgroundStyleGenerated;
61
+ scrollable?: boolean;
62
62
  };
63
63
  }
64
64
 
@@ -2,7 +2,7 @@ import React, { useId, useMemo } from 'react';
2
2
  import type { PaywallCloseButtonComponentProps } from './PaywallCloseButtonProps.generated';
3
3
  import useNode from '../useNode';
4
4
  import { useBuilderParams } from '../../components/BuilderProvider';
5
- import { useExtractTextStyle } from '../../hooks/useExtractTextStyle';
5
+ import { useExtractTextStyle } from '../../attribute-analyser/style/web/useExtractTextStyle';
6
6
  import { useLogRender } from '../../utils/useLogRender';
7
7
  import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
8
8
  import { useMergedStyle } from '../../utils/useMergedStyle';
@@ -33,9 +33,10 @@ function PaywallCloseButton({ node }: PaywallCloseButtonComponentProps) {
33
33
  isSelected ? SELECTED_OUTLINE_STYLE : undefined,
34
34
  );
35
35
 
36
- const styleBag = node.attributes?.style;
37
- const iconType = styleBag?.iconType ?? 'close';
38
- const size = styleBag?.size ?? (style.fontSize as number | undefined) ?? 24;
36
+ const attrs = node.attributes;
37
+ const styleBag = attrs?.style;
38
+ const iconType = attrs?.iconType ?? 'close';
39
+ const size = attrs?.size ?? (style.fontSize as number | undefined) ?? 24;
39
40
  const color =
40
41
  (style.color as string | undefined) ??
41
42
  (styleBag?.color as string | undefined);
@@ -20,17 +20,11 @@ export type JustifyContentOptionType =
20
20
  export type PositionOptionType = 'relative' | 'absolute';
21
21
 
22
22
  export interface PaywallCloseButtonStyleGenerated {
23
- iconType?: string;
24
- size?: number;
25
- strokeWidth?: number;
26
23
  color?: string;
27
24
  fontSize?: string;
28
25
  fontFamily?: string;
29
26
  fontWeight?: string;
30
27
  textAlign?: TextAlignOptionType;
31
- adjustsFontSizeToFit?: boolean;
32
- showEllipsis?: boolean;
33
- scrollable?: boolean;
34
28
  flexDirection?: FlexDirectionOptionType;
35
29
  alignItems?: AlignItemsOptionType;
36
30
  justifyContent?: JustifyContentOptionType;
@@ -70,6 +64,12 @@ export interface PaywallCloseButtonPropsGenerated {
70
64
  child: string;
71
65
  attributes: {
72
66
  style?: PaywallCloseButtonStyleGenerated;
67
+ iconType?: string;
68
+ size?: number;
69
+ strokeWidth?: number;
70
+ adjustsFontSizeToFit?: boolean;
71
+ showEllipsis?: boolean;
72
+ scrollable?: boolean;
73
73
  };
74
74
  }
75
75
 
@@ -1,6 +1,6 @@
1
1
  import { useId, useMemo } from 'react';
2
2
  import type { Product } from '../../paywall/types/paywall-types';
3
- import { useExtractViewStyle } from '../../hooks/useExtractViewStyle';
3
+ import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
4
4
  import type { NodeData } from '../../types/Node';
5
5
  import { useBuilderParams } from '../../components/BuilderProvider';
6
6
  import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
19
19
  export type PositionOptionType = 'relative' | 'absolute';
20
20
 
21
21
  export interface PaywallOptionsStyleGenerated {
22
- scrollable?: boolean;
23
22
  flexDirection?: FlexDirectionOptionType;
24
23
  alignItems?: AlignItemsOptionType;
25
24
  justifyContent?: JustifyContentOptionType;
@@ -59,6 +58,7 @@ export interface PaywallOptionsPropsGenerated {
59
58
  child: string;
60
59
  attributes: {
61
60
  style?: PaywallOptionsStyleGenerated;
61
+ scrollable?: boolean;
62
62
  };
63
63
  }
64
64
 
@@ -3,7 +3,7 @@ import type { PaywallProviderComponentProps } from './PaywallProviderProps.gener
3
3
  import RenderNode from '../RenderNode.generated';
4
4
  import type { Node } from '../../types/Node';
5
5
  import useNode from '../useNode';
6
- import { useExtractViewStyle } from '../../hooks/useExtractViewStyle';
6
+ import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
7
7
  import { useLogRender } from '../../utils/useLogRender';
8
8
  import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
9
9
  import { useMergedStyle } from '../../utils/useMergedStyle';
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
19
19
  export type PositionOptionType = 'relative' | 'absolute';
20
20
 
21
21
  export interface PaywallProviderStyleGenerated {
22
- scrollable?: boolean;
23
22
  flexDirection?: FlexDirectionOptionType;
24
23
  alignItems?: AlignItemsOptionType;
25
24
  justifyContent?: JustifyContentOptionType;
@@ -59,6 +58,7 @@ export interface PaywallProviderPropsGenerated {
59
58
  child: string;
60
59
  attributes: {
61
60
  style?: PaywallProviderStyleGenerated;
61
+ scrollable?: boolean;
62
62
  };
63
63
  }
64
64
 
@@ -3,7 +3,7 @@ import type { PaywallSubscribeButtonComponentProps } from './PaywallSubscribeBut
3
3
  import useNode from '../useNode';
4
4
  import { useBuilderParams } from '../../components/BuilderProvider';
5
5
  import { useLogRender } from '../../utils/useLogRender';
6
- import { useExtractTextStyle } from '../../hooks/useExtractTextStyle';
6
+ import { useExtractTextStyle } from '../../attribute-analyser/style/web/useExtractTextStyle';
7
7
  import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
8
8
  import { useMergedStyle } from '../../utils/useMergedStyle';
9
9
  import { useLocalize } from '../../hooks/useLocalize';
@@ -34,7 +34,6 @@ export interface PaywallSubscribeButtonStyleGenerated {
34
34
  color?: string;
35
35
  fontSize?: string;
36
36
  fontWeight?: FontWeightOptionType;
37
- scrollable?: boolean;
38
37
  flexDirection?: FlexDirectionOptionType;
39
38
  alignItems?: AlignItemsOptionType;
40
39
  justifyContent?: JustifyContentOptionType;
@@ -74,6 +73,7 @@ export interface PaywallSubscribeButtonPropsGenerated {
74
73
  child: string;
75
74
  attributes: {
76
75
  style?: PaywallSubscribeButtonStyleGenerated;
76
+ scrollable?: boolean;
77
77
  };
78
78
  }
79
79
 
@@ -2,7 +2,7 @@ import React, { useContext, useId, useMemo } from 'react';
2
2
  import type { RadioButtonComponentProps } from './RadioButtonProps.generated';
3
3
  import useNode from '../useNode';
4
4
  import { useBuilderParams } from '../../components/BuilderProvider';
5
- import { useExtractViewStyle } from '../../hooks/useExtractViewStyle';
5
+ import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
6
6
  import { useLogRender } from '../../utils/useLogRender';
7
7
  import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
8
8
  import { useMergedStyle } from '../../utils/useMergedStyle';
@@ -96,10 +96,10 @@ function RadioButton({ node }: RadioButtonComponentProps) {
96
96
  isSelected ? SELECTED_OUTLINE_STYLE : undefined,
97
97
  );
98
98
 
99
- const styleBag = node.attributes?.style;
100
- const selected = Boolean(styleBag?.selected);
101
- const color = styleBag?.color;
102
- const size = parseNumberLike(styleBag?.size);
99
+ const attrs = node.attributes;
100
+ const selected = Boolean(attrs?.selected);
101
+ const color = attrs?.color;
102
+ const size = parseNumberLike(attrs?.size);
103
103
 
104
104
  return (
105
105
  <div
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
19
19
  export type PositionOptionType = 'relative' | 'absolute';
20
20
 
21
21
  export interface RadioButtonStyleGenerated {
22
- scrollable?: boolean;
23
22
  flexDirection?: FlexDirectionOptionType;
24
23
  alignItems?: AlignItemsOptionType;
25
24
  justifyContent?: JustifyContentOptionType;
@@ -53,15 +52,16 @@ export interface RadioButtonStyleGenerated {
53
52
  left?: string;
54
53
  right?: string;
55
54
  zIndex?: number;
56
- selected?: boolean;
57
- color?: string;
58
- size?: number;
59
55
  }
60
56
 
61
57
  export interface RadioButtonPropsGenerated {
62
58
  child: string;
63
59
  attributes: {
64
60
  style?: RadioButtonStyleGenerated;
61
+ scrollable?: boolean;
62
+ selected?: boolean;
63
+ color?: string;
64
+ size?: number;
65
65
  };
66
66
  }
67
67
 
@@ -17,13 +17,6 @@
17
17
  "label": "Radio Button",
18
18
  "description": "Generic radio button icon.",
19
19
  "styles": {
20
- "selected": {
21
- "label": "Selected",
22
- "description": "Whether the radio is selected.",
23
- "category": "other",
24
- "specialCategory": null,
25
- "sort": 0
26
- },
27
20
  "color": {
28
21
  "label": "Color",
29
22
  "description": "Radio color.",
@@ -38,6 +31,15 @@
38
31
  "specialCategory": null,
39
32
  "sort": 2
40
33
  }
34
+ },
35
+ "attributes": {
36
+ "selected": {
37
+ "label": "Selected",
38
+ "description": "Whether the radio is selected.",
39
+ "category": "other",
40
+ "specialCategory": null,
41
+ "sort": 0
42
+ }
41
43
  }
42
44
  }
43
45
  }
@@ -8,7 +8,7 @@ import React, {
8
8
  import type { TextComponentProps } from './TextProps.generated';
9
9
  import useNode from '../useNode';
10
10
  import { useBuilderParams } from '../../components/BuilderProvider';
11
- import { useExtractTextStyle } from '../../hooks/useExtractTextStyle';
11
+ import { useExtractTextStyle } from '../../attribute-analyser/style/web/useExtractTextStyle';
12
12
  import { useLogRender } from '../../utils/useLogRender';
13
13
  import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
14
14
  import { useMergedStyle } from '../../utils/useMergedStyle';
@@ -37,11 +37,11 @@ function Text({ node }: TextComponentProps) {
37
37
  [localize, keyOrText],
38
38
  );
39
39
 
40
- const attrs = node.attributes;
41
- const styleBag = attrs?.style;
42
- const adjustsFontSizeToFit =
43
- (styleBag?.adjustsFontSizeToFit as boolean | undefined) ?? false;
44
- const showEllipsis = (styleBag?.showEllipsis as boolean | undefined) ?? false;
40
+ const styleBag = node.attributes?.style as unknown as
41
+ | { adjustsFontSizeToFit?: boolean; showEllipsis?: boolean }
42
+ | undefined;
43
+ const adjustsFontSizeToFit = styleBag?.adjustsFontSizeToFit ?? false;
44
+ const showEllipsis = styleBag?.showEllipsis ?? false;
45
45
 
46
46
  useLayoutEffect(() => {
47
47
  if (!adjustsFontSizeToFit) {
@@ -20,7 +20,6 @@ export type PositionOptionType = 'relative' | 'absolute';
20
20
  export type TextAlignOptionType = 'left' | 'center' | 'right' | 'justify';
21
21
 
22
22
  export interface TextStyleGenerated {
23
- scrollable?: boolean;
24
23
  flexDirection?: FlexDirectionOptionType;
25
24
  alignItems?: AlignItemsOptionType;
26
25
  justifyContent?: JustifyContentOptionType;
@@ -59,14 +58,15 @@ export interface TextStyleGenerated {
59
58
  fontFamily?: string;
60
59
  fontWeight?: string;
61
60
  textAlign?: TextAlignOptionType;
62
- adjustsFontSizeToFit?: boolean;
63
- showEllipsis?: boolean;
64
61
  }
65
62
 
66
63
  export interface TextPropsGenerated {
67
64
  child: string;
68
65
  attributes: {
69
66
  style?: TextStyleGenerated;
67
+ scrollable?: boolean;
68
+ adjustsFontSizeToFit?: boolean;
69
+ showEllipsis?: boolean;
70
70
  };
71
71
  }
72
72
 
@@ -5,13 +5,15 @@
5
5
  "children": "string",
6
6
  "extends": "View",
7
7
  "attributes": {
8
- "color": "color",
9
- "fontSize": "size",
10
- "fontFamily": "fontFamily",
11
- "fontWeight": "fontWeight",
12
- "textAlign": ["left", "center", "right", "justify"],
13
8
  "adjustsFontSizeToFit": "boolean",
14
- "showEllipsis": "boolean"
9
+ "showEllipsis": "boolean",
10
+ "style": {
11
+ "color": "color",
12
+ "fontSize": "size",
13
+ "fontFamily": "fontFamily",
14
+ "fontWeight": "fontWeight",
15
+ "textAlign": ["left", "center", "right", "justify"]
16
+ }
15
17
  }
16
18
  },
17
19
  "meta": {
@@ -54,20 +56,22 @@
54
56
  "category": "style",
55
57
  "specialCategory": null,
56
58
  "sort": 5
57
- },
59
+ }
60
+ },
61
+ "attributes": {
58
62
  "adjustsFontSizeToFit": {
59
63
  "label": "Adjust Font Size To Fit",
60
64
  "description": "Automatically reduces font size to fit the available space.",
61
- "category": "style",
65
+ "category": "other",
62
66
  "specialCategory": null,
63
- "sort": 6
67
+ "sort": 1
64
68
  },
65
69
  "showEllipsis": {
66
70
  "label": "Show Ellipsis",
67
71
  "description": "If text overflows, show ellipsis (…); applied as single-line truncation.",
68
- "category": "style",
72
+ "category": "other",
69
73
  "specialCategory": null,
70
- "sort": 7
74
+ "sort": 2
71
75
  }
72
76
  }
73
77
  }
@@ -4,7 +4,7 @@ import RenderNode from '../RenderNode.generated';
4
4
  import { Node } from '../../types/Node';
5
5
  import useNode from '../useNode';
6
6
  import { useBuilderParams } from '../../components/BuilderProvider';
7
- import { useExtractViewStyle } from '../../hooks/useExtractViewStyle';
7
+ import { useExtractViewStyle } from '../../attribute-analyser/style/web/useExtractViewStyle';
8
8
  import { useLogRender } from '../../utils/useLogRender';
9
9
  import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
10
10
  import { useMergedStyle } from '../../utils/useMergedStyle';
@@ -19,7 +19,6 @@ export type JustifyContentOptionType =
19
19
  export type PositionOptionType = 'relative' | 'absolute';
20
20
 
21
21
  export interface ViewStyleGenerated {
22
- scrollable?: boolean;
23
22
  flexDirection?: FlexDirectionOptionType;
24
23
  alignItems?: AlignItemsOptionType;
25
24
  justifyContent?: JustifyContentOptionType;
@@ -59,6 +58,7 @@ export interface ViewPropsGenerated {
59
58
  child: string;
60
59
  attributes: {
61
60
  style?: ViewStyleGenerated;
61
+ scrollable?: boolean;
62
62
  };
63
63
  }
64
64
 
@@ -5,57 +5,60 @@
5
5
  "children": "node",
6
6
  "attributes": {
7
7
  "scrollable": "boolean",
8
- "flexDirection": [
9
- "row",
10
- "column"
11
- ],
12
- "alignItems": [
13
- "flex-start",
14
- "center",
15
- "flex-end",
16
- "stretch",
17
- "baseline"
18
- ],
19
- "justifyContent": [
20
- "flex-start",
21
- "center",
22
- "flex-end",
23
- "space-between",
24
- "space-around",
25
- "space-evenly"
26
- ],
27
- "gap": "size",
28
- "padding": "size",
29
- "paddingHorizontal": "size",
30
- "paddingVertical": "size",
31
- "paddingTop": "size",
32
- "paddingBottom": "size",
33
- "paddingLeft": "size",
34
- "paddingRight": "size",
35
- "margin": "size",
36
- "marginVertical": "size",
37
- "marginTop": "size",
38
- "marginBottom": "size",
39
- "marginLeft": "size",
40
- "marginRight": "size",
41
- "backgroundColor": "color",
42
- "borderRadius": "size",
43
- "width": "size",
44
- "minWidth": "size",
45
- "maxWidth": "size",
46
- "height": "size",
47
- "minHeight": "size",
48
- "maxHeight": "size",
49
- "flex": "number",
50
- "position": [
51
- "relative",
52
- "absolute"
53
- ],
54
- "top": "size",
55
- "bottom": "size",
56
- "left": "size",
57
- "right": "size",
58
- "zIndex": "number"
8
+ "style": {
9
+ "flexDirection": [
10
+ "row",
11
+ "column"
12
+ ],
13
+ "alignItems": [
14
+ "flex-start",
15
+ "center",
16
+ "flex-end",
17
+ "stretch",
18
+ "baseline"
19
+ ],
20
+ "justifyContent": [
21
+ "flex-start",
22
+ "center",
23
+ "flex-end",
24
+ "space-between",
25
+ "space-around",
26
+ "space-evenly"
27
+ ],
28
+ "gap": "size",
29
+ "padding": "size",
30
+ "paddingHorizontal": "size",
31
+ "paddingVertical": "size",
32
+ "paddingTop": "size",
33
+ "paddingBottom": "size",
34
+ "paddingLeft": "size",
35
+ "paddingRight": "size",
36
+ "margin": "size",
37
+ "marginHorizontal": "size",
38
+ "marginVertical": "size",
39
+ "marginTop": "size",
40
+ "marginBottom": "size",
41
+ "marginLeft": "size",
42
+ "marginRight": "size",
43
+ "backgroundColor": "color",
44
+ "borderRadius": "size",
45
+ "width": "size",
46
+ "minWidth": "size",
47
+ "maxWidth": "size",
48
+ "height": "size",
49
+ "minHeight": "size",
50
+ "maxHeight": "size",
51
+ "flex": "number",
52
+ "position": [
53
+ "relative",
54
+ "absolute"
55
+ ],
56
+ "top": "size",
57
+ "bottom": "size",
58
+ "left": "size",
59
+ "right": "size",
60
+ "zIndex": "number"
61
+ }
59
62
  }
60
63
  },
61
64
  "meta": {
@@ -91,6 +94,23 @@
91
94
  }
92
95
  },
93
96
  "styles": {
97
+ "backgroundColor": {
98
+ "label": "Background Color",
99
+ "description": "Background fill color.",
100
+ "category": "style",
101
+ "specialCategory": null,
102
+ "sort": 20
103
+ },
104
+ "borderRadius": {
105
+ "label": "Border Radius",
106
+ "description": "Corner rounding amount.",
107
+ "category": "style",
108
+ "specialCategory": null,
109
+ "sort": 21,
110
+ "preferedScale": "s"
111
+ }
112
+ },
113
+ "attributes": {
94
114
  "scrollable": {
95
115
  "label": "Scrollable",
96
116
  "description": "Turns scroll interaction on.",
@@ -239,21 +259,6 @@
239
259
  "sort": 19,
240
260
  "preferedScale": "s"
241
261
  },
242
- "backgroundColor": {
243
- "label": "Background Color",
244
- "description": "Background fill color.",
245
- "category": "style",
246
- "specialCategory": null,
247
- "sort": 20
248
- },
249
- "borderRadius": {
250
- "label": "Border Radius",
251
- "description": "Corner rounding amount.",
252
- "category": "style",
253
- "specialCategory": null,
254
- "sort": 21,
255
- "preferedScale": "s"
256
- },
257
262
  "width": {
258
263
  "label": "Width",
259
264
  "description": "Fixed width value.",