@askrjs/askr 0.0.28 → 0.0.30

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 (457) hide show
  1. package/README.md +44 -172
  2. package/dist/_virtual/_rolldown/runtime.js +7 -0
  3. package/dist/bench/components/benchmark-row.d.ts +20 -0
  4. package/dist/bench/components/benchmark-row.d.ts.map +1 -0
  5. package/dist/bench/components/benchmark-row.js +42 -0
  6. package/dist/bench/components/benchmark-row.js.map +1 -0
  7. package/dist/bench/components/benchmark-table.js +25 -0
  8. package/dist/bench/components/benchmark-table.js.map +1 -0
  9. package/dist/benchmark.d.ts +22 -0
  10. package/dist/benchmark.d.ts.map +1 -0
  11. package/dist/benchmark.js +64 -1
  12. package/dist/benchmark.js.map +1 -0
  13. package/dist/bin/askr-ssg.d.ts +22 -26
  14. package/dist/bin/askr-ssg.d.ts.map +1 -1
  15. package/dist/bin/askr-ssg.js +149 -2
  16. package/dist/bin/askr-ssg.js.map +1 -0
  17. package/dist/boot/index.d.ts +64 -42
  18. package/dist/boot/index.d.ts.map +1 -1
  19. package/dist/boot/index.js +416 -2
  20. package/dist/boot/index.js.map +1 -0
  21. package/dist/common/component.d.ts +14 -13
  22. package/dist/common/component.d.ts.map +1 -1
  23. package/dist/common/control.d.ts +13 -0
  24. package/dist/common/control.d.ts.map +1 -0
  25. package/dist/common/control.js +14 -0
  26. package/dist/common/control.js.map +1 -0
  27. package/dist/common/env.js +47 -0
  28. package/dist/common/env.js.map +1 -0
  29. package/dist/common/jsx.d.ts +17 -15
  30. package/dist/common/jsx.d.ts.map +1 -1
  31. package/dist/common/jsx.js +8 -1
  32. package/dist/common/jsx.js.map +1 -0
  33. package/dist/common/props.d.ts +14 -11
  34. package/dist/common/props.d.ts.map +1 -1
  35. package/dist/common/router.d.ts +190 -32
  36. package/dist/common/router.d.ts.map +1 -1
  37. package/dist/common/ssr-errors.d.ts +6 -3
  38. package/dist/common/ssr-errors.d.ts.map +1 -1
  39. package/dist/common/ssr-errors.js +16 -1
  40. package/dist/common/ssr-errors.js.map +1 -0
  41. package/dist/common/ssr.d.ts +12 -9
  42. package/dist/common/ssr.d.ts.map +1 -1
  43. package/dist/common/vnode.d.ts +17 -15
  44. package/dist/common/vnode.d.ts.map +1 -1
  45. package/dist/common/vnode.js +10 -1
  46. package/dist/common/vnode.js.map +1 -0
  47. package/dist/components/link.d.ts +37 -25
  48. package/dist/components/link.d.ts.map +1 -1
  49. package/dist/components/link.js +64 -1
  50. package/dist/components/link.js.map +1 -0
  51. package/dist/control/case.d.ts +17 -0
  52. package/dist/control/case.d.ts.map +1 -0
  53. package/dist/control/case.js +69 -0
  54. package/dist/control/case.js.map +1 -0
  55. package/dist/control/for.d.ts +23 -0
  56. package/dist/control/for.d.ts.map +1 -0
  57. package/dist/control/for.js +62 -0
  58. package/dist/control/for.js.map +1 -0
  59. package/dist/control/index.d.ts +4 -0
  60. package/dist/control/index.js +4 -0
  61. package/dist/control/shared.js +20 -0
  62. package/dist/control/shared.js.map +1 -0
  63. package/dist/control/show.d.ts +14 -0
  64. package/dist/control/show.d.ts.map +1 -0
  65. package/dist/control/show.js +33 -0
  66. package/dist/control/show.js.map +1 -0
  67. package/dist/dev/invariant.js +29 -2
  68. package/dist/dev/invariant.js.map +1 -0
  69. package/dist/dev/logger.js +37 -1
  70. package/dist/dev/logger.js.map +1 -0
  71. package/dist/foundations/core.d.ts +15 -23
  72. package/dist/foundations/core.js +13 -1
  73. package/dist/foundations/icon/icon.d.ts +53 -0
  74. package/dist/foundations/icon/icon.d.ts.map +1 -0
  75. package/dist/foundations/icon/icon.js +88 -0
  76. package/dist/foundations/icon/icon.js.map +1 -0
  77. package/dist/foundations/icon/icon.types.d.ts +21 -0
  78. package/dist/foundations/icon/icon.types.d.ts.map +1 -0
  79. package/dist/foundations/index.d.ts +23 -3
  80. package/dist/foundations/index.js +22 -1
  81. package/dist/foundations/interactions/dismissable.d.ts +25 -17
  82. package/dist/foundations/interactions/dismissable.d.ts.map +1 -1
  83. package/dist/foundations/interactions/dismissable.js +26 -1
  84. package/dist/foundations/interactions/dismissable.js.map +1 -0
  85. package/dist/foundations/interactions/focusable.d.ts +13 -7
  86. package/dist/foundations/interactions/focusable.d.ts.map +1 -1
  87. package/dist/foundations/interactions/focusable.js +18 -1
  88. package/dist/foundations/interactions/focusable.js.map +1 -0
  89. package/dist/foundations/interactions/hoverable.d.ts +17 -10
  90. package/dist/foundations/interactions/hoverable.d.ts.map +1 -1
  91. package/dist/foundations/interactions/hoverable.js +15 -1
  92. package/dist/foundations/interactions/hoverable.js.map +1 -0
  93. package/dist/foundations/interactions/interaction-policy.d.ts +32 -78
  94. package/dist/foundations/interactions/interaction-policy.d.ts.map +1 -1
  95. package/dist/foundations/interactions/interaction-policy.js +122 -1
  96. package/dist/foundations/interactions/interaction-policy.js.map +1 -0
  97. package/dist/foundations/interactions/pressable.d.ts +25 -18
  98. package/dist/foundations/interactions/pressable.d.ts.map +1 -1
  99. package/dist/foundations/interactions/pressable.js +51 -1
  100. package/dist/foundations/interactions/pressable.js.map +1 -0
  101. package/dist/foundations/interactions/roving-focus.d.ts +49 -114
  102. package/dist/foundations/interactions/roving-focus.d.ts.map +1 -1
  103. package/dist/foundations/interactions/roving-focus.js +71 -1
  104. package/dist/foundations/interactions/roving-focus.js.map +1 -0
  105. package/dist/foundations/state/controllable.d.ts +22 -41
  106. package/dist/foundations/state/controllable.d.ts.map +1 -1
  107. package/dist/foundations/state/controllable.js +81 -1
  108. package/dist/foundations/state/controllable.js.map +1 -0
  109. package/dist/foundations/structures/collection.d.ts +25 -40
  110. package/dist/foundations/structures/collection.d.ts.map +1 -1
  111. package/dist/foundations/structures/collection.js +51 -1
  112. package/dist/foundations/structures/collection.js.map +1 -0
  113. package/dist/foundations/structures/layer.d.ts +47 -68
  114. package/dist/foundations/structures/layer.d.ts.map +1 -1
  115. package/dist/foundations/structures/layer.js +81 -1
  116. package/dist/foundations/structures/layer.js.map +1 -0
  117. package/dist/foundations/structures/layout.d.ts +6 -3
  118. package/dist/foundations/structures/layout.d.ts.map +1 -1
  119. package/dist/foundations/structures/layout.js +13 -1
  120. package/dist/foundations/structures/layout.js.map +1 -0
  121. package/dist/foundations/structures/portal.d.ts +17 -10
  122. package/dist/foundations/structures/portal.d.ts.map +1 -1
  123. package/dist/foundations/structures/portal.js +105 -1
  124. package/dist/foundations/structures/portal.js.map +1 -0
  125. package/dist/foundations/structures/presence.d.ts +11 -5
  126. package/dist/foundations/structures/presence.d.ts.map +1 -1
  127. package/dist/foundations/structures/presence.js +39 -1
  128. package/dist/foundations/structures/presence.js.map +1 -0
  129. package/dist/foundations/structures/slot.d.ts +11 -8
  130. package/dist/foundations/structures/slot.d.ts.map +1 -1
  131. package/dist/foundations/structures/slot.js +41 -1
  132. package/dist/foundations/structures/slot.js.map +1 -0
  133. package/dist/foundations/structures.d.ts +7 -14
  134. package/dist/foundations/structures.js +6 -1
  135. package/dist/foundations/utilities/aria.d.ts +9 -6
  136. package/dist/foundations/utilities/aria.d.ts.map +1 -1
  137. package/dist/foundations/utilities/aria.js +17 -1
  138. package/dist/foundations/utilities/aria.js.map +1 -0
  139. package/dist/foundations/utilities/compose-handlers.d.ts +10 -7
  140. package/dist/foundations/utilities/compose-handlers.d.ts.map +1 -1
  141. package/dist/foundations/utilities/compose-handlers.js +20 -1
  142. package/dist/foundations/utilities/compose-handlers.js.map +1 -0
  143. package/dist/foundations/utilities/compose-ref.d.ts +7 -4
  144. package/dist/foundations/utilities/compose-ref.d.ts.map +1 -1
  145. package/dist/foundations/utilities/compose-ref.js +18 -1
  146. package/dist/foundations/utilities/compose-ref.js.map +1 -0
  147. package/dist/foundations/utilities/event-types.d.ts +14 -11
  148. package/dist/foundations/utilities/event-types.d.ts.map +1 -1
  149. package/dist/foundations/utilities/merge-props.d.ts +4 -1
  150. package/dist/foundations/utilities/merge-props.d.ts.map +1 -1
  151. package/dist/foundations/utilities/merge-props.js +49 -1
  152. package/dist/foundations/utilities/merge-props.js.map +1 -0
  153. package/dist/foundations/utilities/use-id.d.ts +9 -6
  154. package/dist/foundations/utilities/use-id.d.ts.map +1 -1
  155. package/dist/foundations/utilities/use-id.js +29 -1
  156. package/dist/foundations/utilities/use-id.js.map +1 -0
  157. package/dist/fx/fx.d.ts +24 -21
  158. package/dist/fx/fx.d.ts.map +1 -1
  159. package/dist/fx/fx.js +212 -1
  160. package/dist/fx/fx.js.map +1 -0
  161. package/dist/fx/index.d.ts +4 -7
  162. package/dist/fx/index.js +4 -1
  163. package/dist/fx/noop.js +9 -1
  164. package/dist/fx/noop.js.map +1 -0
  165. package/dist/fx/timing.d.ts +24 -21
  166. package/dist/fx/timing.d.ts.map +1 -1
  167. package/dist/fx/timing.js +236 -1
  168. package/dist/fx/timing.js.map +1 -0
  169. package/dist/index.d.ts +21 -23
  170. package/dist/index.js +34 -1
  171. package/dist/index.js.map +1 -0
  172. package/dist/jsx/index.d.ts +1 -4
  173. package/dist/jsx/index.js +3 -1
  174. package/dist/jsx/types.d.ts +18 -25
  175. package/dist/jsx/types.d.ts.map +1 -1
  176. package/dist/jsx/types.js +1 -1
  177. package/dist/jsx/utils.d.ts +4 -3
  178. package/dist/jsx/utils.d.ts.map +1 -1
  179. package/dist/jsx/utils.js +19 -1
  180. package/dist/jsx/utils.js.map +1 -0
  181. package/dist/jsx-dev-runtime.d.ts +8 -0
  182. package/dist/jsx-dev-runtime.d.ts.map +1 -0
  183. package/dist/jsx-dev-runtime.js +32 -1
  184. package/dist/jsx-dev-runtime.js.map +1 -0
  185. package/dist/jsx-runtime.d.ts +12 -0
  186. package/dist/jsx-runtime.d.ts.map +1 -0
  187. package/dist/jsx-runtime.js +45 -1
  188. package/dist/jsx-runtime.js.map +1 -0
  189. package/dist/jsx-runtime2.d.ts +2 -0
  190. package/dist/jsx-runtime2.js +3 -0
  191. package/dist/renderer/children.js +293 -0
  192. package/dist/renderer/children.js.map +1 -0
  193. package/dist/renderer/cleanup.js +150 -1
  194. package/dist/renderer/cleanup.js.map +1 -0
  195. package/dist/renderer/dom.js +2439 -1
  196. package/dist/renderer/dom.js.map +1 -0
  197. package/dist/renderer/env.js +1 -0
  198. package/dist/renderer/evaluate.js +450 -1
  199. package/dist/renderer/evaluate.js.map +1 -0
  200. package/dist/renderer/fastpath.js +145 -1
  201. package/dist/renderer/fastpath.js.map +1 -0
  202. package/dist/renderer/index.js +24 -1
  203. package/dist/renderer/index.js.map +1 -0
  204. package/dist/renderer/keyed.js +119 -1
  205. package/dist/renderer/keyed.js.map +1 -0
  206. package/dist/renderer/reconcile.js +359 -1
  207. package/dist/renderer/reconcile.js.map +1 -0
  208. package/dist/renderer/types.js +1 -1
  209. package/dist/renderer/utils.js +220 -1
  210. package/dist/renderer/utils.js.map +1 -0
  211. package/dist/resources/index.d.ts +3 -9
  212. package/dist/resources/index.js +3 -1
  213. package/dist/router/index.d.ts +6 -10
  214. package/dist/router/index.js +5 -1
  215. package/dist/router/match.js +83 -1
  216. package/dist/router/match.js.map +1 -0
  217. package/dist/router/navigate.d.ts +20 -8
  218. package/dist/router/navigate.d.ts.map +1 -1
  219. package/dist/router/navigate.js +288 -1
  220. package/dist/router/navigate.js.map +1 -0
  221. package/dist/router/policy.d.ts +22 -0
  222. package/dist/router/policy.d.ts.map +1 -0
  223. package/dist/router/policy.js +116 -0
  224. package/dist/router/policy.js.map +1 -0
  225. package/dist/router/route-context.js +79 -0
  226. package/dist/router/route-context.js.map +1 -0
  227. package/dist/router/route.d.ts +101 -34
  228. package/dist/router/route.d.ts.map +1 -1
  229. package/dist/router/route.js +599 -1
  230. package/dist/router/route.js.map +1 -0
  231. package/dist/runtime/child-scope.d.ts +21 -0
  232. package/dist/runtime/child-scope.d.ts.map +1 -0
  233. package/dist/runtime/child-scope.js +77 -0
  234. package/dist/runtime/child-scope.js.map +1 -0
  235. package/dist/runtime/component.d.ts +67 -56
  236. package/dist/runtime/component.d.ts.map +1 -1
  237. package/dist/runtime/component.js +462 -1
  238. package/dist/runtime/component.js.map +1 -0
  239. package/dist/runtime/context.d.ts +28 -42
  240. package/dist/runtime/context.d.ts.map +1 -1
  241. package/dist/runtime/context.js +205 -1
  242. package/dist/runtime/context.js.map +1 -0
  243. package/dist/runtime/control.d.ts +43 -0
  244. package/dist/runtime/control.d.ts.map +1 -0
  245. package/dist/runtime/control.js +125 -0
  246. package/dist/runtime/control.js.map +1 -0
  247. package/dist/runtime/derive.d.ts +12 -9
  248. package/dist/runtime/derive.d.ts.map +1 -1
  249. package/dist/runtime/derive.js +134 -1
  250. package/dist/runtime/derive.js.map +1 -0
  251. package/dist/runtime/dev-namespace.js +57 -1
  252. package/dist/runtime/dev-namespace.js.map +1 -0
  253. package/dist/runtime/effect.d.ts +32 -0
  254. package/dist/runtime/effect.d.ts.map +1 -0
  255. package/dist/runtime/effect.js +146 -0
  256. package/dist/runtime/effect.js.map +1 -0
  257. package/dist/runtime/events.js +162 -1
  258. package/dist/runtime/events.js.map +1 -0
  259. package/dist/runtime/execution-model.js +15 -1
  260. package/dist/runtime/execution-model.js.map +1 -0
  261. package/dist/runtime/fastlane.js +204 -1
  262. package/dist/runtime/fastlane.js.map +1 -0
  263. package/dist/runtime/for-bench.d.ts +41 -0
  264. package/dist/runtime/for-bench.d.ts.map +1 -0
  265. package/dist/runtime/for-bench.js +173 -0
  266. package/dist/runtime/for-bench.js.map +1 -0
  267. package/dist/runtime/for.d.ts +62 -49
  268. package/dist/runtime/for.d.ts.map +1 -1
  269. package/dist/runtime/for.js +668 -1
  270. package/dist/runtime/for.js.map +1 -0
  271. package/dist/runtime/operations.d.ts +18 -15
  272. package/dist/runtime/operations.d.ts.map +1 -1
  273. package/dist/runtime/operations.js +209 -1
  274. package/dist/runtime/operations.js.map +1 -0
  275. package/dist/runtime/perf-metrics.js +64 -1
  276. package/dist/runtime/perf-metrics.js.map +1 -0
  277. package/dist/runtime/readable.d.ts +24 -18
  278. package/dist/runtime/readable.d.ts.map +1 -1
  279. package/dist/runtime/readable.js +118 -1
  280. package/dist/runtime/readable.js.map +1 -0
  281. package/dist/runtime/resource-cell.js +102 -1
  282. package/dist/runtime/resource-cell.js.map +1 -0
  283. package/dist/runtime/scheduler.d.ts +51 -50
  284. package/dist/runtime/scheduler.d.ts.map +1 -1
  285. package/dist/runtime/scheduler.js +328 -1
  286. package/dist/runtime/scheduler.js.map +1 -0
  287. package/dist/runtime/selector.d.ts +7 -5
  288. package/dist/runtime/selector.d.ts.map +1 -1
  289. package/dist/runtime/selector.js +188 -1
  290. package/dist/runtime/selector.js.map +1 -0
  291. package/dist/runtime/ssr-bridge.js +24 -1
  292. package/dist/runtime/ssr-bridge.js.map +1 -0
  293. package/dist/runtime/state.d.ts +11 -19
  294. package/dist/runtime/state.d.ts.map +1 -1
  295. package/dist/runtime/state.js +99 -1
  296. package/dist/runtime/state.js.map +1 -0
  297. package/dist/ssg/batch-render.d.ts +10 -10
  298. package/dist/ssg/batch-render.d.ts.map +1 -1
  299. package/dist/ssg/batch-render.js +84 -1
  300. package/dist/ssg/batch-render.js.map +1 -0
  301. package/dist/ssg/create-static-gen.d.ts +28 -29
  302. package/dist/ssg/create-static-gen.d.ts.map +1 -1
  303. package/dist/ssg/create-static-gen.js +282 -1
  304. package/dist/ssg/create-static-gen.js.map +1 -0
  305. package/dist/ssg/generate-metadata.d.ts +12 -15
  306. package/dist/ssg/generate-metadata.d.ts.map +1 -1
  307. package/dist/ssg/generate-metadata.js +94 -1
  308. package/dist/ssg/generate-metadata.js.map +1 -0
  309. package/dist/ssg/incremental-manifest.js +56 -1
  310. package/dist/ssg/incremental-manifest.js.map +1 -0
  311. package/dist/ssg/index.d.ts +8 -28
  312. package/dist/ssg/index.js +7 -1
  313. package/dist/ssg/resolve-ssg-data.d.ts +10 -13
  314. package/dist/ssg/resolve-ssg-data.d.ts.map +1 -1
  315. package/dist/ssg/resolve-ssg-data.js +46 -1
  316. package/dist/ssg/resolve-ssg-data.js.map +1 -0
  317. package/dist/ssg/route-utils.d.ts +14 -10
  318. package/dist/ssg/route-utils.d.ts.map +1 -1
  319. package/dist/ssg/route-utils.js +24 -1
  320. package/dist/ssg/route-utils.js.map +1 -0
  321. package/dist/ssg/types.d.ts +157 -144
  322. package/dist/ssg/types.d.ts.map +1 -1
  323. package/dist/ssg/write-static-files.d.ts +8 -14
  324. package/dist/ssg/write-static-files.d.ts.map +1 -1
  325. package/dist/ssg/write-static-files.js +73 -1
  326. package/dist/ssg/write-static-files.js.map +1 -0
  327. package/dist/ssr/attrs.js +93 -1
  328. package/dist/ssr/attrs.js.map +1 -0
  329. package/dist/ssr/context.d.ts +31 -35
  330. package/dist/ssr/context.d.ts.map +1 -1
  331. package/dist/ssr/context.js +63 -1
  332. package/dist/ssr/context.js.map +1 -0
  333. package/dist/ssr/errors.d.ts +6 -4
  334. package/dist/ssr/errors.d.ts.map +1 -1
  335. package/dist/ssr/errors.js +4 -1
  336. package/dist/ssr/errors.js.map +1 -0
  337. package/dist/ssr/escape.js +153 -1
  338. package/dist/ssr/escape.js.map +1 -0
  339. package/dist/ssr/index.d.ts +74 -72
  340. package/dist/ssr/index.d.ts.map +1 -1
  341. package/dist/ssr/index.js +543 -1
  342. package/dist/ssr/index.js.map +1 -0
  343. package/dist/ssr/render-keys.d.ts +27 -29
  344. package/dist/ssr/render-keys.d.ts.map +1 -1
  345. package/dist/ssr/render-keys.js +39 -1
  346. package/dist/ssr/render-keys.js.map +1 -0
  347. package/dist/ssr/sink.js +86 -1
  348. package/dist/ssr/sink.js.map +1 -0
  349. package/dist/ssr/stream-render.js +76 -1
  350. package/dist/ssr/stream-render.js.map +1 -0
  351. package/dist/ssr/types.d.ts +14 -13
  352. package/dist/ssr/types.d.ts.map +1 -1
  353. package/package.json +49 -69
  354. package/dist/_virtual/___vite-browser-external.js +0 -1
  355. package/dist/_virtual/__vite-browser-external.js +0 -1
  356. package/dist/_virtual/_commonjsHelpers.js +0 -1
  357. package/dist/_virtual/_fs.js +0 -1
  358. package/dist/_virtual/_path.js +0 -1
  359. package/dist/_virtual/main.js +0 -1
  360. package/dist/_virtual/preload-helper.js +0 -1
  361. package/dist/bench/benchmark-entry.d.ts +0 -14
  362. package/dist/bench/benchmark-entry.d.ts.map +0 -1
  363. package/dist/common/errors.d.ts +0 -53
  364. package/dist/common/errors.d.ts.map +0 -1
  365. package/dist/common/index.d.ts +0 -14
  366. package/dist/common/index.d.ts.map +0 -1
  367. package/dist/dev/invariant.d.ts +0 -83
  368. package/dist/dev/invariant.d.ts.map +0 -1
  369. package/dist/dev/logger.d.ts +0 -13
  370. package/dist/dev/logger.d.ts.map +0 -1
  371. package/dist/dev/vite-plugin-askr.d.ts +0 -25
  372. package/dist/dev/vite-plugin-askr.d.ts.map +0 -1
  373. package/dist/dev/warnings.d.ts +0 -5
  374. package/dist/dev/warnings.d.ts.map +0 -1
  375. package/dist/for/for.d.ts +0 -16
  376. package/dist/for/for.d.ts.map +0 -1
  377. package/dist/for/for.js +0 -1
  378. package/dist/for/index.d.ts +0 -2
  379. package/dist/for/index.d.ts.map +0 -1
  380. package/dist/for/index.js +0 -1
  381. package/dist/foundations/core.d.ts.map +0 -1
  382. package/dist/foundations/index.d.ts.map +0 -1
  383. package/dist/foundations/interactions/index.d.ts +0 -5
  384. package/dist/foundations/interactions/index.d.ts.map +0 -1
  385. package/dist/foundations/state/index.d.ts +0 -2
  386. package/dist/foundations/state/index.d.ts.map +0 -1
  387. package/dist/foundations/structures/index.d.ts +0 -5
  388. package/dist/foundations/structures/index.d.ts.map +0 -1
  389. package/dist/foundations/structures.d.ts.map +0 -1
  390. package/dist/foundations/utilities/index.d.ts +0 -7
  391. package/dist/foundations/utilities/index.d.ts.map +0 -1
  392. package/dist/fx/index.d.ts.map +0 -1
  393. package/dist/fx/noop.d.ts +0 -12
  394. package/dist/fx/noop.d.ts.map +0 -1
  395. package/dist/index.d.ts.map +0 -1
  396. package/dist/jsx/index.d.ts.map +0 -1
  397. package/dist/jsx/jsx-dev-runtime.d.ts +0 -4
  398. package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
  399. package/dist/jsx/jsx-runtime.d.ts +0 -10
  400. package/dist/jsx/jsx-runtime.d.ts.map +0 -1
  401. package/dist/node_modules/esbuild/lib/main.js +0 -65
  402. package/dist/renderer/cleanup.d.ts +0 -28
  403. package/dist/renderer/cleanup.d.ts.map +0 -1
  404. package/dist/renderer/dom.d.ts +0 -64
  405. package/dist/renderer/dom.d.ts.map +0 -1
  406. package/dist/renderer/evaluate.d.ts +0 -4
  407. package/dist/renderer/evaluate.d.ts.map +0 -1
  408. package/dist/renderer/fastpath.d.ts +0 -7
  409. package/dist/renderer/fastpath.d.ts.map +0 -1
  410. package/dist/renderer/index.d.ts +0 -6
  411. package/dist/renderer/index.d.ts.map +0 -1
  412. package/dist/renderer/keyed.d.ts +0 -23
  413. package/dist/renderer/keyed.d.ts.map +0 -1
  414. package/dist/renderer/reconcile.d.ts +0 -88
  415. package/dist/renderer/reconcile.d.ts.map +0 -1
  416. package/dist/renderer/types.d.ts +0 -3
  417. package/dist/renderer/types.d.ts.map +0 -1
  418. package/dist/renderer/utils.d.ts +0 -63
  419. package/dist/renderer/utils.d.ts.map +0 -1
  420. package/dist/resources/index.d.ts.map +0 -1
  421. package/dist/router/index.d.ts.map +0 -1
  422. package/dist/router/match.d.ts +0 -22
  423. package/dist/router/match.d.ts.map +0 -1
  424. package/dist/runtime/dev-namespace.d.ts +0 -31
  425. package/dist/runtime/dev-namespace.d.ts.map +0 -1
  426. package/dist/runtime/events.d.ts +0 -53
  427. package/dist/runtime/events.d.ts.map +0 -1
  428. package/dist/runtime/execution-model.d.ts +0 -4
  429. package/dist/runtime/execution-model.d.ts.map +0 -1
  430. package/dist/runtime/fastlane.d.ts +0 -27
  431. package/dist/runtime/fastlane.d.ts.map +0 -1
  432. package/dist/runtime/hydration.d.ts +0 -25
  433. package/dist/runtime/hydration.d.ts.map +0 -1
  434. package/dist/runtime/perf-metrics.d.ts +0 -25
  435. package/dist/runtime/perf-metrics.d.ts.map +0 -1
  436. package/dist/runtime/resource-cell.d.ts +0 -35
  437. package/dist/runtime/resource-cell.d.ts.map +0 -1
  438. package/dist/runtime/snapshot.d.ts +0 -25
  439. package/dist/runtime/snapshot.d.ts.map +0 -1
  440. package/dist/runtime/ssr-bridge.d.ts +0 -10
  441. package/dist/runtime/ssr-bridge.d.ts.map +0 -1
  442. package/dist/ssg/discover-resources.d.ts +0 -15
  443. package/dist/ssg/discover-resources.d.ts.map +0 -1
  444. package/dist/ssg/incremental-manifest.d.ts +0 -23
  445. package/dist/ssg/incremental-manifest.d.ts.map +0 -1
  446. package/dist/ssg/index.d.ts.map +0 -1
  447. package/dist/ssr/attrs.d.ts +0 -26
  448. package/dist/ssr/attrs.d.ts.map +0 -1
  449. package/dist/ssr/create-ssr.d.ts +0 -19
  450. package/dist/ssr/create-ssr.d.ts.map +0 -1
  451. package/dist/ssr/escape.d.ts +0 -38
  452. package/dist/ssr/escape.d.ts.map +0 -1
  453. package/dist/ssr/sink.d.ts +0 -23
  454. package/dist/ssr/sink.d.ts.map +0 -1
  455. package/dist/ssr/stream-render.d.ts +0 -7
  456. package/dist/ssr/stream-render.d.ts.map +0 -1
  457. package/dist/vite/index.js +0 -4
@@ -1 +1,64 @@
1
- import{navigate as u}from"../router/navigate.js";import{applyInteractionPolicy as m}from"../foundations/interactions/interaction-policy.js";import{mergeProps as f}from"../foundations/utilities/merge-props.js";import{jsx as p}from"../jsx-runtime.js";function d({href:r,class:a,children:n,rel:i,target:e,"aria-current":o,"aria-label":s}){const l=m({isNative:!0,disabled:!1,onPress:c=>{const t=c;(t.button??0)!==0||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||e||(t.preventDefault(),u(r))}});return p("a",f(l,{href:r,class:a,rel:i,target:e,"aria-current":o,"aria-label":s,children:n}))}export{d as Link};
1
+ import { jsx } from "../jsx-runtime.js";
2
+ import { navigate } from "../router/navigate.js";
3
+ import { mergeProps } from "../foundations/utilities/merge-props.js";
4
+ import { applyInteractionPolicy } from "../foundations/interactions/interaction-policy.js";
5
+ import "../jsx-runtime2.js";
6
+ //#region src/components/link.tsx
7
+ /**
8
+ * Link component for client-side navigation
9
+ */
10
+ /**
11
+ * Link component that prevents default navigation and uses navigate()
12
+ * Provides declarative way to navigate between routes
13
+ *
14
+ * Accessibility features:
15
+ * - Proper semantic <a> element (not a button)
16
+ * - Supports aria-current for indicating active page
17
+ * - Supports aria-label for descriptive labels
18
+ * - Keyboard accessible (Enter key handled by native <a> element)
19
+ *
20
+ * Respects native browser behaviors:
21
+ * - Middle-click (opens in new tab)
22
+ * - Ctrl/Cmd+click (opens in new tab)
23
+ * - Shift+click (opens in new window)
24
+ * - Alt+click (downloads link)
25
+ * - Right-click context menu
26
+ *
27
+ * Best practices:
28
+ * - Use target="_blank" with rel="noopener noreferrer" for external links
29
+ * - Use aria-current="page" for the current page in navigation
30
+ * - Provide descriptive link text or aria-label
31
+ *
32
+ * Uses applyInteractionPolicy to enforce pit-of-success principles:
33
+ * - Interaction behavior centralized in foundations
34
+ * - Keyboard handling automatic
35
+ * - Composable via mergeProps
36
+ */
37
+ function Link({ href, class: className, children, rel, target, "aria-current": ariaCurrent, "aria-label": ariaLabel, ...rest }) {
38
+ return /* @__PURE__ */ jsx("a", {
39
+ ...mergeProps(rest, {
40
+ ...applyInteractionPolicy({
41
+ isNative: true,
42
+ disabled: false,
43
+ onPress: (e) => {
44
+ const event = e;
45
+ if ((event.button ?? 0) !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;
46
+ if (target) return;
47
+ event.preventDefault();
48
+ navigate(href);
49
+ }
50
+ }),
51
+ href,
52
+ class: className,
53
+ rel,
54
+ target,
55
+ "aria-current": ariaCurrent,
56
+ "aria-label": ariaLabel
57
+ }),
58
+ children
59
+ });
60
+ }
61
+ //#endregion
62
+ export { Link };
63
+
64
+ //# sourceMappingURL=link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.js","names":[],"sources":["../../src/components/link.tsx"],"sourcesContent":["/**\n * Link component for client-side navigation\n */\n\nimport { navigate } from '../router/navigate';\nimport { applyInteractionPolicy } from '../foundations/interactions/interaction-policy';\nimport { mergeProps } from '../foundations/utilities/merge-props';\n\nexport type LinkProps = Omit<\n JSX.IntrinsicElements['a'],\n | 'children'\n | 'href'\n | 'class'\n | 'rel'\n | 'target'\n | 'aria-current'\n | 'aria-label'\n> & {\n href: string;\n class?: string;\n children?: unknown;\n /**\n * Optional rel attribute for link relationships.\n * Common values: \"noopener\", \"noreferrer\", \"nofollow\"\n */\n rel?: string;\n /**\n * Optional target attribute.\n * Use \"_blank\" for new tab/window.\n */\n target?: string;\n /**\n * Optional aria-current attribute for indicating current page/location.\n * Use \"page\" for the current page in navigation.\n */\n 'aria-current'?:\n | 'page'\n | 'step'\n | 'location'\n | 'date'\n | 'time'\n | 'true'\n | 'false';\n /**\n * Optional aria-label for accessibility when link text isn't descriptive enough.\n */\n 'aria-label'?: string;\n};\n\n/**\n * Link component that prevents default navigation and uses navigate()\n * Provides declarative way to navigate between routes\n *\n * Accessibility features:\n * - Proper semantic <a> element (not a button)\n * - Supports aria-current for indicating active page\n * - Supports aria-label for descriptive labels\n * - Keyboard accessible (Enter key handled by native <a> element)\n *\n * Respects native browser behaviors:\n * - Middle-click (opens in new tab)\n * - Ctrl/Cmd+click (opens in new tab)\n * - Shift+click (opens in new window)\n * - Alt+click (downloads link)\n * - Right-click context menu\n *\n * Best practices:\n * - Use target=\"_blank\" with rel=\"noopener noreferrer\" for external links\n * - Use aria-current=\"page\" for the current page in navigation\n * - Provide descriptive link text or aria-label\n *\n * Uses applyInteractionPolicy to enforce pit-of-success principles:\n * - Interaction behavior centralized in foundations\n * - Keyboard handling automatic\n * - Composable via mergeProps\n */\nexport function Link({\n href,\n class: className,\n children,\n rel,\n target,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n ...rest\n}: LinkProps): JSX.Element {\n const interaction = applyInteractionPolicy({\n isNative: true,\n disabled: false,\n onPress: (e: Event) => {\n const event = e as MouseEvent;\n\n // Only intercept left-click without modifiers\n // Default button to 0 if undefined (for mock events in tests)\n const button = event.button ?? 0;\n if (\n button !== 0 || // not left-click\n event.ctrlKey || // Ctrl/Cmd+click\n event.metaKey || // Cmd on Mac\n event.shiftKey || // Shift+click\n event.altKey // Alt+click\n ) {\n return; // Let browser handle it (new tab, etc.)\n }\n\n // Don't intercept external links or explicit target\n if (target) {\n return; // Let browser handle it\n }\n\n event.preventDefault();\n navigate(href);\n },\n });\n\n const props = mergeProps(rest, {\n ...interaction,\n href,\n class: className,\n rel,\n target,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n });\n\n return <a {...props}>{children}</a>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,SAAgB,KAAK,EACnB,MACA,OAAO,WACP,UACA,KACA,QACA,gBAAgB,aAChB,cAAc,WACd,GAAG,QACsB;AAwCzB,QAAO,oBAAC,KAAD;EAAG,GAVI,WAAW,MAAM;GAC7B,GA9BkB,uBAAuB;IACzC,UAAU;IACV,UAAU;IACV,UAAU,MAAa;KACrB,MAAM,QAAQ;AAKd,UADe,MAAM,UAAU,OAElB,KACX,MAAM,WACN,MAAM,WACN,MAAM,YACN,MAAM,OAEN;AAIF,SAAI,OACF;AAGF,WAAM,gBAAgB;AACtB,cAAS,KAAK;;IAEjB,CAGI;GACH;GACA,OAAO;GACP;GACA;GACA,gBAAgB;GAChB,cAAc;GACf,CAEa;EAAQ;EAAa,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { JSXElement } from "../common/jsx.js";
2
+
3
+ //#region src/control/case.d.ts
4
+ type MatchProps = {
5
+ key?: string | number | null;
6
+ when: unknown;
7
+ children: unknown;
8
+ };
9
+ type CaseProps = {
10
+ fallback?: unknown;
11
+ children?: unknown;
12
+ };
13
+ declare function Match(_props: MatchProps): null;
14
+ declare const Case: (props: CaseProps) => JSXElement;
15
+ //#endregion
16
+ export { Case, CaseProps, Match, MatchProps };
17
+ //# sourceMappingURL=case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case.d.ts","names":[],"sources":["../../src/control/case.ts"],"mappings":";;;KAeY,UAAA;EACV,GAAA;EACA,IAAA;EACA,QAAA;AAAA;AAAA,KAGU,SAAA;EACV,QAAA;EACA,QAAA;AAAA;AAAA,iBAmBc,KAAA,CAAM,MAAA,EAAQ,UAAA;AAAA,cAqFjB,IAAA,GAEP,KAAA,EAAO,SAAA,KAAc,UAAA"}
@@ -0,0 +1,69 @@
1
+ import { __CONTROL_BOUNDARY__, markEagerControlPrimitive } from "../common/control.js";
2
+ import { isDevelopmentEnvironment } from "../common/env.js";
3
+ import { createCaseState } from "../runtime/control.js";
4
+ import { state } from "../runtime/state.js";
5
+ import { normalizeBoundaryChild } from "./shared.js";
6
+ //#region src/control/case.ts
7
+ function flattenChildren(children) {
8
+ if (!Array.isArray(children)) return children == null || children === false ? [] : [children];
9
+ const result = [];
10
+ for (const child of children) {
11
+ if (Array.isArray(child)) {
12
+ result.push(...flattenChildren(child));
13
+ continue;
14
+ }
15
+ result.push(child);
16
+ }
17
+ return result;
18
+ }
19
+ function Match(_props) {
20
+ if (isDevelopmentEnvironment()) throw new Error("[askr] <Match> may only be used as a direct child of <Case>.");
21
+ return null;
22
+ }
23
+ function createCaseFallbackRenderer(fallback) {
24
+ const normalizedFallback = normalizeBoundaryChild(fallback);
25
+ if (normalizedFallback == null || normalizedFallback === false) return null;
26
+ return () => normalizedFallback;
27
+ }
28
+ function createMatchBranchKey(key, index) {
29
+ if (key == null) return index;
30
+ return `match:${index}:${typeof key}:${String(key)}`;
31
+ }
32
+ function readMatchBranches(children) {
33
+ const branches = [];
34
+ const flatChildren = flattenChildren(children);
35
+ for (let index = 0; index < flatChildren.length; index += 1) {
36
+ const child = flatChildren[index];
37
+ if (child == null || child === false) continue;
38
+ if (typeof child === "object" && child !== null && "type" in child && child.type === Match) {
39
+ const element = child;
40
+ const props = element.props ?? {};
41
+ const key = createMatchBranchKey(element.key, index);
42
+ const render = typeof props.children === "function" ? () => normalizeBoundaryChild(props.children()) : () => normalizeBoundaryChild(props.children);
43
+ branches.push({
44
+ key,
45
+ render,
46
+ when: props.when
47
+ });
48
+ continue;
49
+ }
50
+ if (isDevelopmentEnvironment()) throw new Error("[askr] <Case> only accepts <Match> children.");
51
+ }
52
+ return branches;
53
+ }
54
+ function CasePrimitive(props) {
55
+ const matches = readMatchBranches(props.children);
56
+ const fallback = createCaseFallbackRenderer(props.fallback);
57
+ const caseState = state(createCaseState(matches, fallback))();
58
+ caseState.matches = matches;
59
+ caseState.fallback = fallback;
60
+ return {
61
+ type: __CONTROL_BOUNDARY__,
62
+ _controlState: caseState
63
+ };
64
+ }
65
+ const Case = markEagerControlPrimitive(CasePrimitive);
66
+ //#endregion
67
+ export { Case, Match };
68
+
69
+ //# sourceMappingURL=case.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case.js","names":[],"sources":["../../src/control/case.ts"],"sourcesContent":["import {\n __CONTROL_BOUNDARY__,\n markEagerControlPrimitive,\n} from '../common/control';\nimport type { JSXElement } from '../common/jsx';\nimport type { VNode } from '../common/vnode';\nimport { isDevelopmentEnvironment } from '../common/env';\nimport {\n createCaseState,\n type CaseState,\n type MatchBranch,\n} from '../runtime/control';\nimport { state } from '../runtime/state';\nimport { normalizeBoundaryChild } from './shared';\n\nexport type MatchProps = {\n key?: string | number | null;\n when: unknown;\n children: unknown;\n};\n\nexport type CaseProps = {\n fallback?: unknown;\n children?: unknown;\n};\n\nfunction flattenChildren(children: unknown): unknown[] {\n if (!Array.isArray(children)) {\n return children == null || children === false ? [] : [children];\n }\n\n const result: unknown[] = [];\n for (const child of children) {\n if (Array.isArray(child)) {\n result.push(...flattenChildren(child));\n continue;\n }\n result.push(child);\n }\n return result;\n}\n\nexport function Match(_props: MatchProps): null {\n if (isDevelopmentEnvironment()) {\n throw new Error(\n '[askr] <Match> may only be used as a direct child of <Case>.'\n );\n }\n return null;\n}\n\nfunction createCaseFallbackRenderer(fallback: unknown): (() => VNode) | null {\n const normalizedFallback = normalizeBoundaryChild(fallback);\n if (normalizedFallback == null || normalizedFallback === false) {\n return null;\n }\n return () => normalizedFallback;\n}\n\nfunction createMatchBranchKey(\n key: string | number | null | undefined,\n index: number\n): string | number {\n if (key == null) {\n return index;\n }\n return `match:${index}:${typeof key}:${String(key)}`;\n}\n\nfunction readMatchBranches(children: unknown): MatchBranch[] {\n const branches: MatchBranch[] = [];\n const flatChildren = flattenChildren(children);\n\n for (let index = 0; index < flatChildren.length; index += 1) {\n const child = flatChildren[index];\n if (child == null || child === false) {\n continue;\n }\n\n if (\n typeof child === 'object' &&\n child !== null &&\n 'type' in child &&\n (child as JSXElement).type === Match\n ) {\n const element = child as JSXElement;\n const props = (element.props ?? {}) as MatchProps;\n const key = createMatchBranchKey(element.key, index);\n const render =\n typeof props.children === 'function'\n ? () =>\n normalizeBoundaryChild((props.children as () => VNode)()) as VNode\n : () => normalizeBoundaryChild(props.children) as VNode;\n branches.push({\n key,\n render,\n when: props.when,\n });\n continue;\n }\n\n if (isDevelopmentEnvironment()) {\n throw new Error('[askr] <Case> only accepts <Match> children.');\n }\n }\n\n return branches;\n}\n\nfunction CasePrimitive(props: CaseProps): JSXElement {\n const matches = readMatchBranches(props.children);\n const fallback = createCaseFallbackRenderer(props.fallback);\n\n const caseStateContainer = state<CaseState>(\n createCaseState(matches, fallback)\n );\n const caseState = caseStateContainer();\n\n caseState.matches = matches;\n caseState.fallback = fallback;\n\n return {\n type: __CONTROL_BOUNDARY__,\n _controlState: caseState,\n } as unknown as JSXElement;\n}\n\nexport const Case = markEagerControlPrimitive(\n CasePrimitive as (props: CaseProps) => JSXElement\n) as (props: CaseProps) => JSXElement;\n"],"mappings":";;;;;;AA0BA,SAAS,gBAAgB,UAA8B;AACrD,KAAI,CAAC,MAAM,QAAQ,SAAS,CAC1B,QAAO,YAAY,QAAQ,aAAa,QAAQ,EAAE,GAAG,CAAC,SAAS;CAGjE,MAAM,SAAoB,EAAE;AAC5B,MAAK,MAAM,SAAS,UAAU;AAC5B,MAAI,MAAM,QAAQ,MAAM,EAAE;AACxB,UAAO,KAAK,GAAG,gBAAgB,MAAM,CAAC;AACtC;;AAEF,SAAO,KAAK,MAAM;;AAEpB,QAAO;;AAGT,SAAgB,MAAM,QAA0B;AAC9C,KAAI,0BAA0B,CAC5B,OAAM,IAAI,MACR,+DACD;AAEH,QAAO;;AAGT,SAAS,2BAA2B,UAAyC;CAC3E,MAAM,qBAAqB,uBAAuB,SAAS;AAC3D,KAAI,sBAAsB,QAAQ,uBAAuB,MACvD,QAAO;AAET,cAAa;;AAGf,SAAS,qBACP,KACA,OACiB;AACjB,KAAI,OAAO,KACT,QAAO;AAET,QAAO,SAAS,MAAM,GAAG,OAAO,IAAI,GAAG,OAAO,IAAI;;AAGpD,SAAS,kBAAkB,UAAkC;CAC3D,MAAM,WAA0B,EAAE;CAClC,MAAM,eAAe,gBAAgB,SAAS;AAE9C,MAAK,IAAI,QAAQ,GAAG,QAAQ,aAAa,QAAQ,SAAS,GAAG;EAC3D,MAAM,QAAQ,aAAa;AAC3B,MAAI,SAAS,QAAQ,UAAU,MAC7B;AAGF,MACE,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACT,MAAqB,SAAS,OAC/B;GACA,MAAM,UAAU;GAChB,MAAM,QAAS,QAAQ,SAAS,EAAE;GAClC,MAAM,MAAM,qBAAqB,QAAQ,KAAK,MAAM;GACpD,MAAM,SACJ,OAAO,MAAM,aAAa,mBAEpB,uBAAwB,MAAM,UAA0B,CAAC,SACrD,uBAAuB,MAAM,SAAS;AAClD,YAAS,KAAK;IACZ;IACA;IACA,MAAM,MAAM;IACb,CAAC;AACF;;AAGF,MAAI,0BAA0B,CAC5B,OAAM,IAAI,MAAM,+CAA+C;;AAInE,QAAO;;AAGT,SAAS,cAAc,OAA8B;CACnD,MAAM,UAAU,kBAAkB,MAAM,SAAS;CACjD,MAAM,WAAW,2BAA2B,MAAM,SAAS;CAK3D,MAAM,YAHqB,MACzB,gBAAgB,SAAS,SAAS,CAElB,EAAoB;AAEtC,WAAU,UAAU;AACpB,WAAU,WAAW;AAErB,QAAO;EACL,MAAM;EACN,eAAe;EAChB;;AAGH,MAAa,OAAO,0BAClB,cACD"}
@@ -0,0 +1,23 @@
1
+ import { JSXElement } from "../common/jsx.js";
2
+ import { VNode } from "../common/vnode.js";
3
+
4
+ //#region src/control/for.d.ts
5
+ type ForEachSource<T> = T[] | (() => T[]);
6
+ type ForBaseProps<T> = {
7
+ each: ForEachSource<T>;
8
+ fallback?: unknown;
9
+ children: (item: T, index: () => number) => VNode;
10
+ };
11
+ type KeyedForProps<T, K extends string | number> = ForBaseProps<T> & {
12
+ by: (item: T, index: number) => K;
13
+ byIndex?: never;
14
+ };
15
+ type IndexedForProps<T> = ForBaseProps<T> & {
16
+ by?: never;
17
+ byIndex: true;
18
+ };
19
+ type ForProps<T, K extends string | number = string | number> = KeyedForProps<T, K> | IndexedForProps<T>;
20
+ declare const For: <T, K extends string | number = string | number>(props: ForProps<T, K>) => JSXElement;
21
+ //#endregion
22
+ export { For, ForEachSource, ForProps };
23
+ //# sourceMappingURL=for.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"for.d.ts","names":[],"sources":["../../src/control/for.ts"],"mappings":";;;;KAgBY,aAAA,MAAmB,CAAA,YAAa,CAAA;AAAA,KAEvC,YAAA;EACH,IAAA,EAAM,aAAA,CAAc,CAAA;EACpB,QAAA;EACA,QAAA,GAAW,IAAA,EAAM,CAAA,EAAG,KAAA,mBAAwB,KAAA;AAAA;AAAA,KAGzC,aAAA,iCAA8C,YAAA,CAAa,CAAA;EAC9D,EAAA,GAAK,IAAA,EAAM,CAAA,EAAG,KAAA,aAAkB,CAAA;EAChC,OAAA;AAAA;AAAA,KAGG,eAAA,MAAqB,YAAA,CAAa,CAAA;EACrC,EAAA;EACA,OAAA;AAAA;AAAA,KAGU,QAAA,mDACR,aAAA,CAAc,CAAA,EAAG,CAAA,IACjB,eAAA,CAAgB,CAAA;AAAA,cA0EP,GAAA,mDAKX,KAAA,EAAO,QAAA,CAAS,CAAA,EAAG,CAAA,MAChB,UAAA"}
@@ -0,0 +1,62 @@
1
+ import { __CONTROL_BOUNDARY__, markEagerControlPrimitive } from "../common/control.js";
2
+ import { useForState } from "../runtime/for.js";
3
+ import { createFineGrainedEffect } from "../runtime/effect.js";
4
+ import { normalizeBoundaryChild } from "./shared.js";
5
+ //#region src/control/for.ts
6
+ /**
7
+ * For JSX primitive
8
+ *
9
+ * Creates a keyed child-scope boundary for efficient list rendering.
10
+ */
11
+ function resolveEach(each) {
12
+ const resolved = typeof each === "function" ? each() : each;
13
+ if (!Array.isArray(resolved)) throw new Error("For each must resolve to an array.");
14
+ return resolved;
15
+ }
16
+ function resolveKeyFn(props) {
17
+ if ("by" in props && typeof props.by === "function") return props.by;
18
+ if ("byIndex" in props && props.byIndex === true) return (_item, index) => index;
19
+ throw new Error("[askr] <For> requires a stable `by` key function. Use `byIndex` only as an explicit positional escape hatch.");
20
+ }
21
+ function createForBoundary(props) {
22
+ if ("by" in props && typeof props.by === "function" && "byIndex" in props) throw new Error("[askr] <For> accepts either `by` or `byIndex`, not both.");
23
+ const byFn = resolveKeyFn(props);
24
+ const fallback = normalizeBoundaryChild(props.fallback);
25
+ const forState = useForState(props.each, byFn, props.children, fallback);
26
+ const computeItems = () => resolveEach(forState.eachSource);
27
+ if (!forState._sourceEffect) {
28
+ forState._suspendSourceCommit = true;
29
+ forState._sourceEffect = createFineGrainedEffect({
30
+ lane: "reactive",
31
+ compute: computeItems,
32
+ commit: (items) => {
33
+ forState.currentItems = items;
34
+ if (forState._suspendSourceCommit) return;
35
+ forState._needsSourceReconcile = true;
36
+ if (forState._enqueueBoundaryCommit) {
37
+ forState._enqueueBoundaryCommit();
38
+ return;
39
+ }
40
+ forState.parentInstance?._enqueueRun?.();
41
+ }
42
+ });
43
+ forState._suspendSourceCommit = false;
44
+ } else {
45
+ forState._suspendSourceCommit = true;
46
+ forState._sourceEffect.updateCompute(computeItems);
47
+ forState._suspendSourceCommit = false;
48
+ }
49
+ return {
50
+ type: __CONTROL_BOUNDARY__,
51
+ _controlState: forState,
52
+ _forState: forState
53
+ };
54
+ }
55
+ function ForPrimitive(props) {
56
+ return createForBoundary(props);
57
+ }
58
+ const For = markEagerControlPrimitive(ForPrimitive);
59
+ //#endregion
60
+ export { For };
61
+
62
+ //# sourceMappingURL=for.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"for.js","names":[],"sources":["../../src/control/for.ts"],"sourcesContent":["/**\n * For JSX primitive\n *\n * Creates a keyed child-scope boundary for efficient list rendering.\n */\n\nimport {\n __CONTROL_BOUNDARY__,\n markEagerControlPrimitive,\n} from '../common/control';\nimport type { JSXElement } from '../common/jsx';\nimport type { DOMElement, VNode } from '../common/vnode';\nimport { createFineGrainedEffect } from '../runtime/effect';\nimport { type ForState, useForState } from '../runtime/for';\nimport { normalizeBoundaryChild } from './shared';\n\nexport type ForEachSource<T> = T[] | (() => T[]);\n\ntype ForBaseProps<T> = {\n each: ForEachSource<T>;\n fallback?: unknown;\n children: (item: T, index: () => number) => VNode;\n};\n\ntype KeyedForProps<T, K extends string | number> = ForBaseProps<T> & {\n by: (item: T, index: number) => K;\n byIndex?: never;\n};\n\ntype IndexedForProps<T> = ForBaseProps<T> & {\n by?: never;\n byIndex: true;\n};\n\nexport type ForProps<T, K extends string | number = string | number> =\n | KeyedForProps<T, K>\n | IndexedForProps<T>;\n\nfunction resolveEach<T>(each: ForEachSource<T>): T[] {\n const resolved = typeof each === 'function' ? each() : each;\n if (!Array.isArray(resolved)) {\n throw new Error('For each must resolve to an array.');\n }\n return resolved;\n}\n\nfunction resolveKeyFn<T>(\n props: ForProps<T>\n): (item: T, index: number) => string | number {\n if ('by' in props && typeof props.by === 'function') {\n return props.by;\n }\n if ('byIndex' in props && props.byIndex === true) {\n return (_item, index) => index;\n }\n throw new Error(\n '[askr] <For> requires a stable `by` key function. Use `byIndex` only as an explicit positional escape hatch.'\n );\n}\n\nfunction createForBoundary<T>(props: ForProps<T>): DOMElement {\n if ('by' in props && typeof props.by === 'function' && 'byIndex' in props) {\n throw new Error('[askr] <For> accepts either `by` or `byIndex`, not both.');\n }\n\n const byFn = resolveKeyFn(props);\n const fallback = normalizeBoundaryChild(props.fallback);\n const forState = useForState(props.each, byFn, props.children, fallback);\n\n const computeItems = () => resolveEach(forState.eachSource);\n if (!forState._sourceEffect) {\n forState._suspendSourceCommit = true;\n forState._sourceEffect = createFineGrainedEffect({\n lane: 'reactive',\n compute: computeItems,\n commit: (items) => {\n forState.currentItems = items;\n\n if (forState._suspendSourceCommit) {\n return;\n }\n\n forState._needsSourceReconcile = true;\n\n if (forState._enqueueBoundaryCommit) {\n forState._enqueueBoundaryCommit();\n return;\n }\n\n forState.parentInstance?._enqueueRun?.();\n },\n });\n forState._suspendSourceCommit = false;\n } else {\n forState._suspendSourceCommit = true;\n forState._sourceEffect.updateCompute(computeItems);\n forState._suspendSourceCommit = false;\n }\n\n return {\n type: __CONTROL_BOUNDARY__,\n _controlState: forState as unknown as ForState<unknown>,\n _forState: forState as unknown as ForState<unknown>,\n };\n}\n\nfunction ForPrimitive<T>(props: ForProps<T>): JSXElement {\n return createForBoundary(props) as unknown as JSXElement;\n}\n\nexport const For = markEagerControlPrimitive(\n ForPrimitive as <T, K extends string | number = string | number>(\n props: ForProps<T, K>\n ) => JSXElement\n) as <T, K extends string | number = string | number>(\n props: ForProps<T, K>\n) => JSXElement;\n"],"mappings":";;;;;;;;;;AAsCA,SAAS,YAAe,MAA6B;CACnD,MAAM,WAAW,OAAO,SAAS,aAAa,MAAM,GAAG;AACvD,KAAI,CAAC,MAAM,QAAQ,SAAS,CAC1B,OAAM,IAAI,MAAM,qCAAqC;AAEvD,QAAO;;AAGT,SAAS,aACP,OAC6C;AAC7C,KAAI,QAAQ,SAAS,OAAO,MAAM,OAAO,WACvC,QAAO,MAAM;AAEf,KAAI,aAAa,SAAS,MAAM,YAAY,KAC1C,SAAQ,OAAO,UAAU;AAE3B,OAAM,IAAI,MACR,+GACD;;AAGH,SAAS,kBAAqB,OAAgC;AAC5D,KAAI,QAAQ,SAAS,OAAO,MAAM,OAAO,cAAc,aAAa,MAClE,OAAM,IAAI,MAAM,2DAA2D;CAG7E,MAAM,OAAO,aAAa,MAAM;CAChC,MAAM,WAAW,uBAAuB,MAAM,SAAS;CACvD,MAAM,WAAW,YAAY,MAAM,MAAM,MAAM,MAAM,UAAU,SAAS;CAExE,MAAM,qBAAqB,YAAY,SAAS,WAAW;AAC3D,KAAI,CAAC,SAAS,eAAe;AAC3B,WAAS,uBAAuB;AAChC,WAAS,gBAAgB,wBAAwB;GAC/C,MAAM;GACN,SAAS;GACT,SAAS,UAAU;AACjB,aAAS,eAAe;AAExB,QAAI,SAAS,qBACX;AAGF,aAAS,wBAAwB;AAEjC,QAAI,SAAS,wBAAwB;AACnC,cAAS,wBAAwB;AACjC;;AAGF,aAAS,gBAAgB,eAAe;;GAE3C,CAAC;AACF,WAAS,uBAAuB;QAC3B;AACL,WAAS,uBAAuB;AAChC,WAAS,cAAc,cAAc,aAAa;AAClD,WAAS,uBAAuB;;AAGlC,QAAO;EACL,MAAM;EACN,eAAe;EACf,WAAW;EACZ;;AAGH,SAAS,aAAgB,OAAgC;AACvD,QAAO,kBAAkB,MAAM;;AAGjC,MAAa,MAAM,0BACjB,aAGD"}
@@ -0,0 +1,4 @@
1
+ import { For, ForProps } from "./for.js";
2
+ import { Show, ShowProps } from "./show.js";
3
+ import { Case, CaseProps, Match, MatchProps } from "./case.js";
4
+ export { Case, type CaseProps, For, type ForProps, Match, type MatchProps, Show, type ShowProps };
@@ -0,0 +1,4 @@
1
+ import { For } from "./for.js";
2
+ import { Show } from "./show.js";
3
+ import { Case, Match } from "./case.js";
4
+ export { Case, For, Match, Show };
@@ -0,0 +1,20 @@
1
+ import { Fragment } from "../common/jsx.js";
2
+ //#region src/control/shared.ts
3
+ function normalizeBoundaryChild(value) {
4
+ if (Array.isArray(value)) {
5
+ if (value.length === 0) return null;
6
+ if (value.length === 1) return normalizeBoundaryChild(value[0]);
7
+ return {
8
+ type: Fragment,
9
+ props: { children: value }
10
+ };
11
+ }
12
+ return value ?? null;
13
+ }
14
+ function resolveMaybeAccessor(value) {
15
+ return typeof value === "function" ? value() : value;
16
+ }
17
+ //#endregion
18
+ export { normalizeBoundaryChild, resolveMaybeAccessor };
19
+
20
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","names":[],"sources":["../../src/control/shared.ts"],"sourcesContent":["import { Fragment } from '../common/jsx';\nimport type { DOMElement, VNode } from '../common/vnode';\n\nexport function normalizeBoundaryChild(value: unknown): VNode | null {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return null;\n }\n if (value.length === 1) {\n return normalizeBoundaryChild(value[0]);\n }\n return {\n type: Fragment,\n props: {\n children: value,\n },\n } as DOMElement;\n }\n\n return (value ?? null) as VNode | null;\n}\n\nexport function resolveMaybeAccessor<T>(value: T | (() => T)): T {\n return typeof value === 'function' ? (value as () => T)() : value;\n}\n"],"mappings":";;AAGA,SAAgB,uBAAuB,OAA8B;AACnE,KAAI,MAAM,QAAQ,MAAM,EAAE;AACxB,MAAI,MAAM,WAAW,EACnB,QAAO;AAET,MAAI,MAAM,WAAW,EACnB,QAAO,uBAAuB,MAAM,GAAG;AAEzC,SAAO;GACL,MAAM;GACN,OAAO,EACL,UAAU,OACX;GACF;;AAGH,QAAQ,SAAS;;AAGnB,SAAgB,qBAAwB,OAAyB;AAC/D,QAAO,OAAO,UAAU,aAAc,OAAmB,GAAG"}
@@ -0,0 +1,14 @@
1
+ import { JSXElement } from "../common/jsx.js";
2
+ import { VNode } from "../common/vnode.js";
3
+
4
+ //#region src/control/show.d.ts
5
+ type ShowSource<T> = T | (() => T);
6
+ type ShowProps<T> = {
7
+ when: ShowSource<T>;
8
+ fallback?: unknown;
9
+ children: unknown | ((value: NonNullable<T>) => VNode);
10
+ };
11
+ declare const Show: <T>(props: ShowProps<T>) => JSXElement;
12
+ //#endregion
13
+ export { Show, ShowProps };
14
+ //# sourceMappingURL=show.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show.d.ts","names":[],"sources":["../../src/control/show.ts"],"mappings":";;;;KAUK,UAAA,MAAgB,CAAA,UAAW,CAAA;AAAA,KAEpB,SAAA;EACV,IAAA,EAAM,UAAA,CAAW,CAAA;EACjB,QAAA;EACA,QAAA,cAAsB,KAAA,EAAO,WAAA,CAAY,CAAA,MAAO,KAAA;AAAA;AAAA,cA+CrC,IAAA,MAEJ,KAAA,EAAO,SAAA,CAAU,CAAA,MAAO,UAAA"}
@@ -0,0 +1,33 @@
1
+ import { __CONTROL_BOUNDARY__, markEagerControlPrimitive } from "../common/control.js";
2
+ import { createShowState } from "../runtime/control.js";
3
+ import { state } from "../runtime/state.js";
4
+ import { normalizeBoundaryChild, resolveMaybeAccessor } from "./shared.js";
5
+ //#region src/control/show.ts
6
+ function createTruthyRenderer(props) {
7
+ if (typeof props.children === "function") return (value) => normalizeBoundaryChild(props.children(value));
8
+ const staticChild = normalizeBoundaryChild(props.children);
9
+ return () => staticChild;
10
+ }
11
+ function createFallbackRenderer(fallback) {
12
+ const normalizedFallback = normalizeBoundaryChild(fallback);
13
+ if (normalizedFallback == null || normalizedFallback === false) return null;
14
+ return () => normalizedFallback;
15
+ }
16
+ function ShowPrimitive(props) {
17
+ const selectedValue = resolveMaybeAccessor(props.when);
18
+ const renderTruthy = createTruthyRenderer(props);
19
+ const renderFallback = createFallbackRenderer(props.fallback);
20
+ const showState = state(createShowState(selectedValue, renderTruthy, renderFallback))();
21
+ showState.selectedValue = selectedValue;
22
+ showState.renderTruthy = renderTruthy;
23
+ showState.renderFallback = renderFallback;
24
+ return {
25
+ type: __CONTROL_BOUNDARY__,
26
+ _controlState: showState
27
+ };
28
+ }
29
+ const Show = markEagerControlPrimitive(ShowPrimitive);
30
+ //#endregion
31
+ export { Show };
32
+
33
+ //# sourceMappingURL=show.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show.js","names":[],"sources":["../../src/control/show.ts"],"sourcesContent":["import {\n __CONTROL_BOUNDARY__,\n markEagerControlPrimitive,\n} from '../common/control';\nimport type { JSXElement } from '../common/jsx';\nimport type { VNode } from '../common/vnode';\nimport { createShowState, type ShowState } from '../runtime/control';\nimport { state } from '../runtime/state';\nimport { normalizeBoundaryChild, resolveMaybeAccessor } from './shared';\n\ntype ShowSource<T> = T | (() => T);\n\nexport type ShowProps<T> = {\n when: ShowSource<T>;\n fallback?: unknown;\n children: unknown | ((value: NonNullable<T>) => VNode);\n};\n\nfunction createTruthyRenderer<T>(\n props: ShowProps<T>\n): ShowState['renderTruthy'] {\n if (typeof props.children === 'function') {\n return (value: unknown) =>\n normalizeBoundaryChild(\n (props.children as (resolved: NonNullable<T>) => VNode)(\n value as NonNullable<T>\n )\n ) as VNode;\n }\n\n const staticChild = normalizeBoundaryChild(props.children);\n return () => staticChild as VNode;\n}\n\nfunction createFallbackRenderer(fallback: unknown): (() => VNode) | null {\n const normalizedFallback = normalizeBoundaryChild(fallback);\n if (normalizedFallback == null || normalizedFallback === false) {\n return null;\n }\n return () => normalizedFallback;\n}\n\nfunction ShowPrimitive<T>(props: ShowProps<T>): JSXElement {\n const selectedValue = resolveMaybeAccessor(props.when);\n const renderTruthy = createTruthyRenderer(props);\n const renderFallback = createFallbackRenderer(props.fallback);\n\n const showStateContainer = state<ShowState>(\n createShowState(selectedValue, renderTruthy, renderFallback)\n );\n const showState = showStateContainer();\n\n showState.selectedValue = selectedValue;\n showState.renderTruthy = renderTruthy;\n showState.renderFallback = renderFallback;\n\n return {\n type: __CONTROL_BOUNDARY__,\n _controlState: showState,\n } as unknown as JSXElement;\n}\n\nexport const Show = markEagerControlPrimitive(\n ShowPrimitive as <T>(props: ShowProps<T>) => JSXElement\n) as <T>(props: ShowProps<T>) => JSXElement;\n"],"mappings":";;;;;AAkBA,SAAS,qBACP,OAC2B;AAC3B,KAAI,OAAO,MAAM,aAAa,WAC5B,SAAQ,UACN,uBACG,MAAM,SACL,MACD,CACF;CAGL,MAAM,cAAc,uBAAuB,MAAM,SAAS;AAC1D,cAAa;;AAGf,SAAS,uBAAuB,UAAyC;CACvE,MAAM,qBAAqB,uBAAuB,SAAS;AAC3D,KAAI,sBAAsB,QAAQ,uBAAuB,MACvD,QAAO;AAET,cAAa;;AAGf,SAAS,cAAiB,OAAiC;CACzD,MAAM,gBAAgB,qBAAqB,MAAM,KAAK;CACtD,MAAM,eAAe,qBAAqB,MAAM;CAChD,MAAM,iBAAiB,uBAAuB,MAAM,SAAS;CAK7D,MAAM,YAHqB,MACzB,gBAAgB,eAAe,cAAc,eAAe,CAE5C,EAAoB;AAEtC,WAAU,gBAAgB;AAC1B,WAAU,eAAe;AACzB,WAAU,iBAAiB;AAE3B,QAAO;EACL,MAAM;EACN,eAAe;EAChB;;AAGH,MAAa,OAAO,0BAClB,cACD"}
@@ -1,2 +1,29 @@
1
- function e(t,n,i){if(!t){const s=i?`
2
- `+JSON.stringify(i,null,2):"";throw new Error(`[Askr Invariant] ${n}${s}`)}}function a(t,n,i){if(e(n in t,`Object missing required property '${String(n)}'`,{object:t}),i){const s=typeof t[n];e(s===i,`Property '${String(n)}' has type '${s}', expected '${i}'`,{value:t[n],expectedType:i})}}function r(t,n){e(t!=null,n,{value:t})}class o{constructor(n){this.called=!1,this.calledAt=null,this.name=n}check(){return this.called}mark(){e(!this.called,`${this.name} called multiple times (previously at ${this.calledAt}ms)`,{now:Date.now()}),this.called=!0,this.calledAt=Date.now()}reset(){this.called=!1,this.calledAt=null}}function l(t,n,i){e(n.includes(t),`${i} must be one of [${n.join(", ")}], got ${JSON.stringify(t)}`,{value:t,allowed:n})}function c(t,n,i){e(t===n,`Invalid ${i} context. Expected ${n}, got ${t}`,{expected:n,actual:t})}function u(t,n){e(t,`[Scheduler Precondition] ${n}`)}function $(t,n){e(t,`[State Precondition] ${n}`)}function d(t,n,i){e(t.aborted===n,`AbortSignal ${n?"should be":"should not be"} aborted in ${i}`,{actual:t.aborted,expected:n})}function f(t,n){e(t!=null,`${n} callback is required but not available`,{callback:t})}function h(t,n,i){e(t===n,`Stale evaluation generation in ${i}: current ${t}, latest ${n}`,{current:t,latest:n})}function S(t,n,i){e(t===n,`Invalid mounted state in ${i}: expected ${n}, got ${t}`,{mounted:t,expected:n})}function g(t,n){e(t!==null,`Cannot render in ${n}: target is null`,{target:t})}export{o as Once,d as assertAbortControllerState,f as assertCallbackAvailable,c as assertContext,r as assertDefined,l as assertEnum,h as assertEvaluationGeneration,S as assertMountedState,a as assertProperty,g as assertRenderTarget,u as assertSchedulingPrecondition,$ as assertStatePrecondition,e as invariant};
1
+ //#region src/dev/invariant.ts
2
+ /**
3
+ * Invariant assertion utilities for correctness checking
4
+ * Production-safe: invariants are enforced at build-time or with minimal overhead
5
+ *
6
+ * Core principle: fail fast when invariants are violated
7
+ * All functions throw descriptive errors for debugging
8
+ */
9
+ /**
10
+ * Assert a condition; throw with context if false
11
+ * @internal
12
+ */
13
+ function invariant(condition, message, context) {
14
+ if (!condition) {
15
+ const contextStr = context ? "\n" + JSON.stringify(context, null, 2) : "";
16
+ throw new Error(`[Askr Invariant] ${message}${contextStr}`);
17
+ }
18
+ }
19
+ /**
20
+ * Assert scheduling precondition (not reentering, not during render, etc)
21
+ * @internal
22
+ */
23
+ function assertSchedulingPrecondition(condition, violationMessage) {
24
+ invariant(condition, `[Scheduler Precondition] ${violationMessage}`);
25
+ }
26
+ //#endregion
27
+ export { assertSchedulingPrecondition, invariant };
28
+
29
+ //# sourceMappingURL=invariant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invariant.js","names":[],"sources":["../../src/dev/invariant.ts"],"sourcesContent":["/**\n * Invariant assertion utilities for correctness checking\n * Production-safe: invariants are enforced at build-time or with minimal overhead\n *\n * Core principle: fail fast when invariants are violated\n * All functions throw descriptive errors for debugging\n */\n\n/**\n * Assert a condition; throw with context if false\n * @internal\n */\nexport function invariant(\n condition: boolean,\n message: string,\n context?: Record<string, unknown>\n): asserts condition {\n if (!condition) {\n const contextStr = context ? '\\n' + JSON.stringify(context, null, 2) : '';\n throw new Error(`[Askr Invariant] ${message}${contextStr}`);\n }\n}\n\n/**\n * Assert object property exists and has correct type\n * @internal\n */\nexport function assertProperty<T extends object, K extends keyof T>(\n obj: T,\n prop: K,\n expectedType?: string\n): asserts obj is T & Required<Pick<T, K>> {\n invariant(prop in obj, `Object missing required property '${String(prop)}'`, {\n object: obj,\n });\n\n if (expectedType) {\n const actualType = typeof obj[prop];\n invariant(\n actualType === expectedType,\n `Property '${String(prop)}' has type '${actualType}', expected '${expectedType}'`,\n { value: obj[prop], expectedType }\n );\n }\n}\n\n/**\n * Assert a reference is not null/undefined\n * @internal\n */\nexport function assertDefined<T>(\n value: T | null | undefined,\n message: string\n): asserts value is T {\n invariant(value !== null && value !== undefined, message, { value });\n}\n\n/**\n * Assert a task runs exactly once atomically\n * Useful for verifying lifecycle events fire precisely when expected\n * @internal\n */\nexport class Once {\n private called = false;\n private calledAt: number | null = null;\n readonly name: string;\n\n constructor(name: string) {\n this.name = name;\n }\n\n check(): boolean {\n return this.called;\n }\n\n mark(): void {\n invariant(\n !this.called,\n `${this.name} called multiple times (previously at ${this.calledAt}ms)`,\n { now: Date.now() }\n );\n this.called = true;\n this.calledAt = Date.now();\n }\n\n reset(): void {\n this.called = false;\n this.calledAt = null;\n }\n}\n\n/**\n * Assert a value falls in an enumerated set\n * @internal\n */\nexport function assertEnum<T extends readonly unknown[]>(\n value: unknown,\n allowedValues: T,\n fieldName: string\n): asserts value is T[number] {\n invariant(\n allowedValues.includes(value),\n `${fieldName} must be one of [${allowedValues.join(', ')}], got ${JSON.stringify(value)}`,\n { value, allowed: allowedValues }\n );\n}\n\n/**\n * Assert execution context (scheduler, component, etc)\n * @internal\n */\nexport function assertContext(\n actual: unknown,\n expected: unknown,\n contextName: string\n): asserts actual is typeof expected {\n invariant(\n actual === expected,\n `Invalid ${contextName} context. Expected ${expected}, got ${actual}`,\n { expected, actual }\n );\n}\n\n/**\n * Assert scheduling precondition (not reentering, not during render, etc)\n * @internal\n */\nexport function assertSchedulingPrecondition(\n condition: boolean,\n violationMessage: string\n): asserts condition {\n invariant(condition, `[Scheduler Precondition] ${violationMessage}`);\n}\n\n/**\n * Assert state precondition\n * @internal\n */\nexport function assertStatePrecondition(\n condition: boolean,\n violationMessage: string\n): asserts condition {\n invariant(condition, `[State Precondition] ${violationMessage}`);\n}\n\n/**\n * Verify AbortController lifecycle\n * @internal\n */\nexport function assertAbortControllerState(\n signal: AbortSignal,\n expectedAborted: boolean,\n context: string\n): void {\n invariant(\n signal.aborted === expectedAborted,\n `AbortSignal ${expectedAborted ? 'should be' : 'should not be'} aborted in ${context}`,\n { actual: signal.aborted, expected: expectedAborted }\n );\n}\n\n/**\n * Guard: throw if callback is null when it shouldn't be\n * Used for notifyUpdate, event handlers, etc.\n * @internal\n */\nexport function assertCallbackAvailable<\n T extends (...args: unknown[]) => unknown,\n>(callback: T | null | undefined, callbackName: string): asserts callback is T {\n invariant(\n callback !== null && callback !== undefined,\n `${callbackName} callback is required but not available`,\n { callback }\n );\n}\n\n/**\n * Verify evaluation generation prevents stale evaluations\n * @internal\n */\nexport function assertEvaluationGeneration(\n current: number,\n latest: number,\n context: string\n): void {\n invariant(\n current === latest,\n `Stale evaluation generation in ${context}: current ${current}, latest ${latest}`,\n { current, latest }\n );\n}\n\n/**\n * Verify mounted flag state\n * @internal\n */\nexport function assertMountedState(\n mounted: boolean,\n expectedMounted: boolean,\n context: string\n): void {\n invariant(\n mounted === expectedMounted,\n `Invalid mounted state in ${context}: expected ${expectedMounted}, got ${mounted}`,\n { mounted, expected: expectedMounted }\n );\n}\n\n/**\n * Verify no null target when rendering\n * @internal\n */\nexport function assertRenderTarget(\n target: Element | null,\n context: string\n): asserts target is Element {\n invariant(target !== null, `Cannot render in ${context}: target is null`, {\n target,\n });\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,UACd,WACA,SACA,SACmB;AACnB,KAAI,CAAC,WAAW;EACd,MAAM,aAAa,UAAU,OAAO,KAAK,UAAU,SAAS,MAAM,EAAE,GAAG;AACvE,QAAM,IAAI,MAAM,oBAAoB,UAAU,aAAa;;;;;;;AA4G/D,SAAgB,6BACd,WACA,kBACmB;AACnB,WAAU,WAAW,4BAA4B,mBAAmB"}
@@ -1 +1,37 @@
1
- function o(n,t){const r=typeof console<"u"?console:void 0;if(!r)return;const e=r[n];if(typeof e=="function")try{e.apply(console,t)}catch{}}const f={debug:(...n)=>{},info:(...n)=>{},warn:(...n)=>{},error:(...n)=>{o("error",n)}};export{f as logger};
1
+ import { isProductionEnvironment } from "../common/env.js";
2
+ //#region src/dev/logger.ts
3
+ /**
4
+ * Centralized logger interface
5
+ * - Keeps production builds silent for debug/warn/info messages
6
+ * - Ensures consistent behavior across the codebase
7
+ * - Protects against missing `console` in some environments
8
+ */
9
+ function callConsole(method, args) {
10
+ const c = typeof console !== "undefined" ? console : void 0;
11
+ if (!c) return;
12
+ const fn = c[method];
13
+ if (typeof fn === "function") try {
14
+ fn.apply(console, args);
15
+ } catch {}
16
+ }
17
+ const logger = {
18
+ debug: (...args) => {
19
+ if (isProductionEnvironment()) return;
20
+ callConsole("debug", args);
21
+ },
22
+ info: (...args) => {
23
+ if (isProductionEnvironment()) return;
24
+ callConsole("info", args);
25
+ },
26
+ warn: (...args) => {
27
+ if (isProductionEnvironment()) return;
28
+ callConsole("warn", args);
29
+ },
30
+ error: (...args) => {
31
+ callConsole("error", args);
32
+ }
33
+ };
34
+ //#endregion
35
+ export { logger };
36
+
37
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","names":[],"sources":["../../src/dev/logger.ts"],"sourcesContent":["/**\n * Centralized logger interface\n * - Keeps production builds silent for debug/warn/info messages\n * - Ensures consistent behavior across the codebase\n * - Protects against missing `console` in some environments\n */\n\nimport { isProductionEnvironment } from '../common/env';\n\nfunction callConsole(method: string, args: unknown[]): void {\n const c = typeof console !== 'undefined' ? (console as unknown) : undefined;\n if (!c) return;\n const fn = (c as Record<string, unknown>)[method];\n if (typeof fn === 'function') {\n try {\n (fn as (...a: unknown[]) => unknown).apply(console, args as unknown[]);\n } catch {\n // ignore logging errors\n }\n }\n}\n\nexport const logger = {\n debug: (...args: unknown[]) => {\n if (isProductionEnvironment()) return;\n callConsole('debug', args);\n },\n\n info: (...args: unknown[]) => {\n if (isProductionEnvironment()) return;\n callConsole('info', args);\n },\n\n warn: (...args: unknown[]) => {\n if (isProductionEnvironment()) return;\n callConsole('warn', args);\n },\n\n error: (...args: unknown[]) => {\n callConsole('error', args);\n },\n};\n"],"mappings":";;;;;;;;AASA,SAAS,YAAY,QAAgB,MAAuB;CAC1D,MAAM,IAAI,OAAO,YAAY,cAAe,UAAsB;AAClE,KAAI,CAAC,EAAG;CACR,MAAM,KAAM,EAA8B;AAC1C,KAAI,OAAO,OAAO,WAChB,KAAI;AACD,KAAoC,MAAM,SAAS,KAAkB;SAChE;;AAMZ,MAAa,SAAS;CACpB,QAAQ,GAAG,SAAoB;AAC7B,MAAI,yBAAyB,CAAE;AAC/B,cAAY,SAAS,KAAK;;CAG5B,OAAO,GAAG,SAAoB;AAC5B,MAAI,yBAAyB,CAAE;AAC/B,cAAY,QAAQ,KAAK;;CAG3B,OAAO,GAAG,SAAoB;AAC5B,MAAI,yBAAyB,CAAE;AAC/B,cAAY,QAAQ,KAAK;;CAG3B,QAAQ,GAAG,SAAoB;AAC7B,cAAY,SAAS,KAAK;;CAE7B"}
@@ -1,23 +1,15 @@
1
- export { composeHandlers } from './utilities/compose-handlers';
2
- export type { ComposeHandlersOptions } from './utilities/compose-handlers';
3
- export { mergeProps } from './utilities/merge-props';
4
- export { ariaDisabled, ariaExpanded, ariaSelected } from './utilities/aria';
5
- export { composeRefs, setRef } from './utilities/compose-ref';
6
- export type { Ref } from './utilities/compose-ref';
7
- export { formatId } from './utilities/use-id';
8
- export type { FormatIdOptions } from './utilities/use-id';
9
- export { pressable } from './interactions/pressable';
10
- export type { PressableOptions, PressableResult, } from './interactions/pressable';
11
- export { dismissable } from './interactions/dismissable';
12
- export type { DismissableOptions } from './interactions/dismissable';
13
- export { focusable } from './interactions/focusable';
14
- export type { FocusableOptions, FocusableResult, } from './interactions/focusable';
15
- export { hoverable } from './interactions/hoverable';
16
- export type { HoverableOptions, HoverableResult, } from './interactions/hoverable';
17
- export { rovingFocus } from './interactions/roving-focus';
18
- export type { RovingFocusOptions, RovingFocusResult, Orientation, } from './interactions/roving-focus';
19
- export { applyInteractionPolicy, mergeInteractionProps, } from './interactions/interaction-policy';
20
- export type { InteractionPolicyInput } from './interactions/interaction-policy';
21
- export { isControlled, resolveControllable, makeControllable, controllableState, } from './state/controllable';
22
- export type { ControllableState } from './state/controllable';
23
- //# sourceMappingURL=core.d.ts.map
1
+ import { ComposeHandlersOptions, composeHandlers } from "./utilities/compose-handlers.js";
2
+ import { mergeProps } from "./utilities/merge-props.js";
3
+ import { ariaDisabled, ariaExpanded, ariaSelected } from "./utilities/aria.js";
4
+ import { Ref, composeRefs, setRef } from "./utilities/compose-ref.js";
5
+ import { FormatIdOptions, formatId } from "./utilities/use-id.js";
6
+ import { DefaultPreventable, FocusLikeEvent, KeyboardLikeEvent, PointerLikeEvent, PropagationStoppable } from "./utilities/event-types.js";
7
+ import { PressableOptions, PressableResult, pressable } from "./interactions/pressable.js";
8
+ import { DismissableOptions, dismissable } from "./interactions/dismissable.js";
9
+ import { FocusableOptions, FocusableResult, focusable } from "./interactions/focusable.js";
10
+ import { HoverableOptions, HoverableResult, hoverable } from "./interactions/hoverable.js";
11
+ import { Orientation, RovingFocusOptions, RovingFocusResult, rovingFocus } from "./interactions/roving-focus.js";
12
+ import { InteractionPolicyInput, applyInteractionPolicy, mergeInteractionProps } from "./interactions/interaction-policy.js";
13
+ import { ControllableState, controllableState, isControlled, makeControllable, resolveControllable } from "./state/controllable.js";
14
+ import { IconOwnProps, IconProps, IconSizeToken, IconStyleObject } from "./icon/icon.types.js";
15
+ import { IconBase, getIconContractProps, isIconSizeToken, joinIconStyle, normalizeIconSizeValue, resolveIconSizeVariable, resolveIconStrokeWidthVariable, serializeIconStyle } from "./icon/icon.js";
@@ -1 +1,13 @@
1
- import{composeHandlers as r}from"./utilities/compose-handlers.js";import{mergeProps as a}from"./utilities/merge-props.js";import{ariaDisabled as p,ariaExpanded as m,ariaSelected as s}from"./utilities/aria.js";import{composeRefs as x,setRef as i}from"./utilities/compose-ref.js";import{formatId as c}from"./utilities/use-id.js";import{pressable as d}from"./interactions/pressable.js";import{dismissable as v}from"./interactions/dismissable.js";import{focusable as I}from"./interactions/focusable.js";import{hoverable as u}from"./interactions/hoverable.js";import{rovingFocus as R}from"./interactions/roving-focus.js";import{applyInteractionPolicy as h,mergeInteractionProps as k}from"./interactions/interaction-policy.js";import{controllableState as E,isControlled as F,makeControllable as H,resolveControllable as j}from"./state/controllable.js";export{h as applyInteractionPolicy,p as ariaDisabled,m as ariaExpanded,s as ariaSelected,r as composeHandlers,x as composeRefs,E as controllableState,v as dismissable,I as focusable,c as formatId,u as hoverable,F as isControlled,H as makeControllable,k as mergeInteractionProps,a as mergeProps,d as pressable,j as resolveControllable,R as rovingFocus,i as setRef};
1
+ import "./utilities/aria.js";
2
+ import "./interactions/pressable.js";
3
+ import "./utilities/compose-handlers.js";
4
+ import "./utilities/compose-ref.js";
5
+ import "./utilities/merge-props.js";
6
+ import "./interactions/interaction-policy.js";
7
+ import "./utilities/use-id.js";
8
+ import "./interactions/dismissable.js";
9
+ import "./interactions/focusable.js";
10
+ import "./interactions/hoverable.js";
11
+ import "./interactions/roving-focus.js";
12
+ import "./state/controllable.js";
13
+ import "./icon/icon.js";
@@ -0,0 +1,53 @@
1
+ import { JSXElement } from "../../common/jsx.js";
2
+ import { IconProps, IconSizeToken, IconStyleObject } from "./icon.types.js";
3
+
4
+ //#region src/foundations/icon/icon.d.ts
5
+ declare function isIconSizeToken(value: unknown): value is IconSizeToken;
6
+ declare function normalizeIconSizeValue(size: number | string): string;
7
+ declare function resolveIconSizeVariable(size: number | string): string;
8
+ declare function resolveIconStrokeWidthVariable(strokeWidth: number, sizeToken: IconSizeToken | undefined): string;
9
+ declare function serializeIconStyle(style: string | IconStyleObject | undefined): string;
10
+ declare function joinIconStyle(...styles: Array<string | undefined>): string | undefined;
11
+ declare function getIconContractProps({
12
+ size,
13
+ strokeWidth,
14
+ color,
15
+ title,
16
+ style,
17
+ iconName
18
+ }: Pick<IconProps, 'color' | 'iconName' | 'size' | 'strokeWidth' | 'style' | 'title'>): {
19
+ sizeToken: IconSizeToken | undefined;
20
+ decorative: string | undefined;
21
+ iconStyle: string | undefined;
22
+ attrs: {
23
+ xmlns: string;
24
+ width: string;
25
+ height: string;
26
+ fill: string;
27
+ stroke: string;
28
+ 'stroke-width': string;
29
+ role: string;
30
+ 'aria-hidden': string | undefined;
31
+ style: string | undefined;
32
+ 'data-slot': string;
33
+ 'data-icon': string | undefined;
34
+ 'data-size': IconSizeToken | undefined;
35
+ 'data-decorative': string | undefined;
36
+ 'data-color': string | undefined;
37
+ };
38
+ };
39
+ declare function IconBase({
40
+ size,
41
+ strokeWidth,
42
+ color,
43
+ title,
44
+ class: className,
45
+ style,
46
+ iconName,
47
+ children,
48
+ ref,
49
+ ...rest
50
+ }: IconProps): JSXElement;
51
+ //#endregion
52
+ export { IconBase, getIconContractProps, isIconSizeToken, joinIconStyle, normalizeIconSizeValue, resolveIconSizeVariable, resolveIconStrokeWidthVariable, serializeIconStyle };
53
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","names":[],"sources":["../../../src/foundations/icon/icon.tsx"],"mappings":";;;;iBAMgB,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,aAAA;AAAA,iBAO1C,sBAAA,CAAuB,IAAA;AAAA,iBAKvB,uBAAA,CAAwB,IAAA;AAAA,iBAOxB,8BAAA,CACd,WAAA,UACA,SAAA,EAAW,aAAA;AAAA,iBAYG,kBAAA,CACd,KAAA,WAAgB,eAAA;AAAA,iBAUF,aAAA,CAAA,GACX,MAAA,EAAQ,KAAA;AAAA,iBAMG,oBAAA,CAAA;EACd,IAAA;EACA,WAAA;EACA,KAAA;EACA,KAAA;EACA,KAAA;EACA;AAAA,GACC,IAAA,CACD,SAAA;;;;;;;;;;;;;;;;;;;;;iBA4Cc,QAAA,CAAA;EACd,IAAA;EACA,WAAA;EACA,KAAA;EACA,KAAA;EACA,KAAA,EAAO,SAAA;EACP,KAAA;EACA,QAAA;EACA,QAAA;EACA,GAAA;EAAA,GACG;AAAA,GACF,SAAA,GAAS,UAAA"}