@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
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-67D32MZ4.js";
|
|
24
24
|
import "./chunk-AE3BWTAE.js";
|
|
25
25
|
import {
|
|
26
26
|
centre,
|
|
@@ -719,11 +719,27 @@ var BAR_ROWS = [
|
|
|
719
719
|
];
|
|
720
720
|
|
|
721
721
|
// src/scene/cases/rows-rules.ts
|
|
722
|
+
var zoomAwayStops = (endGaps) => [
|
|
723
|
+
g.gap("left", 0),
|
|
724
|
+
g.gap("left", 1),
|
|
725
|
+
g.gap("titlebar", 1),
|
|
726
|
+
g.gap("titlebar", 0, "center"),
|
|
727
|
+
...endGaps.map((at2) => g.gap("titlebar", at2, "end")),
|
|
728
|
+
g.gap("toolbar", 0),
|
|
729
|
+
g.gap("toolbar", 1),
|
|
730
|
+
g.gap("toolbar", 0, "center"),
|
|
731
|
+
g.gap("toolbar", 0, "end"),
|
|
732
|
+
g.gap("status", 0),
|
|
733
|
+
g.gap("right", 0),
|
|
734
|
+
g.gap("right", 1),
|
|
735
|
+
g.gap("right", 2),
|
|
736
|
+
g.float
|
|
737
|
+
];
|
|
722
738
|
var panelsOnly = () => tweakEdge({ ...doc(), floatKinds: ["panel"] }, "left", { accepts: ["panel"] });
|
|
723
739
|
var trayColumn = () => tweakEdge({ ...doc(), floatKinds: ["panel"] }, "left", { zoneAccepts: { start: ["panel"], end: ["group"] } });
|
|
724
|
-
function titleEnd(end) {
|
|
740
|
+
function titleEnd(end, pushable = false) {
|
|
725
741
|
const s = tweakEdge(tweakEdge(doc(), "titlebar", { items: ["title", ...end] }), "toolbar", { items: ["views", "tools"] });
|
|
726
|
-
const readout2 = (id, w) => ({ id, kind: "readout", used: 0, fixed: true, align: "end", forms: { row: [form("row", w, w, 28)] } });
|
|
742
|
+
const readout2 = (id, w) => ({ id, kind: "readout", used: 0, fixed: true, align: "end", ...pushable ? { pushable: true } : {}, forms: { row: [form("row", w, w, 28)] } });
|
|
727
743
|
return { ...s, items: { ...s.items, state: readout2("state", 96), page: readout2("page", 42) } };
|
|
728
744
|
}
|
|
729
745
|
function barZones() {
|
|
@@ -1072,6 +1088,32 @@ var RULE_ROWS = [
|
|
|
1072
1088
|
order: { titlebar: ["title", "zoom", "tools", "state", "page"] }
|
|
1073
1089
|
}
|
|
1074
1090
|
},
|
|
1091
|
+
{
|
|
1092
|
+
id: "R7-end-zone-pushable-put-back",
|
|
1093
|
+
title: "Pushable readouts: the gap after them is a stop, and Put back lands in it",
|
|
1094
|
+
expect: `State and Page (fixed, \`pushable\`) are at the title bar's end with Zoom homed after them: "state page zoom". With Zoom moved to the toolbar they are the end zone's anchored run, and the gap after them (end:2) is still one of Zoom's stops, because a readout that declares it may be pushed inward lets a movable item land after it. "Move to \u203A" that gap puts Zoom back: State and Page move left by Zoom's width and the order is "state page zoom" again. A gap between the two readouts (end:1) is no stop: they keep their order.`,
|
|
1095
|
+
group: "groups",
|
|
1096
|
+
scene: titleEnd(["state", "page", "zoom"], true),
|
|
1097
|
+
gestures: [g.moveTo("zoom", g.gap("toolbar", 2)), g.moveTo("zoom", g.gap("titlebar", 2, "end"))],
|
|
1098
|
+
checkpoints: [
|
|
1099
|
+
{ at: 0, layout: { items: { zoom: { edge: "toolbar" }, state: { rect: rect(1062, 0, 96, 32) }, page: { rect: rect(1158, 0, 42, 32) } }, order: { titlebar: ["title", "state", "page"] } }, note: "Zoom away: the readouts sit at the bar's end" }
|
|
1100
|
+
],
|
|
1101
|
+
expectStops: { item: "zoom", at: 0, places: zoomAwayStops([0, 2]) },
|
|
1102
|
+
expectLayout: {
|
|
1103
|
+
items: { state: { rect: rect(862, 0, 96, 32) }, page: { rect: rect(958, 0, 42, 32) }, zoom: { edge: "titlebar", zone: "end", rect: rect(1e3, 0, 200, 32) } },
|
|
1104
|
+
order: { titlebar: ["title", "state", "page", "zoom"] }
|
|
1105
|
+
}
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
id: "R7-end-zone-fixed-without-the-flag-no-gap-after",
|
|
1109
|
+
title: "Readouts without `pushable` keep the end: no gap after them",
|
|
1110
|
+
expect: "The same title bar with State and Page not declaring `pushable`, Zoom moved to the toolbar: no place after them is a stop for Zoom (only end:0, before them), so \"state page zoom\" can't be made by a drop. A fixed item pinned to the bar's end (window controls) is protected unless it says otherwise.",
|
|
1111
|
+
group: "groups",
|
|
1112
|
+
scene: titleEnd(["state", "page", "zoom"]),
|
|
1113
|
+
gestures: [g.moveTo("zoom", g.gap("toolbar", 2))],
|
|
1114
|
+
expectStops: { item: "zoom", places: zoomAwayStops([0]) },
|
|
1115
|
+
expectLayout: { items: { zoom: { edge: "toolbar" }, state: { rect: rect(1062, 0, 96, 32) }, page: { rect: rect(1158, 0, 42, 32) } }, order: { titlebar: ["title", "state", "page"] } }
|
|
1116
|
+
},
|
|
1075
1117
|
{
|
|
1076
1118
|
id: "R8-hand-fold-is-the-fold-form",
|
|
1077
1119
|
title: "A hand fold folds a toolbar group, it never steps to a variant",
|
|
@@ -2350,6 +2392,15 @@ var GRAB_SINCE = "26.11.46";
|
|
|
2350
2392
|
var GRIP_SINCE = "26.11.48";
|
|
2351
2393
|
var ROOM_SINCE = "26.11.50";
|
|
2352
2394
|
var STEP_SINCE = "26.11.51";
|
|
2395
|
+
var NEAR_SINCE = "26.11.52";
|
|
2396
|
+
var HAND_TRAIL = 48;
|
|
2397
|
+
var HAND_TRAIL_BEFORE_HOP = 56;
|
|
2398
|
+
var HAND_MARGIN = 6;
|
|
2399
|
+
function handBound(gap2, beforeHop = false) {
|
|
2400
|
+
return Math.max(beforeHop ? HAND_TRAIL_BEFORE_HOP : HAND_TRAIL, gap2 / 2 + HAND_MARGIN);
|
|
2401
|
+
}
|
|
2402
|
+
var NEAR_REACH = 12;
|
|
2403
|
+
var HAND_FAST = 0.375;
|
|
2353
2404
|
var LAST_WITHOUT_LANES = "26.11.44";
|
|
2354
2405
|
var LANES_DEADLINE = "2026-12-31";
|
|
2355
2406
|
var versionBefore = (a, b) => {
|
|
@@ -2360,6 +2411,55 @@ var versionBefore = (a, b) => {
|
|
|
2360
2411
|
};
|
|
2361
2412
|
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)));
|
|
2362
2413
|
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;
|
|
2414
|
+
var lo = (r, axis) => axis === "x" ? r.x : r.y;
|
|
2415
|
+
var len = (r, axis) => axis === "x" ? r.width : r.height;
|
|
2416
|
+
var outside = (a, b, p) => Math.max(a - p, 0, p - b);
|
|
2417
|
+
function handRule(row2, before, stretchPositions) {
|
|
2418
|
+
const previous = before ?? solve(row2.scene);
|
|
2419
|
+
const own = previous.items[row2.item];
|
|
2420
|
+
const press = row2.path[0];
|
|
2421
|
+
const options = { previous, ...own ? { grab: { x: press.x - own.rect.x, y: press.y - own.rect.y } } : {}, ...stretchPositions ? { stretchPositions } : {} };
|
|
2422
|
+
const bySpot = /* @__PURE__ */ new Map();
|
|
2423
|
+
const regionsOf = (spot) => {
|
|
2424
|
+
let r = bySpot.get(spot);
|
|
2425
|
+
if (!r) bySpot.set(spot, r = lanes(row2.scene, row2.item, spot ? { ...options, spot } : options));
|
|
2426
|
+
return r;
|
|
2427
|
+
};
|
|
2428
|
+
return {
|
|
2429
|
+
/**
|
|
2430
|
+
* The grab's share along the lane, as the landing model takes it: of the item's longer side along the lane when it
|
|
2431
|
+
* lies along it, else the middle (a sliding landing starts at the pointer less the share of its own length).
|
|
2432
|
+
*/
|
|
2433
|
+
share(axis) {
|
|
2434
|
+
if (!own) return 0.5;
|
|
2435
|
+
const long = own.rect.width >= own.rect.height ? "x" : "y";
|
|
2436
|
+
const size = len(own.rect, long);
|
|
2437
|
+
const g2 = long === "x" ? press.x - own.rect.x : press.y - own.rect.y;
|
|
2438
|
+
return axis === long && size > 0 && Number.isFinite(g2) ? Math.min(1, Math.max(0, g2 / size)) : 0.5;
|
|
2439
|
+
},
|
|
2440
|
+
/** The lane `lane` as drawn with `spot` held; as seen when the lane has no such spot (another host's ids). */
|
|
2441
|
+
laneOf(lane, spot) {
|
|
2442
|
+
const held = regionsOf(spot).lanes.find((l) => l.id === lane);
|
|
2443
|
+
return held?.spots.some((s) => s.id === spot) ? held : regionsOf("").lanes.find((l) => l.id === lane);
|
|
2444
|
+
},
|
|
2445
|
+
/**
|
|
2446
|
+
* `g`, px: the gap along the lane between the facing edges of the two adjacent landings the pointer `p` lies between
|
|
2447
|
+
* (a sliding spot's landings span its range); 0 where the pointer lies over a landing, or outside all of them.
|
|
2448
|
+
*/
|
|
2449
|
+
gapAt(lane, p) {
|
|
2450
|
+
const spans = lane.spots.map((s) => {
|
|
2451
|
+
const w = len(s.landing, lane.axis);
|
|
2452
|
+
return s.slide ? [Math.min(s.slide.from, s.slide.to), Math.max(s.slide.from, s.slide.to) + w] : [lo(s.landing, lane.axis), lo(s.landing, lane.axis) + w];
|
|
2453
|
+
}).sort((x, y) => x[0] - y[0]);
|
|
2454
|
+
let end = -Infinity;
|
|
2455
|
+
for (const [a, b] of spans) {
|
|
2456
|
+
if (Number.isFinite(end) && end < p && p < a) return a - end;
|
|
2457
|
+
end = Math.max(end, b);
|
|
2458
|
+
}
|
|
2459
|
+
return 0;
|
|
2460
|
+
}
|
|
2461
|
+
};
|
|
2462
|
+
}
|
|
2363
2463
|
var worstTrail = (frames) => Math.max(0, ...frames.filter((f2) => f2.moving && f2.region === "lane" && f2.landing).map((f2) => gapTo(f2.landing, f2.point)));
|
|
2364
2464
|
function homeIssues(item, before, after) {
|
|
2365
2465
|
const a = before.items[item];
|
|
@@ -2377,10 +2477,47 @@ function homeIssues(item, before, after) {
|
|
|
2377
2477
|
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)})`);
|
|
2378
2478
|
return out;
|
|
2379
2479
|
}
|
|
2380
|
-
function
|
|
2480
|
+
function nearGuideIssues(row2, frames, before, stretchPositions) {
|
|
2481
|
+
const out = [];
|
|
2482
|
+
let seen;
|
|
2483
|
+
const rectOf = (lane) => {
|
|
2484
|
+
if (!seen) {
|
|
2485
|
+
const previous = before ?? solve(row2.scene);
|
|
2486
|
+
const own = previous.items[row2.item];
|
|
2487
|
+
const press = row2.path[0];
|
|
2488
|
+
seen = lanes(row2.scene, row2.item, { previous, ...own ? { grab: { x: press.x - own.rect.x, y: press.y - own.rect.y } } : {}, ...stretchPositions ? { stretchPositions } : {} });
|
|
2489
|
+
}
|
|
2490
|
+
return seen.lanes.find((l) => l.id === lane)?.rect;
|
|
2491
|
+
};
|
|
2492
|
+
for (const f2 of frames) {
|
|
2493
|
+
if (!f2.guides || f2.guides.length === 0) continue;
|
|
2494
|
+
for (const lane of new Set(f2.guides.map((g2) => g2.lane))) {
|
|
2495
|
+
const holds = f2.lane === lane && (f2.region === "lane" || f2.region === "refused");
|
|
2496
|
+
const r = f2.region === "open" && !holds && f2.pending !== lane ? rectOf(lane) : void 0;
|
|
2497
|
+
if (holds || f2.pending === lane || r && gapTo(r, f2.point) <= NEAR_REACH + 0.5) continue;
|
|
2498
|
+
out.push(`at ${Math.round(f2.point.x)},${Math.round(f2.point.y)}: a Near guide of ${lane} over ${f2.region}${f2.lane ? ` in ${f2.lane}` : ""}, where the pointer neither holds ${lane}, nor is pending in it, nor is in open space within ${NEAR_REACH} px of it`);
|
|
2499
|
+
break;
|
|
2500
|
+
}
|
|
2501
|
+
if (out.length >= 4) break;
|
|
2502
|
+
}
|
|
2503
|
+
return out;
|
|
2504
|
+
}
|
|
2505
|
+
function guideSwitches(frames) {
|
|
2506
|
+
let n = 0;
|
|
2507
|
+
let was;
|
|
2508
|
+
for (const f2 of frames) {
|
|
2509
|
+
if (!f2.moving || !f2.guides || f2.guides.length === 0) continue;
|
|
2510
|
+
const now = [...new Set(f2.guides.map((g2) => g2.lane))].sort().join("+");
|
|
2511
|
+
if (was !== void 0 && now !== was) n++;
|
|
2512
|
+
was = now;
|
|
2513
|
+
}
|
|
2514
|
+
return n;
|
|
2515
|
+
}
|
|
2516
|
+
function landingIssues(row2, frames, layout, before, stretchPositions) {
|
|
2381
2517
|
const out = [];
|
|
2382
2518
|
const m = row2.moving;
|
|
2383
2519
|
if (frames.length === 0) return ["no frames"];
|
|
2520
|
+
const hand = m?.hand ? handRule(row2, before, stretchPositions) : void 0;
|
|
2384
2521
|
if (m)
|
|
2385
2522
|
for (const [i, f2] of frames.entries()) {
|
|
2386
2523
|
if (!f2.moving) continue;
|
|
@@ -2393,11 +2530,52 @@ function landingIssues(row2, frames, layout, before) {
|
|
|
2393
2530
|
if (m.notRegions && m.notRegions.includes(f2.region)) out.push(`${at2}: ${f2.region}`);
|
|
2394
2531
|
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`);
|
|
2395
2532
|
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" : ""})`);
|
|
2533
|
+
if (hand && f2.region === "lane" && f2.lane && f2.spot && f2.landing) {
|
|
2534
|
+
const lane = hand.laneOf(f2.lane, f2.spot);
|
|
2535
|
+
if (lane) {
|
|
2536
|
+
const p = lane.axis === "x" ? f2.point.x : f2.point.y;
|
|
2537
|
+
const l = f2.landing;
|
|
2538
|
+
const gap2 = hand.gapAt(lane, p);
|
|
2539
|
+
const limit = handBound(gap2, beforeHop);
|
|
2540
|
+
const d = gapTo(l, f2.point);
|
|
2541
|
+
if (d > limit + 0.5) out.push(`${at2}: the landing ${Math.round(d)} px from the pointer (at most ${Number(limit.toFixed(1))}${beforeHop ? ", the frame before a hop" : ""}${gap2 > 0 ? `, between landings ${Math.round(gap2)} px apart` : ""})`);
|
|
2542
|
+
const prev = frames[i - 1];
|
|
2543
|
+
const quick = !!prev && Math.hypot(f2.point.x - prev.point.x, f2.point.y - prev.point.y) / Math.max(f2.t - prev.t, 1e-6) > HAND_FAST;
|
|
2544
|
+
if (!quick) {
|
|
2545
|
+
const a = lo(l, lane.axis);
|
|
2546
|
+
const w0 = len(l, lane.axis);
|
|
2547
|
+
const here = outside(a, a + w0, p);
|
|
2548
|
+
let worst;
|
|
2549
|
+
for (const s of lane.spots) {
|
|
2550
|
+
const w = len(s.landing, lane.axis);
|
|
2551
|
+
const start = s.slide ? Math.min(Math.max(p - hand.share(lane.axis) * w, Math.min(s.slide.from, s.slide.to)), Math.max(s.slide.from, s.slide.to)) : lo(s.landing, lane.axis);
|
|
2552
|
+
if (Math.min(a + w0, start + w) - Math.max(a, start) > -0.5) continue;
|
|
2553
|
+
const there = outside(start, start + w, p);
|
|
2554
|
+
if (here - there > 2 * HAND_MARGIN + 0.5 && (!worst || here - there > worst.by)) worst = { by: here - there, id: s.id, there };
|
|
2555
|
+
}
|
|
2556
|
+
if (worst) out.push(`${at2}: the landing ${Math.round(here)} px from the pointer along ${f2.lane}, not the nearest landing (${worst.id}, ${Math.round(worst.there)} px)`);
|
|
2557
|
+
}
|
|
2558
|
+
} else {
|
|
2559
|
+
const limit = handBound(0, beforeHop);
|
|
2560
|
+
const d = gapTo(f2.landing, f2.point);
|
|
2561
|
+
if (d > limit + 0.5) out.push(`${at2}: the landing ${Math.round(d)} px from the pointer (at most ${limit}${beforeHop ? ", the frame before a hop" : ""}; the lane ${f2.lane} is not one lanes() gives)`);
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2396
2564
|
if (out.length >= 4) break;
|
|
2397
2565
|
}
|
|
2566
|
+
if (m?.nearGuides) out.push(...nearGuideIssues(row2, frames, before, stretchPositions));
|
|
2567
|
+
if (m?.guideSwitches !== void 0) {
|
|
2568
|
+
const n = guideSwitches(frames);
|
|
2569
|
+
if (n > m.guideSwitches) out.push(`the guides switch lane ${n} times along the path (at most ${m.guideSwitches})`);
|
|
2570
|
+
}
|
|
2398
2571
|
const last = frames.at(-1);
|
|
2399
2572
|
if (row2.end) {
|
|
2400
2573
|
if (last.region !== row2.end.region) out.push(`the last frame is ${last.region}, not ${row2.end.region}`);
|
|
2574
|
+
if (row2.end.pending !== void 0 && (last.pending ?? null) !== row2.end.pending) out.push(`the last frame has ${last.pending ?? "no lane"} pending, not ${row2.end.pending ?? "no lane"}`);
|
|
2575
|
+
if (row2.end.landing) {
|
|
2576
|
+
if (!last.landing) out.push("the last frame lands nowhere");
|
|
2577
|
+
else for (const k of ["x", "y", "width", "height"]) if (row2.end.landing[k] !== void 0 && Math.abs(last.landing[k] - row2.end.landing[k]) > 0.5) out.push(`the last frame's landing ${k} is ${Math.round(last.landing[k])}, not ${row2.end.landing[k]}`);
|
|
2578
|
+
}
|
|
2401
2579
|
if (row2.end.lane !== void 0 && last.lane !== row2.end.lane) out.push(`the last frame holds ${last.lane ?? "no lane"}, not ${row2.end.lane ?? "no lane"}`);
|
|
2402
2580
|
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}`);
|
|
2403
2581
|
}
|
|
@@ -2413,8 +2591,9 @@ async function runLandingCases(rows, host) {
|
|
|
2413
2591
|
continue;
|
|
2414
2592
|
}
|
|
2415
2593
|
try {
|
|
2416
|
-
const
|
|
2417
|
-
const
|
|
2594
|
+
const played = await host.play(row2);
|
|
2595
|
+
const { frames, layout, before } = played;
|
|
2596
|
+
const issues = landingIssues(row2, frames, layout, before, played.stretchPositions);
|
|
2418
2597
|
const over = row2.moving?.trailOverSlow;
|
|
2419
2598
|
if (over) {
|
|
2420
2599
|
const slow = await host.play({ ...row2, speed: over.slow });
|
|
@@ -2457,7 +2636,7 @@ function createLandingHost(o) {
|
|
|
2457
2636
|
const frames = [];
|
|
2458
2637
|
const play = (p, t2, moving) => {
|
|
2459
2638
|
const f2 = model.update(p, t2);
|
|
2460
|
-
frames.push({ t: t2, point: p, moving, region: f2.region, lane: f2.lane, spot: f2.spot, landing: f2.landing, room: f2.room, ...f2.guides ? { guides: f2.guides } : {} });
|
|
2639
|
+
frames.push({ t: t2, point: p, moving, region: f2.region, lane: f2.lane, spot: f2.spot, landing: f2.landing, room: f2.room, ...f2.guides ? { guides: f2.guides } : {}, ...f2.pending ? { pending: f2.pending } : {} });
|
|
2461
2640
|
};
|
|
2462
2641
|
let t = 0;
|
|
2463
2642
|
let at2 = press;
|
|
@@ -2472,7 +2651,7 @@ function createLandingHost(o) {
|
|
|
2472
2651
|
const spot = out?.kind === "spot" ? [...regions.lanes, ...regionsFor(out.spot).lanes].flatMap((l) => l.spots).find((x) => x.id === out.spot) : void 0;
|
|
2473
2652
|
const target = out?.kind === "float" ? regions.float : spot && out?.kind === "spot" && !out.home ? spot.target : null;
|
|
2474
2653
|
const next = target ? target.after(at2, grab).scene : s;
|
|
2475
|
-
return { frames, layout: solve(next, { previous }), before: previous };
|
|
2654
|
+
return { frames, layout: solve(next, { previous }), before: previous, ...o.stretchPositions ? { stretchPositions: o.stretchPositions } : {} };
|
|
2476
2655
|
}
|
|
2477
2656
|
};
|
|
2478
2657
|
}
|
|
@@ -2493,6 +2672,30 @@ function landingWindow(top = ["a"], bottom = []) {
|
|
|
2493
2672
|
floatKinds: ["group"]
|
|
2494
2673
|
};
|
|
2495
2674
|
}
|
|
2675
|
+
function railBesideColumn(bottom = ["a"]) {
|
|
2676
|
+
const pages = { id: "pages", kind: "panel", used: 9, forms: { column: [form("open", 120, 240, 240, { grows: true, crossMin: 180 }), form("header", 28, 28, 240, { crossMin: 60 }), form("rail", 28, 28, 30), form("menu", 0, 0, 0)], row: [form("header", 120, 160, 28), form("menu", 0, 0, 0)] } };
|
|
2677
|
+
return {
|
|
2678
|
+
stage: rect(0, 0, 1080, 640),
|
|
2679
|
+
edges: [
|
|
2680
|
+
bar2("bottom", "bottom", 0, bottom),
|
|
2681
|
+
{ id: "rail-left", side: "left", ring: 0, accepts: ["group"], items: [], cross: { min: 30, max: 30, rail: 30 }, compact: true, zones: ["start"] },
|
|
2682
|
+
{ id: "left-0", side: "left", ring: 1, column: true, accepts: ["panel"], items: ["pages"], cross: { min: 200, max: 480, rail: 32 }, gap: 12, hitBand: "middle" }
|
|
2683
|
+
],
|
|
2684
|
+
items: { ...Object.fromEntries(bottom.map((id, i) => [id, group2(id, i + 1)])), pages },
|
|
2685
|
+
floats: [],
|
|
2686
|
+
floatKinds: ["group"]
|
|
2687
|
+
};
|
|
2688
|
+
}
|
|
2689
|
+
function emptyCorner(bottom = ["b"]) {
|
|
2690
|
+
return {
|
|
2691
|
+
stage: rect(0, 0, 1080, 640),
|
|
2692
|
+
edges: [bar2("top", "top", 0, []), bar2("bottom", "bottom", 0, bottom), { id: "rail-left", side: "left", ring: 0, accepts: ["group"], items: [], cross: { min: 30, max: 30, rail: 30 }, compact: true, zones: ["start"] }],
|
|
2693
|
+
items: Object.fromEntries(bottom.map((id, i) => [id, group2(id, i + 1)])),
|
|
2694
|
+
floats: [],
|
|
2695
|
+
floatKinds: ["group"]
|
|
2696
|
+
};
|
|
2697
|
+
}
|
|
2698
|
+
var NEAR = { lanes: { since: NEAR_SINCE } };
|
|
2496
2699
|
var LANES = { lanes: { since: LANES_SINCE } };
|
|
2497
2700
|
var GRAB = { lanes: { since: GRAB_SINCE } };
|
|
2498
2701
|
var LANDING_CASES = [
|
|
@@ -2684,7 +2887,7 @@ var LANDING_CASES = [
|
|
|
2684
2887
|
{
|
|
2685
2888
|
id: "landing-grip-past-long-neighbor",
|
|
2686
2889
|
title: "A toolbar held by its grip and slid past a long neighbor stays at the hand",
|
|
2687
|
-
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
|
|
2890
|
+
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 stays at the hand (the hand rule: the nearest landing in the bar, within 48 px of the pointer, 56 on the frame before a hop, the landings either side of the neighbor close): the grab never moves a hop past the neighbor.",
|
|
2688
2891
|
scene: landingWindow(["a"], ["b", "c"]),
|
|
2689
2892
|
item: "b",
|
|
2690
2893
|
path: [
|
|
@@ -2693,13 +2896,13 @@ var LANDING_CASES = [
|
|
|
2693
2896
|
],
|
|
2694
2897
|
speed: 0.15,
|
|
2695
2898
|
rest: 40,
|
|
2696
|
-
moving: { lane: "bottom",
|
|
2899
|
+
moving: { lane: "bottom", hand: true },
|
|
2697
2900
|
requires: { lanes: { since: GRIP_SINCE } }
|
|
2698
2901
|
},
|
|
2699
2902
|
{
|
|
2700
2903
|
id: "landing-grip-across-items",
|
|
2701
2904
|
title: "A toolbar held by its grip and slid slowly across two neighbors stays at the hand",
|
|
2702
|
-
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
|
|
2905
|
+
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 stays at the hand (the hand rule: the nearest landing in the bar, within 48 px of the pointer, 56 on the frame before a hop, the landings either side of a neighbor close).",
|
|
2703
2906
|
scene: landingWindow(["a", "b", "c"]),
|
|
2704
2907
|
item: "a",
|
|
2705
2908
|
path: [
|
|
@@ -2708,13 +2911,13 @@ var LANDING_CASES = [
|
|
|
2708
2911
|
],
|
|
2709
2912
|
speed: 0.15,
|
|
2710
2913
|
rest: 40,
|
|
2711
|
-
moving: { lane: "top",
|
|
2914
|
+
moving: { lane: "top", hand: true },
|
|
2712
2915
|
requires: { lanes: { since: GRIP_SINCE } }
|
|
2713
2916
|
},
|
|
2714
2917
|
{
|
|
2715
2918
|
id: "landing-grip-up-the-rail",
|
|
2716
2919
|
title: "A rail toolbar held by its grip and pulled slowly up past its neighbor stays at the hand",
|
|
2717
|
-
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
|
|
2920
|
+
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 stays at the hand (the hand rule: the nearest landing in the rail, within max(48, g / 2 + 6) px of the pointer, g the gap between the two landings the pointer lies between, the 48 being 56 on the frame before a hop).",
|
|
2718
2921
|
scene: (() => {
|
|
2719
2922
|
const s = landingWindow();
|
|
2720
2923
|
const tools = group2("tools", 1);
|
|
@@ -2727,14 +2930,14 @@ var LANDING_CASES = [
|
|
|
2727
2930
|
],
|
|
2728
2931
|
speed: 0.15,
|
|
2729
2932
|
rest: 40,
|
|
2730
|
-
moving: { lane: "rail-left",
|
|
2933
|
+
moving: { lane: "rail-left", hand: true },
|
|
2731
2934
|
requires: { lanes: { since: GRIP_SINCE } }
|
|
2732
2935
|
},
|
|
2733
2936
|
...[0.15, 0.6].map(
|
|
2734
2937
|
(speed) => ({
|
|
2735
2938
|
id: `landing-room-up-past-placed-${speed === 0.15 ? "slow" : "fast"}`,
|
|
2736
2939
|
title: `A rail toolbar held by its grip and pulled up past a long neighbor that keeps room stays at the hand (${speed} px/ms)`,
|
|
2737
|
-
expect: `Tools (158 px) keeps 100 px of room above it at the rail's head, and Zoom keeps 80 px below Tools. Zoom pressed by its grip and pulled straight up past Tools to the rail's head at ${speed} px/ms: every frame holds the rail, and the landing
|
|
2940
|
+
expect: `Tools (158 px) keeps 100 px of room above it at the rail's head, and Zoom keeps 80 px below Tools. Zoom pressed by its grip and pulled straight up past Tools to the rail's head at ${speed} px/ms: every frame holds the rail, and the landing stays at the hand (the hand rule: the nearest landing in the rail, within max(48, g / 2 + 6) px of the pointer, g the gap between the two landings the pointer lies between, the 48 being 56 on the frame before a hop). Over the free room a drop consumes it; over Tools, Zoom takes Tools' place and Tools gives way, so the landings either side of Tools are never a whole Tools apart.`,
|
|
2738
2941
|
scene: (() => {
|
|
2739
2942
|
const s = landingWindow();
|
|
2740
2943
|
const tools = group2("tools", 1);
|
|
@@ -2748,14 +2951,14 @@ var LANDING_CASES = [
|
|
|
2748
2951
|
],
|
|
2749
2952
|
speed,
|
|
2750
2953
|
rest: 40,
|
|
2751
|
-
moving: { lane: "rail-left",
|
|
2954
|
+
moving: { lane: "rail-left", hand: true },
|
|
2752
2955
|
requires: { lanes: { since: ROOM_SINCE } }
|
|
2753
2956
|
})
|
|
2754
2957
|
),
|
|
2755
2958
|
{
|
|
2756
2959
|
id: "landing-step-down-room",
|
|
2757
2960
|
title: "A toolbar slid over room that a neighbor steps down to make stays at the hand",
|
|
2758
|
-
expect: "An 870 px bottom bar: Panels (362 px, 60 in its short form) at its start, Status (382 px) at its end, 109 px between them: 93 px of room for an item less the 8 px gap each side, shorter than Tools (130 px). Tools brought from the document onto the bar and slid right along it at 0.3 px/ms: a drop between them steps Panels down, and the room that makes (266 px past Tools' length) is one sliding stretch, so whenever the bar holds it the landing
|
|
2961
|
+
expect: "An 870 px bottom bar: Panels (362 px, 60 in its short form) at its start, Status (382 px) at its end, 109 px between them: 93 px of room for an item less the 8 px gap each side, shorter than Tools (130 px). Tools brought from the document onto the bar and slid right along it at 0.3 px/ms: a drop between them steps Panels down, and the room that makes (266 px past Tools' length) is one sliding stretch, so whenever the bar holds it the landing stays at the hand (the hand rule: the nearest landing in the bar, within max(48, g / 2 + 6) px of the pointer, g the gap between the two landings the pointer lies between, the 48 being 56 on the frame before a hop).",
|
|
2759
2962
|
scene: (() => {
|
|
2760
2963
|
const row2 = (kind, w) => form(kind, w, w, 31);
|
|
2761
2964
|
const g2 = (id, used, forms, more = {}) => ({ id, kind: "group", used, forms, ...more });
|
|
@@ -2781,7 +2984,7 @@ var LANDING_CASES = [
|
|
|
2781
2984
|
],
|
|
2782
2985
|
speed: 0.3,
|
|
2783
2986
|
rest: 40,
|
|
2784
|
-
moving: {
|
|
2987
|
+
moving: { hand: true },
|
|
2785
2988
|
end: { region: "lane", lane: "bottom" },
|
|
2786
2989
|
requires: { lanes: { since: STEP_SINCE } }
|
|
2787
2990
|
},
|
|
@@ -2800,6 +3003,81 @@ var LANDING_CASES = [
|
|
|
2800
3003
|
speed: 1.2,
|
|
2801
3004
|
moving: { notRegions: ["open"], trailOverSlow: { slow: 0.05, by: 40 } },
|
|
2802
3005
|
requires: LANES
|
|
3006
|
+
},
|
|
3007
|
+
{
|
|
3008
|
+
id: "landing-near-rail-glide",
|
|
3009
|
+
title: "A toolbar glided to an empty rail beside a panel column shows no guide until it can enter the rail",
|
|
3010
|
+
expect: "A toolbar lifted from the bottom bar and glided at 0.3 px/ms up and left over a panel column (it takes no toolbar) to the empty left rail's strip, resting there 40 ms: the rail's guide shows only once the pointer is in the strip, never over the column on the way (the Near guides' rule: a lane's guide shows where the pointer holds it, is pending in it, or is in open space within 12 px of it), the rail holds the pointer from its first slow step in the strip (the place under it is the column's, which takes nothing, and there is nothing else to mean there), and the toolbar takes the rail's icons form, in the rail's 30 px, as it lands.",
|
|
3011
|
+
scene: railBesideColumn(),
|
|
3012
|
+
item: "a",
|
|
3013
|
+
path: [
|
|
3014
|
+
{ x: 60, y: 622 },
|
|
3015
|
+
{ x: 15, y: 320 }
|
|
3016
|
+
],
|
|
3017
|
+
speed: 0.3,
|
|
3018
|
+
rest: 40,
|
|
3019
|
+
moving: { nearGuides: true, hand: true },
|
|
3020
|
+
end: { region: "lane", lane: "rail-left", landing: { x: 0, width: 30 } },
|
|
3021
|
+
layout: { items: { a: { edge: "rail-left", formKind: "icons" } }, order: { "rail-left": ["a"] } },
|
|
3022
|
+
requires: NEAR
|
|
3023
|
+
},
|
|
3024
|
+
{
|
|
3025
|
+
id: "landing-near-rail-pending-release",
|
|
3026
|
+
title: "A release while the rail is pending floats nothing and goes home",
|
|
3027
|
+
expect: "The same toolbar glided at 0.6 px/ms (a fast hand: faster than the gate's 0.375 px/ms) into the rail's strip and released on arrival: the rail is pending (the pointer is inside it, its gate not passed), its guide shows (the Near guides' rule), the last frame lands nowhere (the place under it is the column's), and the release puts the toolbar back in the bottom bar.",
|
|
3028
|
+
scene: railBesideColumn(),
|
|
3029
|
+
item: "a",
|
|
3030
|
+
path: [
|
|
3031
|
+
{ x: 60, y: 622 },
|
|
3032
|
+
{ x: 15, y: 320 }
|
|
3033
|
+
],
|
|
3034
|
+
speed: 0.6,
|
|
3035
|
+
moving: { nearGuides: true },
|
|
3036
|
+
end: { region: "refused", lane: null, pending: "rail-left" },
|
|
3037
|
+
layout: { items: { a: { edge: "bottom" } } },
|
|
3038
|
+
requires: NEAR
|
|
3039
|
+
},
|
|
3040
|
+
{
|
|
3041
|
+
id: "landing-near-corner-steady",
|
|
3042
|
+
title: "At a corner between two lanes the Near guides don't flicker",
|
|
3043
|
+
expect: "A toolbar lifted from the bottom bar, taken into the open space at the corner where the top bar meets the left rail (x 30, y 36) and moved back and forth across it at 0.3 px/ms, 8 px each way, between points where one lane is nearer then the other (both within 12 px): the guides go from the bottom bar's to one lane's once, and stay that lane's, never switching to the other and back (the kept lane gives way only to one 16 px nearer); the release there is in open space, a float.",
|
|
3044
|
+
scene: landingWindow(["a"], ["b"]),
|
|
3045
|
+
item: "b",
|
|
3046
|
+
path: [
|
|
3047
|
+
{ x: 60, y: 622 },
|
|
3048
|
+
{ x: 100, y: 60 },
|
|
3049
|
+
// Back and forth three times: the top bar is nearer at the first point, the rail at the second.
|
|
3050
|
+
...[0, 1, 2].flatMap(() => [
|
|
3051
|
+
{ x: 40, y: 38 },
|
|
3052
|
+
{ x: 32, y: 46 }
|
|
3053
|
+
]),
|
|
3054
|
+
{ x: 40, y: 38 }
|
|
3055
|
+
],
|
|
3056
|
+
speed: 0.3,
|
|
3057
|
+
rest: 40,
|
|
3058
|
+
moving: { nearGuides: true, guideSwitches: 1 },
|
|
3059
|
+
end: { region: "open" },
|
|
3060
|
+
layout: { items: { b: { floating: true } } },
|
|
3061
|
+
requires: NEAR
|
|
3062
|
+
},
|
|
3063
|
+
{
|
|
3064
|
+
id: "landing-near-pending-corner-steady",
|
|
3065
|
+
title: "Inside two lanes that overlap at a corner, the pending lane doesn't flicker",
|
|
3066
|
+
expect: "A toolbar lifted from the bottom bar and carried at 0.6 px/ms into the corner where the empty top bar's band and the empty left rail's overlap, then moved back and forth inside both, between (26, 21), deeper in the bar, and (20, 27), a pixel deeper in the rail: neither lane is entered (the hand never slows), the bar is pending from the first point inside both and stays pending (the other lane takes over only once it is deeper by the spot margin, 6 px), so the guides go from the bottom bar's to the top bar's once.",
|
|
3067
|
+
scene: emptyCorner(),
|
|
3068
|
+
item: "b",
|
|
3069
|
+
path: [
|
|
3070
|
+
{ x: 60, y: 622 },
|
|
3071
|
+
{ x: 100, y: 100 },
|
|
3072
|
+
{ x: 26, y: 21 },
|
|
3073
|
+
...[0, 1, 2, 3].flatMap(() => [
|
|
3074
|
+
{ x: 20, y: 27 },
|
|
3075
|
+
{ x: 26, y: 21 }
|
|
3076
|
+
])
|
|
3077
|
+
],
|
|
3078
|
+
speed: 0.6,
|
|
3079
|
+
moving: { nearGuides: true, guideSwitches: 1, notLanes: ["top", "rail-left"] },
|
|
3080
|
+
requires: NEAR
|
|
2803
3081
|
}
|
|
2804
3082
|
];
|
|
2805
3083
|
|
|
@@ -2825,11 +3103,17 @@ export {
|
|
|
2825
3103
|
END_REACH,
|
|
2826
3104
|
GRAB_SINCE,
|
|
2827
3105
|
GRIP_SINCE,
|
|
3106
|
+
HAND_FAST,
|
|
3107
|
+
HAND_MARGIN,
|
|
3108
|
+
HAND_TRAIL,
|
|
3109
|
+
HAND_TRAIL_BEFORE_HOP,
|
|
2828
3110
|
LANDING_CASES,
|
|
2829
3111
|
LANES_DEADLINE,
|
|
2830
3112
|
LANES_SINCE,
|
|
2831
3113
|
LAST_WITHOUT_LANES,
|
|
2832
3114
|
LIFT_THRESHOLD,
|
|
3115
|
+
NEAR_REACH,
|
|
3116
|
+
NEAR_SINCE,
|
|
2833
3117
|
ROOM_SINCE,
|
|
2834
3118
|
STEP_SINCE,
|
|
2835
3119
|
WINDOW_A,
|
|
@@ -2840,6 +3124,7 @@ export {
|
|
|
2840
3124
|
createSceneHost,
|
|
2841
3125
|
defaultItemSelector,
|
|
2842
3126
|
g,
|
|
3127
|
+
handBound,
|
|
2843
3128
|
idRenames,
|
|
2844
3129
|
landingIssues,
|
|
2845
3130
|
lanesRatchet,
|
|
@@ -2849,6 +3134,7 @@ export {
|
|
|
2849
3134
|
mapPlace,
|
|
2850
3135
|
mapScene,
|
|
2851
3136
|
mapStored,
|
|
3137
|
+
nearGuideIssues,
|
|
2852
3138
|
pickTarget,
|
|
2853
3139
|
resizeStep,
|
|
2854
3140
|
resolvePlace,
|