@vibecook/ice 0.11.0 → 0.15.0-desk.1
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-AMMFQP2C.js +2444 -0
- package/dist/chunk-AMMFQP2C.js.map +1 -0
- package/dist/chunk-BKV4ZEU3.js +1 -0
- package/dist/chunk-BKV4ZEU3.js.map +1 -0
- package/dist/chunk-ENIFIUEP.js +155 -0
- package/dist/chunk-ENIFIUEP.js.map +1 -0
- package/dist/chunk-H3SKYJLK.js +8269 -0
- package/dist/chunk-H3SKYJLK.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-VGVDJZSP.js → chunk-PFJN3XN2.js} +13232 -7388
- package/dist/chunk-PFJN3XN2.js.map +1 -0
- package/dist/chunk-QXOCF56A.js +148 -0
- package/dist/chunk-QXOCF56A.js.map +1 -0
- package/dist/chunk-U4YMA4TJ.js +635 -0
- package/dist/chunk-U4YMA4TJ.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 +12734 -0
- package/dist/desk-objects.js.map +1 -0
- package/dist/desk.js +497 -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 +1047 -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 +36 -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 +73 -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 +53 -1
- package/dist/types/packages/core/src/systems/l2-arbitrate.d.ts +18 -4
- package/dist/types/packages/core/src/systems/l2-recognize.d.ts +3 -1
- 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-button.d.ts +25 -0
- package/dist/types/packages/core/src/systems/press-wheel.d.ts +11 -0
- package/dist/types/packages/core/src/systems/tray.d.ts +111 -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 +306 -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 +133 -0
- package/dist/types/packages/desk/src/compose/pick.d.ts +5 -0
- package/dist/types/packages/desk/src/compose/reflector.d.ts +120 -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 +43 -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/faults.d.ts +38 -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 +537 -0
- package/dist/types/packages/desk/src/hold/focus.d.ts +53 -0
- package/dist/types/packages/desk/src/hold/pose.d.ts +152 -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 +536 -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 +16 -0
- package/dist/types/packages/desk/src/kind.d.ts +189 -0
- package/dist/types/packages/desk/src/kinds/world.d.ts +447 -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 +105 -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/missing/layout.d.ts +27 -0
- package/dist/types/packages/desk/src/missing/object.d.ts +6 -0
- package/dist/types/packages/desk/src/missing/pass.d.ts +39 -0
- package/dist/types/packages/desk/src/missing/shaders.d.ts +7 -0
- package/dist/types/packages/desk/src/missing/slots.d.ts +8 -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 +17 -0
- package/dist/types/packages/desk/src/submit-instrument.d.ts +36 -0
- package/dist/types/packages/desk/src/theme.d.ts +497 -0
- package/dist/types/packages/desk/src/tray/carry.d.ts +99 -0
- package/dist/types/packages/desk/src/tray/drawer.d.ts +124 -0
- package/dist/types/packages/desk/src/tray/flux.d.ts +49 -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 +101 -0
- package/dist/types/packages/desk/src/tray/shaders.d.ts +10 -0
- package/dist/types/packages/desk/src/tray/specimens.d.ts +214 -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 +104 -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 +11 -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 +174 -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
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { BindKind } from "./engine/pipeline";
|
|
2
|
+
import type { RecordStoreStats } from "./engine/records";
|
|
3
|
+
import type { ComposeOptions } from "./engine/shader";
|
|
4
|
+
import type { MatLight } from "./kit/light";
|
|
5
|
+
import type { Presentation } from "./kit/nav";
|
|
6
|
+
import type { FadeIn, MatConfig, MatFrame, MatPass, SlotLight, View } from "./kit/view";
|
|
7
|
+
import type { GroundTheme, RGB } from "./theme";
|
|
8
|
+
/** The strata of the desk a kind can lie in (design-015 §4.2): beneath everything, flat on the mat holding a desk, every other thing. */
|
|
9
|
+
export type StratumName = "pads" | "sheets" | "things";
|
|
10
|
+
/**
|
|
11
|
+
* The strata in paint order. The mat (stratum 0) is the ground's own and draws first; the held set and the
|
|
12
|
+
* marks (strata 4 and 5) are D4's. A kind's place in the registry never moves it out of its stratum.
|
|
13
|
+
*/
|
|
14
|
+
export declare const STRATA: readonly StratumName[];
|
|
15
|
+
/**
|
|
16
|
+
* Everything a kind's pass is prepared with for one slot, one frame — what each object pass's `prepare`
|
|
17
|
+
* took as arguments before the registry, in one record. The ground fills it; a kind reads what it needs.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* What a slot is prepared FOR (D7): `frame` — the canvas (and the hand's own slot over it); `copy` — the held desk copy behind the
|
|
21
|
+
* hand, the desk at half the dpr (design-015 §8). A held frame prepares the root twice, once for each, so a pass that keeps state
|
|
22
|
+
* between its prepares keeps the copy's apart.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The render a slot is prepared for (D7): the FRAME (the desk as it is), the COPY (the desk behind a carried object, made once
|
|
26
|
+
* per stamp and blurred), the HAND (K9 R4 — the carried object alone, prepared EVERY frame of the carry while the copy
|
|
27
|
+
* stands), or a CAPTURE (petition I23, `ground.ts` `captureFrame` — the last presented frame's inputs drawn ONCE MORE into a
|
|
28
|
+
* readable texture at the asked scale, outside any frame; the desk's own frame stands as drawn). A pass that keeps state per
|
|
29
|
+
* render keeps the copy's apart; a pass whose residency asks are per prepare (the pictures' details, the boards' pool) re-asks
|
|
30
|
+
* what it has bound under the hand AND under a capture, else the tick's step — seeing only the hand's asks, or a thumbnail's
|
|
31
|
+
* coarser ones — would free every other detail on the desk behind it, a softness pop at every put-down.
|
|
32
|
+
*/
|
|
33
|
+
export type RenderTarget = "frame" | "copy" | "hand" | "capture";
|
|
34
|
+
export interface SlotContext {
|
|
35
|
+
/** The slot's camera and box (CSS px) and the device pixel ratio. */
|
|
36
|
+
readonly view: View & {
|
|
37
|
+
readonly dpr: number;
|
|
38
|
+
};
|
|
39
|
+
/** The slot's grid's fade-in window AS ITS GRID NAMES IT — `dressGrid` dresses the mat's lattice alone, never the objects. */
|
|
40
|
+
readonly fadeIn: FadeIn;
|
|
41
|
+
/** The slot's mat config (its gobo, its rulers, its vinyl). The block a pass draws with is the slot's (`MatPass.view`, K4a): read, never copied. */
|
|
42
|
+
readonly cfg: MatConfig;
|
|
43
|
+
/** The mat's clocks and tilt this frame; undefined = a still (a pass fills `STILL_MAT_FRAME`). */
|
|
44
|
+
readonly frame: MatFrame | undefined;
|
|
45
|
+
/** The OBJECTS' presentation: the slot's opacity times their own presence (`Presentation.objects`), and the slot's chain. */
|
|
46
|
+
readonly present: Presentation | undefined;
|
|
47
|
+
/** The Sun or the Moon (the theme's `matLight`). */
|
|
48
|
+
readonly light: MatLight;
|
|
49
|
+
/** The lamp the slot is lit by: undefined = its own camera's, exactly (the root at rest); else its host's (MINIMAT.md §4). */
|
|
50
|
+
readonly lit: SlotLight | undefined;
|
|
51
|
+
/** The selection ring's colour (the theme's `select`). */
|
|
52
|
+
readonly select: RGB;
|
|
53
|
+
/** The theme in force. */
|
|
54
|
+
readonly theme: GroundTheme;
|
|
55
|
+
/** The render this slot is prepared for; absent = the frame's (D7). */
|
|
56
|
+
readonly target?: RenderTarget;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* What the ground knows of a kind's records beyond the slot, this frame. `live(i)`: record `i`'s live inside —
|
|
60
|
+
* its objects' presence over the record's face (0..1), or −1 where none is drawn — which the ground computes from
|
|
61
|
+
* the slot's portals, by the kind's OWN record index. A sheet that holds a desk lets its face's far LOD give way
|
|
62
|
+
* to it (the mini mat); every other kind ignores it.
|
|
63
|
+
*/
|
|
64
|
+
export interface KindExtra {
|
|
65
|
+
readonly live: (index: number) => number;
|
|
66
|
+
/**
|
|
67
|
+
* The records' KEYS, one per record in the same order (design-015 §4.3; D6) — the builder's entity (a ghost's negated), stable
|
|
68
|
+
* across frames, so a pass with persistent records keeps a record's slot and writes it only when the record object changed.
|
|
69
|
+
* Absent (the oracle, a bare host): every record is packed afresh this frame.
|
|
70
|
+
*/
|
|
71
|
+
readonly keys?: readonly number[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* One slot's pass of one kind. The root's is made by the kind's program on the root's mat; every other slot's is
|
|
75
|
+
* `spawn`ed from it — its own buffers on the shared pipelines, reading its own mat's wind and light.
|
|
76
|
+
*/
|
|
77
|
+
export interface KindPass<R = unknown> {
|
|
78
|
+
/** A slot's own buffers on the shared pipelines, reading `mat`'s silhouette — a live inside's, a flight's departed desk's. */
|
|
79
|
+
spawn(mat: MatPass): KindPass<R>;
|
|
80
|
+
/** Take the root's laws (the prototype's `tune()` / `copy()`): a spawned slot's pass does, every frame, before it prepares. */
|
|
81
|
+
tune?(root: KindPass<R>): void;
|
|
82
|
+
/** Draw with a host's LIVE law (D5a — `handle.tuneLaw`): the root's pass takes it, and its slots follow through `tune`. */
|
|
83
|
+
setLaw?(law: unknown): void;
|
|
84
|
+
/**
|
|
85
|
+
* Upload this frame's records — the kind's objects in this slot, in paint order — for `slot`'s camera and light.
|
|
86
|
+
* `encoder` is the frame's: work that must precede the frame's pass may be recorded into it (or a pass may submit
|
|
87
|
+
* its own before the frame's, as the whiteboard's stamps and drying do). Returns the count that will draw.
|
|
88
|
+
*/
|
|
89
|
+
prepare(encoder: GPUCommandEncoder, slot: SlotContext, records: readonly R[], extra?: KindExtra): number;
|
|
90
|
+
/** Draw records [first, end) — indices into this frame's `records` — in their order, into the open pass. */
|
|
91
|
+
drawRange(pass: GPURenderPassEncoder, first: number, end: number): void;
|
|
92
|
+
/**
|
|
93
|
+
* The kind's persistent record store's counters (design-015 §4.3; D6) — records packed and uploaded, draw lists rewritten — a
|
|
94
|
+
* rig's witness that a camera move writes no standing record. Absent for a kind that keeps none (the composites' layers).
|
|
95
|
+
*/
|
|
96
|
+
records?(): RecordStoreStats;
|
|
97
|
+
/**
|
|
98
|
+
* The records this slot's last `prepare` turned away at the pass's CAP (its buffers' ceiling — the layered kinds' fixed tables,
|
|
99
|
+
* the record stores' most) — objects the builder resolved that will NOT draw. Never silent (D7): the ground sums them into the
|
|
100
|
+
* frame's `GroundStats.dropped` and the host says so.
|
|
101
|
+
*/
|
|
102
|
+
dropped?(): number;
|
|
103
|
+
/** The hold is over (D7): a pass that kept the held desk copy's state apart (`SlotContext.target`) gives it back. */
|
|
104
|
+
endHold?(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Let go of the device targets this slot's pass makes again at its next draw, when none of its objects was drawn within `ms`
|
|
107
|
+
* (K6a's D-K6a.3 — a layered kind's layer): asked each tick of the slots a host keeps beyond the root (the tray's, K5a).
|
|
108
|
+
*/
|
|
109
|
+
idle?(ms: number): void;
|
|
110
|
+
/**
|
|
111
|
+
* When `idle(ms)` next lets something go (K7a): the host registers it as a TIME wake, so a desk asleep since the drawer shut
|
|
112
|
+
* still wakes to give the layer back. ∞, or absent: nothing to let go (a pass that says no time is let go at a tick taken anyway).
|
|
113
|
+
*/
|
|
114
|
+
idleAt?(ms: number): number;
|
|
115
|
+
/** A sheet's marks over its live inside, drawn right after the inside (the mini mat's chips while the inside's objects come in). */
|
|
116
|
+
drawOver?(pass: GPURenderPassEncoder, index: number): void;
|
|
117
|
+
/**
|
|
118
|
+
* K7b: this slot's resources for the kind's CARD MATERIAL (`KindProgram.card`), in its `bindings` order, and a number that moves
|
|
119
|
+
* whenever one of them is replaced (a record store grown, a texture array grown) — the card's bind group is made again then.
|
|
120
|
+
*/
|
|
121
|
+
cardResources?(): {
|
|
122
|
+
readonly version: number;
|
|
123
|
+
readonly resources: readonly (GPUBuffer | GPUTextureView | GPUSampler)[];
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* K7b: record `index` of the last `prepare` drawn by the desk's FLAT-CARD pipeline — its slot in the kind's records, which the
|
|
127
|
+
* material's functions read — or −1: this pass draws it itself (a print with its detail bound, a board with its raster).
|
|
128
|
+
*/
|
|
129
|
+
cardSlot?(index: number): number;
|
|
130
|
+
/** This slot's buffers (the shared resources go with the last slot standing). */
|
|
131
|
+
dispose(): void;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A kind as the ground registers it: its name (unique in a ground), its stratum, and how its root pass is made on
|
|
135
|
+
* the root's mat — once per device; every other slot's pass is `spawn`ed from that one.
|
|
136
|
+
*/
|
|
137
|
+
export interface KindProgram<R = unknown> {
|
|
138
|
+
readonly name: string;
|
|
139
|
+
readonly stratum: StratumName;
|
|
140
|
+
/**
|
|
141
|
+
* A kind that lays a COMPOSITE (design-015 §4.2): its pass renders every one of its objects into a target of its own in `prepare`
|
|
142
|
+
* (depth, MSAA, shadow maps — the notebook's layer, the calendar's) and `drawRange` lays that target over the frame in one draw.
|
|
143
|
+
* The ground draws such a kind as ONE run, [0, count), after every other run of its stratum — its objects cannot interleave with
|
|
144
|
+
* another kind's without a target per run (D-D4's exception: a note laid on a notebook draws under it). Absent: the kind's objects
|
|
145
|
+
* are cut into runs in the slot's paint order.
|
|
146
|
+
*/
|
|
147
|
+
readonly composite?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* K7b: the kind's CARD MATERIAL — its records drawn by the desk's ONE flat-card pipeline (card/card.ts), interleaved with every
|
|
150
|
+
* other material kind's objects in one run. Absent: the kind draws every record itself, a run of its own.
|
|
151
|
+
*/
|
|
152
|
+
readonly card?: CardMaterial;
|
|
153
|
+
create(device: GPUDevice, format: GPUTextureFormat, mat: MatPass): Promise<KindPass<R>>;
|
|
154
|
+
}
|
|
155
|
+
/** A binding of a CARD MATERIAL (K7b): the WGSL the card declares after `@group(0) @binding(n)`, and its layout (the stages, what it is). */
|
|
156
|
+
export interface CardBinding {
|
|
157
|
+
/** Whole, after the attribute: `var<uniform> paper_k: PaperUniforms` — its name UNIQUE across every kind's material (a kind prefixes its own). */
|
|
158
|
+
readonly wgsl: string;
|
|
159
|
+
readonly entry: BindKind;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* A kind's CARD MATERIAL (K7b, design-016 §6 K7 — the run question). In mixed sibling order a run of one kind ends at the next
|
|
163
|
+
* object of another (rig:scale: draws ≈ 0.3 × the objects drawn, at every zoom); the kinds that declare a material are composed
|
|
164
|
+
* into ONE pipeline, so interleaved objects of every such kind are one run, one draw. Each object is drawn there by its OWN kind's
|
|
165
|
+
* functions over its own kind's records, uniforms and textures — the pixels its own pipeline makes. The card's module is the
|
|
166
|
+
* kit's pieces and every material's structs and modules (deduplicated by name and label), then its bindings, its `only`, its
|
|
167
|
+
* card functions (`shaders.entry` — the same text its own pass composes) and a dispatch on the card's material.
|
|
168
|
+
*/
|
|
169
|
+
export interface CardMaterial {
|
|
170
|
+
/**
|
|
171
|
+
* The kind's program as its own pass composes it — the kit's pieces, its structs, its pure modules — its `entry` the CARD FUNCTIONS
|
|
172
|
+
* over its bindings; asked when the card is composed (a host's text read then, as a pass reads it when it is made).
|
|
173
|
+
*/
|
|
174
|
+
shaders(): ComposeOptions;
|
|
175
|
+
/** WGSL the card composes that the kind's own entry defines otherwise (a texel read from its thumbnails alone — the card binds no pool). */
|
|
176
|
+
readonly only?: string;
|
|
177
|
+
/** Its bindings beyond the slot's view block and mat (`u`, `gobo_tex`, `noise_tex` — the card's), in its pass's `cardResources` order. */
|
|
178
|
+
readonly bindings: readonly CardBinding[];
|
|
179
|
+
/** `fn <quad>(slot: u32, vid: u32) -> vec4f`: corner `vid`'s clip position; (2, 2, 2, 1) — the degenerate — collapses a culled one. */
|
|
180
|
+
readonly quad: string;
|
|
181
|
+
/** `fn <frag>(slot: u32, clip: vec4f) -> vec4f`: the fragment's premultiplied colour through the slot's presentation; alpha < 0 = discard. */
|
|
182
|
+
readonly frag?: string;
|
|
183
|
+
/**
|
|
184
|
+
* The fragment WRITTEN OUT instead of `frag`'s call: WGSL statements over `slot` and `in.clip` that set `c` (or discard) — the
|
|
185
|
+
* kind's own entry's fragment, statement for statement. For a kind whose shade reached through one more function compiles to
|
|
186
|
+
* other bits (the board's: one LSB on a pixel a scene — measured, K7b): the card then runs the very code its entry runs.
|
|
187
|
+
*/
|
|
188
|
+
readonly fragInline?: string;
|
|
189
|
+
}
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import type { Component, Entity, HeldToolApi, HeldToolDef, Relation, Tag, WidgetType, World } from "../../../core/src/index";
|
|
2
|
+
import type { TypingDocs } from "../docs";
|
|
3
|
+
import type { RasterBudget } from "../engine/budget";
|
|
4
|
+
import type { RasterQueue } from "../engine/rasters";
|
|
5
|
+
import type { KindPass, KindProgram, StratumName } from "../kind";
|
|
6
|
+
import type { DeskEditor, TextPart } from "../kit/editor";
|
|
7
|
+
import type { ChildShape, FaceLaw, InsideView } from "../kit/inside";
|
|
8
|
+
import type { Lamp } from "../kit/light";
|
|
9
|
+
import type { LendHost, Lent, ServiceKey, Services } from "../kit/services";
|
|
10
|
+
import type { Rect } from "../kit/nav";
|
|
11
|
+
import type { GridConfig, View } from "../kit/view";
|
|
12
|
+
import type { MarkFrame } from "../marks/layout";
|
|
13
|
+
import type { GroundTheme, Palette, ThemeName } from "../theme";
|
|
14
|
+
/**
|
|
15
|
+
* What the builder hands a CONTAINER kind's `record` about its inside (D2b): the bounds of the
|
|
16
|
+
* children's rects (`content`, null = empty — the arrival is the empty desk's), the inside's
|
|
17
|
+
* embedding and camera under this slot's camera (`view`, from the kind's own `face` — the
|
|
18
|
+
* flight's numbers, so the face's far LOD and the live inside agree to the bit), and the children
|
|
19
|
+
* as their kinds chip them (`chips`, in the inside's own units — the kind maps them through `view.M`).
|
|
20
|
+
*/
|
|
21
|
+
export interface InsideContext {
|
|
22
|
+
readonly content: Rect | null;
|
|
23
|
+
readonly view: InsideView | null;
|
|
24
|
+
readonly chips: readonly ChildShape[];
|
|
25
|
+
}
|
|
26
|
+
/** An object's rect on its desk, world units, CENTRED — converted from ICE's top-left `Position` + `Size` by the builder, once. */
|
|
27
|
+
export interface ObjectRect {
|
|
28
|
+
readonly cx: number;
|
|
29
|
+
readonly cy: number;
|
|
30
|
+
readonly w: number;
|
|
31
|
+
readonly h: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* What moves, per entity — the builder's springs, each 0..1 and SNAPPED to its target when settled
|
|
35
|
+
* (the B7 trap: a spring that never quite lands keeps the desk awake forever). `lift` follows the
|
|
36
|
+
* `Grab` fact (held), `hover` the local mouse pointer's exact hit (the B9 pairing — never the
|
|
37
|
+
* dead-band `Targets`), `fade` the delete ghost (1 alive … 0 gone). `ring` is ALWAYS 0 from the
|
|
38
|
+
* builder: the kinds' own selection ring retired at D4a (the marks draw the selection) and its
|
|
39
|
+
* spring went at D6; the Node oracle alone hands a ring, for the baseline against the prototype.
|
|
40
|
+
*/
|
|
41
|
+
export interface ObjectFlux {
|
|
42
|
+
readonly lift: number;
|
|
43
|
+
readonly hover: number;
|
|
44
|
+
readonly ring: number;
|
|
45
|
+
readonly fade: number;
|
|
46
|
+
}
|
|
47
|
+
/** A kind's answer to "what is under this world point" — the widget itself (`content`/`frame`), a part, or nothing. */
|
|
48
|
+
export type ObjectHit = "content" | "frame" | (string & {});
|
|
49
|
+
/**
|
|
50
|
+
* A slot of the held bar for a kind in hand (design-015 §8 — "the kind's tools take the middle"): core's `HeldToolDef`
|
|
51
|
+
* (D3t-a — widget/held-tools.ts), declared by the kind and carried onto its widget type by `defineObject`, so the one
|
|
52
|
+
* keymap and the one bar reach it through the engine: a `mode` (the tool in hand, core's `HeldTool`), an `action` (an op),
|
|
53
|
+
* or — no `kind` — declared only (dim; a later slice builds it). `glyph` names one of the bar's.
|
|
54
|
+
*/
|
|
55
|
+
export type { HeldToolDef } from "../../../core/src/index";
|
|
56
|
+
/**
|
|
57
|
+
* What a kind's `open.readout` reads (petition I22): the READ side of what its held tools' acts are handed (core's `HeldToolApi` —
|
|
58
|
+
* the world, the object in hand, its props as the world holds them now) and the kind's own state on this desk (`local`, as `page`
|
|
59
|
+
* and `openness` read it: the spread a turn is heading for, the time a clock's hands show). A readout never writes.
|
|
60
|
+
*/
|
|
61
|
+
export interface HeldReadoutContext extends Pick<HeldToolApi, "world" | "entity" | "props"> {
|
|
62
|
+
readonly local: unknown;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The kind's OPENING (design-015 §8; D4b) — what "pick it up" means for this kind. `extent`: the OPEN rect in the object's
|
|
66
|
+
* own desk units, centred as its rect is and UNTURNED (the builder turns it with the object): a notebook's spread (twice the
|
|
67
|
+
* case's width, left of the spine), a board's face, a calendar's month — what the reading size fits into the view. `pose`: how
|
|
68
|
+
* the reading size is reached — `camera` (a flat kind, the default: the held slot's camera maps the extent to the held rect
|
|
69
|
+
* and the kind draws at rest) or `eye` (a thing with height: the camera keeps the desk's zoom and the kind RISES toward the
|
|
70
|
+
* desk eye by `ctx.held.grow`). `openness`: how far the kind's own open motion has come (0 shut … 1 open) — the put-down
|
|
71
|
+
* flies home once it is under 0.35 and lands once under 0.02 (absent: 0, a kind with no motion of its own). `spread`: a
|
|
72
|
+
* two-page extent that opens one page at a time on a portrait phone (Q-p); `page`: which of its two is in view there — 0 the
|
|
73
|
+
* right (the default) … 1 the left, flux the view glides by (D3t-b: the notebook reads page by page). `tools`: the held bar's
|
|
74
|
+
* slots (D3t-a: live — a mode or an action each); `tool`: the mode in hand when it is picked up, from its props (default: the first mode);
|
|
75
|
+
* `swatches`: the colour a slot shows instead of its glyph (the board's four inks — the product's palette, through the look), read
|
|
76
|
+
* with the anchor as `readout` is — a throw leaves the slots their glyphs, said once, never a strike (petition I24).
|
|
77
|
+
*/
|
|
78
|
+
export interface OpenBinding {
|
|
79
|
+
extent(ctx: Pick<ObjectContext, "rect" | "props">): ObjectRect;
|
|
80
|
+
readonly pose?: "camera" | "eye";
|
|
81
|
+
openness?(ctx: Pick<ObjectContext, "entity" | "local">): number;
|
|
82
|
+
readonly spread?: boolean;
|
|
83
|
+
page?(ctx: Pick<ObjectContext, "entity" | "local">): number;
|
|
84
|
+
readonly tools?: readonly HeldToolDef[];
|
|
85
|
+
tool?(props: Readonly<Record<string, unknown>>): string;
|
|
86
|
+
swatches?(look: unknown): Readonly<Record<string, string>>;
|
|
87
|
+
/**
|
|
88
|
+
* The kind's WORD IN HAND (petition I22 — MC-D9's readouts): where the hand is, said beside its tools — the notebook's "Page 2",
|
|
89
|
+
* the calendar's "September", a clock's time. A string, or read each time the selection's anchor is recomposed (the pickup, a
|
|
90
|
+
* mode taken up, a held tool's act run — every frame drawn while it is held) and surfaced as `HeldAnchor.readout`; `undefined`
|
|
91
|
+
* or "" — no word. A readout that throws is caught at the kind's boundary: the anchor keeps the tools and carries no word, and the
|
|
92
|
+
* desk says so once — never a strike against the kind (petition I24: the anchor is read at the host's rate and only in hand, and a
|
|
93
|
+
* word draws nothing of the desk).
|
|
94
|
+
*/
|
|
95
|
+
readonly readout?: string | ((ctx: HeldReadoutContext) => string | undefined);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* What the builder hands the object IN HAND (D4b, beside its flux): the carry amount `e` (0 on the desk … 1 in hand — the
|
|
99
|
+
* lift's height, the focus behind), whether it should be OPEN (past 42 % of the pickup going up; never going down), the
|
|
100
|
+
* factor an `eye` kind must reach by rising (1 for a flat kind — the camera did it), and `snap` (a still: the open motion
|
|
101
|
+
* sits at its target, no spring).
|
|
102
|
+
*/
|
|
103
|
+
export interface HeldContext {
|
|
104
|
+
readonly e: number;
|
|
105
|
+
readonly open: boolean;
|
|
106
|
+
readonly grow: number;
|
|
107
|
+
readonly snap: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Everything a kind is handed for one entity, one frame. The props are the widget type's group
|
|
111
|
+
* fields as the builder cached them (refreshed from the change journal, never re-read per frame —
|
|
112
|
+
* the 09-23 profile); `look` is what the kind's own `theme()` made of the palette in force.
|
|
113
|
+
*/
|
|
114
|
+
export interface ObjectContext {
|
|
115
|
+
readonly entity: Entity;
|
|
116
|
+
readonly rect: ObjectRect;
|
|
117
|
+
readonly props: Readonly<Record<string, unknown>>;
|
|
118
|
+
readonly flux: ObjectFlux;
|
|
119
|
+
/** The kind's `theme(palette, name)` result for the theme in force; `undefined` when the kind declares none. */
|
|
120
|
+
readonly look: unknown;
|
|
121
|
+
readonly theme: GroundTheme;
|
|
122
|
+
/** The desk's one lamp — the gobo projector on the desk plane (`lampOf`), world units. */
|
|
123
|
+
readonly lamp: Lamp;
|
|
124
|
+
/** The slot's camera and attachment (CSS px) with the device pixel ratio. */
|
|
125
|
+
readonly view: View & {
|
|
126
|
+
readonly dpr: number;
|
|
127
|
+
};
|
|
128
|
+
/** The slot's grid: the mat's config (its vinyl, its gobo, its rulers) and the lattice's fade-in. */
|
|
129
|
+
readonly grid: GridConfig;
|
|
130
|
+
/** The frame's dt, SECONDS (the engine's clamped dt). */
|
|
131
|
+
readonly dt: number;
|
|
132
|
+
/**
|
|
133
|
+
* A per-entity asset the HOST pinned through the builder (`DeskBuilder.pin`) — `undefined` = none.
|
|
134
|
+
* Flux, never a world fact. (The note's committed raster moved into its kind's `local` at D2c.)
|
|
135
|
+
*/
|
|
136
|
+
readonly asset?: unknown;
|
|
137
|
+
/**
|
|
138
|
+
* The kind's OWN state on this desk — what `ObjectKind.local()` made for it (the note's writing:
|
|
139
|
+
* its layouts, its rasters' residency, the caret, the wipe — D2c); `undefined` when the kind keeps
|
|
140
|
+
* none. Flux, never a world fact; the builder threads it and tells it when an entity is forgotten.
|
|
141
|
+
*/
|
|
142
|
+
readonly local?: unknown;
|
|
143
|
+
/** A container's inside, for its `record` (D2b): the content bounds, the view through its face, the children's chips. Absent = not a container, or `resolve`. */
|
|
144
|
+
readonly inside?: InsideContext;
|
|
145
|
+
/** The object is IN HAND (D4b): its carry amount, its open target, the eye kind's rise. Absent = on the desk. */
|
|
146
|
+
readonly held?: HeldContext;
|
|
147
|
+
}
|
|
148
|
+
/** What a desk hands a kind's `local()` (D2c): its ROOT pass once the ground is made, the SERVICES lent on this desk, and the builder's doors. */
|
|
149
|
+
export interface KindHost {
|
|
150
|
+
/** The kind's root pass on this desk's ground; `undefined` before `Ground.create` resolves and after the layer ends. */
|
|
151
|
+
pass(): KindPass | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* THE SERVICES (K8a, kit/services.ts — an open registry by key): what the host lends (its text raster `TEXT_RASTER`, the picture
|
|
154
|
+
* decoder `PICTURE_DECODER`, the app's byte store `BLOB_STORE`, anything in `deskLayer({ services })`) and what any object's DOM
|
|
155
|
+
* half lends (`ObjectHost.lend` — the desk calendar's `PRINT_RASTER`): `use(key)` answers it, or undefined when nothing on this
|
|
156
|
+
* desk lends it (in Node the oracle pins committed rasters and tiles). Absent: a bare host (a test) — no services at all.
|
|
157
|
+
* D-K8a.1: the desk's OWN doors stay fields of this host — `pass`, `children`, `drawn`, `budget`, `rasters`, `remake`, `wake`: the
|
|
158
|
+
* builder's word, its budget, its queue and its loop, made by the desk for each kind and never lent, replaced or taken by a kind.
|
|
159
|
+
*/
|
|
160
|
+
use?<T>(key: ServiceKey<T>): T | undefined;
|
|
161
|
+
/** An object's DATA children (D3w, design-015 §5.1 — a board's strokes, a pad's events and pins); absent = none (a test, the oracle). */
|
|
162
|
+
readonly children?: DataChildren | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* The builder's word on what is DRAWN (D6, persistent records): the paint rank of `e` in the last build's root slot, undefined when it
|
|
165
|
+
* was not drawn there. A kind's residency reads it instead of counting its own `record` calls — those come only when a record is
|
|
166
|
+
* remade. Absent (a bare host, the oracle): the kind counts its own.
|
|
167
|
+
*/
|
|
168
|
+
readonly drawn?: ((e: Entity) => number | undefined) | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* THE RASTER BUDGET (D6, engine/budget.ts): one ledger for every raster a kind keeps as a cache of its data — a board's ink, a
|
|
171
|
+
* notebook page's CPU raster, the calendar's tiles. A kind charges what it makes with a way to let it go and answers `keeps` for
|
|
172
|
+
* what is on screen; the host trims the ledger once a tick. Absent: nothing is counted or evicted.
|
|
173
|
+
*/
|
|
174
|
+
readonly budget?: RasterBudget | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* THE FRAME'S RASTER QUEUE (K6b, engine/rasters.ts): a raster the zoom asks again (a new band, a new density) or an object come on
|
|
177
|
+
* screen holding none is ASKED here, with a priority, and made in the queue's turn under the frame's budget — the kind draws what
|
|
178
|
+
* it has meanwhile. Absent (a bare host, the oracle): a kind rasters in the frame that asks, as before.
|
|
179
|
+
*/
|
|
180
|
+
readonly rasters?: RasterQueue | undefined;
|
|
181
|
+
/** `e`'s record remade at the next build (K6b — a raster the queue laid: the record says where its ink is), the desk woken. */
|
|
182
|
+
readonly remake?: ((e: Entity) => void) | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* THE KIND'S WAKE (K7a — registered wakes): something arrived OUTSIDE a frame that changes how the kind draws (a picture
|
|
185
|
+
* decoded, a tile printed, a detail fetched): the kind is ticked at the next frame, and a sleeping loop wakes for it. A
|
|
186
|
+
* kind never polls for what an arrival can tell it. Absent (a bare host, the oracle): its tick is asked every frame.
|
|
187
|
+
*/
|
|
188
|
+
readonly wake?: (() => void) | undefined;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* An object's DATA children as its kind reads them (D3w): entities `ChildOf` the object, never members of the desk's
|
|
192
|
+
* paint order — the `stamp` turns over whenever the set or its order changes (strata's order stamp), and `rows` are the
|
|
193
|
+
* children's values of one component, in sibling order (the oldest stroke first).
|
|
194
|
+
*/
|
|
195
|
+
export interface DataChildren {
|
|
196
|
+
stamp(parent: Entity): number;
|
|
197
|
+
rows<T>(parent: Entity, c: Component<T>): readonly T[];
|
|
198
|
+
/** The children holding `c`, each with its value, in sibling order (D3t-c — a pad's events by entity: the line you point at is one). */
|
|
199
|
+
entries?<T>(parent: Entity, c: Component<T>): readonly {
|
|
200
|
+
readonly entity: Entity;
|
|
201
|
+
readonly value: T;
|
|
202
|
+
}[];
|
|
203
|
+
/** A child's one edge `r` — the entity it names (D3t-c — a pin's note), undefined when it names none. */
|
|
204
|
+
target?(child: Entity, r: Relation): Entity | undefined;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* A kind's own state on ONE desk (D2c) — made once per desk by `ObjectKind.local`, threaded by the
|
|
208
|
+
* builder into every context of the kind as `ctx.local`, and told the frame's clock and each entity's
|
|
209
|
+
* end, so a kind can keep per-entity residency (a raster, a decoded picture) outside the world.
|
|
210
|
+
*/
|
|
211
|
+
export interface KindLocal {
|
|
212
|
+
/** Once a tick, before the draw, with the frame's clock (ms): does the state want a frame now (a wipe, a blink, an asset landed)? */
|
|
213
|
+
tick?(now: number): boolean;
|
|
214
|
+
/**
|
|
215
|
+
* WHEN THE KIND IS NEXT LIVE (K7a — registered wakes, design-015 §2.4): asked after each of its ticks, on the same clock —
|
|
216
|
+
* `now` or before: the next frame (a motion runs: a wipe, a roll, a flight, ink drying); a later time: then (the caret's
|
|
217
|
+
* next blink, a layer let go, midnight); `Infinity`: never on its own — only when the desk's facts move, an input comes, or
|
|
218
|
+
* the kind calls `KindHost.wake`. A loop at rest ticks a kind only when it is due: nothing is polled. Absent while `tick`
|
|
219
|
+
* is declared: due every frame — a kind that never said keeps the desk awake.
|
|
220
|
+
*/
|
|
221
|
+
due?(now: number): number;
|
|
222
|
+
/**
|
|
223
|
+
* What has LANDED on `e` so far — a count the kind moves when something arrives that changes how the object looks with no fact
|
|
224
|
+
* of its own moving (a picture decoded, ink replayed, a raster laid, tiles drawn, a wipe ended), never for a running motion (the
|
|
225
|
+
* ink drying, a wipe running, a pen). The builder reads it after it remakes a restless kind's record: a desk object's that moved
|
|
226
|
+
* remakes the blurred desk copy behind the hand (D7 — its stamp saw only the facts). Absent: nothing lands.
|
|
227
|
+
*/
|
|
228
|
+
landed?(e: Entity): number;
|
|
229
|
+
/** The entity left this desk for good — its ghost faded, it left the frame, the desk was reset: free what it held. */
|
|
230
|
+
forget?(e: Entity): void;
|
|
231
|
+
/**
|
|
232
|
+
* The entity is drawn LIFTED off the desk's order and away from its facts (D3t-a — a print in a hand, flicked, gliding or
|
|
233
|
+
* flying home): the builder paints it with the carried set, above its siblings, and the pick asks it first where it is drawn.
|
|
234
|
+
*/
|
|
235
|
+
lifted?(e: Entity): boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Entities this kind's state says are NOT drawn this frame, of any kind (D3t-c — a note stuck to a day of a month the calendar is
|
|
238
|
+
* not showing): the builder draws none of them and the pick answers `outside` for them. Asked after `tick`, before the draw.
|
|
239
|
+
*/
|
|
240
|
+
veils?(): ReadonlySet<Entity>;
|
|
241
|
+
/** The kind's word on a raster it charged to the budget (D6): true = on screen this frame, never evicted now. */
|
|
242
|
+
keeps?(key: string): boolean;
|
|
243
|
+
dispose?(): void;
|
|
244
|
+
}
|
|
245
|
+
/** What a kind's `rung` reads (K6b): the object as the builder holds it, its SLOT's zoom (an inside's is its host's face's) and the dpr, and its kind's state on this desk. */
|
|
246
|
+
export interface RungContext {
|
|
247
|
+
readonly entity: Entity;
|
|
248
|
+
readonly rect: ObjectRect;
|
|
249
|
+
readonly props: Readonly<Record<string, unknown>>;
|
|
250
|
+
readonly zoom: number;
|
|
251
|
+
readonly dpr: number;
|
|
252
|
+
/** The kind's `local()` on this desk (`KindLocal`); undefined when it keeps none. */
|
|
253
|
+
readonly local: unknown;
|
|
254
|
+
/**
|
|
255
|
+
* The object's distance from the view's centre, screen px — the ORDER of what a kind asks at the new zoom (a raster at another band,
|
|
256
|
+
* of the frame raster queue: `KindHost.rasters`). The rung returned never reads it: it is where the camera is.
|
|
257
|
+
*/
|
|
258
|
+
readonly px: number;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* A kind, whole: the render half the ground registers (`KindProgram` — name, stratum, the pass)
|
|
262
|
+
* and the world half the builder and the pick source drive. `G` is the kind's resolved geometry,
|
|
263
|
+
* `R` the record its pass draws, `L` its look (what `theme()` returns).
|
|
264
|
+
*/
|
|
265
|
+
export interface ObjectKind<G = unknown, R = unknown, L = unknown> extends KindProgram<R> {
|
|
266
|
+
/**
|
|
267
|
+
* How far the kind's drawing may reach PAST its rect, world units — its shadow, its lift, its
|
|
268
|
+
* tilt's overhang: the builder's cull margin, and the pick source's pad (`FramePickSource.pad`).
|
|
269
|
+
*/
|
|
270
|
+
readonly reach: number;
|
|
271
|
+
/** Components and tags the kind reads beyond its own props (the builder adds them to its change journal). */
|
|
272
|
+
readonly reads?: {
|
|
273
|
+
readonly components?: readonly Component[];
|
|
274
|
+
readonly tags?: readonly Tag[];
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* The record reads the view's ZOOM or dpr CONTINUOUSLY (a far-LOD lattice whose lines fade with every step of the zoom) and nothing
|
|
278
|
+
* else of the camera (design-015 §4.3; D6): the builder remakes it whenever they move and reuses it across a pan. A record that
|
|
279
|
+
* reads them only in steps says so with `rung` instead. Absent (and no `rung`) = the record is the facts' and the flux's alone. A
|
|
280
|
+
* composite kind is remade every frame it is drawn whatever it says (its `resolve` steps its own motion).
|
|
281
|
+
*/
|
|
282
|
+
readonly rezoom?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* The record reads the view's zoom or dpr ONLY THROUGH A RUNG (K6b, design-016 §6 — a raster's band): this object's rung under
|
|
285
|
+
* its slot's zoom, and the builder remakes the record only when that moves — a zoom within a rung remakes and writes nothing.
|
|
286
|
+
* Asked of a drawn object whenever its slot's zoom or the dpr moved since its rung was last read, never on a pan; it reads the
|
|
287
|
+
* zoom, never where the camera is. Wins over `rezoom`. A kind whose raster the frame queue makes asks for it HERE (ordered by
|
|
288
|
+
* `ctx.px`) and answers the rung of what it HOLDS — the record shows that until the queue lays the new one (`KindHost.remake`).
|
|
289
|
+
*/
|
|
290
|
+
rung?(ctx: RungContext): number;
|
|
291
|
+
/** A host's LIVE law (D5a — the dev panel's door, `handle.tuneLaw`): the kind resolves under it from the next build. Absent, its law is fixed. */
|
|
292
|
+
tune?(law: unknown): void;
|
|
293
|
+
/** The entity's geometry this frame, from its rect, its props and its flux — the prototype's `resolve*`. */
|
|
294
|
+
resolve(ctx: ObjectContext): G;
|
|
295
|
+
/** The record the kind's pass draws for that geometry — the prototype's instance. */
|
|
296
|
+
record(geometry: G, ctx: ObjectContext): R;
|
|
297
|
+
/** The CPU mirror on the SAME geometry the pass drew: the part under a world point, or null for a miss. */
|
|
298
|
+
hit(geometry: G, wx: number, wy: number): ObjectHit | null;
|
|
299
|
+
/**
|
|
300
|
+
* A CONTAINER kind's FACE as drawn — the window its inside shows through, in the desk's units
|
|
301
|
+
* (the mini mat: the sheet inset by its printed border, through its springs). The builder builds
|
|
302
|
+
* the live inside through it and the nav geometry seam answers core's nav with it (design-015 §9).
|
|
303
|
+
* Absent = the kind holds no desk.
|
|
304
|
+
*/
|
|
305
|
+
face?(geometry: G): Rect | undefined;
|
|
306
|
+
/**
|
|
307
|
+
* A CONTAINER kind's face law (K8a, kit/inside.ts `FaceLaw`): its face's corner radius, the most chips its face draws and the
|
|
308
|
+
* finishes it draws them in — the container's own numbers, never the kit's. Absent on a container: square, no chips.
|
|
309
|
+
*/
|
|
310
|
+
readonly faceLaw?: FaceLaw;
|
|
311
|
+
/**
|
|
312
|
+
* The kind's CHIP — its far impostor inside a container's face (MINIMAT.md §5; K8a: any kind's): the child as a `ChildShape` in
|
|
313
|
+
* ITS desk's units, in a finish the container draws — a note as paper with its writing greeked, a mini mat as vinyl with its
|
|
314
|
+
* border, a plugin kind as either or a finish of a plugin container's; `null` = nothing to chip. Absent = the kind has no chip
|
|
315
|
+
* (the oracle's prints): inside a far face it is not drawn.
|
|
316
|
+
*/
|
|
317
|
+
chip?(geometry: G, ctx: ObjectContext): ChildShape | null;
|
|
318
|
+
/** The grid a CONTAINER kind's inside draws with (the mini mat: the desk's fade-in, the mat in its vinyl, no rulers). Absent = the root's. */
|
|
319
|
+
insideGrid?(ctx: Pick<ObjectContext, "props" | "look">, root: GridConfig): GridConfig;
|
|
320
|
+
/**
|
|
321
|
+
* The silhouette the desk's MARKS go around (D4a — the brackets, a member's ticks, several's union, the tape):
|
|
322
|
+
* the geometry's centre, half extents AS DRAWN (the lift's scale in), turn and corner, world units. Absent =
|
|
323
|
+
* the rect, square to the mat (`rectFrame`).
|
|
324
|
+
*/
|
|
325
|
+
frame?(geometry: G): MarkFrame;
|
|
326
|
+
/** The kind's colours from the host's palette, per theme — the look `record` reads (`ctx.look`). */
|
|
327
|
+
theme?(palette: Palette, name: ThemeName): L;
|
|
328
|
+
/** The kind's own state on one desk (`ctx.local`) — made by the host once per desk; absent = none (D2c). */
|
|
329
|
+
local?(host: KindHost): KindLocal;
|
|
330
|
+
/** The kind's OPENING (design-015 §8, D4b): what picking it up means. Absent = the object never opens (`ops.open` refuses it). */
|
|
331
|
+
readonly open?: OpenBinding;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* What the host lends a kind's DRIVERS (D7 #5, D-D7-A.3 — the hand onto the kind's state: a pen, a carry, a leaf, the
|
|
335
|
+
* calendar's writing and marks). A kind declares them in `defineObject` (`ObjectDef.drivers`); the host makes them once per
|
|
336
|
+
* desk, generically, and ticks them before the kinds' clocks — a third-party openable kind with held tools gets its driver
|
|
337
|
+
* the same way. Everything a driver needs comes through here: the world, the document's doors (docs.ts), the kind's own
|
|
338
|
+
* local and look, the builder's word (geometry as drawn, a held point into the world, the hand), the builder's give.
|
|
339
|
+
*/
|
|
340
|
+
export interface KindDriverHost {
|
|
341
|
+
readonly world: World;
|
|
342
|
+
/** The document's doors — `current()`, the writer's gate, the commit door, the history doors (docs.ts). */
|
|
343
|
+
readonly docs: TypingDocs;
|
|
344
|
+
/** This kind's own local (`ObjectKind.local`), if it declared one. */
|
|
345
|
+
readonly local: KindLocal | undefined;
|
|
346
|
+
/** This kind's look as the desk composed it (the swatches a pen draws in). */
|
|
347
|
+
readonly look: () => unknown;
|
|
348
|
+
/** Is `e` an object of this kind? */
|
|
349
|
+
readonly isKind: (e: Entity) => boolean;
|
|
350
|
+
/** Is `e` an object of the kind named — undefined when that kind is not on this desk. */
|
|
351
|
+
readonly kind: (name: string) => ((e: Entity) => boolean) | undefined;
|
|
352
|
+
/**
|
|
353
|
+
* Does `e`'s object type PROVIDE the key (K8a — `defineObject({ provides })`: the calendar asks after what is `PINNABLE`)? Undefined
|
|
354
|
+
* when no object type on this desk provides it. A kind asks after a capability, never after another kind's name.
|
|
355
|
+
*/
|
|
356
|
+
readonly provides: (key: string) => ((e: Entity) => boolean) | undefined;
|
|
357
|
+
/** The builder's word: an object's geometry as drawn (the kind's `G`), a held-screen point into its world, the hand. */
|
|
358
|
+
readonly geometryOf: (e: Entity) => unknown;
|
|
359
|
+
readonly heldToWorld: (e: Entity, x: number, y: number) => readonly [number, number] | undefined;
|
|
360
|
+
readonly hand: () => {
|
|
361
|
+
readonly entity: Entity;
|
|
362
|
+
readonly landing: boolean;
|
|
363
|
+
readonly frame: {
|
|
364
|
+
readonly cx: number;
|
|
365
|
+
readonly cy: number;
|
|
366
|
+
readonly s: number;
|
|
367
|
+
};
|
|
368
|
+
} | undefined;
|
|
369
|
+
/** The builder's give for a drag the kind refuses (a taped print meets the tape — D4a). */
|
|
370
|
+
readonly refused: (e: Entity) => void;
|
|
371
|
+
/** Ask the desk for a frame (something landed, a mark moved). */
|
|
372
|
+
readonly wake: () => void;
|
|
373
|
+
}
|
|
374
|
+
/** A kind's driver on one desk: ticked once a frame before the kinds' clocks; idle when it has nothing to follow (D7 #14). */
|
|
375
|
+
export interface KindDriver {
|
|
376
|
+
follow(now: number): void;
|
|
377
|
+
/** Nothing to follow this frame — nothing in hand, no press, no rest or roll owed: the host may skip `follow` (the idle-tick budget). Absent: never skipped. */
|
|
378
|
+
idle?(): boolean;
|
|
379
|
+
dispose?(): void;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* An object's DOM HALF (K4b, design-016 §5 · K-L2) — what its kind needs of the browser, DECLARED with the object as its drivers
|
|
383
|
+
* are (`defineObject({ host })`): the desk layer builds what the registered objects declare and never finds a half by type or
|
|
384
|
+
* names a kind. Three moments, in the layer's order:
|
|
385
|
+
* - `lend`, before any kind's local: SERVICES only a browser can make, each under its key (K8a, kit/services.ts — the desk
|
|
386
|
+
* calendar lends `PRINT_RASTER`, in the host's hand, none without a text raster), handed what is lent so far (the host's, then
|
|
387
|
+
* the objects' before it) and the desk's wake for a service whose work lands later (`LendHost.wake` — K7a's sleeping loop steps);
|
|
388
|
+
* any kind's world half `use`s them (`KindHost.use`), a DOM half too (`ObjectDomHost.use`);
|
|
389
|
+
* - `text`, once the drivers are made: the object's TEXT PARTS (K8a, kit/editor.ts `TextPart`) — the parts of its objects that
|
|
390
|
+
* LEASE the desk's ONE editor: a part with a `tap` the desk routes every tap to (the note's body), a part without one its own
|
|
391
|
+
* half leases at event time (the desk calendar's day line). The editor is the DESK's (desk/host/editor.ts): no kind makes it;
|
|
392
|
+
* - `mount`, after that: a screen-space half, handed the editor like every half (the desk calendar's days and pen lease it). A
|
|
393
|
+
* mounted half is ended by what it joins — the calendar's by the calendar's driver.
|
|
394
|
+
*/
|
|
395
|
+
export interface ObjectHost {
|
|
396
|
+
readonly lend?: (host: LendHost) => readonly Lent[];
|
|
397
|
+
readonly text?: (host: ObjectDomHost) => readonly TextPart[] | undefined;
|
|
398
|
+
readonly mount?: (host: ObjectDomHost) => void;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* What the host lends an object's DOM half (K4b): the screen-space container, the object the half was declared on and ITS
|
|
402
|
+
* driver, its kind's look, and the builder's word — a driver host's fields, and the few a browser half adds.
|
|
403
|
+
*/
|
|
404
|
+
export interface ObjectDomHost {
|
|
405
|
+
/** The host's container (screen space): a half's elements go in it, its taps are read on it. */
|
|
406
|
+
readonly container: HTMLElement;
|
|
407
|
+
readonly world: World;
|
|
408
|
+
/** The document's doors (docs.ts) — a half that writes, writes through them. */
|
|
409
|
+
readonly docs: TypingDocs;
|
|
410
|
+
/** The services lent on this desk (K8a — `KindHost.use`'s registry): a DOM half uses them by key as a world half does. */
|
|
411
|
+
readonly use: Services["use"];
|
|
412
|
+
/** The desk's ONE focused editor (K8a — the desk makes it; every kind leases it: kit/editor.ts `EditorLease`). */
|
|
413
|
+
readonly editor: DeskEditor;
|
|
414
|
+
/** The object the half was declared on — its compiled widget type (its props' groups). */
|
|
415
|
+
readonly object: WidgetType;
|
|
416
|
+
/** The object's own driver (`defineObject({ drivers })`), if it declared one. */
|
|
417
|
+
readonly driver: KindDriver | undefined;
|
|
418
|
+
/** The object's kind's look as the desk composed it. */
|
|
419
|
+
readonly look: () => unknown;
|
|
420
|
+
/** The builder's word: an object's geometry as drawn, the hand, a held-screen point into its world. */
|
|
421
|
+
readonly geometryOf: KindDriverHost["geometryOf"];
|
|
422
|
+
readonly hand: KindDriverHost["hand"];
|
|
423
|
+
readonly heldToWorld: KindDriverHost["heldToWorld"];
|
|
424
|
+
/** Ask the desk for a frame. */
|
|
425
|
+
readonly wake: () => void;
|
|
426
|
+
/** A writing session ends after this long without input, ms (`DeskLayerOptions.idleMs`); absent: the half's own. */
|
|
427
|
+
readonly idleMs?: number | undefined;
|
|
428
|
+
}
|
|
429
|
+
/** The strata a kind may declare — re-exported beside the contract for a kind's author. */
|
|
430
|
+
export type { StratumName };
|
|
431
|
+
/** ICE's top-left `Position` + `Size` → the centred rect every law reads: the ONE conversion. */
|
|
432
|
+
export declare function rectOf(pos: {
|
|
433
|
+
readonly x: number;
|
|
434
|
+
readonly y: number;
|
|
435
|
+
}, size: {
|
|
436
|
+
readonly w: number;
|
|
437
|
+
readonly h: number;
|
|
438
|
+
}): ObjectRect;
|
|
439
|
+
/** An object's marks' silhouette when its kind draws none of its own: the rect, square to the mat, no corner. */
|
|
440
|
+
export declare const rectFrame: (r: ObjectRect) => MarkFrame;
|
|
441
|
+
/** The flux of an object at rest: down, unhovered, unselected, whole. */
|
|
442
|
+
export declare const FLUX_REST: ObjectFlux;
|
|
443
|
+
/** A prop read with a type and a default — the kinds' one door to `ctx.props`. */
|
|
444
|
+
export declare const numberProp: (props: Readonly<Record<string, unknown>>, name: string, fallback: number) => number;
|
|
445
|
+
export declare const stringProp: (props: Readonly<Record<string, unknown>>, name: string, fallback: string) => string;
|
|
446
|
+
/** Is this opaque widget binding a desk kind — the world half present beside the program? */
|
|
447
|
+
export declare function isObjectKind(binding: unknown): binding is ObjectKind;
|