@n-uf/motion 26.11.54 → 26.11.56

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/dist/drag.d.ts CHANGED
@@ -91,7 +91,9 @@ interface DragModifiers {
91
91
  */
92
92
  declare const DRAG_DEFAULTS: DragTuning;
93
93
  /**
94
- * A drop target: plain data. `hit` is the zone the pointer can be in;
94
+ * A drop target: plain data. The spring-loading and room fields (`arm`, `armedHit`, `opensRoom`, `roomHold`, `roomHit`) are
95
+ * the intent's own: they are read here, and `@n-uf/docking`'s `DockDrop` sets them (`@n-uf/placement`'s `Target` has none
96
+ * of them). `hit` is the zone the pointer can be in;
95
97
  * `priority` how precise it is (1 beats 2 beats 3; equal priorities go to the
96
98
  * smaller zone). `slot` is where the dragged item would land, `label` what to
97
99
  * call it; the model reads neither. A `free` target has no slot (the item
@@ -155,7 +157,8 @@ interface DragTarget {
155
157
  * 1, 2 and 3; a refusal's tier is `refuse: true`, and the pick orders it by this rank on the same scale: after every
156
158
  * target of priority 1 and 2 (a refusal and a real target where they meet or overlap: the target wins, so a gap keeps
157
159
  * its end), before priority 3 (the float: over drawn space that takes nothing, the refusal wins over floating).
158
- * Among refusals the smaller zone wins. `@n-uf/placement` exports the same value for its reference pick.
160
+ * Among refusals the smaller zone wins. This is the one export of the rank: `@n-uf/docking`'s reference host (which doesn't
161
+ * import motion) keeps a private copy of the same value, and a test holds the two equal.
159
162
  */
160
163
  declare const REFUSAL_RANK = 2.5;
161
164
  /** A target's rank in the pick: its `priority`, a refusal's {@link REFUSAL_RANK}. Lower wins. */
@@ -381,6 +384,11 @@ interface DragPreview {
381
384
  declare const DRAG_PREVIEW_DEFAULT: DragPreview;
382
385
  /** Each mode's place guides when it names none: Snap and Placeholder near, Outline and Glide none. */
383
386
  declare const PLACE_GUIDES_DEFAULT: Readonly<Record<PreviewMode, PlaceGuides>>;
387
+ /**
388
+ * The place guides a preview asks for: its `placeGuides`, else its mode's default. The one reading of the level:
389
+ * `previewPlan` draws it, and the landing model (`createLandingModel({ preview })`) names its lanes by it.
390
+ */
391
+ declare function guidesOf(preview: DragPreview | PreviewMode): PlaceGuides;
384
392
  /** What to draw for one frame of a drag. */
385
393
  interface PreviewPlan {
386
394
  /** Draw the indicator on the shown landing. */
@@ -419,11 +427,13 @@ type PreviewFrame<T extends DragTarget = DragTarget> = Pick<DragFrame<T>, "shown
419
427
  declare function previewPlan<T extends DragTarget>(frame: PreviewFrame<T>, preview: DragPreview | PreviewMode, slotted?: boolean): PreviewPlan;
420
428
 
421
429
  /**
422
- * The landing model: where a docking drag's item lands, as state rather than a per-frame guess. A host gives it the
423
- * drag's regions (from `@n-uf/docking`'s `lanes()`: plain data, the shapes below) and each pointer sample; it
424
- * says the region the pointer is in, the lane and spot held, where the item lands, whether the room is open, and the
425
- * place guides. Every change comes from where the pointer is and how it moved (margins, a path length, a step size):
426
- * the model has no waits of its own.
430
+ * The landing model: where a docking drag's item lands, as a held place rather than a per-frame guess. A host gives it the
431
+ * drag's geometry (`@n-uf/docking`'s `dockDrag(...)` fits `LandingGeometry` as it is: the regions for hit-testing and
432
+ * `landingOf(held)`) and each pointer sample; it says the region the pointer is in, the lane and spot held, the held place a
433
+ * release lands (`frame.held`), where the item lands, whether the room is open, and which lanes' place guides show with
434
+ * the held place each stands for. It picks held places and does no layout: every rect of a held place comes from the geometry. Every
435
+ * change comes from where the pointer is and how it moved (margins, a path length, a step size): the model has no waits
436
+ * of its own.
427
437
  *
428
438
  * - **The stage's edge** is the easiest place to dock: a pointer past the stage by up to `edge` px counts as on its
429
439
  * edge, so it lies deep inside a lane drawn against that edge; beyond, it is nowhere.
@@ -464,41 +474,43 @@ declare function previewPlan<T extends DragTarget>(frame: PreviewFrame<T>, previ
464
474
  * lane the pointer came through (a plain lane's band over the home lane's corner included), and its spot is the
465
475
  * item's own (`home.spot`; a sliding one still lets the landing follow the hand and snap): away and back to where the
466
476
  * item was lifted is home on every layout, so no nudge to a neighboring spot is reachable within `lift` of the press.
467
- * The zone is a held state like a held lane: the drag starts in it, leaves it past `lift` and re-enters only within
477
+ * The zone is held like a held lane: the drag starts in it, leaves it past `lift` and re-enters only within
468
478
  * `lift - spot`, so a wobble at its edge never flips a cut near the press.
479
+ * - **A float's lift zone.** A lift is a float's when it has no `home` option and no lane has a spot marked `home` (a
480
+ * docked item's own place; docking always marks it), so a docked item lifted without `home` stays docked. A float has a zone of
481
+ * its own, the same `margins.lift` around the press: within it no lane takes the pointer, and the frame is judged as if
482
+ * the regions had no lanes (the float is at the hand, so a nudge moves it; blocked and refused places are judged as on
483
+ * any frame, so a float lying over one is refused there). No lane's path counts inside it. The zone is left once, at
484
+ * the first point farther than `lift` from the press, and never re-entered: the lanes act as usual from then on, a
485
+ * held lane included, so a slide back through the press point changes nothing. A float lying inside a lane's band
486
+ * (an empty bar's) stays a float for the first `lift` px, and the lane takes it by its gates after.
469
487
  * - **Along a lane** the spot changes once the pointer is `spot` px past the boundary; where the change moves another
470
488
  * item (the two spots' `others` keys differ), on a step of at most `stepSpeed`, or once the held landing trails the
471
- * pointer by more than `trail`: the item chases only as far as it must. A change that moves only the held item
472
- * follows the hand at any speed. With `regionsFor`, a reflowing change is kept only if, in the new spot's own regions
473
- * (its room open), the pointer still lies in that spot's stretch: the room shifting the boundary never bounces it.
474
- * - **A sliding spot** (`slide`: a free stretch as one spot) lands where the hand is: its landing moved along the lane to
475
- * the pointer less the grab (`grab`), clamped to its range, and snapped to its ends, the item's own place or a dock
476
- * inside within `snapDistance`. Nothing reflows inside it, so there are no steps there; a step comes only where the
477
- * order changes (passing a neighbor), as between any two spots. A release reads where it starts (`at`) once.
489
+ * pointer by more than `trail` (`landingOf` the spot held): the item chases only as far as it must. A change that
490
+ * moves only the held item follows the hand at any speed. With `spotsOf`, a reflowing change is kept only if, with the
491
+ * new spot held (its room open), the pointer still lies in that spot's stretch: the room shifting the boundary never
492
+ * bounces it.
493
+ * - **A sliding spot** (a free stretch as one spot) lands where the hand is: the model names the spot and the pointer,
494
+ * and the geometry says where (`landingOf`). Nothing reflows inside it, so there are no steps there; a step comes only
495
+ * where the order changes (passing a neighbor), as between any two spots.
478
496
  * - **Outside every lane:** a refused place, refused; open space (`"open"`: the content less what blocks it, the page),
479
497
  * the float at its landing; outside the stage (past `edge`), nowhere; else (docked content that takes nothing and
480
498
  * refuses nothing) refused.
481
- * - **Shift** turns a lane or open space into open space (the float), and hides the guides.
482
- * - **Guides** are the lane's `marks` (lines between items, a box per free stretch, in the layout as drawn), else its
483
- * spots' landings. `"near"` shows a lane only where the pointer can enter it: the held lane's (also over its own
499
+ * - **The float key** (`modifiers.floatKey`, Shift by default) turns a lane or open space into open space (the float), and
500
+ * hides the guides.
501
+ * - **Guides** name lanes and the held place each lane's guide stands for (`frame.guides`); the geometry draws them (a lane's
502
+ * marks in that held place's layout). `"near"` shows a lane only where the pointer can enter it: the held lane's (also over its own
484
503
  * refused stretch); else the pending lane's (the pointer inside it, its gate not passed: a release floats or goes
485
504
  * home); else, with the pointer in open space, the approached lane's (the nearest within `reach`, by default the
486
505
  * entry margin `exit`, acquired within `max(reach - spot, reach / 2)` and kept to `reach`, so it never blinks at the
487
506
  * edge: a release floats). Over a refused place outside every lane no guide shows, however near the lane behind it
488
507
  * lies; a host that wants the early guide sets `approach.reach` (in open space only: over a refused place none shows
489
- * at any reach). That lane (the one the Near rule picks) shows its `entry` marks where it has them (docking's
490
- * prediction of an empty lane's marks once entered), so its guide before entry is its mark after it. Its guide leaves
491
- * out the held toolbar at the landing it takes there (held) or would take (the spot the pointer picks, a sliding
492
- * spot's start from the grab), never at its floating rect, so a host passes no held rect in `guideRects`' `clear`; a
493
- * part that cut leaves no longer than `MIN_BOX_LENGTH` (the padding before a clamped landing) is not drawn. `"all"`
494
- * shows every lane's; the lane the Near rule picks shows its `entry` and owns the corners it shares: each lane it
495
- * names in `corners` is cut by what the owner draws (its guide, less the landing), by the interval subtraction of
496
- * `guideRects`, but only where that mark covers the lane's marks across their whole thickness; otherwise the named
497
- * lane keeps the corner and the owner's mark gives the overlap up. Every mark is compared as it is drawn: inside its
498
- * lane's `rect`, a line at its drawn thickness (2 px). Under `"near"` too the Near lane's `entry` is clipped to its
499
- * `rect`. With no Near lane, the corner goes to the lane with `entry` nearest the pointer within `reach`, for the
500
- * corner only (it isn't made Near, pending or enterable). Beyond reach of every such lane, every lane's `marks`,
501
- * where the bar keeps a shared corner. No two lanes' guides overlap on any frame.
508
+ * at any reach). That lane (the one the Near rule picks), held, stands for the frame's held place; pending or approached,
509
+ * for the held place the pointer would land in there (the spot it picks along it), so its guide before entry is its mark
510
+ * after it. `"all"` shows every lane's, every other lane standing for the frame's held place (the screen); with no Near
511
+ * lane, the lane nearest the pointer within `reach` stands for its would-land held place, for the corner only (not made
512
+ * Near, pending or enterable), switching exactly at `reach`. Where that lane's guide meets another's, the geometry
513
+ * gives it that lane.
502
514
  * - Steps are speeds (px/ms) between points that differ, so the gates read the same at any input rate. A repeated
503
515
  * point keeps the last step; it is still only once the pointer has stayed put for `rest` ms.
504
516
  * - **The pointer** is taken onto the stage by the model itself (past it by up to `edge`, onto its edge).
@@ -506,53 +518,21 @@ declare function previewPlan<T extends DragTarget>(frame: PreviewFrame<T>, previ
506
518
  * **The host's part:** call `update` whenever you like: per pointer sample, per animation frame, or both. Call it at
507
519
  * least once more after the pointer stops (every frame does), so it can become still, and again with the same point
508
520
  * when a key changes. `release(point, time)` takes the release point as one more sample when it differs from the last.
509
- * Give `setRegions` the `regionsFor` that answers for the new state.
521
+ * When the state under the drag changes (a resize, a store change), hand the new geometry whole to `setGeometry`.
510
522
  */
511
- /** A place a drop in a lane lands: its stretch of the lane and its landing rect. Ids are stable across solves. */
523
+ /** A place a drop in a lane lands: its stretch of the lane and its listed landing rect. Ids are stable across solves. */
512
524
  interface LandingSpot {
513
525
  readonly id: string;
514
526
  readonly along: readonly [number, number];
527
+ /** Its landing as listed (a sliding spot's at rest): what `home` compares with. Where it lands now is `landingOf`. */
515
528
  readonly landing: Rect;
516
529
  /**
517
530
  * Where its drop draws every other item, as a key: a change between two spots with the same key moves only the held
518
531
  * item. Absent: every change to or from it counts as moving others.
519
532
  */
520
533
  readonly others?: string;
521
- /**
522
- * A sliding spot (a free stretch exposed as one spot): over it the landing follows the pointer, `landing` moved along
523
- * the lane to the pointer less the grab, clamped to `[from, to]` and snapped to a point of `snaps` within
524
- * `snapDistance`, else on whole pixels (`step`). Absent: the landing is `landing`.
525
- */
526
- readonly slide?: LandingSlide;
527
- }
528
- /** A sliding spot's range: where its landing's start may lie along the lane, and the points it snaps to. */
529
- interface LandingSlide {
530
- /** The landing's start at the stretch's start (flush against the neighbor before it), px along the lane. */
531
- readonly from: number;
532
- /** The landing's start at the stretch's end (flush against the neighbor after it), px along the lane. */
533
- readonly to: number;
534
- /** The starts it snaps to: its two ends, the item's own place where it lies here, any discrete dock inside. */
535
- readonly snaps: readonly number[];
536
- /** How near a snap point the landing's start snaps to it, px (default `SNAP_DISTANCE`). */
537
- readonly snapDistance?: number;
538
- /**
539
- * The grain of a start that snaps to nothing, px: a multiple of `step`, clamped to `[from, to]` (default 1, whole
540
- * pixels; 0: wherever the pointer puts it). Give the step the spot's commit uses, so the frame, the release's `at`
541
- * and the commit agree.
542
- */
543
- readonly step?: number;
544
- }
545
- /** How near a sliding spot's snap point its landing snaps to it, px. */
546
- declare const SNAP_DISTANCE = 8;
547
- /**
548
- * A place guide's mark, in the layout as drawn: a line between two items that touch, a box over free room the item
549
- * lands in, a hatch over the part of a neighbor that gives way where the room is shorter than the item.
550
- */
551
- interface LandingMark {
552
- /** Stable while its neighbors stay; absent, the guide is keyed by its lane and place in the list. */
553
- readonly id?: string;
554
- readonly kind: "line" | "box" | "hatch";
555
- readonly rect: Rect;
534
+ /** The held item's own place at the lift (a docked item's; docking marks it): a lift with no spot marked home is a float's. */
535
+ readonly home?: boolean;
556
536
  }
557
537
  interface LandingLane {
558
538
  readonly id: string;
@@ -562,22 +542,6 @@ interface LandingLane {
562
542
  readonly refused: readonly {
563
543
  readonly along: readonly [number, number];
564
544
  }[];
565
- /** Its guides' marks; absent, its spots' landings are the guides. */
566
- readonly marks?: readonly LandingMark[];
567
- /**
568
- * Its marks while it is the lane the pointer picks (held, pending or approached), where they differ from `marks`: a
569
- * prediction of its marks once entered that owns a corner `marks` gives up (docking's `lanes()` gives it for an empty
570
- * lane). Shown in place of `marks` then, clipped to this lane's `rect` (a mark is drawn inside its lane), and under
571
- * `"all"` every lane in `corners` is cut where it overlaps what is drawn of it, if that covers the lane's marks across
572
- * their whole thickness; else that lane keeps the corner.
573
- */
574
- readonly entry?: readonly LandingMark[];
575
- /**
576
- * The lanes whose marks `entry` overlaps: while this lane is the one the pointer picks (or the nearest within reach)
577
- * each is cut where its marks overlap this lane's drawn mark, only where that mark covers them across their whole
578
- * thickness; otherwise the named lane keeps the corner.
579
- */
580
- readonly corners?: readonly string[];
581
545
  /**
582
546
  * Its rect is its own (a rail drop strip at the window's side): inside it, once its gate passes, it takes the pointer
583
547
  * from any lane it overlaps, a held one too. Absent: where lanes overlap, the deeper one wins.
@@ -591,11 +555,11 @@ interface LandingRegions {
591
555
  readonly content: Rect;
592
556
  readonly blocked: readonly Rect[];
593
557
  readonly stage: Rect;
594
- /** The held item's size. */
595
- readonly item: {
596
- readonly width: number;
597
- readonly height: number;
598
- };
558
+ }
559
+ /** One lane a frame shows place guides for, with the held place its guide stands for (`LandingFrame.guides`). */
560
+ interface LandingGuideRef {
561
+ readonly lane: string;
562
+ readonly held: LandingHeld | null;
599
563
  }
600
564
  interface LandingMargins {
601
565
  /** Past a held lane's rect before it lets go, px. */
@@ -667,12 +631,47 @@ declare const LANDING_TOUCH_MARGINS: LandingMargins;
667
631
  */
668
632
  declare const LANDING_GATES: LandingGates;
669
633
  declare const LANDING_APPROACH: LandingApproach;
670
- interface LandingOptions {
634
+ /**
635
+ * The keys the landing model reads: the drag intent's {@link DragModifiers} less the arm key (the model has no
636
+ * spring-loaded targets). While `floatKey` is held a lane or open space is open space and the guides hide; `on: false`
637
+ * turns the key off. A host hands the model the same `modifiers` as its drag intent's tuning.
638
+ */
639
+ type LandingModifiers = Pick<DragModifiers, "on" | "floatKey">;
640
+ /** The default keys: the drag intent's (`DRAG_DEFAULTS.modifiers`), Shift floats. */
641
+ declare const LANDING_MODIFIERS: LandingModifiers;
642
+ /**
643
+ * A held place of the drag: where a release now lands. A spot of a lane with the pointer (a sliding spot lands where the hand
644
+ * holds it: the geometry says where), or the float at the pointer. A frame with none is at rest (it lands nowhere).
645
+ */
646
+ type LandingHeld = {
647
+ readonly kind: "spot";
648
+ readonly lane: string;
649
+ readonly spot: string;
650
+ readonly point: Point;
651
+ } | {
652
+ readonly kind: "float";
653
+ readonly point: Point;
654
+ };
655
+ /**
656
+ * The drag's geometry, from the host's docking layer (`@n-uf/docking`'s `dockDrag(...)` fits it as it is): the regions
657
+ * for hit-testing, as seen, and the one rect the model reads of a held place.
658
+ */
659
+ interface LandingGeometry {
660
+ /** Hit-testing: the lanes (hit rects, spots' stretches, refused stretches), refused places, content, blocked, stage. */
671
661
  readonly regions: LandingRegions;
672
- /** The regions with `spot` held (its room open): the fixed-point check and the stretches while held. Cached per id. */
673
- readonly regionsFor?: (spot: string) => LandingRegions | null;
674
- /** The float's landing for a pointer over the document, or null where the item doesn't float. */
675
- readonly floatLanding?: (point: Point) => Rect | null;
662
+ /**
663
+ * Where the item lands in a held place (its rect in that held place's layout), or null where it lands nowhere (a float
664
+ * where the item doesn't float). The frame's landing, and the trail gate's: the model does no geometry of its own.
665
+ */
666
+ readonly landingOf: (held: LandingHeld) => Rect | null;
667
+ /**
668
+ * A spot's lane with its stretches cut in that spot's own layout (a panel column by halves of what it draws), or null:
669
+ * the stretches along a held lane, and the fixed-point check. Absent: the stretches as seen. Asked once per spot until
670
+ * the geometry changes.
671
+ */
672
+ readonly spotsOf?: (spot: string) => readonly LandingSpot[] | null;
673
+ }
674
+ interface LandingOptions extends LandingGeometry {
676
675
  /** The item's own place at the lift: its lane and spot (the drag starts there, the room open). */
677
676
  readonly home?: {
678
677
  readonly lane: string;
@@ -680,40 +679,42 @@ interface LandingOptions {
680
679
  };
681
680
  /** Where the item was lifted (the press), in the regions' space; default the first point `update` gets. */
682
681
  readonly lift?: Point;
683
- /**
684
- * Where the pointer holds the item, from its top left corner as it is now, px (the press's, as `lanes()` takes it).
685
- * Over a sliding spot the landing's start is the pointer less this, along the item's own length (its longer side; a
686
- * landing of another length at the same share of it); across it, and in a lane across its length, the middle.
687
- * Default: the middle of `regions.item`.
688
- */
689
- readonly grab?: Point;
690
682
  readonly margins?: Partial<LandingMargins>;
691
683
  readonly gates?: Partial<LandingGates>;
692
684
  readonly approach?: Partial<LandingApproach>;
693
- readonly placeGuides?: PlaceGuides;
685
+ /**
686
+ * The keys that win over the lanes (see {@link LandingModifiers}): the same `modifiers` shape as the drag intent's
687
+ * tuning, the float key only. Default Shift floats ({@link LANDING_MODIFIERS}).
688
+ */
689
+ readonly modifiers?: Partial<LandingModifiers>;
690
+ /**
691
+ * The drag's preview, the one `previewPlan` reads: its guide level (`placeGuides`, else the mode's default,
692
+ * `PLACE_GUIDES_DEFAULT`) is how many lanes' guides the frame names. A mode alone is `{ mode }`. Default
693
+ * `DRAG_PREVIEW_DEFAULT` (Glide: none). The guide level has no other home: a host passes the preview here and to
694
+ * `previewPlan`.
695
+ */
696
+ readonly preview?: DragPreview | PreviewMode;
694
697
  }
695
698
 
696
- /** A guide: a mark of a lane, where to draw it now (a spot's landing is a box). */
697
- interface LandingGuide {
698
- /** Stable while its neighbors stay: the mark's id, else `<lane>/<spot id>` for a spot's landing. Key a drawing by it. */
699
- readonly id: string;
700
- readonly lane: string;
701
- /** A line, a box, or a hatch over a neighbor that gives way (draw it over that item, in the guides' color). */
702
- readonly kind: "line" | "box" | "hatch";
703
- readonly rect: Rect;
704
- }
705
699
  interface LandingFrame {
706
700
  readonly region: LandingRegion;
707
701
  /** The lane held (also over its refused stretch), or null. */
708
702
  readonly lane: string | null;
709
703
  /** The spot held, or null. */
710
704
  readonly spot: string | null;
711
- /** Where a release now lands: the spot's landing, or the float's; null where it lands nowhere (the item goes home). */
705
+ /** The held place a release now lands (the screen's: what the host draws), or null at rest. */
706
+ readonly held: LandingHeld | null;
707
+ /** Where a release now lands: `landingOf(held)`; null where it lands nowhere (the item goes home). */
712
708
  readonly landing: Rect | null;
713
- /** The room is open: a spot is held in a lane, no Shift. */
709
+ /** The room is open: a spot is held in a lane, the float key not held. */
714
710
  readonly room: boolean;
715
- readonly guides: readonly LandingGuide[];
716
- /** Shift held: the region is open space wherever it was a lane or open space. */
711
+ /**
712
+ * The lanes whose place guides show, each with the held place its guide stands for: the frame's `held` (the screen), or,
713
+ * for the Near lane before entry (pending or approached), the held place the pointer would land there (the spot it picks
714
+ * along it). The host's geometry draws them (`@n-uf/docking`'s `guides(frame)`).
715
+ */
716
+ readonly guides: readonly LandingGuideRef[];
717
+ /** The float key (`modifiers.floatKey`, Shift by default) held: the region is open space wherever it was a lane or open space. */
717
718
  readonly shift: boolean;
718
719
  /**
719
720
  * The lane the pointer is inside but hasn't entered (its gate not passed yet: a fast pass, or the moment before a slow
@@ -723,19 +724,18 @@ interface LandingFrame {
723
724
  readonly pending?: string;
724
725
  }
725
726
  /**
726
- * What a release lands: a spot (`home` when it is the item's own place), the float at `rect`, or nothing. On a sliding
727
- * spot, `at` is where the landing starts along the lane, as the frame shows it (read once, at the release: a snap
728
- * point, else on the spot's `step`), and `home` holds only where that is the item's own place.
727
+ * What a release lands: the last frame's held place (a spot with the pointer, `home` when it lands at the item's own place;
728
+ * the float at the pointer), or nothing. The host commits that held place's layout (`@n-uf/docking`'s `after(release)`).
729
729
  */
730
730
  type LandingRelease = {
731
731
  readonly kind: "spot";
732
732
  readonly lane: string;
733
733
  readonly spot: string;
734
+ readonly point: Point;
734
735
  readonly home: boolean;
735
- readonly at?: number;
736
736
  } | {
737
737
  readonly kind: "float";
738
- readonly rect: Rect;
738
+ readonly point: Point;
739
739
  } | null;
740
740
  interface LandingModel {
741
741
  update(point: Point, time: number, keys?: DragKeys): LandingFrame;
@@ -745,10 +745,10 @@ interface LandingModel {
745
745
  */
746
746
  release(point: Point, time: number, keys?: DragKeys): LandingRelease;
747
747
  /**
748
- * The regions changed (a resize, a store change, a scroll): spots map by id; a lost one goes to its lane's nearest.
749
- * Pass the `regionsFor` that answers for the new state; without one, the old one stays (it must then read live state).
748
+ * The geometry changed (a resize, a store change, a scroll): the new state's regions and readers, whole. Spots map by
749
+ * id; a lost one goes to its lane's nearest.
750
750
  */
751
- setRegions(regions: LandingRegions, regionsFor?: (spot: string) => LandingRegions | null): void;
751
+ setGeometry(geometry: LandingGeometry): void;
752
752
  /** The view moved under the pointer: the gates start again, the lane is let go. */
753
753
  hide(): void;
754
754
  readonly frame: LandingFrame;
@@ -792,7 +792,7 @@ declare function createGripPress(options?: {
792
792
  readonly double?: Partial<DoubleClick>;
793
793
  }): GripPress;
794
794
 
795
- /** A guide to place: any record with a `kind` and a `rect` (a landing model's `LandingGuide`, a lane's marks). */
795
+ /** A guide to place: any record with a `kind` and a `rect` (a lane's marks, as a host's geometry draws a frame's guides). */
796
796
  interface PlacedGuide {
797
797
  readonly kind: "line" | "box" | "hatch";
798
798
  readonly rect: Rect;
@@ -891,4 +891,4 @@ declare const MIN_BOX_LENGTH = 8;
891
891
  */
892
892
  declare function guideRects<G extends PlacedGuide>(guides: readonly G[], options: GuideRectsOptions): G[];
893
893
 
894
- export { type ClearRect, DRAG_DEFAULTS, DRAG_PREVIEW_DEFAULT, type DragFrame, type DragIntent, type DragIntentOptions, type DragIntentState, type DragKeys, type DragModifiers, type DragPreview, type DragTarget, type DragTuning, type GripPress, type GripRelease, type GuideRectsOptions, LANDING_APPROACH, LANDING_GATES, LANDING_MARGINS, LANDING_TOUCH_MARGINS, type LandingApproach, type LandingFrame, type LandingGates, type LandingGuide, type LandingLane, type LandingMargins, type LandingMark, type LandingModel, type LandingOptions, type LandingRegion, type LandingRegions, type LandingRelease, type LandingSlide, type LandingSpot, type LiftDecision, MIN_BOX_LENGTH, ModifierKey, Modifiers, PLACE_GUIDES_DEFAULT, type PlaceGuides, type PlacedGuide, Point, type PreviewFrame, type PreviewMode, type PreviewPlan, REFUSAL_RANK, Rect, SNAP_DISTANCE, createDragIntent, createGripPress, createLandingModel, guideRects, inRect, liftDecision, pickRank, previewPlan, targetAt };
894
+ export { type ClearRect, DRAG_DEFAULTS, DRAG_PREVIEW_DEFAULT, type DragFrame, type DragIntent, type DragIntentOptions, type DragIntentState, type DragKeys, type DragModifiers, type DragPreview, type DragTarget, type DragTuning, type GripPress, type GripRelease, type GuideRectsOptions, LANDING_APPROACH, LANDING_GATES, LANDING_MARGINS, LANDING_MODIFIERS, LANDING_TOUCH_MARGINS, type LandingApproach, type LandingFrame, type LandingGates, type LandingGeometry, type LandingGuideRef, type LandingHeld, type LandingLane, type LandingMargins, type LandingModel, type LandingModifiers, type LandingOptions, type LandingRegion, type LandingRegions, type LandingRelease, type LandingSpot, type LiftDecision, MIN_BOX_LENGTH, ModifierKey, Modifiers, PLACE_GUIDES_DEFAULT, type PlaceGuides, type PlacedGuide, Point, type PreviewFrame, type PreviewMode, type PreviewPlan, REFUSAL_RANK, Rect, createDragIntent, createGripPress, createLandingModel, guideRects, guidesOf, inRect, liftDecision, pickRank, previewPlan, targetAt };
package/dist/drag.js CHANGED
@@ -4,21 +4,22 @@ import {
4
4
  LANDING_APPROACH,
5
5
  LANDING_GATES,
6
6
  LANDING_MARGINS,
7
+ LANDING_MODIFIERS,
7
8
  LANDING_TOUCH_MARGINS,
8
9
  MIN_BOX_LENGTH,
9
10
  PLACE_GUIDES_DEFAULT,
10
11
  REFUSAL_RANK,
11
- SNAP_DISTANCE,
12
12
  createDragIntent,
13
13
  createGripPress,
14
14
  createLandingModel,
15
15
  guideRects,
16
+ guidesOf,
16
17
  inRect,
17
18
  liftDecision,
18
19
  pickRank,
19
20
  previewPlan,
20
21
  targetAt
21
- } from "./chunk-IT2FMZOM.js";
22
+ } from "./chunk-WSW2DNRW.js";
22
23
  import {
23
24
  isHeld
24
25
  } from "./chunk-RWDYRT3H.js";
@@ -28,15 +29,16 @@ export {
28
29
  LANDING_APPROACH,
29
30
  LANDING_GATES,
30
31
  LANDING_MARGINS,
32
+ LANDING_MODIFIERS,
31
33
  LANDING_TOUCH_MARGINS,
32
34
  MIN_BOX_LENGTH,
33
35
  PLACE_GUIDES_DEFAULT,
34
36
  REFUSAL_RANK,
35
- SNAP_DISTANCE,
36
37
  createDragIntent,
37
38
  createGripPress,
38
39
  createLandingModel,
39
40
  guideRects,
41
+ guidesOf,
40
42
  inRect,
41
43
  isHeld,
42
44
  liftDecision,
package/dist/index.d.ts CHANGED
@@ -8,6 +8,6 @@ export { AnimatorValue, Easing, MotionOptions, MotionValue, SPRING_DEFAULTS, Set
8
8
  export { P as PopIn, R as RevealFrame, p as popIn, r as reveal } from './reveal-Dg5fqoWS.js';
9
9
  export { CancelReason, DWELL_DEFAULTS, DWELL_IDLE, Deadline, DwellConfig, DwellInput, DwellMachineOptions, DwellState, GesturePointer, InputGesture, InputGestureType, Machine, MachineOptions, NO_MODIFIERS, PAGED_SWIPE_DEFAULTS, PAGED_SWIPE_EMPTY_CONTEXT, PAGED_SWIPE_IDLE, PagedSwipeConfig, PagedSwipeContext, PagedSwipeInput, PagedSwipeOptions, PagedSwipeState, Platform, PointerKind, RECOGNIZER_DEFAULTS, RawInputEvent, RawPointerEvent, RawPointerType, RawSafariGestureEvent, RawWheelEvent, Recognizer, RecognizerOptions, RecognizerTimers, SwipeSide, TOUCH_PRESS_DEFAULTS, TOUCH_PRESS_IDLE, TouchPressConfig, TouchPressInput, TouchPressOptions, TouchPressState, WHEEL_DEFAULTS, WHEEL_PAN_DEFAULTS, WheelIntent, WheelOptions, WheelPanOptions, classifyWheel, createDwellMachine, createMachine, createPagedSwipe, createRecognizer, createTouchPress, dampWheelPan, defaultDragModifier, dwellDeadline, dwellReducer, modHeld, pagedSwipeDeadline, pagedSwipeReducer, platformButton, resolveDragModifier, swipeProgress, toModifiers, touchPressDeadline, touchPressReducer, wheelDelta } from './gestures.js';
10
10
  export { D as DOUBLE_CLICK, a as DoubleClick, M as ModifierKey, b as Modifiers, i as isHeld } from './double-click-DBfbiP2U.js';
11
- export { ClearRect, DRAG_DEFAULTS, DRAG_PREVIEW_DEFAULT, DragFrame, DragIntent, DragIntentOptions, DragIntentState, DragKeys, DragModifiers, DragPreview, DragTarget, DragTuning, GripPress, GripRelease, GuideRectsOptions, LANDING_APPROACH, LANDING_GATES, LANDING_MARGINS, LANDING_TOUCH_MARGINS, LandingApproach, LandingFrame, LandingGates, LandingGuide, LandingLane, LandingMargins, LandingMark, LandingModel, LandingOptions, LandingRegion, LandingRegions, LandingRelease, LandingSlide, LandingSpot, LiftDecision, MIN_BOX_LENGTH, PLACE_GUIDES_DEFAULT, PlaceGuides, PlacedGuide, PreviewFrame, PreviewMode, PreviewPlan, REFUSAL_RANK, SNAP_DISTANCE, createDragIntent, createGripPress, createLandingModel, guideRects, inRect, liftDecision, pickRank, previewPlan, targetAt } from './drag.js';
11
+ export { ClearRect, DRAG_DEFAULTS, DRAG_PREVIEW_DEFAULT, DragFrame, DragIntent, DragIntentOptions, DragIntentState, DragKeys, DragModifiers, DragPreview, DragTarget, DragTuning, GripPress, GripRelease, GuideRectsOptions, LANDING_APPROACH, LANDING_GATES, LANDING_MARGINS, LANDING_MODIFIERS, LANDING_TOUCH_MARGINS, LandingApproach, LandingFrame, LandingGates, LandingGeometry, LandingGuideRef, LandingHeld, LandingLane, LandingMargins, LandingModel, LandingModifiers, LandingOptions, LandingRegion, LandingRegions, LandingRelease, LandingSpot, LiftDecision, MIN_BOX_LENGTH, PLACE_GUIDES_DEFAULT, PlaceGuides, PlacedGuide, PreviewFrame, PreviewMode, PreviewPlan, REFUSAL_RANK, createDragIntent, createGripPress, createLandingModel, guideRects, guidesOf, inRect, liftDecision, pickRank, previewPlan, targetAt } from './drag.js';
12
12
  export { D as DrawEntry, a as DrawFrame, b as Drawable, L as LayoutItem, c as LayoutMotion, d as LayoutMotionOptions, e as LayoutTask, f as createLayoutMotion } from './motion-sElR1A_c.js';
13
13
  export { AnchoredMorph, BoxSize, HeldDrag, MORPH_TEMPO, anchoredMorph, holdItem } from './layout.js';
package/dist/index.js CHANGED
@@ -71,21 +71,22 @@ import {
71
71
  LANDING_APPROACH,
72
72
  LANDING_GATES,
73
73
  LANDING_MARGINS,
74
+ LANDING_MODIFIERS,
74
75
  LANDING_TOUCH_MARGINS,
75
76
  MIN_BOX_LENGTH,
76
77
  PLACE_GUIDES_DEFAULT,
77
78
  REFUSAL_RANK,
78
- SNAP_DISTANCE,
79
79
  createDragIntent,
80
80
  createGripPress,
81
81
  createLandingModel,
82
82
  guideRects,
83
+ guidesOf,
83
84
  inRect,
84
85
  liftDecision,
85
86
  pickRank,
86
87
  previewPlan,
87
88
  targetAt
88
- } from "./chunk-IT2FMZOM.js";
89
+ } from "./chunk-WSW2DNRW.js";
89
90
  import {
90
91
  DOUBLE_CLICK,
91
92
  isHeld
@@ -113,6 +114,7 @@ export {
113
114
  LANDING_APPROACH,
114
115
  LANDING_GATES,
115
116
  LANDING_MARGINS,
117
+ LANDING_MODIFIERS,
116
118
  LANDING_TOUCH_MARGINS,
117
119
  MIN_BOX_LENGTH,
118
120
  MORPH_TEMPO,
@@ -126,7 +128,6 @@ export {
126
128
  REFUSAL_RANK,
127
129
  SETTLE_DEFAULTS,
128
130
  SETTLE_TEMPO,
129
- SNAP_DISTANCE,
130
131
  SPRING_DEFAULTS,
131
132
  TOUCH_PRESS_DEFAULTS,
132
133
  TOUCH_PRESS_IDLE,
@@ -164,6 +165,7 @@ export {
164
165
  easeOutCubic,
165
166
  effect,
166
167
  guideRects,
168
+ guidesOf,
167
169
  holdItem,
168
170
  inRect,
169
171
  isHeld,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n-uf/motion",
3
- "version": "26.11.54",
3
+ "version": "26.11.56",
4
4
  "description": "How things move: one frame loop with an injected clock, springs, tweens and the settle curve, a DOM-free gesture recognizer, the drag intent and the landing model, and layout motion. No DOM, no framework.",
5
5
  "keywords": [
6
6
  "animation",