@solidrt/components 0.0.64 → 0.0.65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidrt/components",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "license": "MIT",
5
5
  "funding": "https://github.com/sponsors/wellawaretech",
6
6
  "author": "Antoine van Wel",
@@ -20,7 +20,7 @@
20
20
  "qrcode-generator": "^2.0.4"
21
21
  },
22
22
  "peerDependencies": {
23
- "@solidjs/signals": "2.0.0-rc.9",
24
- "@solidrt/core": "0.0.64"
23
+ "@solidjs/signals": "2.0.0-rc.13",
24
+ "@solidrt/core": "0.0.65"
25
25
  }
26
26
  }
@@ -47,13 +47,14 @@ const SCROLL_SPRING = { duration: 250 }
47
47
  // normal deceleration rate of 0.998 per ms). A fling travels its release
48
48
  // speed over this.
49
49
  const MOMENTUM_DECAY = 2
50
- // The curve a fling glides on: easeOutExpo, 1 - 2^(-10 t), the shape of an
51
- // exponential decay.
52
- const MOMENTUM_CURVE: TransitionCurve = [0.19, 1, 0.22, 1]
53
- // The tween's length, ms: where that curve's decay rate is MOMENTUM_DECAY
54
- // (10 ln 2 over the rate). Constant on purpose: a faster fling travels
55
- // farther, not longer, as a decay does; the tail is sub-pixel.
56
- const MOMENTUM_MS = Math.round(((10 * Math.LN2) / MOMENTUM_DECAY) * 1000)
50
+ // The curve a fling glides on: the cubic-bezier closest to an exponential
51
+ // decay (within 0.4% of the distance) when timed as below.
52
+ const MOMENTUM_CURVE = [0.15, 1, 0.36, 1] satisfies TransitionCurve
53
+ // The tween's length, ms: the curve leaves at slope y1/x1, so over this
54
+ // length the glide leaves at exactly the release speed and decays at
55
+ // MOMENTUM_DECAY. Constant on purpose: a faster fling travels farther, not
56
+ // longer, as a decay does; the tail is sub-pixel.
57
+ const MOMENTUM_MS = Math.round((MOMENTUM_CURVE[1] / MOMENTUM_CURVE[0] / MOMENTUM_DECAY) * 1000)
57
58
  // A read-back offset this close to the written one means nothing is in
58
59
  // flight: no instant write.
59
60
  const LIVE_EPSILON = 0.5