react-native-reanimated 2.3.0-beta.4 → 2.3.0

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 (62) hide show
  1. package/Common/cpp/Tools/RuntimeDecorator.cpp +17 -0
  2. package/android/build.gradle +2 -0
  3. package/android/expo/linking.gradle +34 -0
  4. package/android/expo/src/main/java/com/swmansion/reanimated/EXReanimatedAdapter.java +12 -0
  5. package/android/expo/src/main/java/expo/modules/adapters/reanimated/EXReanimatedPackage.java +26 -0
  6. package/android/react-native-reanimated-63-hermes.aar +0 -0
  7. package/android/react-native-reanimated-63-jsc.aar +0 -0
  8. package/android/react-native-reanimated-64-hermes.aar +0 -0
  9. package/android/react-native-reanimated-64-jsc.aar +0 -0
  10. package/android/react-native-reanimated-65-hermes.aar +0 -0
  11. package/android/react-native-reanimated-65-jsc.aar +0 -0
  12. package/android/react-native-reanimated-66-hermes.aar +0 -0
  13. package/android/react-native-reanimated-66-jsc.aar +0 -0
  14. package/android/react-native-reanimated-67-hermes.aar +0 -0
  15. package/android/react-native-reanimated-67-jsc.aar +0 -0
  16. package/expo-module.config.json +3 -0
  17. package/ios/LayoutReanimation/REAAnimationsManager.m +64 -19
  18. package/ios/native/REAInitializer.mm +3 -4
  19. package/lib/Animated.js +3 -5
  20. package/lib/createAnimatedComponent.js +4 -2
  21. package/lib/index.js +3 -5
  22. package/lib/reanimated1/core/Core.test.js +1 -1
  23. package/lib/reanimated2/component/FlatList.js +30 -0
  24. package/lib/reanimated2/component/WrappedComponents.js +9 -0
  25. package/lib/reanimated2/component/index.js +4 -0
  26. package/lib/reanimated2/core.js +3 -0
  27. package/lib/reanimated2/globals.d.ts +3 -0
  28. package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +14 -14
  29. package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +8 -8
  30. package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +16 -16
  31. package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +15 -15
  32. package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +4 -4
  33. package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +20 -8
  34. package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +2 -2
  35. package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +8 -8
  36. package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +10 -10
  37. package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +8 -8
  38. package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +8 -8
  39. package/package.json +3 -2
  40. package/plugin.js +2 -1
  41. package/react-native-reanimated.d.ts +37 -21
  42. package/src/Animated.js +3 -5
  43. package/src/createAnimatedComponent.tsx +13 -5
  44. package/src/reanimated1/core/Core.test.js +1 -1
  45. package/src/reanimated2/component/FlatList.tsx +44 -0
  46. package/src/reanimated2/component/WrappedComponents.ts +11 -0
  47. package/src/reanimated2/component/index.ts +9 -0
  48. package/src/reanimated2/core.ts +3 -0
  49. package/src/reanimated2/globals.d.ts +3 -0
  50. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +39 -20
  51. package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +5 -1
  52. package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +21 -15
  53. package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +29 -24
  54. package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +61 -34
  55. package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +48 -33
  56. package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +17 -12
  57. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +20 -8
  58. package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +8 -8
  59. package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +8 -8
  60. package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +20 -14
  61. package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +14 -8
  62. package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +24 -12
@@ -1,17 +1,20 @@
1
1
  import { ComplexAnimationBuilder } from '../animationBuilder';
2
2
  import {
3
- EntryExitAnimationFunction,
4
- IEntryExitAnimationBuilder,
3
+ EntryAnimationsValues,
4
+ ExitAnimationsValues,
5
+ AnimationConfigFunction,
6
+ IEntryAnimationBuilder,
7
+ IExitAnimationBuilder,
5
8
  } from '../animationBuilder/commonTypes';
6
9
 
7
10
  export class RotateInDownLeft
8
11
  extends ComplexAnimationBuilder
9
- implements IEntryExitAnimationBuilder {
12
+ implements IEntryAnimationBuilder {
10
13
  static createInstance(): RotateInDownLeft {
11
14
  return new RotateInDownLeft();
12
15
  }
13
16
 
14
- build = (): EntryExitAnimationFunction => {
17
+ build = (): AnimationConfigFunction<EntryAnimationsValues> => {
15
18
  const delayFunction = this.getDelayFunction();
16
19
  const [animation, config] = this.getAnimationAndConfig();
17
20
  const delay = this.getDelay();
@@ -32,8 +35,8 @@ export class RotateInDownLeft
32
35
  opacity: 0,
33
36
  transform: [
34
37
  { rotate: '-90deg' },
35
- { translateX: values.width / 2 - values.height / 2 },
36
- { translateY: -(values.width / 2 - values.height / 2) },
38
+ { translateX: values.targetWidth / 2 - values.targetHeight / 2 },
39
+ { translateY: -(values.targetWidth / 2 - values.targetHeight / 2) },
37
40
  ],
38
41
  },
39
42
  callback: callback,
@@ -44,12 +47,12 @@ export class RotateInDownLeft
44
47
 
45
48
  export class RotateInDownRight
46
49
  extends ComplexAnimationBuilder
47
- implements IEntryExitAnimationBuilder {
50
+ implements IEntryAnimationBuilder {
48
51
  static createInstance(): RotateInDownRight {
49
52
  return new RotateInDownRight();
50
53
  }
51
54
 
52
- build = (): EntryExitAnimationFunction => {
55
+ build = (): AnimationConfigFunction<EntryAnimationsValues> => {
53
56
  const delayFunction = this.getDelayFunction();
54
57
  const [animation, config] = this.getAnimationAndConfig();
55
58
  const delay = this.getDelay();
@@ -70,8 +73,8 @@ export class RotateInDownRight
70
73
  opacity: 0,
71
74
  transform: [
72
75
  { rotate: '90deg' },
73
- { translateX: -(values.width / 2 - values.height / 2) },
74
- { translateY: -(values.width / 2 - values.height / 2) },
76
+ { translateX: -(values.targetWidth / 2 - values.targetHeight / 2) },
77
+ { translateY: -(values.targetWidth / 2 - values.targetHeight / 2) },
75
78
  ],
76
79
  },
77
80
  callback: callback,
@@ -82,12 +85,12 @@ export class RotateInDownRight
82
85
 
83
86
  export class RotateInUpLeft
84
87
  extends ComplexAnimationBuilder
85
- implements IEntryExitAnimationBuilder {
88
+ implements IEntryAnimationBuilder {
86
89
  static createInstance(): RotateInUpLeft {
87
90
  return new RotateInUpLeft();
88
91
  }
89
92
 
90
- build = (): EntryExitAnimationFunction => {
93
+ build = (): AnimationConfigFunction<EntryAnimationsValues> => {
91
94
  const delayFunction = this.getDelayFunction();
92
95
  const [animation, config] = this.getAnimationAndConfig();
93
96
  const delay = this.getDelay();
@@ -108,8 +111,8 @@ export class RotateInUpLeft
108
111
  opacity: 0,
109
112
  transform: [
110
113
  { rotate: '90deg' },
111
- { translateX: values.width / 2 - values.height / 2 },
112
- { translateY: values.width / 2 - values.height / 2 },
114
+ { translateX: values.targetWidth / 2 - values.targetHeight / 2 },
115
+ { translateY: values.targetWidth / 2 - values.targetHeight / 2 },
113
116
  ],
114
117
  },
115
118
  callback: callback,
@@ -120,12 +123,12 @@ export class RotateInUpLeft
120
123
 
121
124
  export class RotateInUpRight
122
125
  extends ComplexAnimationBuilder
123
- implements IEntryExitAnimationBuilder {
126
+ implements IEntryAnimationBuilder {
124
127
  static createInstance(): RotateInUpRight {
125
128
  return new RotateInUpRight();
126
129
  }
127
130
 
128
- build = (): EntryExitAnimationFunction => {
131
+ build = (): AnimationConfigFunction<EntryAnimationsValues> => {
129
132
  const delayFunction = this.getDelayFunction();
130
133
  const [animation, config] = this.getAnimationAndConfig();
131
134
  const delay = this.getDelay();
@@ -146,8 +149,8 @@ export class RotateInUpRight
146
149
  opacity: 0,
147
150
  transform: [
148
151
  { rotate: '-90deg' },
149
- { translateX: -(values.width / 2 - values.height / 2) },
150
- { translateY: values.width / 2 - values.height / 2 },
152
+ { translateX: -(values.targetWidth / 2 - values.targetHeight / 2) },
153
+ { translateY: values.targetWidth / 2 - values.targetHeight / 2 },
151
154
  ],
152
155
  },
153
156
  callback: callback,
@@ -158,12 +161,12 @@ export class RotateInUpRight
158
161
 
159
162
  export class RotateOutDownLeft
160
163
  extends ComplexAnimationBuilder
161
- implements IEntryExitAnimationBuilder {
164
+ implements IExitAnimationBuilder {
162
165
  static createInstance(): RotateOutDownLeft {
163
166
  return new RotateOutDownLeft();
164
167
  }
165
168
 
166
- build = (): EntryExitAnimationFunction => {
169
+ build = (): AnimationConfigFunction<ExitAnimationsValues> => {
167
170
  const delayFunction = this.getDelayFunction();
168
171
  const [animation, config] = this.getAnimationAndConfig();
169
172
  const delay = this.getDelay();
@@ -179,13 +182,19 @@ export class RotateOutDownLeft
179
182
  {
180
183
  translateX: delayFunction(
181
184
  delay,
182
- animation(values.width / 2 - values.height / 2, config)
185
+ animation(
186
+ values.currentWidth / 2 - values.currentHeight / 2,
187
+ config
188
+ )
183
189
  ),
184
190
  },
185
191
  {
186
192
  translateY: delayFunction(
187
193
  delay,
188
- animation(values.width / 2 - values.height / 2, config)
194
+ animation(
195
+ values.currentWidth / 2 - values.currentHeight / 2,
196
+ config
197
+ )
189
198
  ),
190
199
  },
191
200
  ],
@@ -202,12 +211,12 @@ export class RotateOutDownLeft
202
211
 
203
212
  export class RotateOutDownRight
204
213
  extends ComplexAnimationBuilder
205
- implements IEntryExitAnimationBuilder {
214
+ implements IExitAnimationBuilder {
206
215
  static createInstance(): RotateOutDownRight {
207
216
  return new RotateOutDownRight();
208
217
  }
209
218
 
210
- build = (): EntryExitAnimationFunction => {
219
+ build = (): AnimationConfigFunction<ExitAnimationsValues> => {
211
220
  const delayFunction = this.getDelayFunction();
212
221
  const [animation, config] = this.getAnimationAndConfig();
213
222
  const delay = this.getDelay();
@@ -223,13 +232,19 @@ export class RotateOutDownRight
223
232
  {
224
233
  translateX: delayFunction(
225
234
  delay,
226
- animation(-(values.width / 2 - values.height / 2), config)
235
+ animation(
236
+ -(values.currentWidth / 2 - values.currentHeight / 2),
237
+ config
238
+ )
227
239
  ),
228
240
  },
229
241
  {
230
242
  translateY: delayFunction(
231
243
  delay,
232
- animation(values.width / 2 - values.height / 2, config)
244
+ animation(
245
+ values.currentWidth / 2 - values.currentHeight / 2,
246
+ config
247
+ )
233
248
  ),
234
249
  },
235
250
  ],
@@ -246,12 +261,12 @@ export class RotateOutDownRight
246
261
 
247
262
  export class RotateOutUpLeft
248
263
  extends ComplexAnimationBuilder
249
- implements IEntryExitAnimationBuilder {
264
+ implements IExitAnimationBuilder {
250
265
  static createInstance(): RotateOutUpLeft {
251
266
  return new RotateOutUpLeft();
252
267
  }
253
268
 
254
- build = (): EntryExitAnimationFunction => {
269
+ build = (): AnimationConfigFunction<ExitAnimationsValues> => {
255
270
  const delayFunction = this.getDelayFunction();
256
271
  const [animation, config] = this.getAnimationAndConfig();
257
272
  const delay = this.getDelay();
@@ -267,13 +282,19 @@ export class RotateOutUpLeft
267
282
  {
268
283
  translateX: delayFunction(
269
284
  delay,
270
- animation(values.width / 2 - values.height / 2, config)
285
+ animation(
286
+ values.currentWidth / 2 - values.currentHeight / 2,
287
+ config
288
+ )
271
289
  ),
272
290
  },
273
291
  {
274
292
  translateY: delayFunction(
275
293
  delay,
276
- animation(-(values.width / 2 - values.height / 2), config)
294
+ animation(
295
+ -(values.currentWidth / 2 - values.currentHeight / 2),
296
+ config
297
+ )
277
298
  ),
278
299
  },
279
300
  ],
@@ -290,12 +311,12 @@ export class RotateOutUpLeft
290
311
 
291
312
  export class RotateOutUpRight
292
313
  extends ComplexAnimationBuilder
293
- implements IEntryExitAnimationBuilder {
314
+ implements IExitAnimationBuilder {
294
315
  static createInstance(): RotateOutUpRight {
295
316
  return new RotateOutUpRight();
296
317
  }
297
318
 
298
- build = (): EntryExitAnimationFunction => {
319
+ build = (): AnimationConfigFunction<ExitAnimationsValues> => {
299
320
  const delayFunction = this.getDelayFunction();
300
321
  const [animation, config] = this.getAnimationAndConfig();
301
322
  const delay = this.getDelay();
@@ -311,13 +332,19 @@ export class RotateOutUpRight
311
332
  {
312
333
  translateX: delayFunction(
313
334
  delay,
314
- animation(-(values.width / 2 - values.height / 2), config)
335
+ animation(
336
+ -(values.currentWidth / 2 - values.currentHeight / 2),
337
+ config
338
+ )
315
339
  ),
316
340
  },
317
341
  {
318
342
  translateY: delayFunction(
319
343
  delay,
320
- animation(-(values.width / 2 - values.height / 2), config)
344
+ animation(
345
+ -(values.currentWidth / 2 - values.currentHeight / 2),
346
+ config
347
+ )
321
348
  ),
322
349
  },
323
350
  ],
@@ -1,6 +1,9 @@
1
1
  import {
2
- IEntryExitAnimationBuilder,
3
- EntryExitAnimationFunction,
2
+ EntryAnimationsValues,
3
+ ExitAnimationsValues,
4
+ AnimationConfigFunction,
5
+ IEntryAnimationBuilder,
6
+ IExitAnimationBuilder,
4
7
  } from '../animationBuilder/commonTypes';
5
8
  import { Dimensions } from 'react-native';
6
9
  import { ComplexAnimationBuilder } from '../animationBuilder';
@@ -9,12 +12,12 @@ const { width, height } = Dimensions.get('window');
9
12
 
10
13
  export class SlideInRight
11
14
  extends ComplexAnimationBuilder
12
- implements IEntryExitAnimationBuilder {
15
+ implements IEntryAnimationBuilder {
13
16
  static createInstance(): SlideInRight {
14
17
  return new SlideInRight();
15
18
  }
16
19
 
17
- build = (): EntryExitAnimationFunction => {
20
+ build = (): AnimationConfigFunction<EntryAnimationsValues> => {
18
21
  const delayFunction = this.getDelayFunction();
19
22
  const [animation, config] = this.getAnimationAndConfig();
20
23
  const delay = this.getDelay();
@@ -24,10 +27,13 @@ export class SlideInRight
24
27
  'worklet';
25
28
  return {
26
29
  animations: {
27
- originX: delayFunction(delay, animation(values.originX, config)),
30
+ originX: delayFunction(
31
+ delay,
32
+ animation(values.targetOriginX, config)
33
+ ),
28
34
  },
29
35
  initialValues: {
30
- originX: values.originX + width,
36
+ originX: values.targetOriginX + width,
31
37
  },
32
38
  callback: callback,
33
39
  };
@@ -37,12 +43,12 @@ export class SlideInRight
37
43
 
38
44
  export class SlideInLeft
39
45
  extends ComplexAnimationBuilder
40
- implements IEntryExitAnimationBuilder {
46
+ implements IEntryAnimationBuilder {
41
47
  static createInstance(): SlideInLeft {
42
48
  return new SlideInLeft();
43
49
  }
44
50
 
45
- build = (): EntryExitAnimationFunction => {
51
+ build = (): AnimationConfigFunction<EntryAnimationsValues> => {
46
52
  const delayFunction = this.getDelayFunction();
47
53
  const [animation, config] = this.getAnimationAndConfig();
48
54
  const delay = this.getDelay();
@@ -52,10 +58,13 @@ export class SlideInLeft
52
58
  'worklet';
53
59
  return {
54
60
  animations: {
55
- originX: delayFunction(delay, animation(values.originX, config)),
61
+ originX: delayFunction(
62
+ delay,
63
+ animation(values.targetOriginX, config)
64
+ ),
56
65
  },
57
66
  initialValues: {
58
- originX: values.originX - width,
67
+ originX: values.targetOriginX - width,
59
68
  },
60
69
  callback: callback,
61
70
  };
@@ -65,12 +74,12 @@ export class SlideInLeft
65
74
 
66
75
  export class SlideOutRight
67
76
  extends ComplexAnimationBuilder
68
- implements IEntryExitAnimationBuilder {
77
+ implements IExitAnimationBuilder {
69
78
  static createInstance(): SlideOutRight {
70
79
  return new SlideOutRight();
71
80
  }
72
81
 
73
- build = (): EntryExitAnimationFunction => {
82
+ build = (): AnimationConfigFunction<ExitAnimationsValues> => {
74
83
  const delayFunction = this.getDelayFunction();
75
84
  const [animation, config] = this.getAnimationAndConfig();
76
85
  const delay = this.getDelay();
@@ -82,11 +91,11 @@ export class SlideOutRight
82
91
  animations: {
83
92
  originX: delayFunction(
84
93
  delay,
85
- animation(Math.max(values.originX + width, width), config)
94
+ animation(Math.max(values.currentOriginX + width, width), config)
86
95
  ),
87
96
  },
88
97
  initialValues: {
89
- originX: values.originX,
98
+ originX: values.currentOriginX,
90
99
  },
91
100
  callback: callback,
92
101
  };
@@ -96,12 +105,12 @@ export class SlideOutRight
96
105
 
97
106
  export class SlideOutLeft
98
107
  extends ComplexAnimationBuilder
99
- implements IEntryExitAnimationBuilder {
108
+ implements IExitAnimationBuilder {
100
109
  static createInstance(): SlideOutLeft {
101
110
  return new SlideOutLeft();
102
111
  }
103
112
 
104
- build = (): EntryExitAnimationFunction => {
113
+ build = (): AnimationConfigFunction<ExitAnimationsValues> => {
105
114
  const delayFunction = this.getDelayFunction();
106
115
  const [animation, config] = this.getAnimationAndConfig();
107
116
  const delay = this.getDelay();
@@ -113,11 +122,11 @@ export class SlideOutLeft
113
122
  animations: {
114
123
  originX: delayFunction(
115
124
  delay,
116
- animation(Math.min(values.originX - width, -width), config)
125
+ animation(Math.min(values.currentOriginX - width, -width), config)
117
126
  ),
118
127
  },
119
128
  initialValues: {
120
- originX: values.originX,
129
+ originX: values.currentOriginX,
121
130
  },
122
131
  callback: callback,
123
132
  };
@@ -127,12 +136,12 @@ export class SlideOutLeft
127
136
 
128
137
  export class SlideInUp
129
138
  extends ComplexAnimationBuilder
130
- implements IEntryExitAnimationBuilder {
139
+ implements IEntryAnimationBuilder {
131
140
  static createInstance(): SlideInUp {
132
141
  return new SlideInUp();
133
142
  }
134
143
 
135
- build = (): EntryExitAnimationFunction => {
144
+ build = (): AnimationConfigFunction<EntryAnimationsValues> => {
136
145
  const delayFunction = this.getDelayFunction();
137
146
  const [animation, config] = this.getAnimationAndConfig();
138
147
  const delay = this.getDelay();
@@ -142,7 +151,10 @@ export class SlideInUp
142
151
  'worklet';
143
152
  return {
144
153
  animations: {
145
- originY: delayFunction(delay, animation(values.originY, config)),
154
+ originY: delayFunction(
155
+ delay,
156
+ animation(values.targetOriginY, config)
157
+ ),
146
158
  },
147
159
  initialValues: {
148
160
  originY: -height,
@@ -155,12 +167,12 @@ export class SlideInUp
155
167
 
156
168
  export class SlideInDown
157
169
  extends ComplexAnimationBuilder
158
- implements IEntryExitAnimationBuilder {
170
+ implements IEntryAnimationBuilder {
159
171
  static createInstance(): SlideInDown {
160
172
  return new SlideInDown();
161
173
  }
162
174
 
163
- build = (): EntryExitAnimationFunction => {
175
+ build = (): AnimationConfigFunction<EntryAnimationsValues> => {
164
176
  const delayFunction = this.getDelayFunction();
165
177
  const [animation, config] = this.getAnimationAndConfig();
166
178
  const delay = this.getDelay();
@@ -170,10 +182,13 @@ export class SlideInDown
170
182
  'worklet';
171
183
  return {
172
184
  animations: {
173
- originY: delayFunction(delay, animation(values.originY, config)),
185
+ originY: delayFunction(
186
+ delay,
187
+ animation(values.targetOriginY, config)
188
+ ),
174
189
  },
175
190
  initialValues: {
176
- originY: values.originY + height,
191
+ originY: values.targetOriginY + height,
177
192
  },
178
193
  callback: callback,
179
194
  };
@@ -183,12 +198,12 @@ export class SlideInDown
183
198
 
184
199
  export class SlideOutUp
185
200
  extends ComplexAnimationBuilder
186
- implements IEntryExitAnimationBuilder {
201
+ implements IExitAnimationBuilder {
187
202
  static createInstance(): SlideOutUp {
188
203
  return new SlideOutUp();
189
204
  }
190
205
 
191
- build = (): EntryExitAnimationFunction => {
206
+ build = (): AnimationConfigFunction<ExitAnimationsValues> => {
192
207
  const delayFunction = this.getDelayFunction();
193
208
  const [animation, config] = this.getAnimationAndConfig();
194
209
  const delay = this.getDelay();
@@ -200,10 +215,10 @@ export class SlideOutUp
200
215
  animations: {
201
216
  originY: delayFunction(
202
217
  delay,
203
- animation(Math.min(values.originY - height, -height), config)
218
+ animation(Math.min(values.currentOriginY - height, -height), config)
204
219
  ),
205
220
  },
206
- initialValues: { originY: values.originY },
221
+ initialValues: { originY: values.currentOriginY },
207
222
  callback: callback,
208
223
  };
209
224
  };
@@ -212,12 +227,12 @@ export class SlideOutUp
212
227
 
213
228
  export class SlideOutDown
214
229
  extends ComplexAnimationBuilder
215
- implements IEntryExitAnimationBuilder {
230
+ implements IExitAnimationBuilder {
216
231
  static createInstance(): SlideOutDown {
217
232
  return new SlideOutDown();
218
233
  }
219
234
 
220
- build = (): EntryExitAnimationFunction => {
235
+ build = (): AnimationConfigFunction<ExitAnimationsValues> => {
221
236
  const delayFunction = this.getDelayFunction();
222
237
  const [animation, config] = this.getAnimationAndConfig();
223
238
  const delay = this.getDelay();
@@ -229,10 +244,10 @@ export class SlideOutDown
229
244
  animations: {
230
245
  originY: delayFunction(
231
246
  delay,
232
- animation(Math.max(values.originY + height, height), config)
247
+ animation(Math.max(values.currentOriginY + height, height), config)
233
248
  ),
234
249
  },
235
- initialValues: { originY: values.originY },
250
+ initialValues: { originY: values.currentOriginY },
236
251
  callback: callback,
237
252
  };
238
253
  };
@@ -1,6 +1,11 @@
1
1
  import {
2
2
  IEntryExitAnimationBuilder,
3
3
  EntryExitAnimationFunction,
4
+ EntryAnimationsValues,
5
+ ExitAnimationsValues,
6
+ AnimationConfigFunction,
7
+ IEntryAnimationBuilder,
8
+ IExitAnimationBuilder,
4
9
  } from '../animationBuilder/commonTypes';
5
10
  import { Dimensions } from 'react-native';
6
11
  import { ComplexAnimationBuilder } from '../animationBuilder';
@@ -193,12 +198,12 @@ export class ZoomInDown
193
198
 
194
199
  export class ZoomInEasyUp
195
200
  extends ComplexAnimationBuilder
196
- implements IEntryExitAnimationBuilder {
201
+ implements IEntryAnimationBuilder {
197
202
  static createInstance(): ZoomInEasyUp {
198
203
  return new ZoomInEasyUp();
199
204
  }
200
205
 
201
- build = (): EntryExitAnimationFunction => {
206
+ build = (): AnimationConfigFunction<EntryAnimationsValues> => {
202
207
  const delayFunction = this.getDelayFunction();
203
208
  const [animation, config] = this.getAnimationAndConfig();
204
209
  const delay = this.getDelay();
@@ -214,7 +219,7 @@ export class ZoomInEasyUp
214
219
  ],
215
220
  },
216
221
  initialValues: {
217
- transform: [{ translateY: -values.height }, { scale: 0 }],
222
+ transform: [{ translateY: -values.targetHeight }, { scale: 0 }],
218
223
  },
219
224
  callback: callback,
220
225
  };
@@ -224,12 +229,12 @@ export class ZoomInEasyUp
224
229
 
225
230
  export class ZoomInEasyDown
226
231
  extends ComplexAnimationBuilder
227
- implements IEntryExitAnimationBuilder {
232
+ implements IEntryAnimationBuilder {
228
233
  static createInstance(): ZoomInEasyDown {
229
234
  return new ZoomInEasyDown();
230
235
  }
231
236
 
232
- build = (): EntryExitAnimationFunction => {
237
+ build = (): AnimationConfigFunction<EntryAnimationsValues> => {
233
238
  const delayFunction = this.getDelayFunction();
234
239
  const [animation, config] = this.getAnimationAndConfig();
235
240
  const delay = this.getDelay();
@@ -245,7 +250,7 @@ export class ZoomInEasyDown
245
250
  ],
246
251
  },
247
252
  initialValues: {
248
- transform: [{ translateY: values.height }, { scale: 0 }],
253
+ transform: [{ translateY: values.targetHeight }, { scale: 0 }],
249
254
  },
250
255
  callback: callback,
251
256
  };
@@ -439,12 +444,12 @@ export class ZoomOutDown
439
444
 
440
445
  export class ZoomOutEasyUp
441
446
  extends ComplexAnimationBuilder
442
- implements IEntryExitAnimationBuilder {
447
+ implements IExitAnimationBuilder {
443
448
  static createInstance(): ZoomOutEasyUp {
444
449
  return new ZoomOutEasyUp();
445
450
  }
446
451
 
447
- build = (): EntryExitAnimationFunction => {
452
+ build = (): AnimationConfigFunction<ExitAnimationsValues> => {
448
453
  const delayFunction = this.getDelayFunction();
449
454
  const [animation, config] = this.getAnimationAndConfig();
450
455
  const delay = this.getDelay();
@@ -458,7 +463,7 @@ export class ZoomOutEasyUp
458
463
  {
459
464
  translateY: delayFunction(
460
465
  delay,
461
- animation(-values.height, config)
466
+ animation(-values.currentHeight, config)
462
467
  ),
463
468
  },
464
469
  { scale: delayFunction(delay, animation(0, config)) },
@@ -475,12 +480,12 @@ export class ZoomOutEasyUp
475
480
 
476
481
  export class ZoomOutEasyDown
477
482
  extends ComplexAnimationBuilder
478
- implements IEntryExitAnimationBuilder {
483
+ implements IExitAnimationBuilder {
479
484
  static createInstance(): ZoomOutEasyDown {
480
485
  return new ZoomOutEasyDown();
481
486
  }
482
487
 
483
- build = (): EntryExitAnimationFunction => {
488
+ build = (): AnimationConfigFunction<ExitAnimationsValues> => {
484
489
  const delayFunction = this.getDelayFunction();
485
490
  const [animation, config] = this.getAnimationAndConfig();
486
491
  const delay = this.getDelay();
@@ -494,7 +499,7 @@ export class ZoomOutEasyDown
494
499
  {
495
500
  translateY: delayFunction(
496
501
  delay,
497
- animation(values.height, config)
502
+ animation(values.currentHeight, config)
498
503
  ),
499
504
  },
500
505
  { scale: delayFunction(delay, animation(0, config)) },
@@ -74,27 +74,39 @@ export class CurvedTransition
74
74
 
75
75
  return {
76
76
  initialValues: {
77
- originX: values.boriginX,
78
- originY: values.boriginY,
79
- width: values.bwidth,
80
- height: values.bheight,
77
+ originX: values.currentOriginX,
78
+ originY: values.currentOriginY,
79
+ width: values.currentWidth,
80
+ height: values.currentHeight,
81
81
  },
82
82
  animations: {
83
83
  originX: delayFunction(
84
84
  delay,
85
- withTiming(values.originX, { duration, easing: easing.easingX })
85
+ withTiming(values.targetOriginX, {
86
+ duration,
87
+ easing: easing.easingX,
88
+ })
86
89
  ),
87
90
  originY: delayFunction(
88
91
  delay,
89
- withTiming(values.originY, { duration, easing: easing.easingY })
92
+ withTiming(values.targetOriginY, {
93
+ duration,
94
+ easing: easing.easingY,
95
+ })
90
96
  ),
91
97
  width: delayFunction(
92
98
  delay,
93
- withTiming(values.width, { duration, easing: easing.easingWidth })
99
+ withTiming(values.targetWidth, {
100
+ duration,
101
+ easing: easing.easingWidth,
102
+ })
94
103
  ),
95
104
  height: delayFunction(
96
105
  delay,
97
- withTiming(values.height, { duration, easing: easing.easingHeight })
106
+ withTiming(values.targetHeight, {
107
+ duration,
108
+ easing: easing.easingHeight,
109
+ })
98
110
  ),
99
111
  },
100
112
  callback: callback,
@@ -174,28 +174,28 @@ export class EntryExitTransition
174
174
  return {
175
175
  initialValues: {
176
176
  ...exitingValues.initialValues,
177
- originX: values.boriginX,
178
- originY: values.boriginY,
179
- width: values.bwidth,
180
- height: values.bheight,
177
+ originX: values.currentOriginX,
178
+ originY: values.currentOriginY,
179
+ width: values.currentWidth,
180
+ height: values.currentHeight,
181
181
  transform: mergedTransform,
182
182
  },
183
183
  animations: {
184
184
  originX: delayFunction(
185
185
  delay + exitingDuration,
186
- withTiming(values.originX, { duration: exitingDuration })
186
+ withTiming(values.targetOriginX, { duration: exitingDuration })
187
187
  ),
188
188
  originY: delayFunction(
189
189
  delay + exitingDuration,
190
- withTiming(values.originY, { duration: exitingDuration })
190
+ withTiming(values.targetOriginY, { duration: exitingDuration })
191
191
  ),
192
192
  width: delayFunction(
193
193
  delay + exitingDuration,
194
- withTiming(values.width, { duration: exitingDuration })
194
+ withTiming(values.targetWidth, { duration: exitingDuration })
195
195
  ),
196
196
  height: delayFunction(
197
197
  delay + exitingDuration,
198
- withTiming(values.height, { duration: exitingDuration })
198
+ withTiming(values.targetHeight, { duration: exitingDuration })
199
199
  ),
200
200
  ...animations,
201
201
  },