@n-uf/motion 26.11.53 → 26.11.55

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/README.md +23 -30
  3. package/dist/browser.d.ts +79 -3
  4. package/dist/browser.js +49 -3
  5. package/dist/browser.js.map +1 -1
  6. package/dist/chunk-4XGH5367.js +379 -0
  7. package/dist/chunk-4XGH5367.js.map +1 -0
  8. package/dist/{chunk-SIAZRWYD.js → chunk-ALYH6YQK.js} +4 -7
  9. package/dist/chunk-ALYH6YQK.js.map +1 -0
  10. package/dist/{chunk-BVPVUJ42.js → chunk-G5EJSZ3B.js} +77 -30
  11. package/dist/chunk-G5EJSZ3B.js.map +1 -0
  12. package/dist/{chunk-V7DEXKBZ.js → chunk-NI7JLDWZ.js} +35 -8
  13. package/dist/chunk-NI7JLDWZ.js.map +1 -0
  14. package/dist/{chunk-7EAAKM6U.js → chunk-QMGPJ2FG.js} +37 -89
  15. package/dist/chunk-QMGPJ2FG.js.map +1 -0
  16. package/dist/chunk-RWDYRT3H.js +14 -0
  17. package/dist/chunk-RWDYRT3H.js.map +1 -0
  18. package/dist/chunk-W7YP7VB2.js +882 -0
  19. package/dist/chunk-W7YP7VB2.js.map +1 -0
  20. package/dist/clock.d.ts +40 -7
  21. package/dist/clock.js +3 -1
  22. package/dist/double-click-DBfbiP2U.d.ts +39 -0
  23. package/dist/drag.d.ts +227 -285
  24. package/dist/drag.js +23 -913
  25. package/dist/drag.js.map +1 -1
  26. package/dist/{frame-loop-C88dc9xw.d.ts → frame-loop-f0V4b464.d.ts} +11 -11
  27. package/dist/gestures.d.ts +40 -74
  28. package/dist/gestures.js +8 -7
  29. package/dist/index.d.ts +10 -6
  30. package/dist/index.js +58 -10
  31. package/dist/layout.d.ts +9 -233
  32. package/dist/layout.js +7 -427
  33. package/dist/layout.js.map +1 -1
  34. package/dist/motion-sElR1A_c.d.ts +163 -0
  35. package/dist/reveal-Dg5fqoWS.d.ts +51 -0
  36. package/dist/{reveal-C-ewJfFn.d.ts → settle-7C9xxbFg.d.ts} +7 -57
  37. package/dist/values.d.ts +15 -7
  38. package/dist/values.js +2 -2
  39. package/package.json +2 -2
  40. package/dist/chunk-7EAAKM6U.js.map +0 -1
  41. package/dist/chunk-BVPVUJ42.js.map +0 -1
  42. package/dist/chunk-IJSIYH2D.js +0 -7
  43. package/dist/chunk-IJSIYH2D.js.map +0 -1
  44. package/dist/chunk-SIAZRWYD.js.map +0 -1
  45. package/dist/chunk-V7DEXKBZ.js.map +0 -1
  46. package/dist/double-click-jtUSNuHL.d.ts +0 -16
package/CHANGELOG.md CHANGED
@@ -3,6 +3,129 @@
3
3
  Versions are calendar versions, `YY.M.R` (year, month of the release, counter
4
4
  within the month), the same scheme as `@n-uf/hypr-tiling`.
5
5
 
6
+ Unreleased entries live in `changes/` until a release joins them.
7
+
8
+ ## 26.11.55
9
+
10
+ - Fixed: **a float pressed inside an empty lane's band no longer takes that lane when the drag starts.** A lift is a
11
+ float's when it has no `home` option and no lane has a spot marked home (new optional `LandingSpot.home`; docking marks a
12
+ docked item's, so a docked item lifted without `home` stays docked). A float lift now has the lift zone a docked item has, `margins.lift` (16 px)
13
+ around the press: within it no lane takes the pointer, and the frame is judged as if the regions had no lanes, so a nudge
14
+ moves the float, a float over a blocked or refused place is refused as on any frame, and no lane's path counts. The zone is
15
+ left once, past `lift` from the press, and never re-entered, so sliding back through the press point while a lane is held
16
+ changes nothing. After the zone the lanes act by their gates as before.
17
+
18
+ ### One layout: the landing model takes a held place (breaking; with `@n-uf/docking`'s `dockDrag`)
19
+
20
+ The landing model picks a held place and does no layout: every rect of a held place is the host's geometry's, so a held frame draws
21
+ exactly what its release commits. `@n-uf/docking`'s `dockDrag(...)` is that geometry as it is.
22
+
23
+ - **Options.** `createLandingModel({ regions, landingOf, spotsOf?, home?, lift?, margins?, gates?, approach?, placeGuides? })`
24
+ (`LandingOptions` extends the new `LandingGeometry`: `regions` for hit-testing, `landingOf(held)`, the one rect the
25
+ model reads of a held place, and `spotsOf(spot)`, a held lane's stretches in that spot's layout). Removed: `regionsFor`
26
+ (use `spotsOf`), `floatLanding` (`landingOf({ kind: "float", point })`), `grab` (the geometry's: `dockDrag`'s option).
27
+ `setRegions(regions, regionsFor?)` → `setGeometry(geometry)`, whole.
28
+ - **Held places.** New `LandingHeld`: `{ kind: "spot", lane, spot, point }` or `{ kind: "float", point }`. `LandingFrame`
29
+ gains `held` (the held place a release lands now, or null); its `landing` is `landingOf(held)`; its `guides` are now
30
+ `{ lane, held }[]`, each lane shown with the held place its guide stands for (the geometry draws them: docking's
31
+ `guides(frame)`). `LandingRelease` is `{ kind: "spot", lane, spot, point, home }`, `{ kind: "float", point }` or null:
32
+ `at` and `rect` are gone; commit `after(release).state`.
33
+ - **Removed types and fields.** `LandingGuide`, `LandingMark`, `LandingSlide`, `SNAP_DISTANCE`; `LandingLane.marks`,
34
+ `entry` and `corners`; `LandingSpot.slide`. `LandingLane.owns` stays (a hit-testing rule). The model's own sliding
35
+ arithmetic (`landingAt`), its guide geometry and corner owner, and its `guideRects` call are gone: the geometry draws.
36
+ - **Behavior.** Under `"all"` with no Near lane, the lane nearest the pointer within `reach` names its would-land held place,
37
+ for the corner only, switching exactly at `reach`. The trail gate reads `landingOf` the spot held (a sliding spot's
38
+ landing where the hand holds it, not its listed one). `release().home` holds where the geometry lands the item
39
+ home. Hit-testing reads the stage, the lanes' rects, refused, blocked and content as seen (`regions`) on every frame;
40
+ only the held lane's spot stretches come from `spotsOf` (before, all of it came from the held spot's regions,
41
+ `regionsFor`). `LandingRegions.item` is optional: the model doesn't read it. New type: `LandingGuideRef`.
42
+
43
+ ### Docs only
44
+
45
+ - **The design page and the reference catch up with the code.** No behavior, type or export change. Docking's marks (a
46
+ panel drag's lines, boxes and empty columns) are written up on docking's design page, not here; the draw rule for a
47
+ held frame (the state's layout while its room is open, else the window at rest) is stated once there. The unit rule
48
+ names its three exceptions (`DOUBLE_CLICK` and `multiClick`, `longPress.ms`, `WheelPanOptions.speed`). The
49
+ reference covers behavior, with the exported types as the contract, and adds entries for `DragFrame`, `DragTuning`,
50
+ `LandingFrame`, `LandingRelease`, `LandingGates` and the other landing option types.
51
+
52
+ ## 26.11.54
53
+
54
+ **The breaking release of the SDK: structure and names, and the few behavior changes they bring.** The drag intent goes
55
+ back to its general job, one preview type serves both drag models, the root exports everything host-free, the DOM writers
56
+ move to `./browser`, and the package has one modifier key and one unit rule. Host notes: every item below is a rename, a
57
+ move or a removal, with the name or the call to use instead; what a host sees change comes after, each with the call that
58
+ keeps the old result.
59
+
60
+ - **Root.** `@n-uf/motion` exports everything host-free: `./clock`, `./signals`, `./values`, `./gestures`, `./drag`
61
+ and `./layout`, with the shapes. Only `./browser` and `./testing` stay apart. `./values`, `./gestures`, `./drag` and
62
+ `./layout` re-export the shapes they use.
63
+ - **`./clock`.** `createFrameCoalescer` (with `CoalescerOptions`, `FrameCoalescer`) moves here from `./gestures`.
64
+ `FrameLoopOptions.budgetMs` → `budget`, `frameMs` → `frameInterval`, `maxDeltaMs` → `maxDelta`; `FrameInfo.budgetMs`
65
+ → `budget`; `FrameStats.lastMs` → `lastFrame`, `maxMs` → `longestFrame`, `meanMs` → `meanFrame`, `phaseMs` →
66
+ `perPhase`; `FakeClockOptions.frameMs` and `FakeClock.frameMs` → `frameInterval`.
67
+ - **`./values`.** `MotionValue.subscribe(listener)` (new): each change of the value, no signals needed.
68
+ `Animator.setVelocity` is required (a tween ignores it). `Settle.hold` is removed: use `jumpTo`. The step's
69
+ parameter `dtMs` → `dt` (ms) in `Animator.step`, `springStep` and `./layout`'s `AnchoredMorph.step`: a name only,
70
+ calls are unchanged.
71
+ - **`./gestures`.** One `ModifierKey` for the package: `"shift" | "alt" | "ctrl" | "meta" | "mod"` (`"mod"`: ⌘ or
72
+ Ctrl, either one); `isHeld` takes a partial set of keys and knows `"mod"`. Gaining `"mod"` breaks code that indexes
73
+ `Modifiers` by a `ModifierKey` (`mods[key]`) or enumerates its values: read a key with `isHeld(mods, key)`. `RecognizerOptions.toCanvas` is optional
74
+ (identity). `modifierDrag` leaves `press` and `dragStart`, and `ModifierDrag` is removed: a host derives it from
75
+ `origin.button` and `isHeld`. `RawPointerEvent.lostBy` `"surface"` → `"view"`. `DOUBLE_CLICK` is exported here (no
76
+ longer from `./drag`). `RecognizerOptions.staleMs` → `stale`, `DwellConfig.dwellMs` → `dwell`,
77
+ `TouchPressConfig.holdMs` → `hold`, `PagedSwipeConfig.idleMs` → `idle`, `lockoutMs` → `lockout`, `thresholdPx` →
78
+ `threshold`; `wheelDeltaPx` → `wheelDelta`.
79
+ - **`./drag`, the intent.** `DragTuning.railArmDwellMs` → `armAfter`; `DragModifiers.railKey` → `armKey`;
80
+ `DragFrame.forced` `"rail"` → `"armed"`. `liftRect`, `floating`, `earlyRelease` and `DragFrame.refusedSinceShown`
81
+ are removed. `DragFrame.landing` is required. New `bounds` and `setBounds`: the intent clamps the pointer onto the
82
+ drawn space. `release(point, targets, keys?)` → `release(point, time, targets, keys?)`, taking a new point as one more
83
+ sample. `ModifierKey` is the gestures one (lower case), and `DragKeys` is `Partial<Modifiers>`;
84
+ `isHeld` and `Modifiers` are exported here too.
85
+ - **`./drag`, the preview.** One type, `DragPreview` = `{ mode, placeGuides? }` with `PreviewMode` `"outline" |
86
+ "placeholder" | "glide" | "snap"`; a mode alone stands for `{ mode }`. The old strings map `"indicator"` →
87
+ `"outline"`, `"gap"` → `"placeholder"`, `"snap"` → `"glide"`, `"item"` → `"snap"`. `DropPreviewMode` is removed.
88
+ `previewPlan` reads a landing frame too (`PreviewFrame`); `PreviewPlan.guides` is required. `EmptyLanes` and the
89
+ preview's `emptyLanes` leave motion (docking's option).
90
+ - **`./drag`, the landing model.** `release()` → `release(point, time, keys?)`. `LandingGates.still` (px per 8 ms) →
91
+ `stillSpeed` (px/ms, 0.1875), `step` → `stepSpeed` (px/ms, 0.375), `slide` → `slideSpeed` (px/ms, 2).
92
+ - **`./layout`.** `LayoutMotion.onIdle` and `running` are removed: `onActiveChange` is the one way to learn idle,
93
+ `idle()` for a test. `domDrawable`, `layOutBox`, `drawBox`, `flip`, `rectOf` and their types move to `./browser`.
94
+ - **`./browser`.** Everything that touches a host, the DOM writers included. `BrowserClockOptions.fallbackFrameMs` →
95
+ `fallbackFrameInterval`.
96
+ - **One unit rule.** Times in ms, distances in px, a pointer's speeds in px/ms, and no name carries its unit. An
97
+ animator's velocity stays in units per second, and a settle's tempo per second.
98
+ - Signals stay public; nothing requires them, and they leave the package's one-line description.
99
+
100
+ What a host sees change, with the call that keeps the old result:
101
+
102
+ - `./drag`: a preview given as a mode alone takes `PLACE_GUIDES_DEFAULT` (`"near"` for placeholder and snap), where an
103
+ old string preview planned `guides: "off"`. Keep no guides with `{ mode, placeGuides: "off" }`.
104
+ - `./drag`: `DRAG_PREVIEW_DEFAULT` is `{ mode: "glide" }` (the old string `"snap"`: the same plan). Compare its `mode`.
105
+ - `./drag`: `PLACE_GUIDES_DEFAULT` gains `glide: "off"`. A host that enumerates it sees one more key.
106
+ - `./drag`: `PreviewPlan.emptyLanes` is removed. Read the empty-lane option from your own state (docking's
107
+ `EmptyLanes`).
108
+ - `./drag`: `earlyRelease: "float"` has no replacement; a release with no target shown lands on the target under the
109
+ pointer, as the old default `"target"` did.
110
+ - `./drag`: a host that passed `floating: true` gets the home that holds wherever it lies (a floating item's home is
111
+ its own place, as for a docked one). Nothing to pass.
112
+ - `./drag`: `release(point, time, …)` at a point that differs from the last `update` runs one more sample there before
113
+ it decides. To decide on the last frame as before, pass the last update's point and time.
114
+
115
+ Behavior, from the release line since 26.11.53 (not part of the renames above):
116
+
117
+ - `./drag`, **a shared corner moves to a lane only when that lane's mark covers it; otherwise the bar keeps it** (fix).
118
+ Under guides `"all"`, a rail that owns a corner (near it, or nearest within reach) cut the bar's guide where its
119
+ whole `entry` overlapped it, even where the rail's lane stops short of the bar's band, or reaches only part of it,
120
+ so its mark, drawn inside its own `rect`, left the corner with no guide at all. A lane's `entry` is now taken as it
121
+ is drawn (inside its `rect`), and the bar hands the corner over only where that mark covers the bar's guide across
122
+ its whole thickness; else the bar keeps it and the rail's mark gives the overlap up. Both sides are compared as
123
+ drawn: the named lane's marks are clipped to its own `rect` too, a line counts at its drawn thickness (2 px,
124
+ centered), and the named lane is cut by what the owner draws (its guide less the landing it would take, short
125
+ parts dropped), not by its whole `entry`. That is a view for the decision, never what a lane returns: a lane's
126
+ `marks` come back as given. A named lane also leaves out the held (or would-be) landing, the stub outside it
127
+ staying the lane's and a joint line it touches being shortened to the parts outside it. Under `"near"` the Near lane's `entry` is clipped to its `rect`.
128
+
6
129
  ## 26.11.53
7
130
 
8
131
  - `./drag`, **`guideRects` shortens a thin guide that a clear rect meets only at its end** (fix). A line or a striped
package/README.md CHANGED
@@ -3,11 +3,11 @@
3
3
  > [!CAUTION]
4
4
  > ## Not yet stable
5
5
  >
6
- > **@n-uf/motion is young and still changing. Its API (the frame loop, signals, springs and tweens, and the gesture recognizer) and its timing behavior are not final.**
6
+ > **@n-uf/motion is young and still changing. Its API (the frame loop, springs and tweens, the gesture recognizer, the drag and landing models) and its timing behavior are not final.**
7
7
  >
8
8
  > Version numbers are dates (YY.M.R), not semantic versions, so any release may break things, including how frames are scheduled, how springs settle and how gestures are timed. Pin an exact version and read the [CHANGELOG](https://github.com/n-uf/motion/blob/main/packages/motion/CHANGELOG.md) before you upgrade. If you need a stable animation library, use [Motion](https://motion.dev) or [GSAP](https://gsap.com). Both work on the DOM, so neither is a drop-in replacement.
9
9
 
10
- How things move. One frame loop on an injected clock, fine-grained signals, values that animate (springs, tweens and one settle curve for moving windows), a DOM-free gesture recognizer, the drag intent and the landing model, and layout motion that glides a whole layout. No DOM, no framework, no globals: the host hands in a clock and plain event objects and reads plain numbers back, and tests hand in a fake clock.
10
+ How things move. One frame loop on an injected clock, values that animate (springs, tweens and one settle curve for moving windows), a DOM-free gesture recognizer, the drag intent and the landing model, and layout motion that glides a whole layout. No DOM, no framework, no globals: the host hands in a clock and plain event objects and reads plain numbers back, and tests hand in a fake clock. Times are in ms, distances in px and pointer speeds in px/ms.
11
11
 
12
12
  ```sh
13
13
  npm i @n-uf/motion
@@ -17,45 +17,38 @@ npm i @n-uf/motion
17
17
 
18
18
  | Entry | What it gives |
19
19
  |---|---|
20
- | `@n-uf/motion` | Everything in `/clock`, `/signals`, `/values` and `/gestures`, and the shared value shapes (`Point`, `Rect`, `Vector`). |
21
- | `@n-uf/motion/clock` | The frame loop (phases input, update, layout, write; a budget; stats) and a fake clock for tests. |
22
- | `@n-uf/motion/signals` | `signal`, `computed`, `effect`, `batch`: a change recomputes only what depends on it, and effects can run once per frame. |
23
- | `@n-uf/motion/values` | Springs, tweens and the settle curve, as motion values stepped by the loop; `reveal` and `popIn`; easing functions. |
24
- | `@n-uf/motion/gestures` | The recognizer (click or drag, double click, long press, pinch, scroll, zoom), a frame coalescer, and state machines for touch press, paged swipe and dwell. |
25
- | `@n-uf/motion/drag` | The drag intent (when a drop indicator shows, which target, what a release lands on), grip presses, drop previews and the landing model. |
26
- | `@n-uf/motion/layout` | Layout motion: items glide to new rects, a held item follows the pointer 1:1 and lands, FLIP for DOM groups. |
20
+ | `@n-uf/motion` | Everything host-free: all of `/clock`, `/signals`, `/values`, `/gestures`, `/drag` and `/layout`, and the shared value shapes (`Point`, `Rect`, `Vector`). |
21
+ | `@n-uf/motion/clock` | The frame loop (phases input, update, layout, write; a budget; stats), a fake clock for tests, and the frame coalescer. |
22
+ | `@n-uf/motion/signals` | `signal`, `computed`, `effect`, `batch`: a change recomputes only what depends on it, and effects can run once per frame. Optional: nothing else needs them. |
23
+ | `@n-uf/motion/values` | Springs, tweens and the settle curve, as motion values stepped by the loop (follow one with `subscribe`); `reveal` and `popIn`; easing functions. |
24
+ | `@n-uf/motion/gestures` | The recognizer (click or drag, double click, long press, pinch, scroll, zoom), modifier keys, and state machines for touch press, paged swipe and dwell. |
25
+ | `@n-uf/motion/drag` | The drag intent (the general drag: when a drop indicator shows, which target, what a release lands on), grip presses, drop previews and the landing model (the docking drag). |
26
+ | `@n-uf/motion/layout` | Layout motion: items glide to new rects, a held item follows the pointer 1:1 and lands. |
27
27
  | `@n-uf/motion/testing` | Frame-sampled checks of the motion rules (no overshoot, no jumps, held under the pointer), for tests and browser specs. |
28
- | `@n-uf/motion/browser` | The clock on `requestAnimationFrame` and the reduced-motion media query. |
28
+ | `@n-uf/motion/browser` | Everything that touches a host: the clock on `requestAnimationFrame`, the reduced-motion media query, and the DOM writers (`domDrawable`, FLIP for DOM groups). |
29
29
 
30
- The core entries touch no DOM; importing several of them still gives one signal graph. `/drag`, `/layout`, `/testing` and `/browser` are not in the root.
30
+ The core entries touch no DOM; importing several of them still gives one signal graph. Only `/testing` and `/browser` are not in the root.
31
31
 
32
32
  ## One frame
33
33
 
34
- A pointer drives a spring that follows a target, and the DOM is written once per frame, only while something moves.
34
+ A pointer drives a spring toward a target, and the element is written on each frame it moves, only while it moves. No signals needed.
35
35
 
36
36
  ```ts
37
- import { computed, createFrameCoalescer, createFrameLoop, effect, signal, springValue } from "@n-uf/motion";
37
+ import { createFrameCoalescer, createFrameLoop, springValue } from "@n-uf/motion";
38
38
  import { createBrowserClock, prefersReducedMotion } from "@n-uf/motion/browser";
39
39
 
40
40
  const el = document.querySelector<HTMLElement>("#box")!;
41
41
  const loop = createFrameLoop({ clock: createBrowserClock() });
42
42
 
43
- // Input: one pointer sample per frame, delivered in the input phase.
44
- const pointer = signal({ x: 0, y: 0 });
45
- const input = createFrameCoalescer<{ x: number; y: number }>((p) => (pointer.value = p), loop.frames("input"));
46
- addEventListener("pointermove", (e) => input.schedule({ x: e.clientX, y: e.clientY }));
47
-
48
- // Layout: a target derived from state.
49
- const target = computed(() => ({ x: Math.round(pointer.value.x / 50) * 50, y: 0 }));
50
-
51
- // Motion: a spring follows the target, stepping in the layout phase.
43
+ // Motion: a spring, stepping in the layout phase.
52
44
  const box = springValue(loop, { x: 0, y: 0 }, { reducedMotion: prefersReducedMotion() });
53
- box.follow(() => target.value);
54
45
 
55
- // Write: once per frame while it moves; the loop idles when it settles.
56
- effect(() => {
57
- el.style.transform = `translate(${box.value.x}px, ${box.value.y}px)`;
58
- }, { schedule: loop.scheduler("write") });
46
+ // Input: one pointer sample per frame, delivered in the input phase, sets the target.
47
+ const input = createFrameCoalescer<{ x: number; y: number }>((p) => box.set({ x: Math.round(p.x / 50) * 50, y: 0 }), loop.frames("input"));
48
+ addEventListener("pointermove", (e) => input.schedule({ x: e.clientX, y: e.clientY }));
49
+
50
+ // Write: on each change of the value; the loop idles when it settles.
51
+ box.subscribe((v) => (el.style.transform = `translate(${v.x}px, ${v.y}px)`));
59
52
  ```
60
53
 
61
54
  ## A drag
@@ -69,17 +62,17 @@ const slot: DragTarget = { id: "slot", priority: 2, hit: { x: 0, y: 0, width: 20
69
62
  const intent = createDragIntent({ home: { x: 300, y: 300, width: 100, height: 50 } });
70
63
  for (let t = 0; t <= 300; t += 16) intent.update({ x: 100, y: 50 }, t, [slot]); // held still over the slot
71
64
  console.log(intent.state.shown?.id); // "slot"
72
- console.log(intent.release({ x: 100, y: 50 }, [slot])?.id); // "slot"
65
+ console.log(intent.release({ x: 100, y: 50 }, 300, [slot])?.id); // "slot"
73
66
  ```
74
67
 
75
68
  ## Documentation
76
69
 
77
70
  - [Design page](https://github.com/n-uf/motion/blob/main/docs/motion.md): the concept, the parts, the rules a consumer relies on.
78
- - [Reference](https://github.com/n-uf/motion/blob/main/docs/motion-reference.md): every entry point's API, rules and longer examples.
71
+ - [Reference](https://github.com/n-uf/motion/blob/main/docs/motion-reference.md): every entry point's behavior, rules and longer examples; the exported types are the contract.
79
72
  - [CHANGELOG](https://github.com/n-uf/motion/blob/main/packages/motion/CHANGELOG.md)
80
73
  - Site and live demos: [motion.n-uf.com](https://motion.n-uf.com)
81
74
 
82
- Its sibling [`@n-uf/placement`](https://www.npmjs.com/package/@n-uf/placement) owns where things go.
75
+ Its siblings: [`@n-uf/placement`](https://www.npmjs.com/package/@n-uf/placement) owns where things fit, and [`@n-uf/docking`](https://www.npmjs.com/package/@n-uf/docking) where panels and toolbars dock.
83
76
 
84
77
  ## License
85
78
 
package/dist/browser.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  import { C as ClockPort } from './port-CmlUctqx.js';
2
+ import { R as Rect } from './shapes-EbQlwbCu.js';
3
+ import { b as Drawable, a as DrawFrame, L as LayoutItem } from './motion-sElR1A_c.js';
4
+ import './frame-loop-f0V4b464.js';
5
+ import './reveal-Dg5fqoWS.js';
2
6
 
3
7
  /**
4
8
  * The parts of a browser global this adapter uses. Typed here instead of
@@ -22,12 +26,12 @@ interface BrowserClockOptions {
22
26
  /** The global to use. Default `globalThis`. */
23
27
  readonly host?: BrowserHost;
24
28
  /** Frame interval when the host has no requestAnimationFrame. Default 1000/60. */
25
- readonly fallbackFrameMs?: number;
29
+ readonly fallbackFrameInterval?: number;
26
30
  }
27
31
  /**
28
32
  * A {@link ClockPort} on requestAnimationFrame, performance.now and
29
33
  * setTimeout. Without requestAnimationFrame (a worker, a server) frames come
30
- * from setTimeout at `fallbackFrameMs`; without performance, time comes from
34
+ * from setTimeout at `fallbackFrameInterval`; without performance, time comes from
31
35
  * Date.now.
32
36
  */
33
37
  declare function createBrowserClock(options?: BrowserClockOptions): ClockPort;
@@ -39,4 +43,76 @@ declare function createBrowserClock(options?: BrowserClockOptions): ClockPort;
39
43
  */
40
44
  declare function prefersReducedMotion(host?: BrowserHost): () => boolean;
41
45
 
42
- export { type BrowserClockOptions, type BrowserHost, createBrowserClock, prefersReducedMotion };
46
+ /**
47
+ * The style properties the layout motion writes, as strings (a DOM node's `style` has them all). Structural: the
48
+ * library needs no DOM types.
49
+ */
50
+ interface StyleLike {
51
+ left: string;
52
+ top: string;
53
+ width: string;
54
+ height: string;
55
+ transform: string;
56
+ opacity: string;
57
+ clipPath: string;
58
+ visibility: string;
59
+ }
60
+ /** Something with a writable {@link StyleLike} `style`: a DOM node. */
61
+ interface Styled {
62
+ readonly style: StyleLike;
63
+ }
64
+ /**
65
+ * The nodes of a drawn box: `node` is laid out at the box and moved to the drawn rect; `frame` (background, border,
66
+ * shadow) is drawn at the drawn size; `content` is clipped to it. With no `frame` and `content`, `node` itself is
67
+ * clipped (its content laid out at the box, never stretched).
68
+ */
69
+ interface BoxNodes {
70
+ readonly node: Styled;
71
+ readonly frame?: Styled;
72
+ readonly content?: Styled;
73
+ }
74
+ /** Lay `node` out at `box`: its position and size, in its offset parent's coordinates. */
75
+ declare function layOutBox(node: Styled, box: Rect): void;
76
+ /**
77
+ * Draw one frame of a box laid out by {@link layOutBox}: one transform (the move to the drawn rect, and the uniform
78
+ * appearance about its center), the frame at the drawn size, the content clipped (reveal); hidden when gone.
79
+ */
80
+ declare function drawBox(nodes: BoxNodes, frame: DrawFrame): void;
81
+ /** A {@link Drawable} for DOM nodes: {@link layOutBox} on a new box, {@link drawBox} on every frame. */
82
+ declare function domDrawable(nodes: BoxNodes): Drawable;
83
+
84
+ /** A rect as a DOM rect reports it (`getBoundingClientRect()`): left, top, width, height. */
85
+ interface RectLike {
86
+ readonly left: number;
87
+ readonly top: number;
88
+ readonly width: number;
89
+ readonly height: number;
90
+ }
91
+ /** Anything that can say where it is drawn: a DOM node, or a test's stand-in. */
92
+ interface Measurable {
93
+ getBoundingClientRect(): RectLike;
94
+ }
95
+ /** A {@link RectLike} as a {@link Rect}. */
96
+ declare const rectOf: (r: RectLike) => Rect;
97
+ /** One member of a {@link flip}: an item, the node it draws, and where it goes once the DOM has changed. */
98
+ interface FlipEntry {
99
+ readonly item: LayoutItem;
100
+ readonly node: Measurable;
101
+ /**
102
+ * Once the DOM has changed: the old rect (as measured before, in page coordinates) in the item's own coordinates
103
+ * now, and its new place there.
104
+ */
105
+ readonly place: (before: Rect) => {
106
+ readonly from: Rect;
107
+ readonly to: Rect;
108
+ };
109
+ }
110
+ /**
111
+ * FLIP for DOM groups, on settle: record where each node is drawn (first), change the DOM (`change`: move nodes to
112
+ * other parents, reorder them), then each item is drawn at its old rect and settles to its new place (last, invert,
113
+ * play). No transform tween: a settle from the rect it was drawn at, so it never jumps or overshoots, and its size
114
+ * changes through reveal.
115
+ */
116
+ declare function flip(entries: readonly FlipEntry[], change: () => void): void;
117
+
118
+ export { type BoxNodes, type BrowserClockOptions, type BrowserHost, type FlipEntry, type Measurable, type RectLike, type StyleLike, type Styled, createBrowserClock, domDrawable, drawBox, flip, layOutBox, prefersReducedMotion, rectOf };
package/dist/browser.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/browser/browser-clock.ts
2
2
  function createBrowserClock(options = {}) {
3
3
  const host = options.host ?? globalThis;
4
- const fallbackFrameMs = options.fallbackFrameMs ?? 1e3 / 60;
4
+ const fallbackFrameInterval = options.fallbackFrameInterval ?? 1e3 / 60;
5
5
  const performance = host.performance;
6
6
  const now = performance !== void 0 ? () => performance.now() : () => Date.now();
7
7
  let nextTimer = 1;
@@ -36,7 +36,7 @@ function createBrowserClock(options = {}) {
36
36
  }
37
37
  return {
38
38
  now,
39
- requestFrame: (callback) => setTimer(callback, fallbackFrameMs),
39
+ requestFrame: (callback) => setTimer(callback, fallbackFrameInterval),
40
40
  cancelFrame: clearTimer,
41
41
  setTimer,
42
42
  clearTimer
@@ -46,8 +46,54 @@ function prefersReducedMotion(host = globalThis) {
46
46
  const query = host.matchMedia?.("(prefers-reduced-motion: reduce)");
47
47
  return () => query?.matches ?? false;
48
48
  }
49
+
50
+ // src/browser/dom.ts
51
+ function layOutBox(node, box) {
52
+ const s = node.style;
53
+ s.left = `${box.x}px`;
54
+ s.top = `${box.y}px`;
55
+ s.width = `${box.width}px`;
56
+ s.height = `${box.height}px`;
57
+ }
58
+ function drawBox(nodes, frame) {
59
+ const { reveal: r, pop } = frame;
60
+ const cx = frame.drawn.width / 2;
61
+ const cy = frame.drawn.height / 2;
62
+ const s = nodes.node.style;
63
+ s.transform = pop.scale === 1 ? `translate(${r.dx}px, ${r.dy}px)` : `translate(${r.dx}px, ${r.dy}px) translate(${cx}px, ${cy}px) scale(${pop.scale}) translate(${-cx}px, ${-cy}px)`;
64
+ s.opacity = pop.opacity === 1 ? "" : String(pop.opacity);
65
+ if (nodes.frame) {
66
+ nodes.frame.style.width = `${r.width}px`;
67
+ nodes.frame.style.height = `${r.height}px`;
68
+ }
69
+ const clipped = nodes.content ?? (nodes.frame ? null : nodes.node);
70
+ if (clipped) clipped.style.clipPath = r.clipRight || r.clipBottom ? `inset(0 ${r.clipRight}px ${r.clipBottom}px 0)` : "";
71
+ s.visibility = frame.gone ? "hidden" : "";
72
+ }
73
+ function domDrawable(nodes) {
74
+ return {
75
+ layOut: (box) => layOutBox(nodes.node, box),
76
+ draw: (frame) => drawBox(nodes, frame)
77
+ };
78
+ }
79
+
80
+ // src/browser/flip.ts
81
+ var rectOf = (r) => ({ x: r.left, y: r.top, width: r.width, height: r.height });
82
+ function flip(entries, change) {
83
+ const before = entries.map((e) => rectOf(e.node.getBoundingClientRect()));
84
+ change();
85
+ entries.forEach((e, i) => {
86
+ const { from, to } = e.place(before[i]);
87
+ e.item.glideFrom(from, to);
88
+ });
89
+ }
49
90
  export {
50
91
  createBrowserClock,
51
- prefersReducedMotion
92
+ domDrawable,
93
+ drawBox,
94
+ flip,
95
+ layOutBox,
96
+ prefersReducedMotion,
97
+ rectOf
52
98
  };
53
99
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/browser/browser-clock.ts"],"sourcesContent":["import type { ClockPort } from \"../clock/port\";\n\n/**\n * The parts of a browser global this adapter uses. Typed here instead of\n * through lib.dom, so the package builds without DOM types and a test (or a\n * worker, or a server) can pass its own host.\n */\nexport interface BrowserHost {\n requestAnimationFrame?(callback: (time: number) => void): number;\n cancelAnimationFrame?(handle: number): void;\n setTimeout(callback: () => void, ms?: number): unknown;\n clearTimeout(handle: unknown): void;\n readonly performance?: { now(): number };\n matchMedia?(query: string): { readonly matches: boolean };\n}\n\n/** Options of {@link createBrowserClock}. */\nexport interface BrowserClockOptions {\n /** The global to use. Default `globalThis`. */\n readonly host?: BrowserHost;\n /** Frame interval when the host has no requestAnimationFrame. Default 1000/60. */\n readonly fallbackFrameMs?: number;\n}\n\n/**\n * A {@link ClockPort} on requestAnimationFrame, performance.now and\n * setTimeout. Without requestAnimationFrame (a worker, a server) frames come\n * from setTimeout at `fallbackFrameMs`; without performance, time comes from\n * Date.now.\n */\nexport function createBrowserClock(options: BrowserClockOptions = {}): ClockPort {\n const host = options.host ?? (globalThis as unknown as BrowserHost);\n const fallbackFrameMs = options.fallbackFrameMs ?? 1000 / 60;\n const performance = host.performance;\n const now = performance !== undefined ? () => performance.now() : () => Date.now();\n\n // Timer handles are numbers in browsers and objects in Node; the port\n // promises numbers, so keep our own.\n let nextTimer = 1;\n const timers = new Map<number, unknown>();\n\n const setTimer = (callback: () => void, ms: number): number => {\n const id = nextTimer++;\n timers.set(\n id,\n host.setTimeout(() => {\n timers.delete(id);\n callback();\n }, Math.max(0, ms)),\n );\n return id;\n };\n\n const clearTimer = (id: number): void => {\n const handle = timers.get(id);\n if (handle === undefined) return;\n timers.delete(id);\n host.clearTimeout(handle);\n };\n\n const raf = host.requestAnimationFrame;\n const caf = host.cancelAnimationFrame;\n if (raf !== undefined && caf !== undefined) {\n return {\n now,\n requestFrame: (callback) => raf.call(host, () => callback()),\n cancelFrame: (handle) => caf.call(host, handle),\n setTimer,\n clearTimer,\n };\n }\n return {\n now,\n requestFrame: (callback) => setTimer(callback, fallbackFrameMs),\n cancelFrame: clearTimer,\n setTimer,\n clearTimer,\n };\n}\n\n/**\n * The user's reduced-motion preference as a function, for a motion value's\n * `reducedMotion` option. It reads the media query on each call, so a change\n * in the system setting applies to the next target and the next frame.\n * Without matchMedia it always returns `false`.\n */\nexport function prefersReducedMotion(host: BrowserHost = globalThis as unknown as BrowserHost): () => boolean {\n const query = host.matchMedia?.(\"(prefers-reduced-motion: reduce)\");\n return () => query?.matches ?? false;\n}\n"],"mappings":";AA8BO,SAAS,mBAAmB,UAA+B,CAAC,GAAc;AAC/E,QAAM,OAAO,QAAQ,QAAS;AAC9B,QAAM,kBAAkB,QAAQ,mBAAmB,MAAO;AAC1D,QAAM,cAAc,KAAK;AACzB,QAAM,MAAM,gBAAgB,SAAY,MAAM,YAAY,IAAI,IAAI,MAAM,KAAK,IAAI;AAIjF,MAAI,YAAY;AAChB,QAAM,SAAS,oBAAI,IAAqB;AAExC,QAAM,WAAW,CAAC,UAAsB,OAAuB;AAC7D,UAAM,KAAK;AACX,WAAO;AAAA,MACL;AAAA,MACA,KAAK,WAAW,MAAM;AACpB,eAAO,OAAO,EAAE;AAChB,iBAAS;AAAA,MACX,GAAG,KAAK,IAAI,GAAG,EAAE,CAAC;AAAA,IACpB;AACA,WAAO;AAAA,EACT;AAEA,QAAM,aAAa,CAAC,OAAqB;AACvC,UAAM,SAAS,OAAO,IAAI,EAAE;AAC5B,QAAI,WAAW,OAAW;AAC1B,WAAO,OAAO,EAAE;AAChB,SAAK,aAAa,MAAM;AAAA,EAC1B;AAEA,QAAM,MAAM,KAAK;AACjB,QAAM,MAAM,KAAK;AACjB,MAAI,QAAQ,UAAa,QAAQ,QAAW;AAC1C,WAAO;AAAA,MACL;AAAA,MACA,cAAc,CAAC,aAAa,IAAI,KAAK,MAAM,MAAM,SAAS,CAAC;AAAA,MAC3D,aAAa,CAAC,WAAW,IAAI,KAAK,MAAM,MAAM;AAAA,MAC9C;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAO;AAAA,IACL;AAAA,IACA,cAAc,CAAC,aAAa,SAAS,UAAU,eAAe;AAAA,IAC9D,aAAa;AAAA,IACb;AAAA,IACA;AAAA,EACF;AACF;AAQO,SAAS,qBAAqB,OAAoB,YAAqD;AAC5G,QAAM,QAAQ,KAAK,aAAa,kCAAkC;AAClE,SAAO,MAAM,OAAO,WAAW;AACjC;","names":[]}
1
+ {"version":3,"sources":["../src/browser/browser-clock.ts","../src/browser/dom.ts","../src/browser/flip.ts"],"sourcesContent":["import type { ClockPort } from \"../clock/port\";\n\n/**\n * The parts of a browser global this adapter uses. Typed here instead of\n * through lib.dom, so the package builds without DOM types and a test (or a\n * worker, or a server) can pass its own host.\n */\nexport interface BrowserHost {\n requestAnimationFrame?(callback: (time: number) => void): number;\n cancelAnimationFrame?(handle: number): void;\n setTimeout(callback: () => void, ms?: number): unknown;\n clearTimeout(handle: unknown): void;\n readonly performance?: { now(): number };\n matchMedia?(query: string): { readonly matches: boolean };\n}\n\n/** Options of {@link createBrowserClock}. */\nexport interface BrowserClockOptions {\n /** The global to use. Default `globalThis`. */\n readonly host?: BrowserHost;\n /** Frame interval when the host has no requestAnimationFrame. Default 1000/60. */\n readonly fallbackFrameInterval?: number;\n}\n\n/**\n * A {@link ClockPort} on requestAnimationFrame, performance.now and\n * setTimeout. Without requestAnimationFrame (a worker, a server) frames come\n * from setTimeout at `fallbackFrameInterval`; without performance, time comes from\n * Date.now.\n */\nexport function createBrowserClock(options: BrowserClockOptions = {}): ClockPort {\n const host = options.host ?? (globalThis as unknown as BrowserHost);\n const fallbackFrameInterval = options.fallbackFrameInterval ?? 1000 / 60;\n const performance = host.performance;\n const now = performance !== undefined ? () => performance.now() : () => Date.now();\n\n // Timer handles are numbers in browsers and objects in Node; the port\n // promises numbers, so keep our own.\n let nextTimer = 1;\n const timers = new Map<number, unknown>();\n\n const setTimer = (callback: () => void, ms: number): number => {\n const id = nextTimer++;\n timers.set(\n id,\n host.setTimeout(() => {\n timers.delete(id);\n callback();\n }, Math.max(0, ms)),\n );\n return id;\n };\n\n const clearTimer = (id: number): void => {\n const handle = timers.get(id);\n if (handle === undefined) return;\n timers.delete(id);\n host.clearTimeout(handle);\n };\n\n const raf = host.requestAnimationFrame;\n const caf = host.cancelAnimationFrame;\n if (raf !== undefined && caf !== undefined) {\n return {\n now,\n requestFrame: (callback) => raf.call(host, () => callback()),\n cancelFrame: (handle) => caf.call(host, handle),\n setTimer,\n clearTimer,\n };\n }\n return {\n now,\n requestFrame: (callback) => setTimer(callback, fallbackFrameInterval),\n cancelFrame: clearTimer,\n setTimer,\n clearTimer,\n };\n}\n\n/**\n * The user's reduced-motion preference as a function, for a motion value's\n * `reducedMotion` option. It reads the media query on each call, so a change\n * in the system setting applies to the next target and the next frame.\n * Without matchMedia it always returns `false`.\n */\nexport function prefersReducedMotion(host: BrowserHost = globalThis as unknown as BrowserHost): () => boolean {\n const query = host.matchMedia?.(\"(prefers-reduced-motion: reduce)\");\n return () => query?.matches ?? false;\n}\n","import type { Rect } from \"../shapes\";\nimport type { Drawable, DrawFrame } from \"../layout\";\n\n/**\n * The style properties the layout motion writes, as strings (a DOM node's `style` has them all). Structural: the\n * library needs no DOM types.\n */\nexport interface StyleLike {\n left: string;\n top: string;\n width: string;\n height: string;\n transform: string;\n opacity: string;\n clipPath: string;\n visibility: string;\n}\n\n/** Something with a writable {@link StyleLike} `style`: a DOM node. */\nexport interface Styled {\n readonly style: StyleLike;\n}\n\n/**\n * The nodes of a drawn box: `node` is laid out at the box and moved to the drawn rect; `frame` (background, border,\n * shadow) is drawn at the drawn size; `content` is clipped to it. With no `frame` and `content`, `node` itself is\n * clipped (its content laid out at the box, never stretched).\n */\nexport interface BoxNodes {\n readonly node: Styled;\n readonly frame?: Styled;\n readonly content?: Styled;\n}\n\n/** Lay `node` out at `box`: its position and size, in its offset parent's coordinates. */\nexport function layOutBox(node: Styled, box: Rect): void {\n const s = node.style;\n s.left = `${box.x}px`;\n s.top = `${box.y}px`;\n s.width = `${box.width}px`;\n s.height = `${box.height}px`;\n}\n\n/**\n * Draw one frame of a box laid out by {@link layOutBox}: one transform (the move to the drawn rect, and the uniform\n * appearance about its center), the frame at the drawn size, the content clipped (reveal); hidden when gone.\n */\nexport function drawBox(nodes: BoxNodes, frame: DrawFrame): void {\n const { reveal: r, pop } = frame;\n const cx = frame.drawn.width / 2;\n const cy = frame.drawn.height / 2;\n const s = nodes.node.style;\n s.transform =\n pop.scale === 1 ? `translate(${r.dx}px, ${r.dy}px)` : `translate(${r.dx}px, ${r.dy}px) translate(${cx}px, ${cy}px) scale(${pop.scale}) translate(${-cx}px, ${-cy}px)`;\n s.opacity = pop.opacity === 1 ? \"\" : String(pop.opacity);\n if (nodes.frame) {\n nodes.frame.style.width = `${r.width}px`;\n nodes.frame.style.height = `${r.height}px`;\n }\n const clipped = nodes.content ?? (nodes.frame ? null : nodes.node);\n if (clipped) clipped.style.clipPath = r.clipRight || r.clipBottom ? `inset(0 ${r.clipRight}px ${r.clipBottom}px 0)` : \"\";\n // All the way gone: out of sight and out of the way of the pointer.\n s.visibility = frame.gone ? \"hidden\" : \"\";\n}\n\n/** A {@link Drawable} for DOM nodes: {@link layOutBox} on a new box, {@link drawBox} on every frame. */\nexport function domDrawable(nodes: BoxNodes): Drawable {\n return {\n layOut: (box) => layOutBox(nodes.node, box),\n draw: (frame) => drawBox(nodes, frame),\n };\n}\n","import type { Rect } from \"../shapes\";\nimport type { LayoutItem } from \"../layout\";\n\n/** A rect as a DOM rect reports it (`getBoundingClientRect()`): left, top, width, height. */\nexport interface RectLike {\n readonly left: number;\n readonly top: number;\n readonly width: number;\n readonly height: number;\n}\n\n/** Anything that can say where it is drawn: a DOM node, or a test's stand-in. */\nexport interface Measurable {\n getBoundingClientRect(): RectLike;\n}\n\n/** A {@link RectLike} as a {@link Rect}. */\nexport const rectOf = (r: RectLike): Rect => ({ x: r.left, y: r.top, width: r.width, height: r.height });\n\n/** One member of a {@link flip}: an item, the node it draws, and where it goes once the DOM has changed. */\nexport interface FlipEntry {\n readonly item: LayoutItem;\n readonly node: Measurable;\n /**\n * Once the DOM has changed: the old rect (as measured before, in page coordinates) in the item's own coordinates\n * now, and its new place there.\n */\n readonly place: (before: Rect) => { readonly from: Rect; readonly to: Rect };\n}\n\n/**\n * FLIP for DOM groups, on settle: record where each node is drawn (first), change the DOM (`change`: move nodes to\n * other parents, reorder them), then each item is drawn at its old rect and settles to its new place (last, invert,\n * play). No transform tween: a settle from the rect it was drawn at, so it never jumps or overshoots, and its size\n * changes through reveal.\n */\nexport function flip(entries: readonly FlipEntry[], change: () => void): void {\n const before = entries.map((e) => rectOf(e.node.getBoundingClientRect()));\n change();\n entries.forEach((e, i) => {\n const { from, to } = e.place(before[i]!);\n e.item.glideFrom(from, to);\n });\n}\n"],"mappings":"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","names":[]}