@n-uf/placement 26.11.52 → 26.11.54

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +89 -1
  2. package/README.md +27 -58
  3. package/dist/{chunk-VLTYJHUA.js → chunk-2UVUFEBP.js} +4 -8
  4. package/dist/{chunk-VLTYJHUA.js.map → chunk-2UVUFEBP.js.map} +1 -1
  5. package/dist/{geometry-Bf37LbCT.d.ts → geometry-L5gCoiZV.d.ts} +2 -8
  6. package/dist/index.d.ts +64 -42
  7. package/dist/index.js +6 -66
  8. package/dist/index.js.map +1 -1
  9. package/dist/popup.d.ts +49 -0
  10. package/dist/popup.js +58 -0
  11. package/dist/popup.js.map +1 -0
  12. package/dist/stack.d.ts +529 -228
  13. package/dist/stack.js +701 -28
  14. package/dist/stack.js.map +1 -1
  15. package/dist/tiling.d.ts +48 -5
  16. package/dist/tiling.js +198 -19
  17. package/dist/tiling.js.map +1 -1
  18. package/package.json +9 -36
  19. package/dist/chunk-2GGJ4GVR.js +0 -9
  20. package/dist/chunk-2GGJ4GVR.js.map +0 -1
  21. package/dist/chunk-3ZICYLWL.js +0 -791
  22. package/dist/chunk-3ZICYLWL.js.map +0 -1
  23. package/dist/chunk-67D32MZ4.js +0 -4178
  24. package/dist/chunk-67D32MZ4.js.map +0 -1
  25. package/dist/chunk-AE3BWTAE.js +0 -838
  26. package/dist/chunk-AE3BWTAE.js.map +0 -1
  27. package/dist/chunk-JVAR67OL.js +0 -172
  28. package/dist/chunk-JVAR67OL.js.map +0 -1
  29. package/dist/chunk-NF7RYK3U.js +0 -429
  30. package/dist/chunk-NF7RYK3U.js.map +0 -1
  31. package/dist/chunk-R3AAANRY.js +0 -220
  32. package/dist/chunk-R3AAANRY.js.map +0 -1
  33. package/dist/chunk-TWI644JK.js +0 -221
  34. package/dist/chunk-TWI644JK.js.map +0 -1
  35. package/dist/constructions-Cbz7uEAZ.d.ts +0 -251
  36. package/dist/desk.d.ts +0 -51
  37. package/dist/desk.js +0 -111
  38. package/dist/desk.js.map +0 -1
  39. package/dist/dock.d.ts +0 -25
  40. package/dist/dock.js +0 -397
  41. package/dist/dock.js.map +0 -1
  42. package/dist/float-fit-DCYxRMru.d.ts +0 -37
  43. package/dist/lanes-DIwUqchd.d.ts +0 -1321
  44. package/dist/model-X7eUaKlA.d.ts +0 -337
  45. package/dist/panels.d.ts +0 -60
  46. package/dist/panels.js +0 -99
  47. package/dist/panels.js.map +0 -1
  48. package/dist/regions-Db_RyT4P.d.ts +0 -48
  49. package/dist/scene-cases.d.ts +0 -888
  50. package/dist/scene-cases.js +0 -3149
  51. package/dist/scene-cases.js.map +0 -1
  52. package/dist/scene.d.ts +0 -290
  53. package/dist/scene.js +0 -128
  54. package/dist/scene.js.map +0 -1
  55. package/dist/target-BBOCeez2.d.ts +0 -69
  56. package/dist/targets-C9ZVhmCl.d.ts +0 -621
  57. package/dist/targets.d.ts +0 -212
  58. package/dist/targets.js +0 -447
  59. package/dist/targets.js.map +0 -1
  60. package/dist/toolbar.d.ts +0 -167
  61. package/dist/toolbar.js +0 -55
  62. package/dist/toolbar.js.map +0 -1
@@ -1,888 +0,0 @@
1
- import { P as Point, R as Rect } from './geometry-Bf37LbCT.js';
2
- import { S as StackFormKind } from './model-X7eUaKlA.js';
3
- import { S as Scene, a as ScenePlace, b as SceneLayout, c as StoredScene, Z as Zone, d as Side, e as SceneNoteCode, f as SceneTarget, g as SceneRefusal, L as LaneOptions, R as Regions } from './lanes-DIwUqchd.js';
4
- import './target-BBOCeez2.js';
5
-
6
- /**
7
- * The conformance rows' shapes. A row is plain data: a scene, the settings it runs at, the gestures a user makes, and
8
- * what the layout (and, in a host with a page, the DOM) must be after them. `runCase(row, host)` (./run) plays a row on
9
- * a `CaseHost`; the in-memory host (./host) is the reference, and an integrating app's host is one more. Nothing here names a DOM
10
- * type: a page's root only has to answer `getAttribute` and `querySelectorAll`, which every DOM element does.
11
- */
12
-
13
- /** How a row is grouped (the lab's case browser and an integrating app's report list rows by it). */
14
- type CaseGroup = "panels" | "groups" | "drag" | "floats" | "bars" | "previous" | "kinds" | "bands" | "gestures" | "window-a" | "window-b";
15
- /** The settings a row runs at. `stage` replaces the scene's stage with `{ x: 0, y: 0, width: w, height: h }`. */
16
- interface CaseSettings {
17
- readonly stage?: {
18
- readonly w: number;
19
- readonly h: number;
20
- };
21
- /** Frozen: nothing lifts, unless Alt is held (`key: "Alt"`). */
22
- readonly frozen?: boolean;
23
- }
24
- type GestureType = "press" | "move" | "release" | "key" | "click" | "resize" | "scroll" | "hold";
25
- /**
26
- * One thing a user does, in the order they do it. Every field but `type` is optional; which ones count depends on the
27
- * type:
28
- *
29
- * - `press`: pointer down on `item`'s handle (its grip, or its header). `point` is where, relative to the item's
30
- * top-left corner: the GRAB. It is the row's, not the host's: a float lands at the pointer minus the grab, so every
31
- * press that ends in a float gives one (a host's own default may differ, and no row may depend on it). Nothing lifts yet.
32
- * - `move`: the pointer moves, to `point` (stage px) or to the target at `place` (a host aims at the target's hit by its
33
- * place, with `resolvePlace`). With an item pressed, the first move past the lift threshold lifts it (a `place` always
34
- * lifts), and the pointer is then over whichever target the host's pick rule (`PickRule`) finds. Without a press it only moves. With no
35
- * target under the pointer the page draws the committed layout with the held item's place left empty, and nothing else
36
- * moves (a release there commits nothing). A host reaches the end gaps `END_REACH` (24) px past an edge's ends: that is
37
- * required of it, since the rows aim there.
38
- * A checkpoint or DOM check is never read right after a `move`: a `hold` comes first, so a host with a drag intent can
39
- * settle on its target (hysteresis) before the page is read.
40
- * - `release`: pointer up. After a lift it drops on the target under the pointer (a `home` or `none` target, or no
41
- * target, drops nothing); without one it was a press and nothing changes.
42
- * - `key`: `"Escape"` cancels the drag, `"Alt"` holds Alt down and `"Alt:up"` lets it go (frozen windows move while it is
43
- * down), `"Reload"` stores the scene, throws the in-memory one away and reads it back, as a page reload does.
44
- * - `click`: the item's controls, not a drag. With neither `key` nor `place` it activates the item: a closed item opens,
45
- * one folded by hand (a rail tab, a header's caret) unfolds, a float rises; the first two count as a use. With `key`,
46
- * the named control: `"use"` (a use and nothing else: the item is now the newest), `"open"`, `"close"`, `"fold"`,
47
- * `"unfold"`, `"float"` (the menu's Float: its last size, anchored to the content), `"dock"` (Dock, Put back, Reset
48
- * position: where the loaded scene had it). With `place`, the "Move to ›" row for that place (one of `stops`; for the
49
- * float place it is the menu's Float, as with `"float"`). A frozen window refuses `"float"`, `"dock"` and "Move to ›"
50
- * unless Alt is down.
51
- * - `resize`: with `edge`, the user's size across that edge (`size` px; `resize` in `./scene`). With `item`, that item's
52
- * measured length grew by `size` px (a count gained digits; a negative `size` shrinks it): its largest form along the
53
- * axis it lies along. With neither, the window is now `point.x` by `point.y`.
54
- * - `scroll`: the pages scroll by `size` px. Nothing in a scene scrolls, so nothing moves; only a host with a page can
55
- * show that (a DOM `rect` check), the in-memory host has nothing to scroll.
56
- * - `hold`: the pointer rests for `ms`. Hosts with a clock let the drag intent settle; the in-memory host has none.
57
- */
58
- interface Gesture {
59
- readonly type: GestureType;
60
- readonly item?: string;
61
- readonly place?: ScenePlace;
62
- readonly point?: Point;
63
- readonly key?: string;
64
- readonly edge?: string;
65
- readonly size?: number;
66
- readonly ms?: number;
67
- }
68
- /** What one item's layout must be. Every field is optional: a row pins only what its case is about. */
69
- interface ItemExpect {
70
- /** Any of x, y, width, height, within the tolerance. */
71
- readonly rect?: Partial<Rect>;
72
- readonly formKind?: StackFormKind;
73
- /** The index of the form it took. */
74
- readonly form?: number;
75
- /** The edge it is docked in; `null`: docked nowhere (a float, or in the » menu of no edge). */
76
- readonly edge?: string | null;
77
- readonly zone?: Zone;
78
- readonly floating?: boolean;
79
- readonly inMenu?: boolean;
80
- /** The side whose rail draws it as a segment; `null`: in no rail. */
81
- readonly rail?: Side | null;
82
- readonly folded?: "hand" | "auto" | null;
83
- /** The column it rides on (`handFold: "ride"`). */
84
- readonly rides?: string | null;
85
- readonly tab?: boolean;
86
- }
87
- /** What an edge must be. */
88
- interface EdgeExpect {
89
- readonly rect?: Partial<Rect>;
90
- /** Its size across. */
91
- readonly cross?: number;
92
- /** The ids drawn as rail tabs, in order. */
93
- readonly tabs?: readonly string[];
94
- /** The ids in its » menu, in order; `null`: it has none. */
95
- readonly menu?: readonly string[] | null;
96
- }
97
- /** What a layout must be (partial: only what is named is compared). */
98
- interface LayoutExpect {
99
- /** Per item id. `null`: the item is not in the layout at all (a lifted one, a closed one). */
100
- readonly items?: Readonly<Record<string, ItemExpect | null>>;
101
- readonly edges?: Readonly<Record<string, EdgeExpect | null>>;
102
- /** What is left for the pages. */
103
- readonly content?: Partial<Rect>;
104
- /** The least the content may be (`contentMin`'s thresholds: "at least 320 px wide"). */
105
- readonly contentAtLeast?: {
106
- readonly width?: number;
107
- readonly height?: number;
108
- };
109
- /** Per edge id: the ids docked in it (not in its » menu), in order along it. */
110
- readonly order?: Readonly<Record<string, readonly string[]>>;
111
- /** Per side: the members of each open dynamic column, outer column first, each in order down it. */
112
- readonly columns?: Readonly<Partial<Record<"left" | "right", readonly (readonly string[])[]>>>;
113
- /** Per side: the ids drawn as segments of its rail, in order. */
114
- readonly rails?: Readonly<Partial<Record<"left" | "right", readonly string[]>>>;
115
- /** The floats drawn, in stacking order (the last on top). */
116
- readonly floats?: readonly string[];
117
- /** Notes by code: all of `has` present, none of `hasNot`, and with `none` no notes at all. */
118
- readonly notes?: {
119
- readonly has?: readonly SceneNoteCode[];
120
- readonly hasNot?: readonly SceneNoteCode[];
121
- readonly none?: boolean;
122
- };
123
- /** px; default 0.5. */
124
- readonly tolerance?: number;
125
- }
126
- /**
127
- * What a page's DOM must be. The elements are the session's: `data-drag-session="<kind>"` on the root during a drag
128
- * only, `[data-drag-slot][data-drag-target]` for the slot (the attribute holds the target's id), `[data-drag-marker]`
129
- * for the insertion line, `[data-drag-held]` for the held item, `[data-drag-refusal]` for a refusal shown at the pointer
130
- * ("Can't go here", never a mark over the refused place; the attribute holds the refusal's id). A drawn item's element is found by `item`: the host's
131
- * `itemSelector(id)`, by default `[data-dock-item="<id>"]` (a rect check reads it).
132
- */
133
- interface DomCheck {
134
- /** After which gesture (its index) it is checked; default: after the last one. */
135
- readonly at?: number;
136
- /** A selector under the root; omitted (and no `item`): the root itself. */
137
- readonly select?: string;
138
- /** The element of this item, found with the host's `itemSelector` (never together with `select`). */
139
- readonly item?: string;
140
- /** How many elements match: a number, or a range. Default: at least one when `select` is given. */
141
- readonly count?: number | {
142
- readonly min?: number;
143
- readonly max?: number;
144
- };
145
- /** Attribute values on every match; `null` means the attribute is absent. */
146
- readonly attr?: Readonly<Record<string, string | null>>;
147
- /**
148
- * The matched element's rect in stage px (relative to the root's top-left corner), any of x, y, width, height, within
149
- * `tolerance` (default 0.5 px): what a float that never scrolls with the pages, or a slot, really measures on screen.
150
- */
151
- readonly rect?: Partial<Rect>;
152
- readonly tolerance?: number;
153
- /** What the check is about, for the failure line. */
154
- readonly note?: string;
155
- }
156
- /**
157
- * The layout after one gesture (by index), before the later ones are played. After a `move` it is read only once a `hold`
158
- * has followed (so a checkpoint's `at` is never a `move`).
159
- */
160
- interface Checkpoint {
161
- readonly at: number;
162
- readonly layout?: LayoutExpect;
163
- readonly note?: string;
164
- }
165
- /**
166
- * What a row's scene needs of the host's window: a host that can't meet it skips the row or marks it. The runner reads
167
- * only `docks` (against `CaseHost.dockMinWidth`); the rest is data for the host's suite.
168
- */
169
- interface CaseRequires {
170
- /** The scene's columns use the default `hitBand` (an open panel's body is no drop place); a host whose columns use `"middle"` gets card halves there. */
171
- readonly hitBand?: "default";
172
- /** The sides whose rail the scene declares (`Scene.rails`) and shows at the start (a folded column puts panels in it), so a host needs a rail to aim at there. */
173
- readonly rails?: readonly ("left" | "right")[];
174
- /**
175
- * The host drags with a drag intent (`@n-uf/motion/drag`'s `createDragIntent`, or one with its timing): the row checks
176
- * what the intent adds to the pick at a point (a shown target held a band's width past its hit while the pointer
177
- * rests there). A host that picks at the point alone, the in-memory reference host among them, skips the row.
178
- */
179
- readonly intent?: true;
180
- /**
181
- * The scene's own rail drop policy (`Scene.railDrop`, as the row gives it, often none): the row aims at a pixel whose
182
- * meaning depends on whether a rail drop strip lies over the window's edge. A host that lays its own strips (its own
183
- * `railDrop`) skips the row; rows that only mean a place aim by place and need no such precondition.
184
- */
185
- readonly railDrop?: "scene";
186
- /**
187
- * The row's expected outcome depends on panels being docked (columns or rails, an order along an edge, a docked
188
- * panel's place, rect or form, the content beside docked panels, floats that leave a panel out). `CASES` sets it by
189
- * one rule (`needsDocks`); a row may state it, true or false, to override. The runner skips a row with it on a host
190
- * whose `dockMinWidth` is above the row's stage width.
191
- */
192
- readonly docks?: boolean;
193
- /**
194
- * The row is a landing row (`LANDING_CASES`): the host drags with a landing model over `lanes()`, from the library
195
- * version `since` on. A host without one, or on an older version, skips it; the skipped count is a ratchet
196
- * (`lanesRatchet`).
197
- */
198
- readonly lanes?: {
199
- readonly since: string;
200
- };
201
- }
202
- interface CaseRow {
203
- /** Generic and stable: an integrating app's suite names rows by it. */
204
- readonly id: string;
205
- readonly title: string;
206
- /** One sentence: what must be true. */
207
- readonly expect: string;
208
- readonly group: CaseGroup;
209
- readonly scene: Scene;
210
- readonly settings?: CaseSettings;
211
- readonly gestures: readonly Gesture[];
212
- /** The layout after every gesture. */
213
- readonly expectLayout: LayoutExpect;
214
- readonly expectDom?: readonly DomCheck[];
215
- /** The layout after earlier gestures, for rows about the preview (a drop's slot while the pointer is still down). */
216
- readonly checkpoints?: readonly Checkpoint[];
217
- /** What the stored form must hold after the last gesture (a host's `stored()`): ages, folds, no `pinned` flag. */
218
- readonly expectStored?: StoredExpect;
219
- /** The places "Move to ›" and the arrow keys offer for an item, in order (a host's `stops(item)`), after gesture `at` (default the last). */
220
- readonly expectStops?: {
221
- readonly item: string;
222
- readonly at?: number;
223
- readonly places: readonly ScenePlace[];
224
- };
225
- /**
226
- * The library rule this row needs and the Scene doesn't have yet. Such a row is expected to fail on the in-memory host
227
- * until the rule lands (then its suite says to remove this), and an integrating app's suite may skip it.
228
- */
229
- readonly lacks?: string;
230
- /** What the scene needs of the host's window (see {@link CaseRequires}); a host that can't meet it skips or marks the row. */
231
- readonly requires?: CaseRequires;
232
- }
233
- /** What a stored form must hold: per item the named fields exactly (`null`: absent), and strings its JSON never contains. */
234
- interface StoredExpect {
235
- readonly items?: Readonly<Record<string, Readonly<Record<string, string | number | boolean | null>>>>;
236
- readonly absent?: readonly string[];
237
- }
238
- /** A page's root, as much of it as the checks read. A DOM element is one. */
239
- interface DomRoot {
240
- getAttribute(name: string): string | null;
241
- querySelectorAll(selector: string): ArrayLike<DomRoot>;
242
- /** Needed only by rect checks; a DOM element's own is one. */
243
- getBoundingClientRect?(): {
244
- readonly left: number;
245
- readonly top: number;
246
- readonly width: number;
247
- readonly height: number;
248
- };
249
- }
250
- /** What a host gives the runner. */
251
- interface CaseHost {
252
- /** Start over with `scene` (the loaded scene is also what `click` `"dock"` puts items back to). */
253
- load(scene: Scene, settings?: CaseSettings): void;
254
- /** Do one gesture. Throws when it can't be done (no such target, no such item): the runner reports it as a failure. */
255
- perform(gesture: Gesture): void;
256
- /** The layout the page draws now: during a drag, the target's `after.layout` (the preview). */
257
- layout(): SceneLayout;
258
- /** The page's root; absent in a host without a page, and then the DOM checks are skipped. */
259
- root?(): DomRoot | null;
260
- /** The selector, under the root, of the element that draws item `id`; default `[data-dock-item="<id>"]`. A DOM check's `item` is aimed with it. */
261
- itemSelector?(id: string): string;
262
- /** The stored form as a reload would read it back; absent: the stored checks are skipped. */
263
- stored?(): StoredScene;
264
- /** The places "Move to ›" offers for an item, in order (the library's `stops` places); absent: the stops check is skipped. */
265
- stops?(item: string): readonly ScenePlace[];
266
- /** The pick rule the host aims with (see {@link PickRule}); the runner never calls it. */
267
- readonly pick?: PickRule;
268
- /**
269
- * The narrowest stage width, px, at which the host docks panels (below it, say, every panel floats or opens as a
270
- * sheet). The runner skips a row that needs docked panels (`requires.docks`) when the row's stage is narrower at any
271
- * point (its start, or a window `resize`), and lists the row in `skipped`. Absent: the host docks at every width.
272
- */
273
- readonly dockMinWidth?: number;
274
- /**
275
- * The host's names for a row's items and edges: row id to host id (`{ views: "panels", tools: "commands" }`). The
276
- * runner passes every id to the host in the host's words (the scene, the gestures, `stops`, `itemSelector`) and reads
277
- * the layout, the stored form and the stops back in the row's, so the row's expectations stay as written. One to one;
278
- * an id left out keeps its name. See `./ids`.
279
- */
280
- readonly ids?: Readonly<Record<string, string>>;
281
- }
282
- /**
283
- * The pick rule: which of `list` the pointer at `point` is over, or null. There is one, `@n-uf/motion/drag`'s
284
- * `targetAt` (the lowest rank, `pickRank`: the priority, a refusal's `REFUSAL_RANK`; then the smallest zone; a rect
285
- * holds its edges exactly, except toward the outside of `bounds`; `hits` all count), and every host passes it:
286
- * placement doesn't import motion, so the host takes the rule as an input. A `move` lands the pointer over the target
287
- * this rule picks, and `resolvePlace` aims with it.
288
- *
289
- * It reads only a candidate's `id`, `priority`, `refuse`, `hit`, `hits` and `bounds`, and gives back one of the
290
- * candidates it was given, so one rule picks among targets, refusal targets (`refusalTargets`) or both.
291
- */
292
- type PickRule = <T extends PickCandidate>(list: readonly T[], point: Point) => T | null;
293
- /** What the pick rule reads of a candidate. */
294
- interface PickCandidate {
295
- readonly id: string;
296
- readonly priority: 1 | 2 | 3;
297
- /** A refusal: it ranks after every target of priority 1 and 2 (`REFUSAL_RANK`). */
298
- readonly refuse?: true;
299
- readonly hit: Rect;
300
- readonly hits?: readonly Rect[];
301
- /** The window's stage, for a refusal and the float: the zone holds only points strictly inside it. */
302
- readonly bounds?: Rect;
303
- }
304
- /**
305
- * A `CaseHost` whose calls may be async (a page a browser runner drives with real pointer events and timers): each of
306
- * `load`, `perform`, `layout`, `root`, `stored` and `stops` may return a promise. `itemSelector` stays a plain value.
307
- * `runCaseAsync` awaits every call.
308
- */
309
- interface AsyncCaseHost {
310
- load(scene: Scene, settings?: CaseSettings): void | Promise<void>;
311
- perform(gesture: Gesture): void | Promise<void>;
312
- layout(): SceneLayout | Promise<SceneLayout>;
313
- root?(): DomRoot | null | Promise<DomRoot | null>;
314
- itemSelector?(id: string): string;
315
- stored?(): StoredScene | Promise<StoredScene>;
316
- stops?(item: string): readonly ScenePlace[] | Promise<readonly ScenePlace[]>;
317
- /** The pick rule the host aims with, a plain value (see {@link PickRule}); the runner never calls it. */
318
- readonly pick?: PickRule;
319
- /** The narrowest stage width at which the host docks panels, as {@link CaseHost.dockMinWidth}. */
320
- readonly dockMinWidth?: number;
321
- /** The host's names for a row's items and edges, as {@link CaseHost.ids}. */
322
- readonly ids?: Readonly<Record<string, string>>;
323
- }
324
- interface CaseResult {
325
- readonly ok: boolean;
326
- readonly failures: string[];
327
- /**
328
- * The checks not run because the host can't (no root, no stored form, no stops): each one's note, or its selector. A
329
- * row skipped whole (it needs docked panels below the host's `dockMinWidth`) is `ok` with one entry that says so.
330
- */
331
- readonly skipped: string[];
332
- }
333
-
334
- /**
335
- * The in-memory reference host: a `CaseHost` with no page, no pointer and no clock, only the scene. It plays gestures
336
- * the way a page's drag session does: a press on a handle, the first move past the lift threshold lifting the item and
337
- * asking `targets` for every drop target, a pointer over the most precise of them (its `pick`: pass
338
- * `@n-uf/motion/drag`'s `targetAt`, the one pick rule), the preview drawn from that target's `after.layout`, and a
339
- * release committing `after.scene`. Every solve carries the layout before it as `previous`. An integrating app's host does the same
340
- * with their own pointer and DOM; the rows are the contract between them.
341
- *
342
- * Also exported: `resolvePlace` (a point that reaches the target at a place, under a pick rule), the pure step a host
343
- * needs to turn a gesture's `place` into a pointer, and the deprecated `pickTarget` (the default pick).
344
- */
345
-
346
- /** The lift threshold: the pointer moves this far (px) from the press before the item lifts. */
347
- declare const LIFT_THRESHOLD = 4;
348
- /** How far past an edge's ends its first and last gaps reach (px); toolbars use 24. */
349
- declare const END_REACH = 24;
350
- /**
351
- * The most precise target under `point`: the lowest rank (`pickRank`: the priority, a refusal's `REFUSAL_RANK`), then
352
- * the smallest zone; null when none is. A target with `hits` is under the point in any of them, and its zone's size is
353
- * theirs together.
354
- *
355
- * @deprecated The pick rule is `@n-uf/motion/drag`'s `targetAt`: pass it as `createSceneHost({ pick: targetAt })` and
356
- * to `resolvePlace`. This is only the reference host's default when none is given (placement doesn't import motion),
357
- * the same rule with the same tolerances: a rect holds its edges exactly, with no epsilon, and a zone's size is the sum
358
- * of width × height over its pieces. A test holds it equal to `targetAt`. Removed in the release that drops the legacy
359
- * entries.
360
- */
361
- declare function pickTarget<T extends {
362
- readonly priority: number;
363
- readonly hit: Rect;
364
- readonly hits?: readonly Rect[];
365
- readonly refuse?: true;
366
- readonly bounds?: Rect;
367
- }>(list: readonly T[], point: Point): T | null;
368
- /**
369
- * The pick rule with the scene's refusals (`refusals(scene, dragged)`), the drag intent's way: the refusals take part in
370
- * the pick as refusal targets (`refusalTargets`), and where one is what the rule picks nothing is picked, so a release
371
- * there commits nothing and the item goes home ("Can't go here"). Every host aims and drops with it: the reference host,
372
- * and a page's host for `resolvePlace`.
373
- */
374
- declare function withRefusals(pick: PickRule, refused: readonly SceneRefusal[]): PickRule;
375
- /** What `resolvePlace` may aim at when a target covers the whole plane (a float): the stage and the content. */
376
- interface AimArea {
377
- readonly stage: Rect;
378
- readonly content?: Rect;
379
- /**
380
- * The dragged item's own rect as drawn (a float's too): a point outside it is preferred, as a person aims, so a drag
381
- * intent's home gate never holds the aim. Default: the hit of the list's `home` target, if any.
382
- */
383
- readonly own?: Rect;
384
- }
385
- /**
386
- * A pointer position that reaches the target at `place`: inside its hit and not covered by a more precise target
387
- * (`pick` finds it there: the host's pick rule, `@n-uf/motion/drag`'s `targetAt`; default the same rule, `pickTarget`).
388
- * It tries the hit's center, then a grid across the hit; a target over the whole plane (the float) is aimed at the
389
- * content's center, then the stage's, then a grid across the stage. Of the points that reach it, the first outside the
390
- * dragged item's own rect (`AimArea.own`) wins whenever one exists. Null when no point reaches it (a gap that a home or
391
- * a blocked spot covers entirely).
392
- */
393
- declare function resolvePlace(list: readonly SceneTarget[], place: ScenePlace, item: string, area_: AimArea, pick?: PickRule): Point | null;
394
- /**
395
- * A `resize` gesture as a pure step, for any host: the scene after it, and the loaded scene (`start`, what `"dock"` puts
396
- * items back to) after it too. With `edge`, the user's size across that edge; with `item`, that item's largest form along
397
- * the axis it lies along in `layout` grew by `size` px (in both scenes: it was measured again); with neither, the window
398
- * is now `point.x` by `point.y`. Throws when the gesture names nothing that exists.
399
- */
400
- declare function resizeStep(scene: Scene, start: Scene, layout: SceneLayout, g: Gesture): {
401
- readonly scene: Scene;
402
- readonly start: Scene;
403
- };
404
- /** What the in-memory host knows about a drag in progress. */
405
- interface HostDrag {
406
- readonly item: string;
407
- /** False between the press and the lift. */
408
- readonly lifted: boolean;
409
- /** The id of the target the pointer is over, or null. */
410
- readonly target: string | null;
411
- readonly point: Point;
412
- /** Where the pointer holds the item, relative to its top-left corner. */
413
- readonly grab: Point;
414
- }
415
- interface SceneHost extends CaseHost {
416
- /** The committed scene (not the preview). */
417
- scene(): Scene;
418
- /** The scene as the host stores it, as a page reload would read it back. */
419
- stored(): StoredScene;
420
- /** The drag in progress, or null. */
421
- drag(): HostDrag | null;
422
- /** The pick rule it aims with: the one in its options, else the default. */
423
- readonly pick: PickRule;
424
- }
425
- interface SceneHostOptions {
426
- /** How far past an edge's ends its end gaps reach, px (default {@link END_REACH}). */
427
- readonly endReach?: number;
428
- /** Px from the press before an item lifts (default {@link LIFT_THRESHOLD}). */
429
- readonly lift?: number;
430
- /** Where a press with no `point` holds the item, px from its top-left corner (default 8, 8). A test varies it to prove no row depends on it. */
431
- readonly grab?: Point;
432
- /**
433
- * The pick rule: which target the pointer is over. Pass `@n-uf/motion/drag`'s `targetAt`, the rule an app's drag intent
434
- * runs, so the reference host and the kit agree on every boundary pixel. Default: the same rule (`pickTarget`).
435
- */
436
- readonly pick?: PickRule;
437
- }
438
- declare function createSceneHost(options?: SceneHostOptions): SceneHost;
439
-
440
- /** The selector of an item's element when the host has no `itemSelector`: `[data-dock-item="<id>"]`. */
441
- declare const defaultItemSelector: (id: string) => string;
442
- /** The ways `layout` differs from `want`, as lines. Empty: it matches. */
443
- declare function layoutIssues(want: LayoutExpect, layout: SceneLayout): string[];
444
- /**
445
- * Plays `row` on `host`: loads its scene at its settings, performs its gestures in order, and checks. A gesture the host
446
- * can't do is a failure and ends the run (what follows would be about another state), and so is a layout the host can't
447
- * give or a check pointing at a gesture the row doesn't have. With no `host.root` the DOM checks are skipped, with no
448
- * `host.stored` the stored checks and with no `host.stops` the stops check; each is listed in `skipped`.
449
- */
450
- declare function runCase(row: CaseRow, host: CaseHost): CaseResult;
451
- /**
452
- * `runCase` for a host whose calls may be async (a page driven from a browser runner, with real pointer events and
453
- * timers): every host call is awaited, in the same order as `runCase` makes them, with the same checks. A rejected call
454
- * counts as a thrown one: a failed `load`, `perform`, `layout` or `stored` is a failed result, as in `runCase`, while a
455
- * rejection or throw from `root` or `stops` rejects `runCaseAsync` (as it throws from `runCase`). A sync `CaseHost`
456
- * works too.
457
- */
458
- declare function runCaseAsync(row: CaseRow, host: AsyncCaseHost | CaseHost): Promise<CaseResult>;
459
- /** Runs every row on a fresh host each (`makeHost`), and returns each row's result by id. */
460
- declare function runCases(rows: readonly CaseRow[], makeHost: () => CaseHost): {
461
- id: string;
462
- result: CaseResult;
463
- }[];
464
- /**
465
- * `runCases` with `runCaseAsync`: one row after another (a page has one pointer), each on a fresh host (`makeHost` may be
466
- * async). `options.onResult` hears each row's result as it is known.
467
- */
468
- declare function runCasesAsync(rows: readonly CaseRow[], makeHost: () => AsyncCaseHost | CaseHost | Promise<AsyncCaseHost | CaseHost>, options?: {
469
- readonly onResult?: (id: string, result: CaseResult) => void;
470
- }): Promise<{
471
- id: string;
472
- result: CaseResult;
473
- }[]>;
474
-
475
- /**
476
- * Short constructors for gestures, so a row reads as what a user does: `g.press("pages")`, `g.to(place)`,
477
- * `g.release()`. Each returns a plain `Gesture`; nothing here is needed to read or play a row.
478
- */
479
-
480
- declare const g: {
481
- /** Pointer down on the item's handle; `point` is relative to its top-left corner. */
482
- press: (item: string, point?: Point) => Gesture;
483
- /** The pointer moves to the target at `place`. */
484
- to: (place: ScenePlace) => Gesture;
485
- /** The pointer moves to `point` (stage px). */
486
- at: (x: number, y: number) => Gesture;
487
- hold: (ms?: number) => Gesture;
488
- release: () => Gesture;
489
- escape: () => Gesture;
490
- key: (key: string) => Gesture;
491
- /** The item's control (`key`), or with none, a click that opens or unfolds it. */
492
- click: (item: string, key?: string) => Gesture;
493
- /** The "Move to ›" row for `place`. */
494
- moveTo: (item: string, place: ScenePlace) => Gesture;
495
- /** The user's size across an edge. */
496
- resizeEdge: (edge: string, size: number) => Gesture;
497
- /** The item's measured length changed by `size` px. */
498
- resizeItem: (item: string, size: number) => Gesture;
499
- /** The stage is now `width` x `height`. */
500
- resizeWindow: (width: number, height: number) => Gesture;
501
- scroll: (dy: number) => Gesture;
502
- /** A place: before the `at`-th item of an edge's zone. */
503
- gap: (edge: string, at: number, zone?: "start" | "center" | "end") => ScenePlace;
504
- column: (side: "left" | "right", ring: number) => ScenePlace;
505
- rail: (side: "left" | "right", ring?: number) => ScenePlace;
506
- float: ScenePlace;
507
- home: ScenePlace;
508
- /** Press, aim at `place`, rest, let go. */
509
- drag: (item: string, place: ScenePlace, grab?: Point) => Gesture[];
510
- };
511
-
512
- /** A row id to the host's id. */
513
- type IdMap = Readonly<Record<string, string>>;
514
- /** One rename of one id. */
515
- type Rename = (id: string) => string;
516
- /** The renames of a map: `to` (a row's id to the host's) and `from` (back); the identity with no map. */
517
- declare function idRenames(ids: IdMap | undefined): {
518
- readonly to: Rename;
519
- readonly from: Rename;
520
- readonly active: boolean;
521
- };
522
- /** A scene with every item and edge id renamed. */
523
- declare function mapScene(s: Scene, f: Rename): Scene;
524
- /** A place with its edge (a `gap` or `side` place) renamed. */
525
- declare function mapPlace(p: ScenePlace, f: Rename): ScenePlace;
526
- /** A gesture with its `item`, `edge` and place renamed. */
527
- declare function mapGesture(g: Gesture, f: Rename): Gesture;
528
- /** A layout with every id renamed (see the module's docs for which). */
529
- declare function mapLayout(l: SceneLayout, f: Rename): SceneLayout;
530
- /** A stored form with every id renamed. */
531
- declare function mapStored(s: StoredScene, f: Rename): StoredScene;
532
-
533
- interface WinSpec {
534
- readonly card: {
535
- readonly min: number;
536
- readonly max: number;
537
- };
538
- /** Space after each side edge and rail, toward the content. */
539
- readonly gap: number;
540
- /** Space kept clear at the stage's left and right edges. */
541
- readonly pad: number;
542
- readonly rail: number;
543
- readonly contentMin: {
544
- readonly width: number;
545
- readonly height: number;
546
- };
547
- /** The folded bar's length. */
548
- readonly barMain: number;
549
- }
550
- /** Window A: wide cards, a 12 px gap and 12 px of padding each side; its stage is the window's body, padding inside. */
551
- declare const WINDOW_A: WinSpec;
552
- /** Window B: narrower cards, flush (no gap, no padding); its stage is the window's body, as A's. */
553
- declare const WINDOW_B: WinSpec;
554
- declare const WINDOW_BARE: WinSpec;
555
- interface WinOptions {
556
- /** The stage's width (default 1120) and height (default 800). */
557
- readonly width?: number;
558
- readonly height?: number;
559
- /** The panels' ids per column, outer column first: `{ left: [["pages", "annotations"]], right: [["findings"]] }` (the default). */
560
- readonly columns?: {
561
- readonly left?: readonly (readonly string[])[];
562
- readonly right?: readonly (readonly string[])[];
563
- };
564
- /** Ages (default pages 1, annotations 2, findings 3); a panel left out of every column isn't in the scene. */
565
- readonly used?: Readonly<Record<string, number>>;
566
- /** First forms allowed: 1 folds a panel by hand. */
567
- readonly from?: Readonly<Record<string, number>>;
568
- readonly handFold?: "bar" | "ride";
569
- /** The user's column width, for every column (stored sizes). */
570
- readonly size?: number;
571
- /** Panels that float, with their rects. */
572
- readonly floats?: readonly {
573
- readonly id: string;
574
- readonly rect: {
575
- x: number;
576
- y: number;
577
- width: number;
578
- height: number;
579
- };
580
- }[];
581
- }
582
- /** A window: dynamic columns on both sides, a rail on each, `contentMin`, padding and gap. */
583
- declare function winScene(spec: WinSpec, o?: WinOptions): Scene;
584
-
585
- /**
586
- * The landing rows: the landing model's properties as conformance rows, played on any host that drags with a landing
587
- * model (`@n-uf/motion/drag`'s `createLandingModel` over `lanes()`). Placement never imports motion: the model comes in
588
- * as an input, the way the pick rule does (`createLandingHost({ landing: createLandingModel })`).
589
- *
590
- * A row is plain data: a scene, the item dragged, a pointer path at a speed (its first point the press, on the item),
591
- * a rest at its end, and what must hold on every frame while the pointer moves, on the last frame, and in the layout
592
- * after the release. A host plays the path at its own frame rate (it must call the model once more after the pointer
593
- * stops, as every frame does) and reports each frame.
594
- *
595
- * Every row carries `requires: { lanes: { since } }`: the first library version with `lanes()`. A host whose library is
596
- * older skips it (its `version`, read by `runLandingCases`); a host without a landing model doesn't run them, and its
597
- * suite counts them all as skipped. The skipped count is a ratchet (`lanesRatchet`): it may only fall, and from `LANES_DEADLINE` (or the breaking release, if that
598
- * comes first) every row must run.
599
- */
600
-
601
- /**
602
- * The first library version with `lanes()`: a landing row's `requires.lanes.since`. 26.11.21 to 26.11.44 shipped
603
- * without it; the release that ships it is 26.11.45 (a test holds it above 26.11.44, and at or below the package's
604
- * version once that is past 26.11.44).
605
- */
606
- declare const LANES_SINCE = "26.11.45";
607
- /**
608
- * The first library version whose `lanes()` takes the grab (`LaneOptions.grab`): the rows that bring an item back to
609
- * its press point need it, and a host must pass the grab to `lanes()` for them to pass.
610
- */
611
- declare const GRAB_SINCE = "26.11.46";
612
- /**
613
- * The first library version whose grab moves no hop past a long neighbor (26.11.46 and 26.11.47 cut two landings far
614
- * apart at the grab too, so a toolbar held by its grip hopped a neighbor early): the grip rows need it.
615
- */
616
- declare const GRIP_SINCE = "26.11.48";
617
- /**
618
- * The first library version where a dock consumes the room it lands in and an item over a neighbor takes its place (the
619
- * neighbor giving way): the rows passing a neighbor that keeps room need it.
620
- */
621
- declare const ROOM_SINCE = "26.11.50";
622
- /**
623
- * The first library version whose stretch is the room a drop makes (a neighbor that steps down to a shorter form to
624
- * make room counts): the rows sliding over such a stretch need it.
625
- */
626
- declare const STEP_SINCE = "26.11.51";
627
- /**
628
- * The first library version whose landing model shows a Near guide only where the pointer can enter the lane
629
- * (`approach.reach` 12 px, no guide over a refused place outside the lane): the rows that check `nearGuides` need it.
630
- */
631
- declare const NEAR_SINCE = "26.11.52";
632
- /**
633
- * The hand rule's floor, px: while a lane holds, the landing lies at least this near the pointer, however close the
634
- * adjacent landings are (`handBound`).
635
- */
636
- declare const HAND_TRAIL = 48;
637
- /** The floor on the single frame before a hop (the next frame holds another spot of the same lane), px. */
638
- declare const HAND_TRAIL_BEFORE_HOP = 56;
639
- /** The margin a landing model keeps past a boundary between two spots before it hops, px: the spot margin. */
640
- declare const HAND_MARGIN = 6;
641
- /**
642
- * The hand rule's bound, px: `max(floor, g / 2 + 6)`, the floor 48 (`HAND_TRAIL`), 56 on the frame before a hop
643
- * (`HAND_TRAIL_BEFORE_HOP`). `g` is the gap along the lane between the facing edges of the two adjacent landings the
644
- * pointer lies between (a sliding spot's landing taken at the end of its range that faces the next spot); 0 where the
645
- * pointer lies over a landing. Placement cuts between two adjacent spots halfway between their landings, and a spot
646
- * changes 6 px (`HAND_MARGIN`) past the cut, so the landing is never further from the pointer than half the gap plus the
647
- * margin. Over a docked item much longer than the held one no landing lies inside it: `g` is about the item's length
648
- * less the held one's, plus a gutter.
649
- */
650
- declare function handBound(gap: number, beforeHop?: boolean): number;
651
- /**
652
- * How near a lane's rect the pointer is in open space for a Near guide of that lane to show, px: the landing model's
653
- * default `approach.reach`, the entry margin (`LANDING_MARGINS.exit`). A host that sets a larger `approach.reach` does not
654
- * play the rows that check `nearGuides`.
655
- */
656
- declare const NEAR_REACH = 12;
657
- /** A hand faster than this, px/ms, may leave a hop that reflows the window for later (the landing model's `step`, 3 px per 8 ms). */
658
- declare const HAND_FAST = 0.375;
659
- /** The last published version without `lanes()`. */
660
- declare const LAST_WITHOUT_LANES = "26.11.44";
661
- /** From this date every landing row runs on every host (or at the breaking release, if that comes first). */
662
- declare const LANES_DEADLINE = "2026-12-31";
663
- type LandingRegionName = "lane" | "open" | "refused" | "nowhere";
664
- /** A landing model, as much of it as a host plays (`@n-uf/motion/drag`'s `createLandingModel` gives one). */
665
- interface LandingModelLike {
666
- update(point: Point, time: number, keys?: {
667
- readonly shift?: boolean;
668
- }): {
669
- readonly region: LandingRegionName;
670
- readonly lane: string | null;
671
- readonly spot: string | null;
672
- readonly landing: Rect | null;
673
- readonly room: boolean;
674
- readonly guides?: readonly LandingCaseGuide[];
675
- readonly pending?: string;
676
- };
677
- release(): {
678
- readonly kind: "spot";
679
- readonly lane: string;
680
- readonly spot: string;
681
- readonly home: boolean;
682
- } | {
683
- readonly kind: "float";
684
- readonly rect: Rect;
685
- } | null;
686
- }
687
- /** What makes a landing model: `createLandingModel`, as an input. */
688
- type LandingRule = (options: {
689
- readonly regions: Regions;
690
- readonly regionsFor: (spot: string) => Regions;
691
- readonly floatLanding: (point: Point) => Rect | null;
692
- readonly home?: {
693
- readonly lane: string;
694
- readonly spot: string;
695
- };
696
- /** Where the press holds the item (a landing model's `grab`): a sliding spot's landing follows the pointer less it. */
697
- readonly grab?: {
698
- readonly x: number;
699
- readonly y: number;
700
- };
701
- readonly placeGuides?: "off" | "near" | "all";
702
- }) => LandingModelLike;
703
- /** A place guide a frame shows: its lane, line, box or hatch, and where. */
704
- interface LandingCaseGuide {
705
- readonly id: string;
706
- readonly lane: string;
707
- readonly kind: "line" | "box" | "hatch";
708
- readonly rect: Rect;
709
- }
710
- /** One frame a host reports: the pointer, whether it is still moving along the path, and the model's answer. */
711
- interface LandingCaseFrame {
712
- readonly t: number;
713
- readonly point: Point;
714
- readonly moving: boolean;
715
- readonly region: LandingRegionName;
716
- readonly lane: string | null;
717
- readonly spot: string | null;
718
- readonly landing: Rect | null;
719
- readonly room: boolean;
720
- /** The place guides shown ("near"), when the host reports them. */
721
- readonly guides?: readonly LandingCaseGuide[];
722
- /** The lane the pointer is inside but hasn't entered yet (the landing model's `pending`), when the host reports it. */
723
- readonly pending?: string;
724
- }
725
- interface LandingCase {
726
- /** Generic and stable. */
727
- readonly id: string;
728
- readonly title: string;
729
- readonly expect: string;
730
- readonly scene: Scene;
731
- readonly item: string;
732
- /** The pointer path, stage px; the first point is the press on the item. */
733
- readonly path: readonly Point[];
734
- /** px/ms. */
735
- readonly speed: number;
736
- /** The pointer rests at the path's end this long before the release, ms. */
737
- readonly rest?: number;
738
- /** On every frame while the pointer moves. */
739
- readonly moving?: {
740
- /** The lane held on every frame (and never anything else). */
741
- readonly lane?: string;
742
- /** Lanes never held. */
743
- readonly notLanes?: readonly string[];
744
- /** Regions never shown. */
745
- readonly notRegions?: readonly LandingRegionName[];
746
- /** Whenever a lane is held, the landing lies within this many px of the pointer. */
747
- readonly trail?: number;
748
- /**
749
- * On the single frame before a hop (the next frame holds another spot of the same lane), this bound instead of
750
- * `trail`. Absent: `trail` on every frame.
751
- */
752
- readonly trailBeforeHop?: number;
753
- /**
754
- * The hand rule: whenever a lane holds, the landing is the nearest landing in its lane to the pointer (up to twice
755
- * the 6 px margin the model keeps past a boundary before it hops: the held landing may be that much farther than
756
- * the one it will hop to), and lies within `handBound` of the pointer: `max(48, g / 2 + 6)` px, the 48 being 56
757
- * on the frame before a hop, where `g` is the gap along the lane between the facing edges of the two adjacent
758
- * landings the pointer lies between. The spots are those `lanes()` gives for the row's scene in the held spot's
759
- * layout (a sliding spot's landings span its range). Landings that overlap or touch the held one (no more than
760
- * half a pixel apart) are its place, not compared with it. In a lane `lanes()` doesn't give, the floor holds
761
- * (`handBound(0)`), and the issue names the lane.
762
- */
763
- readonly hand?: true;
764
- /**
765
- * The landing lies no further from the pointer, at worst, than when the same path is played at `slow` px/ms, plus
766
- * `by` px: a fast hand trails no more than a slow one does, plus what it may trail.
767
- */
768
- readonly trailOverSlow?: {
769
- readonly slow: number;
770
- readonly by: number;
771
- };
772
- /** Places where no guide lies (nothing lands there): a guide touching one of these rects fails. */
773
- readonly noGuideIn?: readonly Rect[];
774
- /**
775
- * The Near guides' rule (`nearGuideIssues`): on every frame that shows a guide of lane L, one of these holds. (a) L
776
- * holds the pointer: a release lands in L, or, on L's own refused stretch, the frame's region is refused with L as
777
- * its lane. (b) L is pending (the frame's `pending`): a release floats or goes home. (c) The pointer is in open
778
- * space within `NEAR_REACH` of L's rect: a release floats. So no Near guide ever shows over a refused place outside
779
- * L. A host that doesn't report guides isn't checked.
780
- */
781
- readonly nearGuides?: true;
782
- /**
783
- * The lane whose guides show changes between two lanes at most this many times along the path (frames that show no
784
- * guide are skipped): at a corner between two lanes the guides never flicker from one to the other.
785
- */
786
- readonly guideSwitches?: number;
787
- };
788
- /** On the last frame before the release. */
789
- readonly end?: {
790
- readonly region: LandingRegionName;
791
- readonly lane?: string | null;
792
- readonly spot?: string; /** The lane pending on the last frame (`null`: none). */
793
- readonly pending?: string | null; /** Where the last frame's landing lies (any of x, y, width, height, within half a pixel). */
794
- readonly landing?: Partial<Rect>;
795
- };
796
- /** The layout after the release. */
797
- readonly layout?: LayoutExpect;
798
- /**
799
- * After the release the item lies where it lay at the press, in the host's own layout: on the same edge, among the
800
- * same items in the same order, at the same rect (within 0.5 px). Checked against the play's `before` (the host's
801
- * layout at the press), else the row's scene as solved: a host whose geometry differs from the row's (its own gaps)
802
- * passes `before`, and no pixel value of the row's window is asserted.
803
- */
804
- readonly home?: true;
805
- readonly requires: CaseRequires & {
806
- readonly lanes: {
807
- readonly since: string;
808
- };
809
- };
810
- }
811
- /** What a host reports for one row: its frames, the layout after the release and, optionally, the layout at the press. */
812
- interface LandingPlay {
813
- readonly frames: readonly LandingCaseFrame[];
814
- readonly layout: SceneLayout;
815
- /** The host's layout at the press (what a row's `home` compares with). Absent: the row's scene as solved. */
816
- readonly before?: SceneLayout;
817
- /** The `stretchPositions` the host asked `lanes()` for (what a row's `hand` reads the spots with). Absent: the library's default. */
818
- readonly stretchPositions?: LaneOptions["stretchPositions"];
819
- }
820
- /** What a host gives the landing runner: one call plays a row's drag and reports its frames and the layout after. */
821
- interface LandingCaseHost {
822
- /** The library version the host runs (`YY.M.R`); a row needing a later one is skipped. Absent: the latest. */
823
- readonly version?: string;
824
- play(row: LandingCase): LandingPlay | Promise<LandingPlay>;
825
- }
826
- interface LandingCaseResult {
827
- readonly id: string;
828
- readonly ok: boolean;
829
- readonly failures: readonly string[];
830
- /** Why the row didn't run, or null. */
831
- readonly skipped: string | null;
832
- }
833
- /**
834
- * The Near guides' rule over `frames` (`LandingCase.moving.nearGuides`): on every frame that shows a guide of lane L,
835
- * (a) L holds the pointer (the frame's lane is L, in its lane or on its own refused stretch), or (b) L is pending, or
836
- * (c) the pointer is in open space within `NEAR_REACH` of L's rect (as `lanes()` gives it for the row's scene). Anything
837
- * else is a guide for a place the pointer cannot enter: over a refused place outside L, or in open space further off.
838
- * The frames of a host that doesn't report guides show none, so nothing is checked. Exported so a sweep of paths can
839
- * check them all with it.
840
- */
841
- declare function nearGuideIssues(row: LandingCase, frames: readonly LandingCaseFrame[], before?: SceneLayout, stretchPositions?: LaneOptions["stretchPositions"]): string[];
842
- /**
843
- * What differs between a row and what its host played. `before` is the host's layout at the press (a row's `home`
844
- * compares with it); absent, the row's scene as solved.
845
- */
846
- declare function landingIssues(row: LandingCase, frames: readonly LandingCaseFrame[], layout: SceneLayout, before?: SceneLayout, stretchPositions?: LaneOptions["stretchPositions"]): string[];
847
- /**
848
- * Plays every row on `host` and says what differs. A row whose `requires.lanes.since` is after the host's `version` is
849
- * skipped (and listed as such); a row that throws fails.
850
- */
851
- declare function runLandingCases(rows: readonly LandingCase[], host: LandingCaseHost): Promise<LandingCaseResult[]>;
852
- /**
853
- * The ratchet on landing rows a host skips (any reason: no landing model, an older library, a row it can't play):
854
- * `skipped` may not exceed the `baseline` the host recorded last, and from `LANES_DEADLINE` (`today`, `YYYY-MM-DD`) or
855
- * at the `breaking` release it must be 0. The issues, none when it holds.
856
- */
857
- declare function lanesRatchet(r: {
858
- readonly skipped: number;
859
- readonly baseline: number;
860
- readonly today: string;
861
- readonly breaking?: boolean;
862
- }): string[];
863
- /**
864
- * The in-memory reference host for landing rows: `lanes()` over the scene as solved, the landing model `landing` makes
865
- * (`createLandingModel`), a frame every 8 ms along the path (and on through the rest, the same point again), and a
866
- * release that commits the spot's or the float's `after(...).scene`.
867
- */
868
- declare function createLandingHost(o: {
869
- readonly landing: LandingRule;
870
- readonly version?: string;
871
- readonly stretchPositions?: LaneOptions["stretchPositions"];
872
- }): LandingCaseHost;
873
- declare const LANDING_CASES: readonly LandingCase[];
874
-
875
- /**
876
- * Every row, in order: the docking cases, the bar cases, the built-in rules, the panel gestures, the two windows. The
877
- * rows that need docked panels carry `requires: { docks: true }` (see `./docks`).
878
- */
879
- declare const CASES: readonly CaseRow[];
880
- /** The groups rows are listed under, in order, with their titles. */
881
- declare const CASE_GROUPS: readonly {
882
- readonly id: CaseGroup;
883
- readonly title: string;
884
- }[];
885
- /** The row with this id, or undefined. */
886
- declare const caseById: (id: string) => CaseRow | undefined;
887
-
888
- export { type AimArea, type AsyncCaseHost, CASES, CASE_GROUPS, type CaseGroup, type CaseHost, type CaseRequires, type CaseResult, type CaseRow, type CaseSettings, type Checkpoint, type DomCheck, type DomRoot, END_REACH, type EdgeExpect, GRAB_SINCE, GRIP_SINCE, type Gesture, type GestureType, HAND_FAST, HAND_MARGIN, HAND_TRAIL, HAND_TRAIL_BEFORE_HOP, type IdMap, type ItemExpect, LANDING_CASES, LANES_DEADLINE, LANES_SINCE, LAST_WITHOUT_LANES, LIFT_THRESHOLD, type LandingCase, type LandingCaseFrame, type LandingCaseGuide, type LandingCaseHost, type LandingCaseResult, type LandingModelLike, type LandingPlay, type LandingRegionName, type LandingRule, type LayoutExpect, NEAR_REACH, NEAR_SINCE, type PickCandidate, type PickRule, ROOM_SINCE, type Rename, STEP_SINCE, type SceneHost, type SceneHostOptions, type StoredExpect, WINDOW_A, WINDOW_B, WINDOW_BARE, type WinOptions, type WinSpec, caseById, createLandingHost, createSceneHost, defaultItemSelector, g, handBound, idRenames, landingIssues, lanesRatchet, layoutIssues, mapGesture, mapLayout, mapPlace, mapScene, mapStored, nearGuideIssues, pickTarget, resizeStep, resolvePlace, runCase, runCaseAsync, runCases, runCasesAsync, runLandingCases, winScene, withRefusals };