solidjs-motion 0.1.3 → 0.1.4
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 +22 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/src/motion-proxy.d.ts +1 -1
- package/dist/src/types.d.ts +14 -0
- package/package.json +1 -1
- package/src/motion-proxy.tsx +2 -0
- package/src/primitives/createDrag.ts +20 -9
- package/src/types.ts +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,28 @@ All notable changes to `solidjs-motion` / `@solidjs-motion/motion` are documente
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.4] — 2026-05-21
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`dragListener` option** on `useMotion` / `<motion.X>` / `motion.create`.
|
|
13
|
+
Mirrors motion-react's prop. Defaults to `true`. When set to `false`,
|
|
14
|
+
drag skips attaching its own pointerdown listener to the element —
|
|
15
|
+
drag becomes external-only, triggered through `dragControls.start(e)`
|
|
16
|
+
from a handle elsewhere. The canonical case is a scrollable drawer
|
|
17
|
+
body where direct pointer interaction must stay scroll-only, and a
|
|
18
|
+
dedicated edge handle is the single drag affordance.
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
const controls = createDragControls()
|
|
22
|
+
return (
|
|
23
|
+
<motion.aside drag="x" dragControls={controls} dragListener={false}>
|
|
24
|
+
{/* body stays scrollable — no drag from direct touch */}
|
|
25
|
+
<span onPointerDown={(e) => controls.start(e)}>handle</span>
|
|
26
|
+
</motion.aside>
|
|
27
|
+
)
|
|
28
|
+
```
|
|
29
|
+
|
|
8
30
|
## [0.1.3] — 2026-05-21
|
|
9
31
|
|
|
10
32
|
### Fixed
|
package/dist/index.js
CHANGED
|
@@ -1246,7 +1246,7 @@ function createDrag(el, getOpts, setActive) {
|
|
|
1246
1246
|
sessionBounds = null;
|
|
1247
1247
|
getOpts().onDragEnd?.(event, info);
|
|
1248
1248
|
};
|
|
1249
|
-
createPan(() => el, () => ({
|
|
1249
|
+
if (getOpts().dragListener !== false) createPan(() => el, () => ({
|
|
1250
1250
|
threshold: getOpts().panThreshold,
|
|
1251
1251
|
onPanStart: handlePanStart,
|
|
1252
1252
|
onPan: handlePan,
|
|
@@ -2380,6 +2380,7 @@ var MOTION_OPT_KEYS = [
|
|
|
2380
2380
|
"dragTransition",
|
|
2381
2381
|
"dragSnapToOrigin",
|
|
2382
2382
|
"dragControls",
|
|
2383
|
+
"dragListener",
|
|
2383
2384
|
"whileDrag",
|
|
2384
2385
|
"panThreshold",
|
|
2385
2386
|
"variants",
|