@n-uf/placement 26.11.43 → 26.11.45

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.
@@ -1,6 +1,6 @@
1
1
  import { R as Rect, S as Size, P as Point } from './geometry-Bf37LbCT.js';
2
- import { T as Target } from './target-BBOCeez2.js';
3
2
  import { C as CrossLimits, a as StackForm, S as StackFormKind, b as StackFit, c as StackNote } from './model-X7eUaKlA.js';
3
+ import { T as Target } from './target-BBOCeez2.js';
4
4
 
5
5
  /**
6
6
  * The scene's shapes: one model of a whole window. A scene is a stage (the window's inner rect), the edges along its
@@ -73,6 +73,12 @@ interface SceneItem {
73
73
  * offering a choice (`namesZone`: more than one of its zones takes the kind) sets it.
74
74
  */
75
75
  readonly align?: Zone;
76
+ /**
77
+ * Free space it keeps on its zone's open side, px: before it in a start zone, after it in an end zone (none in a center
78
+ * zone), out of the edge's spare length, so an item dropped partway along a free stretch of a bar stays there. When
79
+ * items ask for more than the spare length, each gets its share. A dock move sets it (`DockPlace.space`) or clears it.
80
+ */
81
+ readonly space?: number;
76
82
  /**
77
83
  * Its give-way priority in its edge (default: the edge's `priority`, else 0). When an edge runs short, items step down
78
84
  * their forms (row, wrap in a column, icons, then the edge's » menu) lowest priority first, ties to the one used longest
@@ -382,14 +388,49 @@ interface Scene {
382
388
  * Tuning one kind never changes another; a kind left out keeps the rail targets it had.
383
389
  */
384
390
  readonly railDrop?: Readonly<Partial<Record<Kind, RailDropPolicy>>>;
391
+ /**
392
+ * `"end"`: no drop changes an item's collapsed state. For an item arriving from elsewhere, collapsed titles are one
393
+ * drop place over their whole length, their tiles included, after the last member: a column drawn as a rail, or on a
394
+ * side with a declared `rails` entry the rail itself (the end of its last folded column). An open item opens that
395
+ * column at full size, a collapsed one becomes the last tile. A tile keeps its place among its own rail's tiles. No
396
+ * rail drop strip (`railDrop`) is offered, and on a declared rail no stop folds an open item. Absent: as before. A
397
+ * declaration, like `zoneAccepts`: never stored.
398
+ */
399
+ readonly foldedColumnDrop?: "end";
400
+ /**
401
+ * `"one"`: a side has at most one column (`isSideColumn`). A drag offers a new-column line only on a side with no
402
+ * column holding an item once the item is lifted; where the side has one, an item goes into it (by its gaps) or
403
+ * nowhere on that side. A stored layout with two columns on a side is merged by `mergeSideColumns`, which a host calls
404
+ * as it reads one. Absent: as before. A declaration, like `foldedColumnDrop`: never stored.
405
+ */
406
+ readonly sideColumns?: "one";
407
+ /**
408
+ * `"nearest"`: a bar's zones (start, center, end) meet halfway between the landing rects either side of each boundary,
409
+ * so the pointer picks the zone whose landing is nearest it. Absent: at thirds of the bar's length (each boundary moved
410
+ * past the cards seen beside it, as now). A declaration, like `foldedColumnDrop`: never stored.
411
+ */
412
+ readonly barZones?: "nearest";
385
413
  /**
386
414
  * The least the content may be. While the content is narrower than `width`, dynamic columns shrink toward their
387
415
  * minimum, then fold whole into their side's rail: unkept before kept, the one whose newest use is oldest first, the
388
416
  * outer first, the left first. Under `height`, a `content-short` note.
417
+ *
418
+ * `chromeWidth` (optional, px, at most `width`): a lower floor for chrome. The side edges that hold toolbars, not
419
+ * panels (compact rails and side toolbar bars, `isSideBar`), may take the content down to it while the columns keep
420
+ * their width. A compact rail or side toolbar bar counts only where its side has a column template or a declared rail
421
+ * to tell it from a panel column (`isSideBar`): on a side with neither it is not chrome and gets no floor benefit.
422
+ * A floor of 0 or less lets chrome take all the content. The columns only move aside: a toolbar rail added at an edge
423
+ * narrows the content, not the column. Below the floor a
424
+ * column shrinks, then folds, as without it. The columns alone still leave `width`. Chrome within that allowance is
425
+ * quiet: a content it narrows between the two floors carries no `content-narrow`, and `columnRoom` stays true, so a
426
+ * toolbar rail never flips a host to its narrow layout. `content-narrow` fires when the columns' own need takes the
427
+ * content under `width` (its `min`: `width` less what chrome takes within the allowance), or once it is under the
428
+ * floor. Width only: bars give way by `height` as before.
389
429
  */
390
430
  readonly contentMin?: {
391
431
  readonly width: number;
392
432
  readonly height: number;
433
+ readonly chromeWidth?: number;
393
434
  };
394
435
  /**
395
436
  * How a column folded by hand shows (default `"bar"`): `"bar"` sends it to its side's rail; `"ride"` draws each of its
@@ -529,6 +570,8 @@ interface SceneRailLayout {
529
570
  * - `bar-shrunk`, `bar-folded`: give-way by `contentMin.height`, in give-way order: a top or bottom bar with `giveWay`
530
571
  * shrank across (`from`, `to`), or its items stepped to the next form that fits (a panel's title bar);
531
572
  * - `content-narrow`, `content-short`: the content is still under `contentMin` (overlay bars count against the height).
573
+ * With `contentMin.chromeWidth`, `content-narrow`'s `min` is `contentMin.width` less what chrome takes within its
574
+ * allowance; a host that says "needs at least …" reads `contentMin.width`, not the note's `min`.
532
575
  * - `no-column-room`: not even one column at its minimum fits beside `contentMin.width` (`layout.columnRoom` false):
533
576
  * `width` is the room the stage leaves, `need` the content's minimum plus that column and its gutter.
534
577
  * - `content-changed`: under `previous`, `content` is not the rect `previous.content` was (`from`, `to`). A host refits
@@ -713,12 +756,17 @@ declare function fitResize(scene: Scene, id: string, rect: Rect, moving: ResizeE
713
756
  * `resize(scene, id, rect, moving?)`: a float resized by hand, at `fitResize`'s rect (./float-resize).
714
757
  */
715
758
 
716
- /** Where a docked item goes: before the `at`-th item of `zone` (default the item's own zone) in `edge`. */
759
+ /**
760
+ * Where a docked item goes: before the `at`-th item of `zone` (default the item's own zone) in `edge`, keeping `space`
761
+ * px free on its zone's open side (`SceneItem.space`; 0: none). Absent, it takes the space its new neighbor kept on
762
+ * that side, if any (the space stays where it lies, the item lands where the neighbor was), and else keeps none.
763
+ */
717
764
  interface DockPlace {
718
765
  readonly kind?: "gap";
719
766
  readonly edge: string;
720
767
  readonly zone?: Zone;
721
768
  readonly at: number;
769
+ readonly space?: number;
722
770
  }
723
771
  /** A new column on `side` at `ring` (the edges at that ring and inward move in one); `Infinity` is the side's inner end. */
724
772
  interface ColumnPlace {
@@ -740,6 +788,13 @@ interface FloatPlace {
740
788
  readonly anchor?: FloatAnchorAt;
741
789
  }
742
790
  type Place = DockPlace | ColumnPlace | RailPlace | FloatPlace;
791
+ /**
792
+ * Each side's columns (`isSideColumn`) merged into one, for `Scene.sideColumns: "one"`: the outermost column (by ring)
793
+ * keeps its id and takes every other column's items after its own, in ring order; the others are deleted and the side's
794
+ * rings closed up. A side with one column or none is unchanged; the same scene comes back when nothing merges. A host
795
+ * calls it as it reads a stored layout, so what it stores is what it shows and what a drag reads.
796
+ */
797
+ declare function mergeSideColumns(scene: Scene): Scene;
743
798
  /** The scene with the item out of every edge and every float (a dynamic column it leaves empty is deleted). */
744
799
  declare function lift(scene: Scene, id: string): Scene;
745
800
  declare function moveTo(scene: Scene, id: string, place: Place): Scene;
@@ -808,7 +863,7 @@ declare function dockHome(scene: Scene, id: string, start: Scene): Scene;
808
863
  * v: 1;
809
864
  * edges: { id: string; side: Side; ring: number; items: string[]; size?: number; column?: true }[];
810
865
  * floats: { id: string; x: number; y: number; width: number; height: number; orient?: "row" | "column"; anchor?: FloatAnchor | { at: FloatAnchor; dx?: number; dy?: number }; since?: number }[];
811
- * items: Record<string, { used: number; kept?: true; from?: number; closed?: true; align?: "center" | "end"; floatSize?: { width: number; height: number } }>;
866
+ * items: Record<string, { used: number; kept?: true; from?: number; closed?: true; align?: "center" | "end"; space?: number; floatSize?: { width: number; height: number } }>;
812
867
  * railModes?: { left?: "titles" | "icons"; right?: "titles" | "icons" };
813
868
  * }
814
869
  * ```
@@ -864,6 +919,8 @@ interface StoredSceneItem {
864
919
  readonly from?: number;
865
920
  readonly closed?: true;
866
921
  readonly align?: "center" | "end";
922
+ /** `SceneItem.space`, px. */
923
+ readonly space?: number;
867
924
  readonly floatSize?: Size;
868
925
  }
869
926
  interface StoredScene {
@@ -927,6 +984,11 @@ interface SceneTargetOptions {
927
984
  readonly endReach?: number;
928
985
  /** The float's size for the float target. */
929
986
  readonly floatSize?: Size;
987
+ /**
988
+ * The float target starts from the held item's rect (`heldRect`), kept inside the float region, before it is fitted, so
989
+ * a host that draws the held item there sees what lands. Default: from the pointer's rect, wherever that lies.
990
+ */
991
+ readonly floatFromHeld?: boolean;
930
992
  /** The float's orient for the float target (default: its float's, else the item's `floatOrientOf`). */
931
993
  readonly floatOrient?: Orient;
932
994
  /** As `solve`'s: edge or item ids solved without `previous`, in every `after` too. */
@@ -966,4 +1028,112 @@ interface SceneRefusal {
966
1028
  readonly bounds?: Rect;
967
1029
  }
968
1030
 
969
- export { ZONES as $, type RailPlace as A, type RailSpec as B, type ColumnPlace as C, DEFAULT_FLOAT_SIZE as D, type Edge as E, type FloatAnchorAt as F, type RailVisibility as G, type ResizeEdges as H, type ResizeLimit as I, SIDES as J, type Kind as K, type SceneAfter as L, type SceneChrome as M, type SceneEdgeLayout as N, type Orient as O, type Place as P, type SceneFloat as Q, type RailMode as R, type Scene as S, type SceneItemLayout as T, type SceneNote as U, type SceneRailLayout as V, type SceneRead as W, type StoredSceneEdge as X, type StoredSceneFloat as Y, type Zone as Z, type StoredSceneItem as _, type ScenePlace as a, canFold as a0, close as a1, dockHome as a2, fitResize as a3, floatAt as a4, fold as a5, homeFor as a6, keep as a7, lift as a8, moveTo as a9, open as aa, orient as ab, raise as ac, readScene as ad, resize as ae, setRailMode as af, setSide as ag, storeScene as ah, use as ai, type SceneLayout as b, type StoredScene as c, type Side as d, type SceneNoteCode as e, type SceneTarget as f, type SceneRefusal as g, type FloatAnchor as h, type ZoneAccepts as i, type SceneItem as j, type SolveOptions as k, type SceneTargetOptions as l, type ColumnTemplate as m, DEFAULT_HIT_BAND as n, DEFAULT_RAIL_MAGNET as o, DEFAULT_STRIP as p, type DockPlace as q, EDGE_ROOM_HOLD as r, FLOAT_ANCHORS as s, type FloatAnchorOffset as t, type FloatPlace as u, type FloatResize as v, RAIL_MODES as w, RAIL_STRIP_MIN as x, RAIL_VISIBILITIES as y, type RailDropPolicy as z };
1031
+ /**
1032
+ * Lanes: the geometry of a docking drag for a landing model (`@n-uf/motion/drag`'s `createLandingModel`).
1033
+ *
1034
+ * A lane is one edge that takes the held item (a bar, a rail, a column) or a virtual one (a new column's line, a
1035
+ * declared rail). Its spots are the places a drop there lands, in order along it: before, between and after its items,
1036
+ * and, on a bar or a toolbar rail, spots at a fixed pitch over the free stretches between items (`SPOT_PITCH`), so a
1037
+ * toolbar lands close to the hand. Each spot keys where its drop draws the other items (a change between two spots
1038
+ * with the same key moves only the held item), and each lane carries its place guides' marks in the layout as drawn.
1039
+ * Each spot has a stretch of the lane that picks it. In a panel column, between two spots that share a neighbor (the
1040
+ * item `Y` in `X|Y` and `Y|Z`), the boundary is that item's middle as drawn (in the held spot's own layout with
1041
+ * `options.spot`, so a column takes a panel by halves of what is seen). On a bar or a toolbar rail, and between any two
1042
+ * other spots, it is halfway across the gap between their landings, each in its own layout, so the pointer is at the
1043
+ * landing it picks and a toolbar moved along an occupied lane stays at the hand. Cuts are kept inside the lane and in
1044
+ * order. The spots come from the same generation and filter as `targets()`, so a spot's
1045
+ * landing is exactly what its drop commits. Spot ids are keyed by the lane, zone and neighboring items, so they survive
1046
+ * the window resizing and most items opening or moving; virtual lanes are keyed by the column they lie beside, not
1047
+ * their ring. Remembered per scene and options; a call with `spot` reworks only the held lane's stretches.
1048
+ */
1049
+
1050
+ /** The pitch of the spots over a bar's free stretches, px: a quarter of a typical toolbar's length (158 px in the lab). */
1051
+ declare const SPOT_PITCH = 40;
1052
+ /** One place a drop in a lane lands. */
1053
+ interface LaneSpot {
1054
+ /**
1055
+ * Stable across solves: `<lane>/<zone>/<item before or ^>|<item after or $>`; an empty edge's `<lane>/<zone>`; a
1056
+ * pitched spot `…@<pitches from its neighbor>`; a virtual lane's `<lane>/line` or `<lane>/end`.
1057
+ */
1058
+ readonly id: string;
1059
+ /** Its stretch of the lane, along the lane's axis, inside the lane's range. */
1060
+ readonly along: readonly [number, number];
1061
+ /** Where the item lands (its rect after the drop). */
1062
+ readonly landing: Rect;
1063
+ /** The drop: its place and `after()` (the layout after it, the room). */
1064
+ readonly target: SceneTarget;
1065
+ /** The item's own place (a release there changes nothing). */
1066
+ readonly home?: true;
1067
+ /** A spot at a pitch over a free stretch (`SceneItem.space`). */
1068
+ readonly pitched?: true;
1069
+ /**
1070
+ * Where its drop draws every item other than the held one, as a key: a change between two spots with the same key
1071
+ * moves only the held item; between two with different keys it reflows the window.
1072
+ */
1073
+ readonly others: string;
1074
+ }
1075
+ /** A stretch of a lane that takes no drop of the item, at least the item's length (a shorter one joins its spots). */
1076
+ interface LaneRefusal {
1077
+ readonly along: readonly [number, number];
1078
+ readonly reason: SceneRefusal["reason"];
1079
+ }
1080
+ /**
1081
+ * A place guide's mark, in the lane's layout as drawn: a `line` across the lane between two items that touch (no room
1082
+ * for the item between them but its own; as thick as their gap allows, up to 2 px, so zero where they meet and the host
1083
+ * strokes it), also at a lane's end next to an item, a `box` over a free stretch the item fits in. Never over an item
1084
+ * drawn there, the held one included, nor a line in a refused stretch.
1085
+ */
1086
+ interface LaneMark {
1087
+ /**
1088
+ * Stable while the items either side stay: `<lane>/line/<before>|<after>`, `<lane>/box/<before>|<after>` (`#<n>` for a
1089
+ * stretch's later pieces), `^` and `$` at the lane's ends; a virtual lane's `<lane>/box/<spot id>`. Key a drawing by it.
1090
+ */
1091
+ readonly id: string;
1092
+ readonly kind: "line" | "box";
1093
+ readonly rect: Rect;
1094
+ }
1095
+ interface Lane {
1096
+ /** The edge's id, or a virtual lane's: `column:<side>:<the column it lies outside, or $>`, `rail:<side>`. */
1097
+ readonly id: string;
1098
+ readonly rect: Rect;
1099
+ /** The axis its spots run along. */
1100
+ readonly axis: "x" | "y";
1101
+ readonly spots: readonly LaneSpot[];
1102
+ readonly refused: readonly LaneRefusal[];
1103
+ /** Its place guides' marks, in the layout as drawn (the held spot's, with `options.spot`). */
1104
+ readonly marks: readonly LaneMark[];
1105
+ }
1106
+ /** Everything a landing model reads for one drag. */
1107
+ interface Regions {
1108
+ readonly lanes: readonly Lane[];
1109
+ /** Refused places outside every lane ("Can't go here"). */
1110
+ readonly refused: readonly Rect[];
1111
+ /** The content: the open space is it less `blocked`. */
1112
+ readonly content: Rect;
1113
+ /** What the open space excludes: drawn edges, docked items, the chrome, a drawn declared rail, `Scene.blocked`. */
1114
+ readonly blocked: readonly Rect[];
1115
+ readonly stage: Rect;
1116
+ /** Where a float of the item may lie: the stage less the inset at its left and right (`heldRect`'s region). */
1117
+ readonly floatRegion: Rect;
1118
+ /** The held item's size as it is now. */
1119
+ readonly item: Size;
1120
+ /** The float target (its `after(point, grab)` is the float landing), or null where the item doesn't float. */
1121
+ readonly float: SceneTarget | null;
1122
+ /** The drag's refusals, from the same generation as the spots (what `refusals()` gives), for a host that shows them. */
1123
+ readonly refusals: readonly SceneRefusal[];
1124
+ }
1125
+ interface LaneOptions extends SceneTargetOptions {
1126
+ /** The pitch of a bar's free-stretch spots, px (default `SPOT_PITCH`; 0 or less: none). */
1127
+ readonly pitch?: number;
1128
+ /** The spot held now: its lane's stretches are drawn in its own layout (the room open). Default: the layout as seen. */
1129
+ readonly spot?: string;
1130
+ }
1131
+ /**
1132
+ * The lanes and regions of a drag of `dragged`: every lane that takes it with its spots and stretches, the refused
1133
+ * places outside lanes, the content and what blocks it, the stage, the float region, the item's size and the float
1134
+ * target. Remembered per scene and options (`previous` by identity); with `spot`, only the held lane's stretches are
1135
+ * worked out again, in that spot's own layout.
1136
+ */
1137
+ declare function lanes(scene: Scene, dragged: string, options?: LaneOptions): Regions;
1138
+
1139
+ export { type SceneItemLayout as $, type LaneSpot as A, RAIL_MODES as B, type ColumnPlace as C, DEFAULT_FLOAT_SIZE as D, type Edge as E, type FloatAnchorAt as F, RAIL_STRIP_MIN as G, RAIL_VISIBILITIES as H, type RailDropPolicy as I, type RailPlace as J, type Kind as K, type Lane as L, type RailSpec as M, type RailVisibility as N, type Orient as O, type Place as P, type ResizeEdges as Q, type Regions as R, type Scene as S, type ResizeLimit as T, SIDES as U, SPOT_PITCH as V, type SceneAfter as W, type SceneChrome as X, type SceneEdgeLayout as Y, type Zone as Z, type SceneFloat as _, type ScenePlace as a, type SceneNote as a0, type SceneRailLayout as a1, type SceneRead as a2, type StoredSceneEdge as a3, type StoredSceneFloat as a4, type StoredSceneItem as a5, ZONES as a6, canFold as a7, close as a8, dockHome as a9, fitResize as aa, floatAt as ab, fold as ac, homeFor as ad, keep as ae, lanes as af, lift as ag, mergeSideColumns as ah, moveTo as ai, open as aj, orient as ak, raise as al, readScene as am, resize as an, setRailMode as ao, setSide as ap, storeScene as aq, use as ar, type SceneLayout as b, type StoredScene as c, type Side as d, type SceneNoteCode as e, type SceneTarget as f, type SceneRefusal as g, type FloatAnchor as h, type ZoneAccepts as i, type SceneItem as j, type RailMode as k, type SolveOptions as l, type SceneTargetOptions as m, type ColumnTemplate as n, DEFAULT_HIT_BAND as o, DEFAULT_RAIL_MAGNET as p, DEFAULT_STRIP as q, type DockPlace as r, EDGE_ROOM_HOLD as s, FLOAT_ANCHORS as t, type FloatAnchorOffset as u, type FloatPlace as v, type FloatResize as w, type LaneMark as x, type LaneOptions as y, type LaneRefusal as z };
@@ -1,6 +1,6 @@
1
1
  import { P as Point, R as Rect } from './geometry-Bf37LbCT.js';
2
2
  import { S as StackFormKind } from './model-X7eUaKlA.js';
3
- import { S as Scene, a as ScenePlace, b as SceneLayout, c as StoredScene, Z as Zone, d as Side, e as SceneNoteCode, f as SceneTarget, g as SceneRefusal } from './model-CSO5fk_L.js';
3
+ import { S as Scene, a as ScenePlace, b as SceneLayout, c as StoredScene, Z as Zone, d as Side, e as SceneNoteCode, f as SceneTarget, g as SceneRefusal, R as Regions } from './lanes-CRAFabRE.js';
4
4
  import './target-BBOCeez2.js';
5
5
 
6
6
  /**
@@ -190,6 +190,14 @@ interface CaseRequires {
190
190
  * whose `dockMinWidth` is above the row's stage width.
191
191
  */
192
192
  readonly docks?: boolean;
193
+ /**
194
+ * The row is a landing row (`LANDING_CASES`): the host drags with a landing model over `lanes()`, from the library
195
+ * version `since` on. A host without one, or on an older version, skips it; the skipped count is a ratchet
196
+ * (`lanesRatchet`).
197
+ */
198
+ readonly lanes?: {
199
+ readonly since: string;
200
+ };
193
201
  }
194
202
  interface CaseRow {
195
203
  /** Generic and stable: an integrating app's suite names rows by it. */
@@ -574,6 +582,182 @@ interface WinOptions {
574
582
  /** A window: dynamic columns on both sides, a rail on each, `contentMin`, padding and gap. */
575
583
  declare function winScene(spec: WinSpec, o?: WinOptions): Scene;
576
584
 
585
+ /**
586
+ * The landing rows: the landing model's properties as conformance rows, played on any host that drags with a landing
587
+ * model (`@n-uf/motion/drag`'s `createLandingModel` over `lanes()`). Placement never imports motion: the model comes in
588
+ * as an input, the way the pick rule does (`createLandingHost({ landing: createLandingModel })`).
589
+ *
590
+ * A row is plain data: a scene, the item dragged, a pointer path at a speed (its first point the press, on the item),
591
+ * a rest at its end, and what must hold on every frame while the pointer moves, on the last frame, and in the layout
592
+ * after the release. A host plays the path at its own frame rate (it must call the model once more after the pointer
593
+ * stops, as every frame does) and reports each frame.
594
+ *
595
+ * Every row carries `requires: { lanes: { since } }`: the first library version with `lanes()`. A host whose library is
596
+ * older skips it (its `version`, read by `runLandingCases`); a host without a landing model doesn't run them, and its
597
+ * suite counts them all as skipped. The skipped count is a ratchet (`lanesRatchet`): it may only fall, and from `LANES_DEADLINE` (or the breaking release, if that
598
+ * comes first) every row must run.
599
+ */
600
+
601
+ /**
602
+ * The first library version with `lanes()`: a landing row's `requires.lanes.since`. 26.11.21 to 26.11.44 shipped
603
+ * without it; the release that ships it is 26.11.45 (a test holds it above 26.11.44, and at or below the package's
604
+ * version once that is past 26.11.44).
605
+ */
606
+ declare const LANES_SINCE = "26.11.45";
607
+ /** The last published version without `lanes()`. */
608
+ declare const LAST_WITHOUT_LANES = "26.11.44";
609
+ /** From this date every landing row runs on every host (or at the breaking release, if that comes first). */
610
+ declare const LANES_DEADLINE = "2026-12-31";
611
+ type LandingRegionName = "lane" | "open" | "refused" | "nowhere";
612
+ /** A landing model, as much of it as a host plays (`@n-uf/motion/drag`'s `createLandingModel` gives one). */
613
+ interface LandingModelLike {
614
+ update(point: Point, time: number, keys?: {
615
+ readonly shift?: boolean;
616
+ }): {
617
+ readonly region: LandingRegionName;
618
+ readonly lane: string | null;
619
+ readonly spot: string | null;
620
+ readonly landing: Rect | null;
621
+ readonly room: boolean;
622
+ readonly guides?: readonly LandingCaseGuide[];
623
+ };
624
+ release(): {
625
+ readonly kind: "spot";
626
+ readonly lane: string;
627
+ readonly spot: string;
628
+ readonly home: boolean;
629
+ } | {
630
+ readonly kind: "float";
631
+ readonly rect: Rect;
632
+ } | null;
633
+ }
634
+ /** What makes a landing model: `createLandingModel`, as an input. */
635
+ type LandingRule = (options: {
636
+ readonly regions: Regions;
637
+ readonly regionsFor: (spot: string) => Regions;
638
+ readonly floatLanding: (point: Point) => Rect | null;
639
+ readonly home?: {
640
+ readonly lane: string;
641
+ readonly spot: string;
642
+ };
643
+ readonly placeGuides?: "off" | "near" | "all";
644
+ }) => LandingModelLike;
645
+ /** A place guide a frame shows: its lane, line or box, and where. */
646
+ interface LandingCaseGuide {
647
+ readonly id: string;
648
+ readonly lane: string;
649
+ readonly kind: "line" | "box";
650
+ readonly rect: Rect;
651
+ }
652
+ /** One frame a host reports: the pointer, whether it is still moving along the path, and the model's answer. */
653
+ interface LandingCaseFrame {
654
+ readonly t: number;
655
+ readonly point: Point;
656
+ readonly moving: boolean;
657
+ readonly region: LandingRegionName;
658
+ readonly lane: string | null;
659
+ readonly spot: string | null;
660
+ readonly landing: Rect | null;
661
+ readonly room: boolean;
662
+ /** The place guides shown ("near"), when the host reports them. */
663
+ readonly guides?: readonly LandingCaseGuide[];
664
+ }
665
+ interface LandingCase {
666
+ /** Generic and stable. */
667
+ readonly id: string;
668
+ readonly title: string;
669
+ readonly expect: string;
670
+ readonly scene: Scene;
671
+ readonly item: string;
672
+ /** The pointer path, stage px; the first point is the press on the item. */
673
+ readonly path: readonly Point[];
674
+ /** px/ms. */
675
+ readonly speed: number;
676
+ /** The pointer rests at the path's end this long before the release, ms. */
677
+ readonly rest?: number;
678
+ /** On every frame while the pointer moves. */
679
+ readonly moving?: {
680
+ /** The lane held on every frame (and never anything else). */
681
+ readonly lane?: string;
682
+ /** Lanes never held. */
683
+ readonly notLanes?: readonly string[];
684
+ /** Regions never shown. */
685
+ readonly notRegions?: readonly LandingRegionName[];
686
+ /** Whenever a lane is held, the landing lies within this many px of the pointer. */
687
+ readonly trail?: number;
688
+ /**
689
+ * The landing lies no further from the pointer, at worst, than when the same path is played at `slow` px/ms, plus
690
+ * `by` px: a fast hand trails no more than a slow one does, plus what it may trail.
691
+ */
692
+ readonly trailOverSlow?: {
693
+ readonly slow: number;
694
+ readonly by: number;
695
+ };
696
+ /** Places where no guide lies (nothing lands there): a guide touching one of these rects fails. */
697
+ readonly noGuideIn?: readonly Rect[];
698
+ };
699
+ /** On the last frame before the release. */
700
+ readonly end?: {
701
+ readonly region: LandingRegionName;
702
+ readonly lane?: string | null;
703
+ readonly spot?: string;
704
+ };
705
+ /** The layout after the release. */
706
+ readonly layout?: LayoutExpect;
707
+ readonly requires: CaseRequires & {
708
+ readonly lanes: {
709
+ readonly since: string;
710
+ };
711
+ };
712
+ }
713
+ /** What a host gives the landing runner: one call plays a row's drag and reports its frames and the layout after. */
714
+ interface LandingCaseHost {
715
+ /** The library version the host runs (`YY.M.R`); a row needing a later one is skipped. Absent: the latest. */
716
+ readonly version?: string;
717
+ play(row: LandingCase): {
718
+ readonly frames: readonly LandingCaseFrame[];
719
+ readonly layout: SceneLayout;
720
+ } | Promise<{
721
+ readonly frames: readonly LandingCaseFrame[];
722
+ readonly layout: SceneLayout;
723
+ }>;
724
+ }
725
+ interface LandingCaseResult {
726
+ readonly id: string;
727
+ readonly ok: boolean;
728
+ readonly failures: readonly string[];
729
+ /** Why the row didn't run, or null. */
730
+ readonly skipped: string | null;
731
+ }
732
+ /** What differs between a row and what its host played. */
733
+ declare function landingIssues(row: LandingCase, frames: readonly LandingCaseFrame[], layout: SceneLayout): string[];
734
+ /**
735
+ * Plays every row on `host` and says what differs. A row whose `requires.lanes.since` is after the host's `version` is
736
+ * skipped (and listed as such); a row that throws fails.
737
+ */
738
+ declare function runLandingCases(rows: readonly LandingCase[], host: LandingCaseHost): Promise<LandingCaseResult[]>;
739
+ /**
740
+ * The ratchet on landing rows a host skips (any reason: no landing model, an older library, a row it can't play):
741
+ * `skipped` may not exceed the `baseline` the host recorded last, and from `LANES_DEADLINE` (`today`, `YYYY-MM-DD`) or
742
+ * at the `breaking` release it must be 0. The issues, none when it holds.
743
+ */
744
+ declare function lanesRatchet(r: {
745
+ readonly skipped: number;
746
+ readonly baseline: number;
747
+ readonly today: string;
748
+ readonly breaking?: boolean;
749
+ }): string[];
750
+ /**
751
+ * The in-memory reference host for landing rows: `lanes()` over the scene as solved, the landing model `landing` makes
752
+ * (`createLandingModel`), a frame every 8 ms along the path (and on through the rest, the same point again), and a
753
+ * release that commits the spot's or the float's `after(...).scene`.
754
+ */
755
+ declare function createLandingHost(o: {
756
+ readonly landing: LandingRule;
757
+ readonly version?: string;
758
+ }): LandingCaseHost;
759
+ declare const LANDING_CASES: readonly LandingCase[];
760
+
577
761
  /**
578
762
  * Every row, in order: the docking cases, the bar cases, the built-in rules, the panel gestures, the two windows. The
579
763
  * rows that need docked panels carry `requires: { docks: true }` (see `./docks`).
@@ -587,4 +771,4 @@ declare const CASE_GROUPS: readonly {
587
771
  /** The row with this id, or undefined. */
588
772
  declare const caseById: (id: string) => CaseRow | undefined;
589
773
 
590
- export { type AimArea, type AsyncCaseHost, CASES, CASE_GROUPS, type CaseGroup, type CaseHost, type CaseRequires, type CaseResult, type CaseRow, type CaseSettings, type Checkpoint, type DomCheck, type DomRoot, END_REACH, type EdgeExpect, type Gesture, type GestureType, type IdMap, type ItemExpect, LIFT_THRESHOLD, type LayoutExpect, type PickCandidate, type PickRule, type Rename, type SceneHost, type SceneHostOptions, type StoredExpect, WINDOW_A, WINDOW_B, WINDOW_BARE, type WinOptions, type WinSpec, caseById, createSceneHost, defaultItemSelector, g, idRenames, layoutIssues, mapGesture, mapLayout, mapPlace, mapScene, mapStored, pickTarget, resizeStep, resolvePlace, runCase, runCaseAsync, runCases, runCasesAsync, winScene, withRefusals };
774
+ export { type AimArea, type AsyncCaseHost, CASES, CASE_GROUPS, type CaseGroup, type CaseHost, type CaseRequires, type CaseResult, type CaseRow, type CaseSettings, type Checkpoint, type DomCheck, type DomRoot, END_REACH, type EdgeExpect, type Gesture, type GestureType, type IdMap, type ItemExpect, LANDING_CASES, LANES_DEADLINE, LANES_SINCE, LAST_WITHOUT_LANES, LIFT_THRESHOLD, type LandingCase, type LandingCaseFrame, type LandingCaseGuide, type LandingCaseHost, type LandingCaseResult, type LandingModelLike, type LandingRegionName, type LandingRule, type LayoutExpect, type PickCandidate, type PickRule, type Rename, type SceneHost, type SceneHostOptions, type StoredExpect, WINDOW_A, WINDOW_B, WINDOW_BARE, type WinOptions, type WinSpec, caseById, createLandingHost, createSceneHost, defaultItemSelector, g, idRenames, landingIssues, lanesRatchet, layoutIssues, mapGesture, mapLayout, mapPlace, mapScene, mapStored, pickTarget, resizeStep, resolvePlace, runCase, runCaseAsync, runCases, runCasesAsync, runLandingCases, winScene, withRefusals };