@n-uf/placement 26.11.29 → 26.11.30
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 +35 -0
- package/README.md +86 -63
- package/dist/{chunk-7ASCUAGV.js → chunk-3ZICYLWL.js} +2 -2
- package/dist/{chunk-7ASCUAGV.js.map → chunk-3ZICYLWL.js.map} +1 -1
- package/dist/{chunk-PC5UHBW4.js → chunk-5CSWQSH7.js} +30 -22
- package/dist/chunk-5CSWQSH7.js.map +1 -0
- package/dist/{chunk-3RRCKN74.js → chunk-AE3BWTAE.js} +2 -2
- package/dist/chunk-AE3BWTAE.js.map +1 -0
- package/dist/{chunk-3P6VOXA6.js → chunk-AVMZIXGO.js} +2 -2
- package/dist/{chunk-3P6VOXA6.js.map → chunk-AVMZIXGO.js.map} +1 -1
- package/dist/{chunk-WLMJ6JGO.js → chunk-GIBUM6TB.js} +1 -1
- package/dist/chunk-GIBUM6TB.js.map +1 -0
- package/dist/{chunk-OYGOJWAX.js → chunk-JVAR67OL.js} +2 -2
- package/dist/{chunk-WM5FJ3IS.js → chunk-VLTYJHUA.js} +1 -1
- package/dist/{chunk-WM5FJ3IS.js.map → chunk-VLTYJHUA.js.map} +1 -1
- package/dist/{constructions-DSEjvWMP.d.ts → constructions-Cbz7uEAZ.d.ts} +3 -3
- package/dist/desk.d.ts +3 -3
- package/dist/desk.js +3 -3
- package/dist/dock.d.ts +4 -4
- package/dist/dock.js +2 -2
- package/dist/dock.js.map +1 -1
- package/dist/{float-fit-DRSOU_2y.d.ts → float-fit-DCYxRMru.d.ts} +1 -1
- package/dist/{geometry-CkZ6Fcfb.d.ts → geometry-Bf37LbCT.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{model-lYlnfQnl.d.ts → model-BxFXr9UY.d.ts} +5 -5
- package/dist/{model-CPM1Lv65.d.ts → model-X7eUaKlA.d.ts} +2 -2
- package/dist/panels.d.ts +5 -5
- package/dist/panels.js +3 -3
- package/dist/scene-cases.d.ts +59 -15
- package/dist/scene-cases.js +114 -21
- package/dist/scene-cases.js.map +1 -1
- package/dist/scene.d.ts +7 -7
- package/dist/scene.js +3 -3
- package/dist/stack.d.ts +6 -6
- package/dist/stack.js +2 -2
- package/dist/{target-D9PMr9pF.d.ts → target-2RYYKkd1.d.ts} +1 -1
- package/dist/{targets-BYRTTwCP.d.ts → targets-Du5_4T1u.d.ts} +4 -4
- package/dist/targets.d.ts +14 -14
- package/dist/targets.js +4 -4
- package/dist/targets.js.map +1 -1
- package/dist/toolbar.d.ts +11 -11
- package/dist/toolbar.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-3RRCKN74.js.map +0 -1
- package/dist/chunk-PC5UHBW4.js.map +0 -1
- package/dist/chunk-WLMJ6JGO.js.map +0 -1
- /package/dist/{chunk-OYGOJWAX.js.map → chunk-JVAR67OL.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
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.30
|
|
7
|
+
|
|
8
|
+
- `./scene`, fixed: **an occupied rail offered the same move twice.** With a side's tiles width-folded and an item dragged,
|
|
9
|
+
`rail:left:0` and `rail:left:1` landed identically (a rider bar at the top), so `stops()` listed two identical "Move to"
|
|
10
|
+
entries. Rail stops that land the same are now one stop, wherever their lines lie (the same-move merge slots already
|
|
11
|
+
had, which compared lines); the stop that stays spans both.
|
|
12
|
+
- `./scene`, fixed: **flush windows lost the new outermost column on an occupied side** when a kind's rail strip is on
|
|
13
|
+
(`Scene.railDrop`): the strip owns the window's edge, which was all the line for a new outermost column had, so only
|
|
14
|
+
the inner lines remained (an inset window kept a sliver beside its padding). That line now lies just inside the strip,
|
|
15
|
+
as an empty column's drop strip already does (laid after the strip, so it owns what the strip and the other targets and
|
|
16
|
+
refusals leave); it is in `stops`, so a host's "Move to ›" reaches it.
|
|
17
|
+
- `./scene/cases`, **a host's id map** (additive): `CaseHost.ids` / `AsyncCaseHost.ids`, a row's item and edge ids to the
|
|
18
|
+
host's (`{ views: "panels", tools: "commands" }`). The runner hands the host its own ids (the scene, the gestures,
|
|
19
|
+
`stops`, `itemSelector`) and maps the layout, the stored form and the stops back before comparing, so the rows that
|
|
20
|
+
name control groups run on a host that names them otherwise. One function does both ways: `mapScene`, `mapGesture`,
|
|
21
|
+
`mapLayout`, `mapStored`, `mapPlace` with `idRenames(ids)`; a map that sends two row ids to one host id throws.
|
|
22
|
+
- `./scene/cases`, **the runner clamps the pointer into the stage** (the host contract, now the runner's too): a `move` to
|
|
23
|
+
a `point` reaches the host clamped into the stage (the row's `settings.stage`, or the window after a `resize`), so
|
|
24
|
+
every host plays the same point. C17's text says what the clamped point picks.
|
|
25
|
+
- `./scene/cases`, **`CaseRow.requires`** (additive, type `CaseRequires`): what a row's scene needs of the host's window,
|
|
26
|
+
for a host's suite to skip or mark the row: `hitBand: "default"` on C7 and P5-neighbour-half-facing-it (an open panel's
|
|
27
|
+
body is no drop place), `rails` on P9-to-the-other-rail. **P9-to-the-other-rail changed:** its scene is now 600 px wide
|
|
28
|
+
with Findings folded by hand, so both rails show at the start (at 700 px no right rail was drawn). The rows' docs say a
|
|
29
|
+
window row's stage is the window's body, canvas padding inside (README, `WINDOW_A`, `WINDOW_B`).
|
|
30
|
+
- `./scene`, fixed: **an occupied rail's stops were a dead band** when lifting the item reopened the column that was
|
|
31
|
+
folded by width into that rail (flush window, rails on both sides, `handFold: "ride"`, no `railDrop`): the stops landed
|
|
32
|
+
only in the rail, so the item riding over the reopened column made every stop a `no-room` refusal and the rail had no
|
|
33
|
+
targets. A rail that shows now offers its stops by the one rule the rail strip uses, wherever the item ends up
|
|
34
|
+
collapsed at that side (its tile, a rider bar, or a header); the slot is that landing, and the stops split by the
|
|
35
|
+
halves of the rail's tiles, to the window's edge. A rail with none showing is unchanged. README: draw `refusals()`
|
|
36
|
+
as well as the targets, so a refusal never looks like a dead band.
|
|
37
|
+
- `./scene/cases`, **two `CASE_GROUPS` titles reworded** (data only; the group ids `bands` and `gestures` and every row
|
|
38
|
+
id are unchanged): "Gap bands, refits and slots" is now "Gap hit areas, refits and slots", and "The kits' panel
|
|
39
|
+
gestures" is now "Panel gestures".
|
|
40
|
+
|
|
6
41
|
## 26.11.29
|
|
7
42
|
|
|
8
43
|
- `./scene`, **rail docking per item kind** (additive; a kind with no policy targets exactly as before):
|
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
Site and live demos: [motion.n-uf.com](https://motion.n-uf.com)
|
|
11
11
|
|
|
12
|
-
Where things go. State in, rects and drop targets out: a
|
|
13
|
-
side that give way
|
|
14
|
-
tree with ratios, groups and workspaces) is planned. Pure functions over plain data: no DOM, no framework, no
|
|
12
|
+
Where things go. State in, rects and drop targets out: a workspace of docks, rails and floating panels, panels in
|
|
13
|
+
columns per side that give way least recently used first, toolbar groups in toolbar areas and zones, and the drop
|
|
14
|
+
targets for each. A full tiling entry (a split tree with ratios, groups and workspaces) is planned. Pure functions over plain data: no DOM, no framework, no
|
|
15
15
|
motion, no dependencies.
|
|
16
16
|
|
|
17
17
|
```sh
|
|
@@ -30,14 +30,14 @@ without importing each other: a target list from `@n-uf/placement/targets` is ex
|
|
|
30
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
31
|
rect; `hit` is the largest); `./targets` and `./panels` still export it and the hit sizes.
|
|
32
32
|
- **`/dock`**: a desk of documents and tool panels. Side docks and a bottom dock (between the side docks or across
|
|
33
|
-
the full width), rails, natural-height sections whose last one takes the rest,
|
|
34
|
-
rules (sections
|
|
35
|
-
tear-off and dock-back; and nine
|
|
36
|
-
- **`/toolbar`**: toolbar groups in five
|
|
37
|
-
end), floating groups, insertion points (before all, between, after all, an empty zone), collapse when a
|
|
38
|
-
runs out of room (lowest keep first, trailing groups first among equal keeps), and
|
|
39
|
-
- **`/targets`**: drop targets (`{ id, priority, hit, slot?, label?, free? }`) for the desk
|
|
40
|
-
toolbar
|
|
33
|
+
the full width), rails, natural-height sections whose last one takes the rest, collapse and expand, the give-way
|
|
34
|
+
rules (sections collapse least recently used first, docks collapse to their rails), floating panels with corner
|
|
35
|
+
stacks, tear-off and dock-back; and nine desk layouts built from these parts, as presets (`createDesk`).
|
|
36
|
+
- **`/toolbar`**: toolbar groups in five toolbar areas (title, top, bottom, left, right) and three zones (start, center,
|
|
37
|
+
end), floating groups, insertion points (before all, between, after all, an empty zone), collapse when a toolbar
|
|
38
|
+
area runs out of room (lowest keep first, trailing groups first among equal keeps), and a group's home is its own place.
|
|
39
|
+
- **`/targets`**: drop targets (`{ id, priority, hit, slot?, label?, free? }`) for the desk layouts,
|
|
40
|
+
toolbar areas (each with its `slot`, and `allows` to leave out places a group may not take) and pane drop zones; and
|
|
41
41
|
`keyboardStops`, one ordered list of places for the arrow keys and a "Move to" menu.
|
|
42
42
|
- **`/panels`**: tool panels with string ids: full-height columns per side, each with its own width, shown as a
|
|
43
43
|
stack of sections or as tabs; folding to a title bar or a rail; give-way by age when the pages run out of room (and,
|
|
@@ -56,8 +56,8 @@ without importing each other: a target list from `@n-uf/placement/targets` is ex
|
|
|
56
56
|
title, window controls), floats clear of every bar and chrome (`fitFloat`), one `solve` for every rect, one
|
|
57
57
|
`targets` for every drop target of one item (each carrying the layout a release makes, so the preview is the
|
|
58
58
|
result), pure changes and a stored form.
|
|
59
|
-
- **`/scene/cases`**: the Scene's
|
|
60
|
-
expected after) and `runCase`, which plays one on a host, so
|
|
59
|
+
- **`/scene/cases`**: the Scene's behavior as data: conformance rows (a scene, what a user does, the layout and DOM
|
|
60
|
+
expected after) and `runCase`, which plays one on a host, so an integrating app's test suite and the lab run the same rows.
|
|
61
61
|
|
|
62
62
|
Rendering stays in the app: it draws the rects, measures its groups, and feeds pointer samples to a drag intent.
|
|
63
63
|
|
|
@@ -90,17 +90,17 @@ notes saying how it gave way. A note's `code` (with its `side` and `items` where
|
|
|
90
90
|
| `dock-folded` | a side dock folded to its rail | `side` |
|
|
91
91
|
| `sections-folded` | sections folded to their headers by themselves, least recently used first | |
|
|
92
92
|
| `torn-floating` | panels torn off a dock float | `items` |
|
|
93
|
-
| `torn-shaded` | some torn-off panels
|
|
93
|
+
| `torn-shaded` | some torn-off panels collapse to their headers because they don't fit | |
|
|
94
94
|
| `columns-railed` | the tiling tree's side columns folded to rails | `side` when only one |
|
|
95
|
-
| `tiles-float` | tiles that broke a minimum float,
|
|
95
|
+
| `tiles-float` | tiles that broke a minimum float, most recently added first | `items` |
|
|
96
96
|
| `tabs-folded` | a tabbed side folded to icon tabs | `side` |
|
|
97
97
|
| `drawer-over` | a drawer slides over the documents | `side` |
|
|
98
|
-
| `column-split` | a
|
|
99
|
-
| `strip-scrolls` | the
|
|
100
|
-
| `stacks-merged` | both
|
|
101
|
-
| `palettes-shaded` |
|
|
102
|
-
| `palettes-cover` | how much of the documents the
|
|
103
|
-
| `docs-room` | how much room the
|
|
98
|
+
| `column-split` | a scrolling column split in two | `items` |
|
|
99
|
+
| `strip-scrolls` | the scrolling columns are wider than the stage | |
|
|
100
|
+
| `stacks-merged` | both stacks of floating panels share one corner | |
|
|
101
|
+
| `palettes-shaded` | floating panels collapsed to their headers | |
|
|
102
|
+
| `palettes-cover` | how much of the documents the floating panels cover | |
|
|
103
|
+
| `docs-room` | how much room the floating panels leave the documents | |
|
|
104
104
|
|
|
105
105
|
## Toolbar groups
|
|
106
106
|
|
|
@@ -150,12 +150,12 @@ const drop = deskDrop(input, float, { x: 600, y: 300 }, { x: 20, y: 10 });
|
|
|
150
150
|
console.log(drop.label, drop.slot.x, drop.slot.y); // Float here 580 290
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
A toolbar group's targets come from `hostTargets` (a
|
|
154
|
-
returned as `own`, for the drag's home) and `floatTarget`. Each
|
|
153
|
+
A toolbar group's targets come from `hostTargets` (a toolbar area's lines and empty zones, with its home left out and
|
|
154
|
+
returned as `own`, for the drag's home) and `floatTarget`. Each target it returns carries its `slot`, the group's rect
|
|
155
155
|
once it lands there; `allows(group, place)` leaves out places a group may not go (its `place.index` counts the
|
|
156
156
|
groups there without the dragged one, as `insertGroup` does). The same rule says whether a group may float: add
|
|
157
157
|
`floatTarget` only when `allows(group, "float")`. `keyboardStops` puts the targets in reading order (title, top,
|
|
158
|
-
left, right, bottom; start,
|
|
158
|
+
left, right, bottom; start, center, end) for the arrow keys and a "Move to" menu, with the group's home as
|
|
159
159
|
`home`:
|
|
160
160
|
|
|
161
161
|
```ts
|
|
@@ -325,7 +325,7 @@ bands.
|
|
|
325
325
|
**Drop targets**: `panelTargets({ defs, state, id, stage, options?, allows? })` gives `column:<side>:<i>` (a new
|
|
326
326
|
column as wide as the panel's own width), `into:<side>:<i>` (stack into a column), `rail:<side>` (dock folded) and
|
|
327
327
|
`float` (free), in the shape `@n-uf/motion/drag`'s `createDragIntent` takes. Each carries a structured `place`, not
|
|
328
|
-
words. A place the panel may not take (its def's `sides` and `floats`, or `allows`) and its
|
|
328
|
+
words. A place the panel may not take (its def's `sides` and `floats`, or `allows`) and its home are no targets.
|
|
329
329
|
`panelDrop(input, target, point, grab)` lays out the drop: its `slot` is where the panel lands. `keyboardStops` from
|
|
330
330
|
`@n-uf/placement/targets` puts panel targets in reading order, with `homePlace(state, id)` as `home`:
|
|
331
331
|
|
|
@@ -430,7 +430,7 @@ places them; it is not tied to `./panels` columns, and nothing in it is a word.
|
|
|
430
430
|
|
|
431
431
|
- Every item starts in its largest form, or at `from` (an index into its forms; a panel the user folded by hand
|
|
432
432
|
starts at its header). While the smallest sizes don't fit the `length`, one item takes a smaller form: the step into
|
|
433
|
-
the lowest `rank` (below), and among equals the
|
|
433
|
+
the lowest `rank` (below), and among equals the least recently used item (`used`: the smaller, the longer ago), unkept
|
|
434
434
|
before `kept`, the later in the stack first on a tie. A `menu` form takes no room: the » entry does (`menu.main`,
|
|
435
435
|
default 28 px), while any item is in it.
|
|
436
436
|
- A give-way step goes only to a later form that shortens the stack: its `main.min` is smaller, counting the » entry
|
|
@@ -448,7 +448,7 @@ places them; it is not tied to `./panels` columns, and nothing in it is a word.
|
|
|
448
448
|
- `StackForm.rank` (default 0) orders the steps: the lowest rank of the form an item would step into goes first, then
|
|
449
449
|
unkept before kept, then the oldest, then the later in the stack. Give a pinned primary's last forms a higher rank
|
|
450
450
|
and every other group gives way before it does.
|
|
451
|
-
- `gap` is the space between
|
|
451
|
+
- `gap` is the space between neighboring drawn items (the » entry is a neighbor) and `pad` (`{ start, end }`) the
|
|
452
452
|
space before the first item and after the last (or the » entry). Both count toward the length and every rect
|
|
453
453
|
includes them, so an app draws at the solver's rects and the preview is exact. A non-number or a negative one is 0.
|
|
454
454
|
- Spare length goes to the forms that `grows`, shared by their natural sizes. With none, the items keep their
|
|
@@ -551,7 +551,7 @@ more way and the stack is still too long; forms that don't end in a `menu` form
|
|
|
551
551
|
`stackTargets(input, dragged)` takes the stack (an item of it with the dragged id is lifted out first, so a reorder
|
|
552
552
|
within a stack works) and gives a target for every gap, before each item and after the last, in the shape
|
|
553
553
|
`@n-uf/motion/drag` takes: `id` `gap:<k>`, priority 2, `place` `{ kind: "gap", at: k }`, `hit` (the stack split at
|
|
554
|
-
its items' middles, so it covers the gap and padding between its
|
|
554
|
+
its items' middles, so it covers the gap and padding between its neighbors, as wide across as the larger of the
|
|
555
555
|
stack and the drop's fit; with every item in the menu only the last gap has any length) and `slot`, the rect the
|
|
556
556
|
dragged item gets.
|
|
557
557
|
`fit` is the full solve with the item inserted at k (`input` the stack that was solved), so the preview is exactly the
|
|
@@ -570,10 +570,10 @@ console.log(targets.map((t) => t.id), targets[1]!.slot, targets[1]!.fit.items[1]
|
|
|
570
570
|
|
|
571
571
|
A top bar of control groups uses the same solver, with a few more things it can say:
|
|
572
572
|
|
|
573
|
-
- A group's `fold` form is its
|
|
573
|
+
- A group's `fold` form is its grip with its own » in line (the group collapsed): it keeps its place in the stack and takes its own `main`
|
|
574
574
|
length. The shared » entry (`menu`) stays a later step: give the `menu` form a higher `rank` than the folds, or
|
|
575
575
|
an older group may go into it before a newer one folds.
|
|
576
|
-
- `rank`, `gap`, `pad`, `cross.max` and `endReach` as above. The
|
|
576
|
+
- `rank`, `gap`, `pad`, `cross.max` and `endReach` as above. The app draws every group at the solver's rect, so there
|
|
577
577
|
is nothing to measure and the drop preview is exact.
|
|
578
578
|
- Hysteresis is not here: a pointer that flickers between two gaps is `@n-uf/motion/drag`'s to calm (the intent's
|
|
579
579
|
band, and `placeOf` with `previous`), and `stackTargets` only says where the gaps are.
|
|
@@ -706,7 +706,7 @@ pure.
|
|
|
706
706
|
- `storeFloats(floats)` and `readFloats(data, known?)`: `{ v: 1, floats: [{ id, x, y, width, height }] }`, in stacking
|
|
707
707
|
order (the last is on top). It writes no `pinned`. `storeFloats` leaves out, silently, a float whose position isn't a
|
|
708
708
|
finite number or whose size isn't over 0, and keeps the last readable entry of a repeated id (the one on top, at its
|
|
709
|
-
|
|
709
|
+
home in the order). Reading never throws: anything but an object of version 1 with a `floats` array is
|
|
710
710
|
`{ ok: false, error }` (the version worded as the stack's reader words it, a string quoted); inside one, a float that
|
|
711
711
|
isn't an object, has no string id, isn't one the consumer has (with `known`) or has a position that isn't a finite
|
|
712
712
|
number or a size that isn't over 0 is dropped and listed in `dropped` as `float:<id>`; of a repeated id the last
|
|
@@ -807,7 +807,7 @@ naturals. A column where nothing sets the width is a rail: its items that have a
|
|
|
807
807
|
**Rail titles.** A panel may declare two rail forms: its title (`{ kind: "rail", title: true }`, its `main` the length
|
|
808
808
|
of its name and count turned along the rail, measured by the host) and then its tile (a plain `rail` form). In a rail
|
|
809
809
|
they are two steps on its ladder: while the rail's length fits every title, each item shows its title; when it runs
|
|
810
|
-
short, titles step down to tiles by the usual rules (priority, then the
|
|
810
|
+
short, titles step down to tiles by the usual rules (priority, then the least recently used item) and come back in exact
|
|
811
811
|
reverse as room returns (`StackFit.steps`). That holds for a column drawn as a rail and for a side's rail strip
|
|
812
812
|
(`layout.rails[side]`, whose fit is `rails[side].stack`). Each side has a mode, `scene.railModes[side]`: `"titles"`
|
|
813
813
|
(the default) or `"icons"`, which passes title forms over so every item shows its tile; `setRailMode(scene, side,
|
|
@@ -840,7 +840,7 @@ takes no drop in that zone. The zones are then laid with the title at its natura
|
|
|
840
840
|
|
|
841
841
|
- a leading toolbar sits right after the title's natural rect;
|
|
842
842
|
- the trailing toolbars sit right before the end items (the window controls);
|
|
843
|
-
- a center toolbar sits at the bar's true
|
|
843
|
+
- a center toolbar sits at the bar's true center when that is clear of both, else it is centered in the free span between
|
|
844
844
|
the leading and the trailing ones;
|
|
845
845
|
- the title takes the spare room only when nothing follows it in its zone, so a toolbar after the title is no longer
|
|
846
846
|
separated from it by a stretch of title.
|
|
@@ -901,9 +901,9 @@ const zoom: SceneItem = {
|
|
|
901
901
|
their `icons` form (and the » menu after it), stacked, each item's grip the divider. An item with no `icons` form is left
|
|
902
902
|
out of it with a `no-icons-form` note.
|
|
903
903
|
|
|
904
|
-
**
|
|
904
|
+
**Column footers.** `Edge.zoneAccepts` (and `ColumnTemplate.zoneAccepts`, for the columns a drop makes) narrows `accepts` per zone:
|
|
905
905
|
the kinds each zone takes, and a zone not listed takes nothing. A panel column with `{ start: ["panel"], end: ["group"] }`
|
|
906
|
-
has its panels at the top and a
|
|
906
|
+
has its panels at the top and a footer of toolbar groups at its foot (the end zone, one group per row): a group in the footer
|
|
907
907
|
takes only its `wrap` or `icons` form, never the menu, and the panels give way first. Gaps are offered only in the zones
|
|
908
908
|
that take the dragged kind, `moveTo` puts an item in the zone asked for, else in its own zone if that takes its kind, else in the first that does. An empty edge offers
|
|
909
909
|
each third of its strip only to the kinds that third's zone takes (the other thirds are refusals), and a group never
|
|
@@ -1016,7 +1016,7 @@ preview is the commit and the size survives `storeScene`. `fitFloat` is the othe
|
|
|
1016
1016
|
place and never resizes it.
|
|
1017
1017
|
|
|
1018
1018
|
**`previous`.** `solve(scene, { previous })` hands each edge's fits (`edges[id].free` and `.stack`) to `fitStack`, so a
|
|
1019
|
-
change of ages alone (a press, `use`) or `raise` changes no rect
|
|
1019
|
+
change of ages alone (a press, `use`) or `raise` changes no rect, a form that was only re-measured keeps its place,
|
|
1020
1020
|
and one whose kind changed starts over. Whenever `content` isn't the rect `previous.content` was, the layout has a
|
|
1021
1021
|
`content-changed` note (`{ from, to }`): a host refits its zoom only on that note, so a press or a float move never
|
|
1022
1022
|
refits it. Columns that gave way stay folded, in the order they folded (the fold notes' order), while the content still
|
|
@@ -1040,40 +1040,40 @@ is passed as `fresh`:
|
|
|
1040
1040
|
|
|
1041
1041
|
**Targets.** `targets(scene, id, { previous, endReach, floatSize, floatOrient })` gives, in the `@n-uf/motion/drag` shape:
|
|
1042
1042
|
|
|
1043
|
-
Every hit lies where the user sees things: the layout as it is, the dragged item in place.
|
|
1043
|
+
Every hit lies where the user sees things: the layout as it is, the dragged item in place. The item's home is its own place, and so
|
|
1044
1044
|
are the gaps right beside it (a drop there is the same move). An edge the lift would delete (the item alone in its
|
|
1045
1045
|
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
|
|
1046
|
-
drop, so where the lift would reflow a
|
|
1046
|
+
drop, so where the lift would reflow a neighbor the preview moves it under a fixed pointer, and the hit regions stay put.
|
|
1047
1047
|
|
|
1048
|
-
**Aim order.** Along every occupied edge (a rail, a bar, a title bar, a
|
|
1048
|
+
**Aim order.** Along every occupied edge (a rail, a bar, a title bar, a column footer, a column), the dragged item is taken out
|
|
1049
1049
|
first and the pointer aims at the other items: over the leading half of one (its upper half on a side edge, its left
|
|
1050
|
-
half on a bar) the drop goes right before it, over its trailing half right after it. The
|
|
1050
|
+
half on a bar) the drop goes right before it, over its trailing half right after it. The hit regions split at the midpoints of
|
|
1051
1051
|
the remaining items, whatever their order and zones. Where that aim gives the order the edge has now, the target is home
|
|
1052
|
-
(no slot elsewhere): home covers the item's own rect and the facing halves of its two
|
|
1052
|
+
(no slot elsewhere): home covers the item's own rect and the facing halves of its two neighbors, even a neighbor in
|
|
1053
1053
|
another zone. That holds for **cards**, items whose bodies are drop places (toolbar groups, and panels under
|
|
1054
1054
|
`hitBand: "middle"`); an open panel's body is no drop place, so over a panel the pointer aims only in the bands at its
|
|
1055
1055
|
ends. Zones come in only where no item is aimed at: in the free stretch between two items, beyond the last one
|
|
1056
1056
|
and on an empty zone or edge, the zone extents (thirds, or the solved spans) say which zone's slot the pointer is over,
|
|
1057
|
-
so a drop there can move the item to another zone with its order kept. A slot whose whole
|
|
1057
|
+
so a drop there can move the item to another zone with its order kept. A slot whose whole hit region lies over its neighbors'
|
|
1058
1058
|
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.
|
|
1059
1059
|
|
|
1060
1060
|
- `gap:<edge>:<zone>:<at>` (priority 2) for every edge whose `accepts` lists the item's kind (deny by default), before
|
|
1061
1061
|
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
|
|
1062
1062
|
fits: not in the » menu, no `overflow`, nothing newly `too-wide`, every fixed item of the edge keeping its form and its
|
|
1063
|
-
place, and no chrome under its slot. Along the edge the gaps tile it:
|
|
1063
|
+
place, and no chrome under its slot. Along the edge the gaps tile it: neighboring gaps meet at the midpoint of the
|
|
1064
1064
|
item between them (see Aim order), else halfway between their lines, so an edge of a few short items (a bar, a rail,
|
|
1065
|
-
a column's
|
|
1065
|
+
a column's footer) is covered from end to end. Only over an
|
|
1066
1066
|
open item's body (a panel) the hit narrows to `Edge.hitBand` px around its line (default 24), so the middle of a
|
|
1067
1067
|
panel is no gap and the pointer falls through to the float target (or to none). Gaps on one line are one target, the
|
|
1068
1068
|
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
|
|
1069
1069
|
merge into that start gap (its id stays `gap:<edge>:start:<n>`). The first and last reach `endReach` px past the
|
|
1070
|
-
edge's ends, but only a hit that reaches the edge's end goes on past it (a
|
|
1070
|
+
edge's ends, but only a hit that reaches the edge's end goes on past it (a column footer's gap at the foot never covers the
|
|
1071
1071
|
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
|
|
1072
|
-
the edge, one beside it (a
|
|
1072
|
+
the edge, one beside it (a neighboring column) at its side. Across, the hit is the larger of the edge's thickness
|
|
1073
1073
|
before and after the drop; a compact edge's hits reach 24 px further inward, except where another edge's gap is.
|
|
1074
1074
|
Hits are cut clear of chrome and of every fixed item that doesn't grow (controls, a readout). A fixed item that grows
|
|
1075
1075
|
(a title filling its bar) takes hits over its text, which land in the nearest gap; it reserves only its natural rect,
|
|
1076
|
-
placed by its zone (from its start, from its end in the end zone,
|
|
1076
|
+
placed by its zone (from its start, from its end in the end zone, centered in the center zone), and
|
|
1077
1077
|
`reservedRect(scene, layout, id)` gives that rect, for a host that marks where nothing may drop. The length it grew
|
|
1078
1078
|
by is spare room: the drop shrinks it toward its natural size (to its `min` if the room needs it), so a group moved
|
|
1079
1079
|
out of a title bar can always go back while the room allows. No slot lies over a fixed item's reserved rect. `slot`
|
|
@@ -1083,7 +1083,7 @@ facing halves is home's, and is no target of its own. The slot is where the item
|
|
|
1083
1083
|
closed members keeps its `gap:` ids), a strip `Edge.strip` px deep (default 24) along its side, inside the
|
|
1084
1084
|
content and clear of the other edges (overlay ones included), so never over a docked edge or a panel's body: a
|
|
1085
1085
|
full-width empty bar's strip covers only the content between the columns. A compact rail's strip alone stays at the
|
|
1086
|
-
window edge, its
|
|
1086
|
+
window edge, its home. A gap hit that spans it across trims its start or end (a bar's strip along the top never
|
|
1087
1087
|
covers the columns' first gaps); one across its middle is left to the smaller-hit tie-break. With nothing left (an
|
|
1088
1088
|
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
|
|
1089
1089
|
offered only for a kind its zone takes (`Edge.zoneAccepts`); the others are refusals.
|
|
@@ -1100,14 +1100,18 @@ facing halves is home's, and is no target of its own. The slot is where the item
|
|
|
1100
1100
|
- `rail:<side>:<ring>` (1): docking folded into the side's rail, before each folded column's segments and after the
|
|
1101
1101
|
last, or, while no rail shows, the outer 10 px from the side's outer edge (the window's, an inset's strip included;
|
|
1102
1102
|
flush after the side's outside toolbar bars), landing where the rail lands. The outermost column line starts where
|
|
1103
|
-
it ends. A rail
|
|
1104
|
-
|
|
1105
|
-
|
|
1103
|
+
it ends. A rail that shows offers its stops wherever the item ends up collapsed at that side (the same rule as the
|
|
1104
|
+
strip's below): its tile in the rail, or a rider bar over the side's open column when lifting the item lets a column
|
|
1105
|
+
that was folded by width reopen; the slot is that landing. With no rail showing, the stop keeps its place only while
|
|
1106
|
+
one of its slots lands in the rail (home's counts): where every drop there is refused (a panel would ride over an
|
|
1107
|
+
open column), the outermost column line runs from the window's edge. Draw `refusals()` as well as the targets, so a
|
|
1108
|
+
place that refuses a drop never looks like a dead band.
|
|
1109
|
+
For a kind with a rail drop policy, the rail is a spring-loaded drop strip instead (below).
|
|
1106
1110
|
- `none:<i>` (1) over each `scene.blocked` rect, and `home:<id>` (1) over a docked item's own rect: a release there
|
|
1107
1111
|
commits nothing. A floating item has no home, so a move inside its own rect is a float move. A gap, column line or rail
|
|
1108
1112
|
drop that would put the item back where it is (the gap beside it, its own column's line) keeps its id but is a home
|
|
1109
1113
|
too: no slot, nothing committed. Every rail target on the side whose rail already holds the item is a home: a segment
|
|
1110
|
-
dropped on its own rail, even below the last segment, never splits or reorders it
|
|
1114
|
+
dropped on its own rail, even below the last segment, never splits or reorders it.
|
|
1111
1115
|
|
|
1112
1116
|
**The target model.** `targets` and `refusals` come from one generation: edge, then zones, then slots, then tiles, then
|
|
1113
1117
|
one ordered filter (accepts and zones, fit, clipping, `blocked`). A target wins only where its own hit is, and every point
|
|
@@ -1118,7 +1122,7 @@ zone's.
|
|
|
1118
1122
|
the solver's spans where items fill the edge (a plain panel column is one zone, its whole length; a tray column its
|
|
1119
1123
|
panels' span and its tray's). An **empty zone is one slot**, a single place that takes the drop.
|
|
1120
1124
|
- **Slots and tiles.** A zone's slots are the places a drop can land (before each item, after the last); the zone's
|
|
1121
|
-
extent is cut into one tile per slot, each tile meeting its
|
|
1125
|
+
extent is cut into one tile per slot, each tile meeting its neighbor halfway. Slots that are the same move (one line
|
|
1122
1126
|
and one landing, or both putting the item back) are one slot, the lowest `at` keeping its id. A place that would move a
|
|
1123
1127
|
fixed item of its edge (before a title, after the window controls) is no slot.
|
|
1124
1128
|
- **Home.** Home's tile is the item's own interval, with no band around it: a stretch with no slot of its own is refused,
|
|
@@ -1126,7 +1130,7 @@ zone's.
|
|
|
1126
1130
|
- **Space ownership** decides where tiles of different edges meet: owned, then virtual, then overreach.
|
|
1127
1131
|
- A drawn edge owns its rect. An empty edge owns only a thin place band of 12 px (half the hit band) at the boundary
|
|
1128
1132
|
where it would appear; so does the side's rail where none shows. The item's own place is owned before everything.
|
|
1129
|
-
- A column line is where a new column would appear, so it owns a 12 px place band too,
|
|
1133
|
+
- A column line is where a new column would appear, so it owns a 12 px place band too, centered on its line. Owned rects
|
|
1130
1134
|
are ranked by the order the layout lays edges out: an edge laid first, whose filling pushes the other, wins (outer
|
|
1131
1135
|
before inner on one side, full bars before the sides, the rail before its side's columns, a column line over the
|
|
1132
1136
|
inner column it would push but not the outer one). Between edges laid independently a drawn rect wins over an empty
|
|
@@ -1192,7 +1196,10 @@ side's column open, a rider bar over it; on a side without a declared rail, `mov
|
|
|
1192
1196
|
side's outermost column's start zone as a collapsed header ("the column drawn as a rail"), a rail tile once nothing
|
|
1193
1197
|
in that column sets its width. The slot is that landing, so the preview is the drop. The strip
|
|
1194
1198
|
owns its rect: every other target and refusal of the drag gives it up, home's included (an item alone in its column
|
|
1195
|
-
reaches its side's rail from its
|
|
1199
|
+
reaches its side's rail from its home), and an empty column's own drop strip moves just inside it, as does the line for a
|
|
1200
|
+
new outermost column on an occupied side (flush, the strip owns the window's edge): it is laid after the strip, so it
|
|
1201
|
+
owns what the strip and the other targets and refusals leave, the column's own gaps and inner lines keeping theirs; it
|
|
1202
|
+
is one of `stops`, so a host's "Move to ›" reaches it. Before the
|
|
1196
1203
|
strip arms, a drop there is the float's. A kind with no policy keeps its targets exactly as before; tuning one kind
|
|
1197
1204
|
never changes another. The policy's fields, each default with its reason:
|
|
1198
1205
|
|
|
@@ -1204,9 +1211,9 @@ never changes another. The policy's fields, each default with its reason:
|
|
|
1204
1211
|
| `floatNearEdge` | `true` | Before the strip arms, a float may sit near the window's edge, as it may anywhere; `false` keeps a float's rect clear of every strip. |
|
|
1205
1212
|
|
|
1206
1213
|
The time and the keys are the drag intent's (`@n-uf/motion/drag`): `railArmDwellMs` (200 ms) arms a target marked
|
|
1207
|
-
`arm: "dwell"` (spring-loading), and `modifiers` let Shift float anywhere and
|
|
1214
|
+
`arm: "dwell"` (spring-loading), and `modifiers` let Shift float anywhere and ⌘/Ctrl collapse into the nearest rail (Alt stays free: it unfreezes a frozen layout).
|
|
1208
1215
|
|
|
1209
|
-
A gap, column or rail target exists only where the drop keeps the whole scene sound
|
|
1216
|
+
A gap, column or rail target exists only where the drop keeps the whole scene sound: it adds no `overflow` or
|
|
1210
1217
|
`too-wide` note to any edge, changes no fixed item's form, squeezes none under its `main.min` anywhere (a between bar
|
|
1211
1218
|
under a new column included), and lands its slot on no chrome. The rule compares notes: in an edge that already
|
|
1212
1219
|
overflows (or holds an item already too wide), a drop that adds no new note is accepted, even when it shifts a fixed
|
|
@@ -1233,7 +1240,7 @@ on the other side of `base`'s with `setSide`. `moveTo` and
|
|
|
1233
1240
|
`floatAt` refuse fixed items and kinds the edge or `floatKinds` doesn't list. `moveTo` also takes `{ kind: "column",
|
|
1234
1241
|
side, ring }` (`ring: Infinity` is the side's inner end: "Move to › Dock left"), `{ kind: "rail", side, ring }` (docked
|
|
1235
1242
|
folded) and `{ kind: "float", rect?, anchor? }`. `homeFor(scene, id, start)` is the place a start scene gives the item
|
|
1236
|
-
(the same edge before the same
|
|
1243
|
+
(the same edge before the same neighbor, a new column at its ring when its column is gone, or its float), for Dock,
|
|
1237
1244
|
Put back and Reset position: `moveTo(scene, id, homeFor(scene, id, start)!)`. `dockHome(scene, id, start)` is that and the
|
|
1238
1245
|
start fold too: the item goes to `homeFor`'s place and takes `start`'s `from` (unfolded when `start` has none), so a "Move to ›
|
|
1239
1246
|
rail" (which folds it) followed by Dock brings it back open; the scene is given back unchanged when `start` places it
|
|
@@ -1256,7 +1263,7 @@ gives `base` back with an `error`.
|
|
|
1256
1263
|
|
|
1257
1264
|
## Scene conformance rows
|
|
1258
1265
|
|
|
1259
|
-
`@n-uf/placement/scene/cases` is the Scene's
|
|
1266
|
+
`@n-uf/placement/scene/cases` is the Scene's behavior as data, so an integrating app's test suite and the lab run the same rows. A row
|
|
1260
1267
|
is `{ id, title, expect, scene, settings?, gestures, expectLayout, expectDom? }`: a scene, the stage and freeze it runs
|
|
1261
1268
|
at, what a user does (`press`, `move`, `release`, `key`, `click`, `resize`, `scroll`, `hold`; a `move` may name a target
|
|
1262
1269
|
by its `place` instead of pixels), and what must be true after: a partial layout (per item: `rect`, `formKind`, `edge`,
|
|
@@ -1273,6 +1280,22 @@ that ends in a float gives one. A `move` with no target under the pointer draws
|
|
|
1273
1280
|
place left empty and nothing else moved. A row with `lacks` names a library rule the Scene doesn't have yet and is expected
|
|
1274
1281
|
to fail until it lands. A host reaches the end gaps 24 px (`END_REACH`) past an edge's ends.
|
|
1275
1282
|
|
|
1283
|
+
A window row's stage (`CaseSettings.stage`, a `resize` of the window, the scene's own `stage`) is the window's **body**: the
|
|
1284
|
+
content area inside any canvas padding, so window A's 12 px padding lies inside its 808 px (808 = 12 + 220 + 12 + 320 + 12 +
|
|
1285
|
+
220 + 12), and a host whose own stage leaves its padding out sets its body to the row's stage, with no table. A row's
|
|
1286
|
+
pointer `point`s are body px. The runner clamps every `move` to a `point` into the stage before it reaches the host (the
|
|
1287
|
+
host contract: a pointer past the window's edge means its nearest point of the window, so a drop target at the edge stays
|
|
1288
|
+
under a hand that overshoots it), so every host plays the same point, and a row such as C17 means what the clamped point
|
|
1289
|
+
picks. A row may carry `requires`, what its scene needs of the host's window (`hitBand: "default"`: an open panel's body
|
|
1290
|
+
is no drop place, as in C7 and P5-neighbour-half-facing-it, so a host whose columns use `hitBand: "middle"` skips or marks
|
|
1291
|
+
the row; `rails`: the sides whose rail the scene shows at the start, as in P9-to-the-other-rail); the runner reads none of it.
|
|
1292
|
+
|
|
1293
|
+
A host that names things differently gives `ids`, a row id to its own id (`{ views: "panels", tools: "commands" }`, items and
|
|
1294
|
+
edges, one to one; an id left out keeps its name). The runner hands the host its own ids (the scene, the gestures, `stops`,
|
|
1295
|
+
`itemSelector`) and reads the layout, the stored form and the stops back in the row's, so no expectation changes. One
|
|
1296
|
+
function does both ways (`mapScene`, `mapGesture`, `mapLayout`, `mapStored`, `mapPlace`, each taking a `Rename` that
|
|
1297
|
+
`idRenames(ids)` gives as `to` and `from`), and a host may use them to translate for itself.
|
|
1298
|
+
|
|
1276
1299
|
```ts
|
|
1277
1300
|
import { targetAt } from "@n-uf/motion/drag";
|
|
1278
1301
|
import { CASES, createSceneHost, runCase } from "@n-uf/placement/scene/cases";
|
|
@@ -1291,7 +1314,7 @@ selector under it of the element that draws an item (default `[data-dock-item="<
|
|
|
1291
1314
|
a gesture the row doesn't have fails the row. `createSceneHost()` is the reference: no page, no pointer, no clock, a drag
|
|
1292
1315
|
session that lifts past 4 px, asks `targets` for every target, takes the one under the pointer by its pick rule,
|
|
1293
1316
|
draws the preview from its `after.layout` and commits `after.scene` on release, every solve carrying the layout before
|
|
1294
|
-
it as `previous`.
|
|
1317
|
+
it as `previous`. An integrating app's host does the same with its own pointer; `resolvePlace(targets, place, item, { stage, content
|
|
1295
1318
|
}, pick)` turns a `place` into a point that reaches the target. Every row
|
|
1296
1319
|
passes on the in-memory host except its DOM checks, which it skips, and the rows with `lacks`, which fail on it until the
|
|
1297
1320
|
library rule lands. `CASE_GROUPS` lists the groups.
|
|
@@ -1307,7 +1330,7 @@ played in order:
|
|
|
1307
1330
|
|
|
1308
1331
|
| `type` | What a host does |
|
|
1309
1332
|
|---|---|
|
|
1310
|
-
| `press` | Pointer down on `item`'s
|
|
1333
|
+
| `press` | Pointer down on `item`'s 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. |
|
|
1311
1334
|
| `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. |
|
|
1312
1335
|
| `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`. |
|
|
1313
1336
|
| `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. |
|
|
@@ -1316,7 +1339,7 @@ played in order:
|
|
|
1316
1339
|
| `resize` | With `edge`, the user's size across that edge (`size` px); with `item`, that item's measured length changed by `size` px; with neither, the window is now `point.x` by `point.y`. |
|
|
1317
1340
|
| `scroll` | The pages scroll by `size` px. Nothing in a scene scrolls: only a host with a page can show it, with a DOM `rect` check. |
|
|
1318
1341
|
|
|
1319
|
-
**Driving the rows from a browser runner.**
|
|
1342
|
+
**Driving the rows from a browser runner.** An integrating app's page is driven from outside (Playwright, say) with real pointer
|
|
1320
1343
|
events and timers, so its host's calls are async. `runCaseAsync(row, host)` takes an `AsyncCaseHost`, the same members
|
|
1321
1344
|
as a `CaseHost` but each of `load`, `perform`, `layout`, `root`, `stored` and `stops` may return a promise
|
|
1322
1345
|
(`itemSelector` stays a plain function). It awaits every call, in the same order as `runCase` makes them, and checks the
|
|
@@ -1335,7 +1358,7 @@ const results = await runCasesAsync(CASES, pageHost, { onResult: (id, r) => cons
|
|
|
1335
1358
|
|
|
1336
1359
|
## Pane zones
|
|
1337
1360
|
|
|
1338
|
-
`paneZone(rect, point, previous, options?)` says which of a pane's five zones a point is in: the
|
|
1361
|
+
`paneZone(rect, point, previous, options?)` says which of a pane's five drop zones a point is in: the center rectangle
|
|
1339
1362
|
(34 % of each axis, at least 24 px) or one of four edge trapezoids. The previous zone holds for 6 px past its
|
|
1340
1363
|
boundary. It fits `@n-uf/motion/drag`'s `placeOf(target, point, previous)`: one target per pane, the zone as the
|
|
1341
1364
|
place, and a null place for a zone that takes no drop.
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
RAIL_EDGE,
|
|
4
4
|
clamp,
|
|
5
5
|
rect
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VLTYJHUA.js";
|
|
7
7
|
|
|
8
8
|
// src/panels/model.ts
|
|
9
9
|
var SIDES = ["left", "right"];
|
|
@@ -788,4 +788,4 @@ export {
|
|
|
788
788
|
panelDrop,
|
|
789
789
|
panelStops
|
|
790
790
|
};
|
|
791
|
-
//# sourceMappingURL=chunk-
|
|
791
|
+
//# sourceMappingURL=chunk-3ZICYLWL.js.map
|