@despia-native/kernel 0.0.0-coming-soon.0 → 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 +16 -1
  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 +141 -2
package/dist/motion.js ADDED
@@ -0,0 +1,260 @@
1
+ //
2
+ // motion.ts — THE UI MOTION ENGINE: the shared, corpus-pinned physics/math kernel for
3
+ // the NATIVE UI layer (`<stack>`, `<list>`, `<sheet>` — every element), platform-neutral
4
+ // and DOM-free. Law: architecture/proposals/ui-motion.md. Corpus:
5
+ // OpenSource/Conformance/motion/{curves,spring,retarget,physics}.json.
6
+ //
7
+ // THE PROBLEM THIS FILE ENDS: the UI layer has carried a motion VOCABULARY — `enter` ·
8
+ // `transition` · `keep` · `anim` · `animationCurveDuration`, universal attributes on every element
9
+ // on every renderer — with no motion ENGINE behind it. iOS resolved `animation-curve="spring"`
10
+ // through SwiftUI, Android through Compose, the web through a hand-picked
11
+ // `cubic-bezier(0.34, 1.28, 0.64, 1)`, and nothing held the three to the same curve.
12
+ // The SCENE layer already solved this for `<scene>` (scene/anim.ts + the animation
13
+ // corpus); this is the same treatment for the UI layer.
14
+ //
15
+ // ONE SPRING, ONE BEZIER SOLVER. This module implements NEITHER — it imports
16
+ // sceneBezier / sceneSpring / springSettleSeconds from ./scene/anim.ts and re-exports
17
+ // them. A second spring in this codebase would be a bug. What lives here is:
18
+ //
19
+ // • the `animation-curve=`/`animation-curve-duration=` PARSE into a typed MotionSpec, matching the native
20
+ // defaults exactly (SwiftUI unit beziers, 0.35 s curves; spring response 0.4 /
21
+ // damping 0.8 with animationCurveDuration setting the RESPONSE),
22
+ // • the SwiftUI response/dampingFraction → stiffness/damping CONVERSION (the crux of
23
+ // the 1:1 claim — pinned in spring.json),
24
+ // • motionProgress / motionSettleMs,
25
+ // • the RETARGET fold (the CSS-transition interruption model, on scalars),
26
+ // • the UI PHYSICS primitives: decay/fling, rubber-band overscroll, snap projection.
27
+ //
28
+ // Every renderer derives its native animation object from this: Compose's
29
+ // spring(dampingRatio, stiffness) / tween(ms, CubicBezierEasing) (StackMotion.kt),
30
+ // SwiftUI's .spring(response:dampingFraction:) / .timingCurve(…) (Stack.swift), and the
31
+ // web's CSS timing functions (dom/element-motion.ts — where the spring is sampled into
32
+ // a `linear()` easing, since CSS has no spring; that approximation is NAMED, not silent).
33
+ //
34
+ import { sceneBezier, sceneSpring, springSettleSeconds, } from "./scene/anim.js";
35
+ // THE one spring / one solver re-export — importers take them from here or from
36
+ // scene/anim.ts; there is no third implementation.
37
+ export { sceneBezier, sceneSpring, springSettleSeconds };
38
+ /** The SwiftUI unit beziers — identical to the CSS timing functions of the same names.
39
+ * `linear` is the degenerate (0,0,1,1) whose y(s) = x(s), i.e. the identity. */
40
+ export const MOTION_CURVES = {
41
+ linear: [0, 0, 1, 1],
42
+ "ease-in": [0.42, 0, 1, 1],
43
+ "ease-out": [0, 0, 0.58, 1],
44
+ "ease-in-out": [0.42, 0, 0.58, 1],
45
+ };
46
+ /** SwiftUI's default curve duration when none is authored. */
47
+ export const MOTION_DEFAULT_DURATION_MS = 350;
48
+ /** SwiftUI `.spring(response: 0.4, dampingFraction: 0.8)` — the native `animation-curve="spring"`. */
49
+ export const MOTION_SPRING_DEFAULT_RESPONSE = 0.4;
50
+ export const MOTION_SPRING_DEFAULT_DAMPING_FRACTION = 0.8;
51
+ /** THE CONVERSION — the crux of the 1:1 claim, pinned in Conformance/motion/spring.json.
52
+ * SwiftUI's response/dampingFraction describe a mass-1 damped oscillator:
53
+ * ωₙ = 2π/response · stiffness = ωₙ² · damping = 2·dampingFraction·ωₙ (so ζ = dampingFraction). */
54
+ export function motionSpringConstants(response, dampingFraction) {
55
+ const omega = (2 * Math.PI) / response;
56
+ return { stiffness: omega * omega, damping: 2 * dampingFraction * omega };
57
+ }
58
+ /** The `animation-curve-duration=` grammar: a plain decimal number of SECONDS, strictly > 0, on the
59
+ * TRIMMED string. `null` = absent (use the default, no diagnostic); `NaN` = malformed
60
+ * (one diagnostic + the default). Deliberately stricter than a bare Number()/Double():
61
+ * the three runtimes must agree on what is a duration, so the shape is a regex both
62
+ * Kotlin and Swift spell the same way. */
63
+ const DURATION_RE = /^[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;
64
+ function parseDurationSeconds(raw) {
65
+ if (raw === undefined || raw === null)
66
+ return null;
67
+ const text = raw.trim();
68
+ if (text.length === 0)
69
+ return null;
70
+ if (!DURATION_RE.test(text))
71
+ return NaN;
72
+ const value = Number(text);
73
+ if (!Number.isFinite(value) || value <= 0)
74
+ return NaN;
75
+ return value;
76
+ }
77
+ /** THE PARSE LAW. `anim` absent/empty is ease-in-out and is NOT an error; any other word
78
+ * falls back to ease-in-out with one diagnostic. `animationCurveDuration` sets the curve duration
79
+ * in seconds, or — for `spring` — the RESPONSE. */
80
+ export function parseMotion(anim, animationCurveDuration, diag) {
81
+ const parsedDuration = parseDurationSeconds(animationCurveDuration);
82
+ let seconds = null;
83
+ if (parsedDuration !== null && Number.isNaN(parsedDuration)) {
84
+ diag?.({
85
+ code: "malformed_motion",
86
+ message: `animation-curve-duration="${animationCurveDuration ?? ""}" is not a positive number of seconds — using the default`,
87
+ });
88
+ }
89
+ else {
90
+ seconds = parsedDuration;
91
+ }
92
+ let name = (anim ?? "").trim();
93
+ if (name.length === 0)
94
+ name = "ease-in-out";
95
+ if (name === "spring") {
96
+ const response = seconds ?? MOTION_SPRING_DEFAULT_RESPONSE;
97
+ const dampingFraction = MOTION_SPRING_DEFAULT_DAMPING_FRACTION;
98
+ const { stiffness, damping } = motionSpringConstants(response, dampingFraction);
99
+ return {
100
+ kind: "spring", name: "spring", response, dampingFraction, stiffness, damping,
101
+ durationMs: springSettleSeconds(stiffness, damping) * 1000,
102
+ };
103
+ }
104
+ if (!Object.prototype.hasOwnProperty.call(MOTION_CURVES, name)) {
105
+ diag?.({
106
+ code: "malformed_motion",
107
+ message: `animation-curve="${anim ?? ""}" is not spring·linear·ease-in·ease-out·ease-in-out — using ease-in-out`,
108
+ });
109
+ name = "ease-in-out";
110
+ }
111
+ const [x1, y1, x2, y2] = MOTION_CURVES[name];
112
+ return {
113
+ kind: "curve", name: name,
114
+ durationMs: seconds === null ? MOTION_DEFAULT_DURATION_MS : seconds * 1000,
115
+ x1, y1, x2, y2,
116
+ };
117
+ }
118
+ /** A spring spec built directly from the AUTHORING plane, for the framework's own
119
+ * springs (the overscroll release below) — `animation-curve="spring"` can only ever reach damping
120
+ * fraction 0.8, but the kernel's physics primitives name their own. */
121
+ export function motionSpring(response, dampingFraction) {
122
+ const { stiffness, damping } = motionSpringConstants(response, dampingFraction);
123
+ return {
124
+ kind: "spring", name: "spring", response, dampingFraction, stiffness, damping,
125
+ durationMs: springSettleSeconds(stiffness, damping) * 1000,
126
+ };
127
+ }
128
+ /** Attribute-map convenience — the shape every renderer actually holds. */
129
+ export function motionFromAttrs(attrs, diag) {
130
+ return parseMotion(attrs["animation-curve"], attrs["animation-curve-duration"], diag);
131
+ }
132
+ /** The two motion PRESETS a renderer applies when the author sets no `animation-curve=` on a
133
+ * built-in behaviour. Pinned in curves.json `presets` — a renderer must not invent a
134
+ * third. `keep` = the `keep="true"` hide/show fade; `press` = the button press-scale
135
+ * snap; `default` = a bare, unauthored `anim`. */
136
+ export const MOTION_PRESET_KEEP = parseMotion("ease-out", "0.18");
137
+ export const MOTION_PRESET_PRESS = parseMotion("ease-out", "0.12");
138
+ export const MOTION_PRESET_DEFAULT = parseMotion(undefined, undefined);
139
+ /** The scene easing a spec evaluates through — the bridge to the ONE spring/solver. */
140
+ export function motionEasing(spec) {
141
+ if (spec.kind === "spring") {
142
+ return { kind: "spring", stiffness: spec.stiffness, damping: spec.damping };
143
+ }
144
+ if (spec.name === "linear")
145
+ return { kind: "linear" };
146
+ return { kind: "bezier", x1: spec.x1, y1: spec.y1, x2: spec.x2, y2: spec.y2 };
147
+ }
148
+ /** THE PROGRESS LAW: 0..1 at elapsed CLIP time (ms). A curve normalizes by its
149
+ * duration; a spring runs on the REAL clock and clamps to exactly 1 at/after settle,
150
+ * so ending never snaps. An underdamped spring legitimately returns > 1 mid-flight. */
151
+ export function motionProgress(spec, elapsedMs) {
152
+ if (spec.kind === "spring") {
153
+ if (elapsedMs >= spec.durationMs)
154
+ return 1;
155
+ if (elapsedMs <= 0)
156
+ return 0;
157
+ return sceneSpring(elapsedMs / 1000, spec.stiffness, spec.damping);
158
+ }
159
+ const u = spec.durationMs <= 0 ? 1 : Math.min(Math.max(elapsedMs / spec.durationMs, 0), 1);
160
+ if (spec.name === "linear")
161
+ return u;
162
+ return sceneBezier(u, spec.x1, spec.y1, spec.x2, spec.y2);
163
+ }
164
+ /** THE SETTLE LAW: when a clip ends — the authored duration for a curve, the pinned
165
+ * 0.1%-envelope time for a spring (which is what `durationMs` already holds). */
166
+ export function motionSettleMs(spec) {
167
+ return spec.durationMs;
168
+ }
169
+ export function motionStart(from, to, startMs) {
170
+ return { from, to, startMs };
171
+ }
172
+ /** The rendered value at `nowMs`, and whether the clip has completed (at/after which
173
+ * the value is EXACTLY `to` — the override retires without a snap). */
174
+ export function motionValue(spec, state, nowMs) {
175
+ const elapsed = nowMs - state.startMs;
176
+ if (spec.durationMs <= 0 || elapsed >= spec.durationMs)
177
+ return { value: state.to, done: true };
178
+ const p = motionProgress(spec, elapsed);
179
+ return { value: state.from + (state.to - state.from) * p, done: false };
180
+ }
181
+ /** THE RETARGET LAW: a new target mid-flight starts a FRESH clip from the CURRENT
182
+ * rendered value. Never snap to the new target, never queue behind the old clip, and
183
+ * no special case for retargeting to the value already being animated toward. */
184
+ export function motionRetarget(spec, state, to, nowMs) {
185
+ return { from: motionValue(spec, state, nowMs).value, to, startMs: nowMs };
186
+ }
187
+ // ── the UI physics primitives (ui-motion.md phase 2) ─────────────────────────────────
188
+ //
189
+ // Offsets and dimensions are POINTS; velocities are POINTS PER MILLISECOND. These are
190
+ // pure folds the elements call — sheet detents, pagers, pickers, pull-to-refresh and
191
+ // lightbox dismissal all stop re-deriving their own feel.
192
+ /** `UIScrollView.DecelerationRate.normal`, per millisecond. */
193
+ export const MOTION_DECELERATION_RATE = 0.998;
194
+ /** τ = −1 / ln(rate) ms — the decay time constant (≈ 499.499833 ms). */
195
+ export const MOTION_DECAY_TAU_MS = -1 / Math.log(MOTION_DECELERATION_RATE);
196
+ /** Terminal velocity: at or under this a fling does not move at all (1 pt/s). */
197
+ export const MOTION_DECAY_MIN_VELOCITY = 0.001;
198
+ /** The standard iOS overscroll compression constant. */
199
+ export const MOTION_RUBBER_BAND_C = 0.55;
200
+ /** The overscroll RELEASE spring — critically damped, because a snap-back must never
201
+ * bounce past the edge it is returning to. */
202
+ export const MOTION_RUBBER_BAND_RELEASE = motionSpring(0.35, 1);
203
+ function atRest(v0) {
204
+ return !(Math.abs(v0) > MOTION_DECAY_MIN_VELOCITY);
205
+ }
206
+ /** THE DECAY LAW: x(t) = x0 + v0·τ·(1 − e^(−t/τ)). */
207
+ export function decayAt(x0, v0, tMs) {
208
+ if (tMs <= 0 || atRest(v0))
209
+ return x0;
210
+ return x0 + v0 * MOTION_DECAY_TAU_MS * (1 - Math.exp(-tMs / MOTION_DECAY_TAU_MS));
211
+ }
212
+ /** The resting offset — the t → ∞ limit x0 + v0·τ (x0 for a sub-threshold release). */
213
+ export function decayTarget(x0, v0) {
214
+ return atRest(v0) ? x0 : x0 + v0 * MOTION_DECAY_TAU_MS;
215
+ }
216
+ /** How long the fling lasts: τ·ln(|v0| / threshold), 0 for a sub-threshold release —
217
+ * never negative. */
218
+ export function decayDurationMs(v0) {
219
+ if (atRest(v0))
220
+ return 0;
221
+ return MOTION_DECAY_TAU_MS * Math.log(Math.abs(v0) / MOTION_DECAY_MIN_VELOCITY);
222
+ }
223
+ /** THE RUBBER-BAND LAW: f(x) = sign(x)·(1 − 1/(|x|·c/d + 1))·d — asymptotic, so no
224
+ * amount of finger travel moves the content more than `dimension` past the edge. */
225
+ export function rubberBand(x, dimension, c = MOTION_RUBBER_BAND_C) {
226
+ if (!(dimension > 0))
227
+ return 0;
228
+ const sign = x < 0 ? -1 : 1;
229
+ const a = Math.abs(x);
230
+ return sign * (1 - 1 / ((a * c) / dimension + 1)) * dimension;
231
+ }
232
+ /** Its exact inverse — x = (d/c)·(1/(1 − |y|/d) − 1), |y| clamped just inside d — so a
233
+ * gesture can resume from an already-compressed offset. */
234
+ export function rubberBandInverse(y, dimension, c = MOTION_RUBBER_BAND_C) {
235
+ if (!(dimension > 0))
236
+ return 0;
237
+ const sign = y < 0 ? -1 : 1;
238
+ const a = Math.min(Math.abs(y), dimension * 0.999999);
239
+ return sign * (dimension / c) * (1 / (1 - a / dimension) - 1);
240
+ }
241
+ /** THE SNAP LAW: project the release with the decay fold, then take the NEAREST snap
242
+ * point to that projection; an exact tie takes the LOWER point (deterministic on all
243
+ * three runtimes). The one law behind sheet detents, pagers and pickers. */
244
+ export function snapTarget(x0, v0, points) {
245
+ const projected = decayTarget(x0, v0);
246
+ if (points.length === 0)
247
+ return { projected, target: projected, index: -1 };
248
+ let bestIndex = 0;
249
+ let bestDistance = Math.abs(points[0] - projected);
250
+ for (let i = 1; i < points.length; i += 1) {
251
+ const distance = Math.abs(points[i] - projected);
252
+ if (distance < bestDistance - 1e-12
253
+ || (Math.abs(distance - bestDistance) <= 1e-12 && points[i] < points[bestIndex])) {
254
+ bestDistance = distance;
255
+ bestIndex = i;
256
+ }
257
+ }
258
+ return { projected, target: points[bestIndex], index: bestIndex };
259
+ }
260
+ //# sourceMappingURL=motion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion.js","sourceRoot":"","sources":["../src/motion.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,uFAAuF;AACvF,0FAA0F;AAC1F,mEAAmE;AACnE,wEAAwE;AACxE,EAAE;AACF,wFAAwF;AACxF,oGAAoG;AACpG,gGAAgG;AAChG,2EAA2E;AAC3E,sFAAsF;AACtF,oFAAoF;AACpF,yDAAyD;AACzD,EAAE;AACF,8EAA8E;AAC9E,uFAAuF;AACvF,8EAA8E;AAC9E,EAAE;AACF,4GAA4G;AAC5G,mFAAmF;AACnF,qEAAqE;AACrE,uFAAuF;AACvF,8CAA8C;AAC9C,uCAAuC;AACvC,6EAA6E;AAC7E,uFAAuF;AACvF,EAAE;AACF,2EAA2E;AAC3E,oFAAoF;AACpF,yFAAyF;AACzF,wFAAwF;AACxF,2FAA2F;AAC3F,EAAE;AAEF,OAAO,EACL,WAAW,EAAE,WAAW,EAAE,mBAAmB,GAC9C,MAAM,iBAAiB,CAAC;AAEzB,gFAAgF;AAChF,mDAAmD;AAC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,UAAU,UAAU,CACxB,EAAU,EAAE,EAAU,EAAE,MAAyB;IAEjD,MAAM,SAAS,GAAG,WAAW,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACtC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IAC5E,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAE,GAAG,SAAS,CAAC,CAAC;IACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAE,GAAG,SAAS,CAAC,CAAC;QAClD,IAAI,QAAQ,GAAG,YAAY,GAAG,KAAK;eAC9B,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,YAAY,CAAC,IAAI,KAAK,IAAI,MAAM,CAAC,CAAC,CAAE,GAAG,MAAM,CAAC,SAAS,CAAE,CAAC,EAAE,CAAC;YACrF,YAAY,GAAG,QAAQ,CAAC;YACxB,SAAS,GAAG,CAAC,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,SAAS,CAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AACrE,CAAC"}
@@ -0,0 +1,203 @@
1
+ import { type AvailabilityTable, type Remedy, type TargetRow, type Condition } from "./availability.ts";
2
+ export type MountTargetInput = {
3
+ /** availability rows of the host chain, nearest layer first */
4
+ chain: readonly TargetRow[];
5
+ table: Pick<AvailabilityTable, "axes" | "members" | "edges">;
6
+ /** a member the table knows, or absent for markup text (no row: it runs on every renderer) */
7
+ component?: string;
8
+ /** comma list of terms; empty or `auto` = `native, web` */
9
+ target?: string;
10
+ /** narrows in the member grammar: OR within an axis, AND across */
11
+ requires?: Record<string, readonly string[]>;
12
+ fallback?: string;
13
+ /** layer name -> launch OS version (absent = unknown) */
14
+ os?: Record<string, string>;
15
+ excluded?: readonly string[];
16
+ };
17
+ export type MountTarget = {
18
+ state: "resolved";
19
+ layer: string;
20
+ lane: string;
21
+ component?: string;
22
+ fallback?: true;
23
+ conditions?: Condition[];
24
+ } | {
25
+ state: "unavailable";
26
+ reason: string;
27
+ remedy: Remedy | null;
28
+ };
29
+ export declare function mountTerms(target: string | undefined): string[];
30
+ /** A term matches a layer by renderer class, lane, target name, or any axis value it carries. */
31
+ export declare function mountTermMatches(term: string, layer: TargetRow): boolean;
32
+ export declare function mountTarget(input: MountTargetInput): MountTarget;
33
+ export type MountMode = "strict" | "unrestricted";
34
+ export type MountCaller = {
35
+ kind: "markup" | "native" | "page";
36
+ origin?: string;
37
+ overTheAir?: boolean;
38
+ };
39
+ /** `scheme://host[:port]` with the scheme and host lowercased and a default port dropped; null when not an exact origin. */
40
+ export declare function mountOrigin(raw: string): string | null;
41
+ export declare function mountMode(caller: MountCaller, trustedOrigins: readonly string[]): MountMode;
42
+ /** lint: a trusted entry must be an exact origin; a wildcard or a path is refused */
43
+ export declare function mountTrustedProblems(trustedOrigins: readonly string[]): Array<{
44
+ entry: string;
45
+ code: string;
46
+ }>;
47
+ export declare const MOUNT_EDGES: readonly ["top", "bottom", "start", "end"];
48
+ export declare const MOUNT_LIMITS: {
49
+ readonly strictMounts: 3;
50
+ readonly rateCount: 10;
51
+ readonly rateWindowMs: 10000;
52
+ readonly propsBytes: 2048;
53
+ readonly strictExtent: 0.3;
54
+ };
55
+ export type MountRequest = {
56
+ id: string;
57
+ component?: string;
58
+ markup?: string;
59
+ edge?: string;
60
+ props?: Record<string, unknown>;
61
+ [k: string]: unknown;
62
+ };
63
+ export type MountPolicy = {
64
+ /** the app's allow list (exact `scheme.Component`) */
65
+ allow: readonly string[];
66
+ /** components whose package declares them overlay-safe in its manifest */
67
+ safe: readonly string[];
68
+ /** tags strict markup may use without allow-listing (the stock primitives) */
69
+ primitives: readonly string[];
70
+ };
71
+ export type MountState = {
72
+ strictMounts: readonly string[];
73
+ recent: readonly number[];
74
+ now: number;
75
+ };
76
+ export type MountVerdict = {
77
+ admit: boolean;
78
+ mode: MountMode;
79
+ code: string | null;
80
+ detail: string | null;
81
+ diagnostics: string[];
82
+ };
83
+ export declare function mountPropsProblem(props: Record<string, unknown> | undefined): string | null;
84
+ /** Tags a markup document uses, closing tags and the document wrapper words skipped. */
85
+ export declare function mountMarkupTags(markup: string): string[];
86
+ export declare function admitMount(req: MountRequest, mode: MountMode, policy: MountPolicy, state: MountState): MountVerdict;
87
+ /** Strict event delivery: declared names only, detail reduced to its scalar fields. */
88
+ export declare function mountEventOut(mode: MountMode, declared: readonly string[], name: string, detail: unknown): {
89
+ deliver: boolean;
90
+ detail: Record<string, unknown>;
91
+ };
92
+ export type MountInsets = {
93
+ top: number;
94
+ bottom: number;
95
+ start: number;
96
+ end: number;
97
+ };
98
+ export type MountMeasured = {
99
+ id: string;
100
+ edge?: string;
101
+ mode: MountMode;
102
+ width: number;
103
+ height: number;
104
+ };
105
+ export type MountPlaced = {
106
+ id: string;
107
+ edge: string | null;
108
+ offset: number;
109
+ extent: number;
110
+ clipped: boolean;
111
+ };
112
+ /**
113
+ * Edge mounts stack outward-in along their edge in declaration order, inside the safe area of that
114
+ * edge. An edge's inset is its safe area plus every mount on it, or 0 when nothing is mounted there,
115
+ * so a page that pads by the safe area alone is not double counted. A strict mount's extent is
116
+ * clipped at MOUNT_LIMITS.strictExtent of the surface's cross dimension. Floating and fill mounts
117
+ * reserve nothing.
118
+ */
119
+ export declare function mountLayout(mounts: readonly MountMeasured[], surface: {
120
+ width: number;
121
+ height: number;
122
+ }, safe: MountInsets): {
123
+ insets: MountInsets;
124
+ placed: MountPlaced[];
125
+ };
126
+ /** The page plane: the four custom properties the page script writes on :root. */
127
+ export declare function mountInsetProperties(insets: MountInsets): Record<string, string>;
128
+ export declare const MOUNT_SCHEMA = "dsx.mount.resolution/1";
129
+ /** closed and ordered: the order a tree is walked, so the first non-mountable node names the tree */
130
+ export declare const MOUNT_STATUSES: readonly ["mountable", "invalid", "not_installed", "not_imported", "version_mismatch", "not_declared", "unavailable_on_target", "permission_required", "blocked_by_strict_mode"];
131
+ export type MountStatus = typeof MOUNT_STATUSES[number];
132
+ export type MountNode = {
133
+ kind: "package" | "component";
134
+ name: string;
135
+ status: MountStatus;
136
+ /** a stable code from an existing registry: the availability reasons, the call errors, the
137
+ * availability conditions, or this module's declared `mount.*` errors; null when mountable */
138
+ code: string | null;
139
+ reason: string | null;
140
+ remedy: Remedy | null;
141
+ };
142
+ export type MountResolution = {
143
+ schema: typeof MOUNT_SCHEMA;
144
+ id: string;
145
+ status: MountStatus;
146
+ code: string | null;
147
+ reason: string | null;
148
+ remedy: Remedy | null;
149
+ mode: MountMode;
150
+ /** what the host shows: the requested tree, the declared fallback, or nothing */
151
+ renders: "primary" | "fallback" | "nothing";
152
+ evaluatedOn: {
153
+ runtime: string;
154
+ chain: string[];
155
+ layer: string | null;
156
+ };
157
+ target: MountTarget | null;
158
+ nodes: MountNode[];
159
+ fallback: MountResolution | null;
160
+ };
161
+ export type MountPackage = {
162
+ version: string;
163
+ /** the package's PUBLIC component declarations (its dsx.json), by local name */
164
+ components: Record<string, {
165
+ overlay?: "safe";
166
+ events?: readonly string[];
167
+ }>;
168
+ };
169
+ export type MountWorld = {
170
+ runtime: string;
171
+ /** the app's dsx.json imports: package chains; an imported chain imports its sub-packages */
172
+ imports: readonly string[];
173
+ /** every package the build carries, by chain */
174
+ packages: Record<string, MountPackage>;
175
+ /** the app's OWN components (bare tags): the app is their package, so they need no import and the
176
+ * app's allow list is their only key in strict mode */
177
+ app?: readonly string[];
178
+ chain: readonly TargetRow[];
179
+ table: Pick<AvailabilityTable, "axes" | "members" | "edges">;
180
+ os?: Record<string, string>;
181
+ excluded?: readonly string[];
182
+ /** live conditions per member (`dsx.condition`): code -> { setting } */
183
+ conditions?: Record<string, Record<string, {
184
+ setting?: string | null;
185
+ }>>;
186
+ policy: Omit<MountPolicy, "safe">;
187
+ mode: MountMode;
188
+ state: MountState;
189
+ };
190
+ export type MountSpec = MountRequest & {
191
+ target?: string;
192
+ requires?: Record<string, readonly string[]>;
193
+ fallback?: string;
194
+ /** the owning package's version range: `1.2.0`, `^1.2`, `~1.2`, `>=1.2` */
195
+ version?: string;
196
+ };
197
+ /**
198
+ * THE PREFLIGHT, and the answer every failed mount carries: one versioned tree of every package,
199
+ * sub-package and component the spec names, each with a status from MOUNT_STATUSES and a code
200
+ * from an existing registry, the resolved target, the mode, and the declared fallback's own tree.
201
+ */
202
+ export declare function mountResolve(spec: MountSpec, world: MountWorld): MountResolution;
203
+ //# sourceMappingURL=mount-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount-core.d.ts","sourceRoot":"","sources":["../src/mount-core.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAW,KAAK,iBAAiB,EAAoC,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInJ,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+DAA+D;IAC/D,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;IAC7D,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM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