@despia-native/kernel 0.0.0-stage → 0.3.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 (661) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +1414 -0
  3. package/README.md +17 -2
  4. package/dist/.dsx-build-stamp.json +7 -0
  5. package/dist/api-cohort.d.ts +27 -0
  6. package/dist/api-cohort.d.ts.map +1 -0
  7. package/dist/api-cohort.js +94 -0
  8. package/dist/api-cohort.js.map +1 -0
  9. package/dist/api.d.ts +454 -0
  10. package/dist/api.d.ts.map +1 -0
  11. package/dist/api.js +2442 -0
  12. package/dist/api.js.map +1 -0
  13. package/dist/app-consts.d.ts +10 -0
  14. package/dist/app-consts.d.ts.map +1 -0
  15. package/dist/app-consts.js +39 -0
  16. package/dist/app-consts.js.map +1 -0
  17. package/dist/app-update.d.ts +12 -0
  18. package/dist/app-update.d.ts.map +1 -0
  19. package/dist/app-update.js +32 -0
  20. package/dist/app-update.js.map +1 -0
  21. package/dist/aria.d.ts +152 -0
  22. package/dist/aria.d.ts.map +1 -0
  23. package/dist/aria.js +524 -0
  24. package/dist/aria.js.map +1 -0
  25. package/dist/audio-core.d.ts +260 -0
  26. package/dist/audio-core.d.ts.map +1 -0
  27. package/dist/audio-core.js +1440 -0
  28. package/dist/audio-core.js.map +1 -0
  29. package/dist/audio-edit.d.ts +100 -0
  30. package/dist/audio-edit.d.ts.map +1 -0
  31. package/dist/audio-edit.js +489 -0
  32. package/dist/audio-edit.js.map +1 -0
  33. package/dist/audio-mix.d.ts +84 -0
  34. package/dist/audio-mix.d.ts.map +1 -0
  35. package/dist/audio-mix.js +393 -0
  36. package/dist/audio-mix.js.map +1 -0
  37. package/dist/auth-proof.d.ts +145 -0
  38. package/dist/auth-proof.d.ts.map +1 -0
  39. package/dist/auth-proof.js +644 -0
  40. package/dist/auth-proof.js.map +1 -0
  41. package/dist/availability-explain.d.ts +3 -0
  42. package/dist/availability-explain.d.ts.map +1 -0
  43. package/dist/availability-explain.js +322 -0
  44. package/dist/availability-explain.js.map +1 -0
  45. package/dist/availability.d.ts +246 -0
  46. package/dist/availability.d.ts.map +1 -0
  47. package/dist/availability.js +615 -0
  48. package/dist/availability.js.map +1 -0
  49. package/dist/background.d.ts +116 -0
  50. package/dist/background.d.ts.map +1 -0
  51. package/dist/background.js +235 -0
  52. package/dist/background.js.map +1 -0
  53. package/dist/boot-tables-flag.d.ts +2 -0
  54. package/dist/boot-tables-flag.d.ts.map +1 -0
  55. package/dist/boot-tables-flag.js +16 -0
  56. package/dist/boot-tables-flag.js.map +1 -0
  57. package/dist/boot-tables.d.ts +40 -0
  58. package/dist/boot-tables.d.ts.map +1 -0
  59. package/dist/boot-tables.js +102 -0
  60. package/dist/boot-tables.js.map +1 -0
  61. package/dist/border-edges.d.ts +5 -0
  62. package/dist/border-edges.d.ts.map +1 -0
  63. package/dist/border-edges.js +47 -0
  64. package/dist/border-edges.js.map +1 -0
  65. package/dist/bus.d.ts +1203 -0
  66. package/dist/bus.d.ts.map +1 -0
  67. package/dist/bus.js +2647 -0
  68. package/dist/bus.js.map +1 -0
  69. package/dist/calendar-core.d.ts +143 -0
  70. package/dist/calendar-core.d.ts.map +1 -0
  71. package/dist/calendar-core.js +372 -0
  72. package/dist/calendar-core.js.map +1 -0
  73. package/dist/call-value.d.ts +16 -0
  74. package/dist/call-value.d.ts.map +1 -0
  75. package/dist/call-value.js +54 -0
  76. package/dist/call-value.js.map +1 -0
  77. package/dist/camera-core.d.ts +222 -0
  78. package/dist/camera-core.d.ts.map +1 -0
  79. package/dist/camera-core.js +980 -0
  80. package/dist/camera-core.js.map +1 -0
  81. package/dist/canvas-core.d.ts +404 -0
  82. package/dist/canvas-core.d.ts.map +1 -0
  83. package/dist/canvas-core.js +2186 -0
  84. package/dist/canvas-core.js.map +1 -0
  85. package/dist/capture-core.d.ts +74 -0
  86. package/dist/capture-core.d.ts.map +1 -0
  87. package/dist/capture-core.js +158 -0
  88. package/dist/capture-core.js.map +1 -0
  89. package/dist/compile/codegen.d.ts +146 -0
  90. package/dist/compile/codegen.d.ts.map +1 -0
  91. package/dist/compile/codegen.js +1949 -0
  92. package/dist/compile/codegen.js.map +1 -0
  93. package/dist/compile/jstier.d.ts +44 -0
  94. package/dist/compile/jstier.d.ts.map +1 -0
  95. package/dist/compile/jstier.js +181 -0
  96. package/dist/compile/jstier.js.map +1 -0
  97. package/dist/compile/tier-door.d.ts +41 -0
  98. package/dist/compile/tier-door.d.ts.map +1 -0
  99. package/dist/compile/tier-door.js +167 -0
  100. package/dist/compile/tier-door.js.map +1 -0
  101. package/dist/compile/tier-realm.d.ts +49 -0
  102. package/dist/compile/tier-realm.d.ts.map +1 -0
  103. package/dist/compile/tier-realm.js +368 -0
  104. package/dist/compile/tier-realm.js.map +1 -0
  105. package/dist/compile/tier.d.ts +23 -0
  106. package/dist/compile/tier.d.ts.map +1 -0
  107. package/dist/compile/tier.js +157 -0
  108. package/dist/compile/tier.js.map +1 -0
  109. package/dist/compose-core.d.ts +86 -0
  110. package/dist/compose-core.d.ts.map +1 -0
  111. package/dist/compose-core.js +112 -0
  112. package/dist/compose-core.js.map +1 -0
  113. package/dist/config-validate.d.ts +31 -0
  114. package/dist/config-validate.d.ts.map +1 -0
  115. package/dist/config-validate.js +147 -0
  116. package/dist/config-validate.js.map +1 -0
  117. package/dist/config-values.d.ts +106 -0
  118. package/dist/config-values.d.ts.map +1 -0
  119. package/dist/config-values.js +340 -0
  120. package/dist/config-values.js.map +1 -0
  121. package/dist/contacts-core.d.ts +127 -0
  122. package/dist/contacts-core.d.ts.map +1 -0
  123. package/dist/contacts-core.js +211 -0
  124. package/dist/contacts-core.js.map +1 -0
  125. package/dist/content-transition.d.ts +58 -0
  126. package/dist/content-transition.d.ts.map +1 -0
  127. package/dist/content-transition.js +94 -0
  128. package/dist/content-transition.js.map +1 -0
  129. package/dist/controls-core.d.ts +227 -0
  130. package/dist/controls-core.d.ts.map +1 -0
  131. package/dist/controls-core.js +652 -0
  132. package/dist/controls-core.js.map +1 -0
  133. package/dist/cookies.d.ts +78 -0
  134. package/dist/cookies.d.ts.map +1 -0
  135. package/dist/cookies.js +265 -0
  136. package/dist/cookies.js.map +1 -0
  137. package/dist/corner-shape-core.d.ts +69 -0
  138. package/dist/corner-shape-core.d.ts.map +1 -0
  139. package/dist/corner-shape-core.js +261 -0
  140. package/dist/corner-shape-core.js.map +1 -0
  141. package/dist/crypto-core.d.ts +57 -0
  142. package/dist/crypto-core.d.ts.map +1 -0
  143. package/dist/crypto-core.js +128 -0
  144. package/dist/crypto-core.js.map +1 -0
  145. package/dist/dataviz.d.ts +436 -0
  146. package/dist/dataviz.d.ts.map +1 -0
  147. package/dist/dataviz.js +956 -0
  148. package/dist/dataviz.js.map +1 -0
  149. package/dist/debug.d.ts +293 -0
  150. package/dist/debug.d.ts.map +1 -0
  151. package/dist/debug.js +767 -0
  152. package/dist/debug.js.map +1 -0
  153. package/dist/device-ownership.d.ts +50 -0
  154. package/dist/device-ownership.d.ts.map +1 -0
  155. package/dist/device-ownership.js +105 -0
  156. package/dist/device-ownership.js.map +1 -0
  157. package/dist/effects.d.ts +86 -0
  158. package/dist/effects.d.ts.map +1 -0
  159. package/dist/effects.js +98 -0
  160. package/dist/effects.js.map +1 -0
  161. package/dist/element.d.ts +108 -0
  162. package/dist/element.d.ts.map +1 -0
  163. package/dist/element.js +63 -0
  164. package/dist/element.js.map +1 -0
  165. package/dist/file-watch.d.ts +16 -0
  166. package/dist/file-watch.d.ts.map +1 -0
  167. package/dist/file-watch.js +49 -0
  168. package/dist/file-watch.js.map +1 -0
  169. package/dist/filepaths.d.ts +72 -0
  170. package/dist/filepaths.d.ts.map +1 -0
  171. package/dist/filepaths.js +271 -0
  172. package/dist/filepaths.js.map +1 -0
  173. package/dist/film.d.ts +264 -0
  174. package/dist/film.d.ts.map +1 -0
  175. package/dist/film.js +313 -0
  176. package/dist/film.js.map +1 -0
  177. package/dist/fonts.d.ts +66 -0
  178. package/dist/fonts.d.ts.map +1 -0
  179. package/dist/fonts.js +135 -0
  180. package/dist/fonts.js.map +1 -0
  181. package/dist/forms.d.ts +191 -0
  182. package/dist/forms.d.ts.map +1 -0
  183. package/dist/forms.js +663 -0
  184. package/dist/forms.js.map +1 -0
  185. package/dist/geo.d.ts +289 -0
  186. package/dist/geo.d.ts.map +1 -0
  187. package/dist/geo.js +460 -0
  188. package/dist/geo.js.map +1 -0
  189. package/dist/handler-announce.d.ts +46 -0
  190. package/dist/handler-announce.d.ts.map +1 -0
  191. package/dist/handler-announce.js +96 -0
  192. package/dist/handler-announce.js.map +1 -0
  193. package/dist/handoff.d.ts +71 -0
  194. package/dist/handoff.d.ts.map +1 -0
  195. package/dist/handoff.js +250 -0
  196. package/dist/handoff.js.map +1 -0
  197. package/dist/identity-durability.d.ts +76 -0
  198. package/dist/identity-durability.d.ts.map +1 -0
  199. package/dist/identity-durability.js +150 -0
  200. package/dist/identity-durability.js.map +1 -0
  201. package/dist/image-core.d.ts +240 -0
  202. package/dist/image-core.d.ts.map +1 -0
  203. package/dist/image-core.js +618 -0
  204. package/dist/image-core.js.map +1 -0
  205. package/dist/image-schemes.d.ts +10 -0
  206. package/dist/image-schemes.d.ts.map +1 -0
  207. package/dist/image-schemes.js +28 -0
  208. package/dist/image-schemes.js.map +1 -0
  209. package/dist/index.d.ts +143 -0
  210. package/dist/index.d.ts.map +1 -0
  211. package/dist/index.js +299 -0
  212. package/dist/index.js.map +1 -0
  213. package/dist/ink-core.d.ts +53 -0
  214. package/dist/ink-core.d.ts.map +1 -0
  215. package/dist/ink-core.js +119 -0
  216. package/dist/ink-core.js.map +1 -0
  217. package/dist/input.d.ts +148 -0
  218. package/dist/input.d.ts.map +1 -0
  219. package/dist/input.js +358 -0
  220. package/dist/input.js.map +1 -0
  221. package/dist/integrity.d.ts +63 -0
  222. package/dist/integrity.d.ts.map +1 -0
  223. package/dist/integrity.js +150 -0
  224. package/dist/integrity.js.map +1 -0
  225. package/dist/intents.d.ts +95 -0
  226. package/dist/intents.d.ts.map +1 -0
  227. package/dist/intents.js +282 -0
  228. package/dist/intents.js.map +1 -0
  229. package/dist/interpolate-core.d.ts +37 -0
  230. package/dist/interpolate-core.d.ts.map +1 -0
  231. package/dist/interpolate-core.js +443 -0
  232. package/dist/interpolate-core.js.map +1 -0
  233. package/dist/jse/color.d.ts +12 -0
  234. package/dist/jse/color.d.ts.map +1 -0
  235. package/dist/jse/color.js +196 -0
  236. package/dist/jse/color.js.map +1 -0
  237. package/dist/jse/core.d.ts +54 -0
  238. package/dist/jse/core.d.ts.map +1 -0
  239. package/dist/jse/core.js +1519 -0
  240. package/dist/jse/core.js.map +1 -0
  241. package/dist/jse/dispatch.d.ts +28 -0
  242. package/dist/jse/dispatch.d.ts.map +1 -0
  243. package/dist/jse/dispatch.js +116 -0
  244. package/dist/jse/dispatch.js.map +1 -0
  245. package/dist/jse/highlight-grammar.d.ts +15 -0
  246. package/dist/jse/highlight-grammar.d.ts.map +1 -0
  247. package/dist/jse/highlight-grammar.js +161 -0
  248. package/dist/jse/highlight-grammar.js.map +1 -0
  249. package/dist/jse/highlight-grammars.generated.d.ts +2 -0
  250. package/dist/jse/highlight-grammars.generated.d.ts.map +1 -0
  251. package/dist/jse/highlight-grammars.generated.js +4 -0
  252. package/dist/jse/highlight-grammars.generated.js.map +1 -0
  253. package/dist/jse/highlight.d.ts +37 -0
  254. package/dist/jse/highlight.d.ts.map +1 -0
  255. package/dist/jse/highlight.js +323 -0
  256. package/dist/jse/highlight.js.map +1 -0
  257. package/dist/jse/jse.d.ts +674 -0
  258. package/dist/jse/jse.d.ts.map +1 -0
  259. package/dist/jse/jse.js +5841 -0
  260. package/dist/jse/jse.js.map +1 -0
  261. package/dist/jse/pathmatch.d.ts +10 -0
  262. package/dist/jse/pathmatch.d.ts.map +1 -0
  263. package/dist/jse/pathmatch.js +73 -0
  264. package/dist/jse/pathmatch.js.map +1 -0
  265. package/dist/jse/regex.d.ts +33 -0
  266. package/dist/jse/regex.d.ts.map +1 -0
  267. package/dist/jse/regex.js +375 -0
  268. package/dist/jse/regex.js.map +1 -0
  269. package/dist/jse/stdlib.d.ts +8 -0
  270. package/dist/jse/stdlib.d.ts.map +1 -0
  271. package/dist/jse/stdlib.js +765 -0
  272. package/dist/jse/stdlib.js.map +1 -0
  273. package/dist/jse/tokens.d.ts +102 -0
  274. package/dist/jse/tokens.d.ts.map +1 -0
  275. package/dist/jse/tokens.js +982 -0
  276. package/dist/jse/tokens.js.map +1 -0
  277. package/dist/jse/values.d.ts +206 -0
  278. package/dist/jse/values.d.ts.map +1 -0
  279. package/dist/jse/values.js +846 -0
  280. package/dist/jse/values.js.map +1 -0
  281. package/dist/keyboard.d.ts +196 -0
  282. package/dist/keyboard.d.ts.map +1 -0
  283. package/dist/keyboard.js +186 -0
  284. package/dist/keyboard.js.map +1 -0
  285. package/dist/label-choices.d.ts +3 -0
  286. package/dist/label-choices.d.ts.map +1 -0
  287. package/dist/label-choices.js +168 -0
  288. package/dist/label-choices.js.map +1 -0
  289. package/dist/language.d.ts +33 -0
  290. package/dist/language.d.ts.map +1 -0
  291. package/dist/language.js +50 -0
  292. package/dist/language.js.map +1 -0
  293. package/dist/length-units.d.ts +30 -0
  294. package/dist/length-units.d.ts.map +1 -0
  295. package/dist/length-units.js +83 -0
  296. package/dist/length-units.js.map +1 -0
  297. package/dist/lightsensor.d.ts +48 -0
  298. package/dist/lightsensor.d.ts.map +1 -0
  299. package/dist/lightsensor.js +97 -0
  300. package/dist/lightsensor.js.map +1 -0
  301. package/dist/link-refresh.d.ts +27 -0
  302. package/dist/link-refresh.d.ts.map +1 -0
  303. package/dist/link-refresh.js +166 -0
  304. package/dist/link-refresh.js.map +1 -0
  305. package/dist/link.d.ts +57 -0
  306. package/dist/link.d.ts.map +1 -0
  307. package/dist/link.js +333 -0
  308. package/dist/link.js.map +1 -0
  309. package/dist/linkpreview.d.ts +114 -0
  310. package/dist/linkpreview.d.ts.map +1 -0
  311. package/dist/linkpreview.js +439 -0
  312. package/dist/linkpreview.js.map +1 -0
  313. package/dist/list-presence.d.ts +32 -0
  314. package/dist/list-presence.d.ts.map +1 -0
  315. package/dist/list-presence.js +48 -0
  316. package/dist/list-presence.js.map +1 -0
  317. package/dist/live-stream.d.ts +27 -0
  318. package/dist/live-stream.d.ts.map +1 -0
  319. package/dist/live-stream.js +274 -0
  320. package/dist/live-stream.js.map +1 -0
  321. package/dist/livelogs.d.ts +134 -0
  322. package/dist/livelogs.d.ts.map +1 -0
  323. package/dist/livelogs.js +409 -0
  324. package/dist/livelogs.js.map +1 -0
  325. package/dist/logs.d.ts +80 -0
  326. package/dist/logs.d.ts.map +1 -0
  327. package/dist/logs.js +206 -0
  328. package/dist/logs.js.map +1 -0
  329. package/dist/mcp/apps.d.ts +82 -0
  330. package/dist/mcp/apps.d.ts.map +1 -0
  331. package/dist/mcp/apps.js +219 -0
  332. package/dist/mcp/apps.js.map +1 -0
  333. package/dist/mcp/entities.d.ts +25 -0
  334. package/dist/mcp/entities.d.ts.map +1 -0
  335. package/dist/mcp/entities.js +71 -0
  336. package/dist/mcp/entities.js.map +1 -0
  337. package/dist/mcp/result.d.ts +73 -0
  338. package/dist/mcp/result.d.ts.map +1 -0
  339. package/dist/mcp/result.js +119 -0
  340. package/dist/mcp/result.js.map +1 -0
  341. package/dist/mcp/webmcp.d.ts +162 -0
  342. package/dist/mcp/webmcp.d.ts.map +1 -0
  343. package/dist/mcp/webmcp.js +214 -0
  344. package/dist/mcp/webmcp.js.map +1 -0
  345. package/dist/mcp.d.ts +5 -0
  346. package/dist/mcp.d.ts.map +1 -0
  347. package/dist/mcp.js +14 -0
  348. package/dist/mcp.js.map +1 -0
  349. package/dist/media-core.d.ts +191 -0
  350. package/dist/media-core.d.ts.map +1 -0
  351. package/dist/media-core.js +446 -0
  352. package/dist/media-core.js.map +1 -0
  353. package/dist/media-timeline-core.d.ts +94 -0
  354. package/dist/media-timeline-core.d.ts.map +1 -0
  355. package/dist/media-timeline-core.js +620 -0
  356. package/dist/media-timeline-core.js.map +1 -0
  357. package/dist/message.d.ts +42 -0
  358. package/dist/message.d.ts.map +1 -0
  359. package/dist/message.js +582 -0
  360. package/dist/message.js.map +1 -0
  361. package/dist/missing-element.d.ts +29 -0
  362. package/dist/missing-element.d.ts.map +1 -0
  363. package/dist/missing-element.js +76 -0
  364. package/dist/missing-element.js.map +1 -0
  365. package/dist/motion-core.d.ts +160 -0
  366. package/dist/motion-core.d.ts.map +1 -0
  367. package/dist/motion-core.js +752 -0
  368. package/dist/motion-core.js.map +1 -0
  369. package/dist/motion-pose.d.ts +65 -0
  370. package/dist/motion-pose.d.ts.map +1 -0
  371. package/dist/motion-pose.js +143 -0
  372. package/dist/motion-pose.js.map +1 -0
  373. package/dist/motion.d.ts +132 -0
  374. package/dist/motion.d.ts.map +1 -0
  375. package/dist/motion.js +260 -0
  376. package/dist/motion.js.map +1 -0
  377. package/dist/mount-core.d.ts +203 -0
  378. package/dist/mount-core.d.ts.map +1 -0
  379. package/dist/mount-core.js +437 -0
  380. package/dist/mount-core.js.map +1 -0
  381. package/dist/net-core.d.ts +110 -0
  382. package/dist/net-core.d.ts.map +1 -0
  383. package/dist/net-core.js +225 -0
  384. package/dist/net-core.js.map +1 -0
  385. package/dist/notify.d.ts +399 -0
  386. package/dist/notify.d.ts.map +1 -0
  387. package/dist/notify.js +964 -0
  388. package/dist/notify.js.map +1 -0
  389. package/dist/orientation-binding.d.ts +39 -0
  390. package/dist/orientation-binding.d.ts.map +1 -0
  391. package/dist/orientation-binding.js +64 -0
  392. package/dist/orientation-binding.js.map +1 -0
  393. package/dist/orientation.d.ts +55 -0
  394. package/dist/orientation.d.ts.map +1 -0
  395. package/dist/orientation.js +89 -0
  396. package/dist/orientation.js.map +1 -0
  397. package/dist/ota.d.ts +52 -0
  398. package/dist/ota.d.ts.map +1 -0
  399. package/dist/ota.js +122 -0
  400. package/dist/ota.js.map +1 -0
  401. package/dist/passkeys.d.ts +91 -0
  402. package/dist/passkeys.d.ts.map +1 -0
  403. package/dist/passkeys.js +307 -0
  404. package/dist/passkeys.js.map +1 -0
  405. package/dist/payment.d.ts +85 -0
  406. package/dist/payment.d.ts.map +1 -0
  407. package/dist/payment.js +270 -0
  408. package/dist/payment.js.map +1 -0
  409. package/dist/pending-presenter.d.ts +31 -0
  410. package/dist/pending-presenter.d.ts.map +1 -0
  411. package/dist/pending-presenter.js +119 -0
  412. package/dist/pending-presenter.js.map +1 -0
  413. package/dist/permission-core.d.ts +59 -0
  414. package/dist/permission-core.d.ts.map +1 -0
  415. package/dist/permission-core.js +102 -0
  416. package/dist/permission-core.js.map +1 -0
  417. package/dist/persist.d.ts +169 -0
  418. package/dist/persist.d.ts.map +1 -0
  419. package/dist/persist.js +361 -0
  420. package/dist/persist.js.map +1 -0
  421. package/dist/phase-plan.d.ts +114 -0
  422. package/dist/phase-plan.d.ts.map +1 -0
  423. package/dist/phase-plan.js +837 -0
  424. package/dist/phase-plan.js.map +1 -0
  425. package/dist/playback-core.d.ts +64 -0
  426. package/dist/playback-core.d.ts.map +1 -0
  427. package/dist/playback-core.js +176 -0
  428. package/dist/playback-core.js.map +1 -0
  429. package/dist/player-sources.d.ts +12 -0
  430. package/dist/player-sources.d.ts.map +1 -0
  431. package/dist/player-sources.js +44 -0
  432. package/dist/player-sources.js.map +1 -0
  433. package/dist/proxy-denylist.d.ts +11 -0
  434. package/dist/proxy-denylist.d.ts.map +1 -0
  435. package/dist/proxy-denylist.js +44 -0
  436. package/dist/proxy-denylist.js.map +1 -0
  437. package/dist/public-config.d.ts +20 -0
  438. package/dist/public-config.d.ts.map +1 -0
  439. package/dist/public-config.js +109 -0
  440. package/dist/public-config.js.map +1 -0
  441. package/dist/qoe-core.d.ts +72 -0
  442. package/dist/qoe-core.d.ts.map +1 -0
  443. package/dist/qoe-core.js +113 -0
  444. package/dist/qoe-core.js.map +1 -0
  445. package/dist/reactive-request.d.ts +80 -0
  446. package/dist/reactive-request.d.ts.map +1 -0
  447. package/dist/reactive-request.js +192 -0
  448. package/dist/reactive-request.js.map +1 -0
  449. package/dist/read-cache.d.ts +129 -0
  450. package/dist/read-cache.d.ts.map +1 -0
  451. package/dist/read-cache.js +566 -0
  452. package/dist/read-cache.js.map +1 -0
  453. package/dist/recorder-core.d.ts +57 -0
  454. package/dist/recorder-core.d.ts.map +1 -0
  455. package/dist/recorder-core.js +136 -0
  456. package/dist/recorder-core.js.map +1 -0
  457. package/dist/ref.d.ts +41 -0
  458. package/dist/ref.d.ts.map +1 -0
  459. package/dist/ref.js +98 -0
  460. package/dist/ref.js.map +1 -0
  461. package/dist/refusal.d.ts +82 -0
  462. package/dist/refusal.d.ts.map +1 -0
  463. package/dist/refusal.js +218 -0
  464. package/dist/refusal.js.map +1 -0
  465. package/dist/region-insets.d.ts +61 -0
  466. package/dist/region-insets.d.ts.map +1 -0
  467. package/dist/region-insets.js +67 -0
  468. package/dist/region-insets.js.map +1 -0
  469. package/dist/rive-core.d.ts +323 -0
  470. package/dist/rive-core.d.ts.map +1 -0
  471. package/dist/rive-core.js +677 -0
  472. package/dist/rive-core.js.map +1 -0
  473. package/dist/runner.d.ts +595 -0
  474. package/dist/runner.d.ts.map +1 -0
  475. package/dist/runner.js +4094 -0
  476. package/dist/runner.js.map +1 -0
  477. package/dist/scene/a11y.d.ts +11 -0
  478. package/dist/scene/a11y.d.ts.map +1 -0
  479. package/dist/scene/a11y.js +67 -0
  480. package/dist/scene/a11y.js.map +1 -0
  481. package/dist/scene/anim.d.ts +149 -0
  482. package/dist/scene/anim.d.ts.map +1 -0
  483. package/dist/scene/anim.js +396 -0
  484. package/dist/scene/anim.js.map +1 -0
  485. package/dist/scene/bind.d.ts +33 -0
  486. package/dist/scene/bind.d.ts.map +1 -0
  487. package/dist/scene/bind.js +66 -0
  488. package/dist/scene/bind.js.map +1 -0
  489. package/dist/scene/collide.d.ts +56 -0
  490. package/dist/scene/collide.d.ts.map +1 -0
  491. package/dist/scene/collide.js +146 -0
  492. package/dist/scene/collide.js.map +1 -0
  493. package/dist/scene/frame.d.ts +22 -0
  494. package/dist/scene/frame.d.ts.map +1 -0
  495. package/dist/scene/frame.js +57 -0
  496. package/dist/scene/frame.js.map +1 -0
  497. package/dist/scene/gltf.d.ts +79 -0
  498. package/dist/scene/gltf.d.ts.map +1 -0
  499. package/dist/scene/gltf.js +409 -0
  500. package/dist/scene/gltf.js.map +1 -0
  501. package/dist/scene/ir.d.ts +293 -0
  502. package/dist/scene/ir.d.ts.map +1 -0
  503. package/dist/scene/ir.js +692 -0
  504. package/dist/scene/ir.js.map +1 -0
  505. package/dist/scene/math.d.ts +50 -0
  506. package/dist/scene/math.d.ts.map +1 -0
  507. package/dist/scene/math.js +180 -0
  508. package/dist/scene/math.js.map +1 -0
  509. package/dist/scene/orbit.d.ts +19 -0
  510. package/dist/scene/orbit.d.ts.map +1 -0
  511. package/dist/scene/orbit.js +60 -0
  512. package/dist/scene/orbit.js.map +1 -0
  513. package/dist/scene/physics.d.ts +228 -0
  514. package/dist/scene/physics.d.ts.map +1 -0
  515. package/dist/scene/physics.js +1500 -0
  516. package/dist/scene/physics.js.map +1 -0
  517. package/dist/scene/registry.d.ts +85 -0
  518. package/dist/scene/registry.d.ts.map +1 -0
  519. package/dist/scene/registry.js +75 -0
  520. package/dist/scene/registry.js.map +1 -0
  521. package/dist/scene/skin.d.ts +82 -0
  522. package/dist/scene/skin.d.ts.map +1 -0
  523. package/dist/scene/skin.js +351 -0
  524. package/dist/scene/skin.js.map +1 -0
  525. package/dist/scene/sprite.d.ts +36 -0
  526. package/dist/scene/sprite.d.ts.map +1 -0
  527. package/dist/scene/sprite.js +107 -0
  528. package/dist/scene/sprite.js.map +1 -0
  529. package/dist/scene/viewer.d.ts +96 -0
  530. package/dist/scene/viewer.d.ts.map +1 -0
  531. package/dist/scene/viewer.js +235 -0
  532. package/dist/scene/viewer.js.map +1 -0
  533. package/dist/scoped-slots.d.ts +9 -0
  534. package/dist/scoped-slots.d.ts.map +1 -0
  535. package/dist/scoped-slots.js +42 -0
  536. package/dist/scoped-slots.js.map +1 -0
  537. package/dist/screen.d.ts +109 -0
  538. package/dist/screen.d.ts.map +1 -0
  539. package/dist/screen.js +309 -0
  540. package/dist/screen.js.map +1 -0
  541. package/dist/scroll.d.ts +525 -0
  542. package/dist/scroll.d.ts.map +1 -0
  543. package/dist/scroll.js +1226 -0
  544. package/dist/scroll.js.map +1 -0
  545. package/dist/settings-plane.d.ts +58 -0
  546. package/dist/settings-plane.d.ts.map +1 -0
  547. package/dist/settings-plane.js +86 -0
  548. package/dist/settings-plane.js.map +1 -0
  549. package/dist/share-inbox.d.ts +56 -0
  550. package/dist/share-inbox.d.ts.map +1 -0
  551. package/dist/share-inbox.js +114 -0
  552. package/dist/share-inbox.js.map +1 -0
  553. package/dist/shared-transition.d.ts +152 -0
  554. package/dist/shared-transition.d.ts.map +1 -0
  555. package/dist/shared-transition.js +257 -0
  556. package/dist/shared-transition.js.map +1 -0
  557. package/dist/sheet-content-padding.d.ts +24 -0
  558. package/dist/sheet-content-padding.d.ts.map +1 -0
  559. package/dist/sheet-content-padding.js +32 -0
  560. package/dist/sheet-content-padding.js.map +1 -0
  561. package/dist/shot-devices.d.ts +36 -0
  562. package/dist/shot-devices.d.ts.map +1 -0
  563. package/dist/shot-devices.js +90 -0
  564. package/dist/shot-devices.js.map +1 -0
  565. package/dist/shot-guards.d.ts +100 -0
  566. package/dist/shot-guards.d.ts.map +1 -0
  567. package/dist/shot-guards.js +260 -0
  568. package/dist/shot-guards.js.map +1 -0
  569. package/dist/shot-scope.d.ts +140 -0
  570. package/dist/shot-scope.d.ts.map +1 -0
  571. package/dist/shot-scope.js +302 -0
  572. package/dist/shot-scope.js.map +1 -0
  573. package/dist/slot-partition.d.ts +9 -0
  574. package/dist/slot-partition.d.ts.map +1 -0
  575. package/dist/slot-partition.js +38 -0
  576. package/dist/slot-partition.js.map +1 -0
  577. package/dist/snackbar.d.ts +165 -0
  578. package/dist/snackbar.d.ts.map +1 -0
  579. package/dist/snackbar.js +220 -0
  580. package/dist/snackbar.js.map +1 -0
  581. package/dist/socket.d.ts +96 -0
  582. package/dist/socket.d.ts.map +1 -0
  583. package/dist/socket.js +370 -0
  584. package/dist/socket.js.map +1 -0
  585. package/dist/spotlight.d.ts +77 -0
  586. package/dist/spotlight.d.ts.map +1 -0
  587. package/dist/spotlight.js +174 -0
  588. package/dist/spotlight.js.map +1 -0
  589. package/dist/state-primitive.d.ts +37 -0
  590. package/dist/state-primitive.d.ts.map +1 -0
  591. package/dist/state-primitive.js +91 -0
  592. package/dist/state-primitive.js.map +1 -0
  593. package/dist/store-query.d.ts +25 -0
  594. package/dist/store-query.d.ts.map +1 -0
  595. package/dist/store-query.js +88 -0
  596. package/dist/store-query.js.map +1 -0
  597. package/dist/store-value.d.ts +48 -0
  598. package/dist/store-value.d.ts.map +1 -0
  599. package/dist/store-value.js +264 -0
  600. package/dist/store-value.js.map +1 -0
  601. package/dist/store-versioning.d.ts +70 -0
  602. package/dist/store-versioning.d.ts.map +1 -0
  603. package/dist/store-versioning.js +188 -0
  604. package/dist/store-versioning.js.map +1 -0
  605. package/dist/store.d.ts +282 -0
  606. package/dist/store.d.ts.map +1 -0
  607. package/dist/store.js +1144 -0
  608. package/dist/store.js.map +1 -0
  609. package/dist/strings.d.ts +141 -0
  610. package/dist/strings.d.ts.map +1 -0
  611. package/dist/strings.js +581 -0
  612. package/dist/strings.js.map +1 -0
  613. package/dist/telemetry.d.ts +95 -0
  614. package/dist/telemetry.d.ts.map +1 -0
  615. package/dist/telemetry.js +255 -0
  616. package/dist/telemetry.js.map +1 -0
  617. package/dist/transform-core.d.ts +228 -0
  618. package/dist/transform-core.d.ts.map +1 -0
  619. package/dist/transform-core.js +921 -0
  620. package/dist/transform-core.js.map +1 -0
  621. package/dist/transition-core.d.ts +58 -0
  622. package/dist/transition-core.d.ts.map +1 -0
  623. package/dist/transition-core.js +352 -0
  624. package/dist/transition-core.js.map +1 -0
  625. package/dist/trim-trailing.d.ts +3 -0
  626. package/dist/trim-trailing.d.ts.map +1 -0
  627. package/dist/trim-trailing.js +14 -0
  628. package/dist/trim-trailing.js.map +1 -0
  629. package/dist/upload.d.ts +51 -0
  630. package/dist/upload.d.ts.map +1 -0
  631. package/dist/upload.js +68 -0
  632. package/dist/upload.js.map +1 -0
  633. package/dist/vendor-face.d.ts +44 -0
  634. package/dist/vendor-face.d.ts.map +1 -0
  635. package/dist/vendor-face.js +80 -0
  636. package/dist/vendor-face.js.map +1 -0
  637. package/dist/vendor-session.d.ts +166 -0
  638. package/dist/vendor-session.d.ts.map +1 -0
  639. package/dist/vendor-session.js +423 -0
  640. package/dist/vendor-session.js.map +1 -0
  641. package/dist/vendor-surface.d.ts +290 -0
  642. package/dist/vendor-surface.d.ts.map +1 -0
  643. package/dist/vendor-surface.js +439 -0
  644. package/dist/vendor-surface.js.map +1 -0
  645. package/dist/version-rules.generated.d.ts +17 -0
  646. package/dist/version-rules.generated.d.ts.map +1 -0
  647. package/dist/version-rules.generated.js +99 -0
  648. package/dist/version-rules.generated.js.map +1 -0
  649. package/dist/view-transition-core.d.ts +99 -0
  650. package/dist/view-transition-core.d.ts.map +1 -0
  651. package/dist/view-transition-core.js +127 -0
  652. package/dist/view-transition-core.js.map +1 -0
  653. package/dist/view-transition-door.d.ts +26 -0
  654. package/dist/view-transition-door.d.ts.map +1 -0
  655. package/dist/view-transition-door.js +88 -0
  656. package/dist/view-transition-door.js.map +1 -0
  657. package/dist/window-identity.d.ts +3 -0
  658. package/dist/window-identity.d.ts.map +1 -0
  659. package/dist/window-identity.js +27 -0
  660. package/dist/window-identity.js.map +1 -0
  661. package/package.json +139 -4
package/dist/scroll.js ADDED
@@ -0,0 +1,1226 @@
1
+ /**
2
+ * scroll.ts — the `<scroll>` observation plane and the scroll-linked style substrate, TS twin.
3
+ *
4
+ * The law and the reasoning live in OpenSource/Conformance/scroll/README.md; the cases live in
5
+ * that folder's seven .json files and run against THIS file
6
+ * (packages/kernel/test/scroll-conformance.test.ts), against the Kotlin twin
7
+ * (:core ScrollLinkedConformanceTest) and against the Swift twin (ScrollLinked.swift).
8
+ *
9
+ * Everything here is pure: geometry in, values out. The surface work — observing the scroll
10
+ * view, driving the display link, writing resolved values into the render tree, and the `ref`
11
+ * registry behind `dsx.scroll(name)` — belongs to each renderer's presenter. Keeping the
12
+ * decision separate from the plumbing is what lets one corpus judge three runtimes.
13
+ *
14
+ * THE SPLIT THIS FILE EXISTS FOR. `on:scroll` is for LOGIC and is coalesced to the display
15
+ * link; `--scroll-*` is for STYLE and is a pure function of one sample, so a renderer resolves
16
+ * it inside its own frame callback and nothing crosses the bus. A scroll handler dispatched per
17
+ * frame through a message bus is how a framework earns its reputation, and it is the one thing
18
+ * this design refuses to make possible.
19
+ */
20
+ /** Sub-pixel tolerance, in points. Momentum deceleration lands a fraction of a point short of
21
+ * the rail; a strict comparison makes `atBottom` flicker false at rest, which is how an
22
+ * infinite-scroll trigger misses. The same tolerance gives `direction` its stickiness. */
23
+ export const SCROLL_EPSILON = 0.5;
24
+ /** One display-link tick at 60 Hz. The default coalescing budget for `on:scroll`. */
25
+ export const FRAME_BUDGET_MS = 16;
26
+ /** How long without movement counts as settled, on a renderer with no platform deceleration
27
+ * callback (the web). iOS and Android have real end-of-deceleration signals and use those. */
28
+ export const SETTLE_MS = 120;
29
+ /** Above this speed a snap follows the direction of travel instead of the nearest candidate.
30
+ * It is what makes a 10% flick turn a page. Points per second. */
31
+ export const FLING_VELOCITY = 500;
32
+ /** How near a snap position has to be before `proximity` proposes it, as a fraction of the
33
+ * viewport length. CSS Scroll Snap 1 section 3 leaves the proximity range to the user agent and
34
+ * names no number, so this one is MEASURED rather than quoted: swept in
35
+ * OpenSource/Conformance/scroll/snap-css.json against a rail whose only snap positions are 0 and
36
+ * 300 in a 300px port, Firefox 151 and WebKit 26.5 both snap at a distance of 90 and both decline
37
+ * at 100, and Chromium 149 snaps at 100 and declines at 110. Two of the three draw the line at
38
+ * 0.30 of the viewport, so DSX draws it there. */
39
+ export const PROXIMITY_RATIO = 0.3;
40
+ /** `on:collapse` quantum: a hundredth of the collapse range. */
41
+ export const COLLAPSE_EPSILON = 0.01;
42
+ /** Where `<CollapsingHeader titleTransition="move">` hands the title to the nav bar. The header
43
+ * title's opacity reaches 0 exactly here and the nav bar's leaves 0 exactly here, so the two
44
+ * are never both visible and the title is ONE accessibility element at every fraction. */
45
+ export const TITLE_HANDOFF_FRACTION = 0.75;
46
+ /** Full-collapse blur radius for `blurOnCollapse`. */
47
+ export const BLUR_MAX = 20;
48
+ /** The default `<CollapsingHeader>` scrim: a bottom-anchored gradient from transparent at 60%
49
+ * of the height to 60% black at the bottom edge. It exists by default because a white title
50
+ * over a light photo is unreadable, and every app that ships this without one ships that bug. */
51
+ export const SCRIM_START = 0.6;
52
+ export const SCRIM_ALPHA = 0.6;
53
+ /** The default `minHeight` when the author names none. A host that knows its real bar height
54
+ * passes it; 56 is the shared floor (M3 small top app bar, comfortably over an iOS bar). */
55
+ export const NAV_BAR_HEIGHT = 56;
56
+ /** A number that survived a platform report. Nonsense reads as the origin rather than poisoning
57
+ * every value derived from it: one NaN offset otherwise becomes a NaN CSS length, and a dropped
58
+ * declaration is a silent layout hole. */
59
+ function finite(value) {
60
+ const n = typeof value === 'number' ? value : Number(value);
61
+ return Number.isFinite(n) ? n : 0;
62
+ }
63
+ /** Round half away from zero to four decimals. Half-away-from-zero rather than half-to-even
64
+ * because three languages must agree, and only this rule is spelled the same in all three. */
65
+ export function round4(value) {
66
+ const v = finite(value);
67
+ const sign = v < 0 ? -1 : 1;
68
+ return (sign * Math.floor(Math.abs(v) * 10000 + 0.5)) / 10000;
69
+ }
70
+ /** The published spelling of a number. Part of the contract: the corpus compares strings, so
71
+ * three languages must format identically. No exponent, no trailing zeros, no negative zero. */
72
+ export function formatNumber(value) {
73
+ const r = round4(value);
74
+ if (r === 0)
75
+ return '0';
76
+ let s = r.toFixed(4);
77
+ if (s.indexOf('.') >= 0)
78
+ s = s.replace(/0+$/, '').replace(/\.$/, '');
79
+ return s;
80
+ }
81
+ function clamp(v, lo, hi) {
82
+ return v < lo ? lo : v > hi ? hi : v;
83
+ }
84
+ /**
85
+ * The offset math every other function here builds on.
86
+ *
87
+ * The degenerate case is pinned on purpose: content no taller than the viewport is at BOTH ends
88
+ * (a page with nothing to scroll IS at each of them, and that is what makes `on:reach-end` fire
89
+ * once for a short list) and reports progress 0, never 1 — a non-scrollable plane must publish
90
+ * the RESTING state, because a header that boots into its collapsed look on a short page is the
91
+ * visible bug.
92
+ */
93
+ export function scrollMetrics(geometry) {
94
+ const x = finite(geometry.x);
95
+ const y = finite(geometry.y);
96
+ const maxX = Math.max(0, finite(geometry.contentWidth) - finite(geometry.viewportWidth));
97
+ const maxY = Math.max(0, finite(geometry.contentHeight) - finite(geometry.viewportHeight));
98
+ return {
99
+ x: round4(x),
100
+ y: round4(y),
101
+ maxX: round4(maxX),
102
+ maxY: round4(maxY),
103
+ progress: round4(maxY <= 0 ? 0 : clamp(y, 0, maxY) / maxY),
104
+ progressX: round4(maxX <= 0 ? 0 : clamp(x, 0, maxX) / maxX),
105
+ atTop: y <= SCROLL_EPSILON,
106
+ atBottom: y >= maxY - SCROLL_EPSILON,
107
+ atStart: x <= SCROLL_EPSILON,
108
+ atEnd: x >= maxX - SCROLL_EPSILON,
109
+ };
110
+ }
111
+ /**
112
+ * Motion from a SAMPLE PAIR, never from an accumulated delta.
113
+ *
114
+ * `direction` is STICKY below the tolerance. A one-pixel jitter that flips the word every frame
115
+ * is exactly the shrinking-header flicker, so a sub-tolerance sample keeps the previous word
116
+ * rather than inventing `none`; `none` is only ever the state before the first real movement.
117
+ * A non-monotonic or backwards clock yields velocity 0 rather than an infinity.
118
+ */
119
+ export function scrollMotion(previous, next, previousDirection) {
120
+ const dx = finite(next.x) - finite(previous.x);
121
+ const dy = finite(next.y) - finite(previous.y);
122
+ const dt = finite(next.t) - finite(previous.t);
123
+ const velocityX = dt > 0 ? (dx * 1000) / dt : 0;
124
+ const velocityY = dt > 0 ? (dy * 1000) / dt : 0;
125
+ // An exact tie prefers the vertical axis: it is the default axis of a <scroll>.
126
+ const vertical = Math.abs(dy) >= Math.abs(dx);
127
+ const delta = vertical ? dy : dx;
128
+ let direction;
129
+ if (Math.abs(delta) <= SCROLL_EPSILON)
130
+ direction = previousDirection ?? 'none';
131
+ else if (vertical)
132
+ direction = delta > 0 ? 'down' : 'up';
133
+ else
134
+ direction = delta > 0 ? 'right' : 'left';
135
+ return {
136
+ dx: round4(dx),
137
+ dy: round4(dy),
138
+ velocityX: round4(velocityX),
139
+ velocityY: round4(velocityY),
140
+ velocity: round4(vertical ? velocityY : velocityX),
141
+ direction,
142
+ };
143
+ }
144
+ // ---------------------------------------------------------------------------- coalescing
145
+ /**
146
+ * The performance contract, as one predicate.
147
+ *
148
+ * With no handler bound the answer is FALSE, not "cheap": a scroll nobody is listening to costs
149
+ * nothing at all. Otherwise at most one dispatch per display-link tick, and the first sample of
150
+ * a gesture always dispatches so a handler sees the start.
151
+ */
152
+ export function shouldDispatchScroll(hasHandler, lastDispatchAt, now, frameBudgetMs = FRAME_BUDGET_MS) {
153
+ if (!hasHandler)
154
+ return false;
155
+ if (lastDispatchAt === null)
156
+ return true;
157
+ return finite(now) - finite(lastDispatchAt) >= finite(frameBudgetMs);
158
+ }
159
+ /** Run a whole sample train through the policy. The corpus asserts the COUNT over a fixed train,
160
+ * so a coalescing regression is caught rather than felt. */
161
+ export function coalesceScroll(samples, hasHandler, frameBudgetMs = FRAME_BUDGET_MS) {
162
+ if (!hasHandler)
163
+ return { dispatches: 0, at: [] };
164
+ const at = [];
165
+ let last = null;
166
+ for (const raw of samples) {
167
+ const t = finite(raw);
168
+ if (shouldDispatchScroll(true, last, t, frameBudgetMs)) {
169
+ at.push(round4(t));
170
+ last = t;
171
+ }
172
+ }
173
+ return { dispatches: at.length, at };
174
+ }
175
+ /** One sticky inset. `auto` is CSS's "this edge does not stick", and anything a runtime cannot
176
+ * read is auto too rather than a silent zero, which would pin a box nobody asked to pin. */
177
+ function stickyInset(value) {
178
+ if (value === null || value === undefined)
179
+ return null;
180
+ const n = typeof value === 'number' ? value : Number(value);
181
+ return Number.isFinite(n) ? n : null;
182
+ }
183
+ /**
184
+ * `position: sticky`, as ONE number: the distance the box is PAINTED from its normal-flow
185
+ * position along the scroll axis, in points. Layout is untouched, which is the whole of CSS
186
+ * sticky (css-position-3 section 3.4): the box keeps its normal-flow rect and only the paint is
187
+ * translated, so nothing after it moves.
188
+ *
189
+ * THE BROWSER DOES THIS ITSELF, so nothing on the web lane calls it at render time. It is here
190
+ * because the corpus that judges the two native twins must be judged by three runners like every
191
+ * other file in `Conformance/scroll/`, and a rule stated in two places is a rule that drifts.
192
+ *
193
+ * The order is the specification's: the END inset pulls the box back first, the START inset then
194
+ * overrides it, and the containing block confines the result. A top-only header therefore reduces
195
+ * to `clamp(scrollOffset - boxStart + top, 0, blockEnd - boxEnd)`.
196
+ */
197
+ export function stickyOffset(geometry) {
198
+ const scroll = finite(geometry.scrollOffset);
199
+ const port = finite(geometry.viewport);
200
+ const boxLead = finite(geometry.boxStart) - scroll;
201
+ const boxTrail = finite(geometry.boxEnd) - scroll;
202
+ const blockLead = finite(geometry.blockStart) - scroll;
203
+ const blockTrail = finite(geometry.blockEnd) - scroll;
204
+ let offset = 0;
205
+ const trailInset = stickyInset(geometry.insetEnd);
206
+ const leadInset = stickyInset(geometry.insetStart);
207
+ if (trailInset !== null) {
208
+ const rail = port - trailInset;
209
+ if (boxTrail > rail)
210
+ offset = rail - boxTrail;
211
+ }
212
+ if (leadInset !== null && boxLead + offset < leadInset)
213
+ offset = leadInset - boxLead;
214
+ // The box may never leave its containing block: a sticky header scrolls away with its own
215
+ // section rather than riding on over the next one.
216
+ if (offset > blockTrail - boxTrail)
217
+ offset = blockTrail - boxTrail;
218
+ if (offset < blockLead - boxLead)
219
+ offset = blockLead - boxLead;
220
+ return offset;
221
+ }
222
+ /**
223
+ * `on:reach-end`, EDGE-TRIGGERED. It fires on the sample that crosses the threshold, not on every
224
+ * frame spent at the bottom; the latch releases when the user scrolls back out. Without the
225
+ * latch a "load more" handler is called sixty times a second at the rail, which is the classic
226
+ * duplicate-page bug.
227
+ */
228
+ export function reachEndState(latched, metrics, threshold, axis = 'vertical') {
229
+ const remaining = axis === 'horizontal'
230
+ ? metrics.maxX - clamp(metrics.x, 0, metrics.maxX)
231
+ : metrics.maxY - clamp(metrics.y, 0, metrics.maxY);
232
+ const crossed = remaining <= finite(threshold) + SCROLL_EPSILON;
233
+ return { fire: crossed && !latched, latched: crossed, remaining: round4(remaining) };
234
+ }
235
+ /**
236
+ * The axis word is not decoration: CSS Scroll Snap 1 section 6.1 confines snapping to the declared
237
+ * axis, so a rail that declares `x` while it scrolls vertically snaps NOTHING rather than snapping
238
+ * on the axis that can move. `axis` is the container's own axis, `horizontal` / `x` or anything
239
+ * else for the block axis. The strictness defaults to `proximity`, the property's own initial one.
240
+ */
241
+ export function snapPlan(snapType, axis) {
242
+ const words = (snapType ?? '').trim().toLowerCase().split(' ').filter((w) => w.length > 0);
243
+ if (words.length === 0 || words[0] === 'none')
244
+ return { applies: false, strictness: 'proximity' };
245
+ const horizontal = axis === 'horizontal' || axis === 'x';
246
+ const declared = words[0];
247
+ const applies = declared === 'both'
248
+ ? true
249
+ : declared === 'x' || declared === 'inline'
250
+ ? horizontal
251
+ : declared === 'y' || declared === 'block'
252
+ ? !horizontal
253
+ : false;
254
+ return { applies, strictness: words.length > 1 && words[1] === 'mandatory' ? 'mandatory' : 'proximity' };
255
+ }
256
+ /**
257
+ * `dsx.scroll(ref).to/.toTop/.toBottom/.toElement`, reduced to one offset.
258
+ *
259
+ * Three rules. An imperative call NEVER over-scrolls, so every target clamps into 0..max —
260
+ * `to({y: 99999})` parks on the rail instead of leaving a band of nothing under the content.
261
+ * `toTop`/`toBottom` name the PRIMARY AXIS rather than the vertical one, so the familiar words
262
+ * keep working on a horizontal rail. `align: "nearest"` is the only alignment allowed to decide
263
+ * not to move, which is what makes `toElement` safe to call on every selection change.
264
+ *
265
+ * An unrealised row in a virtualised list returns null rather than guessing at an offset it
266
+ * cannot know; a virtualiser carrying an estimate passes the estimated frame and gets a real
267
+ * answer, then re-resolves once the row is realised.
268
+ */
269
+ export function resolveScrollCommand(command, geometry, axis = 'vertical') {
270
+ const m = scrollMetrics(geometry);
271
+ const horizontal = axis === 'horizontal';
272
+ const animated = command.animated ?? true;
273
+ const offset = horizontal ? m.x : m.y;
274
+ const limit = horizontal ? m.maxX : m.maxY;
275
+ const view = finite(horizontal ? geometry.viewportWidth : geometry.viewportHeight);
276
+ if (command.kind === 'to') {
277
+ return {
278
+ x: round4(command.x === undefined ? m.x : clamp(finite(command.x), 0, m.maxX)),
279
+ y: round4(command.y === undefined ? m.y : clamp(finite(command.y), 0, m.maxY)),
280
+ animated,
281
+ };
282
+ }
283
+ let target;
284
+ if (command.kind === 'toTop')
285
+ target = 0;
286
+ else if (command.kind === 'toBottom')
287
+ target = limit;
288
+ else {
289
+ const child = command.child;
290
+ if (!child)
291
+ return null;
292
+ const start = finite(child.start);
293
+ const length = finite(child.length);
294
+ const align = command.align ?? 'nearest';
295
+ if (align === 'start')
296
+ target = start;
297
+ else if (align === 'center')
298
+ target = start + length / 2 - view / 2;
299
+ else if (align === 'end')
300
+ target = start + length - view;
301
+ else if (start >= offset && start + length <= offset + view)
302
+ target = offset;
303
+ else if (start < offset)
304
+ target = start;
305
+ else
306
+ target = start + length - view;
307
+ }
308
+ target = clamp(target, 0, limit);
309
+ return {
310
+ x: round4(horizontal ? target : m.x),
311
+ y: round4(horizontal ? m.y : target),
312
+ animated,
313
+ };
314
+ }
315
+ // ---------------------------------------------------------------------------- snap
316
+ function roundHalfUp(v) {
317
+ return v >= 0 ? Math.floor(v + 0.5) : -Math.floor(-v + 0.5);
318
+ }
319
+ /**
320
+ * The snap target, or null when the container proposes none.
321
+ *
322
+ * `paging` is `page` (the viewport is the stride); `start`/`center`/`end` snap to CHILD
323
+ * BOUNDARIES, which is why real child frames are the input and a fixed stride is not — a rail of
324
+ * variable-width cards is the common case. At rest the nearest candidate wins and an exact tie
325
+ * takes the SMALLER offset, because a tie that advances is a snap that fights the finger. Past
326
+ * the fling threshold the target is the next candidate in the direction of travel.
327
+ */
328
+ export function resolveSnap(mode, offset, viewportLength, contentLength, children, velocity,
329
+ /** `mandatory` always proposes its nearest candidate; `proximity` proposes one only while it is
330
+ * within PROXIMITY_RATIO of the viewport. The DSX `snap` ATTRIBUTE has always meant mandatory,
331
+ * which is why that is the default and not the property's own initial value. */
332
+ strictness = 'mandatory') {
333
+ const view = finite(viewportLength);
334
+ const limit = Math.max(0, finite(contentLength) - view);
335
+ const at = finite(offset);
336
+ const v = finite(velocity);
337
+ if (mode === 'none' || limit <= 0)
338
+ return null;
339
+ if (mode === 'page') {
340
+ if (view <= 0)
341
+ return null;
342
+ const index = Math.floor(at / view);
343
+ const fraction = at / view - index;
344
+ let target;
345
+ if (v >= FLING_VELOCITY)
346
+ target = (index + 1) * view;
347
+ else if (v <= -FLING_VELOCITY)
348
+ target = fraction > 0 ? index * view : (index - 1) * view;
349
+ else
350
+ target = roundHalfUp(at / view) * view;
351
+ return round4(clamp(target, 0, limit));
352
+ }
353
+ // A candidate per SNAP AREA, not per child. The area is the child's frame outset by its own
354
+ // `scroll-margin`, and a child whose effective alignment is `none` is not a snap area at all: in
355
+ // `css` mode every child answers with its own word, and a child that declares none contributes
356
+ // nothing. That is the difference between a rail whose cards align differently and a rail the
357
+ // container aligns for.
358
+ const candidates = [];
359
+ for (const child of children) {
360
+ const align = child.align ?? (mode === 'css' ? 'none' : mode);
361
+ if (align !== 'start' && align !== 'center' && align !== 'end')
362
+ continue;
363
+ const margin = finite(child.margin ?? 0);
364
+ const start = finite(child.start) - margin;
365
+ const length = finite(child.length) + margin * 2;
366
+ const raw = align === 'start' ? start : align === 'center' ? start + length / 2 - view / 2 : start + length - view;
367
+ candidates.push(clamp(raw, 0, limit));
368
+ }
369
+ if (candidates.length === 0)
370
+ return null;
371
+ if (v >= FLING_VELOCITY) {
372
+ // The NEAREST candidate ahead, which is what `scroll-snap-stop: always` demands of any
373
+ // resolver: an area in the direction of travel is never passed over, because the fling arm
374
+ // cannot reach past the first one. `stop` therefore rides on the frame without a branch here,
375
+ // and scrollSnapStopHolds below is the assertion that keeps it true.
376
+ const ahead = candidates.filter((c) => c > at + SCROLL_EPSILON);
377
+ if (ahead.length > 0)
378
+ return proposed(Math.min(...ahead), at, view, strictness);
379
+ }
380
+ else if (v <= -FLING_VELOCITY) {
381
+ const behind = candidates.filter((c) => c < at - SCROLL_EPSILON);
382
+ if (behind.length > 0)
383
+ return proposed(Math.max(...behind), at, view, strictness);
384
+ }
385
+ let best = candidates[0];
386
+ for (const c of candidates) {
387
+ const d = Math.abs(c - at);
388
+ const bd = Math.abs(best - at);
389
+ if (d < bd || (d === bd && c < best))
390
+ best = c;
391
+ }
392
+ return proposed(best, at, view, strictness);
393
+ }
394
+ /** The chosen candidate, or null when `proximity` says it is too far to reach for. */
395
+ function proposed(target, at, view, strictness) {
396
+ if (strictness === 'proximity' && Math.abs(target - at) > view * PROXIMITY_RATIO)
397
+ return null;
398
+ return round4(target);
399
+ }
400
+ /**
401
+ * `scroll-snap-stop: always` holds by construction rather than by a branch, and this is where that
402
+ * is asserted rather than assumed: past the fling threshold resolveSnap proposes the NEAREST
403
+ * candidate in the direction of travel, so no snap area between the offset and the target can be
404
+ * passed over, whatever it declares. The day the fling arm grows a multi-area reach, this returns
405
+ * false and the corpus says so.
406
+ */
407
+ export function scrollSnapStopHolds(offset, viewportLength, contentLength, children, velocity) {
408
+ const target = resolveSnap('css', offset, viewportLength, contentLength, children, velocity);
409
+ if (target === null)
410
+ return true;
411
+ const lo = Math.min(offset, target);
412
+ const hi = Math.max(offset, target);
413
+ const limit = Math.max(0, finite(contentLength) - finite(viewportLength));
414
+ for (const child of children) {
415
+ if (child.stop !== 'always')
416
+ continue;
417
+ const align = child.align;
418
+ if (align !== 'start' && align !== 'center' && align !== 'end')
419
+ continue;
420
+ const margin = finite(child.margin ?? 0);
421
+ const start = finite(child.start) - margin;
422
+ const length = finite(child.length) + margin * 2;
423
+ const raw = align === 'start'
424
+ ? start
425
+ : align === 'center'
426
+ ? start + length / 2 - viewportLength / 2
427
+ : start + length - viewportLength;
428
+ const area = clamp(raw, 0, limit);
429
+ if (area > lo + SCROLL_EPSILON && area < hi - SCROLL_EPSILON)
430
+ return false;
431
+ }
432
+ return true;
433
+ }
434
+ /**
435
+ * Keep the visual position across a content mutation.
436
+ *
437
+ * THE INPUT IS AN ANCHOR, not a content-height delta, and that is the whole design. A content
438
+ * height diff cannot tell a prepend from an append, so compensating on it makes an appending
439
+ * chat jump exactly as badly as a prepending one failed to. The anchor is a previously visible
440
+ * child's frame origin before and after the mutation; prepend, append and removal-above then all
441
+ * fall out of ONE formula, and the append case correctly compensates by zero.
442
+ */
443
+ export function maintainPositionOffset(offset, anchorBefore, anchorAfter, viewportLength, contentLength) {
444
+ const limit = Math.max(0, finite(contentLength) - finite(viewportLength));
445
+ const delta = finite(anchorAfter) - finite(anchorBefore);
446
+ return { offset: round4(clamp(finite(offset) + delta, 0, limit)), delta: round4(delta) };
447
+ }
448
+ /** Is this scroll end-anchored (Conformance/scroll/reverse.json)? Only the reverse direction on
449
+ * the scroll's OWN axis counts; the browser needs no help, the native lanes lay out and open at
450
+ * the end from this answer. */
451
+ export function endAnchored(axis, flexDirection) {
452
+ const word = String(flexDirection ?? '').trim().toLowerCase();
453
+ return axis === 'horizontal' ? word === 'row-reverse' : word === 'column-reverse';
454
+ }
455
+ /** The main-axis gap a `<scroll>` charges between adjacent flow children
456
+ * (Conformance/scroll/flow-gap.json): `row-gap` on a vertical scroll, `column-gap` on a horizontal
457
+ * one, in points (`px` tolerated). The browser spaces a flex scroller itself; the native hosts
458
+ * stack their content from this answer. A percentage, a negative, a word or a missing value is 0. */
459
+ export function flowGap(axis, rowGap, columnGap) {
460
+ let word = String((axis === 'horizontal' ? columnGap : rowGap) ?? '').trim().toLowerCase();
461
+ if (word.endsWith('px'))
462
+ word = word.slice(0, -2).trim();
463
+ if (word === '' || !/^[0-9.]+$/.test(word))
464
+ return 0;
465
+ const value = Number(word);
466
+ return Number.isFinite(value) && value > 0 ? value : 0;
467
+ }
468
+ /** Where a `<scroll>` places a child on its cross axis (Conformance/scroll/cross-anchor.json):
469
+ * `start`, `center` or `end`, logical edges. The child's `align-self` wins; `auto`, `normal`,
470
+ * a missing value or a word the property cannot take defers to the scroll's `align-items`, whose
471
+ * initial `normal` behaves as `stretch`. Stretch, baseline and every start word answer `start`.
472
+ * The browser places a flex scroller's children itself; the native hosts align their content
473
+ * from this answer. Twins: ScrollLinked.kt, ScrollLinked.swift `crossAnchor`. */
474
+ export function crossAnchor(alignItems, alignSelf) {
475
+ const word = (raw) => {
476
+ const words = String(raw ?? '').trim().toLowerCase().split(/\s+/).filter((w) => w !== 'safe' && w !== 'unsafe');
477
+ switch (words[0] ?? '') {
478
+ case 'center': return 'center';
479
+ case 'end':
480
+ case 'flex-end':
481
+ case 'self-end': return 'end';
482
+ case 'start':
483
+ case 'flex-start':
484
+ case 'self-start':
485
+ case 'stretch':
486
+ case 'baseline':
487
+ case 'first':
488
+ case 'last': return 'start';
489
+ default: return null;
490
+ }
491
+ };
492
+ return word(alignSelf) ?? word(alignItems) ?? 'start';
493
+ }
494
+ /** Whether a `<scroll>` STRETCHES a child across its cross axis (Conformance/scroll/cross-anchor.json,
495
+ * `crossStretch`): true for `stretch` and for the initial `normal`, read with the same deferral
496
+ * as `crossAnchor` (the child's `align-self` wins; `auto`, `normal`, a missing value or a word the
497
+ * property cannot take defers to the scroll's `align-items`). The host fills the cross axis only
498
+ * for a child whose own cross size is `auto`. Twins: ScrollLinked.kt, ScrollLinked.swift. */
499
+ export function crossStretch(alignItems, alignSelf) {
500
+ const word = (raw) => {
501
+ const words = String(raw ?? '').trim().toLowerCase().split(/\s+/).filter((w) => w !== 'safe' && w !== 'unsafe');
502
+ switch (words[0] ?? '') {
503
+ case 'stretch': return true;
504
+ case 'center':
505
+ case 'end':
506
+ case 'flex-end':
507
+ case 'self-end':
508
+ case 'start':
509
+ case 'flex-start':
510
+ case 'self-start':
511
+ case 'baseline':
512
+ case 'first':
513
+ case 'last': return false;
514
+ default: return null;
515
+ }
516
+ };
517
+ return word(alignSelf) ?? word(alignItems) ?? true;
518
+ }
519
+ /**
520
+ * Content grew (or shrank) at the END of an end-anchored scroll. A reader pinned to the end stays
521
+ * pinned, so a streaming answer stays in view; a reader who scrolled back is compensated by the
522
+ * growth, so what they are reading does not move. Distances are measured from the end.
523
+ */
524
+ export function endFollow(fromEnd, grownBy, viewportLength, contentLength) {
525
+ const limit = Math.max(0, finite(contentLength) - finite(viewportLength));
526
+ const before = Math.max(0, finite(fromEnd));
527
+ if (before <= SCROLL_EPSILON)
528
+ return { fromEnd: 0, pinned: true };
529
+ return { fromEnd: round4(clamp(before + finite(grownBy), 0, limit)), pinned: false };
530
+ }
531
+ /**
532
+ * Is a scroll at its FIRST end (Conformance/scroll/reverse.json, `atFirstEnd`): the end a swipe DOWN cannot go past. An
533
+ * ordinary scroll is there at offset 0. An end-anchored one (a chat thread, column-reverse) opens at its newest end with
534
+ * offset 0 and goes negative (the browser) going back, so its first end, the oldest message, is the most negative offset.
535
+ * A sheet asks this before it carries a downward drag: a thread scrolled to its newest end is NOT at its top, and reading
536
+ * it as one made every swipe down in a chat sheet drag the sheet instead of scrolling the thread. Offsets from a native
537
+ * lane that measures the same distance positive read by magnitude, like newestRemaining.
538
+ */
539
+ export function atFirstEnd(anchored, offset, viewportLength, contentLength) {
540
+ const limit = Math.max(0, finite(contentLength) - finite(viewportLength));
541
+ if (!anchored)
542
+ return finite(offset) <= SCROLL_EPSILON;
543
+ return Math.abs(finite(offset)) >= limit - SCROLL_EPSILON;
544
+ }
545
+ /**
546
+ * The plane of an end-anchored scroll, from the one number a runtime that measures from the end
547
+ * has (Compose reverseScrolling `value`). `remaining` is the distance still to travel to the
548
+ * anchored (visual) end, `offset` the distance from the START, what --scroll-y publishes on a
549
+ * normal scroll, so every runtime publishes the same plane. Clamped to the travel; a
550
+ * non-finite distance reads as pinned.
551
+ */
552
+ export function endPlane(fromEnd, viewportLength, contentLength) {
553
+ const limit = Math.max(0, finite(contentLength) - finite(viewportLength));
554
+ const remaining = clamp(finite(fromEnd), 0, limit);
555
+ return { offset: round4(limit - remaining), remaining: round4(remaining) };
556
+ }
557
+ // ---------------------------------------------------------------------------- pinned to the newest
558
+ /** How near the newest end still counts as reading it (Conformance/scroll/pinned.json). A reader a finger's nudge
559
+ * away from the newest message is still "at the latest": the follow and the jump affordance must not flicker on a
560
+ * few points of momentum. Points; `pinThreshold` overrides it per scroll. */
561
+ export const PIN_THRESHOLD = 24;
562
+ /** The distance still to travel to the NEWEST end, from a renderer's own offset. On an end-anchored scroll the browser
563
+ * measures from the anchored end (0 at the newest, negative going back) and a native lane measures the same distance
564
+ * positive; both read as its magnitude. On an ordinary scroll the newest end is the far end. Clamped to the travel. */
565
+ export function newestRemaining(anchored, offset, viewportLength, contentLength) {
566
+ const limit = Math.max(0, finite(contentLength) - finite(viewportLength));
567
+ const value = anchored ? Math.abs(finite(offset)) : limit - finite(offset);
568
+ return round4(clamp(value, 0, limit));
569
+ }
570
+ /** Pinned while within `threshold` of the newest end. `changed` is true only on the sample that crosses, so a pane
571
+ * re-reads nothing while the reader stays on one side. A first sample (previous null) reports its state as changed. */
572
+ export function pinnedState(previous, remaining, threshold = PIN_THRESHOLD) {
573
+ const r = Math.max(0, finite(remaining));
574
+ const pinned = r <= Math.max(0, finite(threshold)) + SCROLL_EPSILON;
575
+ return { pinned, remaining: round4(r), changed: previous === null || previous !== pinned };
576
+ }
577
+ /** `pinThreshold`: a non-negative number of points, else the default. */
578
+ export function pinThreshold(value) {
579
+ if (value === null || value === undefined || value.trim() === '')
580
+ return PIN_THRESHOLD;
581
+ const n = Number(value.trim().replace(/px$/, ''));
582
+ return Number.isFinite(n) && n >= 0 ? round4(n) : PIN_THRESHOLD;
583
+ }
584
+ /**
585
+ * THE JUMP-TO-LATEST AFFORDANCE. Pinned: never drawn, and the baseline forgets. Unpinned with a count (the pane's
586
+ * `count`, the number of items in the thread): the baseline is the count at the moment the reader left, and the
587
+ * affordance appears once new items arrive past it, saying how many. Unpinned with no count: it appears as soon as
588
+ * the reader leaves, with no number, since the pane cannot know what is new.
589
+ */
590
+ export function jumpState(pinned, count, baseline) {
591
+ if (pinned)
592
+ return { show: false, unread: 0, baseline: null };
593
+ const known = typeof count === 'number' && Number.isFinite(count);
594
+ if (!known)
595
+ return { show: true, unread: 0, baseline: null };
596
+ const base = typeof baseline === 'number' && Number.isFinite(baseline) ? baseline : count;
597
+ const unread = Math.max(0, Math.floor(count - base));
598
+ return { show: unread > 0, unread, baseline: base };
599
+ }
600
+ /** The prefix every published key carries. A named plane is spelled by inserting the ref right
601
+ * after it, so the two families are one family with one namespace. */
602
+ const SCROLL_PREFIX = '--scroll-';
603
+ /**
604
+ * The unqualified keys the two axis planes own. A named scroller may never publish one of them:
605
+ * `ref="progress"` would otherwise spell `--scroll-progress-x` and shadow the horizontal plane
606
+ * of whatever page it sits on. The reserved key wins and the named twin is simply not published,
607
+ * which keeps the collision a naming inconvenience rather than an action at a distance.
608
+ */
609
+ export const RESERVED_SCROLL_KEYS = [
610
+ '--scroll-y', '--scroll-y-px', '--scroll-progress', '--scroll-velocity',
611
+ '--scroll-remaining', '--scroll-remaining-px',
612
+ '--scroll-x', '--scroll-x-px', '--scroll-progress-x', '--scroll-velocity-x',
613
+ '--scroll-remaining-x', '--scroll-remaining-x-px',
614
+ ];
615
+ /** Points still to travel on an axis, from the CLAMPED offset so rubber-band over-scroll cannot
616
+ * push it past either end. `--scroll-y` measures from the top and this measures from the
617
+ * bottom; without it a bottom-anchored effect can only be written in `progress`, which is a
618
+ * fraction of the content and therefore a different distance on every list. */
619
+ function remainingOf(offset, max) {
620
+ return finite(max) - clamp(finite(offset), 0, finite(max));
621
+ }
622
+ /**
623
+ * The plane one scroll node publishes. A node contributes ONLY the plane of its own axis, so a
624
+ * horizontal rail inside a vertical page owns `--scroll-x*` and leaves `--scroll-y*` to the page.
625
+ *
626
+ * Two spellings per length, and this is a CORRECTION to the U01 plan: `--scroll-y` is unitless
627
+ * points so `calc(1 - var(--scroll-y) / 280)` types as a number, and `--scroll-y-px` carries px
628
+ * so `translateY(calc(var(--scroll-y-px) * 0.5))` types as a length. A single property cannot be
629
+ * both, and the plan's example is rejected by every engine, ours and a browser's alike.
630
+ */
631
+ /** How wide the edge fade grows once there is content past that edge (web-face: the rail
632
+ * law). A rail that simply CUTS at the scrollport edge reads as a rendering fault — a chip
633
+ * sliced mid-word — where a fade reads as "there is more this way". Published as a length so
634
+ * the mask can interpolate it: 0 at the end of travel, so the fade is only ever present on
635
+ * the side that actually continues. */
636
+ // NO EDGE-FADE KEYS HERE, and the corpus is why. A rail's edge fade is a WEB PRESENTATION
637
+ // detail — a CSS mask — and this function publishes the RENDERER-NEUTRAL scroll plane that
638
+ // iOS and Android resolve too. Two literal `--dsx-edge-*` keys were added here and the
639
+ // linked corpus caught both halves of the mistake within one run: they broke every exact-set
640
+ // publication row, and — the real defect — they carried no axis and no plane name, so a
641
+ // horizontal rail inside a vertical page published the SAME two variables as the page and the
642
+ // two fought over one value ("the vertical and horizontal planes never collide"). The fade is
643
+ // now derived in CSS from the plane that was already here, per axis, with no new member:
644
+ // `min(28px, var(--scroll-x-px, 0px))` — see dom/src/globals.ts.
645
+ export function scrollLinkedProperties(axis, metrics, velocity) {
646
+ if (axis === 'horizontal') {
647
+ const remaining = remainingOf(metrics.x, metrics.maxX);
648
+ return {
649
+ '--scroll-x': formatNumber(metrics.x),
650
+ '--scroll-x-px': formatNumber(metrics.x) + 'px',
651
+ '--scroll-progress-x': formatNumber(metrics.progressX),
652
+ '--scroll-velocity-x': formatNumber(velocity),
653
+ '--scroll-remaining-x': formatNumber(remaining),
654
+ '--scroll-remaining-x-px': formatNumber(remaining) + 'px',
655
+ };
656
+ }
657
+ const remaining = remainingOf(metrics.y, metrics.maxY);
658
+ return {
659
+ '--scroll-y': formatNumber(metrics.y),
660
+ '--scroll-y-px': formatNumber(metrics.y) + 'px',
661
+ '--scroll-progress': formatNumber(metrics.progress),
662
+ '--scroll-velocity': formatNumber(velocity),
663
+ '--scroll-remaining': formatNumber(remaining),
664
+ '--scroll-remaining-px': formatNumber(remaining) + 'px',
665
+ };
666
+ }
667
+ /**
668
+ * Whether a `ref` can name a plane. The ref registry treats a name as opaque, but a published
669
+ * key is a CSS custom property, and a name carrying a space or a dot does not spell one - so it
670
+ * publishes NOTHING rather than an unreachable key or, worse, a truncated one that another ref
671
+ * could also spell. The imperative surface behind the same ref is unaffected.
672
+ */
673
+ export function isScrollPlaneRef(ref) {
674
+ if (typeof ref !== 'string' || ref.length === 0)
675
+ return false;
676
+ for (let i = 0; i < ref.length; i++) {
677
+ const c = ref.charAt(i);
678
+ const ok = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') ||
679
+ c === '-' || c === '_';
680
+ if (!ok)
681
+ return false;
682
+ }
683
+ return true;
684
+ }
685
+ /**
686
+ * The same plane, published under the node's `ref` and scoped to the DOCUMENT ROOT rather than
687
+ * to the node's descendants.
688
+ *
689
+ * THE CASE THE CASCADE CANNOT SERVE (R27). Pinned chrome - fade edges, a floating back-to-top,
690
+ * a progress rail - sits OVER a scroller and is by definition not inside it, so no cascade can
691
+ * ever reach it; and every way to make it a descendant makes it scroll away. Naming the scroller
692
+ * is the web's own answer to the same problem (`scroll-timeline` + `timeline-scope` name a
693
+ * scroller precisely so something outside its subtree can read it), and it needs no new value
694
+ * grammar here: the key is an ordinary custom property and `var()` already reads it.
695
+ */
696
+ export function namedScrollProperties(ref, axis, metrics, velocity) {
697
+ if (!isScrollPlaneRef(ref))
698
+ return {};
699
+ const out = {};
700
+ for (const [key, value] of Object.entries(scrollLinkedProperties(axis, metrics, velocity))) {
701
+ const named = SCROLL_PREFIX + ref + '-' + key.slice(SCROLL_PREFIX.length);
702
+ if (RESERVED_SCROLL_KEYS.indexOf(named) >= 0)
703
+ continue;
704
+ out[named] = value;
705
+ }
706
+ return out;
707
+ }
708
+ /**
709
+ * Resolve the properties in scope for an element, from its scroll ancestors NEAREST FIRST, plus
710
+ * every named plane in the document.
711
+ *
712
+ * Each axis resolves independently from its own nearest ancestor, which is what an author
713
+ * expects of a horizontal rail inside a vertical page. An axis with no ancestor contributes
714
+ * NOTHING rather than zero, so `var(--scroll-y, 0)` can tell "no scroller" from "at the top".
715
+ *
716
+ * Named planes are document-wide and apply to every element, ancestor or not. They are merged in
717
+ * document order so a duplicated ref resolves to its LAST provider, which is the ref registry's
718
+ * own law (`Conformance/input/ref.json`) rather than a second opinion about it. A reserved key is
719
+ * dropped here as well as at publication, so a hand-built plane cannot shadow an axis either.
720
+ */
721
+ export function resolveLinkedScope(ancestors, named = []) {
722
+ const out = {};
723
+ for (const plane of named) {
724
+ for (const [key, value] of Object.entries(plane.properties)) {
725
+ if (RESERVED_SCROLL_KEYS.indexOf(key) >= 0)
726
+ continue;
727
+ out[key] = value;
728
+ }
729
+ }
730
+ let vertical = false;
731
+ let horizontal = false;
732
+ for (const ancestor of ancestors) {
733
+ if (ancestor.axis === 'vertical' && !vertical) {
734
+ Object.assign(out, ancestor.properties);
735
+ vertical = true;
736
+ }
737
+ else if (ancestor.axis === 'horizontal' && !horizontal) {
738
+ Object.assign(out, ancestor.properties);
739
+ horizontal = true;
740
+ }
741
+ }
742
+ return out;
743
+ }
744
+ // ---------------------------------------------------------------------------- var()/calc()
745
+ /**
746
+ * The native twin of what a browser does for free: substitute `var()`, then fold every `calc()`
747
+ * with CSS's own unit algebra. The web renderer never calls it — the browser owns calc there —
748
+ * but the two native renderers must agree with the browser to the last decimal, so the reference
749
+ * implementation lives here and the corpus judges all three.
750
+ *
751
+ * Anything it cannot type DROPS the declaration (returns null), which is what CSS itself does
752
+ * for a value that is invalid at computed value, and what CssValue already does for a cyclic
753
+ * var() chain.
754
+ */
755
+ export function evaluateScrollLinked(expression, properties) {
756
+ const substituted = substituteVars(expression, properties, 0);
757
+ if (substituted === null)
758
+ return null;
759
+ let out = '';
760
+ let i = 0;
761
+ for (;;) {
762
+ const at = nextMathFunction(substituted, i);
763
+ if (at === null) {
764
+ out += substituted.slice(i);
765
+ return out;
766
+ }
767
+ out += substituted.slice(i, at.start);
768
+ const close = matchParen(substituted, at.open + 1);
769
+ if (close < 0)
770
+ return null;
771
+ const folded = foldCalc(substituted.slice(at.start, close + 1));
772
+ if (folded === null)
773
+ return null;
774
+ out += formatNumber(folded.value) + folded.unit;
775
+ i = close + 1;
776
+ }
777
+ }
778
+ /** The four CSS math functions this evaluator folds, longest first so `calc` cannot shadow one. */
779
+ const MATH_FUNCTIONS = ['clamp(', 'calc(', 'min(', 'max('];
780
+ /**
781
+ * The next math function at or after `from`, ignoring one that is only the tail of a longer
782
+ * identifier (`admin(` is not `min(`). Returns where the name starts and where its `(` sits.
783
+ */
784
+ function nextMathFunction(source, from) {
785
+ const lower = source.toLowerCase();
786
+ let best = null;
787
+ for (const name of MATH_FUNCTIONS) {
788
+ let at = lower.indexOf(name, from);
789
+ while (at >= 0) {
790
+ const before = at > 0 ? lower[at - 1] : '';
791
+ const glued = (before >= 'a' && before <= 'z') || (before >= '0' && before <= '9')
792
+ || before === '-' || before === '_';
793
+ if (!glued) {
794
+ if (best === null || at < best.start)
795
+ best = { start: at, open: at + name.length - 1 };
796
+ break;
797
+ }
798
+ at = lower.indexOf(name, at + 1);
799
+ }
800
+ }
801
+ return best;
802
+ }
803
+ /** Index of the `)` closing a `(` whose CONTENT starts at `from`, or -1. */
804
+ function matchParen(source, from) {
805
+ let depth = 1;
806
+ for (let i = from; i < source.length; i += 1) {
807
+ if (source[i] === '(')
808
+ depth += 1;
809
+ else if (source[i] === ')') {
810
+ depth -= 1;
811
+ if (depth === 0)
812
+ return i;
813
+ }
814
+ }
815
+ return -1;
816
+ }
817
+ const VAR_DEPTH_BUDGET = 8;
818
+ function substituteVars(source, properties, depth) {
819
+ if (source.indexOf('var(') < 0)
820
+ return source;
821
+ // A cyclic definition rotates forever; the budget terminates it exactly as CssValue does.
822
+ if (depth > VAR_DEPTH_BUDGET)
823
+ return null;
824
+ let out = '';
825
+ let i = 0;
826
+ for (;;) {
827
+ const at = source.indexOf('var(', i);
828
+ if (at < 0) {
829
+ out += source.slice(i);
830
+ break;
831
+ }
832
+ out += source.slice(i, at);
833
+ const close = matchParen(source, at + 4);
834
+ if (close < 0)
835
+ return null;
836
+ const inner = source.slice(at + 4, close);
837
+ const comma = splitTopLevel(inner, ',');
838
+ const name = comma[0].trim();
839
+ const fallback = comma.length > 1 ? comma.slice(1).join(',').trim() : null;
840
+ if (Object.prototype.hasOwnProperty.call(properties, name))
841
+ out += properties[name];
842
+ else if (fallback !== null)
843
+ out += fallback;
844
+ else
845
+ return null;
846
+ i = close + 1;
847
+ }
848
+ return substituteVars(out, properties, depth + 1);
849
+ }
850
+ function splitTopLevel(source, separator) {
851
+ const parts = [];
852
+ let depth = 0;
853
+ let current = '';
854
+ for (const ch of source) {
855
+ if (ch === '(')
856
+ depth += 1;
857
+ else if (ch === ')')
858
+ depth -= 1;
859
+ if (ch === separator && depth === 0) {
860
+ parts.push(current);
861
+ current = '';
862
+ }
863
+ else
864
+ current += ch;
865
+ }
866
+ parts.push(current);
867
+ return parts;
868
+ }
869
+ const CALC_UNITS = ['rem', 'deg', 'ms', 'em', 'px', 'pt', 'vh', 'vw', '%', 's'];
870
+ function tokenizeCalc(source) {
871
+ const tokens = [];
872
+ let i = 0;
873
+ while (i < source.length) {
874
+ const ch = source[i];
875
+ if (ch === ' ' || ch === '\t' || ch === '\n' || ch === '\r') {
876
+ i += 1;
877
+ continue;
878
+ }
879
+ if (ch === '(' || ch === ')' || ch === '+' || ch === '-' || ch === '*' || ch === '/'
880
+ || ch === ',') {
881
+ tokens.push({ kind: ch });
882
+ i += 1;
883
+ continue;
884
+ }
885
+ if ((ch >= '0' && ch <= '9') || ch === '.') {
886
+ let j = i;
887
+ while (j < source.length && ((source[j] >= '0' && source[j] <= '9') || source[j] === '.'))
888
+ j += 1;
889
+ const value = Number(source.slice(i, j));
890
+ if (!Number.isFinite(value))
891
+ return null;
892
+ let unit = '';
893
+ for (const candidate of CALC_UNITS) {
894
+ if (source.slice(j, j + candidate.length).toLowerCase() === candidate) {
895
+ unit = candidate;
896
+ j += candidate.length;
897
+ break;
898
+ }
899
+ }
900
+ tokens.push({ kind: 'num', value, unit });
901
+ i = j;
902
+ continue;
903
+ }
904
+ if (source.slice(i, i + 5).toLowerCase() === 'calc(') {
905
+ tokens.push({ kind: '(' });
906
+ i += 5;
907
+ continue;
908
+ }
909
+ if (source.slice(i, i + 4).toLowerCase() === 'min(') {
910
+ tokens.push({ kind: 'm' }, { kind: '(' });
911
+ i += 4;
912
+ continue;
913
+ }
914
+ if (source.slice(i, i + 4).toLowerCase() === 'max(') {
915
+ tokens.push({ kind: 'x' }, { kind: '(' });
916
+ i += 4;
917
+ continue;
918
+ }
919
+ if (source.slice(i, i + 6).toLowerCase() === 'clamp(') {
920
+ tokens.push({ kind: 'c' }, { kind: '(' });
921
+ i += 6;
922
+ continue;
923
+ }
924
+ return null;
925
+ }
926
+ return tokens;
927
+ }
928
+ /**
929
+ * Fold one math function, HEAD INCLUDED (`calc(…)`, `min(…)`, `max(…)`, `clamp(…)`, nested
930
+ * freely). CSS's unit algebra, and nothing beyond it: `+`/`-` need matching units
931
+ * (zero being the one unitless length), at most one operand of a product may carry a unit, and a
932
+ * divisor must be a non-zero number. Every refusal returns null so the caller drops the whole
933
+ * declaration rather than shipping a half-typed value.
934
+ */
935
+ /**
936
+ * `min()` / `max()` / `clamp()`. CSS compares LIKE with LIKE, so every argument must carry the
937
+ * same unit - a bound is meaningless between a length and a ratio - and `clamp()` is exactly
938
+ * three arguments, folded as `max(low, min(value, high))`, which is CSS's own definition and is
939
+ * what makes an inverted pair resolve to the low bound rather than to nothing.
940
+ */
941
+ function compare(fn, args) {
942
+ if (args.length === 0)
943
+ return null;
944
+ const unit = args[0].unit;
945
+ for (const arg of args)
946
+ if (arg.unit !== unit)
947
+ return null;
948
+ if (fn === 'c') {
949
+ if (args.length !== 3)
950
+ return null;
951
+ const [low, value, high] = args;
952
+ return { value: Math.max(low.value, Math.min(value.value, high.value)), unit };
953
+ }
954
+ let out = args[0].value;
955
+ for (const arg of args)
956
+ out = fn === 'm' ? Math.min(out, arg.value) : Math.max(out, arg.value);
957
+ return { value: out, unit };
958
+ }
959
+ function foldCalc(body) {
960
+ const parsed = tokenizeCalc(body);
961
+ if (parsed === null)
962
+ return null;
963
+ // Declared non-nullable rather than narrowed: the recursive-descent helpers below are HOISTED
964
+ // function declarations, and the null check above does not reach across a hoist.
965
+ const tokens = parsed;
966
+ let pos = 0;
967
+ const peek = () => (pos < tokens.length ? tokens[pos].kind : null);
968
+ function primary() {
969
+ const kind = peek();
970
+ if (kind === '(') {
971
+ pos += 1;
972
+ const inner = sum();
973
+ if (inner === null || peek() !== ')')
974
+ return null;
975
+ pos += 1;
976
+ return inner;
977
+ }
978
+ if (kind === '-') {
979
+ pos += 1;
980
+ const inner = primary();
981
+ return inner === null ? null : { value: -inner.value, unit: inner.unit };
982
+ }
983
+ if (kind === '+') {
984
+ pos += 1;
985
+ return primary();
986
+ }
987
+ if (kind === 'm' || kind === 'x' || kind === 'c') {
988
+ pos += 1;
989
+ if (peek() !== '(')
990
+ return null;
991
+ pos += 1;
992
+ const args = [];
993
+ for (;;) {
994
+ const arg = sum();
995
+ if (arg === null)
996
+ return null;
997
+ args.push(arg);
998
+ if (peek() !== ',')
999
+ break;
1000
+ pos += 1;
1001
+ }
1002
+ if (peek() !== ')')
1003
+ return null;
1004
+ pos += 1;
1005
+ return compare(kind, args);
1006
+ }
1007
+ if (kind === 'num') {
1008
+ const token = tokens[pos];
1009
+ pos += 1;
1010
+ return { value: token.value, unit: token.unit };
1011
+ }
1012
+ return null;
1013
+ }
1014
+ function product() {
1015
+ let left = primary();
1016
+ if (left === null)
1017
+ return null;
1018
+ for (;;) {
1019
+ const op = peek();
1020
+ if (op !== '*' && op !== '/')
1021
+ return left;
1022
+ pos += 1;
1023
+ const right = primary();
1024
+ if (right === null)
1025
+ return null;
1026
+ if (op === '*') {
1027
+ if (left.unit && right.unit)
1028
+ return null; // CSS has no square pixels.
1029
+ left = { value: left.value * right.value, unit: left.unit || right.unit };
1030
+ }
1031
+ else {
1032
+ if (right.unit)
1033
+ return null; // Division BY a dimension is not a CSS operation.
1034
+ if (right.value === 0)
1035
+ return null; // An infinity in a declaration is a dropped declaration.
1036
+ left = { value: left.value / right.value, unit: left.unit };
1037
+ }
1038
+ }
1039
+ }
1040
+ function sum() {
1041
+ let left = product();
1042
+ if (left === null)
1043
+ return null;
1044
+ for (;;) {
1045
+ const op = peek();
1046
+ if (op !== '+' && op !== '-')
1047
+ return left;
1048
+ pos += 1;
1049
+ const right = product();
1050
+ if (right === null)
1051
+ return null;
1052
+ let unit = left.unit; // annotated: `left` is reassigned from `unit` below, so inference is circular
1053
+ if (left.unit && right.unit) {
1054
+ if (left.unit !== right.unit)
1055
+ return null;
1056
+ }
1057
+ else if (left.unit && !right.unit) {
1058
+ if (right.value !== 0)
1059
+ return null;
1060
+ }
1061
+ else if (!left.unit && right.unit) {
1062
+ if (left.value !== 0)
1063
+ return null;
1064
+ unit = right.unit;
1065
+ }
1066
+ left = { value: op === '+' ? left.value + right.value : left.value - right.value, unit };
1067
+ }
1068
+ }
1069
+ const result = sum();
1070
+ if (result === null || pos !== tokens.length)
1071
+ return null;
1072
+ return result;
1073
+ }
1074
+ /**
1075
+ * `<CollapsingHeader>` (U10), which is a pure function of `--scroll-y` and therefore lives here.
1076
+ *
1077
+ * THE TITLE IS ONE ACCESSIBILITY ELEMENT AT EVERY FRACTION, and that is enforced by construction
1078
+ * rather than by review: `titleOwner` is a single value, and under `move` the header's opacity
1079
+ * reaches 0 exactly where the nav bar's leaves 0. A naive implementation cross-fades the two over
1080
+ * the whole range and a screen reader then finds the title twice, which is the defect this
1081
+ * pattern produces when implemented the obvious way.
1082
+ *
1083
+ * THE PINNED SLOT RAISES THE FLOOR. `effectiveMinHeight` is max(minHeight, pinnedHeight), so
1084
+ * content that must survive the collapse cannot be clipped by a minHeight the author chose
1085
+ * before adding it.
1086
+ *
1087
+ * REDUCED MOTION zeroes parallax and keeps everything else: the collapse is LAYOUT and must
1088
+ * still happen, and `stretch` survives because it tracks the finger one to one rather than
1089
+ * animating on its own, which is not what the vestibular guidance is about.
1090
+ */
1091
+ export function collapseState(input) {
1092
+ const height = Math.max(0, finite(input.height ?? 280));
1093
+ const pinned = Math.max(0, finite(input.pinnedHeight ?? 0));
1094
+ const minHeight = clamp(Math.max(finite(input.minHeight ?? NAV_BAR_HEIGHT), pinned), 0, height);
1095
+ const scrollY = finite(input.scrollY);
1096
+ const parallax = clamp(finite(input.parallax ?? 0.5), 0, 1);
1097
+ const stretch = input.stretch ?? true;
1098
+ const transition = input.titleTransition ?? 'move';
1099
+ const reduceMotion = input.reduceMotion ?? false;
1100
+ const range = Math.max(0, height - minHeight);
1101
+ // The degenerate case answers 0, matching metrics.json: nothing to collapse means the RESTING
1102
+ // state, because booting into the collapsed look on a short page is the visible bug.
1103
+ const fraction = range <= 0 ? 0 : clamp(scrollY / range, 0, 1);
1104
+ const stretching = scrollY < 0 && stretch;
1105
+ const headerHeight = stretching ? height - scrollY : height - fraction * range;
1106
+ const imageScale = stretching && height > 0 ? (height - scrollY) / height : 1;
1107
+ const effectiveParallax = reduceMotion ? 0 : parallax;
1108
+ // Clamped to the range: once the header has stopped shrinking there is nothing left to move
1109
+ // the image against, and an unclamped translation walks the image out of its own header.
1110
+ const imageTranslation = clamp(scrollY, 0, range) * effectiveParallax;
1111
+ let headerTitleOpacity;
1112
+ let navBarTitleOpacity;
1113
+ let titleOwner;
1114
+ if (transition === 'move') {
1115
+ headerTitleOpacity = clamp(1 - fraction / TITLE_HANDOFF_FRACTION, 0, 1);
1116
+ navBarTitleOpacity = clamp((fraction - TITLE_HANDOFF_FRACTION) / (1 - TITLE_HANDOFF_FRACTION), 0, 1);
1117
+ titleOwner = fraction >= TITLE_HANDOFF_FRACTION ? 'navbar' : 'header';
1118
+ }
1119
+ else if (transition === 'fade') {
1120
+ headerTitleOpacity = clamp(1 - fraction, 0, 1);
1121
+ navBarTitleOpacity = 0;
1122
+ titleOwner = 'header';
1123
+ }
1124
+ else {
1125
+ headerTitleOpacity = 1;
1126
+ navBarTitleOpacity = 0;
1127
+ titleOwner = 'header';
1128
+ }
1129
+ return {
1130
+ fraction: round4(fraction),
1131
+ headerHeight: round4(headerHeight),
1132
+ effectiveMinHeight: round4(minHeight),
1133
+ imageTranslation: round4(imageTranslation),
1134
+ imageScale: round4(imageScale),
1135
+ effectiveParallax: round4(effectiveParallax),
1136
+ headerTitleOpacity: round4(headerTitleOpacity),
1137
+ navBarTitleOpacity: round4(navBarTitleOpacity),
1138
+ titleOwner,
1139
+ blurRadius: round4((input.blurOnCollapse ?? false) ? fraction * BLUR_MAX : 0),
1140
+ pinnedOffset: round4(Math.max(0, headerHeight - pinned)),
1141
+ };
1142
+ }
1143
+ /** `on:collapse` is quantised to a hundredth of the range, with the endpoints ALWAYS emitted so
1144
+ * a handler can rely on seeing exactly 0 and exactly 1. */
1145
+ export function shouldEmitCollapse(previousFraction, fraction) {
1146
+ if (previousFraction === null)
1147
+ return true;
1148
+ if (fraction !== previousFraction && (fraction === 0 || fraction === 1))
1149
+ return true;
1150
+ return Math.abs(fraction - previousFraction) >= COLLAPSE_EPSILON;
1151
+ }
1152
+ function boolAttribute(value, fallback) {
1153
+ if (value === null || value === undefined)
1154
+ return fallback;
1155
+ const word = value.trim().toLowerCase();
1156
+ if (word === 'false' || word === '0' || word === 'no' || word === 'off')
1157
+ return false;
1158
+ if (word === 'true' || word === '1' || word === 'yes' || word === 'on' || word === '')
1159
+ return true;
1160
+ return fallback;
1161
+ }
1162
+ function numberAttribute(value, fallback) {
1163
+ if (value === null || value === undefined)
1164
+ return fallback;
1165
+ // An empty string is ABSENCE, not zero: Number('') is 0 in JS and null in Kotlin/Swift, and a
1166
+ // twin that disagrees on the empty attribute disagrees on every unset one.
1167
+ const text = value.trim().replace(/%$/, '').replace(/px$/i, '').replace(/pt$/i, '');
1168
+ if (text === '')
1169
+ return fallback;
1170
+ const n = Number(text);
1171
+ return Number.isFinite(n) ? n : fallback;
1172
+ }
1173
+ function wordAttribute(value, allowed, fallback) {
1174
+ if (value === null || value === undefined)
1175
+ return fallback;
1176
+ const word = value.trim().toLowerCase();
1177
+ for (const candidate of allowed)
1178
+ if (candidate.toLowerCase() === word)
1179
+ return candidate;
1180
+ return fallback;
1181
+ }
1182
+ /** CSS edge shorthand, exactly: 1, 2, 3 or 4 values. An author who has written CSS knows it. */
1183
+ export function parseEdgeInsets(value) {
1184
+ const zero = { top: 0, right: 0, bottom: 0, left: 0 };
1185
+ if (value === null || value === undefined)
1186
+ return zero;
1187
+ const parts = value.replace(/,/g, ' ').split(/\s+/).filter((p) => p.length > 0);
1188
+ const nums = parts.map((p) => numberAttribute(p, 0));
1189
+ if (nums.length === 0)
1190
+ return zero;
1191
+ if (nums.length === 1)
1192
+ return { top: round4(nums[0]), right: round4(nums[0]), bottom: round4(nums[0]), left: round4(nums[0]) };
1193
+ if (nums.length === 2)
1194
+ return { top: round4(nums[0]), right: round4(nums[1]), bottom: round4(nums[0]), left: round4(nums[1]) };
1195
+ if (nums.length === 3)
1196
+ return { top: round4(nums[0]), right: round4(nums[1]), bottom: round4(nums[2]), left: round4(nums[1]) };
1197
+ return { top: round4(nums[0]), right: round4(nums[1]), bottom: round4(nums[2]), left: round4(nums[3]) };
1198
+ }
1199
+ /**
1200
+ * The whole `<scroll>` attribute table, folded through ONE total function: no input throws, no
1201
+ * unrecognised word fails a build, and every unknown value falls back to the documented default.
1202
+ * These values come from authored markup and a dashboard field, not from a schema.
1203
+ *
1204
+ * `paging` and `snap` are one setting with two spellings, so paging resolves to `page` and
1205
+ * outranks a declared snap word rather than silently fighting it.
1206
+ */
1207
+ export function parseScrollConfig(attributes) {
1208
+ const paging = boolAttribute(attributes['paging'], false);
1209
+ const snapWord = wordAttribute(attributes['snap'], ['none', 'start', 'center', 'end'], 'none');
1210
+ const bounces = attributes['bounces'];
1211
+ return {
1212
+ axis: wordAttribute(attributes['axis'] ?? attributes['direction'], ['vertical', 'horizontal'], 'vertical'),
1213
+ bind: attributes['bind'] ?? null,
1214
+ indicators: boolAttribute(attributes['indicators'], true),
1215
+ bounces: bounces === null || bounces === undefined ? null : boolAttribute(bounces, true),
1216
+ paging,
1217
+ snap: paging ? 'page' : snapWord,
1218
+ keyboardDismiss: wordAttribute(attributes['keyboard-dismiss'], ['none', 'onDrag', 'interactive'], 'interactive'),
1219
+ keyboardReveal: wordAttribute(attributes['keyboard-reveal'], ['auto', 'none'], 'auto'),
1220
+ overscroll: wordAttribute(attributes['overscroll'], ['auto', 'never', 'always'], 'auto'),
1221
+ contentInset: parseEdgeInsets(attributes['contentInset']),
1222
+ maintainPosition: boolAttribute(attributes['maintain-position'], false),
1223
+ threshold: round4(Math.max(0, numberAttribute(attributes['threshold'], 0))),
1224
+ };
1225
+ }
1226
+ //# sourceMappingURL=scroll.js.map