@n-uf/placement 26.11.47 → 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.
@@ -1044,9 +1044,10 @@ interface SceneRefusal {
1044
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
1045
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
1046
1046
  * other spots, it is halfway across the gap between their landings, each in its own layout, so the pointer is at the
1047
- * landing it picks and a toolbar moved along an occupied lane stays at the hand. On a bar or a toolbar rail that gap is
1048
- * measured where the item is held (`options.grab`): halfway between the points the pointer would hold in each landing,
1049
- * so a pointer back at its press point picks the item's own place however far from its middle it was pressed. Cuts are
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
1050
1051
  * kept inside the lane and in order. The spots come from the same generation and filter as `targets()`, so a spot's
1051
1052
  * landing is exactly what its drop commits. Spot ids are keyed by the lane, zone and neighboring items, so they survive
1052
1053
  * the window resizing and most items opening or moving; virtual lanes are keyed by the column they lie beside, not
@@ -1085,17 +1086,27 @@ interface LaneRefusal {
1085
1086
  }
1086
1087
  /**
1087
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
1088
- * for the item between them but its own; as thick as their gap allows, up to 2 px, so zero where they meet and the host
1089
- * strokes it), also at a lane's end next to an item, a `box` over a free stretch the item fits in. Never over an item
1090
- * drawn there, the held one included, nor a line in a refused stretch.
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).
1091
1100
  */
1092
1101
  interface LaneMark {
1093
1102
  /**
1094
1103
  * Stable while the items either side stay: `<lane>/line/<before>|<after>`, `<lane>/box/<before>|<after>` (`#<n>` for a
1095
- * stretch's later pieces), `^` and `$` at the lane's ends; a virtual lane's `<lane>/box/<spot id>`. Key a drawing by it.
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.
1096
1107
  */
1097
1108
  readonly id: string;
1098
- readonly kind: "line" | "box";
1109
+ readonly kind: "line" | "box" | "hatch";
1099
1110
  readonly rect: Rect;
1100
1111
  }
1101
1112
  interface Lane {
@@ -1108,6 +1119,11 @@ interface Lane {
1108
1119
  readonly refused: readonly LaneRefusal[];
1109
1120
  /** Its place guides' marks, in the layout as drawn (the held spot's, with `options.spot`). */
1110
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;
1111
1127
  }
1112
1128
  /** Everything a landing model reads for one drag. */
1113
1129
  interface Regions {
@@ -1137,16 +1153,23 @@ interface LaneOptions extends SceneTargetOptions {
1137
1153
  * Where the pointer holds the item, from its top left corner as it is now, px (what a target's `after(point, grab)`
1138
1154
  * takes): the press's, constant for the drag (each grab is remembered as its own options), and the same in the call
1139
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
1140
- * along that axis the cut between two spots lies halfway between the points the pointer would hold in each landing
1141
- * (with landings of one length; at the same share of each), so a pointer back at its press point picks the item's own
1142
- * place. Across the item, and in a lane across its length (a rail toolbar over a bar), it is the item's middle, as
1143
- * without a grab. Panel columns take a panel by halves of what is drawn either way. Where another lane's band
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
1144
1161
  * overlaps the press point (an empty bar's band over a rail's end) that lane can still take the pointer first.
1145
1162
  */
1146
1163
  readonly grab?: {
1147
1164
  readonly x: number;
1148
1165
  readonly y: number;
1149
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";
1150
1173
  }
1151
1174
  /**
1152
1175
  * The lanes and regions of a drag of `dragged`: every lane that takes it with its spots and stretches, the refused
@@ -1155,5 +1178,15 @@ interface LaneOptions extends SceneTargetOptions {
1155
1178
  * worked out again, in that spot's own layout.
1156
1179
  */
1157
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;
1158
1191
 
1159
- export { type SceneItemLayout as $, type LaneSpot as A, RAIL_MODES as B, type ColumnPlace as C, DEFAULT_FLOAT_SIZE as D, type Edge as E, type FloatAnchorAt as F, RAIL_STRIP_MIN as G, RAIL_VISIBILITIES as H, type RailDropPolicy as I, type RailPlace as J, type Kind as K, type Lane as L, type RailSpec as M, type RailVisibility as N, type Orient as O, type Place as P, type ResizeEdges as Q, type Regions as R, type Scene as S, type ResizeLimit as T, SIDES as U, SPOT_PITCH as V, type SceneAfter as W, type SceneChrome as X, type SceneEdgeLayout as Y, type Zone as Z, type SceneFloat as _, type ScenePlace as a, type SceneNote as a0, type SceneRailLayout as a1, type SceneRead as a2, type StoredSceneEdge as a3, type StoredSceneFloat as a4, type StoredSceneItem as a5, ZONES as a6, canFold as a7, close as a8, dockHome as a9, fitResize as aa, floatAt as ab, fold as ac, homeFor as ad, keep as ae, lanes as af, lift as ag, mergeSideColumns as ah, moveTo as ai, open as aj, orient as ak, raise as al, readScene as am, resize as an, setRailMode as ao, setSide as ap, storeScene as aq, use as ar, 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, type LaneMark as x, type LaneOptions as y, type LaneRefusal as z };
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 };
@@ -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-0L2Cy12X.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-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 box, and where. */
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.
@@ -787,4 +797,4 @@ declare const CASE_GROUPS: readonly {
787
797
  /** The row with this id, or undefined. */
788
798
  declare const caseById: (id: string) => CaseRow | undefined;
789
799
 
790
- 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 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 };
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 };
@@ -20,7 +20,7 @@ import {
20
20
  storeScene,
21
21
  targets,
22
22
  use
23
- } from "./chunk-VNOEEI4L.js";
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) => {
@@ -2379,13 +2380,17 @@ function landingIssues(row2, frames, layout, before) {
2379
2380
  const m = row2.moving;
2380
2381
  if (frames.length === 0) return ["no frames"];
2381
2382
  if (m)
2382
- for (const f2 of frames.filter((x) => x.moving)) {
2383
+ for (const [i, f2] of frames.entries()) {
2384
+ if (!f2.moving) continue;
2383
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;
2384
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}`);
2385
2390
  if (m.notLanes && f2.lane && m.notLanes.includes(f2.lane)) out.push(`${at2}: held ${f2.lane}`);
2386
2391
  if (m.notRegions && m.notRegions.includes(f2.region)) out.push(`${at2}: ${f2.region}`);
2387
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`);
2388
- if (m.trail !== void 0 && f2.region === "lane" && f2.landing && gapTo(f2.landing, f2.point) > m.trail + 0.5) out.push(`${at2}: the landing ${Math.round(gapTo(f2.landing, f2.point))} px from the pointer (at most ${m.trail})`);
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" : ""})`);
2389
2394
  if (out.length >= 4) break;
2390
2395
  }
2391
2396
  const last = frames.at(-1);
@@ -2673,6 +2678,55 @@ var LANDING_CASES = [
2673
2678
  home: true,
2674
2679
  requires: GRAB
2675
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
+ },
2676
2730
  {
2677
2731
  id: "landing-across-items",
2678
2732
  title: "A fast hand across docked items trails no further than it must",
@@ -2712,6 +2766,7 @@ export {
2712
2766
  CASE_GROUPS,
2713
2767
  END_REACH,
2714
2768
  GRAB_SINCE,
2769
+ GRIP_SINCE,
2715
2770
  LANDING_CASES,
2716
2771
  LANES_DEADLINE,
2717
2772
  LANES_SINCE,