@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.
- package/README.md +79 -50
- package/dist/chunk-BA7XJC27.js +2429 -0
- package/dist/chunk-BA7XJC27.js.map +1 -0
- package/dist/chunk-BKV4ZEU3.js +1 -0
- package/dist/chunk-BKV4ZEU3.js.map +1 -0
- package/dist/{chunk-VGVDJZSP.js → chunk-DYK6KNLG.js} +13206 -7387
- package/dist/chunk-DYK6KNLG.js.map +1 -0
- package/dist/chunk-ENIFIUEP.js +155 -0
- package/dist/chunk-ENIFIUEP.js.map +1 -0
- package/dist/chunk-IBWWLA6D.js +634 -0
- package/dist/chunk-IBWWLA6D.js.map +1 -0
- package/dist/{chunk-OR5FNVUE.js → chunk-JS6PG6YD.js} +398 -167
- package/dist/chunk-JS6PG6YD.js.map +1 -0
- package/dist/chunk-QXOCF56A.js +148 -0
- package/dist/chunk-QXOCF56A.js.map +1 -0
- package/dist/chunk-ZPUPBULB.js +7399 -0
- package/dist/chunk-ZPUPBULB.js.map +1 -0
- package/dist/desk-engine.js +36 -0
- package/dist/desk-engine.js.map +1 -0
- package/dist/desk-kit.js +244 -0
- package/dist/desk-kit.js.map +1 -0
- package/dist/desk-objects.js +12728 -0
- package/dist/desk-objects.js.map +1 -0
- package/dist/desk.js +469 -0
- package/dist/desk.js.map +1 -0
- package/dist/devtools.js +233 -189
- package/dist/devtools.js.map +1 -1
- package/dist/dom.js +7 -19
- package/dist/index.js +232 -20
- package/dist/kernel.js +53 -25
- package/dist/react.js +1045 -38
- package/dist/react.js.map +1 -1
- package/dist/types/packages/core/src/behavior/define-behavior.d.ts +11 -0
- package/dist/types/packages/core/src/behavior/runtime.d.ts +4 -0
- package/dist/types/packages/core/src/canvas/define-canvas-type.d.ts +86 -0
- package/dist/types/packages/core/src/canvas/define-container.d.ts +17 -0
- package/dist/types/packages/core/src/canvas/diagnostics.d.ts +27 -0
- package/dist/types/packages/core/src/canvas/engine-catalog.d.ts +70 -0
- package/dist/types/packages/core/src/canvas/extensions.d.ts +125 -0
- package/dist/types/packages/core/src/canvas/frame-behavior-host.d.ts +16 -0
- package/dist/types/packages/core/src/canvas/frame-preview.d.ts +79 -0
- package/dist/types/packages/core/src/canvas/frame-projection.d.ts +38 -0
- package/dist/types/packages/core/src/canvas/frame-view.d.ts +36 -0
- package/dist/types/packages/core/src/canvas/migrate.d.ts +14 -0
- package/dist/types/packages/core/src/canvas/placement.d.ts +30 -0
- package/dist/types/packages/core/src/canvas/presentation-transition.d.ts +100 -0
- package/dist/types/packages/core/src/canvas/runtime-extension-host.d.ts +16 -0
- package/dist/types/packages/core/src/canvas/session.d.ts +47 -0
- package/dist/types/packages/core/src/catalog/camera-derived.d.ts +16 -27
- package/dist/types/packages/core/src/catalog/desk.d.ts +326 -0
- package/dist/types/packages/core/src/catalog/gesture.d.ts +51 -0
- package/dist/types/packages/core/src/catalog/graph.d.ts +2 -2
- package/dist/types/packages/core/src/catalog/index.d.ts +2 -0
- package/dist/types/packages/core/src/catalog/pointer.d.ts +42 -0
- package/dist/types/packages/core/src/catalog/selection-presence.d.ts +7 -0
- package/dist/types/packages/core/src/catalog/settings-resources.d.ts +28 -2
- package/dist/types/packages/core/src/catalog/surface.d.ts +1 -0
- package/dist/types/packages/core/src/doc/doc-commit-sink.d.ts +18 -2
- package/dist/types/packages/core/src/doc/doc-kit.d.ts +21 -2
- package/dist/types/packages/core/src/doc/envelope.d.ts +5 -2
- package/dist/types/packages/core/src/doc/schema-migrate.d.ts +1 -1
- package/dist/types/packages/core/src/doc/version-gate.d.ts +21 -3
- package/dist/types/packages/core/src/engine/commit-sink.d.ts +10 -1
- package/dist/types/packages/core/src/engine/engine.d.ts +6 -0
- package/dist/types/packages/core/src/engine/frame-control.d.ts +74 -0
- package/dist/types/packages/core/src/engine/guests.d.ts +4 -1
- package/dist/types/packages/core/src/engine/world-doors.d.ts +12 -0
- package/dist/types/packages/core/src/facade/create-canvas-engine.d.ts +146 -13
- package/dist/types/packages/core/src/index.d.ts +33 -12
- package/dist/types/packages/core/src/input/queue.d.ts +3 -1
- package/dist/types/packages/core/src/interaction/install.d.ts +30 -0
- package/dist/types/packages/core/src/interaction/wakes.d.ts +24 -0
- package/dist/types/packages/core/src/nav/nav-geometry.d.ts +100 -0
- package/dist/types/packages/core/src/nav/nested-canvas.d.ts +47 -4
- package/dist/types/packages/core/src/ops/cascade.d.ts +2 -1
- package/dist/types/packages/core/src/ops/claims.d.ts +6 -0
- package/dist/types/packages/core/src/ops/insert.d.ts +4 -0
- package/dist/types/packages/core/src/ops/point-pick.d.ts +4 -1
- package/dist/types/packages/core/src/ops/sibling-order.d.ts +14 -4
- package/dist/types/packages/core/src/ops/tray.d.ts +48 -0
- package/dist/types/packages/core/src/presence/presence-kit.d.ts +5 -0
- package/dist/types/packages/core/src/schema/meta.d.ts +10 -0
- package/dist/types/packages/core/src/schema/prefab.d.ts +8 -0
- package/dist/types/packages/core/src/settings/defaults.d.ts +25 -6
- package/dist/types/packages/core/src/surface/gpu-device.d.ts +55 -0
- package/dist/types/packages/core/src/systems/camera-sim.d.ts +29 -0
- package/dist/types/packages/core/src/systems/chrome.d.ts +15 -23
- package/dist/types/packages/core/src/systems/drag-mods.d.ts +34 -0
- package/dist/types/packages/core/src/systems/held.d.ts +71 -0
- package/dist/types/packages/core/src/systems/insert-ghost.d.ts +2 -0
- package/dist/types/packages/core/src/systems/l0-input.d.ts +14 -0
- package/dist/types/packages/core/src/systems/l1-pick.d.ts +37 -1
- package/dist/types/packages/core/src/systems/l2-arbitrate.d.ts +18 -4
- package/dist/types/packages/core/src/systems/l3-behave.d.ts +4 -1
- package/dist/types/packages/core/src/systems/l3-claim.d.ts +7 -0
- package/dist/types/packages/core/src/systems/l3-connect.d.ts +1 -1
- package/dist/types/packages/core/src/systems/l3-drop.d.ts +30 -1
- package/dist/types/packages/core/src/systems/l3-marquee.d.ts +2 -1
- package/dist/types/packages/core/src/systems/l3-ports.d.ts +1 -1
- package/dist/types/packages/core/src/systems/l4-cursor.d.ts +5 -0
- package/dist/types/packages/core/src/systems/nav-flight.d.ts +85 -3
- package/dist/types/packages/core/src/systems/nav-tap.d.ts +44 -0
- package/dist/types/packages/core/src/systems/press-wheel.d.ts +11 -0
- package/dist/types/packages/core/src/systems/tray.d.ts +108 -0
- package/dist/types/packages/core/src/systems/zoom-through.d.ts +30 -0
- package/dist/types/packages/core/src/tools/define-tool.d.ts +10 -0
- package/dist/types/packages/core/src/widget/define-widget.d.ts +166 -63
- package/dist/types/packages/core/src/widget/equip.d.ts +14 -2
- package/dist/types/packages/core/src/widget/held-tools.d.ts +83 -0
- package/dist/types/packages/core/src/widget/menu-actions.d.ts +44 -0
- package/dist/types/packages/core/src/widget/mount-store.d.ts +21 -46
- package/dist/types/packages/core/src/widget/spawn.d.ts +1 -1
- package/dist/types/packages/desk/src/assets/blue-noise.gen.d.ts +10 -0
- package/dist/types/packages/desk/src/card/card.d.ts +103 -0
- package/dist/types/packages/desk/src/compose/ambient.d.ts +59 -0
- package/dist/types/packages/desk/src/compose/builder.d.ts +285 -0
- package/dist/types/packages/desk/src/compose/children.d.ts +3 -0
- package/dist/types/packages/desk/src/compose/index.d.ts +14 -0
- package/dist/types/packages/desk/src/compose/marks.d.ts +126 -0
- package/dist/types/packages/desk/src/compose/pick.d.ts +5 -0
- package/dist/types/packages/desk/src/compose/reflector.d.ts +111 -0
- package/dist/types/packages/desk/src/compose/tap.d.ts +5 -0
- package/dist/types/packages/desk/src/docs.d.ts +23 -0
- package/dist/types/packages/desk/src/engine/budget.d.ts +38 -0
- package/dist/types/packages/desk/src/engine/device.d.ts +54 -0
- package/dist/types/packages/desk/src/engine/index.d.ts +5 -0
- package/dist/types/packages/desk/src/engine/pipeline.d.ts +36 -0
- package/dist/types/packages/desk/src/engine/rasters.d.ts +66 -0
- package/dist/types/packages/desk/src/engine/records.d.ts +56 -0
- package/dist/types/packages/desk/src/engine/shader.d.ts +22 -0
- package/dist/types/packages/desk/src/engine/struct.d.ts +39 -0
- package/dist/types/packages/desk/src/engine/target.d.ts +26 -0
- package/dist/types/packages/desk/src/gpu-ablation.d.ts +61 -0
- package/dist/types/packages/desk/src/gpu-memory.d.ts +54 -0
- package/dist/types/packages/desk/src/gpu-profiler.d.ts +141 -0
- package/dist/types/packages/desk/src/gpu-wrap.d.ts +8 -0
- package/dist/types/packages/desk/src/ground.d.ts +388 -0
- package/dist/types/packages/desk/src/hold/focus.d.ts +53 -0
- package/dist/types/packages/desk/src/hold/pose.d.ts +132 -0
- package/dist/types/packages/desk/src/hold/shaders.d.ts +9 -0
- package/dist/types/packages/desk/src/host/editor.d.ts +18 -0
- package/dist/types/packages/desk/src/host/index.d.ts +9 -0
- package/dist/types/packages/desk/src/host/ink.d.ts +18 -0
- package/dist/types/packages/desk/src/host/layer.d.ts +430 -0
- package/dist/types/packages/desk/src/host/picture.d.ts +2 -0
- package/dist/types/packages/desk/src/host/surface.d.ts +5 -0
- package/dist/types/packages/desk/src/index.d.ts +13 -0
- package/dist/types/packages/desk/src/kind.d.ts +187 -0
- package/dist/types/packages/desk/src/kinds/world.d.ts +429 -0
- package/dist/types/packages/desk/src/kit/arrays.d.ts +88 -0
- package/dist/types/packages/desk/src/kit/blobs.d.ts +40 -0
- package/dist/types/packages/desk/src/kit/book.d.ts +2 -0
- package/dist/types/packages/desk/src/kit/editor.d.ts +103 -0
- package/dist/types/packages/desk/src/kit/eye.d.ts +37 -0
- package/dist/types/packages/desk/src/kit/hold.d.ts +1 -0
- package/dist/types/packages/desk/src/kit/index.d.ts +26 -0
- package/dist/types/packages/desk/src/kit/inside.d.ts +116 -0
- package/dist/types/packages/desk/src/kit/layer.d.ts +159 -0
- package/dist/types/packages/desk/src/kit/light.d.ts +3 -0
- package/dist/types/packages/desk/src/kit/mesh.d.ts +29 -0
- package/dist/types/packages/desk/src/kit/mips.d.ts +2 -0
- package/dist/types/packages/desk/src/kit/nav.d.ts +2 -0
- package/dist/types/packages/desk/src/kit/paper-tex.d.ts +5 -0
- package/dist/types/packages/desk/src/kit/physics.d.ts +44 -0
- package/dist/types/packages/desk/src/kit/place.d.ts +44 -0
- package/dist/types/packages/desk/src/kit/print.d.ts +30 -0
- package/dist/types/packages/desk/src/kit/raster.d.ts +34 -0
- package/dist/types/packages/desk/src/kit/sdf.d.ts +1 -0
- package/dist/types/packages/desk/src/kit/seeds.d.ts +11 -0
- package/dist/types/packages/desk/src/kit/services.d.ts +34 -0
- package/dist/types/packages/desk/src/kit/springs.d.ts +12 -0
- package/dist/types/packages/desk/src/kit/strokes.d.ts +93 -0
- package/dist/types/packages/desk/src/kit/text.d.ts +142 -0
- package/dist/types/packages/desk/src/kit/uniform.d.ts +8 -0
- package/dist/types/packages/desk/src/kit/view.d.ts +39 -0
- package/dist/types/packages/desk/src/kit/wgsl.d.ts +15 -0
- package/dist/types/packages/desk/src/lattice/line.d.ts +15 -0
- package/dist/types/packages/desk/src/lattice/lod.d.ts +52 -0
- package/dist/types/packages/desk/src/lattice/ruler.d.ts +88 -0
- package/dist/types/packages/desk/src/marks/assemble.d.ts +65 -0
- package/dist/types/packages/desk/src/marks/ease.d.ts +4 -0
- package/dist/types/packages/desk/src/marks/laser.d.ts +41 -0
- package/dist/types/packages/desk/src/marks/layout.d.ts +167 -0
- package/dist/types/packages/desk/src/marks/pass.d.ts +59 -0
- package/dist/types/packages/desk/src/marks/shaders.d.ts +12 -0
- package/dist/types/packages/desk/src/mat/grid.d.ts +50 -0
- package/dist/types/packages/desk/src/mat/lamp.d.ts +14 -0
- package/dist/types/packages/desk/src/mat/layout.d.ts +144 -0
- package/dist/types/packages/desk/src/mat/mat-pass.d.ts +83 -0
- package/dist/types/packages/desk/src/mat/night.d.ts +95 -0
- package/dist/types/packages/desk/src/mat/projector.d.ts +39 -0
- package/dist/types/packages/desk/src/mat/shaders.d.ts +17 -0
- package/dist/types/packages/desk/src/mat/tilt.d.ts +14 -0
- package/dist/types/packages/desk/src/nav/flight.d.ts +186 -0
- package/dist/types/packages/desk/src/nav/portal.d.ts +95 -0
- package/dist/types/packages/desk/src/object.d.ts +46 -0
- package/dist/types/packages/desk/src/pass-instrument.d.ts +89 -0
- package/dist/types/packages/desk/src/shaders.d.ts +12 -0
- package/dist/types/packages/desk/src/shaders.gen.d.ts +16 -0
- package/dist/types/packages/desk/src/submit-instrument.d.ts +36 -0
- package/dist/types/packages/desk/src/theme.d.ts +475 -0
- package/dist/types/packages/desk/src/tray/carry.d.ts +99 -0
- package/dist/types/packages/desk/src/tray/drawer.d.ts +113 -0
- package/dist/types/packages/desk/src/tray/flux.d.ts +46 -0
- package/dist/types/packages/desk/src/tray/index.d.ts +4 -0
- package/dist/types/packages/desk/src/tray/lattice.d.ts +71 -0
- package/dist/types/packages/desk/src/tray/layout.d.ts +7 -0
- package/dist/types/packages/desk/src/tray/look.d.ts +29 -0
- package/dist/types/packages/desk/src/tray/pass.d.ts +96 -0
- package/dist/types/packages/desk/src/tray/shaders.d.ts +10 -0
- package/dist/types/packages/desk/src/tray/specimens.d.ts +199 -0
- package/dist/types/packages/devtools/src/attach.d.ts +22 -8
- package/dist/types/packages/devtools/src/dock.d.ts +18 -14
- package/dist/types/packages/devtools/src/gpu-panel.d.ts +105 -0
- package/dist/types/packages/devtools/src/index.d.ts +5 -4
- package/dist/types/packages/dom/src/desk-host.d.ts +91 -0
- package/dist/types/packages/dom/src/host.d.ts +13 -14
- package/dist/types/packages/dom/src/index.d.ts +12 -10
- package/dist/types/packages/dom/src/loop.d.ts +18 -1
- package/dist/types/packages/dom/src/pointer-adapter.d.ts +5 -29
- package/dist/types/packages/dom/src/widget-focus.d.ts +17 -13
- package/dist/types/packages/ice/src/desk-engine.d.ts +2 -0
- package/dist/types/packages/ice/src/desk-kit.d.ts +6 -0
- package/dist/types/packages/ice/src/desk-objects.d.ts +5 -0
- package/dist/types/packages/ice/src/desk.d.ts +5 -0
- package/dist/types/packages/kernel/src/atlas-pack.d.ts +157 -0
- package/dist/types/packages/kernel/src/bezier.d.ts +0 -15
- package/dist/types/packages/kernel/src/coords.d.ts +0 -39
- package/dist/types/packages/kernel/src/index.d.ts +2 -2
- package/dist/types/packages/kernel/src/nav-flight.d.ts +6 -0
- package/dist/types/packages/kernel/src/tray.d.ts +155 -0
- package/dist/types/packages/objects/src/board/board-pass.d.ts +180 -0
- package/dist/types/packages/objects/src/board/board-pen.d.ts +36 -0
- package/dist/types/packages/objects/src/board/board.d.ts +104 -0
- package/dist/types/packages/objects/src/board/data.d.ts +31 -0
- package/dist/types/packages/objects/src/board/history.d.ts +33 -0
- package/dist/types/packages/objects/src/board/kind.d.ts +208 -0
- package/dist/types/packages/objects/src/board/layout.d.ts +102 -0
- package/dist/types/packages/objects/src/board/object.d.ts +7 -0
- package/dist/types/packages/objects/src/board/pen.d.ts +71 -0
- package/dist/types/packages/objects/src/board/shaders.d.ts +36 -0
- package/dist/types/packages/objects/src/board/stroke.d.ts +99 -0
- package/dist/types/packages/objects/src/board/theme.d.ts +150 -0
- package/dist/types/packages/objects/src/calendar/data.d.ts +97 -0
- package/dist/types/packages/objects/src/calendar/events.d.ts +58 -0
- package/dist/types/packages/objects/src/calendar/hand.d.ts +53 -0
- package/dist/types/packages/objects/src/calendar/host/input.d.ts +67 -0
- package/dist/types/packages/objects/src/calendar/host/print.d.ts +9 -0
- package/dist/types/packages/objects/src/calendar/kind.d.ts +297 -0
- package/dist/types/packages/objects/src/calendar/law.d.ts +151 -0
- package/dist/types/packages/objects/src/calendar/layout.d.ts +47 -0
- package/dist/types/packages/objects/src/calendar/month.d.ts +75 -0
- package/dist/types/packages/objects/src/calendar/object.d.ts +45 -0
- package/dist/types/packages/objects/src/calendar/pad.d.ts +42 -0
- package/dist/types/packages/objects/src/calendar/pass.d.ts +229 -0
- package/dist/types/packages/objects/src/calendar/print.d.ts +87 -0
- package/dist/types/packages/objects/src/calendar/printing.d.ts +80 -0
- package/dist/types/packages/objects/src/calendar/roll.d.ts +45 -0
- package/dist/types/packages/objects/src/calendar/shaders.d.ts +12 -0
- package/dist/types/packages/objects/src/calendar/sheet.d.ts +43 -0
- package/dist/types/packages/objects/src/calendar/tiles.d.ts +67 -0
- package/dist/types/packages/objects/src/calendar/turn.d.ts +73 -0
- package/dist/types/packages/objects/src/calendar/writing.d.ts +42 -0
- package/dist/types/packages/objects/src/index.d.ts +22 -0
- package/dist/types/packages/objects/src/kinds.d.ts +24 -0
- package/dist/types/packages/objects/src/minimat/inside.d.ts +17 -0
- package/dist/types/packages/objects/src/minimat/kind.d.ts +51 -0
- package/dist/types/packages/objects/src/minimat/layout.d.ts +83 -0
- package/dist/types/packages/objects/src/minimat/minimat.d.ts +179 -0
- package/dist/types/packages/objects/src/minimat/object.d.ts +8 -0
- package/dist/types/packages/objects/src/minimat/pass.d.ts +61 -0
- package/dist/types/packages/objects/src/minimat/shaders.d.ts +10 -0
- package/dist/types/packages/objects/src/minimat/theme.d.ts +98 -0
- package/dist/types/packages/objects/src/notebook/ink.d.ts +70 -0
- package/dist/types/packages/objects/src/notebook/kind.d.ts +236 -0
- package/dist/types/packages/objects/src/notebook/law.d.ts +129 -0
- package/dist/types/packages/objects/src/notebook/layout.d.ts +46 -0
- package/dist/types/packages/objects/src/notebook/leaf.d.ts +44 -0
- package/dist/types/packages/objects/src/notebook/mesh.d.ts +20 -0
- package/dist/types/packages/objects/src/notebook/motion.d.ts +107 -0
- package/dist/types/packages/objects/src/notebook/object.d.ts +8 -0
- package/dist/types/packages/objects/src/notebook/pages.d.ts +56 -0
- package/dist/types/packages/objects/src/notebook/pass.d.ts +197 -0
- package/dist/types/packages/objects/src/notebook/pick.d.ts +30 -0
- package/dist/types/packages/objects/src/notebook/raster.d.ts +28 -0
- package/dist/types/packages/objects/src/notebook/shaders.d.ts +11 -0
- package/dist/types/packages/objects/src/notebook/shape.d.ts +155 -0
- package/dist/types/packages/objects/src/notebook/theme.d.ts +76 -0
- package/dist/types/packages/objects/src/palette.d.ts +577 -0
- package/dist/types/packages/objects/src/paper/host/body.d.ts +30 -0
- package/dist/types/packages/objects/src/paper/kind.d.ts +81 -0
- package/dist/types/packages/objects/src/paper/layout.d.ts +73 -0
- package/dist/types/packages/objects/src/paper/object.d.ts +31 -0
- package/dist/types/packages/objects/src/paper/pages.d.ts +43 -0
- package/dist/types/packages/objects/src/paper/paper-pass.d.ts +86 -0
- package/dist/types/packages/objects/src/paper/paper.d.ts +117 -0
- package/dist/types/packages/objects/src/paper/shaders.d.ts +18 -0
- package/dist/types/packages/objects/src/paper/theme.d.ts +58 -0
- package/dist/types/packages/objects/src/paper/typing.d.ts +51 -0
- package/dist/types/packages/objects/src/paper/writing.d.ts +161 -0
- package/dist/types/packages/objects/src/photo/carry.d.ts +33 -0
- package/dist/types/packages/objects/src/photo/kind.d.ts +136 -0
- package/dist/types/packages/objects/src/photo/layout.d.ts +39 -0
- package/dist/types/packages/objects/src/photo/object.d.ts +5 -0
- package/dist/types/packages/objects/src/photo/photo-pass.d.ts +104 -0
- package/dist/types/packages/objects/src/photo/photo.d.ts +262 -0
- package/dist/types/packages/objects/src/photo/pictures.d.ts +152 -0
- package/dist/types/packages/objects/src/photo/sample.d.ts +9 -0
- package/dist/types/packages/objects/src/photo/shaders.d.ts +18 -0
- package/dist/types/packages/objects/src/preset.d.ts +44 -0
- package/dist/types/packages/objects/src/shaders.d.ts +3 -0
- package/dist/types/packages/objects/src/shaders.gen.d.ts +21 -0
- package/dist/types/packages/react/src/canvas-hooks.d.ts +12 -0
- package/dist/types/packages/react/src/desk.d.ts +56 -0
- package/dist/types/packages/react/src/engine-context.d.ts +2 -2
- package/dist/types/packages/react/src/frame-preview-boundary.d.ts +19 -0
- package/dist/types/packages/react/src/hooks.d.ts +9 -14
- package/dist/types/packages/react/src/index.d.ts +16 -9
- package/dist/types/packages/react/src/keymap.d.ts +21 -2
- package/dist/types/packages/react/src/selection-menu.d.ts +171 -0
- package/dist/types/packages/react/src/tray-bar.d.ts +124 -0
- package/package.json +64 -31
- package/dist/chunk-2TNVB2ON.js +0 -1163
- package/dist/chunk-2TNVB2ON.js.map +0 -1
- package/dist/chunk-OR5FNVUE.js.map +0 -1
- package/dist/chunk-Q665T4L7.js +0 -681
- package/dist/chunk-Q665T4L7.js.map +0 -1
- package/dist/chunk-VGVDJZSP.js.map +0 -1
- package/dist/ground.js +0 -1108
- package/dist/ground.js.map +0 -1
- package/dist/r3f.js +0 -1644
- package/dist/r3f.js.map +0 -1
- package/dist/types/packages/core/src/input/measure-queue.d.ts +0 -30
- package/dist/types/packages/core/src/settings/ground-config.d.ts +0 -101
- package/dist/types/packages/core/src/systems/measure-ingest.d.ts +0 -26
- package/dist/types/packages/devtools/src/gl-panel.d.ts +0 -69
- package/dist/types/packages/dom/src/measure-adapter.d.ts +0 -31
- package/dist/types/packages/dom/src/measure-wiring.d.ts +0 -49
- package/dist/types/packages/dom/src/planes.d.ts +0 -33
- package/dist/types/packages/dom/src/reflectors/chrome.d.ts +0 -33
- package/dist/types/packages/dom/src/reflectors/dom-widgets.d.ts +0 -59
- package/dist/types/packages/dom/src/reflectors/graybox.d.ts +0 -31
- package/dist/types/packages/dom/src/reflectors/plane-transform.d.ts +0 -38
- package/dist/types/packages/ground/src/index.d.ts +0 -69
- package/dist/types/packages/ground/src/layer.d.ts +0 -40
- package/dist/types/packages/ground/src/pass.d.ts +0 -41
- package/dist/types/packages/ground/src/passes/grid-contract.d.ts +0 -28
- package/dist/types/packages/ground/src/passes/grid-magnet-pass.d.ts +0 -2
- package/dist/types/packages/ground/src/passes/grid-magnet.d.ts +0 -31
- package/dist/types/packages/ground/src/passes/grid.d.ts +0 -10
- package/dist/types/packages/ground/src/passes/guides-collect.d.ts +0 -14
- package/dist/types/packages/ground/src/passes/guides.d.ts +0 -3
- package/dist/types/packages/ground/src/passes/magnet-collect.d.ts +0 -63
- package/dist/types/packages/ground/src/passes/soup-collect.d.ts +0 -35
- package/dist/types/packages/ground/src/passes/soup-mesh.d.ts +0 -8
- package/dist/types/packages/ground/src/passes/wires-collect.d.ts +0 -35
- package/dist/types/packages/ground/src/passes/wires.d.ts +0 -10
- package/dist/types/packages/ground/src/poles.d.ts +0 -47
- package/dist/types/packages/ground/src/renderer.d.ts +0 -15
- package/dist/types/packages/ice/src/ground.d.ts +0 -1
- package/dist/types/packages/ice/src/r3f.d.ts +0 -1
- package/dist/types/packages/kernel/src/eviction.d.ts +0 -23
- package/dist/types/packages/kernel/src/zoom-bands.d.ts +0 -19
- package/dist/types/packages/r3f/src/bridge.d.ts +0 -129
- package/dist/types/packages/r3f/src/composite-material.d.ts +0 -26
- package/dist/types/packages/r3f/src/compositor-pass.d.ts +0 -105
- package/dist/types/packages/r3f/src/dev-write-trap.d.ts +0 -30
- package/dist/types/packages/r3f/src/gl-root.d.ts +0 -96
- package/dist/types/packages/r3f/src/gl-router.d.ts +0 -70
- package/dist/types/packages/r3f/src/index.d.ts +0 -17
- package/dist/types/packages/r3f/src/island-state.d.ts +0 -112
- package/dist/types/packages/r3f/src/island.d.ts +0 -13
- package/dist/types/packages/r3f/src/pool.d.ts +0 -56
- package/dist/types/packages/r3f/src/preview-capture.d.ts +0 -19
- package/dist/types/packages/r3f/src/resource-registry.d.ts +0 -30
- package/dist/types/packages/r3f/src/self-sustain.d.ts +0 -39
- package/dist/types/packages/r3f/src/use-island-frame.d.ts +0 -39
- package/dist/types/packages/react/src/infinite-canvas.d.ts +0 -140
- package/dist/types/packages/react/src/preview-snapshots.d.ts +0 -17
- package/dist/types/packages/react/src/widget-preview.d.ts +0 -14
- package/dist/types/packages/react/src/widget-root.d.ts +0 -33
|
@@ -37,51 +37,14 @@ function zoomAtPoint(camera, screenX, screenY, newZoom) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
function fitCamera(content, vpW, vpH, opts) {
|
|
40
|
-
const
|
|
41
|
-
const zoom = Math.min(opts.maxZoom, Math.max(opts.minZoom,
|
|
40
|
+
const fit2 = Math.min(vpW / (content.width + opts.pad * 2), vpH / (content.height + opts.pad * 2));
|
|
41
|
+
const zoom = Math.min(opts.maxZoom, Math.max(opts.minZoom, fit2));
|
|
42
42
|
return {
|
|
43
43
|
x: content.x + content.width / 2 - vpW / (2 * zoom),
|
|
44
44
|
y: content.y + content.height / 2 - vpH / (2 * zoom),
|
|
45
45
|
zoom
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
function planeCssTransform(camera) {
|
|
49
|
-
return {
|
|
50
|
-
tx: -camera.x * camera.zoom,
|
|
51
|
-
ty: -camera.y * camera.zoom,
|
|
52
|
-
scale: camera.zoom
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function worldToIsland(worldX, worldY, widget) {
|
|
56
|
-
return {
|
|
57
|
-
x: worldX - (widget.x + widget.width / 2),
|
|
58
|
-
y: -(worldY - (widget.y + widget.height / 2))
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function islandToWorld(islandX, islandY, widget) {
|
|
62
|
-
return {
|
|
63
|
-
x: widget.x + widget.width / 2 + islandX,
|
|
64
|
-
y: widget.y + widget.height / 2 - islandY
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function compositeCameraFrustum(camera, viewportW, viewportH) {
|
|
68
|
-
return {
|
|
69
|
-
left: 0,
|
|
70
|
-
right: viewportW / camera.zoom,
|
|
71
|
-
top: 0,
|
|
72
|
-
bottom: -(viewportH / camera.zoom),
|
|
73
|
-
x: camera.x,
|
|
74
|
-
y: -camera.y
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function worldRectToComposite(rect) {
|
|
78
|
-
return {
|
|
79
|
-
x: rect.x + rect.width / 2,
|
|
80
|
-
y: -(rect.y + rect.height / 2),
|
|
81
|
-
sx: rect.width,
|
|
82
|
-
sy: rect.height
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
48
|
|
|
86
49
|
// ../kernel/src/snap.ts
|
|
87
50
|
function computeSnapGuides(dragged, references, threshold) {
|
|
@@ -376,64 +339,6 @@ var SpatialIndex = class {
|
|
|
376
339
|
}
|
|
377
340
|
};
|
|
378
341
|
|
|
379
|
-
// ../kernel/src/zoom-bands.ts
|
|
380
|
-
var ZOOM_BANDS = [0.0625, 0.125, 0.25, 0.5, 1, 2, 4, 8, 16];
|
|
381
|
-
var MIN_BAND = 0.0625;
|
|
382
|
-
var MAX_BAND = 16;
|
|
383
|
-
function selectBand(zoom) {
|
|
384
|
-
if (zoom <= MIN_BAND) return MIN_BAND;
|
|
385
|
-
if (zoom >= MAX_BAND) return MAX_BAND;
|
|
386
|
-
for (const b of ZOOM_BANDS) {
|
|
387
|
-
if (zoom <= b) return b;
|
|
388
|
-
}
|
|
389
|
-
return MAX_BAND;
|
|
390
|
-
}
|
|
391
|
-
function isOutOfBand(currentZoom, paintedBand) {
|
|
392
|
-
if (paintedBand <= 0) return false;
|
|
393
|
-
const ratio = currentZoom / paintedBand;
|
|
394
|
-
return ratio > 2 || ratio < 0.5;
|
|
395
|
-
}
|
|
396
|
-
function fboPixelSize(worldWidth, worldHeight, dpr, band) {
|
|
397
|
-
return {
|
|
398
|
-
width: Math.max(1, Math.round(worldWidth * dpr * band)),
|
|
399
|
-
height: Math.max(1, Math.round(worldHeight * dpr * band))
|
|
400
|
-
};
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
// ../kernel/src/eviction.ts
|
|
404
|
-
var PHASE_PRIORITY = {
|
|
405
|
-
Cold: 0,
|
|
406
|
-
Warm: 1,
|
|
407
|
-
Dormant: 2,
|
|
408
|
-
Waking: Number.POSITIVE_INFINITY,
|
|
409
|
-
Hot: Number.POSITIVE_INFINITY
|
|
410
|
-
};
|
|
411
|
-
function computeIslandPhase(active, visible, animating, hasFbo) {
|
|
412
|
-
if (!active) return "Dormant";
|
|
413
|
-
if (visible) {
|
|
414
|
-
if (animating) return "Hot";
|
|
415
|
-
return hasFbo ? "Warm" : "Waking";
|
|
416
|
-
}
|
|
417
|
-
return "Cold";
|
|
418
|
-
}
|
|
419
|
-
function selectEvictions(candidates, totalBytes, maxBytes) {
|
|
420
|
-
if (totalBytes <= maxBytes) return [];
|
|
421
|
-
const eligible = candidates.filter((c) => Number.isFinite(PHASE_PRIORITY[c.phase]));
|
|
422
|
-
eligible.sort((a, b) => {
|
|
423
|
-
const p = PHASE_PRIORITY[a.phase] - PHASE_PRIORITY[b.phase];
|
|
424
|
-
if (p !== 0) return p;
|
|
425
|
-
return a.lastUsedMs - b.lastUsedMs;
|
|
426
|
-
});
|
|
427
|
-
const toEvict = [];
|
|
428
|
-
let remaining = totalBytes;
|
|
429
|
-
for (const c of eligible) {
|
|
430
|
-
if (remaining <= maxBytes) break;
|
|
431
|
-
toEvict.push(c.id);
|
|
432
|
-
remaining -= c.bytes;
|
|
433
|
-
}
|
|
434
|
-
return toEvict;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
342
|
// ../kernel/src/anchors.ts
|
|
438
343
|
function portAnchor(widget, slot) {
|
|
439
344
|
const f = (slot.index + 1) / (slot.count + 1);
|
|
@@ -497,62 +402,6 @@ function cubicAABB(c) {
|
|
|
497
402
|
maxY: Math.max(c.y0, c.y1, c.y2, c.y3)
|
|
498
403
|
};
|
|
499
404
|
}
|
|
500
|
-
function flatEnough(c, tolSq) {
|
|
501
|
-
const dx = c.x3 - c.x0;
|
|
502
|
-
const dy = c.y3 - c.y0;
|
|
503
|
-
const chordSq = dx * dx + dy * dy;
|
|
504
|
-
if (chordSq <= 1e-12) {
|
|
505
|
-
const d12 = Math.hypot(c.x1 - c.x0, c.y1 - c.y0);
|
|
506
|
-
const d22 = Math.hypot(c.x2 - c.x0, c.y2 - c.y0);
|
|
507
|
-
return (d12 + d22) * (d12 + d22) <= tolSq;
|
|
508
|
-
}
|
|
509
|
-
const d1 = Math.abs((c.x1 - c.x0) * dy - (c.y1 - c.y0) * dx);
|
|
510
|
-
const d2 = Math.abs((c.x2 - c.x0) * dy - (c.y2 - c.y0) * dx);
|
|
511
|
-
return (d1 + d2) * (d1 + d2) <= tolSq * chordSq;
|
|
512
|
-
}
|
|
513
|
-
function splitCubic(c) {
|
|
514
|
-
const ax = (c.x0 + c.x1) / 2;
|
|
515
|
-
const ay = (c.y0 + c.y1) / 2;
|
|
516
|
-
const bx = (c.x1 + c.x2) / 2;
|
|
517
|
-
const by = (c.y1 + c.y2) / 2;
|
|
518
|
-
const cx = (c.x2 + c.x3) / 2;
|
|
519
|
-
const cy = (c.y2 + c.y3) / 2;
|
|
520
|
-
const abx = (ax + bx) / 2;
|
|
521
|
-
const aby = (ay + by) / 2;
|
|
522
|
-
const bcx = (bx + cx) / 2;
|
|
523
|
-
const bcy = (by + cy) / 2;
|
|
524
|
-
const mx = (abx + bcx) / 2;
|
|
525
|
-
const my = (aby + bcy) / 2;
|
|
526
|
-
return [
|
|
527
|
-
{ x0: c.x0, y0: c.y0, x1: ax, y1: ay, x2: abx, y2: aby, x3: mx, y3: my },
|
|
528
|
-
{ x0: mx, y0: my, x1: bcx, y1: bcy, x2: cx, y2: cy, x3: c.x3, y3: c.y3 }
|
|
529
|
-
];
|
|
530
|
-
}
|
|
531
|
-
function tessellateCubic(c, tolerance = 0.25, maxDepth = 16) {
|
|
532
|
-
const pts = [c.x0, c.y0];
|
|
533
|
-
const tolSq = tolerance * tolerance;
|
|
534
|
-
const walk = (cur, depth) => {
|
|
535
|
-
if (depth >= maxDepth || flatEnough(cur, tolSq)) {
|
|
536
|
-
pts.push(cur.x3, cur.y3);
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
const [l, r] = splitCubic(cur);
|
|
540
|
-
walk(l, depth + 1);
|
|
541
|
-
walk(r, depth + 1);
|
|
542
|
-
};
|
|
543
|
-
walk(c, 0);
|
|
544
|
-
const n = pts.length / 2;
|
|
545
|
-
const points = new Float32Array(pts);
|
|
546
|
-
const arcLength = new Float32Array(n);
|
|
547
|
-
let acc = 0;
|
|
548
|
-
for (let i = 1; i < n; i++) {
|
|
549
|
-
const dx = pts[i * 2] - pts[i * 2 - 2];
|
|
550
|
-
const dy = pts[i * 2 + 1] - pts[i * 2 - 1];
|
|
551
|
-
acc += Math.hypot(dx, dy);
|
|
552
|
-
arcLength[i] = acc;
|
|
553
|
-
}
|
|
554
|
-
return { points, arcLength };
|
|
555
|
-
}
|
|
556
405
|
function distanceToSegment(px, py, ax, ay, bx, by) {
|
|
557
406
|
const dx = bx - ax;
|
|
558
407
|
const dy = by - ay;
|
|
@@ -638,6 +487,13 @@ function solveFlightStart(A, camPre) {
|
|
|
638
487
|
zoom: camPre.zoom / A.s
|
|
639
488
|
};
|
|
640
489
|
}
|
|
490
|
+
function outgoingCamera(A, destination) {
|
|
491
|
+
return {
|
|
492
|
+
x: (destination.x - A.ox) / A.s,
|
|
493
|
+
y: (destination.y - A.oy) / A.s,
|
|
494
|
+
zoom: A.s * destination.zoom
|
|
495
|
+
};
|
|
496
|
+
}
|
|
641
497
|
function flightOctaves(from, to) {
|
|
642
498
|
return Math.abs(Math.log2(to.zoom / from.zoom));
|
|
643
499
|
}
|
|
@@ -658,7 +514,7 @@ function flightCamera(c0, c1, p, vpW, vpH) {
|
|
|
658
514
|
const inv0 = 1 / c0.zoom;
|
|
659
515
|
const inv1 = 1 / c1.zoom;
|
|
660
516
|
const inv = 1 / zoom;
|
|
661
|
-
const w = Math.abs(inv1 - inv0)
|
|
517
|
+
const w = Math.abs(inv1 - inv0) <= 1e-9 * Math.max(inv0, inv1) ? p : (inv - inv0) / (inv1 - inv0);
|
|
662
518
|
const cx = c0.x + vpW * inv0 * 0.5 + (c1.x + vpW * inv1 * 0.5 - (c0.x + vpW * inv0 * 0.5)) * w;
|
|
663
519
|
const cy = c0.y + vpH * inv0 * 0.5 + (c1.y + vpH * inv1 * 0.5 - (c0.y + vpH * inv0 * 0.5)) * w;
|
|
664
520
|
return { x: cx - vpW * inv * 0.5, y: cy - vpH * inv * 0.5, zoom };
|
|
@@ -957,6 +813,367 @@ function layerGraph(nodes, edges, opts) {
|
|
|
957
813
|
return out;
|
|
958
814
|
}
|
|
959
815
|
|
|
816
|
+
// ../kernel/src/tray.ts
|
|
817
|
+
var PEG_LATTICE = {
|
|
818
|
+
/** A hole's centre: x = c + colPhase + ½·(r odd) from the board's left edge… */
|
|
819
|
+
colPhase: 0.25,
|
|
820
|
+
/** …at y = r + rowPhase below its top at scroll 0. */
|
|
821
|
+
rowPhase: 0.75,
|
|
822
|
+
/** A hole is punched only where its centre lies this far from both sides (the solid border). */
|
|
823
|
+
border: 0.75
|
|
824
|
+
};
|
|
825
|
+
var TRAY_ACCESSORIES = ["hook", "shelf", "clip", "rail"];
|
|
826
|
+
var TRAY_ACCESSORY = {
|
|
827
|
+
/** Round a peg: the plug in its hole and the reach of what sits on it (a hole is 0.26 × 0.66). */
|
|
828
|
+
plug: { hx: 0.17, hy: 0.4 },
|
|
829
|
+
hook: { hx: 0.12, drop: 0.62 },
|
|
830
|
+
shelf: { thick: 0.24, overhang: 0.3, bracket: 0.1 },
|
|
831
|
+
clip: { hx: 0.3, below: 0.55 },
|
|
832
|
+
rail: { hy: 0.13, overhang: 0.4 }
|
|
833
|
+
};
|
|
834
|
+
var TRAY_SPACING = { margin: 0.5, gap: 1, top: 2, clear: 1 };
|
|
835
|
+
var EPS = 1e-9;
|
|
836
|
+
var whole = (v) => Math.abs(v - Math.round(v)) < 1e-9;
|
|
837
|
+
function hangError(h) {
|
|
838
|
+
if (typeof h !== "object" || h === null) return "a hang is { w, h, pegs, accessory }";
|
|
839
|
+
if (!(Number.isFinite(h.w) && h.w > 0 && Number.isFinite(h.h) && h.h > 0)) return `its size ${h.w} \xD7 ${h.h} is not a positive CSS px size`;
|
|
840
|
+
if (!TRAY_ACCESSORIES.includes(h.accessory)) return `its accessory "${String(h.accessory)}" is not one of ${TRAY_ACCESSORIES.join(", ")}`;
|
|
841
|
+
if (!Array.isArray(h.pegs) || h.pegs.length === 0) return "it names no peg \u2014 an accessory plugs into at least one hole";
|
|
842
|
+
const [x0, y0] = h.pegs[0];
|
|
843
|
+
for (const p of h.pegs) {
|
|
844
|
+
if (!Array.isArray(p) || p.length !== 2 || !Number.isFinite(p[0]) || !Number.isFinite(p[1])) return `a peg ${JSON.stringify(p)} is not [dx, dy] in pitches`;
|
|
845
|
+
const dy = p[1] - y0;
|
|
846
|
+
const dx = p[0] - x0;
|
|
847
|
+
if (!whole(dy)) return `the peg [${p.join(", ")}] is ${dy} rows from the first \u2014 pegs lie a whole number of rows apart`;
|
|
848
|
+
if (!whole(dx - dy / 2)) return `the peg [${p.join(", ")}] is ${dx} pitches across from the first over ${dy} rows \u2014 the stagger puts holes a whole pitch apart on one parity, a half on the other`;
|
|
849
|
+
}
|
|
850
|
+
return null;
|
|
851
|
+
}
|
|
852
|
+
function trayOrder(a, b) {
|
|
853
|
+
const ca = a.category ?? "";
|
|
854
|
+
const cb = b.category ?? "";
|
|
855
|
+
if (ca !== cb) return ca < cb ? -1 : 1;
|
|
856
|
+
const oa = a.order ?? 0;
|
|
857
|
+
const ob = b.order ?? 0;
|
|
858
|
+
if (oa !== ob) return oa - ob;
|
|
859
|
+
return a.type < b.type ? -1 : a.type > b.type ? 1 : 0;
|
|
860
|
+
}
|
|
861
|
+
function hangFootprint(h, pitch) {
|
|
862
|
+
const A = TRAY_ACCESSORY;
|
|
863
|
+
const hw = h.w / pitch / 2;
|
|
864
|
+
const hh = h.h / pitch;
|
|
865
|
+
const shelf = h.accessory === "shelf";
|
|
866
|
+
let x0 = -hw;
|
|
867
|
+
let x1 = hw;
|
|
868
|
+
let y0 = shelf ? -hh : 0;
|
|
869
|
+
let y1 = shelf ? 0 : hh;
|
|
870
|
+
const add = (a, b, c, d) => {
|
|
871
|
+
x0 = Math.min(x0, a);
|
|
872
|
+
y0 = Math.min(y0, b);
|
|
873
|
+
x1 = Math.max(x1, c);
|
|
874
|
+
y1 = Math.max(y1, d);
|
|
875
|
+
};
|
|
876
|
+
const xs = h.pegs.map((p) => p[0]);
|
|
877
|
+
for (const [dx, dy] of h.pegs) {
|
|
878
|
+
add(dx - A.plug.hx, dy - A.plug.hy, dx + A.plug.hx, dy + A.plug.hy);
|
|
879
|
+
if (h.accessory === "hook") add(dx - A.hook.hx, dy, dx + A.hook.hx, dy + A.hook.drop);
|
|
880
|
+
if (h.accessory === "clip") add(dx - A.clip.hx, dy, dx + A.clip.hx, Math.max(dy, 0) + A.clip.below);
|
|
881
|
+
if (shelf) add(dx - A.shelf.bracket, Math.min(0, dy), dx + A.shelf.bracket, Math.max(0, dy));
|
|
882
|
+
}
|
|
883
|
+
if (shelf) add(-hw - A.shelf.overhang, 0, hw + A.shelf.overhang, A.shelf.thick);
|
|
884
|
+
if (h.accessory === "rail") {
|
|
885
|
+
const ys = h.pegs.map((p) => p[1]);
|
|
886
|
+
add(Math.min(...xs) - A.rail.overhang, Math.min(...ys) - A.rail.hy, Math.max(...xs) + A.rail.overhang, Math.max(...ys) + A.rail.hy);
|
|
887
|
+
}
|
|
888
|
+
return { x0, y0, x1, y1 };
|
|
889
|
+
}
|
|
890
|
+
function holeAt(x, y) {
|
|
891
|
+
const row = Math.round(y - PEG_LATTICE.rowPhase);
|
|
892
|
+
const col = Math.round(x - PEG_LATTICE.colPhase - ((row & 1) !== 0 ? 0.5 : 0));
|
|
893
|
+
return { row, col };
|
|
894
|
+
}
|
|
895
|
+
var bodyTop = (h, pitch) => h.accessory === "shelf" ? -h.h / pitch : 0;
|
|
896
|
+
function fit(item, top, body, left, pitch) {
|
|
897
|
+
const L = PEG_LATTICE;
|
|
898
|
+
const h = item.hang;
|
|
899
|
+
const fp = hangFootprint(h, pitch);
|
|
900
|
+
const [dx0, dy0] = h.pegs[0];
|
|
901
|
+
const r0 = Math.ceil(Math.max(top - fp.y0, body - bodyTop(h, pitch)) + dy0 - L.rowPhase - EPS);
|
|
902
|
+
const hy = r0 + L.rowPhase - dy0;
|
|
903
|
+
const odd = (r0 & 1) !== 0 ? 0.5 : 0;
|
|
904
|
+
const minDx = Math.min(...h.pegs.map((p) => p[0]));
|
|
905
|
+
const want = Math.max(left - fp.x0 + dx0, L.border - minDx + dx0);
|
|
906
|
+
const c0 = Math.ceil(want - L.colPhase - odd - EPS);
|
|
907
|
+
const hx = c0 + L.colPhase + odd - dx0;
|
|
908
|
+
return { hx, hy, box: { x0: hx + fp.x0, y0: hy + fp.y0, x1: hx + fp.x1, y1: hy + fp.y1 }, pegs: h.pegs.map(([dx, dy]) => [hx + dx, hy + dy]) };
|
|
909
|
+
}
|
|
910
|
+
function layTray(items, width, pitch, spacing = TRAY_SPACING) {
|
|
911
|
+
const S = spacing;
|
|
912
|
+
const cols = width / pitch;
|
|
913
|
+
const sorted = [...items].sort(trayOrder);
|
|
914
|
+
const lead = Math.max(0, ...sorted.map((i) => bodyTop(i.hang, pitch) - hangFootprint(i.hang, pitch).y0));
|
|
915
|
+
const placed = [];
|
|
916
|
+
let top = S.top;
|
|
917
|
+
let left = S.margin;
|
|
918
|
+
let foot = top;
|
|
919
|
+
let line = 0;
|
|
920
|
+
let inLine = 0;
|
|
921
|
+
const fits = (f) => f.box.x1 <= cols - S.margin + EPS && f.pegs.every(([x]) => x <= cols - PEG_LATTICE.border + EPS);
|
|
922
|
+
for (const item of sorted) {
|
|
923
|
+
let f = fit(item, top, top + lead, left, pitch);
|
|
924
|
+
if (inLine > 0 && !fits(f)) {
|
|
925
|
+
top = foot + S.clear;
|
|
926
|
+
left = S.margin;
|
|
927
|
+
line += 1;
|
|
928
|
+
inLine = 0;
|
|
929
|
+
f = fit(item, top, top + lead, left, pitch);
|
|
930
|
+
}
|
|
931
|
+
const h = item.hang;
|
|
932
|
+
const x = f.hx * pitch - h.w / 2;
|
|
933
|
+
const y = h.accessory === "shelf" ? f.hy * pitch - h.h : f.hy * pitch;
|
|
934
|
+
placed.push({
|
|
935
|
+
type: item.type,
|
|
936
|
+
x,
|
|
937
|
+
y,
|
|
938
|
+
w: h.w,
|
|
939
|
+
h: h.h,
|
|
940
|
+
line,
|
|
941
|
+
pegs: f.pegs.map(([px, py]) => {
|
|
942
|
+
const { row, col } = holeAt(px, py);
|
|
943
|
+
return { row, col, x: px * pitch, y: py * pitch };
|
|
944
|
+
}),
|
|
945
|
+
box: { x0: f.box.x0 * pitch, y0: f.box.y0 * pitch, x1: f.box.x1 * pitch, y1: f.box.y1 * pitch }
|
|
946
|
+
});
|
|
947
|
+
left = f.box.x1 + S.gap;
|
|
948
|
+
foot = inLine === 0 ? f.box.y1 : Math.max(foot, f.box.y1);
|
|
949
|
+
inLine += 1;
|
|
950
|
+
}
|
|
951
|
+
return { placed, bottom: placed.length === 0 ? 0 : foot * pitch };
|
|
952
|
+
}
|
|
953
|
+
function trayScrollMax(bottom, face, pitch) {
|
|
954
|
+
return bottom <= 0 ? 0 : Math.max(0, bottom + pitch - face);
|
|
955
|
+
}
|
|
956
|
+
function specimenFit(rect, natural) {
|
|
957
|
+
const zoom = Math.min(rect.w / natural.w, rect.h / natural.h);
|
|
958
|
+
const w = natural.w * zoom;
|
|
959
|
+
const h = natural.h * zoom;
|
|
960
|
+
return { zoom, x: rect.x + (rect.w - w) / 2, y: rect.y + (rect.h - h) / 2, w, h };
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
// ../kernel/src/atlas-pack.ts
|
|
964
|
+
var DEFAULT_ATLAS_GUTTER = 2;
|
|
965
|
+
function createShelfPage(width, height, gutter = DEFAULT_ATLAS_GUTTER) {
|
|
966
|
+
return { width, height, gutter, shelves: [], holes: [], usedArea: 0 };
|
|
967
|
+
}
|
|
968
|
+
function cloneShelfPage(page) {
|
|
969
|
+
return {
|
|
970
|
+
width: page.width,
|
|
971
|
+
height: page.height,
|
|
972
|
+
gutter: page.gutter,
|
|
973
|
+
shelves: page.shelves.map((s) => ({ ...s })),
|
|
974
|
+
holes: page.holes.map((h) => ({ ...h })),
|
|
975
|
+
usedArea: page.usedArea
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
function pageOccupiedHeight(page) {
|
|
979
|
+
const last = page.shelves[page.shelves.length - 1];
|
|
980
|
+
return last === void 0 ? 0 : last.y + last.height + page.gutter;
|
|
981
|
+
}
|
|
982
|
+
function pageWaste(page) {
|
|
983
|
+
const pageArea = page.width * page.height;
|
|
984
|
+
const occupiedArea = page.width * pageOccupiedHeight(page);
|
|
985
|
+
let holeArea = 0;
|
|
986
|
+
for (const h of page.holes) holeArea += h.width * h.height;
|
|
987
|
+
return {
|
|
988
|
+
pageArea,
|
|
989
|
+
occupiedArea,
|
|
990
|
+
usedArea: page.usedArea,
|
|
991
|
+
holeArea,
|
|
992
|
+
packingWastePct: occupiedArea === 0 ? 0 : 1 - page.usedArea / occupiedArea,
|
|
993
|
+
allocationWastePct: pageArea === 0 ? 0 : 1 - page.usedArea / pageArea,
|
|
994
|
+
fragmentationPct: occupiedArea === 0 ? 0 : holeArea / occupiedArea
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
function findPlacement(page, width, height, size) {
|
|
998
|
+
const g = page.gutter;
|
|
999
|
+
if (size.width <= 0 || size.height <= 0) return null;
|
|
1000
|
+
let best = null;
|
|
1001
|
+
const better = (c) => {
|
|
1002
|
+
if (best === null) return true;
|
|
1003
|
+
for (let i = 0; i < c.length; i++) {
|
|
1004
|
+
const a = c[i];
|
|
1005
|
+
const b = best[i];
|
|
1006
|
+
if (a !== b) return a < b;
|
|
1007
|
+
}
|
|
1008
|
+
return false;
|
|
1009
|
+
};
|
|
1010
|
+
for (const hole of page.holes) {
|
|
1011
|
+
if (hole.width < size.width || hole.height < size.height) continue;
|
|
1012
|
+
if (hole.width !== size.width && hole.width - size.width <= g) continue;
|
|
1013
|
+
const c = [
|
|
1014
|
+
hole.height - size.height,
|
|
1015
|
+
hole.width - size.width,
|
|
1016
|
+
0,
|
|
1017
|
+
hole.x,
|
|
1018
|
+
hole.y
|
|
1019
|
+
];
|
|
1020
|
+
if (better(c)) best = c;
|
|
1021
|
+
}
|
|
1022
|
+
for (const shelf of page.shelves) {
|
|
1023
|
+
if (shelf.height < size.height) continue;
|
|
1024
|
+
const tail = width - g - shelf.cursorX;
|
|
1025
|
+
if (tail < size.width) continue;
|
|
1026
|
+
const c = [
|
|
1027
|
+
shelf.height - size.height,
|
|
1028
|
+
tail - size.width,
|
|
1029
|
+
1,
|
|
1030
|
+
shelf.cursorX,
|
|
1031
|
+
shelf.y
|
|
1032
|
+
];
|
|
1033
|
+
if (better(c)) best = c;
|
|
1034
|
+
}
|
|
1035
|
+
if (best !== null) return { x: best[3], y: best[4], width: size.width, height: size.height };
|
|
1036
|
+
const bottom = pageOccupiedHeight(page);
|
|
1037
|
+
const y = bottom === 0 ? g : bottom;
|
|
1038
|
+
if (y + size.height + g <= height && g + size.width + g <= width) {
|
|
1039
|
+
return { x: g, y, width: size.width, height: size.height };
|
|
1040
|
+
}
|
|
1041
|
+
return null;
|
|
1042
|
+
}
|
|
1043
|
+
function canPackAt(page, width, height, size) {
|
|
1044
|
+
return findPlacement(page, width, height, size) !== null;
|
|
1045
|
+
}
|
|
1046
|
+
function packRect(page, size) {
|
|
1047
|
+
const rect = findPlacement(page, page.width, page.height, size);
|
|
1048
|
+
if (rect === null) return null;
|
|
1049
|
+
const g = page.gutter;
|
|
1050
|
+
const holeIndex = page.holes.findIndex((h) => h.x === rect.x && h.y === rect.y);
|
|
1051
|
+
if (holeIndex >= 0) {
|
|
1052
|
+
const hole = page.holes[holeIndex];
|
|
1053
|
+
const remainder = hole.width - rect.width - g;
|
|
1054
|
+
if (remainder > 0) {
|
|
1055
|
+
page.holes[holeIndex] = { x: hole.x + rect.width + g, y: hole.y, width: remainder, height: hole.height };
|
|
1056
|
+
} else {
|
|
1057
|
+
page.holes.splice(holeIndex, 1);
|
|
1058
|
+
}
|
|
1059
|
+
} else {
|
|
1060
|
+
const shelf = page.shelves.find((s) => s.y === rect.y);
|
|
1061
|
+
if (shelf === void 0) {
|
|
1062
|
+
page.shelves.push({ y: rect.y, height: rect.height, cursorX: rect.x + rect.width + g });
|
|
1063
|
+
} else {
|
|
1064
|
+
shelf.cursorX = rect.x + rect.width + g;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
page.usedArea += rect.width * rect.height;
|
|
1068
|
+
return rect;
|
|
1069
|
+
}
|
|
1070
|
+
function freeRect(page, rect) {
|
|
1071
|
+
const shelf = page.shelves.find((s) => s.y === rect.y);
|
|
1072
|
+
if (shelf === void 0) return false;
|
|
1073
|
+
const g = page.gutter;
|
|
1074
|
+
if (rect.x + rect.width + g > shelf.cursorX) return false;
|
|
1075
|
+
if (page.holes.some(
|
|
1076
|
+
(h) => h.y === shelf.y && rect.x >= h.x && rect.x + rect.width <= h.x + h.width
|
|
1077
|
+
)) {
|
|
1078
|
+
return false;
|
|
1079
|
+
}
|
|
1080
|
+
page.usedArea -= rect.width * rect.height;
|
|
1081
|
+
if (rect.x + rect.width + g === shelf.cursorX) {
|
|
1082
|
+
shelf.cursorX = rect.x;
|
|
1083
|
+
} else {
|
|
1084
|
+
page.holes.push({ x: rect.x, y: shelf.y, width: rect.width, height: shelf.height });
|
|
1085
|
+
}
|
|
1086
|
+
coalesceHoles(page);
|
|
1087
|
+
absorbHolesAtCursor(page, shelf);
|
|
1088
|
+
coalesceShelves(page);
|
|
1089
|
+
return true;
|
|
1090
|
+
}
|
|
1091
|
+
function absorbHolesAtCursor(page, shelf) {
|
|
1092
|
+
const g = page.gutter;
|
|
1093
|
+
for (; ; ) {
|
|
1094
|
+
const i = page.holes.findIndex((h) => h.y === shelf.y && h.x + h.width + g === shelf.cursorX);
|
|
1095
|
+
if (i < 0) return;
|
|
1096
|
+
shelf.cursorX = page.holes[i].x;
|
|
1097
|
+
page.holes.splice(i, 1);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
function coalesceHoles(page) {
|
|
1101
|
+
const g = page.gutter;
|
|
1102
|
+
page.holes.sort((a, b) => a.y - b.y || a.x - b.x);
|
|
1103
|
+
const merged = [];
|
|
1104
|
+
for (const hole of page.holes) {
|
|
1105
|
+
const prev = merged[merged.length - 1];
|
|
1106
|
+
if (prev !== void 0 && prev.y === hole.y && prev.x + prev.width + g === hole.x) {
|
|
1107
|
+
prev.width = hole.x + hole.width - prev.x;
|
|
1108
|
+
} else {
|
|
1109
|
+
merged.push({ ...hole });
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
page.holes = merged;
|
|
1113
|
+
}
|
|
1114
|
+
function coalesceShelves(page) {
|
|
1115
|
+
const g = page.gutter;
|
|
1116
|
+
const isEmpty = (s) => s.cursorX === g;
|
|
1117
|
+
const merged = [];
|
|
1118
|
+
for (const shelf of page.shelves) {
|
|
1119
|
+
const prev = merged[merged.length - 1];
|
|
1120
|
+
if (prev !== void 0 && isEmpty(prev) && isEmpty(shelf)) {
|
|
1121
|
+
prev.height = shelf.y + shelf.height - prev.y;
|
|
1122
|
+
} else {
|
|
1123
|
+
merged.push(shelf);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
while (merged.length > 0 && isEmpty(merged[merged.length - 1])) merged.pop();
|
|
1127
|
+
page.shelves = merged;
|
|
1128
|
+
}
|
|
1129
|
+
function initialPageSize(size, minSize, maxSize, gutter = DEFAULT_ATLAS_GUTTER) {
|
|
1130
|
+
const need = Math.max(size.width, size.height) + 2 * gutter;
|
|
1131
|
+
if (need > maxSize) return null;
|
|
1132
|
+
let side = Math.max(minSize, 1);
|
|
1133
|
+
while (side < need) side *= 2;
|
|
1134
|
+
side = Math.min(side, maxSize);
|
|
1135
|
+
return { width: side, height: side };
|
|
1136
|
+
}
|
|
1137
|
+
function nextGrowthStep(current, maxSize) {
|
|
1138
|
+
const { width, height } = current;
|
|
1139
|
+
if (width >= maxSize && height >= maxSize) return null;
|
|
1140
|
+
if (width <= height && width < maxSize) return { width: Math.min(width * 2, maxSize), height };
|
|
1141
|
+
if (height < maxSize) return { width, height: Math.min(height * 2, maxSize) };
|
|
1142
|
+
return { width: Math.min(width * 2, maxSize), height };
|
|
1143
|
+
}
|
|
1144
|
+
function planPageGrowth(page, size, maxSize) {
|
|
1145
|
+
let extent = { width: page.width, height: page.height };
|
|
1146
|
+
while (!canPackAt(page, extent.width, extent.height, size)) {
|
|
1147
|
+
const step = nextGrowthStep(extent, maxSize);
|
|
1148
|
+
if (step === null) return null;
|
|
1149
|
+
extent = step;
|
|
1150
|
+
}
|
|
1151
|
+
return extent;
|
|
1152
|
+
}
|
|
1153
|
+
function growShelfPage(page, size) {
|
|
1154
|
+
if (size.width < page.width || size.height < page.height) {
|
|
1155
|
+
throw new Error("atlas: pages grow only \u2014 shrinking would move live slots");
|
|
1156
|
+
}
|
|
1157
|
+
page.width = size.width;
|
|
1158
|
+
page.height = size.height;
|
|
1159
|
+
}
|
|
1160
|
+
function packPage(width, height, gutter, sizes) {
|
|
1161
|
+
const order = sizes.map((_, i) => i);
|
|
1162
|
+
order.sort((a, b) => {
|
|
1163
|
+
const sa = sizes[a];
|
|
1164
|
+
const sb = sizes[b];
|
|
1165
|
+
return sb.height - sa.height || sb.width - sa.width || a - b;
|
|
1166
|
+
});
|
|
1167
|
+
const page = createShelfPage(width, height, gutter);
|
|
1168
|
+
const rects = new Array(sizes.length);
|
|
1169
|
+
for (const i of order) {
|
|
1170
|
+
const rect = packRect(page, sizes[i]);
|
|
1171
|
+
if (rect === null) return null;
|
|
1172
|
+
rects[i] = rect;
|
|
1173
|
+
}
|
|
1174
|
+
return { page, rects };
|
|
1175
|
+
}
|
|
1176
|
+
|
|
960
1177
|
// ../kernel/src/index.ts
|
|
961
1178
|
var KERNEL_VERSION = "0.0.0";
|
|
962
1179
|
|
|
@@ -970,25 +1187,13 @@ export {
|
|
|
970
1187
|
worldToScreen,
|
|
971
1188
|
zoomAtPoint,
|
|
972
1189
|
fitCamera,
|
|
973
|
-
planeCssTransform,
|
|
974
|
-
worldToIsland,
|
|
975
|
-
islandToWorld,
|
|
976
|
-
compositeCameraFrustum,
|
|
977
|
-
worldRectToComposite,
|
|
978
1190
|
computeSnapGuides,
|
|
979
1191
|
SpatialIndex,
|
|
980
|
-
ZOOM_BANDS,
|
|
981
|
-
selectBand,
|
|
982
|
-
isOutOfBand,
|
|
983
|
-
fboPixelSize,
|
|
984
|
-
computeIslandPhase,
|
|
985
|
-
selectEvictions,
|
|
986
1192
|
portAnchor,
|
|
987
1193
|
sideDirection,
|
|
988
1194
|
wireCubic,
|
|
989
1195
|
cubicPoint,
|
|
990
1196
|
cubicAABB,
|
|
991
|
-
tessellateCubic,
|
|
992
1197
|
distanceToSegment,
|
|
993
1198
|
distanceToCubic,
|
|
994
1199
|
cubicBezierEase,
|
|
@@ -997,6 +1202,7 @@ export {
|
|
|
997
1202
|
invertAffine,
|
|
998
1203
|
composeAffine,
|
|
999
1204
|
solveFlightStart,
|
|
1205
|
+
outgoingCamera,
|
|
1000
1206
|
flightOctaves,
|
|
1001
1207
|
capFlightStart,
|
|
1002
1208
|
flightCamera,
|
|
@@ -1004,6 +1210,31 @@ export {
|
|
|
1004
1210
|
insertSlot,
|
|
1005
1211
|
packLayout,
|
|
1006
1212
|
layerGraph,
|
|
1213
|
+
PEG_LATTICE,
|
|
1214
|
+
TRAY_ACCESSORIES,
|
|
1215
|
+
TRAY_ACCESSORY,
|
|
1216
|
+
TRAY_SPACING,
|
|
1217
|
+
hangError,
|
|
1218
|
+
trayOrder,
|
|
1219
|
+
hangFootprint,
|
|
1220
|
+
layTray,
|
|
1221
|
+
trayScrollMax,
|
|
1222
|
+
specimenFit,
|
|
1223
|
+
DEFAULT_ATLAS_GUTTER,
|
|
1224
|
+
createShelfPage,
|
|
1225
|
+
cloneShelfPage,
|
|
1226
|
+
pageOccupiedHeight,
|
|
1227
|
+
pageWaste,
|
|
1228
|
+
canPackAt,
|
|
1229
|
+
packRect,
|
|
1230
|
+
freeRect,
|
|
1231
|
+
coalesceHoles,
|
|
1232
|
+
coalesceShelves,
|
|
1233
|
+
initialPageSize,
|
|
1234
|
+
nextGrowthStep,
|
|
1235
|
+
planPageGrowth,
|
|
1236
|
+
growShelfPage,
|
|
1237
|
+
packPage,
|
|
1007
1238
|
KERNEL_VERSION
|
|
1008
1239
|
};
|
|
1009
|
-
//# sourceMappingURL=chunk-
|
|
1240
|
+
//# sourceMappingURL=chunk-JS6PG6YD.js.map
|