@askrjs/askr 0.0.51 → 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 (593) 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 +2 -4
  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 +20 -11
  11. package/dist/boot/root-lifecycle.d.ts +6 -3
  12. package/dist/boot/root-lifecycle.js +14 -10
  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 +1 -2
  22. package/dist/common/invariant.js +0 -2
  23. package/dist/common/jsx.d.ts +1 -2
  24. package/dist/common/jsx.js +0 -2
  25. package/dist/common/logger.js +0 -2
  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 +1 -2
  39. package/dist/components/error-boundary.js +0 -2
  40. package/dist/components/link.d.ts +2 -2
  41. package/dist/components/link.js +0 -2
  42. package/dist/control/case.d.ts +1 -2
  43. package/dist/control/case.js +0 -2
  44. package/dist/control/for.d.ts +1 -2
  45. package/dist/control/for.js +0 -2
  46. package/dist/control/shared.d.ts +1 -2
  47. package/dist/control/shared.js +0 -2
  48. package/dist/control/show.d.ts +1 -2
  49. package/dist/control/show.js +0 -2
  50. package/dist/data/data-runtime.d.ts +1 -2
  51. package/dist/data/data-runtime.js +3 -5
  52. package/dist/data/invalidation-listeners.js +0 -2
  53. package/dist/data/invalidation.d.ts +1 -2
  54. package/dist/data/invalidation.js +0 -2
  55. package/dist/data/mutation-cell.d.ts +1 -2
  56. package/dist/data/mutation-cell.js +6 -5
  57. package/dist/data/query-cell.d.ts +3 -2
  58. package/dist/data/query-cell.js +43 -9
  59. package/dist/data/query-key.js +0 -2
  60. package/dist/data/shared.js +2 -3
  61. package/dist/data/types.d.ts +1 -2
  62. package/dist/foundations/icon/icon.d.ts +1 -2
  63. package/dist/foundations/icon/icon.js +0 -2
  64. package/dist/foundations/icon/icon.types.d.ts +1 -2
  65. package/dist/foundations/interactions/dismissable.d.ts +1 -2
  66. package/dist/foundations/interactions/dismissable.js +0 -2
  67. package/dist/foundations/interactions/focusable.d.ts +1 -2
  68. package/dist/foundations/interactions/focusable.js +0 -2
  69. package/dist/foundations/interactions/hoverable.d.ts +1 -2
  70. package/dist/foundations/interactions/hoverable.js +0 -2
  71. package/dist/foundations/interactions/interaction-policy.d.ts +1 -2
  72. package/dist/foundations/interactions/interaction-policy.js +0 -2
  73. package/dist/foundations/interactions/pressable.d.ts +1 -2
  74. package/dist/foundations/interactions/pressable.js +0 -2
  75. package/dist/foundations/interactions/roving-focus.d.ts +1 -2
  76. package/dist/foundations/interactions/roving-focus.js +0 -2
  77. package/dist/foundations/state/controllable.d.ts +1 -2
  78. package/dist/foundations/state/controllable.js +0 -2
  79. package/dist/foundations/structures/collection.d.ts +1 -2
  80. package/dist/foundations/structures/collection.js +0 -2
  81. package/dist/foundations/structures/layer.d.ts +1 -2
  82. package/dist/foundations/structures/layer.js +0 -2
  83. package/dist/foundations/structures/layout.d.ts +1 -2
  84. package/dist/foundations/structures/layout.js +0 -2
  85. package/dist/foundations/structures/presence.d.ts +1 -2
  86. package/dist/foundations/structures/presence.js +0 -2
  87. package/dist/foundations/structures/slot.d.ts +1 -2
  88. package/dist/foundations/structures/slot.js +0 -2
  89. package/dist/foundations/utilities/aria.d.ts +1 -2
  90. package/dist/foundations/utilities/aria.js +0 -2
  91. package/dist/foundations/utilities/compose-handlers.d.ts +1 -2
  92. package/dist/foundations/utilities/compose-handlers.js +0 -2
  93. package/dist/foundations/utilities/compose-ref.d.ts +1 -2
  94. package/dist/foundations/utilities/compose-ref.js +0 -2
  95. package/dist/foundations/utilities/event-types.d.ts +1 -2
  96. package/dist/foundations/utilities/merge-props.d.ts +1 -2
  97. package/dist/foundations/utilities/merge-props.js +0 -2
  98. package/dist/foundations/utilities/use-id.d.ts +1 -2
  99. package/dist/foundations/utilities/use-id.js +0 -2
  100. package/dist/fx/fx.d.ts +1 -2
  101. package/dist/fx/fx.js +0 -2
  102. package/dist/fx/noop.js +0 -2
  103. package/dist/fx/timing.d.ts +1 -2
  104. package/dist/fx/timing.js +0 -2
  105. package/dist/index.d.ts +1 -1
  106. package/dist/index.js +0 -2
  107. package/dist/jsx/types.d.ts +1 -2
  108. package/dist/jsx/utils.d.ts +1 -2
  109. package/dist/jsx/utils.js +0 -2
  110. package/dist/jsx-dev-runtime.d.ts +16 -2
  111. package/dist/jsx-dev-runtime.js +3 -12
  112. package/dist/jsx-runtime.d.ts +16 -2
  113. package/dist/jsx-runtime.js +15 -24
  114. package/dist/jsx-runtime2.d.ts +1 -1
  115. package/dist/renderer/attributes.js +28 -6
  116. package/dist/renderer/boundaries.js +48 -172
  117. package/dist/renderer/boundary-materialization.js +72 -0
  118. package/dist/renderer/boundary-range-adoption.js +76 -0
  119. package/dist/renderer/boundary-range-sync.js +101 -0
  120. package/dist/renderer/boundary-state.js +50 -0
  121. package/dist/renderer/child-shape.js +0 -2
  122. package/dist/renderer/children-fastpath.js +3 -3
  123. package/dist/renderer/children.js +0 -2
  124. package/dist/renderer/cleanup.js +70 -13
  125. package/dist/renderer/component-host-cleanup.js +123 -48
  126. package/dist/renderer/component-host-instances.js +59 -8
  127. package/dist/renderer/component-host-replacement.js +105 -0
  128. package/dist/renderer/component-host-results.js +138 -0
  129. package/dist/renderer/component-host.js +94 -169
  130. package/dist/renderer/dom-host.js +0 -2
  131. package/dist/renderer/dom-internal.js +110 -53
  132. package/dist/renderer/dom-range.js +161 -0
  133. package/dist/renderer/dom.js +5 -4
  134. package/dist/renderer/element-children.js +112 -32
  135. package/dist/renderer/error-boundary-dom.js +19 -11
  136. package/dist/renderer/evaluate-dom-range.js +3 -4
  137. package/dist/renderer/evaluate-reconcile.js +12 -37
  138. package/dist/renderer/evaluate.js +14 -3
  139. package/dist/renderer/fastpath.js +4 -12
  140. package/dist/renderer/for-commit-dom-map.js +6 -18
  141. package/dist/renderer/for-commit-removal.js +7 -16
  142. package/dist/renderer/for-commit-reorder.js +0 -2
  143. package/dist/renderer/for-commit.js +172 -44
  144. package/dist/renderer/hydration-boundaries.js +60 -0
  145. package/dist/renderer/hydration-listener-transaction.js +49 -0
  146. package/dist/renderer/index.js +8 -7
  147. package/dist/renderer/intrinsic-blueprint-analysis.js +202 -0
  148. package/dist/renderer/intrinsic-blueprint-bindings.js +152 -0
  149. package/dist/renderer/intrinsic-blueprint-materialization.js +100 -0
  150. package/dist/renderer/intrinsic-blueprint.js +30 -0
  151. package/dist/renderer/intrinsic-hydration-adoption.js +66 -0
  152. package/dist/renderer/keyed-children.js +3 -9
  153. package/dist/renderer/keyed.js +10 -10
  154. package/dist/renderer/namespaces.js +0 -2
  155. package/dist/renderer/prop-bindings.js +56 -21
  156. package/dist/renderer/reactive-child-dom.js +10 -4
  157. package/dist/renderer/reactive-child-sources.js +0 -2
  158. package/dist/renderer/reactive-children.js +29 -20
  159. package/dist/renderer/reconcile-commit.js +0 -2
  160. package/dist/renderer/reconcile-fastpaths.js +4 -11
  161. package/dist/renderer/reconcile-resolution.js +31 -55
  162. package/dist/renderer/reconcile.js +0 -2
  163. package/dist/renderer/retained-element-rollback.js +159 -148
  164. package/dist/renderer/stable-patch.js +3 -4
  165. package/dist/renderer/static-reuse.js +0 -2
  166. package/dist/renderer/utils.js +18 -9
  167. package/dist/router/access.js +0 -2
  168. package/dist/router/activity.d.ts +1 -2
  169. package/dist/router/activity.js +0 -2
  170. package/dist/router/authoring.d.ts +1 -2
  171. package/dist/router/authoring.js +0 -2
  172. package/dist/router/internal-types.d.ts +1 -2
  173. package/dist/router/lazy.d.ts +1 -2
  174. package/dist/router/lazy.js +0 -2
  175. package/dist/router/manifest.d.ts +1 -2
  176. package/dist/router/manifest.js +0 -2
  177. package/dist/router/match.js +0 -2
  178. package/dist/router/navigate.d.ts +1 -2
  179. package/dist/router/navigate.js +4 -7
  180. package/dist/router/navigation-registry.d.ts +1 -2
  181. package/dist/router/navigation-registry.js +0 -2
  182. package/dist/router/navigation-scroll.d.ts +1 -2
  183. package/dist/router/navigation-scroll.js +0 -2
  184. package/dist/router/navigation-targets.d.ts +3 -4
  185. package/dist/router/navigation-targets.js +419 -40
  186. package/dist/router/policy.d.ts +1 -2
  187. package/dist/router/policy.js +0 -2
  188. package/dist/router/rendering.d.ts +1 -2
  189. package/dist/router/rendering.js +4 -3
  190. package/dist/router/resolution.d.ts +1 -2
  191. package/dist/router/resolution.js +0 -2
  192. package/dist/router/route-context.js +0 -2
  193. package/dist/router/route-matching.d.ts +1 -2
  194. package/dist/router/route-matching.js +0 -2
  195. package/dist/router/route-query.d.ts +1 -2
  196. package/dist/router/route-query.js +1 -3
  197. package/dist/router/store.d.ts +1 -2
  198. package/dist/router/store.js +0 -2
  199. package/dist/runtime/access.d.ts +1 -2
  200. package/dist/runtime/access.js +0 -2
  201. package/dist/runtime/child-scope.d.ts +21 -2
  202. package/dist/runtime/child-scope.js +101 -54
  203. package/dist/runtime/component-cleanup.d.ts +1 -2
  204. package/dist/runtime/component-cleanup.js +2 -4
  205. package/dist/runtime/component-commit.js +25 -23
  206. package/dist/runtime/component-facade.js +5 -3
  207. package/dist/runtime/component-internal.d.ts +11 -6
  208. package/dist/runtime/component-internal.js +63 -45
  209. package/dist/runtime/component-lifecycle.d.ts +2 -41
  210. package/dist/runtime/component-lifecycle.js +6 -149
  211. package/dist/runtime/component-scope.d.ts +3 -4
  212. package/dist/runtime/component-scope.js +27 -8
  213. package/dist/runtime/component.js +4 -3
  214. package/dist/runtime/context.d.ts +5 -2
  215. package/dist/runtime/context.js +29 -3
  216. package/dist/runtime/control.d.ts +22 -3
  217. package/dist/runtime/control.js +168 -55
  218. package/dist/runtime/derive.d.ts +1 -2
  219. package/dist/runtime/derive.js +0 -2
  220. package/dist/runtime/dev-namespace.d.ts +5 -6
  221. package/dist/runtime/dev-namespace.js +32 -25
  222. package/dist/runtime/effect.d.ts +8 -5
  223. package/dist/runtime/effect.js +158 -75
  224. package/dist/runtime/error-boundary.d.ts +1 -2
  225. package/dist/runtime/error-boundary.js +0 -2
  226. package/dist/runtime/events.d.ts +3 -3
  227. package/dist/runtime/events.js +66 -69
  228. package/dist/runtime/execution-model.d.ts +1 -2
  229. package/dist/runtime/execution-model.js +0 -2
  230. package/dist/runtime/fastlane.d.ts +1 -2
  231. package/dist/runtime/fastlane.js +0 -2
  232. package/dist/runtime/for-bench.d.ts +1 -2
  233. package/dist/runtime/for-bench.js +9 -167
  234. package/dist/runtime/for-internal.d.ts +68 -5
  235. package/dist/runtime/for-internal.js +201 -14
  236. package/dist/runtime/for-reconcile.d.ts +1 -2
  237. package/dist/runtime/for-reconcile.js +76 -23
  238. package/dist/runtime/for-scopes.d.ts +5 -5
  239. package/dist/runtime/for-scopes.js +168 -48
  240. package/dist/runtime/for-signals.d.ts +13 -4
  241. package/dist/runtime/for-signals.js +155 -81
  242. package/dist/runtime/for-types.d.ts +1 -2
  243. package/dist/runtime/for.d.ts +2 -2
  244. package/dist/runtime/for.js +3 -3
  245. package/dist/runtime/index.d.ts +5 -5
  246. package/dist/runtime/index.js +12 -10
  247. package/dist/runtime/lifecycle-batch.d.ts +59 -0
  248. package/dist/runtime/lifecycle-batch.js +178 -0
  249. package/dist/runtime/lifecycle-operation-settlement.d.ts +5 -0
  250. package/dist/runtime/lifecycle-operation-settlement.js +51 -0
  251. package/dist/runtime/lifecycle-operations.d.ts +1 -2
  252. package/dist/runtime/lifecycle-operations.js +5 -6
  253. package/dist/runtime/perf-metrics.d.ts +8 -7
  254. package/dist/runtime/perf-metrics.js +4 -68
  255. package/dist/runtime/portal.d.ts +1 -2
  256. package/dist/runtime/portal.js +103 -11
  257. package/dist/runtime/readable.d.ts +9 -4
  258. package/dist/runtime/readable.js +41 -17
  259. package/dist/runtime/resource-cell.js +2 -4
  260. package/dist/runtime/resource-operation.d.ts +1 -2
  261. package/dist/runtime/resource-operation.js +37 -34
  262. package/dist/runtime/runtime.d.ts +1 -2
  263. package/dist/runtime/runtime.js +0 -2
  264. package/dist/runtime/scheduler.d.ts +1 -2
  265. package/dist/runtime/scheduler.js +8 -11
  266. package/dist/runtime/selector-store.js +0 -2
  267. package/dist/runtime/selector.d.ts +1 -2
  268. package/dist/runtime/selector.js +3 -11
  269. package/dist/runtime/snapshot-source.d.ts +1 -2
  270. package/dist/runtime/snapshot-source.js +0 -2
  271. package/dist/runtime/state.d.ts +1 -2
  272. package/dist/runtime/state.js +1 -3
  273. package/dist/ssg/batch-render.js +0 -2
  274. package/dist/ssg/create-static-gen.d.ts +4 -2
  275. package/dist/ssg/create-static-gen.js +65 -14
  276. package/dist/ssg/generate-metadata.js +0 -2
  277. package/dist/ssg/generation-plan.js +0 -2
  278. package/dist/ssg/incremental-manifest.js +1 -3
  279. package/dist/ssg/resolve-ssg-data.js +0 -2
  280. package/dist/ssg/route-utils.js +0 -2
  281. package/dist/ssg/static-routes.js +0 -2
  282. package/dist/ssg/types.d.ts +2 -3
  283. package/dist/ssg/write-static-files.js +16 -12
  284. package/dist/ssr/attrs.js +0 -2
  285. package/dist/ssr/boundaries.js +16 -5
  286. package/dist/ssr/component-runtime.js +1 -27
  287. package/dist/ssr/context.d.ts +1 -2
  288. package/dist/ssr/context.js +0 -2
  289. package/dist/ssr/errors.d.ts +1 -2
  290. package/dist/ssr/errors.js +0 -2
  291. package/dist/ssr/escape.js +0 -2
  292. package/dist/ssr/hydration-data.js +0 -2
  293. package/dist/ssr/hydration-verify.d.ts +1 -2
  294. package/dist/ssr/hydration-verify.js +34 -7
  295. package/dist/ssr/index-internal.d.ts +1 -2
  296. package/dist/ssr/index-internal.js +0 -2
  297. package/dist/ssr/render-keys.js +0 -2
  298. package/dist/ssr/render-resolved.d.ts +1 -2
  299. package/dist/ssr/render-resolved.js +0 -2
  300. package/dist/ssr/render-sync.d.ts +1 -2
  301. package/dist/ssr/render-sync.js +27 -19
  302. package/dist/ssr/route-policy-resolution.js +0 -2
  303. package/dist/ssr/route-render.d.ts +1 -2
  304. package/dist/ssr/route-render.js +0 -2
  305. package/dist/ssr/sink.d.ts +1 -2
  306. package/dist/ssr/sink.js +0 -2
  307. package/dist/ssr/types.d.ts +1 -2
  308. package/dist/ssr/verify-hydration.js +0 -2
  309. package/dist/testing/index.d.ts +1 -2
  310. package/dist/testing/index.js +0 -2
  311. package/package.json +57 -44
  312. package/dist/bench/components/benchmark-row.d.ts.map +0 -1
  313. package/dist/bench/components/benchmark-row.js.map +0 -1
  314. package/dist/bench/components/benchmark-table.js.map +0 -1
  315. package/dist/benchmark.d.ts.map +0 -1
  316. package/dist/benchmark.js.map +0 -1
  317. package/dist/bin/askr-ssg.d.ts.map +0 -1
  318. package/dist/bin/askr-ssg.js.map +0 -1
  319. package/dist/boot/hydration.js.map +0 -1
  320. package/dist/boot/index.d.ts.map +0 -1
  321. package/dist/boot/index.js.map +0 -1
  322. package/dist/boot/root-lifecycle.d.ts.map +0 -1
  323. package/dist/boot/root-lifecycle.js.map +0 -1
  324. package/dist/boot/route-startup.js.map +0 -1
  325. package/dist/boot/types.d.ts.map +0 -1
  326. package/dist/common/attr-names.js.map +0 -1
  327. package/dist/common/component.d.ts.map +0 -1
  328. package/dist/common/control.d.ts.map +0 -1
  329. package/dist/common/control.js.map +0 -1
  330. package/dist/common/env.js.map +0 -1
  331. package/dist/common/error-boundary.d.ts.map +0 -1
  332. package/dist/common/invariant.js.map +0 -1
  333. package/dist/common/jsx.d.ts.map +0 -1
  334. package/dist/common/jsx.js.map +0 -1
  335. package/dist/common/logger.js.map +0 -1
  336. package/dist/common/promise.js.map +0 -1
  337. package/dist/common/props.d.ts.map +0 -1
  338. package/dist/common/render-context.js.map +0 -1
  339. package/dist/common/route-activity.js.map +0 -1
  340. package/dist/common/router-internal.js.map +0 -1
  341. package/dist/common/router.d.ts.map +0 -1
  342. package/dist/common/ssr-errors.d.ts.map +0 -1
  343. package/dist/common/ssr-errors.js.map +0 -1
  344. package/dist/common/ssr.d.ts.map +0 -1
  345. package/dist/common/ssr.js.map +0 -1
  346. package/dist/common/vnode.d.ts.map +0 -1
  347. package/dist/common/vnode.js.map +0 -1
  348. package/dist/components/error-boundary.d.ts.map +0 -1
  349. package/dist/components/error-boundary.js.map +0 -1
  350. package/dist/components/link.d.ts.map +0 -1
  351. package/dist/components/link.js.map +0 -1
  352. package/dist/control/case.d.ts.map +0 -1
  353. package/dist/control/case.js.map +0 -1
  354. package/dist/control/for.d.ts.map +0 -1
  355. package/dist/control/for.js.map +0 -1
  356. package/dist/control/shared.d.ts.map +0 -1
  357. package/dist/control/shared.js.map +0 -1
  358. package/dist/control/show.d.ts.map +0 -1
  359. package/dist/control/show.js.map +0 -1
  360. package/dist/data/data-runtime.d.ts.map +0 -1
  361. package/dist/data/data-runtime.js.map +0 -1
  362. package/dist/data/invalidation-listeners.js.map +0 -1
  363. package/dist/data/invalidation.d.ts.map +0 -1
  364. package/dist/data/invalidation.js.map +0 -1
  365. package/dist/data/mutation-cell.d.ts.map +0 -1
  366. package/dist/data/mutation-cell.js.map +0 -1
  367. package/dist/data/query-cell.d.ts.map +0 -1
  368. package/dist/data/query-cell.js.map +0 -1
  369. package/dist/data/query-key.js.map +0 -1
  370. package/dist/data/shared.js.map +0 -1
  371. package/dist/data/types.d.ts.map +0 -1
  372. package/dist/foundations/icon/icon.d.ts.map +0 -1
  373. package/dist/foundations/icon/icon.js.map +0 -1
  374. package/dist/foundations/icon/icon.types.d.ts.map +0 -1
  375. package/dist/foundations/interactions/dismissable.d.ts.map +0 -1
  376. package/dist/foundations/interactions/dismissable.js.map +0 -1
  377. package/dist/foundations/interactions/focusable.d.ts.map +0 -1
  378. package/dist/foundations/interactions/focusable.js.map +0 -1
  379. package/dist/foundations/interactions/hoverable.d.ts.map +0 -1
  380. package/dist/foundations/interactions/hoverable.js.map +0 -1
  381. package/dist/foundations/interactions/interaction-policy.d.ts.map +0 -1
  382. package/dist/foundations/interactions/interaction-policy.js.map +0 -1
  383. package/dist/foundations/interactions/pressable.d.ts.map +0 -1
  384. package/dist/foundations/interactions/pressable.js.map +0 -1
  385. package/dist/foundations/interactions/roving-focus.d.ts.map +0 -1
  386. package/dist/foundations/interactions/roving-focus.js.map +0 -1
  387. package/dist/foundations/state/controllable.d.ts.map +0 -1
  388. package/dist/foundations/state/controllable.js.map +0 -1
  389. package/dist/foundations/structures/collection.d.ts.map +0 -1
  390. package/dist/foundations/structures/collection.js.map +0 -1
  391. package/dist/foundations/structures/layer.d.ts.map +0 -1
  392. package/dist/foundations/structures/layer.js.map +0 -1
  393. package/dist/foundations/structures/layout.d.ts.map +0 -1
  394. package/dist/foundations/structures/layout.js.map +0 -1
  395. package/dist/foundations/structures/presence.d.ts.map +0 -1
  396. package/dist/foundations/structures/presence.js.map +0 -1
  397. package/dist/foundations/structures/slot.d.ts.map +0 -1
  398. package/dist/foundations/structures/slot.js.map +0 -1
  399. package/dist/foundations/utilities/aria.d.ts.map +0 -1
  400. package/dist/foundations/utilities/aria.js.map +0 -1
  401. package/dist/foundations/utilities/compose-handlers.d.ts.map +0 -1
  402. package/dist/foundations/utilities/compose-handlers.js.map +0 -1
  403. package/dist/foundations/utilities/compose-ref.d.ts.map +0 -1
  404. package/dist/foundations/utilities/compose-ref.js.map +0 -1
  405. package/dist/foundations/utilities/event-types.d.ts.map +0 -1
  406. package/dist/foundations/utilities/merge-props.d.ts.map +0 -1
  407. package/dist/foundations/utilities/merge-props.js.map +0 -1
  408. package/dist/foundations/utilities/use-id.d.ts.map +0 -1
  409. package/dist/foundations/utilities/use-id.js.map +0 -1
  410. package/dist/fx/fx.d.ts.map +0 -1
  411. package/dist/fx/fx.js.map +0 -1
  412. package/dist/fx/noop.js.map +0 -1
  413. package/dist/fx/timing.d.ts.map +0 -1
  414. package/dist/fx/timing.js.map +0 -1
  415. package/dist/index.js.map +0 -1
  416. package/dist/jsx/types.d.ts.map +0 -1
  417. package/dist/jsx/utils.d.ts.map +0 -1
  418. package/dist/jsx/utils.js.map +0 -1
  419. package/dist/jsx-dev-runtime.d.ts.map +0 -1
  420. package/dist/jsx-dev-runtime.js.map +0 -1
  421. package/dist/jsx-runtime.d.ts.map +0 -1
  422. package/dist/jsx-runtime.js.map +0 -1
  423. package/dist/renderer/attributes.js.map +0 -1
  424. package/dist/renderer/boundaries.js.map +0 -1
  425. package/dist/renderer/child-shape.js.map +0 -1
  426. package/dist/renderer/children-fastpath.js.map +0 -1
  427. package/dist/renderer/children.js.map +0 -1
  428. package/dist/renderer/cleanup.js.map +0 -1
  429. package/dist/renderer/component-host-cleanup.js.map +0 -1
  430. package/dist/renderer/component-host-instances.js.map +0 -1
  431. package/dist/renderer/component-host.js.map +0 -1
  432. package/dist/renderer/dom-host.js.map +0 -1
  433. package/dist/renderer/dom-internal.js.map +0 -1
  434. package/dist/renderer/element-children.js.map +0 -1
  435. package/dist/renderer/error-boundary-dom.js.map +0 -1
  436. package/dist/renderer/evaluate-dom-range.js.map +0 -1
  437. package/dist/renderer/evaluate-reconcile.js.map +0 -1
  438. package/dist/renderer/evaluate.js.map +0 -1
  439. package/dist/renderer/fastpath.js.map +0 -1
  440. package/dist/renderer/for-commit-dom-map.js.map +0 -1
  441. package/dist/renderer/for-commit-removal.js.map +0 -1
  442. package/dist/renderer/for-commit-reorder.js.map +0 -1
  443. package/dist/renderer/for-commit.js.map +0 -1
  444. package/dist/renderer/index.js.map +0 -1
  445. package/dist/renderer/keyed-children.js.map +0 -1
  446. package/dist/renderer/keyed.js.map +0 -1
  447. package/dist/renderer/namespaces.js.map +0 -1
  448. package/dist/renderer/prop-bindings.js.map +0 -1
  449. package/dist/renderer/reactive-child-dom.js.map +0 -1
  450. package/dist/renderer/reactive-child-sources.js.map +0 -1
  451. package/dist/renderer/reactive-children.js.map +0 -1
  452. package/dist/renderer/reconcile-commit.js.map +0 -1
  453. package/dist/renderer/reconcile-fastpaths.js.map +0 -1
  454. package/dist/renderer/reconcile-resolution.js.map +0 -1
  455. package/dist/renderer/reconcile.js.map +0 -1
  456. package/dist/renderer/retained-element-rollback.js.map +0 -1
  457. package/dist/renderer/stable-patch.js.map +0 -1
  458. package/dist/renderer/static-reuse.js.map +0 -1
  459. package/dist/renderer/utils.js.map +0 -1
  460. package/dist/router/access.js.map +0 -1
  461. package/dist/router/activity.d.ts.map +0 -1
  462. package/dist/router/activity.js.map +0 -1
  463. package/dist/router/authoring.d.ts.map +0 -1
  464. package/dist/router/authoring.js.map +0 -1
  465. package/dist/router/internal-types.d.ts.map +0 -1
  466. package/dist/router/lazy.d.ts.map +0 -1
  467. package/dist/router/lazy.js.map +0 -1
  468. package/dist/router/manifest.d.ts.map +0 -1
  469. package/dist/router/manifest.js.map +0 -1
  470. package/dist/router/match.js.map +0 -1
  471. package/dist/router/navigate.d.ts.map +0 -1
  472. package/dist/router/navigate.js.map +0 -1
  473. package/dist/router/navigation-registry.d.ts.map +0 -1
  474. package/dist/router/navigation-registry.js.map +0 -1
  475. package/dist/router/navigation-scroll.d.ts.map +0 -1
  476. package/dist/router/navigation-scroll.js.map +0 -1
  477. package/dist/router/navigation-targets.d.ts.map +0 -1
  478. package/dist/router/navigation-targets.js.map +0 -1
  479. package/dist/router/policy.d.ts.map +0 -1
  480. package/dist/router/policy.js.map +0 -1
  481. package/dist/router/rendering.d.ts.map +0 -1
  482. package/dist/router/rendering.js.map +0 -1
  483. package/dist/router/resolution.d.ts.map +0 -1
  484. package/dist/router/resolution.js.map +0 -1
  485. package/dist/router/route-context.js.map +0 -1
  486. package/dist/router/route-matching.d.ts.map +0 -1
  487. package/dist/router/route-matching.js.map +0 -1
  488. package/dist/router/route-query.d.ts.map +0 -1
  489. package/dist/router/route-query.js.map +0 -1
  490. package/dist/router/store.d.ts.map +0 -1
  491. package/dist/router/store.js.map +0 -1
  492. package/dist/runtime/access.d.ts.map +0 -1
  493. package/dist/runtime/access.js.map +0 -1
  494. package/dist/runtime/child-scope.d.ts.map +0 -1
  495. package/dist/runtime/child-scope.js.map +0 -1
  496. package/dist/runtime/component-cleanup.d.ts.map +0 -1
  497. package/dist/runtime/component-cleanup.js.map +0 -1
  498. package/dist/runtime/component-commit.js.map +0 -1
  499. package/dist/runtime/component-internal.d.ts.map +0 -1
  500. package/dist/runtime/component-internal.js.map +0 -1
  501. package/dist/runtime/component-lifecycle.d.ts.map +0 -1
  502. package/dist/runtime/component-lifecycle.js.map +0 -1
  503. package/dist/runtime/component-scope.d.ts.map +0 -1
  504. package/dist/runtime/component-scope.js.map +0 -1
  505. package/dist/runtime/context.d.ts.map +0 -1
  506. package/dist/runtime/context.js.map +0 -1
  507. package/dist/runtime/control.d.ts.map +0 -1
  508. package/dist/runtime/control.js.map +0 -1
  509. package/dist/runtime/derive.d.ts.map +0 -1
  510. package/dist/runtime/derive.js.map +0 -1
  511. package/dist/runtime/dev-namespace.d.ts.map +0 -1
  512. package/dist/runtime/dev-namespace.js.map +0 -1
  513. package/dist/runtime/effect.d.ts.map +0 -1
  514. package/dist/runtime/effect.js.map +0 -1
  515. package/dist/runtime/error-boundary.d.ts.map +0 -1
  516. package/dist/runtime/error-boundary.js.map +0 -1
  517. package/dist/runtime/events.d.ts.map +0 -1
  518. package/dist/runtime/events.js.map +0 -1
  519. package/dist/runtime/execution-model.d.ts.map +0 -1
  520. package/dist/runtime/execution-model.js.map +0 -1
  521. package/dist/runtime/fastlane.d.ts.map +0 -1
  522. package/dist/runtime/fastlane.js.map +0 -1
  523. package/dist/runtime/for-bench.d.ts.map +0 -1
  524. package/dist/runtime/for-bench.js.map +0 -1
  525. package/dist/runtime/for-internal.d.ts.map +0 -1
  526. package/dist/runtime/for-internal.js.map +0 -1
  527. package/dist/runtime/for-reconcile.d.ts.map +0 -1
  528. package/dist/runtime/for-reconcile.js.map +0 -1
  529. package/dist/runtime/for-scopes.d.ts.map +0 -1
  530. package/dist/runtime/for-scopes.js.map +0 -1
  531. package/dist/runtime/for-signals.d.ts.map +0 -1
  532. package/dist/runtime/for-signals.js.map +0 -1
  533. package/dist/runtime/for-types.d.ts.map +0 -1
  534. package/dist/runtime/lifecycle-operations.d.ts.map +0 -1
  535. package/dist/runtime/lifecycle-operations.js.map +0 -1
  536. package/dist/runtime/perf-metrics.d.ts.map +0 -1
  537. package/dist/runtime/perf-metrics.js.map +0 -1
  538. package/dist/runtime/portal.d.ts.map +0 -1
  539. package/dist/runtime/portal.js.map +0 -1
  540. package/dist/runtime/readable.d.ts.map +0 -1
  541. package/dist/runtime/readable.js.map +0 -1
  542. package/dist/runtime/resource-cell.js.map +0 -1
  543. package/dist/runtime/resource-operation.d.ts.map +0 -1
  544. package/dist/runtime/resource-operation.js.map +0 -1
  545. package/dist/runtime/runtime.d.ts.map +0 -1
  546. package/dist/runtime/runtime.js.map +0 -1
  547. package/dist/runtime/scheduler.d.ts.map +0 -1
  548. package/dist/runtime/scheduler.js.map +0 -1
  549. package/dist/runtime/selector-store.js.map +0 -1
  550. package/dist/runtime/selector.d.ts.map +0 -1
  551. package/dist/runtime/selector.js.map +0 -1
  552. package/dist/runtime/snapshot-source.d.ts.map +0 -1
  553. package/dist/runtime/snapshot-source.js.map +0 -1
  554. package/dist/runtime/state.d.ts.map +0 -1
  555. package/dist/runtime/state.js.map +0 -1
  556. package/dist/ssg/batch-render.js.map +0 -1
  557. package/dist/ssg/create-static-gen.d.ts.map +0 -1
  558. package/dist/ssg/create-static-gen.js.map +0 -1
  559. package/dist/ssg/generate-metadata.js.map +0 -1
  560. package/dist/ssg/generation-plan.js.map +0 -1
  561. package/dist/ssg/incremental-manifest.js.map +0 -1
  562. package/dist/ssg/resolve-ssg-data.js.map +0 -1
  563. package/dist/ssg/route-utils.js.map +0 -1
  564. package/dist/ssg/static-routes.js.map +0 -1
  565. package/dist/ssg/types.d.ts.map +0 -1
  566. package/dist/ssg/write-static-files.js.map +0 -1
  567. package/dist/ssr/attrs.js.map +0 -1
  568. package/dist/ssr/boundaries.js.map +0 -1
  569. package/dist/ssr/component-runtime.js.map +0 -1
  570. package/dist/ssr/context.d.ts.map +0 -1
  571. package/dist/ssr/context.js.map +0 -1
  572. package/dist/ssr/errors.d.ts.map +0 -1
  573. package/dist/ssr/errors.js.map +0 -1
  574. package/dist/ssr/escape.js.map +0 -1
  575. package/dist/ssr/hydration-data.js.map +0 -1
  576. package/dist/ssr/hydration-verify.d.ts.map +0 -1
  577. package/dist/ssr/hydration-verify.js.map +0 -1
  578. package/dist/ssr/index-internal.d.ts.map +0 -1
  579. package/dist/ssr/index-internal.js.map +0 -1
  580. package/dist/ssr/render-keys.js.map +0 -1
  581. package/dist/ssr/render-resolved.d.ts.map +0 -1
  582. package/dist/ssr/render-resolved.js.map +0 -1
  583. package/dist/ssr/render-sync.d.ts.map +0 -1
  584. package/dist/ssr/render-sync.js.map +0 -1
  585. package/dist/ssr/route-policy-resolution.js.map +0 -1
  586. package/dist/ssr/route-render.d.ts.map +0 -1
  587. package/dist/ssr/route-render.js.map +0 -1
  588. package/dist/ssr/sink.d.ts.map +0 -1
  589. package/dist/ssr/sink.js.map +0 -1
  590. package/dist/ssr/types.d.ts.map +0 -1
  591. package/dist/ssr/verify-hydration.js.map +0 -1
  592. package/dist/testing/index.d.ts.map +0 -1
  593. package/dist/testing/index.js.map +0 -1
@@ -0,0 +1,72 @@
1
+ import { getRuntimeEnv } from "../common/env.js";
2
+ import { logger } from "../common/logger.js";
3
+ import "./env.js";
4
+ import { appendRange } from "./dom-range.js";
5
+ import { assignScopeRange, checkVNodeShapeChanged, materializeChildScopeRange } from "./boundary-range-adoption.js";
6
+ import { clearControlBoundaryDomUpdateState, evaluateControlBoundaryState, getControlBoundaryState } from "./boundary-state.js";
7
+ //#region src/renderer/boundary-materialization.ts
8
+ /**
9
+ * Create DOM from For/Show/Case control boundaries.
10
+ *
11
+ * DOM order is reconstructed from the current vnode list on every render.
12
+ * Reusing DOM nodes never implies preserving their position; appending an
13
+ * existing node to the fragment expresses reordering per the DOM spec.
14
+ */
15
+ function createForBoundary(node, props, parentNamespace) {
16
+ const controlState = getControlBoundaryState(node);
17
+ if (!controlState) {
18
+ if (getRuntimeEnv().NODE_ENV !== "production") logger.warn("[Askr] Control boundary missing state");
19
+ return document.createDocumentFragment();
20
+ }
21
+ const childrenVNodes = evaluateControlBoundaryState(controlState);
22
+ const fragment = document.createDocumentFragment();
23
+ if (controlState.kind !== "for") {
24
+ const activeScope = controlState.activeScope;
25
+ const vnode = childrenVNodes[0];
26
+ if (activeScope && vnode !== void 0) {
27
+ const range = materializeChildScopeRange(vnode, parentNamespace, activeScope);
28
+ assignScopeRange(activeScope, range);
29
+ activeScope.hydrationPending = false;
30
+ appendRange(fragment, range);
31
+ }
32
+ clearControlBoundaryDomUpdateState(controlState);
33
+ return fragment;
34
+ }
35
+ const forState = controlState;
36
+ if (forState.orderedKeys.length === 0) {
37
+ const fallbackScope = forState.fallbackScope;
38
+ const fallbackVNode = childrenVNodes[0];
39
+ if (fallbackScope && fallbackVNode !== void 0) {
40
+ const range = materializeChildScopeRange(fallbackVNode, parentNamespace, fallbackScope);
41
+ assignScopeRange(fallbackScope, range);
42
+ fallbackScope.hydrationPending = false;
43
+ appendRange(fragment, range);
44
+ }
45
+ clearControlBoundaryDomUpdateState(controlState);
46
+ return fragment;
47
+ }
48
+ for (let i = 0; i < childrenVNodes.length; i++) {
49
+ const childVNode = childrenVNodes[i];
50
+ const itemKey = forState.orderedKeys[i];
51
+ const itemInstance = itemKey != null ? forState.items.get(itemKey) : null;
52
+ let range = null;
53
+ if (itemInstance && itemInstance.scope.range) {
54
+ const cachedRange = itemInstance.scope.range;
55
+ const cachedDom = cachedRange.single ? cachedRange.start : null;
56
+ if (!cachedDom || !checkVNodeShapeChanged(cachedDom, childVNode)) range = cachedRange;
57
+ }
58
+ if (!range) {
59
+ const materializedRange = materializeChildScopeRange(childVNode, parentNamespace, itemInstance?.scope);
60
+ if (itemInstance) {
61
+ assignScopeRange(itemInstance.scope, materializedRange);
62
+ itemInstance.scope.hydrationPending = false;
63
+ }
64
+ range = materializedRange;
65
+ }
66
+ appendRange(fragment, range);
67
+ }
68
+ clearControlBoundaryDomUpdateState(controlState);
69
+ return fragment;
70
+ }
71
+ //#endregion
72
+ export { createForBoundary };
@@ -0,0 +1,76 @@
1
+ import { _isDOMElement } from "../common/vnode.js";
2
+ import "./types.js";
3
+ import { Fragment } from "../common/jsx.js";
4
+ import { enterDomCommitScope, restoreDomCommitScope } from "../runtime/component-scope.js";
5
+ import "../runtime/index.js";
6
+ import { createDetachedRange, createEmptyRange, createSingleNodeRange, findRangeEnd, getRangeNodes, isRangeStart } from "./dom-range.js";
7
+ import { getParentNamespace } from "./namespaces.js";
8
+ import "../jsx/index.js";
9
+ //#region src/renderer/boundary-range-adoption.ts
10
+ let boundaryRangeHost = null;
11
+ function configureBoundaryRangeHost(host) {
12
+ boundaryRangeHost = host;
13
+ }
14
+ function getBoundaryRangeHost() {
15
+ if (!boundaryRangeHost) throw new Error("[askr] Control boundary DOM host is not configured.");
16
+ return boundaryRangeHost;
17
+ }
18
+ function assignScopeRange(scope, range) {
19
+ scope.range = range;
20
+ scope.dom = range.single ? range.start : void 0;
21
+ }
22
+ function checkVNodeShapeChanged(dom, vnode) {
23
+ if (!_isDOMElement(vnode) || !(dom instanceof Element)) return true;
24
+ if (typeof vnode.type !== "string") return true;
25
+ return dom.tagName.toLowerCase() !== vnode.type.toLowerCase();
26
+ }
27
+ function adoptHydratedRange(parent, scope, before, vnode) {
28
+ if (!scope.hydrationPending || !before || !isRangeStart(before)) return null;
29
+ const end = findRangeEnd(before);
30
+ if (!end || end.parentNode !== parent) return null;
31
+ const range = {
32
+ start: before,
33
+ end,
34
+ single: false
35
+ };
36
+ const contentNodes = getRangeNodes(range);
37
+ const expectedChildren = _isDOMElement(vnode) && vnode.type === Fragment ? vnode.props?.children ?? [] : [vnode];
38
+ if (contentNodes.length !== expectedChildren.length) return null;
39
+ for (let index = 0; index < expectedChildren.length; index += 1) {
40
+ const expected = expectedChildren[index];
41
+ const actual = contentNodes[index];
42
+ if (_isDOMElement(expected) && typeof expected.type === "string" && (!(actual instanceof Element) || actual.tagName.toLowerCase() !== expected.type.toLowerCase())) return null;
43
+ }
44
+ assignScopeRange(scope, range);
45
+ scope.hydrationPending = false;
46
+ return range;
47
+ }
48
+ function getScopeRange(scope) {
49
+ if (scope.range) return scope.range;
50
+ if (!scope.dom) return null;
51
+ const range = {
52
+ start: scope.dom,
53
+ end: scope.dom,
54
+ single: true
55
+ };
56
+ scope.range = range;
57
+ return range;
58
+ }
59
+ function materializeChildScopeRange(vnode, parentNamespace, scope, scopeAlreadyActive = false) {
60
+ const previousInstance = scope && !scopeAlreadyActive ? enterDomCommitScope(scope.componentInstance) : null;
61
+ let dom;
62
+ try {
63
+ const host = getBoundaryRangeHost();
64
+ dom = scope?.blueprintOwner && _isDOMElement(vnode) && typeof vnode.type === "string" ? host.createResultNodeWithBlueprint(scope.blueprintOwner, vnode, parentNamespace) : host.createDOMNode(vnode, parentNamespace);
65
+ } finally {
66
+ if (scope && !scopeAlreadyActive) restoreDomCommitScope(previousInstance);
67
+ }
68
+ if (!dom) return createEmptyRange(document, scope).range;
69
+ if (!(dom instanceof DocumentFragment)) return createSingleNodeRange(dom, scope);
70
+ return createDetachedRange(dom, scope).range;
71
+ }
72
+ function getBoundaryParentNamespace(parent) {
73
+ return getParentNamespace(parent);
74
+ }
75
+ //#endregion
76
+ export { adoptHydratedRange, assignScopeRange, checkVNodeShapeChanged, configureBoundaryRangeHost, getBoundaryParentNamespace, getBoundaryRangeHost, getScopeRange, materializeChildScopeRange };
@@ -0,0 +1,101 @@
1
+ import { _isDOMElement } from "../common/vnode.js";
2
+ import "./types.js";
3
+ import { enterDomCommitScope, restoreDomCommitScope } from "../runtime/component-scope.js";
4
+ import { registerLifecycleTransaction } from "../runtime/lifecycle-batch.js";
5
+ import { clearCaseDomUpdateState, clearShowDomUpdateState } from "../runtime/control.js";
6
+ import { clearForDomUpdateState } from "../runtime/for-internal.js";
7
+ import "../runtime/index.js";
8
+ import { teardownNodeSubtree } from "./cleanup.js";
9
+ import { tagNamesEqualIgnoreCase } from "./utils.js";
10
+ import { insertRangeBefore, removeRange } from "./dom-range.js";
11
+ import { adoptHydratedRange, assignScopeRange, getBoundaryParentNamespace, getBoundaryRangeHost, getScopeRange, materializeChildScopeRange } from "./boundary-range-adoption.js";
12
+ //#region src/renderer/boundary-range-sync.ts
13
+ function clearBoundaryState(controlState) {
14
+ if (controlState.kind === "for") clearForDomUpdateState(controlState);
15
+ else if (controlState.kind === "show") clearShowDomUpdateState(controlState);
16
+ else clearCaseDomUpdateState(controlState);
17
+ }
18
+ function syncControlBoundaryScopeDom(parent, scope, vnode, before = null, allowHydrationAdoption = true, insertDetached = true) {
19
+ const previousInstance = enterDomCommitScope(scope.componentInstance);
20
+ try {
21
+ const currentRange = getScopeRange(scope);
22
+ const dom = currentRange?.single ? currentRange.start : null;
23
+ const host = getBoundaryRangeHost();
24
+ const hydratedRange = currentRange || !allowHydrationAdoption ? null : adoptHydratedRange(parent, scope, before, vnode);
25
+ if (hydratedRange) return hydratedRange;
26
+ const resolvedRange = hydratedRange ?? currentRange;
27
+ if (resolvedRange && scope.hydrationPending && !resolvedRange.single) {
28
+ scope.hydrationPending = false;
29
+ return resolvedRange;
30
+ }
31
+ if (_isDOMElement(vnode) && typeof vnode.type === "function") {
32
+ const synced = host.syncComponentElement(dom, vnode, vnode.type, (vnode.props ?? {}) || {}, getBoundaryParentNamespace(parent));
33
+ if (synced) {
34
+ const nextRange = {
35
+ start: synced,
36
+ end: synced,
37
+ single: true
38
+ };
39
+ assignScopeRange(scope, nextRange);
40
+ return nextRange;
41
+ }
42
+ }
43
+ if (!resolvedRange) {
44
+ const nextRange = materializeChildScopeRange(vnode, getBoundaryParentNamespace(parent), scope, true);
45
+ assignScopeRange(scope, nextRange);
46
+ if (insertDetached) insertRangeBefore(parent, nextRange, before);
47
+ return nextRange;
48
+ }
49
+ if (resolvedRange.single && dom?.nodeType === 3 && (typeof vnode === "string" || typeof vnode === "number")) {
50
+ dom.data = String(vnode);
51
+ return currentRange;
52
+ }
53
+ if (resolvedRange.single && dom?.nodeType === 8 && (vnode === null || vnode === void 0 || vnode === false)) return currentRange;
54
+ if (resolvedRange.single && dom instanceof Element && _isDOMElement(vnode) && typeof vnode.type === "string" && tagNamesEqualIgnoreCase(dom.tagName, vnode.type)) {
55
+ host.updateElementFromVnode(dom, vnode, true);
56
+ return currentRange;
57
+ }
58
+ const nextRange = materializeChildScopeRange(vnode, getBoundaryParentNamespace(parent), scope);
59
+ const previousRange = resolvedRange;
60
+ const previousDom = scope.dom;
61
+ const previousParent = previousRange.start.parentNode;
62
+ const previousNextSibling = previousRange.end.nextSibling;
63
+ const registered = registerLifecycleTransaction({}, () => removeRange(previousRange, teardownBoundaryRangeNode), () => {
64
+ removeRange(nextRange, teardownBoundaryRangeNode);
65
+ if (previousParent && !previousRange.start.parentNode) previousParent.insertBefore(previousRange.start, previousNextSibling?.parentNode === previousParent ? previousNextSibling : null);
66
+ scope.range = previousRange;
67
+ scope.dom = previousDom;
68
+ });
69
+ if (previousRange.single && nextRange.single && previousRange.start.parentNode === parent) parent.replaceChild(nextRange.start, previousRange.start);
70
+ else insertRangeBefore(parent, nextRange, previousRange.start.parentNode === parent ? previousRange.start : null);
71
+ assignScopeRange(scope, nextRange);
72
+ if (!registered) removeRange(previousRange, teardownBoundaryRangeNode);
73
+ return nextRange;
74
+ } finally {
75
+ restoreDomCommitScope(previousInstance);
76
+ }
77
+ }
78
+ function teardownBoundaryRangeNode(node) {
79
+ if (node.nodeType === 8) {
80
+ node.parentNode?.removeChild(node);
81
+ return;
82
+ }
83
+ teardownNodeSubtree(node);
84
+ node.parentNode?.removeChild(node);
85
+ }
86
+ function syncControlBoundaryScopeNode(parent, scope, vnode) {
87
+ const range = syncControlBoundaryScopeDom(parent, scope, vnode, null, true, false);
88
+ return range?.single ? range.start : null;
89
+ }
90
+ function syncControlBoundaryInMixedParent(parent, controlState, childrenVNodes, before) {
91
+ if (controlState.kind === "for") throw new Error("[askr] For ranges require the keyed boundary commit path.");
92
+ const activeScope = controlState.activeScope;
93
+ const activeVNode = childrenVNodes[0];
94
+ const nextRange = activeScope && activeVNode !== void 0 ? syncControlBoundaryScopeDom(parent, activeScope, activeVNode, before, controlState.lastRemovedRanges.length === 0) : null;
95
+ for (const range of controlState.lastRemovedRanges) if (range !== nextRange) removeRange(range, teardownBoundaryRangeNode);
96
+ for (const node of controlState.lastRemovedNodes) if (node.parentNode === parent) teardownBoundaryRangeNode(node);
97
+ clearBoundaryState(controlState);
98
+ return nextRange ? [nextRange] : [];
99
+ }
100
+ //#endregion
101
+ export { syncControlBoundaryInMixedParent, syncControlBoundaryScopeDom, syncControlBoundaryScopeNode };
@@ -0,0 +1,50 @@
1
+ import { __FOR_BOUNDARY__, _isDOMElement } from "../common/vnode.js";
2
+ import "./types.js";
3
+ import { clearCaseDomUpdateState, clearShowDomUpdateState, evaluateCaseState, evaluateShowState } from "../runtime/control.js";
4
+ import { clearForDomUpdateState, evaluateForState } from "../runtime/for-internal.js";
5
+ import "../runtime/index.js";
6
+ //#region src/renderer/boundary-state.ts
7
+ function evaluateControlBoundaryState(controlState) {
8
+ if (controlState.kind === "for") return evaluateForState(controlState);
9
+ if (controlState.kind === "show") return evaluateShowState(controlState);
10
+ return evaluateCaseState(controlState);
11
+ }
12
+ function clearControlBoundaryDomUpdateState(controlState) {
13
+ if (controlState.kind === "for") {
14
+ clearForDomUpdateState(controlState);
15
+ return;
16
+ }
17
+ if (controlState.kind === "show") {
18
+ clearShowDomUpdateState(controlState);
19
+ return;
20
+ }
21
+ clearCaseDomUpdateState(controlState);
22
+ }
23
+ function getControlBoundaryState(node) {
24
+ return node._controlState ?? node._forState ?? null;
25
+ }
26
+ function getDirectControlBoundaryVNode(children) {
27
+ if (!Array.isArray(children) && _isDOMElement(children) && children.type === __FOR_BOUNDARY__) return children;
28
+ if (Array.isArray(children) && children.length === 1 && _isDOMElement(children[0]) && children[0].type === __FOR_BOUNDARY__) return children[0];
29
+ return null;
30
+ }
31
+ function getControlBoundaryCommitChildren(controlState) {
32
+ if (controlState.kind === "for" && controlState._needsSourceReconcile) return evaluateForState(controlState);
33
+ if (controlState.kind !== "for") {
34
+ const activeVNode = controlState.activeScope?.vnode;
35
+ return activeVNode == null || activeVNode === false ? [] : [activeVNode];
36
+ }
37
+ if (controlState.orderedKeys.length === 0) {
38
+ const fallbackVNode = controlState.fallbackScope?.vnode;
39
+ return fallbackVNode == null || fallbackVNode === false ? [] : [fallbackVNode];
40
+ }
41
+ const childrenVNodes = [];
42
+ for (let index = 0; index < controlState.orderedKeys.length; index += 1) {
43
+ const itemKey = controlState.orderedKeys[index];
44
+ const itemInstance = controlState.items.get(itemKey);
45
+ childrenVNodes.push(itemInstance?.scope.vnode ?? null);
46
+ }
47
+ return childrenVNodes;
48
+ }
49
+ //#endregion
50
+ export { clearControlBoundaryDomUpdateState, evaluateControlBoundaryState, getControlBoundaryCommitChildren, getControlBoundaryState, getDirectControlBoundaryVNode };
@@ -81,5 +81,3 @@ function tryGetStaticCreateFastPathShape(props, children) {
81
81
  }
82
82
  //#endregion
83
83
  export { isFragmentVNode, maybeWarnMissingKeys, normalizeComponentChildren, tryGetStaticCreateFastPathShape };
84
-
85
- //# sourceMappingURL=child-shape.js.map
@@ -116,8 +116,10 @@ function setTextNodeData(el, text) {
116
116
  function setDataKey(el, key, onSet) {
117
117
  try {
118
118
  const next = String(key);
119
- if (el.getAttribute("data-key") === next) return;
119
+ const keyKind = typeof key;
120
+ if (el.getAttribute("data-key") === next && el.getAttribute("data-askr-key-kind") === keyKind) return;
120
121
  el.setAttribute("data-key", next);
122
+ el.setAttribute("data-askr-key-kind", keyKind);
121
123
  onSet();
122
124
  } catch {}
123
125
  }
@@ -145,5 +147,3 @@ function updateKeyedElementsMap(parent, keyedVnodes) {
145
147
  }
146
148
  //#endregion
147
149
  export { performBulkPositionalKeyedTextUpdate, tagsEqualIgnoreCase };
148
-
149
- //# sourceMappingURL=children-fastpath.js.map
@@ -156,5 +156,3 @@ function recordBulkDiag(data) {
156
156
  }
157
157
  //#endregion
158
158
  export { isBulkTextFastPathEligible, performBulkPositionalKeyedTextUpdate, performBulkTextReplace };
159
-
160
- //# sourceMappingURL=children.js.map
@@ -1,10 +1,12 @@
1
1
  import { logger } from "../common/logger.js";
2
2
  import { incDevCounter } from "../runtime/dev-namespace.js";
3
3
  import { cleanupComponent } from "../runtime/component-cleanup.js";
4
+ import { registerLifecycleTransaction } from "../runtime/lifecycle-batch.js";
4
5
  import { clearDelegatedHandlersForElement, removeDelegatedListener } from "../runtime/events.js";
5
6
  import "../runtime/index.js";
6
7
  //#region src/renderer/cleanup.ts
7
8
  const elementRefs = /* @__PURE__ */ new WeakMap();
9
+ const refOwners = /* @__PURE__ */ new Map();
8
10
  function applyRefValue(ref, value) {
9
11
  const resolvedRef = ref;
10
12
  if (!resolvedRef) return;
@@ -15,26 +17,47 @@ function applyRefValue(ref, value) {
15
17
  if (Object.isExtensible(resolvedRef)) resolvedRef.current = value;
16
18
  }
17
19
  function updateElementRef(element, ref) {
20
+ if (registerLifecycleTransaction({}, () => updateElementRefImmediately(element, ref), () => void 0)) return;
21
+ updateElementRefImmediately(element, ref);
22
+ }
23
+ function updateElementRefImmediately(element, ref) {
18
24
  const previousRef = elementRefs.get(element);
19
25
  if (previousRef === ref) return;
20
26
  if (previousRef) applyRefValue(previousRef, null);
21
27
  if (ref) {
28
+ const previousOwner = refOwners.get(ref);
29
+ if (typeof ref === "function" && previousOwner && previousOwner !== element) {
30
+ elementRefs.set(element, ref);
31
+ refOwners.set(ref, element);
32
+ return;
33
+ }
22
34
  applyRefValue(ref, element);
23
35
  elementRefs.set(element, ref);
36
+ refOwners.set(ref, element);
24
37
  } else elementRefs.delete(element);
25
38
  }
26
39
  function removeElementRef(element) {
27
40
  const ref = elementRefs.get(element);
28
41
  if (!ref) return;
42
+ if (typeof ref !== "function" && refOwners.get(ref) !== element) {
43
+ elementRefs.delete(element);
44
+ return;
45
+ }
29
46
  applyRefValue(ref, null);
47
+ const nextOwner = refOwners.get(ref);
48
+ if (typeof ref === "function" && nextOwner && nextOwner !== element) applyRefValue(ref, nextOwner);
30
49
  elementRefs.delete(element);
50
+ if (refOwners.get(ref) === element) refOwners.delete(ref);
31
51
  }
32
52
  function cleanupSingleInstance(node, errors, strict) {
53
+ const instanceList = node.__ASKR_INSTANCES;
54
+ const primaryInstance = node.__ASKR_INSTANCE;
55
+ if (!instanceList && !primaryInstance) return;
33
56
  const instances = /* @__PURE__ */ new Set();
34
- if (Array.isArray(node.__ASKR_INSTANCES)) {
35
- for (const instance of node.__ASKR_INSTANCES) if (instance) instances.add(instance);
57
+ if (Array.isArray(instanceList)) {
58
+ for (const instance of instanceList) if (instance) instances.add(instance);
36
59
  }
37
- if (node.__ASKR_INSTANCE) instances.add(node.__ASKR_INSTANCE);
60
+ if (primaryInstance) instances.add(primaryInstance);
38
61
  for (const instance of instances) try {
39
62
  cleanupComponent(instance);
40
63
  } catch (err) {
@@ -172,14 +195,50 @@ function teardownNodeSubtree(node, opts) {
172
195
  }
173
196
  const REACTIVE_CHILDREN_KEY = "__askr_reactive_children__";
174
197
  const elementReactivePropsCleanup = /* @__PURE__ */ new WeakMap();
198
+ function getElementReactivePropsCleanupMap(element, create = false) {
199
+ const store = elementReactivePropsCleanup.get(element);
200
+ if (store instanceof Map) return store;
201
+ if (store) {
202
+ const map = /* @__PURE__ */ new Map([[store._bindingKey, store]]);
203
+ elementReactivePropsCleanup.set(element, map);
204
+ return map;
205
+ }
206
+ if (!create) return;
207
+ const map = /* @__PURE__ */ new Map();
208
+ elementReactivePropsCleanup.set(element, map);
209
+ return map;
210
+ }
211
+ function setDirectElementReactivePropCleanup(element, bindingKey, entry) {
212
+ if (!elementReactivePropsCleanup.get(element)) {
213
+ entry._bindingKey = bindingKey;
214
+ elementReactivePropsCleanup.set(element, entry);
215
+ return;
216
+ }
217
+ getElementReactivePropsCleanupMap(element, true).set(bindingKey, entry);
218
+ }
219
+ /** @internal Publish the first reactive binding on a newly created element. */
220
+ function setFreshElementReactivePropCleanup(element, bindingKey, entry) {
221
+ entry._bindingKey = bindingKey;
222
+ elementReactivePropsCleanup.set(element, entry);
223
+ }
224
+ function getElementReactivePropCleanupSize(element) {
225
+ const store = elementReactivePropsCleanup.get(element);
226
+ return store instanceof Map ? store.size : store ? 1 : 0;
227
+ }
228
+ function forEachElementReactivePropCleanup(element, visit) {
229
+ const store = elementReactivePropsCleanup.get(element);
230
+ if (store instanceof Map) for (const entry of store.values()) visit(entry);
231
+ else if (store) visit(store);
232
+ }
175
233
  function removeElementReactiveProps(element) {
176
- const cleanupMap = elementReactivePropsCleanup.get(element);
177
- if (cleanupMap) {
178
- for (const entry of cleanupMap.values()) try {
179
- entry.cleanup();
180
- } catch (err) {
181
- logger.warn("[Askr] reactive prop cleanup failed:", err);
182
- }
234
+ if (elementReactivePropsCleanup.has(element)) {
235
+ forEachElementReactivePropCleanup(element, (entry) => {
236
+ try {
237
+ entry.cleanup();
238
+ } catch (err) {
239
+ logger.warn("[Askr] reactive prop cleanup failed:", err);
240
+ }
241
+ });
183
242
  elementReactivePropsCleanup.delete(element);
184
243
  }
185
244
  }
@@ -205,6 +264,4 @@ function removeAllListeners(root) {
205
264
  });
206
265
  }
207
266
  //#endregion
208
- export { REACTIVE_CHILDREN_KEY, cleanupInstanceIfPresent, cleanupInstancesUnder, elementListeners, elementReactivePropsCleanup, elementRefs, removeAllListeners, removeElementListeners, removeElementReactiveProps, removeElementRef, teardownNodeSubtree, updateElementRef };
209
-
210
- //# sourceMappingURL=cleanup.js.map
267
+ export { REACTIVE_CHILDREN_KEY, cleanupInstanceIfPresent, cleanupInstancesUnder, elementListeners, elementReactivePropsCleanup, elementRefs, forEachElementReactivePropCleanup, getElementReactivePropCleanupSize, getElementReactivePropsCleanupMap, removeAllListeners, removeElementListeners, removeElementReactiveProps, removeElementRef, setDirectElementReactivePropCleanup, setFreshElementReactivePropCleanup, teardownNodeSubtree, updateElementRef };
@@ -1,68 +1,143 @@
1
+ import { incDevCounter } from "../runtime/dev-namespace.js";
1
2
  import { cleanupComponent } from "../runtime/component-cleanup.js";
3
+ import { registerLifecycleTransaction } from "../runtime/lifecycle-batch.js";
4
+ import { clearDelegatedHandlersForElement, removeDelegatedListener } from "../runtime/events.js";
2
5
  import "../runtime/index.js";
3
- import { removeElementListeners, removeElementReactiveProps } from "./cleanup.js";
6
+ import { elementListeners, elementReactivePropsCleanup, elementRefs, forEachElementReactivePropCleanup, removeElementRef } from "./cleanup.js";
4
7
  //#region src/renderer/component-host-cleanup.ts
5
8
  function cleanupDetachedComponentHost(host, retainedInstance) {
6
- removeElementListeners(host);
7
- removeElementReactiveProps(host);
8
- const hostInstances = host.__ASKR_INSTANCES;
9
- if (hostInstances && hostInstances.length > 0) for (const instance of hostInstances) {
10
- if (instance === retainedInstance) continue;
11
- cleanupComponent(instance);
9
+ const retainedInstances = retainedInstance instanceof Object && typeof retainedInstance[Symbol.iterator] === "function" ? new Set(retainedInstance) : /* @__PURE__ */ new Set([retainedInstance]);
10
+ const cleanupErrors = [];
11
+ const cleanedInstances = /* @__PURE__ */ new Set();
12
+ const elements = [host];
13
+ try {
14
+ const descendants = host.querySelectorAll("*");
15
+ for (let index = 0; index < descendants.length; index += 1) elements.push(descendants[index]);
16
+ } catch (error) {
17
+ cleanupErrors.push(error);
18
+ }
19
+ for (const element of elements) {
20
+ cleanupElementListeners(element, cleanupErrors);
21
+ cleanupElementReactiveProps(element, cleanupErrors);
22
+ cleanupElementRef(element, cleanupErrors);
23
+ cleanupElementInstances(element, retainedInstances, cleanedInstances, cleanupErrors);
24
+ clearHostMetadata(element, cleanupErrors);
12
25
  }
13
- else if (host.__ASKR_INSTANCE && host.__ASKR_INSTANCE !== retainedInstance) cleanupComponent(host.__ASKR_INSTANCE);
14
- const descendants = host.querySelectorAll("*");
15
- for (let index = 0; index < descendants.length; index += 1) {
16
- const descendant = descendants[index];
17
- removeElementListeners(descendant);
18
- removeElementReactiveProps(descendant);
19
- if (descendant.__ASKR_INSTANCES?.length) {
20
- for (const instance of descendant.__ASKR_INSTANCES) {
21
- if (instance === retainedInstance) continue;
22
- cleanupComponent(instance);
23
- }
24
- try {
25
- delete descendant.__ASKR_INSTANCES;
26
- } catch {}
27
- } else if (descendant.__ASKR_INSTANCE && descendant.__ASKR_INSTANCE !== retainedInstance) {
28
- cleanupComponent(descendant.__ASKR_INSTANCE);
29
- try {
30
- delete descendant.__ASKR_INSTANCE;
31
- } catch {}
26
+ if (cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, "Detached component host cleanup failed");
27
+ }
28
+ function cleanupElementListeners(element, cleanupErrors) {
29
+ const listenerMap = elementListeners.get(element);
30
+ if (listenerMap) {
31
+ elementListeners.delete(element);
32
+ for (const entry of listenerMap.values()) try {
33
+ incDevCounter("listenerRemoves");
34
+ if (entry.isDelegated) removeDelegatedListener(element, entry.eventName);
35
+ else if (entry.options !== void 0) element.removeEventListener(entry.eventName, entry.handler, entry.options);
36
+ else element.removeEventListener(entry.eventName, entry.handler);
37
+ } catch (error) {
38
+ cleanupErrors.push(error);
32
39
  }
33
40
  }
34
41
  try {
35
- delete host.__ASKR_INSTANCE;
36
- delete host.__ASKR_INSTANCES;
37
- delete host.__ASKR_WRAPPER_HOST;
38
- } catch {}
42
+ clearDelegatedHandlersForElement(element);
43
+ } catch (error) {
44
+ cleanupErrors.push(error);
45
+ }
39
46
  }
40
- function pruneComponentHostInstances(host, retainedInstances) {
41
- const retained = new Set(retainedInstances);
42
- const nextInstances = [];
43
- const staleInstances = /* @__PURE__ */ new Set();
44
- const retainOrMarkStale = (instance) => {
45
- if (!instance) return;
46
- if (retained.has(instance)) {
47
- if (!nextInstances.includes(instance)) nextInstances.push(instance);
48
- return;
47
+ function cleanupElementReactiveProps(element, cleanupErrors) {
48
+ if (!elementReactivePropsCleanup.has(element)) return;
49
+ const entries = [];
50
+ forEachElementReactivePropCleanup(element, (entry) => entries.push(entry));
51
+ elementReactivePropsCleanup.delete(element);
52
+ for (const entry of entries) try {
53
+ entry.cleanup();
54
+ } catch (error) {
55
+ cleanupErrors.push(error);
56
+ }
57
+ }
58
+ function cleanupElementRef(element, cleanupErrors) {
59
+ try {
60
+ removeElementRef(element);
61
+ } catch (error) {
62
+ elementRefs.delete(element);
63
+ cleanupErrors.push(error);
64
+ }
65
+ }
66
+ function cleanupElementInstances(element, retainedInstances, cleanedInstances, cleanupErrors) {
67
+ const instances = new Set(element.__ASKR_INSTANCES ?? []);
68
+ if (element.__ASKR_INSTANCE) instances.add(element.__ASKR_INSTANCE);
69
+ for (const instance of instances) {
70
+ if (retainedInstances.has(instance) || cleanedInstances.has(instance)) continue;
71
+ cleanedInstances.add(instance);
72
+ try {
73
+ cleanupComponent(instance);
74
+ } catch (error) {
75
+ cleanupErrors.push(error);
49
76
  }
50
- staleInstances.add(instance);
77
+ }
78
+ }
79
+ function clearHostMetadata(element, cleanupErrors) {
80
+ for (const property of [
81
+ "__ASKR_INSTANCE",
82
+ "__ASKR_INSTANCES",
83
+ "__ASKR_WRAPPER_HOST"
84
+ ]) try {
85
+ delete element[property];
86
+ } catch (error) {
87
+ cleanupErrors.push(error);
88
+ }
89
+ }
90
+ function pruneComponentHostInstances(host, retainedInstances) {
91
+ const hadInstanceList = Object.prototype.hasOwnProperty.call(host, "__ASKR_INSTANCES");
92
+ const hadPrimaryInstance = Object.prototype.hasOwnProperty.call(host, "__ASKR_INSTANCE");
93
+ const previousInstanceList = host.__ASKR_INSTANCES?.slice();
94
+ const previousPrimaryInstance = host.__ASKR_INSTANCE;
95
+ const previousInstances = collectHostInstances(host);
96
+ const commit = () => {
97
+ const retained = new Set(retainedInstances);
98
+ const currentInstances = collectHostInstances(host);
99
+ const nextInstances = Array.from(currentInstances).filter((instance) => retained.has(instance));
100
+ for (const instance of retained) if (instance.target === host && !nextInstances.includes(instance)) nextInstances.push(instance);
101
+ writeHostInstances(host, nextInstances);
102
+ cleanupHostInstances(Array.from(currentInstances).filter((instance) => !retained.has(instance)), "Component host pruning failed");
103
+ };
104
+ const rollback = () => {
105
+ const currentInstances = collectHostInstances(host);
106
+ try {
107
+ if (hadInstanceList) host.__ASKR_INSTANCES = previousInstanceList;
108
+ else delete host.__ASKR_INSTANCES;
109
+ if (hadPrimaryInstance) host.__ASKR_INSTANCE = previousPrimaryInstance;
110
+ else delete host.__ASKR_INSTANCE;
111
+ } catch {}
112
+ cleanupHostInstances(Array.from(currentInstances).filter((instance) => !previousInstances.has(instance)), "Provisional component host cleanup failed");
51
113
  };
52
- for (const instance of host.__ASKR_INSTANCES ?? []) retainOrMarkStale(instance);
53
- retainOrMarkStale(host.__ASKR_INSTANCE);
54
- for (const instance of staleInstances) cleanupComponent(instance);
114
+ if (!registerLifecycleTransaction({}, commit, rollback)) commit();
115
+ }
116
+ function collectHostInstances(host) {
117
+ const instances = /* @__PURE__ */ new Set();
118
+ for (const instance of host.__ASKR_INSTANCES ?? []) instances.add(instance);
119
+ if (host.__ASKR_INSTANCE) instances.add(host.__ASKR_INSTANCE);
120
+ return instances;
121
+ }
122
+ function writeHostInstances(host, instances) {
55
123
  try {
56
- if (nextInstances.length > 0) {
57
- host.__ASKR_INSTANCES = nextInstances;
58
- host.__ASKR_INSTANCE = nextInstances[0];
124
+ if (instances.length > 0) {
125
+ host.__ASKR_INSTANCES = instances;
126
+ host.__ASKR_INSTANCE = instances[0];
59
127
  } else {
60
128
  delete host.__ASKR_INSTANCES;
61
129
  delete host.__ASKR_INSTANCE;
62
130
  }
63
131
  } catch {}
64
132
  }
133
+ function cleanupHostInstances(instances, message) {
134
+ const cleanupErrors = [];
135
+ for (const instance of instances) try {
136
+ cleanupComponent(instance);
137
+ } catch (error) {
138
+ cleanupErrors.push(error);
139
+ }
140
+ if (cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, message);
141
+ }
65
142
  //#endregion
66
143
  export { cleanupDetachedComponentHost, pruneComponentHostInstances };
67
-
68
- //# sourceMappingURL=component-host-cleanup.js.map