@flipova/foundation 1.9.0 → 1.10.1

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 (135) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +64 -1
  3. package/dist/{chunk-3PYMFFVP.mjs → chunk-32VWREEH.mjs} +2289 -7
  4. package/dist/chunk-32VWREEH.mjs.map +1 -0
  5. package/dist/{chunk-5ZDSYOFL.js → chunk-3RJREGCN.js} +2604 -309
  6. package/dist/chunk-3RJREGCN.js.map +1 -0
  7. package/dist/{chunk-MWRMHYW2.js → chunk-D4QJYQOK.js} +17 -17
  8. package/dist/{chunk-MWRMHYW2.js.map → chunk-D4QJYQOK.js.map} +1 -1
  9. package/dist/{chunk-GZPFYWMA.mjs → chunk-IKVONTJC.mjs} +10 -3
  10. package/dist/chunk-IKVONTJC.mjs.map +1 -0
  11. package/dist/{chunk-RRZSROIT.mjs → chunk-RRV2Q4SS.mjs} +3 -3
  12. package/dist/{chunk-RRZSROIT.mjs.map → chunk-RRV2Q4SS.mjs.map} +1 -1
  13. package/dist/chunk-RUZBEFDO.js +669 -0
  14. package/dist/{chunk-T7V6TILB.js.map → chunk-RUZBEFDO.js.map} +1 -1
  15. package/dist/{chunk-45NSZH5Z.js → chunk-UBZMVSIN.js} +10 -2
  16. package/dist/chunk-UBZMVSIN.js.map +1 -0
  17. package/dist/{chunk-SYHGZT2M.mjs → chunk-YTD4AWV2.mjs} +4 -4
  18. package/dist/{chunk-SYHGZT2M.mjs.map → chunk-YTD4AWV2.mjs.map} +1 -1
  19. package/dist/config/index.js +6 -6
  20. package/dist/config/index.mjs +1 -1
  21. package/dist/index.d.mts +1 -2
  22. package/dist/index.d.ts +1 -2
  23. package/dist/index.js +200 -201
  24. package/dist/index.mjs +4 -5
  25. package/dist/layout/index.d.mts +192 -3
  26. package/dist/layout/index.d.ts +192 -3
  27. package/dist/layout/index.js +159 -160
  28. package/dist/layout/index.mjs +1 -2
  29. package/dist/studio-v2/cli/index.js +96 -0
  30. package/dist/theme/index.js +14 -14
  31. package/dist/theme/index.mjs +1 -1
  32. package/dist/tokens/index.js +14 -14
  33. package/dist/tokens/index.mjs +1 -1
  34. package/dist/web/index.js +3639 -363
  35. package/dist/web/index.js.map +1 -1
  36. package/dist/web/index.mjs +3463 -61
  37. package/dist/web/index.mjs.map +1 -1
  38. package/package.json +15 -8
  39. package/studio-v2/apps/web/CHANGELOG.md +7 -0
  40. package/studio-v2/apps/web/LICENSE +21 -0
  41. package/studio-v2/apps/web/README.md +56 -0
  42. package/studio-v2/apps/web/dist/+not-found.html +793 -0
  43. package/studio-v2/apps/web/dist/_expo/.routes.json +3 -0
  44. package/studio-v2/apps/web/dist/_expo/static/css/global-a4717de456877faacb88ee482aa99653.css +1 -0
  45. package/{studio/app/dist/_expo/static/js/web/entry-77f601f6b9353e7b6e3b18cdbe63ac99.js → studio-v2/apps/web/dist/_expo/static/js/web/entry-5d96588cc8f2ee5c00754cef9ac6481d.js} +3707 -17257
  46. package/studio-v2/apps/web/dist/_expo/static/js/web/index-470f33f64d8c4f7b8d8da2632b2959c2.js +4 -0
  47. package/{studio/app/dist/_expo/static/js/web/index-ac88f7a39991e452f0b4323da9aa4367.js → studio-v2/apps/web/dist/_expo/static/js/web/index-f7fcd21ae9d8dacf4c88ea5796614af0.js} +3 -3
  48. package/studio-v2/apps/web/dist/_sitemap.html +793 -0
  49. package/studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/drawer/lib/module/views/assets/toggle-drawer-icon.ae74bb20586a731af545e6b00fe14a09.png +0 -0
  50. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png +0 -0
  51. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png +0 -0
  52. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png +0 -0
  53. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png +0 -0
  54. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png +0 -0
  55. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png +0 -0
  56. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png +0 -0
  57. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png +0 -0
  58. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png +0 -0
  59. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png +0 -0
  60. package/studio-v2/apps/web/dist/assets/___node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png +0 -0
  61. package/studio-v2/apps/web/dist/index.html +793 -0
  62. package/dist/chunk-3PYMFFVP.mjs.map +0 -1
  63. package/dist/chunk-45NSZH5Z.js.map +0 -1
  64. package/dist/chunk-4QTEZKXE.mjs +0 -2287
  65. package/dist/chunk-4QTEZKXE.mjs.map +0 -1
  66. package/dist/chunk-5ZDSYOFL.js.map +0 -1
  67. package/dist/chunk-BJTO5JO5.mjs +0 -10
  68. package/dist/chunk-BJTO5JO5.mjs.map +0 -1
  69. package/dist/chunk-DGUM43GV.js +0 -12
  70. package/dist/chunk-DGUM43GV.js.map +0 -1
  71. package/dist/chunk-ECBM426M.mjs +0 -2647
  72. package/dist/chunk-ECBM426M.mjs.map +0 -1
  73. package/dist/chunk-EIWDEXBO.js +0 -2690
  74. package/dist/chunk-EIWDEXBO.js.map +0 -1
  75. package/dist/chunk-FLEEJX7L.js +0 -2301
  76. package/dist/chunk-FLEEJX7L.js.map +0 -1
  77. package/dist/chunk-GZPFYWMA.mjs.map +0 -1
  78. package/dist/chunk-T7V6TILB.js +0 -669
  79. package/dist/primitives-DVX2q5St.d.mts +0 -195
  80. package/dist/primitives-nj-4at-g.d.ts +0 -195
  81. package/dist/studio/cli/index.d.mts +0 -1
  82. package/dist/studio/cli/index.d.ts +0 -1
  83. package/dist/studio/cli/index.js +0 -42
  84. package/dist/studio/cli/index.js.map +0 -1
  85. package/dist/studio/cli/index.mjs +0 -35
  86. package/dist/studio/cli/index.mjs.map +0 -1
  87. package/dist/studio/index.d.mts +0 -441
  88. package/dist/studio/index.d.ts +0 -441
  89. package/dist/studio/index.js +0 -84
  90. package/dist/studio/index.js.map +0 -1
  91. package/dist/studio/index.mjs +0 -3
  92. package/dist/studio/index.mjs.map +0 -1
  93. package/dist/web/index.d.mts +0 -778
  94. package/dist/web/index.d.ts +0 -778
  95. package/studio/README.md +0 -154
  96. package/studio/app/dist/_expo/static/js/web/index-9587ee2e3c02826ac2da47e86fefe882.js +0 -4
  97. package/studio/app/dist/index.html +0 -37
  98. package/studio/app/dist/metadata.json +0 -1
  99. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/AntDesign.3f78af31cca60105799838a1a7a59fbd.ttf +0 -0
  100. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Entypo.31b5ffea3daddc69dd01a1f3d6cf63c5.ttf +0 -0
  101. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/EvilIcons.140c53a7643ea949007aa9a282153849.ttf +0 -0
  102. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Feather.ca4b48e04dc1ce10bfbddb262c8b835f.ttf +0 -0
  103. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome.b06871f281fee6b241d60582ae9369b9.ttf +0 -0
  104. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome5_Brands.3b89dd103490708d19a95adcae52210e.ttf +0 -0
  105. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome5_Regular.1f77739ca9ff2188b539c36f30ffa2be.ttf +0 -0
  106. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome5_Solid.605ed7926cf39a2ad5ec2d1f9d391d3d.ttf +0 -0
  107. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome6_Brands.56c8d80832e37783f12c05db7c8849e2.ttf +0 -0
  108. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome6_Regular.370dd5af19f8364907b6e2c41f45dbbf.ttf +0 -0
  109. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome6_Solid.adec7d6f310bc577f05e8fe06a5daccf.ttf +0 -0
  110. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Fontisto.b49ae8ab2dbccb02c4d11caaacf09eab.ttf +0 -0
  111. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Foundation.e20945d7c929279ef7a6f1db184a4470.ttf +0 -0
  112. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Ionicons.b4eb097d35f44ed943676fd56f6bdc51.ttf +0 -0
  113. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/MaterialCommunityIcons.6e435534bd35da5fef04168860a9b8fa.ttf +0 -0
  114. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/MaterialIcons.4e85bc9ebe07e0340c9c4fc2f6c38908.ttf +0 -0
  115. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Octicons.871378c6eab492a3e689a9385dc45a12.ttf +0 -0
  116. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/SimpleLineIcons.d2285965fe34b05465047401b8595dd0.ttf +0 -0
  117. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Zocial.1681f34aaca71b8dfb70756bca331eb2.ttf +0 -0
  118. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png +0 -0
  119. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png +0 -0
  120. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png +0 -0
  121. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png +0 -0
  122. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png +0 -0
  123. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png +0 -0
  124. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png +0 -0
  125. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png +0 -0
  126. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png +0 -0
  127. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png +0 -0
  128. /package/{studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements → studio-v2/apps/web/dist/assets/___node_modules/@react-navigation/elements/lib/module/assets}/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png +0 -0
  129. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png +0 -0
  130. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png +0 -0
  131. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png +0 -0
  132. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png +0 -0
  133. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png +0 -0
  134. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png +0 -0
  135. /package/{studio/app/dist/assets/__node_modules → studio-v2/apps/web/dist/assets/___node_modules}/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png +0 -0
@@ -1,441 +0,0 @@
1
- import * as ws from 'ws';
2
- import { WebSocket } from 'ws';
3
- import * as express_serve_static_core from 'express-serve-static-core';
4
- import http from 'http';
5
-
6
- /**
7
- * Document Tree Types
8
- *
9
- * The tree is the central data structure of the builder.
10
- * A page is a tree of nodes. Each node references a registry item
11
- * (layout, component, or block) and carries its configured props.
12
- *
13
- * The tree is:
14
- * - Serializable to JSON (saved to disk, sent over WebSocket)
15
- * - Renderable to React Native code (via codegen)
16
- * - Renderable to a live preview (via the web preview engine)
17
- */
18
- type NodeKind = "layout" | "component" | "block" | "primitive" | "slot" | "text";
19
- interface TreeNode {
20
- id: string;
21
- kind: NodeKind;
22
- registryId: string;
23
- props: Record<string, unknown>;
24
- variant?: string;
25
- children: TreeNode[];
26
- slotName?: string;
27
- styles?: Record<string, unknown>;
28
- events?: Record<string, ActionDef[]>;
29
- bindings?: Record<string, string>;
30
- conditionalRender?: {
31
- expression: string;
32
- mode: "show" | "hide";
33
- };
34
- parentId?: string;
35
- /**
36
- * repeatBinding — iterates an array and passes each item to children.
37
- * Used for the primary items slot (kind: "items") in DATA mode.
38
- * source: expression pointing to an array, e.g. "$query.getUsersData"
39
- * keyProp: field used as React key, e.g. "id"
40
- * itemVar: internal codegen alias (auto-derived, not shown in UI)
41
- */
42
- repeatBinding?: {
43
- source: string;
44
- keyProp: string;
45
- itemVar?: string;
46
- };
47
- /**
48
- * slotBindings — per-slot data source configuration for named-array slots.
49
- *
50
- * Keyed by slot prop name (e.g. "backContent", "social", "actions").
51
- * Each entry configures how that slot's array is populated:
52
- *
53
- * mode: "static" — children are dropped manually (default, no binding needed)
54
- * mode: "template" — a single dropped child is repeated via source.map()
55
- * mode: "data" — no dropped child; source.map() renders a template inline
56
- *
57
- * Example:
58
- * slotBindings: {
59
- * backContent: { mode: "data", source: "$state.backs", keyProp: "id" }
60
- * }
61
- * → generates: backContent={backs.map((back) => (<BackCard key={back.id} />))}
62
- */
63
- slotBindings?: Record<string, {
64
- mode: "static" | "template" | "data";
65
- source?: string;
66
- keyProp?: string;
67
- itemVar?: string;
68
- }>;
69
- /**
70
- * dataContext — exposes a single object/value to all children.
71
- * Works like repeatBinding but for a single item (not a list).
72
- * Typically set when a callApi with storeResponseAs is on this node.
73
- *
74
- * source: expression pointing to the data, e.g. "$state.user"
75
- * alias: optional alias for children to reference it (default: last segment of source)
76
- *
77
- * Example: node has callApi(login, storeResponseAs: "user")
78
- * → dataContext = { source: "$state.user", alias: "user" }
79
- * → children can bind "name" → resolves to $state.user.name
80
- */
81
- dataContext?: {
82
- source: string;
83
- alias?: string;
84
- };
85
- animation?: AnimationConfig;
86
- }
87
- type AnimationPreset = "fadeIn" | "fadeOut" | "slideUp" | "slideDown" | "slideLeft" | "slideRight" | "scaleIn" | "scaleOut" | "bounce" | "rotate" | "pulse" | "none";
88
- type AnimationTrigger = "onMount" | "onPress" | "onVisible" | "onState";
89
- interface AnimationConfig {
90
- preset: AnimationPreset;
91
- trigger: AnimationTrigger;
92
- duration: number;
93
- delay: number;
94
- easing: "ease" | "linear" | "easeIn" | "easeOut" | "easeInOut" | "spring";
95
- stateExpression?: string;
96
- }
97
- type ActionType = "navigate" | "setState" | "callApi" | "callCustomFn" | "openModal" | "closeModal" | "alert" | "toast" | "consoleLog" | "playSound" | "haptics" | "share" | "sendSMS" | "biometrics" | "getLocation" | "clipboard" | "openURL" | "custom" | "transform" | "compute" | "conditional" | "delay";
98
- /**
99
- * CustomFunction — a user-defined hook stored in the project.
100
- * Generated as hooks/use{name}.ts
101
- */
102
- interface CustomFunction {
103
- id: string;
104
- name: string;
105
- description: string;
106
- serviceId: string;
107
- template: string;
108
- params: {
109
- name: string;
110
- type: string;
111
- stateBinding: string;
112
- description: string;
113
- }[];
114
- returnStateKey: string;
115
- returnType: 'object' | 'array' | 'string' | 'boolean' | 'void';
116
- errorStateKey: string;
117
- code: string;
118
- }
119
- interface ActionDef {
120
- type: ActionType;
121
- payload: Record<string, unknown>;
122
- }
123
- /**
124
- * Extended callApi payload — supports dynamic body, response mapping, and error handling.
125
- *
126
- * Example for a login form:
127
- * {
128
- * queryName: "login",
129
- * body: { email: "$state.email", password: "$state.password" },
130
- * onSuccess: [
131
- * { type: "setState", payload: { key: "user", value: "$response" } },
132
- * { type: "navigate", payload: { screen: "home" } }
133
- * ],
134
- * onError: [
135
- * { type: "setState", payload: { key: "loginError", value: "$response.message" } }
136
- * ]
137
- * }
138
- *
139
- * $response refers to the full response body.
140
- * $response.field accesses a specific field.
141
- */
142
- interface CallApiPayload {
143
- queryName: string;
144
- /** Dynamic body — values can be $state.x, $global.x, or literal strings */
145
- body?: Record<string, string>;
146
- /** Actions to run on success — can reference $response */
147
- onSuccess?: ActionDef[];
148
- /** Actions to run on error — can reference $response.message */
149
- onError?: ActionDef[];
150
- /** Store the full response in a state var directly */
151
- storeResponseAs?: string;
152
- }
153
- interface PageState {
154
- name: string;
155
- type: "string" | "number" | "boolean" | "object" | "array";
156
- default: unknown;
157
- scope: "page" | "app";
158
- }
159
- interface PageDocument {
160
- id: string;
161
- /** Human-readable display name, e.g. "Home Screen" */
162
- name: string;
163
- /** URL-safe slug used as the file name and expo-router route, e.g. "home-screen" */
164
- route: string;
165
- root: TreeNode;
166
- state?: PageState[];
167
- createdAt: string;
168
- updatedAt: string;
169
- }
170
- interface ProjectDocument {
171
- name: string;
172
- version: string;
173
- theme: string;
174
- /** URL-safe slug used as the app identifier, e.g. "my-app" */
175
- slug?: string;
176
- /** Bundle identifier for native builds, e.g. "com.example.app" */
177
- bundleId?: string;
178
- /** Screen orientation: "portrait" | "landscape" | "default" */
179
- orientation?: string;
180
- /** Per-theme token overrides: { themeName: { tokenKey: value } } */
181
- themeOverrides?: Record<string, Record<string, string>>;
182
- pages: PageDocument[];
183
- services: ServiceConfig[];
184
- navigation: NavigationConfig;
185
- queries?: DataQuery[];
186
- customFunctions?: CustomFunction[];
187
- auth?: AuthConfig;
188
- capabilities?: NativeCapability[];
189
- deepLinking?: {
190
- scheme: string;
191
- prefixes: string[];
192
- };
193
- screenGroups?: ScreenGroup[];
194
- globalState?: GlobalStateVar[];
195
- constants?: AppConstant[];
196
- envVars?: EnvVar[];
197
- statusBar?: {
198
- style: string;
199
- hidden: boolean;
200
- translucent: boolean;
201
- backgroundColor?: string;
202
- };
203
- tabBarConfig?: {
204
- backgroundColor?: string;
205
- activeTintColor?: string;
206
- inactiveTintColor?: string;
207
- showLabels?: boolean;
208
- };
209
- drawerConfig?: DrawerConfig;
210
- }
211
- interface DrawerConfig {
212
- backgroundColor?: string;
213
- activeTintColor?: string;
214
- inactiveTintColor?: string;
215
- drawerPosition?: 'left' | 'right';
216
- }
217
- interface ScreenGroup {
218
- id: string;
219
- name: string;
220
- type: "tabs" | "stack" | "drawer" | "auth" | "protected" | "custom";
221
- screenIds: string[];
222
- requireAuth?: boolean;
223
- redirectTo?: string;
224
- }
225
- interface GlobalStateVar {
226
- name: string;
227
- type: "string" | "number" | "boolean" | "object" | "array";
228
- default: unknown;
229
- persist?: "none" | "async" | "secure";
230
- }
231
- interface AppConstant {
232
- key: string;
233
- value: string;
234
- }
235
- interface EnvVar {
236
- key: string;
237
- value: string;
238
- secret?: boolean;
239
- }
240
- interface DataQuery {
241
- id: string;
242
- name: string;
243
- serviceId: string;
244
- method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
245
- path: string;
246
- params?: Record<string, unknown>;
247
- /** Request body for POST/PUT/PATCH — values can be $state.x expressions */
248
- body?: Record<string, string>;
249
- /** Response headers to include */
250
- headers?: Record<string, string>;
251
- transform?: string;
252
- autoFetch?: boolean;
253
- /**
254
- * alias — the state variable name where the response is stored.
255
- * When set, the response is automatically stored in $state.{alias}.
256
- * This is the ONLY way to access query data in bindings/repeat/conditional.
257
- *
258
- * Example: alias = "users" → response stored in $state.users
259
- * → use $state.users in repeat source
260
- * → use $state.users[0].name in bindings
261
- */
262
- alias?: string;
263
- }
264
- interface ServiceConfig {
265
- id: string;
266
- type: "supabase" | "rest" | "graphql" | "firebase" | "custom";
267
- name: string;
268
- config: Record<string, unknown>;
269
- }
270
- interface NavigationConfig {
271
- type: "stack" | "tabs" | "drawer";
272
- screens: NavigationScreen[];
273
- }
274
- interface NavigationScreen {
275
- name: string;
276
- pageId: string;
277
- icon?: string;
278
- options?: Record<string, unknown>;
279
- route?: string;
280
- params?: string[];
281
- requireAuth?: boolean;
282
- transition?: "default" | "fade" | "slide" | "modal" | "none";
283
- }
284
- interface AuthConfig {
285
- enabled: boolean;
286
- provider: "supabase" | "firebase" | "custom";
287
- serviceId?: string;
288
- loginScreen?: string;
289
- signupScreen?: string;
290
- redirectAfterLogin?: string;
291
- }
292
- interface NativeCapability {
293
- id: string;
294
- enabled: boolean;
295
- config?: Record<string, unknown>;
296
- }
297
- interface StudioPlugin {
298
- id: string;
299
- name: string;
300
- version: string;
301
- components?: PluginComponent[];
302
- blocks?: PluginBlock[];
303
- panels?: PluginPanel[];
304
- codegenHooks?: PluginCodegenHook[];
305
- }
306
- interface PluginComponent {
307
- id: string;
308
- label: string;
309
- description: string;
310
- category: string;
311
- props: Record<string, unknown>[];
312
- render: string;
313
- }
314
- interface PluginBlock {
315
- id: string;
316
- label: string;
317
- description: string;
318
- category: string;
319
- slots: Record<string, unknown>[];
320
- props: Record<string, unknown>[];
321
- }
322
- interface PluginPanel {
323
- id: string;
324
- label: string;
325
- position: "left" | "right" | "bottom";
326
- render: string;
327
- }
328
- interface PluginCodegenHook {
329
- event: "beforeImports" | "afterImports" | "beforeReturn" | "afterComponent" | "projectFile";
330
- handler: string;
331
- }
332
-
333
- /**
334
- * Tree Operations
335
- *
336
- * Pure functions to manipulate the document tree.
337
- * All operations are immutable — they return new trees.
338
- */
339
-
340
- declare function generateId(): string;
341
- declare function createNode(kind: TreeNode["kind"], registryId: string, props?: Record<string, unknown>, variant?: string): TreeNode;
342
- declare function findNode(root: TreeNode, nodeId: string): TreeNode | null;
343
- declare function findParent(root: TreeNode, nodeId: string): TreeNode | null;
344
- declare function insertChild(root: TreeNode, parentId: string, node: TreeNode, index?: number): TreeNode;
345
- declare function removeNode(root: TreeNode, nodeId: string): TreeNode;
346
- declare function updateProps(root: TreeNode, nodeId: string, props: Record<string, unknown>): TreeNode;
347
- declare function moveNode(root: TreeNode, nodeId: string, newParentId: string, index?: number): TreeNode;
348
- /** Derives the URL-safe route slug from a page name. Single source of truth. */
349
- declare function pageNameToRoute(name: string): string;
350
- /** Derives the PascalCase component name from a page name. Single source of truth. */
351
- declare function pageNameToComponent(name: string): string;
352
- declare function renamePage(project: ProjectDocument, pageId: string, newName: string): {
353
- project: ProjectDocument;
354
- oldRoute: string;
355
- };
356
- declare function createPage(name: string, layoutId?: string): PageDocument;
357
- /**
358
- * Find the nearest ancestor node that has a repeatBinding.
359
- * Returns null if the node is not inside a repeat.
360
- */
361
- declare function findRepeatAncestor(root: TreeNode, nodeId: string, ancestors?: TreeNode[]): TreeNode | null;
362
- /**
363
- * Collect all $query.* variable names referenced in a tree.
364
- * Returns a Set of varNames like "jpUsersData".
365
- */
366
- declare function collectQueryRefs(node: TreeNode): Set<string>;
367
- /**
368
- * Collect all $state.* variable names referenced in a tree.
369
- */
370
- declare function collectStateRefs(node: TreeNode): Set<string>;
371
- interface ItemField {
372
- key: string;
373
- preview: string;
374
- type: string;
375
- }
376
- /**
377
- * Extract item fields from query response data.
378
- * Takes the first item of an array, or the object itself.
379
- */
380
- declare function extractItemFields(data: any): ItemField[];
381
-
382
- /**
383
- * Code Generator
384
- *
385
- * Transforms a PageDocument tree into a React Native .tsx screen file
386
- * and a companion .hook.ts file.
387
- *
388
- * Rules:
389
- * - ALL logic lives in the hook (no inline handlers in JSX)
390
- * - ALL action types are handled (navigate, setState, callApi, alert, toast,
391
- * openModal, closeModal, consoleLog, haptics, share, sendSMS, biometrics,
392
- * getLocation, clipboard, openURL, playSound, custom)
393
- * - API calls import from services/ via the generated query hook
394
- * - Naming is delegated to naming.ts (single source of truth)
395
- */
396
-
397
- declare function generatePageCode(page: PageDocument, queries?: DataQuery[]): string;
398
-
399
- /**
400
- * Project Generator
401
- *
402
- * Generates a full Expo React Native project with tabs navigation,
403
- * FoundationProvider, and all screens from the document tree.
404
- */
405
-
406
- interface GeneratedFile {
407
- path: string;
408
- content: string;
409
- }
410
- interface GeneratorOptions {
411
- /** Active la compatibilité Snack Expo (SDK 52/53). Défaut : false */
412
- snackMode?: boolean;
413
- /**
414
- * Stratégie de résolution de @flipova/foundation.
415
- * "registry" → génère .npmrc pointant vers GitHub Packages (défaut)
416
- * "local" → copie les sources foundation/ dans _flipova_modules/
417
- */
418
- foundationMode?: "registry" | "local";
419
- /**
420
- * Chemin absolu vers le dossier foundation/ du monorepo.
421
- * Obligatoire si foundationMode === "local".
422
- */
423
- foundationSourcePath?: string;
424
- }
425
- interface GenerationResult {
426
- files: GeneratedFile[];
427
- warnings: string[];
428
- }
429
- declare function generateProject(project: ProjectDocument, options?: GeneratorOptions): GenerationResult;
430
-
431
- declare function startServer(options?: {
432
- port?: number;
433
- projectDir?: string;
434
- }): {
435
- app: express_serve_static_core.Express;
436
- server: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
437
- wss: ws.Server<typeof WebSocket, typeof http.IncomingMessage>;
438
- broadcast: (type: string, payload: unknown) => void;
439
- };
440
-
441
- export { type ActionDef, type ActionType, type AnimationConfig, type AnimationPreset, type AnimationTrigger, type AppConstant, type AuthConfig, type CallApiPayload, type CustomFunction, type DataQuery, type DrawerConfig, type EnvVar, type GeneratedFile, type GenerationResult, type GeneratorOptions, type GlobalStateVar, type ItemField, type NativeCapability, type NavigationConfig, type NavigationScreen, type NodeKind, type PageDocument, type PageState, type PluginBlock, type PluginCodegenHook, type PluginComponent, type PluginPanel, type ProjectDocument, type ScreenGroup, type ServiceConfig, type StudioPlugin, type TreeNode, collectQueryRefs, collectStateRefs, createNode, createPage, extractItemFields, findNode, findParent, findRepeatAncestor, generateId, generatePageCode, generateProject, insertChild, moveNode, pageNameToComponent, pageNameToRoute, removeNode, renamePage, startServer, updateProps };