@symbiote-native/angular 0.1.0

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 (372) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +147 -0
  3. package/build/angular/components/activity-indicator/index.android.d.ts +12 -0
  4. package/build/angular/components/activity-indicator/index.android.js +21 -0
  5. package/build/angular/components/activity-indicator/index.android.js.map +1 -0
  6. package/build/angular/components/activity-indicator/index.d.ts +1 -0
  7. package/build/angular/components/activity-indicator/index.ios.d.ts +8 -0
  8. package/build/angular/components/activity-indicator/index.ios.js +21 -0
  9. package/build/angular/components/activity-indicator/index.ios.js.map +1 -0
  10. package/build/angular/components/activity-indicator/index.js +4 -0
  11. package/build/angular/components/activity-indicator/index.js.map +1 -0
  12. package/build/angular/components/activity-indicator/shared.d.ts +67 -0
  13. package/build/angular/components/activity-indicator/shared.js +260 -0
  14. package/build/angular/components/activity-indicator/shared.js.map +1 -0
  15. package/build/angular/components/button.d.ts +63 -0
  16. package/build/angular/components/button.js +332 -0
  17. package/build/angular/components/button.js.map +1 -0
  18. package/build/angular/components/drawer-layout-android/index.android.d.ts +34 -0
  19. package/build/angular/components/drawer-layout-android/index.android.js +291 -0
  20. package/build/angular/components/drawer-layout-android/index.android.js.map +1 -0
  21. package/build/angular/components/drawer-layout-android/index.d.ts +11 -0
  22. package/build/angular/components/drawer-layout-android/index.js +109 -0
  23. package/build/angular/components/drawer-layout-android/index.js.map +1 -0
  24. package/build/angular/components/drawer-layout-android/shared.d.ts +74 -0
  25. package/build/angular/components/drawer-layout-android/shared.js +138 -0
  26. package/build/angular/components/drawer-layout-android/shared.js.map +1 -0
  27. package/build/angular/components/flat-list/index.d.ts +122 -0
  28. package/build/angular/components/flat-list/index.js +689 -0
  29. package/build/angular/components/flat-list/index.js.map +1 -0
  30. package/build/angular/components/image/index.android.d.ts +10 -0
  31. package/build/angular/components/image/index.android.js +59 -0
  32. package/build/angular/components/image/index.android.js.map +1 -0
  33. package/build/angular/components/image/index.d.ts +1 -0
  34. package/build/angular/components/image/index.ios.d.ts +10 -0
  35. package/build/angular/components/image/index.ios.js +59 -0
  36. package/build/angular/components/image/index.ios.js.map +1 -0
  37. package/build/angular/components/image/index.js +3 -0
  38. package/build/angular/components/image/index.js.map +1 -0
  39. package/build/angular/components/image/shared.d.ts +101 -0
  40. package/build/angular/components/image/shared.js +408 -0
  41. package/build/angular/components/image/shared.js.map +1 -0
  42. package/build/angular/components/image-background.d.ts +81 -0
  43. package/build/angular/components/image-background.js +418 -0
  44. package/build/angular/components/image-background.js.map +1 -0
  45. package/build/angular/components/input-accessory-view.d.ts +59 -0
  46. package/build/angular/components/input-accessory-view.js +266 -0
  47. package/build/angular/components/input-accessory-view.js.map +1 -0
  48. package/build/angular/components/keyboard-avoiding-view.d.ts +82 -0
  49. package/build/angular/components/keyboard-avoiding-view.js +363 -0
  50. package/build/angular/components/keyboard-avoiding-view.js.map +1 -0
  51. package/build/angular/components/modal.d.ts +92 -0
  52. package/build/angular/components/modal.js +365 -0
  53. package/build/angular/components/modal.js.map +1 -0
  54. package/build/angular/components/pressable/index.d.ts +123 -0
  55. package/build/angular/components/pressable/index.js +421 -0
  56. package/build/angular/components/pressable/index.js.map +1 -0
  57. package/build/angular/components/refresh-control.d.ts +86 -0
  58. package/build/angular/components/refresh-control.js +347 -0
  59. package/build/angular/components/refresh-control.js.map +1 -0
  60. package/build/angular/components/safe-area-view.d.ts +57 -0
  61. package/build/angular/components/safe-area-view.js +253 -0
  62. package/build/angular/components/safe-area-view.js.map +1 -0
  63. package/build/angular/components/scroll-view/index.android.d.ts +21 -0
  64. package/build/angular/components/scroll-view/index.android.js +235 -0
  65. package/build/angular/components/scroll-view/index.android.js.map +1 -0
  66. package/build/angular/components/scroll-view/index.d.ts +3 -0
  67. package/build/angular/components/scroll-view/index.ios.d.ts +9 -0
  68. package/build/angular/components/scroll-view/index.ios.js +86 -0
  69. package/build/angular/components/scroll-view/index.ios.js.map +1 -0
  70. package/build/angular/components/scroll-view/index.js +6 -0
  71. package/build/angular/components/scroll-view/index.js.map +1 -0
  72. package/build/angular/components/scroll-view/projection.d.ts +32 -0
  73. package/build/angular/components/scroll-view/projection.js +312 -0
  74. package/build/angular/components/scroll-view/projection.js.map +1 -0
  75. package/build/angular/components/scroll-view/shared.d.ts +230 -0
  76. package/build/angular/components/scroll-view/shared.js +679 -0
  77. package/build/angular/components/scroll-view/shared.js.map +1 -0
  78. package/build/angular/components/scroll-view/sticky-header.d.ts +41 -0
  79. package/build/angular/components/scroll-view/sticky-header.js +208 -0
  80. package/build/angular/components/scroll-view/sticky-header.js.map +1 -0
  81. package/build/angular/components/section-list/index.d.ts +116 -0
  82. package/build/angular/components/section-list/index.js +641 -0
  83. package/build/angular/components/section-list/index.js.map +1 -0
  84. package/build/angular/components/switch/index.android.d.ts +20 -0
  85. package/build/angular/components/switch/index.android.js +70 -0
  86. package/build/angular/components/switch/index.android.js.map +1 -0
  87. package/build/angular/components/switch/index.d.ts +1 -0
  88. package/build/angular/components/switch/index.ios.d.ts +19 -0
  89. package/build/angular/components/switch/index.ios.js +69 -0
  90. package/build/angular/components/switch/index.ios.js.map +1 -0
  91. package/build/angular/components/switch/index.js +4 -0
  92. package/build/angular/components/switch/index.js.map +1 -0
  93. package/build/angular/components/switch/shared.d.ts +40 -0
  94. package/build/angular/components/switch/shared.js +127 -0
  95. package/build/angular/components/switch/shared.js.map +1 -0
  96. package/build/angular/components/text-input.d.ts +153 -0
  97. package/build/angular/components/text-input.js +604 -0
  98. package/build/angular/components/text-input.js.map +1 -0
  99. package/build/angular/components/touchable-native-feedback.d.ts +83 -0
  100. package/build/angular/components/touchable-native-feedback.js +376 -0
  101. package/build/angular/components/touchable-native-feedback.js.map +1 -0
  102. package/build/angular/components/touchable.d.ts +248 -0
  103. package/build/angular/components/touchable.js +1206 -0
  104. package/build/angular/components/touchable.js.map +1 -0
  105. package/build/angular/components/virtualized-list/directives.d.ts +54 -0
  106. package/build/angular/components/virtualized-list/directives.js +154 -0
  107. package/build/angular/components/virtualized-list/directives.js.map +1 -0
  108. package/build/angular/components/virtualized-list/index.d.ts +268 -0
  109. package/build/angular/components/virtualized-list/index.js +1162 -0
  110. package/build/angular/components/virtualized-list/index.js.map +1 -0
  111. package/build/angular/components/virtualized-section-list/directives.d.ts +37 -0
  112. package/build/angular/components/virtualized-section-list/directives.js +77 -0
  113. package/build/angular/components/virtualized-section-list/directives.js.map +1 -0
  114. package/build/angular/components/virtualized-section-list/index.d.ts +178 -0
  115. package/build/angular/components/virtualized-section-list/index.js +722 -0
  116. package/build/angular/components/virtualized-section-list/index.js.map +1 -0
  117. package/build/angular/components.d.ts +39 -0
  118. package/build/angular/components.js +38 -0
  119. package/build/angular/components.js.map +1 -0
  120. package/build/angular/create-portal.d.ts +22 -0
  121. package/build/angular/create-portal.js +74 -0
  122. package/build/angular/create-portal.js.map +1 -0
  123. package/build/angular/create-tunnel.d.ts +34 -0
  124. package/build/angular/create-tunnel.js +126 -0
  125. package/build/angular/create-tunnel.js.map +1 -0
  126. package/build/angular/descriptor-to-angular/index.d.ts +22 -0
  127. package/build/angular/descriptor-to-angular/index.js +142 -0
  128. package/build/angular/descriptor-to-angular/index.js.map +1 -0
  129. package/build/angular/host-instance/index.d.ts +2 -0
  130. package/build/angular/host-instance/index.js +37 -0
  131. package/build/angular/host-instance/index.js.map +1 -0
  132. package/build/angular/index.d.ts +21 -0
  133. package/build/angular/index.js +42 -0
  134. package/build/angular/index.js.map +1 -0
  135. package/build/angular/modules/animated/create-animated-component.d.ts +68 -0
  136. package/build/angular/modules/animated/create-animated-component.js +429 -0
  137. package/build/angular/modules/animated/create-animated-component.js.map +1 -0
  138. package/build/angular/modules/animated/index.d.ts +51 -0
  139. package/build/angular/modules/animated/index.js +59 -0
  140. package/build/angular/modules/animated/index.js.map +1 -0
  141. package/build/angular/modules/app-registry/index.d.ts +7 -0
  142. package/build/angular/modules/app-registry/index.js +23 -0
  143. package/build/angular/modules/app-registry/index.js.map +1 -0
  144. package/build/angular/modules/status-bar.d.ts +20 -0
  145. package/build/angular/modules/status-bar.js +59 -0
  146. package/build/angular/modules/status-bar.js.map +1 -0
  147. package/build/angular/primitives/index.d.ts +63 -0
  148. package/build/angular/primitives/index.js +189 -0
  149. package/build/angular/primitives/index.js.map +1 -0
  150. package/build/angular/primitives/shared.d.ts +89 -0
  151. package/build/angular/primitives/shared.js +172 -0
  152. package/build/angular/primitives/shared.js.map +1 -0
  153. package/build/angular/render.d.ts +11 -0
  154. package/build/angular/render.js +161 -0
  155. package/build/angular/render.js.map +1 -0
  156. package/build/angular/renderer.d.ts +38 -0
  157. package/build/angular/renderer.js +360 -0
  158. package/build/angular/renderer.js.map +1 -0
  159. package/build/angular/services/color-scheme.service.d.ts +16 -0
  160. package/build/angular/services/color-scheme.service.js +31 -0
  161. package/build/angular/services/color-scheme.service.js.map +1 -0
  162. package/build/angular/services/index.d.ts +2 -0
  163. package/build/angular/services/index.js +3 -0
  164. package/build/angular/services/index.js.map +1 -0
  165. package/build/angular/services/window-dimensions.service.d.ts +16 -0
  166. package/build/angular/services/window-dimensions.service.js +42 -0
  167. package/build/angular/services/window-dimensions.service.js.map +1 -0
  168. package/build/components/activity-indicator/index.android.d.ts +9 -0
  169. package/build/components/activity-indicator/index.android.js +64 -0
  170. package/build/components/activity-indicator/index.d.ts +1 -0
  171. package/build/components/activity-indicator/index.ios.d.ts +5 -0
  172. package/build/components/activity-indicator/index.ios.js +64 -0
  173. package/build/components/activity-indicator/index.js +3 -0
  174. package/build/components/activity-indicator/shared.d.ts +64 -0
  175. package/build/components/activity-indicator/shared.js +424 -0
  176. package/build/components/button.d.ts +60 -0
  177. package/build/components/button.js +456 -0
  178. package/build/components/drawer-layout-android/index.android.d.ts +29 -0
  179. package/build/components/drawer-layout-android/index.android.js +326 -0
  180. package/build/components/drawer-layout-android/index.d.ts +8 -0
  181. package/build/components/drawer-layout-android/index.js +145 -0
  182. package/build/components/drawer-layout-android/shared.d.ts +71 -0
  183. package/build/components/drawer-layout-android/shared.js +205 -0
  184. package/build/components/flat-list/index.d.ts +119 -0
  185. package/build/components/flat-list/index.js +692 -0
  186. package/build/components/image/index.android.d.ts +7 -0
  187. package/build/components/image/index.android.js +88 -0
  188. package/build/components/image/index.d.ts +1 -0
  189. package/build/components/image/index.ios.d.ts +7 -0
  190. package/build/components/image/index.ios.js +88 -0
  191. package/build/components/image/index.js +2 -0
  192. package/build/components/image/shared.d.ts +101 -0
  193. package/build/components/image/shared.js +407 -0
  194. package/build/components/image-background.d.ts +78 -0
  195. package/build/components/image-background.js +583 -0
  196. package/build/components/input-accessory-view.d.ts +56 -0
  197. package/build/components/input-accessory-view.js +407 -0
  198. package/build/components/keyboard-avoiding-view.d.ts +79 -0
  199. package/build/components/keyboard-avoiding-view.js +509 -0
  200. package/build/components/modal.d.ts +89 -0
  201. package/build/components/modal.js +534 -0
  202. package/build/components/pressable/index.d.ts +120 -0
  203. package/build/components/pressable/index.js +640 -0
  204. package/build/components/refresh-control.d.ts +83 -0
  205. package/build/components/refresh-control.js +514 -0
  206. package/build/components/safe-area-view.d.ts +54 -0
  207. package/build/components/safe-area-view.js +393 -0
  208. package/build/components/scroll-view/index.android.d.ts +16 -0
  209. package/build/components/scroll-view/index.android.js +228 -0
  210. package/build/components/scroll-view/index.d.ts +3 -0
  211. package/build/components/scroll-view/index.ios.d.ts +6 -0
  212. package/build/components/scroll-view/index.ios.js +113 -0
  213. package/build/components/scroll-view/index.js +5 -0
  214. package/build/components/scroll-view/projection.d.ts +32 -0
  215. package/build/components/scroll-view/projection.js +311 -0
  216. package/build/components/scroll-view/shared.d.ts +225 -0
  217. package/build/components/scroll-view/shared.js +757 -0
  218. package/build/components/scroll-view/sticky-header.d.ts +38 -0
  219. package/build/components/scroll-view/sticky-header.js +257 -0
  220. package/build/components/section-list/index.d.ts +113 -0
  221. package/build/components/section-list/index.js +768 -0
  222. package/build/components/switch/index.android.d.ts +17 -0
  223. package/build/components/switch/index.android.js +107 -0
  224. package/build/components/switch/index.d.ts +1 -0
  225. package/build/components/switch/index.ios.d.ts +16 -0
  226. package/build/components/switch/index.ios.js +106 -0
  227. package/build/components/switch/index.js +3 -0
  228. package/build/components/switch/shared.d.ts +37 -0
  229. package/build/components/switch/shared.js +176 -0
  230. package/build/components/text-input.d.ts +150 -0
  231. package/build/components/text-input.js +826 -0
  232. package/build/components/touchable-native-feedback.d.ts +80 -0
  233. package/build/components/touchable-native-feedback.js +550 -0
  234. package/build/components/touchable.d.ts +241 -0
  235. package/build/components/touchable.js +1672 -0
  236. package/build/components/virtualized-list/directives.d.ts +41 -0
  237. package/build/components/virtualized-list/directives.js +250 -0
  238. package/build/components/virtualized-list/index.d.ts +265 -0
  239. package/build/components/virtualized-list/index.js +1344 -0
  240. package/build/components/virtualized-section-list/directives.d.ts +28 -0
  241. package/build/components/virtualized-section-list/directives.js +149 -0
  242. package/build/components/virtualized-section-list/index.d.ts +175 -0
  243. package/build/components/virtualized-section-list/index.js +854 -0
  244. package/build/components.d.ts +39 -0
  245. package/build/components.js +37 -0
  246. package/build/create-portal.d.ts +17 -0
  247. package/build/create-portal.js +128 -0
  248. package/build/create-tunnel.d.ts +29 -0
  249. package/build/create-tunnel.js +181 -0
  250. package/build/descriptor-to-angular/index.d.ts +19 -0
  251. package/build/descriptor-to-angular/index.js +186 -0
  252. package/build/host-instance/index.d.ts +2 -0
  253. package/build/host-instance/index.js +36 -0
  254. package/build/index.d.ts +21 -0
  255. package/build/index.js +41 -0
  256. package/build/modules/animated/create-animated-component.d.ts +57 -0
  257. package/build/modules/animated/create-animated-component.js +490 -0
  258. package/build/modules/animated/index.d.ts +51 -0
  259. package/build/modules/animated/index.js +58 -0
  260. package/build/modules/app-registry/index.d.ts +7 -0
  261. package/build/modules/app-registry/index.js +22 -0
  262. package/build/modules/status-bar.d.ts +17 -0
  263. package/build/modules/status-bar.js +121 -0
  264. package/build/primitives/index.d.ts +32 -0
  265. package/build/primitives/index.js +386 -0
  266. package/build/primitives/shared.d.ts +84 -0
  267. package/build/primitives/shared.js +231 -0
  268. package/build/render.d.ts +11 -0
  269. package/build/render.js +160 -0
  270. package/build/renderer.d.ts +38 -0
  271. package/build/renderer.js +359 -0
  272. package/build/services/color-scheme.service.d.ts +13 -0
  273. package/build/services/color-scheme.service.js +72 -0
  274. package/build/services/index.d.ts +2 -0
  275. package/build/services/index.js +2 -0
  276. package/build/services/window-dimensions.service.d.ts +13 -0
  277. package/build/services/window-dimensions.service.js +83 -0
  278. package/metro-css-parser.cjs +11 -0
  279. package/package.json +57 -0
  280. package/src/__tests__/responder-change-detection.test.ts +102 -0
  281. package/src/__tests__/responder-nested-cd.test.ts +113 -0
  282. package/src/angular-gaps.test.ts +142 -0
  283. package/src/angular-imports.test.ts +100 -0
  284. package/src/components/activity-indicator/activity-indicator-class-style.test.ts +44 -0
  285. package/src/components/activity-indicator/activity-indicator.test.ts +131 -0
  286. package/src/components/activity-indicator/index.android.ts +16 -0
  287. package/src/components/activity-indicator/index.ios.ts +17 -0
  288. package/src/components/activity-indicator/index.ts +4 -0
  289. package/src/components/activity-indicator/shared.ts +206 -0
  290. package/src/components/button.ts +193 -0
  291. package/src/components/flat-list/column-wrapper-style-class.test.ts +116 -0
  292. package/src/components/flat-list/flat-list-array-style.test.ts +131 -0
  293. package/src/components/flat-list/flat-list-class-style.test.ts +74 -0
  294. package/src/components/flat-list/flat-list-scroll-containment.test.ts +107 -0
  295. package/src/components/flat-list/flat-list.test.ts +99 -0
  296. package/src/components/flat-list/index.ts +575 -0
  297. package/src/components/image/image-class-style.test.ts +46 -0
  298. package/src/components/image/index.android.ts +48 -0
  299. package/src/components/image/index.ios.ts +48 -0
  300. package/src/components/image/index.ts +3 -0
  301. package/src/components/image/shared.ts +478 -0
  302. package/src/components/image-background-class-style.test.ts +48 -0
  303. package/src/components/image-background-style-class.test.ts +79 -0
  304. package/src/components/image-background.ts +270 -0
  305. package/src/components/input-accessory-view.test.ts +43 -0
  306. package/src/components/input-accessory-view.ts +191 -0
  307. package/src/components/keyboard-avoiding-view.test.ts +54 -0
  308. package/src/components/keyboard-avoiding-view.ts +308 -0
  309. package/src/components/modal.test.ts +43 -0
  310. package/src/components/modal.ts +304 -0
  311. package/src/components/pressable/index.ts +371 -0
  312. package/src/components/pressable/pressable.test.ts +85 -0
  313. package/src/components/refresh-control.test.ts +41 -0
  314. package/src/components/refresh-control.ts +288 -0
  315. package/src/components/safe-area-view.test.ts +43 -0
  316. package/src/components/safe-area-view.ts +178 -0
  317. package/src/components/scroll-view/android-scroll-view-axis-projection.test.ts +123 -0
  318. package/src/components/scroll-view/content-container-style-class.test.ts +75 -0
  319. package/src/components/scroll-view/index.android.ts +190 -0
  320. package/src/components/scroll-view/index.ios.ts +79 -0
  321. package/src/components/scroll-view/index.ts +7 -0
  322. package/src/components/scroll-view/projection.ts +384 -0
  323. package/src/components/scroll-view/scroll-view-class-style.test.ts +134 -0
  324. package/src/components/scroll-view/scroll-view-projection.test.ts +194 -0
  325. package/src/components/scroll-view/shared.ts +836 -0
  326. package/src/components/scroll-view/sticky-header.ts +230 -0
  327. package/src/components/section-list/index.ts +445 -0
  328. package/src/components/switch/android-switch-class.test.ts +42 -0
  329. package/src/components/switch/index.android.ts +61 -0
  330. package/src/components/switch/index.ios.ts +60 -0
  331. package/src/components/switch/index.ts +4 -0
  332. package/src/components/switch/shared.ts +197 -0
  333. package/src/components/switch/switch.test.ts +92 -0
  334. package/src/components/text-input-class-style.test.ts +54 -0
  335. package/src/components/text-input.ts +536 -0
  336. package/src/components/touchable-native-feedback.test.ts +49 -0
  337. package/src/components/touchable-native-feedback.ts +260 -0
  338. package/src/components/touchable.test.ts +102 -0
  339. package/src/components/touchable.ts +643 -0
  340. package/src/components/virtualized-list/directives.ts +169 -0
  341. package/src/components/virtualized-list/index.ts +1204 -0
  342. package/src/components/virtualized-list/virtualized-list-class-style.test.ts +76 -0
  343. package/src/components/virtualized-section-list/directives.ts +91 -0
  344. package/src/components/virtualized-section-list/index.ts +598 -0
  345. package/src/components/virtualized-section-list/virtualized-section-list-class-style.test.ts +60 -0
  346. package/src/components.ts +149 -0
  347. package/src/create-portal.test.ts +90 -0
  348. package/src/create-portal.ts +74 -0
  349. package/src/create-tunnel.test.ts +120 -0
  350. package/src/create-tunnel.ts +136 -0
  351. package/src/descriptor-to-angular/descriptor-outlet.test.ts +94 -0
  352. package/src/descriptor-to-angular/index.ts +190 -0
  353. package/src/host-instance/host-instance.test.ts +49 -0
  354. package/src/host-instance/index.ts +36 -0
  355. package/src/index.ts +257 -0
  356. package/src/modules/animated/animated-scroll-view.test.ts +85 -0
  357. package/src/modules/animated/create-animated-component.ts +435 -0
  358. package/src/modules/animated/index.ts +105 -0
  359. package/src/modules/app-registry/app-registry.test.ts +106 -0
  360. package/src/modules/app-registry/index.ts +60 -0
  361. package/src/modules/status-bar.test.ts +50 -0
  362. package/src/modules/status-bar.ts +57 -0
  363. package/src/primitives/index.ts +119 -0
  364. package/src/primitives/shared.ts +191 -0
  365. package/src/render.test.ts +147 -0
  366. package/src/render.ts +224 -0
  367. package/src/renderer.test.ts +179 -0
  368. package/src/renderer.ts +407 -0
  369. package/src/services/color-scheme.service.ts +27 -0
  370. package/src/services/index.ts +2 -0
  371. package/src/services/services.test.ts +163 -0
  372. package/src/services/window-dimensions.service.ts +41 -0
@@ -0,0 +1,836 @@
1
+ // ScrollView, the Angular lifecycle half (ADR 0024). The Fabric tree is nested: a scroll view
2
+ // wraps a content view that holds the children (RN's ScrollView.js shape). The platform-invariant
3
+ // math (decelerationRate, the per-axis intrinsics/base style, the content-size dedupe, the
4
+ // imperative handle, the native sticky scroll-attach, the aria/role fold) lives in
5
+ // @symbiote-native/components, shared verbatim with React/Vue. Here Angular supplies only the lifecycle:
6
+ // the host node held by IDENTITY through a directive's ElementRef, a forwarded-prop bag set onto
7
+ // that node through Renderer2 (-> routeProp), the imperative handle (scrollTo/scrollToEnd/
8
+ // flashScrollIndicators), the content-size dedupe, and the native sticky scroll-attach wired
9
+ // through whenCommitted. This is the Angular twin of the React useRef + Vue shallowRef host.
10
+ //
11
+ // What diverges per platform (ADR 0020/0024), how a RefreshControl integrates, stays in the
12
+ // .ios/.android files (Metro filename-selected): iOS renders the RefreshControl as a SIBLING
13
+ // before the content container; on Android an AndroidSwipeRefreshLayout WRAPS the scroll view.
14
+ //
15
+ // Angular cannot transform <ng-content> children in the template the way React children.map /
16
+ // Vue slots() can, so ScrollView owns a tiny projection bridge: the content host registers a
17
+ // ScrollViewProjectionController with the Angular renderer, and the renderer wraps direct projected
18
+ // children whose indices match stickyHeaderIndices. Android RefreshControl projection is handled by
19
+ // re-rendering the projected component's native prop surface as the wrapper around the scroll view
20
+ // (RN's Android shape), while excluding the original projected node from the content slot.
21
+
22
+ import {
23
+ Directive,
24
+ ElementRef,
25
+ EventEmitter,
26
+ Output,
27
+ ViewChild,
28
+ ContentChild,
29
+ inject,
30
+ type AfterViewInit,
31
+ type OnDestroy,
32
+ } from '@angular/core';
33
+ import {
34
+ attachStickyScroll,
35
+ buildScrollViewHandle,
36
+ didContentSizeChange,
37
+ forwardScrollEvent,
38
+ readLayoutDimension,
39
+ resolveAccessibilityProps,
40
+ resolveDecelerationRate,
41
+ selectScrollIntrinsics,
42
+ splitLayoutProps,
43
+ type IAccessibilityProps,
44
+ type IAccessibilityStateValue,
45
+ type IAriaProps,
46
+ type IContentSize,
47
+ type IScrollViewHandle,
48
+ } from '@symbiote-native/components';
49
+ import {
50
+ AnimatedValue,
51
+ dlog,
52
+ event as animatedEvent,
53
+ isNativeAnimatedAvailable,
54
+ isSymbioteNode,
55
+ resolveClassName,
56
+ whenCommitted,
57
+ type IStyleProp,
58
+ type ISymbioteEvent,
59
+ type ISymbioteNode,
60
+ type IViewStyle,
61
+ } from '@symbiote-native/engine';
62
+ import { SymbioteHostPropsDirective } from '../../primitives';
63
+ import { RefreshControl } from '../refresh-control';
64
+ import { ScrollViewProjectionController } from './projection';
65
+
66
+ export type { IScrollViewHandle } from '@symbiote-native/components';
67
+
68
+ type IScrollHandler = (event: ISymbioteEvent) => void;
69
+ type IContentSizeHandler = (width: number, height: number) => void;
70
+
71
+ // The inputs every platform ScrollView accepts, listed on each concrete @Component (the adapter
72
+ // convention, mirroring Switch/Animated) so the base fields bind consistently. The aria-* /
73
+ // role aliases ride here too and are folded by resolveAccessibilityProps before reaching native.
74
+ export const SCROLL_VIEW_INPUTS = [
75
+ 'style',
76
+ 'contentContainerStyle',
77
+ 'horizontal',
78
+ 'scrollEnabled',
79
+ 'showsVerticalScrollIndicator',
80
+ 'showsHorizontalScrollIndicator',
81
+ 'pagingEnabled',
82
+ 'bounces',
83
+ 'decelerationRate',
84
+ 'scrollEventThrottle',
85
+ 'contentInset',
86
+ 'contentOffset',
87
+ 'removeClippedSubviews',
88
+ 'snapToInterval',
89
+ 'snapToOffsets',
90
+ 'snapToAlignment',
91
+ 'snapToStart',
92
+ 'snapToEnd',
93
+ 'disableIntervalMomentum',
94
+ 'stickyHeaderIndices',
95
+ 'invertStickyHeaders',
96
+ 'StickyHeaderComponent',
97
+ 'keyboardDismissMode',
98
+ 'keyboardShouldPersistTaps',
99
+ 'maintainVisibleContentPosition',
100
+ 'alwaysBounceHorizontal',
101
+ 'alwaysBounceVertical',
102
+ 'centerContent',
103
+ 'scrollIndicatorInsets',
104
+ 'indicatorStyle',
105
+ 'directionalLockEnabled',
106
+ 'automaticallyAdjustKeyboardInsets',
107
+ 'contentInsetAdjustmentBehavior',
108
+ 'minimumZoomScale',
109
+ 'maximumZoomScale',
110
+ 'zoomScale',
111
+ 'bouncesZoom',
112
+ 'pinchGestureEnabled',
113
+ 'nestedScrollEnabled',
114
+ 'overScrollMode',
115
+ 'fadingEdgeLength',
116
+ 'persistentScrollbar',
117
+ 'endFillColor',
118
+ 'onScroll',
119
+ 'onScrollBeginDrag',
120
+ 'onScrollEndDrag',
121
+ 'onMomentumScrollBegin',
122
+ 'onMomentumScrollEnd',
123
+ 'testID',
124
+ 'nativeID',
125
+ 'accessible',
126
+ 'accessibilityLabel',
127
+ 'accessibilityHint',
128
+ 'accessibilityRole',
129
+ 'accessibilityState',
130
+ 'accessibilityValue',
131
+ 'accessibilityActions',
132
+ 'accessibilityLabelledBy',
133
+ 'importantForAccessibility',
134
+ 'accessibilityLiveRegion',
135
+ 'screenReaderFocusable',
136
+ 'accessibilityViewIsModal',
137
+ 'accessibilityElementsHidden',
138
+ 'accessibilityIgnoresInvertColors',
139
+ 'accessibilityLanguage',
140
+ 'accessibilityRespondsToUserInteraction',
141
+ 'accessibilityShowsLargeContentViewer',
142
+ 'accessibilityLargeContentTitle',
143
+ 'role',
144
+ 'aria-label',
145
+ 'aria-labelledby',
146
+ 'aria-live',
147
+ 'aria-hidden',
148
+ 'aria-busy',
149
+ 'aria-checked',
150
+ 'aria-disabled',
151
+ 'aria-expanded',
152
+ 'aria-selected',
153
+ 'aria-modal',
154
+ 'aria-valuemax',
155
+ 'aria-valuemin',
156
+ 'aria-valuenow',
157
+ 'aria-valuetext',
158
+ ];
159
+
160
+ // The Angular-facing prop surface. React's IScrollViewProps is React-coupled (ReactNode children,
161
+ // ReactElement refreshControl); Angular takes children via <ng-content> and composes the
162
+ // RefreshControl through projection / an outer wrap, so this mirrors the same pass-through surface
163
+ // minus those, declared per-adapter over the shared a11y base per
164
+ // <prop_types_split_agnostic_vs_per_adapter>. Every prop is accepted and typed against the full
165
+ // React surface so app code type-checks against parity now.
166
+ export interface IAngularScrollViewProps extends IAccessibilityProps, IAriaProps {
167
+ style?: IStyleProp<IViewStyle>;
168
+ // A bare string resolves through the shared style registry, like `class` on the host node.
169
+ contentContainerStyle?: IStyleProp<IViewStyle> | string;
170
+ horizontal?: boolean;
171
+ scrollEnabled?: boolean;
172
+ showsVerticalScrollIndicator?: boolean;
173
+ showsHorizontalScrollIndicator?: boolean;
174
+ pagingEnabled?: boolean;
175
+ bounces?: boolean;
176
+ decelerationRate?: 'normal' | 'fast' | number;
177
+ scrollEventThrottle?: number;
178
+ contentInset?: { top?: number; left?: number; bottom?: number; right?: number };
179
+ contentOffset?: { x: number; y: number };
180
+ removeClippedSubviews?: boolean;
181
+ snapToInterval?: number;
182
+ snapToOffsets?: number[];
183
+ snapToAlignment?: 'start' | 'center' | 'end';
184
+ snapToStart?: boolean;
185
+ snapToEnd?: boolean;
186
+ disableIntervalMomentum?: boolean;
187
+ // Sticky headers: RN implements stickiness PURELY IN JS (ScrollView.js wraps each flagged child
188
+ // in ScrollViewStickyHeader, driven by the scroll offset). The native scroll view does NOT honor
189
+ // an index array. See the header note on the Angular projection boundary for the auto-wrap.
190
+ stickyHeaderIndices?: number[];
191
+ invertStickyHeaders?: boolean;
192
+ // Angular auto projection is renderer-node based, so this input is intentionally explicit-
193
+ // composition only: custom sticky wrappers must be written in the template; auto stickyHeaderIndices
194
+ // uses the built-in wrapper to stay AOT-safe.
195
+ StickyHeaderComponent?: unknown;
196
+ keyboardDismissMode?: 'none' | 'on-drag' | 'interactive';
197
+ keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled';
198
+ maintainVisibleContentPosition?: {
199
+ minIndexForVisible: number;
200
+ autoscrollToTopThreshold?: number;
201
+ };
202
+ // iOS-only forwarding props (harmless on Android: its manager ignores unknown props).
203
+ alwaysBounceHorizontal?: boolean;
204
+ alwaysBounceVertical?: boolean;
205
+ centerContent?: boolean;
206
+ scrollIndicatorInsets?: { top?: number; left?: number; bottom?: number; right?: number };
207
+ indicatorStyle?: 'default' | 'black' | 'white';
208
+ directionalLockEnabled?: boolean;
209
+ automaticallyAdjustKeyboardInsets?: boolean;
210
+ contentInsetAdjustmentBehavior?: 'automatic' | 'scrollableAxes' | 'never' | 'always';
211
+ minimumZoomScale?: number;
212
+ maximumZoomScale?: number;
213
+ zoomScale?: number;
214
+ bouncesZoom?: boolean;
215
+ pinchGestureEnabled?: boolean;
216
+ // Android-only forwarding props (harmless on iOS).
217
+ nestedScrollEnabled?: boolean;
218
+ overScrollMode?: 'auto' | 'always' | 'never';
219
+ fadingEdgeLength?: number;
220
+ persistentScrollbar?: boolean;
221
+ endFillColor?: string;
222
+ onLayout?: IScrollHandler;
223
+ onScroll?: IScrollHandler;
224
+ onScrollBeginDrag?: IScrollHandler;
225
+ onScrollEndDrag?: IScrollHandler;
226
+ onMomentumScrollBegin?: IScrollHandler;
227
+ onMomentumScrollEnd?: IScrollHandler;
228
+ // iOS-only: user tapped the status bar to scroll to top. Inert on Android.
229
+ onScrollToTop?: IScrollHandler;
230
+ // Synthesized in JS from the content view's onLayout (RN _handleContentOnLayout); deduped.
231
+ onContentSizeChange?: IContentSizeHandler;
232
+ onAccessibilityAction?: (event: ISymbioteEvent) => void;
233
+ onAccessibilityTap?: (event: ISymbioteEvent) => void;
234
+ onMagicTap?: (event: ISymbioteEvent) => void;
235
+ onAccessibilityEscape?: (event: ISymbioteEvent) => void;
236
+ }
237
+
238
+ // What ScrollView itself takes as plain @Input()s: the full surface minus the layout/content-size/
239
+ // accessibility events it exposes as real @Output() EventEmitters instead (see ScrollViewBase below).
240
+ // onScroll and the drag/momentum family stay callback @Input()s permanently — they must also accept
241
+ // an Animated.event(...) native-driver marker, which no @Output() binding can carry.
242
+ export type IAngularScrollViewInputs = Omit<
243
+ IAngularScrollViewProps,
244
+ | 'onLayout'
245
+ | 'onScrollToTop'
246
+ | 'onContentSizeChange'
247
+ | 'onAccessibilityAction'
248
+ | 'onAccessibilityTap'
249
+ | 'onMagicTap'
250
+ | 'onAccessibilityEscape'
251
+ >;
252
+
253
+ // Strip undefined entries so a prop the user never set is not forwarded to the host (an undefined
254
+ // reaching Fabric is at best a no-op, at worst clears a default). The Angular twin of React/Vue
255
+ // destructuring `...rest` past the defined props.
256
+ function compact(bag: Record<string, unknown>): Record<string, unknown> {
257
+ const result: Record<string, unknown> = {};
258
+ for (const key of Object.keys(bag)) {
259
+ if (bag[key] !== undefined) result[key] = bag[key];
260
+ }
261
+ return result;
262
+ }
263
+
264
+ // ScrollView's forwarded surface (scroll events + the snap/keyboard/zoom families) is exactly the
265
+ // flat-bag shape SymbioteHostPropsDirective spreads onto a host element via Renderer2 (-> routeProp).
266
+ // The scroll-event callbacks ride this bag (not the (event) channel) because routeProp must be free
267
+ // to wire onScroll as an Animated.event when sticky headers drive the value natively, which the
268
+ // listen()/setEventListener channel cannot carry. This mirrors React/Vue putting onScroll on
269
+ // outerProps.
270
+ @Directive({
271
+ selector: '[symbioteScrollViewProjection]',
272
+ standalone: true,
273
+ inputs: ['symbioteScrollViewProjection'],
274
+ })
275
+ export class ScrollViewProjectionDirective {
276
+ private readonly elementRef = inject<ElementRef<unknown>>(ElementRef);
277
+
278
+ set symbioteScrollViewProjection(controller: ScrollViewProjectionController) {
279
+ const node = this.elementRef.nativeElement;
280
+ if (isSymbioteNode(node)) controller.bindContentNode(node);
281
+ }
282
+ }
283
+
284
+ // @Directive() (no selector) is the Angular-sanctioned decorator for an abstract base that
285
+ // declares lifecycle hooks and @ViewChild queries (mirrors AnimatedComponentBase) — without it
286
+ // ngtsc rejects the inherited hooks/queries (NG2007). The concrete platform @Components add ONLY a
287
+ // decorator + their platform template; all behavior lives here.
288
+ @Directive()
289
+ export abstract class ScrollViewBase implements IAngularScrollViewInputs, AfterViewInit, OnDestroy {
290
+ style: IStyleProp<IViewStyle> | undefined;
291
+ contentContainerStyle: IStyleProp<IViewStyle> | string | undefined;
292
+ horizontal: boolean | undefined;
293
+ scrollEnabled: boolean | undefined;
294
+ showsVerticalScrollIndicator: boolean | undefined;
295
+ showsHorizontalScrollIndicator: boolean | undefined;
296
+ pagingEnabled: boolean | undefined;
297
+ bounces: boolean | undefined;
298
+ decelerationRate: 'normal' | 'fast' | number | undefined;
299
+ scrollEventThrottle: number | undefined;
300
+ contentInset: IAngularScrollViewProps['contentInset'];
301
+ contentOffset: IAngularScrollViewProps['contentOffset'];
302
+ removeClippedSubviews: boolean | undefined;
303
+ snapToInterval: number | undefined;
304
+ snapToOffsets: number[] | undefined;
305
+ snapToAlignment: IAngularScrollViewProps['snapToAlignment'];
306
+ snapToStart: boolean | undefined;
307
+ snapToEnd: boolean | undefined;
308
+ disableIntervalMomentum: boolean | undefined;
309
+ stickyHeaderIndices: number[] | undefined;
310
+ invertStickyHeaders: boolean | undefined;
311
+ StickyHeaderComponent: unknown;
312
+ keyboardDismissMode: IAngularScrollViewProps['keyboardDismissMode'];
313
+ keyboardShouldPersistTaps: IAngularScrollViewProps['keyboardShouldPersistTaps'];
314
+ maintainVisibleContentPosition: IAngularScrollViewProps['maintainVisibleContentPosition'];
315
+ alwaysBounceHorizontal: boolean | undefined;
316
+ alwaysBounceVertical: boolean | undefined;
317
+ centerContent: boolean | undefined;
318
+ scrollIndicatorInsets: IAngularScrollViewProps['scrollIndicatorInsets'];
319
+ indicatorStyle: IAngularScrollViewProps['indicatorStyle'];
320
+ directionalLockEnabled: boolean | undefined;
321
+ automaticallyAdjustKeyboardInsets: boolean | undefined;
322
+ contentInsetAdjustmentBehavior: IAngularScrollViewProps['contentInsetAdjustmentBehavior'];
323
+ minimumZoomScale: number | undefined;
324
+ maximumZoomScale: number | undefined;
325
+ zoomScale: number | undefined;
326
+ bouncesZoom: boolean | undefined;
327
+ pinchGestureEnabled: boolean | undefined;
328
+ nestedScrollEnabled: boolean | undefined;
329
+ overScrollMode: IAngularScrollViewProps['overScrollMode'];
330
+ fadingEdgeLength: number | undefined;
331
+ persistentScrollbar: boolean | undefined;
332
+ endFillColor: string | undefined;
333
+ onScroll: IScrollHandler | undefined;
334
+ onScrollBeginDrag: IScrollHandler | undefined;
335
+ onScrollEndDrag: IScrollHandler | undefined;
336
+ onMomentumScrollBegin: IScrollHandler | undefined;
337
+ onMomentumScrollEnd: IScrollHandler | undefined;
338
+
339
+ // The layout/content-size/accessibility events as real Angular events: `(layout)="…"`, not
340
+ // `[onLayout]="…"`. onScroll and the drag/momentum family stay plain @Input() callbacks above —
341
+ // they must also accept an Animated.event(...) native-driver marker (see the file header note),
342
+ // which no @Output() binding can carry.
343
+ @Output() readonly layout = new EventEmitter<ISymbioteEvent>();
344
+ @Output() readonly scrollToTop = new EventEmitter<ISymbioteEvent>();
345
+ @Output() readonly contentSizeChange = new EventEmitter<IContentSize>();
346
+ @Output() readonly accessibilityAction = new EventEmitter<ISymbioteEvent>();
347
+ @Output() readonly accessibilityTap = new EventEmitter<ISymbioteEvent>();
348
+ @Output() readonly magicTap = new EventEmitter<ISymbioteEvent>();
349
+ @Output() readonly accessibilityEscape = new EventEmitter<ISymbioteEvent>();
350
+
351
+ testID: string | undefined;
352
+ nativeID: string | undefined;
353
+ accessible: boolean | undefined;
354
+ accessibilityLabel: string | undefined;
355
+ accessibilityHint: string | undefined;
356
+ accessibilityRole: IAccessibilityProps['accessibilityRole'];
357
+ accessibilityState: IAccessibilityStateValue | undefined;
358
+ accessibilityValue: IAccessibilityProps['accessibilityValue'];
359
+ accessibilityActions: IAccessibilityProps['accessibilityActions'];
360
+ accessibilityLabelledBy: string | string[] | undefined;
361
+ importantForAccessibility: IAccessibilityProps['importantForAccessibility'];
362
+ accessibilityLiveRegion: IAccessibilityProps['accessibilityLiveRegion'];
363
+ screenReaderFocusable: boolean | undefined;
364
+ accessibilityViewIsModal: boolean | undefined;
365
+ accessibilityElementsHidden: boolean | undefined;
366
+ accessibilityIgnoresInvertColors: boolean | undefined;
367
+ accessibilityLanguage: string | undefined;
368
+ accessibilityRespondsToUserInteraction: boolean | undefined;
369
+ accessibilityShowsLargeContentViewer: boolean | undefined;
370
+ accessibilityLargeContentTitle: string | undefined;
371
+ role: IAriaProps['role'];
372
+ 'aria-label': string | undefined;
373
+ 'aria-labelledby': string | undefined;
374
+ 'aria-live': IAriaProps['aria-live'];
375
+ 'aria-hidden': boolean | undefined;
376
+ 'aria-busy': boolean | undefined;
377
+ 'aria-checked': boolean | 'mixed' | undefined;
378
+ 'aria-disabled': boolean | undefined;
379
+ 'aria-expanded': boolean | undefined;
380
+ 'aria-selected': boolean | undefined;
381
+ 'aria-modal': boolean | undefined;
382
+ 'aria-valuemax': number | undefined;
383
+ 'aria-valuemin': number | undefined;
384
+ 'aria-valuenow': number | undefined;
385
+ 'aria-valuetext': string | undefined;
386
+
387
+ // The host directive on the scroll-view intrinsic; `.node` is the committed SymbioteNode held by
388
+ // IDENTITY (Renderer2.createElement returned the engine node, ElementRef hands it back unwrapped).
389
+ // Inherited by the decorated subclass — Angular collects base-class @ViewChild queries.
390
+ @ViewChild('host', { read: SymbioteHostPropsDirective })
391
+ private hostDirective?: SymbioteHostPropsDirective;
392
+
393
+ @ContentChild(RefreshControl) protected projectedRefreshControl?: RefreshControl;
394
+
395
+ // A single AnimatedValue tracks the scroll offset and drives every sticky header's translateY
396
+ // (RN's _scrollAnimatedValue). A stable field (allocated once, held by identity — Angular does
397
+ // not proxy class fields, so no markRaw needed); the native attach below feeds it on the UI
398
+ // thread. Allocated unconditionally; inert until a sticky header consumes it.
399
+ protected readonly scrollAnimatedValue = new AnimatedValue(0);
400
+
401
+ // The last-seen content size, used to dedupe onContentSizeChange: RN fires the content onLayout
402
+ // on every layout pass; only real size changes emit (didContentSizeChange).
403
+ private lastContentSize: IContentSize | null = null;
404
+ // Inverted sticky headers stick to the BOTTOM, so they need the viewport height (RN _handleLayout).
405
+ private viewportHeight: number | undefined = undefined;
406
+
407
+ protected readonly projectionController = new ScrollViewProjectionController({
408
+ stickyHeaderIndices: undefined,
409
+ invertStickyHeaders: undefined,
410
+ scrollViewHeight: undefined,
411
+ scrollAnimatedValue: this.scrollAnimatedValue,
412
+ customStickyHeaderComponent: undefined,
413
+ excludeRefreshControl: false,
414
+ });
415
+
416
+ // Native sticky-scroll attach (RN attachNativeEvent): when the native module is available the
417
+ // scroll value is driven on the UI thread so the interpolations ride scroll natively (no JS
418
+ // jitter). Through whenCommitted because under Angular's zoneless batched CD the host's Fabric
419
+ // tag does not exist yet at ngAfterViewInit time (the async-commit gotcha Vue documents); the
420
+ // bind runs now if committed, else after the commit that assigns the tag. Detached on destroy.
421
+ private detachStickyScroll: (() => void) | undefined;
422
+ private cancelStickyBind: (() => void) | undefined;
423
+
424
+ private lastLoggedIsHorizontal: boolean | undefined = undefined;
425
+
426
+ // Stable reference (bound once): inverted sticky headers need the viewport height captured off
427
+ // the scroll-view's own onLayout before forwarding to the user (RN _handleLayout). A getter that
428
+ // built this arrow function fresh on every `scrollProps` access would hand `[symbioteHostProps]`
429
+ // a new function reference every change-detection pass touching this component — jsonEqual
430
+ // (commit.ts) falls back to Object.is on a function leaf, so even a structurally-identical bag
431
+ // reads as "props changed" and forces a real Fabric re-clone that cascades up every ancestor
432
+ // (see AnimatedComponentBase.reconcile()'s identical warning).
433
+ private readonly handleInvertedStickyLayout = (event: ISymbioteEvent): void => {
434
+ const height = readLayoutDimension(event, 'height');
435
+ if (height !== undefined) this.viewportHeight = height;
436
+ this.layout.emit(event);
437
+ };
438
+
439
+ // Same reasoning as handleInvertedStickyLayout: the content view's onLayout synthesizes
440
+ // onContentSizeChange (deduped) and must stay a stable reference across `contentProps` re-reads.
441
+ private readonly handleContentLayout = (event: ISymbioteEvent): void => {
442
+ const width = readLayoutDimension(event, 'width');
443
+ const height = readLayoutDimension(event, 'height');
444
+ if (width === undefined || height === undefined) return;
445
+ if (!didContentSizeChange(this.lastContentSize, { width, height })) return;
446
+ this.lastContentSize = { width, height };
447
+ dlog(`Angular ScrollView contentSizeChange ${width}x${height}`);
448
+ this.contentSizeChange.emit({ width, height });
449
+ };
450
+
451
+ // Memoizes the wrapper each `emitterCallback` builds, keyed by the emitter it closes over
452
+ // (identity holds across ScrollViewBase's own @Output()s and a projected RefreshControl's,
453
+ // since a WeakMap key is just object identity). Without this, `scrollProps`/`refreshControlProps`
454
+ // handed a fresh `(event) => emitter.emit(event)` closure to the forwarded prop bag on every
455
+ // evaluation — the same jsonEqual/Object.is function-leaf problem as the arrow fields above, one
456
+ // level further removed. `.observed` is checked BEFORE the cache so an unbound event still
457
+ // resolves to `undefined` (the "nobody cares" contract `emitterCallback`'s own comment documents),
458
+ // not a stale cached wrapper from before the last subscriber unsubscribed.
459
+ private readonly emitterCallbackCache = new WeakMap<
460
+ EventEmitter<ISymbioteEvent>,
461
+ IScrollHandler
462
+ >();
463
+
464
+ // The sticky JS-path Animated.event handler depends on a REAL input (onScroll), so it can't be a
465
+ // plain stable field the way handleInvertedStickyLayout/handleContentLayout are — it must track
466
+ // `this.onScroll` genuinely changing, mirroring sticky-header.ts's own rebuildInterpolation cache
467
+ // (rebuild only when the tracked dependency's reference actually differs, not on every getter
468
+ // read). A fresh `animatedEvent(...)` call every `scrollProps` access would otherwise construct a
469
+ // new listener wrapper (and a new AnimatedEvent walking `collectMappedValues`) on every unrelated
470
+ // change-detection pass while sticky headers are active.
471
+ private cachedStickyOnScrollSource: IScrollHandler | undefined;
472
+ private cachedStickyOnScrollHandler: ((...args: readonly unknown[]) => void) | undefined;
473
+
474
+ get isHorizontal(): boolean {
475
+ const value = this.horizontal === true;
476
+ if (value !== this.lastLoggedIsHorizontal) {
477
+ this.lastLoggedIsHorizontal = value;
478
+ dlog(
479
+ `Angular ScrollView isHorizontal changed to ${value} (horizontal input=${this.horizontal})`,
480
+ );
481
+ }
482
+ return value;
483
+ }
484
+
485
+ private get hasStickyHeaders(): boolean {
486
+ return this.stickyHeaderIndices !== undefined && this.stickyHeaderIndices.length > 0;
487
+ }
488
+
489
+ // A class-name string resolves through the shared registry before it reaches
490
+ // selectScrollIntrinsics, which only understands style objects/arrays.
491
+ private get resolvedContentContainerStyle(): IStyleProp<IViewStyle> | undefined {
492
+ return typeof this.contentContainerStyle === 'string'
493
+ ? resolveClassName(this.contentContainerStyle)
494
+ : this.contentContainerStyle;
495
+ }
496
+
497
+ private get scrollViewBaseStyle(): IViewStyle {
498
+ return selectScrollIntrinsics(this.isHorizontal, this.resolvedContentContainerStyle)
499
+ .scrollViewBaseStyle;
500
+ }
501
+
502
+ // The forwarded host-prop bag for the scroll-view node: aria/role folded, the native pass-through
503
+ // families, the scroll-event callbacks, then the lifecycle-managed overrides (nestedScrollEnabled
504
+ // default ON, horizontal when defined, decelerationRate resolved per-platform, the sticky onScroll
505
+ // path). Base style UNDER user style so an explicit user value still wins. Mirrors Vue's outerProps
506
+ // + scrollProps assembly.
507
+ get scrollProps(): Record<string, unknown> {
508
+ const bag: Record<string, unknown> = compact({
509
+ ...resolveAccessibilityProps(this.accessibilityInputs()),
510
+ scrollEnabled: this.scrollEnabled,
511
+ showsVerticalScrollIndicator: this.showsVerticalScrollIndicator,
512
+ showsHorizontalScrollIndicator: this.showsHorizontalScrollIndicator,
513
+ pagingEnabled: this.pagingEnabled,
514
+ bounces: this.bounces,
515
+ contentInset: this.contentInset,
516
+ contentOffset: this.contentOffset,
517
+ removeClippedSubviews: this.removeClippedSubviews,
518
+ snapToInterval: this.snapToInterval,
519
+ snapToOffsets: this.snapToOffsets,
520
+ snapToAlignment: this.snapToAlignment,
521
+ snapToStart: this.snapToStart,
522
+ snapToEnd: this.snapToEnd,
523
+ disableIntervalMomentum: this.disableIntervalMomentum,
524
+ keyboardDismissMode: this.keyboardDismissMode,
525
+ keyboardShouldPersistTaps: this.keyboardShouldPersistTaps,
526
+ maintainVisibleContentPosition: this.maintainVisibleContentPosition,
527
+ alwaysBounceHorizontal: this.alwaysBounceHorizontal,
528
+ alwaysBounceVertical: this.alwaysBounceVertical,
529
+ centerContent: this.centerContent,
530
+ scrollIndicatorInsets: this.scrollIndicatorInsets,
531
+ indicatorStyle: this.indicatorStyle,
532
+ directionalLockEnabled: this.directionalLockEnabled,
533
+ automaticallyAdjustKeyboardInsets: this.automaticallyAdjustKeyboardInsets,
534
+ contentInsetAdjustmentBehavior: this.contentInsetAdjustmentBehavior,
535
+ minimumZoomScale: this.minimumZoomScale,
536
+ maximumZoomScale: this.maximumZoomScale,
537
+ zoomScale: this.zoomScale,
538
+ bouncesZoom: this.bouncesZoom,
539
+ pinchGestureEnabled: this.pinchGestureEnabled,
540
+ overScrollMode: this.overScrollMode,
541
+ fadingEdgeLength: this.fadingEdgeLength,
542
+ persistentScrollbar: this.persistentScrollbar,
543
+ endFillColor: this.endFillColor,
544
+ onScrollBeginDrag: this.onScrollBeginDrag,
545
+ onScrollEndDrag: this.onScrollEndDrag,
546
+ onMomentumScrollBegin: this.onMomentumScrollBegin,
547
+ onMomentumScrollEnd: this.onMomentumScrollEnd,
548
+ onScrollToTop: this.emitterCallback(this.scrollToTop),
549
+ onAccessibilityAction: this.emitterCallback(this.accessibilityAction),
550
+ onAccessibilityTap: this.emitterCallback(this.accessibilityTap),
551
+ onMagicTap: this.emitterCallback(this.magicTap),
552
+ onAccessibilityEscape: this.emitterCallback(this.accessibilityEscape),
553
+ });
554
+
555
+ // RN defaults nested scrolling ON (ScrollView.js `nestedScrollEnabled ?? true`); Android needs
556
+ // it to scroll a nested scrollable independently, iOS handles nesting natively (a no-op there).
557
+ bag.nestedScrollEnabled = this.nestedScrollEnabled ?? true;
558
+ // iOS needs `horizontal` to flip RCTScrollView's axis; Android's dedicated manager ignores it.
559
+ if (this.horizontal !== undefined) bag.horizontal = this.horizontal;
560
+ if (this.decelerationRate !== undefined) {
561
+ bag.decelerationRate = resolveDecelerationRate(this.decelerationRate);
562
+ }
563
+
564
+ // onScroll: when sticky headers are active, the offset must reach the AnimatedValue (RN
565
+ // _scrollAnimatedValueAttachment). With the native module, the value is driven on the UI thread
566
+ // by the post-commit attach below, so onScroll forwards to the user with throttle 1
567
+ // (ScrollView.js:1798). Without it, Animated.event drives the value each frame (the JS jitter)
568
+ // and forwards the user handler as the listener passthrough.
569
+ const nativeStickyAvailable = this.hasStickyHeaders && isNativeAnimatedAvailable();
570
+ if (this.hasStickyHeaders) {
571
+ if (nativeStickyAvailable) {
572
+ if (this.onScroll !== undefined) bag.onScroll = this.onScroll;
573
+ bag.scrollEventThrottle = this.scrollEventThrottle ?? 1;
574
+ } else {
575
+ bag.onScroll = this.stickyOnScrollHandler(this.onScroll);
576
+ bag.scrollEventThrottle = this.scrollEventThrottle ?? 16;
577
+ }
578
+ // Inverted sticky headers need the viewport height (RN _handleLayout): capture it on the
579
+ // scroll-view onLayout, then call the user's handler. Non-inverted forwards onLayout as-is.
580
+ if (this.invertStickyHeaders === true) {
581
+ bag.onLayout = this.handleInvertedStickyLayout;
582
+ } else {
583
+ const layoutCallback = this.emitterCallback(this.layout);
584
+ if (layoutCallback !== undefined) bag.onLayout = layoutCallback;
585
+ }
586
+ } else {
587
+ if (this.onScroll !== undefined) bag.onScroll = this.onScroll;
588
+ if (this.scrollEventThrottle !== undefined)
589
+ bag.scrollEventThrottle = this.scrollEventThrottle;
590
+ const layoutCallback = this.emitterCallback(this.layout);
591
+ if (layoutCallback !== undefined) bag.onLayout = layoutCallback;
592
+ }
593
+
594
+ dlog(
595
+ `Angular ScrollView -> ${this.isHorizontal ? 'horizontal' : 'vertical'} (sticky=${this.hasStickyHeaders})`,
596
+ );
597
+
598
+ bag.style = [this.scrollViewBaseStyle, this.style];
599
+ this.updateProjectionController();
600
+ return bag;
601
+ }
602
+
603
+ // Overridable hook, NOT `this.style` directly: `splitLayoutProps` below decides which layout
604
+ // properties (flex/height/gap/…) go on the Android outer refresh-control wrapper vs. the inner
605
+ // scroll view. `this.style` alone only ever carries the explicit `[style]` @Input — a composed
606
+ // component's OWN anchor host (see anchorHostStyle's doc comment in primitives/shared.ts) can
607
+ // hold ADDITIONAL class-derived layout style that's otherwise invisible to this split, so its
608
+ // wrapper never gets its needed layout (collapses to zero size — the Android outer wrapper
609
+ // shows literally nothing on screen). This mirrors the Vue adapter's identical
610
+ // `layoutSplitStyle` field and the real Android device bug it fixes; the Angular Android
611
+ // ScrollView (index.android.ts) overrides this to merge in `anchorHostStyle`. Default here is
612
+ // `this.style` alone, preserving current behavior for anything that doesn't override it.
613
+ protected get layoutSplitStyle(): IStyleProp<IViewStyle> {
614
+ return this.style;
615
+ }
616
+
617
+ get androidWrappedScrollProps(): Record<string, unknown> {
618
+ const props = { ...this.scrollProps };
619
+ const { inner, outer } = splitLayoutProps(this.layoutSplitStyle);
620
+ dlog(
621
+ `Angular ScrollView splitProbe layoutSplitStyle=${JSON.stringify(this.layoutSplitStyle)} ` +
622
+ `outer=${JSON.stringify(outer)} inner=${JSON.stringify(inner)}`,
623
+ );
624
+ props.style = [this.scrollViewBaseStyle, inner];
625
+ props.nestedScrollEnabled = true;
626
+ return props;
627
+ }
628
+
629
+ get iosRefreshControlProps(): Record<string, unknown> {
630
+ return this.refreshControlProps();
631
+ }
632
+
633
+ get androidRefreshControlProps(): Record<string, unknown> {
634
+ const { outer } = splitLayoutProps(this.layoutSplitStyle);
635
+ dlog(
636
+ `Angular ScrollView refreshControlProbe outer=${JSON.stringify(outer)} ` +
637
+ `hasRefresh=${this.projectedRefreshControl !== undefined}`,
638
+ );
639
+ return this.refreshControlProps(outer);
640
+ }
641
+
642
+ protected handleProjectedRefresh(nativeNode: unknown): void {
643
+ this.projectedRefreshControl?.handleRefresh(nativeNode);
644
+ }
645
+
646
+ private refreshControlProps(style?: IStyleProp<IViewStyle>): Record<string, unknown> {
647
+ const refresh = this.projectedRefreshControl;
648
+ if (refresh === undefined) return {};
649
+ return compact({
650
+ ...refresh.folded,
651
+ refreshing: refresh.refreshing,
652
+ tintColor: refresh.tintColor,
653
+ title: refresh.title,
654
+ titleColor: refresh.titleColor,
655
+ progressViewOffset: refresh.progressViewOffset,
656
+ colors: refresh.colors,
657
+ progressBackgroundColor: refresh.progressBackgroundColor,
658
+ size: refresh.size,
659
+ enabled: refresh.enabled,
660
+ style,
661
+ testID: refresh.testID,
662
+ nativeID: refresh.nativeID,
663
+ accessible: refresh.accessible,
664
+ onAccessibilityAction: this.emitterCallback(refresh.accessibilityAction),
665
+ onAccessibilityTap: this.emitterCallback(refresh.accessibilityTap),
666
+ onMagicTap: this.emitterCallback(refresh.magicTap),
667
+ onAccessibilityEscape: this.emitterCallback(refresh.accessibilityEscape),
668
+ });
669
+ }
670
+
671
+ get hasProjectedRefreshControl(): boolean {
672
+ return this.projectedRefreshControl !== undefined;
673
+ }
674
+
675
+ // The content (inner) view's prop bag. `collapsable: false` keeps the layout-only content view a
676
+ // real native view (Android Fabric view-flattens it away otherwise, hoisting cells as direct
677
+ // children of a scroll view that hosts exactly one — an addViewAt crash). collapsableChildren
678
+ // false preserves the cell views maintainVisibleContentPosition/snapToAlignment anchor against.
679
+ // onLayout synthesizes onContentSizeChange (deduped). iOS never flattens; both are no-ops there.
680
+ get contentProps(): Record<string, unknown> {
681
+ const { contentStyle } = selectScrollIntrinsics(
682
+ this.isHorizontal,
683
+ this.resolvedContentContainerStyle,
684
+ );
685
+ const bag: Record<string, unknown> = { style: contentStyle, collapsable: false };
686
+ if (this.maintainVisibleContentPosition !== undefined || this.snapToAlignment !== undefined) {
687
+ bag.collapsableChildren = false;
688
+ }
689
+ bag.onLayout = this.handleContentLayout;
690
+ return bag;
691
+ }
692
+
693
+ // Wraps an @Output() as a plain callback only while it has a subscriber, so an unbound event
694
+ // still leaves the forwarded prop bag key absent — the same "undefined means nobody cares"
695
+ // contract the old @Input() callbacks had. Mirrors Pressable's emitterHandler. The wrapper itself
696
+ // is memoized per emitter (emitterCallbackCache) rather than rebuilt on every call: see that
697
+ // field's comment for why an unstable closure here breaks the forwarded prop bag.
698
+ private emitterCallback(emitter: EventEmitter<ISymbioteEvent>): IScrollHandler | undefined {
699
+ if (!emitter.observed) return undefined;
700
+ let cached = this.emitterCallbackCache.get(emitter);
701
+ if (cached === undefined) {
702
+ cached = (event: ISymbioteEvent) => emitter.emit(event);
703
+ this.emitterCallbackCache.set(emitter, cached);
704
+ }
705
+ return cached;
706
+ }
707
+
708
+ // Rebuilds the JS-path Animated.event handler only when the tracked `onScroll` input actually
709
+ // changes reference (see cachedStickyOnScrollHandler's comment).
710
+ private stickyOnScrollHandler(
711
+ userOnScroll: IScrollHandler | undefined,
712
+ ): (...args: readonly unknown[]) => void {
713
+ if (
714
+ this.cachedStickyOnScrollHandler === undefined ||
715
+ this.cachedStickyOnScrollSource !== userOnScroll
716
+ ) {
717
+ this.cachedStickyOnScrollSource = userOnScroll;
718
+ this.cachedStickyOnScrollHandler = animatedEvent(
719
+ [{ nativeEvent: { contentOffset: { y: this.scrollAnimatedValue } } }],
720
+ userOnScroll === undefined
721
+ ? undefined
722
+ : { listener: (...args: readonly unknown[]) => forwardScrollEvent(userOnScroll, args) },
723
+ );
724
+ }
725
+ return this.cachedStickyOnScrollHandler;
726
+ }
727
+
728
+ // The committed scroll-view node held by IDENTITY (the directive's ElementRef). null until the
729
+ // element commits; the imperative handle and the sticky attach both read it through this getter.
730
+ private get hostNode(): ISymbioteNode | null {
731
+ const native = this.hostDirective?.node;
732
+ return isSymbioteNode(native) ? native : null;
733
+ }
734
+
735
+ // The imperative API a parent reaches via @ViewChild(ScrollView). buildScrollViewHandle is the
736
+ // shared, proven handle (React/Vue use it verbatim); it reads the node through the LAZY getter on
737
+ // every call, so a command before commit no-ops rather than freezing a null node (ADR 0024 §3).
738
+ private readonly handle: IScrollViewHandle = buildScrollViewHandle(() => this.hostNode);
739
+
740
+ scrollTo(options?: { x?: number; y?: number; animated?: boolean }): void {
741
+ this.handle.scrollTo(options);
742
+ }
743
+
744
+ scrollToEnd(options?: { animated?: boolean }): void {
745
+ this.handle.scrollToEnd(options);
746
+ }
747
+
748
+ flashScrollIndicators(): void {
749
+ this.handle.flashScrollIndicators();
750
+ }
751
+
752
+ getScrollNode(): ISymbioteNode | null {
753
+ return this.handle.getScrollNode();
754
+ }
755
+
756
+ ngAfterViewInit(): void {
757
+ this.updateProjectionController();
758
+ this.attachSticky();
759
+ }
760
+
761
+ // Wire the native sticky-scroll attach after the view exists. Re-attaches if the node identity
762
+ // changes; no-op when sticky is off or the native module is absent.
763
+ private attachSticky(): void {
764
+ this.cancelStickyBind?.();
765
+ this.cancelStickyBind = undefined;
766
+ if (this.detachStickyScroll !== undefined) {
767
+ this.detachStickyScroll();
768
+ this.detachStickyScroll = undefined;
769
+ }
770
+ if (!this.hasStickyHeaders || !isNativeAnimatedAvailable()) return;
771
+ const node = this.hostNode;
772
+ if (node === null) return;
773
+ this.cancelStickyBind = whenCommitted(node, () => {
774
+ this.detachStickyScroll = attachStickyScroll(node, this.scrollAnimatedValue);
775
+ });
776
+ }
777
+
778
+ ngOnDestroy(): void {
779
+ this.cancelStickyBind?.();
780
+ this.cancelStickyBind = undefined;
781
+ if (this.detachStickyScroll !== undefined) this.detachStickyScroll();
782
+ }
783
+
784
+ private updateProjectionController(): void {
785
+ this.projectionController.update({
786
+ stickyHeaderIndices: this.stickyHeaderIndices,
787
+ invertStickyHeaders: this.invertStickyHeaders,
788
+ scrollViewHeight: this.viewportHeight,
789
+ scrollAnimatedValue: this.scrollAnimatedValue,
790
+ customStickyHeaderComponent: this.StickyHeaderComponent,
791
+ excludeRefreshControl: this.hasProjectedRefreshControl,
792
+ });
793
+ }
794
+
795
+ // Typed as the a11y intersection WITH the string index so resolveAccessibilityProps's result
796
+ // stays assignable into the forwarded bag (a genuine narrowing, built at that type — no cast).
797
+ private accessibilityInputs(): IAccessibilityProps & IAriaProps & Record<string, unknown> {
798
+ return {
799
+ testID: this.testID,
800
+ nativeID: this.nativeID,
801
+ accessible: this.accessible,
802
+ accessibilityLabel: this.accessibilityLabel,
803
+ accessibilityHint: this.accessibilityHint,
804
+ accessibilityRole: this.accessibilityRole,
805
+ accessibilityState: this.accessibilityState,
806
+ accessibilityValue: this.accessibilityValue,
807
+ accessibilityActions: this.accessibilityActions,
808
+ accessibilityLabelledBy: this.accessibilityLabelledBy,
809
+ importantForAccessibility: this.importantForAccessibility,
810
+ accessibilityLiveRegion: this.accessibilityLiveRegion,
811
+ screenReaderFocusable: this.screenReaderFocusable,
812
+ accessibilityViewIsModal: this.accessibilityViewIsModal,
813
+ accessibilityElementsHidden: this.accessibilityElementsHidden,
814
+ accessibilityIgnoresInvertColors: this.accessibilityIgnoresInvertColors,
815
+ accessibilityLanguage: this.accessibilityLanguage,
816
+ accessibilityRespondsToUserInteraction: this.accessibilityRespondsToUserInteraction,
817
+ accessibilityShowsLargeContentViewer: this.accessibilityShowsLargeContentViewer,
818
+ accessibilityLargeContentTitle: this.accessibilityLargeContentTitle,
819
+ role: this.role,
820
+ 'aria-label': this['aria-label'],
821
+ 'aria-labelledby': this['aria-labelledby'],
822
+ 'aria-live': this['aria-live'],
823
+ 'aria-hidden': this['aria-hidden'],
824
+ 'aria-busy': this['aria-busy'],
825
+ 'aria-checked': this['aria-checked'],
826
+ 'aria-disabled': this['aria-disabled'],
827
+ 'aria-expanded': this['aria-expanded'],
828
+ 'aria-selected': this['aria-selected'],
829
+ 'aria-modal': this['aria-modal'],
830
+ 'aria-valuemax': this['aria-valuemax'],
831
+ 'aria-valuemin': this['aria-valuemin'],
832
+ 'aria-valuenow': this['aria-valuenow'],
833
+ 'aria-valuetext': this['aria-valuetext'],
834
+ };
835
+ }
836
+ }