react-native-gesture-handler 2.31.0 → 2.31.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.
Files changed (29) hide show
  1. package/apple/Handlers/RNHoverHandler.m +2 -0
  2. package/lib/commonjs/components/DrawerLayout.js +4 -4
  3. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  4. package/lib/commonjs/components/ReanimatedDrawerLayout.js +4 -4
  5. package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
  6. package/lib/commonjs/components/ReanimatedSwipeable/ReanimatedSwipeable.js +2 -2
  7. package/lib/commonjs/components/ReanimatedSwipeable/ReanimatedSwipeable.js.map +1 -1
  8. package/lib/commonjs/components/Swipeable.js +2 -2
  9. package/lib/commonjs/components/Swipeable.js.map +1 -1
  10. package/lib/commonjs/components/touchables/GenericTouchable.js +9 -13
  11. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  12. package/lib/module/components/DrawerLayout.js +4 -4
  13. package/lib/module/components/DrawerLayout.js.map +1 -1
  14. package/lib/module/components/ReanimatedDrawerLayout.js +4 -4
  15. package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
  16. package/lib/module/components/ReanimatedSwipeable/ReanimatedSwipeable.js +2 -2
  17. package/lib/module/components/ReanimatedSwipeable/ReanimatedSwipeable.js.map +1 -1
  18. package/lib/module/components/Swipeable.js +2 -2
  19. package/lib/module/components/Swipeable.js.map +1 -1
  20. package/lib/module/components/touchables/GenericTouchable.js +9 -13
  21. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  22. package/lib/typescript/components/touchables/GenericTouchable.d.ts +1 -1
  23. package/lib/typescript/components/touchables/GenericTouchable.d.ts.map +1 -1
  24. package/package.json +5 -4
  25. package/src/components/DrawerLayout.tsx +4 -4
  26. package/src/components/ReanimatedDrawerLayout.tsx +4 -4
  27. package/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx +2 -2
  28. package/src/components/Swipeable.tsx +2 -2
  29. package/src/components/touchables/GenericTouchable.tsx +14 -16
@@ -605,12 +605,12 @@ const styles = StyleSheet.create({
605
605
  overflow: 'hidden',
606
606
  },
607
607
  leftActions: {
608
- ...StyleSheet.absoluteFillObject,
608
+ ...StyleSheet.absoluteFill,
609
609
  flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row',
610
610
  overflow: 'hidden',
611
611
  },
612
612
  rightActions: {
613
- ...StyleSheet.absoluteFillObject,
613
+ ...StyleSheet.absoluteFill,
614
614
  flexDirection: I18nManager.isRTL ? 'row' : 'row-reverse',
615
615
  overflow: 'hidden',
616
616
  },
@@ -585,11 +585,11 @@ const styles = StyleSheet.create({
585
585
  overflow: 'hidden',
586
586
  },
587
587
  leftActions: {
588
- ...StyleSheet.absoluteFillObject,
588
+ ...StyleSheet.absoluteFill,
589
589
  flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row',
590
590
  },
591
591
  rightActions: {
592
- ...StyleSheet.absoluteFillObject,
592
+ ...StyleSheet.absoluteFill,
593
593
  flexDirection: I18nManager.isRTL ? 'row' : 'row-reverse',
594
594
  },
595
595
  });
@@ -31,9 +31,7 @@ interface InternalProps {
31
31
  onStateChange?: (oldState: TouchableState, newState: TouchableState) => void;
32
32
  }
33
33
 
34
- // TODO: maybe can be better
35
- // TODO: all clearTimeout have ! added, maybe they shouldn't ?
36
- type Timeout = ReturnType<typeof setTimeout> | null | undefined;
34
+ type Timeout = ReturnType<typeof setTimeout> | undefined;
37
35
 
38
36
  /**
39
37
  * GenericTouchable is not intented to be used as it is.
@@ -70,7 +68,7 @@ export default class GenericTouchable extends Component<
70
68
  if (this.props.delayPressIn) {
71
69
  this.pressInTimeout = setTimeout(() => {
72
70
  this.moveToState(TOUCHABLE_STATE.BEGAN);
73
- this.pressInTimeout = null;
71
+ this.pressInTimeout = undefined;
74
72
  }, this.props.delayPressIn);
75
73
  } else {
76
74
  this.moveToState(TOUCHABLE_STATE.BEGAN);
@@ -89,7 +87,7 @@ export default class GenericTouchable extends Component<
89
87
  this.pressOutTimeout ||
90
88
  setTimeout(() => {
91
89
  this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);
92
- this.pressOutTimeout = null;
90
+ this.pressOutTimeout = undefined;
93
91
  }, this.props.delayPressOut);
94
92
  } else {
95
93
  this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE);
@@ -98,14 +96,14 @@ export default class GenericTouchable extends Component<
98
96
 
99
97
  // handleGoToUndetermined transits to UNDETERMINED state with proper delay
100
98
  handleGoToUndetermined() {
101
- clearTimeout(this.pressOutTimeout!); // TODO: maybe it can be undefined
99
+ clearTimeout(this.pressOutTimeout);
102
100
  if (this.props.delayPressOut) {
103
101
  this.pressOutTimeout = setTimeout(() => {
104
102
  if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {
105
103
  this.moveToState(TOUCHABLE_STATE.BEGAN);
106
104
  }
107
105
  this.moveToState(TOUCHABLE_STATE.UNDETERMINED);
108
- this.pressOutTimeout = null;
106
+ this.pressOutTimeout = undefined;
109
107
  }, this.props.delayPressOut);
110
108
  } else {
111
109
  if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) {
@@ -122,12 +120,12 @@ export default class GenericTouchable extends Component<
122
120
  reset() {
123
121
  this.longPressDetected = false;
124
122
  this.pointerInside = true;
125
- clearTimeout(this.pressInTimeout!);
126
- clearTimeout(this.pressOutTimeout!);
127
- clearTimeout(this.longPressTimeout!);
128
- this.pressOutTimeout = null;
129
- this.longPressTimeout = null;
130
- this.pressInTimeout = null;
123
+ clearTimeout(this.pressInTimeout);
124
+ clearTimeout(this.pressOutTimeout);
125
+ clearTimeout(this.longPressTimeout);
126
+ this.pressOutTimeout = undefined;
127
+ this.longPressTimeout = undefined;
128
+ this.pressInTimeout = undefined;
131
129
  }
132
130
 
133
131
  // All states' transitions are defined here.
@@ -189,7 +187,7 @@ export default class GenericTouchable extends Component<
189
187
  const shouldCallOnPress =
190
188
  !this.longPressDetected &&
191
189
  this.STATE !== TOUCHABLE_STATE.MOVED_OUTSIDE &&
192
- this.pressOutTimeout === null;
190
+ this.pressOutTimeout === undefined;
193
191
  this.handleGoToUndetermined();
194
192
  if (shouldCallOnPress) {
195
193
  // Calls only inside component whether no long press was called previously
@@ -218,8 +216,8 @@ export default class GenericTouchable extends Component<
218
216
 
219
217
  onMoveOut() {
220
218
  // Long press should no longer be detected
221
- clearTimeout(this.longPressTimeout!);
222
- this.longPressTimeout = null;
219
+ clearTimeout(this.longPressTimeout);
220
+ this.longPressTimeout = undefined;
223
221
  if (this.STATE === TOUCHABLE_STATE.BEGAN) {
224
222
  this.handleMoveOutside();
225
223
  }