@n-uf/placement 26.11.17 → 26.11.18

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,64 @@
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.18
7
+
8
+ - `@n-uf/placement/stack`: **`StackForm.wrap`** (`{ widths, row, gap?, lead? }`, a form of the new group kind `wrap`):
9
+ words in rows that wrap to the cross size the item gets, beside a lead cell (the grip) as a hanging indent. Its length
10
+ is rows × `row`, its natural cross the one-row width, and it fits a cross size when some row width up to it leaves no
11
+ row but the last with a single word; it is laid out at the widest such width, so fitting is monotone (a form that fits
12
+ a cross fits every wider one) and `formCrossMin` is the narrowest width that fits. Give-way, fits, `previous` and growth use the computed length; under `ownCross` it is drawn as wide as
13
+ its rows need. New exports `formMain`, `formCrossMin`, `formFitsCross`, `wrapLines`, `wrapRows`, `wrapCross` and
14
+ `WrapSpec`. **`StackForm.grip`** (px) is a grip strip at a form's start along the stack. Additive: both are optional,
15
+ and a stack without them fits as before.
16
+ - **Type change:** `GroupFormKind` and `StackFormKind` gain `"wrap"`. An exhaustive `switch` over them needs a `wrap`
17
+ case.
18
+ - `@n-uf/placement/scene`, the toolbar rules:
19
+ - A `wrap` form applies only in a column edge, and the layout reports a wrapped item's `rows` and its `grip` rect
20
+ (`SceneItemLayout.rows`, `.grip`). In a column drawn as a rail and in a float with `orient: "column"`, a group skips
21
+ its `wrap` forms and shows its next form (icons) at its natural size (vertical means icons); an item with only
22
+ `wrap` forms left is left out with the new note `no-vertical-form`. Affected: a vertical float of a group whose
23
+ first column form was a `wrap` form is drawn as its icons.
24
+ - **`Edge.compact`**: an icons-only edge (a thin rail of vertical toolbars along a window side). Items take only
25
+ their `icons` form; one without is left out with the new note `no-icons-form`.
26
+ - **`Edge.zoneAccepts`** (and `ColumnTemplate.zoneAccepts`): the kinds each zone takes, narrowing `accepts`. A panel
27
+ column with `{ start: ["panel"], end: ["group"] }` has a tray of toolbars at its foot: a toolbar there takes only
28
+ its `wrap` or `icons` form, never the menu, and the panels give way first. Gaps are offered only in zones that take
29
+ the kind, and `moveTo` puts an item in a zone that takes it. A new column (a `column:` target, a `rail:` target, a
30
+ `moveTo` column or rail place) is offered only for a kind the template's start zone takes, so a group never opens
31
+ such a column. New exports `ZoneAccepts`, `zoneTakes` and `zonesTaking`.
32
+ - **`dockHome(scene, id, start)`**: Dock, Put back and Reset position restore the start scene's fold too, so a
33
+ "Move to › rail" followed by Dock brings an item back open; an item already at its home place (the only item of a
34
+ dynamic column) takes the start fold in place.
35
+ - **Changed** (targets), the hit tiling: an edge's gap hits split halfway between the lines of the gaps a drop fits
36
+ in and together cover the whole edge, short items included (a bar of a few toolbars, a rail, a column's tray); the
37
+ 24 px band (`hitBand`) lies over an open item's body only. A compact rail's hits reach 24 px inward past it, except
38
+ where a column's gap is. A hit lies over a growing fixed item (a title) and lands in the nearest gap, never over a
39
+ fixed item that doesn't grow (controls, a readout) or chrome; a slot never covers a fixed item's reserved rect.
40
+ 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 the
41
+ edge, one beside it at its side; the edges as they are now (not the dragged item's own) trim it at its side too. An
42
+ empty edge's `strip:` hit lies inside the content and clear of overlay edges, so never over a docked edge or a
43
+ panel's body (a compact rail's strip keeps its place at the window edge); a gap hit that spans it trims its ends,
44
+ and it is dropped only when nothing is left (an empty outer bar lying on a non-empty inner one).
45
+ - **Changed** (layout): a side rail shows a column's segments in zone order (start, center, end), as the column shows
46
+ its items.
47
+ - Affected, for scenes that set none of the new options (`wrap`, `compact`, `zoneAccepts`): gap hits on bars and
48
+ rails are longer (they now meet halfway, also over the stretch beside a short item), bands over closed or folded
49
+ items are gone, a title bar's stretch left of its controls and the text of a growing title take drops, columns'
50
+ hits stop at the bars and columns around them, an empty bar's strip covers only the content (no longer the columns'
51
+ tops; gone when an inner bar or an overlay column covers it), an empty column's strip stops at the bars above and
52
+ below it, and a rail with center or end items orders its segments by zone.
53
+ The layout of every scene is otherwise as in 26.11.17.
54
+ - `SceneNote` gains the codes `no-vertical-form` and `no-icons-form`; an exhaustive `switch` over `SceneNote["code"]`
55
+ needs them.
56
+ - New entry **`@n-uf/placement/scene/cases`**: the Scene's behaviour as data. `CASES` (conformance rows: a `Scene`, the
57
+ gestures a user makes and the layout and DOM expected after them), `CASE_GROUPS`, `runCase` and `runCases`, the
58
+ in-memory reference host `createSceneHost()`, the `CaseHost` contract (`load`, `perform`, `layout`, `root?`,
59
+ `itemSelector?`, `stored?`, `stops?`), the gesture constructors `g`, `pickTarget` and `resolvePlace`, so a UI kit's
60
+ suite and the lab run the same rows. A DOM check names an item with `item`, found with the host's `itemSelector(id)`
61
+ (default `[data-dock-item="<id>"]`, `defaultItemSelector`). Pure data and logic, no DOM and no dependencies; a new
62
+ `scene-cases` file in the build, checked by `check-dist` (every row runs on the built code).
63
+
6
64
  ## 26.11.17
7
65
 
8
66
  - `@n-uf/placement/scene` exports `reservedRect(scene, layout, id)`: what a fixed item keeps clear of hits and slots.
package/README.md CHANGED
@@ -50,6 +50,8 @@ without importing each other: a target list from `@n-uf/placement/targets` is ex
50
50
  between bars, columns, overlay edges), each a stack with start, center and end zones, fixed items (a title, window
51
51
  controls), floats clear of every bar and chrome, one `solve` for every rect, one `targets` for every drop target
52
52
  of one item (each carrying the layout a release makes, so the preview is the result), pure changes and a stored form.
53
+ - **`/scene/cases`**: the Scene's behaviour as data: conformance rows (a scene, what a user does, the layout and DOM
54
+ expected after) and `runCase`, which plays one on a host, so a UI kit's suite and the lab run the same rows.
53
55
 
54
56
  Rendering stays in the app: it draws the rects, measures its groups, and feeds pointer samples to a drag intent.
55
57
 
@@ -416,7 +418,7 @@ now.
416
418
 
417
419
  `@n-uf/placement/stack` lays out the items along one edge of a stage: a column (`axis: "column"`, a side region) or a
418
420
  row (`"row"`, a bar). An item is a panel or a control group and declares its forms, largest first. Each form has a
419
- structural `kind` (a panel's `open`, `header`, `rail`, `menu`; a group's `row`, `stacked`, `icons`, `fold`, `menu`), a `main`
421
+ structural `kind` (a panel's `open`, `header`, `rail`, `menu`; a group's `row`, `stacked`, `wrap`, `icons`, `fold`, `menu`), a `main`
420
422
  size along the stack (`min`, `natural`, `grows`) and a `cross` size. `fitStack(input)` picks one form per item and
421
423
  places them; it is not tied to `./panels` columns, and nothing in it is a word.
422
424
 
@@ -451,6 +453,21 @@ places them; it is not tied to `./panels` columns, and nothing in it is a word.
451
453
  form that sets the cross size and has a `cross.min` over the limits' `max` steps down too: in a top bar with `cross.max`
452
454
  40, an open panel with `cross.min` 120 becomes a header instead of being squeezed to 40. Without it such a form is
453
455
  clamped to `max`, whatever its `cross.min`.
456
+ - `StackForm.wrap` (`{ widths, row, gap?, lead? }`, a form of the group kind `wrap`, meant for a column of words): a form
457
+ whose length depends on the cross size it gets. The words flow into rows of at most the stack's cross size, in a box
458
+ beside `lead` (the grip's cell at the start of row one: a hanging indent, every row starts after it, so the grip never
459
+ has a row of its own). A row always takes its first word. Its length is rows × `row`; its natural cross is the one-row
460
+ width (the lead, the words and the gaps), which counts only with `setsCross: true`. It fits a cross size only when
461
+ every word fits beside the lead and no row but the last holds a single word: narrower, it is too wide and takes its
462
+ next form, and its `cross.min` is the narrowest cross where it fits. `main` and `cross` given on such a
463
+ form are ignored. Give-way, fits, `previous` and growth use the computed length, and under `ownCross` it is drawn as
464
+ wide as its rows need. A word group in a column needs an `icons` form after it: a vertical place skips `wrap` forms.
465
+ `wrapLines(spec, cross)` gives the word indexes per row, the widest row and whether the form fits; `wrapRows(spec,
466
+ cross)` the row count; `wrapCross(spec)` the one-row width and the narrowest cross it fits; `formFitsCross(form,
467
+ cross)`, `formCrossMin(form)` and `formMain(form, "min" | "natural", cross)` read any form, wrap or not.
468
+ A word 1 px wider moves nothing else while the rows don't change.
469
+ - `StackForm.grip` (px): a grip at the form's start along the stack, this long (an icons strip's horizontal grip on
470
+ top); `./scene` reports its rect as the item's `grip`. A `wrap` form's grip is its lead cell instead.
454
471
  - `fitStack(input, { previous })` keeps the forms of the fit the stack had before, while they still fit: a change of
455
472
  `used` ages alone (a press on a header) reshapes nothing. Ages decide only who gives way anew (the length shrank, an
456
473
  item was added, or a panel opened: its `from` went down, so it starts over). Growing never re-ranks. When the stack got
@@ -579,8 +596,8 @@ fit and the targets it always gave. Item kinds are the host's; placement only ca
579
596
  item moves it along, as a drop anywhere moves what follows. The solve doesn't depend on where the dragged item is
580
597
  inserted (it counts as the newest, and the give-way order is the same at every gap), so what `onlyFits` leaves is all
581
598
  the gaps or none; `allows` is what tells gaps apart.
582
- - **`StackInput.ownCross`** (default off): an item whose current form is a group kind (`row`, `stacked`, `icons`,
583
- `fold`) is drawn at its own `cross.natural`, clamped to the stack's cross size and from its start edge (the left of a
599
+ - **`StackInput.ownCross`** (default off): an item whose current form is a group kind (`row`, `stacked`, `wrap`, `icons`,
600
+ `fold`) is drawn at its own `cross.natural` (a `wrap` form: as wide as its rows need), clamped to the stack's cross size and from its start edge (the left of a
584
601
  column, the top of a bar), not across the whole stack. Panel kinds (`open`, `header`, `rail`) and the » entry still
585
602
  span it, so every open panel and header fills the column, as wide as the widest open panel. The kind decides, not
586
603
  `setsCross`, which still decides the stack's cross size as before. `cross`, the forms, the notes and the lengths are
@@ -589,7 +606,8 @@ fit and the targets it always gave. Item kinds are the host's; placement only ca
589
606
  true`, so a column of groups is as wide as its widest), then `icons` (28 across, sets nothing: with every group in
590
607
  icons the column is a rail), then `menu`. No `row`: a row of words asks for more than a column has, and the group
591
608
  that keeps it widens the column. With `ownCross` each group is drawn at its own width, also beside a wider open panel.
592
- A bar's group is `row`, `stacked` or `fold`, `icons`, `menu`, as in the toolbar above.
609
+ A bar's group is `row`, `stacked` or `fold`, `icons`, `menu`, as in the toolbar above. A group whose words should wrap to
610
+ the column rather than stand one per line takes `wrap` (above) in place of `stacked`.
593
611
 
594
612
  ```ts
595
613
  const title: StackItem = { id: "title", used: 0, fixed: true, forms: [form("row", 160, 160, 26)] };
@@ -775,6 +793,27 @@ no smaller form never folds either: it reports `overflow` or `too-wide`.
775
793
 
776
794
  **Closed items** keep their place in their edge (or their float rect) but take no room and have no targets.
777
795
 
796
+ **Toolbar shapes.** A group in a column draws its words in rows that wrap to the column: give it the column forms
797
+ `[wrap, icons, menu]` (a `wrap` form from `./stack`; no one-word-per-line `stacked` form). The layout reports a wrapped
798
+ item's `rows` (the word indexes per row; the words wrap beside the grip, a hanging indent) and its `grip` (the lead cell at
799
+ the start of row one; for a form with `StackForm.grip` such as an icons strip, that strip at the form's start along the
800
+ axis). A `wrap` form applies only in a column edge. Vertical means icons: in a column drawn as a rail, and in a float
801
+ with `orient: "column"`, a group skips its `wrap` forms and shows its next form (its icons) at that form's natural size,
802
+ whatever its `from`. An item with only `wrap` forms left has no form there: it is left out with a `no-vertical-form` note,
803
+ so give a word group an `icons` form. A drop's `after()` gives the wrapped rect as the slot.
804
+
805
+ **Compact edges.** `Edge.compact: true` makes a thin rail of vertical toolbars along a window side: its items take only
806
+ their `icons` form (and the » menu after it), stacked, each item's grip the divider. An item with no `icons` form is left
807
+ out of it with a `no-icons-form` note.
808
+
809
+ **Trays.** `Edge.zoneAccepts` (and `ColumnTemplate.zoneAccepts`, for the columns a drop makes) narrows `accepts` per zone:
810
+ the kinds each zone takes, and a zone not listed takes nothing. A panel column with `{ start: ["panel"], end: ["group"] }`
811
+ has its panels at the top and a tray of toolbars at its foot (the end zone, one toolbar per row): a toolbar in the tray
812
+ takes only its `wrap` or `icons` form, never the menu, and the panels give way first. Gaps are offered only in the zones
813
+ 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, and a group never opens such a
814
+ column on its own: an empty edge offers its strip only to the kinds its start zone takes, so a group's drag gets the compact
815
+ rail's strip but none for an empty panel column.
816
+
778
817
  **Columns and rails.** A left or right edge with `column: true` is a dynamic column: drops make it (a `column` place, from
779
818
  `scene.columns[side]`: `accepts`, `cross`, `gap`, `pad`, `menu`), and it is deleted, its side's rings closed up, when it
780
819
  holds no item. On a side with `scene.rails[side]` (`{ width, accepts }`), folded columns show as segments of that side's
@@ -817,25 +856,35 @@ edges without `previous`.
817
856
  - `gap:<edge>:<zone>:<at>` (priority 2) for every edge whose `accepts` lists the item's kind (deny by default), before
818
857
  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
819
858
  fits: not in the » menu, no `overflow`, nothing newly `too-wide`, every fixed item of the edge keeping its form and its
820
- place, and no chrome under its slot. Along the edge the hit follows `Edge.hitBand`: in a column (default 24) a band
821
- that many px around the gap's insertion line, never into a neighbour's band, so the body of a panel away from its
822
- edges is no gap and the pointer falls through to the float target (or to none); in a bar (default `"middle"`) the
823
- edge split halfway between neighbouring lines. Gaps on one line are one target, the first in zone order: when a bar
824
- has no spare length, `center:0` and `end:0` lie on the start zone's last line and merge into that start gap (its id
825
- stays `gap:<edge>:start:<n>`). The first and last reach `endReach` px past the edge's ends. Across, the hit is the
826
- larger of the edge's thickness before and after the drop, and it is cut clear of chrome and of what each fixed item
827
- reserves: its drawn rect, or for a fixed item that grows (a title filling its bar) only its natural rect, placed by
828
- its zone (from its start, from its end in the end zone, centred in the centre zone); `reservedRect(scene, layout, id)`
829
- gives that rect, for a host that marks where nothing may drop. The length it grew by is spare
830
- room: gap hits may lie there, and the drop shrinks it toward its natural size (to its `min` if the room needs it), so
831
- a group moved out of a title bar can always go back while the room allows. A title already at its natural size leaves
832
- no such room. No slot lies over a fixed item's reserved rect. `slot` is the item's rect after the drop and `marker`
833
- the insertion line across the edge.
834
- - `strip:<edge>` (2): an empty accepting edge, a strip `Edge.strip` px deep (default 24) along its side.
859
+ place, and no chrome under its slot. Along the edge the gaps tile it: each hit runs halfway to the neighbouring
860
+ 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
861
+ open item's body (a panel) the hit narrows to `Edge.hitBand` px around its line (default 24), so the middle of a
862
+ panel is no gap and the pointer falls through to the float target (or to none). Gaps on one line are one target, the
863
+ 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
864
+ merge into that start gap (its id stays `gap:<edge>:start:<n>`). The first and last reach `endReach` px past the
865
+ 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
866
+ 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
867
+ the edge, one beside it (a neighbouring column) at its side; the edges as they are now, before the item is lifted,
868
+ trim it at its side too (but the dragged item's own edge). Across, the hit is the larger of the edge's thickness
869
+ before and after the drop; a compact edge's hits reach 24 px further inward, except where another edge's gap is.
870
+ Hits are cut clear of chrome and of every fixed item that doesn't grow (controls, a readout). A fixed item that grows
871
+ (a title filling its bar) takes hits over its text, which land in the nearest gap; it reserves only its natural rect,
872
+ placed by its zone (from its start, from its end in the end zone, centred in the centre zone), and
873
+ `reservedRect(scene, layout, id)` gives that rect, for a host that marks where nothing may drop. The length it grew
874
+ by is spare room: the drop shrinks it toward its natural size (to its `min` if the room needs it), so a group moved
875
+ out of a title bar can always go back while the room allows. No slot lies over a fixed item's reserved rect. `slot`
876
+ is the item's rect after the drop and `marker` the insertion line across the edge.
877
+ - `strip:<edge>` (2): an empty accepting edge, a strip `Edge.strip` px deep (default 24) along its side, inside the
878
+ content and clear of the other edges (overlay ones included), so never over a docked edge or a panel's body: a
879
+ full-width empty bar's strip covers only the content between the columns. A compact rail's strip alone stays at the
880
+ window edge, its own place. A gap hit that spans it across trims its start or end (a bar's strip along the top never
881
+ covers the columns' first gaps); one across its middle is left to the smaller-hit tie-break. With nothing left (an
882
+ empty outer bar on a non-empty inner one, a bar's strip all under an overlay column) it has no target. Only for a
883
+ kind its start zone takes (`Edge.zoneAccepts`).
835
884
  - `float:<id>` (3, free) when `floatKinds` lists the kind: the whole plane, landing with the pointer holding the float
836
885
  at `grab`, clamped and moved clear. It has no fixed `slot`: the slot to draw is
837
886
  `after(point, grab).layout.items[id].rect`, for the pointer at the time.
838
- - `column:<side>:<ring>` (2): a new column on each column line of a side whose template takes the kind (outside the
887
+ - `column:<side>:<ring>` (2): a new column on each column line of a side whose template's start zone takes the kind (outside the
839
888
  outermost open column, between two, inside the innermost, or at the content's edge), 22 px each way.
840
889
  - `rail:<side>:<ring>` (1): docking folded into the side's rail, before each folded column's segments and after the
841
890
  last, or a 10 px strip at the side's outer edge while no rail shows.
@@ -865,10 +914,14 @@ Each target's `after(point, grab)` is `{ scene, layout }`: the scene to commit (
865
914
  side, ring }` (`ring: Infinity` is the side's inner end: "Move to › Dock left"), `{ kind: "rail", side, ring }` (docked
866
915
  folded) and `{ kind: "float", rect?, anchor? }`. `homeFor(scene, id, start)` is the place a start scene gives the item
867
916
  (the same edge before the same neighbour, a new column at its ring when its column is gone, or its float), for Dock,
868
- Put back and Reset position: `moveTo(scene, id, homeFor(scene, id, start)!)`. `lift(scene, id)` is the scene while an
869
- item is held: the item out of every edge and float, and a dynamic column it leaves empty gone (its side's rings closed
870
- up). During a drag a host draws everything else from `solve(lift(scene, id), { previous })`, as if the held item were
871
- gone.
917
+ Put back and Reset position: `moveTo(scene, id, homeFor(scene, id, start)!)`. `dockHome(scene, id, start)` is that and the
918
+ start fold too: the item goes to `homeFor`'s place and takes `start`'s `from` (unfolded when `start` has none), so a "Move to ›
919
+ rail" (which folds it) followed by Dock brings it back open; the scene is given back unchanged when `start` places it
920
+ nowhere. `lift(scene, id)` is the scene while an item is held: the item out of every edge and float, and a dynamic
921
+ column it leaves empty gone (its side's rings closed up). While an item is held, a host draws every item from the shown
922
+ target's `after(point, grab).layout`; with **no target under the pointer** it draws the committed layout with the held
923
+ item's place left empty and nothing else moved (a release there commits nothing). It does not reflow the others with
924
+ `solve(lift(scene, id), { previous })`, which would show a result no drop gives.
872
925
 
873
926
  **Stored form.** `storeScene(scene)` gives `{ v: 1, edges: [{ id, side, ring, items, size?, column? }], floats: [{ id, x, y,
874
927
  width, height, orient?, anchor? }], items: { [id]: { used, kept?, from?, closed?, align?, floatSize? } } }`; no float has a
@@ -881,6 +934,61 @@ its bar), never cut, so a reload lands where it was drawn. Dynamic columns are t
881
934
  `base` lacks is made from `base.columns[side]` at its stored ring, and empty ones are deleted. Anything but version 1
882
935
  gives `base` back with an `error`.
883
936
 
937
+ ## Scene conformance rows
938
+
939
+ `@n-uf/placement/scene/cases` is the Scene's behaviour as data, so a UI kit's suite and the lab run the same rows. A row
940
+ is `{ id, title, expect, scene, settings?, gestures, expectLayout, expectDom? }`: a scene, the stage and freeze it runs
941
+ at, what a user does (`press`, `move`, `release`, `key`, `click`, `resize`, `scroll`, `hold`; a `move` may name a target
942
+ by its `place` instead of pixels), and what must be true after: a partial layout (per item: `rect`, `formKind`, `edge`,
943
+ `floating`, `inMenu`, `rail`…, within a tolerance, 0.5 px by default) and, for a host with a page, DOM checks on the
944
+ session's marks (`data-drag-session` on the root during a drag only, `[data-drag-slot][data-drag-target]` for the slot
945
+ (the attribute holds the target's id), `[data-drag-marker]` for the insertion line, `[data-drag-held]` for the held item).
946
+ A drawn item's element is `[data-dock-item="<id>"]` by default, and a DOM check names it with `item` (not a literal
947
+ selector), optionally pinning its `rect` in stage px; a host that marks items another way gives `itemSelector(id)`. A row
948
+ may also carry `checkpoints`: the layout after an earlier gesture, for what the preview shows while the
949
+ pointer is still down; a checkpoint or DOM check is never read right after a `move`, a `hold` comes first so a host's drag
950
+ intent can settle. `expectStored` pins the stored form (ages, folds, no `pinned` flag) and `expectStops` the places "Move
951
+ to ›" offers, in order. A press's grab (`point`) is the row's: a float lands at the pointer minus the grab, so every press
952
+ that ends in a float gives one. A `move` with no target under the pointer draws the committed layout with the held item's
953
+ place left empty and nothing else moved. A row with `lacks` names a library rule the Scene doesn't have yet and is expected
954
+ to fail until it lands. A host reaches the end gaps 24 px (`END_REACH`) past an edge's ends.
955
+
956
+ ```ts
957
+ import { CASES, createSceneHost, runCase } from "@n-uf/placement/scene/cases";
958
+
959
+ const row = CASES.find((c) => c.id === "C1")!; // the drop preview is the rect the item gets
960
+ const result = runCase(row, createSceneHost());
961
+ console.log(result.ok, result.failures, result.skipped.length); // true [] 6
962
+ ```
963
+
964
+ `runCase(row, host)` loads the scene, performs the gestures in order and compares; it returns `{ ok, failures, skipped }`.
965
+ A host is `{ load(scene, settings), perform(gesture), layout(), root?(), itemSelector?(id), stored?(), stops?(item) }`:
966
+ `layout()` is what the page draws now (during a drag, the target's `after.layout`, the preview), `root()` is its root,
967
+ anything with `getAttribute` and `querySelectorAll` (and `getBoundingClientRect` for rect checks), `itemSelector(id)` the
968
+ selector under it of the element that draws an item (default `[data-dock-item="<id>"]`, also exported as
969
+ `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
970
+ a gesture the row doesn't have fails the row. `createSceneHost()` is the reference: no page, no pointer, no clock, a drag
971
+ session that lifts past 4 px, asks `targets` for every target, takes the most precise one under the pointer (`pickTarget`:
972
+ the lowest priority number, then the smallest hit), draws the preview from its `after.layout` and commits `after.scene` on
973
+ release, every solve carrying the layout before it as `previous`. A kit's host does the same with its own pointer;
974
+ `resolvePlace(targets, place, item, { stage, content })` turns a `place` into a point that reaches the target. Every row
975
+ passes on the in-memory host except its DOM checks, which it skips, and the rows with `lacks`, which fail on it until the
976
+ library rule lands. `CASE_GROUPS` lists the groups.
977
+
978
+ **The gesture grammar.** A row's `gestures` are plain objects (`g.press(...)` and the other `g` constructors build them),
979
+ played in order:
980
+
981
+ | `type` | What a host does |
982
+ |---|---|
983
+ | `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. |
984
+ | `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. |
985
+ | `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`. |
986
+ | `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. |
987
+ | `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. |
988
+ | `click` | The item's controls, not a drag. With neither `key` nor `place` it activates the item (a closed one opens, one folded by hand unfolds, a float rises). With `key`: `"use"`, `"open"`, `"close"`, `"fold"`, `"unfold"`, `"float"` or `"dock"` (`dockHome`: where the loaded scene had it). With `place`, the "Move to ›" row for that place. |
989
+ | `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`. |
990
+ | `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. |
991
+
884
992
  ## Pane zones
885
993
 
886
994
  `paneZone(rect, point, previous, options?)` says which of a pane's five zones a point is in: the centre rectangle