@n-uf/docking 26.11.54 → 26.11.55

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,82 @@ 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.55
11
+
12
+ - Added: **`DockItem.lengths`** (`{ column?, row? }`, px along the edge, per axis), the length a person asked an item to
13
+ have, read by the edge's stack in place of a growing form's natural, and the verbs on it: **`dividers(state, layout?)`**
14
+ (`DockDivider`), **`resizeBetween`**, **`resetBetween`** and **`resetLengths(state, edgeId)`**. `storeDockState` keeps
15
+ the length and `readDockState` reads it back (a bad entry is dropped as `item:<id>:lengths:<axis>`; a store without it
16
+ reads with none). Additive: a state that declares no length lays out exactly as before. A layout passed to a verb is used
17
+ only when it was solved from that very state object; otherwise the verb solves the state again.
18
+ - Fixed: **`resizeBetween` and `resetBetween` write `DockItem.lengths` for the pair only, in ask units** (not drawn px; with
19
+ 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
20
+ 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
21
+ nobody resized, not at a length inflated by the column's scale.
22
+ - Behavior change (from `@n-uf/placement`): **a length under its least now reads as a weight with room**: the item is drawn
23
+ 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.
24
+ A length of 0 is no length: the item asks its natural, `storeDockState` does not write one (and drops the `lengths`
25
+ object when nothing is left), and `readDockState` drops a stored one like any bad entry (`item:<id>:lengths:<axis>`).
26
+ - Fixed: **a tile keeps its place among its own rail's tiles.** With `rails` declared, a column folded whole into its
27
+ 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
28
+ from it had no place among its own column's tiles (without `rails`, the same column drawn as a rail offered its gaps,
29
+ and `foldedColumnDrop`'s documented contract said it would). A held tile now also has that column's gaps
30
+ (`gap:<edge>:<zone>:<at>`, before each other tile and after the last, wherever it would stay a tile in the rail), over
31
+ 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
32
+ 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.
33
+ A host tells a home by `place.kind === "home"`, never by its id (`rail:<side>:<ring>` stays a home's id). The lanes
34
+ agree: a column folded into a declared rail is a lane drawn where its run of tiles lies (the hull of its rail
35
+ segments), so its hit rect, its spots' stretches and its marks stop at the run, where they took the whole rail (a spot
36
+ over another column's tiles that reordered the held tile, a stretch past the rail's last tile); a column created folded
37
+ 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
38
+ (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
39
+ second column holding the held tile the lanes' new-column lane over the rail's first pixels where `targets()` floats),
40
+ which the sweep lists by name.
41
+ - Fixed: **a float pressed inside an empty lane's band no longer takes that lane when the drag starts** (the landing
42
+ 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
43
+ same name). `dockDrag` has nothing new to pass: a float's drag has no home spot, and a host passes `home` only for a
44
+ docked item.
45
+
46
+ ### One layout for the held frame and the commit (breaking; with `@n-uf/motion`'s held place)
47
+
48
+ - **New: `dockDrag(state, dragged, options)`** (`DockDrag`): `regions` (hit-testing, as seen), `after(held)`
49
+ (`DockAfter`: the `state` a release commits, its `layout` solved with the drag's one `previous`, the `landing`, every
50
+ lane's `marks` in that one layout as `DockLaneMark`s, and for a spot its lane's `spots`), `landingOf(held)`,
51
+ `spotsOf(spot)` and `guides(frame)` (`DockGuideFrame`, whose `guides` are `DockGuideRef`s `{ lane, held }`, →
52
+ `DockGuide[]`, rule B: a lane on screen less the would-land
53
+ landing; a lane the screen doesn't draw in the layout that creates it, giving way to whatever the screen draws: another
54
+ lane's marks, a drawn bar or rail, the landing; the Near lane's marks win). `DockHeld` (a held place) is
55
+ `{ kind: "spot", spot, point }` or `{ kind: "float", point }`. It fits `@n-uf/motion/drag`'s
56
+ `LandingGeometry` as it is; `./testing` adds `AssertGeometry`.
57
+ - **Removed (breaking): the held-frame path of `lanes()`.** `DockLaneOptions.spot` and `lanes(…, { spot })`,
58
+ `DockLane.entry` and `corners` (the prediction of an empty lane's marks): a held frame is `after(held)`, and a
59
+ frame's guides `guides(frame)`. `lanes()` gives the regions and each lane's marks as seen.
60
+ - **Changed.** A held lane's marks follow its edge as drawn in that held place's layout, corners included (decision 0002:
61
+ with both side rails holding a toolbar, a toolbar held in the empty top bar draws the bar full width, as the
62
+ commit does). A neighbor's giving way (a striped end) is judged in the layout drawn, not the lifted one. Held on a
63
+ 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
64
+ between two empty lanes in a held frame. `./testing`'s `LandingRule` takes `{ regions, landingOf, spotsOf, home?,
65
+ placeGuides? }`, and its host draws guides with `guides(frame)` and commits `after(release).state`.
66
+ - Added: **`DockDrag.shown(frame)`**, the layout a landing frame draws (`after(frame.held).layout` while the frame's room
67
+ is open, else the window at rest), and **`DockGuideFrame.room`** (required; the landing model's `LandingFrame.room`, so a
68
+ landing frame still fits; a host that builds its own frame passes it, and passes false where it draws no room for a spot).
69
+ - Fixed: **a float frame's guides are cut in the window as drawn.** `guides(frame)` took the screen from
70
+ `after(frame.held)`, so on a float frame (whose room is not open: the gap closes on release) the marks were cut in
71
+ the float's commit layout, the column closed up, while the host drew the window at rest. `guides(frame)` now cuts in
72
+ `shown(frame)`. A frame whose room is open (every spot frame the landing model gives) gives the guides it gave before.
73
+
74
+ ### Docs only
75
+
76
+ - **The design page and the reference catch up with the code.** No behavior, type or export change. The draw rule is
77
+ stated once: a held frame draws `after(held).layout` while its room is open, and a float frame whose room is not
78
+ open, and the Outline mode, draw the window at rest (the gap closes on release). `dockDrag` is in the page's
79
+ paragraph, diagram, contents and SDK table, the landing model is named as the docking drag with `targets()` as the
80
+ list of places for menus, keys and the conformance pick, and a panel drag's marks are written up here. The
81
+ reference covers behavior, with the exported types as the contract, and adds entries for `Place` and its four kinds,
82
+ `SolveOptions`, `DockLaneOptions`, `EmptyLanes` and the stored types.
83
+
8
84
  ## 26.11.54
9
85
 
10
86
  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)