@n-uf/placement 26.11.45 → 26.11.46
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 +21 -0
- package/README.md +16 -4
- package/dist/{chunk-6IHRZ3NP.js → chunk-A4DQQX7W.js} +11 -5
- package/dist/{chunk-6IHRZ3NP.js.map → chunk-A4DQQX7W.js.map} +1 -1
- package/dist/{lanes-CRAFabRE.d.ts → lanes-BFqBNGvs.d.ts} +18 -2
- package/dist/scene-cases.d.ts +7 -2
- package/dist/scene-cases.js +40 -3
- package/dist/scene-cases.js.map +1 -1
- package/dist/scene.d.ts +2 -2
- package/dist/scene.js +1 -1
- package/package.json +2 -2
|
@@ -1040,8 +1040,10 @@ interface SceneRefusal {
|
|
|
1040
1040
|
* 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
1041
|
* `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
1042
|
* 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.
|
|
1044
|
-
*
|
|
1043
|
+
* 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
|
|
1044
|
+
* measured where the item is held (`options.grab`): halfway between the points the pointer would hold in each landing,
|
|
1045
|
+
* so a pointer back at its press point picks the item's own place however far from its middle it was pressed. Cuts are
|
|
1046
|
+
* kept inside the lane and in order. The spots come from the same generation and filter as `targets()`, so a spot's
|
|
1045
1047
|
* landing is exactly what its drop commits. Spot ids are keyed by the lane, zone and neighboring items, so they survive
|
|
1046
1048
|
* the window resizing and most items opening or moving; virtual lanes are keyed by the column they lie beside, not
|
|
1047
1049
|
* their ring. Remembered per scene and options; a call with `spot` reworks only the held lane's stretches.
|
|
@@ -1127,6 +1129,20 @@ interface LaneOptions extends SceneTargetOptions {
|
|
|
1127
1129
|
readonly pitch?: number;
|
|
1128
1130
|
/** The spot held now: its lane's stretches are drawn in its own layout (the room open). Default: the layout as seen. */
|
|
1129
1131
|
readonly spot?: string;
|
|
1132
|
+
/**
|
|
1133
|
+
* Where the pointer holds the item, from its top left corner as it is now, px (what a target's `after(point, grab)`
|
|
1134
|
+
* takes): the press's, constant for the drag (each grab is remembered as its own options), and the same in the call
|
|
1135
|
+
* 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 spots lies halfway between the points the pointer would hold in each landing
|
|
1137
|
+
* (with landings of one length; at the same share of each), so a pointer back at its press point picks the item's own
|
|
1138
|
+
* place. Across the item, and in a lane across its length (a rail toolbar over a bar), it is the item's middle, as
|
|
1139
|
+
* without a grab. Panel columns take a panel by halves of what is drawn either way. Where another lane's band
|
|
1140
|
+
* overlaps the press point (an empty bar's band over a rail's end) that lane can still take the pointer first.
|
|
1141
|
+
*/
|
|
1142
|
+
readonly grab?: {
|
|
1143
|
+
readonly x: number;
|
|
1144
|
+
readonly y: number;
|
|
1145
|
+
};
|
|
1130
1146
|
}
|
|
1131
1147
|
/**
|
|
1132
1148
|
* The lanes and regions of a drag of `dragged`: every lane that takes it with its spots and stretches, the refused
|
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-BFqBNGvs.js';
|
|
4
4
|
import './target-BBOCeez2.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -604,6 +604,11 @@ declare function winScene(spec: WinSpec, o?: WinOptions): Scene;
|
|
|
604
604
|
* version once that is past 26.11.44).
|
|
605
605
|
*/
|
|
606
606
|
declare const LANES_SINCE = "26.11.45";
|
|
607
|
+
/**
|
|
608
|
+
* The first library version whose `lanes()` takes the grab (`LaneOptions.grab`): the rows that bring an item back to
|
|
609
|
+
* its press point need it, and a host must pass the grab to `lanes()` for them to pass.
|
|
610
|
+
*/
|
|
611
|
+
declare const GRAB_SINCE = "26.11.46";
|
|
607
612
|
/** The last published version without `lanes()`. */
|
|
608
613
|
declare const LAST_WITHOUT_LANES = "26.11.44";
|
|
609
614
|
/** From this date every landing row runs on every host (or at the breaking release, if that comes first). */
|
|
@@ -771,4 +776,4 @@ declare const CASE_GROUPS: readonly {
|
|
|
771
776
|
/** The row with this id, or undefined. */
|
|
772
777
|
declare const caseById: (id: string) => CaseRow | undefined;
|
|
773
778
|
|
|
774
|
-
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, 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 };
|
|
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 };
|
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-A4DQQX7W.js";
|
|
24
24
|
import "./chunk-AE3BWTAE.js";
|
|
25
25
|
import {
|
|
26
26
|
centre,
|
|
@@ -2346,6 +2346,7 @@ async function runCasesAsync(rows, makeHost, options = {}) {
|
|
|
2346
2346
|
|
|
2347
2347
|
// src/scene/cases/landing.ts
|
|
2348
2348
|
var LANES_SINCE = "26.11.45";
|
|
2349
|
+
var GRAB_SINCE = "26.11.46";
|
|
2349
2350
|
var LAST_WITHOUT_LANES = "26.11.44";
|
|
2350
2351
|
var LANES_DEADLINE = "2026-12-31";
|
|
2351
2352
|
var versionBefore = (a, b) => {
|
|
@@ -2424,8 +2425,8 @@ function createLandingHost(o) {
|
|
|
2424
2425
|
if (!own) throw new Error(`no item ${row2.item}`);
|
|
2425
2426
|
const press = row2.path[0];
|
|
2426
2427
|
const grab = { x: press.x - own.rect.x, y: press.y - own.rect.y };
|
|
2427
|
-
const regions = lanes(s, row2.item, { previous });
|
|
2428
|
-
const regionsFor = (spot2) => lanes(s, row2.item, { previous, spot: spot2 });
|
|
2428
|
+
const regions = lanes(s, row2.item, { previous, grab });
|
|
2429
|
+
const regionsFor = (spot2) => lanes(s, row2.item, { previous, grab, spot: spot2 });
|
|
2429
2430
|
const home = regions.lanes.flatMap((l) => l.spots.filter((x) => x.home).map((x) => ({ lane: l.id, spot: x.id })))[0];
|
|
2430
2431
|
const model = o.landing({ regions, regionsFor, floatLanding: (p) => regions.float?.after(p, grab).layout.items[row2.item]?.rect ?? null, ...home ? { home } : {}, placeGuides: "near" });
|
|
2431
2432
|
const frames = [];
|
|
@@ -2468,6 +2469,7 @@ function landingWindow(top = ["a"], bottom = []) {
|
|
|
2468
2469
|
};
|
|
2469
2470
|
}
|
|
2470
2471
|
var LANES = { lanes: { since: LANES_SINCE } };
|
|
2472
|
+
var GRAB = { lanes: { since: GRAB_SINCE } };
|
|
2471
2473
|
var LANDING_CASES = [
|
|
2472
2474
|
{
|
|
2473
2475
|
id: "landing-rail-repro",
|
|
@@ -2620,6 +2622,40 @@ var LANDING_CASES = [
|
|
|
2620
2622
|
moving: { lane: "top", trail: 40 },
|
|
2621
2623
|
requires: LANES
|
|
2622
2624
|
},
|
|
2625
|
+
{
|
|
2626
|
+
id: "landing-back-home-bar",
|
|
2627
|
+
title: "A toolbar taken away by its end and brought back lands home",
|
|
2628
|
+
expect: "A toolbar pressed 12 px from its right end in its bar (the free stretch's spots lie that way), moved into the document and back to the press point at 0.6 px/ms, resting there 80 ms: it ends on its own place, not on a free-stretch spot beside it.",
|
|
2629
|
+
scene: landingWindow(),
|
|
2630
|
+
item: "a",
|
|
2631
|
+
path: [
|
|
2632
|
+
{ x: 196, y: 18 },
|
|
2633
|
+
{ x: 500, y: 300 },
|
|
2634
|
+
{ x: 196, y: 18 }
|
|
2635
|
+
],
|
|
2636
|
+
speed: 0.6,
|
|
2637
|
+
rest: 80,
|
|
2638
|
+
end: { region: "lane", lane: "top" },
|
|
2639
|
+
layout: { items: { a: { edge: "top", rect: { x: 8 } } } },
|
|
2640
|
+
requires: GRAB
|
|
2641
|
+
},
|
|
2642
|
+
{
|
|
2643
|
+
id: "landing-back-home-rail",
|
|
2644
|
+
title: "A rail toolbar taken away by its bottom and brought back lands home",
|
|
2645
|
+
expect: "Zoom pressed 6 px above its bottom in its rail (the free stretch's spots lie below it), moved into the document and back to the press point at 0.6 px/ms, resting there 80 ms: it ends where it was, below Tools.",
|
|
2646
|
+
scene: landingWindow(),
|
|
2647
|
+
item: "zoom",
|
|
2648
|
+
path: [
|
|
2649
|
+
{ x: 15, y: 198 },
|
|
2650
|
+
{ x: 500, y: 300 },
|
|
2651
|
+
{ x: 15, y: 198 }
|
|
2652
|
+
],
|
|
2653
|
+
speed: 0.6,
|
|
2654
|
+
rest: 80,
|
|
2655
|
+
end: { region: "lane", lane: "rail-left" },
|
|
2656
|
+
layout: { order: { "rail-left": ["tools", "zoom"] }, items: { zoom: { rect: { y: 120 } } } },
|
|
2657
|
+
requires: GRAB
|
|
2658
|
+
},
|
|
2623
2659
|
{
|
|
2624
2660
|
id: "landing-across-items",
|
|
2625
2661
|
title: "A fast hand across docked items trails no further than it must",
|
|
@@ -2658,6 +2694,7 @@ export {
|
|
|
2658
2694
|
CASES,
|
|
2659
2695
|
CASE_GROUPS,
|
|
2660
2696
|
END_REACH,
|
|
2697
|
+
GRAB_SINCE,
|
|
2661
2698
|
LANDING_CASES,
|
|
2662
2699
|
LANES_DEADLINE,
|
|
2663
2700
|
LANES_SINCE,
|