@pushframe/sdk 0.1.4 → 0.1.8

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 (288) hide show
  1. package/lib/commonjs/PushframeProvider.js +69 -0
  2. package/lib/commonjs/PushframeProvider.js.map +1 -0
  3. package/lib/commonjs/PushframeScreen.js +69 -0
  4. package/lib/commonjs/PushframeScreen.js.map +1 -0
  5. package/lib/commonjs/bindings.js +73 -0
  6. package/lib/commonjs/bindings.js.map +1 -0
  7. package/lib/commonjs/components/ButtonComponent.js +72 -0
  8. package/lib/commonjs/components/ButtonComponent.js.map +1 -0
  9. package/lib/commonjs/components/FlatListComponent.js +73 -0
  10. package/lib/commonjs/components/FlatListComponent.js.map +1 -0
  11. package/lib/commonjs/components/ImageComponent.js +67 -0
  12. package/lib/commonjs/components/ImageComponent.js.map +1 -0
  13. package/lib/commonjs/components/PushFrameComponent.js +179 -0
  14. package/lib/commonjs/components/PushFrameComponent.js.map +1 -0
  15. package/lib/commonjs/components/PushFrameProvider.js +115 -0
  16. package/lib/commonjs/components/PushFrameProvider.js.map +1 -0
  17. package/lib/commonjs/components/PushFrameScreen.js +39 -0
  18. package/lib/commonjs/components/PushFrameScreen.js.map +1 -0
  19. package/lib/commonjs/components/ScrollViewComponent.js +64 -0
  20. package/lib/commonjs/components/ScrollViewComponent.js.map +1 -0
  21. package/lib/commonjs/components/StackComponent.js +61 -0
  22. package/lib/commonjs/components/StackComponent.js.map +1 -0
  23. package/lib/commonjs/components/TextComponent.js +62 -0
  24. package/lib/commonjs/components/TextComponent.js.map +1 -0
  25. package/lib/commonjs/conditions.js +44 -0
  26. package/lib/commonjs/conditions.js.map +1 -0
  27. package/lib/commonjs/context/PushFrameContext.js +33 -0
  28. package/lib/commonjs/context/PushFrameContext.js.map +1 -0
  29. package/lib/commonjs/index.js +200 -0
  30. package/lib/commonjs/index.js.map +1 -0
  31. package/lib/commonjs/overlays/BottomSheetHost.js +144 -0
  32. package/lib/commonjs/overlays/BottomSheetHost.js.map +1 -0
  33. package/lib/commonjs/overlays/ToastHost.js +135 -0
  34. package/lib/commonjs/overlays/ToastHost.js.map +1 -0
  35. package/lib/commonjs/package.json +1 -0
  36. package/lib/commonjs/primitives/ActivityIndicator.js +24 -0
  37. package/lib/commonjs/primitives/ActivityIndicator.js.map +1 -0
  38. package/lib/commonjs/primitives/FlatList.js +34 -0
  39. package/lib/commonjs/primitives/FlatList.js.map +1 -0
  40. package/lib/commonjs/primitives/Image.js +33 -0
  41. package/lib/commonjs/primitives/Image.js.map +1 -0
  42. package/lib/commonjs/primitives/KeyboardAvoidingView.js +24 -0
  43. package/lib/commonjs/primitives/KeyboardAvoidingView.js.map +1 -0
  44. package/lib/commonjs/primitives/Modal.js +24 -0
  45. package/lib/commonjs/primitives/Modal.js.map +1 -0
  46. package/lib/commonjs/primitives/Pressable.js +26 -0
  47. package/lib/commonjs/primitives/Pressable.js.map +1 -0
  48. package/lib/commonjs/primitives/SafeAreaView.js +38 -0
  49. package/lib/commonjs/primitives/SafeAreaView.js.map +1 -0
  50. package/lib/commonjs/primitives/ScrollView.js +26 -0
  51. package/lib/commonjs/primitives/ScrollView.js.map +1 -0
  52. package/lib/commonjs/primitives/StatusBar.js +24 -0
  53. package/lib/commonjs/primitives/StatusBar.js.map +1 -0
  54. package/lib/commonjs/primitives/Switch.js +28 -0
  55. package/lib/commonjs/primitives/Switch.js.map +1 -0
  56. package/lib/commonjs/primitives/Text.js +37 -0
  57. package/lib/commonjs/primitives/Text.js.map +1 -0
  58. package/lib/commonjs/primitives/TextInput.js +31 -0
  59. package/lib/commonjs/primitives/TextInput.js.map +1 -0
  60. package/lib/commonjs/primitives/View.js +24 -0
  61. package/lib/commonjs/primitives/View.js.map +1 -0
  62. package/lib/commonjs/primitives/index.js +97 -0
  63. package/lib/commonjs/primitives/index.js.map +1 -0
  64. package/lib/commonjs/registry/ComponentRegistry.js +70 -0
  65. package/lib/commonjs/registry/ComponentRegistry.js.map +1 -0
  66. package/lib/commonjs/registry.js +94 -0
  67. package/lib/commonjs/registry.js.map +1 -0
  68. package/lib/commonjs/renderer/RecursiveRenderer.js +202 -0
  69. package/lib/commonjs/renderer/RecursiveRenderer.js.map +1 -0
  70. package/lib/commonjs/renderer/bindingResolver.js +98 -0
  71. package/lib/commonjs/renderer/bindingResolver.js.map +1 -0
  72. package/lib/commonjs/renderer/conditionalEvaluator.js +31 -0
  73. package/lib/commonjs/renderer/conditionalEvaluator.js.map +1 -0
  74. package/lib/commonjs/renderer.js +107 -0
  75. package/lib/commonjs/renderer.js.map +1 -0
  76. package/lib/commonjs/schema.js +79 -0
  77. package/lib/commonjs/schema.js.map +1 -0
  78. package/lib/commonjs/transformer/index.js +1055 -0
  79. package/lib/commonjs/transformer/index.js.map +1 -0
  80. package/lib/commonjs/transport.js +86 -0
  81. package/lib/commonjs/transport.js.map +1 -0
  82. package/lib/module/PushframeProvider.js +62 -0
  83. package/lib/module/PushframeProvider.js.map +1 -0
  84. package/lib/module/PushframeScreen.js +65 -0
  85. package/lib/module/PushframeScreen.js.map +1 -0
  86. package/lib/module/bindings.js +68 -0
  87. package/lib/module/bindings.js.map +1 -0
  88. package/lib/module/components/ButtonComponent.js +67 -0
  89. package/lib/module/components/ButtonComponent.js.map +1 -0
  90. package/lib/module/components/FlatListComponent.js +68 -0
  91. package/lib/module/components/FlatListComponent.js.map +1 -0
  92. package/lib/module/components/ImageComponent.js +62 -0
  93. package/lib/module/components/ImageComponent.js.map +1 -0
  94. package/lib/module/components/PushFrameComponent.js +174 -0
  95. package/lib/module/components/PushFrameComponent.js.map +1 -0
  96. package/lib/module/components/PushFrameProvider.js +110 -0
  97. package/lib/module/components/PushFrameProvider.js.map +1 -0
  98. package/lib/module/components/PushFrameScreen.js +34 -0
  99. package/lib/module/components/PushFrameScreen.js.map +1 -0
  100. package/lib/module/components/ScrollViewComponent.js +59 -0
  101. package/lib/module/components/ScrollViewComponent.js.map +1 -0
  102. package/lib/module/components/StackComponent.js +56 -0
  103. package/lib/module/components/StackComponent.js.map +1 -0
  104. package/lib/module/components/TextComponent.js +57 -0
  105. package/lib/module/components/TextComponent.js.map +1 -0
  106. package/lib/module/conditions.js +40 -0
  107. package/lib/module/conditions.js.map +1 -0
  108. package/lib/module/context/PushFrameContext.js +29 -0
  109. package/lib/module/context/PushFrameContext.js.map +1 -0
  110. package/lib/module/index.js +99 -0
  111. package/lib/module/index.js.map +1 -0
  112. package/lib/module/overlays/BottomSheetHost.js +139 -0
  113. package/lib/module/overlays/BottomSheetHost.js.map +1 -0
  114. package/lib/module/overlays/ToastHost.js +130 -0
  115. package/lib/module/overlays/ToastHost.js.map +1 -0
  116. package/lib/module/primitives/ActivityIndicator.js +19 -0
  117. package/lib/module/primitives/ActivityIndicator.js.map +1 -0
  118. package/lib/module/primitives/FlatList.js +29 -0
  119. package/lib/module/primitives/FlatList.js.map +1 -0
  120. package/lib/module/primitives/Image.js +28 -0
  121. package/lib/module/primitives/Image.js.map +1 -0
  122. package/lib/module/primitives/KeyboardAvoidingView.js +19 -0
  123. package/lib/module/primitives/KeyboardAvoidingView.js.map +1 -0
  124. package/lib/module/primitives/Modal.js +19 -0
  125. package/lib/module/primitives/Modal.js.map +1 -0
  126. package/lib/module/primitives/Pressable.js +21 -0
  127. package/lib/module/primitives/Pressable.js.map +1 -0
  128. package/lib/module/primitives/SafeAreaView.js +33 -0
  129. package/lib/module/primitives/SafeAreaView.js.map +1 -0
  130. package/lib/module/primitives/ScrollView.js +21 -0
  131. package/lib/module/primitives/ScrollView.js.map +1 -0
  132. package/lib/module/primitives/StatusBar.js +19 -0
  133. package/lib/module/primitives/StatusBar.js.map +1 -0
  134. package/lib/module/primitives/Switch.js +23 -0
  135. package/lib/module/primitives/Switch.js.map +1 -0
  136. package/lib/module/primitives/Text.js +32 -0
  137. package/lib/module/primitives/Text.js.map +1 -0
  138. package/lib/module/primitives/TextInput.js +26 -0
  139. package/lib/module/primitives/TextInput.js.map +1 -0
  140. package/lib/module/primitives/View.js +19 -0
  141. package/lib/module/primitives/View.js.map +1 -0
  142. package/lib/module/primitives/index.js +16 -0
  143. package/lib/module/primitives/index.js.map +1 -0
  144. package/lib/module/registry/ComponentRegistry.js +66 -0
  145. package/lib/module/registry/ComponentRegistry.js.map +1 -0
  146. package/lib/module/registry.js +88 -0
  147. package/lib/module/registry.js.map +1 -0
  148. package/lib/module/renderer/RecursiveRenderer.js +197 -0
  149. package/lib/module/renderer/RecursiveRenderer.js.map +1 -0
  150. package/lib/module/renderer/bindingResolver.js +92 -0
  151. package/lib/module/renderer/bindingResolver.js.map +1 -0
  152. package/lib/module/renderer/conditionalEvaluator.js +28 -0
  153. package/lib/module/renderer/conditionalEvaluator.js.map +1 -0
  154. package/lib/module/renderer.js +103 -0
  155. package/lib/module/renderer.js.map +1 -0
  156. package/lib/module/schema.js +74 -0
  157. package/lib/module/schema.js.map +1 -0
  158. package/lib/module/transformer/index.js +1051 -0
  159. package/lib/module/transformer/index.js.map +1 -0
  160. package/lib/module/transport.js +82 -0
  161. package/lib/module/transport.js.map +1 -0
  162. package/lib/typescript/PushframeProvider.d.ts +58 -0
  163. package/lib/typescript/PushframeProvider.d.ts.map +1 -0
  164. package/lib/typescript/PushframeScreen.d.ts +36 -0
  165. package/lib/typescript/PushframeScreen.d.ts.map +1 -0
  166. package/lib/typescript/bindings.d.ts +29 -0
  167. package/lib/typescript/bindings.d.ts.map +1 -0
  168. package/lib/typescript/components/ButtonComponent.d.ts +11 -0
  169. package/lib/typescript/components/ButtonComponent.d.ts.map +1 -0
  170. package/lib/typescript/components/FlatListComponent.d.ts +28 -0
  171. package/lib/typescript/components/FlatListComponent.d.ts.map +1 -0
  172. package/lib/typescript/components/ImageComponent.d.ts +12 -0
  173. package/lib/typescript/components/ImageComponent.d.ts.map +1 -0
  174. package/lib/typescript/components/PushFrameComponent.d.ts +48 -0
  175. package/lib/typescript/components/PushFrameComponent.d.ts.map +1 -0
  176. package/lib/typescript/components/PushFrameProvider.d.ts +51 -0
  177. package/lib/typescript/components/PushFrameProvider.d.ts.map +1 -0
  178. package/lib/typescript/components/PushFrameScreen.d.ts +15 -0
  179. package/lib/typescript/components/PushFrameScreen.d.ts.map +1 -0
  180. package/lib/typescript/components/ScrollViewComponent.d.ts +19 -0
  181. package/lib/typescript/components/ScrollViewComponent.d.ts.map +1 -0
  182. package/lib/typescript/components/StackComponent.d.ts +16 -0
  183. package/lib/typescript/components/StackComponent.d.ts.map +1 -0
  184. package/lib/typescript/components/TextComponent.d.ts +13 -0
  185. package/lib/typescript/components/TextComponent.d.ts.map +1 -0
  186. package/lib/typescript/conditions.d.ts +12 -0
  187. package/lib/typescript/conditions.d.ts.map +1 -0
  188. package/lib/typescript/context/PushFrameContext.d.ts +57 -0
  189. package/lib/typescript/context/PushFrameContext.d.ts.map +1 -0
  190. package/lib/typescript/index.d.ts +74 -0
  191. package/lib/typescript/index.d.ts.map +1 -0
  192. package/lib/typescript/overlays/BottomSheetHost.d.ts +21 -0
  193. package/lib/typescript/overlays/BottomSheetHost.d.ts.map +1 -0
  194. package/lib/typescript/overlays/ToastHost.d.ts +12 -0
  195. package/lib/typescript/overlays/ToastHost.d.ts.map +1 -0
  196. package/lib/typescript/primitives/ActivityIndicator.d.ts +12 -0
  197. package/lib/typescript/primitives/ActivityIndicator.d.ts.map +1 -0
  198. package/lib/typescript/primitives/FlatList.d.ts +29 -0
  199. package/lib/typescript/primitives/FlatList.d.ts.map +1 -0
  200. package/lib/typescript/primitives/Image.d.ts +20 -0
  201. package/lib/typescript/primitives/Image.d.ts.map +1 -0
  202. package/lib/typescript/primitives/KeyboardAvoidingView.d.ts +12 -0
  203. package/lib/typescript/primitives/KeyboardAvoidingView.d.ts.map +1 -0
  204. package/lib/typescript/primitives/Modal.d.ts +12 -0
  205. package/lib/typescript/primitives/Modal.d.ts.map +1 -0
  206. package/lib/typescript/primitives/Pressable.d.ts +14 -0
  207. package/lib/typescript/primitives/Pressable.d.ts.map +1 -0
  208. package/lib/typescript/primitives/SafeAreaView.d.ts +20 -0
  209. package/lib/typescript/primitives/SafeAreaView.d.ts.map +1 -0
  210. package/lib/typescript/primitives/ScrollView.d.ts +15 -0
  211. package/lib/typescript/primitives/ScrollView.d.ts.map +1 -0
  212. package/lib/typescript/primitives/StatusBar.d.ts +12 -0
  213. package/lib/typescript/primitives/StatusBar.d.ts.map +1 -0
  214. package/lib/typescript/primitives/Switch.d.ts +19 -0
  215. package/lib/typescript/primitives/Switch.d.ts.map +1 -0
  216. package/lib/typescript/primitives/Text.d.ts +25 -0
  217. package/lib/typescript/primitives/Text.d.ts.map +1 -0
  218. package/lib/typescript/primitives/TextInput.d.ts +25 -0
  219. package/lib/typescript/primitives/TextInput.d.ts.map +1 -0
  220. package/lib/typescript/primitives/View.d.ts +12 -0
  221. package/lib/typescript/primitives/View.d.ts.map +1 -0
  222. package/lib/typescript/primitives/index.d.ts +27 -0
  223. package/lib/typescript/primitives/index.d.ts.map +1 -0
  224. package/lib/typescript/registry/ComponentRegistry.d.ts +21 -0
  225. package/lib/typescript/registry/ComponentRegistry.d.ts.map +1 -0
  226. package/lib/typescript/registry.d.ts +57 -0
  227. package/lib/typescript/registry.d.ts.map +1 -0
  228. package/lib/typescript/renderer/RecursiveRenderer.d.ts +32 -0
  229. package/lib/typescript/renderer/RecursiveRenderer.d.ts.map +1 -0
  230. package/lib/typescript/renderer/bindingResolver.d.ts +26 -0
  231. package/lib/typescript/renderer/bindingResolver.d.ts.map +1 -0
  232. package/lib/typescript/renderer/conditionalEvaluator.d.ts +15 -0
  233. package/lib/typescript/renderer/conditionalEvaluator.d.ts.map +1 -0
  234. package/lib/typescript/renderer.d.ts +29 -0
  235. package/lib/typescript/renderer.d.ts.map +1 -0
  236. package/lib/typescript/schema.d.ts +84 -0
  237. package/lib/typescript/schema.d.ts.map +1 -0
  238. package/lib/typescript/transformer/index.d.ts +49 -0
  239. package/lib/typescript/transformer/index.d.ts.map +1 -0
  240. package/lib/typescript/transport.d.ts +19 -0
  241. package/lib/typescript/transport.d.ts.map +1 -0
  242. package/package.json +20 -18
  243. package/src/PushframeProvider.tsx +119 -0
  244. package/src/PushframeScreen.tsx +107 -0
  245. package/src/bindings.ts +72 -0
  246. package/src/components/ButtonComponent.tsx +87 -0
  247. package/src/components/FlatListComponent.tsx +86 -0
  248. package/src/components/ImageComponent.tsx +70 -0
  249. package/src/components/PushFrameComponent.tsx +221 -0
  250. package/src/components/PushFrameProvider.tsx +177 -0
  251. package/src/components/PushFrameScreen.tsx +30 -0
  252. package/src/components/ScrollViewComponent.tsx +65 -0
  253. package/src/components/StackComponent.tsx +69 -0
  254. package/src/components/TextComponent.tsx +60 -0
  255. package/src/conditions.ts +46 -0
  256. package/src/context/PushFrameContext.ts +89 -0
  257. package/src/index.ts +119 -0
  258. package/src/overlays/BottomSheetHost.tsx +175 -0
  259. package/src/overlays/ToastHost.tsx +147 -0
  260. package/src/primitives/ActivityIndicator.tsx +21 -0
  261. package/src/primitives/FlatList.tsx +49 -0
  262. package/src/primitives/Image.tsx +26 -0
  263. package/src/primitives/KeyboardAvoidingView.tsx +21 -0
  264. package/src/primitives/Modal.tsx +17 -0
  265. package/src/primitives/Pressable.tsx +19 -0
  266. package/src/primitives/SafeAreaView.tsx +42 -0
  267. package/src/primitives/ScrollView.tsx +21 -0
  268. package/src/primitives/StatusBar.tsx +17 -0
  269. package/src/primitives/Switch.tsx +24 -0
  270. package/src/primitives/Text.tsx +43 -0
  271. package/src/primitives/TextInput.tsx +42 -0
  272. package/src/primitives/View.tsx +17 -0
  273. package/src/primitives/index.ts +38 -0
  274. package/src/registry/ComponentRegistry.ts +99 -0
  275. package/src/registry.ts +99 -0
  276. package/src/renderer/RecursiveRenderer.tsx +242 -0
  277. package/src/renderer/bindingResolver.ts +94 -0
  278. package/src/renderer/conditionalEvaluator.ts +29 -0
  279. package/src/renderer.tsx +124 -0
  280. package/src/schema.ts +132 -0
  281. package/src/transformer/index.ts +1016 -0
  282. package/src/transport.ts +104 -0
  283. package/dist/index.d.mts +0 -534
  284. package/dist/index.d.ts +0 -534
  285. package/dist/index.js +0 -1572
  286. package/dist/index.js.map +0 -1
  287. package/dist/index.mjs +0 -1541
  288. package/dist/index.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","e","__esModule","default","Switch","if","_if","actions","_actions","onChange","rest","jsx","onValueChange"],"sourceRoot":"../../../src","sources":["primitives/Switch.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAkD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAclD;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,MAAMA,CAAC;EAAEC,EAAE,EAAEC,GAAG;EAAEC,OAAO,EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;AAA2B,CAAC,EAAE;EAC9F,oBAAO,IAAAV,WAAA,CAAAW,GAAA,EAACZ,YAAA,CAAAK,MAAQ;IAACQ,aAAa,EAAEH,QAAS;IAAA,GAAKC;EAAI,CAAG,CAAC;AACxD","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Text = Text;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ /**
12
+ * Thin wrapper over React Native Text.
13
+ * Strips `if`, `actions`, `content` before forwarding to RN.
14
+ * Display priority: value > content > children (children remain in rest).
15
+ */
16
+ function Text({
17
+ if: _if,
18
+ actions: _actions,
19
+ value,
20
+ content,
21
+ ...rest
22
+ }) {
23
+ // When value or content is provided it takes precedence over JSX children
24
+ // (which are part of rest via RNTextProps inheritance).
25
+ const textContent = value !== undefined ? value : content;
26
+ if (textContent !== undefined) {
27
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
28
+ ...rest,
29
+ children: textContent
30
+ });
31
+ }
32
+ // No explicit text content — forward rest as-is (includes any children prop)
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
34
+ ...rest
35
+ });
36
+ }
37
+ //# sourceMappingURL=Text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","e","__esModule","default","Text","if","_if","actions","_actions","value","content","rest","textContent","undefined","jsx","children"],"sourceRoot":"../../../src","sources":["primitives/Text.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAA8C,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAqB9C;AACA;AACA;AACA;AACA;AACO,SAASG,IAAIA,CAAC;EACnBC,EAAE,EAAEC,GAAG;EACPC,OAAO,EAAEC,QAAQ;EACjBC,KAAK;EACLC,OAAO;EACP,GAAGC;AACe,CAAC,EAAE;EACrB;EACA;EACA,MAAMC,WAAW,GAAGH,KAAK,KAAKI,SAAS,GAAGJ,KAAK,GAAGC,OAAO;EACzD,IAAIE,WAAW,KAAKC,SAAS,EAAE;IAC7B,oBAAO,IAAAb,WAAA,CAAAc,GAAA,EAACf,YAAA,CAAAK,IAAM;MAAA,GAAKO,IAAI;MAAAI,QAAA,EAAGH;IAAW,CAAS,CAAC;EACjD;EACA;EACA,oBAAO,IAAAZ,WAAA,CAAAc,GAAA,EAACf,YAAA,CAAAK,IAAM;IAAA,GAAKO;EAAI,CAAG,CAAC;AAC7B","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TextInput = TextInput;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ /**
12
+ * Thin wrapper over React Native TextInput.
13
+ * Maps Pushframe schema triggers to RN event props:
14
+ * onChange → onChangeText
15
+ * onSubmit → onSubmitEditing
16
+ * Strips `if`, `actions`, `onChange`, `onSubmit` before forwarding to RN.
17
+ */
18
+ function TextInput({
19
+ if: _if,
20
+ actions: _actions,
21
+ onChange,
22
+ onSubmit,
23
+ ...rest
24
+ }) {
25
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
26
+ onChangeText: onChange,
27
+ onSubmitEditing: onSubmit ? () => onSubmit() : undefined,
28
+ ...rest
29
+ });
30
+ }
31
+ //# sourceMappingURL=TextInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","e","__esModule","default","TextInput","if","_if","actions","_actions","onChange","onSubmit","rest","jsx","onChangeText","onSubmitEditing","undefined"],"sourceRoot":"../../../src","sources":["primitives/TextInput.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAwD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAmBxD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,SAASA,CAAC;EACxBC,EAAE,EAAEC,GAAG;EACPC,OAAO,EAAEC,QAAQ;EACjBC,QAAQ;EACRC,QAAQ;EACR,GAAGC;AACoB,CAAC,EAAE;EAC1B,oBACE,IAAAX,WAAA,CAAAY,GAAA,EAACb,YAAA,CAAAK,SAAW;IACVS,YAAY,EAAEJ,QAAS;IACvBK,eAAe,EAAEJ,QAAQ,GAAG,MAAMA,QAAQ,CAAC,CAAC,GAAGK,SAAU;IAAA,GACrDJ;EAAI,CACT,CAAC;AAEN","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.View = View;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ /**
12
+ * Thin wrapper over React Native View.
13
+ * Strips `if`, `actions` before forwarding to RN.
14
+ */
15
+ function View({
16
+ if: _if,
17
+ actions: _actions,
18
+ ...rest
19
+ }) {
20
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
21
+ ...rest
22
+ });
23
+ }
24
+ //# sourceMappingURL=View.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","e","__esModule","default","View","if","_if","actions","_actions","rest","jsx"],"sourceRoot":"../../../src","sources":["primitives/View.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAA8C,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAS9C;AACA;AACA;AACA;AACO,SAASG,IAAIA,CAAC;EAAEC,EAAE,EAAEC,GAAG;EAAEC,OAAO,EAAEC,QAAQ;EAAE,GAAGC;AAAyB,CAAC,EAAE;EAChF,oBAAO,IAAAT,WAAA,CAAAU,GAAA,EAACX,YAAA,CAAAK,IAAM;IAAA,GAAKK;EAAI,CAAG,CAAC;AAC7B","ignoreList":[]}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ActivityIndicator", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _ActivityIndicator.ActivityIndicator;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "FlatList", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _FlatList.FlatList;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "Image", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _Image.Image;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "KeyboardAvoidingView", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _KeyboardAvoidingView.KeyboardAvoidingView;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "Modal", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _Modal.Modal;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "Pressable", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _Pressable.Pressable;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "SafeAreaView", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _SafeAreaView.SafeAreaView;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "ScrollView", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _ScrollView.ScrollView;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "StatusBar", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _StatusBar.StatusBar;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "Switch", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _Switch.Switch;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "Text", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _Text.Text;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "TextInput", {
73
+ enumerable: true,
74
+ get: function () {
75
+ return _TextInput.TextInput;
76
+ }
77
+ });
78
+ Object.defineProperty(exports, "View", {
79
+ enumerable: true,
80
+ get: function () {
81
+ return _View.View;
82
+ }
83
+ });
84
+ var _Text = require("./Text");
85
+ var _View = require("./View");
86
+ var _ScrollView = require("./ScrollView");
87
+ var _Image = require("./Image");
88
+ var _Pressable = require("./Pressable");
89
+ var _TextInput = require("./TextInput");
90
+ var _FlatList = require("./FlatList");
91
+ var _Modal = require("./Modal");
92
+ var _ActivityIndicator = require("./ActivityIndicator");
93
+ var _Switch = require("./Switch");
94
+ var _KeyboardAvoidingView = require("./KeyboardAvoidingView");
95
+ var _SafeAreaView = require("./SafeAreaView");
96
+ var _StatusBar = require("./StatusBar");
97
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Text","require","_View","_ScrollView","_Image","_Pressable","_TextInput","_FlatList","_Modal","_ActivityIndicator","_Switch","_KeyboardAvoidingView","_SafeAreaView","_StatusBar"],"sourceRoot":"../../../src","sources":["primitives/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,KAAA,GAAAD,OAAA;AAGA,IAAAE,WAAA,GAAAF,OAAA;AAGA,IAAAG,MAAA,GAAAH,OAAA;AAGA,IAAAI,UAAA,GAAAJ,OAAA;AAGA,IAAAK,UAAA,GAAAL,OAAA;AAGA,IAAAM,SAAA,GAAAN,OAAA;AAGA,IAAAO,MAAA,GAAAP,OAAA;AAGA,IAAAQ,kBAAA,GAAAR,OAAA;AAGA,IAAAS,OAAA,GAAAT,OAAA;AAGA,IAAAU,qBAAA,GAAAV,OAAA;AAGA,IAAAW,aAAA,GAAAX,OAAA;AAGA,IAAAY,UAAA,GAAAZ,OAAA","ignoreList":[]}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ComponentRegistry = void 0;
7
+ var _Text = require("../primitives/Text");
8
+ var _View = require("../primitives/View");
9
+ var _ScrollView = require("../primitives/ScrollView");
10
+ var _Image = require("../primitives/Image");
11
+ var _Pressable = require("../primitives/Pressable");
12
+ var _TextInput = require("../primitives/TextInput");
13
+ var _FlatList = require("../primitives/FlatList");
14
+ var _Modal = require("../primitives/Modal");
15
+ var _ActivityIndicator = require("../primitives/ActivityIndicator");
16
+ var _Switch = require("../primitives/Switch");
17
+ var _KeyboardAvoidingView = require("../primitives/KeyboardAvoidingView");
18
+ var _SafeAreaView = require("../primitives/SafeAreaView");
19
+ var _StatusBar = require("../primitives/StatusBar");
20
+ // ---------------------------------------------------------------------------
21
+ // Built-in type → component mappings (cannot be overridden)
22
+ // ---------------------------------------------------------------------------
23
+
24
+ const BUILT_IN_TYPES = new Set(['text', 'view', 'scrollview', 'image', 'pressable', 'textinput', 'flatlist', 'modal', 'activityindicator', 'switch', 'keyboardavoidingview', 'safeareaview', 'statusbar']);
25
+ const BUILT_IN_COMPONENTS = new Map([['text', _Text.Text], ['view', _View.View], ['scrollview', _ScrollView.ScrollView], ['image', _Image.Image], ['pressable', _Pressable.Pressable], ['textinput', _TextInput.TextInput], ['flatlist', _FlatList.FlatList], ['modal', _Modal.Modal], ['activityindicator', _ActivityIndicator.ActivityIndicator], ['switch', _Switch.Switch], ['keyboardavoidingview', _KeyboardAvoidingView.KeyboardAvoidingView], ['safeareaview', _SafeAreaView.SafeAreaView], ['statusbar', _StatusBar.StatusBar]]);
26
+
27
+ // ---------------------------------------------------------------------------
28
+ // ComponentRegistry
29
+ // ---------------------------------------------------------------------------
30
+
31
+ /**
32
+ * Maps component type strings to React components.
33
+ *
34
+ * Built-ins are always present and cannot be overridden.
35
+ * Developer-registered components are merged on top for non-conflicting types.
36
+ */
37
+ class ComponentRegistry {
38
+ constructor(developerComponents) {
39
+ // Start with built-ins
40
+ this.components = new Map(BUILT_IN_COMPONENTS);
41
+
42
+ // Merge developer components, skipping any that conflict with built-ins
43
+ if (developerComponents) {
44
+ for (const [type, component] of Object.entries(developerComponents)) {
45
+ if (BUILT_IN_TYPES.has(type)) {
46
+ console.warn(`[PushFrame] ComponentRegistry: "${type}" is a built-in type and cannot be overridden. ` + `Registration skipped.`);
47
+ continue;
48
+ }
49
+ this.components.set(type, component);
50
+ }
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Resolve a type string to its React component.
56
+ * Returns null if no component is registered for the type.
57
+ */
58
+ resolve(type) {
59
+ return this.components.get(type) ?? null;
60
+ }
61
+
62
+ /**
63
+ * Returns all registered type strings (useful for debugging).
64
+ */
65
+ types() {
66
+ return Array.from(this.components.keys());
67
+ }
68
+ }
69
+ exports.ComponentRegistry = ComponentRegistry;
70
+ //# sourceMappingURL=ComponentRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Text","require","_View","_ScrollView","_Image","_Pressable","_TextInput","_FlatList","_Modal","_ActivityIndicator","_Switch","_KeyboardAvoidingView","_SafeAreaView","_StatusBar","BUILT_IN_TYPES","Set","BUILT_IN_COMPONENTS","Map","Text","View","ScrollView","Image","Pressable","TextInput","FlatList","Modal","ActivityIndicator","Switch","KeyboardAvoidingView","SafeAreaView","StatusBar","ComponentRegistry","constructor","developerComponents","components","type","component","Object","entries","has","console","warn","set","resolve","get","types","Array","from","keys","exports"],"sourceRoot":"../../../src","sources":["registry/ComponentRegistry.ts"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAA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AAmB,CAAC,EAAE;QACnE,IAAInB,cAAc,CAACyB,GAAG,CAACJ,IAAI,CAAC,EAAE;UAC5BK,OAAO,CAACC,IAAI,CACV,mCAAmCN,IAAI,iDAAiD,GACtF,uBACJ,CAAC;UACD;QACF;QACA,IAAI,CAACD,UAAU,CAACQ,GAAG,CAACP,IAAI,EAAEC,SAAyD,CAAC;MACtF;IACF;EACF;;EAEA;AACF;AACA;AACA;EACEO,OAAOA,CAACR,IAAY,EAAuD;IACzE,OAAO,IAAI,CAACD,UAAU,CAACU,GAAG,CAACT,IAAI,CAAC,IAAI,IAAI;EAC1C;;EAEA;AACF;AACA;EACEU,KAAKA,CAAA,EAAa;IAChB,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACb,UAAU,CAACc,IAAI,CAAC,CAAC,CAAC;EAC3C;AACF;AAACC,OAAA,CAAAlB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ComponentRegistry = void 0;
7
+ exports.createDefaultRegistry = createDefaultRegistry;
8
+ /**
9
+ * Props passed to every Pushframe component.
10
+ *
11
+ * `props` — fully-resolved (all $bind references substituted) props map.
12
+ * `children` — pre-rendered child nodes (if any).
13
+ * `onAction` — callback for emitting an action event back to the host app.
14
+ * `rawChildren` — raw schema child nodes, available for data-driven components
15
+ * (e.g. FlatList) that need to render the same template
16
+ * multiple times with different context.
17
+ * `renderChild` — render a schema node with an optional context override that
18
+ * gets merged into the parent context. Use this together with
19
+ * `rawChildren` to implement per-item rendering.
20
+ */
21
+
22
+ /**
23
+ * ComponentRegistry maps a component type string (e.g. "stack") to its
24
+ * React component implementation.
25
+ *
26
+ * Use `createRegistry()` to construct one, then call `register()` to add
27
+ * custom components on top.
28
+ */
29
+ class ComponentRegistry {
30
+ components = new Map();
31
+
32
+ /**
33
+ * Register a component under the given type string.
34
+ * Calling register() with an existing type overwrites the previous entry,
35
+ * allowing host apps to override built-ins.
36
+ */
37
+ register(type, component) {
38
+ this.components.set(type, component);
39
+ return this;
40
+ }
41
+
42
+ /**
43
+ * Look up a component by type string.
44
+ * Returns undefined if no component is registered for that type.
45
+ */
46
+ get(type) {
47
+ return this.components.get(type);
48
+ }
49
+
50
+ /**
51
+ * Returns true if the registry contains an entry for the given type.
52
+ */
53
+ has(type) {
54
+ return this.components.has(type);
55
+ }
56
+
57
+ /**
58
+ * Returns all registered type strings (useful for debugging).
59
+ */
60
+ types() {
61
+ return Array.from(this.components.keys());
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Build the default registry pre-loaded with all built-in components.
67
+ */
68
+ exports.ComponentRegistry = ComponentRegistry;
69
+ function createDefaultRegistry() {
70
+ // Lazy-import to keep tree-shaking effective when consumers only need
71
+ // a subset of built-ins.
72
+ const {
73
+ StackComponent
74
+ } = require('./components/StackComponent');
75
+ const {
76
+ TextComponent
77
+ } = require('./components/TextComponent');
78
+ const {
79
+ ButtonComponent
80
+ } = require('./components/ButtonComponent');
81
+ const {
82
+ ImageComponent
83
+ } = require('./components/ImageComponent');
84
+ const {
85
+ ScrollViewComponent
86
+ } = require('./components/ScrollViewComponent');
87
+ const {
88
+ FlatListComponent
89
+ } = require('./components/FlatListComponent');
90
+ return new ComponentRegistry().register('stack', StackComponent)
91
+ // 'screen' is a common server-side root container alias for stack
92
+ .register('screen', StackComponent).register('text', TextComponent).register('button', ButtonComponent).register('image', ImageComponent).register('scrollview', ScrollViewComponent).register('flatlist', FlatListComponent);
93
+ }
94
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ComponentRegistry","components","Map","register","type","component","set","get","has","types","Array","from","keys","exports","createDefaultRegistry","StackComponent","require","TextComponent","ButtonComponent","ImageComponent","ScrollViewComponent","FlatListComponent"],"sourceRoot":"../../src","sources":["registry.ts"],"mappings":";;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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OAAO,EAAEY,cAAc;EACjC;EAAA,CACCZ,QAAQ,CAAC,QAAQ,EAAEY,cAAc,CAAC,CAClCZ,QAAQ,CAAC,MAAM,EAAEc,aAAa,CAAC,CAC/Bd,QAAQ,CAAC,QAAQ,EAAEe,eAAe,CAAC,CACnCf,QAAQ,CAAC,OAAO,EAAEgB,cAAc,CAAC,CACjChB,QAAQ,CAAC,YAAY,EAAEiB,mBAAmB,CAAC,CAC3CjB,QAAQ,CAAC,UAAU,EAAEkB,iBAAiB,CAAC;AAC5C","ignoreList":[]}
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RecursiveRenderer = RecursiveRenderer;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _bindingResolver = require("./bindingResolver");
9
+ var _conditionalEvaluator = require("./conditionalEvaluator");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ // ---------------------------------------------------------------------------
13
+ // Types
14
+ // ---------------------------------------------------------------------------
15
+
16
+ // ---------------------------------------------------------------------------
17
+ // Action wiring helpers
18
+ // ---------------------------------------------------------------------------
19
+
20
+ /**
21
+ * Group an actions array by trigger name and produce a prop map where each
22
+ * trigger key maps to a callback that fires all actions for that trigger.
23
+ */
24
+ function buildActionProps(actions, context, dispatchAction) {
25
+ // Group by trigger
26
+ const grouped = new Map();
27
+ for (const action of actions) {
28
+ const existing = grouped.get(action.trigger);
29
+ if (existing) {
30
+ existing.push(action);
31
+ } else {
32
+ grouped.set(action.trigger, [action]);
33
+ }
34
+ }
35
+ const result = {};
36
+ for (const [trigger, triggerActions] of grouped) {
37
+ result[trigger] = (..._args) => {
38
+ for (const action of triggerActions) {
39
+ const resolvedPayload = action.payload !== undefined ? (0, _bindingResolver.resolveDeep)(action.payload, context) : undefined;
40
+ dispatchAction(action.action, resolvedPayload);
41
+ }
42
+ };
43
+ }
44
+ return result;
45
+ }
46
+
47
+ // ---------------------------------------------------------------------------
48
+ // FlatList special handling
49
+ // ---------------------------------------------------------------------------
50
+
51
+ function renderFlatListNode(node, context, registry, dispatchAction, fallbackComponent) {
52
+ // Resolve all props including the data/items binding
53
+ const resolvedProps = (0, _bindingResolver.resolveProps)(node.props, context);
54
+
55
+ // Build action props for the FlatList container itself
56
+ const actionProps = node.actions ? buildActionProps(node.actions, context, dispatchAction) : {};
57
+
58
+ // Support both `data` (transformer output) and `items` (legacy) for the array source.
59
+ // Extract and resolve; the primitive receives it as `items`.
60
+ const {
61
+ data: resolvedData,
62
+ items: resolvedItems,
63
+ keyExtractor: keyExtractorExpr,
64
+ direction,
65
+ numColumns,
66
+ visible: _visible,
67
+ _propValues: _pv,
68
+ ...restProps
69
+ } = resolvedProps;
70
+ const items = Array.isArray(resolvedData) ? resolvedData : Array.isArray(resolvedItems) ? resolvedItems : [];
71
+
72
+ // Build a keyExtractor function if specified in schema
73
+ let keyExtractorFn;
74
+ if (typeof keyExtractorExpr === 'string') {
75
+ const extractorExpr = keyExtractorExpr;
76
+ keyExtractorFn = (item, index) => {
77
+ const itemContext = {
78
+ ...context,
79
+ item,
80
+ index
81
+ };
82
+ const resolved = (0, _bindingResolver.resolveValue)(extractorExpr, itemContext);
83
+ return resolved !== undefined && resolved !== null ? String(resolved) : String(index);
84
+ };
85
+ }
86
+
87
+ // itemTemplate: per-item context merges { item, index } into current context
88
+ const renderItemFn = ({
89
+ item,
90
+ index
91
+ }) => {
92
+ const itemContext = {
93
+ ...context,
94
+ item,
95
+ index
96
+ };
97
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(RecursiveRenderer, {
98
+ node: node.itemTemplate,
99
+ context: itemContext,
100
+ registry: registry,
101
+ dispatchAction: dispatchAction,
102
+ fallbackComponent: fallbackComponent
103
+ }, keyExtractorFn ? keyExtractorFn(item, index) : index);
104
+ };
105
+ const FlatListComponent = registry.resolve('flatlist');
106
+ if (!FlatListComponent) {
107
+ console.warn('[PushFrame] RecursiveRenderer: "flatlist" not found in registry.');
108
+ return fallbackComponent ? fallbackComponent : null;
109
+ }
110
+ return /*#__PURE__*/_react.default.createElement(FlatListComponent, {
111
+ ...restProps,
112
+ ...actionProps,
113
+ items,
114
+ direction,
115
+ numColumns,
116
+ keyExtractor: keyExtractorFn,
117
+ renderItem: renderItemFn
118
+ });
119
+ }
120
+
121
+ // ---------------------------------------------------------------------------
122
+ // RecursiveRenderer
123
+ // ---------------------------------------------------------------------------
124
+
125
+ /**
126
+ * Stateless recursive renderer. Evaluates schema nodes and produces React elements.
127
+ *
128
+ * - Evaluates `if` expression (string or non-string); returns null when falsy
129
+ * - Handles `visible` prop: returns null when visible resolves to false
130
+ * - Handles FlatList nodes with per-item context injection via `itemTemplate`
131
+ * - Supports `data` (transformer) and `items` (legacy) as FlatList data source
132
+ * - Resolves all prop bindings against current context
133
+ * - Merges `_propValues` into child context (custom component prop injection)
134
+ * - Wires actions to component event handler props
135
+ * - Looks up component in registry; renders fallback or null when not found
136
+ * - Recurses into children
137
+ */
138
+ function RecursiveRenderer({
139
+ node,
140
+ context,
141
+ registry,
142
+ dispatchAction,
143
+ fallbackComponent
144
+ }) {
145
+ // 1. Evaluate conditional — skip entire subtree if falsy
146
+ if (!(0, _conditionalEvaluator.evaluateIf)(node.if, context)) {
147
+ return null;
148
+ }
149
+
150
+ // 2. FlatList special case
151
+ if (node.type === 'flatlist') {
152
+ return renderFlatListNode(node, context, registry, dispatchAction, fallbackComponent);
153
+ }
154
+
155
+ // 3. Resolve props
156
+ const resolvedProps = (0, _bindingResolver.resolveProps)(node.props, context);
157
+
158
+ // 4. Handle `visible` prop — transformer sets visible:false when a node is hidden.
159
+ // A missing or true value means visible; anything falsy hides the node.
160
+ if (resolvedProps.visible !== undefined && !resolvedProps.visible) {
161
+ return null;
162
+ }
163
+
164
+ // 5. Extract SDK-internal props that must not be forwarded to RN components.
165
+ // `_propValues` carries custom-component instance overrides → merge into
166
+ // child context so nested bindings resolve against them.
167
+ const {
168
+ visible: _visible,
169
+ _propValues: propValuesRaw,
170
+ ...propsToForward
171
+ } = resolvedProps;
172
+ const propValues = propValuesRaw;
173
+ const childContext = propValues && Object.keys(propValues).length > 0 ? {
174
+ ...context,
175
+ ...propValues
176
+ } : context;
177
+
178
+ // 6. Wire actions → inject as trigger-named props
179
+ const actionProps = node.actions ? buildActionProps(node.actions, context, dispatchAction) : {};
180
+
181
+ // 7. Resolve component from registry
182
+ const Component = registry.resolve(node.type);
183
+ if (!Component) {
184
+ console.warn(`[PushFrame] RecursiveRenderer: Unknown component type "${node.type}". ` + `Registered types: ${registry.types().join(', ')}`);
185
+ return fallbackComponent ? fallbackComponent : null;
186
+ }
187
+
188
+ // 8. Render children recursively (using childContext for _propValues injection)
189
+ const children = node.children && node.children.length > 0 ? node.children.map((child, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(RecursiveRenderer, {
190
+ node: child,
191
+ context: childContext,
192
+ registry: registry,
193
+ dispatchAction: dispatchAction,
194
+ fallbackComponent: fallbackComponent
195
+ }, `${child.type}-${index}`)) : undefined;
196
+ return /*#__PURE__*/_react.default.createElement(Component, {
197
+ ...propsToForward,
198
+ ...actionProps,
199
+ children
200
+ });
201
+ }
202
+ //# sourceMappingURL=RecursiveRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_bindingResolver","_conditionalEvaluator","_jsxRuntime","e","__esModule","default","buildActionProps","actions","context","dispatchAction","grouped","Map","action","existing","get","trigger","push","set","result","triggerActions","_args","resolvedPayload","payload","undefined","resolveDeep","renderFlatListNode","node","registry","fallbackComponent","resolvedProps","resolveProps","props","actionProps","data","resolvedData","items","resolvedItems","keyExtractor","keyExtractorExpr","direction","numColumns","visible","_visible","_propValues","_pv","restProps","Array","isArray","keyExtractorFn","extractorExpr","item","index","itemContext","resolved","resolveValue","String","renderItemFn","jsx","RecursiveRenderer","itemTemplate","FlatListComponent","resolve","console","warn","React","createElement","renderItem","evaluateIf","if","type","propValuesRaw","propsToForward","propValues","childContext","Object","keys","length","Component","types","join","children","map","child"],"sourceRoot":"../../../src","sources":["renderer/RecursiveRenderer.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAAoD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpD;AACA;AACA;;AAiBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAASG,gBAAgBA,CACvBC,OAAiB,EACjBC,OAAgC,EAChCC,cAA8B,EACgB;EAC9C;EACA,MAAMC,OAAO,GAAG,IAAIC,GAAG,CAAmB,CAAC;EAC3C,KAAK,MAAMC,MAAM,IAAIL,OAAO,EAAE;IAC5B,MAAMM,QAAQ,GAAGH,OAAO,CAACI,GAAG,CAACF,MAAM,CAACG,OAAO,CAAC;IAC5C,IAAIF,QAAQ,EAAE;MACZA,QAAQ,CAACG,IAAI,CAACJ,MAAM,CAAC;IACvB,CAAC,MAAM;MACLF,OAAO,CAACO,GAAG,CAACL,MAAM,CAACG,OAAO,EAAE,CAACH,MAAM,CAAC,CAAC;IACvC;EACF;EAEA,MAAMM,MAAoD,GAAG,CAAC,CAAC;EAC/D,KAAK,MAAM,CAACH,OAAO,EAAEI,cAAc,CAAC,IAAIT,OAAO,EAAE;IAC/CQ,MAAM,CAACH,OAAO,CAAC,GAAG,CAAC,GAAGK,KAAgB,KAAK;MACzC,KAAK,MAAMR,MAAM,IAAIO,cAAc,EAAE;QACnC,MAAME,eAAe,GACnBT,MAAM,CAACU,OAAO,KAAKC,SAAS,GACvB,IAAAC,4BAAW,EAACZ,MAAM,CAACU,OAAO,EAAEd,OAAO,CAAC,GACrCe,SAAS;QACfd,cAAc,CAACG,M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