@n-uf/placement 26.11.46 → 26.11.48
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 +68 -0
- package/README.md +43 -16
- package/dist/{chunk-A4DQQX7W.js → chunk-IDWMDPY7.js} +160 -17
- package/dist/chunk-IDWMDPY7.js.map +1 -0
- package/dist/{lanes-BFqBNGvs.d.ts → lanes-BcglySmh.d.ts} +51 -14
- package/dist/scene-cases.d.ts +34 -13
- package/dist/scene-cases.js +81 -9
- package/dist/scene-cases.js.map +1 -1
- package/dist/scene.d.ts +2 -2
- package/dist/scene.js +5 -1
- package/package.json +2 -2
- package/dist/chunk-A4DQQX7W.js.map +0 -1
|
@@ -407,7 +407,11 @@ interface Scene {
|
|
|
407
407
|
/**
|
|
408
408
|
* `"nearest"`: a bar's zones (start, center, end) meet halfway between the landing rects either side of each boundary,
|
|
409
409
|
* so the pointer picks the zone whose landing is nearest it. Absent: at thirds of the bar's length (each boundary moved
|
|
410
|
-
* past the cards seen beside it, as now). A declaration, like `foldedColumnDrop`: never stored.
|
|
410
|
+
* past the cards seen beside it, as now). A declaration, like `foldedColumnDrop`: never stored. It moves each zone's
|
|
411
|
+
* extent, so it changes which zone a pointer picks among `targets()` (the hit areas a drag intent reads), and, since a
|
|
412
|
+
* zone left with no room gets no drop, which of a bar's drops exist and where its refused stretches lie. Under a
|
|
413
|
+
* landing model `lanes()` cuts between spots by their landings, not by zones: there it changes which spots and
|
|
414
|
+
* refused stretches a bar has, never the rule that cuts between spots (the cuts follow whichever spots exist).
|
|
411
415
|
*/
|
|
412
416
|
readonly barZones?: "nearest";
|
|
413
417
|
/**
|
|
@@ -1040,9 +1044,10 @@ interface SceneRefusal {
|
|
|
1040
1044
|
* item `Y` in `X|Y` and `Y|Z`), the boundary is that item's middle as drawn (in the held spot's own layout with
|
|
1041
1045
|
* `options.spot`, so a column takes a panel by halves of what is seen). On a bar or a toolbar rail, and between any two
|
|
1042
1046
|
* other spots, it is halfway across the gap between their landings, each in its own layout, so the pointer is at the
|
|
1043
|
-
* landing it picks and a toolbar moved along an occupied lane stays at the hand. On a bar or a toolbar rail
|
|
1044
|
-
*
|
|
1045
|
-
* so a pointer back at its press point picks the item's own place
|
|
1047
|
+
* landing it picks and a toolbar moved along an occupied lane stays at the hand. On a bar or a toolbar rail, two landings
|
|
1048
|
+
* that overlap (spots a pitch apart, the pointer inside both) are cut where the item is held (`options.grab`): halfway
|
|
1049
|
+
* between the points the pointer would hold in each, so a pointer back at its press point picks the item's own place
|
|
1050
|
+
* however far from its middle it was pressed; landings apart are cut halfway across their gap whatever the grab. Cuts are
|
|
1046
1051
|
* kept inside the lane and in order. The spots come from the same generation and filter as `targets()`, so a spot's
|
|
1047
1052
|
* landing is exactly what its drop commits. Spot ids are keyed by the lane, zone and neighboring items, so they survive
|
|
1048
1053
|
* the window resizing and most items opening or moving; virtual lanes are keyed by the column they lie beside, not
|
|
@@ -1081,17 +1086,27 @@ interface LaneRefusal {
|
|
|
1081
1086
|
}
|
|
1082
1087
|
/**
|
|
1083
1088
|
* A place guide's mark, in the lane's layout as drawn: a `line` across the lane between two items that touch (no room
|
|
1084
|
-
*
|
|
1085
|
-
* strokes it),
|
|
1086
|
-
*
|
|
1089
|
+
* between them but the edge's own gap; as thick as their gap allows, up to 2 px, so zero where they meet and the host
|
|
1090
|
+
* strokes it), a `box` over free room the item lands in, and a `hatch` over the part of a neighbor that gives way.
|
|
1091
|
+
* Where the free room is shorter than the item (a lane's end, a gap between items wider than the edge's gap), the spot
|
|
1092
|
+
* there is drawn as it lands: a box over the free room and a hatch over the rest of its landing (the edge of the
|
|
1093
|
+
* neighbor that will move), the two together the landing; with no free room at a lane's end, the hatch alone. A box
|
|
1094
|
+
* over another edge's docked items (an empty side rail over a column's outer strip) is a hatch there too: they move
|
|
1095
|
+
* aside when the lane opens. Never a box or a line over an item drawn there, nor anything over the held one; nothing in
|
|
1096
|
+
* a refused stretch; no two edge lanes' marks overlap (at a corner a lane not drawn gives way to a drawn one, and
|
|
1097
|
+
* between two not drawn the bar owns it; a virtual lane, a new column's line or a declared rail, is drawn over what it
|
|
1098
|
+
* would push). As seen (no `spot`) the lifted item is drawn nowhere, so its own place is free room
|
|
1099
|
+
* in its lane; with `spot`, every lane's marks lie in that spot's layout (the held item there, its room open).
|
|
1087
1100
|
*/
|
|
1088
1101
|
interface LaneMark {
|
|
1089
1102
|
/**
|
|
1090
1103
|
* Stable while the items either side stay: `<lane>/line/<before>|<after>`, `<lane>/box/<before>|<after>` (`#<n>` for a
|
|
1091
|
-
* stretch's later pieces
|
|
1104
|
+
* stretch's later pieces; `:before` or `:after` for the room beside the held item), `<lane>/hatch/<before>|<after>`
|
|
1105
|
+
* (`~2` for the second side), `^` and `$` at the lane's ends; a virtual lane's `<lane>/box/<spot id>`. Key a drawing by
|
|
1106
|
+
* it.
|
|
1092
1107
|
*/
|
|
1093
1108
|
readonly id: string;
|
|
1094
|
-
readonly kind: "line" | "box";
|
|
1109
|
+
readonly kind: "line" | "box" | "hatch";
|
|
1095
1110
|
readonly rect: Rect;
|
|
1096
1111
|
}
|
|
1097
1112
|
interface Lane {
|
|
@@ -1104,6 +1119,11 @@ interface Lane {
|
|
|
1104
1119
|
readonly refused: readonly LaneRefusal[];
|
|
1105
1120
|
/** Its place guides' marks, in the layout as drawn (the held spot's, with `options.spot`). */
|
|
1106
1121
|
readonly marks: readonly LaneMark[];
|
|
1122
|
+
/**
|
|
1123
|
+
* Its rect is its own: a rail drop strip at the window's side (`Scene.railDrop`), which every other target of the drag
|
|
1124
|
+
* gives up. A landing model gives it the pointer inside it over any lane it overlaps (a flush column's edge).
|
|
1125
|
+
*/
|
|
1126
|
+
readonly owns?: true;
|
|
1107
1127
|
}
|
|
1108
1128
|
/** Everything a landing model reads for one drag. */
|
|
1109
1129
|
interface Regions {
|
|
@@ -1133,16 +1153,23 @@ interface LaneOptions extends SceneTargetOptions {
|
|
|
1133
1153
|
* Where the pointer holds the item, from its top left corner as it is now, px (what a target's `after(point, grab)`
|
|
1134
1154
|
* takes): the press's, constant for the drag (each grab is remembered as its own options), and the same in the call
|
|
1135
1155
|
* with `spot`. It counts along the item's own length only (its longer side as it is now): on a bar or a toolbar rail
|
|
1136
|
-
* along that axis the cut between two
|
|
1137
|
-
* (with landings of one length; at the same share of each),
|
|
1138
|
-
*
|
|
1139
|
-
*
|
|
1156
|
+
* along that axis the cut between two overlapping landings lies halfway between the points the pointer would hold in
|
|
1157
|
+
* each (with landings of one length; at the same share of each), kept within half a pitch of their overlap, so a
|
|
1158
|
+
* pointer back at its press point picks the item's own place; landings with a gap between them (either side of a long
|
|
1159
|
+
* neighbor) are cut halfway across it whatever the grab, so the pointer is at the landing it picks (R12). Across the
|
|
1160
|
+
* item, and in a lane across its length (a rail toolbar over a bar), it is the item's middle, as without a grab. Panel columns take a panel by halves of what is drawn either way. Where another lane's band
|
|
1140
1161
|
* overlaps the press point (an empty bar's band over a rail's end) that lane can still take the pointer first.
|
|
1141
1162
|
*/
|
|
1142
1163
|
readonly grab?: {
|
|
1143
1164
|
readonly x: number;
|
|
1144
1165
|
readonly y: number;
|
|
1145
1166
|
};
|
|
1167
|
+
/**
|
|
1168
|
+
* How an empty lane's marks draw it (an empty bar or side rail, or a virtual lane, its room not open): `"real"` (the
|
|
1169
|
+
* default), boxes at the size it will take, lying over what moves aside (the page, a column); `"edge"`, each a thin
|
|
1170
|
+
* striped strip (`HATCH_EDGE`) on its window side. Where it lands is the same either way.
|
|
1171
|
+
*/
|
|
1172
|
+
readonly emptyLanes?: "real" | "edge";
|
|
1146
1173
|
}
|
|
1147
1174
|
/**
|
|
1148
1175
|
* The lanes and regions of a drag of `dragged`: every lane that takes it with its spots and stretches, the refused
|
|
@@ -1151,5 +1178,15 @@ interface LaneOptions extends SceneTargetOptions {
|
|
|
1151
1178
|
* worked out again, in that spot's own layout.
|
|
1152
1179
|
*/
|
|
1153
1180
|
declare function lanes(scene: Scene, dragged: string, options?: LaneOptions): Regions;
|
|
1181
|
+
/**
|
|
1182
|
+
* The striped end inside a box whose room partly fits, px: a cue that the neighbor there gives way, never a measure
|
|
1183
|
+
* (about 6 px drawn, inside a box a host insets 2 px).
|
|
1184
|
+
*/
|
|
1185
|
+
declare const HATCH_END = 8;
|
|
1186
|
+
/**
|
|
1187
|
+
* A striped column edge's thickness, px: where an empty lane's band lies over items that move aside when it opens
|
|
1188
|
+
* (about 6 px drawn, 2 px clear of the window's edge).
|
|
1189
|
+
*/
|
|
1190
|
+
declare const HATCH_EDGE = 8;
|
|
1154
1191
|
|
|
1155
|
-
export { type
|
|
1192
|
+
export { type SceneEdgeLayout as $, type LaneRefusal as A, type LaneSpot as B, type ColumnPlace as C, DEFAULT_FLOAT_SIZE as D, type Edge as E, type FloatAnchorAt as F, RAIL_MODES as G, HATCH_EDGE as H, RAIL_STRIP_MIN as I, RAIL_VISIBILITIES as J, type Kind as K, type Lane as L, type RailDropPolicy as M, type RailPlace as N, type Orient as O, type Place as P, type RailSpec as Q, type Regions as R, type Scene as S, type RailVisibility as T, type ResizeEdges as U, type ResizeLimit as V, SIDES as W, SPOT_PITCH as X, type SceneAfter as Y, type Zone as Z, type SceneChrome as _, type ScenePlace as a, type SceneFloat as a0, type SceneItemLayout as a1, type SceneNote as a2, type SceneRailLayout as a3, type SceneRead as a4, type StoredSceneEdge as a5, type StoredSceneFloat as a6, type StoredSceneItem as a7, ZONES as a8, canFold as a9, close as aa, dockHome as ab, fitResize as ac, floatAt as ad, fold as ae, homeFor as af, keep as ag, lanes as ah, lift as ai, mergeSideColumns as aj, moveTo as ak, open as al, orient as am, raise as an, readScene as ao, resize as ap, setRailMode as aq, setSide as ar, storeScene as as, use as at, type SceneLayout as b, type StoredScene as c, type Side as d, type SceneNoteCode as e, type SceneTarget as f, type SceneRefusal as g, type FloatAnchor as h, type ZoneAccepts as i, type SceneItem as j, type RailMode as k, type SolveOptions as l, type SceneTargetOptions as m, type ColumnTemplate as n, DEFAULT_HIT_BAND as o, DEFAULT_RAIL_MAGNET as p, DEFAULT_STRIP as q, type DockPlace as r, EDGE_ROOM_HOLD as s, FLOAT_ANCHORS as t, type FloatAnchorOffset as u, type FloatPlace as v, type FloatResize as w, HATCH_END as x, type LaneMark as y, type LaneOptions as z };
|
package/dist/scene-cases.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as Point, R as Rect } from './geometry-Bf37LbCT.js';
|
|
2
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, R as Regions } from './lanes-
|
|
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, R as Regions } from './lanes-BcglySmh.js';
|
|
4
4
|
import './target-BBOCeez2.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -609,6 +609,11 @@ declare const LANES_SINCE = "26.11.45";
|
|
|
609
609
|
* its press point need it, and a host must pass the grab to `lanes()` for them to pass.
|
|
610
610
|
*/
|
|
611
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";
|
|
612
617
|
/** The last published version without `lanes()`. */
|
|
613
618
|
declare const LAST_WITHOUT_LANES = "26.11.44";
|
|
614
619
|
/** From this date every landing row runs on every host (or at the breaking release, if that comes first). */
|
|
@@ -647,11 +652,11 @@ type LandingRule = (options: {
|
|
|
647
652
|
};
|
|
648
653
|
readonly placeGuides?: "off" | "near" | "all";
|
|
649
654
|
}) => LandingModelLike;
|
|
650
|
-
/** A place guide a frame shows: its lane, line or
|
|
655
|
+
/** A place guide a frame shows: its lane, line, box or hatch, and where. */
|
|
651
656
|
interface LandingCaseGuide {
|
|
652
657
|
readonly id: string;
|
|
653
658
|
readonly lane: string;
|
|
654
|
-
readonly kind: "line" | "box";
|
|
659
|
+
readonly kind: "line" | "box" | "hatch";
|
|
655
660
|
readonly rect: Rect;
|
|
656
661
|
}
|
|
657
662
|
/** One frame a host reports: the pointer, whether it is still moving along the path, and the model's answer. */
|
|
@@ -690,6 +695,11 @@ interface LandingCase {
|
|
|
690
695
|
readonly notRegions?: readonly LandingRegionName[];
|
|
691
696
|
/** Whenever a lane is held, the landing lies within this many px of the pointer. */
|
|
692
697
|
readonly trail?: number;
|
|
698
|
+
/**
|
|
699
|
+
* On the single frame before a hop (the next frame holds another spot of the same lane), this bound instead of
|
|
700
|
+
* `trail` (R12: 48 px, 56 on that frame). Absent: `trail` on every frame.
|
|
701
|
+
*/
|
|
702
|
+
readonly trailBeforeHop?: number;
|
|
693
703
|
/**
|
|
694
704
|
* The landing lies no further from the pointer, at worst, than when the same path is played at `slow` px/ms, plus
|
|
695
705
|
* `by` px: a fast hand trails no more than a slow one does, plus what it may trail.
|
|
@@ -709,23 +719,31 @@ interface LandingCase {
|
|
|
709
719
|
};
|
|
710
720
|
/** The layout after the release. */
|
|
711
721
|
readonly layout?: LayoutExpect;
|
|
722
|
+
/**
|
|
723
|
+
* After the release the item lies where it lay at the press, in the host's own layout: on the same edge, among the
|
|
724
|
+
* same items in the same order, at the same rect (within 0.5 px). Checked against the play's `before` (the host's
|
|
725
|
+
* layout at the press), else the row's scene as solved: a host whose geometry differs from the row's (its own gaps)
|
|
726
|
+
* passes `before`, and no pixel value of the row's window is asserted.
|
|
727
|
+
*/
|
|
728
|
+
readonly home?: true;
|
|
712
729
|
readonly requires: CaseRequires & {
|
|
713
730
|
readonly lanes: {
|
|
714
731
|
readonly since: string;
|
|
715
732
|
};
|
|
716
733
|
};
|
|
717
734
|
}
|
|
735
|
+
/** What a host reports for one row: its frames, the layout after the release and, optionally, the layout at the press. */
|
|
736
|
+
interface LandingPlay {
|
|
737
|
+
readonly frames: readonly LandingCaseFrame[];
|
|
738
|
+
readonly layout: SceneLayout;
|
|
739
|
+
/** The host's layout at the press (what a row's `home` compares with). Absent: the row's scene as solved. */
|
|
740
|
+
readonly before?: SceneLayout;
|
|
741
|
+
}
|
|
718
742
|
/** What a host gives the landing runner: one call plays a row's drag and reports its frames and the layout after. */
|
|
719
743
|
interface LandingCaseHost {
|
|
720
744
|
/** The library version the host runs (`YY.M.R`); a row needing a later one is skipped. Absent: the latest. */
|
|
721
745
|
readonly version?: string;
|
|
722
|
-
play(row: LandingCase):
|
|
723
|
-
readonly frames: readonly LandingCaseFrame[];
|
|
724
|
-
readonly layout: SceneLayout;
|
|
725
|
-
} | Promise<{
|
|
726
|
-
readonly frames: readonly LandingCaseFrame[];
|
|
727
|
-
readonly layout: SceneLayout;
|
|
728
|
-
}>;
|
|
746
|
+
play(row: LandingCase): LandingPlay | Promise<LandingPlay>;
|
|
729
747
|
}
|
|
730
748
|
interface LandingCaseResult {
|
|
731
749
|
readonly id: string;
|
|
@@ -734,8 +752,11 @@ interface LandingCaseResult {
|
|
|
734
752
|
/** Why the row didn't run, or null. */
|
|
735
753
|
readonly skipped: string | null;
|
|
736
754
|
}
|
|
737
|
-
/**
|
|
738
|
-
|
|
755
|
+
/**
|
|
756
|
+
* What differs between a row and what its host played. `before` is the host's layout at the press (a row's `home`
|
|
757
|
+
* compares with it); absent, the row's scene as solved.
|
|
758
|
+
*/
|
|
759
|
+
declare function landingIssues(row: LandingCase, frames: readonly LandingCaseFrame[], layout: SceneLayout, before?: SceneLayout): string[];
|
|
739
760
|
/**
|
|
740
761
|
* Plays every row on `host` and says what differs. A row whose `requires.lanes.since` is after the host's `version` is
|
|
741
762
|
* skipped (and listed as such); a row that throws fails.
|
|
@@ -776,4 +797,4 @@ declare const CASE_GROUPS: readonly {
|
|
|
776
797
|
/** The row with this id, or undefined. */
|
|
777
798
|
declare const caseById: (id: string) => CaseRow | undefined;
|
|
778
799
|
|
|
779
|
-
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, type Gesture, type GestureType, 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 LandingRegionName, type LandingRule, type LayoutExpect, type PickCandidate, type PickRule, type Rename, type SceneHost, type SceneHostOptions, type StoredExpect, WINDOW_A, WINDOW_B, WINDOW_BARE, type WinOptions, type WinSpec, caseById, createLandingHost, createSceneHost, defaultItemSelector, g, idRenames, landingIssues, lanesRatchet, layoutIssues, mapGesture, mapLayout, mapPlace, mapScene, mapStored, pickTarget, resizeStep, resolvePlace, runCase, runCaseAsync, runCases, runCasesAsync, runLandingCases, winScene, withRefusals };
|
|
800
|
+
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, 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, type PickCandidate, type PickRule, type Rename, type SceneHost, type SceneHostOptions, type StoredExpect, WINDOW_A, WINDOW_B, WINDOW_BARE, type WinOptions, type WinSpec, caseById, createLandingHost, createSceneHost, defaultItemSelector, g, idRenames, landingIssues, lanesRatchet, layoutIssues, mapGesture, mapLayout, mapPlace, mapScene, mapStored, pickTarget, resizeStep, resolvePlace, runCase, runCaseAsync, runCases, runCasesAsync, runLandingCases, winScene, withRefusals };
|
package/dist/scene-cases.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
storeScene,
|
|
21
21
|
targets,
|
|
22
22
|
use
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-IDWMDPY7.js";
|
|
24
24
|
import "./chunk-AE3BWTAE.js";
|
|
25
25
|
import {
|
|
26
26
|
centre,
|
|
@@ -2347,6 +2347,7 @@ async function runCasesAsync(rows, makeHost, options = {}) {
|
|
|
2347
2347
|
// src/scene/cases/landing.ts
|
|
2348
2348
|
var LANES_SINCE = "26.11.45";
|
|
2349
2349
|
var GRAB_SINCE = "26.11.46";
|
|
2350
|
+
var GRIP_SINCE = "26.11.48";
|
|
2350
2351
|
var LAST_WITHOUT_LANES = "26.11.44";
|
|
2351
2352
|
var LANES_DEADLINE = "2026-12-31";
|
|
2352
2353
|
var versionBefore = (a, b) => {
|
|
@@ -2358,18 +2359,38 @@ var versionBefore = (a, b) => {
|
|
|
2358
2359
|
var gapTo = (r, p) => Math.hypot(Math.max(r.x - p.x, 0, p.x - (r.x + r.width)), Math.max(r.y - p.y, 0, p.y - (r.y + r.height)));
|
|
2359
2360
|
var touches = (a, b) => a.x <= b.x + b.width && b.x <= a.x + a.width && a.y <= b.y + b.height && b.y <= a.y + a.height;
|
|
2360
2361
|
var worstTrail = (frames) => Math.max(0, ...frames.filter((f2) => f2.moving && f2.region === "lane" && f2.landing).map((f2) => gapTo(f2.landing, f2.point)));
|
|
2361
|
-
function
|
|
2362
|
+
function homeIssues(item, before, after) {
|
|
2363
|
+
const a = before.items[item];
|
|
2364
|
+
const b = after.items[item];
|
|
2365
|
+
if (!a) return [`${item} is not in the layout at the press`];
|
|
2366
|
+
if (!b) return [`${item} is not in the layout after the release`];
|
|
2367
|
+
const out = [];
|
|
2368
|
+
const where = (it) => it.floating ? "floating" : it.inMenu ? `in ${it.edge ?? "no"} menu` : it.edge ?? "nowhere";
|
|
2369
|
+
if (where(a) !== where(b)) out.push(`${item} ends ${where(b)}, not where it was (${where(a)})`);
|
|
2370
|
+
else if (a.edge && dockedIn(before, a.edge).join(",") !== dockedIn(after, a.edge).join(","))
|
|
2371
|
+
out.push(`${a.edge} holds ${dockedIn(after, a.edge).join(", ")}, not ${dockedIn(before, a.edge).join(", ")} as at the press`);
|
|
2372
|
+
const r0 = a.rect;
|
|
2373
|
+
const r1 = b.rect;
|
|
2374
|
+
if (Math.max(Math.abs(r0.x - r1.x), Math.abs(r0.y - r1.y), Math.abs(r0.width - r1.width), Math.abs(r0.height - r1.height)) > 0.5)
|
|
2375
|
+
out.push(`${item} is at ${Math.round(r1.x)},${Math.round(r1.y)} ${Math.round(r1.width)}x${Math.round(r1.height)}, not where it was (${Math.round(r0.x)},${Math.round(r0.y)} ${Math.round(r0.width)}x${Math.round(r0.height)})`);
|
|
2376
|
+
return out;
|
|
2377
|
+
}
|
|
2378
|
+
function landingIssues(row2, frames, layout, before) {
|
|
2362
2379
|
const out = [];
|
|
2363
2380
|
const m = row2.moving;
|
|
2364
2381
|
if (frames.length === 0) return ["no frames"];
|
|
2365
2382
|
if (m)
|
|
2366
|
-
for (const f2 of frames.
|
|
2383
|
+
for (const [i, f2] of frames.entries()) {
|
|
2384
|
+
if (!f2.moving) continue;
|
|
2367
2385
|
const at2 = `at ${Math.round(f2.point.x)},${Math.round(f2.point.y)}`;
|
|
2386
|
+
const next = frames[i + 1];
|
|
2387
|
+
const beforeHop = !!next && next.region === "lane" && f2.region === "lane" && next.lane === f2.lane && next.spot !== f2.spot;
|
|
2388
|
+
const bound = beforeHop && m.trailBeforeHop !== void 0 ? m.trailBeforeHop : m.trail;
|
|
2368
2389
|
if (m.lane !== void 0 && (f2.region !== "lane" || f2.lane !== m.lane)) out.push(`${at2}: ${f2.region}${f2.lane ? ` in ${f2.lane}` : ""}, not the lane ${m.lane}`);
|
|
2369
2390
|
if (m.notLanes && f2.lane && m.notLanes.includes(f2.lane)) out.push(`${at2}: held ${f2.lane}`);
|
|
2370
2391
|
if (m.notRegions && m.notRegions.includes(f2.region)) out.push(`${at2}: ${f2.region}`);
|
|
2371
2392
|
for (const g2 of m.noGuideIn ? f2.guides ?? [] : []) if (m.noGuideIn.some((r) => touches(g2.rect, r))) out.push(`${at2}: the guide ${g2.id} where nothing lands`);
|
|
2372
|
-
if (
|
|
2393
|
+
if (bound !== void 0 && f2.region === "lane" && f2.landing && gapTo(f2.landing, f2.point) > bound + 0.5) out.push(`${at2}: the landing ${Math.round(gapTo(f2.landing, f2.point))} px from the pointer (at most ${bound}${beforeHop ? ", the frame before a hop" : ""})`);
|
|
2373
2394
|
if (out.length >= 4) break;
|
|
2374
2395
|
}
|
|
2375
2396
|
const last = frames.at(-1);
|
|
@@ -2379,6 +2400,7 @@ function landingIssues(row2, frames, layout) {
|
|
|
2379
2400
|
if (row2.end.spot !== void 0 && last.spot !== row2.end.spot) out.push(`the last frame's spot is ${last.spot ?? "none"}, not ${row2.end.spot}`);
|
|
2380
2401
|
}
|
|
2381
2402
|
if (row2.layout) out.push(...layoutIssues(row2.layout, layout));
|
|
2403
|
+
if (row2.home) out.push(...homeIssues(row2.item, before ?? solve(row2.scene), layout));
|
|
2382
2404
|
return out;
|
|
2383
2405
|
}
|
|
2384
2406
|
async function runLandingCases(rows, host) {
|
|
@@ -2389,8 +2411,8 @@ async function runLandingCases(rows, host) {
|
|
|
2389
2411
|
continue;
|
|
2390
2412
|
}
|
|
2391
2413
|
try {
|
|
2392
|
-
const { frames, layout } = await host.play(row2);
|
|
2393
|
-
const issues = landingIssues(row2, frames, layout);
|
|
2414
|
+
const { frames, layout, before } = await host.play(row2);
|
|
2415
|
+
const issues = landingIssues(row2, frames, layout, before);
|
|
2394
2416
|
const over = row2.moving?.trailOverSlow;
|
|
2395
2417
|
if (over) {
|
|
2396
2418
|
const slow = await host.play({ ...row2, speed: over.slow });
|
|
@@ -2447,7 +2469,7 @@ function createLandingHost(o) {
|
|
|
2447
2469
|
const spot = out?.kind === "spot" ? [...regions.lanes, ...regionsFor(out.spot).lanes].flatMap((l) => l.spots).find((x) => x.id === out.spot) : void 0;
|
|
2448
2470
|
const target = out?.kind === "float" ? regions.float : spot && !spot.home ? spot.target : null;
|
|
2449
2471
|
const next = target ? target.after(at2, grab).scene : s;
|
|
2450
|
-
return { frames, layout: solve(next, { previous }) };
|
|
2472
|
+
return { frames, layout: solve(next, { previous }), before: previous };
|
|
2451
2473
|
}
|
|
2452
2474
|
};
|
|
2453
2475
|
}
|
|
@@ -2636,7 +2658,7 @@ var LANDING_CASES = [
|
|
|
2636
2658
|
speed: 0.6,
|
|
2637
2659
|
rest: 80,
|
|
2638
2660
|
end: { region: "lane", lane: "top" },
|
|
2639
|
-
|
|
2661
|
+
home: true,
|
|
2640
2662
|
requires: GRAB
|
|
2641
2663
|
},
|
|
2642
2664
|
{
|
|
@@ -2653,9 +2675,58 @@ var LANDING_CASES = [
|
|
|
2653
2675
|
speed: 0.6,
|
|
2654
2676
|
rest: 80,
|
|
2655
2677
|
end: { region: "lane", lane: "rail-left" },
|
|
2656
|
-
|
|
2678
|
+
home: true,
|
|
2657
2679
|
requires: GRAB
|
|
2658
2680
|
},
|
|
2681
|
+
{
|
|
2682
|
+
id: "landing-grip-past-long-neighbor",
|
|
2683
|
+
title: "A toolbar held by its grip and slid past a long neighbor stays at the hand",
|
|
2684
|
+
expect: "A toolbar pressed 6 px into its left end (its grip) in the bottom bar and slid right along it past a 200 px neighbor to the bar's far end at 0.15 px/ms: every frame holds the bar, and the landing lies within 48 px of the pointer, 56 on the frame before a hop (R12): the grab never moves a hop past the neighbor.",
|
|
2685
|
+
scene: landingWindow(["a"], ["b", "c"]),
|
|
2686
|
+
item: "b",
|
|
2687
|
+
path: [
|
|
2688
|
+
{ x: 14, y: 622 },
|
|
2689
|
+
{ x: 1060, y: 622 }
|
|
2690
|
+
],
|
|
2691
|
+
speed: 0.15,
|
|
2692
|
+
rest: 40,
|
|
2693
|
+
moving: { lane: "bottom", trail: 48, trailBeforeHop: 56 },
|
|
2694
|
+
requires: { lanes: { since: GRIP_SINCE } }
|
|
2695
|
+
},
|
|
2696
|
+
{
|
|
2697
|
+
id: "landing-grip-across-items",
|
|
2698
|
+
title: "A toolbar held by its grip and slid slowly across two neighbors stays at the hand",
|
|
2699
|
+
expect: "In a top bar of three 200 px toolbars, the first pressed 6 px into its left end (its grip) and slid right across the other two to the bar's end at 0.15 px/ms: every frame holds the bar, and the landing lies within 48 px of the pointer, 56 on the frame before a hop (R12).",
|
|
2700
|
+
scene: landingWindow(["a", "b", "c"]),
|
|
2701
|
+
item: "a",
|
|
2702
|
+
path: [
|
|
2703
|
+
{ x: 14, y: 18 },
|
|
2704
|
+
{ x: 1060, y: 18 }
|
|
2705
|
+
],
|
|
2706
|
+
speed: 0.15,
|
|
2707
|
+
rest: 40,
|
|
2708
|
+
moving: { lane: "top", trail: 48, trailBeforeHop: 56 },
|
|
2709
|
+
requires: { lanes: { since: GRIP_SINCE } }
|
|
2710
|
+
},
|
|
2711
|
+
{
|
|
2712
|
+
id: "landing-grip-up-the-rail",
|
|
2713
|
+
title: "A rail toolbar held by its grip and pulled slowly up past its neighbor stays at the hand",
|
|
2714
|
+
expect: "Zoom pressed 6 px below its top (its grip) in its rail and pulled straight up past Tools (158 px long there) to the rail's head at 0.15 px/ms: every frame holds the rail, and the landing lies within 48 px of the pointer, 56 on the frame before a hop (R12).",
|
|
2715
|
+
scene: (() => {
|
|
2716
|
+
const s = landingWindow();
|
|
2717
|
+
const tools = group2("tools", 1);
|
|
2718
|
+
return { ...s, items: { ...s.items, tools: { ...tools, forms: { ...tools.forms, column: [form("icons", 158, 158, 28), form("menu", 0, 0, 0)] } } } };
|
|
2719
|
+
})(),
|
|
2720
|
+
item: "zoom",
|
|
2721
|
+
path: [
|
|
2722
|
+
{ x: 15, y: 200 },
|
|
2723
|
+
{ x: 15, y: 40 }
|
|
2724
|
+
],
|
|
2725
|
+
speed: 0.15,
|
|
2726
|
+
rest: 40,
|
|
2727
|
+
moving: { lane: "rail-left", trail: 48, trailBeforeHop: 56 },
|
|
2728
|
+
requires: { lanes: { since: GRIP_SINCE } }
|
|
2729
|
+
},
|
|
2659
2730
|
{
|
|
2660
2731
|
id: "landing-across-items",
|
|
2661
2732
|
title: "A fast hand across docked items trails no further than it must",
|
|
@@ -2695,6 +2766,7 @@ export {
|
|
|
2695
2766
|
CASE_GROUPS,
|
|
2696
2767
|
END_REACH,
|
|
2697
2768
|
GRAB_SINCE,
|
|
2769
|
+
GRIP_SINCE,
|
|
2698
2770
|
LANDING_CASES,
|
|
2699
2771
|
LANES_DEADLINE,
|
|
2700
2772
|
LANES_SINCE,
|