diff --git a/packages/docs-gesture-handler/docs/gestures/_shared/base-gesture-config.mdx b/packages/docs-gesture-handler/docs/gestures/_shared/base-gesture-config.mdx index f104f8fa02..98da1376d9 100644 --- a/packages/docs-gesture-handler/docs/gestures/_shared/base-gesture-config.mdx +++ b/packages/docs-gesture-handler/docs/gestures/_shared/base-gesture-config.mdx @@ -19,7 +19,7 @@ shouldCancelWhenOutside: boolean | SharedValue; When `true`, the handler will stop recognition whenever the finger leaves the area of the connected view. Default value of this property is different depending on the handler type. -Most handlers' `shouldCancelWhenOutside` property defaults to `false` except for the [`LongPressGesture`](/docs/gestures/use-long-press-gesture) and [`TapGesture`](/docs/gestures/use-tap-gesture) which default to `true`. +Most handlers' `shouldCancelWhenOutside` property defaults to `false` except for the [`LongPress`](/docs/gestures/use-long-press-gesture), [`Tap`](/docs/gestures/use-tap-gesture) and [`Native`](/docs/gestures/use-native-gesture) (on Android and web), which default to `true`. ### hitSlop diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-callbacks.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-callbacks.md deleted file mode 100644 index 60e2af2c48..0000000000 --- a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-callbacks.md +++ /dev/null @@ -1,9 +0,0 @@ -### Callbacks common to all continuous gestures: - -### `onUpdate(callback)` - -Set the callback that is being called every time the gesture receives an update while it's active. - -### `onChange(callback)` - -Set the callback that is being called every time the gesture receives an update while it's active. This callback will receive information about change in value in relation to the last received event. diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-callbacks.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-callbacks.md new file mode 120000 index 0000000000..4008179ec0 --- /dev/null +++ b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-callbacks.md @@ -0,0 +1 @@ +../../../versioned_docs/version-2.x/gestures/_shared/base-continuous-gesture-callbacks.md \ No newline at end of file diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-config.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-config.md deleted file mode 100644 index 17a4de8527..0000000000 --- a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-config.md +++ /dev/null @@ -1,5 +0,0 @@ -### Properties common to all continuous gestures: - -### `manualActivation(value: boolean)` - -When `true`, the handler will not activate by itself even if its activation criteria are met. Instead, you can manipulate its state using [state manager](/docs/2.x/gestures/state-manager/). diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-config.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-config.md new file mode 120000 index 0000000000..fe79576133 --- /dev/null +++ b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-continuous-gesture-config.md @@ -0,0 +1 @@ +../../../versioned_docs/version-2.x/gestures/_shared/base-continuous-gesture-config.md \ No newline at end of file diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-callbacks.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-callbacks.md deleted file mode 100644 index dff985b307..0000000000 --- a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-callbacks.md +++ /dev/null @@ -1,33 +0,0 @@ -### Callbacks common to all gestures: - -### `onBegin(callback)` - -Set the callback that is being called when given gesture handler starts receiving touches. At the moment of this callback the handler is not yet in an active state and we don't know yet if it will recognize the gesture at all. - -### `onStart(callback)` - -Set the callback that is being called when the gesture is recognized by the handler and it transitions to the active state. - -### `onEnd(callback)` - -Set the callback that is being called when the gesture that was recognized by the handler finishes. It will be called only if the handler was previously in the active state. - -### `onFinalize(callback)` - -Set the callback that is being called when the handler finalizes handling gesture - the gesture was recognized and has finished or it failed to recognize. - -### `onTouchesDown(callback)` - -Set the `onTouchesDown` callback which is called every time a finger is placed on the screen. - -### `onTouchesMove(callback)` - -Set the `onTouchesMove` callback which is called every time a finger is moved on the screen. - -### `onTouchesUp(callback)` - -Set the `onTouchesUp` callback which is called every time a finger is lifted from the screen. - -### `onTouchesCancelled(callback)` - -Set the `onTouchesCancelled` callback which is called every time a finger stops being tracked, for example when the gesture finishes. diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-callbacks.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-callbacks.md new file mode 120000 index 0000000000..41dd4cb8c3 --- /dev/null +++ b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-callbacks.md @@ -0,0 +1 @@ +../../../versioned_docs/version-2.x/gestures/_shared/base-gesture-callbacks.md \ No newline at end of file diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-config.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-config.md deleted file mode 100644 index 16774a8eef..0000000000 --- a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-config.md +++ /dev/null @@ -1,68 +0,0 @@ -### Properties common to all gestures: - -### `enabled(value: boolean)` - -Indicates whether the given handler should be analyzing the stream of touch events or not. -When set to `false`, we can be sure that the handler's state will **never** become [`ACTIVE`](/docs/2.x/fundamentals/states-events#active). -If the value gets updated while the handler has already started recognizing a gesture, then the handler's state will immediately change to [`FAILED`](/docs/2.x/fundamentals/states-events#failed) or [`CANCELLED`](/docs/2.x/fundamentals/states-events#cancelled) (depending on its current state). -Default value is `true`. - -### `shouldCancelWhenOutside(value: boolean)` - -When `true`, the handler will [cancel](/docs/2.x/fundamentals/states-events#cancelled) or [fail](/docs/2.x/fundamentals/states-events#failed) recognition (depending on its current state) whenever the finger leaves the area of the connected view. -Default value of this property is different depending on the handler type. -Most handlers' `shouldCancelWhenOutside` property defaults to `false` except for the [`LongPressGesture`](/docs/2.x/gestures/long-press-gesture) and [`TapGesture`](/docs/2.x/gestures/tap-gesture) which default to `true`. - -### `hitSlop(settings)` - -This parameter enables control over what part of the connected view area can be used to [begin](/docs/2.x/fundamentals/states-events#began) recognizing the gesture. -When a negative number is provided, the bounds of the view will reduce the area by the given number of points in each of the sides evenly. - -Instead you can pass an object to specify how each boundary side should be reduced by providing different number of points for `left`, `right`, `top` or `bottom` sides. -You can alternatively provide `horizontal` or `vertical` instead of specifying directly `left`, `right` or `top` and `bottom`. -Finally, the object can also take `width` and `height` attributes. -When `width` is set it is only allowed to specify one of the sides `right` or `left`. -Similarly when `height` is provided only `top` or `bottom` can be set. -Specifying `width` or `height` is useful if we only want the gesture to activate on the edge of the view. In which case for example we can set `left: 0` and `width: 20` which would make it possible for the gesture to be recognized when started no more than 20 points from the left edge. - -**IMPORTANT:** Note that this parameter is primarily designed to reduce the area where gesture can activate. Hence it is only supported for all the values (except `width` and `height`) to be non positive (0 or lower). Although on Android it is supported for the values to also be positive and therefore allow to expand beyond view bounds but not further than the parent view bounds. To achieve this effect on both platforms you can use React Native's View [hitSlop](https://reactnative.dev/docs/view.html#hitslop) property. - -### `withRef(ref)` - -Sets a ref to the gesture object, allowing for interoperability with the old -API. - -### `withTestId(testID)` - -Sets a `testID` property for gesture object, allowing for querying for it in tests. - -### `cancelsTouchesInView(value)` (**iOS only**) - -Accepts a boolean value. -When `true`, the gesture will cancel touches for native UI components (`UIButton`, `UISwitch`, etc) it's attached to when it becomes [`ACTIVE`](/docs/2.x/fundamentals/states-events#active). -Default value is `true`. - -### `runOnJS(value: boolean)` - -When `react-native-reanimated` is installed, the callbacks passed to the gestures are automatically workletized and run on the UI thread when called. This option allows for changing this behavior: when `true`, all the callbacks will be run on the JS thread instead of the UI thread, regardless of whether they are worklets or not. -Defaults to `false`. - -### `simultaneousWithExternalGesture(otherGesture1, otherGesture2, ...)` - -Adds a gesture that should be recognized simultaneously with this one. - -**IMPORTANT:** Note that this method only marks the relation between gestures, without [composing them](/docs/2.x/fundamentals/gesture-composition). [`GestureDetector`](/docs/2.x/gestures/gesture-detector) will not recognize the `otherGestures` and it needs to be added to another detector in order to be recognized. - -### `requireExternalGestureToFail(otherGesture1, otherGesture2, ...)` - -Adds a relation requiring another gesture to fail, before this one can activate. - -### `blocksExternalGesture(otherGesture1, otherGesture2, ...)` - -Adds a relation that makes other gestures wait with activation until this gesture fails (or doesn't start at all). - -**IMPORTANT:** Note that this method only marks the relation between gestures, without [composing them](/docs/2.x/fundamentals/gesture-composition). [`GestureDetector`](/docs/2.x/gestures/gesture-detector) will not recognize the `otherGestures` and it needs to be added to another detector in order to be recognized. - -### `activeCursor(value)` (Web only) - -This parameter allows specifying which cursor should be used when the gesture activates. Supports all CSS cursor values (e.g. `"grab"`, `"zoom-in"`). Default value is set to `"auto"`. diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-config.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-config.md new file mode 120000 index 0000000000..ec59ba1305 --- /dev/null +++ b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-config.md @@ -0,0 +1 @@ +../../../versioned_docs/version-2.x/gestures/_shared/base-gesture-config.md \ No newline at end of file diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-event-data.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-event-data.md deleted file mode 100644 index 674f2fb478..0000000000 --- a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-event-data.md +++ /dev/null @@ -1,19 +0,0 @@ -### Event attributes common to all gestures: - -### `state` - -Current [state](/docs/2.x/fundamentals/states-events) of the handler. Expressed as one of the constants exported under `State` object by the library. - -### `numberOfPointers` - -Represents the number of pointers (fingers) currently placed on the screen. - -### `pointerType` - -Indicates the type of pointer device in use. This value is represented by the `PointerType` enum, which includes the following fields: - -- `TOUCH` - represents finger -- `STYLUS` - represents stylus or digital pen -- `MOUSE` - represents computer mouse -- `KEY` - represents keyboard -- `OTHER` - represents unknown device type that is not relevant diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-event-data.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-event-data.md new file mode 120000 index 0000000000..2333e1ae35 --- /dev/null +++ b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/base-gesture-event-data.md @@ -0,0 +1 @@ +../../../versioned_docs/version-2.x/gestures/_shared/base-gesture-event-data.md \ No newline at end of file diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/gesture-detector-functional1.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/gesture-detector-functional1.md deleted file mode 100644 index 2397af9dfa..0000000000 --- a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/gesture-detector-functional1.md +++ /dev/null @@ -1,19 +0,0 @@ -```jsx -export default function Example() { - const tap = Gesture.Tap().onStart(() => { - console.log('tap'); - }); - - return ( - - - - - - ); -} - -function FunctionalComponent(props) { - return {props.children}; -} -``` diff --git a/packages/docs-gesture-handler/docs/legacy-gestures/_shared/gesture-detector-functional1.md b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/gesture-detector-functional1.md new file mode 120000 index 0000000000..0cf6014af9 --- /dev/null +++ b/packages/docs-gesture-handler/docs/legacy-gestures/_shared/gesture-detector-functional1.md @@ -0,0 +1 @@ +../../../versioned_docs/version-2.x/gestures/_shared/gesture-detector-functional1.md \ No newline at end of file diff --git a/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-continuous-gesture-config.md b/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-continuous-gesture-config.md index f829d626e9..17a4de8527 100644 --- a/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-continuous-gesture-config.md +++ b/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-continuous-gesture-config.md @@ -2,4 +2,4 @@ ### `manualActivation(value: boolean)` -When `true` the handler will not activate by itself even if its activation criteria are met. Instead you can manipulate its state using [state manager](/docs/2.x/gestures/state-manager/). +When `true`, the handler will not activate by itself even if its activation criteria are met. Instead, you can manipulate its state using [state manager](/docs/2.x/gestures/state-manager/). diff --git a/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-gesture-config.md b/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-gesture-config.md index b91cbb4f6a..033c01bb5c 100644 --- a/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-gesture-config.md +++ b/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-gesture-config.md @@ -2,21 +2,21 @@ ### `enabled(value: boolean)` -Indicates whether the given handler should be analyzing stream of touch events or not. -When set to `false` we can be sure that the handler's state will **never** become [`ACTIVE`](/docs/2.x/fundamentals/states-events#active). -If the value gets updated while the handler already started recognizing a gesture, then the handler's state will immediately change to [`FAILED`](/docs/2.x/fundamentals/states-events#failed) or [`CANCELLED`](/docs/2.x/fundamentals/states-events#cancelled) (depending on its current state). +Indicates whether the given handler should be analyzing the stream of touch events or not. +When set to `false`, we can be sure that the handler's state will **never** become [`ACTIVE`](/docs/2.x/fundamentals/states-events#active). +If the value gets updated while the handler has already started recognizing a gesture, then the handler's state will immediately change to [`FAILED`](/docs/2.x/fundamentals/states-events#failed) or [`CANCELLED`](/docs/2.x/fundamentals/states-events#cancelled) (depending on its current state). Default value is `true`. ### `shouldCancelWhenOutside(value: boolean)` -When `true` the handler will [cancel](/docs/2.x/fundamentals/states-events#cancelled) or [fail](/docs/2.x/fundamentals/states-events#failed) recognition (depending on its current state) whenever the finger leaves the area of the connected view. +When `true`, the handler will [cancel](/docs/2.x/fundamentals/states-events#cancelled) or [fail](/docs/2.x/fundamentals/states-events#failed) recognition (depending on its current state) whenever the finger leaves the area of the connected view. Default value of this property is different depending on the handler type. -Most handlers' `shouldCancelWhenOutside` property defaults to `false` except for the [`LongPressGesture`](/docs/2.x/gestures/long-press-gesture) and [`TapGesture`](/docs/2.x/gestures/tap-gesture) which default to `true`. +Most handlers' `shouldCancelWhenOutside` property defaults to `false` except for the [`LongPressGesture`](/docs/2.x/gestures/long-press-gesture), [`TapGesture`](/docs/2.x/gestures/tap-gesture) and [`NativeGesture`](/docs/2.x/gestures/native-gesture) (on Android and web) which default to `true`. ### `hitSlop(settings)` This parameter enables control over what part of the connected view area can be used to [begin](/docs/2.x/fundamentals/states-events#began) recognizing the gesture. -When a negative number is provided the bounds of the view will reduce the area by the given number of points in each of the sides evenly. +When a negative number is provided, the bounds of the view will reduce the area by the given number of points in each of the sides evenly. Instead you can pass an object to specify how each boundary side should be reduced by providing different number of points for `left`, `right`, `top` or `bottom` sides. You can alternatively provide `horizontal` or `vertical` instead of specifying directly `left`, `right` or `top` and `bottom`. @@ -65,4 +65,4 @@ Adds a relation that makes other gestures wait with activation until this gestur ### `activeCursor(value)` (Web only) -This parameter allows to specify which cursor should be used when gesture activates. Supports all CSS cursor values (e.g. `"grab"`, `"zoom-in"`). Default value is set to `"auto"`. +This parameter allows specifying which cursor should be used when the gesture activates. Supports all CSS cursor values (e.g. `"grab"`, `"zoom-in"`). Default value is set to `"auto"`. diff --git a/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-gesture-event-data.md b/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-gesture-event-data.md index 21da18e191..674f2fb478 100644 --- a/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-gesture-event-data.md +++ b/packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/_shared/base-gesture-event-data.md @@ -12,8 +12,8 @@ Represents the number of pointers (fingers) currently placed on the screen. Indicates the type of pointer device in use. This value is represented by the `PointerType` enum, which includes the following fields: -- `TOUCH` - represents a finger -- `STYLUS` - represents a stylus or digital pen -- `MOUSE` - represents a computer mouse -- `KEY` - represents a keyboard -- `OTHER` - represents an unknown device type that is not relevant +- `TOUCH` - represents finger +- `STYLUS` - represents stylus or digital pen +- `MOUSE` - represents computer mouse +- `KEY` - represents keyboard +- `OTHER` - represents unknown device type that is not relevant