@vibecook/ice 0.11.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/README.md +79 -50
  2. package/dist/chunk-BA7XJC27.js +2429 -0
  3. package/dist/chunk-BA7XJC27.js.map +1 -0
  4. package/dist/chunk-BKV4ZEU3.js +1 -0
  5. package/dist/chunk-BKV4ZEU3.js.map +1 -0
  6. package/dist/{chunk-VGVDJZSP.js → chunk-DYK6KNLG.js} +13206 -7387
  7. package/dist/chunk-DYK6KNLG.js.map +1 -0
  8. package/dist/chunk-ENIFIUEP.js +155 -0
  9. package/dist/chunk-ENIFIUEP.js.map +1 -0
  10. package/dist/chunk-IBWWLA6D.js +634 -0
  11. package/dist/chunk-IBWWLA6D.js.map +1 -0
  12. package/dist/{chunk-OR5FNVUE.js → chunk-JS6PG6YD.js} +398 -167
  13. package/dist/chunk-JS6PG6YD.js.map +1 -0
  14. package/dist/chunk-QXOCF56A.js +148 -0
  15. package/dist/chunk-QXOCF56A.js.map +1 -0
  16. package/dist/chunk-ZPUPBULB.js +7399 -0
  17. package/dist/chunk-ZPUPBULB.js.map +1 -0
  18. package/dist/desk-engine.js +36 -0
  19. package/dist/desk-engine.js.map +1 -0
  20. package/dist/desk-kit.js +244 -0
  21. package/dist/desk-kit.js.map +1 -0
  22. package/dist/desk-objects.js +12728 -0
  23. package/dist/desk-objects.js.map +1 -0
  24. package/dist/desk.js +469 -0
  25. package/dist/desk.js.map +1 -0
  26. package/dist/devtools.js +233 -189
  27. package/dist/devtools.js.map +1 -1
  28. package/dist/dom.js +7 -19
  29. package/dist/index.js +232 -20
  30. package/dist/kernel.js +53 -25
  31. package/dist/react.js +1045 -38
  32. package/dist/react.js.map +1 -1
  33. package/dist/types/packages/core/src/behavior/define-behavior.d.ts +11 -0
  34. package/dist/types/packages/core/src/behavior/runtime.d.ts +4 -0
  35. package/dist/types/packages/core/src/canvas/define-canvas-type.d.ts +86 -0
  36. package/dist/types/packages/core/src/canvas/define-container.d.ts +17 -0
  37. package/dist/types/packages/core/src/canvas/diagnostics.d.ts +27 -0
  38. package/dist/types/packages/core/src/canvas/engine-catalog.d.ts +70 -0
  39. package/dist/types/packages/core/src/canvas/extensions.d.ts +125 -0
  40. package/dist/types/packages/core/src/canvas/frame-behavior-host.d.ts +16 -0
  41. package/dist/types/packages/core/src/canvas/frame-preview.d.ts +79 -0
  42. package/dist/types/packages/core/src/canvas/frame-projection.d.ts +38 -0
  43. package/dist/types/packages/core/src/canvas/frame-view.d.ts +36 -0
  44. package/dist/types/packages/core/src/canvas/migrate.d.ts +14 -0
  45. package/dist/types/packages/core/src/canvas/placement.d.ts +30 -0
  46. package/dist/types/packages/core/src/canvas/presentation-transition.d.ts +100 -0
  47. package/dist/types/packages/core/src/canvas/runtime-extension-host.d.ts +16 -0
  48. package/dist/types/packages/core/src/canvas/session.d.ts +47 -0
  49. package/dist/types/packages/core/src/catalog/camera-derived.d.ts +16 -27
  50. package/dist/types/packages/core/src/catalog/desk.d.ts +326 -0
  51. package/dist/types/packages/core/src/catalog/gesture.d.ts +51 -0
  52. package/dist/types/packages/core/src/catalog/graph.d.ts +2 -2
  53. package/dist/types/packages/core/src/catalog/index.d.ts +2 -0
  54. package/dist/types/packages/core/src/catalog/pointer.d.ts +42 -0
  55. package/dist/types/packages/core/src/catalog/selection-presence.d.ts +7 -0
  56. package/dist/types/packages/core/src/catalog/settings-resources.d.ts +28 -2
  57. package/dist/types/packages/core/src/catalog/surface.d.ts +1 -0
  58. package/dist/types/packages/core/src/doc/doc-commit-sink.d.ts +18 -2
  59. package/dist/types/packages/core/src/doc/doc-kit.d.ts +21 -2
  60. package/dist/types/packages/core/src/doc/envelope.d.ts +5 -2
  61. package/dist/types/packages/core/src/doc/schema-migrate.d.ts +1 -1
  62. package/dist/types/packages/core/src/doc/version-gate.d.ts +21 -3
  63. package/dist/types/packages/core/src/engine/commit-sink.d.ts +10 -1
  64. package/dist/types/packages/core/src/engine/engine.d.ts +6 -0
  65. package/dist/types/packages/core/src/engine/frame-control.d.ts +74 -0
  66. package/dist/types/packages/core/src/engine/guests.d.ts +4 -1
  67. package/dist/types/packages/core/src/engine/world-doors.d.ts +12 -0
  68. package/dist/types/packages/core/src/facade/create-canvas-engine.d.ts +146 -13
  69. package/dist/types/packages/core/src/index.d.ts +33 -12
  70. package/dist/types/packages/core/src/input/queue.d.ts +3 -1
  71. package/dist/types/packages/core/src/interaction/install.d.ts +30 -0
  72. package/dist/types/packages/core/src/interaction/wakes.d.ts +24 -0
  73. package/dist/types/packages/core/src/nav/nav-geometry.d.ts +100 -0
  74. package/dist/types/packages/core/src/nav/nested-canvas.d.ts +47 -4
  75. package/dist/types/packages/core/src/ops/cascade.d.ts +2 -1
  76. package/dist/types/packages/core/src/ops/claims.d.ts +6 -0
  77. package/dist/types/packages/core/src/ops/insert.d.ts +4 -0
  78. package/dist/types/packages/core/src/ops/point-pick.d.ts +4 -1
  79. package/dist/types/packages/core/src/ops/sibling-order.d.ts +14 -4
  80. package/dist/types/packages/core/src/ops/tray.d.ts +48 -0
  81. package/dist/types/packages/core/src/presence/presence-kit.d.ts +5 -0
  82. package/dist/types/packages/core/src/schema/meta.d.ts +10 -0
  83. package/dist/types/packages/core/src/schema/prefab.d.ts +8 -0
  84. package/dist/types/packages/core/src/settings/defaults.d.ts +25 -6
  85. package/dist/types/packages/core/src/surface/gpu-device.d.ts +55 -0
  86. package/dist/types/packages/core/src/systems/camera-sim.d.ts +29 -0
  87. package/dist/types/packages/core/src/systems/chrome.d.ts +15 -23
  88. package/dist/types/packages/core/src/systems/drag-mods.d.ts +34 -0
  89. package/dist/types/packages/core/src/systems/held.d.ts +71 -0
  90. package/dist/types/packages/core/src/systems/insert-ghost.d.ts +2 -0
  91. package/dist/types/packages/core/src/systems/l0-input.d.ts +14 -0
  92. package/dist/types/packages/core/src/systems/l1-pick.d.ts +37 -1
  93. package/dist/types/packages/core/src/systems/l2-arbitrate.d.ts +18 -4
  94. package/dist/types/packages/core/src/systems/l3-behave.d.ts +4 -1
  95. package/dist/types/packages/core/src/systems/l3-claim.d.ts +7 -0
  96. package/dist/types/packages/core/src/systems/l3-connect.d.ts +1 -1
  97. package/dist/types/packages/core/src/systems/l3-drop.d.ts +30 -1
  98. package/dist/types/packages/core/src/systems/l3-marquee.d.ts +2 -1
  99. package/dist/types/packages/core/src/systems/l3-ports.d.ts +1 -1
  100. package/dist/types/packages/core/src/systems/l4-cursor.d.ts +5 -0
  101. package/dist/types/packages/core/src/systems/nav-flight.d.ts +85 -3
  102. package/dist/types/packages/core/src/systems/nav-tap.d.ts +44 -0
  103. package/dist/types/packages/core/src/systems/press-wheel.d.ts +11 -0
  104. package/dist/types/packages/core/src/systems/tray.d.ts +108 -0
  105. package/dist/types/packages/core/src/systems/zoom-through.d.ts +30 -0
  106. package/dist/types/packages/core/src/tools/define-tool.d.ts +10 -0
  107. package/dist/types/packages/core/src/widget/define-widget.d.ts +166 -63
  108. package/dist/types/packages/core/src/widget/equip.d.ts +14 -2
  109. package/dist/types/packages/core/src/widget/held-tools.d.ts +83 -0
  110. package/dist/types/packages/core/src/widget/menu-actions.d.ts +44 -0
  111. package/dist/types/packages/core/src/widget/mount-store.d.ts +21 -46
  112. package/dist/types/packages/core/src/widget/spawn.d.ts +1 -1
  113. package/dist/types/packages/desk/src/assets/blue-noise.gen.d.ts +10 -0
  114. package/dist/types/packages/desk/src/card/card.d.ts +103 -0
  115. package/dist/types/packages/desk/src/compose/ambient.d.ts +59 -0
  116. package/dist/types/packages/desk/src/compose/builder.d.ts +285 -0
  117. package/dist/types/packages/desk/src/compose/children.d.ts +3 -0
  118. package/dist/types/packages/desk/src/compose/index.d.ts +14 -0
  119. package/dist/types/packages/desk/src/compose/marks.d.ts +126 -0
  120. package/dist/types/packages/desk/src/compose/pick.d.ts +5 -0
  121. package/dist/types/packages/desk/src/compose/reflector.d.ts +111 -0
  122. package/dist/types/packages/desk/src/compose/tap.d.ts +5 -0
  123. package/dist/types/packages/desk/src/docs.d.ts +23 -0
  124. package/dist/types/packages/desk/src/engine/budget.d.ts +38 -0
  125. package/dist/types/packages/desk/src/engine/device.d.ts +54 -0
  126. package/dist/types/packages/desk/src/engine/index.d.ts +5 -0
  127. package/dist/types/packages/desk/src/engine/pipeline.d.ts +36 -0
  128. package/dist/types/packages/desk/src/engine/rasters.d.ts +66 -0
  129. package/dist/types/packages/desk/src/engine/records.d.ts +56 -0
  130. package/dist/types/packages/desk/src/engine/shader.d.ts +22 -0
  131. package/dist/types/packages/desk/src/engine/struct.d.ts +39 -0
  132. package/dist/types/packages/desk/src/engine/target.d.ts +26 -0
  133. package/dist/types/packages/desk/src/gpu-ablation.d.ts +61 -0
  134. package/dist/types/packages/desk/src/gpu-memory.d.ts +54 -0
  135. package/dist/types/packages/desk/src/gpu-profiler.d.ts +141 -0
  136. package/dist/types/packages/desk/src/gpu-wrap.d.ts +8 -0
  137. package/dist/types/packages/desk/src/ground.d.ts +388 -0
  138. package/dist/types/packages/desk/src/hold/focus.d.ts +53 -0
  139. package/dist/types/packages/desk/src/hold/pose.d.ts +132 -0
  140. package/dist/types/packages/desk/src/hold/shaders.d.ts +9 -0
  141. package/dist/types/packages/desk/src/host/editor.d.ts +18 -0
  142. package/dist/types/packages/desk/src/host/index.d.ts +9 -0
  143. package/dist/types/packages/desk/src/host/ink.d.ts +18 -0
  144. package/dist/types/packages/desk/src/host/layer.d.ts +430 -0
  145. package/dist/types/packages/desk/src/host/picture.d.ts +2 -0
  146. package/dist/types/packages/desk/src/host/surface.d.ts +5 -0
  147. package/dist/types/packages/desk/src/index.d.ts +13 -0
  148. package/dist/types/packages/desk/src/kind.d.ts +187 -0
  149. package/dist/types/packages/desk/src/kinds/world.d.ts +429 -0
  150. package/dist/types/packages/desk/src/kit/arrays.d.ts +88 -0
  151. package/dist/types/packages/desk/src/kit/blobs.d.ts +40 -0
  152. package/dist/types/packages/desk/src/kit/book.d.ts +2 -0
  153. package/dist/types/packages/desk/src/kit/editor.d.ts +103 -0
  154. package/dist/types/packages/desk/src/kit/eye.d.ts +37 -0
  155. package/dist/types/packages/desk/src/kit/hold.d.ts +1 -0
  156. package/dist/types/packages/desk/src/kit/index.d.ts +26 -0
  157. package/dist/types/packages/desk/src/kit/inside.d.ts +116 -0
  158. package/dist/types/packages/desk/src/kit/layer.d.ts +159 -0
  159. package/dist/types/packages/desk/src/kit/light.d.ts +3 -0
  160. package/dist/types/packages/desk/src/kit/mesh.d.ts +29 -0
  161. package/dist/types/packages/desk/src/kit/mips.d.ts +2 -0
  162. package/dist/types/packages/desk/src/kit/nav.d.ts +2 -0
  163. package/dist/types/packages/desk/src/kit/paper-tex.d.ts +5 -0
  164. package/dist/types/packages/desk/src/kit/physics.d.ts +44 -0
  165. package/dist/types/packages/desk/src/kit/place.d.ts +44 -0
  166. package/dist/types/packages/desk/src/kit/print.d.ts +30 -0
  167. package/dist/types/packages/desk/src/kit/raster.d.ts +34 -0
  168. package/dist/types/packages/desk/src/kit/sdf.d.ts +1 -0
  169. package/dist/types/packages/desk/src/kit/seeds.d.ts +11 -0
  170. package/dist/types/packages/desk/src/kit/services.d.ts +34 -0
  171. package/dist/types/packages/desk/src/kit/springs.d.ts +12 -0
  172. package/dist/types/packages/desk/src/kit/strokes.d.ts +93 -0
  173. package/dist/types/packages/desk/src/kit/text.d.ts +142 -0
  174. package/dist/types/packages/desk/src/kit/uniform.d.ts +8 -0
  175. package/dist/types/packages/desk/src/kit/view.d.ts +39 -0
  176. package/dist/types/packages/desk/src/kit/wgsl.d.ts +15 -0
  177. package/dist/types/packages/desk/src/lattice/line.d.ts +15 -0
  178. package/dist/types/packages/desk/src/lattice/lod.d.ts +52 -0
  179. package/dist/types/packages/desk/src/lattice/ruler.d.ts +88 -0
  180. package/dist/types/packages/desk/src/marks/assemble.d.ts +65 -0
  181. package/dist/types/packages/desk/src/marks/ease.d.ts +4 -0
  182. package/dist/types/packages/desk/src/marks/laser.d.ts +41 -0
  183. package/dist/types/packages/desk/src/marks/layout.d.ts +167 -0
  184. package/dist/types/packages/desk/src/marks/pass.d.ts +59 -0
  185. package/dist/types/packages/desk/src/marks/shaders.d.ts +12 -0
  186. package/dist/types/packages/desk/src/mat/grid.d.ts +50 -0
  187. package/dist/types/packages/desk/src/mat/lamp.d.ts +14 -0
  188. package/dist/types/packages/desk/src/mat/layout.d.ts +144 -0
  189. package/dist/types/packages/desk/src/mat/mat-pass.d.ts +83 -0
  190. package/dist/types/packages/desk/src/mat/night.d.ts +95 -0
  191. package/dist/types/packages/desk/src/mat/projector.d.ts +39 -0
  192. package/dist/types/packages/desk/src/mat/shaders.d.ts +17 -0
  193. package/dist/types/packages/desk/src/mat/tilt.d.ts +14 -0
  194. package/dist/types/packages/desk/src/nav/flight.d.ts +186 -0
  195. package/dist/types/packages/desk/src/nav/portal.d.ts +95 -0
  196. package/dist/types/packages/desk/src/object.d.ts +46 -0
  197. package/dist/types/packages/desk/src/pass-instrument.d.ts +89 -0
  198. package/dist/types/packages/desk/src/shaders.d.ts +12 -0
  199. package/dist/types/packages/desk/src/shaders.gen.d.ts +16 -0
  200. package/dist/types/packages/desk/src/submit-instrument.d.ts +36 -0
  201. package/dist/types/packages/desk/src/theme.d.ts +475 -0
  202. package/dist/types/packages/desk/src/tray/carry.d.ts +99 -0
  203. package/dist/types/packages/desk/src/tray/drawer.d.ts +113 -0
  204. package/dist/types/packages/desk/src/tray/flux.d.ts +46 -0
  205. package/dist/types/packages/desk/src/tray/index.d.ts +4 -0
  206. package/dist/types/packages/desk/src/tray/lattice.d.ts +71 -0
  207. package/dist/types/packages/desk/src/tray/layout.d.ts +7 -0
  208. package/dist/types/packages/desk/src/tray/look.d.ts +29 -0
  209. package/dist/types/packages/desk/src/tray/pass.d.ts +96 -0
  210. package/dist/types/packages/desk/src/tray/shaders.d.ts +10 -0
  211. package/dist/types/packages/desk/src/tray/specimens.d.ts +199 -0
  212. package/dist/types/packages/devtools/src/attach.d.ts +22 -8
  213. package/dist/types/packages/devtools/src/dock.d.ts +18 -14
  214. package/dist/types/packages/devtools/src/gpu-panel.d.ts +105 -0
  215. package/dist/types/packages/devtools/src/index.d.ts +5 -4
  216. package/dist/types/packages/dom/src/desk-host.d.ts +91 -0
  217. package/dist/types/packages/dom/src/host.d.ts +13 -14
  218. package/dist/types/packages/dom/src/index.d.ts +12 -10
  219. package/dist/types/packages/dom/src/loop.d.ts +18 -1
  220. package/dist/types/packages/dom/src/pointer-adapter.d.ts +5 -29
  221. package/dist/types/packages/dom/src/widget-focus.d.ts +17 -13
  222. package/dist/types/packages/ice/src/desk-engine.d.ts +2 -0
  223. package/dist/types/packages/ice/src/desk-kit.d.ts +6 -0
  224. package/dist/types/packages/ice/src/desk-objects.d.ts +5 -0
  225. package/dist/types/packages/ice/src/desk.d.ts +5 -0
  226. package/dist/types/packages/kernel/src/atlas-pack.d.ts +157 -0
  227. package/dist/types/packages/kernel/src/bezier.d.ts +0 -15
  228. package/dist/types/packages/kernel/src/coords.d.ts +0 -39
  229. package/dist/types/packages/kernel/src/index.d.ts +2 -2
  230. package/dist/types/packages/kernel/src/nav-flight.d.ts +6 -0
  231. package/dist/types/packages/kernel/src/tray.d.ts +155 -0
  232. package/dist/types/packages/objects/src/board/board-pass.d.ts +180 -0
  233. package/dist/types/packages/objects/src/board/board-pen.d.ts +36 -0
  234. package/dist/types/packages/objects/src/board/board.d.ts +104 -0
  235. package/dist/types/packages/objects/src/board/data.d.ts +31 -0
  236. package/dist/types/packages/objects/src/board/history.d.ts +33 -0
  237. package/dist/types/packages/objects/src/board/kind.d.ts +208 -0
  238. package/dist/types/packages/objects/src/board/layout.d.ts +102 -0
  239. package/dist/types/packages/objects/src/board/object.d.ts +7 -0
  240. package/dist/types/packages/objects/src/board/pen.d.ts +71 -0
  241. package/dist/types/packages/objects/src/board/shaders.d.ts +36 -0
  242. package/dist/types/packages/objects/src/board/stroke.d.ts +99 -0
  243. package/dist/types/packages/objects/src/board/theme.d.ts +150 -0
  244. package/dist/types/packages/objects/src/calendar/data.d.ts +97 -0
  245. package/dist/types/packages/objects/src/calendar/events.d.ts +58 -0
  246. package/dist/types/packages/objects/src/calendar/hand.d.ts +53 -0
  247. package/dist/types/packages/objects/src/calendar/host/input.d.ts +67 -0
  248. package/dist/types/packages/objects/src/calendar/host/print.d.ts +9 -0
  249. package/dist/types/packages/objects/src/calendar/kind.d.ts +297 -0
  250. package/dist/types/packages/objects/src/calendar/law.d.ts +151 -0
  251. package/dist/types/packages/objects/src/calendar/layout.d.ts +47 -0
  252. package/dist/types/packages/objects/src/calendar/month.d.ts +75 -0
  253. package/dist/types/packages/objects/src/calendar/object.d.ts +45 -0
  254. package/dist/types/packages/objects/src/calendar/pad.d.ts +42 -0
  255. package/dist/types/packages/objects/src/calendar/pass.d.ts +229 -0
  256. package/dist/types/packages/objects/src/calendar/print.d.ts +87 -0
  257. package/dist/types/packages/objects/src/calendar/printing.d.ts +80 -0
  258. package/dist/types/packages/objects/src/calendar/roll.d.ts +45 -0
  259. package/dist/types/packages/objects/src/calendar/shaders.d.ts +12 -0
  260. package/dist/types/packages/objects/src/calendar/sheet.d.ts +43 -0
  261. package/dist/types/packages/objects/src/calendar/tiles.d.ts +67 -0
  262. package/dist/types/packages/objects/src/calendar/turn.d.ts +73 -0
  263. package/dist/types/packages/objects/src/calendar/writing.d.ts +42 -0
  264. package/dist/types/packages/objects/src/index.d.ts +22 -0
  265. package/dist/types/packages/objects/src/kinds.d.ts +24 -0
  266. package/dist/types/packages/objects/src/minimat/inside.d.ts +17 -0
  267. package/dist/types/packages/objects/src/minimat/kind.d.ts +51 -0
  268. package/dist/types/packages/objects/src/minimat/layout.d.ts +83 -0
  269. package/dist/types/packages/objects/src/minimat/minimat.d.ts +179 -0
  270. package/dist/types/packages/objects/src/minimat/object.d.ts +8 -0
  271. package/dist/types/packages/objects/src/minimat/pass.d.ts +61 -0
  272. package/dist/types/packages/objects/src/minimat/shaders.d.ts +10 -0
  273. package/dist/types/packages/objects/src/minimat/theme.d.ts +98 -0
  274. package/dist/types/packages/objects/src/notebook/ink.d.ts +70 -0
  275. package/dist/types/packages/objects/src/notebook/kind.d.ts +236 -0
  276. package/dist/types/packages/objects/src/notebook/law.d.ts +129 -0
  277. package/dist/types/packages/objects/src/notebook/layout.d.ts +46 -0
  278. package/dist/types/packages/objects/src/notebook/leaf.d.ts +44 -0
  279. package/dist/types/packages/objects/src/notebook/mesh.d.ts +20 -0
  280. package/dist/types/packages/objects/src/notebook/motion.d.ts +107 -0
  281. package/dist/types/packages/objects/src/notebook/object.d.ts +8 -0
  282. package/dist/types/packages/objects/src/notebook/pages.d.ts +56 -0
  283. package/dist/types/packages/objects/src/notebook/pass.d.ts +197 -0
  284. package/dist/types/packages/objects/src/notebook/pick.d.ts +30 -0
  285. package/dist/types/packages/objects/src/notebook/raster.d.ts +28 -0
  286. package/dist/types/packages/objects/src/notebook/shaders.d.ts +11 -0
  287. package/dist/types/packages/objects/src/notebook/shape.d.ts +155 -0
  288. package/dist/types/packages/objects/src/notebook/theme.d.ts +76 -0
  289. package/dist/types/packages/objects/src/palette.d.ts +577 -0
  290. package/dist/types/packages/objects/src/paper/host/body.d.ts +30 -0
  291. package/dist/types/packages/objects/src/paper/kind.d.ts +81 -0
  292. package/dist/types/packages/objects/src/paper/layout.d.ts +73 -0
  293. package/dist/types/packages/objects/src/paper/object.d.ts +31 -0
  294. package/dist/types/packages/objects/src/paper/pages.d.ts +43 -0
  295. package/dist/types/packages/objects/src/paper/paper-pass.d.ts +86 -0
  296. package/dist/types/packages/objects/src/paper/paper.d.ts +117 -0
  297. package/dist/types/packages/objects/src/paper/shaders.d.ts +18 -0
  298. package/dist/types/packages/objects/src/paper/theme.d.ts +58 -0
  299. package/dist/types/packages/objects/src/paper/typing.d.ts +51 -0
  300. package/dist/types/packages/objects/src/paper/writing.d.ts +161 -0
  301. package/dist/types/packages/objects/src/photo/carry.d.ts +33 -0
  302. package/dist/types/packages/objects/src/photo/kind.d.ts +136 -0
  303. package/dist/types/packages/objects/src/photo/layout.d.ts +39 -0
  304. package/dist/types/packages/objects/src/photo/object.d.ts +5 -0
  305. package/dist/types/packages/objects/src/photo/photo-pass.d.ts +104 -0
  306. package/dist/types/packages/objects/src/photo/photo.d.ts +262 -0
  307. package/dist/types/packages/objects/src/photo/pictures.d.ts +152 -0
  308. package/dist/types/packages/objects/src/photo/sample.d.ts +9 -0
  309. package/dist/types/packages/objects/src/photo/shaders.d.ts +18 -0
  310. package/dist/types/packages/objects/src/preset.d.ts +44 -0
  311. package/dist/types/packages/objects/src/shaders.d.ts +3 -0
  312. package/dist/types/packages/objects/src/shaders.gen.d.ts +21 -0
  313. package/dist/types/packages/react/src/canvas-hooks.d.ts +12 -0
  314. package/dist/types/packages/react/src/desk.d.ts +56 -0
  315. package/dist/types/packages/react/src/engine-context.d.ts +2 -2
  316. package/dist/types/packages/react/src/frame-preview-boundary.d.ts +19 -0
  317. package/dist/types/packages/react/src/hooks.d.ts +9 -14
  318. package/dist/types/packages/react/src/index.d.ts +16 -9
  319. package/dist/types/packages/react/src/keymap.d.ts +21 -2
  320. package/dist/types/packages/react/src/selection-menu.d.ts +171 -0
  321. package/dist/types/packages/react/src/tray-bar.d.ts +124 -0
  322. package/package.json +64 -31
  323. package/dist/chunk-2TNVB2ON.js +0 -1163
  324. package/dist/chunk-2TNVB2ON.js.map +0 -1
  325. package/dist/chunk-OR5FNVUE.js.map +0 -1
  326. package/dist/chunk-Q665T4L7.js +0 -681
  327. package/dist/chunk-Q665T4L7.js.map +0 -1
  328. package/dist/chunk-VGVDJZSP.js.map +0 -1
  329. package/dist/ground.js +0 -1108
  330. package/dist/ground.js.map +0 -1
  331. package/dist/r3f.js +0 -1644
  332. package/dist/r3f.js.map +0 -1
  333. package/dist/types/packages/core/src/input/measure-queue.d.ts +0 -30
  334. package/dist/types/packages/core/src/settings/ground-config.d.ts +0 -101
  335. package/dist/types/packages/core/src/systems/measure-ingest.d.ts +0 -26
  336. package/dist/types/packages/devtools/src/gl-panel.d.ts +0 -69
  337. package/dist/types/packages/dom/src/measure-adapter.d.ts +0 -31
  338. package/dist/types/packages/dom/src/measure-wiring.d.ts +0 -49
  339. package/dist/types/packages/dom/src/planes.d.ts +0 -33
  340. package/dist/types/packages/dom/src/reflectors/chrome.d.ts +0 -33
  341. package/dist/types/packages/dom/src/reflectors/dom-widgets.d.ts +0 -59
  342. package/dist/types/packages/dom/src/reflectors/graybox.d.ts +0 -31
  343. package/dist/types/packages/dom/src/reflectors/plane-transform.d.ts +0 -38
  344. package/dist/types/packages/ground/src/index.d.ts +0 -69
  345. package/dist/types/packages/ground/src/layer.d.ts +0 -40
  346. package/dist/types/packages/ground/src/pass.d.ts +0 -41
  347. package/dist/types/packages/ground/src/passes/grid-contract.d.ts +0 -28
  348. package/dist/types/packages/ground/src/passes/grid-magnet-pass.d.ts +0 -2
  349. package/dist/types/packages/ground/src/passes/grid-magnet.d.ts +0 -31
  350. package/dist/types/packages/ground/src/passes/grid.d.ts +0 -10
  351. package/dist/types/packages/ground/src/passes/guides-collect.d.ts +0 -14
  352. package/dist/types/packages/ground/src/passes/guides.d.ts +0 -3
  353. package/dist/types/packages/ground/src/passes/magnet-collect.d.ts +0 -63
  354. package/dist/types/packages/ground/src/passes/soup-collect.d.ts +0 -35
  355. package/dist/types/packages/ground/src/passes/soup-mesh.d.ts +0 -8
  356. package/dist/types/packages/ground/src/passes/wires-collect.d.ts +0 -35
  357. package/dist/types/packages/ground/src/passes/wires.d.ts +0 -10
  358. package/dist/types/packages/ground/src/poles.d.ts +0 -47
  359. package/dist/types/packages/ground/src/renderer.d.ts +0 -15
  360. package/dist/types/packages/ice/src/ground.d.ts +0 -1
  361. package/dist/types/packages/ice/src/r3f.d.ts +0 -1
  362. package/dist/types/packages/kernel/src/eviction.d.ts +0 -23
  363. package/dist/types/packages/kernel/src/zoom-bands.d.ts +0 -19
  364. package/dist/types/packages/r3f/src/bridge.d.ts +0 -129
  365. package/dist/types/packages/r3f/src/composite-material.d.ts +0 -26
  366. package/dist/types/packages/r3f/src/compositor-pass.d.ts +0 -105
  367. package/dist/types/packages/r3f/src/dev-write-trap.d.ts +0 -30
  368. package/dist/types/packages/r3f/src/gl-root.d.ts +0 -96
  369. package/dist/types/packages/r3f/src/gl-router.d.ts +0 -70
  370. package/dist/types/packages/r3f/src/index.d.ts +0 -17
  371. package/dist/types/packages/r3f/src/island-state.d.ts +0 -112
  372. package/dist/types/packages/r3f/src/island.d.ts +0 -13
  373. package/dist/types/packages/r3f/src/pool.d.ts +0 -56
  374. package/dist/types/packages/r3f/src/preview-capture.d.ts +0 -19
  375. package/dist/types/packages/r3f/src/resource-registry.d.ts +0 -30
  376. package/dist/types/packages/r3f/src/self-sustain.d.ts +0 -39
  377. package/dist/types/packages/r3f/src/use-island-frame.d.ts +0 -39
  378. package/dist/types/packages/react/src/infinite-canvas.d.ts +0 -140
  379. package/dist/types/packages/react/src/preview-snapshots.d.ts +0 -17
  380. package/dist/types/packages/react/src/widget-preview.d.ts +0 -14
  381. package/dist/types/packages/react/src/widget-root.d.ts +0 -33
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../dom/src/host.ts","../../dom/src/loop.ts","../../dom/src/input-ownership.ts","../../dom/src/pointer-adapter.ts","../../dom/src/reflectors/cursor.ts","../../dom/src/reflectors/remote-cursors.ts","../../dom/src/widget-focus.ts","../../dom/src/desk-host.ts","../../dom/src/index.ts"],"sourcesContent":["/**\n * The canvas host (design-004 §1, host pipeline; SCREEN SPACE ONLY since design-015 D5b).\n *\n * The container is styled to be a stable, gesture-clean viewport: `relative` so\n * absolutely-positioned children (the desk's canvas, the one focused editor, the\n * remote-cursor plane, the app's screen-space chrome) anchor to it,\n * `overflow:hidden` to clip them, `touch-action:none` + `user-select:none` so\n * browser scroll/zoom and text selection never fight the interaction stack.\n *\n * THE CONTENT PLANE IS GONE (design-015 §2 law 2). Until D5b the host also made\n * one camera-transformed `<div>` — M3's \"content plane\", the P1 every DOM\n * widget mounted in, carrying the camera as ONE CSS transform written by the\n * plane-transform reflector (kernel `planeCssTransform`, gone since D7). No DOM element\n * carries a camera transform any more: everything under the camera is the\n * desk renderer's, and the DOM that remains is screen-space.\n */\n\nexport interface CanvasHost {\n /** The app-provided viewport element (styled, not created, by the host). */\n readonly container: HTMLElement;\n /** Clear the inline styles the host wrote. */\n dispose(): void;\n}\n\n/** The container styles the host owns unconditionally (cleared on dispose). */\nconst CONTAINER_STYLE: Readonly<Record<string, string>> = {\n overflow: \"hidden\",\n touchAction: \"none\",\n userSelect: \"none\",\n};\n\nexport function createCanvasHost(container: HTMLElement): CanvasHost {\n // The children need the container to be a POSITIONED containing block — but\n // `absolute`/`fixed` already qualify, so only promote a `static` container\n // to `relative`. Stomping an app's `position: absolute` with inline\n // `relative` collapses the common `#app { position: absolute; inset: 0 }`\n // sizing pattern to zero height (inset offsets a relative box, it does not\n // size it), and the host's own overflow:hidden then clips everything.\n // Inline style first (authoritative and environment-independent), computed\n // second (catches stylesheet rules like `#app { position: absolute }`).\n const view = container.ownerDocument.defaultView;\n const position =\n container.style.position !== \"\"\n ? container.style.position\n : (view?.getComputedStyle(container).position ?? \"\");\n const promoteToRelative = position === \"\" || position === \"static\";\n if (promoteToRelative) container.style.position = \"relative\";\n // Record each host-owned property's prior inline value BEFORE overwriting it,\n // so dispose restores what the caller set (e.g. an inline overflow:auto) rather\n // than blanket-clearing it. Empty string = the caller had no inline value here.\n const priorContainerStyle = Object.keys(CONTAINER_STYLE).map((prop) => {\n // camelCase → kebab-case for the CSSOM property API (touchAction → touch-action).\n const cssName = prop.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);\n return [cssName, container.style.getPropertyValue(cssName)] as const;\n });\n Object.assign(container.style, CONTAINER_STYLE);\n\n return {\n container,\n dispose() {\n if (promoteToRelative) container.style.removeProperty(\"position\");\n for (const [cssName, prior] of priorContainerStyle) {\n // Restore the caller's prior inline value, or clear the host's if the\n // caller had none.\n if (prior !== \"\") container.style.setProperty(cssName, prior);\n else container.style.removeProperty(cssName);\n }\n },\n };\n}\n","/**\n * The rAF frame loop (design-002 §1: core is scheduler-free — the DOM package\n * owns the loop; core never touches the platform).\n *\n * Drives `engine.step(now)` once per animation frame, threading the rAF\n * timestamp straight into the frame clock (so FrameInfo.dt is real wall time,\n * clamped in core). The returned stop fn cancels the pending frame AND latches\n * so a frame already in flight cannot re-schedule — calling it is idempotent.\n *\n * THE FREEZE GATE (2026-08-04). Before each frame the loop claims a step from\n * `engine.frame`. While a freeze is held the gate walks its settle and then\n * refuses, at which point the loop PARKS: it stops scheduling rAF at all\n * rather than spinning a callback that does nothing — \"the engine is stopped\"\n * should mean the browser has no work queued for it either. Thaw arrives\n * through the gate's change subscription, which schedules the next frame.\n *\n * The dt clamp is what makes resume safe: a freeze that lasted an hour hands\n * `step` an enormous `now`, and core clamps the delta (frame-info.ts), so\n * tweens advance by one ordinary frame instead of teleporting to their end.\n *\n * THE LOOP OUTLIVES A THROWING STEP (2026-08-15, petition I14). Until this fix\n * the reschedule sat on the line AFTER `engine.step(now)`, so ONE throw from a\n * publish hook (which propagate loudly by design — engine.ts) escaped the rAF\n * callback, left `handle` un-renewed, and killed the canvas PERMANENTLY: with\n * `parked` still false, `wake` early-returns forever, so even freeze/thaw could\n * not restart it. Recovery needed a fresh `startRafLoop`. The next frame is now\n * scheduled in a `finally`, so a faulting frame is loud but survivable — the\n * throw still reaches the browser's error handler; only the death is gone.\n *\n * BEFORE EACH STEP (2026-09-27, ICE M21 K1): an optional `beforeStep` — where a host reads what the\n * platform changes without an event it can hear (the device's ratio: `createDeskHost`). It runs\n * only for a step that runs (never while parked), and inside the same `try`, so a throwing hook is\n * as survivable as a throwing step.\n *\n * THE SLEEP (2026-09-27, ICE M21 K7a — `@ice/core`'s frame-control.ts): with `sleep`, the loop asks\n * the frame gate after every step when the next one is due, and SLEEPS when it is not the next\n * frame — no rAF queued, and a timer only when a registered wake names a time (a flight, a caret's\n * blink, a layer let go). A wake (an input, a write from outside a step, a document's or a room's\n * arrival, a desk's flux) restarts it in the next frame; so does a freeze, whose settle walk needs\n * steps. A desk at rest then costs the main thread nothing at all (design-015 §11.4). Without\n * `sleep` the loop steps every frame, as it always did.\n */\nimport type { Engine } from \"@ice/core\";\n\nexport interface RafLoopOptions {\n /** Sleep when the engine is quiet (K7a): no frame scheduled until a wake or a registered time. Default false. */\n readonly sleep?: boolean;\n}\n\nexport function startRafLoop(engine: Engine, beforeStep?: (now: number) => void, opts: RafLoopOptions = {}): () => void {\n const sleepy = opts.sleep === true;\n const frame = engine.frame;\n let handle = 0;\n let stopped = false;\n let parked = false;\n let asleep = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n const tick = (now: number): void => {\n if (stopped) return;\n if (!frame.claimStep()) {\n // Park: no step, and deliberately no reschedule. `wake` owns the restart.\n parked = true;\n handle = 0;\n return;\n }\n try {\n beforeStep?.(now);\n engine.step(now);\n } finally {\n // Re-checked AFTER the body: a `stop()` called from inside the step\n // (a publish hook, a reflector) must still win, or the loop would\n // resurrect itself past its own stopper.\n if (!stopped) schedule();\n }\n };\n\n /** After a step: the next frame, or sleep — until a wake, or the soonest registered time. */\n const schedule = (): void => {\n if (!sleepy) {\n handle = requestAnimationFrame(tick);\n return;\n }\n const t = performance.now();\n const due = frame.nextStep(t);\n if (due <= t) {\n handle = requestAnimationFrame(tick);\n return;\n }\n handle = 0;\n asleep = true;\n frame.sleeping(true);\n if (due !== Number.POSITIVE_INFINITY) timer = setTimeout(() => rise(true), Math.max(0, due - t));\n };\n\n /** Out of the sleep: the next frame steps (`timed`: for a registered time alone). */\n const rise = (timed: boolean): void => {\n if (stopped || !asleep) return;\n asleep = false;\n if (timer !== undefined) clearTimeout(timer);\n timer = undefined;\n frame.sleeping(false, timed);\n handle = requestAnimationFrame(tick);\n };\n\n // (a freeze taken while the loop sleeps rises it through the world's doors — the freeze writes its `FrameMode` mirror — so its\n // settle walk has the steps it needs; the sleep test pins it)\n const wake = (): void => {\n if (stopped || !parked || frame.isFrozen()) return;\n parked = false;\n handle = requestAnimationFrame(tick);\n };\n const unsubscribe = frame.onChange(wake);\n const unsubscribeWake = sleepy ? frame.onWake(() => rise(false)) : undefined;\n\n handle = requestAnimationFrame(tick);\n\n return () => {\n stopped = true;\n unsubscribe();\n unsubscribeWake?.();\n if (timer !== undefined) clearTimeout(timer);\n if (asleep) frame.sleeping(false);\n cancelAnimationFrame(handle);\n };\n}\n","/**\n * Input-ownership predicates (design-007 §4 — one predicate FAMILY, not one\n * predicate; petitions I1/I4). \"Does the widget own input here\" is answered\n * per-surface at the right scope, sharing the DOM-walk mechanics:\n *\n * - `isEditableTarget` — the 4-class editable gate (keymap default + the\n * adapter's Space-types fix). Kept narrow so UNDECLARED widgets behave\n * exactly as before (design-007 F5).\n * - `keyboardClaimOf` — the `data-canvas-keyboard` claim marker written by the\n * dom-widgets reflector for `interaction.keyboard: \"exclusive\"` widgets.\n * Read UNBOUNDED (page-global) on purpose: `document.activeElement` is one\n * per page, so engine B's keymap must stand down while you type into engine\n * A's claiming widget (design-007 F2 — only the DOM is page-global).\n * - `wheelCede` — the NARROW, DYNAMIC scroll opt-out (design-007 §3.4/§4):\n * plain wheel cedes to native scroll only when a scroller WITH ROOM in the\n * wheel's dominant axis sits inside a claim-marked / `data-canvas-\n * interactive` / editable subtree. At the scroll bounds the predicate turns\n * false and the wheel falls through to canvas pan/zoom — the familiar\n * nested-scroll feel — which also keeps scroll-chaining from ever reaching\n * the page. Deliberately NOT the full `crossesInteractive` set: hovering a\n * bare `<button>` must not kill canvas zoom (design-007 F4).\n *\n * The keymap (`@ice/react`) imports these — the two historically disagreeing\n * guards now share one implementation (the I1 unification).\n */\n\n/** The claim marker the dom-widgets reflector writes on an exclusive widget's host. */\nexport const KEYBOARD_CLAIM_ATTR = \"data-canvas-keyboard\";\n\n/** Marker value for `keyboardEscape: \"widget\"` (the widget receives even Escape). */\nexport const CLAIM_OWNS_ESCAPE = \"escape\";\n\nexport interface KeyboardClaim {\n /** The event-target chain crosses a claim marker (⇒ engine keyboard stands down). */\n readonly claimed: boolean;\n /** The claiming widget owns Escape too (`keyboardEscape: \"widget\"`). */\n readonly ownsEscape: boolean;\n}\n\nconst NO_CLAIM: KeyboardClaim = { claimed: false, ownsEscape: false };\n\n/** The keymap's editable gate — exactly INPUT/TEXTAREA/SELECT/contentEditable. */\nexport function isEditableTarget(target: EventTarget | null): boolean {\n if (target === null || !(target instanceof HTMLElement)) return false;\n const tag = target.tagName;\n return tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\" || target.isContentEditable;\n}\n\n/**\n * Resolve the keyboard claim for an event target (keydown targets ARE\n * `document.activeElement`, so this reads browser focus — the single source of\n * truth, design-007 §2.1). Unbounded `closest` by design (see header).\n */\nexport function keyboardClaimOf(target: EventTarget | null): KeyboardClaim {\n if (!(target instanceof Element)) return NO_CLAIM;\n const marked = target.closest(`[${KEYBOARD_CLAIM_ATTR}]`);\n if (marked === null) return NO_CLAIM;\n return { claimed: true, ownsEscape: marked.getAttribute(KEYBOARD_CLAIM_ATTR) === CLAIM_OWNS_ESCAPE };\n}\n\n/**\n * The scroll-opt-out subtree roots (design-007 §4 `crossesScrollable` — the\n * narrow set): the claim marker, the explicit interactive opt-in, and real\n * editable scrollers. NOT bare button/a/media.\n */\nconst SCROLL_OPT_OUT_SELECTOR =\n `[${KEYBOARD_CLAIM_ATTR}], [data-canvas-interactive], input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]`;\n\n/** Sub-pixel tolerance for fractional scroll positions. */\nconst SCROLL_EPS = 1;\n\n/** The element can consume this wheel's dominant-axis delta RIGHT NOW (overflow + room). */\nfunction hasScrollRoom(el: HTMLElement, dx: number, dy: number): boolean {\n const style = el.ownerDocument.defaultView?.getComputedStyle(el);\n if (style === undefined || style === null) return false;\n if (Math.abs(dy) >= Math.abs(dx)) {\n if (dy === 0) return false;\n const oy = style.overflowY;\n if (oy !== \"auto\" && oy !== \"scroll\") return false;\n if (el.scrollHeight <= el.clientHeight + SCROLL_EPS) return false;\n return dy > 0 ? el.scrollTop + el.clientHeight < el.scrollHeight - SCROLL_EPS : el.scrollTop > SCROLL_EPS;\n }\n if (dx === 0) return false;\n const ox = style.overflowX;\n if (ox !== \"auto\" && ox !== \"scroll\") return false;\n if (el.scrollWidth <= el.clientWidth + SCROLL_EPS) return false;\n return dx > 0 ? el.scrollLeft + el.clientWidth < el.scrollWidth - SCROLL_EPS : el.scrollLeft > SCROLL_EPS;\n}\n\n/**\n * Should this plain (non-pinch) wheel be ceded to native widget scroll?\n * Walks target → container: remembers any scroller-with-room, cedes on the\n * first opt-out root at or above it. Walking up meets scrollers BEFORE their\n * widget's marker (the marker sits on the host), so \"a scroller inside an\n * opt-out subtree\" is exactly \"saw a scroller by the time the marker matches\".\n * ctrl/pinch wheels never reach this — they are ALWAYS the canvas's zoom.\n */\nexport function wheelCede(\n target: EventTarget | null,\n container: HTMLElement,\n dx: number,\n dy: number,\n): boolean {\n if (!(target instanceof Element)) return false;\n if (dx === 0 && dy === 0) return false;\n let sawScrollableRoom = false;\n for (let el: Element | null = target; el !== null && el !== container; el = el.parentElement) {\n if (el instanceof HTMLElement && hasScrollRoom(el, dx, dy)) sawScrollableRoom = true;\n if (sawScrollableRoom && el.matches(SCROLL_OPT_OUT_SELECTOR)) return true;\n }\n return false;\n}\n","/**\n * The real L0 pointer adapter (design-003 §2–§3; replaces the M3 demo-input scaffold).\n *\n * Translates DOM pointer / wheel / keyboard events into normalized `InputEvent`s\n * and ONLY enqueues them (Law 2: adapters enqueue, they never touch the world —\n * this file imports no ECS state and writes nothing). `pointerIngest` drains the\n * queue once per tick and turns the facts into world state.\n *\n * Details that matter:\n * - stable pointer ids: `\"mouse\"` for the one mouse, `\"touch:<pointerId>\"` per\n * contact, `\"pen\"` — ingest keys pointer entities off these (design-003 §2);\n * - container-relative CSS px (the kernel screen space) via getBoundingClientRect;\n * - `setPointerCapture` on down so a drag keeps delivering outside the element;\n * - Space is the pan modifier (design-003 §4.4): tracked here and threaded onto\n * every event's `mods.space`; keydown/keyup emit a `key` fact only when the\n * modifier tuple actually changes. Space's preventDefault/latch is OWNERSHIP-\n * AWARE (design-007 §3.4, petition I1): into an editable it neither latches\n * nor preventDefaults (Space must TYPE — the §1.6 live-bug fix); into a\n * `data-canvas-keyboard` claim it cedes the pan SEMANTICS but keeps killing\n * the page-scroll default (the key still reaches the widget's own listener —\n * preventDefault is not stopPropagation); elsewhere it pans, as ever;\n * - wheel: ctrl-wheel / trackpad pinch is ALWAYS `preventDefault` + the canvas\n * zoom signal (`wheel.pinch`) — a browser page-zoom over a widget is\n * catastrophic, claimed or not. A PLAIN wheel over a scroller-with-room\n * inside a claim/`data-canvas-interactive`/editable subtree (`wheelCede`,\n * design-007 §3.4/§3.5) is ceded: NO preventDefault (native scroll\n * proceeds), the fact still lands flagged `wheelHandled` so ingest stamps\n * the one-tick `WheelHandled` and the wheel recognizers skip the tick. At\n * the scroll bounds the predicate flips and the wheel falls through to\n * canvas pan/zoom. Everything else: `preventDefault`, dx/dy (deltaMode\n * lines → px ×16) — unchanged;\n * - window blur enqueues a synthetic `cancel` for every pointer still down\n * (design-003 §8) — the browser will not send the pointerups.\n *\n * Widget opt-out (the pinned widget-event contract, design-002 §8 / design-004 §4):\n * on `pointerdown` ONLY, if the event's target chain (up to the container) crosses\n * a native interactive (input/textarea/select/button/a[href]/contenteditable/\n * media[controls]) or an explicit `[data-canvas-interactive]`, the down fact is\n * flagged `surfaceHandled: true` — the fact still lands (the one input path is\n * absolute), but recognizer-spawn/arbitration skip it (`HandledByWidget` flows\n * through L0). `stopPropagation()` inside widget content is the OTHER boundary:\n * a stopped event never reaches the container listener, so it never becomes a\n * canvas fact at all — that is the design, not a gap.\n *\n * Hover-time amendment (design-002 §8, 2026-07-18): down/move facts ALSO carry\n * `overInteractive` — the same `crossesInteractive` check, run at hover time —\n * so the world can telegraph the opt-out BEFORE a down (cursor affordances).\n * (Until design-015 D5b the GL router's hover verdict was OR'd in; the GL\n * route left with the islands it picked.) It never gates gestures:\n * `surfaceHandled` stays down-only and keeps its exact meaning. During a\n * container-captured drag every event retargets to the container, so\n * `overInteractive` reads false mid-gesture — correct: the gesture owns the\n * pointer, not the widget under it.\n */\nimport { NO_MODS, type InputEvent, type InputMods, type InputQueue } from \"@ice/core\";\nimport type { CanvasHost } from \"./host\";\nimport { isEditableTarget, keyboardClaimOf, wheelCede } from \"./input-ownership\";\n\n/** DOM_DELTA_LINE → px (one wheel \"line\" ≈ 16px; matches typical browser mapping). */\nconst WHEEL_LINE_PX = 16;\n\n/**\n * Elements whose `pointerdown` is the widget's, not the canvas's (design-002 §8).\n * `contenteditable=\"\"` (bare attribute) and `=\"true\"` are editable; `=\"false\"` is\n * not. Media only opts out WITH visible controls.\n */\nconst INTERACTIVE_SELECTOR =\n 'input, textarea, select, button, a[href], [contenteditable=\"\"], [contenteditable=\"true\"], audio[controls], video[controls], [data-canvas-interactive]';\n\n/** True if `target`'s ancestor chain, up to but excluding `container`, holds an interactive surface. */\nfunction crossesInteractive(target: EventTarget | null, container: HTMLElement): boolean {\n if (!(target instanceof Element)) return false;\n const match = target.closest(INTERACTIVE_SELECTOR);\n // `closest` walks to the document root; bound it to inside the canvas so an\n // interactive ANCESTOR of the container (unusual, but legal) does not count.\n return match !== null && container.contains(match);\n}\n\nfunction pointerIdOf(e: PointerEvent): string {\n if (e.pointerType === \"touch\") return `touch:${e.pointerId}`;\n if (e.pointerType === \"pen\") return \"pen\";\n return \"mouse\";\n}\n\nfunction deviceOf(e: PointerEvent): InputEvent[\"device\"] {\n if (e.pointerType === \"touch\") return \"touch\";\n if (e.pointerType === \"pen\") return \"pen\";\n return \"mouse\";\n}\n\nexport function attachPointerAdapter(host: CanvasHost, queue: InputQueue): () => void {\n const { container } = host;\n const view = container.ownerDocument.defaultView;\n\n let spaceHeld = false;\n // Pointers currently down — blur-cancel sweep + DEFERRED-CAPTURE state.\n // Capture timing (field report 2026-07-12, v1's click-vs-drag discrimination):\n // capturing on DOWN retargets the derived `click`/`dblclick` to the container,\n // killing every widget-body handler (todo rows, folder double-click). So:\n // - GL-claimed downs capture IMMEDIATELY (the router synthesizes its own\n // clicks; island drags must keep delivering outside the element);\n // - native-interactive downs NEVER capture (the engine ignores them);\n // - everything else captures on the FIRST held-button move past a 4px slop\n // — below every recognizer dead zone, so a drag is always captured\n // before it can activate, while a clean tap never captures at all.\n const live = new Map<\n string,\n {\n device: InputEvent[\"device\"];\n x: number;\n y: number;\n downX: number;\n downY: number;\n native: boolean;\n captured: boolean;\n }\n >();\n const CAPTURE_SLOP_PX = 4;\n\n const capture = (pointerId: number): void => {\n if (typeof container.setPointerCapture !== \"function\") return;\n try {\n container.setPointerCapture(pointerId);\n } catch {\n // capture is best-effort — a detached or unsupported target must not throw here.\n }\n };\n // Last emitted keyboard tuple — emit a `key` fact only when it actually changes.\n let lastMods = { shift: false, ctrl: false, alt: false, meta: false, space: false };\n\n const relative = (clientX: number, clientY: number): { x: number; y: number } => {\n const rect = container.getBoundingClientRect();\n return { x: clientX - rect.left, y: clientY - rect.top };\n };\n\n const pointerMods = (e: PointerEvent | WheelEvent): InputMods => ({\n shift: e.shiftKey,\n ctrl: e.ctrlKey,\n alt: e.altKey,\n meta: e.metaKey,\n space: spaceHeld,\n });\n\n const onPointerDown = (e: PointerEvent): void => {\n const id = pointerIdOf(e);\n const device = deviceOf(e);\n const { x, y } = relative(e.clientX, e.clientY);\n // Widget opt-out: down on a native interactive / [data-canvas-interactive]\n // flags the fact so recognizers skip it (design-002 §8).\n const native = crossesInteractive(e.target, container);\n live.set(id, { device, x, y, downX: x, downY: y, native, captured: false });\n const surfaceHandled = native;\n queue.enqueue({\n kind: \"down\",\n pointerId: id,\n device,\n screenX: x,\n screenY: y,\n buttons: e.buttons,\n mods: pointerMods(e),\n tMs: e.timeStamp,\n ...(surfaceHandled ? { surfaceHandled: true } : {}),\n // The down IS a hover-bearing fact: a touch's first event must seed the\n // pointer's OverInteractive truth (no prior moves exist to).\n overInteractive: surfaceHandled,\n });\n };\n\n const onPointerMove = (e: PointerEvent): void => {\n const id = pointerIdOf(e);\n const device = deviceOf(e);\n const { x, y } = relative(e.clientX, e.clientY);\n let seen = live.get(id);\n // ADOPTED-gesture hardening (ops.insertByDrag, 2026-07-19): a held-button\n // move for a pointer whose down we never saw means widget content started\n // the gesture and handed it to the engine (the tray tile stopPropagation'd\n // its down — the sanctioned boundary). Track it from HERE so the deferred\n // capture below still takes the pointer before it can leave the window\n // mid-drag, and the blur sweep knows to cancel it. Gated off interactive\n // targets: a move over opted-out content (text selection in a widget's\n // input, the tray panel itself) must never trigger a container capture.\n if (seen === undefined && e.buttons !== 0 && !crossesInteractive(e.target, container)) {\n seen = { device, x, y, downX: x, downY: y, native: false, captured: false };\n live.set(id, seen);\n }\n if (seen !== undefined) {\n seen.x = x;\n seen.y = y;\n // Deferred capture: a real drag is forming — take it before any\n // recognizer dead zone (>=8px) can activate.\n if (\n !seen.captured &&\n !seen.native &&\n e.buttons !== 0 &&\n Math.hypot(x - seen.downX, y - seen.downY) > CAPTURE_SLOP_PX\n ) {\n capture(e.pointerId);\n seen.captured = true;\n }\n }\n queue.enqueue({\n kind: \"move\",\n pointerId: id,\n device,\n screenX: x,\n screenY: y,\n buttons: e.buttons,\n mods: pointerMods(e),\n tMs: e.timeStamp,\n // Hover fact, every move: the DOM chain check.\n overInteractive: crossesInteractive(e.target, container),\n });\n };\n\n const endPointer =\n (kind: \"up\" | \"cancel\") =>\n (e: PointerEvent): void => {\n const id = pointerIdOf(e);\n const device = deviceOf(e);\n const { x, y } = relative(e.clientX, e.clientY);\n live.delete(id);\n if (typeof container.releasePointerCapture === \"function\") {\n try {\n container.releasePointerCapture(e.pointerId);\n } catch {\n // release is best-effort (capture may already be gone).\n }\n }\n queue.enqueue({\n kind,\n pointerId: id,\n device,\n screenX: x,\n screenY: y,\n buttons: e.buttons,\n mods: pointerMods(e),\n // No overInteractive stamp: a capture-retargeted up reads the container,\n // not the content under the pointer — the next real move re-truths it.\n });\n };\n const onPointerUp = endPointer(\"up\");\n const onPointerCancel = endPointer(\"cancel\");\n\n const onWheel = (e: WheelEvent): void => {\n const { x, y } = relative(e.clientX, e.clientY);\n const scale = e.deltaMode === 1 ? WHEEL_LINE_PX : 1; // DOM_DELTA_LINE → px\n if (e.ctrlKey) {\n // Pinch/ctrl-wheel: ALWAYS the canvas's zoom (design-007 F4) — the\n // browser's page pinch-zoom must never fire, claimed content or not.\n e.preventDefault();\n queue.enqueue({ kind: \"wheel\", pointerId: \"mouse\", device: \"mouse\", screenX: x, screenY: y, buttons: e.buttons, mods: pointerMods(e), wheel: { dx: 0, dy: 0, pinch: e.deltaY } });\n return;\n }\n const wheel = { dx: e.deltaX * scale, dy: e.deltaY * scale, pinch: 0 };\n if (wheelCede(e.target, container, e.deltaX, e.deltaY)) {\n // Ceded to widget scroll (I4): no preventDefault — native scroll consumes\n // the deltas. The fact still lands (the one input path is absolute),\n // flagged so recognizers treat the tick as wheel silence. The room-check\n // in wheelCede means an at-bounds scroller falls through to the branch\n // below — and scroll-chaining can never escape to the page.\n queue.enqueue({ kind: \"wheel\", pointerId: \"mouse\", device: \"mouse\", screenX: x, screenY: y, buttons: e.buttons, mods: pointerMods(e), wheel, wheelHandled: true });\n return;\n }\n e.preventDefault(); // own zoom/pan — never let the page scroll\n queue.enqueue({ kind: \"wheel\", pointerId: \"mouse\", device: \"mouse\", screenX: x, screenY: y, buttons: e.buttons, mods: pointerMods(e), wheel });\n };\n\n /** Emit a `key` fact iff the modifier tuple changed (design-003 §2 minimal keyboard). */\n const emitKeyIfChanged = (e: KeyboardEvent): void => {\n const mods: InputMods = { shift: e.shiftKey, ctrl: e.ctrlKey, alt: e.altKey, meta: e.metaKey, space: spaceHeld };\n if (\n mods.shift === lastMods.shift &&\n mods.ctrl === lastMods.ctrl &&\n mods.alt === lastMods.alt &&\n mods.meta === lastMods.meta &&\n mods.space === lastMods.space\n ) {\n return;\n }\n lastMods = { ...mods };\n queue.enqueue({ kind: \"key\", pointerId: \"\", device: \"mouse\", screenX: 0, screenY: 0, buttons: 0, mods });\n };\n\n const isSpace = (e: KeyboardEvent): boolean => e.key === \" \" || e.code === \"Space\";\n\n const onKeyDown = (e: KeyboardEvent): void => {\n if (isSpace(e) && !e.defaultPrevented) {\n // Ownership-aware Space (design-007 §3.4; the keydown target IS the\n // focused node, so this reads browser focus — the one truth).\n if (isEditableTarget(e.target)) {\n // Space must TYPE into widget fields (§1.6 live-bug fix): no\n // preventDefault, no pan latch.\n } else if (keyboardClaimOf(e.target).claimed) {\n // Cede the pan SEMANTICS to the claiming widget; keep suppressing the\n // page-scroll default (§3.3 residual — preventDefault still lets the\n // key reach the widget's own keydown listener).\n e.preventDefault();\n } else {\n e.preventDefault(); // Space would otherwise page-scroll\n spaceHeld = true;\n }\n }\n emitKeyIfChanged(e);\n };\n const onKeyUp = (e: KeyboardEvent): void => {\n if (isSpace(e)) {\n if (!e.defaultPrevented && !isEditableTarget(e.target) && !keyboardClaimOf(e.target).claimed) {\n e.preventDefault();\n }\n // Clear UNCONDITIONALLY: the down may have latched over canvas and the\n // up can land after focus moved into a widget/editable — a skipped clear\n // here would strand the pan modifier held.\n spaceHeld = false;\n }\n emitKeyIfChanged(e);\n };\n\n /**\n * Drain every latched input to a clean slate (Law 2: enqueue only). Called on\n * window blur AND on detach: the browser delivers no more pointerups/keyups\n * once we blur, and detaching mid-gesture (unmounting the canvas while the\n * engine outlives it) must not strand an Active drag / held buttons / latched\n * modifiers in the world for a remount of the same engine to resurrect. Also\n * clears the deferred-capture `live` map so no per-pointer tracking survives.\n */\n const cancelAllInput = (): void => {\n // The browser will not deliver pointerups once we lose focus — cancel every\n // still-down pointer so no gesture is stranded Active (design-003 §8).\n for (const [id, s] of live) {\n queue.enqueue({ kind: \"cancel\", pointerId: id, device: s.device, screenX: s.x, screenY: s.y, buttons: 0, mods: { ...NO_MODS, space: spaceHeld } });\n }\n live.clear();\n // Modifier keyups are also lost on blur — ENQUEUE the clearing fact, or\n // the world's Keyboard resource stays latched (space-stuck: every canvas\n // drag pans forever). Clearing only local state was the bug: lastMods\n // already saying \"space up\" suppressed the next emitKeyIfChanged too.\n spaceHeld = false;\n if (lastMods.space || lastMods.shift || lastMods.ctrl || lastMods.alt || lastMods.meta) {\n lastMods = { ...NO_MODS };\n queue.enqueue({\n kind: \"key\",\n pointerId: \"\",\n device: \"mouse\",\n screenX: 0,\n screenY: 0,\n buttons: 0,\n mods: { ...NO_MODS },\n });\n }\n };\n\n const onBlur = (): void => {\n cancelAllInput();\n };\n\n container.addEventListener(\"pointerdown\", onPointerDown);\n container.addEventListener(\"pointermove\", onPointerMove);\n container.addEventListener(\"pointerup\", onPointerUp);\n container.addEventListener(\"pointercancel\", onPointerCancel);\n container.addEventListener(\"wheel\", onWheel, { passive: false });\n view?.addEventListener(\"keydown\", onKeyDown);\n view?.addEventListener(\"keyup\", onKeyUp);\n view?.addEventListener(\"blur\", onBlur);\n\n return () => {\n // Sweep first (a detach can land mid-gesture) — same clean-slate cancel as\n // blur; facts drain on the engine's next step. Then unwire the listeners.\n cancelAllInput();\n container.removeEventListener(\"pointerdown\", onPointerDown);\n container.removeEventListener(\"pointermove\", onPointerMove);\n container.removeEventListener(\"pointerup\", onPointerUp);\n container.removeEventListener(\"pointercancel\", onPointerCancel);\n container.removeEventListener(\"wheel\", onWheel);\n view?.removeEventListener(\"keydown\", onKeyDown);\n view?.removeEventListener(\"keyup\", onKeyUp);\n view?.removeEventListener(\"blur\", onBlur);\n };\n}\n","/**\n * The cursor reflector (design-003 §7 L4 cursor projection; v1 approach:\n * local cursor = OS cursor via one `style.cursor` write).\n *\n * `createCursorSync` resolves the cursor string into closure state every\n * `derive` tick with no observable ECS stamp (a plain string, not a\n * component/resource write), so there is nothing for `observe` to watch —\n * hence `always: true` with an internal last-value cache, mirroring the\n * \"cheap-overlay style\" carve-out `ReflectorDef.always` exists for. The cache\n * is what keeps the write ONE-per-change: `flush` runs every frame, but\n * `host.container.style.cursor` is only touched when `readCursor()` differs\n * from the last-applied value.\n *\n * Law 10: reflectors run post-notify, write output only, never read layout\n * or write ECS — this flush touches only `host.container.style`.\n */\nimport type { ReflectorDef, World } from \"@ice/core\";\nimport type { CanvasHost } from \"../host\";\n\nexport function createCursorReflector(\n host: CanvasHost,\n readCursor: () => string,\n): ReflectorDef & { writes(): number } {\n let writes = 0;\n let last: string | undefined;\n return {\n name: \"cursor\",\n always: true,\n flush(_world: World) {\n const next = readCursor();\n if (next === last) return;\n last = next;\n host.container.style.cursor = next;\n writes++;\n },\n writes: () => writes,\n };\n}\n","/**\n * P5 — remote cursors (design-004 §1: screen-space DOM, \"remote cursors are\n * always custom nodes\"; design-003 §7).\n *\n * Renders one pooled node per REMOTE cursor entity (`CursorVisual` kind\n * \"remote\" + world `Position`, derived by core's remote-cursors system from\n * presence peers; `Follows` names the peer whose `PresenceInfo` supplies\n * color + label). Screen-space by design: an acknowledged small-N\n * camera→position consumer (design-002 §5 rescope), recomputed on camera or\n * cursor dirt only. The plane mounts LAST in the container, above chrome;\n * `pointer-events: none` throughout — cursors are never hit-testable.\n */\nimport {\n Camera,\n CursorVisual,\n Follows,\n Position,\n PresenceInfo,\n defineQuery,\n type Entity,\n type ReflectorDef,\n type World,\n} from \"@ice/core\";\nimport { worldToScreen } from \"@ice/kernel\";\nimport type { CanvasHost } from \"../host\";\n\nconst remoteCursorQ = defineQuery([Position, CursorVisual]);\n\nexport interface RemoteCursorsReflector {\n readonly reflector: ReflectorDef;\n /** Remove the plane + pool (doc close / HMR). */\n destroy(): void;\n}\n\nexport function createRemoteCursorsReflector(host: CanvasHost, world: World): RemoteCursorsReflector {\n const doc = host.container.ownerDocument;\n const plane = doc.createElement(\"div\");\n Object.assign(plane.style, {\n position: \"absolute\",\n inset: \"0\",\n overflow: \"hidden\",\n pointerEvents: \"none\",\n } as Partial<CSSStyleDeclaration>);\n host.container.appendChild(plane); // last child ⇒ topmost (P5 over P4)\n\n interface Node {\n root: HTMLDivElement;\n label: HTMLDivElement;\n color: string;\n name: string;\n x: number;\n y: number;\n }\n const pool = new Map<Entity, Node>();\n\n const ensure = (e: Entity): Node => {\n let n = pool.get(e);\n if (n !== undefined) return n;\n const root = doc.createElement(\"div\");\n Object.assign(root.style, {\n position: \"absolute\",\n left: \"0\",\n top: \"0\",\n willChange: \"transform\",\n pointerEvents: \"none\",\n } as Partial<CSSStyleDeclaration>);\n // Arrow glyph + name chip (color applied on first style pass).\n const arrow = doc.createElement(\"div\");\n Object.assign(arrow.style, {\n width: \"0\",\n height: \"0\",\n borderLeft: \"6px solid transparent\",\n borderRight: \"6px solid transparent\",\n borderBottom: \"14px solid currentColor\",\n transform: \"rotate(-32deg)\",\n } as Partial<CSSStyleDeclaration>);\n const label = doc.createElement(\"div\");\n Object.assign(label.style, {\n marginTop: \"2px\",\n marginLeft: \"8px\",\n padding: \"1px 6px\",\n borderRadius: \"8px\",\n font: \"11px system-ui, sans-serif\",\n color: \"#fff\",\n whiteSpace: \"nowrap\",\n } as Partial<CSSStyleDeclaration>);\n root.appendChild(arrow);\n root.appendChild(label);\n plane.appendChild(root);\n n = { root, label, color: \"\", name: \"\", x: Number.NaN, y: Number.NaN };\n pool.set(e, n);\n return n;\n };\n\n const reflector: ReflectorDef = {\n name: \"remoteCursors\",\n observe: {\n resources: [Camera],\n queries: [{ q: remoteCursorQ, cols: [Position, CursorVisual] }],\n },\n flush: (w) => {\n const cam = w.getResource(Camera) ?? { x: 0, y: 0, zoom: 1 };\n const seen = new Set<Entity>();\n w.query(remoteCursorQ).each((b) => {\n for (const r of b) {\n const e = b.entity(r);\n if (w.get(e, CursorVisual)?.kind !== \"remote\") continue;\n seen.add(e);\n const p = w.read(e, Position);\n const s = worldToScreen(p.x, p.y, cam);\n const n = ensure(e);\n if (n.x !== s.x || n.y !== s.y) {\n n.root.style.transform = `translate(${s.x}px, ${s.y}px)`;\n n.x = s.x;\n n.y = s.y;\n }\n const peer = w.getRelation(e, Follows);\n const info = peer !== undefined ? w.get(peer, PresenceInfo) : undefined;\n const color = info?.color ?? \"#7a8aa0\";\n const name = info?.name ?? \"\";\n if (n.color !== color) {\n n.root.style.color = color;\n n.label.style.background = color;\n n.color = color;\n }\n if (n.name !== name) {\n n.label.textContent = name;\n n.label.style.display = name === \"\" ? \"none\" : \"block\";\n n.name = name;\n }\n }\n });\n for (const [e, n] of pool) {\n if (!seen.has(e)) {\n n.root.remove();\n pool.delete(e);\n }\n }\n },\n };\n\n return {\n reflector,\n destroy() {\n pool.clear();\n plane.remove();\n },\n };\n}\n","/**\n * The focus driver — acquisition + programmatic focus for keyboard-claiming\n * widgets (design-007 §2.3–§2.5, petition I1).\n *\n * The single source of truth is BROWSER focus: `document.activeElement` inside\n * a `data-canvas-keyboard` subtree is what makes every engine keyboard surface\n * stand down (input-ownership.ts). This driver's whole job is to make that\n * state reachable — it drives `.focus()`, it never mirrors focus into the\n * world (there is no Focus resource; design-007 §2.2 demoted it, and despawn\n * integrity is free: removing the node resets `activeElement`).\n *\n * Acquisition is DOM-at-event-time, not a world system: the browser's own event\n * targeting IS the pick (the down target sits inside the claiming host — since\n * design-015 D5b that host is screen-space chrome, never a widget under the\n * camera; the desk's one focused editor acquires focus on its own, the same\n * principle). A capture-phase listener keeps ordering deterministic across\n * browsers (Safari's click-focus quirks):\n *\n * - down on a natively-focusable node inside the claim (textarea, canvas\n * with tabindex, the declared proxy itself) → the browser's own mousedown\n * focus is correct; the driver does nothing.\n * - down anywhere else inside the claim → the driver focuses the claim's\n * declared `[data-canvas-focus]` proxy when one exists, else the host\n * (which carries `tabindex=\"-1\"`), with `preventScroll` — and\n * `preventDefault()`s the pointerdown so the native focus fixup cannot\n * fight the choice. Canceling a pointerdown suppresses only the compat\n * mouse events (focus fixup + text selection — the container is already\n * `user-select:none`); `click` still derives and the adapter's container\n * listener has already enqueued the down fact (one input path intact).\n * - down outside any claim → untouched; the browser blurs to body/other\n * content on its own (click-away release, design-007 §2.4).\n *\n * Release stays where the design put it: Escape in the keymap (blur), lifecycle\n * via node removal, window blur deliberately does NOT force-blur (the browser\n * restores focus on refocus — adapter's cancelAllInput keeps its hands off).\n */\nimport type { Entity } from \"@ice/core\";\nimport type { CanvasHost } from \"./host\";\nimport { KEYBOARD_CLAIM_ATTR } from \"./input-ownership\";\n\n/** The widget-declared focus target (a proxy descendant): `<div data-canvas-focus tabIndex={-1}>`. */\nexport const FOCUS_PROXY_ATTR = \"data-canvas-focus\";\n\n/**\n * Natively click-focusable content — where the browser's own mousedown focus\n * already lands inside the widget (the driver must not override it).\n */\nconst FOCUSABLE_SELECTOR =\n 'input, textarea, select, button, a[href], [contenteditable=\"\"], [contenteditable=\"true\"], [tabindex], audio[controls], video[controls], iframe';\n\n/**\n * Resolves an entity to a claiming host's content element — what `focusWidget` walks from. The\n * dom-widgets reflector was the one lookup until design-015 D5b; a host that keeps per-entity\n * DOM (none in the engine today) may still hand one in.\n */\nexport interface FocusHostLookup {\n hostFor(entity: Entity): HTMLElement | undefined;\n}\n\nexport interface WidgetFocusHandle {\n /**\n * Programmatically focus a claiming widget (its proxy, else its host).\n * Returns false when the entity has no host in the lookup (always, without\n * one) or no keyboard claim — only `keyboard: \"exclusive\"` widgets are\n * focusable (declaration drives focusability; design-007 §3.1).\n */\n focusWidget(entity: Entity): boolean;\n /** Blur whatever claim currently holds focus. False when none does. */\n blurFocus(): boolean;\n /** Remove the acquisition listener. */\n detach(): void;\n}\n\n/** The claiming host's focus node: the declared proxy, else the (tabindexed) host. */\nfunction focusNodeOf(claimHost: HTMLElement): HTMLElement {\n const proxy = claimHost.querySelector<HTMLElement>(`[${FOCUS_PROXY_ATTR}]`);\n return proxy ?? claimHost;\n}\n\nexport function attachWidgetFocus(host: CanvasHost, lookup?: FocusHostLookup): WidgetFocusHandle {\n const { container } = host;\n const doc = container.ownerDocument;\n\n const onPointerDown = (e: PointerEvent): void => {\n if (!(e.target instanceof Element)) return;\n const marked = e.target.closest(`[${KEYBOARD_CLAIM_ATTR}]`);\n if (!(marked instanceof HTMLElement) || !container.contains(marked)) return;\n // A natively-focusable node under the pointer (deeper than the host)\n // takes browser focus on its own — the common editable/terminal case.\n const focusable = e.target.closest(FOCUSABLE_SELECTOR);\n if (focusable !== null && focusable !== marked && marked.contains(focusable)) return;\n const node = focusNodeOf(marked);\n if (doc.activeElement === node) return; // already held — never disturb mid-gesture\n e.preventDefault(); // suppress the native focus fixup; the driver owns the choice\n node.focus({ preventScroll: true });\n };\n\n // Capture phase: runs before widget content's own handlers and before the\n // adapter's bubble listener — deterministic acquisition, no races.\n container.addEventListener(\"pointerdown\", onPointerDown, true);\n\n return {\n focusWidget(entity) {\n const content = lookup?.hostFor(entity);\n const hostEl = content?.parentElement;\n if (!(hostEl instanceof HTMLElement) || !hostEl.hasAttribute(KEYBOARD_CLAIM_ATTR)) return false;\n const node = focusNodeOf(hostEl);\n node.focus({ preventScroll: true });\n return doc.activeElement === node;\n },\n blurFocus() {\n const active = doc.activeElement;\n // SVG focus targets included — same rule as the keymap's Escape release.\n if (!(active instanceof HTMLElement || active instanceof SVGElement)) return false;\n if (active.closest(`[${KEYBOARD_CLAIM_ATTR}]`) === null) return false;\n active.blur();\n return true;\n },\n detach() {\n container.removeEventListener(\"pointerdown\", onPointerDown, true);\n },\n };\n}\n","/**\n * `createDeskHost` — the vanilla mount (design-015 §3, D-D15; D5b). What `<InfiniteCanvas>` did\n * for the hybrid, with the hybrid gone: ONE container, the desk's layer in it, and this package's\n * screen-space half around it — the pointer adapter (L0's one producer), the rAF loop, the OS\n * cursor, the room's other people (the remote cursors), the focus driver, the viewport sync.\n * `@ice/react`'s `<Desk>` wraps it; an app without React mounts it directly.\n *\n * THE DESK ARRIVES AS AN OPAQUE LAYER FACTORY. This package never imports `@ice/desk` (the wall\n * `nobody-imports-desk`): the factory's context and its handle are typed STRUCTURALLY here —\n * exactly as `<InfiniteCanvas ground={groundCompose(…)}>` received the ground — and\n * `@ice/desk`'s `deskLayer(opts)` (its src/host/) returns a function assignable to {@link LayerFactory}.\n * The context carries the interaction stack's seams the renderer fills (the frame pick, the nav\n * geometry, the held pose — design-014 B3b, design-015 §8–§9) and the marquee buffer it draws.\n *\n * Boot order (registration order = reflector flush order): host → layer → reflectors [ layer ·\n * cursor · remoteCursors ] → pointer adapter → focus → viewport (one layout read, then a\n * ResizeObserver, and the device's ratio read before every step) → rAF loop. `dispose` undoes it in reverse. The engine is NOT owned here — it\n * outlives the mount (the app disposes it). A layer factory that throws leaves nothing claimed on\n * the engine: it runs before any registration, and only the local host is undone.\n */\nimport {\n Viewport,\n writeRuntimeResource,\n type CanvasEngine,\n type EngineGpu,\n type InteractionStack,\n type ReflectorDef,\n type World,\n} from \"@ice/core\";\nimport { createCanvasHost, type CanvasHost } from \"./host\";\nimport { startRafLoop } from \"./loop\";\nimport { attachPointerAdapter } from \"./pointer-adapter\";\nimport { createCursorReflector } from \"./reflectors/cursor\";\nimport { createRemoteCursorsReflector } from \"./reflectors/remote-cursors\";\nimport { attachWidgetFocus, type WidgetFocusHandle } from \"./widget-focus\";\n\n/**\n * What the host needs of a mounted layer: its drawing reflector and its teardown. The desk's own\n * handle (`@ice/desk`'s `DeskLayerHandle`) carries far more; an app keeps that through its\n * own factory wrapper, or reads it off {@link DeskHost.layer} typed as the factory returned it.\n */\nexport interface LayerHandle {\n readonly reflector: ReflectorDef & { available(): boolean };\n dispose(): void;\n}\n\n/** The mount context a layer factory receives: the host, the world and the seams the renderer fills. */\nexport interface LayerContext {\n readonly host: CanvasHost;\n readonly world: World;\n /** The frame pick slot (design-014, B3b): the renderer sets its hit test here at mount, clears it at dispose. */\n readonly framePick: InteractionStack[\"framePick\"];\n /** The nav geometry slot (design-015 §9, D2b): the renderer's word on its containers' drawn faces. */\n readonly navGeometry: InteractionStack[\"navGeometry\"];\n /** The held pose slot (design-015 §8, D4b): where the object in hand is on screen, as drawn. */\n readonly heldPose: InteractionStack[\"heldPose\"];\n /** The tray pose slot (design-017 §4, K3): where the pegboard drawer is on screen, as drawn. */\n readonly trayPose: InteractionStack[\"trayPose\"];\n /** The presentation transition coordinator: the layer registers the `ground` plane so a nav flight can prepare. */\n readonly transitions: CanvasEngine[\"transitions\"];\n /** The engine's catalog: the object types whose kinds the layer registers. */\n readonly catalog: CanvasEngine[\"catalog\"];\n /** The marquee's preview, out of the ECS (design-003 §5.7): the vellum the marks draw (design-015 D4a). */\n readonly readMarquee: () => InteractionStack[\"marqueeBuffer\"];\n /** The one spatial index (design-015 §2.5; D6): the renderer's cull rides it with a hysteresis margin — no per-entity rect test on a pan. */\n readonly spatial: InteractionStack[\"index\"];\n /** The engine's device (`engine.compositorDevice`), when the app passed one (design-015 D7): the layer draws with it — ONE device per engine. */\n readonly gpu?: EngineGpu;\n /**\n * The frame gate's sleep (K7a, `@ice/core` frame-control.ts): the layer registers when it is next due (`wakeWhen`), wakes a\n * sleeping loop for what it hears outside a step (`wake` — an asset landing, a theme, a pin), and asks whether the step in\n * progress is a registered time's alone (`settled` — then it ticks only what is due).\n */\n readonly frame?: Pick<CanvasEngine[\"engine\"][\"frame\"], \"wake\" | \"wakeWhen\" | \"settled\">;\n}\n\nexport type LayerFactory<H extends LayerHandle = LayerHandle> = (ctx: LayerContext) => H;\n\nexport interface DeskHostOptions<H extends LayerHandle = LayerHandle> {\n /** The viewport element; styled, not created, by the host. */\n readonly container: HTMLElement;\n /** A constructed engine (`createCanvasEngine(...)`); NOT disposed by the host. */\n readonly engine: CanvasEngine;\n /** The desk — `deskLayer({ … })` from `@vibecook/ice/desk` (`@ice/desk`'s src/host/), received opaquely. */\n readonly layer: LayerFactory<H>;\n /**\n * The loop SLEEPS when the engine is quiet (K7a — design-015 §11.4: a desk at rest costs the main thread nothing): no frame\n * until an input, a write, an arrival or a registered time wakes it. Default true; false steps every frame, as before K7a.\n */\n readonly sleep?: boolean;\n}\n\nexport interface DeskHost<H extends LayerHandle = LayerHandle> {\n readonly engine: CanvasEngine;\n readonly host: CanvasHost;\n /** The mounted layer's handle, as the factory returned it. */\n readonly layer: H;\n /**\n * The focus driver (design-007 §2.3): `blurFocus()` releases whatever keyboard claim holds\n * focus. Focus is VIEW state (design-007 §2.6) — it rides the mount, not `engine.ops`.\n */\n readonly focus: WidgetFocusHandle;\n /** Stop the loop, detach every adapter, unregister every reflector, dispose the layer and the host. Idempotent. */\n dispose(): void;\n}\n\nexport function createDeskHost<H extends LayerHandle>(opts: DeskHostOptions<H>): DeskHost<H> {\n const { container, engine } = opts;\n const { world, engine: core, stack } = engine;\n const host = createCanvasHost(container);\n\n let layer: H;\n try {\n layer = opts.layer({\n host,\n world,\n framePick: stack.framePick,\n navGeometry: stack.navGeometry,\n heldPose: stack.heldPose,\n trayPose: stack.trayPose,\n transitions: engine.transitions,\n catalog: engine.catalog,\n readMarquee: () => stack.marqueeBuffer,\n spatial: stack.index,\n ...(engine.compositorDevice !== undefined ? { gpu: engine.compositorDevice } : {}),\n frame: core.frame,\n });\n } catch (err) {\n host.dispose();\n throw err;\n }\n\n // Registration order = flush order: the desk draws, then the OS cursor, then\n // the room's other people on top (their plane is the container's last child).\n const remoteCursors = createRemoteCursorsReflector(host, world);\n const unregister = [\n core.registerReflector(layer.reflector),\n core.registerReflector(createCursorReflector(host, stack.readCursor)),\n core.registerReflector(remoteCursors.reflector),\n ];\n\n // The OS's reduced-motion preference, into the transition coordinator (a nav flight snaps).\n const motionQuery = container.ownerDocument.defaultView?.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const syncReducedMotion = (): void => {\n engine.transitions.setReducedMotion(motionQuery?.matches === true);\n };\n syncReducedMotion();\n motionQuery?.addEventListener(\"change\", syncReducedMotion);\n\n const detachPointer = attachPointerAdapter(host, stack.queue);\n const focus = attachWidgetFocus(host);\n\n const ratio = (): number => (typeof window !== \"undefined\" ? window.devicePixelRatio : 1);\n let synced = 0;\n const syncViewport = (): void => {\n const rect = container.getBoundingClientRect();\n synced = ratio();\n writeRuntimeResource(world, Viewport, { w: rect.width, h: rect.height, dpr: synced });\n };\n syncViewport();\n let resizeObserver: ResizeObserver | undefined;\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver(syncViewport);\n resizeObserver.observe(container);\n }\n\n // THE RATIO (ICE M21 K1): a change of the device's ratio alone — another display, the browser's zoom, an emulated ratio — resizes\n // nothing, so the observer never hears it and the desk kept drawing at the old ratio; an emulated one (DevTools' device mode, CDP)\n // fires not even the `(resolution)` media query (measured: `.matches` flips, no `change` over three rendered frames, no\n // device-pixel box moves). So the ratio is READ before every step — a property read — and the viewport re-synced when it moved.\n const stopLoop = startRafLoop(\n core,\n () => {\n if (ratio() !== synced) syncViewport();\n },\n { sleep: opts.sleep !== false },\n );\n // …and while the loop SLEEPS (K7a) no step reads it: the ratio is read twice a second instead — a property read, and the\n // viewport write wakes the loop through the world's doors when it moved\n const ratioPoll = opts.sleep !== false ? setInterval(() => { if (ratio() !== synced) syncViewport(); }, 500) : undefined;\n\n let disposed = false;\n return {\n engine,\n host,\n layer,\n focus,\n dispose() {\n if (disposed) return;\n disposed = true;\n stopLoop();\n if (ratioPoll !== undefined) clearInterval(ratioPoll);\n resizeObserver?.disconnect();\n focus.detach();\n detachPointer();\n motionQuery?.removeEventListener(\"change\", syncReducedMotion);\n engine.transitions.setReducedMotion(false);\n for (const unreg of unregister) unreg();\n remoteCursors.destroy();\n layer.dispose();\n host.dispose();\n },\n };\n}\n","/**\n * @ice/dom — SCREEN SPACE ONLY (design-015 §3, D-D15; D5b): the canvas host, the pointer\n * adapter (events → queue ONLY), the rAF loop, input ownership + the editor's focus, the OS\n * cursor + the room's remote cursors, and `createDeskHost` — the vanilla mount that takes the\n * desk as an opaque layer factory.\n * Import wall: @ice/core + @ice/kernel down only — never react/three/desk (enforced).\n *\n * GONE at D5b — the WORLD-SPACE half (design-015 §1): the content and lifted planes, the\n * plane-transform reflector, the DOM widget hosts + writeback, the L1 source canvas\n * (`layoutsubtree`), the Widget Surface contract, measurement, the graybox and the P4 chrome\n * reflectors, and the pointer adapter's GL route. No DOM under the camera (DK-D2).\n */\nexport const DOM_VERSION = \"0.0.0\";\n\n// The canvas host (design-004 §1): the styled container — no planes.\nexport { createCanvasHost, type CanvasHost } from \"./host\";\n\n// The vanilla mount (design-015 §3): the desk's layer, the adapters, the reflectors, the loop.\nexport {\n createDeskHost,\n type DeskHost,\n type DeskHostOptions,\n type LayerContext,\n type LayerFactory,\n type LayerHandle,\n} from \"./desk-host\";\n\n// The rAF frame loop (design-002 §1: the platform owns the loop).\nexport { startRafLoop } from \"./loop\";\n\n// The L0 pointer adapter (design-003 §2–§3): DOM events → InputQueue, nothing more.\nexport { attachPointerAdapter } from \"./pointer-adapter\";\n\n// Input-ownership predicates (design-007 §4, petitions I1/I4): the shared\n// per-surface guard family — the keymap (@ice/react) reads these too.\nexport {\n CLAIM_OWNS_ESCAPE,\n KEYBOARD_CLAIM_ATTR,\n isEditableTarget,\n keyboardClaimOf,\n wheelCede,\n type KeyboardClaim,\n} from \"./input-ownership\";\n\n// The focus driver (design-007 §2.3–§2.5): click-to-focus acquisition for a\n// keyboard-claiming host + the programmatic blurFocus/focusWidget handle.\n// Focus is VIEW state (design-007 §2.6) — it lives here, not in core.\nexport {\n FOCUS_PROXY_ATTR,\n attachWidgetFocus,\n type FocusHostLookup,\n type WidgetFocusHandle,\n} from \"./widget-focus\";\n\n// L4 cursor projection output (design-003 §7: local cursor = OS cursor, one write).\nexport { createCursorReflector } from \"./reflectors/cursor\";\n// P5 remote cursors (design-004 §1: screen-space pooled nodes; M9 presence) — a room's other people.\nexport { createRemoteCursorsReflector, type RemoteCursorsReflector } from \"./reflectors/remote-cursors\";\n"],"mappings":";;;;;;;;;;;;;;;;AAyBA,IAAM,kBAAoD;AAAA,EACxD,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AACd;AAEO,SAAS,iBAAiB,WAAoC;AASnE,QAAM,OAAO,UAAU,cAAc;AACrC,QAAM,WACJ,UAAU,MAAM,aAAa,KACzB,UAAU,MAAM,WACf,MAAM,iBAAiB,SAAS,EAAE,YAAY;AACrD,QAAM,oBAAoB,aAAa,MAAM,aAAa;AAC1D,MAAI,kBAAmB,WAAU,MAAM,WAAW;AAIl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