@n-uf/motion 26.11.52 → 26.11.54
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 +102 -0
- package/README.md +22 -29
- package/dist/browser.d.ts +79 -3
- package/dist/browser.js +49 -3
- package/dist/browser.js.map +1 -1
- package/dist/chunk-4XGH5367.js +379 -0
- package/dist/chunk-4XGH5367.js.map +1 -0
- package/dist/{chunk-SIAZRWYD.js → chunk-ALYH6YQK.js} +4 -7
- package/dist/chunk-ALYH6YQK.js.map +1 -0
- package/dist/{chunk-BVPVUJ42.js → chunk-G5EJSZ3B.js} +77 -30
- package/dist/chunk-G5EJSZ3B.js.map +1 -0
- package/dist/chunk-IT2FMZOM.js +989 -0
- package/dist/chunk-IT2FMZOM.js.map +1 -0
- package/dist/{chunk-V7DEXKBZ.js → chunk-NI7JLDWZ.js} +35 -8
- package/dist/chunk-NI7JLDWZ.js.map +1 -0
- package/dist/{chunk-7EAAKM6U.js → chunk-QMGPJ2FG.js} +37 -89
- package/dist/chunk-QMGPJ2FG.js.map +1 -0
- package/dist/chunk-RWDYRT3H.js +14 -0
- package/dist/chunk-RWDYRT3H.js.map +1 -0
- package/dist/clock.d.ts +40 -7
- package/dist/clock.js +3 -1
- package/dist/double-click-DBfbiP2U.d.ts +39 -0
- package/dist/drag.d.ts +170 -192
- package/dist/drag.js +24 -892
- package/dist/drag.js.map +1 -1
- package/dist/{frame-loop-C88dc9xw.d.ts → frame-loop-f0V4b464.d.ts} +11 -11
- package/dist/gestures.d.ts +40 -74
- package/dist/gestures.js +8 -7
- package/dist/index.d.ts +10 -6
- package/dist/index.js +60 -10
- package/dist/layout.d.ts +9 -233
- package/dist/layout.js +7 -427
- package/dist/layout.js.map +1 -1
- package/dist/motion-sElR1A_c.d.ts +163 -0
- package/dist/reveal-Dg5fqoWS.d.ts +51 -0
- package/dist/{reveal-C-ewJfFn.d.ts → settle-7C9xxbFg.d.ts} +7 -57
- package/dist/values.d.ts +15 -7
- package/dist/values.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-7EAAKM6U.js.map +0 -1
- package/dist/chunk-BVPVUJ42.js.map +0 -1
- package/dist/chunk-IJSIYH2D.js +0 -7
- package/dist/chunk-IJSIYH2D.js.map +0 -1
- package/dist/chunk-SIAZRWYD.js.map +0 -1
- package/dist/chunk-V7DEXKBZ.js.map +0 -1
- package/dist/double-click-jtUSNuHL.d.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,108 @@
|
|
|
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
|
+
## 26.11.54
|
|
7
|
+
|
|
8
|
+
**The breaking release of the SDK: structure and names, and the few behavior changes they bring.** The drag intent goes
|
|
9
|
+
back to its general job, one preview type serves both drag models, the root exports everything host-free, the DOM writers
|
|
10
|
+
move to `./browser`, and the package has one modifier key and one unit rule. Host notes: every item below is a rename, a
|
|
11
|
+
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
|
|
12
|
+
keeps the old result.
|
|
13
|
+
|
|
14
|
+
- **Root.** `@n-uf/motion` exports everything host-free: `./clock`, `./signals`, `./values`, `./gestures`, `./drag`
|
|
15
|
+
and `./layout`, with the shapes. Only `./browser` and `./testing` stay apart. `./values`, `./gestures`, `./drag` and
|
|
16
|
+
`./layout` re-export the shapes they use.
|
|
17
|
+
- **`./clock`.** `createFrameCoalescer` (with `CoalescerOptions`, `FrameCoalescer`) moves here from `./gestures`.
|
|
18
|
+
`FrameLoopOptions.budgetMs` → `budget`, `frameMs` → `frameInterval`, `maxDeltaMs` → `maxDelta`; `FrameInfo.budgetMs`
|
|
19
|
+
→ `budget`; `FrameStats.lastMs` → `lastFrame`, `maxMs` → `longestFrame`, `meanMs` → `meanFrame`, `phaseMs` →
|
|
20
|
+
`perPhase`; `FakeClockOptions.frameMs` and `FakeClock.frameMs` → `frameInterval`.
|
|
21
|
+
- **`./values`.** `MotionValue.subscribe(listener)` (new): each change of the value, no signals needed.
|
|
22
|
+
`Animator.setVelocity` is required (a tween ignores it). `Settle.hold` is removed: use `jumpTo`. The step's
|
|
23
|
+
parameter `dtMs` → `dt` (ms) in `Animator.step`, `springStep` and `./layout`'s `AnchoredMorph.step`: a name only,
|
|
24
|
+
calls are unchanged.
|
|
25
|
+
- **`./gestures`.** One `ModifierKey` for the package: `"shift" | "alt" | "ctrl" | "meta" | "mod"` (`"mod"`: ⌘ or
|
|
26
|
+
Ctrl, either one); `isHeld` takes a partial set of keys and knows `"mod"`. Gaining `"mod"` breaks code that indexes
|
|
27
|
+
`Modifiers` by a `ModifierKey` (`mods[key]`) or enumerates its values: read a key with `isHeld(mods, key)`. `RecognizerOptions.toCanvas` is optional
|
|
28
|
+
(identity). `modifierDrag` leaves `press` and `dragStart`, and `ModifierDrag` is removed: a host derives it from
|
|
29
|
+
`origin.button` and `isHeld`. `RawPointerEvent.lostBy` `"surface"` → `"view"`. `DOUBLE_CLICK` is exported here (no
|
|
30
|
+
longer from `./drag`). `RecognizerOptions.staleMs` → `stale`, `DwellConfig.dwellMs` → `dwell`,
|
|
31
|
+
`TouchPressConfig.holdMs` → `hold`, `PagedSwipeConfig.idleMs` → `idle`, `lockoutMs` → `lockout`, `thresholdPx` →
|
|
32
|
+
`threshold`; `wheelDeltaPx` → `wheelDelta`.
|
|
33
|
+
- **`./drag`, the intent.** `DragTuning.railArmDwellMs` → `armAfter`; `DragModifiers.railKey` → `armKey`;
|
|
34
|
+
`DragFrame.forced` `"rail"` → `"armed"`. `liftRect`, `floating`, `earlyRelease` and `DragFrame.refusedSinceShown`
|
|
35
|
+
are removed. `DragFrame.landing` is required. New `bounds` and `setBounds`: the intent clamps the pointer onto the
|
|
36
|
+
drawn space. `release(point, targets, keys?)` → `release(point, time, targets, keys?)`, taking a new point as one more
|
|
37
|
+
sample. `ModifierKey` is the gestures one (lower case), and `DragKeys` is `Partial<Modifiers>`;
|
|
38
|
+
`isHeld` and `Modifiers` are exported here too.
|
|
39
|
+
- **`./drag`, the preview.** One type, `DragPreview` = `{ mode, placeGuides? }` with `PreviewMode` `"outline" |
|
|
40
|
+
"placeholder" | "glide" | "snap"`; a mode alone stands for `{ mode }`. The old strings map `"indicator"` →
|
|
41
|
+
`"outline"`, `"gap"` → `"placeholder"`, `"snap"` → `"glide"`, `"item"` → `"snap"`. `DropPreviewMode` is removed.
|
|
42
|
+
`previewPlan` reads a landing frame too (`PreviewFrame`); `PreviewPlan.guides` is required. `EmptyLanes` and the
|
|
43
|
+
preview's `emptyLanes` leave motion (docking's option).
|
|
44
|
+
- **`./drag`, the landing model.** `release()` → `release(point, time, keys?)`. `LandingGates.still` (px per 8 ms) →
|
|
45
|
+
`stillSpeed` (px/ms, 0.1875), `step` → `stepSpeed` (px/ms, 0.375), `slide` → `slideSpeed` (px/ms, 2).
|
|
46
|
+
- **`./layout`.** `LayoutMotion.onIdle` and `running` are removed: `onActiveChange` is the one way to learn idle,
|
|
47
|
+
`idle()` for a test. `domDrawable`, `layOutBox`, `drawBox`, `flip`, `rectOf` and their types move to `./browser`.
|
|
48
|
+
- **`./browser`.** Everything that touches a host, the DOM writers included. `BrowserClockOptions.fallbackFrameMs` →
|
|
49
|
+
`fallbackFrameInterval`.
|
|
50
|
+
- **One unit rule.** Times in ms, distances in px, a pointer's speeds in px/ms, and no name carries its unit. An
|
|
51
|
+
animator's velocity stays in units per second, and a settle's tempo per second.
|
|
52
|
+
- Signals stay public; nothing requires them, and they leave the package's one-line description.
|
|
53
|
+
|
|
54
|
+
What a host sees change, with the call that keeps the old result:
|
|
55
|
+
|
|
56
|
+
- `./drag`: a preview given as a mode alone takes `PLACE_GUIDES_DEFAULT` (`"near"` for placeholder and snap), where an
|
|
57
|
+
old string preview planned `guides: "off"`. Keep no guides with `{ mode, placeGuides: "off" }`.
|
|
58
|
+
- `./drag`: `DRAG_PREVIEW_DEFAULT` is `{ mode: "glide" }` (the old string `"snap"`: the same plan). Compare its `mode`.
|
|
59
|
+
- `./drag`: `PLACE_GUIDES_DEFAULT` gains `glide: "off"`. A host that enumerates it sees one more key.
|
|
60
|
+
- `./drag`: `PreviewPlan.emptyLanes` is removed. Read the empty-lane option from your own state (docking's
|
|
61
|
+
`EmptyLanes`).
|
|
62
|
+
- `./drag`: `earlyRelease: "float"` has no replacement; a release with no target shown lands on the target under the
|
|
63
|
+
pointer, as the old default `"target"` did.
|
|
64
|
+
- `./drag`: a host that passed `floating: true` gets the home that holds wherever it lies (a floating item's home is
|
|
65
|
+
its own place, as for a docked one). Nothing to pass.
|
|
66
|
+
- `./drag`: `release(point, time, …)` at a point that differs from the last `update` runs one more sample there before
|
|
67
|
+
it decides. To decide on the last frame as before, pass the last update's point and time.
|
|
68
|
+
|
|
69
|
+
Behavior, from the release line since 26.11.53 (not part of the renames above):
|
|
70
|
+
|
|
71
|
+
- `./drag`, **a shared corner moves to a lane only when that lane's mark covers it; otherwise the bar keeps it** (fix).
|
|
72
|
+
Under guides `"all"`, a rail that owns a corner (near it, or nearest within reach) cut the bar's guide where its
|
|
73
|
+
whole `entry` overlapped it, even where the rail's lane stops short of the bar's band, or reaches only part of it,
|
|
74
|
+
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
|
|
75
|
+
is drawn (inside its `rect`), and the bar hands the corner over only where that mark covers the bar's guide across
|
|
76
|
+
its whole thickness; else the bar keeps it and the rail's mark gives the overlap up. Both sides are compared as
|
|
77
|
+
drawn: the named lane's marks are clipped to its own `rect` too, a line counts at its drawn thickness (2 px,
|
|
78
|
+
centered), and the named lane is cut by what the owner draws (its guide less the landing it would take, short
|
|
79
|
+
parts dropped), not by its whole `entry`. That is a view for the decision, never what a lane returns: a lane's
|
|
80
|
+
`marks` come back as given. A named lane also leaves out the held (or would-be) landing, the stub outside it
|
|
81
|
+
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`.
|
|
82
|
+
|
|
83
|
+
## 26.11.53
|
|
84
|
+
|
|
85
|
+
- `./drag`, **`guideRects` shortens a thin guide that a clear rect meets only at its end** (fix). A line or a striped
|
|
86
|
+
strip met by a rect at one end of its length only (a toolbar over the last 10 px of a column's line) was thinned
|
|
87
|
+
across its thickness by that rect and so dropped whole. It is now shortened along its length, as a box is trimmed at
|
|
88
|
+
one end: it loses the overlap and the clearance, and keeps `minLength` or is left out. A rect across its middle (or
|
|
89
|
+
over all its length) thins it as before.
|
|
90
|
+
- `./drag`, **`guideRects` widens thin lines** (behavior change). A `line` guide thinner than the new option
|
|
91
|
+
`lineThickness` (default 2 px) is widened to it, centered on its own position, before the inset, the clear rects and
|
|
92
|
+
`minThickness` apply; a line at least that thick is unchanged. Hosts that passed zero-thick lines (placement gives
|
|
93
|
+
the line between two docked panels zero thickness) used to see them dropped by `minThickness`, and now see them
|
|
94
|
+
drawn at 2 px, so a host no longer widens them itself. `lineThickness: 0` keeps the old behavior.
|
|
95
|
+
- `./drag`, **a hand creeping a pixel at a time is slow** (fix). With the hand's speed, a host that sends a sample only
|
|
96
|
+
when the pointer moves a whole pixel, creeping at 0.016 to 0.025 px/ms (a pixel every 40 to 60 ms), made every sample
|
|
97
|
+
a gap, its step unknown, so it never entered a band over a refused column while it kept creeping. A step over a gap
|
|
98
|
+
that is no longer than 3 px now reads as the slow step it is; a longer one (a fling out of a rest) stays unknown. The
|
|
99
|
+
3 px is a length of its own (`HAND_SPEED.slowStep` of the internal estimate), not `gates.step`, which is a speed.
|
|
100
|
+
- Docs only: **the hand's speed estimate of 26.11.52, written up with its costs in numbers.** No behavior change in this
|
|
101
|
+
entry; it describes what 26.11.52 already does. The estimate (`createHandSpeed`, `HAND_SPEED`, `HandSpeedOptions`) is
|
|
102
|
+
internal, not exported from `./drag`. A gap of `min(40, gates.pause)` ms starts the hand again. Since 26.11.52 a slide
|
|
103
|
+
into a touching lane enters about 1.3 to 2.8 times as far up the lane as before it (from the bar under an empty rail,
|
|
104
|
+
smooth samples: 0.6 px/ms 62 → 82 px at 125 Hz, 67 → 106 at 60 Hz; 1.2 px/ms 67 → 125 and 77 → 173; 1.9 px/ms
|
|
105
|
+
61 → 167 and 91 → 243). A hand jittering on the spot after a fling docks 64 → 104 ms after its last fast sample at
|
|
106
|
+
125 Hz, 64 → 128 ms at 60 Hz.
|
|
107
|
+
|
|
6
108
|
## 26.11.52
|
|
7
109
|
|
|
8
110
|
- `./drag`, **one estimate of the hand's speed** (fix, design). Fast or slow was decided four ways (a frame's step, a
|
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,
|
|
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,
|
|
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
|
|
21
|
-
| `@n-uf/motion/clock` | The frame loop (phases input, update, layout, write; a budget; stats)
|
|
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),
|
|
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
|
|
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` |
|
|
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.
|
|
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
|
|
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 {
|
|
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
|
-
//
|
|
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
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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,7 +62,7 @@ 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
|
|
@@ -79,7 +72,7 @@ console.log(intent.release({ x: 100, y: 50 }, [slot])?.id); // "slot"
|
|
|
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
|
|
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
|
|
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 `
|
|
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
|
-
|
|
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
|
|
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,
|
|
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
|
-
|
|
92
|
+
domDrawable,
|
|
93
|
+
drawBox,
|
|
94
|
+
flip,
|
|
95
|
+
layOutBox,
|
|
96
|
+
prefersReducedMotion,
|
|
97
|
+
rectOf
|
|
52
98
|
};
|
|
53
99
|
//# sourceMappingURL=browser.js.map
|
package/dist/browser.js.map
CHANGED
|
@@ -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":[]}
|