@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,543 @@
1
+ import { z } from "zod";
2
+ import { blockRef } from "../block-ref.ts";
3
+ import { COMMON_PROPERTY_KEYS, commonDataShape, deprecated, deprecateKeys, ignoredOn, singleChildShape } from "../common.ts";
4
+ import {
5
+ alignmentSchema,
6
+ borderSchema,
7
+ boxConstraintsSchema,
8
+ boxFitSchema,
9
+ colorSchema,
10
+ cornerRadiiSchema,
11
+ filterQualitySchema,
12
+ fontWeightSchema,
13
+ imageBlendModeSchema,
14
+ imageRepeatSchema,
15
+ paddingEntrySchema,
16
+ shadowSchema,
17
+ sizeSchema,
18
+ tapTargetSizeSchema,
19
+ textAlignmentSchema,
20
+ textConfigSchema,
21
+ textShadowSchema,
22
+ textStyleSchema,
23
+ visualDensitySchema,
24
+ } from "../properties.ts";
25
+
26
+ /**
27
+ * Blocks that present content: text, icons, images and status widgets
28
+ * (paths relative to `fractal_core_blocks-ios/Sources/Blocks`).
29
+ */
30
+
31
+ /**
32
+ * Flutter `Text` (contract 2.0). Defaults (S7): `style.font_size` 14, `config.soft_wrap` true,
33
+ * `config.overflow` `clip`, `config.max_lines` none, `text_alignment` `start`,
34
+ * `config.text_direction` ambient, `config.text_width_basis` `parent`. Layout (`RenderParagraph`):
35
+ * laid out with the constraints received (max width unbounded when `soft_wrap` is false and
36
+ * `overflow` is not `ellipsis`); width = the natural single-line width (`parent`) or the longest
37
+ * wrapped line (`longest_line`), clamped to the constraints; hugs when loose, fills a tight box;
38
+ * never greedy, never a flex child; text at the top, lines placed by `text_alignment`.
39
+ * Extensions kept: `alignment_geometry` and `size` (when set, the text fills its bounded width or
40
+ * `size` and is placed there); `style.line_height` (points). Deprecated, accepted and ignored:
41
+ * `alignment`, `padding`, `margin`, `background_*`, `gradient`, `shape`, `corner_radius`,
42
+ * `fixed_size`, `foreground_color`, `background_overlays`.
43
+ * Swift: Text/FIOCoreTextDataBlock.swift.
44
+ */
45
+ const ignoredOnText = ignoredOn("text", "", "texts");
46
+
47
+ export const textDataSchema = z.strictObject({
48
+ ...commonDataShape,
49
+ ...deprecateKeys(
50
+ commonDataShape,
51
+ [
52
+ "background_color",
53
+ "foreground_color",
54
+ "padding",
55
+ "margin",
56
+ "shape",
57
+ "corner_radius",
58
+ "gradient",
59
+ "fixed_size",
60
+ "background_image",
61
+ "background_overlays",
62
+ ],
63
+ ignoredOnText,
64
+ ),
65
+ text: z.string().optional(),
66
+ text_alignment: textAlignmentSchema.optional(),
67
+ style: textStyleSchema.optional(),
68
+ config: textConfigSchema.optional(),
69
+ alignment: deprecated(alignmentSchema.optional(), ignoredOnText("alignment")),
70
+ });
71
+
72
+ /**
73
+ * `icon_size` of `icon` and `icon_button` (contract 2.0), Flutter `Icon.size` / `IconButton.iconSize`:
74
+ * "Icons occupy a square with width and height equal to size." Absent = 24 (Flutter
75
+ * `IconThemeData.fallback().size` and `_IconButtonDefaultsM3.iconSize`; the 1.x blocks used 17).
76
+ * The `search` icon decodes into the `icon` payload and keeps its own default (15).
77
+ */
78
+ const iconBlockSizeSchema = z
79
+ .number()
80
+ .min(0)
81
+ .describe(
82
+ "Side, in points, of the square the icon occupies (Flutter `Icon.size`, >= 0, default 24); the symbol is fitted into it, aspect ratio kept, centered.",
83
+ );
84
+
85
+ /**
86
+ * Flutter `Icon` (contract 2.0), "Icons are not interactive." From `widgets/icon.dart` and
87
+ * `IconThemeData.fallback`. Swift: Icon/FIOCoreIconDataBlock.swift. The `search` block decodes its
88
+ * `icon` straight into this payload.
89
+ * Keys:
90
+ * - `system_name`: an SF Symbols name (an extension; each platform keeps its own map). Empty or
91
+ * unknown keeps the box and draws nothing (Flutter draws a `SizedBox` for a null icon).
92
+ * - `icon_size`: "Icons occupy a square with width and height equal to size." Default 24.
93
+ * - `color`: the glyph color. Absent = the M3 `ThemeData.iconTheme` color of a light theme,
94
+ * `#000000` at alpha 0xDD (221 / 255, about 0.87): `theme_data.dart` sets
95
+ * `iconTheme ??= ... IconThemeData(color: kDefaultIconDarkColor)` and `constants.dart` has
96
+ * `kDefaultIconDarkColor = Color(0xDD000000)`, with or without `useMaterial3`.
97
+ * - `font_weight`: Flutter `weight` (the stroke weight of the symbol; Android gap declared).
98
+ * - `rotation_degrees`: an extension, paint only (layout is unchanged).
99
+ * - `semantic_label`: Flutter `semanticLabel`, the accessibility label (never shown).
100
+ * - `shadows`: Flutter `shadows`, the text `Shadow` schema of `textStyleSchema` drawn under the
101
+ * glyph; each entry defaults to opaque black, offset 0, blur 0.
102
+ * - `apply_text_scaling`: Flutter `applyTextScaling`, scales `icon_size` by the text scale factor.
103
+ * Default false.
104
+ * - `match_text_direction`: Flutter `IconData.matchTextDirection`, mirrors the glyph horizontally
105
+ * in a right-to-left layout. Default false.
106
+ * Not added: Flutter `fill`, `grade`, `opticalSize`, `blendMode`.
107
+ * Layout: an exact `icon_size` square when loose; a tight parent forces the box and the glyph stays
108
+ * centered; never greedy, never a flex child.
109
+ * S20: "Common keys, `id`, `events` deprecated and ignored." They stay valid so saved 1.x icons
110
+ * decode. iOS decodes `rotation_degrees` with `try?`, so a non-number is dropped silently.
111
+ */
112
+ /** The glyph keys of `icon` (S20), shared with `icon_button` and the `text_button.icon`, which draw the same glyph. */
113
+ export const iconGlyphShape = {
114
+ system_name: z.string().optional(),
115
+ color: colorSchema.optional(),
116
+ icon_size: iconBlockSizeSchema.optional(),
117
+ font_weight: fontWeightSchema.optional(),
118
+ rotation_degrees: z.number().optional(),
119
+ semantic_label: z.string().optional(),
120
+ shadows: z.array(textShadowSchema).optional(),
121
+ apply_text_scaling: z.boolean().optional(),
122
+ match_text_direction: z.boolean().optional(),
123
+ };
124
+
125
+ export const iconDataSchema = z.strictObject({
126
+ ...commonDataShape,
127
+ ...deprecateKeys(commonDataShape, [...COMMON_PROPERTY_KEYS, "id", "events"], ignoredOn("icon", "S20", "icons")),
128
+ ...iconGlyphShape,
129
+ });
130
+
131
+ /**
132
+ * Flutter `IconButton` / `IconButton.filled` / `.filledTonal` / `.outlined` with the Material 3
133
+ * defaults (contract 2.0), from `material/icon_button.dart` (`_IconButtonDefaultsM3`,
134
+ * `_FilledIconButtonDefaultsM3`, `_FilledTonalIconButtonDefaultsM3`,
135
+ * `_OutlinedIconButtonDefaultsM3`), `button_style_button.dart` and the light M3 `ColorScheme`.
136
+ * S21: "If the onPressed callback is null, then the button will be disabled and will not react to
137
+ * touch."; "Expands the minimum tap target size to 48px by 48px".
138
+ * Keys:
139
+ * - The glyph keys of `icon` (S20): `system_name`, `color`, `icon_size` (>= 0, default 24),
140
+ * `font_weight`, `rotation_degrees`, `semantic_label`, `shadows`, `apply_text_scaling`,
141
+ * `match_text_direction`.
142
+ * - `variant`: `standard` (the default) | `filled` | `filled_tonal` | `outlined`.
143
+ * - `color` = the foreground. Absent: standard / outlined `#49454F` (onSurfaceVariant), filled
144
+ * `#FFFFFF` (onPrimary), filled_tonal `#4A4458` (onSecondaryContainer).
145
+ * - `background_color`. Absent: standard / outlined transparent, filled `#6750A4` (primary),
146
+ * filled_tonal `#E8DEF8` (secondaryContainer).
147
+ * - `padding`: honored, default all 8. `alignment_geometry`: the glyph's alignment, default center.
148
+ * - `constraints` (the `container` schema) = the minimum / maximum size (Flutter `minimumSize` /
149
+ * `maximumSize`). Absent: min 40 × 40, max unbounded. Given: a min it leaves out is 0 and a max
150
+ * it leaves out is unbounded. `size` is kept as an extension = Flutter `fixedSize`, clamped into the constraints.
151
+ * - `shape`: default `capsule` (Flutter `StadiumBorder`); `corner_radius` / `corner_radii` give a
152
+ * rounded rect. `border` = the side, drawn inside the edge (outlined default `#79747E`, 1).
153
+ * `shadow` is kept as an extension (full x / y / color; Flutter's elevation is 0).
154
+ * - `is_selected`: Flutter `isSelected`; set (true or false) makes the button a toggle that flips
155
+ * locally on tap, shows `selected_system_name` while selected, and posts the new value with
156
+ * `on_tap`. Absent = a plain button.
157
+ * - `disabled_color`: Flutter `disabledColor`, the foreground when `is_enabled` is false. Absent =
158
+ * `#1D1B20` (onSurface) at 38%; filled / filled_tonal fill `#1D1B20` at 12%.
159
+ * - `tooltip`: Flutter `tooltip`, shown on long press / hover and used as the accessibility label
160
+ * (it replaces the glyph `semantic_label`).
161
+ * - `tap_target_size`: `padded` (the default) | `shrink_wrap`. `visual_density`: `standard` (the
162
+ * default) | `comfortable` | `compact`.
163
+ * - `is_enabled` (false = Flutter null `onPressed`) and `events` (`on_tap`) are kept; `id` is kept.
164
+ * Layout: content = icon + padding (40 × 40 by default), clamped by `constraints` / `size`;
165
+ * `padded` makes the frame max(visual, 48) per axis, the visual centered, the whole frame tappable;
166
+ * never greedy, never a flex child.
167
+ * Paint: shadow → fill → state layer (pressed: 10%) → icon → border.
168
+ * Deprecated, accepted and ignored (S21: everything outside the list above): `foreground_color`,
169
+ * `margin`, `gradient`, `fixed_size`, `background_image`, `background_overlays`. They stay valid so
170
+ * saved 1.x icon buttons decode.
171
+ * Swift: IconButton/FIOCoreIconButtonDataBlock.swift.
172
+ */
173
+ export const iconButtonDataSchema = z.strictObject({
174
+ ...commonDataShape,
175
+ ...deprecateKeys(
176
+ commonDataShape,
177
+ ["foreground_color", "margin", "gradient", "fixed_size", "background_image", "background_overlays"],
178
+ ignoredOn("icon_button", "S21", "icon buttons"),
179
+ ),
180
+ ...iconGlyphShape,
181
+ variant: z.enum(["standard", "filled", "filled_tonal", "outlined"]).optional(),
182
+ constraints: boxConstraintsSchema.optional(),
183
+ corner_radii: cornerRadiiSchema.optional(),
184
+ shadow: shadowSchema.optional(),
185
+ border: borderSchema.optional(),
186
+ is_enabled: z.boolean().optional(),
187
+ is_selected: z.boolean().optional(),
188
+ /** The `system_name` drawn while `is_selected` is true (Flutter `selectedIcon`); absent = `system_name`. */
189
+ selected_system_name: z.string().optional(),
190
+ disabled_color: colorSchema.optional(),
191
+ tooltip: z.string().optional(),
192
+ tap_target_size: tapTargetSizeSchema.optional(),
193
+ visual_density: visualDensitySchema.optional(),
194
+ });
195
+
196
+ /**
197
+ * Flutter `Image` / `Image.network` (contract 2.0), from `widgets/image.dart`, `rendering/image.dart`
198
+ * (`RenderImage`) and `painting/decoration_image.dart` (`paintImage`), flutter/flutter main 66b3ad9.
199
+ * S22: "How to inscribe the image into the space allocated during layout."; "If null, the image will
200
+ * pick a size that best preserves its intrinsic aspect ratio."
201
+ * Keys: `image_url`, `id`; `size.width` / `size.height` = Flutter `width` / `height` (exact); `fit`,
202
+ * `alignment_geometry` (= `alignment`), `repeat`, `color`, `color_blend_mode`, `opacity`,
203
+ * `filter_quality`, `semantic_label`, `exclude_from_semantics`, `match_text_direction`,
204
+ * `gapless_playback`, `is_anti_alias`, `scale` (defaults in each key's description).
205
+ * Extensions kept: `content_mode` (deprecated alias of `fit`), `foreground_color` (deprecated alias
206
+ * of `color`), `shape` and `corner_radius` (a clip of the box).
207
+ * Layout (`RenderImage._sizeForConstraints`): `BoxConstraints.tightFor(width, height).enforce(parent)`;
208
+ * no image (loading, absent or invalid URL, failed) = `constraints.smallest`, nothing painted (0 × 0
209
+ * when loose without `size`); loaded = `constrainSizeAndAttemptToPreserveAspectRatio(pixels / scale)`;
210
+ * never greedy, never a flex child; in `expanded` / `flexible` forced to the share; the picture is
211
+ * placed by `fit` + `alignment`, clipped to the box; `shape` / `corner_radius` clip last. No spinner
212
+ * while loading (Flutter-literal: the layout jumps on load).
213
+ * Deprecated, accepted and ignored: `events`, `padding`, `margin`, `background_color`, `gradient`,
214
+ * `fixed_size`, `background_image`, `background_overlays`. They stay valid so saved 1.x images decode.
215
+ * Not added: `centerSlice`, `invertColors`, headers, cache sizes, frame / loading / error builders.
216
+ * Swift: Image/FIOCoreImageDataBlock.swift.
217
+ */
218
+ const ignoredOnImage = (key: string) => `Deprecated on \`image\` since 2.0 and ignored (S22); \`${key}\` stays valid so saved 1.x images decode.`;
219
+
220
+ export const imageDataSchema = z.strictObject({
221
+ ...commonDataShape,
222
+ events: commonDataShape.events.describe(ignoredOnImage("events")).meta({ deprecated: true }),
223
+ padding: commonDataShape.padding.describe(ignoredOnImage("padding")).meta({ deprecated: true }),
224
+ margin: commonDataShape.margin.describe(ignoredOnImage("margin")).meta({ deprecated: true }),
225
+ background_color: commonDataShape.background_color.describe(ignoredOnImage("background_color")).meta({ deprecated: true }),
226
+ gradient: commonDataShape.gradient.describe(ignoredOnImage("gradient")).meta({ deprecated: true }),
227
+ fixed_size: commonDataShape.fixed_size.describe(ignoredOnImage("fixed_size")).meta({ deprecated: true }),
228
+ background_image: commonDataShape.background_image.describe(ignoredOnImage("background_image")).meta({ deprecated: true }),
229
+ background_overlays: commonDataShape.background_overlays.describe(ignoredOnImage("background_overlays")).meta({ deprecated: true }),
230
+ image_url: z
231
+ .string()
232
+ .optional()
233
+ .describe(
234
+ "Network URL of the picture (Flutter `Image.network`). Absent, invalid, loading or failed: no image, the box is `constraints.smallest` and nothing is painted (no spinner).",
235
+ ),
236
+ size: commonDataShape.size.describe(
237
+ "Flutter `width` / `height`: an exact size on each axis set, folded into the parent's constraints (`BoxConstraints.tightFor(width, height).enforce(constraints)`). Absent axis: the intrinsic size kept in ratio once loaded, the minimum before.",
238
+ ),
239
+ alignment_geometry: commonDataShape.alignment_geometry.describe(
240
+ "Flutter `alignment`: where the picture sits inside the box. Default `center` (`Alignment.center`); `start` / `end` follow the layout direction.",
241
+ ),
242
+ fit: boxFitSchema
243
+ .optional()
244
+ .describe("Flutter `fit` (`BoxFit`). Absent = `scale_down` (`paintImage`: `BoxFit.scaleDown` when there is no `centerSlice`)."),
245
+ repeat: imageRepeatSchema
246
+ .optional()
247
+ .describe("Flutter `repeat`: how the area of the box the picture does not cover is painted. Default `no_repeat` (`ImageRepeat.noRepeat`)."),
248
+ color: colorSchema
249
+ .optional()
250
+ .describe("Flutter `color`: blended with each image pixel using `color_blend_mode`. Absent = no color filter."),
251
+ color_blend_mode: imageBlendModeSchema
252
+ .optional()
253
+ .describe("Flutter `colorBlendMode`, used only with `color`. Default `src_in` (`BlendMode.srcIn`: the color takes the picture's alpha)."),
254
+ opacity: z
255
+ .number()
256
+ .min(0)
257
+ .max(1)
258
+ .optional()
259
+ .describe("Flutter `opacity`: the picture's opacity, 0 ... 1. Default 1 (Flutter `null`, fully opaque)."),
260
+ filter_quality: filterQualitySchema
261
+ .optional()
262
+ .describe("Flutter `filterQuality`: the sampling quality when the picture is scaled. Default `medium` (`FilterQuality.medium`)."),
263
+ semantic_label: z.string().optional().describe("Flutter `semanticLabel`: the accessibility description of the picture (never shown). Absent = none."),
264
+ exclude_from_semantics: z
265
+ .boolean()
266
+ .optional()
267
+ .describe("Flutter `excludeFromSemantics`: hides the picture from accessibility. Default false."),
268
+ match_text_direction: z
269
+ .boolean()
270
+ .optional()
271
+ .describe("Flutter `matchTextDirection`: mirrors the picture horizontally in a right-to-left layout. Default false."),
272
+ gapless_playback: z
273
+ .boolean()
274
+ .optional()
275
+ .describe("Flutter `gaplessPlayback`: when `image_url` changes, keep showing the old picture until the new one loads (false = show nothing meanwhile). Default false."),
276
+ is_anti_alias: z.boolean().optional().describe("Flutter `isAntiAlias`: paints the picture with anti-aliasing. Default false."),
277
+ scale: z
278
+ .number()
279
+ .positive()
280
+ .optional()
281
+ .describe("Flutter `Image.network` `scale` (> 0): the intrinsic size is the pixel size divided by `scale`, in points / dp / CSS px. Default 1."),
282
+ content_mode: z
283
+ .enum(["fill", "fit"])
284
+ .optional()
285
+ .describe("Deprecated 1.x alias of `fit`, honored only when `fit` is absent: `fill` = `cover`, `fit` = `contain`. Ignored when `fit` is set.").meta({ deprecated: true }),
286
+ foreground_color: commonDataShape.foreground_color.describe(
287
+ "Deprecated 1.x alias of `color` with `src_in`, honored only when `color` is absent. Ignored when `color` is set.",
288
+ ).meta({ deprecated: true }),
289
+ shape: commonDataShape.shape.describe(
290
+ "Extension (no Flutter `Image` key): clips the box. `circle` = a centered circle, diameter = the shorter side; `capsule` rounds by half the shorter side; `rect` uses `corner_radius`. The frame is unchanged.",
291
+ ),
292
+ corner_radius: commonDataShape.corner_radius.describe(
293
+ "Extension (no Flutter `Image` key): rounded-rect clip of the box with this radius (as `card`). Absent = no rounding.",
294
+ ),
295
+ });
296
+
297
+ /**
298
+ * Flutter `MaterialBanner` with the Material 3 `_BannerDefaultsM3` (contract 2.0), from
299
+ * `material/banner.dart`, `material/material.dart`, `material/divider.dart`,
300
+ * `widgets/overflow_bar.dart` and the light M3 `ColorScheme` / `Typography.material2021`
301
+ * (`theme_data.dart`, `typography.dart`), flutter/flutter main 3490ec8. S33: "A banner displays an
302
+ * important, succinct message, and provides actions for users to address (or dismiss the banner).";
303
+ * "The [actions] will be placed beside the [content] if there is only one. Otherwise, the [actions]
304
+ * will be placed below the [content]. Use [forceActionsBelow] to override this behavior."
305
+ * Keys (defaults in each key's description): `id`, `content` (or the two runs `regular_text` +
306
+ * `emphasized_text`), `content_text_style`, `leading`, `leading_padding`, `actions`,
307
+ * `force_actions_below`, `overflow_alignment`, `min_action_bar_height`, `background_color`,
308
+ * `elevation`, `shadow_color`, `surface_tint_color`, `divider_color`, `padding`, `margin`.
309
+ * Layout: inside `margin`, a `Material` holding a column: (1) `padding` around a row of the
310
+ * `leading` (inside `leading_padding`), the content (it takes the rest of the width, tight; soft
311
+ * wrap; text scale clamped to 1.5) and, in the single-row case (exactly one action and not
312
+ * `force_actions_below`), the action bar; (2) otherwise the action bar below; (3) when `elevation` is
313
+ * 0, a divider of height 0 that paints a 1 px line in `divider_color` over the last pixel of the
314
+ * banner. The row's children are centered vertically. The action bar is at least
315
+ * `min_action_bar_height` tall, has horizontal padding 8 and holds the actions in a Flutter
316
+ * `OverflowBar` (spacing 8) aligned to the center end; below the content, actions that do not fit in
317
+ * one row are stacked (no spacing) and placed by `overflow_alignment`. The banner fills a bounded
318
+ * width (0 wide when unbounded) and hugs its height; a tight parent forces it (the column stays at
319
+ * the top). RTL mirrors it. Zero actions = no action bar and the single-row padding (Flutter asserts
320
+ * at least one action). Paint, bottom to top: the elevation shadow → the fill (tinted) → the content,
321
+ * leading and actions → the divider. No gestures and no semantics of its own (a banner placed in the
322
+ * tree, not shown by a `ScaffoldMessenger`).
323
+ * Deprecated, accepted and ignored: `events`, `foreground_color`, `size`, `alignment_geometry`,
324
+ * `shape`, `corner_radius`, `gradient`, `fixed_size`, `background_image`, `background_overlays`.
325
+ * They stay valid so saved 1.x banners decode; a saved 1.x banner (the two runs, no actions) renders
326
+ * as a Flutter banner with zero actions.
327
+ * Swift: AlertBanner/FIOCoreAlertBannerDataBlock.swift.
328
+ */
329
+ const ignoredOnAlertBanner = (key: string) =>
330
+ `Deprecated on \`alert_banner\` since 2.0 and ignored (S33); \`${key}\` stays valid so saved 1.x banners decode.`;
331
+
332
+ export const alertBannerDataSchema = z.strictObject({
333
+ ...commonDataShape,
334
+ events: commonDataShape.events.describe(
335
+ ignoredOnAlertBanner("events") + " Flutter `MaterialBanner` has no gestures; put the events on the `actions`.",
336
+ ).meta({ deprecated: true }),
337
+ foreground_color: commonDataShape.foreground_color.describe(
338
+ ignoredOnAlertBanner("foreground_color") + " Use `content_text_style.foreground_color`.",
339
+ ).meta({ deprecated: true }),
340
+ size: commonDataShape.size.describe(ignoredOnAlertBanner("size")).meta({ deprecated: true }),
341
+ alignment_geometry: commonDataShape.alignment_geometry.describe(ignoredOnAlertBanner("alignment_geometry")).meta({ deprecated: true }),
342
+ shape: commonDataShape.shape.describe(ignoredOnAlertBanner("shape")).meta({ deprecated: true }),
343
+ corner_radius: commonDataShape.corner_radius.describe(ignoredOnAlertBanner("corner_radius")).meta({ deprecated: true }),
344
+ gradient: commonDataShape.gradient.describe(ignoredOnAlertBanner("gradient")).meta({ deprecated: true }),
345
+ fixed_size: commonDataShape.fixed_size.describe(ignoredOnAlertBanner("fixed_size")).meta({ deprecated: true }),
346
+ background_image: commonDataShape.background_image.describe(ignoredOnAlertBanner("background_image")).meta({ deprecated: true }),
347
+ background_overlays: commonDataShape.background_overlays.describe(ignoredOnAlertBanner("background_overlays")).meta({ deprecated: true }),
348
+ content: blockRef
349
+ .optional()
350
+ .describe(
351
+ "Flutter `content`: \"The content of the [MaterialBanner].\" Any block; it gets the rest of the row's width as a tight width and a loose height, and a `text` block in it takes `content_text_style` for the style fields it leaves out. Wins over `regular_text` / `emphasized_text`.",
352
+ ),
353
+ regular_text: z
354
+ .string()
355
+ .optional()
356
+ .describe(
357
+ "The first run of the content when `content` is absent: one paragraph `regular_text` + `emphasized_text` with no separator (a separating space belongs at the end of `regular_text`), in `content_text_style`, start-aligned, soft wrap. Ignored when `content` is set. Absent = empty; with both runs empty the content is empty and 0 tall.",
358
+ ),
359
+ emphasized_text: z
360
+ .string()
361
+ .optional()
362
+ .describe(
363
+ "The second run of the content when `content` is absent: `content_text_style` with the weight `semi_bold` (w600). Ignored when `content` is set. Absent = empty.",
364
+ ),
365
+ content_text_style: textStyleSchema
366
+ .optional()
367
+ .describe(
368
+ "Flutter `contentTextStyle` (S19 shared schema). Absent = bodyMedium: 14, w400, letter spacing 0.25, height 1.43 (20), even leading, `#1D1B20` (colorScheme.onSurface). A left-out field keeps that default.",
369
+ ),
370
+ leading: blockRef
371
+ .optional()
372
+ .describe(
373
+ "Flutter `leading`: \"The (optional) leading widget of the [MaterialBanner].\" Any block, at the start of the row inside `leading_padding`, with its natural width (unbounded width, loose height), centered vertically. Absent = none.",
374
+ ),
375
+ leading_padding: z
376
+ .array(paddingEntrySchema)
377
+ .optional()
378
+ .describe(
379
+ "Flutter `leadingPadding`, resolved like every padding list (`edgeAnchorSchema`). Absent = end 16 (`EdgeInsetsDirectional.only(end: 16.0)`). Only with a `leading`. Negative constants count as 0.",
380
+ ),
381
+ actions: z
382
+ .array(blockRef)
383
+ .optional()
384
+ .describe(
385
+ "Flutter `actions`: \"The set of actions that are displayed at the bottom or trailing side of the [MaterialBanner].\" Usually `text_button` blocks, laid out with loose constraints. Exactly one (and not `force_actions_below`) = the single-row layout: the bar sits after the content in the row. Otherwise the bar goes below the content. Absent or empty = no action bar and the single-row padding (Flutter asserts at least one action).",
386
+ ),
387
+ force_actions_below: z
388
+ .boolean()
389
+ .optional()
390
+ .describe("Flutter `forceActionsBelow`. Default false. true = the action bar goes below the content even with one action."),
391
+ overflow_alignment: z
392
+ .enum(["start", "center", "end"])
393
+ .optional()
394
+ .describe(
395
+ "Flutter `overflowAlignment` (`OverflowBarAlignment`): the horizontal place of each action when the actions below the content do not fit in one row and are stacked, inside the bar's horizontal padding 8; `start` / `end` follow the layout direction. Default `end`. No effect when they fit in a row (the row sits at the end) or in the single-row layout.",
396
+ ),
397
+ min_action_bar_height: z
398
+ .number()
399
+ .min(0)
400
+ .optional()
401
+ .describe("Flutter `minActionBarHeight` (>= 0): the minimum height of the action bar, in both layouts. Default 52. The actions are centered vertically in it."),
402
+ background_color: commonDataShape.background_color.describe(
403
+ "Flutter `backgroundColor`: the fill of the banner (inside `margin`). Absent = `#F7F2FA` (colorScheme.surfaceContainerLow).",
404
+ ),
405
+ elevation: z
406
+ .number()
407
+ .min(0)
408
+ .optional()
409
+ .describe(
410
+ "Flutter `elevation` (>= 0) of the banner's `Material`: the shadow, and the surface tint opacity. Default 0. At 0 the divider is drawn and `margin` defaults to 0; above 0 there is no divider and `margin` defaults to bottom 10.",
411
+ ),
412
+ shadow_color: colorSchema.optional().describe("Flutter `shadowColor`. Absent = `#000000` (colorScheme.shadow). Only drawn when `elevation` > 0."),
413
+ surface_tint_color: colorSchema
414
+ .optional()
415
+ .describe(
416
+ "Flutter `surfaceTintColor`. Absent = transparent (no tint). Set = an overlay of this color over the fill at the M3 elevation opacity: 0 → 0, 1 → 5%, 3 → 8%, 6 → 11%, 8 → 12%, 12 → 14%, interpolated between and clamped past the ends.",
417
+ ),
418
+ divider_color: colorSchema
419
+ .optional()
420
+ .describe(
421
+ "Flutter `dividerColor`: the 1 px line along the bottom edge, drawn only when `elevation` is 0. Absent = `#CAC4D0` (colorScheme.outlineVariant).",
422
+ ),
423
+ padding: commonDataShape.padding.describe(
424
+ "Flutter `padding`: the insets of the row (leading, content and the single-row action bar), resolved like every padding list (`edgeAnchorSchema`); it replaces the whole default. Absent = start 16, top 2 in the single-row layout (and with zero actions); start 16, top 24, end 16, bottom 4 when the actions are below. Negative constants count as 0.",
425
+ ),
426
+ margin: commonDataShape.margin.describe(
427
+ "Flutter `margin`: empty space around the banner, inside the block's frame, resolved like every padding list. Absent = bottom 10 when `elevation` > 0, else 0; set, it replaces that default. Negative constants count as 0.",
428
+ ),
429
+ });
430
+
431
+ /**
432
+ * Flutter determinate `LinearProgressIndicator` (contract 2.0), from `material/progress_indicator.dart`
433
+ * (`_LinearProgressIndicatorDefaultsM3Year2023`, `_LinearProgressIndicatorDefaultsM3`) and the light M3
434
+ * `ColorScheme` (`theme_data.dart`), flutter/flutter main 4e9c63a. S34: "To create a determinate
435
+ * progress indicator, use a non-null [value] between 0.0 and 1.0."; "The value will be clamped to be in
436
+ * the range 0.0-1.0."
437
+ * Keys (defaults in each key's description): `id`, `fill_fraction` (value), `fill_color` (color),
438
+ * `background_color` (track color), `size.height` (minHeight), `corner_radius` / `corner_radii`
439
+ * (borderRadius), `year_2023`, `stop_indicator_color`, `stop_indicator_radius`, `track_gap`,
440
+ * `semantics_label`, `semantics_value`, and the extension `child` (a label overlaid on the track).
441
+ * Layout (`ConstrainedBox(minWidth: infinity, minHeight)` around a childless `CustomPaint`): width = the
442
+ * maximum width it receives (fills a bounded width; 0 wide when unbounded, where Flutter throws);
443
+ * height = `size.height` clamped into the height constraints (a tight parent forces it). Inside
444
+ * `expanded` / `flexible` it takes the share. Paint, bottom to top: the track (from 0, or from the fill
445
+ * end + the gap when `year_2023` is false) → the stop dot (`year_2023` false) → the fill (0 to
446
+ * clamp(`fill_fraction`) × width, when > 0) → the label. Track and fill are each a rounded rect with the
447
+ * same radii; RTL mirrors the fill, the stop dot and the label. Not clipped. Semantics: a progress bar,
448
+ * min 0, max 100, `semantics_label`, value `semantics_value` (absent: the rounded percentage).
449
+ * Label (`child`, extension, S6 parity): laid out with unbounded constraints at its natural size (it
450
+ * may be wider or taller than the track and is not clipped), vertically centered on the track; with
451
+ * fill = clamp(`fill_fraction`) × width and L = the label's width: fill 0 → centered in the track, but
452
+ * never starting before the track start (x = max((width − L) / 2, 0)); fill >= L + 16 → inside the
453
+ * fill, x = 8; otherwise just past the fill end, x = fill + 8 (RTL mirrors x). It never changes the
454
+ * track's frame.
455
+ * Deprecated, accepted and ignored: `size.width`, `events`, `foreground_color`, `padding`, `margin`,
456
+ * `alignment_geometry`, `shape`, `gradient`, `fixed_size`, `background_image`, `background_overlays`.
457
+ * They stay valid so saved 1.x tracks decode; a saved 1.x track without `size` becomes 4 tall.
458
+ * Swift: StatProgressTrack/FIOCoreStatProgressTrackDataBlock.swift.
459
+ */
460
+ const ignoredOnProgressTrack = (key: string) =>
461
+ `Deprecated on \`stat_progress_track\` since 2.0 and ignored (S34); \`${key}\` stays valid so saved 1.x tracks decode.`;
462
+
463
+ export const statProgressTrackDataSchema = z.strictObject({
464
+ ...singleChildShape(blockRef),
465
+ child: blockRef
466
+ .optional()
467
+ .describe(
468
+ "Extension (no Flutter key, S6 parity): a label overlaid on the track. Laid out with unbounded constraints at its natural size (a `text` keeps one line), vertically centered on the track, never clipped and never changing the track's frame. With fill = clamp(`fill_fraction`) × width and L = the label's width: fill 0 → x = max((width − L) / 2, 0); fill >= L + 16 → inside the fill at x = 8; otherwise just past the fill end at x = fill + 8. RTL mirrors x.",
469
+ ),
470
+ events: commonDataShape.events.describe(
471
+ ignoredOnProgressTrack("events") + " Flutter `LinearProgressIndicator` has no gestures.",
472
+ ).meta({ deprecated: true }),
473
+ foreground_color: commonDataShape.foreground_color.describe(ignoredOnProgressTrack("foreground_color") + " Use `fill_color`.").meta({ deprecated: true }),
474
+ padding: commonDataShape.padding.describe(ignoredOnProgressTrack("padding")).meta({ deprecated: true }),
475
+ margin: commonDataShape.margin.describe(ignoredOnProgressTrack("margin")).meta({ deprecated: true }),
476
+ alignment_geometry: commonDataShape.alignment_geometry.describe(ignoredOnProgressTrack("alignment_geometry")).meta({ deprecated: true }),
477
+ shape: commonDataShape.shape.describe(ignoredOnProgressTrack("shape") + " Use `corner_radius` / `corner_radii`.").meta({ deprecated: true }),
478
+ gradient: commonDataShape.gradient.describe(ignoredOnProgressTrack("gradient")).meta({ deprecated: true }),
479
+ fixed_size: commonDataShape.fixed_size.describe(ignoredOnProgressTrack("fixed_size")).meta({ deprecated: true }),
480
+ background_image: commonDataShape.background_image.describe(ignoredOnProgressTrack("background_image")).meta({ deprecated: true }),
481
+ background_overlays: commonDataShape.background_overlays.describe(ignoredOnProgressTrack("background_overlays")).meta({ deprecated: true }),
482
+ fill_fraction: z
483
+ .number()
484
+ .optional()
485
+ .describe(
486
+ "Flutter `value` of a determinate indicator: \"A value of 0.0 means no progress and 1.0 means that progress is complete. The value will be clamped to be in the range 0.0-1.0.\" Any number is valid and clamped to 0…1 (the fill, the track gap, the label placement and the semantics value all use the clamped value). Absent = 0 (there is no indeterminate mode).",
487
+ ),
488
+ fill_color: colorSchema
489
+ .optional()
490
+ .describe("Flutter `color`: the fill (the active indicator). Absent = `#6750A4` (colorScheme.primary), also when `year_2023` is false."),
491
+ background_color: commonDataShape.background_color.describe(
492
+ "Flutter `backgroundColor`: the track. Absent = `#E8DEF8` (colorScheme.secondaryContainer), also when `year_2023` is false.",
493
+ ),
494
+ size: sizeSchema
495
+ .extend({
496
+ width: deprecated(sizeSchema.shape.width, ignoredOnProgressTrack("size.width") + " The track takes the maximum width it receives."),
497
+ })
498
+ .optional()
499
+ .describe(
500
+ "`size.height` = Flutter `minHeight`: the height of the track, clamped into the height constraints it receives (a tight parent forces it). Absent = 4. A value <= 0 counts as 0 (Flutter asserts > 0). `size.width` is deprecated and ignored: the track takes the maximum width it receives.",
501
+ ),
502
+ corner_radius: commonDataShape.corner_radius.describe(
503
+ "Flutter `borderRadius` (`BorderRadius.circular`): the radius of each corner of the track and, separately, of the fill. Absent = no rounding when `year_2023` is true, 2 when it is false. Negative = 0. Radii larger than the segment are scaled down to fit (a uniform radius becomes min(r, segment width / 2, height / 2)).",
504
+ ),
505
+ corner_radii: cornerRadiiSchema
506
+ .optional()
507
+ .describe(
508
+ "Flutter `borderRadius` as `BorderRadiusDirectional.only`: per-corner radii of the track and of the fill (`start` / `end` follow the layout direction). A corner given here overrides `corner_radius`; a corner left out takes `corner_radius`, else the `year_2023` default (0, or 2 when false).",
509
+ ),
510
+ year_2023: z
511
+ .boolean()
512
+ .optional()
513
+ .describe(
514
+ "Flutter `year2023` (deprecated in Flutter): \"When true, the [LinearProgressIndicator] will use the 2023 Material Design 3 appearance.\" Default true. false = the December 2023 look: default radius 2, a stop dot at the track end, and a gap between the fill and the track. `stop_indicator_color`, `stop_indicator_radius` and `track_gap` only apply when it is false.",
515
+ ),
516
+ stop_indicator_color: colorSchema
517
+ .optional()
518
+ .describe("Flutter `stopIndicatorColor`: the dot at the end of the track. Only when `year_2023` is false. Absent = `#6750A4` (colorScheme.primary)."),
519
+ stop_indicator_radius: z
520
+ .number()
521
+ .min(0)
522
+ .optional()
523
+ .describe(
524
+ "Flutter `stopIndicatorRadius` (>= 0): \"Set [stopIndicatorRadius] to 0 to hide the stop indicator.\" Only when `year_2023` is false. Absent = 2. Drawn as a circle of radius min(r, height / 2) centered at (width − height / 2, height / 2) (mirrored in RTL), above the track and under the fill.",
525
+ ),
526
+ track_gap: z
527
+ .number()
528
+ .min(0)
529
+ .optional()
530
+ .describe(
531
+ "Flutter `trackGap` (>= 0): \"Set [trackGap] to 0 to hide the track gap.\" Only when `year_2023` is false. Absent = 4. The track starts at the fill end + gap × min(value, 0.01) / 0.01 (the gap ramps in over the first 1%), so at 0 there is no gap.",
532
+ ),
533
+ semantics_label: z
534
+ .string()
535
+ .optional()
536
+ .describe("Flutter `semanticsLabel`: \"This value indicates the purpose of the progress bar, and will be read out by screen readers to indicate the purpose of this progress indicator.\" Absent = no label."),
537
+ semantics_value: z
538
+ .string()
539
+ .optional()
540
+ .describe(
541
+ "Flutter `semanticsValue`: the progress bar's accessibility value (role progress bar, min 0, max 100). Absent = the clamped value × 100 rounded half away from zero, as a string without a percent sign (0.73 → \"73\"; Flutter code, not the \"10%\" of its doc).",
542
+ ),
543
+ });