@fractal-io-technology/spec 0.0.0-stage → 2.2.2

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 (323) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +165 -2
  3. package/conformance/1.0/action-cases.json +227 -0
  4. package/conformance/1.0/bind-cases.json +768 -0
  5. package/conformance/1.0/cases.json +25139 -0
  6. package/conformance/1.0/layout/01-onboarding-start.json +95 -0
  7. package/conformance/1.0/layout/02-home-discover.json +177 -0
  8. package/conformance/1.0/layout/03-filters.json +186 -0
  9. package/conformance/1.0/layout/README.md +145 -0
  10. package/conformance/1.0/layout/REPORT.md +222 -0
  11. package/conformance/1.0/layout/alert.json +22 -0
  12. package/conformance/1.0/layout/iphone-14-15-pro-107.json +272 -0
  13. package/conformance/1.0/layout/live_status_on_its_way_4.ios.json +100 -0
  14. package/conformance/1.0/layout/lucy-booking-mobile.json +261 -0
  15. package/conformance/1.0/layout/lucy-booking-tablet.json +817 -0
  16. package/conformance/1.0/layout/lucy-booking.json +185 -0
  17. package/conformance/1.0/layout/lucy-header.json +84 -0
  18. package/conformance/1.0/layout/lucy-welcome-pin-mobile.json +31 -0
  19. package/conformance/1.0/layout/lucy-welcome-pin.json +31 -0
  20. package/conformance/1.0/layout/measured/android/01-onboarding-start.json +95 -0
  21. package/conformance/1.0/layout/measured/android/02-home-discover.json +177 -0
  22. package/conformance/1.0/layout/measured/android/03-filters.json +186 -0
  23. package/conformance/1.0/layout/measured/android/alert.json +22 -0
  24. package/conformance/1.0/layout/measured/android/iphone-14-15-pro-107.json +272 -0
  25. package/conformance/1.0/layout/measured/android/live_status_on_its_way_4.ios.json +100 -0
  26. package/conformance/1.0/layout/measured/android/lucy-booking-mobile.json +261 -0
  27. package/conformance/1.0/layout/measured/android/lucy-booking-tablet.json +817 -0
  28. package/conformance/1.0/layout/measured/android/lucy-booking.json +185 -0
  29. package/conformance/1.0/layout/measured/android/lucy-header.json +84 -0
  30. package/conformance/1.0/layout/measured/android/lucy-welcome-pin-mobile.json +31 -0
  31. package/conformance/1.0/layout/measured/android/lucy-welcome-pin.json +31 -0
  32. package/conformance/1.0/layout/measured/android/navigation-bar.json +46 -0
  33. package/conformance/1.0/layout/measured/android/probe-alert-banner-flutter.json +37 -0
  34. package/conformance/1.0/layout/measured/android/probe-alert-banner-regression-flutter.json +51 -0
  35. package/conformance/1.0/layout/measured/android/probe-alert-banner-stack-flutter.json +29 -0
  36. package/conformance/1.0/layout/measured/android/probe-card.json +35 -0
  37. package/conformance/1.0/layout/measured/android/probe-check-box-flutter.json +20 -0
  38. package/conformance/1.0/layout/measured/android/probe-container-height.json +21 -0
  39. package/conformance/1.0/layout/measured/android/probe-divider.json +55 -0
  40. package/conformance/1.0/layout/measured/android/probe-dropdown-menu-flutter.json +24 -0
  41. package/conformance/1.0/layout/measured/android/probe-dropdown-menu-max-lines.json +11 -0
  42. package/conformance/1.0/layout/measured/android/probe-expanded.json +31 -0
  43. package/conformance/1.0/layout/measured/android/probe-failed-decode.json +11 -0
  44. package/conformance/1.0/layout/measured/android/probe-flex.json +43 -0
  45. package/conformance/1.0/layout/measured/android/probe-grid-flutter.json +78 -0
  46. package/conformance/1.0/layout/measured/android/probe-grid.json +29 -0
  47. package/conformance/1.0/layout/measured/android/probe-icon-button-flutter.json +25 -0
  48. package/conformance/1.0/layout/measured/android/probe-icon-flutter.json +19 -0
  49. package/conformance/1.0/layout/measured/android/probe-icon-sizing.json +36 -0
  50. package/conformance/1.0/layout/measured/android/probe-image-flutter.json +24 -0
  51. package/conformance/1.0/layout/measured/android/probe-list-flutter.json +79 -0
  52. package/conformance/1.0/layout/measured/android/probe-list-regression-flutter.json +94 -0
  53. package/conformance/1.0/layout/measured/android/probe-list-row-flutter.json +86 -0
  54. package/conformance/1.0/layout/measured/android/probe-list-styles.json +45 -0
  55. package/conformance/1.0/layout/measured/android/probe-pin-input-parity.json +18 -0
  56. package/conformance/1.0/layout/measured/android/probe-progress-track-flutter.json +41 -0
  57. package/conformance/1.0/layout/measured/android/probe-progress-track-regression-flutter.json +57 -0
  58. package/conformance/1.0/layout/measured/android/probe-row-column.json +84 -0
  59. package/conformance/1.0/layout/measured/android/probe-scroll.json +54 -0
  60. package/conformance/1.0/layout/measured/android/probe-search-flutter.json +22 -0
  61. package/conformance/1.0/layout/measured/android/probe-size-constraints.json +20 -0
  62. package/conformance/1.0/layout/measured/android/probe-spacer.json +43 -0
  63. package/conformance/1.0/layout/measured/android/probe-stat-progress-track.json +14 -0
  64. package/conformance/1.0/layout/measured/android/probe-text-button-flutter.json +27 -0
  65. package/conformance/1.0/layout/measured/android/probe-text-field-flutter.json +28 -0
  66. package/conformance/1.0/layout/measured/android/probe-text.json +30 -0
  67. package/conformance/1.0/layout/measured/android/wallet-home.json +127 -0
  68. package/conformance/1.0/layout/measured/web/01-onboarding-start.json +95 -0
  69. package/conformance/1.0/layout/measured/web/02-home-discover.json +177 -0
  70. package/conformance/1.0/layout/measured/web/03-filters.json +186 -0
  71. package/conformance/1.0/layout/measured/web/alert.json +22 -0
  72. package/conformance/1.0/layout/measured/web/iphone-14-15-pro-107.json +272 -0
  73. package/conformance/1.0/layout/measured/web/live_status_on_its_way_4.ios.json +100 -0
  74. package/conformance/1.0/layout/measured/web/lucy-booking-mobile.json +261 -0
  75. package/conformance/1.0/layout/measured/web/lucy-booking-tablet.json +817 -0
  76. package/conformance/1.0/layout/measured/web/lucy-booking.json +185 -0
  77. package/conformance/1.0/layout/measured/web/lucy-header.json +84 -0
  78. package/conformance/1.0/layout/measured/web/lucy-welcome-pin-mobile.json +31 -0
  79. package/conformance/1.0/layout/measured/web/lucy-welcome-pin.json +31 -0
  80. package/conformance/1.0/layout/measured/web/navigation-bar.json +46 -0
  81. package/conformance/1.0/layout/measured/web/probe-alert-banner-flutter.json +37 -0
  82. package/conformance/1.0/layout/measured/web/probe-alert-banner-regression-flutter.json +51 -0
  83. package/conformance/1.0/layout/measured/web/probe-alert-banner-stack-flutter.json +29 -0
  84. package/conformance/1.0/layout/measured/web/probe-card.json +35 -0
  85. package/conformance/1.0/layout/measured/web/probe-check-box-flutter.json +20 -0
  86. package/conformance/1.0/layout/measured/web/probe-container-height.json +21 -0
  87. package/conformance/1.0/layout/measured/web/probe-divider.json +55 -0
  88. package/conformance/1.0/layout/measured/web/probe-dropdown-menu-flutter.json +24 -0
  89. package/conformance/1.0/layout/measured/web/probe-dropdown-menu-max-lines.json +11 -0
  90. package/conformance/1.0/layout/measured/web/probe-expanded.json +31 -0
  91. package/conformance/1.0/layout/measured/web/probe-failed-decode.json +15 -0
  92. package/conformance/1.0/layout/measured/web/probe-flex.json +43 -0
  93. package/conformance/1.0/layout/measured/web/probe-grid-flutter.json +78 -0
  94. package/conformance/1.0/layout/measured/web/probe-grid.json +29 -0
  95. package/conformance/1.0/layout/measured/web/probe-icon-button-flutter.json +25 -0
  96. package/conformance/1.0/layout/measured/web/probe-icon-flutter.json +19 -0
  97. package/conformance/1.0/layout/measured/web/probe-icon-sizing.json +36 -0
  98. package/conformance/1.0/layout/measured/web/probe-image-flutter.json +24 -0
  99. package/conformance/1.0/layout/measured/web/probe-list-flutter.json +79 -0
  100. package/conformance/1.0/layout/measured/web/probe-list-regression-flutter.json +94 -0
  101. package/conformance/1.0/layout/measured/web/probe-list-row-flutter.json +86 -0
  102. package/conformance/1.0/layout/measured/web/probe-list-styles.json +45 -0
  103. package/conformance/1.0/layout/measured/web/probe-pin-input-parity.json +18 -0
  104. package/conformance/1.0/layout/measured/web/probe-progress-track-flutter.json +41 -0
  105. package/conformance/1.0/layout/measured/web/probe-progress-track-regression-flutter.json +57 -0
  106. package/conformance/1.0/layout/measured/web/probe-row-column.json +84 -0
  107. package/conformance/1.0/layout/measured/web/probe-scroll.json +54 -0
  108. package/conformance/1.0/layout/measured/web/probe-search-flutter.json +22 -0
  109. package/conformance/1.0/layout/measured/web/probe-size-constraints.json +20 -0
  110. package/conformance/1.0/layout/measured/web/probe-spacer.json +43 -0
  111. package/conformance/1.0/layout/measured/web/probe-stat-progress-track.json +14 -0
  112. package/conformance/1.0/layout/measured/web/probe-text-button-flutter.json +27 -0
  113. package/conformance/1.0/layout/measured/web/probe-text-field-flutter.json +28 -0
  114. package/conformance/1.0/layout/measured/web/probe-text.json +30 -0
  115. package/conformance/1.0/layout/measured/web/wallet-home.json +127 -0
  116. package/conformance/1.0/layout/navigation-bar.json +46 -0
  117. package/conformance/1.0/layout/probe-alert-banner-flutter.json +37 -0
  118. package/conformance/1.0/layout/probe-alert-banner-regression-flutter.json +51 -0
  119. package/conformance/1.0/layout/probe-alert-banner-stack-flutter.json +29 -0
  120. package/conformance/1.0/layout/probe-card.json +35 -0
  121. package/conformance/1.0/layout/probe-check-box-flutter.json +20 -0
  122. package/conformance/1.0/layout/probe-container-height.json +21 -0
  123. package/conformance/1.0/layout/probe-divider.json +55 -0
  124. package/conformance/1.0/layout/probe-dropdown-menu-flutter.json +24 -0
  125. package/conformance/1.0/layout/probe-dropdown-menu-max-lines.json +11 -0
  126. package/conformance/1.0/layout/probe-expanded.json +31 -0
  127. package/conformance/1.0/layout/probe-failed-decode.json +13 -0
  128. package/conformance/1.0/layout/probe-flex.json +43 -0
  129. package/conformance/1.0/layout/probe-grid-flutter.json +78 -0
  130. package/conformance/1.0/layout/probe-grid.json +29 -0
  131. package/conformance/1.0/layout/probe-icon-button-flutter.json +25 -0
  132. package/conformance/1.0/layout/probe-icon-flutter.json +19 -0
  133. package/conformance/1.0/layout/probe-icon-sizing.json +36 -0
  134. package/conformance/1.0/layout/probe-image-flutter.json +24 -0
  135. package/conformance/1.0/layout/probe-list-flutter.json +79 -0
  136. package/conformance/1.0/layout/probe-list-regression-flutter.json +94 -0
  137. package/conformance/1.0/layout/probe-list-row-flutter.json +86 -0
  138. package/conformance/1.0/layout/probe-list-styles.json +45 -0
  139. package/conformance/1.0/layout/probe-pin-input-parity.json +18 -0
  140. package/conformance/1.0/layout/probe-progress-track-flutter.json +41 -0
  141. package/conformance/1.0/layout/probe-progress-track-regression-flutter.json +57 -0
  142. package/conformance/1.0/layout/probe-row-column.json +84 -0
  143. package/conformance/1.0/layout/probe-scroll.json +54 -0
  144. package/conformance/1.0/layout/probe-search-flutter.json +22 -0
  145. package/conformance/1.0/layout/probe-size-constraints.json +20 -0
  146. package/conformance/1.0/layout/probe-spacer.json +43 -0
  147. package/conformance/1.0/layout/probe-stat-progress-track.json +14 -0
  148. package/conformance/1.0/layout/probe-text-button-flutter.json +27 -0
  149. package/conformance/1.0/layout/probe-text-field-flutter.json +28 -0
  150. package/conformance/1.0/layout/probe-text.json +30 -0
  151. package/conformance/1.0/layout/probes/probe-alert-banner-flutter.json +296 -0
  152. package/conformance/1.0/layout/probes/probe-alert-banner-regression-flutter.json +1 -0
  153. package/conformance/1.0/layout/probes/probe-alert-banner-stack-flutter.json +219 -0
  154. package/conformance/1.0/layout/probes/probe-card.json +252 -0
  155. package/conformance/1.0/layout/probes/probe-check-box-flutter.json +86 -0
  156. package/conformance/1.0/layout/probes/probe-container-height.json +147 -0
  157. package/conformance/1.0/layout/probes/probe-divider.json +469 -0
  158. package/conformance/1.0/layout/probes/probe-dropdown-menu-flutter.json +293 -0
  159. package/conformance/1.0/layout/probes/probe-dropdown-menu-max-lines.json +54 -0
  160. package/conformance/1.0/layout/probes/probe-expanded.json +208 -0
  161. package/conformance/1.0/layout/probes/probe-failed-decode.json +96 -0
  162. package/conformance/1.0/layout/probes/probe-flex.json +353 -0
  163. package/conformance/1.0/layout/probes/probe-grid-flutter.json +584 -0
  164. package/conformance/1.0/layout/probes/probe-grid.json +209 -0
  165. package/conformance/1.0/layout/probes/probe-icon-button-flutter.json +143 -0
  166. package/conformance/1.0/layout/probes/probe-icon-flutter.json +89 -0
  167. package/conformance/1.0/layout/probes/probe-icon-sizing.json +219 -0
  168. package/conformance/1.0/layout/probes/probe-image-flutter.json +130 -0
  169. package/conformance/1.0/layout/probes/probe-list-flutter.json +732 -0
  170. package/conformance/1.0/layout/probes/probe-list-regression-flutter.json +815 -0
  171. package/conformance/1.0/layout/probes/probe-list-row-flutter.json +734 -0
  172. package/conformance/1.0/layout/probes/probe-list-styles.json +332 -0
  173. package/conformance/1.0/layout/probes/probe-pin-input-parity.json +87 -0
  174. package/conformance/1.0/layout/probes/probe-progress-track-flutter.json +298 -0
  175. package/conformance/1.0/layout/probes/probe-progress-track-regression-flutter.json +525 -0
  176. package/conformance/1.0/layout/probes/probe-row-column.json +784 -0
  177. package/conformance/1.0/layout/probes/probe-scroll.json +378 -0
  178. package/conformance/1.0/layout/probes/probe-search-flutter.json +138 -0
  179. package/conformance/1.0/layout/probes/probe-size-constraints.json +157 -0
  180. package/conformance/1.0/layout/probes/probe-spacer.json +291 -0
  181. package/conformance/1.0/layout/probes/probe-stat-progress-track.json +87 -0
  182. package/conformance/1.0/layout/probes/probe-text-button-flutter.json +163 -0
  183. package/conformance/1.0/layout/probes/probe-text-field-flutter.json +170 -0
  184. package/conformance/1.0/layout/probes/probe-text.json +202 -0
  185. package/conformance/1.0/layout/report/01-onboarding-start.md +49 -0
  186. package/conformance/1.0/layout/report/02-home-discover.md +98 -0
  187. package/conformance/1.0/layout/report/03-filters.md +85 -0
  188. package/conformance/1.0/layout/report/alert.md +27 -0
  189. package/conformance/1.0/layout/report/iphone-14-15-pro-107.md +47 -0
  190. package/conformance/1.0/layout/report/live_status_on_its_way_4.ios.md +60 -0
  191. package/conformance/1.0/layout/report/lucy-booking-mobile.md +81 -0
  192. package/conformance/1.0/layout/report/lucy-booking-tablet.md +279 -0
  193. package/conformance/1.0/layout/report/lucy-booking.md +117 -0
  194. package/conformance/1.0/layout/report/lucy-header.md +64 -0
  195. package/conformance/1.0/layout/report/lucy-welcome-pin-mobile.md +15 -0
  196. package/conformance/1.0/layout/report/lucy-welcome-pin.md +11 -0
  197. package/conformance/1.0/layout/report/navigation-bar.md +23 -0
  198. package/conformance/1.0/layout/report/probe-alert-banner-flutter.md +11 -0
  199. package/conformance/1.0/layout/report/probe-alert-banner-regression-flutter.md +27 -0
  200. package/conformance/1.0/layout/report/probe-alert-banner-stack-flutter.md +11 -0
  201. package/conformance/1.0/layout/report/probe-card.md +11 -0
  202. package/conformance/1.0/layout/report/probe-check-box-flutter.md +17 -0
  203. package/conformance/1.0/layout/report/probe-divider.md +11 -0
  204. package/conformance/1.0/layout/report/probe-dropdown-menu-flutter.md +15 -0
  205. package/conformance/1.0/layout/report/probe-dropdown-menu-max-lines.md +15 -0
  206. package/conformance/1.0/layout/report/probe-flex.md +23 -0
  207. package/conformance/1.0/layout/report/probe-grid-flutter.md +11 -0
  208. package/conformance/1.0/layout/report/probe-icon-button-flutter.md +11 -0
  209. package/conformance/1.0/layout/report/probe-icon-flutter.md +11 -0
  210. package/conformance/1.0/layout/report/probe-image-flutter.md +11 -0
  211. package/conformance/1.0/layout/report/probe-list-flutter.md +11 -0
  212. package/conformance/1.0/layout/report/probe-list-regression-flutter.md +27 -0
  213. package/conformance/1.0/layout/report/probe-list-row-flutter.md +11 -0
  214. package/conformance/1.0/layout/report/probe-pin-input-parity.md +11 -0
  215. package/conformance/1.0/layout/report/probe-progress-track-flutter.md +11 -0
  216. package/conformance/1.0/layout/report/probe-progress-track-regression-flutter.md +20 -0
  217. package/conformance/1.0/layout/report/probe-row-column.md +20 -0
  218. package/conformance/1.0/layout/report/probe-scroll.md +11 -0
  219. package/conformance/1.0/layout/report/probe-search-flutter.md +11 -0
  220. package/conformance/1.0/layout/report/probe-spacer.md +11 -0
  221. package/conformance/1.0/layout/report/probe-text-button-flutter.md +22 -0
  222. package/conformance/1.0/layout/report/probe-text-field-flutter.md +11 -0
  223. package/conformance/1.0/layout/report/probe-text.md +31 -0
  224. package/conformance/1.0/layout/report/wallet-home.md +35 -0
  225. package/conformance/1.0/layout/tolerance.json +12 -0
  226. package/conformance/1.0/layout/wallet-home.json +127 -0
  227. package/conformance/1.0/response-cases.json +228 -0
  228. package/conformance/1.0/screen-cases.json +198 -0
  229. package/conformance/1.0/screens/01-onboarding-start.json +994 -0
  230. package/conformance/1.0/screens/02-home-discover.json +2165 -0
  231. package/conformance/1.0/screens/03-filters.json +2290 -0
  232. package/conformance/1.0/screens/alert.json +231 -0
  233. package/conformance/1.0/screens/iphone-14-15-pro-107.json +3149 -0
  234. package/conformance/1.0/screens/live_status_on_its_way_4.ios.json +1313 -0
  235. package/conformance/1.0/screens/lucy-booking-mobile.json +3063 -0
  236. package/conformance/1.0/screens/lucy-booking-tablet.json +10371 -0
  237. package/conformance/1.0/screens/lucy-booking.json +2130 -0
  238. package/conformance/1.0/screens/lucy-header.json +1201 -0
  239. package/conformance/1.0/screens/lucy-welcome-pin-mobile.json +417 -0
  240. package/conformance/1.0/screens/lucy-welcome-pin.json +409 -0
  241. package/conformance/1.0/screens/navigation-bar.json +542 -0
  242. package/conformance/1.0/screens/wallet-home.json +1585 -0
  243. package/dist/action.d.ts +10616 -0
  244. package/dist/action.d.ts.map +1 -0
  245. package/dist/action.js +92 -0
  246. package/dist/action.js.map +1 -0
  247. package/dist/bind.d.ts +32 -0
  248. package/dist/bind.d.ts.map +1 -0
  249. package/dist/bind.js +102 -0
  250. package/dist/bind.js.map +1 -0
  251. package/dist/block-ref.d.ts +17 -0
  252. package/dist/block-ref.d.ts.map +1 -0
  253. package/dist/block-ref.js +17 -0
  254. package/dist/block-ref.js.map +1 -0
  255. package/dist/block-types.d.ts +26 -0
  256. package/dist/block-types.d.ts.map +1 -0
  257. package/dist/block-types.js +39 -0
  258. package/dist/block-types.js.map +1 -0
  259. package/dist/block.d.ts +20908 -0
  260. package/dist/block.d.ts.map +1 -0
  261. package/dist/block.js +81 -0
  262. package/dist/block.js.map +1 -0
  263. package/dist/blocks/display.d.ts +1915 -0
  264. package/dist/blocks/display.d.ts.map +1 -0
  265. package/dist/blocks/display.js +433 -0
  266. package/dist/blocks/display.js.map +1 -0
  267. package/dist/blocks/input.d.ts +7148 -0
  268. package/dist/blocks/input.d.ts.map +1 -0
  269. package/dist/blocks/input.js +855 -0
  270. package/dist/blocks/input.js.map +1 -0
  271. package/dist/blocks/layout.d.ts +2482 -0
  272. package/dist/blocks/layout.d.ts.map +1 -0
  273. package/dist/blocks/layout.js +266 -0
  274. package/dist/blocks/layout.js.map +1 -0
  275. package/dist/blocks/list.d.ts +980 -0
  276. package/dist/blocks/list.d.ts.map +1 -0
  277. package/dist/blocks/list.js +286 -0
  278. package/dist/blocks/list.js.map +1 -0
  279. package/dist/common.d.ts +958 -0
  280. package/dist/common.d.ts.map +1 -0
  281. package/dist/common.js +108 -0
  282. package/dist/common.js.map +1 -0
  283. package/dist/deprecated.d.ts +11 -0
  284. package/dist/deprecated.d.ts.map +1 -0
  285. package/dist/deprecated.js +26 -0
  286. package/dist/deprecated.js.map +1 -0
  287. package/dist/index.d.ts +20 -0
  288. package/dist/index.d.ts.map +1 -0
  289. package/dist/index.js +15 -0
  290. package/dist/index.js.map +1 -0
  291. package/dist/layout.d.ts +103 -0
  292. package/dist/layout.d.ts.map +1 -0
  293. package/dist/layout.js +113 -0
  294. package/dist/layout.js.map +1 -0
  295. package/dist/properties.d.ts +787 -0
  296. package/dist/properties.d.ts.map +1 -0
  297. package/dist/properties.js +447 -0
  298. package/dist/properties.js.map +1 -0
  299. package/dist/screen.d.ts +10494 -0
  300. package/dist/screen.d.ts.map +1 -0
  301. package/dist/screen.js +32 -0
  302. package/dist/screen.js.map +1 -0
  303. package/package.json +57 -4
  304. package/schema/1.0/action.json +109 -0
  305. package/schema/1.0/block.json +5886 -0
  306. package/schema/1.0/response.json +91 -0
  307. package/schema/1.0/screen.json +22 -0
  308. package/src/README.md +135 -0
  309. package/src/action.ts +119 -0
  310. package/src/bind.ts +114 -0
  311. package/src/block-ref.ts +18 -0
  312. package/src/block-types.ts +55 -0
  313. package/src/block.ts +116 -0
  314. package/src/blocks/display.ts +543 -0
  315. package/src/blocks/input.ts +1031 -0
  316. package/src/blocks/layout.ts +322 -0
  317. package/src/blocks/list.ts +355 -0
  318. package/src/common.ts +133 -0
  319. package/src/deprecated.ts +40 -0
  320. package/src/index.ts +31 -0
  321. package/src/layout.ts +194 -0
  322. package/src/properties.ts +516 -0
  323. package/src/screen.ts +39 -0
@@ -0,0 +1,322 @@
1
+ import { z } from "zod";
2
+ import { blockRef } from "../block-ref.ts";
3
+ import { COMMON_PROPERTY_KEYS, deprecated, deprecateKeys, ignoredOn, multiChildShape, singleChildShape } from "../common.ts";
4
+ import {
5
+ backgroundImageSchema,
6
+ blendModeSchema,
7
+ borderSchema,
8
+ boxConstraintsSchema,
9
+ clipBehaviorSchema,
10
+ colorSchema,
11
+ cornerRadiiSchema,
12
+ gradientSchema,
13
+ intSchema,
14
+ keyboardDismissBehaviorSchema,
15
+ scrollPhysicsSchema,
16
+ shadowSchema,
17
+ transformSchema,
18
+ alignmentSchema,
19
+ flexCrossAxisAlignmentSchema,
20
+ mainAxisAlignmentSchema,
21
+ mainAxisSizeSchema,
22
+ textBaselineSchema,
23
+ textDirectionSchema,
24
+ verticalDirectionSchema,
25
+ } from "../properties.ts";
26
+
27
+ /**
28
+ * Layout and structural blocks. Each schema is the `data` payload of a block
29
+ * `{ type, data }`; the Swift source of every block is named next to it
30
+ * (paths relative to `fractal_core_blocks-ios/Sources/Blocks`).
31
+ */
32
+
33
+ /**
34
+ * Flutter `Container` (contract 2.0): the common single-child keys plus the
35
+ * `Container` / `BoxDecoration` properties. `size` is an exact size, the child
36
+ * is hugged unless `alignment_geometry` is set, and nothing is clipped unless
37
+ * `clip_behavior` says so. `fixed_size` is deprecated and ignored.
38
+ * Swift: Container/FIOCoreContainerDataBlock.swift.
39
+ */
40
+ const containerShape = singleChildShape(blockRef);
41
+
42
+ export const containerDataSchema = z.strictObject({
43
+ ...containerShape,
44
+ ...deprecateKeys(containerShape, ["fixed_size"], ignoredOn("container", "S9", "containers")),
45
+ constraints: boxConstraintsSchema.optional(),
46
+ corner_radii: cornerRadiiSchema.optional(),
47
+ border: borderSchema.optional(),
48
+ shadow: shadowSchema.optional(),
49
+ clip_behavior: clipBehaviorSchema.optional(),
50
+ background_blend_mode: blendModeSchema.optional(),
51
+ /** Painted above the child, inside the shape: the gradient replaces the color (Flutter `BoxDecoration`), then the image. */
52
+ foreground_decoration: z
53
+ .strictObject({
54
+ color: colorSchema.optional(),
55
+ gradient: gradientSchema.optional(),
56
+ image: backgroundImageSchema.optional(),
57
+ })
58
+ .optional(),
59
+ transform: transformSchema.optional(),
60
+ /** The transform's origin; absent = the top left corner in both directions (Flutter `transformAlignment` null). */
61
+ transform_alignment: alignmentSchema.optional(),
62
+ });
63
+
64
+ /**
65
+ * Flutter `Padding` (contract 2.0): only `child`, `padding` and `id` apply. The
66
+ * child gets the parent's constraints minus the insets (tight stays tight), sits
67
+ * at the top start, and the block is the child's size plus the insets, clamped
68
+ * to the parent; without a child it is the insets' size. Negative constants
69
+ * count as 0. The other common keys are deprecated and ignored.
70
+ * Swift: Padding/FIOCorePaddingDataBlock.swift (single child, no own keys).
71
+ */
72
+ const paddingShape = singleChildShape(blockRef);
73
+
74
+ export const paddingDataSchema = z.strictObject({
75
+ ...paddingShape,
76
+ ...deprecateKeys(
77
+ paddingShape,
78
+ [...COMMON_PROPERTY_KEYS.filter((key) => key !== "padding"), "events"],
79
+ ignoredOn("padding", "", "padding blocks"),
80
+ ),
81
+ });
82
+
83
+ /** A Flutter flex factor: an integer of at least 1 (0 would mean "not flexible"). */
84
+ const flexFactorSchema = intSchema.min(1);
85
+
86
+ /**
87
+ * Flutter `Expanded` (contract 2.0) = `flexible` with `fit: tight`. As a direct child of a `row` /
88
+ * `column` with a bounded main axis it takes its `flex` share (default 1) of the free main-axis
89
+ * space and forces its child to it; the cross axis is loose. Outside a Flex it is transparent, and
90
+ * on an unbounded main axis its child keeps its natural size. `show_max_height` /
91
+ * `show_max_width` and the other common keys are deprecated and ignored.
92
+ * Swift: Expanded/FIOCoreExpandedDataBlock.swift.
93
+ */
94
+ const ignoredOnExpanded = ignoredOn("expanded", "", "expanded blocks");
95
+ const expandedShape = singleChildShape(blockRef);
96
+
97
+ export const expandedDataSchema = z.strictObject({
98
+ ...expandedShape,
99
+ ...deprecateKeys(expandedShape, [...COMMON_PROPERTY_KEYS, "events"], ignoredOnExpanded),
100
+ show_max_height: deprecated(z.boolean().optional(), ignoredOnExpanded("show_max_height")),
101
+ show_max_width: deprecated(z.boolean().optional(), ignoredOnExpanded("show_max_width")),
102
+ flex: flexFactorSchema.optional(),
103
+ });
104
+
105
+ /**
106
+ * Flutter `Flexible` (contract 2.0): like `expanded`, but `fit` defaults to `loose`, so the child may
107
+ * be smaller than its share (`tight` behaves as `expanded`). Only `child`, `id`, `flex` and `fit`.
108
+ */
109
+ export const flexibleDataSchema = z.strictObject({
110
+ child: blockRef.optional(),
111
+ id: z.string().nullish(),
112
+ flex: flexFactorSchema.optional(),
113
+ fit: z.enum(["loose", "tight"]).optional(),
114
+ });
115
+
116
+ /**
117
+ * Flutter `Spacer` (contract 2.0) = an `expanded` with no child (`SizedBox.shrink`). As a direct child
118
+ * of a `row` / `column` with a bounded main axis it takes its `flex` share (default 1) of the free
119
+ * main-axis space with the other flex children, and is 0 on the cross axis. Elsewhere, and on an
120
+ * unbounded main axis, it is 0 × 0. `child`, `show_max_height` / `show_max_width` and the other
121
+ * common keys are deprecated and ignored. Swift: Spacer/FIOCoreSpacerDataBlock.swift.
122
+ */
123
+ const ignoredOnSpacer = ignoredOn("spacer", "", "spacers");
124
+ const spacerShape = singleChildShape(blockRef);
125
+
126
+ export const spacerDataSchema = z.strictObject({
127
+ ...spacerShape,
128
+ ...deprecateKeys(spacerShape, [...COMMON_PROPERTY_KEYS, "events", "child"], ignoredOnSpacer),
129
+ show_max_height: deprecated(z.boolean().optional(), ignoredOnSpacer("show_max_height")),
130
+ show_max_width: deprecated(z.boolean().optional(), ignoredOnSpacer("show_max_width")),
131
+ flex: flexFactorSchema.optional(),
132
+ });
133
+
134
+ /**
135
+ * Flutter `SingleChildScrollView` (contract 2.0). The child gets the scroll's constraints with the
136
+ * main axis unbounded and the cross axis as received, deflated by `padding` (insets inside the
137
+ * scrollable area). The viewport is the child's size plus `padding`, clamped to the parent's
138
+ * constraints, so it hugs a smaller child; the child sits at the start. In a `row` / `column` it is
139
+ * not flexible (wrap it in `expanded` to fill). `is_vertical` defaults to true, `reverse` to false,
140
+ * `clip_behavior` to `hard_edge`, `keyboard_dismiss_behavior` to `manual`; no `physics` means the
141
+ * platform default. `show_scroll_indicator` and the other common keys are deprecated and ignored.
142
+ * Swift: SingleChildScroll/FIOCoreSingleChildScrollDataBlock.swift.
143
+ */
144
+ const ignoredOnScroll = ignoredOn("single_child_scroll", "", "scrolls");
145
+ const scrollShape = singleChildShape(blockRef);
146
+
147
+ export const singleChildScrollDataSchema = z.strictObject({
148
+ ...scrollShape,
149
+ ...deprecateKeys(scrollShape, [...COMMON_PROPERTY_KEYS.filter((key) => key !== "padding"), "events"], ignoredOnScroll),
150
+ is_vertical: z.boolean().optional(),
151
+ show_scroll_indicator: deprecated(
152
+ z.boolean().optional(),
153
+ ignoredOnScroll("show_scroll_indicator") + " The indicator is always hidden (Flutter mobile shows no scrollbar).",
154
+ ),
155
+ reverse: z.boolean().optional(),
156
+ clip_behavior: clipBehaviorSchema.optional(),
157
+ physics: scrollPhysicsSchema.optional(),
158
+ keyboard_dismiss_behavior: keyboardDismissBehaviorSchema.optional(),
159
+ });
160
+
161
+ /**
162
+ * Flutter `Card` / `Card.filled` / `Card.outlined` with the Material 3 defaults (contract 2.0).
163
+ * `variant` defaults to `elevated`; `elevation` (>= 0) defaults to 1 for `elevated` and 0 for
164
+ * `filled` / `outlined`; `corner_radius` defaults to 12, overridden per corner by `corner_radii`;
165
+ * `margin` (outside the card, in its frame) defaults to all 4; `clip_behavior` defaults to `none`;
166
+ * `border_on_foreground` and `semantic_container` default to true; `shadow_color` defaults to
167
+ * black; `surface_tint_color` has no default (no tint). An absent `background_color` is the
168
+ * variant's color token; `border` is drawn inside the edge (width default 1; `outlined` without a
169
+ * `border` draws `#CAC4D0`, 1) and does not inset the child. The child gets the constraints minus
170
+ * the margin and sits at the top start (`alignment_geometry` aligns it as in a `container`).
171
+ * `size`, `gradient`, `shadow` (replaces the elevation shadow) and `alignment_geometry` are kept as
172
+ * extensions. `padding`, `foreground_color`, `fixed_size`, `background_image` and
173
+ * `background_overlays` are deprecated and ignored.
174
+ * Swift: Card/FIOCoreCardDataBlock.swift. iOS decodes `shadow` and `border`
175
+ * with `try?`, so a malformed one is dropped silently; the schema rejects it.
176
+ */
177
+ const cardShape = singleChildShape(blockRef);
178
+
179
+ export const cardDataSchema = z.strictObject({
180
+ ...cardShape,
181
+ ...deprecateKeys(
182
+ cardShape,
183
+ ["padding", "foreground_color", "fixed_size", "background_image", "background_overlays"],
184
+ ignoredOn("card", "S15", "cards"),
185
+ ),
186
+ shadow: shadowSchema.optional(),
187
+ border: borderSchema.optional(),
188
+ variant: z.enum(["elevated", "filled", "outlined"]).optional(),
189
+ elevation: z.number().min(0).optional(),
190
+ shadow_color: colorSchema.optional(),
191
+ surface_tint_color: colorSchema.optional(),
192
+ border_on_foreground: z.boolean().optional(),
193
+ clip_behavior: clipBehaviorSchema.optional(),
194
+ semantic_container: z.boolean().optional(),
195
+ corner_radii: cornerRadiiSchema.optional(),
196
+ });
197
+
198
+ /**
199
+ * Flutter `Divider` / `VerticalDivider` with the Material 3 defaults (contract 2.0).
200
+ * `height` is the extent of the box across the line (default 16; in 1.x it was the line
201
+ * thickness); the line is centered in it. `thickness` is the line (default 1; 0 draws one device
202
+ * pixel). `indent` / `end_indent` (default 0) are the empty space before / after the line and
203
+ * follow the layout direction (start / end). `color` defaults to `#CAC4D0`. `corner_radius` is the
204
+ * line's corner radius (Flutter `radius`; default none). `is_vertical` (default false) makes it a
205
+ * `VerticalDivider`: `height` is then the box width and the indents are top / bottom. All numbers
206
+ * are >= 0.
207
+ * Swift: Divider/FIOCoreDividerDataBlock.swift. Divider extends
208
+ * `FIOCoreGenericBlockData` directly, so it does NOT accept the common keys
209
+ * (`id`, `events`, `padding`, ...), only its own keys.
210
+ */
211
+ export const dividerDataSchema = z.strictObject({
212
+ color: colorSchema.optional(),
213
+ height: z.number().min(0).optional(),
214
+ thickness: z.number().min(0).optional(),
215
+ indent: z.number().min(0).optional(),
216
+ end_indent: z.number().min(0).optional(),
217
+ corner_radius: z.number().min(0).optional(),
218
+ is_vertical: z.boolean().optional(),
219
+ });
220
+
221
+ /**
222
+ * The keys of a Flutter `Flex` shared by `row` and `column` (contract 2.0). `spacing` (from the
223
+ * multi-child shape) is the space between children in the main axis, default 0 (8 in 1.x; negative
224
+ * is accepted). `main_axis_alignment` defaults to `start`, `main_axis_size` to `max`, `alignment`
225
+ * (the cross axis) to `center` and gains `stretch` and `baseline` (row/column only);
226
+ * `text_direction` absent = the ambient direction; `vertical_direction` defaults to `down`;
227
+ * `text_baseline` absent with `baseline` = `alphabetic`; `clip_behavior` defaults to `none`.
228
+ * Layout (`RenderFlex`): every non-flex child gets an unbounded main axis and a loose cross axis
229
+ * (tight at the maximum cross extent with `stretch` when bounded); `expanded` / `flexible` /
230
+ * `spacer` children split the free space; `max` fills a bounded main axis and hugs an unbounded
231
+ * one, `min` hugs; overflow runs past the end and is not clipped with `none`. The Flex does not
232
+ * scroll. `distribution` and the common keys (`events`, `padding`, `size`, `background_color`, ...)
233
+ * are deprecated and ignored.
234
+ */
235
+ function flexShape(block: "row" | "column") {
236
+ const shape = multiChildShape(blockRef);
237
+ return {
238
+ ...shape,
239
+ ...deprecateKeys(shape, [...COMMON_PROPERTY_KEYS, "events", "distribution"], ignoredOn(block, "", `${block}s`)),
240
+ alignment: flexCrossAxisAlignmentSchema.optional(),
241
+ main_axis_alignment: mainAxisAlignmentSchema.optional(),
242
+ main_axis_size: mainAxisSizeSchema.optional(),
243
+ text_direction: textDirectionSchema.optional(),
244
+ vertical_direction: verticalDirectionSchema.optional(),
245
+ text_baseline: textBaselineSchema.optional(),
246
+ clip_behavior: clipBehaviorSchema.optional(),
247
+ };
248
+ }
249
+
250
+ /**
251
+ * Flutter `Column` (contract 2.0): a vertical `Flex` (see `flexShape`); `baseline` acts as `start`
252
+ * and children are ordered by `vertical_direction`. Swift: Columns/FIOCoreColumnDataBlock.swift.
253
+ */
254
+ export const columnDataSchema = z.strictObject(flexShape("column"));
255
+
256
+ /**
257
+ * Flutter `Row` (contract 2.0): a horizontal `Flex` (see `flexShape`); children are ordered by
258
+ * `text_direction`. A long text keeps its one-line width and overflows. Swift: Row/FIOCoreRowDataBlock.swift.
259
+ */
260
+ export const rowDataSchema = z.strictObject(flexShape("row"));
261
+
262
+ /**
263
+ * Flutter `GridView.count` / `GridView.extent` (contract 2.0), "A scrollable, 2D array of widgets."
264
+ * The cross-axis count is `columns` (Flutter `crossAxisCount`, an integer >= 1; absent = 1) or, with
265
+ * `max_cross_axis_extent` (> 0), max(1, ceil(W / (max_cross_axis_extent + cross_axis_spacing)));
266
+ * `columns` together with `max_cross_axis_extent` is invalid. `main_axis_spacing` and
267
+ * `cross_axis_spacing` default to 0 (the 1.x grid used 8 / 20) and are never negative.
268
+ * `child_aspect_ratio` is "The ratio of the cross-axis to the main-axis extent of each child." (> 0,
269
+ * default 1.0); `main_axis_extent` is "The extent of each tile in the main axis." (>= 0, overrides
270
+ * the ratio).
271
+ * Tiles: usable = max(0, cross - padding - cross_axis_spacing * (n - 1)); tile cross = usable / n;
272
+ * tile main = `main_axis_extent` ?? tile cross / `child_aspect_ratio`; each child gets tight tile
273
+ * constraints (it fills its tile, it is not centered); the cross axis fills first and the last line
274
+ * may be partial; RTL mirrors the cross axis; `reverse` starts from the main-axis end.
275
+ * Scroll keys as `single_child_scroll`: `is_vertical` (default true), `reverse` (default false),
276
+ * `physics` (absent = the platform default), `clip_behavior` (default `hard_edge`),
277
+ * `keyboard_dismiss_behavior` (default `manual`). `padding` is Flutter's padding: it deflates the
278
+ * extent before the tiles. `shrink_wrap` "Defaults to false."
279
+ * Viewport: a bounded main axis with `shrink_wrap` false is filled and scrolls; `shrink_wrap` true
280
+ * hugs the tiles, clamped to the parent; an unbounded main axis (a `column` child, inside a scroll)
281
+ * acts as shrink-wrap and does not scroll. The cross axis fills a bounded extent; on an unbounded
282
+ * cross axis the tile side is the largest child. Not a flex child; inside `expanded` / `flexible`
283
+ * it takes the share.
284
+ * Deprecated, accepted and ignored: `grid_size`, `alignment` (the grid keeps its own 3-value enum),
285
+ * `spacing`, `distribution`, `events` and the other common keys.
286
+ * Swift: Grid/FIOCoreGridDataBlock.swift.
287
+ *
288
+ * The one rule JSON Schema cannot say with properties alone, "not both `columns` and
289
+ * `max_cross_axis_extent`", is a refine mirrored by its JSON Schema twin in the metadata
290
+ * (`not: { required: [...] }`), so the published schema says the same; the conformance suite
291
+ * checks both give the same verdict (`GR.both_modes`).
292
+ */
293
+ const ignoredOnGrid = ignoredOn("grid", "S18", "grids");
294
+ const gridShape = multiChildShape(blockRef);
295
+
296
+ export const gridDataSchema = z
297
+ .strictObject({
298
+ ...gridShape,
299
+ ...deprecateKeys(
300
+ gridShape,
301
+ [...COMMON_PROPERTY_KEYS.filter((key) => key !== "padding"), "events", "alignment", "spacing", "distribution"],
302
+ ignoredOnGrid,
303
+ ),
304
+ grid_size: deprecated(z.enum(["flexible"]).optional(), ignoredOnGrid("grid_size")),
305
+ columns: intSchema.min(1).optional(),
306
+ max_cross_axis_extent: z.number().positive().optional(),
307
+ main_axis_spacing: z.number().min(0).optional(),
308
+ cross_axis_spacing: z.number().min(0).optional(),
309
+ child_aspect_ratio: z.number().positive().optional(),
310
+ main_axis_extent: z.number().min(0).optional(),
311
+ is_vertical: z.boolean().optional(),
312
+ reverse: z.boolean().optional(),
313
+ physics: scrollPhysicsSchema.optional(),
314
+ clip_behavior: clipBehaviorSchema.optional(),
315
+ keyboard_dismiss_behavior: keyboardDismissBehaviorSchema.optional(),
316
+ shrink_wrap: z.boolean().optional(),
317
+ })
318
+ .refine((data) => data.columns === undefined || data.max_cross_axis_extent === undefined, {
319
+ message: "`columns` and `max_cross_axis_extent` are mutually exclusive",
320
+ path: ["max_cross_axis_extent"],
321
+ })
322
+ .meta({ not: { required: ["columns", "max_cross_axis_extent"] } });
@@ -0,0 +1,355 @@
1
+ import { z } from "zod";
2
+ import { blockRef } from "../block-ref.ts";
3
+ import { commonDataShape, deprecateKeys, ignoredOn, multiChildShape } from "../common.ts";
4
+ import {
5
+ clipBehaviorSchema,
6
+ colorSchema,
7
+ keyboardDismissBehaviorSchema,
8
+ layoutDimensionSchema,
9
+ paddingEntrySchema,
10
+ scrollPhysicsSchema,
11
+ visualDensitySchema,
12
+ } from "../properties.ts";
13
+ import { dividerDataSchema } from "./layout.ts";
14
+
15
+ /**
16
+ * List blocks (contract 2.0): `list` = Flutter `ListView` / `ListView.separated`, `list_row` =
17
+ * Flutter `ListTile` with the Material 3 `_LisTileDefaultsM3`, and `list_section` (no Flutter
18
+ * widget; cross-platform parity only). Verified against flutter/flutter main d4c8577
19
+ * (`widgets/scroll_view.dart`, `rendering/viewport.dart`, `rendering/sliver.dart`,
20
+ * `rendering/sliver_list.dart`, `rendering/sliver_fixed_extent_list.dart`,
21
+ * `rendering/sliver_padding.dart`, `material/list_tile.dart`, `material/theme_data.dart`,
22
+ * `material/divider.dart`, `material/ink_well.dart`, `material/typography.dart`), S30–S32.
23
+ */
24
+
25
+ /**
26
+ * The shared recipe of a list's look (an extension: Flutter has no list style), the same on all
27
+ * three (iOS no longer uses the native `List` / `.listStyle`). It reaches the list's direct
28
+ * children and the children of its `list_section` children. A group is each `list_section` child,
29
+ * and each run of consecutive children that are not sections.
30
+ * - `plain` (the default): no background, no row fill, no group gap, no separators unless
31
+ * `separator`; headers as typed.
32
+ * - `grouped`: list background `#F2F2F7`, each group's rows on a `#FFFFFF` fill, groups 16 apart,
33
+ * a separator between the rows of a group (a `divider` with height 1, thickness 1, indent 16,
34
+ * color `#3C3C43` at 29%), headers uppercase.
35
+ * - `inset_grouped`: `grouped`, with each group's rows inset 16 on both sides and their fill
36
+ * rounded by 10.
37
+ * - `sidebar`: no background, no fill, no separators unless `separator`; groups inset 8 on both
38
+ * sides and 8 apart; headers as typed.
39
+ * A section header is the `title` text, 13 points, weight w400, color `#3C3C43` at 60%, with
40
+ * padding start / end 16 (plus the group inset) and bottom 6.
41
+ */
42
+ export const listStyleSchema = z.enum(["plain", "grouped", "inset_grouped", "sidebar"]);
43
+
44
+ /**
45
+ * Flutter `ListView` / `ListView.separated` (contract 2.0): "In the cross axis, the children are
46
+ * required to fill the [ListView]."; `itemExtent` "If non-null, forces the children to have the
47
+ * given extent in the scroll direction."
48
+ * Keys (defaults in each key's description): `children`, `id`; the scroll keys of
49
+ * `single_child_scroll` / `grid`: `is_vertical`, `reverse`, `physics`, `clip_behavior`,
50
+ * `keyboard_dismiss_behavior`; `padding`, `shrink_wrap`, `height_row` (= `itemExtent`),
51
+ * `separator` (= `separatorBuilder` returning a `Divider`) and `list_style` (an extension).
52
+ * Layout: each child gets a tight cross axis (the list's cross extent minus `padding`) and an
53
+ * unbounded main axis (exactly `height_row` when set); children follow each other from the start
54
+ * of the main axis with no gap (the end with `reverse`). A bounded main axis with `shrink_wrap`
55
+ * false is filled (`RenderViewport`, `constraints.biggest`) and scrolls; `shrink_wrap` true hugs
56
+ * the children plus `padding`, clamped to the parent; an unbounded main axis (a `column` child,
57
+ * inside a scroll) acts as shrink-wrap and does not scroll (Flutter throws). The cross axis fills a
58
+ * bounded extent; on an unbounded cross axis it is the largest child's natural cross extent and
59
+ * every child is forced to it (Flutter throws; the `grid` precedent). Not a flex child; inside
60
+ * `expanded` / `flexible` it takes the share.
61
+ * Deprecated, accepted and ignored: `distribution`, `alignment`, `spacing`, `events` and the other
62
+ * common keys. They stay valid so saved 1.x lists decode.
63
+ * Swift: List/FIOCoreListDataBlock.swift.
64
+ */
65
+ const ignoredOnList = ignoredOn("list", "S30", "lists");
66
+ const listShape = multiChildShape(blockRef);
67
+
68
+ export const listDataSchema = z.strictObject({
69
+ ...listShape,
70
+ ...deprecateKeys(
71
+ listShape,
72
+ [
73
+ "background_color",
74
+ "foreground_color",
75
+ "size",
76
+ "alignment_geometry",
77
+ "margin",
78
+ "shape",
79
+ "corner_radius",
80
+ "gradient",
81
+ "fixed_size",
82
+ "background_image",
83
+ "background_overlays",
84
+ "events",
85
+ "distribution",
86
+ "alignment",
87
+ "spacing",
88
+ ],
89
+ ignoredOnList,
90
+ ),
91
+ children: listShape.children.describe(
92
+ "The list items, laid out one after another along the main axis. Each gets a tight cross axis (it fills the list) and an unbounded main axis.",
93
+ ),
94
+ padding: listShape.padding.describe(
95
+ "Flutter `padding` (a `SliverPadding`): insets inside the scrollable area, around the children, on both axes. Absent = 0 on every edge (no safe-area padding, unlike Flutter's MediaQuery default).",
96
+ ),
97
+ is_vertical: z
98
+ .boolean()
99
+ .optional()
100
+ .describe("Flutter `scrollDirection`. Default true (vertical). false = a horizontal list: children fill the height and keep their natural width."),
101
+ reverse: z
102
+ .boolean()
103
+ .optional()
104
+ .describe("Flutter `reverse`. Default false. true = the first child sits at the end of the main axis and the scroll starts there."),
105
+ physics: scrollPhysicsSchema
106
+ .optional()
107
+ .describe("Flutter `physics`. Absent = the platform default (bouncing on iOS, clamping on Android, the browser's on web). `never` = no user scrolling."),
108
+ clip_behavior: clipBehaviorSchema
109
+ .optional()
110
+ .describe("Flutter `clipBehavior`. Default `hard_edge`: children are clipped to the viewport. `none` lets them paint outside it."),
111
+ keyboard_dismiss_behavior: keyboardDismissBehaviorSchema
112
+ .optional()
113
+ .describe("Flutter `keyboardDismissBehavior`. Default `manual`. `on_drag` = a drag on the list dismisses the keyboard."),
114
+ shrink_wrap: z
115
+ .boolean()
116
+ .optional()
117
+ .describe(
118
+ "Flutter `shrinkWrap`. Default false: a bounded main axis is filled. true = the list is as long as its children plus `padding`, clamped to the parent. An unbounded main axis always shrink-wraps.",
119
+ ),
120
+ height_row: z
121
+ .number()
122
+ .optional()
123
+ .describe(
124
+ "Flutter `itemExtent`: when set, every child is forced to exactly this extent along the main axis (its height in a vertical list, its width in a horizontal one). Separators keep their own extent. Absent = each child's natural extent. A negative value counts as 0.",
125
+ ),
126
+ separator: dividerDataSchema
127
+ .optional()
128
+ .describe(
129
+ "Flutter `ListView.separated` with a `Divider` (the `divider` block's data, S16; `is_vertical: true` for a horizontal list): drawn between adjacent items, not before the first or after the last; it takes its `height` (default 16) along the main axis. Absent = no separators in `plain` and `sidebar`. With a grouped `list_style` it replaces the recipe's separator, between the rows of each group.",
130
+ ),
131
+ list_style: listStyleSchema
132
+ .optional()
133
+ .describe(
134
+ "An extension (Flutter has no list style): the shared look recipe of `listStyleSchema`, the same on all three. Default `plain`. A horizontal list (`is_vertical: false`) is always `plain`.",
135
+ ),
136
+ });
137
+
138
+ /**
139
+ * A section of a `list` (S31; no Flutter widget, cross-platform parity only): a column with an
140
+ * optional header (the `title` text) over its children, each with a tight cross axis (it fills the
141
+ * section) and its natural main-axis extent, with no gap. The section has its own frame on all
142
+ * three: it fills a bounded width (on an unbounded width, the widest child) and is as tall as its
143
+ * header plus its children. Header metrics, color and case, the row fill, the group inset and the
144
+ * separators come from the enclosing list's `list_style` recipe; a section outside a list uses
145
+ * `plain`. Standalone and inside a list it is laid out the same.
146
+ * Deprecated, accepted and ignored: `distribution`, `alignment`, `spacing`, `events` and the other
147
+ * common keys. They stay valid so saved 1.x sections decode.
148
+ * Swift: ListSection/FIOCoreListSectionDataBlock.swift.
149
+ */
150
+ const ignoredOnSection = ignoredOn("list_section", "S31", "sections");
151
+ const sectionShape = multiChildShape(blockRef);
152
+
153
+ export const listSectionDataSchema = z.strictObject({
154
+ ...sectionShape,
155
+ ...deprecateKeys(
156
+ sectionShape,
157
+ [
158
+ "background_color",
159
+ "foreground_color",
160
+ "padding",
161
+ "size",
162
+ "alignment_geometry",
163
+ "margin",
164
+ "shape",
165
+ "corner_radius",
166
+ "gradient",
167
+ "fixed_size",
168
+ "background_image",
169
+ "background_overlays",
170
+ "events",
171
+ "distribution",
172
+ "alignment",
173
+ "spacing",
174
+ ],
175
+ ignoredOnSection,
176
+ ),
177
+ title: z
178
+ .string()
179
+ .optional()
180
+ .describe(
181
+ "The section header, drawn above the children: 13 points, weight w400, color `#3C3C43` at 60%, padding start / end 16 (plus the group inset) and bottom 6; uppercase in `grouped` / `inset_grouped`, as typed otherwise. Absent or empty = no header.",
182
+ ),
183
+ });
184
+
185
+ /**
186
+ * Flutter `ListTile` with the Material 3 `_LisTileDefaultsM3` (contract 2.0): "ListTile requires
187
+ * fixed width constraints, whereas a Row does not constrain its children."; contentPadding
188
+ * `EdgeInsetsDirectional.only(start: 16.0, end: 24.0)`.
189
+ * Slots (each a full block; names kept from 1.x): `start_block` = `leading`, `title_block` =
190
+ * `title`, `subtitle_block` = `subtitle`, `end_block` = `trailing`. An absent slot takes no
191
+ * space.
192
+ * Layout (`_RenderListTile`), inside `content_padding`: the row fills a bounded width (0 wide on
193
+ * an unbounded one). `start_block` / `end_block` get a loose box at most 56 tall (dense 48, plus
194
+ * the density step); the title and subtitle get a tight width = inner width − title start −
195
+ * trailing room, where title start = max(`min_leading_width`, leading width) + gap (0 without a
196
+ * leading) and trailing room = max(trailing width + gap, 32) (0 without a trailing); gap =
197
+ * `horizontal_title_gap` + 2 × the density step. Height = `min_tile_height` ?? 56 / 72 / 88 for
198
+ * one / two / three lines (dense 48 / 64 / 76) + 4 × the density step, grown to fit the title and
199
+ * subtitle with `min_vertical_padding` above and below; the leading and trailing never grow it.
200
+ * One line: the title is centered. Two or three lines: the title and subtitle sit at Flutter's
201
+ * baselines (title 32 / subtitle 52; three-line 28 / 48; dense 28 / 48, dense three-line 22 / 42;
202
+ * the subtitle's plus 2 × the density step), pushed apart if they overlap, and stacked from `min_vertical_padding` when they do
203
+ * not fit. The leading and trailing are placed by `title_alignment`. Not a flex child.
204
+ * Colors are defaults: a slot block with its own color keeps it. Text without its own style takes
205
+ * title bodyLarge (16, height 1.5, letter spacing 0.5) `#1D1B20`, subtitle bodyMedium (14, height
206
+ * 1.43, letter spacing 0.25) `#49454F`, leading / trailing text labelSmall (11, w500, height 1.45,
207
+ * letter spacing 0.5) `#49454F`; dense: title 13, subtitle 12. Icons `#49454F`.
208
+ * Paint: tile fill (`tile_color`, `selected_tile_color` when selected; in `shape`) → the overlay
209
+ * (pressed `#BCBCBC` at 40%, hover on web `#000000` at 4%; only with an `on_tap` and enabled,
210
+ * clipped to `shape`) → slots. Semantics: a button when it has an `on_tap`, selected and enabled
211
+ * states. Disabled (`is_enabled` false): no taps, no events, text and icons `#000000` at 38%.
212
+ * Deprecated, accepted and ignored: the common keys other than `id`, `events`, `shape` and
213
+ * `corner_radius`. They stay valid so saved 1.x rows decode.
214
+ *
215
+ * The one rule JSON Schema cannot say with properties alone, "`is_three_line` needs a
216
+ * `subtitle_block`" (Flutter asserts `isThreeLine != true || subtitle != null`), is a refine
217
+ * mirrored by its JSON Schema twin in the metadata, so the published schema says the same; the
218
+ * conformance suite checks both give the same verdict (`LT.is_three_line.no_subtitle`).
219
+ * Swift: ListRow/FIOCoreListRowDataBlock.swift.
220
+ */
221
+ const ignoredOnRow = ignoredOn("list_row", "S32", "rows");
222
+
223
+ const slotDimension = (slot: string, flutter: string) =>
224
+ layoutDimensionSchema
225
+ .optional()
226
+ .describe(
227
+ `An extension (Flutter's \`ListTile\` has no slot caps): \`max_width.constant\` / \`max_height.constant\` cap the ${slot} block (\`${flutter}\`) inside the box Flutter gives that slot (the smaller limit wins, so the leading / trailing height stays at most 56, dense 48); \`alignment\` places the block in its slot when it is smaller. Absent = no extra cap.`,
228
+ );
229
+
230
+ export const listRowDataSchema = z
231
+ .strictObject({
232
+ ...commonDataShape,
233
+ ...deprecateKeys(
234
+ commonDataShape,
235
+ [
236
+ "background_color",
237
+ "foreground_color",
238
+ "padding",
239
+ "size",
240
+ "alignment_geometry",
241
+ "margin",
242
+ "gradient",
243
+ "fixed_size",
244
+ "background_image",
245
+ "background_overlays",
246
+ ],
247
+ ignoredOnRow,
248
+ ),
249
+ shape: commonDataShape.shape.describe(
250
+ "Flutter `shape` of the tile fill and the overlay. Absent = `rect` with no rounding (Flutter `RoundedRectangleBorder()`). `circle` = a centered circle, diameter = the shorter side; `capsule` = rounded by half the shorter side.",
251
+ ),
252
+ corner_radius: commonDataShape.corner_radius.describe(
253
+ "The corner radius of a `rect` `shape` (Flutter `RoundedRectangleBorder.borderRadius`). Default 0. A negative value counts as 0.",
254
+ ),
255
+ events: commonDataShape.events.describe(
256
+ "`on_tap` is posted on each tap of an enabled row (Flutter `onTap`); a row with an `on_tap` shows the pressed overlay and is a button for accessibility. Other event types are not posted.",
257
+ ),
258
+ start_block: blockRef.optional().describe("Flutter `leading`: a block before the title, typically an `icon`. Absent = no leading, no space."),
259
+ title_block: blockRef.optional().describe("Flutter `title`: the primary content, typically a `text` (one line). Absent = an empty title of height 0."),
260
+ subtitle_block: blockRef.optional().describe("Flutter `subtitle`: a block below the title, typically a `text`. Absent = a one-line row."),
261
+ end_block: blockRef.optional().describe("Flutter `trailing`: a block after the title, typically an `icon`. Absent = no trailing, no space."),
262
+ is_three_line: z
263
+ .boolean()
264
+ .optional()
265
+ .describe(
266
+ "Flutter `isThreeLine`. Default false: one line without a `subtitle_block`, two with one. true = three lines (88 tall, dense 76); it needs a `subtitle_block` (Flutter asserts).",
267
+ ),
268
+ dense: z
269
+ .boolean()
270
+ .optional()
271
+ .describe("Flutter `dense`. Default false. true = heights 48 / 64 / 76, leading / trailing at most 48, title text 13 and subtitle text 12."),
272
+ visual_density: visualDensitySchema
273
+ .optional()
274
+ .describe(
275
+ "Flutter `visualDensity` (S21 schema). Default `standard`. Each step (`comfortable` −1, `compact` −2) adds 4 × the step to the default height and to the leading / trailing cap, and 2 × the step to the title gap: `compact` = 48 / 64 / 80 tall, gap 12.",
276
+ ),
277
+ is_enabled: z
278
+ .boolean()
279
+ .optional()
280
+ .describe(
281
+ "Flutter `enabled`. Default true. false = taps ignored, no events, no overlay; title, subtitle, leading / trailing text and icons `#000000` at 38% (ThemeData.disabledColor); `text_color`, `icon_color` and `selected_color` are ignored.",
282
+ ),
283
+ is_selected: z
284
+ .boolean()
285
+ .optional()
286
+ .describe(
287
+ "Flutter `selected`. Default false. true = text and icons in `selected_color`, the fill `selected_tile_color` (not `tile_color`). `is_enabled: false` wins for the colors.",
288
+ ),
289
+ tile_color: colorSchema
290
+ .optional()
291
+ .describe("Flutter `tileColor`: the fill while not selected. Absent = transparent."),
292
+ selected_tile_color: colorSchema
293
+ .optional()
294
+ .describe("Flutter `selectedTileColor`: the fill while selected. Absent = transparent."),
295
+ selected_color: colorSchema
296
+ .optional()
297
+ .describe("Flutter `selectedColor`: text and icons while selected and enabled. Absent = `#6750A4` (colorScheme.primary)."),
298
+ icon_color: colorSchema
299
+ .optional()
300
+ .describe(
301
+ "Flutter `iconColor`: the default color of icons (and `icon_button` foregrounds) in the slots while enabled and not selected. Absent = `#49454F` (colorScheme.onSurfaceVariant).",
302
+ ),
303
+ text_color: colorSchema
304
+ .optional()
305
+ .describe(
306
+ "Flutter `textColor`: the default color of the title, subtitle and leading / trailing text while enabled and not selected. Absent = each slot's default: title `#1D1B20` (onSurface), subtitle and leading / trailing `#49454F` (onSurfaceVariant).",
307
+ ),
308
+ min_vertical_padding: z
309
+ .number()
310
+ .min(0)
311
+ .optional()
312
+ .describe("Flutter `minVerticalPadding`: the least space above the title and below the subtitle (or the title). Default 8."),
313
+ min_leading_width: z
314
+ .number()
315
+ .min(0)
316
+ .optional()
317
+ .describe("Flutter `minLeadingWidth`: the least width the title start reserves for a `start_block`. Default 24. No effect without a `start_block`."),
318
+ horizontal_title_gap: z
319
+ .number()
320
+ .min(0)
321
+ .optional()
322
+ .describe("Flutter `horizontalTitleGap`: the gap between the title and the leading / trailing. Default 16 (plus 2 × the density step)."),
323
+ min_tile_height: z
324
+ .number()
325
+ .min(0)
326
+ .optional()
327
+ .describe(
328
+ "Flutter `minTileHeight`: replaces the default height (56 / 72 / 88, dense 48 / 64 / 76, density included); the row still grows to fit its title and subtitle. Absent = the default.",
329
+ ),
330
+ title_alignment: z
331
+ .enum(["three_line", "title_height", "top", "center", "bottom"])
332
+ .optional()
333
+ .describe(
334
+ "Flutter `titleAlignment`: the vertical place of the leading and trailing. Default `three_line` (`top` when `is_three_line`, else `center`). `top` = `min_vertical_padding` from the top; `center` = centered in the row; `bottom` = `min_vertical_padding` from the bottom; `title_height` = 16 from the top in a row taller than 72, else the trailing centered and the leading at min(centered, 16).",
335
+ ),
336
+ content_alignment: z
337
+ .enum(["top", "center", "bottom"])
338
+ .optional()
339
+ .describe("Deprecated since 2.0 (S32): an alias of `title_alignment` with the same value, honored only when `title_alignment` is absent.").meta({ deprecated: true }),
340
+ content_padding: z
341
+ .array(paddingEntrySchema)
342
+ .optional()
343
+ .describe(
344
+ "Flutter `contentPadding`: insets of the slots inside the row, resolved like `padding` (S10 anchors and precedence; `all` counts once). Absent = start 16, end 24, top and bottom 0. The top and bottom add to the row height.",
345
+ ),
346
+ start_dimension: slotDimension("start", "leading"),
347
+ title_dimension: slotDimension("title", "title"),
348
+ subtitle_dimension: slotDimension("subtitle", "subtitle"),
349
+ end_dimension: slotDimension("end", "trailing"),
350
+ })
351
+ .refine((data) => data.is_three_line !== true || data.subtitle_block !== undefined, {
352
+ message: "`is_three_line` needs a `subtitle_block` (Flutter asserts `isThreeLine != true || subtitle != null`)",
353
+ path: ["is_three_line"],
354
+ })
355
+ .meta({ not: { required: ["is_three_line"], properties: { is_three_line: { const: true } }, not: { required: ["subtitle_block"] } } });