/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The canvas's card layer (#1387, #1393, #1403): the layer the cards draw in — * an item drawn as a card a component of its own (`card.tsx`), told how it * stands in values (invariant 13) — and with them a Move's preview and a * refused connection's caption under the item it would end at, in the shared * drag caption (invariant 6). It holds the live camera's custom properties the * apply writes, so a camera move is three property writes on it and never a * card's re-layout, and the widest card, which the recipe reads. Each card's * size as the page lays it out is heard by a ResizeObserver, for a link's end * to meet (invariant 9): written into one map in place as it moves, never a * copy of it a batch, and let go of as the layer stops observing the card, so * the map holds the sizes of the cards drawn, no more. * * @packageDocumentation */ import { type RefObject } from "react"; import type { SchematicDropMark } from "../drop.js"; import type { SchematicNarrowedLook } from "../narrowing.js"; import { type SchematicCardProps } from "./card"; import type { DrawnItem } from "./drawn"; import { type LodTier } from "./model"; import type { GestureState } from "./use-gestures"; /** Props of {@link SchematicCardLayer}. */ export interface SchematicCardLayerProps { /** The layer's element: what the apply writes the live camera's custom properties to. */ readonly cardLayerRef: RefObject; /** The recipe's styles, resolved once a recipe. */ readonly styles: SchematicCardProps["styles"]; /** The items in view: those drawn as cards draw here. */ readonly visibleItems: readonly DrawnItem[]; /** What each item in view draws as at the zoom. */ readonly tiers: ReadonlyMap; /** The tier the zoom's band draws its items at. */ readonly lod: LodTier; /** What draws as the narrowing's context (#1392). */ readonly context: ReadonlySet; /** How context draws, and what the matches take. */ readonly look: SchematicNarrowedLook; /** The narrowing's matches, by id. */ readonly matches: ReadonlySet; /** The items holding a conflict not yet chosen, by key. */ readonly conflicted: ReadonlySet; /** The items whose rows break their fields' bounds (#1585), by key: none by default. */ readonly bounded?: ReadonlySet | undefined; /** What draws selected: the selection, or what a marquee in flight would select. */ readonly renderSelected: ReadonlySet; /** What a locked layer holds, by id. */ readonly lockedKeys: ReadonlySet; /** Each dimmed entity's opacity, by id. */ readonly layerAlpha: ReadonlyMap; /** Connect's draft: the item it would end at, refused, and why (SC9). */ readonly connectDraft: GestureState["connectDraft"]; /** Where a library card's drop lands while its drag rests there (#1390). */ readonly dropMark: SchematicDropMark | undefined; /** Each item drawn's centre, by its id: where a refusal's caption stands. */ readonly centers: ReadonlyMap; /** Each card's size as the page lays it out, by its item's id (#1403): what the observer writes, in place. */ readonly cardSizesRef: RefObject>; /** Draws the paint again as a card's size moves (`use-paint.ts`' `applyCardSizes`): told the sizes moved, then the apply. */ readonly applyCamera: () => void; } /** * The card layer (see the module docs). * * @param props - The layer's element and the recipe's styles, the items in view and what each draws as, how each card * stands, Connect's draft, the drop's mark, the items' centres, and each card's size and the apply * @returns The layer */ export declare function SchematicCardLayer({ cardLayerRef, styles, visibleItems, tiers, lod, context, look, matches, conflicted, bounded, renderSelected, lockedKeys, layerAlpha, connectDraft, dropMark, centers, cardSizesRef, applyCamera, }: SchematicCardLayerProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=card-layer.d.ts.map