@n-uf/placement 26.11.25 → 26.11.27

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,169 @@
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.27
7
+
8
+ - `./scene`, **a float resized by hand** (additive):
9
+ - **`fitResize(scene, id, rect, moving)`** → `{ rect, limits } | null`: the one clamp a host calls per pointer move,
10
+ in one pass. `moving` (`ResizeEdges`: `{ left?, right?, top?, bottom? }`) names the dragged edges; the others stay
11
+ put. The size stays within `floatMin` (else the open form's minimums) and `floatMax`, the float in the floats'
12
+ region (the stage less the inset at its left and right, its full height), and a dragged edge stops at what floats
13
+ are kept clear of (a bar, a docked item, the chrome), so `solve` never moves the float off. `limits`
14
+ (`ResizeLimit[]`: `"min"`, `"max"`, `"region"`, `"docked"`) says what bound it. Null for a toolbar group (sized by
15
+ its forms) and a folded float. One exception to "the others stay put": a float that already covers something
16
+ (`solve` notes `float-covers`, as it has no clear place at its size) may move to a clear place once a resize opens
17
+ one. The preview is still the commit.
18
+ - **`resize(scene, floatId, rect, moving?)`** commits `fitResize`'s rect (default `moving`: right and bottom) as the
19
+ float's rect and the item's `floatSize`, so `storeScene` keeps it and the preview is the commit.
20
+ `resize(scene, edgeId, size)` is unchanged.
21
+ - **`SceneItem.floatMax`** (`Size`, optional, beside `floatMin`): `solve` lays a larger float at it, its top-left
22
+ corner kept, and `fitResize` stops there.
23
+
24
+ - `./scene`, **aim order: a pointer over an item's half means before or after it** (hits change; ids, `after` and the
25
+ API don't).
26
+ - On every occupied edge the dragged item is taken out first; neighbouring gaps meet at the midpoint of the item
27
+ between them (they met halfway between the gaps' lines). Over a remaining item's leading half the drop goes right
28
+ before it, over its trailing half right after it.
29
+ - Home covers the item's own rect and the facing halves of its two neighbours, a neighbour in another zone too. A
30
+ slot of the same order in another zone keeps only the free stretch beside them; one with no free stretch is no
31
+ longer a target, so `stops` lists it no more.
32
+ - Fixed: dragging the last toolbar of a rail with the pointer just inside the top of the toolbar above it showed home
33
+ (the slot at its own place) instead of the place between the two toolbars above. Home's line at the far end of the
34
+ item's own place was laid into the stretch above it, which spread that stretch's lines evenly.
35
+ - The items' halves win over a bar's or rail's thirds where they disagree; the thirds still decide between and
36
+ beyond the items, and on empty zones and empty edges.
37
+
38
+ - `./scene`, **`readScene`: an anchor listed inside another edge's entry** (a store that kept page thumbnails in a side
39
+ edge): that entry now says where and how big the anchor's own static edge (one that takes nothing, `accepts: []`) is. The edge moves to the entry's side
40
+ (`setSide`) and takes its `size`; the anchor stays in it, and the other edge keeps its items and its own size. The
41
+ anchor used to be dropped there.
42
+
43
+ - `./scene`, **an anchor folded by hand** (additive, opt-in): on an edge with `Edge.foldable: true`, `fold(scene, id,
44
+ on)` folds a fixed item to its rail form and reopens it, as it does a panel, and `readScene` keeps a stored fold. Left
45
+ out, a fixed item stays as it is: `fold` is a no-op for it and a stored fold is dropped, as before.
46
+
47
+ - `./scene`, **an anchor dragged to the other side** (additive): `Edge.moves: "side"` lets the user drag a static edge's
48
+ fixed item (page thumbnails) to the other side of the edge's axis. `targets` then gives that item one target,
49
+ `side:<other side>` (place `{ kind: "side", edge, side }`), over the place the edge takes there; its `after` is
50
+ `setSide` and `use`, solved, so the preview is the landing. Its own place is home, and it never gets a gap.
51
+ `targetId` and `parseTargetId` read and build `side:<side>`.
52
+
53
+ - `./scene`, **targets lie where the user sees things** (hits change; ids, `after` and the API don't).
54
+ - Every hit is laid in one layout: the committed one, the dragged item in place. Lines, zone extents, ownership and
55
+ bands come from it. They used to come from the layout with the item lifted, mixed with the one as it is now.
56
+ - Each target's `after` is still the solved drop, so preview = landing. Where the lift would reflow a neighbour, the
57
+ preview moves it under a fixed pointer; the hits stay put. Dragging the only panel of a column, the neighbouring
58
+ column's gaps lie over its cards where they are drawn.
59
+ - The gaps right beside the item's own place are home (the same move), never the float or another slot. The item's
60
+ own column, when the lift would delete it, is home as a whole.
61
+ - A bar's zone reaches over every card seen in it, so a card past its third is never refused by the next zone.
62
+ - A panel's body no longer splits its column's tiling: the card's band beside the item meets the nearest slot past
63
+ it. A body cuts only beyond half a band of each gap's line: a column's first gap under an empty bar's place band
64
+ keeps its half band into the panel's body just past that band, local to its line (it used to be moved to the
65
+ column's far end).
66
+ - Slots that are the same move keep the home one (beside a closed member). An empty dynamic column in the scene no
67
+ longer stops a drop back at home from counting as home.
68
+
69
+ - `./scene`, **reserved edge ids:** `column:<side>` and `rail:<side>` name a side's virtual edges (its column lines and
70
+ its rail, as `SceneRefusal.edge` gives them). A real edge with such an id used to change targets. Now `solve`,
71
+ `targets` (and so `refusals`, `stops`) and `readScene` throw a clear error for it. A stored column under such an id is
72
+ dropped on read.
73
+
74
+ - **Fixed:** the new-column target at the window's edge.
75
+ - The outermost column line (at a flush window's edge, or where the rail stop lies) used to have its band centred on
76
+ the line. Half of the band lay past the stage. The rail stop's band then cut the part inside the window off from
77
+ the line, and that part was refused as `no-room` although a column fits.
78
+ - Now the band is laid inward: the rail stop keeps its 10 px at the boundary, and the line's band (`DEFAULT_HIT_BAND`)
79
+ follows it. A point 28 px in from an empty or outermost side picks `column:<side>:0`, in flush and inset windows
80
+ alike.
81
+ - No column line's hit lies past the stage.
82
+ - A stretch of a column line that another edge's band cuts off from the line is still that line's slot, one more
83
+ piece of its `hits`, not a refusal.
84
+
85
+ - **Fixed:** `readScene` lost a stored column's tray. It made a column the user had created from its side's template
86
+ without the template's `zoneAccepts`, so after a reload the column took any kind in any zone. Every column the Scene
87
+ makes (a drop on a column line, `moveTo` a new column, `dockHome`, `readScene`) now comes from one helper and takes
88
+ every template field.
89
+
90
+ - `./scene`, **`ColumnTemplate.hitBand`** (additive): takes the same values as `Edge.hitBand`, a number or `"middle"`
91
+ (a drop on a card's upper half is the gap before it, on its lower half the gap after it). Columns made from the
92
+ template take it: by a drop on a column line, by `moveTo` a new column, by `dockHome`, and read back by `readScene`. A
93
+ dynamic column with no `hitBand` of its own reads its template's. The default is unchanged.
94
+
95
+ - **One pick rule, one id scheme** (what moved, what's deprecated; no id and no row changes).
96
+ - **The pick rule moved to `@n-uf/motion/drag`'s `targetAt`.** `./scene/cases` takes it as an input:
97
+ `createSceneHost({ pick })`, `resolvePlace(list, place, item, area, pick?)`, and an optional `pick` on
98
+ `CaseHost`/`AsyncCaseHost` (type `PickRule`). The reference host exposes the rule it aims with as `pick`. Pass
99
+ `targetAt`, so the reference host and a kit's drag intent agree on every boundary pixel.
100
+ - **Deprecated: `pickTarget`.** It is only the default when no `pick` is given, now with `targetAt`'s tolerances: a
101
+ rect holds its edges exactly (it used to accept 1e-6 px past them), and a zone's size is its pieces' width × height
102
+ (it used to count a negative side as 0). A test holds the two equal. Removed with the legacy entries.
103
+ - **Ids come from one module.** `./scene` exports `targetId(parts)`, `parseTargetId(id)`, `placeTargetId(place, item)`,
104
+ `virtualEdgeId(kind, side)` and `TargetIdParts`. These build and read every `gap:`, `strip:`, `column:`, `rail:`,
105
+ `home:`, `float:`, `none:` and `refuse:` id, so a host never splits strings, even when an edge id holds `:`. The
106
+ ids themselves are unchanged. The legacy entries (`./panels`, `./targets`, `./stack`) keep their own ids until
107
+ they are removed.
108
+
109
+ ## 26.11.26
110
+
111
+ - Notes for hosts: every `SceneItemLayout` now carries `hidden` (an empty array when nothing is hidden), so a host that
112
+ compares layouts as JSON sees every item change once. A column whose items are all closed keeps its give-way notes
113
+ (e.g. `column-folded`) in `layout.notes` while nothing of it is drawn; read notes for the edges you draw.
114
+
115
+ - `@n-uf/placement/stack` and `/scene`, **forms carry what they hide** (additive). A toolbar's compact variants are
116
+ more row forms between its full row and its next form, each at its own size (its "+N" cell counted) with
117
+ **`StackForm.hides`**, the control ids it leaves out against the item's first form (any form may set it). The ladder
118
+ is unchanged: variants are taken in order, give way by priority then age and come back in the exact reverse.
119
+ **`SceneItemLayout.hidden`** is the chosen form's `hides` on every item (empty when none, or in a » menu); `form`
120
+ already names the variant, so there is no separate field. `after()` previews the variant a drop lands in. A drop onto
121
+ a title bar lands in a form of its first form's kind (the full row or a variant), read from the forms rather than
122
+ from index 0. **Typing:** code that builds a `SceneItemLayout` itself needs `hidden`.
123
+
124
+ - `@n-uf/placement/stack`, **Changed: a growing fixed item (a title) holds its natural length first.** While the other
125
+ items of its stack can still step to a form of the kind they are in (a toolbar's compact variants) or shrink toward
126
+ their least, they do so before the title gives up any of its natural width; then the title shrinks, and after it come
127
+ the steps that change a form's kind (icons, fold, the » menu), by priority then age. Room coming back is the exact
128
+ reverse. In a title bar a narrowing window now steps toolbar variants (and shrinks toolbars) before the title, and a
129
+ toolbar dropped onto a crowded title bar lands in its compact variant. `StackFit.need` is the forms' least with every
130
+ growing fixed item at its minimum.
131
+
132
+ - `@n-uf/placement/scene`, **Fixed: a closed item is not a removed one.** A column whose items are all closed keeps its
133
+ fold history (`column-folded` / `kept-folded` notes, at their place in the order) while they are closed, and when its
134
+ items open again (`previous` being the layout with them closed) they come back with their ages and that history
135
+ applies again: closing whole columns and opening them at the same width gives the layout from before the close.
136
+ Items opened together keep their order among themselves. An item opened beside items that stayed open in its edge is
137
+ still a request to show it (the newest there, its column weighed anew). A shrink isn't kept: a reopened column
138
+ shrinks again by the usual order.
139
+
140
+ - `@n-uf/placement/scene` and `/stack`, **the Scene owns the whole window**. Nothing published is removed.
141
+ - **What moved:** `fitFloat` and `FloatFit` are exported by `./scene` (the Scene fits its floats with it). `./scene`
142
+ no longer reaches into `./stack`'s files: it uses `./stack` only as the edge solver, through its entry.
143
+ `solve` and `targets` are split by phase into smaller modules; their results are unchanged.
144
+ - **Deprecated in `./stack`**, each with its Scene replacement, until the next breaking release:
145
+ `stackTargets`, `StackTarget`, `StackPlace`, `StackTargetOptions` → `targets(scene, id)` (`SceneTarget`,
146
+ `ScenePlace`, `SceneTargetOptions`); `createStack`, `storeStack`, `readStack`, `StackState`, `StoredStack`,
147
+ `StackRead` → `storeScene` / `readScene`; `stackFloatTarget`, `FloatTarget`, `FloatDrop`, `StackFloatTargetInput`
148
+ → the `float:<id>` target of `targets()`; `storeFloats`, `readFloats`, `StoredFloats`, `FloatsRead`, `StackFloat`
149
+ → the stored scene's floats (`Scene.floats`); `fitFloat`, `FloatFit` → the same names from `./scene`.
150
+ - **Stays in `./stack`:** the edge solver, `fitStack` with `StackInput`, `StackItem`, `StackFit`, and the form
151
+ vocabulary (`StackForm`, `CrossLimits` and the form helpers).
152
+
153
+ - `@n-uf/placement/scene`, **Changed: space ownership, refined** (the 26.11.25 target model's rules):
154
+ - A refused place owns nothing against other edges: an edge owns its band only along the stretches its surviving
155
+ slots tile (home's place aside), and a refusal takes only what every surviving target's tile and every other
156
+ edge's drawn rect leave (within its own edge a refusal keeps its tile). So a panel
157
+ can always become its own column beside the others: in a window with no inset and a side bar, an empty rail that
158
+ would refuse the drop no longer hides the new-column target just inside the bar (`column:<side>:<ring>`); and an
159
+ empty top bar whose zone holds only the dragged item's place no longer covers a column's top band.
160
+ - A stretch is owned by what the user sees there; if the owner has no slot there, it refuses. Until a target shows,
161
+ the host draws the layout as it is now, so an edge that moves when the dragged item lifts (a side bar pushed inward
162
+ by a rail that empties) still owns where it is seen, unless another edge lies there once the item has lifted; what
163
+ its own tiles don't cover there is its refusal, with its zone's reason. No stretch under an edge as it is now is
164
+ left to the float.
165
+ - Clipping changes a slot's shape, never who owns it: whatever is left of a slot's tile is the slot's. A target left
166
+ in pieces has **`hits`** (every piece; additive, optional on `Target`), `hit` the largest piece for hosts that
167
+ read one rect. `pickTarget` (`./scene/cases`) tests every piece. Nothing of a slot's own room is refused any more.
168
+
6
169
  ## 26.11.25
7
170
 
8
171
  - `@n-uf/placement` (root), **one geometry** (additive): the rect math every entry shares is the root's: `EPS`,
package/README.md CHANGED
@@ -27,7 +27,8 @@ without importing each other: a target list from `@n-uf/placement/targets` is ex
27
27
  rule allows it. The geometry is `rect`, `overlap`, `clampInto`, `centre`, `EPS`, `PLANE`, `area`, `overlaps`,
28
28
  `contains`, `clamp` and `subtract` (a rect less another, as disjoint rects), with the hit sizes `COLUMN_REACH` (22 px,
29
29
  each way of a column line) and `RAIL_EDGE` (10 px). The `Target` type (a drop target's shape, as
30
- `@n-uf/motion/drag` takes it) is exported here too; `./targets` and `./panels` still export it and the hit sizes.
30
+ `@n-uf/motion/drag` takes it) is exported here too, with its optional `hits` (every piece of a zone that isn't one
31
+ rect; `hit` is the largest); `./targets` and `./panels` still export it and the hit sizes.
31
32
  - **`/dock`**: a desk of documents and tool panels. Side docks and a bottom dock (between the side docks or across
32
33
  the full width), rails, natural-height sections whose last one takes the rest, fold and unfold, the give-way
33
34
  rules (sections fold least recently used first, docks fold to their rails), floating palettes with corner stacks,
@@ -47,13 +48,14 @@ without importing each other: a target list from `@n-uf/placement/targets` is ex
47
48
  - **`/stack`**: the items along one edge, a column or a bar, each a panel or a control group with forms from largest to
48
49
  smallest (open, header, rail icon, » menu; row, stacked, icons, fold, » menu): one form and rect per item, giving
49
50
  way by age and `rank`, only to a form that is shorter, spare room to the panels that grow, a rail when nothing open
50
- sets the width, `gap` and `pad` in the length; a drop target for every gap, each with the exact solve a drop makes; a
51
- stored form; and floats (an item above the pages, in the stage's own px, kept inside the stage and clear of the docked
52
- items, with its drop target and stored form). Not tied to `/panels`.
53
- - **`/scene`**: one model of a whole window on `/stack`: edges cut ring by ring along the stage's sides (full and
54
- between bars, columns, overlay edges), each a stack with start, center and end zones, fixed items (a title, window
55
- controls), floats clear of every bar and chrome, one `solve` for every rect, one `targets` for every drop target
56
- of one item (each carrying the layout a release makes, so the preview is the result), pure changes and a stored form.
51
+ sets the width, `gap` and `pad` in the length. It is the edge solver `/scene` lays each edge with. Its window-level
52
+ parts (a drop target for every gap, a stored form, floats with their drop target and stored form) are
53
+ **deprecated**: `/scene` owns the window and replaces each of them (see Edge stacks). Not tied to `/panels`.
54
+ - **`/scene`**: one model of a whole window, each edge laid with `/stack`: edges cut ring by ring along the stage's
55
+ sides (full and between bars, columns, overlay edges), each a stack with start, center and end zones, fixed items (a
56
+ title, window controls), floats clear of every bar and chrome (`fitFloat`), one `solve` for every rect, one
57
+ `targets` for every drop target of one item (each carrying the layout a release makes, so the preview is the
58
+ result), pure changes and a stored form.
57
59
  - **`/scene/cases`**: the Scene's behaviour as data: conformance rows (a scene, what a user does, the layout and DOM
58
60
  expected after) and `runCase`, which plays one on a host, so a UI kit's suite and the lab run the same rows.
59
61
 
@@ -438,6 +440,11 @@ places them; it is not tied to `./panels` columns, and nothing in it is a word.
438
440
  can't go in alone: the items stuck that way go in together, in give-way order, as few as shorten the stack (two
439
441
  icons, 48 px, for one entry, 28 px); each item after that saves its whole size. If all of them together don't beat
440
442
  the entry, they stay.
443
+ - A growing fixed item (a title: `fixed`, with a form that `grows`) holds its natural length first. While the other
444
+ items can still step to a form of the kind they are in (a toolbar's compact variants, a row to a smaller row) or shrink
445
+ toward their least, they do so before the title gives up any of its natural length; then the title shrinks toward its
446
+ `main.min`, and after it come the steps that change a form's kind (icons, fold, the » menu), by rank, then age. Room
447
+ coming back is the exact reverse. `StackFit.need` is the forms' least with every growing fixed item at its minimum.
441
448
  - `StackForm.rank` (default 0) orders the steps: the lowest rank of the form an item would step into goes first, then
442
449
  unkept before kept, then the oldest, then the later in the stack. Give a pinned primary's last forms a higher rank
443
450
  and every other group gives way before it does.
@@ -472,6 +479,8 @@ places them; it is not tied to `./panels` columns, and nothing in it is a word.
472
479
  A word 1 px wider moves nothing else while the rows don't change.
473
480
  - `StackForm.grip` (px): a grip at the form's start along the stack, this long (an icons strip's horizontal grip on
474
481
  top); `./scene` reports its rect as the item's `grip`. A `wrap` form's grip is its lead cell instead.
482
+ - `StackForm.hides` (control ids): what the form leaves out against the item's first form, for a toolbar's compact
483
+ variants (see Compact variants under Scenes). The stack never reads it; `./scene` reports it as the item's `hidden`.
475
484
  - `fitStack(input, { previous })` keeps the forms of the fit the stack had before, while they still fit: a change of
476
485
  `used` ages alone (a press on a header) reshapes nothing. Ages decide only who gives way anew (the length shrank, an
477
486
  item was added, or a panel opened: its `from` went down, so it starts over). Growing never re-ranks. When the stack got
@@ -533,6 +542,12 @@ menu has the entry's rect; `menu.items` are exactly the items whose kind is `men
533
542
  into its forms), `to-menu` (`id`), `too-wide` (`id`), `no-forms` (`id`) and `overflow` (`over` px: no item can give
534
543
  more way and the stack is still too long; forms that don't end in a `menu` form can't give more).
535
544
 
545
+ > **Deprecated:** `stackTargets`, `createStack`, `storeStack`, `readStack` and the floats below (`fitFloat`,
546
+ > `stackFloatTarget`, `storeFloats`, `readFloats`) belong to the window, which `@n-uf/placement/scene` owns:
547
+ > `targets(scene, id)` replaces `stackTargets` and `stackFloatTarget` (its `float:<id>` target), `storeScene` /
548
+ > `readScene` replace the stack's and the floats' stored forms, and `fitFloat` is exported by `./scene`. They stay
549
+ > until the next breaking release. `fitStack` and the forms are the edge solver and stay.
550
+
536
551
  `stackTargets(input, dragged)` takes the stack (an item of it with the dragged id is lifted out first, so a reorder
537
552
  within a stack works) and gives a target for every gap, before each item and after the last, in the shape
538
553
  `@n-uf/motion/drag` takes: `id` `gap:<k>`, priority 2, `place` `{ kind: "gap", at: k }`, `hit` (the stack split at
@@ -801,7 +816,9 @@ is over the leading zone (`start`), in the middle third over the center zone, in
801
816
  toolbars run past its third spreads its gap lines inside the third, so its last gap keeps a slice of it. An empty bar's
802
817
  strip is three targets, `strip:<bar>:start`, `strip:<bar>:center` and `strip:<bar>:end` (it was one `strip:<bar>`), one
803
818
  per third. Every empty edge does the same along its own axis: a side edge or a compact rail by thirds of its height
804
- (`strip:<edge>:start|center|end`, top, middle, bottom).
819
+ (`strip:<edge>:start|center|end`, top, middle, bottom). On an occupied edge the items' halves win over the thirds where
820
+ they disagree: a pointer over an item's half aims before or after that item, in its zone (see Aim order under
821
+ Targets); the thirds decide only between and beyond the items, and on empty zones and empty edges.
805
822
 
806
823
  A **title bar**, a bar with a fixed item that grows (the window title), is a constrained host: a toolbar dropped there
807
824
  must land in its first form, nothing else in the bar may change form for it, and the title keeps its natural width (it may
@@ -816,7 +833,9 @@ takes no drop in that zone. The zones are then laid with the title at its natura
816
833
  separated from it by a stretch of title.
817
834
 
818
835
  **Fixed items** (a title, window controls, a page readout) never change form, are never reordered, never dragged, and
819
- no hit covers them. Their length shrinks toward `main.min` and grows with spare room when the form `grows`; window
836
+ no hit covers them. Their length shrinks toward `main.min` and grows with spare room when the form `grows` (a title
837
+ holds its natural length while the toolbars of its bar can still step to a compact variant or shrink, and shrinks before
838
+ any step that changes a form's kind); window
820
839
  controls have `min` equal to `natural`. A stage too short for them overflows instead of folding them. A `kept` item with
821
840
  no smaller form never folds either: it reports `overflow` or `too-wide`.
822
841
 
@@ -841,6 +860,30 @@ with `orient: "column"`, a group skips its `wrap` forms and shows its next form
841
860
  whatever its `from`. An item with only `wrap` forms left has no form there: it is left out with a `no-vertical-form` note,
842
861
  so give a word group an `icons` form. A drop's `after()` gives the wrapped rect as the slot.
843
862
 
863
+ **Compact variants.** A toolbar that can drop controls before it wraps declares them as more row forms between its full
864
+ row and its next form, largest first, each at its own measured size with its "+N" cell counted, and each naming the
865
+ control ids it leaves out (`StackForm.hides`, against the item's first form; any form may set it). Variants are forms
866
+ like any other: taken in declared order, giving way by priority then age, coming back in the exact reverse. The layout
867
+ reports the chosen form's ids as `hidden` on every item (empty when it hides none or sits in a » menu), and `form`
868
+ names the variant; a host draws the kept controls and a "+N" control that lists exactly `hidden`. A drop's `after()`
869
+ previews the variant the drop lands in. A drop onto a title bar lands in a form of its first form's kind (the full row
870
+ or a variant), read from the forms.
871
+
872
+ ```ts
873
+ const zoom: SceneItem = {
874
+ id: "zoom", kind: "group", used: 3,
875
+ forms: {
876
+ row: [
877
+ f("row", 150, 150, 28), // − 86% + FIT
878
+ { ...f("row", 118, 118, 28), hides: ["fit"] }, // − 86% + "+1"
879
+ { ...f("row", 70, 70, 28), hides: ["-", "+", "fit"] }, // 86% "+3"
880
+ f("fold", 30, 30, 28),
881
+ f("menu", 0, 0, 0),
882
+ ],
883
+ },
884
+ };
885
+ ```
886
+
844
887
  **Compact edges.** `Edge.compact: true` makes a thin rail of vertical toolbars along a window side: its items take only
845
888
  their `icons` form (and the » menu after it), stacked, each item's grip the divider. An item with no `icons` form is left
846
889
  out of it with a `no-icons-form` note.
@@ -884,6 +927,15 @@ none lays out as before.
884
927
  between such bars, and an anchor runs through the inset beside them. Without it nothing changes.
885
928
  - **`Edge.giveWay`**: a static left or right edge that gives way like a dynamic column. It shrinks toward its minimum,
886
929
  then folds whole into its side's rail, in give-way order with the columns (by its items' ages). It is never deleted.
930
+ - **`Edge.moves: "side"`**: a static edge whose fixed item (an anchor, such as page thumbnails) the user may drag to the
931
+ other side of the edge's axis. `targets` then gives that item one target, `side:<other side>`, over the place the edge
932
+ takes there, landing as `setSide` puts it; its own place is home. Left out, a fixed item has no targets. `readScene`
933
+ moves an anchor's edge to the side and size of the stored entry that lists it.
934
+ - **`Edge.foldable: true`**: the user may fold this edge's fixed items (an anchor) by hand, like a panel:
935
+ `fold(scene, id, true)` shows the item in its rail form, `fold(scene, id, false)` reopens it, and `storeScene` /
936
+ `readScene` keep it folded. Left out, `fold` leaves a fixed item as it is and a stored fold is dropped.
937
+ - **`ColumnTemplate.hitBand`**: the `Edge.hitBand` (a number of px, or `"middle"`) that the columns a template makes
938
+ inherit; see the gap targets below.
887
939
  - **`Scene.insetWhen`** (`"always"`, the default, or `"docked"`): with `"docked"` the inset applies only while something is
888
940
  docked beside the content, that is an open panel column or a rail showing panels (an item whose first column form is
889
941
  `open`, `header` or `rail`, not closed). Only panels count: an anchor alone doesn't, and neither does a toolbar group
@@ -915,7 +967,7 @@ none lays out as before.
915
967
  lie (by ring, then by order, no ties), and `homeFor` gives a start column's ring that way.
916
968
 
917
969
  **Floats** lie above the content in stage px, last on top. Each is moved inside the stage and clear of every docked
918
- item, every bar and every `chrome` rect (`fitFloat`), with `float-clamped`, `float-moved` or `float-covers` notes. With
970
+ item, every bar and every `chrome` rect (`fitFloat`, which `./scene` exports with `FloatFit`), with `float-clamped`, `float-moved` or `float-covers` notes. With
919
971
  `anchor` (such as `"content-top-right"`) it sits flush with that side or corner of the content and follows it until a
920
972
  drop gives it a real rect. `orient` picks the forms it uses; folded by hand (`from` over 0) it is its
921
973
  bar: that form's natural length along its orient, its other size kept.
@@ -932,7 +984,20 @@ bottom don't cut it). A float is clamped into it, and one larger than it is shru
932
984
  (`Size`) is the floor of that shrink: a float of the item is laid out at `max(floatMin, min(its size, the region))` each
933
985
  way. Without it a shrink stops at the form's own minimums (`cross.min` across, `main.min` along), and a float asked for
934
986
  smaller than those keeps its size. A float wider than the region even at the floor keeps the floor and lies at the
935
- region's left edge; a folded float keeps its height.
987
+ region's left edge; a folded float keeps its height. **`SceneItem.floatMax`** (`Size`, optional) is the ceiling: a
988
+ larger float is laid out at it, its top-left corner kept (never under `floatMin`).
989
+
990
+ **Resizing a float by hand.** Per pointer move a host calls **`fitResize(scene, id, rect, moving)`**: `rect` is the
991
+ rect asked for (the float as drawn, the dragged edges where the pointer put them) and `moving`
992
+ (`{ left?, right?, top?, bottom? }`) names those edges; the others stay put, so a left-edge drag keeps the right edge.
993
+ In one pass, with no iteration, it keeps the size within `floatMin` (else the open form's minimums) and `floatMax`, the
994
+ float in the float region, and stops a dragged edge at what floats are kept clear of (a bar, a docked item, the
995
+ chrome), so `solve` lays the result exactly there. It gives `{ rect, limits }`, `limits` naming what bound it:
996
+ `"min"`, `"max"`, `"region"`, `"docked"`. It gives null for anything but a float drawn at a first form that grows (a
997
+ panel's card): a toolbar group's size and a folded float's bar come from their forms. On commit (each move, or the
998
+ release) `resize(scene, id, rect, moving)` stores that same rect as the float's rect and the item's `floatSize`, so the
999
+ preview is the commit and the size survives `storeScene`. `fitFloat` is the other half: it moves a float to a clear
1000
+ place and never resizes it.
936
1001
 
937
1002
  **`previous`.** `solve(scene, { previous })` hands each edge's fits (`edges[id].free` and `.stack`) to `fitStack`, so a
938
1003
  change of ages alone (a press, `use`) or `raise` changes no rect (C23), a form that was only re-measured keeps its place,
@@ -941,26 +1006,52 @@ and one whose kind changed starts over. Whenever `content` isn't the rect `previ
941
1006
  refits it. Columns that gave way stay folded, in the order they folded (the fold notes' order), while the content still
942
1007
  fits; room that comes back unfolds them in the reverse of that order, never by age, so a press unfolds nothing, and
943
1008
  solving again from a layout changes nothing. An item docked now that was closed or absent in `previous` has just
944
- opened: it counts as the newest and takes its largest form that fits its edge as laid out. The columns' fold and shrink
945
- state still follows `previous` (only a column folded by give-way that holds the opened item is weighed again), so to
946
- reweigh a column fully, pass `fresh: [columnId]`. `fresh` (edge or item ids, on `solve` and `targets`) solves those
947
- edges without `previous`.
1009
+ opened. Opened beside items that stayed open in its edge, it counts as the newest and takes its largest form that fits
1010
+ its edge as laid out, and its column is weighed again. A closed item is not a removed one: opened into an edge whose
1011
+ items were all closed, it comes back with its age, and the column's folds, kept while it was closed, apply again. The
1012
+ columns' fold and shrink state otherwise follows `previous`, so to reweigh a column fully, pass `fresh: [columnId]`.
1013
+ `fresh` (edge or item ids, on `solve` and `targets`) solves those edges without `previous`.
1014
+
1015
+ `use` alone never reshapes anything: ages decide only who gives way anew. A user's explicit request to show an item
1016
+ is passed as `fresh`:
1017
+
1018
+ | Action | What to pass |
1019
+ |---|---|
1020
+ | focus (a press on a header) | `use` only |
1021
+ | expand a folded or railed item | `use` + `fresh: [id]` |
1022
+ | Keep open | `keep` + `fresh: [id]` |
1023
+ | open a closed item | `open`: it counts as fresh by itself beside items that stayed open in its edge. Into an edge whose items were all closed it comes back as it was (its column may stay folded by give-way); to show it regardless, `open` + `use` + `fresh: [id]`, as for expanding |
948
1024
 
949
1025
  **Targets.** `targets(scene, id, { previous, endReach, floatSize, floatOrient })` gives, in the `@n-uf/motion/drag` shape:
950
1026
 
1027
+ Every hit lies where the user sees things: the layout as it is, the dragged item in place. Its own place is home, and so
1028
+ are the gaps right beside it (a drop there is the same move). An edge the lift would delete (the item alone in its
1029
+ column) is home as a whole. A zone of a bar reaches over every card seen in it. Each target's `after` is the solved
1030
+ drop, so where the lift would reflow a neighbour the preview moves it under a fixed pointer, and the tiles stay put.
1031
+
1032
+ **Aim order.** Along every occupied edge (a rail, a bar, a title bar, a tray, a column), the dragged item is taken out
1033
+ first and the pointer aims at the other items: over the leading half of one (its upper half on a side edge, its left
1034
+ half on a bar) the drop goes right before it, over its trailing half right after it. The tiles split at the midpoints of
1035
+ the remaining items, whatever their order and zones. Where that aim gives the order the edge has now, the target is home
1036
+ (no slot elsewhere): home covers the item's own rect and the facing halves of its two neighbours, even a neighbour in
1037
+ another zone. Zones come in only where no item is aimed at: in the free stretch between two items, beyond the last one
1038
+ and on an empty zone or edge, the zone extents (thirds, or the solved spans) say which zone's slot the pointer is over,
1039
+ so a drop there can move the item to another zone with its order kept. A slot whose whole tile lies over its neighbours'
1040
+ facing halves is home's, and is no target of its own. The slot is where the item lands, at its size in that edge's form.
1041
+
951
1042
  - `gap:<edge>:<zone>:<at>` (priority 2) for every edge whose `accepts` lists the item's kind (deny by default), before
952
1043
  each item of each zone and at each zone's end, so an empty center or end zone can be opened; only where the item
953
1044
  fits: not in the » menu, no `overflow`, nothing newly `too-wide`, every fixed item of the edge keeping its form and its
954
- place, and no chrome under its slot. Along the edge the gaps tile it: each hit runs halfway to the neighbouring
955
- gaps' lines, so an edge of a few short items (a bar, a rail, a column's tray) is covered from end to end. Only over an
1045
+ place, and no chrome under its slot. Along the edge the gaps tile it: neighbouring gaps meet at the midpoint of the
1046
+ item between them (see Aim order), else halfway between their lines, so an edge of a few short items (a bar, a rail,
1047
+ a column's tray) is covered from end to end. Only over an
956
1048
  open item's body (a panel) the hit narrows to `Edge.hitBand` px around its line (default 24), so the middle of a
957
1049
  panel is no gap and the pointer falls through to the float target (or to none). Gaps on one line are one target, the
958
1050
  first in zone order: when a bar has no spare length, `center:0` and `end:0` lie on the start zone's last line and
959
1051
  merge into that start gap (its id stays `gap:<edge>:start:<n>`). The first and last reach `endReach` px past the
960
1052
  edge's ends, but only a hit that reaches the edge's end goes on past it (a tray's gap at the foot never covers the
961
1053
  top). Another edge's rect trims a gap's hit: one across from the edge (a bar above a column) at the hit's end along
962
- the edge, one beside it (a neighbouring column) at its side; the edges as they are now, before the item is lifted,
963
- trim it at its side too (but the dragged item's own edge). Across, the hit is the larger of the edge's thickness
1054
+ the edge, one beside it (a neighbouring column) at its side. Across, the hit is the larger of the edge's thickness
964
1055
  before and after the drop; a compact edge's hits reach 24 px further inward, except where another edge's gap is.
965
1056
  Hits are cut clear of chrome and of every fixed item that doesn't grow (controls, a readout). A fixed item that grows
966
1057
  (a title filling its bar) takes hits over its text, which land in the nearest gap; it reserves only its natural rect,
@@ -978,6 +1069,9 @@ edges without `previous`.
978
1069
  covers the columns' first gaps); one across its middle is left to the smaller-hit tie-break. With nothing left (an
979
1070
  empty outer bar on a non-empty inner one, a bar's strip all under an overlay column) it has no target. A third is
980
1071
  offered only for a kind its zone takes (`Edge.zoneAccepts`); the others are refusals.
1072
+ - `side:<side>` (2), only for a fixed item on an edge with `moves: "side"` (an anchor such as page thumbnails): the
1073
+ place its edge takes on the other side of its axis, landing as `setSide` puts it. A fixed item has no other target
1074
+ but home.
981
1075
  - `float:<id>` (3, free) when `floatKinds` lists the kind: the whole plane, landing with the pointer holding the float
982
1076
  at `grab`, clamped and moved clear. It has no fixed `slot`: the slot to draw is
983
1077
  `after(point, grab).layout.items[id].rect`, for the pointer at the time.
@@ -1020,6 +1114,18 @@ zone's.
1020
1114
  edge's owned rect.
1021
1115
  - An overlay column is drawn on top, and what shows on top wins: an empty rail's place under it offers no `rail:` stop
1022
1116
  there, and a column line beside it yields to it.
1117
+ - A refused place owns nothing against other edges, zone by zone: an edge owns its band only along the zones with a
1118
+ slot the filter keeps (home's place aside), and a refusal of a zone with none takes only what every surviving target's
1119
+ tile and every other edge's owned rect leave (within its own edge a refusal keeps its tile). So a panel can always
1120
+ become its own column beside the others: an empty rail that would refuse the drop doesn't hide the new-column target
1121
+ just inside a side bar, and an empty top bar whose zone holds only the dragged item's place doesn't cover a column's
1122
+ top band.
1123
+ - An edge that only moves when the dragged item lifts (a side bar pushed inward by a rail that empties) owns where it
1124
+ lies after the lift, where its tiles are, never its old place.
1125
+ - Clipping changes a slot's shape, never who owns it: whatever is left of a slot's tile is the slot's. A target left in
1126
+ pieces has **`hits`**, every piece (optional on `Target`), and `hit` is the largest piece, for hosts that read one
1127
+ rect; `pickTarget` (`./scene/cases`) tests every piece, as `@n-uf/motion/drag` does. Nothing of a slot's own room is
1128
+ refused.
1023
1129
  - **The column lines and the rail are edges like the others**, tiled by the same rule. A column line or rail stop whose
1024
1130
  drop wouldn't land or fit, and any piece clipping cuts off its tile, is refused (`refuse:column:<side>:start`,
1025
1131
  `refuse:rail:<side>:start`, `no-room`) rather than left to the float.
@@ -1040,6 +1146,16 @@ across it), so an id holds from one frame to the next; no id is given twice by o
1040
1146
  its own tile. A host shows "no room here" at the pointer over one, with no slot anywhere; a release there commits
1041
1147
  nothing, the item goes home. It takes the same `previous` and `fresh` as `targets`.
1042
1148
 
1149
+ **Ids, read and built.** These formats exist in one place. A host reads an id with `parseTargetId(id)` and builds one
1150
+ with `targetId(parts)`, so it never splits strings (an edge id may hold `:`):
1151
+
1152
+ | Helper | What it does |
1153
+ |---|---|
1154
+ | `targetId(parts)` | The id for `{ kind: "gap", edge, zone, at }`, `{ kind: "strip", edge, zone }`, `{ kind: "column" \| "rail", side, ring }`, `{ kind: "home" \| "float", item }`, `{ kind: "none", index }` or `{ kind: "refuse", edge, zone, n }` (`n` 0 for a zone's first refusal). |
1155
+ | `parseTargetId(id)` | The same parts (`TargetIdParts`), or null for an id outside the scheme. |
1156
+ | `placeTargetId(place, item)` | The id `targets` gives the target at a `ScenePlace` (null for `none`). |
1157
+ | `virtualEdgeId(kind, side)` | `column:<side>` or `rail:<side>`: the virtual edge a refusal names in `edge`. |
1158
+
1043
1159
  A gap, column or rail target exists only where the drop keeps the whole scene sound (C29): it adds no `overflow` or
1044
1160
  `too-wide` note to any edge, changes no fixed item's form, squeezes none under its `main.min` anywhere (a between bar
1045
1161
  under a new column included), and lands its slot on no chrome. The rule compares notes: in an edge that already
@@ -1056,7 +1172,9 @@ Each target's `after(point, grab)` is `{ scene, layout }`: the scene to commit (
1056
1172
  **Changes** are pure and return the scene given when nothing applies: `moveTo(scene, id, { edge, zone?, at })`,
1057
1173
  `floatAt(scene, id, rect?, orient?)` (with no rect: its last `floatSize`, anchored to the content's top-right), `fold`,
1058
1174
  `use`, `keep`, `raise` (a float on top: no use, no reshape), `open`, `close`, `orient`, `resize` and
1059
- `setSide(scene, edgeId, side)`. `setSide` moves an edge to the other side of its axis (left ⇄ right, top ⇄ bottom) as
1175
+ `setSide(scene, edgeId, side)`. `resize(scene, edgeId, size)` sets the user's size across an edge;
1176
+ `resize(scene, floatId, rect, moving?)` resizes a float by hand at `fitResize`'s rect (see "Resizing a float by hand";
1177
+ the scene given back where `fitResize` gives null). `setSide` moves an edge to the other side of its axis (left ⇄ right, top ⇄ bottom) as
1060
1178
  its side's outermost edge: ring 0, before that side's other edges, whose rings close up behind it (the side it left
1061
1179
  closes up too). Its items, size and options go with it; the scene is given back unchanged for an unknown edge, the side
1062
1180
  it is already on, or a side across its axis. Like every change it ticks no use clock: a host that moves an edge by hand
@@ -1106,10 +1224,11 @@ place left empty and nothing else moved. A row with `lacks` names a library rule
1106
1224
  to fail until it lands. A host reaches the end gaps 24 px (`END_REACH`) past an edge's ends.
1107
1225
 
1108
1226
  ```ts
1227
+ import { targetAt } from "@n-uf/motion/drag";
1109
1228
  import { CASES, createSceneHost, runCase } from "@n-uf/placement/scene/cases";
1110
1229
 
1111
1230
  const row = CASES.find((c) => c.id === "C1")!; // the drop preview is the rect the item gets
1112
- const result = runCase(row, createSceneHost());
1231
+ const result = runCase(row, createSceneHost({ pick: targetAt })); // motion's pick rule
1113
1232
  console.log(result.ok, result.failures, result.skipped.length); // true [] 6
1114
1233
  ```
1115
1234
 
@@ -1120,20 +1239,26 @@ anything with `getAttribute` and `querySelectorAll` (and `getBoundingClientRect`
1120
1239
  selector under it of the element that draws an item (default `[data-dock-item="<id>"]`, also exported as
1121
1240
  `defaultItemSelector`), `stored()` the stored form and `stops(item)` the "Move to ›" places; a check the host can't make is skipped and listed in `skipped`. A check pointing at
1122
1241
  a gesture the row doesn't have fails the row. `createSceneHost()` is the reference: no page, no pointer, no clock, a drag
1123
- session that lifts past 4 px, asks `targets` for every target, takes the most precise one under the pointer (`pickTarget`:
1124
- the lowest priority number, then the smallest hit), draws the preview from its `after.layout` and commits `after.scene` on
1125
- release, every solve carrying the layout before it as `previous`. A kit's host does the same with its own pointer;
1126
- `resolvePlace(targets, place, item, { stage, content })` turns a `place` into a point that reaches the target. Every row
1242
+ session that lifts past 4 px, asks `targets` for every target, takes the one under the pointer by its pick rule,
1243
+ draws the preview from its `after.layout` and commits `after.scene` on release, every solve carrying the layout before
1244
+ it as `previous`. A kit's host does the same with its own pointer; `resolvePlace(targets, place, item, { stage, content
1245
+ }, pick)` turns a `place` into a point that reaches the target. Every row
1127
1246
  passes on the in-memory host except its DOM checks, which it skips, and the rows with `lacks`, which fail on it until the
1128
1247
  library rule lands. `CASE_GROUPS` lists the groups.
1129
1248
 
1249
+ **The pick rule** (which target the pointer is over: the lowest priority number, then the smallest zone, every piece of
1250
+ `hits` counted, a rect holding its edges exactly) is `@n-uf/motion/drag`'s `targetAt`, the rule the drag intent runs.
1251
+ Placement doesn't import motion, so the host takes it as an input: `createSceneHost({ pick: targetAt })`, the last
1252
+ argument of `resolvePlace`, and a host's optional `pick` (`PickRule`). Without one, the default is the same rule
1253
+ (`pickTarget`, deprecated, held equal to `targetAt` by a test).
1254
+
1130
1255
  **The gesture grammar.** A row's `gestures` are plain objects (`g.press(...)` and the other `g` constructors build them),
1131
1256
  played in order:
1132
1257
 
1133
1258
  | `type` | What a host does |
1134
1259
  |---|---|
1135
1260
  | `press` | Pointer down on `item`'s handle (its grip, or its header); `point` is the grab, relative to the item's top-left corner, and is the row's, not the host's. Nothing lifts yet. |
1136
- | `move` | The pointer moves to `point` (stage px) or to the target at `place` (`resolvePlace` finds a point that reaches it). With an item pressed, the first move past the lift threshold lifts it (a `place` always lifts), and the pointer is then over whichever target `pickTarget` finds. With no target under it, the host draws the committed layout with the held item's place left empty and nothing else moved. |
1261
+ | `move` | The pointer moves to `point` (stage px) or to the target at `place` (`resolvePlace` finds a point that reaches it). With an item pressed, the first move past the lift threshold lifts it (a `place` always lifts), and the pointer is then over whichever target the host's pick rule finds. With no target under it, the host draws the committed layout with the held item's place left empty and nothing else moved. |
1137
1262
  | `hold` | The pointer rests for `ms`, so a host with a drag intent settles on its target. A checkpoint or DOM check is never read right after a `move`. |
1138
1263
  | `release` | Pointer up: after a lift, it drops on the target under the pointer (a `home` or `none` target, or none, drops nothing); without one it was a press and nothing changes. |
1139
1264
  | `key` | `"Escape"` cancels the drag, `"Alt"` holds Alt down and `"Alt:up"` lets it go (a frozen window moves while it is down), `"Reload"` stores the scene, drops the live one and reads it back. |