react-native-screen-transitions 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/shared/providers/screen/styles.provider.js +41 -32
- package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/styles.provider.js +41 -32
- package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
- package/package.json +28 -2
- package/src/shared/providers/screen/styles.provider.tsx +40 -34
|
@@ -22,48 +22,57 @@ function ScreenStylesProvider({
|
|
|
22
22
|
currentInterpolator
|
|
23
23
|
} = (0, _useScreenAnimation2._useScreenAnimation)();
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Tracks when user starts a gesture while another screen is still closing.
|
|
27
|
+
* This persists until both the gesture ends AND the closing animation completes.
|
|
28
|
+
*/
|
|
29
|
+
const isGesturingDuringCloseAnimation = (0, _reactNativeReanimated.useSharedValue)(false);
|
|
27
30
|
const stylesMap = (0, _reactNativeReanimated.useDerivedValue)(() => {
|
|
28
31
|
"worklet";
|
|
29
32
|
|
|
30
33
|
const props = screenInterpolatorProps.value;
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const {
|
|
35
|
+
current,
|
|
36
|
+
next,
|
|
37
|
+
progress,
|
|
38
|
+
stackProgress
|
|
39
|
+
} = props;
|
|
40
|
+
const isDragging = current.gesture.isDragging;
|
|
41
|
+
const isNextClosing = !!next?.closing;
|
|
42
|
+
if (isDragging && isNextClosing) {
|
|
43
|
+
isGesturingDuringCloseAnimation.value = true;
|
|
36
44
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!props.current.gesture.isDragging && !props.next?.closing && hasTriggeredGestureWhileInFlight.value) {
|
|
40
|
-
hasTriggeredGestureWhileInFlight.value = false;
|
|
45
|
+
if (!isDragging && !isNextClosing) {
|
|
46
|
+
isGesturingDuringCloseAnimation.value = false;
|
|
41
47
|
}
|
|
48
|
+
const isInGestureMode = isDragging || isGesturingDuringCloseAnimation.value;
|
|
49
|
+
const hasPushedScreenWhileClosing = !isInGestureMode && isNextClosing && stackProgress > progress;
|
|
42
50
|
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
const interpolator =
|
|
51
|
+
// Select interpolator
|
|
52
|
+
// - If in gesture mode, use current screen's interpolator since we're driving
|
|
53
|
+
// the animation from this screen (dragging back to dismiss next).
|
|
54
|
+
const interpolator = isInGestureMode ? currentInterpolator : nextInterpolator ?? currentInterpolator;
|
|
55
|
+
if (!interpolator) return _constants.NO_STYLES;
|
|
47
56
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} : props;
|
|
57
|
+
// Build effective props with corrected progress
|
|
58
|
+
// - Gesture mode: use current.progress only (avoids jumps during drag)
|
|
59
|
+
// - Pushed while closing: use stackProgress (includes new screen)
|
|
60
|
+
// - Normal: use derived progress as-is
|
|
61
|
+
|
|
62
|
+
let effectiveProgress = progress;
|
|
63
|
+
let effectiveNext = next;
|
|
64
|
+
if (isInGestureMode) {
|
|
65
|
+
effectiveProgress = current.progress;
|
|
66
|
+
effectiveNext = undefined;
|
|
67
|
+
} else if (hasPushedScreenWhileClosing) {
|
|
68
|
+
effectiveProgress = stackProgress;
|
|
69
|
+
}
|
|
62
70
|
try {
|
|
63
|
-
if (!interpolator) return _constants.NO_STYLES;
|
|
64
71
|
return interpolator({
|
|
65
|
-
...
|
|
66
|
-
|
|
72
|
+
...props,
|
|
73
|
+
progress: effectiveProgress,
|
|
74
|
+
next: effectiveNext,
|
|
75
|
+
bounds: (0, _bounds.createBounds)(props)
|
|
67
76
|
});
|
|
68
77
|
} catch (err) {
|
|
69
78
|
if (__DEV__) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNativeReanimated","_constants","_useScreenAnimation2","_bounds","_jsxRuntime","ScreenStylesContext","createContext","ScreenStylesProvider","children","parentCtx","useContext","screenInterpolatorProps","nextInterpolator","currentInterpolator","_useScreenAnimation","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNativeReanimated","_constants","_useScreenAnimation2","_bounds","_jsxRuntime","ScreenStylesContext","createContext","ScreenStylesProvider","children","parentCtx","useContext","screenInterpolatorProps","nextInterpolator","currentInterpolator","_useScreenAnimation","isGesturingDuringCloseAnimation","useSharedValue","stylesMap","useDerivedValue","props","value","current","next","progress","stackProgress","isDragging","gesture","isNextClosing","closing","isInGestureMode","hasPushedScreenWhileClosing","interpolator","NO_STYLES","effectiveProgress","effectiveNext","undefined","bounds","createBounds","err","__DEV__","console","warn","useMemo","ancestorStylesMaps","jsx","Provider","useScreenStyles","ctx","Error"],"sourceRoot":"../../../../../src","sources":["shared/providers/screen/styles.provider.tsx"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AAAkD,IAAAK,WAAA,GAAAL,OAAA;AAWlD,MAAMM,mBAAmB,gBAAG,IAAAC,oBAAa,EACxC,IACD,CAAC;AAEM,SAASC,oBAAoBA,CAAC;EAAEC;AAAgB,CAAC,EAAE;EACzD,MAAMC,SAAS,GAAG,IAAAC,iBAAU,EAACL,mBAAmB,CAAC;EAEjD,MAAM;IAAEM,uBAAuB;IAAEC,gBAAgB;IAAEC;EAAoB,CAAC,GACvE,IAAAC,wCAAmB,EAAC,CAAC;;EAEtB;AACD;AACA;AACA;EACC,MAAMC,+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C,oBAAY,EAAClB,KAAK;MAC3B,CAAC,CAAC;IACH,CAAC,CAAC,OAAOmB,GAAG,EAAE;MACb,IAAIC,OAAO,EAAE;QACZC,OAAO,CAACC,IAAI,CACX,6EAA6E,EAC7EH,GACD,CAAC;MACF;MACA,OAAON,oBAAS;IACjB;EACD,CAAC,CAAC;EAEF,MAAMZ,KAAK,GAAG,IAAAsB,cAAO,EAAC,MAAM;IAC3B;IACA,MAAMC,kBAAkB,GAAGlC,SAAS,GACjC,CAACA,SAAS,CAACQ,SAAS,EAAE,GAAGR,SAAS,CAACkC,kBAAkB,CAAC,GACtD,EAAE;IAEL,OAAO;MACN1B,SAAS;MACT0B;IACD,CAAC;EACF,CAAC,EAAE,CAAC1B,SAAS,EAAER,SAAS,CAAC,CAAC;EAE1B,oBACC,IAAAL,WAAA,CAAAwC,GAAA,EAACvC,mBAAmB,CAACwC,QAAQ;IAACzB,KAAK,EAAEA,KAAM;IAAAZ,QAAA,EACzCA;EAAQ,CACoB,CAAC;AAEjC;AAEO,SAASsC,eAAeA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAG,IAAArC,iBAAU,EAACL,mBAAmB,CAAC;EAC3C,IAAI,CAAC0C,GAAG,EAAE;IACT,MAAM,IAAIC,KAAK,CACd,4DACD,CAAC;EACF;EACA,OAAOD,GAAG;AACX","ignoreList":[]}
|
|
@@ -17,48 +17,57 @@ export function ScreenStylesProvider({
|
|
|
17
17
|
currentInterpolator
|
|
18
18
|
} = _useScreenAnimation();
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Tracks when user starts a gesture while another screen is still closing.
|
|
22
|
+
* This persists until both the gesture ends AND the closing animation completes.
|
|
23
|
+
*/
|
|
24
|
+
const isGesturingDuringCloseAnimation = useSharedValue(false);
|
|
22
25
|
const stylesMap = useDerivedValue(() => {
|
|
23
26
|
"worklet";
|
|
24
27
|
|
|
25
28
|
const props = screenInterpolatorProps.value;
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const {
|
|
30
|
+
current,
|
|
31
|
+
next,
|
|
32
|
+
progress,
|
|
33
|
+
stackProgress
|
|
34
|
+
} = props;
|
|
35
|
+
const isDragging = current.gesture.isDragging;
|
|
36
|
+
const isNextClosing = !!next?.closing;
|
|
37
|
+
if (isDragging && isNextClosing) {
|
|
38
|
+
isGesturingDuringCloseAnimation.value = true;
|
|
31
39
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (!props.current.gesture.isDragging && !props.next?.closing && hasTriggeredGestureWhileInFlight.value) {
|
|
35
|
-
hasTriggeredGestureWhileInFlight.value = false;
|
|
40
|
+
if (!isDragging && !isNextClosing) {
|
|
41
|
+
isGesturingDuringCloseAnimation.value = false;
|
|
36
42
|
}
|
|
43
|
+
const isInGestureMode = isDragging || isGesturingDuringCloseAnimation.value;
|
|
44
|
+
const hasPushedScreenWhileClosing = !isInGestureMode && isNextClosing && stackProgress > progress;
|
|
37
45
|
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
const interpolator =
|
|
46
|
+
// Select interpolator
|
|
47
|
+
// - If in gesture mode, use current screen's interpolator since we're driving
|
|
48
|
+
// the animation from this screen (dragging back to dismiss next).
|
|
49
|
+
const interpolator = isInGestureMode ? currentInterpolator : nextInterpolator ?? currentInterpolator;
|
|
50
|
+
if (!interpolator) return NO_STYLES;
|
|
42
51
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
} : props;
|
|
52
|
+
// Build effective props with corrected progress
|
|
53
|
+
// - Gesture mode: use current.progress only (avoids jumps during drag)
|
|
54
|
+
// - Pushed while closing: use stackProgress (includes new screen)
|
|
55
|
+
// - Normal: use derived progress as-is
|
|
56
|
+
|
|
57
|
+
let effectiveProgress = progress;
|
|
58
|
+
let effectiveNext = next;
|
|
59
|
+
if (isInGestureMode) {
|
|
60
|
+
effectiveProgress = current.progress;
|
|
61
|
+
effectiveNext = undefined;
|
|
62
|
+
} else if (hasPushedScreenWhileClosing) {
|
|
63
|
+
effectiveProgress = stackProgress;
|
|
64
|
+
}
|
|
57
65
|
try {
|
|
58
|
-
if (!interpolator) return NO_STYLES;
|
|
59
66
|
return interpolator({
|
|
60
|
-
...
|
|
61
|
-
|
|
67
|
+
...props,
|
|
68
|
+
progress: effectiveProgress,
|
|
69
|
+
next: effectiveNext,
|
|
70
|
+
bounds: createBounds(props)
|
|
62
71
|
});
|
|
63
72
|
} catch (err) {
|
|
64
73
|
if (__DEV__) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useContext","useMemo","useDerivedValue","useSharedValue","NO_STYLES","_useScreenAnimation","createBounds","jsx","_jsx","ScreenStylesContext","ScreenStylesProvider","children","parentCtx","screenInterpolatorProps","nextInterpolator","currentInterpolator","
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useMemo","useDerivedValue","useSharedValue","NO_STYLES","_useScreenAnimation","createBounds","jsx","_jsx","ScreenStylesContext","ScreenStylesProvider","children","parentCtx","screenInterpolatorProps","nextInterpolator","currentInterpolator","isGesturingDuringCloseAnimation","stylesMap","props","value","current","next","progress","stackProgress","isDragging","gesture","isNextClosing","closing","isInGestureMode","hasPushedScreenWhileClosing","interpolator","effectiveProgress","effectiveNext","undefined","bounds","err","__DEV__","console","warn","ancestorStylesMaps","Provider","useScreenStyles","ctx","Error"],"sourceRoot":"../../../../../src","sources":["shared/providers/screen/styles.provider.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC1D,SAECC,eAAe,EACfC,cAAc,QACR,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,mBAAmB,QAAQ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":["../../../../../src/shared/providers/screen/styles.provider.tsx"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,WAAW,EAGhB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAG/E,KAAK,KAAK,GAAG;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC/B,SAAS,EAAE,WAAW,CAAC,2BAA2B,CAAC,CAAC;IACpD,kBAAkB,EAAE,WAAW,CAAC,2BAA2B,CAAC,EAAE,CAAC;CAC/D,CAAC;AAMF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"styles.provider.d.ts","sourceRoot":"","sources":["../../../../../src/shared/providers/screen/styles.provider.tsx"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,WAAW,EAGhB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAG/E,KAAK,KAAK,GAAG;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC/B,SAAS,EAAE,WAAW,CAAC,2BAA2B,CAAC,CAAC;IACpD,kBAAkB,EAAE,WAAW,CAAC,2BAA2B,CAAC,EAAE,CAAC;CAC/D,CAAC;AAMF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,2CA2FvD;AAED,wBAAgB,eAAe,6BAQ9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-screen-transitions",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Easy screen transitions for React Native and Expo",
|
|
5
5
|
"author": "Ed",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"build": "bob build",
|
|
44
44
|
"lint": "biome check ./src",
|
|
45
45
|
"typecheck": "tsc --noEmit",
|
|
46
|
-
"prepublishOnly": "bun run build"
|
|
46
|
+
"prepublishOnly": "bun run build",
|
|
47
|
+
"release": "release-it"
|
|
47
48
|
},
|
|
48
49
|
"keywords": [
|
|
49
50
|
"react-native",
|
|
@@ -73,8 +74,10 @@
|
|
|
73
74
|
"react-native-screens": ">=4.4.0"
|
|
74
75
|
},
|
|
75
76
|
"devDependencies": {
|
|
77
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
76
78
|
"@types/react": "~19.1.10",
|
|
77
79
|
"react-native-builder-bob": "0.39.0",
|
|
80
|
+
"release-it": "^19.0.4",
|
|
78
81
|
"typescript": "catalog:"
|
|
79
82
|
},
|
|
80
83
|
"react-native-builder-bob": {
|
|
@@ -91,5 +94,28 @@
|
|
|
91
94
|
]
|
|
92
95
|
]
|
|
93
96
|
},
|
|
97
|
+
"release-it": {
|
|
98
|
+
"git": {
|
|
99
|
+
"commitMessage": "chore: release ${version}",
|
|
100
|
+
"tagName": "v${version}",
|
|
101
|
+
"commitArgs": [
|
|
102
|
+
"-n"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"npm": {
|
|
106
|
+
"publish": true
|
|
107
|
+
},
|
|
108
|
+
"github": {
|
|
109
|
+
"release": true
|
|
110
|
+
},
|
|
111
|
+
"plugins": {
|
|
112
|
+
"@release-it/conventional-changelog": {
|
|
113
|
+
"preset": {
|
|
114
|
+
"name": "angular"
|
|
115
|
+
},
|
|
116
|
+
"path": "."
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
94
120
|
"gitHead": "888d4df9936ec0e3b8221bea7cd81115e6301693"
|
|
95
121
|
}
|
|
@@ -28,56 +28,62 @@ export function ScreenStylesProvider({ children }: Props) {
|
|
|
28
28
|
const { screenInterpolatorProps, nextInterpolator, currentInterpolator } =
|
|
29
29
|
_useScreenAnimation();
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Tracks when user starts a gesture while another screen is still closing.
|
|
33
|
+
* This persists until both the gesture ends AND the closing animation completes.
|
|
34
|
+
*/
|
|
35
|
+
const isGesturingDuringCloseAnimation = useSharedValue(false);
|
|
33
36
|
|
|
34
37
|
const stylesMap = useDerivedValue<TransitionInterpolatedStyle>(() => {
|
|
35
38
|
"worklet";
|
|
36
39
|
const props = screenInterpolatorProps.value;
|
|
37
|
-
const
|
|
40
|
+
const { current, next, progress, stackProgress } = props;
|
|
41
|
+
const isDragging = current.gesture.isDragging;
|
|
42
|
+
const isNextClosing = !!next?.closing;
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
hasTriggeredGestureWhileInFlight.value = true;
|
|
44
|
+
if (isDragging && isNextClosing) {
|
|
45
|
+
isGesturingDuringCloseAnimation.value = true;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
!props.current.gesture.isDragging &&
|
|
47
|
-
!props.next?.closing &&
|
|
48
|
-
hasTriggeredGestureWhileInFlight.value
|
|
49
|
-
) {
|
|
50
|
-
hasTriggeredGestureWhileInFlight.value = false;
|
|
48
|
+
if (!isDragging && !isNextClosing) {
|
|
49
|
+
isGesturingDuringCloseAnimation.value = false;
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
// otherwise use next interpolator if available (normal case)
|
|
55
|
-
const shouldUseCurrentInterpolator =
|
|
56
|
-
props.current.gesture.isDragging ||
|
|
57
|
-
hasTriggeredGestureWhileInFlight.value;
|
|
52
|
+
const isInGestureMode = isDragging || isGesturingDuringCloseAnimation.value;
|
|
58
53
|
|
|
59
|
-
const
|
|
54
|
+
const hasPushedScreenWhileClosing =
|
|
55
|
+
!isInGestureMode && isNextClosing && stackProgress > progress;
|
|
56
|
+
|
|
57
|
+
// Select interpolator
|
|
58
|
+
// - If in gesture mode, use current screen's interpolator since we're driving
|
|
59
|
+
// the animation from this screen (dragging back to dismiss next).
|
|
60
|
+
const interpolator = isInGestureMode
|
|
60
61
|
? currentInterpolator
|
|
61
62
|
: (nextInterpolator ?? currentInterpolator);
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
if (!interpolator) return NO_STYLES;
|
|
65
|
+
|
|
66
|
+
// Build effective props with corrected progress
|
|
67
|
+
// - Gesture mode: use current.progress only (avoids jumps during drag)
|
|
68
|
+
// - Pushed while closing: use stackProgress (includes new screen)
|
|
69
|
+
// - Normal: use derived progress as-is
|
|
70
|
+
|
|
71
|
+
let effectiveProgress = progress;
|
|
72
|
+
let effectiveNext = next;
|
|
73
|
+
|
|
74
|
+
if (isInGestureMode) {
|
|
75
|
+
effectiveProgress = current.progress;
|
|
76
|
+
effectiveNext = undefined;
|
|
77
|
+
} else if (hasPushedScreenWhileClosing) {
|
|
78
|
+
effectiveProgress = stackProgress;
|
|
79
|
+
}
|
|
75
80
|
|
|
76
81
|
try {
|
|
77
|
-
if (!interpolator) return NO_STYLES;
|
|
78
82
|
return interpolator({
|
|
79
|
-
...
|
|
80
|
-
|
|
83
|
+
...props,
|
|
84
|
+
progress: effectiveProgress,
|
|
85
|
+
next: effectiveNext,
|
|
86
|
+
bounds: createBounds(props),
|
|
81
87
|
});
|
|
82
88
|
} catch (err) {
|
|
83
89
|
if (__DEV__) {
|