@n-uf/placement 26.11.48 → 26.11.50

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,70 @@
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.50
7
+
8
+ Stretch positions. With `@n-uf/motion`'s sliding spots. Host notes: **a contract change**: `stretchPositions` now
9
+ defaults to `"free"`; pass `"pitched"` for the old pitched spots. Under `"free"`, commit a sliding spot through its
10
+ target's `after(point, grab)` (a release by id alone must pass the pointer), give the landing model the press's grab,
11
+ and read a release's `home` and `at` (not the target's place kind) to tell the item's own place from a move along its
12
+ stretch.
13
+
14
+ - `./scene`, **`LaneOptions.stretchPositions`** (`"free" | "pitched"`, default `"free"`) and
15
+ **`LaneOptions.snapDistance`** (default 8). **Contract change:** `stretchPositions` now defaults to `"free"`; pass
16
+ `"pitched"` for the old pitched spots. A free stretch on a bar or a toolbar rail is a range of landings from flush
17
+ against one neighbor to flush against the other: `"pitched"` samples it every `pitch` px, its ends included (its
18
+ ids and its ends changed in this release: see the room model below); `"free"` gives one sliding spot, `LaneSpot.slide` (`LaneSlide`: `{ from, to, snaps, snapDistance, step }`),
19
+ id `<lane>/<zone>/<before>|<after>@slide`. Its `target.after(point, grab)` lands the item's start at the pointer less
20
+ the grab, clamped and snapped (to the stretch's ends, the item's own place and any dock inside), else on a whole
21
+ pixel (`step` 1), as a dock keeping the `space` that puts it there. A release within the snap distance of the
22
+ item's own place is home. The stretch stays one guide box. `pitch` of 0 or less turns pitched spots off; under
23
+ `"free"` it only sets the sampling step that checks a stretch's range (40 px when 0 or less).
24
+ - `./scene`, **the room model: contract changes.** Room is the free length an item keeps on its zone's open side
25
+ (`SceneItem.space`) and belongs to the stretch, not to the item that sits beside it:
26
+ - `lift` gives the item's room to the next placed item in its zone (the first that keeps room, past the flush items
27
+ between), which stays where it is; before, the room went with the item.
28
+ - `moveTo` and `moveAmong` consume a placed neighbor's room: an item docked into room lies flush against its zone's end of
29
+ it (or where its own `space` puts it) and the neighbor keeps what is left. The old rule, "the item takes the space
30
+ its new neighbor kept", is gone, and a named `space` in a `DockPlace` now changes the neighbor.
31
+ - `floatAt` lifts first, so the room the item held goes to the next placed item as for `lift`.
32
+ - `ROOM_SINCE` (`"26.11.50"`, `./scene/cases`) and two new `LANDING_CASES` rows: the rows that pass a neighbor keeping
33
+ room need a library with this model; a host on an older version skips them.
34
+ - Takeover spots `…@in:<neighbor>` in both modes: over a neighbor itself the item takes its place and the neighbor gives
35
+ way by the item's length, so passing a neighbor longer than the room beside it leaves no gap between the landings
36
+ either side.
37
+ - Pitched ids at a stretch's end: the end that keeps some space is `…@to:<neighbor>` (the neighbor it lies against),
38
+ where it was `…@<n>` (pitches kept); the open-end "dock keeping none" spots are removed. A host that keys on a
39
+ pitched spot's id re-keys; a landing model maps a lost id to its lane's nearest spot as before.
40
+ - `./scene`, **a free start is whole pixels in the frame, the release and the commit** (`LaneSlide.step`): the spot
41
+ carries the grain, and `@n-uf/motion`'s landing model rounds its frame by it, so the rect a frame draws is the rect
42
+ the drop commits (before, the frame used the raw start and only the commit rounded: up to half a pixel apart). Known
43
+ caveat: on an over-subscribed edge the solver gives fractional positions, so frame and commit can differ by about a
44
+ pixel there.
45
+ - `./scene`, **a snap point is keyed by what it commits** (fix): a dock that lands inside a stretch (a center dock, say)
46
+ keeps its own snap point even within half a pixel of the stretch's start, and commits as that dock. Two points merge
47
+ only where they lie on the same start, the taken-over dock then winning. A center dock's snap moves its center
48
+ neighbor by design.
49
+ - `./scene`, **a spot's `place` is the dock at the spot's listed landing** (fix): `place` is the dock at the spot's listed
50
+ landing (on the item's own sliding spot its own zone, index and `space`, where it said the stretch's first zone); a
51
+ sliding spot commits through `after(point, grab)`, and the release's `home` and `at` say where, never the place kind
52
+ (which says "home" only for a spot whose drop changes nothing: a pitched or plain home spot).
53
+ - `./scene/cases`, **`createLandingHost`** takes `stretchPositions` (default: the library's), passes the press's `grab`
54
+ to the landing model, and commits a release by the model's `home`; `LandingRule`'s options carry `grab` (additive).
55
+ The landing rows hold under both values.
56
+
57
+ ## 26.11.49
58
+
59
+ The gutter between a column and the pages is open space. With `@n-uf/motion` 26.11.49. Host notes: none; a host
60
+ that grew `Regions.content` itself to open the gutter no longer needs to.
61
+
62
+ - `./scene`, **`Regions.content` is the float region** (fix): `lanes()` gave a landing model `content` as the pages
63
+ rect, so the gutter between a column and the pages was neither open nor blocked and counted as refused: with one
64
+ column per side a flick released there landed nowhere. `content` is now where a float can land (`floatRegion`, the
65
+ stage less its float insets), and `blocked` keeps every drawn edge, docked item, chrome and drawn rail out of it, so
66
+ the gutter is open and a release there floats, while anything docked stays refused.
67
+ - The README is a short page of the current state; the full reference is
68
+ [docs/placement-reference.md](https://github.com/n-uf/motion/blob/main/docs/placement-reference.md).
69
+
6
70
  ## 26.11.48
7
71
 
8
72
  A place guide at every spot that says only "you can drop here", and a fix to the grab's cut (R12). With