Skip to content
Status

Status

container-relative layout and pointer ownership

Maosaico declares source version 0.1.0. Until 1.0, a minor release can change the public API, so pin the version you test against.

Package qualification does not publish a release. Check the npm registry before choosing a released version.

Maosaico stores layout state only for the lifetime of a mounted root. It does not persist frames, provide App identity, own keyboard policy, or move/focus the caller’s content. The host provides bounds, minima, controls, theme, and animation. Resize gestures and tiled mode do not offer snap targets.

Bounds, minima, and size preferences are layout measurements and must be finite and nonnegative. Maosaico adapts the MaoMaoLabs core gesture and snap behavior; see LICENSE for its MIT license terms and attribution.

Maosaico is MIT licensed; see LICENSE.

MaosaicoLayers onDismiss reports host-window blur and focus entering the windows region. Compose it with Caps OverlayRoot subscribeDismiss to retire transient popovers and tooltips together; blocking dialogs and toasts stay live.

arrangeBento reflows caller-owned { id, col, row, w, h } placements into 1, 2 or 4 columns. Spans clamp to the current grid; collisions push occupants down and vertical gaps compact deterministically. IDs are unique within a grid. applyBentoOps accepts move and resize intents without mutating the input. bentoFrames maps accepted cells to container-relative pixel frames. Every accepted move or resize compacts all tiles to an arrangeBento fixpoint; downward moves pass the intersecting occupant. Cells and their extents must fit finite safe integers; duplicate IDs throw. There is no engine product quota on tile count or size.

useMaosaicoBento takes those placements, measured width, columns, rowHeight, gap and an onChange(ops) callback. Optional rowHeights provide measured pixel heights for individual rows; missing rows use rowHeight. Frames and pointer snapping share those row boundaries. Changing measurements cancels an in-flight gesture; equal fresh arrays preserve it. These measurements never change the integer placements. Its previewId names only the live gesture tile. Its frames include the live pointer preview. Spread bind(id, "move") or bind(id, "resize") onto a focusable handle with touchAction: "none". Arrow keys propose one cell; Escape, lost capture, disabling, unmount and host geometry changes cancel a pointer gesture. A completed drop proposes operations through onChange; the host accepts them with applyBentoOps and supplies the new placements.

The host chooses breakpoints and persists its own placements. Reflow does not rewrite storage, and bento does not change MaosaicoRoot window behavior. The controlled bento story composes Caps SectionCard and Button. The browser contract exercises real captured-pointer move, resize, cancellation and keyboard input.