@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 +3 -3
- package/src/scroll-view.tsx +8 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidrt/components",
|
|
3
|
-
"version": "0.0.
|
|
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.
|
|
24
|
-
"@solidrt/core": "0.0.
|
|
23
|
+
"@solidjs/signals": "2.0.0-rc.13",
|
|
24
|
+
"@solidrt/core": "0.0.65"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/src/scroll-view.tsx
CHANGED
|
@@ -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:
|
|
51
|
-
//
|
|
52
|
-
const MOMENTUM_CURVE
|
|
53
|
-
// The tween's length, ms:
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
|
|
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
|