@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.
- package/CHANGELOG.md +41 -5
- package/README.md +5 -3
- package/dist/{chunk-SGUHE5CX.mjs → chunk-4ASOELLA.mjs} +1 -1
- package/dist/{chunk-CSODMRJ7.mjs → chunk-55W7BNO2.mjs} +475 -83
- package/dist/chunk-5SRD2WCO.js +8 -0
- package/dist/{chunk-PTRF47DA.js → chunk-7A6WTXNK.js} +10 -3
- package/dist/{chunk-3XTVY34H.js → chunk-CENTULW6.js} +2 -2
- package/dist/{chunk-4PEHWDAZ.js → chunk-D5KAHWMC.js} +7 -7
- package/dist/{chunk-O22NXXCZ.mjs → chunk-J5Q46OPW.mjs} +1 -1
- package/dist/{chunk-RGNX6UZN.mjs → chunk-K3CLP74S.mjs} +2 -2
- package/dist/{chunk-BP3Y2SHQ.js → chunk-MYE5NMXW.js} +495 -101
- package/dist/{chunk-OQV66TBQ.mjs → chunk-NAOXQJ7U.mjs} +1 -1
- package/dist/{chunk-R63GIUNU.mjs → chunk-QKC3APP4.mjs} +1 -1
- package/dist/{chunk-46P57VMY.mjs → chunk-RF7J5FRM.mjs} +1 -1
- package/dist/{chunk-CY7Y64C3.mjs → chunk-TU2XFPAK.mjs} +10 -4
- package/dist/chunk-TVFNJ25Z.js +8 -0
- package/dist/chunk-VLDIFL3F.js +8 -0
- package/dist/{chunk-7AOERN53.js → chunk-WVRCKOPO.js} +3 -3
- package/dist/{chunk-W5MC3P4N.js → chunk-XMEVPEMH.js} +2 -2
- package/dist/{chunk-BQQTHG2V.mjs → chunk-YKGY22SB.mjs} +1 -1
- 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 +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +48 -169
- package/dist/index.mjs +17 -137
- 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-G1dBU2IQ.d.mts → types-37pN82yh.d.mts} +49 -14
- package/dist/{types-G1dBU2IQ.d.ts → types-37pN82yh.d.ts} +49 -14
- package/dist/{useGesture-D1e4ixJo.d.ts → useGesture-Cl4uzZIr.d.ts} +1 -1
- package/dist/{useGesture-RFY6kTL3.d.mts → useGesture-_IKkS8Dv.d.mts} +1 -1
- package/llms.txt +3 -1
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/internal/boxShadow.ts +177 -6
- package/src/internal/nonWorkletWarning.ts +4 -6
- package/src/internal/warnOnce.ts +28 -0
- package/src/layout/index.ts +10 -0
- package/src/layout/measureWindow.ts +135 -0
- package/src/layout/sharedRegistry.ts +107 -18
- package/src/layout/useSharedLayout.ts +256 -91
- package/src/motion/createMotionComponent.tsx +378 -39
- package/src/motion/installCheck.ts +1 -1
- package/src/transitions/index.ts +1 -1
- package/src/types.ts +52 -12
- package/src/values/useColorTransition.ts +1 -1
- package/dist/chunk-FNVFV4EY.js +0 -8
- package/dist/chunk-FWQOXA43.js +0 -8
- package/dist/chunk-KBP4LR75.js +0 -8
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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,
|
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 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
|
|
12
|
+
get: function () { return chunk5SRD2WCO_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-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-
|
|
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-
|
|
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
|
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 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
|
|
12
|
+
get: function () { return chunkCENTULW6_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-RF7J5FRM.mjs';
|
|
2
|
+
import '../chunk-55W7BNO2.mjs';
|
|
3
|
+
import '../chunk-QKC3APP4.mjs';
|
|
4
|
+
import '../chunk-TU2XFPAK.mjs';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
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
|
|
12
|
+
get: function () { return chunkXMEVPEMH_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-NAOXQJ7U.mjs';
|
|
2
|
+
import '../chunk-55W7BNO2.mjs';
|
|
3
|
+
import '../chunk-QKC3APP4.mjs';
|
|
4
|
+
import '../chunk-TU2XFPAK.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 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
|
|
12
|
+
get: function () { return chunkTVFNJ25Z_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-4ASOELLA.mjs';
|
|
2
|
+
import '../chunk-55W7BNO2.mjs';
|
|
3
|
+
import '../chunk-QKC3APP4.mjs';
|
|
4
|
+
import '../chunk-TU2XFPAK.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 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
|
|
12
|
+
get: function () { return chunkVLDIFL3F_js.MotionView; }
|
|
13
13
|
});
|
package/dist/motion/View.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { MotionView } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { MotionView } from '../chunk-YKGY22SB.mjs';
|
|
2
|
+
import '../chunk-55W7BNO2.mjs';
|
|
3
|
+
import '../chunk-QKC3APP4.mjs';
|
|
4
|
+
import '../chunk-TU2XFPAK.mjs';
|
package/dist/touch/index.d.mts
CHANGED
|
@@ -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-
|
|
3
|
+
import { T as TransitionConfig } from '../types-37pN82yh.mjs';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/touch/index.d.ts
CHANGED
|
@@ -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-
|
|
3
|
+
import { T as TransitionConfig } from '../types-37pN82yh.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/touch/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
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 =
|
|
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 =
|
|
58
|
+
dragY.value = chunk7A6WTXNK_js.buildReleaseAnimation(
|
|
59
59
|
result.y,
|
|
60
60
|
toY
|
|
61
61
|
);
|
package/dist/touch/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildReleaseAnimation } from '../chunk-
|
|
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
|
-
*
|
|
344
|
-
* source and target
|
|
345
|
-
*
|
|
346
|
-
*
|
|
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).
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
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 };
|