@n-uf/placement 26.11.44 → 26.11.46

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/CHANGELOG.md CHANGED
@@ -3,6 +3,81 @@
3
3
  Versions are calendar versions, `YY.M.R` (year, month of the release, counter within the month), shared with
4
4
  `@n-uf/motion`: both packages carry the same version, and a release bumps both.
5
5
 
6
+ ## 26.11.46
7
+
8
+ A fix for hosts on the landing model. Host notes: pass the drag's grab to `lanes()` (`{ previous, grab }`, and the
9
+ same in the `regionsFor` call with `spot`), the offset a target's `after(point, grab)` already takes. A host that
10
+ doesn't gets exactly the stretches of 26.11.45, and fails the two new landing rows.
11
+
12
+ - `./scene`, **`lanes()` takes the grab** (fix, additive option): on a bar or a toolbar rail the cut between two spots
13
+ lay halfway between their landings, where the pointer is only when it holds the item at its middle. Free-stretch
14
+ spots lie a pitch (40 px) apart, so the item's own place was picked only within about 20 px of its middle: a toolbar
15
+ pressed near one end, taken away and brought back to its press point landed on the spot beside its own place, one or
16
+ two pitches over. `LaneOptions.grab` puts each cut there, along the item's own length, halfway between the points
17
+ the pointer would hold in each landing (landings of one length), so the press point lies on the item's own place
18
+ however far from its middle it was pressed. Across the item, and in a lane across its length, the middle counts.
19
+ Without it, the item's middle is the grab (as before). Panel columns cut by halves whatever the grab. Pass the
20
+ press's grab, constant for the drag. Not settled here: where another lane's band overlaps the press point (an
21
+ empty bar's band over the end of a rail), that lane can still take the pointer first.
22
+ - `./scene/cases`, **two landing rows** (additive): `landing-back-home-bar` and `landing-back-home-rail`, a toolbar
23
+ pressed near one end, taken into the document and brought back to its press point, ending on its own place. They
24
+ need `GRAB_SINCE` (26.11.46): a host that says it runs 26.11.45 skips them. The reference host
25
+ (`createLandingHost`) passes its grab to `lanes()`.
26
+
27
+ ## 26.11.45
28
+
29
+ The geometry for the landing model, opt-in: a scene that sets none of the new fields lays out, targets and stores
30
+ exactly as in 26.11.44. Host notes: `SceneItem.space` is stored once an item keeps space, and 26.11.44 or older drops
31
+ it on read (listed as `item:<id>:space`), so a host that sets it doesn't roll back across versions; the landing rows'
32
+ ratchet is due on 2026-12-31 (`LANES_DEADLINE`), from when a host that runs `lanesRatchet` must skip none. With
33
+ `@n-uf/motion` 26.11.45 (`createLandingModel`).
34
+
35
+ - `./scene/cases`, **landing rows** (additive): `LANDING_CASES`, the landing model's properties as rows (a path at a
36
+ speed, what holds on every frame, at the end and after the release), `runLandingCases`, the reference host
37
+ `createLandingHost({ landing })` (the model is an input: placement doesn't import motion), and the ratchet on skipped
38
+ rows, `lanesRatchet`: the count may only fall, and from `LANES_DEADLINE` (2026-12-31) or the breaking release every
39
+ row runs. Each row needs `requires.lanes.since` (`LANES_SINCE`, 26.11.45, the first release with `lanes()`). The rows
40
+ are not in `CASES`, so a suite that runs `CASES` is unchanged.
41
+
42
+ - `./scene`, **`lanes()`** (additive): a drag's lanes (every edge that takes the item, and the virtual ones), each with
43
+ its spots in order (landing, target, stretch: in a panel column the cut is at the middle of the item two spots share,
44
+ as drawn; in a bar or toolbar rail it is halfway across the gap between their landings), refused
45
+ stretches, refused places outside lanes, the content and what blocks it (the chrome and a drawn declared rail
46
+ included), the stage, the float region, the item's size, the float target and the drag's refusals (one generation), for
47
+ a landing model. Spots are stable by
48
+ id; a bar's or a toolbar rail's free stretches, an empty bar's included, get spots at `SPOT_PITCH` (40 px). Each spot
49
+ keys where its drop draws the `others` (two spots with one key differ only in the held item); each lane carries its
50
+ place guides' `marks` (lines between items and at its ends, a box per free stretch, never over an item, only where a
51
+ drop lands, and none on the held item's own edge), each with a stable `id` naming what it separates other than the held
52
+ item, in the layout as drawn; a refused stretch shorter than the item joins its spots. Beside an item that keeps space
53
+ there is also a dock that keeps none, and a growing title's length beyond its natural length counts as free stretch.
54
+ Remembered per scene and options; `options.spot` reworks only the held lane, in that spot's layout. A float or a new
55
+ column clears an item's `space`.
56
+
57
+ - `./scene`, **`SceneItem.space`**, **`DockPlace.space`** (additive): free space an item keeps on its zone's open side,
58
+ out of the edge's spare length; a dock move sets it (0: none), and with none named it takes the space its new
59
+ neighbor kept on that side (the space stays where it lies); the stored form keeps it. With no item keeping space,
60
+ nothing changes.
61
+
62
+ - `./scene`, **`Scene.sideColumns`**, **`mergeSideColumns`**, **`isSideColumn`** (additive). With `sideColumns: "one"` a
63
+ side has at most one column: a drag offers a new-column line only on a side with no column holding an item once the
64
+ item is lifted. `mergeSideColumns` merges a side's columns into the outermost (items in ring order, the outermost's
65
+ id and size kept), for a host reading a stored layout. Absent, nothing changes.
66
+
67
+ - `./scene`, **`Scene.barZones`** (additive). With `"nearest"`, a bar's zones meet halfway between the landing rects
68
+ either side of each boundary instead of at thirds. Absent, nothing changes.
69
+
70
+ - `./scene`, **`heldRect(scene, id, size, pointer, grab)`** and **`SceneTargetOptions.floatFromHeld`** (additive): where
71
+ a held item lies, the grip under the pointer where it fits, else moved just enough to lie wholly inside the float
72
+ region (the stage less the inset at its left and right). With `floatFromHeld` the float target starts from that rect;
73
+ without it, float drops land as before.
74
+
75
+ - `./scene`, **`Scene.foldedColumnDrop`** (additive). With `"end"`, no drop changes an item's collapsed state. For an
76
+ item arriving from elsewhere, collapsed titles (a column drawn as a rail, or a declared rail) are one drop place over
77
+ their whole length, tiles included, after the last member: an open panel opens the column at full size, a collapsed
78
+ one becomes the last title tile. A tile still moves within its own rail. Rail drop strips and the rail stops that fold
79
+ an open panel are not offered. Without it nothing changes.
80
+
6
81
  ## 26.11.44
7
82
 
8
83
  - `./scene`, **the content gives way to chrome** (additive). `contentMin.chromeWidth` is a lower content floor for
package/README.md CHANGED
@@ -982,6 +982,88 @@ ignored, and a list with no zone counts as all three. With `zoneAccepts` as well
982
982
  say so (`zoneAccepts: { start: [...] }` alone keeps three zones and refuses the other two thirds). Like `zoneAccepts`,
983
983
  `zones` is a declaration: `storeScene` never writes it and `readScene` takes it from `base`.
984
984
 
985
+ **A drop on collapsed titles.** With `Scene.foldedColumnDrop: "end"`, no drop changes an item's collapsed state. For an
986
+ item arriving from elsewhere, collapsed titles are one drop place over their whole length, their tiles included, after
987
+ the last member: a column drawn as a rail or, on a side with a declared `rails` entry, the rail itself (the end of its
988
+ last folded column). An open panel opens that column around it at full size, a collapsed one becomes the last title
989
+ tile. A tile dragged within its own rail still moves among that rail's places, staying collapsed. No rail drop strip is
990
+ offered, whatever `railDrop` says, and on a declared rail no stop folds an open panel; with no rail showing, an open
991
+ panel has no stop there. It is a declaration too, never stored.
992
+
993
+ **One column per side.** With `Scene.sideColumns: "one"`, a side has at most one column (`isSideColumn`: a left or right
994
+ edge that takes something and is neither a compact rail nor a toolbar bar). A drag offers a new-column line only on a side
995
+ with no column holding an item once the dragged item is lifted; where the side has a column, an item goes into it by its
996
+ gaps. `mergeSideColumns(scene)` merges a side's columns into the outermost, its items first and the others' after in
997
+ ring order, keeping the outermost's id and size; a host calls it as it reads a stored layout, so what it stores next is
998
+ what it shows and what a drag reads. A declaration, never stored.
999
+
1000
+ **Nearest bar zones.** With `Scene.barZones: "nearest"`, a bar's start, center and end zones meet halfway between the
1001
+ landing rects either side of each boundary, not at thirds, so the pointer picks the zone whose landing is nearest it. A
1002
+ declaration, never stored.
1003
+
1004
+ **Space kept on a zone's open side.** `SceneItem.space` is free space an item keeps before it in a start zone or after it
1005
+ in an end zone, out of the edge's spare length (shared out when items ask for more). A dock move sets it with
1006
+ `DockPlace.space` (0: none). With none named, a dock on the open side of a neighbor that keeps space takes that space
1007
+ (it lands where the neighbor was, and the neighbor moves by the item only), and else keeps none. The stored form keeps
1008
+ it. `lanes()` offers both beside such a neighbor: the dock taking its space, and one keeping none at the stretch's
1009
+ other end. A title that grows to fill its bar counts its length past its natural one as free stretch for pitched
1010
+ spots.
1011
+
1012
+ **Lanes for a landing model.** `lanes(scene, id, options)` gives what a landing model (`@n-uf/motion/drag`) reads for a
1013
+ drag of `id`:
1014
+ - `lanes`: every edge that takes it (and the virtual ones: a new column's line, a declared rail), each with its rect, its
1015
+ axis and its spots in order. A spot is a place a drop there lands: its `landing` rect, its `target` (the drop, its
1016
+ `after()`), and its `along` stretch of the lane, the part that picks it. In a panel column, between two spots that
1017
+ share a neighbor (the item `Y` in `X|Y` and `Y|Z`) the boundary is that item's middle as drawn, so a column takes a
1018
+ panel by halves; with `options.spot` the held spot's lane is drawn in that spot's own layout (its room open). On a bar
1019
+ or a toolbar rail, and between any two other spots, the boundary is halfway across the gap between their landings,
1020
+ each in its own layout: wherever the pointer is, it is at the landing it picks or no nearer the other, so a toolbar
1021
+ moved along an occupied bar stays at the hand (within half the difference of its and its neighbor's lengths, plus
1022
+ the 6 px margin). Pass `options.grab`, where the pointer holds the item (its offset from the item's top left, as a
1023
+ target's `after(point, grab)` takes it; the press's, constant for the drag, in both calls, with and without `spot`):
1024
+ on a bar or a toolbar rail along the item's own length that gap is then measured at the grab, halfway between the
1025
+ points the pointer would hold in each landing (with landings of one length), so a pointer brought back to its press
1026
+ point picks the item's own place however far from its middle it was pressed. Across the item, and in a lane across
1027
+ its length (a rail toolbar over a bar), the middle counts, as without a grab. Without it the item's middle is the
1028
+ grab, and a toolbar pressed near one end can come back to a free-stretch spot beside its own place. Panel columns cut
1029
+ by halves whatever the grab. One case it doesn't settle: where another lane's band overlaps the press point (an
1030
+ empty bar's band over the end of a rail), that lane can take the pointer first. Every cut lies inside its lane, in
1031
+ order. A spot's `others` keys where its drop draws every item but
1032
+ the held one: a change between two spots with the same key moves only the held item, so a model gates only changes
1033
+ between spots whose keys differ (that reflow the window).
1034
+ - `marks` per lane, the place guides in the layout as drawn (the held spot's, with `options.spot`): a `line` across the
1035
+ lane between two items too close for the item between them, and at a lane's end next to an item; a `box` over each
1036
+ free stretch it fits in (a virtual lane: a box at its landing, a line beside it where the held item is drawn over
1037
+ it). Only where a drop lands (a spot between those two items, or beside the held one), so none beside fixed chrome
1038
+ nothing lands next to. Never over an item drawn on the lane, the held one included, nor a line in a refused stretch. Each mark has an
1039
+ `id` (`<lane>/line/<before>|<after>`, `<lane>/box/<before>|<after>`, `^` and `$` at the ends) that stays while its
1040
+ neighbors stay, so a host keys its drawing by it.
1041
+ - `refused` stretches per lane, each at least the item's length (a shorter one joins its spots), and refused places
1042
+ outside lanes;
1043
+ - the `content`, and what `blocked` takes out of it (drawn edges, docked items, the chrome, a drawn declared rail, the
1044
+ scene's `blocked` spots, where a release cancels): the open space;
1045
+ - the stage, the `floatRegion` (the stage less the inset at its left and right, as `heldRect` keeps a held item), the
1046
+ item's size, and the float target;
1047
+ - the drag's `refusals`, from the same generation (what `refusals()` gives): with the spots' targets and the float, a
1048
+ host has every target and refusal of the lift from one call.
1049
+
1050
+ A bar's free stretches, and a toolbar rail's (a compact edge, along its length), get spots at `SPOT_PITCH` (40 px;
1051
+ `options.pitch`), each a dock keeping `space`, so a toolbar lands close to the hand; an empty bar gets them over its whole length less its padding. Where a stretch is too short for the
1052
+ item, or lies next to a center item, it has none, so coverage is not universal: a point next to a center item that
1053
+ doesn't fit beside it can still be far from its landing (452 px at worst in the sweep scenes).
1054
+
1055
+ Spot ids are keyed by the lane, zone and neighboring items: `<lane>/<zone>/<before>|<after>`, an empty edge's
1056
+ `<lane>/<zone>`, `@<n>` for a pitched spot (pitches from its neighbor), a virtual lane's `<lane>/line` or `<lane>/end`.
1057
+ A new column's lane is `column:<side>:<the column it lies outside, or $>`, not its ring. Ids survive the window resizing;
1058
+ an item opening or moving beside a spot can change it (61–82% kept in the sweeps), so a landing model maps a lost id to
1059
+ its lane's nearest spot. The spots come from the same generation and filter as `targets()`, so a spot's landing is
1060
+ exactly what its drop commits. `lanes()` is remembered per scene and options (`previous` by identity); a call with `spot`
1061
+ reworks only the held lane's stretches (0.03–0.66 ms per spot change), while the first call of a lift solves each spot
1062
+ once (2–18 ms at 1200–3200 px wide with full bars; 130–190 ms in the most crowded generated scenes).
1063
+
1064
+ A declared rail is one lane with one spot, its end: reordering the tiles inside a declared rail is not a lane's job
1065
+ (the rail keeps its own tile order).
1066
+
985
1067
  **Column footers.** `Edge.zoneAccepts` (and `ColumnTemplate.zoneAccepts`, for the columns a drop makes) narrows `accepts` per zone:
986
1068
  the kinds each zone takes, and a zone not listed takes nothing. A panel column with `{ start: ["panel"], end: ["group"] }`
987
1069
  has its panels at the top and a footer of toolbar groups at its foot (the end zone, one group per row): a group in the footer
@@ -1077,6 +1159,11 @@ none lays out as before.
1077
1159
  bar or an anchor at the window's edge is never pushed inward. Column and rail places count rings as the side's edges
1078
1160
  lie (by ring, then by order, no ties), and `homeFor` gives a start column's ring that way.
1079
1161
 
1162
+ **Holding an item.** `heldRect(scene, id, size, pointer, grab)` is where a held item lies: its grip under the pointer
1163
+ where it fits, else moved just enough to lie wholly inside the float region (the stage less the inset at its left and
1164
+ right). Pass `floatFromHeld: true` to `targets` and the float target starts from the same rect, so a host that draws the
1165
+ held item there sees what lands. Without it the float target starts from the pointer's rect, wherever that lies.
1166
+
1080
1167
  **Floats** lie above the content in stage px, last on top. Each is moved inside the stage and clear of every docked
1081
1168
  item, every bar and every `chrome` rect (`fitFloat`, which `./scene` exports with `FloatFit`), with `float-clamped`, `float-moved` or `float-covers` notes. With
1082
1169
  `anchor` (such as `"content-top-right"`) it sits flush with that side or corner of the content and follows it until a
@@ -1571,6 +1658,34 @@ declare function pageHost(): Promise<AsyncCaseHost>;
1571
1658
  const results = await runCasesAsync(CASES, pageHost, { onResult: (id, r) => console.log(id, r.ok) });
1572
1659
  ```
1573
1660
 
1661
+ **Landing rows.** `LANDING_CASES` are the landing model's properties as rows, for a host that drags with one
1662
+ (`@n-uf/motion/drag`'s `createLandingModel` over `lanes()`): a scene, the item dragged, a pointer path at a speed (its
1663
+ first point the press), a rest, and what holds on every frame while the pointer moves (the lane held, lanes or regions
1664
+ never shown, how far the landing may trail the pointer, or no further than the same path played slowly plus a
1665
+ margin), on the last frame and in the layout after the release. They cover the rail repro, the window's edge (on it
1666
+ and up to 48 px past it docks, beyond is nowhere), a fast pass over a bar, lane to lane at a corner, a fast hand along
1667
+ a free stretch and across docked items, and a toolbar taken away by one end and brought back to its press point,
1668
+ which lands home. A host implements `play(row)`: its frames (`LandingCaseFrame`) and the layout
1669
+ after. `runLandingCases(rows, host)` says what differs. Placement doesn't import motion, so the reference host takes
1670
+ the model as an input, as the scene host takes the pick rule:
1671
+
1672
+ ```ts
1673
+ import { createLandingModel } from "@n-uf/motion/drag";
1674
+ import { createLandingHost, LANDING_CASES, lanesRatchet, runLandingCases } from "@n-uf/placement/scene/cases";
1675
+
1676
+ const results = await runLandingCases(LANDING_CASES, createLandingHost({ landing: createLandingModel }));
1677
+ const skipped = results.filter((r) => r.skipped).length;
1678
+ // The host's suite records its count; it may only fall, and from 2026-12-31 (or the breaking release) it must be 0.
1679
+ expect(lanesRatchet({ skipped, baseline: 0, today: new Date().toISOString().slice(0, 10) })).toEqual([]);
1680
+ ```
1681
+
1682
+ Every landing row carries `requires: { lanes: { since } }`: `LANES_SINCE`, the first version with `lanes()` (26.11.45;
1683
+ 26.11.21 to 26.11.44, `LAST_WITHOUT_LANES`, shipped without it), or a later one where the row needs more: the rows
1684
+ that bring an item back to its press point need `GRAB_SINCE` (26.11.46, `lanes()` taking the grab), and pass only on a
1685
+ host that passes its grab to `lanes()`. A host that says it runs an older `version` skips a row. The skipped count is a ratchet (`lanesRatchet`): it may not exceed the
1686
+ baseline the host's suite recorded, and from `LANES_DEADLINE` (2026-12-31) or at the breaking release, whichever comes
1687
+ first, every row runs.
1688
+
1574
1689
  ## Tiling
1575
1690
 
1576
1691
  `@n-uf/placement/tiling` divides an area among panes, with no overlap and no hole. It has two models; **use an order