@rootnative/inertia 0.0.6 → 0.0.8
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 +51 -1
- package/README.md +7 -1
- package/dist/chunk-24NUL23E.js +8 -0
- package/dist/chunk-4XBX7KOD.js +8 -0
- package/dist/{chunk-OBRGJAST.js → chunk-6AN5X3YE.js} +3 -3
- package/dist/{chunk-5MGWHOSV.js → chunk-6NOCY764.js} +2 -2
- package/dist/{chunk-PFPO7DX2.mjs → chunk-6YIUETBF.mjs} +1 -1
- package/dist/{chunk-767UKZXG.js → chunk-E3ALFSH2.js} +76 -33
- package/dist/chunk-EN4PN7X3.mjs +22 -0
- package/dist/{chunk-CMHVF6F4.mjs → chunk-GSUC4HWP.mjs} +1 -1
- package/dist/chunk-IHVMNOS4.js +28 -0
- package/dist/{chunk-2ICQLWH2.mjs → chunk-IX6SEOSK.mjs} +53 -12
- package/dist/{chunk-C3EDC5ZW.mjs → chunk-JBK5ZLMH.mjs} +1 -1
- package/dist/{chunk-OW5XTGVN.mjs → chunk-L4JFECXU.mjs} +2 -2
- package/dist/{chunk-BAAQI37F.mjs → chunk-M4766VUV.mjs} +1 -1
- package/dist/{chunk-Z3HCJ43H.mjs → chunk-MFAFB4K7.mjs} +1 -1
- package/dist/{chunk-4NAMD62I.js → chunk-MUT6BTZS.js} +7 -7
- package/dist/{chunk-F7LJX56B.mjs → chunk-QNLSCOR5.mjs} +1 -1
- package/dist/{chunk-REYL77RE.mjs → chunk-W7NTRSPD.mjs} +17 -10
- package/dist/{chunk-PM6CVGXJ.js → chunk-WNVHPMBI.js} +16 -8
- package/dist/chunk-Z5USXWTE.js +8 -0
- package/dist/{chunk-X7B5WR5A.js → chunk-ZBHQPVWE.js} +2 -2
- package/dist/gestureLayer/index.d.mts +2 -2
- package/dist/gestureLayer/index.d.ts +2 -2
- package/dist/gestureLayer/index.js +10 -10
- package/dist/gestureLayer/index.mjs +3 -3
- package/dist/index.d.mts +89 -10
- package/dist/index.d.ts +89 -10
- package/dist/index.js +67 -49
- package/dist/index.mjs +21 -18
- package/dist/motion/FlatList.d.mts +53 -0
- package/dist/motion/FlatList.d.ts +53 -0
- package/dist/motion/FlatList.js +13 -0
- package/dist/motion/FlatList.mjs +4 -0
- package/dist/motion/Image.d.mts +1 -1
- package/dist/motion/Image.d.ts +1 -1
- package/dist/motion/Image.js +5 -5
- package/dist/motion/Image.mjs +4 -4
- package/dist/motion/Pressable.d.mts +1 -1
- package/dist/motion/Pressable.d.ts +1 -1
- package/dist/motion/Pressable.js +5 -5
- package/dist/motion/Pressable.mjs +4 -4
- package/dist/motion/ScrollView.d.mts +1 -1
- package/dist/motion/ScrollView.d.ts +1 -1
- package/dist/motion/ScrollView.js +5 -5
- package/dist/motion/ScrollView.mjs +4 -4
- package/dist/motion/Text.d.mts +1 -1
- package/dist/motion/Text.d.ts +1 -1
- package/dist/motion/Text.js +5 -5
- package/dist/motion/Text.mjs +4 -4
- package/dist/motion/View.d.mts +1 -1
- package/dist/motion/View.d.ts +1 -1
- package/dist/motion/View.js +5 -5
- package/dist/motion/View.mjs +4 -4
- package/dist/touch/index.d.mts +1 -1
- package/dist/touch/index.d.ts +1 -1
- package/dist/touch/index.js +3 -3
- package/dist/touch/index.mjs +1 -1
- package/dist/{types-BQgLJeQG.d.mts → types-DyJpG64F.d.mts} +1 -1
- package/dist/{types-BQgLJeQG.d.ts → types-DyJpG64F.d.ts} +1 -1
- package/dist/{useGesture-DfaTx-3t.d.mts → useGesture-CnZQnYHH.d.mts} +1 -1
- package/dist/{useGesture-B0_CzOUz.d.ts → useGesture-DbH46EBp.d.ts} +1 -1
- package/jest-setup.js +7 -1
- package/llms.txt +25 -4
- package/package.json +8 -1
- package/src/index.ts +5 -0
- package/src/motion/FlatList.tsx +77 -0
- package/src/motion/createMotionComponent.tsx +68 -10
- package/src/motion/index.ts +3 -0
- package/src/stagger/Stagger.tsx +75 -0
- package/src/stagger/StaggerContext.ts +25 -0
- package/src/stagger/index.ts +2 -0
- package/src/transitions/index.ts +6 -1
- package/src/transitions/resolve.ts +7 -1
- package/src/transitions/runtime.ts +22 -7
- package/src/values/useScroll.ts +9 -5
- package/dist/chunk-FWWVHLXB.js +0 -8
- package/dist/chunk-K5SI6VXS.js +0 -8
- package/dist/chunk-STARIT6W.js +0 -8
package/dist/index.js
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
3
|
+
var chunkMUT6BTZS_js = require('./chunk-MUT6BTZS.js');
|
|
4
|
+
var chunk24NUL23E_js = require('./chunk-24NUL23E.js');
|
|
5
|
+
var chunk4XBX7KOD_js = require('./chunk-4XBX7KOD.js');
|
|
6
|
+
var chunkZ5USXWTE_js = require('./chunk-Z5USXWTE.js');
|
|
7
|
+
var chunk6NOCY764_js = require('./chunk-6NOCY764.js');
|
|
8
|
+
var chunkZBHQPVWE_js = require('./chunk-ZBHQPVWE.js');
|
|
9
|
+
var chunkIHVMNOS4_js = require('./chunk-IHVMNOS4.js');
|
|
10
|
+
var chunkE3ALFSH2_js = require('./chunk-E3ALFSH2.js');
|
|
11
|
+
var chunk6AN5X3YE_js = require('./chunk-6AN5X3YE.js');
|
|
12
|
+
var chunkWNVHPMBI_js = require('./chunk-WNVHPMBI.js');
|
|
12
13
|
var react = require('react');
|
|
13
14
|
var reactNativeReanimated = require('react-native-reanimated');
|
|
14
15
|
var reactNativeWorklets = require('react-native-worklets');
|
|
15
16
|
|
|
16
17
|
// src/motion/index.ts
|
|
17
18
|
var Motion = {
|
|
18
|
-
View:
|
|
19
|
-
Text:
|
|
20
|
-
Image:
|
|
21
|
-
Pressable:
|
|
22
|
-
ScrollView:
|
|
19
|
+
View: chunk24NUL23E_js.MotionView,
|
|
20
|
+
Text: chunk4XBX7KOD_js.MotionText,
|
|
21
|
+
Image: chunkZ5USXWTE_js.MotionImage,
|
|
22
|
+
Pressable: chunk6NOCY764_js.MotionPressable,
|
|
23
|
+
ScrollView: chunkZBHQPVWE_js.MotionScrollView,
|
|
24
|
+
FlatList: chunkIHVMNOS4_js.MotionFlatList
|
|
23
25
|
};
|
|
24
26
|
function useAnimation(target, transition) {
|
|
25
27
|
const output = reactNativeReanimated.useSharedValue(target);
|
|
26
|
-
const shouldReduceMotion =
|
|
27
|
-
const resolved =
|
|
28
|
-
const cfgSig =
|
|
28
|
+
const shouldReduceMotion = chunk6AN5X3YE_js.useShouldReduceMotion();
|
|
29
|
+
const resolved = chunk6AN5X3YE_js.resolveNamedTransition(transition, chunk6AN5X3YE_js.useNamedTransitions());
|
|
30
|
+
const cfgSig = chunkWNVHPMBI_js.stableSig(resolved);
|
|
29
31
|
react.useEffect(() => {
|
|
30
32
|
const cfg = shouldReduceMotion ? { type: "no-animation" } : resolved ?? { type: "spring" };
|
|
31
|
-
output.value =
|
|
33
|
+
output.value = chunkWNVHPMBI_js.resolveTransition(cfg, target);
|
|
32
34
|
}, [target, cfgSig, shouldReduceMotion]);
|
|
33
35
|
react.useEffect(
|
|
34
36
|
() => () => reactNativeReanimated.cancelAnimation(output),
|
|
@@ -39,22 +41,22 @@ function useAnimation(target, transition) {
|
|
|
39
41
|
return output;
|
|
40
42
|
}
|
|
41
43
|
function useAnimator() {
|
|
42
|
-
const registry =
|
|
43
|
-
const shouldReduceMotion =
|
|
44
|
+
const registry = chunk6AN5X3YE_js.useNamedTransitions();
|
|
45
|
+
const shouldReduceMotion = chunk6AN5X3YE_js.useShouldReduceMotion();
|
|
44
46
|
const registryRef = react.useRef(registry);
|
|
45
47
|
registryRef.current = registry;
|
|
46
48
|
const reduceMotionRef = react.useRef(shouldReduceMotion);
|
|
47
49
|
reduceMotionRef.current = shouldReduceMotion;
|
|
48
50
|
return react.useCallback((value, to, transition) => {
|
|
49
|
-
const resolved =
|
|
51
|
+
const resolved = chunk6AN5X3YE_js.resolveNamedTransition(transition, registryRef.current);
|
|
50
52
|
const cfg = reduceMotionRef.current ? { type: "no-animation" } : resolved ?? { type: "spring" };
|
|
51
|
-
value.value =
|
|
53
|
+
value.value = chunkWNVHPMBI_js.resolveTransition(cfg, to);
|
|
52
54
|
}, []);
|
|
53
55
|
}
|
|
54
56
|
function useSpring(target, config) {
|
|
55
|
-
const spring = resolveSpringInput(config,
|
|
57
|
+
const spring = resolveSpringInput(config, chunk6AN5X3YE_js.useNamedTransitions());
|
|
56
58
|
const reanimConfig = react.useMemo(
|
|
57
|
-
() =>
|
|
59
|
+
() => chunkWNVHPMBI_js.springToReanimated(spring ?? {}),
|
|
58
60
|
// Keyed on the resolved primitive fields rather than the `config` object
|
|
59
61
|
// identity: callers routinely pass a fresh object literal each render, so
|
|
60
62
|
// depending on `config` itself would rebuild the Reanimated config on
|
|
@@ -99,7 +101,7 @@ function useSpring(target, config) {
|
|
|
99
101
|
}
|
|
100
102
|
function resolveSpringInput(config, registry) {
|
|
101
103
|
if (typeof config !== "string") return config;
|
|
102
|
-
const cfg =
|
|
104
|
+
const cfg = chunk6AN5X3YE_js.lookupNamedTransition(config, registry);
|
|
103
105
|
if (cfg.type === void 0 || cfg.type === "spring") return cfg;
|
|
104
106
|
if (__DEV__) {
|
|
105
107
|
console.warn(
|
|
@@ -296,7 +298,7 @@ function useTransform(arg1, inputRange, outputRange, options) {
|
|
|
296
298
|
if (reactNativeWorklets.isWorkletFunction(userFn)) {
|
|
297
299
|
producer = userFn;
|
|
298
300
|
} else {
|
|
299
|
-
|
|
301
|
+
chunkWNVHPMBI_js.warnNonWorkletOnce(
|
|
300
302
|
"useTransform-transformer",
|
|
301
303
|
"[inertia] useTransform: the transformer is not a worklet, so the shared values it reads can't be tracked as dependencies \u2014 the derived value will only refresh on React re-renders, and native builds reject plain functions on the UI thread. Add the 'worklet' directive as the first statement of the transformer."
|
|
302
304
|
);
|
|
@@ -362,9 +364,9 @@ function useShadow({
|
|
|
362
364
|
const hasElevation = from.elevation !== void 0 || to.elevation !== void 0;
|
|
363
365
|
const hasColor = from.shadowColor !== void 0 || to.shadowColor !== void 0;
|
|
364
366
|
const hasOffset = from.shadowOffset !== void 0 || to.shadowOffset !== void 0;
|
|
365
|
-
const boxShadowPairs = from.boxShadow !== void 0 || to.boxShadow !== void 0 ?
|
|
366
|
-
|
|
367
|
-
|
|
367
|
+
const boxShadowPairs = from.boxShadow !== void 0 || to.boxShadow !== void 0 ? chunkE3ALFSH2_js.pairBoxShadowLayers(
|
|
368
|
+
chunkE3ALFSH2_js.resolveBoxShadowInput(from.boxShadow),
|
|
369
|
+
chunkE3ALFSH2_js.resolveBoxShadowInput(to.boxShadow)
|
|
368
370
|
) : [];
|
|
369
371
|
const opacityFrom = from.shadowOpacity ?? 0;
|
|
370
372
|
const opacityTo = to.shadowOpacity ?? 0;
|
|
@@ -463,83 +465,99 @@ function useVariants(variants, initial) {
|
|
|
463
465
|
|
|
464
466
|
Object.defineProperty(exports, "useGesture", {
|
|
465
467
|
enumerable: true,
|
|
466
|
-
get: function () { return
|
|
468
|
+
get: function () { return chunkMUT6BTZS_js.useGesture; }
|
|
467
469
|
});
|
|
468
470
|
Object.defineProperty(exports, "MotionView", {
|
|
469
471
|
enumerable: true,
|
|
470
|
-
get: function () { return
|
|
472
|
+
get: function () { return chunk24NUL23E_js.MotionView; }
|
|
471
473
|
});
|
|
472
474
|
Object.defineProperty(exports, "MotionText", {
|
|
473
475
|
enumerable: true,
|
|
474
|
-
get: function () { return
|
|
476
|
+
get: function () { return chunk4XBX7KOD_js.MotionText; }
|
|
475
477
|
});
|
|
476
478
|
Object.defineProperty(exports, "MotionImage", {
|
|
477
479
|
enumerable: true,
|
|
478
|
-
get: function () { return
|
|
480
|
+
get: function () { return chunkZ5USXWTE_js.MotionImage; }
|
|
479
481
|
});
|
|
480
482
|
Object.defineProperty(exports, "MotionPressable", {
|
|
481
483
|
enumerable: true,
|
|
482
|
-
get: function () { return
|
|
484
|
+
get: function () { return chunk6NOCY764_js.MotionPressable; }
|
|
483
485
|
});
|
|
484
486
|
Object.defineProperty(exports, "MotionScrollView", {
|
|
485
487
|
enumerable: true,
|
|
486
|
-
get: function () { return
|
|
488
|
+
get: function () { return chunkZBHQPVWE_js.MotionScrollView; }
|
|
489
|
+
});
|
|
490
|
+
Object.defineProperty(exports, "MotionFlatList", {
|
|
491
|
+
enumerable: true,
|
|
492
|
+
get: function () { return chunkIHVMNOS4_js.MotionFlatList; }
|
|
487
493
|
});
|
|
488
494
|
Object.defineProperty(exports, "Presence", {
|
|
489
495
|
enumerable: true,
|
|
490
|
-
get: function () { return
|
|
496
|
+
get: function () { return chunkE3ALFSH2_js.Presence; }
|
|
497
|
+
});
|
|
498
|
+
Object.defineProperty(exports, "Stagger", {
|
|
499
|
+
enumerable: true,
|
|
500
|
+
get: function () { return chunkE3ALFSH2_js.Stagger; }
|
|
491
501
|
});
|
|
492
502
|
Object.defineProperty(exports, "TRANSPARENT", {
|
|
493
503
|
enumerable: true,
|
|
494
|
-
get: function () { return
|
|
504
|
+
get: function () { return chunkE3ALFSH2_js.TRANSPARENT; }
|
|
495
505
|
});
|
|
496
506
|
Object.defineProperty(exports, "createMotionComponent", {
|
|
497
507
|
enumerable: true,
|
|
498
|
-
get: function () { return
|
|
508
|
+
get: function () { return chunkE3ALFSH2_js.createMotionComponent; }
|
|
499
509
|
});
|
|
500
510
|
Object.defineProperty(exports, "usePresence", {
|
|
501
511
|
enumerable: true,
|
|
502
|
-
get: function () { return
|
|
512
|
+
get: function () { return chunkE3ALFSH2_js.usePresence; }
|
|
513
|
+
});
|
|
514
|
+
Object.defineProperty(exports, "useStaggerDelay", {
|
|
515
|
+
enumerable: true,
|
|
516
|
+
get: function () { return chunkE3ALFSH2_js.useStaggerDelay; }
|
|
503
517
|
});
|
|
504
518
|
Object.defineProperty(exports, "MotionConfig", {
|
|
505
519
|
enumerable: true,
|
|
506
|
-
get: function () { return
|
|
520
|
+
get: function () { return chunk6AN5X3YE_js.MotionConfig; }
|
|
507
521
|
});
|
|
508
522
|
Object.defineProperty(exports, "resolveNamedTransition", {
|
|
509
523
|
enumerable: true,
|
|
510
|
-
get: function () { return
|
|
524
|
+
get: function () { return chunk6AN5X3YE_js.resolveNamedTransition; }
|
|
511
525
|
});
|
|
512
526
|
Object.defineProperty(exports, "useMotionConfig", {
|
|
513
527
|
enumerable: true,
|
|
514
|
-
get: function () { return
|
|
528
|
+
get: function () { return chunk6AN5X3YE_js.useMotionConfig; }
|
|
515
529
|
});
|
|
516
530
|
Object.defineProperty(exports, "useNamedTransitions", {
|
|
517
531
|
enumerable: true,
|
|
518
|
-
get: function () { return
|
|
532
|
+
get: function () { return chunk6AN5X3YE_js.useNamedTransitions; }
|
|
519
533
|
});
|
|
520
534
|
Object.defineProperty(exports, "useShouldReduceMotion", {
|
|
521
535
|
enumerable: true,
|
|
522
|
-
get: function () { return
|
|
536
|
+
get: function () { return chunk6AN5X3YE_js.useShouldReduceMotion; }
|
|
537
|
+
});
|
|
538
|
+
Object.defineProperty(exports, "applyDelay", {
|
|
539
|
+
enumerable: true,
|
|
540
|
+
get: function () { return chunkWNVHPMBI_js.applyDelay; }
|
|
523
541
|
});
|
|
524
542
|
Object.defineProperty(exports, "buildReleaseAnimation", {
|
|
525
543
|
enumerable: true,
|
|
526
|
-
get: function () { return
|
|
544
|
+
get: function () { return chunkWNVHPMBI_js.buildReleaseAnimation; }
|
|
527
545
|
});
|
|
528
546
|
Object.defineProperty(exports, "cubicBezier", {
|
|
529
547
|
enumerable: true,
|
|
530
|
-
get: function () { return
|
|
548
|
+
get: function () { return chunkWNVHPMBI_js.cubicBezier; }
|
|
531
549
|
});
|
|
532
550
|
Object.defineProperty(exports, "ensureWorkletEasing", {
|
|
533
551
|
enumerable: true,
|
|
534
|
-
get: function () { return
|
|
552
|
+
get: function () { return chunkWNVHPMBI_js.ensureWorkletEasing; }
|
|
535
553
|
});
|
|
536
554
|
Object.defineProperty(exports, "resolveAnimatableValue", {
|
|
537
555
|
enumerable: true,
|
|
538
|
-
get: function () { return
|
|
556
|
+
get: function () { return chunkWNVHPMBI_js.resolveAnimatableValue; }
|
|
539
557
|
});
|
|
540
558
|
Object.defineProperty(exports, "resolveTransition", {
|
|
541
559
|
enumerable: true,
|
|
542
|
-
get: function () { return
|
|
560
|
+
get: function () { return chunkWNVHPMBI_js.resolveTransition; }
|
|
543
561
|
});
|
|
544
562
|
exports.Motion = Motion;
|
|
545
563
|
exports.useAnimation = useAnimation;
|
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
export { useGesture } from './chunk-
|
|
2
|
-
import { MotionView } from './chunk-
|
|
3
|
-
export { MotionView } from './chunk-
|
|
4
|
-
import { MotionText } from './chunk-
|
|
5
|
-
export { MotionText } from './chunk-
|
|
6
|
-
import { MotionImage } from './chunk-
|
|
7
|
-
export { MotionImage } from './chunk-
|
|
8
|
-
import { MotionPressable } from './chunk-
|
|
9
|
-
export { MotionPressable } from './chunk-
|
|
10
|
-
import { MotionScrollView } from './chunk-
|
|
11
|
-
export { MotionScrollView } from './chunk-
|
|
12
|
-
import {
|
|
13
|
-
export {
|
|
14
|
-
import {
|
|
15
|
-
export {
|
|
16
|
-
import {
|
|
17
|
-
export {
|
|
1
|
+
export { useGesture } from './chunk-L4JFECXU.mjs';
|
|
2
|
+
import { MotionView } from './chunk-GSUC4HWP.mjs';
|
|
3
|
+
export { MotionView } from './chunk-GSUC4HWP.mjs';
|
|
4
|
+
import { MotionText } from './chunk-QNLSCOR5.mjs';
|
|
5
|
+
export { MotionText } from './chunk-QNLSCOR5.mjs';
|
|
6
|
+
import { MotionImage } from './chunk-6YIUETBF.mjs';
|
|
7
|
+
export { MotionImage } from './chunk-6YIUETBF.mjs';
|
|
8
|
+
import { MotionPressable } from './chunk-JBK5ZLMH.mjs';
|
|
9
|
+
export { MotionPressable } from './chunk-JBK5ZLMH.mjs';
|
|
10
|
+
import { MotionScrollView } from './chunk-M4766VUV.mjs';
|
|
11
|
+
export { MotionScrollView } from './chunk-M4766VUV.mjs';
|
|
12
|
+
import { MotionFlatList } from './chunk-EN4PN7X3.mjs';
|
|
13
|
+
export { MotionFlatList } from './chunk-EN4PN7X3.mjs';
|
|
14
|
+
import { pairBoxShadowLayers, resolveBoxShadowInput } from './chunk-IX6SEOSK.mjs';
|
|
15
|
+
export { Presence, Stagger, TRANSPARENT, createMotionComponent, usePresence, useStaggerDelay } from './chunk-IX6SEOSK.mjs';
|
|
16
|
+
import { useShouldReduceMotion, resolveNamedTransition, useNamedTransitions, lookupNamedTransition } from './chunk-MFAFB4K7.mjs';
|
|
17
|
+
export { MotionConfig, resolveNamedTransition, useMotionConfig, useNamedTransitions, useShouldReduceMotion } from './chunk-MFAFB4K7.mjs';
|
|
18
|
+
import { stableSig, resolveTransition, springToReanimated, warnNonWorkletOnce } from './chunk-W7NTRSPD.mjs';
|
|
19
|
+
export { applyDelay, buildReleaseAnimation, cubicBezier, ensureWorkletEasing, resolveAnimatableValue, resolveTransition } from './chunk-W7NTRSPD.mjs';
|
|
18
20
|
import { useEffect, useRef, useCallback, useMemo } from 'react';
|
|
19
21
|
import { useSharedValue, cancelAnimation, withSpring, useAnimatedReaction, useAnimatedStyle, interpolateColor, interpolate, useDerivedValue, Extrapolation, useAnimatedScrollHandler } from 'react-native-reanimated';
|
|
20
22
|
import { isWorkletFunction } from 'react-native-worklets';
|
|
@@ -25,7 +27,8 @@ var Motion = {
|
|
|
25
27
|
Text: MotionText,
|
|
26
28
|
Image: MotionImage,
|
|
27
29
|
Pressable: MotionPressable,
|
|
28
|
-
ScrollView: MotionScrollView
|
|
30
|
+
ScrollView: MotionScrollView,
|
|
31
|
+
FlatList: MotionFlatList
|
|
29
32
|
};
|
|
30
33
|
function useAnimation(target, transition) {
|
|
31
34
|
const output = useSharedValue(target);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { FlatListProps, FlatList } from 'react-native';
|
|
2
|
+
import { V as VariantsMap, a as MotionProps } from '../types-DyJpG64F.mjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Animatable, virtualized `FlatList`.
|
|
7
|
+
*
|
|
8
|
+
* Built on Reanimated's `Animated.FlatList` rather than RN's `FlatList`. That
|
|
9
|
+
* wrapper supplies two things this primitive would otherwise have to
|
|
10
|
+
* re-implement: the `CellRendererComponent` injection that powers per-row
|
|
11
|
+
* `itemLayoutAnimation`, and a `scrollEventThrottle` default of 1.
|
|
12
|
+
*
|
|
13
|
+
* A note on that throttle default, because the reasoning is easy to get wrong
|
|
14
|
+
* from Reanimated's own source comment: it says RN defaults FlatList's
|
|
15
|
+
* `scrollEventThrottle` to 50, which **is stale**. On RN 0.81
|
|
16
|
+
* (`@react-native/virtualized-lists`, `VirtualizedList.js`) the default is
|
|
17
|
+
* `props.scrollEventThrottle ?? 0.0001` — effectively every frame. So the
|
|
18
|
+
* patch is belt-and-braces on current RN rather than the load-bearing reason
|
|
19
|
+
* to use the wrapper. It is still worth inheriting: it costs nothing, and it
|
|
20
|
+
* pins the behaviour if RN's default changes again. **Do not restate the "50"
|
|
21
|
+
* figure as fact** — verify against the installed RN before relying on it.
|
|
22
|
+
*
|
|
23
|
+
* This is the primitive that lets one list both virtualize and animate. The
|
|
24
|
+
* `useScroll()` handler works because `Motion.*` components are Reanimated
|
|
25
|
+
* animated components — the same mechanism `Motion.ScrollView` relies on, and
|
|
26
|
+
* nothing about it was ever specific to `ScrollView`:
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* const { scrollY, onScroll } = useScroll()
|
|
30
|
+
*
|
|
31
|
+
* <Motion.FlatList
|
|
32
|
+
* data={items}
|
|
33
|
+
* renderItem={renderItem}
|
|
34
|
+
* onScroll={onScroll}
|
|
35
|
+
* initial={{ opacity: 0 }}
|
|
36
|
+
* animate={{ opacity: 1 }}
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* Two scoping notes:
|
|
41
|
+
*
|
|
42
|
+
* - `animate` / `initial` / `gesture` apply to the **scroll container**, not to
|
|
43
|
+
* rows. Animate rows by using a `Motion.*` primitive inside `renderItem`.
|
|
44
|
+
* - The `layout` prop animates the list frame. Per-row layout animation is
|
|
45
|
+
* Reanimated's `itemLayoutAnimation`, which is forwarded through untouched.
|
|
46
|
+
* Note that row-level layout animation can fight the list's own measurement
|
|
47
|
+
* passes — measure before adopting it.
|
|
48
|
+
*/
|
|
49
|
+
declare const MotionFlatList: <ItemT = any, V extends VariantsMap<FlatListProps<ItemT>> = VariantsMap<FlatListProps<ItemT>>>(props: FlatListProps<ItemT> & MotionProps<FlatListProps<ItemT>, V> & {
|
|
50
|
+
ref?: React.Ref<FlatList<ItemT>>;
|
|
51
|
+
}) => React.ReactElement;
|
|
52
|
+
|
|
53
|
+
export { MotionFlatList };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { FlatListProps, FlatList } from 'react-native';
|
|
2
|
+
import { V as VariantsMap, a as MotionProps } from '../types-DyJpG64F.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Animatable, virtualized `FlatList`.
|
|
7
|
+
*
|
|
8
|
+
* Built on Reanimated's `Animated.FlatList` rather than RN's `FlatList`. That
|
|
9
|
+
* wrapper supplies two things this primitive would otherwise have to
|
|
10
|
+
* re-implement: the `CellRendererComponent` injection that powers per-row
|
|
11
|
+
* `itemLayoutAnimation`, and a `scrollEventThrottle` default of 1.
|
|
12
|
+
*
|
|
13
|
+
* A note on that throttle default, because the reasoning is easy to get wrong
|
|
14
|
+
* from Reanimated's own source comment: it says RN defaults FlatList's
|
|
15
|
+
* `scrollEventThrottle` to 50, which **is stale**. On RN 0.81
|
|
16
|
+
* (`@react-native/virtualized-lists`, `VirtualizedList.js`) the default is
|
|
17
|
+
* `props.scrollEventThrottle ?? 0.0001` — effectively every frame. So the
|
|
18
|
+
* patch is belt-and-braces on current RN rather than the load-bearing reason
|
|
19
|
+
* to use the wrapper. It is still worth inheriting: it costs nothing, and it
|
|
20
|
+
* pins the behaviour if RN's default changes again. **Do not restate the "50"
|
|
21
|
+
* figure as fact** — verify against the installed RN before relying on it.
|
|
22
|
+
*
|
|
23
|
+
* This is the primitive that lets one list both virtualize and animate. The
|
|
24
|
+
* `useScroll()` handler works because `Motion.*` components are Reanimated
|
|
25
|
+
* animated components — the same mechanism `Motion.ScrollView` relies on, and
|
|
26
|
+
* nothing about it was ever specific to `ScrollView`:
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* const { scrollY, onScroll } = useScroll()
|
|
30
|
+
*
|
|
31
|
+
* <Motion.FlatList
|
|
32
|
+
* data={items}
|
|
33
|
+
* renderItem={renderItem}
|
|
34
|
+
* onScroll={onScroll}
|
|
35
|
+
* initial={{ opacity: 0 }}
|
|
36
|
+
* animate={{ opacity: 1 }}
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* Two scoping notes:
|
|
41
|
+
*
|
|
42
|
+
* - `animate` / `initial` / `gesture` apply to the **scroll container**, not to
|
|
43
|
+
* rows. Animate rows by using a `Motion.*` primitive inside `renderItem`.
|
|
44
|
+
* - The `layout` prop animates the list frame. Per-row layout animation is
|
|
45
|
+
* Reanimated's `itemLayoutAnimation`, which is forwarded through untouched.
|
|
46
|
+
* Note that row-level layout animation can fight the list's own measurement
|
|
47
|
+
* passes — measure before adopting it.
|
|
48
|
+
*/
|
|
49
|
+
declare const MotionFlatList: <ItemT = any, V extends VariantsMap<FlatListProps<ItemT>> = VariantsMap<FlatListProps<ItemT>>>(props: FlatListProps<ItemT> & MotionProps<FlatListProps<ItemT>, V> & {
|
|
50
|
+
ref?: React.Ref<FlatList<ItemT>>;
|
|
51
|
+
}) => React.ReactElement;
|
|
52
|
+
|
|
53
|
+
export { MotionFlatList };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkIHVMNOS4_js = require('../chunk-IHVMNOS4.js');
|
|
4
|
+
require('../chunk-E3ALFSH2.js');
|
|
5
|
+
require('../chunk-6AN5X3YE.js');
|
|
6
|
+
require('../chunk-WNVHPMBI.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "MotionFlatList", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunkIHVMNOS4_js.MotionFlatList; }
|
|
13
|
+
});
|
package/dist/motion/Image.d.mts
CHANGED
package/dist/motion/Image.d.ts
CHANGED
package/dist/motion/Image.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var chunkZ5USXWTE_js = require('../chunk-Z5USXWTE.js');
|
|
4
|
+
require('../chunk-E3ALFSH2.js');
|
|
5
|
+
require('../chunk-6AN5X3YE.js');
|
|
6
|
+
require('../chunk-WNVHPMBI.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "MotionImage", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkZ5USXWTE_js.MotionImage; }
|
|
13
13
|
});
|
package/dist/motion/Image.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { MotionImage } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { MotionImage } from '../chunk-6YIUETBF.mjs';
|
|
2
|
+
import '../chunk-IX6SEOSK.mjs';
|
|
3
|
+
import '../chunk-MFAFB4K7.mjs';
|
|
4
|
+
import '../chunk-W7NTRSPD.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as react_native from 'react-native';
|
|
3
|
-
import { M as MotionComponent } from '../types-
|
|
3
|
+
import { M as MotionComponent } from '../types-DyJpG64F.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Animatable `Pressable`. The `gesture` prop's `pressed` sub-state hooks into
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as react_native from 'react-native';
|
|
3
|
-
import { M as MotionComponent } from '../types-
|
|
3
|
+
import { M as MotionComponent } from '../types-DyJpG64F.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Animatable `Pressable`. The `gesture` prop's `pressed` sub-state hooks into
|
package/dist/motion/Pressable.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var chunk6NOCY764_js = require('../chunk-6NOCY764.js');
|
|
4
|
+
require('../chunk-E3ALFSH2.js');
|
|
5
|
+
require('../chunk-6AN5X3YE.js');
|
|
6
|
+
require('../chunk-WNVHPMBI.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "MotionPressable", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunk6NOCY764_js.MotionPressable; }
|
|
13
13
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { MotionPressable } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { MotionPressable } from '../chunk-JBK5ZLMH.mjs';
|
|
2
|
+
import '../chunk-IX6SEOSK.mjs';
|
|
3
|
+
import '../chunk-MFAFB4K7.mjs';
|
|
4
|
+
import '../chunk-W7NTRSPD.mjs';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var chunkZBHQPVWE_js = require('../chunk-ZBHQPVWE.js');
|
|
4
|
+
require('../chunk-E3ALFSH2.js');
|
|
5
|
+
require('../chunk-6AN5X3YE.js');
|
|
6
|
+
require('../chunk-WNVHPMBI.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "MotionScrollView", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkZBHQPVWE_js.MotionScrollView; }
|
|
13
13
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { MotionScrollView } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { MotionScrollView } from '../chunk-M4766VUV.mjs';
|
|
2
|
+
import '../chunk-IX6SEOSK.mjs';
|
|
3
|
+
import '../chunk-MFAFB4K7.mjs';
|
|
4
|
+
import '../chunk-W7NTRSPD.mjs';
|
package/dist/motion/Text.d.mts
CHANGED
package/dist/motion/Text.d.ts
CHANGED
package/dist/motion/Text.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var chunk4XBX7KOD_js = require('../chunk-4XBX7KOD.js');
|
|
4
|
+
require('../chunk-E3ALFSH2.js');
|
|
5
|
+
require('../chunk-6AN5X3YE.js');
|
|
6
|
+
require('../chunk-WNVHPMBI.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "MotionText", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunk4XBX7KOD_js.MotionText; }
|
|
13
13
|
});
|
package/dist/motion/Text.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { MotionText } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { MotionText } from '../chunk-QNLSCOR5.mjs';
|
|
2
|
+
import '../chunk-IX6SEOSK.mjs';
|
|
3
|
+
import '../chunk-MFAFB4K7.mjs';
|
|
4
|
+
import '../chunk-W7NTRSPD.mjs';
|
package/dist/motion/View.d.mts
CHANGED
package/dist/motion/View.d.ts
CHANGED
package/dist/motion/View.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var chunk24NUL23E_js = require('../chunk-24NUL23E.js');
|
|
4
|
+
require('../chunk-E3ALFSH2.js');
|
|
5
|
+
require('../chunk-6AN5X3YE.js');
|
|
6
|
+
require('../chunk-WNVHPMBI.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "MotionView", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunk24NUL23E_js.MotionView; }
|
|
13
13
|
});
|