Skip to content

ResolvedTarget

@whittakertech/mosaic / ResolvedTarget

Interface: ResolvedTarget

Defined in: drag/resolver.ts:22

The outcome of resolving a drop destination at a point in the DOM.

A ResolvedTarget unifies the destination concerns introduced across the v0.3 “Spatial Intelligence” milestone: explicit drop targets (#11), nesting depth (#12), and group scoping (#13). In v0.2-equivalent flat layouts the forward-looking fields collapse to their trivial values — container is the root, depth is 0, group is null, and ancestors is empty.

Remarks

Resolution is pure and side-effect free. The returned object describes where a drop would land; it does not mutate the DOM.

Properties

ancestors

ancestors: HTMLElement[];

Defined in: drag/resolver.ts:49

Ancestor chain from (but excluding) the target up to the root.

Constraint rules use this to evaluate nesting/parent context. Populated by #12/#13; empty for flat resolution.


container

container: HTMLElement;

Defined in: drag/resolver.ts:35

The element the active node would be inserted into.

In v0.2/#11 this is always the Mosaic root; nested targets (#12) and groups (#13) populate it with the resolved container.


depth

depth: number;

Defined in: drag/resolver.ts:38

Nesting depth of the target (0 = root-level). Populated by #12.


element

element: HTMLElement;

Defined in: drag/resolver.ts:24

The matched element — a draggable node or an explicit drop target.


group

group: HTMLElement | null;

Defined in: drag/resolver.ts:41

Nearest group ancestor of the target, or null. Populated by #13.


instanceId

instanceId: string;

Defined in: drag/resolver.ts:63

The mosaicInstanceId of the Mosaic instance whose root/selectors this target was resolved against (#158/RM-21.2).

Remarks

Always set — including for an own-instance resolution, which carries the resolving instance’s own id rather than being left undefined — so downstream code never has to special-case “undefined means self”. A cross-peer resolution (a linked peer’s root/selectors, probed as a fallback when the dragging instance’s own resolution returns null) carries that peer’s id instead.


kind

kind: TargetKind;

Defined in: drag/resolver.ts:27

Whether the match is a draggable node or an explicit drop target.