@developer_tribe/react-builder 1.2.32 → 1.2.34

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 (79) hide show
  1. package/dist/assets/prompt-scheme-onboard.generated.d.ts +1 -0
  2. package/dist/assets/prompt-scheme-paywall.generated.d.ts +1 -0
  3. package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +3 -3
  4. package/dist/build-components/patterns.generated.d.ts +52 -52
  5. package/dist/components/BuilderProvider.d.ts +2 -4
  6. package/dist/index.cjs.js +1 -1
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.esm.js +1 -1
  9. package/dist/index.esm.js.map +1 -1
  10. package/dist/index.web.cjs.js +6 -6
  11. package/dist/index.web.cjs.js.map +1 -1
  12. package/dist/index.web.esm.js +6 -6
  13. package/dist/index.web.esm.js.map +1 -1
  14. package/dist/modals/PromptManagerModal.d.ts +9 -0
  15. package/dist/modals/index.d.ts +1 -0
  16. package/dist/styles.css +1 -1
  17. package/dist/utils/nodeXml.d.ts +11 -0
  18. package/package.json +5 -1
  19. package/scripts/prebuild/assets/prompt_scheme.md +77 -0
  20. package/scripts/prebuild/generate-prompt-schemes.js +464 -0
  21. package/scripts/prebuild/prebuild.js +4 -0
  22. package/src/RenderPage.tsx +6 -6
  23. package/src/assets/meta.json +1 -1
  24. package/src/assets/prompt-scheme-onboard.generated.ts +4 -0
  25. package/src/assets/prompt-scheme-paywall.generated.ts +4 -0
  26. package/src/attribute-analyser/style/native/useExtractImageStyle.ts +1 -1
  27. package/src/attribute-analyser/style/native/useExtractTextStyle.ts +1 -1
  28. package/src/attribute-analyser/style/native/useExtractViewStyle.ts +1 -1
  29. package/src/attribute-analyser/style/web/useExtractImageStyle.ts +1 -1
  30. package/src/attribute-analyser/style/web/useExtractTextStyle.ts +1 -1
  31. package/src/attribute-analyser/style/web/useExtractViewStyle.ts +1 -1
  32. package/src/build-components/BIcon/pattern.json +1 -3
  33. package/src/build-components/BackgroundImage/pattern.json +2 -10
  34. package/src/build-components/Button/pattern.json +1 -3
  35. package/src/build-components/Carousel/pattern.json +2 -8
  36. package/src/build-components/CarouselDots/CarouselDots.tsx +1 -1
  37. package/src/build-components/CarouselProvider/pattern.json +1 -4
  38. package/src/build-components/CountDown/pattern.json +1 -3
  39. package/src/build-components/Image/pattern.json +2 -9
  40. package/src/build-components/Main/pattern.json +1 -3
  41. package/src/build-components/NavigationBarColor/NavigationBarColor.tsx +1 -1
  42. package/src/build-components/NavigationBarColor/pattern.json +1 -3
  43. package/src/build-components/Onboard/pattern.json +2 -6
  44. package/src/build-components/OnboardButton/OnboardButton.tsx +1 -1
  45. package/src/build-components/OnboardButton/pattern.json +3 -14
  46. package/src/build-components/OnboardButtons/pattern.json +4 -15
  47. package/src/build-components/OnboardDot/OnboardDot.tsx +1 -1
  48. package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +3 -3
  49. package/src/build-components/OnboardDot/pattern.json +15 -16
  50. package/src/build-components/OnboardFooter/OnboardFooter.tsx +3 -3
  51. package/src/build-components/OnboardFooter/pattern.json +15 -19
  52. package/src/build-components/OnboardItem/pattern.json +3 -11
  53. package/src/build-components/OnboardProvider/pattern.json +2 -8
  54. package/src/build-components/OnboardSubtitle/pattern.json +1 -4
  55. package/src/build-components/OnboardTitle/pattern.json +1 -4
  56. package/src/build-components/PaywallBackground/pattern.json +1 -3
  57. package/src/build-components/PaywallCloseButton/pattern.json +1 -3
  58. package/src/build-components/PaywallOptions/pattern.json +1 -3
  59. package/src/build-components/PaywallProvider/pattern.json +1 -3
  60. package/src/build-components/PaywallSubscribeButton/pattern.json +1 -3
  61. package/src/build-components/PriceTag/pattern.json +2 -8
  62. package/src/build-components/Pricing/pattern.json +1 -3
  63. package/src/build-components/Promo/pattern.json +1 -3
  64. package/src/build-components/Separator/pattern.json +1 -3
  65. package/src/build-components/StatusBarColor/StatusBarColor.tsx +1 -1
  66. package/src/build-components/StatusBarColor/pattern.json +1 -3
  67. package/src/build-components/Text/pattern.json +1 -3
  68. package/src/build-components/View/pattern.json +4 -16
  69. package/src/build-components/patterns.generated.ts +52 -52
  70. package/src/components/BottomBar.tsx +28 -1
  71. package/src/components/BuilderProvider.tsx +5 -14
  72. package/src/hooks/useLocalize.ts +1 -1
  73. package/src/modals/MockableFeatureModal.tsx +552 -5
  74. package/src/modals/Modal.tsx +7 -1
  75. package/src/modals/PromptManagerModal.tsx +270 -0
  76. package/src/modals/index.ts +1 -0
  77. package/src/styles/index.scss +1 -0
  78. package/src/styles/modals/_prompt-manager-modal.scss +95 -0
  79. package/src/utils/nodeXml.ts +196 -0
@@ -7,15 +7,9 @@
7
7
  "children": "node",
8
8
  "extends": "View",
9
9
  "attributes": {
10
- "display": [
11
- "flex",
12
- "block"
13
- ],
10
+ "display": ["flex", "block"],
14
11
  "gap": "size",
15
- "flexDirection": [
16
- "row",
17
- "column"
18
- ],
12
+ "flexDirection": ["row", "column"],
19
13
  "paddingHorizontal": "size"
20
14
  }
21
15
  },
@@ -28,9 +22,7 @@
28
22
  }
29
23
  },
30
24
  "meta": {
31
- "desiredParent": [
32
- "=Onboard"
33
- ],
25
+ "desiredParent": ["=Onboard"],
34
26
  "label": "Onboard Item",
35
27
  "description": "Single onboarding screen section.",
36
28
  "styles": {},
@@ -7,11 +7,7 @@
7
7
  "children": "node",
8
8
  "extends": "View",
9
9
  "attributes": {
10
- "theme": [
11
- "light",
12
- "dark",
13
- "all"
14
- ],
10
+ "theme": ["light", "dark", "all"],
15
11
  "borderRadius": "never"
16
12
  }
17
13
  },
@@ -22,9 +18,7 @@
22
18
  }
23
19
  },
24
20
  "meta": {
25
- "desiredParent": [
26
- "root"
27
- ],
21
+ "desiredParent": ["root"],
28
22
  "label": "Onboard Provider",
29
23
  "description": "Provides shared settings for onboarding.",
30
24
  "styles": {},
@@ -14,10 +14,7 @@
14
14
  }
15
15
  },
16
16
  "meta": {
17
- "desiredParent": [
18
- ">OnboardProvider",
19
- ">OnboardItem"
20
- ],
17
+ "desiredParent": [">OnboardProvider", ">OnboardItem"],
21
18
  "label": "Onboard Subtitle",
22
19
  "description": "Subtitle text for an onboarding step.",
23
20
  "styles": {}
@@ -15,10 +15,7 @@
15
15
  }
16
16
  },
17
17
  "meta": {
18
- "desiredParent": [
19
- ">OnboardItem",
20
- ">OnboardProvider"
21
- ],
18
+ "desiredParent": [">OnboardItem", ">OnboardProvider"],
22
19
  "label": "Onboard Title",
23
20
  "description": "Title text for an onboarding step.",
24
21
  "styles": {}
@@ -20,9 +20,7 @@
20
20
  }
21
21
  },
22
22
  "meta": {
23
- "desiredParent": [
24
- ">PaywallProvider"
25
- ],
23
+ "desiredParent": [">PaywallProvider"],
26
24
  "label": "Paywall Background",
27
25
  "description": "Paywall Background component.",
28
26
  "styles": {}
@@ -8,9 +8,7 @@
8
8
  "extends": "BIcon"
9
9
  },
10
10
  "meta": {
11
- "desiredParent": [
12
- ">PaywallProvider"
13
- ],
11
+ "desiredParent": [">PaywallProvider"],
14
12
  "label": "Paywall Close Button",
15
13
  "description": "Paywall Close Button component.",
16
14
  "styles": {}
@@ -8,9 +8,7 @@
8
8
  "children": "node"
9
9
  },
10
10
  "meta": {
11
- "desiredParent": [
12
- ">PaywallProvider"
13
- ],
11
+ "desiredParent": [">PaywallProvider"],
14
12
  "label": "Paywall Options",
15
13
  "description": "Paywall options selector component.",
16
14
  "styles": {}
@@ -17,9 +17,7 @@
17
17
  }
18
18
  },
19
19
  "meta": {
20
- "desiredParent": [
21
- "all"
22
- ],
20
+ "desiredParent": ["all"],
23
21
  "label": "Paywall Provider",
24
22
  "description": "Provider/wrapper for paywall screen components.",
25
23
  "attributes": {
@@ -21,9 +21,7 @@
21
21
  }
22
22
  },
23
23
  "meta": {
24
- "desiredParent": [
25
- ">PaywallProvider"
26
- ],
24
+ "desiredParent": [">PaywallProvider"],
27
25
  "label": "Paywall Subscribe Button",
28
26
  "description": "Paywall subscribe call-to-action button. Extends Button.",
29
27
  "styles": {}
@@ -10,11 +10,7 @@
10
10
  "showOriginalPricePossible": "boolean",
11
11
  "hideIfItsNotDiscount": "boolean",
12
12
  "styles": {
13
- "textDecorationLine": [
14
- "none",
15
- "underline",
16
- "line-through"
17
- ]
13
+ "textDecorationLine": ["none", "underline", "line-through"]
18
14
  }
19
15
  }
20
16
  },
@@ -25,9 +21,7 @@
25
21
  }
26
22
  },
27
23
  "meta": {
28
- "desiredParent": [
29
- ">PaywallProvider"
30
- ],
24
+ "desiredParent": [">PaywallProvider"],
31
25
  "label": "Price Tag",
32
26
  "description": "Displays a price tag text. Extends Text.",
33
27
  "styles": {
@@ -17,9 +17,7 @@
17
17
  }
18
18
  },
19
19
  "meta": {
20
- "desiredParent": [
21
- ">PaywallProvider"
22
- ],
20
+ "desiredParent": [">PaywallProvider"],
23
21
  "label": "Pricing",
24
22
  "description": "Displays pricing details (e.g. promo/trial breakdown). Extends Text.",
25
23
  "styles": {}
@@ -17,9 +17,7 @@
17
17
  }
18
18
  },
19
19
  "meta": {
20
- "desiredParent": [
21
- ">PaywallProvider"
22
- ],
20
+ "desiredParent": [">PaywallProvider"],
23
21
  "label": "Promo",
24
22
  "description": "Displays promotional badge/text (e.g. discount percentage). Extends Text.",
25
23
  "styles": {}
@@ -18,9 +18,7 @@
18
18
  }
19
19
  },
20
20
  "meta": {
21
- "desiredParent": [
22
- "all"
23
- ],
21
+ "desiredParent": ["all"],
24
22
  "label": "Separator",
25
23
  "description": "Horizontal line separator.",
26
24
  "styles": {
@@ -11,7 +11,7 @@ function StatusBarColor({ node }: StatusBarColorComponentProps) {
11
11
  useLogRender('StatusBarColor');
12
12
  node = useNode(node);
13
13
 
14
- const { theme, projectColors } = useBuilderParams();
14
+ const { selectedTheme: theme, projectColors } = useBuilderParams();
15
15
  const setStatusBarOverrideColor = useRenderStore(
16
16
  (s) => s.setStatusBarOverrideColor,
17
17
  );
@@ -13,9 +13,7 @@
13
13
  }
14
14
  },
15
15
  "meta": {
16
- "desiredParent": [
17
- "all"
18
- ],
16
+ "desiredParent": ["all"],
19
17
  "label": "Status Bar Color",
20
18
  "description": "Sets the OS status bar background color.",
21
19
  "styles": {
@@ -27,9 +27,7 @@
27
27
  }
28
28
  },
29
29
  "meta": {
30
- "desiredParent": [
31
- "all"
32
- ],
30
+ "desiredParent": ["all"],
33
31
  "label": "Text",
34
32
  "description": "Displays simple text.",
35
33
  "styles": {
@@ -8,15 +8,8 @@
8
8
  "attributes": {
9
9
  "scrollable": "boolean",
10
10
  "styles": {
11
- "flexDirection": [
12
- "row",
13
- "column"
14
- ],
15
- "flexWrap": [
16
- "nowrap",
17
- "wrap",
18
- "wrap-reverse"
19
- ],
11
+ "flexDirection": ["row", "column"],
12
+ "flexWrap": ["nowrap", "wrap", "wrap-reverse"],
20
13
  "alignItems": [
21
14
  "flex-start",
22
15
  "center",
@@ -56,10 +49,7 @@
56
49
  "minHeight": "size",
57
50
  "maxHeight": "size",
58
51
  "flex": "number",
59
- "position": [
60
- "relative",
61
- "absolute"
62
- ],
52
+ "position": ["relative", "absolute"],
63
53
  "top": "size",
64
54
  "bottom": "size",
65
55
  "left": "size",
@@ -69,9 +59,7 @@
69
59
  }
70
60
  },
71
61
  "meta": {
72
- "desiredParent": [
73
- "all"
74
- ],
62
+ "desiredParent": ["all"],
75
63
  "label": "View",
76
64
  "description": "Base layout container.",
77
65
  "specialCategories": {
@@ -6162,13 +6162,13 @@ export const patterns = [
6162
6162
  'sliding_dot',
6163
6163
  'liquid_like',
6164
6164
  ],
6165
+ flexDirection: 'never',
6166
+ alignItems: 'never',
6167
+ justifyContent: 'never',
6165
6168
  dot_thickness: 'size',
6166
6169
  inactive_dot_opacity: 'number',
6167
6170
  inactive_dot_color: 'color',
6168
6171
  active_dot_color: 'color',
6169
- flexDirection: 'never',
6170
- alignItems: 'never',
6171
- justifyContent: 'never',
6172
6172
  },
6173
6173
  },
6174
6174
  meta: {
@@ -6217,41 +6217,6 @@ export const patterns = [
6217
6217
  sort: 21,
6218
6218
  preferredScale: 's',
6219
6219
  },
6220
- dotType: {
6221
- label: 'Dot Type',
6222
- description: 'Dot animation style.',
6223
- category: 'style',
6224
- specialCategory: null,
6225
- sort: 1,
6226
- },
6227
- inactive_dot_opacity: {
6228
- label: 'Inactive Dot Opacity',
6229
- description: 'Opacity for inactive dots.',
6230
- category: 'style',
6231
- specialCategory: null,
6232
- sort: 3,
6233
- },
6234
- inactive_dot_color: {
6235
- label: 'Inactive Dot Color',
6236
- description: 'Color of inactive dots.',
6237
- category: 'style',
6238
- specialCategory: null,
6239
- sort: 4,
6240
- },
6241
- dot_thickness: {
6242
- label: 'Dot Thickness',
6243
- description: 'Dot size/diameter.',
6244
- category: 'style',
6245
- specialCategory: null,
6246
- sort: 2,
6247
- },
6248
- active_dot_color: {
6249
- label: 'Active Dot Color',
6250
- description: 'Color of the active dot.',
6251
- category: 'style',
6252
- specialCategory: null,
6253
- sort: 5,
6254
- },
6255
6220
  },
6256
6221
  attributes: {
6257
6222
  scrollable: {
@@ -6510,6 +6475,41 @@ export const patterns = [
6510
6475
  specialCategory: null,
6511
6476
  sort: 26,
6512
6477
  },
6478
+ dotType: {
6479
+ label: 'Dot Type',
6480
+ description: 'Dot animation style.',
6481
+ category: 'style',
6482
+ specialCategory: null,
6483
+ sort: 1,
6484
+ },
6485
+ dot_thickness: {
6486
+ label: 'Dot Thickness',
6487
+ description: 'Dot size/diameter.',
6488
+ category: 'style',
6489
+ specialCategory: null,
6490
+ sort: 2,
6491
+ },
6492
+ inactive_dot_opacity: {
6493
+ label: 'Inactive Dot Opacity',
6494
+ description: 'Opacity for inactive dots.',
6495
+ category: 'style',
6496
+ specialCategory: null,
6497
+ sort: 3,
6498
+ },
6499
+ inactive_dot_color: {
6500
+ label: 'Inactive Dot Color',
6501
+ description: 'Color of inactive dots.',
6502
+ category: 'style',
6503
+ specialCategory: null,
6504
+ sort: 4,
6505
+ },
6506
+ active_dot_color: {
6507
+ label: 'Active Dot Color',
6508
+ description: 'Color of the active dot.',
6509
+ category: 'style',
6510
+ specialCategory: null,
6511
+ sort: 5,
6512
+ },
6513
6513
  },
6514
6514
  },
6515
6515
  defaults: {
@@ -6662,20 +6662,6 @@ export const patterns = [
6662
6662
  sort: 21,
6663
6663
  preferredScale: 's',
6664
6664
  },
6665
- linkedWordFirstColor: {
6666
- label: 'Linked Word First Color',
6667
- description: 'Color of the first linked word.',
6668
- category: 'style',
6669
- specialCategory: null,
6670
- sort: 3,
6671
- },
6672
- linkedWordSecondColor: {
6673
- label: 'Linked Word Second Color',
6674
- description: 'Color of the second linked word.',
6675
- category: 'style',
6676
- specialCategory: null,
6677
- sort: 6,
6678
- },
6679
6665
  },
6680
6666
  attributes: {
6681
6667
  adjustsFontSizeToFit: {
@@ -6964,6 +6950,13 @@ export const patterns = [
6964
6950
  specialCategory: null,
6965
6951
  sort: 2,
6966
6952
  },
6953
+ linkedWordFirstColor: {
6954
+ label: 'Linked Word First Color',
6955
+ description: 'Color of the first linked word.',
6956
+ category: 'other',
6957
+ specialCategory: null,
6958
+ sort: 3,
6959
+ },
6967
6960
  linkedWordFirstPage: {
6968
6961
  label: 'Linked Word First Page',
6969
6962
  description: 'Page opened by the first link.',
@@ -6978,6 +6971,13 @@ export const patterns = [
6978
6971
  specialCategory: null,
6979
6972
  sort: 5,
6980
6973
  },
6974
+ linkedWordSecondColor: {
6975
+ label: 'Linked Word Second Color',
6976
+ description: 'Color of the second linked word.',
6977
+ category: 'other',
6978
+ specialCategory: null,
6979
+ sort: 6,
6980
+ },
6981
6981
  linkedWordSecondPage: {
6982
6982
  label: 'Linked Word Second Page',
6983
6983
  description: 'Page opened by the second link.',
@@ -3,7 +3,12 @@ import { Icon } from './Icon.generated';
3
3
  import type { IconsType } from '../types/Icons.generated';
4
4
  import { useRenderStore } from '../store';
5
5
  import type { Localication } from '../types/PreviewConfig';
6
- import { InspectModal, LocalicationModal, Modal } from '../modals';
6
+ import {
7
+ InspectModal,
8
+ LocalicationModal,
9
+ Modal,
10
+ PromptManagerModal,
11
+ } from '../modals';
7
12
  import type { Node } from '../types/Node';
8
13
  import type { Project } from '../types/Project';
9
14
  import { DebugJsonPage } from '../pages/DebugJsonPage';
@@ -29,6 +34,7 @@ export function BottomBar({
29
34
  const debugIcon: IconsType = 'speedometer-03';
30
35
  const localizationIcon: IconsType = 'globe-01';
31
36
  const inspectIcon: IconsType = 'info-circle';
37
+ const promptAiIcon: IconsType = 'star';
32
38
 
33
39
  const {
34
40
  localization,
@@ -57,6 +63,7 @@ export function BottomBar({
57
63
  const [isDebugOpen, setIsDebugOpen] = useState(false);
58
64
  const [isLocalizationOpen, setIsLocalizationOpen] = useState(false);
59
65
  const [isInspectOpen, setIsInspectOpen] = useState(false);
66
+ const [isPromptManagerOpen, setIsPromptManagerOpen] = useState(false);
60
67
 
61
68
  const languages = useMemo(() => ['en', 'tr', 'ar'], []);
62
69
  const activeLanguage = defaultLanguage;
@@ -150,6 +157,18 @@ export function BottomBar({
150
157
  <Icon iconType={inspectIcon} size={20} color="currentColor" alt="" />
151
158
  </button>
152
159
 
160
+ <button
161
+ type="button"
162
+ className={`rb-bottom-bar__button${
163
+ isPromptManagerOpen ? ' is-active' : ''
164
+ }`}
165
+ aria-label="Prompt Manager"
166
+ aria-pressed={isPromptManagerOpen}
167
+ onClick={() => setIsPromptManagerOpen(true)}
168
+ >
169
+ <Icon iconType={promptAiIcon} size={20} color="currentColor" alt="" />
170
+ </button>
171
+
153
172
  <div className="rb-bottom-bar__spacer" />
154
173
 
155
174
  <div className="rb-bottom-bar__langs" aria-label="Language">
@@ -199,6 +218,14 @@ export function BottomBar({
199
218
  {isInspectOpen && (
200
219
  <InspectModal onClose={() => setIsInspectOpen(false)} />
201
220
  )}
221
+
222
+ {isPromptManagerOpen && (
223
+ <PromptManagerModal
224
+ data={data}
225
+ setData={setData}
226
+ onClose={() => setIsPromptManagerOpen(false)}
227
+ />
228
+ )}
202
229
  </>
203
230
  );
204
231
  }
@@ -36,19 +36,14 @@ export type BuilderProviderParams = {
36
36
  // but internally we prefer store values.
37
37
  mockProducts?: Products[];
38
38
  mockBenefits?: PaywallBenefits;
39
- mockTheme?: Theme;
40
- mockDefaultLanguage?: string;
39
+ selectedLanguage?: string;
40
+ selectedTheme?: Theme;
41
41
  localization?: Localication;
42
42
  baseSize?: BaseSize;
43
- // projectColors, fonts, previewMode, selectedKey kept as they are commonly used and not explicitly asked to rename
44
43
  projectColors?: ProjectColors;
45
44
  fonts?: Fonts;
46
45
  previewMode?: boolean;
47
46
  selectedKey?: string;
48
-
49
- // Derived / Convenience values provided by the context (populated from mock* if present)
50
- theme?: Theme;
51
- defaultLanguage?: string;
52
47
  };
53
48
 
54
49
  type BuilderProviderProps = {
@@ -63,17 +58,13 @@ const builderContext = createContext<BuilderProviderParams | undefined>(
63
58
  export function BuilderProvider({ params, children }: BuilderProviderProps) {
64
59
  // We rely purely on params passed from parent (which reads from store)
65
60
  const value = useMemo<BuilderProviderParams>(() => {
66
- const theme = params.mockTheme ?? defaultTheme;
67
- const lang = params.mockDefaultLanguage ?? defaultLanguage;
61
+ const lang = params.selectedLanguage ?? defaultLanguage;
68
62
  return {
69
63
  ...params,
70
- // Ensure defaults if mxissing
71
64
  mockProducts: params.mockProducts ?? [],
72
65
  mockBenefits: params.mockBenefits ?? {},
73
- mockTheme: theme,
74
- mockDefaultLanguage: lang,
75
- theme,
76
- defaultLanguage: lang,
66
+ selectedLanguage: lang,
67
+ selectedTheme: params.selectedTheme ?? defaultTheme,
77
68
  baseSize: params.baseSize ?? defaultBaseSize,
78
69
  projectColors: params.projectColors
79
70
  ? mergeProjectColors(defaultProjectColors, params.projectColors)
@@ -12,7 +12,7 @@ export function useLocalize(options?: {
12
12
  }): LocalizeFn {
13
13
  const {
14
14
  localization: builderLocalization,
15
- mockDefaultLanguage: builderDefaultLanguage,
15
+ selectedLanguage: builderDefaultLanguage,
16
16
  } = useBuilderParams();
17
17
  //TODO: genelle (react-native ksımına export et)
18
18
  const localization =