react-voodoo 2.6.4 → 2.7.1
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/.claude/scheduled_tasks.lock +1 -0
- package/README.md +23 -7
- package/coverage/clover.xml +2221 -0
- package/coverage/coverage-final.json +35 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/comps/Axis.js.html +391 -0
- package/coverage/lcov-report/comps/Draggable.js.html +1180 -0
- package/coverage/lcov-report/comps/Node.js.html +691 -0
- package/coverage/lcov-report/comps/Tweener.js.html +3637 -0
- package/coverage/lcov-report/comps/TweenerContext.js.html +127 -0
- package/coverage/lcov-report/comps/index.html +176 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/hooks/index.html +146 -0
- package/coverage/lcov-report/hooks/useReducedMotion.js.html +172 -0
- package/coverage/lcov-report/hooks/useTweener.js.html +130 -0
- package/coverage/lcov-report/hooks/useVoodoo.js.html +553 -0
- package/coverage/lcov-report/index.html +206 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/spells/asTweener.js.html +361 -0
- package/coverage/lcov-report/spells/index.html +131 -0
- package/coverage/lcov-report/spells/withTweener.js.html +262 -0
- package/coverage/lcov-report/utils/CssTweenAxis.js.html +721 -0
- package/coverage/lcov-report/utils/css/cssUtils.js.html +916 -0
- package/coverage/lcov-report/utils/css/demux/backgroundColor.js.html +115 -0
- package/coverage/lcov-report/utils/css/demux/boxShadow.js.html +115 -0
- package/coverage/lcov-report/utils/css/demux/filter.js.html +724 -0
- package/coverage/lcov-report/utils/css/demux/index.html +176 -0
- package/coverage/lcov-report/utils/css/demux/textShadow.js.html +115 -0
- package/coverage/lcov-report/utils/css/demux/transform.js.html +1006 -0
- package/coverage/lcov-report/utils/css/demux/typed/any.js.html +640 -0
- package/coverage/lcov-report/utils/css/demux/typed/bool.js.html +196 -0
- package/coverage/lcov-report/utils/css/demux/typed/color.js.html +322 -0
- package/coverage/lcov-report/utils/css/demux/typed/index.html +236 -0
- package/coverage/lcov-report/utils/css/demux/typed/length.js.html +562 -0
- package/coverage/lcov-report/utils/css/demux/typed/multi.js.html +298 -0
- package/coverage/lcov-report/utils/css/demux/typed/number.js.html +199 -0
- package/coverage/lcov-report/utils/css/demux/typed/ratio.js.html +199 -0
- package/coverage/lcov-report/utils/css/demux/typed/shadow.js.html +1060 -0
- package/coverage/lcov-report/utils/css/demux/typed/svgAttr.js.html +214 -0
- package/coverage/lcov-report/utils/css/index.html +146 -0
- package/coverage/lcov-report/utils/css/index.js.html +829 -0
- package/coverage/lcov-report/utils/css/prop.js.html +199 -0
- package/coverage/lcov-report/utils/dom.js.html +1309 -0
- package/coverage/lcov-report/utils/index.html +206 -0
- package/coverage/lcov-report/utils/inertia.js.html +2140 -0
- package/coverage/lcov-report/utils/motionPrefs.js.html +262 -0
- package/coverage/lcov-report/utils/react.js.html +199 -0
- package/coverage/lcov-report/utils/spring.js.html +397 -0
- package/coverage/lcov-report/utils/tweenTools.js.html +1003 -0
- package/coverage/lcov.info +4931 -0
- package/dist/react-voodoo.js +1 -1
- package/dist/react-voodoo.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"sessionId":"6c9df37f-1f1e-4466-9e55-24976b8775e6","pid":36465,"procStart":"400558","acquiredAt":1780727446778}
|
package/README.md
CHANGED
|
@@ -37,6 +37,8 @@ This unlocks a set of features that are unique to the delta model:
|
|
|
37
37
|
| **Additive multi-axis composition** | Each axis contributes a delta; they stack without coordination code. |
|
|
38
38
|
| **Swipeable / draggable animations** | Drag gestures are mapped directly to axis positions with realistic momentum. |
|
|
39
39
|
| **Predictive inertia** | The engine computes the final snap target *at the moment of release*, before the animation plays out — useful for preloading the next slide. |
|
|
40
|
+
| **Physical spring settle** | `settle: { stiffness, damping, mass }` — the landing curve is generated at release from the actual gesture velocity (closed-form, no per-frame integration), with per-waypoint overrides. |
|
|
41
|
+
| **Reduced-motion aware** | `reducedMotion: "user"` honors the OS *prefers-reduced-motion* setting: transitions jump to their predicted target, callbacks still fire, 1:1 dragging untouched. |
|
|
40
42
|
| **SSR with correct initial styles** | Axes have a `defaultPosition`; styles are computed server-side and rendered inline — no flash on first paint. |
|
|
41
43
|
| **DOM writes bypass React** | Style updates go straight to `node.style` via direct DOM writes, never triggering a re-render. |
|
|
42
44
|
| **Multi-unit CSS via `calc()`** | Mix `%`, `px`, `vw`, `bw`/`bh` (box-relative units) in a single value — compiled to `calc()` automatically. |
|
|
@@ -52,7 +54,8 @@ This unlocks a set of features that are unique to the delta model:
|
|
|
52
54
|
| Scroll-linked animation | ✅ | ✅ `useScroll` | ✅ | ⚠️ manual | ✅ | ✅ `ScrollObserver` |
|
|
53
55
|
| Drag-linked animation | ✅ native | ✅ `drag` | ⚠️ manual | ✅ `@use-gesture` | ✅ gestures | ✅ `Draggable` |
|
|
54
56
|
| **Additive multi-axis composition** | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
55
|
-
| Physics / momentum inertia | ✅ predictive | ✅ spring | ❌ | ✅ spring | ⚠️ limited | ✅ spring |
|
|
57
|
+
| Physics / momentum inertia | ✅ predictive + springs | ✅ spring | ❌ | ✅ spring | ⚠️ limited | ✅ spring |
|
|
58
|
+
| Reduced-motion (a11y) | ✅ built-in | ✅ built-in | ⚠️ manual | ✅ built-in | ✅ built-in | ⚠️ manual |
|
|
56
59
|
| **Predictive snap target** | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
57
60
|
| **SSR — correct initial styles** | ✅ | ⚠️ flash | ⚠️ flash | ⚠️ flash | ⚠️ flash | ❌ |
|
|
58
61
|
| Bypasses React render loop | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
@@ -60,7 +63,7 @@ This unlocks a set of features that are unique to the delta model:
|
|
|
60
63
|
| SVG geometry attributes | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
|
|
61
64
|
| Multitouch (drag multiple axes) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
62
65
|
| Bundle size (approx. gzip) | ~18 kB | ~32 kB | ~35 kB | ~25 kB | ~4 kB | ~10 kB |
|
|
63
|
-
| React dependency |
|
|
66
|
+
| React dependency | 16 – 19 | ≥ 18 | none | ≥ 16 | none | none |
|
|
64
67
|
|
|
65
68
|
---
|
|
66
69
|
|
|
@@ -113,7 +116,7 @@ and it disappears entirely once you have more than one axis compositing on the s
|
|
|
113
116
|
npm install react-voodoo
|
|
114
117
|
```
|
|
115
118
|
|
|
116
|
-
**Peer dependencies:** `react
|
|
119
|
+
**Peer dependencies:** `react` & `react-dom` 16 – 19
|
|
117
120
|
|
|
118
121
|
---
|
|
119
122
|
|
|
@@ -208,7 +211,11 @@ const Sample = ( {} ) => {
|
|
|
208
211
|
// lock to only 1 drag direction
|
|
209
212
|
dragDirectionLock: false,
|
|
210
213
|
// allow dragging with mouse
|
|
211
|
-
enableMouseDrag: false
|
|
214
|
+
enableMouseDrag: false,
|
|
215
|
+
// honor the OS prefers-reduced-motion setting : "user" | "always" | "never" (default)
|
|
216
|
+
// when active : eased scrolls & anims jump to their final state, inertia
|
|
217
|
+
// teleports to the predicted snap target ( callbacks still fire )
|
|
218
|
+
reducedMotion: "user"
|
|
212
219
|
}
|
|
213
220
|
);
|
|
214
221
|
// get a named parent tweener
|
|
@@ -272,8 +279,17 @@ const Sample = ( {} ) => {
|
|
|
272
279
|
onSnap: ( snapIndex, targetWayPointObj ) => {
|
|
273
280
|
},
|
|
274
281
|
|
|
275
|
-
//
|
|
276
|
-
|
|
282
|
+
// settle easing : how the axis travels to the landing position
|
|
283
|
+
// ( default : easePolyOut )
|
|
284
|
+
// - any d3-ease fn name or custom easing fn
|
|
285
|
+
// - or a physical spring : the curve is generated at release from
|
|
286
|
+
// the actual gesture velocity ( velocity continuity + bounce ),
|
|
287
|
+
// the predictive waypoint snap stays authoritative
|
|
288
|
+
settle: { stiffness: 200, damping: 14 },
|
|
289
|
+
|
|
290
|
+
// list of waypoints ; gravity > 1 makes a waypoint stickier,
|
|
291
|
+
// a per-waypoint settle overrides the axis-level one
|
|
292
|
+
wayPoints: [{ at: 100 }, { at: 200, gravity: 2, settle: "easeCubicOut" }]
|
|
277
293
|
}
|
|
278
294
|
}
|
|
279
295
|
/>
|
|
@@ -327,7 +343,7 @@ const Sample = ( {} ) => {
|
|
|
327
343
|
// mouseDrag={true} // listen for mouse drag ( default to false )
|
|
328
344
|
// touchDrag={false} // listen for touch drag ( default to true )
|
|
329
345
|
|
|
330
|
-
// button={
|
|
346
|
+
// button={0-2} // limit mouse drag to the specified event.button ( default to 0; the left btn )
|
|
331
347
|
|
|
332
348
|
// * actually Draggable create it's own div node
|
|
333
349
|
>
|