@rootnative/inertia 0.0.3 → 0.0.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +41 -5
  2. package/README.md +5 -3
  3. package/dist/{chunk-SGUHE5CX.mjs → chunk-4ASOELLA.mjs} +1 -1
  4. package/dist/{chunk-CSODMRJ7.mjs → chunk-55W7BNO2.mjs} +475 -83
  5. package/dist/chunk-5SRD2WCO.js +8 -0
  6. package/dist/{chunk-PTRF47DA.js → chunk-7A6WTXNK.js} +10 -3
  7. package/dist/{chunk-3XTVY34H.js → chunk-CENTULW6.js} +2 -2
  8. package/dist/{chunk-4PEHWDAZ.js → chunk-D5KAHWMC.js} +7 -7
  9. package/dist/{chunk-O22NXXCZ.mjs → chunk-J5Q46OPW.mjs} +1 -1
  10. package/dist/{chunk-RGNX6UZN.mjs → chunk-K3CLP74S.mjs} +2 -2
  11. package/dist/{chunk-BP3Y2SHQ.js → chunk-MYE5NMXW.js} +495 -101
  12. package/dist/{chunk-OQV66TBQ.mjs → chunk-NAOXQJ7U.mjs} +1 -1
  13. package/dist/{chunk-R63GIUNU.mjs → chunk-QKC3APP4.mjs} +1 -1
  14. package/dist/{chunk-46P57VMY.mjs → chunk-RF7J5FRM.mjs} +1 -1
  15. package/dist/{chunk-CY7Y64C3.mjs → chunk-TU2XFPAK.mjs} +10 -4
  16. package/dist/chunk-TVFNJ25Z.js +8 -0
  17. package/dist/chunk-VLDIFL3F.js +8 -0
  18. package/dist/{chunk-7AOERN53.js → chunk-WVRCKOPO.js} +3 -3
  19. package/dist/{chunk-W5MC3P4N.js → chunk-XMEVPEMH.js} +2 -2
  20. package/dist/{chunk-BQQTHG2V.mjs → chunk-YKGY22SB.mjs} +1 -1
  21. package/dist/gestureLayer/index.d.mts +2 -2
  22. package/dist/gestureLayer/index.d.ts +2 -2
  23. package/dist/gestureLayer/index.js +10 -10
  24. package/dist/gestureLayer/index.mjs +3 -3
  25. package/dist/index.d.mts +4 -4
  26. package/dist/index.d.ts +4 -4
  27. package/dist/index.js +48 -169
  28. package/dist/index.mjs +17 -137
  29. package/dist/motion/Image.d.mts +1 -1
  30. package/dist/motion/Image.d.ts +1 -1
  31. package/dist/motion/Image.js +5 -5
  32. package/dist/motion/Image.mjs +4 -4
  33. package/dist/motion/Pressable.d.mts +1 -1
  34. package/dist/motion/Pressable.d.ts +1 -1
  35. package/dist/motion/Pressable.js +5 -5
  36. package/dist/motion/Pressable.mjs +4 -4
  37. package/dist/motion/ScrollView.d.mts +1 -1
  38. package/dist/motion/ScrollView.d.ts +1 -1
  39. package/dist/motion/ScrollView.js +5 -5
  40. package/dist/motion/ScrollView.mjs +4 -4
  41. package/dist/motion/Text.d.mts +1 -1
  42. package/dist/motion/Text.d.ts +1 -1
  43. package/dist/motion/Text.js +5 -5
  44. package/dist/motion/Text.mjs +4 -4
  45. package/dist/motion/View.d.mts +1 -1
  46. package/dist/motion/View.d.ts +1 -1
  47. package/dist/motion/View.js +5 -5
  48. package/dist/motion/View.mjs +4 -4
  49. package/dist/touch/index.d.mts +1 -1
  50. package/dist/touch/index.d.ts +1 -1
  51. package/dist/touch/index.js +3 -3
  52. package/dist/touch/index.mjs +1 -1
  53. package/dist/{types-G1dBU2IQ.d.mts → types-37pN82yh.d.mts} +49 -14
  54. package/dist/{types-G1dBU2IQ.d.ts → types-37pN82yh.d.ts} +49 -14
  55. package/dist/{useGesture-D1e4ixJo.d.ts → useGesture-Cl4uzZIr.d.ts} +1 -1
  56. package/dist/{useGesture-RFY6kTL3.d.mts → useGesture-_IKkS8Dv.d.mts} +1 -1
  57. package/llms.txt +3 -1
  58. package/package.json +1 -1
  59. package/src/index.ts +2 -1
  60. package/src/internal/boxShadow.ts +177 -6
  61. package/src/internal/nonWorkletWarning.ts +4 -6
  62. package/src/internal/warnOnce.ts +28 -0
  63. package/src/layout/index.ts +10 -0
  64. package/src/layout/measureWindow.ts +135 -0
  65. package/src/layout/sharedRegistry.ts +107 -18
  66. package/src/layout/useSharedLayout.ts +256 -91
  67. package/src/motion/createMotionComponent.tsx +378 -39
  68. package/src/motion/installCheck.ts +1 -1
  69. package/src/transitions/index.ts +1 -1
  70. package/src/types.ts +52 -12
  71. package/src/values/useColorTransition.ts +1 -1
  72. package/dist/chunk-FNVFV4EY.js +0 -8
  73. package/dist/chunk-FWQOXA43.js +0 -8
  74. package/dist/chunk-KBP4LR75.js +0 -8
package/dist/index.mjs CHANGED
@@ -1,19 +1,20 @@
1
- export { useGesture } from './chunk-RGNX6UZN.mjs';
2
- import { MotionView } from './chunk-BQQTHG2V.mjs';
3
- export { MotionView } from './chunk-BQQTHG2V.mjs';
4
- import { MotionText } from './chunk-SGUHE5CX.mjs';
5
- export { MotionText } from './chunk-SGUHE5CX.mjs';
6
- import { MotionImage } from './chunk-O22NXXCZ.mjs';
7
- export { MotionImage } from './chunk-O22NXXCZ.mjs';
8
- import { MotionPressable } from './chunk-46P57VMY.mjs';
9
- export { MotionPressable } from './chunk-46P57VMY.mjs';
10
- import { MotionScrollView } from './chunk-OQV66TBQ.mjs';
11
- export { MotionScrollView } from './chunk-OQV66TBQ.mjs';
12
- export { Presence, createMotionComponent, usePresence } from './chunk-CSODMRJ7.mjs';
13
- import { useShouldReduceMotion, resolveNamedTransition, useNamedTransitions, lookupNamedTransition } from './chunk-R63GIUNU.mjs';
14
- export { MotionConfig, resolveNamedTransition, useMotionConfig, useNamedTransitions, useShouldReduceMotion } from './chunk-R63GIUNU.mjs';
15
- import { stableSig, resolveTransition, springToReanimated, warnNonWorkletOnce } from './chunk-CY7Y64C3.mjs';
16
- export { buildReleaseAnimation, cubicBezier, ensureWorkletEasing, resolveAnimatableValue, resolveTransition } from './chunk-CY7Y64C3.mjs';
1
+ export { useGesture } from './chunk-K3CLP74S.mjs';
2
+ import { MotionView } from './chunk-YKGY22SB.mjs';
3
+ export { MotionView } from './chunk-YKGY22SB.mjs';
4
+ import { MotionText } from './chunk-4ASOELLA.mjs';
5
+ export { MotionText } from './chunk-4ASOELLA.mjs';
6
+ import { MotionImage } from './chunk-J5Q46OPW.mjs';
7
+ export { MotionImage } from './chunk-J5Q46OPW.mjs';
8
+ import { MotionPressable } from './chunk-RF7J5FRM.mjs';
9
+ export { MotionPressable } from './chunk-RF7J5FRM.mjs';
10
+ import { MotionScrollView } from './chunk-NAOXQJ7U.mjs';
11
+ export { MotionScrollView } from './chunk-NAOXQJ7U.mjs';
12
+ import { pairBoxShadowLayers, resolveBoxShadowInput } from './chunk-55W7BNO2.mjs';
13
+ export { Presence, createMotionComponent, usePresence } from './chunk-55W7BNO2.mjs';
14
+ import { useShouldReduceMotion, resolveNamedTransition, useNamedTransitions, lookupNamedTransition } from './chunk-QKC3APP4.mjs';
15
+ export { MotionConfig, resolveNamedTransition, useMotionConfig, useNamedTransitions, useShouldReduceMotion } from './chunk-QKC3APP4.mjs';
16
+ import { stableSig, resolveTransition, springToReanimated, warnNonWorkletOnce } from './chunk-TU2XFPAK.mjs';
17
+ export { buildReleaseAnimation, cubicBezier, ensureWorkletEasing, resolveAnimatableValue, resolveTransition } from './chunk-TU2XFPAK.mjs';
17
18
  import { useEffect, useRef, useCallback, useMemo } from 'react';
18
19
  import { useSharedValue, cancelAnimation, withSpring, useAnimatedReaction, useAnimatedStyle, interpolateColor, interpolate, useDerivedValue, Extrapolation, useAnimatedScrollHandler } from 'react-native-reanimated';
19
20
  import { isWorkletFunction } from 'react-native-worklets';
@@ -357,127 +358,6 @@ function useScroll() {
357
358
  onScroll: handler
358
359
  };
359
360
  }
360
-
361
- // src/internal/boxShadow.ts
362
- var LENGTH = /^[+-]?(\d+\.?\d*|\.\d+)(px)?$/i;
363
- var UNIT_LIKE = /^[+-]?(\d+\.?\d*|\.\d+)[a-z%]+$/i;
364
- function invalid(input, reason) {
365
- return new Error(
366
- `[inertia] parseBoxShadow: ${reason} in ${JSON.stringify(input)}. Expected CSS box-shadow syntax with px lengths: '[inset] <offset-x> <offset-y> [blur] [spread] [color], ...'`
367
- );
368
- }
369
- function splitLayers(input) {
370
- const layers = [];
371
- let depth = 0;
372
- let start = 0;
373
- for (let i = 0; i < input.length; i++) {
374
- const ch = input[i];
375
- if (ch === "(") depth++;
376
- else if (ch === ")") depth--;
377
- else if (ch === "," && depth === 0) {
378
- layers.push(input.slice(start, i));
379
- start = i + 1;
380
- }
381
- }
382
- layers.push(input.slice(start));
383
- return layers;
384
- }
385
- function tokenize(layer) {
386
- const tokens = [];
387
- let depth = 0;
388
- let current = "";
389
- for (const ch of layer) {
390
- if (ch === "(") depth++;
391
- else if (ch === ")") depth--;
392
- if (depth === 0 && /\s/.test(ch)) {
393
- if (current) tokens.push(current);
394
- current = "";
395
- } else {
396
- current += ch;
397
- }
398
- }
399
- if (current) tokens.push(current);
400
- return tokens;
401
- }
402
- function parseBoxShadow(input) {
403
- const trimmed = input.trim();
404
- if (trimmed === "") throw invalid(input, "empty string");
405
- if (trimmed.toLowerCase() === "none") return [];
406
- return splitLayers(trimmed).map((layerString) => {
407
- const tokens = tokenize(layerString.trim());
408
- if (tokens.length === 0) throw invalid(input, "empty layer");
409
- const lengths = [];
410
- let color;
411
- let inset = false;
412
- for (const token of tokens) {
413
- if (token.toLowerCase() === "inset") {
414
- if (inset) throw invalid(input, "duplicate 'inset'");
415
- inset = true;
416
- } else if (LENGTH.test(token)) {
417
- lengths.push(parseFloat(token));
418
- } else if (UNIT_LIKE.test(token)) {
419
- throw invalid(input, `unsupported unit in ${JSON.stringify(token)}`);
420
- } else {
421
- if (color !== void 0) throw invalid(input, "multiple colors");
422
- color = token;
423
- }
424
- }
425
- if (lengths.length < 2 || lengths.length > 4) {
426
- throw invalid(input, `expected 2-4 lengths, got ${lengths.length}`);
427
- }
428
- const [offsetX = 0, offsetY = 0, blurRadius = 0, spreadDistance = 0] = lengths;
429
- if (blurRadius < 0) throw invalid(input, "negative blur radius");
430
- return {
431
- offsetX,
432
- offsetY,
433
- blurRadius,
434
- spreadDistance,
435
- color: color ?? "black",
436
- inset
437
- };
438
- });
439
- }
440
- function resolveBoxShadowInput(input) {
441
- if (input === void 0) return [];
442
- if (typeof input === "string") return parseBoxShadow(input);
443
- return input.map((layer) => ({
444
- offsetX: layer.offsetX,
445
- offsetY: layer.offsetY,
446
- blurRadius: layer.blurRadius ?? 0,
447
- spreadDistance: layer.spreadDistance ?? 0,
448
- color: layer.color ?? "black",
449
- inset: layer.inset ?? false
450
- }));
451
- }
452
- function pairBoxShadowLayers(from, to) {
453
- const count = Math.max(from.length, to.length);
454
- const pairs = [];
455
- for (let i = 0; i < count; i++) {
456
- const a = from[i];
457
- const b = to[i];
458
- const fromLayer = a ?? invisibleLayer(b.inset);
459
- const toLayer = b ?? invisibleLayer(a.inset);
460
- if (fromLayer.inset !== toLayer.inset) {
461
- throw new Error(
462
- `[inertia] useShadow: boxShadow layer ${i} is 'inset' on one side but not the other \u2014 inset cannot be interpolated. Give both sides the same inset-ness (pad with a transparent layer if needed).`
463
- );
464
- }
465
- pairs.push({ from: fromLayer, to: toLayer });
466
- }
467
- return pairs;
468
- }
469
- function invisibleLayer(inset) {
470
- return {
471
- offsetX: 0,
472
- offsetY: 0,
473
- blurRadius: 0,
474
- spreadDistance: 0,
475
- color: "transparent",
476
- inset
477
- };
478
- }
479
-
480
- // src/values/useShadow.ts
481
361
  function useShadow({
482
362
  from,
483
363
  to,
@@ -1,5 +1,5 @@
1
1
  import { Image } from 'react-native';
2
- import { M as MotionComponent } from '../types-G1dBU2IQ.mjs';
2
+ import { M as MotionComponent } from '../types-37pN82yh.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-G1dBU2IQ.js';
2
+ import { M as MotionComponent } from '../types-37pN82yh.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkKBP4LR75_js = require('../chunk-KBP4LR75.js');
4
- require('../chunk-BP3Y2SHQ.js');
5
- require('../chunk-7AOERN53.js');
6
- require('../chunk-PTRF47DA.js');
3
+ var chunk5SRD2WCO_js = require('../chunk-5SRD2WCO.js');
4
+ require('../chunk-MYE5NMXW.js');
5
+ require('../chunk-WVRCKOPO.js');
6
+ require('../chunk-7A6WTXNK.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MotionImage", {
11
11
  enumerable: true,
12
- get: function () { return chunkKBP4LR75_js.MotionImage; }
12
+ get: function () { return chunk5SRD2WCO_js.MotionImage; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionImage } from '../chunk-O22NXXCZ.mjs';
2
- import '../chunk-CSODMRJ7.mjs';
3
- import '../chunk-R63GIUNU.mjs';
4
- import '../chunk-CY7Y64C3.mjs';
1
+ export { MotionImage } from '../chunk-J5Q46OPW.mjs';
2
+ import '../chunk-55W7BNO2.mjs';
3
+ import '../chunk-QKC3APP4.mjs';
4
+ import '../chunk-TU2XFPAK.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-G1dBU2IQ.mjs';
3
+ import { M as MotionComponent } from '../types-37pN82yh.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-G1dBU2IQ.js';
3
+ import { M as MotionComponent } from '../types-37pN82yh.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 chunk3XTVY34H_js = require('../chunk-3XTVY34H.js');
4
- require('../chunk-BP3Y2SHQ.js');
5
- require('../chunk-7AOERN53.js');
6
- require('../chunk-PTRF47DA.js');
3
+ var chunkCENTULW6_js = require('../chunk-CENTULW6.js');
4
+ require('../chunk-MYE5NMXW.js');
5
+ require('../chunk-WVRCKOPO.js');
6
+ require('../chunk-7A6WTXNK.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MotionPressable", {
11
11
  enumerable: true,
12
- get: function () { return chunk3XTVY34H_js.MotionPressable; }
12
+ get: function () { return chunkCENTULW6_js.MotionPressable; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionPressable } from '../chunk-46P57VMY.mjs';
2
- import '../chunk-CSODMRJ7.mjs';
3
- import '../chunk-R63GIUNU.mjs';
4
- import '../chunk-CY7Y64C3.mjs';
1
+ export { MotionPressable } from '../chunk-RF7J5FRM.mjs';
2
+ import '../chunk-55W7BNO2.mjs';
3
+ import '../chunk-QKC3APP4.mjs';
4
+ import '../chunk-TU2XFPAK.mjs';
@@ -1,5 +1,5 @@
1
1
  import { ScrollView } from 'react-native';
2
- import { M as MotionComponent } from '../types-G1dBU2IQ.mjs';
2
+ import { M as MotionComponent } from '../types-37pN82yh.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-G1dBU2IQ.js';
2
+ import { M as MotionComponent } from '../types-37pN82yh.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkW5MC3P4N_js = require('../chunk-W5MC3P4N.js');
4
- require('../chunk-BP3Y2SHQ.js');
5
- require('../chunk-7AOERN53.js');
6
- require('../chunk-PTRF47DA.js');
3
+ var chunkXMEVPEMH_js = require('../chunk-XMEVPEMH.js');
4
+ require('../chunk-MYE5NMXW.js');
5
+ require('../chunk-WVRCKOPO.js');
6
+ require('../chunk-7A6WTXNK.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MotionScrollView", {
11
11
  enumerable: true,
12
- get: function () { return chunkW5MC3P4N_js.MotionScrollView; }
12
+ get: function () { return chunkXMEVPEMH_js.MotionScrollView; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionScrollView } from '../chunk-OQV66TBQ.mjs';
2
- import '../chunk-CSODMRJ7.mjs';
3
- import '../chunk-R63GIUNU.mjs';
4
- import '../chunk-CY7Y64C3.mjs';
1
+ export { MotionScrollView } from '../chunk-NAOXQJ7U.mjs';
2
+ import '../chunk-55W7BNO2.mjs';
3
+ import '../chunk-QKC3APP4.mjs';
4
+ import '../chunk-TU2XFPAK.mjs';
@@ -1,5 +1,5 @@
1
1
  import { Text } from 'react-native';
2
- import { M as MotionComponent } from '../types-G1dBU2IQ.mjs';
2
+ import { M as MotionComponent } from '../types-37pN82yh.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-G1dBU2IQ.js';
2
+ import { M as MotionComponent } from '../types-37pN82yh.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkFWQOXA43_js = require('../chunk-FWQOXA43.js');
4
- require('../chunk-BP3Y2SHQ.js');
5
- require('../chunk-7AOERN53.js');
6
- require('../chunk-PTRF47DA.js');
3
+ var chunkTVFNJ25Z_js = require('../chunk-TVFNJ25Z.js');
4
+ require('../chunk-MYE5NMXW.js');
5
+ require('../chunk-WVRCKOPO.js');
6
+ require('../chunk-7A6WTXNK.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MotionText", {
11
11
  enumerable: true,
12
- get: function () { return chunkFWQOXA43_js.MotionText; }
12
+ get: function () { return chunkTVFNJ25Z_js.MotionText; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionText } from '../chunk-SGUHE5CX.mjs';
2
- import '../chunk-CSODMRJ7.mjs';
3
- import '../chunk-R63GIUNU.mjs';
4
- import '../chunk-CY7Y64C3.mjs';
1
+ export { MotionText } from '../chunk-4ASOELLA.mjs';
2
+ import '../chunk-55W7BNO2.mjs';
3
+ import '../chunk-QKC3APP4.mjs';
4
+ import '../chunk-TU2XFPAK.mjs';
@@ -1,5 +1,5 @@
1
1
  import { View } from 'react-native';
2
- import { M as MotionComponent } from '../types-G1dBU2IQ.mjs';
2
+ import { M as MotionComponent } from '../types-37pN82yh.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-G1dBU2IQ.js';
2
+ import { M as MotionComponent } from '../types-37pN82yh.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkFNVFV4EY_js = require('../chunk-FNVFV4EY.js');
4
- require('../chunk-BP3Y2SHQ.js');
5
- require('../chunk-7AOERN53.js');
6
- require('../chunk-PTRF47DA.js');
3
+ var chunkVLDIFL3F_js = require('../chunk-VLDIFL3F.js');
4
+ require('../chunk-MYE5NMXW.js');
5
+ require('../chunk-WVRCKOPO.js');
6
+ require('../chunk-7A6WTXNK.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "MotionView", {
11
11
  enumerable: true,
12
- get: function () { return chunkFNVFV4EY_js.MotionView; }
12
+ get: function () { return chunkVLDIFL3F_js.MotionView; }
13
13
  });
@@ -1,4 +1,4 @@
1
- export { MotionView } from '../chunk-BQQTHG2V.mjs';
2
- import '../chunk-CSODMRJ7.mjs';
3
- import '../chunk-R63GIUNU.mjs';
4
- import '../chunk-CY7Y64C3.mjs';
1
+ export { MotionView } from '../chunk-YKGY22SB.mjs';
2
+ import '../chunk-55W7BNO2.mjs';
3
+ import '../chunk-QKC3APP4.mjs';
4
+ import '../chunk-TU2XFPAK.mjs';
@@ -1,6 +1,6 @@
1
1
  import { PanResponderInstance } from 'react-native';
2
2
  import { useAnimatedStyle, SharedValue } from 'react-native-reanimated';
3
- import { T as TransitionConfig } from '../types-G1dBU2IQ.mjs';
3
+ import { T as TransitionConfig } from '../types-37pN82yh.mjs';
4
4
  import 'react';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { PanResponderInstance } from 'react-native';
2
2
  import { useAnimatedStyle, SharedValue } from 'react-native-reanimated';
3
- import { T as TransitionConfig } from '../types-G1dBU2IQ.js';
3
+ import { T as TransitionConfig } from '../types-37pN82yh.js';
4
4
  import 'react';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkPTRF47DA_js = require('../chunk-PTRF47DA.js');
3
+ var chunk7A6WTXNK_js = require('../chunk-7A6WTXNK.js');
4
4
  var react = require('react');
5
5
  var reactNative = require('react-native');
6
6
  var reactNativeReanimated = require('react-native-reanimated');
@@ -48,14 +48,14 @@ function useTouchDrag(options = {}) {
48
48
  if (result) {
49
49
  if (result.x && lockX) {
50
50
  const toX = "to" in result.x ? result.x.to : x;
51
- dragX.value = chunkPTRF47DA_js.buildReleaseAnimation(
51
+ dragX.value = chunk7A6WTXNK_js.buildReleaseAnimation(
52
52
  result.x,
53
53
  toX
54
54
  );
55
55
  }
56
56
  if (result.y && lockY) {
57
57
  const toY = "to" in result.y ? result.y.to : y;
58
- dragY.value = chunkPTRF47DA_js.buildReleaseAnimation(
58
+ dragY.value = chunk7A6WTXNK_js.buildReleaseAnimation(
59
59
  result.y,
60
60
  toY
61
61
  );
@@ -1,4 +1,4 @@
1
- import { buildReleaseAnimation } from '../chunk-CY7Y64C3.mjs';
1
+ import { buildReleaseAnimation } from '../chunk-TU2XFPAK.mjs';
2
2
  import { useMemo } from 'react';
3
3
  import { PanResponder } from 'react-native';
4
4
  import { useSharedValue, useAnimatedStyle } from 'react-native-reanimated';
@@ -1,5 +1,5 @@
1
1
  import { ComponentType, ComponentProps, Ref, ReactElement } from 'react';
2
- import { StyleProp } from 'react-native';
2
+ import { StyleProp, BoxShadowValue } from 'react-native';
3
3
 
4
4
  /**
5
5
  * A single animation step's destination, optionally overriding the transition
@@ -154,6 +154,36 @@ type AnimatableTransformExtras = {
154
154
  rotateX?: AnimatableValue<number>;
155
155
  rotateY?: AnimatableValue<number>;
156
156
  };
157
+ /**
158
+ * Target shape for the `boxShadow` key on `animate` / `initial` / `exit`: a
159
+ * CSS `box-shadow` string, or RN's own array-of-layers form.
160
+ *
161
+ * Both endpoints of a `boxShadow` animation are normalized to a common layer
162
+ * count on the JS thread, so a two-layer shadow can animate to a one-layer one
163
+ * (the short side is padded with a transparent layer, as CSS transitions do).
164
+ * A layer that is `inset` on one side and not the other is not interpolable
165
+ * and throws.
166
+ */
167
+ type BoxShadowInput = string | ReadonlyArray<BoxShadowValue>;
168
+ /**
169
+ * Keys whose animatable form deliberately departs from the generic
170
+ * `AnimatableValue<S[K]>` mapping.
171
+ *
172
+ * `boxShadow` is the only member. Its natural value is already an array, which
173
+ * collides head-on with `AnimatableValue`'s keyframe-sequence form — nothing
174
+ * distinguishes `[layerA, layerB]` (one two-layer shadow) from a two-step
175
+ * sequence. The array slot is given to layers, which is the shape RN itself
176
+ * uses and by far the common case, and sequences are unsupported on this key.
177
+ * This mirrors the single-value-only contract `shadowOffset` has carried since
178
+ * `0.0.1`. Per-property transitions are unaffected: `transition={{ boxShadow:
179
+ * { type: 'timing' } }}` works as it does for every other key.
180
+ *
181
+ * Conditional on `S` so the key only appears where the underlying style
182
+ * actually has it, rather than being bolted onto every primitive.
183
+ */
184
+ type AnimatableStructuredExtras<S> = 'boxShadow' extends keyof S ? {
185
+ boxShadow?: BoxShadowInput;
186
+ } : {};
157
187
  /**
158
188
  * The animation state shape inferred from the underlying component's style
159
189
  * prop. We narrow to the value side of `style` so consumers see ViewStyle on
@@ -168,9 +198,9 @@ type AnimatableTransformExtras = {
168
198
  type _StyleValue<T> = Exclude<T, (...args: any[]) => any>;
169
199
  type AnimateStyle<C> = C extends {
170
200
  style?: infer Raw;
171
- } ? _StyleValue<Raw> extends StyleProp<infer S> ? {
201
+ } ? _StyleValue<Raw> extends StyleProp<infer S> ? Omit<{
172
202
  [K in keyof S]?: AnimatableValue<S[K]>;
173
- } & AnimatableTransformExtras : never : never;
203
+ }, 'boxShadow'> & AnimatableTransformExtras & AnimatableStructuredExtras<S> : never : never;
174
204
  interface AnimationCallbackInfo<S> {
175
205
  /**
176
206
  * The animatable key that just settled — typically a `keyof S` (e.g.
@@ -339,19 +369,24 @@ interface MotionProps<C, V extends VariantsMap<C> = VariantsMap<C>> {
339
369
  * recorded rect to its natural position via a FLIP transform stack.
340
370
  *
341
371
  * Reanimated 4 removed the `sharedTransitionTag` API — `layoutId` is the
342
- * Inertia-side measure-based replacement. Rects are recorded in
343
- * parent-relative coordinates (from `onLayout`), which composes when the
344
- * source and target screens share an outer content container (the common
345
- * stack-navigator case); nested-parent layouts need the v2
346
- * window-coordinate path.
372
+ * Inertia-side measure-based replacement. Rects are recorded in **window**
373
+ * coordinates wherever the host can be measured synchronously (Fabric),
374
+ * which is what lets a source and target sit under containers at different
375
+ * screen offsets; elsewhere both fall back to the parent-relative
376
+ * coordinates `onLayout` reports. A source and target that ended up in
377
+ * different spaces skip the animation rather than play a wrong one.
347
378
  *
348
379
  * The same `transition` prop drives the FLIP animation (spring by
349
380
  * default; `'timing'` honored; `'decay'` downgrades to spring; reduced
350
- * motion skips the transition). Out of scope for the first iteration:
351
- * style-prop interpolation (border radius, colors, etc.) only the
352
- * rect-to-rect transform is animated. Two simultaneously-mounted
353
- * primitives sharing the same `layoutId` are undefined behavior; pick a
354
- * primitive per id at a time.
381
+ * motion skips the transition). Alongside the rect, a fixed set of style
382
+ * keys is carried from the source and crossfaded out on that same
383
+ * transition: `opacity`, `borderRadius`, `backgroundColor`, `borderColor`,
384
+ * `color`, `tintColor`. Transform keys are not carried the FLIP owns
385
+ * them and a key only participates when the element already has a value
386
+ * for it, from a record or from its static `style`.
387
+ *
388
+ * Two simultaneously-mounted primitives sharing the same `layoutId` are
389
+ * undefined behavior; pick a primitive per id at a time.
355
390
  */
356
391
  layoutId?: string;
357
392
  /**
@@ -385,4 +420,4 @@ interface MotionComponent<C extends ComponentType<any>> {
385
420
  displayName?: string;
386
421
  }
387
422
 
388
- export type { AnimatableValue as A, DecayTransition as D, EasingInput as E, GestureLayerTransitions as G, MotionComponent as M, NamedTransitions as N, PerPropertyTransition as P, RegisteredTransitions as R, SpringTransition as S, TransitionConfig as T, VariantController as V, TransitionInput as a, TransitionName as b, AnimateStyle as c, AnimationCallbackInfo as d, EasingFunction as e, EasingFunctionFactory as f, GestureSubStates as g, MotionProps as h, NoAnimationTransition as i, RepeatConfig as j, SequenceStep as k, TimingTransition as l, Transition as m, VariantsMap as n };
423
+ export type { AnimatableValue as A, BoxShadowInput as B, DecayTransition as D, EasingInput as E, GestureLayerTransitions as G, MotionComponent as M, NamedTransitions as N, PerPropertyTransition as P, RegisteredTransitions as R, SpringTransition as S, TransitionConfig as T, VariantController as V, TransitionInput as a, TransitionName as b, AnimateStyle as c, AnimationCallbackInfo as d, EasingFunction as e, EasingFunctionFactory as f, GestureSubStates as g, MotionProps as h, NoAnimationTransition as i, RepeatConfig as j, SequenceStep as k, TimingTransition as l, Transition as m, VariantsMap as n };