@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.
Files changed (79) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/README.md +7 -1
  3. package/dist/chunk-24NUL23E.js +8 -0
  4. package/dist/chunk-4XBX7KOD.js +8 -0
  5. package/dist/{chunk-OBRGJAST.js → chunk-6AN5X3YE.js} +3 -3
  6. package/dist/{chunk-5MGWHOSV.js → chunk-6NOCY764.js} +2 -2
  7. package/dist/{chunk-PFPO7DX2.mjs → chunk-6YIUETBF.mjs} +1 -1
  8. package/dist/{chunk-767UKZXG.js → chunk-E3ALFSH2.js} +76 -33
  9. package/dist/chunk-EN4PN7X3.mjs +22 -0
  10. package/dist/{chunk-CMHVF6F4.mjs → chunk-GSUC4HWP.mjs} +1 -1
  11. package/dist/chunk-IHVMNOS4.js +28 -0
  12. package/dist/{chunk-2ICQLWH2.mjs → chunk-IX6SEOSK.mjs} +53 -12
  13. package/dist/{chunk-C3EDC5ZW.mjs → chunk-JBK5ZLMH.mjs} +1 -1
  14. package/dist/{chunk-OW5XTGVN.mjs → chunk-L4JFECXU.mjs} +2 -2
  15. package/dist/{chunk-BAAQI37F.mjs → chunk-M4766VUV.mjs} +1 -1
  16. package/dist/{chunk-Z3HCJ43H.mjs → chunk-MFAFB4K7.mjs} +1 -1
  17. package/dist/{chunk-4NAMD62I.js → chunk-MUT6BTZS.js} +7 -7
  18. package/dist/{chunk-F7LJX56B.mjs → chunk-QNLSCOR5.mjs} +1 -1
  19. package/dist/{chunk-REYL77RE.mjs → chunk-W7NTRSPD.mjs} +17 -10
  20. package/dist/{chunk-PM6CVGXJ.js → chunk-WNVHPMBI.js} +16 -8
  21. package/dist/chunk-Z5USXWTE.js +8 -0
  22. package/dist/{chunk-X7B5WR5A.js → chunk-ZBHQPVWE.js} +2 -2
  23. package/dist/gestureLayer/index.d.mts +2 -2
  24. package/dist/gestureLayer/index.d.ts +2 -2
  25. package/dist/gestureLayer/index.js +10 -10
  26. package/dist/gestureLayer/index.mjs +3 -3
  27. package/dist/index.d.mts +89 -10
  28. package/dist/index.d.ts +89 -10
  29. package/dist/index.js +67 -49
  30. package/dist/index.mjs +21 -18
  31. package/dist/motion/FlatList.d.mts +53 -0
  32. package/dist/motion/FlatList.d.ts +53 -0
  33. package/dist/motion/FlatList.js +13 -0
  34. package/dist/motion/FlatList.mjs +4 -0
  35. package/dist/motion/Image.d.mts +1 -1
  36. package/dist/motion/Image.d.ts +1 -1
  37. package/dist/motion/Image.js +5 -5
  38. package/dist/motion/Image.mjs +4 -4
  39. package/dist/motion/Pressable.d.mts +1 -1
  40. package/dist/motion/Pressable.d.ts +1 -1
  41. package/dist/motion/Pressable.js +5 -5
  42. package/dist/motion/Pressable.mjs +4 -4
  43. package/dist/motion/ScrollView.d.mts +1 -1
  44. package/dist/motion/ScrollView.d.ts +1 -1
  45. package/dist/motion/ScrollView.js +5 -5
  46. package/dist/motion/ScrollView.mjs +4 -4
  47. package/dist/motion/Text.d.mts +1 -1
  48. package/dist/motion/Text.d.ts +1 -1
  49. package/dist/motion/Text.js +5 -5
  50. package/dist/motion/Text.mjs +4 -4
  51. package/dist/motion/View.d.mts +1 -1
  52. package/dist/motion/View.d.ts +1 -1
  53. package/dist/motion/View.js +5 -5
  54. package/dist/motion/View.mjs +4 -4
  55. package/dist/touch/index.d.mts +1 -1
  56. package/dist/touch/index.d.ts +1 -1
  57. package/dist/touch/index.js +3 -3
  58. package/dist/touch/index.mjs +1 -1
  59. package/dist/{types-BQgLJeQG.d.mts → types-DyJpG64F.d.mts} +1 -1
  60. package/dist/{types-BQgLJeQG.d.ts → types-DyJpG64F.d.ts} +1 -1
  61. package/dist/{useGesture-DfaTx-3t.d.mts → useGesture-CnZQnYHH.d.mts} +1 -1
  62. package/dist/{useGesture-B0_CzOUz.d.ts → useGesture-DbH46EBp.d.ts} +1 -1
  63. package/jest-setup.js +7 -1
  64. package/llms.txt +25 -4
  65. package/package.json +8 -1
  66. package/src/index.ts +5 -0
  67. package/src/motion/FlatList.tsx +77 -0
  68. package/src/motion/createMotionComponent.tsx +68 -10
  69. package/src/motion/index.ts +3 -0
  70. package/src/stagger/Stagger.tsx +75 -0
  71. package/src/stagger/StaggerContext.ts +25 -0
  72. package/src/stagger/index.ts +2 -0
  73. package/src/transitions/index.ts +6 -1
  74. package/src/transitions/resolve.ts +7 -1
  75. package/src/transitions/runtime.ts +22 -7
  76. package/src/values/useScroll.ts +9 -5
  77. package/dist/chunk-FWWVHLXB.js +0 -8
  78. package/dist/chunk-K5SI6VXS.js +0 -8
  79. package/dist/chunk-STARIT6W.js +0 -8
package/dist/index.js CHANGED
@@ -1,34 +1,36 @@
1
1
  'use strict';
2
2
 
3
- var chunk4NAMD62I_js = require('./chunk-4NAMD62I.js');
4
- var chunkK5SI6VXS_js = require('./chunk-K5SI6VXS.js');
5
- var chunkSTARIT6W_js = require('./chunk-STARIT6W.js');
6
- var chunkFWWVHLXB_js = require('./chunk-FWWVHLXB.js');
7
- var chunk5MGWHOSV_js = require('./chunk-5MGWHOSV.js');
8
- var chunkX7B5WR5A_js = require('./chunk-X7B5WR5A.js');
9
- var chunk767UKZXG_js = require('./chunk-767UKZXG.js');
10
- var chunkOBRGJAST_js = require('./chunk-OBRGJAST.js');
11
- var chunkPM6CVGXJ_js = require('./chunk-PM6CVGXJ.js');
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: chunkK5SI6VXS_js.MotionView,
19
- Text: chunkSTARIT6W_js.MotionText,
20
- Image: chunkFWWVHLXB_js.MotionImage,
21
- Pressable: chunk5MGWHOSV_js.MotionPressable,
22
- ScrollView: chunkX7B5WR5A_js.MotionScrollView
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 = chunkOBRGJAST_js.useShouldReduceMotion();
27
- const resolved = chunkOBRGJAST_js.resolveNamedTransition(transition, chunkOBRGJAST_js.useNamedTransitions());
28
- const cfgSig = chunkPM6CVGXJ_js.stableSig(resolved);
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 = chunkPM6CVGXJ_js.resolveTransition(cfg, target);
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 = chunkOBRGJAST_js.useNamedTransitions();
43
- const shouldReduceMotion = chunkOBRGJAST_js.useShouldReduceMotion();
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 = chunkOBRGJAST_js.resolveNamedTransition(transition, registryRef.current);
51
+ const resolved = chunk6AN5X3YE_js.resolveNamedTransition(transition, registryRef.current);
50
52
  const cfg = reduceMotionRef.current ? { type: "no-animation" } : resolved ?? { type: "spring" };
51
- value.value = chunkPM6CVGXJ_js.resolveTransition(cfg, to);
53
+ value.value = chunkWNVHPMBI_js.resolveTransition(cfg, to);
52
54
  }, []);
53
55
  }
54
56
  function useSpring(target, config) {
55
- const spring = resolveSpringInput(config, chunkOBRGJAST_js.useNamedTransitions());
57
+ const spring = resolveSpringInput(config, chunk6AN5X3YE_js.useNamedTransitions());
56
58
  const reanimConfig = react.useMemo(
57
- () => chunkPM6CVGXJ_js.springToReanimated(spring ?? {}),
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 = chunkOBRGJAST_js.lookupNamedTransition(config, registry);
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
- chunkPM6CVGXJ_js.warnNonWorkletOnce(
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 ? chunk767UKZXG_js.pairBoxShadowLayers(
366
- chunk767UKZXG_js.resolveBoxShadowInput(from.boxShadow),
367
- chunk767UKZXG_js.resolveBoxShadowInput(to.boxShadow)
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 chunk4NAMD62I_js.useGesture; }
468
+ get: function () { return chunkMUT6BTZS_js.useGesture; }
467
469
  });
468
470
  Object.defineProperty(exports, "MotionView", {
469
471
  enumerable: true,
470
- get: function () { return chunkK5SI6VXS_js.MotionView; }
472
+ get: function () { return chunk24NUL23E_js.MotionView; }
471
473
  });
472
474
  Object.defineProperty(exports, "MotionText", {
473
475
  enumerable: true,
474
- get: function () { return chunkSTARIT6W_js.MotionText; }
476
+ get: function () { return chunk4XBX7KOD_js.MotionText; }
475
477
  });
476
478
  Object.defineProperty(exports, "MotionImage", {
477
479
  enumerable: true,
478
- get: function () { return chunkFWWVHLXB_js.MotionImage; }
480
+ get: function () { return chunkZ5USXWTE_js.MotionImage; }
479
481
  });
480
482
  Object.defineProperty(exports, "MotionPressable", {
481
483
  enumerable: true,
482
- get: function () { return chunk5MGWHOSV_js.MotionPressable; }
484
+ get: function () { return chunk6NOCY764_js.MotionPressable; }
483
485
  });
484
486
  Object.defineProperty(exports, "MotionScrollView", {
485
487
  enumerable: true,
486
- get: function () { return chunkX7B5WR5A_js.MotionScrollView; }
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 chunk767UKZXG_js.Presence; }
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 chunk767UKZXG_js.TRANSPARENT; }
504
+ get: function () { return chunkE3ALFSH2_js.TRANSPARENT; }
495
505
  });
496
506
  Object.defineProperty(exports, "createMotionComponent", {
497
507
  enumerable: true,
498
- get: function () { return chunk767UKZXG_js.createMotionComponent; }
508
+ get: function () { return chunkE3ALFSH2_js.createMotionComponent; }
499
509
  });
500
510
  Object.defineProperty(exports, "usePresence", {
501
511
  enumerable: true,
502
- get: function () { return chunk767UKZXG_js.usePresence; }
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 chunkOBRGJAST_js.MotionConfig; }
520
+ get: function () { return chunk6AN5X3YE_js.MotionConfig; }
507
521
  });
508
522
  Object.defineProperty(exports, "resolveNamedTransition", {
509
523
  enumerable: true,
510
- get: function () { return chunkOBRGJAST_js.resolveNamedTransition; }
524
+ get: function () { return chunk6AN5X3YE_js.resolveNamedTransition; }
511
525
  });
512
526
  Object.defineProperty(exports, "useMotionConfig", {
513
527
  enumerable: true,
514
- get: function () { return chunkOBRGJAST_js.useMotionConfig; }
528
+ get: function () { return chunk6AN5X3YE_js.useMotionConfig; }
515
529
  });
516
530
  Object.defineProperty(exports, "useNamedTransitions", {
517
531
  enumerable: true,
518
- get: function () { return chunkOBRGJAST_js.useNamedTransitions; }
532
+ get: function () { return chunk6AN5X3YE_js.useNamedTransitions; }
519
533
  });
520
534
  Object.defineProperty(exports, "useShouldReduceMotion", {
521
535
  enumerable: true,
522
- get: function () { return chunkOBRGJAST_js.useShouldReduceMotion; }
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 chunkPM6CVGXJ_js.buildReleaseAnimation; }
544
+ get: function () { return chunkWNVHPMBI_js.buildReleaseAnimation; }
527
545
  });
528
546
  Object.defineProperty(exports, "cubicBezier", {
529
547
  enumerable: true,
530
- get: function () { return chunkPM6CVGXJ_js.cubicBezier; }
548
+ get: function () { return chunkWNVHPMBI_js.cubicBezier; }
531
549
  });
532
550
  Object.defineProperty(exports, "ensureWorkletEasing", {
533
551
  enumerable: true,
534
- get: function () { return chunkPM6CVGXJ_js.ensureWorkletEasing; }
552
+ get: function () { return chunkWNVHPMBI_js.ensureWorkletEasing; }
535
553
  });
536
554
  Object.defineProperty(exports, "resolveAnimatableValue", {
537
555
  enumerable: true,
538
- get: function () { return chunkPM6CVGXJ_js.resolveAnimatableValue; }
556
+ get: function () { return chunkWNVHPMBI_js.resolveAnimatableValue; }
539
557
  });
540
558
  Object.defineProperty(exports, "resolveTransition", {
541
559
  enumerable: true,
542
- get: function () { return chunkPM6CVGXJ_js.resolveTransition; }
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-OW5XTGVN.mjs';
2
- import { MotionView } from './chunk-CMHVF6F4.mjs';
3
- export { MotionView } from './chunk-CMHVF6F4.mjs';
4
- import { MotionText } from './chunk-F7LJX56B.mjs';
5
- export { MotionText } from './chunk-F7LJX56B.mjs';
6
- import { MotionImage } from './chunk-PFPO7DX2.mjs';
7
- export { MotionImage } from './chunk-PFPO7DX2.mjs';
8
- import { MotionPressable } from './chunk-C3EDC5ZW.mjs';
9
- export { MotionPressable } from './chunk-C3EDC5ZW.mjs';
10
- import { MotionScrollView } from './chunk-BAAQI37F.mjs';
11
- export { MotionScrollView } from './chunk-BAAQI37F.mjs';
12
- import { pairBoxShadowLayers, resolveBoxShadowInput } from './chunk-2ICQLWH2.mjs';
13
- export { Presence, TRANSPARENT, createMotionComponent, usePresence } from './chunk-2ICQLWH2.mjs';
14
- import { useShouldReduceMotion, resolveNamedTransition, useNamedTransitions, lookupNamedTransition } from './chunk-Z3HCJ43H.mjs';
15
- export { MotionConfig, resolveNamedTransition, useMotionConfig, useNamedTransitions, useShouldReduceMotion } from './chunk-Z3HCJ43H.mjs';
16
- import { stableSig, resolveTransition, springToReanimated, warnNonWorkletOnce } from './chunk-REYL77RE.mjs';
17
- export { buildReleaseAnimation, cubicBezier, ensureWorkletEasing, resolveAnimatableValue, resolveTransition } from './chunk-REYL77RE.mjs';
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
+ });
@@ -0,0 +1,4 @@
1
+ export { MotionFlatList } from '../chunk-EN4PN7X3.mjs';
2
+ import '../chunk-IX6SEOSK.mjs';
3
+ import '../chunk-MFAFB4K7.mjs';
4
+ import '../chunk-W7NTRSPD.mjs';
@@ -1,5 +1,5 @@
1
1
  import { Image } from 'react-native';
2
- import { M as MotionComponent } from '../types-BQgLJeQG.mjs';
2
+ import { M as MotionComponent } from '../types-DyJpG64F.mjs';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Image } from 'react-native';
2
- import { M as MotionComponent } from '../types-BQgLJeQG.js';
2
+ import { M as MotionComponent } from '../types-DyJpG64F.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkFWWVHLXB_js = require('../chunk-FWWVHLXB.js');
4
- require('../chunk-767UKZXG.js');
5
- require('../chunk-OBRGJAST.js');
6
- require('../chunk-PM6CVGXJ.js');
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 chunkFWWVHLXB_js.MotionImage; }
12
+ get: function () { return chunkZ5USXWTE_js.MotionImage; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionImage } from '../chunk-PFPO7DX2.mjs';
2
- import '../chunk-2ICQLWH2.mjs';
3
- import '../chunk-Z3HCJ43H.mjs';
4
- import '../chunk-REYL77RE.mjs';
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-BQgLJeQG.mjs';
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-BQgLJeQG.js';
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
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunk5MGWHOSV_js = require('../chunk-5MGWHOSV.js');
4
- require('../chunk-767UKZXG.js');
5
- require('../chunk-OBRGJAST.js');
6
- require('../chunk-PM6CVGXJ.js');
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 chunk5MGWHOSV_js.MotionPressable; }
12
+ get: function () { return chunk6NOCY764_js.MotionPressable; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionPressable } from '../chunk-C3EDC5ZW.mjs';
2
- import '../chunk-2ICQLWH2.mjs';
3
- import '../chunk-Z3HCJ43H.mjs';
4
- import '../chunk-REYL77RE.mjs';
1
+ export { MotionPressable } from '../chunk-JBK5ZLMH.mjs';
2
+ import '../chunk-IX6SEOSK.mjs';
3
+ import '../chunk-MFAFB4K7.mjs';
4
+ import '../chunk-W7NTRSPD.mjs';
@@ -1,5 +1,5 @@
1
1
  import { ScrollView } from 'react-native';
2
- import { M as MotionComponent } from '../types-BQgLJeQG.mjs';
2
+ import { M as MotionComponent } from '../types-DyJpG64F.mjs';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { ScrollView } from 'react-native';
2
- import { M as MotionComponent } from '../types-BQgLJeQG.js';
2
+ import { M as MotionComponent } from '../types-DyJpG64F.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkX7B5WR5A_js = require('../chunk-X7B5WR5A.js');
4
- require('../chunk-767UKZXG.js');
5
- require('../chunk-OBRGJAST.js');
6
- require('../chunk-PM6CVGXJ.js');
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 chunkX7B5WR5A_js.MotionScrollView; }
12
+ get: function () { return chunkZBHQPVWE_js.MotionScrollView; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionScrollView } from '../chunk-BAAQI37F.mjs';
2
- import '../chunk-2ICQLWH2.mjs';
3
- import '../chunk-Z3HCJ43H.mjs';
4
- import '../chunk-REYL77RE.mjs';
1
+ export { MotionScrollView } from '../chunk-M4766VUV.mjs';
2
+ import '../chunk-IX6SEOSK.mjs';
3
+ import '../chunk-MFAFB4K7.mjs';
4
+ import '../chunk-W7NTRSPD.mjs';
@@ -1,5 +1,5 @@
1
1
  import { Text } from 'react-native';
2
- import { M as MotionComponent } from '../types-BQgLJeQG.mjs';
2
+ import { M as MotionComponent } from '../types-DyJpG64F.mjs';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Text } from 'react-native';
2
- import { M as MotionComponent } from '../types-BQgLJeQG.js';
2
+ import { M as MotionComponent } from '../types-DyJpG64F.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkSTARIT6W_js = require('../chunk-STARIT6W.js');
4
- require('../chunk-767UKZXG.js');
5
- require('../chunk-OBRGJAST.js');
6
- require('../chunk-PM6CVGXJ.js');
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 chunkSTARIT6W_js.MotionText; }
12
+ get: function () { return chunk4XBX7KOD_js.MotionText; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionText } from '../chunk-F7LJX56B.mjs';
2
- import '../chunk-2ICQLWH2.mjs';
3
- import '../chunk-Z3HCJ43H.mjs';
4
- import '../chunk-REYL77RE.mjs';
1
+ export { MotionText } from '../chunk-QNLSCOR5.mjs';
2
+ import '../chunk-IX6SEOSK.mjs';
3
+ import '../chunk-MFAFB4K7.mjs';
4
+ import '../chunk-W7NTRSPD.mjs';
@@ -1,5 +1,5 @@
1
1
  import { View } from 'react-native';
2
- import { M as MotionComponent } from '../types-BQgLJeQG.mjs';
2
+ import { M as MotionComponent } from '../types-DyJpG64F.mjs';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { View } from 'react-native';
2
- import { M as MotionComponent } from '../types-BQgLJeQG.js';
2
+ import { M as MotionComponent } from '../types-DyJpG64F.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkK5SI6VXS_js = require('../chunk-K5SI6VXS.js');
4
- require('../chunk-767UKZXG.js');
5
- require('../chunk-OBRGJAST.js');
6
- require('../chunk-PM6CVGXJ.js');
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 chunkK5SI6VXS_js.MotionView; }
12
+ get: function () { return chunk24NUL23E_js.MotionView; }
13
13
  });