@n-uf/placement 26.11.51 → 26.11.52
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 +120 -0
- package/dist/{chunk-UPZXNTIR.js → chunk-67D32MZ4.js} +223 -61
- package/dist/chunk-67D32MZ4.js.map +1 -0
- package/dist/{lanes-Dl39s0r7.d.ts → lanes-DIwUqchd.d.ts} +79 -14
- package/dist/scene-cases.d.ts +77 -5
- package/dist/scene-cases.js +304 -18
- package/dist/scene-cases.js.map +1 -1
- package/dist/scene.d.ts +19 -9
- package/dist/scene.js +3 -1
- package/package.json +2 -2
- package/dist/chunk-UPZXNTIR.js.map +0 -1
|
@@ -65,6 +65,18 @@ interface SceneItem {
|
|
|
65
65
|
* with spare room when the form `grows`; window controls have `min` equal to `natural`.
|
|
66
66
|
*/
|
|
67
67
|
readonly fixed?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* A fixed item that yields: a movable item dropped after it in its zone may push it inward along the zone. Left out,
|
|
70
|
+
* a fixed item at a zone's anchor (window controls at a bar's end) keeps its place, so no gap after it is offered; a
|
|
71
|
+
* fixed item with `pushable` at the anchor (a state or page cell at a title bar's end) lets the gap after the run be a
|
|
72
|
+
* stop, a place a toolbar homed after it can be put back in. It keeps its order among the fixed items: no gap is
|
|
73
|
+
* offered between two `pushable` items. The rule is "a movable item dropped beside me, on my anchor's side, may push
|
|
74
|
+
* me inward", so in the start zone it is the mirror: the gap before a run of `pushable` items at the edge's start (a
|
|
75
|
+
* title at a title bar's start) is a stop, and a drop there pushes them inward. A declaration of the scene like
|
|
76
|
+
* `Edge.zoneAccepts`: `readScene` takes it from
|
|
77
|
+
* `base`, `storeScene` never writes it.
|
|
78
|
+
*/
|
|
79
|
+
readonly pushable?: boolean;
|
|
68
80
|
/** Closed: it keeps its place in its edge (or its float rect) but takes no room and has no targets. */
|
|
69
81
|
readonly closed?: boolean;
|
|
70
82
|
/**
|
|
@@ -88,8 +100,20 @@ interface SceneItem {
|
|
|
88
100
|
*/
|
|
89
101
|
readonly priority?: number;
|
|
90
102
|
/**
|
|
91
|
-
* Its size as a float: `floatAt` with no rect uses
|
|
92
|
-
*
|
|
103
|
+
* Its size as a float, per orient: `floatAt` with no rect uses the one for the orient it floats in, and a float drop or
|
|
104
|
+
* a hand resize sets it for the orient the float is in, so a float turned to the other orient (`orient`) takes that
|
|
105
|
+
* orient's size and, turned back, its own again. Without one for an orient, a float takes its first form's natural size
|
|
106
|
+
* along that orient (`floatSizeOf`), or `DEFAULT_FLOAT_SIZE` when that form grows (a panel's card).
|
|
107
|
+
*/
|
|
108
|
+
readonly floatSizes?: {
|
|
109
|
+
readonly row?: Size;
|
|
110
|
+
readonly column?: Size;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Its one size as a float, from before sizes were kept per orient. Read for the orient the float is in (a stored scene
|
|
114
|
+
* with it reads as `floatSizes` for its float's orient); nothing writes it any more.
|
|
115
|
+
*
|
|
116
|
+
* @deprecated Use `floatSizes`. Removed in the next breaking release.
|
|
93
117
|
*/
|
|
94
118
|
readonly floatSize?: Size;
|
|
95
119
|
/**
|
|
@@ -467,6 +491,12 @@ interface SceneItemLayout {
|
|
|
467
491
|
/** Stage px. An item in the » menu has the menu entry's rect. */
|
|
468
492
|
readonly rect: Rect;
|
|
469
493
|
readonly kind: Kind;
|
|
494
|
+
/**
|
|
495
|
+
* The axis it lies along, for every item: a placed item's edge's (a bar's items lie along a row, a column's and a
|
|
496
|
+
* rail's along a column, whatever form they took: a bar's icons form is a row), a float's orient. `form` indexes the
|
|
497
|
+
* forms of this axis. Hosts read it here, never from `formKind`.
|
|
498
|
+
*/
|
|
499
|
+
readonly axis: Orient;
|
|
470
500
|
/** The form it took: an index into the forms of its axis. */
|
|
471
501
|
readonly form: number;
|
|
472
502
|
readonly formKind: StackFormKind;
|
|
@@ -746,16 +776,19 @@ declare function fitResize(scene: Scene, id: string, rect: Rect, moving: ResizeE
|
|
|
746
776
|
* hand, a rail tile once nothing there sets the width); `{ kind: "float", rect?, anchor? }` floats it. A dynamic column an item leaves empty is deleted
|
|
747
777
|
* and its side's rings are closed up.
|
|
748
778
|
* - `homeFor(scene, id, start)`: the place a start scene gives the item, for `moveTo`.
|
|
749
|
-
* - `floatAt(scene, id, rect?, orient?)`: floats it on top at `rect` (its size becomes `
|
|
750
|
-
* its `floatSizeOf` size anchored to the content's top-right corner: its `
|
|
751
|
-
*
|
|
779
|
+
* - `floatAt(scene, id, rect?, orient?)`: floats it on top at `rect` (its size becomes its `floatSizes` for the orient
|
|
780
|
+
* it floats in); with no rect, at its `floatSizeOf` size anchored to the content's top-right corner: its `floatSizes`
|
|
781
|
+
* for that orient, else its form's natural size along it (the float's, `orient`, else `floatOrientOf`), else the
|
|
782
|
+
* default size.
|
|
752
783
|
* - `fold(scene, id, on)`: folded by hand (`from: 1`) draws it in its folded form on the axis it lies along (a panel's
|
|
753
784
|
* `header`, a group's `fold`), and give-way steps down from there; unfolding clears `from`. Where it has no folded
|
|
754
785
|
* form (`canFold` false), folding changes nothing.
|
|
755
786
|
* - `use(scene, id)`: the newest age. Under `previous` it reshapes nothing.
|
|
756
787
|
* - `keep(scene, id, on)`, `open(scene, id)`, `close(scene, id)`.
|
|
757
788
|
* - `raise(scene, id)`: a float to the top of the stack; no use, no reshape.
|
|
758
|
-
* - `orient(scene, id, orient)`: a float's axis.
|
|
789
|
+
* - `orient(scene, id, orient)`: a float's axis. Its frame takes the size the new orient draws it at (`floatSizeOf`: the
|
|
790
|
+
* size kept for that orient, else the form's natural size), its place and anchor kept; turned back, it has its first
|
|
791
|
+
* orient's size again. An item that declares no `floatSizes` turns keeping its rect, as before the per-orient sizes.
|
|
759
792
|
* - `resize(scene, edge, size)`: the user's size across; a size that isn't a finite number clears it.
|
|
760
793
|
* `resize(scene, id, rect, moving?)`: a float resized by hand, at `fitResize`'s rect (./float-resize).
|
|
761
794
|
*/
|
|
@@ -832,7 +865,7 @@ declare function orient(scene: Scene, id: string, to: Orient): Scene;
|
|
|
832
865
|
* The user's size across an edge (`size` a number; one that isn't finite clears it). Or, with a rect, a float resized
|
|
833
866
|
* by hand: the rect `fitResize(scene, floatId, rect, moving)` gives (default `moving`: right and bottom), so a host's
|
|
834
867
|
* preview from `fitResize` is what this commits. The float keeps its stacking order and orient, loses its anchor, and
|
|
835
|
-
* the size becomes the item's `
|
|
868
|
+
* the size becomes the item's `floatSizes` for that orient (stored with the scene). The scene given back where `fitResize` refuses (a
|
|
836
869
|
* toolbar group, a folded float, anything not floating).
|
|
837
870
|
*/
|
|
838
871
|
declare function resize(scene: Scene, edgeId: string, size: number): Scene;
|
|
@@ -873,7 +906,7 @@ declare function dockHome(scene: Scene, id: string, start: Scene): Scene;
|
|
|
873
906
|
* v: 1;
|
|
874
907
|
* edges: { id: string; side: Side; ring: number; items: string[]; size?: number; column?: true }[];
|
|
875
908
|
* floats: { id: string; x: number; y: number; width: number; height: number; orient?: "row" | "column"; anchor?: FloatAnchor | { at: FloatAnchor; dx?: number; dy?: number }; since?: number }[];
|
|
876
|
-
* items: Record<string, { used: number; kept?: true; from?: number; closed?: true; align?: "center" | "end"; space?: number;
|
|
909
|
+
* items: Record<string, { used: number; kept?: true; from?: number; closed?: true; align?: "center" | "end"; space?: number; floatSizes?: { row?: { width: number; height: number }; column?: { width: number; height: number } } }>;
|
|
877
910
|
* railModes?: { left?: "titles" | "icons"; right?: "titles" | "icons" };
|
|
878
911
|
* }
|
|
879
912
|
* ```
|
|
@@ -900,6 +933,10 @@ declare function dockHome(scene: Scene, id: string, start: Scene): Scene;
|
|
|
900
933
|
* lies by its anchor, so the clamp never turns it into a pixel position). An unusable anchor is dropped
|
|
901
934
|
* (`float:<id>:anchor`), and so is a bad offset field (`float:<id>:anchor:dx`, `float:<id>:anchor:<field>`). A float's
|
|
902
935
|
* `since` is kept as stored; one that isn't a number from 0 to `Number.MAX_SAFE_INTEGER` is dropped (`float:<id>:since`).
|
|
936
|
+
* A float's size is stored per orient (`floatSizes`); one entry that isn't a size, or an orient that isn't `row` or
|
|
937
|
+
* `column`, is dropped (`item:<id>:floatSizes:<orient>`). A store from before that, with one `floatSize` on an item,
|
|
938
|
+
* reads as `floatSizes` for the orient its float is in (the item's own orient where it floats nowhere), so the size
|
|
939
|
+
* never follows the float to the other orient.
|
|
903
940
|
*/
|
|
904
941
|
|
|
905
942
|
interface StoredSceneEdge {
|
|
@@ -931,6 +968,17 @@ interface StoredSceneItem {
|
|
|
931
968
|
readonly align?: "center" | "end";
|
|
932
969
|
/** `SceneItem.space`, px. */
|
|
933
970
|
readonly space?: number;
|
|
971
|
+
/** `SceneItem.floatSizes`: its float size per orient. */
|
|
972
|
+
readonly floatSizes?: {
|
|
973
|
+
readonly row?: Size;
|
|
974
|
+
readonly column?: Size;
|
|
975
|
+
};
|
|
976
|
+
/**
|
|
977
|
+
* The old single float size, read as `floatSizes` for the orient its float is in; `storeScene` writes it only for an
|
|
978
|
+
* item still carrying one.
|
|
979
|
+
*
|
|
980
|
+
* @deprecated Use `floatSizes`.
|
|
981
|
+
*/
|
|
934
982
|
readonly floatSize?: Size;
|
|
935
983
|
}
|
|
936
984
|
interface StoredScene {
|
|
@@ -1026,11 +1074,14 @@ interface SceneRefusal {
|
|
|
1026
1074
|
*/
|
|
1027
1075
|
readonly hits?: readonly Rect[];
|
|
1028
1076
|
/**
|
|
1029
|
-
* `no-room`: the zone takes the kind, but the drop there doesn't fit (a title bar at the title's
|
|
1030
|
-
*
|
|
1031
|
-
*
|
|
1077
|
+
* `no-room`: the zone takes the kind, but the drop there doesn't fit along the edge (a title bar at the title's
|
|
1078
|
+
* natural width, say): no length would be enough. `too-thick`: the zone takes the kind, but no form of the item
|
|
1079
|
+
* (the » menu aside) fits across the edge: each sets no cross size and has a `cross.min` over the edge's thickness
|
|
1080
|
+
* (a 30 px toolbar on a 28 px bar), so no length would help. `own-place`: the stretch beside an item alone in its
|
|
1081
|
+
* zone: there is room, but the zone's only place is the item's own (a release there puts it back). `not-accepted`:
|
|
1082
|
+
* the edge or zone doesn't take the kind.
|
|
1032
1083
|
*/
|
|
1033
|
-
readonly reason: "no-room" | "own-place" | "not-accepted";
|
|
1084
|
+
readonly reason: "no-room" | "too-thick" | "own-place" | "not-accepted";
|
|
1034
1085
|
/**
|
|
1035
1086
|
* The stage: the refusal holds only points strictly inside it (`Target.bounds`), so a pointer a host clamps exactly
|
|
1036
1087
|
* onto the window's edge is never in it. Set by `refusals()`; `refusalTargets` passes it on.
|
|
@@ -1164,8 +1215,22 @@ interface Lane {
|
|
|
1164
1215
|
readonly axis: "x" | "y";
|
|
1165
1216
|
readonly spots: readonly LaneSpot[];
|
|
1166
1217
|
readonly refused: readonly LaneRefusal[];
|
|
1167
|
-
/**
|
|
1218
|
+
/**
|
|
1219
|
+
* Its place guides' marks, in the layout as drawn (the held spot's, with `options.spot`). An edge lane empty as seen
|
|
1220
|
+
* with one spot (or one sliding spot) is the exception (`emptyLanes: "real"`, no `spot`): its marks are predicted, in
|
|
1221
|
+
* the after-entry layout of that spot, the same marks `lanes(…, { spot })` gives it once held. Where that prediction
|
|
1222
|
+
* overlaps another lane's marks (a corner two empty lanes share, a drawn rail's end) it gives the overlap up here: to
|
|
1223
|
+
* every lane not predicted, and between two predicted lanes the bar owns the corner. `entry` keeps it whole.
|
|
1224
|
+
*/
|
|
1168
1225
|
readonly marks: readonly LaneMark[];
|
|
1226
|
+
/**
|
|
1227
|
+
* The predicted marks whole, each corner they share owned (`marks` less nothing), where `marks` gave some of them up:
|
|
1228
|
+
* what a landing model shows for this lane while it is the lane the pointer picks (held, pending or approached), the
|
|
1229
|
+
* other lanes' marks cut where they overlap it. Absent where `marks` is the whole prediction, or nothing is predicted.
|
|
1230
|
+
*/
|
|
1231
|
+
readonly entry?: readonly LaneMark[];
|
|
1232
|
+
/** The lanes whose marks `entry` overlaps (the ones it gave the overlap up to in `marks`), with `entry`. */
|
|
1233
|
+
readonly corners?: readonly string[];
|
|
1169
1234
|
/**
|
|
1170
1235
|
* Its rect is its own: a rail drop strip at the window's side (`Scene.railDrop`), which every other target of the drag
|
|
1171
1236
|
* gives up. A landing model gives it the pointer inside it over any lane it overlaps (a flush column's edge).
|
|
@@ -1253,4 +1318,4 @@ declare const HATCH_END = 8;
|
|
|
1253
1318
|
*/
|
|
1254
1319
|
declare const HATCH_EDGE = 8;
|
|
1255
1320
|
|
|
1256
|
-
export { type SceneChrome as $, type LaneRefusal as A, type LaneSlide as B, type ColumnPlace as C, DEFAULT_FLOAT_SIZE as D, type Edge as E, type FloatAnchorAt as F, type LaneSpot as G, HATCH_EDGE as H, RAIL_MODES as I, RAIL_STRIP_MIN as J, type Kind as K, type LaneOptions as L, RAIL_VISIBILITIES as M, type RailDropPolicy as N, type Orient as O, type Place as P, type RailPlace as Q, type Regions as R, type Scene as S, type RailSpec as T, type RailVisibility as U, type ResizeEdges as V, type ResizeLimit as W, SIDES as X, SPOT_PITCH as Y, type Zone as Z, type SceneAfter as _, type ScenePlace as a, type SceneEdgeLayout as a0, type SceneFloat as a1, type SceneItemLayout as a2, type SceneNote as a3, type SceneRailLayout as a4, type SceneRead as a5, type StoredSceneEdge as a6, type StoredSceneFloat as a7, type StoredSceneItem as a8, ZONES as a9, canFold as aa, close as ab, dockHome as ac, fitResize as ad, floatAt as ae, fold as af, homeFor as ag, keep as ah, lanes as ai, lift as aj, mergeSideColumns as ak, moveTo as al, open as am, orient as an, raise as ao, readScene as ap, resize as aq, setRailMode as ar, setSide as as, storeScene as at, use as au, 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
|
|
1321
|
+
export { type SceneChrome as $, type LaneRefusal as A, type LaneSlide as B, type ColumnPlace as C, DEFAULT_FLOAT_SIZE as D, type Edge as E, type FloatAnchorAt as F, type LaneSpot as G, HATCH_EDGE as H, RAIL_MODES as I, RAIL_STRIP_MIN as J, type Kind as K, type LaneOptions as L, RAIL_VISIBILITIES as M, type RailDropPolicy as N, type Orient as O, type Place as P, type RailPlace as Q, type Regions as R, type Scene as S, type RailSpec as T, type RailVisibility as U, type ResizeEdges as V, type ResizeLimit as W, SIDES as X, SPOT_PITCH as Y, type Zone as Z, type SceneAfter as _, type ScenePlace as a, type SceneEdgeLayout as a0, type SceneFloat as a1, type SceneItemLayout as a2, type SceneNote as a3, type SceneRailLayout as a4, type SceneRead as a5, type StoredSceneEdge as a6, type StoredSceneFloat as a7, type StoredSceneItem as a8, ZONES as a9, canFold as aa, close as ab, dockHome as ac, fitResize as ad, floatAt as ae, fold as af, homeFor as ag, keep as ah, lanes as ai, lift as aj, mergeSideColumns as ak, moveTo as al, open as am, orient as an, raise as ao, readScene as ap, resize as aq, setRailMode as ar, setSide as as, storeScene as at, use as au, 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 SceneItem as i, type ZoneAccepts 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 Lane as y, type LaneMark 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,
|
|
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
4
|
import './target-BBOCeez2.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -624,6 +624,38 @@ declare const ROOM_SINCE = "26.11.50";
|
|
|
624
624
|
* make room counts): the rows sliding over such a stretch need it.
|
|
625
625
|
*/
|
|
626
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;
|
|
627
659
|
/** The last published version without `lanes()`. */
|
|
628
660
|
declare const LAST_WITHOUT_LANES = "26.11.44";
|
|
629
661
|
/** From this date every landing row runs on every host (or at the breaking release, if that comes first). */
|
|
@@ -640,6 +672,7 @@ interface LandingModelLike {
|
|
|
640
672
|
readonly landing: Rect | null;
|
|
641
673
|
readonly room: boolean;
|
|
642
674
|
readonly guides?: readonly LandingCaseGuide[];
|
|
675
|
+
readonly pending?: string;
|
|
643
676
|
};
|
|
644
677
|
release(): {
|
|
645
678
|
readonly kind: "spot";
|
|
@@ -686,6 +719,8 @@ interface LandingCaseFrame {
|
|
|
686
719
|
readonly room: boolean;
|
|
687
720
|
/** The place guides shown ("near"), when the host reports them. */
|
|
688
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;
|
|
689
724
|
}
|
|
690
725
|
interface LandingCase {
|
|
691
726
|
/** Generic and stable. */
|
|
@@ -712,9 +747,20 @@ interface LandingCase {
|
|
|
712
747
|
readonly trail?: number;
|
|
713
748
|
/**
|
|
714
749
|
* On the single frame before a hop (the next frame holds another spot of the same lane), this bound instead of
|
|
715
|
-
* `trail
|
|
750
|
+
* `trail`. Absent: `trail` on every frame.
|
|
716
751
|
*/
|
|
717
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;
|
|
718
764
|
/**
|
|
719
765
|
* The landing lies no further from the pointer, at worst, than when the same path is played at `slow` px/ms, plus
|
|
720
766
|
* `by` px: a fast hand trails no more than a slow one does, plus what it may trail.
|
|
@@ -725,12 +771,27 @@ interface LandingCase {
|
|
|
725
771
|
};
|
|
726
772
|
/** Places where no guide lies (nothing lands there): a guide touching one of these rects fails. */
|
|
727
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;
|
|
728
787
|
};
|
|
729
788
|
/** On the last frame before the release. */
|
|
730
789
|
readonly end?: {
|
|
731
790
|
readonly region: LandingRegionName;
|
|
732
791
|
readonly lane?: string | null;
|
|
733
|
-
readonly spot?: string;
|
|
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>;
|
|
734
795
|
};
|
|
735
796
|
/** The layout after the release. */
|
|
736
797
|
readonly layout?: LayoutExpect;
|
|
@@ -753,6 +814,8 @@ interface LandingPlay {
|
|
|
753
814
|
readonly layout: SceneLayout;
|
|
754
815
|
/** The host's layout at the press (what a row's `home` compares with). Absent: the row's scene as solved. */
|
|
755
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"];
|
|
756
819
|
}
|
|
757
820
|
/** What a host gives the landing runner: one call plays a row's drag and reports its frames and the layout after. */
|
|
758
821
|
interface LandingCaseHost {
|
|
@@ -767,11 +830,20 @@ interface LandingCaseResult {
|
|
|
767
830
|
/** Why the row didn't run, or null. */
|
|
768
831
|
readonly skipped: string | null;
|
|
769
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[];
|
|
770
842
|
/**
|
|
771
843
|
* What differs between a row and what its host played. `before` is the host's layout at the press (a row's `home`
|
|
772
844
|
* compares with it); absent, the row's scene as solved.
|
|
773
845
|
*/
|
|
774
|
-
declare function landingIssues(row: LandingCase, frames: readonly LandingCaseFrame[], layout: SceneLayout, before?: SceneLayout): string[];
|
|
846
|
+
declare function landingIssues(row: LandingCase, frames: readonly LandingCaseFrame[], layout: SceneLayout, before?: SceneLayout, stretchPositions?: LaneOptions["stretchPositions"]): string[];
|
|
775
847
|
/**
|
|
776
848
|
* Plays every row on `host` and says what differs. A row whose `requires.lanes.since` is after the host's `version` is
|
|
777
849
|
* skipped (and listed as such); a row that throws fails.
|
|
@@ -813,4 +885,4 @@ declare const CASE_GROUPS: readonly {
|
|
|
813
885
|
/** The row with this id, or undefined. */
|
|
814
886
|
declare const caseById: (id: string) => CaseRow | undefined;
|
|
815
887
|
|
|
816
|
-
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, 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, idRenames, landingIssues, lanesRatchet, layoutIssues, mapGesture, mapLayout, mapPlace, mapScene, mapStored, pickTarget, resizeStep, resolvePlace, runCase, runCaseAsync, runCases, runCasesAsync, runLandingCases, winScene, withRefusals };
|
|
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 };
|