@n-uf/docking 26.11.58 → 26.11.60

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
@@ -7,6 +7,80 @@ package, the docking model shipped as `@n-uf/placement/scene` and `/scene/cases`
7
7
 
8
8
  Unreleased entries live in `changes/` until a release joins them.
9
9
 
10
+ ## 26.11.60
11
+
12
+ - **The grab is a function of the laid form** ([decision 0013](https://github.com/n-uf/motion/blob/main/docs/decisions/0013-grab-as-a-function-of-the-form.md)).
13
+ `DockLaneOptions.grab` and `DockDropOptions.grab` (and the `grab` a target's `after(point, grab)` takes) are now a
14
+ `DockGrab`: a point, as before, or `(form, size) => Point | undefined`, where `form` is the laid item's layout entry
15
+ with the place it lies in (`DockGrabForm`, `DockGrabPlace`: a float, a spot on an edge, or a side's rail with its side
16
+ and orient) and the point is in the laid rect's own coordinates. A host whose grip lies elsewhere in each form (a
17
+ row's at its left end, an icons column's at its top) keeps the pressed spot of the grip under the pointer when the
18
+ form changes. A plain point becomes the library's own twin function at the lift, so every reader (the float, a
19
+ sliding spot, the aim cuts) reads one function, and a plain point lands exactly as before. A function gives the press
20
+ point at the item's own form and size, may give `undefined` for a form it can't place yet (the twin answers), and is
21
+ pure for the drag: one closure per drag, remembered by identity.
22
+ - New: `DockAfter.grab`, on every held place, never absent: where the pointer holds the item in the form that place
23
+ shows (a float's and a sliding spot's the grab they landed with, a fixed spot's the grab in its landing's form, rest's
24
+ the press point, which a host seeds `holdItem` with). The held copy is drawn at the pointer less it.
25
+ `DropResult.grab` (optional) says the grab a float's or a sliding spot's drop landed with.
26
+ - A float and a sliding spot whose landing lies in another form than the grab was read in are aimed once more with the
27
+ grab in that form, never again; on a sliding spot only the grab's part along the lane moves the landing. A fixed spot
28
+ doesn't move for the grab; the cut between two overlapping landings lies halfway between the points the pointer would
29
+ hold in each, the grab read in each landing's own form.
30
+ - Types: `options.grab` is now a union; code that reads it back as a point narrows it first. Passing a point needs no
31
+ change.
32
+
33
+ ## 26.11.59
34
+
35
+ - **One aim order for `targets()` and `lanes()`.** Both now cut where one place along an edge meets the next by one
36
+ rule (`aimCut`): a panel column takes a panel by halves of what is drawn, as before; a bar or a toolbar rail takes the
37
+ nearest landing, halfway across the gap between the two landings either side of a neighbor, at the grab where they
38
+ overlap. `lanes()` cut this way already; `targets()` cut a toolbar's neighbor at its middle, so a host reading the
39
+ tiles and one reading the lanes could put a toolbar on opposite sides of the same neighbor for the same pointer. The
40
+ tiles now follow the lanes, across zones and past fixed items too (one place in the edge's order is one stretch, as a
41
+ sliding spot is): dragged over a neighbor of its own length, a toolbar takes that neighbor's place, and
42
+ home holds its own place only up to the cut beside it. A slot that lands within half a pitch of the item's own place
43
+ (pushing a neighbor) is home's, as in the lanes. A toolbar tray at a column's foot cuts by halves, like its column, as
44
+ before.
45
+ - **Two docks at one landing: the zone beside the stretch.** Where a sliding spot's start (or another of its snap points)
46
+ is also a center dock's landing, the dock in the zone of the neighbor before the stretch wins, so a drop flush after
47
+ the last start-zone toolbar stays in the start zone.
48
+ - New: `DockDropOptions.grab` (where the pointer holds the item, as `DockLaneOptions.grab`): the tiles cut overlapping
49
+ landings there, as the lanes do; without it, the item's middle. `DockDropOptions.pitch` (as `DockLaneOptions.pitch`,
50
+ which `lanes()` passes on): half of it is how far past an overlap the cut may move, in both paths.
51
+ - **Stops are the places; the pointer takes the nearest.** A place whose landing is never the nearest to any pointer
52
+ (behind a fixed run, say) has no hit in `targets()` and a spot with no stretch in `lanes()` (its guide still drawn);
53
+ `stops()` still lists it, at its landing, so "Move to ›" and the arrow keys keep every place they had.
54
+ - **A sliding spot's target holds its stretch.** Its `hit` now runs over the spot's stretch of the lane, not over its
55
+ whole range of landings, which ran into the neighbors' stretches.
56
+ - **Three layouts, one job each.** On a bar or a toolbar rail which places exist and fit is read in the room, growth
57
+ off (the gap beside a grown row stays a place); where the aim cut between two places lies is halfway between their
58
+ landings, each in the layout its own drop commits (a grower as that commit draws it), in the tiles and the lanes
59
+ alike, never from insertion lines; what is drawn is `shown(frame)`. A place over free room cuts from its range's
60
+ ends, the room its drop makes, so beside a growing neighbor (a title, a stretchable panel) whose slack a dock takes,
61
+ the slack is reachable: the place after it starts halfway from the landing before the neighbor. The tiles order
62
+ places by their landings, not by their zone pieces, so where a grower moves a landing past another place's (a center
63
+ dock beside stretchable panels), both paths agree. A place is unreachable only where its landing is another's.
64
+ - **A place whose cuts cross moves no other cut.** Where a place's cut after it would lie before its cut before it (a
65
+ sliding spot where the item lands in a shorter form, between two docks that overlap), it is nearer no pointer: both
66
+ paths leave it out of the cutting, its neighbors cut between themselves, and it keeps a spot with no stretch (a stop).
67
+ Before, the lanes kept their cuts in order by pushing the next cut on, so the place after the crossed one started late.
68
+ - Changed (behavior): **a sliding or pitched dock counts the dropped item as just used**, as every target's drop
69
+ already did ("a dropped item counts as just used"): one model on both paths. So on a full bar, after a slide, the
70
+ neighbor that gives way is the one the solver gives up first for the freshly used item: the least used goes to the »
71
+ where a neighbor used to step down to a shorter form to make a single start (a toolbar dropped beside two others on a
72
+ bar with room for only two keeps the bar, and the least used of the two moves to the »). A slide's commit and the
73
+ tile's for the same place now agree on which neighbor that is.
74
+ - **The grab's share reads the held item.** `targets()` reads `DockDropOptions.grab` as a share of the item's length as
75
+ held (a movable grower at its natural length), as `lanes()` does.
76
+ - **Stops list every place that fits on a bar.** A slot of a bar or a toolbar rail whose stretch clipping left under a
77
+ pixel is a stop too, as one the aim cuts leave none.
78
+ - Changed (breaking for conformance): the row `R4-bar-gaps-split-at-the-middle` is renamed
79
+ `R4-bar-items-take-the-nearest-landing` (a toolbar over a neighbor of its length stays before it on either side of
80
+ its middle); `R7-end-zone-pushes-fixed-behind-a-movable-leading` now expects the drop after Zoom, as the trailing row
81
+ does, since the nearest landing over Zoom is Zoom's place. A host that lists either row by id or by its old outcome
82
+ updates it.
83
+
10
84
  ## 26.11.58
11
85
 
12
86
  - Fixed: **no guide lies over a movable grower while another item is held beside it.** The marks read a grower as the