@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
@@ -1,681 +0,0 @@
1
- import {
2
- attachPointerAdapter,
3
- attachWidgetFocus,
4
- createCanvasHost,
5
- createChromeReflector,
6
- createCursorReflector,
7
- createDomWidgetsReflector,
8
- createPlaneTransformReflector,
9
- createPlanes,
10
- createRemoteCursorsReflector,
11
- isEditableTarget,
12
- keyboardClaimOf,
13
- startRafLoop,
14
- wireMeasurement
15
- } from "./chunk-2TNVB2ON.js";
16
- import {
17
- ActiveTool,
18
- DurableUndoStatus,
19
- Local,
20
- Not,
21
- Position,
22
- PrefabId,
23
- PresenceInfo,
24
- PresencePeer,
25
- Selected,
26
- Viewport,
27
- WidgetBreakpoint,
28
- createCanvasEngine,
29
- defineQuery,
30
- devGuardsEnabled,
31
- guardedTransaction,
32
- selectedEntities,
33
- tools,
34
- widgets,
35
- writeRuntimeResource
36
- } from "./chunk-VGVDJZSP.js";
37
-
38
- // ../react/src/hooks.ts
39
- import { createContext, useCallback, useContext, useMemo, useRef, useSyncExternalStore } from "react";
40
- var WidgetHiddenContext = createContext(false);
41
- var selectedQ = defineQuery([Selected]);
42
- function shallowEq(a, b) {
43
- if (Object.is(a, b)) return true;
44
- if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
45
- const ka = Object.keys(a);
46
- const kb = Object.keys(b);
47
- if (ka.length !== kb.length) return false;
48
- for (const k of ka) {
49
- if (!Object.is(a[k], b[k])) return false;
50
- }
51
- return true;
52
- }
53
- function useWorldComponent(world, entity, component) {
54
- const hidden = useContext(WidgetHiddenContext);
55
- const last = useRef(void 0);
56
- const subscribe = useCallback(
57
- (onChange) => {
58
- if (hidden) return () => {
59
- };
60
- return world.reactive.observeValue(entity, component, onChange);
61
- },
62
- [world, entity, component, hidden]
63
- );
64
- const getSnapshot = useCallback(() => {
65
- if (hidden) return last.current;
66
- const v = world.isAlive(entity) ? world.get(entity, component) : void 0;
67
- if (!shallowEq(v, last.current)) last.current = v;
68
- return last.current;
69
- }, [world, entity, component, hidden]);
70
- return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
71
- }
72
- function useWidgetProps(world, entity, type, group = "props") {
73
- const widget = widgets.get(type);
74
- const g = widget?.groups.find((x) => x.name === group);
75
- if (widget === void 0 || g === void 0) {
76
- throw new Error(`ice: useWidgetProps \u2014 unknown widget type/group "${type}"/"${group}".`);
77
- }
78
- const raw = useWorldComponent(world, entity, g.component);
79
- return useMemo(() => {
80
- if (raw === void 0) return void 0;
81
- const out = {};
82
- for (const [name, spec] of Object.entries(g.fields)) {
83
- const v = raw[name];
84
- out[name] = spec.kind === "json" && typeof v === "string" ? parseJsonCell(v, spec.default) : v;
85
- }
86
- return out;
87
- }, [raw, g]);
88
- }
89
- function useBehavior(world, entity, behavior) {
90
- const raw = useWorldComponent(world, entity, behavior.component);
91
- return useMemo(() => {
92
- if (raw === void 0) return void 0;
93
- const out = {};
94
- for (const [name, spec] of Object.entries(behavior.schema)) {
95
- const v = raw[name];
96
- out[name] = spec.kind === "json" && typeof v === "string" ? parseJsonCell(v, spec.default) : v;
97
- }
98
- return out;
99
- }, [raw, behavior]);
100
- }
101
- function parseJsonCell(cell, serializedDefault) {
102
- try {
103
- return JSON.parse(cell);
104
- } catch {
105
- try {
106
- return JSON.parse(serializedDefault ?? "null");
107
- } catch {
108
- return null;
109
- }
110
- }
111
- }
112
- function useSelected(world, entity) {
113
- const hidden = useContext(WidgetHiddenContext);
114
- const last = useRef(false);
115
- const subscribe = useCallback(
116
- (onChange) => {
117
- if (hidden) return () => {
118
- };
119
- return world.reactive.observeQuery(selectedQ, onChange);
120
- },
121
- [world, hidden]
122
- );
123
- const getSnapshot = useCallback(() => {
124
- if (hidden) return last.current;
125
- last.current = world.isAlive(entity) && world.hasTag(entity, Selected);
126
- return last.current;
127
- }, [world, entity, hidden]);
128
- return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
129
- }
130
- function useBreakpoint(world, entity) {
131
- const bp = useWorldComponent(world, entity, WidgetBreakpoint);
132
- return bp?.tier ?? "normal";
133
- }
134
-
135
- // ../react/src/widget-root.tsx
136
- import { createElement } from "react";
137
- import { createPortal } from "react-dom";
138
- import { useSyncExternalStore as useSyncExternalStore2 } from "react";
139
- function WidgetRoot({ world, store, hosts }) {
140
- const entries = useSyncExternalStore2(store.subscribe, store.getSnapshot, store.getSnapshot);
141
- const portals = [];
142
- for (const entry of entries) {
143
- if (!world.isAlive(entry.entity)) continue;
144
- const type = world.get(entry.entity, PrefabId)?.id;
145
- const widget = typeof type === "string" ? widgets.get(type) : void 0;
146
- if (widget === void 0) continue;
147
- const view = widget.surface === "dom" ? widget.component : widget.chrome;
148
- if (view == null) continue;
149
- const target = hosts.hostFor(entry.entity);
150
- if (target === void 0) continue;
151
- const View = view;
152
- portals.push(
153
- createPortal(
154
- createElement(
155
- WidgetHiddenContext.Provider,
156
- { value: entry.hidden },
157
- createElement(View, { entity: entry.entity, world })
158
- ),
159
- target,
160
- String(entry.entity)
161
- )
162
- );
163
- }
164
- return createElement("div", { "data-ice-widget-root": "" }, portals);
165
- }
166
-
167
- // ../react/src/engine-context.tsx
168
- import { createContext as createContext2, useContext as useContext2, useEffect } from "react";
169
- import { jsx } from "react/jsx-runtime";
170
- var EngineContext = createContext2(null);
171
- function EngineProvider({ engine, children }) {
172
- return /* @__PURE__ */ jsx(EngineContext.Provider, { value: engine, children });
173
- }
174
- function useCanvasEngine() {
175
- const engine = useContext2(EngineContext);
176
- if (engine === null) {
177
- throw new Error(
178
- "ice: useCanvasEngine \u2014 no <EngineProvider>. Render widgets inside <InfiniteCanvas> (which provides it) or wrap your tree in <EngineProvider engine={...}>."
179
- );
180
- }
181
- return engine;
182
- }
183
- function useOps() {
184
- return useCanvasEngine().ops;
185
- }
186
- function useStageHold(engine, active, name) {
187
- useEffect(() => {
188
- if (!active) return void 0;
189
- return engine.stage.background(name);
190
- }, [engine, active, name]);
191
- }
192
- function useFrameFreeze(engine, active, name) {
193
- useEffect(() => {
194
- if (!active) return void 0;
195
- return engine.frame.freeze(name);
196
- }, [engine, active, name]);
197
- }
198
- var warnedUseWorld = false;
199
- function useWorld() {
200
- const engine = useCanvasEngine();
201
- if (devGuardsEnabled() && !warnedUseWorld) {
202
- warnedUseWorld = true;
203
- console.warn(
204
- "ice: useWorld() is a READ/OBSERVE escape hatch \u2014 never write to the world directly. Use useOps()/useCommit() for mutation (design-005 \xA75)."
205
- );
206
- }
207
- return engine.world;
208
- }
209
-
210
- // ../react/src/use-commit.ts
211
- import { useCallback as useCallback2, useRef as useRef2, useSyncExternalStore as useSyncExternalStore3 } from "react";
212
- function useCommit() {
213
- const engine = useCanvasEngine();
214
- return useCallback2(
215
- (fn, opts) => {
216
- const session = engine.docs.current();
217
- if (session === void 0) {
218
- throw new Error(
219
- "ice: useCommit \u2014 no active document. Attach one with engine.docs.create()/open()/join() before committing widget edits."
220
- );
221
- }
222
- if (session.readOnly) {
223
- throw new Error("ice: useCommit \u2014 the document is read-only (version gate); widget edits are disabled.");
224
- }
225
- guardedTransaction(session.store, engine.world, fn, opts);
226
- },
227
- [engine]
228
- );
229
- }
230
- var NO_UNDO = { canUndo: false, canRedo: false };
231
- function useUndoStatus() {
232
- const engine = useCanvasEngine();
233
- const last = useRef2(NO_UNDO);
234
- const subscribe = useCallback2(
235
- (onChange) => engine.world.reactive.observeResource(DurableUndoStatus, onChange),
236
- [engine]
237
- );
238
- const getSnapshot = useCallback2(() => {
239
- const status = engine.world.getResource(DurableUndoStatus);
240
- const canUndo = status?.canUndo ?? false;
241
- const canRedo = status?.canRedo ?? false;
242
- if (last.current.canUndo !== canUndo || last.current.canRedo !== canRedo) {
243
- last.current = { canUndo, canRedo };
244
- }
245
- return last.current;
246
- }, [engine]);
247
- return useSyncExternalStore3(subscribe, getSnapshot, getSnapshot);
248
- }
249
-
250
- // ../react/src/preview-snapshots.ts
251
- var images = /* @__PURE__ */ new Map();
252
- var listeners = /* @__PURE__ */ new Set();
253
- function setPreviewSnapshot(type, image) {
254
- images.set(type, image);
255
- for (const l of listeners) l();
256
- }
257
- function getPreviewSnapshot(type) {
258
- return images.get(type);
259
- }
260
- function hasPreviewSnapshot(type) {
261
- return images.has(type);
262
- }
263
- function subscribePreviewSnapshots(listener) {
264
- listeners.add(listener);
265
- return () => listeners.delete(listener);
266
- }
267
-
268
- // ../react/src/widget-preview.tsx
269
- import {
270
- Component,
271
- useEffect as useEffect2,
272
- useRef as useRef3,
273
- useSyncExternalStore as useSyncExternalStore4
274
- } from "react";
275
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
276
- var sandbox = null;
277
- function ensurePreviewEntity(def) {
278
- if (sandbox === null) {
279
- const ce = createCanvasEngine();
280
- ce.docs.create();
281
- ce.world.sync();
282
- ce.step(16);
283
- sandbox = { ce, entities: /* @__PURE__ */ new Map() };
284
- }
285
- const existing = sandbox.entities.get(def.type);
286
- if (existing !== void 0) return existing;
287
- try {
288
- const e = sandbox.ce.ops.spawnWidget(def.type, {
289
- x: 0,
290
- y: 0,
291
- undoable: false,
292
- ...def.previewProps !== void 0 ? { props: def.previewProps } : {}
293
- });
294
- sandbox.ce.world.sync();
295
- sandbox.ce.step(32);
296
- sandbox.entities.set(def.type, e);
297
- return e;
298
- } catch (err) {
299
- console.warn(`ice: WidgetPreview("${def.type}") sandbox spawn failed \u2014 falling back.`, err);
300
- return void 0;
301
- }
302
- }
303
- var PreviewBoundary = class extends Component {
304
- state = { failed: false };
305
- static getDerivedStateFromError() {
306
- return { failed: true };
307
- }
308
- componentDidCatch(error) {
309
- console.warn("ice: a widget preview threw while rendering \u2014 showing the fallback.", error);
310
- }
311
- render() {
312
- return this.state.failed ? this.props.fallback : this.props.children;
313
- }
314
- };
315
- function SnapshotLayer({ image }) {
316
- const ref = useRef3(null);
317
- useEffect2(() => {
318
- const canvas = ref.current;
319
- if (canvas === null) return;
320
- canvas.width = image.width;
321
- canvas.height = image.height;
322
- try {
323
- canvas.getContext("2d")?.drawImage(image, 0, 0);
324
- } catch {
325
- }
326
- }, [image]);
327
- return /* @__PURE__ */ jsx2(
328
- "canvas",
329
- {
330
- ref,
331
- "data-preview-snapshot": "",
332
- style: { position: "absolute", inset: 0, width: "100%", height: "100%" }
333
- }
334
- );
335
- }
336
- function defaultPlaceholder(label) {
337
- return /* @__PURE__ */ jsx2(
338
- "div",
339
- {
340
- style: {
341
- width: "100%",
342
- height: "100%",
343
- borderRadius: 12,
344
- background: "rgba(127, 127, 127, 0.12)",
345
- boxShadow: "inset 0 0 0 1px rgba(127, 127, 127, 0.25)",
346
- display: "flex",
347
- alignItems: "center",
348
- justifyContent: "center",
349
- fontSize: 11,
350
- color: "rgba(127, 127, 127, 0.8)",
351
- overflow: "hidden"
352
- },
353
- children: label
354
- }
355
- );
356
- }
357
- function WidgetPreview({ type, width, height, fallback, className, style }) {
358
- const snapshot = useSyncExternalStore4(subscribePreviewSnapshots, () => getPreviewSnapshot(type));
359
- const def = widgets.get(type);
360
- const safeFallback = fallback ?? defaultPlaceholder(type);
361
- if (def === void 0 || def.defaultSize.w <= 0 || def.defaultSize.h <= 0) {
362
- return /* @__PURE__ */ jsx2("div", { className, style: { width, height, ...style }, children: safeFallback });
363
- }
364
- const s = Math.min(width / def.defaultSize.w, height / def.defaultSize.h);
365
- const fitW = def.defaultSize.w * s;
366
- const fitH = def.defaultSize.h * s;
367
- const stage = (content) => /* @__PURE__ */ jsx2("div", { className, style: { width: fitW, height: fitH, overflow: "hidden", ...style }, children: /* @__PURE__ */ jsx2(
368
- "div",
369
- {
370
- inert: true,
371
- style: {
372
- width: def.defaultSize.w,
373
- height: def.defaultSize.h,
374
- transform: `scale(${s})`,
375
- transformOrigin: "0 0",
376
- pointerEvents: "none",
377
- userSelect: "none"
378
- },
379
- children: /* @__PURE__ */ jsx2(PreviewBoundary, { fallback: safeFallback, children: content })
380
- }
381
- ) });
382
- if (def.previewComponent !== null && def.previewComponent !== void 0) {
383
- const Declared = def.previewComponent;
384
- return stage(/* @__PURE__ */ jsx2(Declared, {}));
385
- }
386
- if (def.surface === "gl" && snapshot !== void 0) {
387
- let chromeLayer = null;
388
- if (def.chrome !== null && def.chrome !== void 0) {
389
- const entity = ensurePreviewEntity(def);
390
- if (entity !== void 0 && sandbox !== null) {
391
- const Chrome = def.chrome;
392
- chromeLayer = /* @__PURE__ */ jsx2(EngineProvider, { engine: sandbox.ce, children: /* @__PURE__ */ jsx2("div", { style: { position: "absolute", inset: 0 }, children: /* @__PURE__ */ jsx2(Chrome, { entity, world: sandbox.ce.world }) }) });
393
- }
394
- }
395
- return stage(
396
- /* @__PURE__ */ jsxs("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
397
- chromeLayer,
398
- /* @__PURE__ */ jsx2(SnapshotLayer, { image: snapshot })
399
- ] })
400
- );
401
- }
402
- if (def.surface === "dom" && def.component !== null && def.component !== void 0) {
403
- const entity = ensurePreviewEntity(def);
404
- if (entity !== void 0 && sandbox !== null) {
405
- const View = def.component;
406
- return stage(
407
- /* @__PURE__ */ jsx2(EngineProvider, { engine: sandbox.ce, children: /* @__PURE__ */ jsx2(View, { entity, world: sandbox.ce.world }) })
408
- );
409
- }
410
- }
411
- return /* @__PURE__ */ jsx2("div", { className, style: { width: fitW, height: fitH, ...style }, children: safeFallback });
412
- }
413
-
414
- // ../react/src/use-tool.ts
415
- import { useCallback as useCallback3, useSyncExternalStore as useSyncExternalStore5 } from "react";
416
- function useTool() {
417
- const engine = useCanvasEngine();
418
- const subscribe = useCallback3(
419
- (onChange) => engine.world.reactive.observeResource(ActiveTool, onChange),
420
- [engine]
421
- );
422
- const getSnapshot = useCallback3(() => engine.world.getResource(ActiveTool)?.id ?? "select", [engine]);
423
- const active = useSyncExternalStore5(subscribe, getSnapshot, getSnapshot);
424
- const setTool = useCallback3((id) => engine.ops.setTool(id), [engine]);
425
- return [active, setTool];
426
- }
427
- function useToolState(id) {
428
- const [active] = useTool();
429
- return active === id;
430
- }
431
-
432
- // ../react/src/use-presence.ts
433
- import { useCallback as useCallback4, useRef as useRef4, useSyncExternalStore as useSyncExternalStore6 } from "react";
434
- var remotePeersQ = defineQuery([PresencePeer, Not(Local)]);
435
- function usePresencePeers() {
436
- const engine = useCanvasEngine();
437
- const cache = useRef4({ key: "\0", value: [] });
438
- const subscribe = useCallback4(
439
- (onChange) => engine.world.reactive.observeQuery(remotePeersQ, onChange),
440
- [engine]
441
- );
442
- const getSnapshot = useCallback4(() => {
443
- const world = engine.world;
444
- const ids = [];
445
- world.query(remotePeersQ).each((b) => {
446
- for (const r of b) ids.push(b.entity(r));
447
- });
448
- const key = ids.join(",");
449
- if (key !== cache.current.key) {
450
- cache.current = {
451
- key,
452
- value: ids.map((entity) => ({ entity, info: world.get(entity, PresenceInfo) }))
453
- };
454
- }
455
- return cache.current.value;
456
- }, [engine]);
457
- return useSyncExternalStore6(subscribe, getSnapshot, getSnapshot);
458
- }
459
-
460
- // ../react/src/keymap.ts
461
- var signature = (key, mod, shift) => `${key.toLowerCase()}|${mod ? 1 : 0}|${shift ? 1 : 0}`;
462
- function nudgeSelection(engine, dx, dy) {
463
- const session = engine.docs.current();
464
- if (session === void 0) return;
465
- const selection = selectedEntities(engine.world).filter((e) => session.store.keyOf(e) !== void 0);
466
- if (selection.length === 0) return;
467
- guardedTransaction(session.store, engine.world, (tx) => {
468
- for (const e of selection) {
469
- const p = engine.world.get(e, Position);
470
- if (p === void 0) continue;
471
- tx.edit(e).set(Position, { x: p.x + dx, y: p.y + dy });
472
- }
473
- });
474
- }
475
- var ARROWS = [
476
- ["ArrowLeft", -1, 0],
477
- ["ArrowRight", 1, 0],
478
- ["ArrowUp", 0, -1],
479
- ["ArrowDown", 0, 1]
480
- ];
481
- function defaultEntries() {
482
- const entries = [
483
- { key: "Backspace", run: (e) => e.ops.deleteSelection() },
484
- { key: "Delete", run: (e) => e.ops.deleteSelection() },
485
- { key: "z", mod: true, run: (e) => e.docs.undo() },
486
- { key: "z", mod: true, shift: true, run: (e) => e.docs.redo() },
487
- { key: "d", mod: true, run: (e) => e.ops.duplicateSelection() },
488
- { key: "a", mod: true, run: (e) => e.ops.selectAll() },
489
- { key: "Escape", run: (e) => e.ops.cancelActiveGestures() }
490
- ];
491
- for (const [key, dx, dy] of ARROWS) {
492
- entries.push({ key, run: (e) => nudgeSelection(e, dx, dy) });
493
- entries.push({ key, shift: true, run: (e) => nudgeSelection(e, dx * 10, dy * 10) });
494
- }
495
- for (const tool of tools.all()) {
496
- if (tool.shortcut !== void 0) {
497
- const id = tool.id;
498
- entries.push({ key: tool.shortcut, run: (e) => e.ops.setTool(id) });
499
- }
500
- }
501
- return entries;
502
- }
503
- function resolveTarget(target) {
504
- if (target !== void 0) return target;
505
- return typeof window !== "undefined" ? window : void 0;
506
- }
507
- function attachKeymap(engine, target, overrides = []) {
508
- const el = resolveTarget(target);
509
- if (el === void 0) return () => {
510
- };
511
- const map = /* @__PURE__ */ new Map();
512
- for (const entry of defaultEntries()) map.set(signature(entry.key, entry.mod, entry.shift), entry);
513
- for (const entry of overrides) {
514
- if (entry.key === " ") {
515
- console.warn(
516
- "ice: attachKeymap \u2014 an override on Space can never fire: the pointer adapter owns Space as the pan modifier (design-003 \xA74.4) and preventDefaults it before the keymap's handled-by-content gate."
517
- );
518
- }
519
- map.set(signature(entry.key, entry.mod, entry.shift), entry);
520
- }
521
- const onKeyDown = (event) => {
522
- if (event.defaultPrevented) return;
523
- const claim = keyboardClaimOf(event.target);
524
- if (claim.claimed) {
525
- if (event.key === "Escape" && !claim.ownsEscape) {
526
- event.preventDefault();
527
- const t = event.target;
528
- if (t instanceof HTMLElement || t instanceof SVGElement) t.blur();
529
- }
530
- return;
531
- }
532
- if (isEditableTarget(event.target)) return;
533
- const mod = event.metaKey || event.ctrlKey;
534
- const entry = map.get(signature(event.key, mod, event.shiftKey));
535
- if (entry === void 0) return;
536
- event.preventDefault();
537
- entry.run(engine);
538
- };
539
- el.addEventListener("keydown", onKeyDown);
540
- return () => el.removeEventListener("keydown", onKeyDown);
541
- }
542
-
543
- // ../react/src/infinite-canvas.tsx
544
- import { useEffect as useEffect3, useRef as useRef5, useState } from "react";
545
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
546
- function InfiniteCanvas({
547
- engine,
548
- measureQueue,
549
- onReady,
550
- ground,
551
- grid: gridConfig,
552
- glRoute,
553
- keymapOverrides,
554
- className,
555
- style,
556
- children
557
- }) {
558
- const containerRef = useRef5(null);
559
- const [hosts, setHosts] = useState(void 0);
560
- const onReadyRef = useRef5(onReady);
561
- onReadyRef.current = onReady;
562
- const groundRef = useRef5(null);
563
- const gridConfigRef = useRef5(gridConfig);
564
- gridConfigRef.current = gridConfig;
565
- const glRouteRef = useRef5(glRoute);
566
- glRouteRef.current = glRoute;
567
- const keymapOverridesRef = useRef5(keymapOverrides);
568
- keymapOverridesRef.current = keymapOverrides;
569
- useEffect3(() => {
570
- const container = containerRef.current;
571
- if (container === null) return;
572
- const { world, engine: core, stack, runtime } = engine;
573
- const host = createCanvasHost(container);
574
- const planes = createPlanes(host);
575
- const planeArgs = { contentPlane: planes.content, liftedPlane: planes.lifted };
576
- const domWidgets = createDomWidgetsReflector(planeArgs, world, runtime.store);
577
- const remoteCursors = createRemoteCursorsReflector(host, world);
578
- const groundLayer = ground?.({
579
- host,
580
- world,
581
- readWirePreview: () => stack.wirePreview,
582
- readSpatial: (bounds) => stack.index.search(bounds)
583
- }) ?? null;
584
- groundRef.current = groundLayer;
585
- if (groundLayer !== null && gridConfigRef.current !== void 0) {
586
- groundLayer.configureGrid(gridConfigRef.current);
587
- }
588
- const chrome = createChromeReflector(host, world, stack.marqueeBuffer);
589
- const unregister = [
590
- core.registerReflector(createPlaneTransformReflector(planeArgs)),
591
- ...groundLayer !== null ? [core.registerReflector(groundLayer.reflector)] : [],
592
- core.registerReflector(domWidgets),
593
- core.registerReflector(chrome),
594
- core.registerReflector(createCursorReflector(host, stack.readCursor)),
595
- core.registerReflector(remoteCursors.reflector)
596
- ];
597
- const detachPointer = attachPointerAdapter(
598
- host,
599
- stack.queue,
600
- glRouteRef.current !== void 0 ? (
601
- // Pass the verdict through UNCOERCED: a rich GLRouteVerdict return
602
- // (hover-time overInteractive, 2026-07-18) must survive this seam.
603
- { glRoute: (kind, x, y, e) => glRouteRef.current?.(kind, x, y, e) ?? false }
604
- ) : {}
605
- );
606
- const detachMeasure = measureQueue !== void 0 ? wireMeasurement(runtime.store, domWidgets, measureQueue) : void 0;
607
- const detachKeymap = attachKeymap(engine, void 0, keymapOverridesRef.current ?? []);
608
- const focus = attachWidgetFocus(host, domWidgets);
609
- const syncViewport = () => {
610
- const rect = container.getBoundingClientRect();
611
- const dpr = typeof window !== "undefined" ? window.devicePixelRatio : 1;
612
- writeRuntimeResource(world, Viewport, { w: rect.width, h: rect.height, dpr });
613
- };
614
- syncViewport();
615
- let resizeObserver;
616
- if (typeof ResizeObserver !== "undefined") {
617
- resizeObserver = new ResizeObserver(syncViewport);
618
- resizeObserver.observe(container);
619
- }
620
- const stopLoop = startRafLoop(core);
621
- setHosts(domWidgets);
622
- onReadyRef.current?.({ engine, host, planes, focus });
623
- return () => {
624
- stopLoop();
625
- focus.detach();
626
- detachKeymap();
627
- detachMeasure?.();
628
- detachPointer();
629
- resizeObserver?.disconnect();
630
- for (const unreg of unregister) unreg();
631
- remoteCursors.destroy();
632
- groundLayer?.dispose();
633
- groundRef.current = null;
634
- domWidgets.dispose();
635
- chrome.dispose();
636
- planes.dispose();
637
- host.dispose();
638
- setHosts(void 0);
639
- };
640
- }, [engine, measureQueue, ground]);
641
- useEffect3(() => {
642
- if (gridConfig !== void 0) groundRef.current?.configureGrid(gridConfig);
643
- }, [gridConfig]);
644
- return /* @__PURE__ */ jsx3(EngineProvider, { engine, children: /* @__PURE__ */ jsxs2("div", { ref: containerRef, className, style: { width: "100%", height: "100%", ...style }, "data-ice-canvas": "", children: [
645
- hosts !== void 0 ? /* @__PURE__ */ jsx3(WidgetRoot, { world: engine.world, store: engine.runtime.store, hosts }) : null,
646
- children
647
- ] }) });
648
- }
649
-
650
- // ../react/src/index.ts
651
- var REACT_VERSION = "0.0.0";
652
-
653
- export {
654
- WidgetHiddenContext,
655
- useWorldComponent,
656
- useWidgetProps,
657
- useBehavior,
658
- useSelected,
659
- useBreakpoint,
660
- WidgetRoot,
661
- EngineProvider,
662
- useCanvasEngine,
663
- useOps,
664
- useStageHold,
665
- useFrameFreeze,
666
- useWorld,
667
- useCommit,
668
- useUndoStatus,
669
- setPreviewSnapshot,
670
- getPreviewSnapshot,
671
- hasPreviewSnapshot,
672
- subscribePreviewSnapshots,
673
- WidgetPreview,
674
- useTool,
675
- useToolState,
676
- usePresencePeers,
677
- attachKeymap,
678
- InfiniteCanvas,
679
- REACT_VERSION
680
- };
681
- //# sourceMappingURL=chunk-Q665T4L7.js.map