@askrjs/askr 0.0.50 → 0.0.52

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 (594) hide show
  1. package/dist/bench/components/benchmark-row.d.ts +2 -2
  2. package/dist/bench/components/benchmark-row.js +0 -2
  3. package/dist/bench/components/benchmark-table.js +0 -2
  4. package/dist/benchmark.d.ts +1 -2
  5. package/dist/benchmark.js +5 -6
  6. package/dist/bin/askr-ssg.d.ts +1 -2
  7. package/dist/bin/askr-ssg.js +21 -6
  8. package/dist/boot/hydration.js +10 -11
  9. package/dist/boot/index.d.ts +1 -2
  10. package/dist/boot/index.js +21 -11
  11. package/dist/boot/root-lifecycle.d.ts +6 -3
  12. package/dist/boot/root-lifecycle.js +18 -14
  13. package/dist/boot/route-startup.js +13 -4
  14. package/dist/boot/types.d.ts +1 -2
  15. package/dist/common/attr-names.js +0 -2
  16. package/dist/common/component.d.ts +1 -2
  17. package/dist/common/control.d.ts +1 -2
  18. package/dist/common/control.js +0 -2
  19. package/dist/common/dom-range.d.ts +13 -0
  20. package/dist/common/env.js +1 -7
  21. package/dist/common/error-boundary.d.ts +15 -0
  22. package/dist/common/invariant.js +15 -0
  23. package/dist/common/jsx.d.ts +1 -2
  24. package/dist/common/jsx.js +0 -2
  25. package/dist/{dev → common}/logger.js +5 -8
  26. package/dist/common/promise.js +0 -2
  27. package/dist/common/props.d.ts +1 -2
  28. package/dist/common/render-context.js +0 -2
  29. package/dist/common/route-activity.js +0 -2
  30. package/dist/common/router-internal.js +0 -2
  31. package/dist/common/router.d.ts +1 -2
  32. package/dist/common/ssr-errors.d.ts +1 -2
  33. package/dist/common/ssr-errors.js +0 -2
  34. package/dist/common/ssr.d.ts +1 -2
  35. package/dist/common/ssr.js +0 -2
  36. package/dist/common/vnode.d.ts +1 -2
  37. package/dist/common/vnode.js +0 -2
  38. package/dist/components/error-boundary.d.ts +2 -16
  39. package/dist/components/error-boundary.js +2 -76
  40. package/dist/components/index.d.ts +2 -1
  41. package/dist/components/link.d.ts +2 -2
  42. package/dist/components/link.js +2 -2
  43. package/dist/control/case.d.ts +1 -2
  44. package/dist/control/case.js +1 -2
  45. package/dist/control/for.d.ts +3 -4
  46. package/dist/control/for.js +2 -4
  47. package/dist/control/shared.d.ts +1 -2
  48. package/dist/control/shared.js +0 -2
  49. package/dist/control/show.d.ts +1 -2
  50. package/dist/control/show.js +1 -2
  51. package/dist/data/data-runtime.d.ts +1 -2
  52. package/dist/data/data-runtime.js +3 -5
  53. package/dist/data/invalidation-listeners.js +0 -2
  54. package/dist/data/invalidation.d.ts +1 -2
  55. package/dist/data/invalidation.js +2 -4
  56. package/dist/data/mutation-cell.d.ts +1 -2
  57. package/dist/data/mutation-cell.js +7 -6
  58. package/dist/data/query-cell.d.ts +3 -2
  59. package/dist/data/query-cell.js +45 -11
  60. package/dist/data/query-key.js +0 -2
  61. package/dist/data/shared.js +3 -3
  62. package/dist/data/testing.js +2 -0
  63. package/dist/data/types.d.ts +1 -2
  64. package/dist/foundations/icon/icon.d.ts +1 -2
  65. package/dist/foundations/icon/icon.js +0 -2
  66. package/dist/foundations/icon/icon.types.d.ts +1 -2
  67. package/dist/foundations/index.d.ts +1 -1
  68. package/dist/foundations/index.js +1 -1
  69. package/dist/foundations/interactions/dismissable.d.ts +1 -2
  70. package/dist/foundations/interactions/dismissable.js +0 -2
  71. package/dist/foundations/interactions/focusable.d.ts +1 -2
  72. package/dist/foundations/interactions/focusable.js +0 -2
  73. package/dist/foundations/interactions/hoverable.d.ts +1 -2
  74. package/dist/foundations/interactions/hoverable.js +0 -2
  75. package/dist/foundations/interactions/interaction-policy.d.ts +1 -2
  76. package/dist/foundations/interactions/interaction-policy.js +0 -2
  77. package/dist/foundations/interactions/pressable.d.ts +1 -2
  78. package/dist/foundations/interactions/pressable.js +0 -2
  79. package/dist/foundations/interactions/roving-focus.d.ts +1 -2
  80. package/dist/foundations/interactions/roving-focus.js +0 -2
  81. package/dist/foundations/state/controllable.d.ts +1 -3
  82. package/dist/foundations/state/controllable.js +1 -2
  83. package/dist/foundations/structures/collection.d.ts +1 -2
  84. package/dist/foundations/structures/collection.js +0 -2
  85. package/dist/foundations/structures/index.d.ts +1 -1
  86. package/dist/foundations/structures/index.js +2 -1
  87. package/dist/foundations/structures/layer.d.ts +1 -2
  88. package/dist/foundations/structures/layer.js +0 -2
  89. package/dist/foundations/structures/layout.d.ts +1 -2
  90. package/dist/foundations/structures/layout.js +0 -2
  91. package/dist/foundations/structures/portal.d.ts +2 -24
  92. package/dist/foundations/structures/portal.js +3 -187
  93. package/dist/foundations/structures/presence.d.ts +1 -2
  94. package/dist/foundations/structures/presence.js +0 -2
  95. package/dist/foundations/structures/slot.d.ts +1 -2
  96. package/dist/foundations/structures/slot.js +0 -2
  97. package/dist/foundations/utilities/aria.d.ts +1 -2
  98. package/dist/foundations/utilities/aria.js +0 -2
  99. package/dist/foundations/utilities/compose-handlers.d.ts +1 -2
  100. package/dist/foundations/utilities/compose-handlers.js +0 -2
  101. package/dist/foundations/utilities/compose-ref.d.ts +1 -2
  102. package/dist/foundations/utilities/compose-ref.js +0 -2
  103. package/dist/foundations/utilities/event-types.d.ts +1 -2
  104. package/dist/foundations/utilities/merge-props.d.ts +1 -2
  105. package/dist/foundations/utilities/merge-props.js +0 -2
  106. package/dist/foundations/utilities/use-id.d.ts +1 -2
  107. package/dist/foundations/utilities/use-id.js +0 -2
  108. package/dist/fx/fx.d.ts +1 -2
  109. package/dist/fx/fx.js +2 -4
  110. package/dist/fx/index.js +1 -0
  111. package/dist/fx/noop.js +0 -2
  112. package/dist/fx/timing.d.ts +1 -2
  113. package/dist/fx/timing.js +0 -2
  114. package/dist/index.d.ts +4 -4
  115. package/dist/index.js +4 -6
  116. package/dist/jsx/types.d.ts +1 -2
  117. package/dist/jsx/utils.d.ts +1 -2
  118. package/dist/jsx/utils.js +0 -2
  119. package/dist/jsx-dev-runtime.d.ts +16 -2
  120. package/dist/jsx-dev-runtime.js +4 -12
  121. package/dist/jsx-runtime.d.ts +16 -2
  122. package/dist/jsx-runtime.js +16 -24
  123. package/dist/jsx-runtime2.d.ts +1 -1
  124. package/dist/renderer/attributes.js +29 -6
  125. package/dist/renderer/boundaries.js +50 -174
  126. package/dist/renderer/boundary-materialization.js +72 -0
  127. package/dist/renderer/boundary-range-adoption.js +76 -0
  128. package/dist/renderer/boundary-range-sync.js +101 -0
  129. package/dist/renderer/boundary-state.js +50 -0
  130. package/dist/renderer/child-shape.js +2 -4
  131. package/dist/renderer/children-fastpath.js +149 -0
  132. package/dist/renderer/children.js +3 -140
  133. package/dist/renderer/cleanup.js +72 -15
  134. package/dist/renderer/component-host-cleanup.js +124 -49
  135. package/dist/renderer/component-host-instances.js +60 -9
  136. package/dist/renderer/component-host-replacement.js +105 -0
  137. package/dist/renderer/component-host-results.js +138 -0
  138. package/dist/renderer/component-host.js +95 -170
  139. package/dist/renderer/dom-host.js +0 -2
  140. package/dist/renderer/dom-internal.js +115 -57
  141. package/dist/renderer/dom-range.js +161 -0
  142. package/dist/renderer/dom.js +7 -5
  143. package/dist/renderer/element-children.js +112 -32
  144. package/dist/renderer/error-boundary-dom.js +70 -13
  145. package/dist/renderer/evaluate-dom-range.js +3 -4
  146. package/dist/renderer/evaluate-reconcile.js +18 -42
  147. package/dist/renderer/evaluate.js +14 -3
  148. package/dist/renderer/fastpath.js +7 -14
  149. package/dist/renderer/for-commit-dom-map.js +6 -18
  150. package/dist/renderer/for-commit-removal.js +8 -17
  151. package/dist/renderer/for-commit-reorder.js +2 -4
  152. package/dist/renderer/for-commit.js +173 -45
  153. package/dist/renderer/hydration-boundaries.js +60 -0
  154. package/dist/renderer/hydration-listener-transaction.js +49 -0
  155. package/dist/renderer/index.js +11 -8
  156. package/dist/renderer/intrinsic-blueprint-analysis.js +202 -0
  157. package/dist/renderer/intrinsic-blueprint-bindings.js +152 -0
  158. package/dist/renderer/intrinsic-blueprint-materialization.js +100 -0
  159. package/dist/renderer/intrinsic-blueprint.js +30 -0
  160. package/dist/renderer/intrinsic-hydration-adoption.js +66 -0
  161. package/dist/renderer/keyed-children.js +3 -9
  162. package/dist/renderer/keyed.js +10 -10
  163. package/dist/renderer/namespaces.js +0 -2
  164. package/dist/renderer/prop-bindings.js +59 -24
  165. package/dist/renderer/reactive-child-dom.js +10 -4
  166. package/dist/renderer/reactive-child-sources.js +0 -2
  167. package/dist/renderer/reactive-children.js +33 -24
  168. package/dist/renderer/reconcile-commit.js +0 -2
  169. package/dist/renderer/reconcile-fastpaths.js +6 -12
  170. package/dist/renderer/reconcile-resolution.js +32 -56
  171. package/dist/renderer/reconcile.js +0 -2
  172. package/dist/renderer/retained-element-rollback.js +161 -149
  173. package/dist/renderer/stable-patch.js +5 -7
  174. package/dist/renderer/static-reuse.js +0 -2
  175. package/dist/renderer/utils.js +20 -10
  176. package/dist/resources/index.js +1 -2
  177. package/dist/router/access.js +0 -2
  178. package/dist/router/activity.d.ts +1 -2
  179. package/dist/router/activity.js +20 -24
  180. package/dist/router/authoring.d.ts +1 -2
  181. package/dist/router/authoring.js +1 -3
  182. package/dist/router/index.d.ts +1 -1
  183. package/dist/router/internal-types.d.ts +1 -2
  184. package/dist/router/lazy.d.ts +1 -2
  185. package/dist/router/lazy.js +0 -2
  186. package/dist/router/manifest.d.ts +1 -2
  187. package/dist/router/manifest.js +0 -2
  188. package/dist/router/match.js +0 -2
  189. package/dist/router/navigate.d.ts +1 -2
  190. package/dist/router/navigate.js +5 -8
  191. package/dist/router/navigation-registry.d.ts +1 -2
  192. package/dist/router/navigation-registry.js +1 -3
  193. package/dist/router/navigation-scroll.d.ts +1 -2
  194. package/dist/router/navigation-scroll.js +0 -2
  195. package/dist/router/navigation-targets.d.ts +3 -4
  196. package/dist/router/navigation-targets.js +425 -44
  197. package/dist/router/policy.d.ts +1 -2
  198. package/dist/router/policy.js +0 -2
  199. package/dist/router/rendering.d.ts +1 -2
  200. package/dist/router/rendering.js +5 -3
  201. package/dist/router/resolution.d.ts +2 -16
  202. package/dist/router/resolution.js +6 -175
  203. package/dist/router/route-context.js +0 -2
  204. package/dist/router/route-matching.d.ts +19 -0
  205. package/dist/router/route-matching.js +173 -0
  206. package/dist/router/route-query.d.ts +1 -2
  207. package/dist/router/route-query.js +1 -3
  208. package/dist/router/route.js +4 -2
  209. package/dist/router/store.d.ts +1 -2
  210. package/dist/router/store.js +0 -2
  211. package/dist/router/testing.js +4 -0
  212. package/dist/runtime/access.d.ts +19 -0
  213. package/dist/runtime/access.js +0 -2
  214. package/dist/runtime/child-scope.d.ts +21 -2
  215. package/dist/runtime/child-scope.js +101 -54
  216. package/dist/runtime/component-cleanup.d.ts +1 -2
  217. package/dist/runtime/component-cleanup.js +3 -5
  218. package/dist/runtime/component-commit.js +26 -24
  219. package/dist/runtime/component-facade.js +5 -3
  220. package/dist/runtime/component-internal.d.ts +12 -7
  221. package/dist/runtime/component-internal.js +64 -46
  222. package/dist/runtime/component-lifecycle.d.ts +2 -41
  223. package/dist/runtime/component-lifecycle.js +6 -149
  224. package/dist/runtime/component-scope.d.ts +4 -5
  225. package/dist/runtime/component-scope.js +27 -8
  226. package/dist/runtime/component.js +4 -3
  227. package/dist/runtime/context.d.ts +5 -2
  228. package/dist/runtime/context.js +29 -3
  229. package/dist/runtime/control.d.ts +22 -3
  230. package/dist/runtime/control.js +168 -55
  231. package/dist/runtime/derive.d.ts +1 -2
  232. package/dist/runtime/derive.js +0 -2
  233. package/dist/runtime/dev-namespace.d.ts +30 -0
  234. package/dist/runtime/dev-namespace.js +32 -25
  235. package/dist/runtime/effect.d.ts +8 -5
  236. package/dist/runtime/effect.js +158 -75
  237. package/dist/runtime/error-boundary.d.ts +4 -0
  238. package/dist/runtime/error-boundary.js +29 -0
  239. package/dist/runtime/events.d.ts +58 -0
  240. package/dist/runtime/events.js +67 -70
  241. package/dist/runtime/execution-model.d.ts +6 -0
  242. package/dist/runtime/execution-model.js +0 -2
  243. package/dist/runtime/fastlane.d.ts +33 -0
  244. package/dist/runtime/fastlane.js +0 -2
  245. package/dist/runtime/for-bench.d.ts +1 -2
  246. package/dist/runtime/for-bench.js +9 -167
  247. package/dist/runtime/for-internal.d.ts +73 -10
  248. package/dist/runtime/for-internal.js +201 -14
  249. package/dist/runtime/for-reconcile.d.ts +1 -2
  250. package/dist/runtime/for-reconcile.js +76 -23
  251. package/dist/runtime/for-scopes.d.ts +5 -5
  252. package/dist/runtime/for-scopes.js +168 -48
  253. package/dist/runtime/for-signals.d.ts +14 -5
  254. package/dist/runtime/for-signals.js +157 -83
  255. package/dist/runtime/for-types.d.ts +8 -0
  256. package/dist/runtime/for.d.ts +2 -2
  257. package/dist/runtime/for.js +3 -3
  258. package/dist/runtime/index.d.ts +24 -0
  259. package/dist/runtime/index.js +33 -0
  260. package/dist/runtime/lifecycle-batch.d.ts +59 -0
  261. package/dist/runtime/lifecycle-batch.js +178 -0
  262. package/dist/runtime/lifecycle-operation-settlement.d.ts +5 -0
  263. package/dist/runtime/lifecycle-operation-settlement.js +51 -0
  264. package/dist/runtime/lifecycle-operations.d.ts +1 -2
  265. package/dist/runtime/lifecycle-operations.js +5 -6
  266. package/dist/runtime/perf-metrics.d.ts +27 -0
  267. package/dist/runtime/perf-metrics.js +4 -68
  268. package/dist/runtime/portal.d.ts +21 -0
  269. package/dist/runtime/portal.js +305 -0
  270. package/dist/runtime/readable.d.ts +9 -4
  271. package/dist/runtime/readable.js +41 -17
  272. package/dist/runtime/resource-cell.js +3 -5
  273. package/dist/runtime/resource-operation.d.ts +1 -2
  274. package/dist/runtime/resource-operation.js +38 -35
  275. package/dist/runtime/runtime.d.ts +2 -3
  276. package/dist/runtime/runtime.js +0 -2
  277. package/dist/runtime/scheduler.d.ts +1 -2
  278. package/dist/runtime/scheduler.js +10 -13
  279. package/dist/runtime/selector-store.js +22 -0
  280. package/dist/runtime/selector.d.ts +1 -2
  281. package/dist/runtime/selector.js +6 -29
  282. package/dist/runtime/snapshot-source.d.ts +1 -2
  283. package/dist/runtime/snapshot-source.js +0 -2
  284. package/dist/runtime/state.d.ts +1 -2
  285. package/dist/runtime/state.js +1 -3
  286. package/dist/ssg/batch-render.js +0 -2
  287. package/dist/ssg/create-static-gen.d.ts +4 -2
  288. package/dist/ssg/create-static-gen.js +66 -14
  289. package/dist/ssg/generate-metadata.js +0 -2
  290. package/dist/ssg/generation-plan.js +0 -2
  291. package/dist/ssg/incremental-manifest.js +1 -3
  292. package/dist/ssg/resolve-ssg-data.js +0 -2
  293. package/dist/ssg/route-utils.js +0 -2
  294. package/dist/ssg/static-routes.js +1 -2
  295. package/dist/ssg/types.d.ts +2 -3
  296. package/dist/ssg/write-static-files.js +16 -12
  297. package/dist/ssr/attrs.js +0 -2
  298. package/dist/ssr/boundaries.js +17 -6
  299. package/dist/ssr/component-runtime.js +4 -30
  300. package/dist/ssr/context.d.ts +1 -2
  301. package/dist/ssr/context.js +0 -2
  302. package/dist/ssr/errors.d.ts +1 -2
  303. package/dist/ssr/errors.js +0 -2
  304. package/dist/ssr/escape.js +0 -2
  305. package/dist/ssr/hydration-data.js +0 -2
  306. package/dist/ssr/hydration-verify.d.ts +1 -2
  307. package/dist/ssr/hydration-verify.js +34 -7
  308. package/dist/ssr/index-internal.d.ts +1 -2
  309. package/dist/ssr/index-internal.js +0 -2
  310. package/dist/ssr/render-keys.js +0 -2
  311. package/dist/ssr/render-resolved.d.ts +1 -2
  312. package/dist/ssr/render-resolved.js +1 -3
  313. package/dist/ssr/render-sync.d.ts +1 -2
  314. package/dist/ssr/render-sync.js +28 -20
  315. package/dist/ssr/route-policy-resolution.js +2 -3
  316. package/dist/ssr/route-render.d.ts +1 -2
  317. package/dist/ssr/route-render.js +2 -3
  318. package/dist/ssr/sink.d.ts +1 -2
  319. package/dist/ssr/sink.js +0 -2
  320. package/dist/ssr/types.d.ts +1 -2
  321. package/dist/ssr/verify-hydration.js +0 -2
  322. package/dist/testing/index.d.ts +1 -2
  323. package/dist/testing/index.js +3 -4
  324. package/package.json +60 -47
  325. package/dist/bench/components/benchmark-row.d.ts.map +0 -1
  326. package/dist/bench/components/benchmark-row.js.map +0 -1
  327. package/dist/bench/components/benchmark-table.js.map +0 -1
  328. package/dist/benchmark.d.ts.map +0 -1
  329. package/dist/benchmark.js.map +0 -1
  330. package/dist/bin/askr-ssg.d.ts.map +0 -1
  331. package/dist/bin/askr-ssg.js.map +0 -1
  332. package/dist/boot/hydration.js.map +0 -1
  333. package/dist/boot/index.d.ts.map +0 -1
  334. package/dist/boot/index.js.map +0 -1
  335. package/dist/boot/root-lifecycle.d.ts.map +0 -1
  336. package/dist/boot/root-lifecycle.js.map +0 -1
  337. package/dist/boot/route-startup.js.map +0 -1
  338. package/dist/boot/types.d.ts.map +0 -1
  339. package/dist/common/attr-names.js.map +0 -1
  340. package/dist/common/component.d.ts.map +0 -1
  341. package/dist/common/control.d.ts.map +0 -1
  342. package/dist/common/control.js.map +0 -1
  343. package/dist/common/env.js.map +0 -1
  344. package/dist/common/jsx.d.ts.map +0 -1
  345. package/dist/common/jsx.js.map +0 -1
  346. package/dist/common/promise.js.map +0 -1
  347. package/dist/common/props.d.ts.map +0 -1
  348. package/dist/common/render-context.js.map +0 -1
  349. package/dist/common/route-activity.js.map +0 -1
  350. package/dist/common/router-internal.js.map +0 -1
  351. package/dist/common/router.d.ts.map +0 -1
  352. package/dist/common/ssr-errors.d.ts.map +0 -1
  353. package/dist/common/ssr-errors.js.map +0 -1
  354. package/dist/common/ssr.d.ts.map +0 -1
  355. package/dist/common/ssr.js.map +0 -1
  356. package/dist/common/vnode.d.ts.map +0 -1
  357. package/dist/common/vnode.js.map +0 -1
  358. package/dist/components/error-boundary.d.ts.map +0 -1
  359. package/dist/components/error-boundary.js.map +0 -1
  360. package/dist/components/link.d.ts.map +0 -1
  361. package/dist/components/link.js.map +0 -1
  362. package/dist/control/case.d.ts.map +0 -1
  363. package/dist/control/case.js.map +0 -1
  364. package/dist/control/for.d.ts.map +0 -1
  365. package/dist/control/for.js.map +0 -1
  366. package/dist/control/shared.d.ts.map +0 -1
  367. package/dist/control/shared.js.map +0 -1
  368. package/dist/control/show.d.ts.map +0 -1
  369. package/dist/control/show.js.map +0 -1
  370. package/dist/data/data-runtime.d.ts.map +0 -1
  371. package/dist/data/data-runtime.js.map +0 -1
  372. package/dist/data/invalidation-listeners.js.map +0 -1
  373. package/dist/data/invalidation.d.ts.map +0 -1
  374. package/dist/data/invalidation.js.map +0 -1
  375. package/dist/data/mutation-cell.d.ts.map +0 -1
  376. package/dist/data/mutation-cell.js.map +0 -1
  377. package/dist/data/query-cell.d.ts.map +0 -1
  378. package/dist/data/query-cell.js.map +0 -1
  379. package/dist/data/query-key.js.map +0 -1
  380. package/dist/data/shared.js.map +0 -1
  381. package/dist/data/types.d.ts.map +0 -1
  382. package/dist/dev/invariant.js +0 -29
  383. package/dist/dev/invariant.js.map +0 -1
  384. package/dist/dev/logger.js.map +0 -1
  385. package/dist/foundations/icon/icon.d.ts.map +0 -1
  386. package/dist/foundations/icon/icon.js.map +0 -1
  387. package/dist/foundations/icon/icon.types.d.ts.map +0 -1
  388. package/dist/foundations/interactions/dismissable.d.ts.map +0 -1
  389. package/dist/foundations/interactions/dismissable.js.map +0 -1
  390. package/dist/foundations/interactions/focusable.d.ts.map +0 -1
  391. package/dist/foundations/interactions/focusable.js.map +0 -1
  392. package/dist/foundations/interactions/hoverable.d.ts.map +0 -1
  393. package/dist/foundations/interactions/hoverable.js.map +0 -1
  394. package/dist/foundations/interactions/interaction-policy.d.ts.map +0 -1
  395. package/dist/foundations/interactions/interaction-policy.js.map +0 -1
  396. package/dist/foundations/interactions/pressable.d.ts.map +0 -1
  397. package/dist/foundations/interactions/pressable.js.map +0 -1
  398. package/dist/foundations/interactions/roving-focus.d.ts.map +0 -1
  399. package/dist/foundations/interactions/roving-focus.js.map +0 -1
  400. package/dist/foundations/state/controllable.d.ts.map +0 -1
  401. package/dist/foundations/state/controllable.js.map +0 -1
  402. package/dist/foundations/structures/collection.d.ts.map +0 -1
  403. package/dist/foundations/structures/collection.js.map +0 -1
  404. package/dist/foundations/structures/layer.d.ts.map +0 -1
  405. package/dist/foundations/structures/layer.js.map +0 -1
  406. package/dist/foundations/structures/layout.d.ts.map +0 -1
  407. package/dist/foundations/structures/layout.js.map +0 -1
  408. package/dist/foundations/structures/portal.d.ts.map +0 -1
  409. package/dist/foundations/structures/portal.js.map +0 -1
  410. package/dist/foundations/structures/presence.d.ts.map +0 -1
  411. package/dist/foundations/structures/presence.js.map +0 -1
  412. package/dist/foundations/structures/slot.d.ts.map +0 -1
  413. package/dist/foundations/structures/slot.js.map +0 -1
  414. package/dist/foundations/utilities/aria.d.ts.map +0 -1
  415. package/dist/foundations/utilities/aria.js.map +0 -1
  416. package/dist/foundations/utilities/compose-handlers.d.ts.map +0 -1
  417. package/dist/foundations/utilities/compose-handlers.js.map +0 -1
  418. package/dist/foundations/utilities/compose-ref.d.ts.map +0 -1
  419. package/dist/foundations/utilities/compose-ref.js.map +0 -1
  420. package/dist/foundations/utilities/event-types.d.ts.map +0 -1
  421. package/dist/foundations/utilities/merge-props.d.ts.map +0 -1
  422. package/dist/foundations/utilities/merge-props.js.map +0 -1
  423. package/dist/foundations/utilities/use-id.d.ts.map +0 -1
  424. package/dist/foundations/utilities/use-id.js.map +0 -1
  425. package/dist/fx/fx.d.ts.map +0 -1
  426. package/dist/fx/fx.js.map +0 -1
  427. package/dist/fx/noop.js.map +0 -1
  428. package/dist/fx/timing.d.ts.map +0 -1
  429. package/dist/fx/timing.js.map +0 -1
  430. package/dist/index.js.map +0 -1
  431. package/dist/jsx/types.d.ts.map +0 -1
  432. package/dist/jsx/utils.d.ts.map +0 -1
  433. package/dist/jsx/utils.js.map +0 -1
  434. package/dist/jsx-dev-runtime.d.ts.map +0 -1
  435. package/dist/jsx-dev-runtime.js.map +0 -1
  436. package/dist/jsx-runtime.d.ts.map +0 -1
  437. package/dist/jsx-runtime.js.map +0 -1
  438. package/dist/renderer/attributes.js.map +0 -1
  439. package/dist/renderer/boundaries.js.map +0 -1
  440. package/dist/renderer/child-shape.js.map +0 -1
  441. package/dist/renderer/children.js.map +0 -1
  442. package/dist/renderer/cleanup.js.map +0 -1
  443. package/dist/renderer/component-host-cleanup.js.map +0 -1
  444. package/dist/renderer/component-host-instances.js.map +0 -1
  445. package/dist/renderer/component-host.js.map +0 -1
  446. package/dist/renderer/dom-host.js.map +0 -1
  447. package/dist/renderer/dom-internal.js.map +0 -1
  448. package/dist/renderer/element-children.js.map +0 -1
  449. package/dist/renderer/error-boundary-dom.js.map +0 -1
  450. package/dist/renderer/evaluate-dom-range.js.map +0 -1
  451. package/dist/renderer/evaluate-reconcile.js.map +0 -1
  452. package/dist/renderer/evaluate.js.map +0 -1
  453. package/dist/renderer/fastpath.js.map +0 -1
  454. package/dist/renderer/for-commit-dom-map.js.map +0 -1
  455. package/dist/renderer/for-commit-removal.js.map +0 -1
  456. package/dist/renderer/for-commit-reorder.js.map +0 -1
  457. package/dist/renderer/for-commit.js.map +0 -1
  458. package/dist/renderer/index.js.map +0 -1
  459. package/dist/renderer/keyed-children.js.map +0 -1
  460. package/dist/renderer/keyed.js.map +0 -1
  461. package/dist/renderer/namespaces.js.map +0 -1
  462. package/dist/renderer/prop-bindings.js.map +0 -1
  463. package/dist/renderer/reactive-child-dom.js.map +0 -1
  464. package/dist/renderer/reactive-child-sources.js.map +0 -1
  465. package/dist/renderer/reactive-children.js.map +0 -1
  466. package/dist/renderer/reconcile-commit.js.map +0 -1
  467. package/dist/renderer/reconcile-fastpaths.js.map +0 -1
  468. package/dist/renderer/reconcile-resolution.js.map +0 -1
  469. package/dist/renderer/reconcile.js.map +0 -1
  470. package/dist/renderer/retained-element-rollback.js.map +0 -1
  471. package/dist/renderer/stable-patch.js.map +0 -1
  472. package/dist/renderer/static-reuse.js.map +0 -1
  473. package/dist/renderer/utils.js.map +0 -1
  474. package/dist/router/access.js.map +0 -1
  475. package/dist/router/activity.d.ts.map +0 -1
  476. package/dist/router/activity.js.map +0 -1
  477. package/dist/router/authoring.d.ts.map +0 -1
  478. package/dist/router/authoring.js.map +0 -1
  479. package/dist/router/internal-types.d.ts.map +0 -1
  480. package/dist/router/lazy.d.ts.map +0 -1
  481. package/dist/router/lazy.js.map +0 -1
  482. package/dist/router/manifest.d.ts.map +0 -1
  483. package/dist/router/manifest.js.map +0 -1
  484. package/dist/router/match.js.map +0 -1
  485. package/dist/router/navigate.d.ts.map +0 -1
  486. package/dist/router/navigate.js.map +0 -1
  487. package/dist/router/navigation-registry.d.ts.map +0 -1
  488. package/dist/router/navigation-registry.js.map +0 -1
  489. package/dist/router/navigation-scroll.d.ts.map +0 -1
  490. package/dist/router/navigation-scroll.js.map +0 -1
  491. package/dist/router/navigation-targets.d.ts.map +0 -1
  492. package/dist/router/navigation-targets.js.map +0 -1
  493. package/dist/router/policy.d.ts.map +0 -1
  494. package/dist/router/policy.js.map +0 -1
  495. package/dist/router/rendering.d.ts.map +0 -1
  496. package/dist/router/rendering.js.map +0 -1
  497. package/dist/router/resolution.d.ts.map +0 -1
  498. package/dist/router/resolution.js.map +0 -1
  499. package/dist/router/route-context.js.map +0 -1
  500. package/dist/router/route-query.d.ts.map +0 -1
  501. package/dist/router/route-query.js.map +0 -1
  502. package/dist/router/store.d.ts.map +0 -1
  503. package/dist/router/store.js.map +0 -1
  504. package/dist/runtime/access.js.map +0 -1
  505. package/dist/runtime/child-scope.d.ts.map +0 -1
  506. package/dist/runtime/child-scope.js.map +0 -1
  507. package/dist/runtime/component-cleanup.d.ts.map +0 -1
  508. package/dist/runtime/component-cleanup.js.map +0 -1
  509. package/dist/runtime/component-commit.js.map +0 -1
  510. package/dist/runtime/component-contracts.js +0 -5
  511. package/dist/runtime/component-internal.d.ts.map +0 -1
  512. package/dist/runtime/component-internal.js.map +0 -1
  513. package/dist/runtime/component-lifecycle.d.ts.map +0 -1
  514. package/dist/runtime/component-lifecycle.js.map +0 -1
  515. package/dist/runtime/component-scope.d.ts.map +0 -1
  516. package/dist/runtime/component-scope.js.map +0 -1
  517. package/dist/runtime/context.d.ts.map +0 -1
  518. package/dist/runtime/context.js.map +0 -1
  519. package/dist/runtime/control.d.ts.map +0 -1
  520. package/dist/runtime/control.js.map +0 -1
  521. package/dist/runtime/derive.d.ts.map +0 -1
  522. package/dist/runtime/derive.js.map +0 -1
  523. package/dist/runtime/dev-namespace.js.map +0 -1
  524. package/dist/runtime/effect.d.ts.map +0 -1
  525. package/dist/runtime/effect.js.map +0 -1
  526. package/dist/runtime/events.js.map +0 -1
  527. package/dist/runtime/execution-model.js.map +0 -1
  528. package/dist/runtime/fastlane.js.map +0 -1
  529. package/dist/runtime/for-bench.d.ts.map +0 -1
  530. package/dist/runtime/for-bench.js.map +0 -1
  531. package/dist/runtime/for-internal.d.ts.map +0 -1
  532. package/dist/runtime/for-internal.js.map +0 -1
  533. package/dist/runtime/for-reconcile.d.ts.map +0 -1
  534. package/dist/runtime/for-reconcile.js.map +0 -1
  535. package/dist/runtime/for-scopes.d.ts.map +0 -1
  536. package/dist/runtime/for-scopes.js.map +0 -1
  537. package/dist/runtime/for-signals.d.ts.map +0 -1
  538. package/dist/runtime/for-signals.js.map +0 -1
  539. package/dist/runtime/lifecycle-operations.d.ts.map +0 -1
  540. package/dist/runtime/lifecycle-operations.js.map +0 -1
  541. package/dist/runtime/perf-metrics.js.map +0 -1
  542. package/dist/runtime/readable.d.ts.map +0 -1
  543. package/dist/runtime/readable.js.map +0 -1
  544. package/dist/runtime/resource-cell.js.map +0 -1
  545. package/dist/runtime/resource-operation.d.ts.map +0 -1
  546. package/dist/runtime/resource-operation.js.map +0 -1
  547. package/dist/runtime/runtime.d.ts.map +0 -1
  548. package/dist/runtime/runtime.js.map +0 -1
  549. package/dist/runtime/scheduler.d.ts.map +0 -1
  550. package/dist/runtime/scheduler.js.map +0 -1
  551. package/dist/runtime/selector.d.ts.map +0 -1
  552. package/dist/runtime/selector.js.map +0 -1
  553. package/dist/runtime/snapshot-source.d.ts.map +0 -1
  554. package/dist/runtime/snapshot-source.js.map +0 -1
  555. package/dist/runtime/state.d.ts.map +0 -1
  556. package/dist/runtime/state.js.map +0 -1
  557. package/dist/ssg/batch-render.js.map +0 -1
  558. package/dist/ssg/create-static-gen.d.ts.map +0 -1
  559. package/dist/ssg/create-static-gen.js.map +0 -1
  560. package/dist/ssg/generate-metadata.js.map +0 -1
  561. package/dist/ssg/generation-plan.js.map +0 -1
  562. package/dist/ssg/incremental-manifest.js.map +0 -1
  563. package/dist/ssg/resolve-ssg-data.js.map +0 -1
  564. package/dist/ssg/route-utils.js.map +0 -1
  565. package/dist/ssg/static-routes.js.map +0 -1
  566. package/dist/ssg/types.d.ts.map +0 -1
  567. package/dist/ssg/write-static-files.js.map +0 -1
  568. package/dist/ssr/attrs.js.map +0 -1
  569. package/dist/ssr/boundaries.js.map +0 -1
  570. package/dist/ssr/component-runtime.js.map +0 -1
  571. package/dist/ssr/context.d.ts.map +0 -1
  572. package/dist/ssr/context.js.map +0 -1
  573. package/dist/ssr/errors.d.ts.map +0 -1
  574. package/dist/ssr/errors.js.map +0 -1
  575. package/dist/ssr/escape.js.map +0 -1
  576. package/dist/ssr/hydration-data.js.map +0 -1
  577. package/dist/ssr/hydration-verify.d.ts.map +0 -1
  578. package/dist/ssr/hydration-verify.js.map +0 -1
  579. package/dist/ssr/index-internal.d.ts.map +0 -1
  580. package/dist/ssr/index-internal.js.map +0 -1
  581. package/dist/ssr/render-keys.js.map +0 -1
  582. package/dist/ssr/render-resolved.d.ts.map +0 -1
  583. package/dist/ssr/render-resolved.js.map +0 -1
  584. package/dist/ssr/render-sync.d.ts.map +0 -1
  585. package/dist/ssr/render-sync.js.map +0 -1
  586. package/dist/ssr/route-policy-resolution.js.map +0 -1
  587. package/dist/ssr/route-render.d.ts.map +0 -1
  588. package/dist/ssr/route-render.js.map +0 -1
  589. package/dist/ssr/sink.d.ts.map +0 -1
  590. package/dist/ssr/sink.js.map +0 -1
  591. package/dist/ssr/types.d.ts.map +0 -1
  592. package/dist/ssr/verify-hydration.js.map +0 -1
  593. package/dist/testing/index.d.ts.map +0 -1
  594. package/dist/testing/index.js.map +0 -1
@@ -1,33 +1,27 @@
1
- import { logger } from "../dev/logger.js";
1
+ import { logger } from "../common/logger.js";
2
+ import { getCurrentLifecycleCommitBatch, registerLifecycleTransaction } from "../runtime/lifecycle-batch.js";
2
3
  import { addDelegatedListener, getDelegatedHandlersForElement, removeDelegatedListener, updateDelegatedListener } from "../runtime/events.js";
3
- import { elementListeners, elementReactivePropsCleanup, elementRefs } from "./cleanup.js";
4
+ import "../runtime/index.js";
5
+ import { elementListeners, elementReactivePropsCleanup, elementRefs, getElementReactivePropsCleanupMap } from "./cleanup.js";
4
6
  import { keyedElements } from "./keyed.js";
5
7
  //#region src/renderer/retained-element-rollback.ts
6
- function collectElementSubtree(root) {
7
- const elements = [root];
8
- const descendants = root.querySelectorAll("*");
9
- for (let index = 0; index < descendants.length; index += 1) elements.push(descendants[index]);
10
- return elements;
11
- }
12
8
  function collectTextSnapshots(root) {
13
9
  const snapshots = [];
14
- const stack = Array.from(root.childNodes).reverse();
15
- while (stack.length > 0) {
16
- const node = stack.pop();
10
+ for (let index = 0; index < root.childNodes.length; index += 1) {
11
+ const node = root.childNodes[index];
17
12
  if (node.nodeType === 3) {
13
+ const text = node;
18
14
  snapshots.push({
19
- node,
20
- data: node.data
15
+ node: text,
16
+ data: text.data
21
17
  });
22
- continue;
23
18
  }
24
- for (let child = node.lastChild; child; child = child.previousSibling) stack.push(child);
25
19
  }
26
20
  return snapshots;
27
21
  }
28
22
  function getFormControlSnapshot(element) {
29
23
  const control = element;
30
- const snapshot = { element };
24
+ const snapshot = {};
31
25
  if ("value" in control) snapshot.value = String(control.value ?? "");
32
26
  if ("checked" in control) snapshot.checked = Boolean(control.checked);
33
27
  return snapshot.value !== void 0 || snapshot.checked !== void 0 ? snapshot : null;
@@ -46,72 +40,38 @@ function cloneReactivePropEntry(entry) {
46
40
  return {
47
41
  cleanup: entry.cleanup,
48
42
  fnRef: entry.fnRef,
43
+ groupedScalar: entry.groupedScalar,
49
44
  restoreFn: entry.restoreFn,
50
45
  updateFn: entry.updateFn
51
46
  };
52
47
  }
53
- function snapshotRetainedElement(element) {
54
- const elements = collectElementSubtree(element);
55
- const attributes = [];
56
- const childNodes = [];
57
- const delegatedListeners = [];
58
- const formControls = [];
59
- const listeners = [];
60
- const reactiveProps = [];
61
- const refs = [];
62
- for (const currentElement of elements) {
63
- attributes.push({
64
- element: currentElement,
65
- attributes: Array.from(currentElement.attributes, (attribute) => [attribute.name, attribute.value])
66
- });
67
- childNodes.push({
68
- element: currentElement,
69
- childNodes: Array.from(currentElement.childNodes)
70
- });
71
- const formControl = getFormControlSnapshot(currentElement);
72
- if (formControl) formControls.push(formControl);
73
- const listenerMap = elementListeners.get(currentElement);
74
- listeners.push({
75
- element: currentElement,
76
- entries: listenerMap ? Array.from(listenerMap, ([listenerKey, entry]) => ({
77
- listenerKey,
78
- entry: cloneListenerEntry(entry)
79
- })) : []
80
- });
81
- const delegatedHandlerMap = getDelegatedHandlersForElement(currentElement);
82
- delegatedListeners.push({
83
- element: currentElement,
84
- entries: delegatedHandlerMap ? Array.from(delegatedHandlerMap, ([eventName, entry]) => ({
85
- eventName,
86
- handler: entry.handler,
87
- original: entry.original,
88
- options: entry.options
89
- })) : []
90
- });
91
- const reactivePropMap = elementReactivePropsCleanup.get(currentElement);
92
- reactiveProps.push({
93
- element: currentElement,
94
- entries: reactivePropMap ? Array.from(reactivePropMap, ([propName, entry]) => ({
95
- propName,
96
- entry: cloneReactivePropEntry(entry)
97
- })) : []
98
- });
99
- refs.push({
100
- element: currentElement,
101
- ref: elementRefs.get(currentElement)
102
- });
103
- }
48
+ function snapshotRetainedElement(element, bindingsOnly = false) {
49
+ const listenerMap = elementListeners.get(element);
50
+ const delegatedHandlerMap = getDelegatedHandlersForElement(element);
51
+ const reactivePropMap = getElementReactivePropsCleanupMap(element);
104
52
  const keyedMap = keyedElements.get(element);
105
53
  return {
106
- attributes,
107
- childNodes,
108
- delegatedListeners,
109
- formControls,
54
+ attributes: bindingsOnly ? [] : Array.from(element.attributes, (attribute) => [attribute.name, attribute.value]),
55
+ childNodes: bindingsOnly ? [] : Array.from(element.childNodes),
56
+ delegatedListeners: delegatedHandlerMap ? Array.from(delegatedHandlerMap, ([eventName, entry]) => ({
57
+ eventName,
58
+ handler: entry.handler,
59
+ original: entry.original,
60
+ options: entry.options
61
+ })) : [],
62
+ domCaptured: !bindingsOnly,
63
+ formControl: bindingsOnly ? null : getFormControlSnapshot(element),
110
64
  keyedMap: keyedMap ? new Map(keyedMap) : void 0,
111
- listeners,
112
- reactiveProps,
113
- refs,
114
- textNodes: collectTextSnapshots(element)
65
+ listeners: listenerMap ? Array.from(listenerMap, ([listenerKey, entry]) => ({
66
+ listenerKey,
67
+ entry: cloneListenerEntry(entry)
68
+ })) : [],
69
+ reactiveProps: reactivePropMap ? Array.from(reactivePropMap, ([propName, entry]) => ({
70
+ propName,
71
+ entry: cloneReactivePropEntry(entry)
72
+ })) : [],
73
+ ref: elementRefs.get(element),
74
+ textNodes: bindingsOnly ? [] : collectTextSnapshots(element)
115
75
  };
116
76
  }
117
77
  function sameChildOrder(element, childNodes) {
@@ -119,19 +79,17 @@ function sameChildOrder(element, childNodes) {
119
79
  for (let index = 0; index < childNodes.length; index += 1) if (element.childNodes[index] !== childNodes[index]) return false;
120
80
  return true;
121
81
  }
122
- function restoreAttributes(snapshot) {
123
- for (const { element, attributes } of snapshot.attributes) {
124
- const expectedNames = new Set(attributes.map(([name]) => name));
125
- for (const attribute of Array.from(element.attributes)) if (!expectedNames.has(attribute.name)) element.removeAttribute(attribute.name);
126
- for (const [name, value] of attributes) if (element.getAttribute(name) !== value) element.setAttribute(name, value);
127
- }
82
+ function restoreAttributes(element, snapshot) {
83
+ const expectedNames = new Set(snapshot.attributes.map(([name]) => name));
84
+ for (const attribute of Array.from(element.attributes)) if (!expectedNames.has(attribute.name)) element.removeAttribute(attribute.name);
85
+ for (const [name, value] of snapshot.attributes) if (element.getAttribute(name) !== value) element.setAttribute(name, value);
128
86
  }
129
- function restoreFormControls(snapshot) {
130
- for (const { element, value, checked } of snapshot.formControls) {
131
- const control = element;
132
- if (value !== void 0 && "value" in control) control.value = value;
133
- if (checked !== void 0 && "checked" in control) control.checked = checked;
134
- }
87
+ function restoreFormControl(element, snapshot) {
88
+ if (!snapshot.formControl) return;
89
+ const { value, checked } = snapshot.formControl;
90
+ const control = element;
91
+ if (value !== void 0 && "value" in control) control.value = value;
92
+ if (checked !== void 0 && "checked" in control) control.checked = checked;
135
93
  }
136
94
  function applyRefValue(ref, value) {
137
95
  if (!ref) return;
@@ -143,15 +101,13 @@ function applyRefValue(ref, value) {
143
101
  if (Object.isExtensible(ref)) ref.current = value;
144
102
  } catch {}
145
103
  }
146
- function restoreRefs(snapshot) {
147
- for (const { element, ref } of snapshot.refs) {
148
- const currentRef = elementRefs.get(element);
149
- if (currentRef !== ref) applyRefValue(currentRef, null);
150
- if (ref) {
151
- applyRefValue(ref, element);
152
- elementRefs.set(element, ref);
153
- } else elementRefs.delete(element);
154
- }
104
+ function restoreRef(element, snapshot) {
105
+ const currentRef = elementRefs.get(element);
106
+ if (currentRef !== snapshot.ref) applyRefValue(currentRef, null);
107
+ if (snapshot.ref) {
108
+ applyRefValue(snapshot.ref, element);
109
+ elementRefs.set(element, snapshot.ref);
110
+ } else elementRefs.delete(element);
155
111
  }
156
112
  function removeDirectListener(element, entry) {
157
113
  if (entry.isDelegated) return;
@@ -163,63 +119,86 @@ function addDirectListener(element, entry) {
163
119
  if (entry.options !== void 0) element.addEventListener(entry.eventName, entry.handler, entry.options);
164
120
  else element.addEventListener(entry.eventName, entry.handler);
165
121
  }
166
- function restoreListeners(snapshot) {
167
- for (const { element, entries } of snapshot.listeners) {
168
- const expectedKeys = new Set(entries.map(({ listenerKey }) => listenerKey));
169
- let currentMap = elementListeners.get(element);
170
- if (currentMap) {
171
- for (const [listenerKey, entry] of Array.from(currentMap)) if (!expectedKeys.has(listenerKey)) {
122
+ function restoreListeners(element, snapshot) {
123
+ const errors = [];
124
+ const expectedKeys = new Set(snapshot.listeners.map(({ listenerKey }) => listenerKey));
125
+ let currentMap = elementListeners.get(element);
126
+ if (currentMap) {
127
+ for (const [listenerKey, entry] of Array.from(currentMap)) if (!expectedKeys.has(listenerKey)) {
128
+ try {
172
129
  removeDirectListener(element, entry);
173
- currentMap.delete(listenerKey);
130
+ } catch (error) {
131
+ errors.push(error);
174
132
  }
133
+ currentMap.delete(listenerKey);
175
134
  }
176
- if (entries.length === 0) {
177
- if (currentMap?.size === 0) elementListeners.delete(element);
178
- continue;
179
- }
135
+ }
136
+ if (snapshot.listeners.length === 0) {
137
+ if (currentMap?.size === 0) elementListeners.delete(element);
138
+ } else {
180
139
  if (!currentMap) {
181
140
  currentMap = /* @__PURE__ */ new Map();
182
141
  elementListeners.set(element, currentMap);
183
142
  }
184
- for (const { listenerKey, entry } of entries) {
143
+ for (const { listenerKey, entry } of snapshot.listeners) {
185
144
  const currentEntry = currentMap.get(listenerKey);
186
145
  entry.updateHandler?.(entry.original);
187
- if (currentEntry && currentEntry.handler !== entry.handler) removeDirectListener(element, currentEntry);
188
- if (!currentEntry || currentEntry.handler !== entry.handler) addDirectListener(element, entry);
146
+ if (currentEntry && currentEntry.handler !== entry.handler) try {
147
+ removeDirectListener(element, currentEntry);
148
+ } catch (error) {
149
+ errors.push(error);
150
+ }
151
+ if (!currentEntry || currentEntry.handler !== entry.handler) try {
152
+ addDirectListener(element, entry);
153
+ } catch (error) {
154
+ errors.push(error);
155
+ }
189
156
  else currentEntry.updateHandler?.(entry.original);
190
157
  currentMap.set(listenerKey, cloneListenerEntry(entry));
191
158
  }
192
159
  }
160
+ if (errors.length > 0) throw new AggregateError(errors, "Listener rollback failed");
193
161
  }
194
- function restoreDelegatedListeners(snapshot) {
195
- for (const { element, entries } of snapshot.delegatedListeners) {
196
- const expectedEventNames = new Set(entries.map(({ eventName }) => eventName));
197
- const currentMap = getDelegatedHandlersForElement(element);
198
- if (currentMap) {
199
- for (const eventName of currentMap.keys()) if (!expectedEventNames.has(eventName)) removeDelegatedListener(element, eventName);
162
+ function restoreDelegatedListeners(element, snapshot) {
163
+ const errors = [];
164
+ const expectedEventNames = new Set(snapshot.delegatedListeners.map(({ eventName }) => eventName));
165
+ const currentMap = getDelegatedHandlersForElement(element);
166
+ if (currentMap) {
167
+ for (const eventName of currentMap.keys()) if (!expectedEventNames.has(eventName)) try {
168
+ removeDelegatedListener(element, eventName);
169
+ } catch (error) {
170
+ errors.push(error);
200
171
  }
201
- for (const { eventName, handler, original, options } of entries) if (!updateDelegatedListener(element, eventName, handler, original, options)) addDelegatedListener(element, eventName, handler, original, options);
202
172
  }
173
+ for (const { eventName, handler, original, options } of snapshot.delegatedListeners) try {
174
+ if (!updateDelegatedListener(element, eventName, handler, original, options)) addDelegatedListener(element, eventName, handler, original, options);
175
+ } catch (error) {
176
+ errors.push(error);
177
+ }
178
+ if (errors.length > 0) throw new AggregateError(errors, "Delegated listener rollback failed");
203
179
  }
204
- function restoreReactiveProps(snapshot) {
205
- for (const { element, entries } of snapshot.reactiveProps) {
206
- const expectedPropNames = new Set(entries.map(({ propName }) => propName));
207
- let currentMap = elementReactivePropsCleanup.get(element);
208
- if (currentMap) {
209
- for (const [propName, entry] of Array.from(currentMap)) if (!expectedPropNames.has(propName)) {
180
+ function restoreReactiveProps(element, snapshot) {
181
+ const errors = [];
182
+ const expectedPropNames = new Set(snapshot.reactiveProps.map(({ propName }) => propName));
183
+ let currentMap = getElementReactivePropsCleanupMap(element);
184
+ if (currentMap) {
185
+ for (const [propName, entry] of Array.from(currentMap)) if (!expectedPropNames.has(propName)) {
186
+ try {
210
187
  entry.cleanup();
211
- currentMap.delete(propName);
188
+ } catch (error) {
189
+ errors.push(error);
212
190
  }
191
+ currentMap.delete(propName);
213
192
  }
214
- if (entries.length === 0) {
215
- if (currentMap?.size === 0) elementReactivePropsCleanup.delete(element);
216
- continue;
217
- }
193
+ }
194
+ if (snapshot.reactiveProps.length === 0) {
195
+ if (currentMap?.size === 0) elementReactivePropsCleanup.delete(element);
196
+ } else {
218
197
  if (!currentMap) {
219
198
  currentMap = /* @__PURE__ */ new Map();
220
199
  elementReactivePropsCleanup.set(element, currentMap);
221
200
  }
222
- for (const { propName, entry } of entries) {
201
+ for (const { propName, entry } of snapshot.reactiveProps) {
223
202
  const currentEntry = currentMap.get(propName);
224
203
  if (currentEntry) {
225
204
  currentEntry.updateFn?.(entry.fnRef);
@@ -227,16 +206,28 @@ function restoreReactiveProps(snapshot) {
227
206
  currentMap.set(propName, currentEntry);
228
207
  continue;
229
208
  }
230
- currentMap.set(propName, entry.restoreFn?.(entry.fnRef) ?? cloneReactivePropEntry(entry));
209
+ currentMap.set(propName, (() => {
210
+ try {
211
+ return entry.restoreFn?.(entry.fnRef) ?? cloneReactivePropEntry(entry);
212
+ } catch (error) {
213
+ errors.push(error);
214
+ return cloneReactivePropEntry(entry);
215
+ }
216
+ })());
231
217
  }
232
218
  }
219
+ if (errors.length > 0) throw new AggregateError(errors, "Reactive property rollback failed");
233
220
  }
234
- function restoreChildNodes(snapshot, cleanupRangeNode) {
235
- for (const { element, childNodes } of snapshot.childNodes) {
236
- const expectedChildren = new Set(childNodes);
237
- for (const child of Array.from(element.childNodes)) if (!expectedChildren.has(child)) cleanupRangeNode(child);
221
+ function restoreChildNodes(element, snapshot, cleanupRangeNode) {
222
+ const errors = [];
223
+ const expectedChildren = new Set(snapshot.childNodes);
224
+ for (const child of Array.from(element.childNodes)) if (!expectedChildren.has(child)) try {
225
+ cleanupRangeNode(child);
226
+ } catch (error) {
227
+ errors.push(error);
238
228
  }
239
- for (const { element, childNodes } of snapshot.childNodes) if (!sameChildOrder(element, childNodes)) element.replaceChildren(...childNodes);
229
+ if (!sameChildOrder(element, snapshot.childNodes)) element.replaceChildren(...snapshot.childNodes);
230
+ if (errors.length > 0) throw new AggregateError(errors, "DOM range rollback cleanup failed");
240
231
  }
241
232
  function restoreTextNodes(snapshot) {
242
233
  for (const { node, data } of snapshot.textNodes) if (node.data !== data) node.data = data;
@@ -246,31 +237,52 @@ function restoreKeyedMap(element, snapshot) {
246
237
  else keyedElements.delete(element);
247
238
  }
248
239
  function restoreRetainedElement(element, snapshot, cleanupRangeNode) {
249
- restoreChildNodes(snapshot, cleanupRangeNode);
250
- restoreReactiveProps(snapshot);
251
- restoreAttributes(snapshot);
252
- restoreTextNodes(snapshot);
253
- restoreFormControls(snapshot);
254
- restoreRefs(snapshot);
255
- restoreListeners(snapshot);
256
- restoreDelegatedListeners(snapshot);
257
- restoreKeyedMap(element, snapshot);
240
+ const errors = [];
241
+ const phases = [
242
+ ...snapshot.domCaptured ? [
243
+ () => restoreChildNodes(element, snapshot, cleanupRangeNode),
244
+ () => restoreTextNodes(snapshot),
245
+ () => restoreFormControl(element, snapshot),
246
+ () => restoreAttributes(element, snapshot)
247
+ ] : [],
248
+ () => restoreReactiveProps(element, snapshot),
249
+ () => restoreRef(element, snapshot),
250
+ () => restoreListeners(element, snapshot),
251
+ () => restoreDelegatedListeners(element, snapshot),
252
+ ...snapshot.domCaptured ? [() => restoreKeyedMap(element, snapshot)] : []
253
+ ];
254
+ for (const phase of phases) try {
255
+ phase();
256
+ } catch (error) {
257
+ errors.push(error);
258
+ }
259
+ if (errors.length > 0) throw new AggregateError(errors, "Retained element rollback failed");
258
260
  }
259
- function runRetainedElementUpdate(element, cleanupRangeNode, update, onError) {
260
- const snapshot = snapshotRetainedElement(element);
261
+ function runRetainedElementUpdate(element, cleanupRangeNode, update, onError, bindingsOnly = false) {
262
+ const batch = getCurrentLifecycleCommitBatch();
263
+ const existingSnapshot = batch?.retainedElementSnapshots.get(element);
264
+ const snapshot = existingSnapshot ?? snapshotRetainedElement(element, bindingsOnly);
265
+ let restored = false;
266
+ if (batch && !existingSnapshot) {
267
+ batch.retainedElementSnapshots.set(element, snapshot);
268
+ registerLifecycleTransaction(element, () => void 0, () => {
269
+ if (restored) return;
270
+ restored = true;
271
+ restoreRetainedElement(element, snapshot, cleanupRangeNode);
272
+ });
273
+ }
261
274
  try {
262
275
  update();
263
276
  } catch (err) {
264
277
  onError?.();
265
278
  try {
279
+ restored = true;
266
280
  restoreRetainedElement(element, snapshot, cleanupRangeNode);
267
281
  } catch (rollbackError) {
268
- logger.warn("[Askr] retained element rollback failed:", rollbackError);
282
+ logger.warn("[Askr] retained element rollback failed:", new AggregateError([err, rollbackError], "Render failed and retained rollback reported errors"));
269
283
  }
270
284
  throw err;
271
285
  }
272
286
  }
273
287
  //#endregion
274
288
  export { restoreRetainedElement, runRetainedElementUpdate, snapshotRetainedElement };
275
-
276
- //# sourceMappingURL=retained-element-rollback.js.map
@@ -5,13 +5,13 @@ import { incDevCounter } from "../runtime/dev-namespace.js";
5
5
  import { getCurrentInstance } from "../runtime/component-scope.js";
6
6
  import { isPromiseLike } from "../common/promise.js";
7
7
  import { captureInlineRenderSnapshot, renderComponentInline, warnUnusedStateReads } from "../runtime/component-internal.js";
8
- import "../runtime/component-contracts.js";
9
- import { tagNamesEqualIgnoreCase } from "./utils.js";
10
8
  import { recordBenchEvent } from "../runtime/for-bench.js";
11
- import "../runtime/for.js";
9
+ import "../runtime/index.js";
10
+ import { tagNamesEqualIgnoreCase } from "./utils.js";
12
11
  import { getRendererDOMHost } from "./dom-host.js";
13
12
  import { findHostInstanceByType, inheritComponentCleanupStrict, inheritComponentKey, isRouteRootComponentVNode } from "./component-host-instances.js";
14
- import { resolveNestedComponentResult } from "./component-host.js";
13
+ import { resolveNestedComponentResult } from "./component-host-results.js";
14
+ import "./component-host.js";
15
15
  //#region src/renderer/stable-patch.ts
16
16
  function normalizeStableIntrinsicChildren(children) {
17
17
  if (children === null || children === void 0 || children === false) return [];
@@ -50,7 +50,7 @@ function resolveStableIntrinsicPatchVNode(dom, vnode) {
50
50
  if (typeof vnode.type === "string") return tagNamesEqualIgnoreCase(dom.tagName, vnode.type) ? vnode : null;
51
51
  if (typeof vnode.type !== "function") return null;
52
52
  const host = dom;
53
- const existingInstance = findHostInstanceByType(host, vnode.type);
53
+ const existingInstance = findHostInstanceByType(host, vnode.type, vnode, getCurrentInstance());
54
54
  if (!existingInstance || existingInstance.fn !== vnode.type || host.__ASKR_WRAPPER_HOST) return null;
55
55
  const snapshot = getVNodeContextFrame(vnode) || getCurrentContextFrame() || existingInstance.ownerFrame || null;
56
56
  captureInlineRenderSnapshot(existingInstance);
@@ -78,5 +78,3 @@ function tryPatchStableForDirtyItem(scope) {
78
78
  }
79
79
  //#endregion
80
80
  export { tryPatchStableForDirtyItem };
81
-
82
- //# sourceMappingURL=stable-patch.js.map
@@ -92,5 +92,3 @@ function canReuseStaticSubtree(el, vnode) {
92
92
  }
93
93
  //#endregion
94
94
  export { canReuseStaticSubtree, setStaticChildSlotsCacheEnabled, tagsEqualIgnoreCase };
95
-
96
- //# sourceMappingURL=static-reuse.js.map
@@ -1,7 +1,8 @@
1
1
  import { getRuntimeEnv } from "../common/env.js";
2
- import { logger } from "../dev/logger.js";
2
+ import { logger } from "../common/logger.js";
3
3
  import { runRuntimeHandlerScope } from "../runtime/access.js";
4
4
  import { incDevCounter, setDevValue } from "../runtime/dev-namespace.js";
5
+ import "../runtime/index.js";
5
6
  import { getPublicAttributeName } from "../common/attr-names.js";
6
7
  import "./env.js";
7
8
  //#region src/renderer/utils.ts
@@ -14,6 +15,14 @@ const DIRECT_REPLACE_CHILDREN_SPREAD_LIMIT = 4096;
14
15
  function canUseDirectReplaceChildrenSpread(count) {
15
16
  return count <= DIRECT_REPLACE_CHILDREN_SPREAD_LIMIT;
16
17
  }
18
+ const CLICK_EVENT_PROP = {
19
+ eventName: "click",
20
+ capture: false
21
+ };
22
+ const CLICK_CAPTURE_EVENT_PROP = {
23
+ eventName: "click",
24
+ capture: true
25
+ };
17
26
  const handlerCache = /* @__PURE__ */ new WeakMap();
18
27
  let cacheSize = 0;
19
28
  const MAX_CACHE_SIZE = 1e3;
@@ -24,6 +33,8 @@ function parseEventName(propName) {
24
33
  return parseEventProp(propName)?.eventName ?? null;
25
34
  }
26
35
  function parseEventProp(propName) {
36
+ if (propName === "onClick") return CLICK_EVENT_PROP;
37
+ if (propName === "onClickCapture") return CLICK_CAPTURE_EVENT_PROP;
27
38
  if (!propName.startsWith("on") || propName.length <= 2) return null;
28
39
  const capture = propName.endsWith("Capture") && propName.length > 9;
29
40
  const normalizedPropName = capture ? propName.slice(0, -7) : propName;
@@ -206,15 +217,16 @@ function extractKey(vnode) {
206
217
  function buildKeyMapFromChildren(parent) {
207
218
  const map = /* @__PURE__ */ new Map();
208
219
  for (let ch = parent.firstElementChild; ch; ch = ch.nextElementSibling) {
209
- const k = ch.getAttribute("data-key");
210
- if (k !== null) {
211
- map.set(k, ch);
212
- const n = Number(k);
213
- if (!Number.isNaN(n)) map.set(n, ch);
214
- }
220
+ const key = getMaterializedKey(ch);
221
+ if (key !== void 0) map.set(key, ch);
215
222
  }
216
223
  return map;
217
224
  }
225
+ function getMaterializedKey(element) {
226
+ const value = element.getAttribute("data-key");
227
+ if (value === null) return void 0;
228
+ return element.getAttribute("data-askr-key-kind") === "number" ? Number(value) : value;
229
+ }
218
230
  /**
219
231
  * Record DOM replace operation for diagnostics
220
232
  */
@@ -250,6 +262,4 @@ function now() {
250
262
  return typeof performance !== "undefined" && performance.now ? performance.now() : Date.now();
251
263
  }
252
264
  //#endregion
253
- export { DIRECT_REPLACE_CHILDREN_SPREAD_LIMIT, buildKeyMapFromChildren, canUseDirectReplaceChildrenSpread, checkPropChanges, createMutableWrappedHandler, createWrappedHandler, extractKey, getEventListenerKey, getEventListenerOptions, getPassiveOptions, getRenderedAttributeName, hasNonTrivialProps, hasPropChanged, isIgnoredForPropChanges, isSVGDomElement, isSkippedProp, logFastPathDebug, now, parseEventName, parseEventProp, readElementClassName, recordDOMReplace, recordFastPathStats, removeRenderedAttribute, setRenderedAttribute, tagNamesEqualIgnoreCase, writeElementClassName };
254
-
255
- //# sourceMappingURL=utils.js.map
265
+ export { DIRECT_REPLACE_CHILDREN_SPREAD_LIMIT, buildKeyMapFromChildren, canUseDirectReplaceChildrenSpread, checkPropChanges, createMutableWrappedHandler, createWrappedHandler, extractKey, getEventListenerKey, getEventListenerOptions, getMaterializedKey, getPassiveOptions, getRenderedAttributeName, hasNonTrivialProps, hasPropChanged, isIgnoredForPropChanges, isSVGDomElement, isSkippedProp, logFastPathDebug, now, parseEventName, parseEventProp, readElementClassName, recordDOMReplace, recordFastPathStats, removeRenderedAttribute, setRenderedAttribute, tagNamesEqualIgnoreCase, writeElementClassName };
@@ -1,6 +1,5 @@
1
1
  import { getSignal } from "../runtime/component-scope.js";
2
- import "../runtime/component.js";
3
2
  import { resource } from "../runtime/resource-operation.js";
4
3
  import { capture, documentVisible, on, routeActive, stream, task, timer, windowFocused } from "../runtime/lifecycle-operations.js";
5
- import "../runtime/operations.js";
4
+ import "../runtime/index.js";
6
5
  export { capture, documentVisible, getSignal, on, resource, routeActive, stream, task, timer, windowFocused };
@@ -32,5 +32,3 @@ function compileNodePolicies(node) {
32
32
  }
33
33
  //#endregion
34
34
  export { compileNodePolicies, nextAccessScopeState, validateAccessMetadata };
35
-
36
- //# sourceMappingURL=access.js.map
@@ -6,5 +6,4 @@ declare function isRoutePathActive(pathOrPaths: string | readonly string[]): boo
6
6
  declare function currentRoute<TParams extends RouteParams = RouteParams>(): RouteSnapshot<TParams>;
7
7
  declare function syncCurrentRouteSnapshot(pathname: string, search: string, hash: string, activityMatches?: readonly RouteMatch[]): void;
8
8
  //#endregion
9
- export { currentRoute };
10
- //# sourceMappingURL=activity.d.ts.map
9
+ export { currentRoute };
@@ -1,11 +1,12 @@
1
1
  import { markReactivePropsDirtySource, markReadableDerivedSubscribersDirty, notifyReadableReaders, recordReadableRead } from "../runtime/readable.js";
2
2
  import { getCurrentComponentInstance } from "../runtime/component-scope.js";
3
- import "../runtime/component.js";
4
3
  import { getActiveRenderContext } from "../common/render-context.js";
5
- import { getActiveRoutes } from "./store.js";
6
4
  import { syncRouteActivitySnapshot } from "../common/route-activity.js";
5
+ import "../runtime/index.js";
6
+ import { getActiveRoutes } from "./store.js";
7
7
  import { deepFreeze, makeQuery, parseLocation } from "./route-context.js";
8
- import { computeMatchesFromRoutes } from "./resolution.js";
8
+ import { computeMatchesFromRoutes } from "./route-matching.js";
9
+ import "./resolution.js";
9
10
  //#region src/router/activity.ts
10
11
  let currentRouteSnapshot = buildRouteSnapshot("/", "", "");
11
12
  const currentRouteSource = (() => currentRouteSnapshot);
@@ -39,28 +40,25 @@ function setCurrentRouteSnapshot(pathname, search, hash, activityMatches) {
39
40
  markReactivePropsDirtySource(currentRouteSource);
40
41
  notifyReadableReaders(currentRouteSource, instance);
41
42
  }
43
+ function readCurrentRouteLocation() {
44
+ const renderContext = getActiveRenderContext();
45
+ if (renderContext?.url) return parseLocation(renderContext.url);
46
+ if (typeof window !== "undefined" && window.location) return {
47
+ pathname: window.location.pathname || "/",
48
+ search: window.location.search || "",
49
+ hash: window.location.hash || ""
50
+ };
51
+ if (serverLocation) return parseLocation(serverLocation);
52
+ return {
53
+ pathname: currentRouteSnapshot.path,
54
+ search: "",
55
+ hash: currentRouteSnapshot.hash ?? ""
56
+ };
57
+ }
42
58
  function readCurrentRouteSnapshot() {
43
59
  const instance = getCurrentComponentInstance();
44
60
  if (!instance) throw new Error("currentRoute() can only be called during component render execution. Call currentRoute() from inside your component function.");
45
- let pathname = "/";
46
- let search = "";
47
- let hash = "";
48
- const renderContext = getActiveRenderContext();
49
- if (instance.ssr && renderContext?.url) {
50
- const parsed = parseLocation(renderContext.url);
51
- pathname = parsed.pathname;
52
- search = parsed.search;
53
- hash = parsed.hash;
54
- } else if (typeof window !== "undefined" && window.location) {
55
- pathname = window.location.pathname || "/";
56
- search = window.location.search || "";
57
- hash = window.location.hash || "";
58
- } else if (serverLocation) {
59
- const parsed = parseLocation(serverLocation);
60
- pathname = parsed.pathname;
61
- search = parsed.search;
62
- hash = parsed.hash;
63
- }
61
+ const { pathname, search, hash } = readCurrentRouteLocation();
64
62
  const query = makeQuery(search);
65
63
  const matches = computeMatchesFromRoutes(pathname, getActiveRoutes());
66
64
  const instanceParams = instance.props;
@@ -85,5 +83,3 @@ function syncCurrentRouteSnapshot(pathname, search, hash, activityMatches) {
85
83
  }
86
84
  //#endregion
87
85
  export { currentRoute, setServerLocation, syncCurrentRouteSnapshot };
88
-
89
- //# sourceMappingURL=activity.js.map
@@ -18,5 +18,4 @@ declare function registerRoutes(definition: RouteDefinition, options?: RegisterR
18
18
  declare function route<const TPath extends string>(path: TPath, Component: RouteComponent<RoutePathParams<TPath>>, options?: RouteOptions<RoutePathParams<TPath>>): void;
19
19
  declare function route<const TPath extends string, TComponent extends AnyRouteComponent>(path: TPath, Component: CompatibleRouteComponent<TPath, TComponent>, options?: RouteOptionsForComponent<TPath, TComponent>): void;
20
20
  //#endregion
21
- export { fallback, group, index, page, registerRoutes, route };
22
- //# sourceMappingURL=authoring.d.ts.map
21
+ export { fallback, group, index, page, registerRoutes, route };
@@ -1,6 +1,6 @@
1
1
  import { getCurrentComponentInstance } from "../runtime/component-scope.js";
2
- import "../runtime/component.js";
3
2
  import { getExecutionModel } from "../runtime/execution-model.js";
3
+ import "../runtime/index.js";
4
4
  import { computeRank, normalizeRouteSegmentName, parseSegments } from "./match.js";
5
5
  import { compileNodePolicies, nextAccessScopeState, validateAccessMetadata } from "./access.js";
6
6
  import { createRouteHandler } from "./rendering.js";
@@ -194,5 +194,3 @@ function route(path, Component, options) {
194
194
  }
195
195
  //#endregion
196
196
  export { fallback, group, index, page, registerRoutes, route };
197
-
198
- //# sourceMappingURL=authoring.js.map
@@ -5,10 +5,10 @@ import { RouteQueryParamInput, RouteQueryParamValue, RouteQueryUpdater, RouteQue
5
5
  import { navigate } from "./navigate.js";
6
6
  import { fallback, group, index, page, registerRoutes, route } from "./authoring.js";
7
7
  import { currentRoute } from "./activity.js";
8
+ import { allow, deny, forbidden, notFound, redirect, requireAuth, requirePermission, requireRole, unauthorized } from "./policy.js";
8
9
  import { clearRoutes, createRouteRegistry, getManifest } from "./manifest.js";
9
10
  import { getRoutes } from "./store.js";
10
11
  import { lazy } from "./lazy.js";
11
12
  import { Outlet } from "./rendering.js";
12
- import { allow, deny, forbidden, notFound, redirect, requireAuth, requirePermission, requireRole, unauthorized } from "./policy.js";
13
13
  import { Link, LinkProps } from "../components/link.js";
14
14
  export { type AccessDecision, type AccessDenyDecision, type AccessRedirectDecision, type GroupHelperOptions, type HistoryScrollBehavior, type LayoutScopeRecord, Link, type LinkProps, type NavigateOptions, type NavigationScrollBehavior, Outlet, type PageHelperOptions, type PageScopeRecord, type ParsedSegment, type RegisterRoutesOptions, type Route, type RouteAuthMode, type RouteAuthOptions, type RouteAuthResolver, type RouteAuthState, type RouteComponent, type RouteContext, type RouteDefinition, type RouteHandler, type RouteManifest, type RouteMatch, type RouteMode, type RouteOptions, type RouteParams, type RoutePathParams, type RoutePolicy, type RouteQuery, type RouteQueryParamInput, type RouteQueryParamValue, type RouteQueryUpdater, type RouteQueryUpdates, type RouteRecord, type RouteRegistry, type RouteRenderResult, type RouteRequestOptions, type RouteRequestResult, type RouteSnapshot, type ScrollRestorationOptions, type UpdateRouteQueryOptions, allow, clearRoutes, createRouteRegistry, currentRoute, deny, fallback, forbidden, getManifest, getRoutes, group, index, lazy, navigate, notFound, page, redirect, registerRoutes, requireAuth, requirePermission, requireRole, route, unauthorized, updateRouteQuery };