@n-uf/docking 26.11.55 → 26.11.57

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,116 @@ 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.57
11
+
12
+ - **Keep-clear rects anchored to the layout's content** (new, additive). A `DockState.keepClear` entry may now be
13
+ `{ region: "content", side, size, for, id? }` (`AnchoredKeepClear`; `KeepClearRegion` is `"content"`, extensible):
14
+ `size` px deep at that side of `DockLayout.content`, along its whole length, clamped to it, none in an empty content.
15
+ `solve` resolves it once the edges and the content are final, before the floats, into the new
16
+ `DockLayout.keepClear` (`DockKeepClearLayout`: `rect`, `for`, `id`), so an overlay strip a host draws at the content's
17
+ edge moves with the content a drop opens or closes. Before, a host fed the strip as a fixed rect taken from the
18
+ committed layout, and a drop that opened or closed a column solved its `after` with the strip where it was: the
19
+ commit moved it and a float re-fitted off its marker. Nothing that sizes the content reads keep-clear rects. Each
20
+ reader names its layout: the hits a drag shows and a float resize by hand read the layout on screen; a drop's fit
21
+ and its floats read the drop's own `after`. A guide predicted in another layout (an empty lane, a Near lane not on
22
+ screen) is trimmed by the anchored rects on screen; a `for: "floats"` rect cuts no lane guide. A declaration like
23
+ `pushable`: taken from `base`, never stored. A state with fixed rects only lays out exactly as before, and its layout
24
+ has no `keepClear`.
25
+ - **`minRegion` on an anchored entry** (new, additive): `minRegion?: { width?, height? }`. While the region as solved
26
+ is narrower or shorter than a given bound the entry is inactive: it keeps nothing clear and is absent from
27
+ `DockLayout.keepClear` (absent, not flagged), so a host draws its overlay exactly when the entry is there. A drop
28
+ that opens a column and takes the content under the bound has no entry in its `after` layout.
29
+ - Breaking (type only): `DockState.keepClear` is now `readonly (KeepClear | AnchoredKeepClear)[]`; narrow an entry
30
+ with `"region" in c` (or the root's new `isAnchoredKeepClear(c)`) before reading it as a rect. No behavior changes
31
+ for a state with fixed rects only.
32
+ - Changed (breaking for a conformance host): **`@n-uf/docking/testing` row C1 expects no `[data-drag-marker]`.** A gap or
33
+ strip landing draws one mark, the slot (`[data-drag-slot][data-drag-target]`), so a page that also drew an insertion
34
+ line from `DockDrop.marker` now fails the row: draw the slot only. `DockDrop.marker` stays, as data.
35
+ - Fixed: **reach only adds, for a new column's line and a rail stop too.** A bar's `endReach` strip past its end (over an
36
+ inset's strip beside the content) used to take the corner of the virtual `column:<side>:<n>` line's own hit there, so
37
+ the line lost its corner points once `endReach` was set; a line whose drop is the same move as home or a rail stop lost
38
+ its pieces the same way. A reach strip now never takes what another target holds as its own: a drawn edge's owned
39
+ band, or the tiles an edge with no drawn ends (a column line, a rail stop) has as it tiles on its own. Every target's
40
+ pieces with `endReach` cover its pieces without it.
41
+ - **`Side` is placement's, and `Axis` joins it; both re-exported from the root.** `Side` (`"top" | "right" | "bottom" |
42
+ "left"`) is declared once, in `@n-uf/placement`, and `@n-uf/docking` re-exports it with the new `Axis` (`"x" | "y"`):
43
+ a host's `import { type Side } from "@n-uf/docking"` still works. `DockLane.axis` and `LaneMarks.axis` are typed
44
+ `Axis`, the same two strings. No runtime change.
45
+ - **Removed (breaking): `DockGuide`.** It was the deprecated alias of `DockLaneMark` (what `DockDrag.guides(frame)`
46
+ returns). A host that wrote `DockGuide` writes `DockLaneMark`: a one-line rename, the type is the same.
47
+
48
+ ## 26.11.56
49
+
50
+ - Behavior change: **"does not fit" is decided by the hand.** The float target's drop (`DockDrop.after`, so
51
+ `dockDrag(...).after({ kind: "float", point })`) keeps a float clear of the docked items only while the pointer is
52
+ still on the item at that clear place (on the hand rect as kept inside the stage). Otherwise the float lies at the
53
+ hand, over the docked items it covers, still clear of the bars and the chrome, and the least-covered fallback is not
54
+ used for it. A narrow float pushed at a column keeps the wall until the pointer enters the column, as before; a float
55
+ wider than the open room follows the hand and lands where it is shown, instead of jumping to one of a few seams.
56
+ - Added: **`DockFloat.stays`**, the mark of a float the hand left over content. `solve` keeps a marked float inside the
57
+ stage and clear of the bars and the chrome only, never beside what it covers (a `float-covers` note says what), so
58
+ it stays put at rest; a float with no mark keeps the rule it had (it moves clear when a column opens under it or the
59
+ window shrinks). The float target's drop decides the mark again each time; `floatAt` with a rect clears it;
60
+ `resizeFloat`, `orientFloat`, `raiseFloat` and `markUsed` keep it. `FloatPlace.stays` sets it with a rect
61
+ (`moveTo`), and the place `homeFor` gives carries it. `fitResize` on a marked float stops a growing edge at the bars
62
+ and the chrome only. Stored as `stays: true` (`StoredDockStateFloat.stays`); a `stays` that isn't `true`, or one on an
63
+ anchored float, is dropped and listed (`float:<id>:stays`).
64
+ - The conformance row `P5-neighbour-half-facing-it` now expects the float at the hand, over the neighbor's body
65
+ (`140,190`), not beside it.
66
+ - A float at the hand, and a marked float at rest, is pushed the least it takes clear of the bars and the chrome, along
67
+ the axis that needs it (as the stage's edge clamps it), and stays at the hand otherwise; it is never moved to a clear
68
+ place elsewhere.
69
+ - Behavior change: **the float floated first wins the place both want; what the hand does moves nothing else.** An
70
+ anchored float keeps clear of the anchored floats floated before it, as before, and of the floats with a rect of their
71
+ own floated strictly before it (a smaller `since`), no longer of every float with a rect of its own. A float floated
72
+ after an anchored float (or as early, with no `since`), grown over it by a corner resize or dropped on it, covers it
73
+ (or lies under it, by the stacking order), and the anchored float keeps its place. A group sent to Float from a menu
74
+ still lands beside the floats already there.
75
+ - Behavior change: **what the hand covers, it wins; what it doesn't cover never moves.** `floatAt` with a rect (a drop)
76
+ and `resizeFloat` give the float one more than the largest `since` there only when its new rect lies over an anchored
77
+ float as drawn, so a float dropped or grown over an anchored float wins over it whichever was floated first; a drop or
78
+ resize that stays clear of every anchored float keeps its `since`, so a nudge beside an anchored float moves nothing.
79
+ Re-anchoring with no rect, `raiseFloat` and `markUsed` keep it too.
80
+ - Fixed: **over a drawn rail, a new column's line and `targets()` and the lanes now decide the same** (the one-layout
81
+ property over a rail has no exceptions left). A drawn rail owns its whole rect, less the held tile's own run, so `targets()` no longer offers a
82
+ `column:<side>:<ring>` over the rest of a rail (past its last tile, or below a held tile's own run) where the lanes
83
+ stayed, and a new column's lane gives way to the rail as seen: its hit rect stops at the rail's inner side, so a
84
+ pointer on the held tile's own rail stays home or floats, as `targets()` says, instead of picking the new column whose
85
+ box lands where that rail was. With a tile of a rail held, the strip beside the rail is
86
+ home's in `targets()` (the new-column lines about its folded column are the same move as home), and the lanes now
87
+ block it too (`regions.blocked` holds the rail's home pieces), so a pointer there stays instead of floating. The new column's marks are unchanged (they are laid in the layout that makes it).
88
+ - **Added: `DockItem.stepping`**, a fixed item that still takes steps (a page readout at a title bar's end with a
89
+ `controlLadder` of its own). It is never dragged, no hit covers it and nothing lands between it and its zone's anchor
90
+ (read from the order of ids while it is in the »), but it steps through its forms, folds and goes into its edge's »
91
+ like a movable item with the same forms. A declaration like `pushable`: taken from `base`, never stored. Plain `fixed`
92
+ is unchanged.
93
+ - Fixed: **a growing title no longer takes its zone's drop room.** Its growth is spare room, not owned room: for target
94
+ room a growing fixed item counts at its natural length, not its grown length, so a drop beside it lands exactly where it
95
+ would beside a fixed item of that length that doesn't grow (its neighbors giving way as on any bar), where it was
96
+ refused before. The title yields its growth to the landing and never shrinks under its natural length for a drop. A
97
+ title bar asks nothing else of a drop: the rules that the dropped item keep its first form's kind and that nothing
98
+ else in the bar change form are gone.
99
+ - The model reads a form's » through `StackForm.menu` (or the fit's menu list), never its kind.
100
+ - Breaking: **`DockDrop` now carries the spring-loading and room fields itself.** `arm: "dwell"`, `armedHit`,
101
+ `opensRoom`, `roomHold` (ms) and `roomHit` used to come with placement's root `Target`, which now holds only `id`,
102
+ `priority`, `hit`, `hits`, `slot`, `label`, `free`, `refuse` and `bounds`; they are declared on `DockDrop`, with the same
103
+ names, types and values on every target (`DockRefusalTarget` has none of them, as before). Only a drag intent
104
+ (`@n-uf/motion/drag`'s `createDragIntent`) reads them; the landing model and `dockDrag` never do. `EDGE_ROOM_HOLD` and
105
+ `RailDropPolicy.magnet` are unchanged. No behavior changes.
106
+
107
+ ### The drag is the landing model's whole wiring
108
+
109
+ - **Added: `DockDrag.home`**, the item's own place at the lift, `{ lane, spot }` (the first spot `lanes()` marks `home`;
110
+ absent for a float). So `createLandingModel({ ...dockDrag(...), preview })` is the whole wiring. Old: the host scanned
111
+ `drag.regions.lanes[].spots[].home` for it and passed `home` by hand; a host that still passes its own `home` after the
112
+ spread keeps working (its value wins), and a host that passed none now gets the drag's.
113
+ - `./testing`, **changed (breaking, type only): `LandingRule`'s options carry `preview` in place of `placeGuides`**
114
+ (`{ mode, placeGuides? }`, motion's `DragPreview` shape), and `createLandingHost` hands the rule the drag as it is
115
+ (`{ ...drag, preview }`, its `home` included). `createLandingModel` from `@n-uf/motion/drag` is a rule as before.
116
+ - `./testing`: the reference host keeps a private copy of the refusal rank (2.5), as it can't import it any more from
117
+ `@n-uf/placement`, which dropped it (see its changelog). The reference pick is unchanged and a test holds it equal to
118
+ motion's `targetAt`.
119
+
10
120
  ## 26.11.55
11
121
 
12
122
  - Added: **`DockItem.lengths`** (`{ column?, row? }`, px along the edge, per axis), the length a person asked an item to