@n-uf/docking 26.11.54 → 26.11.56

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
@@ -5,6 +5,154 @@ Versions are calendar versions, `YY.M.R` (year, month of the release, counter wi
5
5
  package, the docking model shipped as `@n-uf/placement/scene` and `/scene/cases`; their history is in
6
6
  [placement's CHANGELOG](https://github.com/n-uf/motion/blob/main/packages/placement/CHANGELOG.md).
7
7
 
8
+ Unreleased entries live in `changes/` until a release joins them.
9
+
10
+ ## 26.11.56
11
+
12
+ - Behavior change: **"does not fit" is decided by the hand.** The float target's drop (`DockDrop.after`, so
13
+ `dockDrag(...).after({ kind: "float", point })`) keeps a float clear of the docked items only while the pointer is
14
+ still on the item at that clear place (on the hand rect as kept inside the stage). Otherwise the float lies at the
15
+ hand, over the docked items it covers, still clear of the bars and the chrome, and the least-covered fallback is not
16
+ used for it. A narrow float pushed at a column keeps the wall until the pointer enters the column, as before; a float
17
+ wider than the open room follows the hand and lands where it is shown, instead of jumping to one of a few seams.
18
+ - Added: **`DockFloat.stays`**, the mark of a float the hand left over content. `solve` keeps a marked float inside the
19
+ stage and clear of the bars and the chrome only, never beside what it covers (a `float-covers` note says what), so
20
+ 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
21
+ window shrinks). The float target's drop decides the mark again each time; `floatAt` with a rect clears it;
22
+ `resizeFloat`, `orientFloat`, `raiseFloat` and `markUsed` keep it. `FloatPlace.stays` sets it with a rect
23
+ (`moveTo`), and the place `homeFor` gives carries it. `fitResize` on a marked float stops a growing edge at the bars
24
+ and the chrome only. Stored as `stays: true` (`StoredDockStateFloat.stays`); a `stays` that isn't `true`, or one on an
25
+ anchored float, is dropped and listed (`float:<id>:stays`).
26
+ - The conformance row `P5-neighbour-half-facing-it` now expects the float at the hand, over the neighbor's body
27
+ (`140,190`), not beside it.
28
+ - 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
29
+ 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
30
+ place elsewhere.
31
+ - Behavior change: **the float floated first wins the place both want; what the hand does moves nothing else.** An
32
+ anchored float keeps clear of the anchored floats floated before it, as before, and of the floats with a rect of their
33
+ own floated strictly before it (a smaller `since`), no longer of every float with a rect of its own. A float floated
34
+ after an anchored float (or as early, with no `since`), grown over it by a corner resize or dropped on it, covers it
35
+ (or lies under it, by the stacking order), and the anchored float keeps its place. A group sent to Float from a menu
36
+ still lands beside the floats already there.
37
+ - Behavior change: **what the hand covers, it wins; what it doesn't cover never moves.** `floatAt` with a rect (a drop)
38
+ and `resizeFloat` give the float one more than the largest `since` there only when its new rect lies over an anchored
39
+ float as drawn, so a float dropped or grown over an anchored float wins over it whichever was floated first; a drop or
40
+ resize that stays clear of every anchored float keeps its `since`, so a nudge beside an anchored float moves nothing.
41
+ Re-anchoring with no rect, `raiseFloat` and `markUsed` keep it too.
42
+ - Fixed: **over a drawn rail, a new column's line and `targets()` and the lanes now decide the same** (the one-layout
43
+ 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
44
+ `column:<side>:<ring>` over the rest of a rail (past its last tile, or below a held tile's own run) where the lanes
45
+ 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
46
+ pointer on the held tile's own rail stays home or floats, as `targets()` says, instead of picking the new column whose
47
+ box lands where that rail was. With a tile of a rail held, the strip beside the rail is
48
+ home's in `targets()` (the new-column lines about its folded column are the same move as home), and the lanes now
49
+ 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).
50
+ - **Added: `DockItem.stepping`**, a fixed item that still takes steps (a page readout at a title bar's end with a
51
+ `controlLadder` of its own). It is never dragged, no hit covers it and nothing lands between it and its zone's anchor
52
+ (read from the order of ids while it is in the »), but it steps through its forms, folds and goes into its edge's »
53
+ like a movable item with the same forms. A declaration like `pushable`: taken from `base`, never stored. Plain `fixed`
54
+ is unchanged.
55
+ - Fixed: **a growing title no longer takes its zone's drop room.** Its growth is spare room, not owned room: for target
56
+ room a growing fixed item counts at its natural length, not its grown length, so a drop beside it lands exactly where it
57
+ would beside a fixed item of that length that doesn't grow (its neighbors giving way as on any bar), where it was
58
+ refused before. The title yields its growth to the landing and never shrinks under its natural length for a drop. A
59
+ title bar asks nothing else of a drop: the rules that the dropped item keep its first form's kind and that nothing
60
+ else in the bar change form are gone.
61
+ - The model reads a form's » through `StackForm.menu` (or the fit's menu list), never its kind.
62
+ - Breaking: **`DockDrop` now carries the spring-loading and room fields itself.** `arm: "dwell"`, `armedHit`,
63
+ `opensRoom`, `roomHold` (ms) and `roomHit` used to come with placement's root `Target`, which now holds only `id`,
64
+ `priority`, `hit`, `hits`, `slot`, `label`, `free`, `refuse` and `bounds`; they are declared on `DockDrop`, with the same
65
+ names, types and values on every target (`DockRefusalTarget` has none of them, as before). Only a drag intent
66
+ (`@n-uf/motion/drag`'s `createDragIntent`) reads them; the landing model and `dockDrag` never do. `EDGE_ROOM_HOLD` and
67
+ `RailDropPolicy.magnet` are unchanged. No behavior changes.
68
+
69
+ ### The drag is the landing model's whole wiring
70
+
71
+ - **Added: `DockDrag.home`**, the item's own place at the lift, `{ lane, spot }` (the first spot `lanes()` marks `home`;
72
+ absent for a float). So `createLandingModel({ ...dockDrag(...), preview })` is the whole wiring. Old: the host scanned
73
+ `drag.regions.lanes[].spots[].home` for it and passed `home` by hand; a host that still passes its own `home` after the
74
+ spread keeps working (its value wins), and a host that passed none now gets the drag's.
75
+ - `./testing`, **changed (breaking, type only): `LandingRule`'s options carry `preview` in place of `placeGuides`**
76
+ (`{ mode, placeGuides? }`, motion's `DragPreview` shape), and `createLandingHost` hands the rule the drag as it is
77
+ (`{ ...drag, preview }`, its `home` included). `createLandingModel` from `@n-uf/motion/drag` is a rule as before.
78
+ - `./testing`: the reference host keeps a private copy of the refusal rank (2.5), as it can't import it any more from
79
+ `@n-uf/placement`, which dropped it (see its changelog). The reference pick is unchanged and a test holds it equal to
80
+ motion's `targetAt`.
81
+
82
+ ## 26.11.55
83
+
84
+ - Added: **`DockItem.lengths`** (`{ column?, row? }`, px along the edge, per axis), the length a person asked an item to
85
+ have, read by the edge's stack in place of a growing form's natural, and the verbs on it: **`dividers(state, layout?)`**
86
+ (`DockDivider`), **`resizeBetween`**, **`resetBetween`** and **`resetLengths(state, edgeId)`**. `storeDockState` keeps
87
+ the length and `readDockState` reads it back (a bad entry is dropped as `item:<id>:lengths:<axis>`; a store without it
88
+ reads with none). Additive: a state that declares no length lays out exactly as before. A layout passed to a verb is used
89
+ only when it was solved from that very state object; otherwise the verb solves the state again.
90
+ - Fixed: **`resizeBetween` and `resetBetween` write `DockItem.lengths` for the pair only, in ask units** (not drawn px; with
91
+ room to spare a drawn size is the ask times the shared scale, or its least when that is more), as placement's do. A
92
+ bystander of a drag gets no length, so an item moved to another edge after a drag next to it is laid out as an item
93
+ nobody resized, not at a length inflated by the column's scale.
94
+ - Behavior change (from `@n-uf/placement`): **a length under its least now reads as a weight with room**: the item is drawn
95
+ at its least and the others share the rest by their asks. Short of room an ask under the least still reads as the least.
96
+ A length of 0 is no length: the item asks its natural, `storeDockState` does not write one (and drops the `lengths`
97
+ object when nothing is left), and `readDockState` drops a stored one like any bad entry (`item:<id>:lengths:<axis>`).
98
+ - Fixed: **a tile keeps its place among its own rail's tiles.** With `rails` declared, a column folded whole into its
99
+ side's rail drew its members as the rail's tiles, but the rail's stops lay only between folded columns, so a tile held
100
+ from it had no place among its own column's tiles (without `rails`, the same column drawn as a rail offered its gaps,
101
+ and `foldedColumnDrop`'s documented contract said it would). A held tile now also has that column's gaps
102
+ (`gap:<edge>:<zone>:<at>`, before each other tile and after the last, wherever it would stay a tile in the rail), over
103
+ its own column's run of tiles only: over the tiles of the rail's other columns, and past the last tile, the place is
104
+ the rail's, home for it, as before. A tile of another column, or the only tile of its column, gets the places it had.
105
+ A host tells a home by `place.kind === "home"`, never by its id (`rail:<side>:<ring>` stays a home's id). The lanes
106
+ agree: a column folded into a declared rail is a lane drawn where its run of tiles lies (the hull of its rail
107
+ segments), so its hit rect, its spots' stretches and its marks stop at the run, where they took the whole rail (a spot
108
+ over another column's tiles that reordered the held tile, a stretch past the rail's last tile); a column created folded
109
+ draws no mark beyond its own tile. `lanes()` and `targets()` decide the same at every point of a rail, except the pending new-column-line cases
110
+ (a new-column line over a rail where the lanes stay, in a narrow window and in one with a tray of toolbars, and with a
111
+ second column holding the held tile the lanes' new-column lane over the rail's first pixels where `targets()` floats),
112
+ which the sweep lists by name.
113
+ - Fixed: **a float pressed inside an empty lane's band no longer takes that lane when the drag starts** (the landing
114
+ model gives a float's lift, one with no `home` and no spot marked home, the lift zone a docked item has; `@n-uf/motion`'s change of the
115
+ same name). `dockDrag` has nothing new to pass: a float's drag has no home spot, and a host passes `home` only for a
116
+ docked item.
117
+
118
+ ### One layout for the held frame and the commit (breaking; with `@n-uf/motion`'s held place)
119
+
120
+ - **New: `dockDrag(state, dragged, options)`** (`DockDrag`): `regions` (hit-testing, as seen), `after(held)`
121
+ (`DockAfter`: the `state` a release commits, its `layout` solved with the drag's one `previous`, the `landing`, every
122
+ lane's `marks` in that one layout as `DockLaneMark`s, and for a spot its lane's `spots`), `landingOf(held)`,
123
+ `spotsOf(spot)` and `guides(frame)` (`DockGuideFrame`, whose `guides` are `DockGuideRef`s `{ lane, held }`, →
124
+ `DockGuide[]`, rule B: a lane on screen less the would-land
125
+ landing; a lane the screen doesn't draw in the layout that creates it, giving way to whatever the screen draws: another
126
+ lane's marks, a drawn bar or rail, the landing; the Near lane's marks win). `DockHeld` (a held place) is
127
+ `{ kind: "spot", spot, point }` or `{ kind: "float", point }`. It fits `@n-uf/motion/drag`'s
128
+ `LandingGeometry` as it is; `./testing` adds `AssertGeometry`.
129
+ - **Removed (breaking): the held-frame path of `lanes()`.** `DockLaneOptions.spot` and `lanes(…, { spot })`,
130
+ `DockLane.entry` and `corners` (the prediction of an empty lane's marks): a held frame is `after(held)`, and a
131
+ frame's guides `guides(frame)`. `lanes()` gives the regions and each lane's marks as seen.
132
+ - **Changed.** A held lane's marks follow its edge as drawn in that held place's layout, corners included (decision 0002:
133
+ with both side rails holding a toolbar, a toolbar held in the empty top bar draws the bar full width, as the
134
+ commit does). A neighbor's giving way (a striped end) is judged in the layout drawn, not the lifted one. Held on a
135
+ sliding spot, the item is drawn where it lands and the room beside it is a box from 8 px; the bar keeps the corner
136
+ between two empty lanes in a held frame. `./testing`'s `LandingRule` takes `{ regions, landingOf, spotsOf, home?,
137
+ placeGuides? }`, and its host draws guides with `guides(frame)` and commits `after(release).state`.
138
+ - Added: **`DockDrag.shown(frame)`**, the layout a landing frame draws (`after(frame.held).layout` while the frame's room
139
+ is open, else the window at rest), and **`DockGuideFrame.room`** (required; the landing model's `LandingFrame.room`, so a
140
+ landing frame still fits; a host that builds its own frame passes it, and passes false where it draws no room for a spot).
141
+ - Fixed: **a float frame's guides are cut in the window as drawn.** `guides(frame)` took the screen from
142
+ `after(frame.held)`, so on a float frame (whose room is not open: the gap closes on release) the marks were cut in
143
+ the float's commit layout, the column closed up, while the host drew the window at rest. `guides(frame)` now cuts in
144
+ `shown(frame)`. A frame whose room is open (every spot frame the landing model gives) gives the guides it gave before.
145
+
146
+ ### Docs only
147
+
148
+ - **The design page and the reference catch up with the code.** No behavior, type or export change. The draw rule is
149
+ stated once: a held frame draws `after(held).layout` while its room is open, and a float frame whose room is not
150
+ open, and the Outline mode, draw the window at rest (the gap closes on release). `dockDrag` is in the page's
151
+ paragraph, diagram, contents and SDK table, the landing model is named as the docking drag with `targets()` as the
152
+ list of places for menus, keys and the conformance pick, and a panel drag's marks are written up here. The
153
+ reference covers behavior, with the exported types as the contract, and adds entries for `Place` and its four kinds,
154
+ `SolveOptions`, `DockLaneOptions`, `EmptyLanes` and the stored types.
155
+
8
156
  ## 26.11.54
9
157
 
10
158
  The first release. The window's docking model moves here from `@n-uf/placement/scene`, and its conformance rows from
package/README.md CHANGED
@@ -17,7 +17,7 @@ npm i @n-uf/docking @n-uf/placement
17
17
 
18
18
  | Entry | What it gives |
19
19
  |---|---|
20
- | `@n-uf/docking` | One model of a whole window: `solve` for every rect, `targets` and `refusals` for every drag, `lanes` for a landing model, pure changes (`moveTo`, `foldItem`, `floatAt`, `resizeEdge`, ...) and a stored form (`storeDockState`, `readDockState`). |
20
+ | `@n-uf/docking` | One model of a whole window: `solve` for every rect, `targets` and `refusals` for every drag, `dockDrag` for a landing model (its `after(held)`: the one layout a held frame draws while its room is open, and its release commits; `lanes` for hit-testing), pure changes (`moveTo`, `foldItem`, `floatAt`, `resizeEdge`, ...) and a stored form (`storeDockState`, `readDockState`). |
21
21
  | `@n-uf/docking/testing` | Conformance rows (`CASES`, `LANDING_CASES`), runners (`runCase`, `runLandingCases`) and reference hosts (`createReferenceHost`, `createLandingHost`) that a host's test suite plays against the model, and `AssertLanding`, a type check that the lanes fit `@n-uf/motion/drag`'s landing model. |
22
22
 
23
23
  Items declare their forms in `@n-uf/placement/stack`'s vocabulary (`StackForm`).
@@ -85,7 +85,7 @@ the hand rule included: while a lane holds, the landing is the nearest in its la
85
85
 
86
86
  ## Documentation
87
87
 
88
- - [Design page](https://github.com/n-uf/motion/blob/main/docs/docking.md): the concept, the parts, the rules a consumer relies on, and the SDK entry by entry.
88
+ - [Design page](https://motion.n-uf.com/docs/docking/): the concept, the parts, the rules a consumer relies on, and the SDK entry by entry.
89
89
  - [Reference](https://github.com/n-uf/motion/blob/main/docs/docking-reference.md): every rule, id, option and longer examples.
90
90
  - [CHANGELOG](https://github.com/n-uf/motion/blob/main/packages/docking/CHANGELOG.md): what changed, and how to move from `@n-uf/placement/scene`.
91
91
  - Site and live demos: [motion.n-uf.com](https://motion.n-uf.com)