Skip to content

Commit f4d2e0f

Browse files
authored
Merge branch 'main' into @mbert/clickable-mock
2 parents 97ed97f + d1096d5 commit f4d2e0f

17 files changed

Lines changed: 152 additions & 108 deletions

File tree

apps/basic-example/Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ GEM
1818
mutex_m
1919
securerandom (>= 0.3)
2020
tzinfo (~> 2.0)
21-
addressable (2.8.7)
22-
public_suffix (>= 2.0.2, < 7.0)
21+
addressable (2.9.0)
22+
public_suffix (>= 2.0.2, < 8.0)
2323
algoliasearch (1.27.5)
2424
httpclient (~> 2.8, >= 2.8.3)
2525
json (>= 1.5.1)

apps/common-app/src/new_api/components/clickable/index.tsx renamed to apps/common-app/src/new_api/components/touchable/index.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@ import React from 'react';
22
import { StyleSheet, Text, View, ScrollView } from 'react-native';
33
import {
44
GestureHandlerRootView,
5-
Clickable,
6-
ClickableProps,
5+
Touchable,
6+
TouchableProps,
77
} from 'react-native-gesture-handler';
88
import { COLORS } from '../../../common';
99

10-
type ButtonWrapperProps = ClickableProps & {
10+
type ButtonWrapperProps = TouchableProps & {
1111
name: string;
1212
color: string;
1313
};
1414

15-
function ClickableWrapper({ name, color, ...rest }: ButtonWrapperProps) {
15+
function TouchableWrapper({ name, color, ...rest }: ButtonWrapperProps) {
1616
return (
17-
<Clickable
17+
<Touchable
1818
style={[styles.button, { backgroundColor: color }]}
1919
onPressIn={() => console.log(`[${name}] onPressIn`)}
2020
onPress={() => console.log(`[${name}] onPress`)}
2121
onLongPress={() => console.log(`[${name}] onLongPress`)}
2222
onPressOut={() => console.log(`[${name}] onPressOut`)}
2323
{...rest}>
2424
<Text style={styles.buttonText}>{name}</Text>
25-
</Clickable>
25+
</Touchable>
2626
);
2727
}
2828

29-
export default function ClickableExample() {
29+
export default function TouchableExample() {
3030
return (
3131
<GestureHandlerRootView style={styles.container}>
3232
<ScrollView contentContainerStyle={styles.scrollContent}>
@@ -35,15 +35,15 @@ export default function ClickableExample() {
3535
<Text>New component that replaces all buttons and pressables.</Text>
3636

3737
<View style={styles.row}>
38-
<ClickableWrapper name="Base" color={COLORS.DARK_PURPLE} />
38+
<TouchableWrapper name="Base" color={COLORS.DARK_PURPLE} />
3939

40-
<ClickableWrapper
40+
<TouchableWrapper
4141
name="Rect"
4242
color={COLORS.WEB_BLUE}
4343
activeUnderlayOpacity={0.105}
4444
/>
4545

46-
<ClickableWrapper
46+
<TouchableWrapper
4747
name="Borderless"
4848
activeOpacity={0.3}
4949
color={COLORS.RED}
@@ -56,13 +56,13 @@ export default function ClickableExample() {
5656
<Text>Animated underlay.</Text>
5757

5858
<View style={styles.row}>
59-
<ClickableWrapper
59+
<TouchableWrapper
6060
name="Click me!"
6161
color={COLORS.YELLOW}
6262
activeUnderlayOpacity={0.3}
6363
/>
6464

65-
<ClickableWrapper
65+
<TouchableWrapper
6666
name="Click me!"
6767
color={COLORS.NAVY}
6868
defaultUnderlayOpacity={0.7}
@@ -74,14 +74,14 @@ export default function ClickableExample() {
7474
<Text>Animated component.</Text>
7575

7676
<View style={styles.row}>
77-
<ClickableWrapper
77+
<TouchableWrapper
7878
name="Click me!"
7979
color={COLORS.LIGHT_BLUE}
8080
defaultOpacity={0.3}
8181
activeOpacity={0.7}
8282
/>
8383

84-
<ClickableWrapper
84+
<TouchableWrapper
8585
name="Click me!"
8686
color={COLORS.DARK_SALMON}
8787
defaultOpacity={0.7}
@@ -92,16 +92,16 @@ export default function ClickableExample() {
9292

9393
<View style={styles.section}>
9494
<Text style={styles.sectionHeader}>Android ripple</Text>
95-
<Text>Configurable ripple effect on Clickable component.</Text>
95+
<Text>Configurable ripple effect on Touchable component.</Text>
9696

9797
<View style={styles.row}>
98-
<ClickableWrapper
98+
<TouchableWrapper
9999
name="Default"
100100
color={COLORS.ANDROID}
101101
androidRipple={{}}
102102
/>
103103

104-
<ClickableWrapper
104+
<TouchableWrapper
105105
name="Borderless"
106106
color={COLORS.ANDROID}
107107
androidRipple={{

apps/common-app/src/new_api/components/clickable_stress/index.tsx renamed to apps/common-app/src/new_api/components/touchable_stress/index.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Profiler, useCallback, useEffect, useRef, useState } from 'react';
22
import { StyleSheet, Text, View } from 'react-native';
3-
import { Clickable, ScrollView } from 'react-native-gesture-handler';
3+
import { Touchable, ScrollView } from 'react-native-gesture-handler';
44

55
const CLICK_COUNT = 2000;
66
const N = 25;
@@ -27,12 +27,12 @@ function getTrimmedAverage(results: number[], dropout: number): number {
2727
return trimmed.reduce((sum, v) => sum + v, 0) / trimmed.length;
2828
}
2929

30-
type ClickableListProps = {
30+
type TouchableListProps = {
3131
run: number;
3232
onMountDuration: (duration: number) => void;
3333
};
3434

35-
function ClickableList({ run, onMountDuration }: ClickableListProps) {
35+
function TouchableList({ run, onMountDuration }: TouchableListProps) {
3636
const reportedRef = useRef(-1);
3737

3838
const handleRender = useCallback(
@@ -46,28 +46,28 @@ function ClickableList({ run, onMountDuration }: ClickableListProps) {
4646
);
4747

4848
return (
49-
<Profiler id="ClickableList" onRender={handleRender}>
49+
<Profiler id="TouchableList" onRender={handleRender}>
5050
<ScrollView style={{ flex: 1 }}>
5151
{STRESS_DATA.map((id) => (
5252
// <BaseButton key={id} style={styles.button} />
53-
<Clickable key={id} style={styles.button} />
53+
<Touchable key={id} style={styles.button} />
5454

5555
// <RectButton key={id} style={styles.button} />
56-
// <Clickable
56+
// <Touchable
5757
// key={id}
5858
// style={styles.button}
5959
// activeUnderlayOpacity={0.105}
6060
// />
6161

6262
// <BorderlessButton key={id} style={styles.button} />
63-
// <Clickable key={id} style={styles.button} activeOpacity={0.3} />
63+
// <Touchable key={id} style={styles.button} activeOpacity={0.3} />
6464
))}
6565
</ScrollView>
6666
</Profiler>
6767
);
6868
}
6969

70-
export default function ClickableStress() {
70+
export default function TouchableStress() {
7171
const [state, setState] = useState<BenchmarkState>({ phase: 'idle' });
7272
const resultsRef = useRef<number[]>([]);
7373
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
@@ -112,15 +112,15 @@ export default function ClickableStress() {
112112

113113
return (
114114
<View style={styles.container}>
115-
<Clickable
115+
<Touchable
116116
activeUnderlayOpacity={0.105}
117117
style={[styles.startButton, isRunning && styles.startButtonBusy]}
118118
onPress={start}
119119
enabled={!isRunning}>
120120
<Text style={styles.startButtonText}>
121121
{isRunning ? `Running ${currentRun}/${N}...` : 'Start test'}
122122
</Text>
123-
</Clickable>
123+
</Touchable>
124124

125125
{results && (
126126
<View style={styles.results}>
@@ -143,7 +143,7 @@ export default function ClickableStress() {
143143
)}
144144

145145
{isRunning && (
146-
<ClickableList run={currentRun} onMountDuration={handleMountDuration} />
146+
<TouchableList run={currentRun} onMountDuration={handleMountDuration} />
147147
)}
148148
</View>
149149
);

apps/common-app/src/new_api/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import TapExample from './simple/tap';
2828

2929
import ButtonsExample from './components/buttons';
3030
import ButtonUnderlayExample from './components/button_underlay';
31-
import ClickableExample from './components/clickable';
32-
import ClickableStressExample from './components/clickable_stress';
31+
import TouchableExample from './components/touchable';
32+
import TouchableStressExample from './components/touchable_stress';
3333
import ReanimatedDrawerLayout from './components/drawer';
3434
import FlatListExample from './components/flatlist';
3535
import ScrollViewExample from './components/scrollview';
@@ -109,8 +109,8 @@ export const NEW_EXAMPLES: ExamplesSection[] = [
109109
{ name: 'ScrollView example', component: ScrollViewExample },
110110
{ name: 'Buttons example', component: ButtonsExample },
111111
{ name: 'Button underlay example', component: ButtonUnderlayExample },
112-
{ name: 'Clickable example', component: ClickableExample },
113-
{ name: 'Clickable stress test', component: ClickableStressExample },
112+
{ name: 'Touchable example', component: TouchableExample },
113+
{ name: 'Touchable stress test', component: TouchableStressExample },
114114
{ name: 'Switch & TextInput', component: SwitchTextInputExample },
115115
{ name: 'Reanimated Swipeable', component: Swipeable },
116116
{ name: 'Reanimated Drawer Layout', component: ReanimatedDrawerLayout },

apps/macos-example/Gemfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GEM
55
base64
66
nkf
77
rexml
8-
activesupport (7.2.2.1)
8+
activesupport (7.2.3.1)
99
base64
1010
benchmark (>= 0.3)
1111
bigdecimal
@@ -14,7 +14,7 @@ GEM
1414
drb
1515
i18n (>= 1.6, < 2)
1616
logger (>= 1.4.2)
17-
minitest (>= 5.1)
17+
minitest (>= 5.1, < 6)
1818
securerandom (>= 0.3)
1919
tzinfo (~> 2.0, >= 2.0.5)
2020
addressable (2.8.7)
@@ -23,7 +23,7 @@ GEM
2323
httpclient (~> 2.8, >= 2.8.3)
2424
json (>= 1.5.1)
2525
atomos (0.1.3)
26-
base64 (0.2.0)
26+
base64 (0.3.0)
2727
benchmark (0.4.0)
2828
bigdecimal (3.1.9)
2929
claide (1.1.0)
@@ -66,8 +66,8 @@ GEM
6666
cocoapods-try (1.2.0)
6767
colored2 (3.1.2)
6868
concurrent-ruby (1.3.3)
69-
connection_pool (2.5.2)
70-
drb (2.2.1)
69+
connection_pool (3.0.2)
70+
drb (2.2.3)
7171
escape (0.0.4)
7272
ethon (0.16.0)
7373
ffi (>= 1.15.0)
@@ -77,19 +77,19 @@ GEM
7777
gh_inspector (1.1.3)
7878
httpclient (2.9.0)
7979
mutex_m
80-
i18n (1.14.7)
80+
i18n (1.14.8)
8181
concurrent-ruby (~> 1.0)
8282
json (2.11.1)
8383
logger (1.7.0)
84-
minitest (5.25.5)
84+
minitest (5.27.0)
8585
molinillo (0.8.0)
8686
mutex_m (0.3.0)
8787
nanaimo (0.3.0)
8888
nap (1.1.0)
8989
netrc (0.11.0)
9090
nkf (0.2.0)
9191
public_suffix (4.0.7)
92-
rexml (3.4.1)
92+
rexml (3.4.2)
9393
ruby-macho (2.5.1)
9494
securerandom (0.4.1)
9595
typhoeus (1.4.1)

packages/docs-gesture-handler/yarn.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6356,11 +6356,11 @@ fast-uri@^3.0.1:
63566356
integrity sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==
63576357

63586358
fast-xml-parser@^4.0.12:
6359-
version "4.5.3"
6360-
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz#c54d6b35aa0f23dc1ea60b6c884340c006dc6efb"
6361-
integrity sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==
6359+
version "4.5.6"
6360+
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.6.tgz#4ff57d4aca13a2d11aa42ad460495cf00f32b655"
6361+
integrity sha512-Yd4vkROfJf8AuJrDIVMVmYfULKmIJszVsMv7Vo71aocsKgFxpdlpSHXSaInvyYfgw2PRuObQSW2GFpVMUjxu9A==
63626362
dependencies:
6363-
strnum "^1.1.1"
6363+
strnum "^1.0.5"
63646364

63656365
fastest-levenshtein@^1.0.12:
63666366
version "1.0.16"
@@ -8066,9 +8066,9 @@ lodash.uniq@^4.5.0:
80668066
integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==
80678067

80688068
lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.6.1:
8069-
version "4.17.21"
8070-
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
8071-
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
8069+
version "4.18.1"
8070+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.18.1.tgz#ff2b66c1f6326d59513de2407bf881439812771c"
8071+
integrity sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==
80728072

80738073
log-symbols@^4.1.0:
80748074
version "4.1.0"
@@ -8430,9 +8430,9 @@ mdast-util-phrasing@^4.0.0:
84308430
unist-util-is "^6.0.0"
84318431

84328432
mdast-util-to-hast@^13.0.0:
8433-
version "13.2.0"
8434-
resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz#5ca58e5b921cc0a3ded1bc02eed79a4fe4fe41f4"
8435-
integrity sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==
8433+
version "13.2.1"
8434+
resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz#d7ff84ca499a57e2c060ae67548ad950e689a053"
8435+
integrity sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==
84368436
dependencies:
84378437
"@types/hast" "^3.0.0"
84388438
"@types/mdast" "^4.0.0"
@@ -9771,9 +9771,9 @@ node-fetch@^2.2.0, node-fetch@^2.6.0, node-fetch@^2.7.0:
97719771
whatwg-url "^5.0.0"
97729772

97739773
node-forge@^1:
9774-
version "1.3.1"
9775-
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3"
9776-
integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==
9774+
version "1.4.0"
9775+
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.4.0.tgz#1c7b7d8bdc2d078739f58287d589d903a11b2fc2"
9776+
integrity sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==
97779777

97789778
node-int64@^0.4.0:
97799779
version "0.4.0"
@@ -10261,9 +10261,9 @@ picocolors@^1.0.0, picocolors@^1.1.1:
1026110261
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
1026210262

1026310263
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1:
10264-
version "2.3.1"
10265-
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
10266-
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
10264+
version "2.3.2"
10265+
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.2.tgz#5a942915e26b372dc0f0e6753149a16e6b1c5601"
10266+
integrity sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==
1026710267

1026810268
pify@^4.0.1:
1026910269
version "4.0.1"
@@ -12484,7 +12484,7 @@ strip-json-comments@~2.0.1:
1248412484
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
1248512485
integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==
1248612486

12487-
strnum@^1.1.1:
12487+
strnum@^1.0.5:
1248812488
version "1.1.2"
1248912489
resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.1.2.tgz#57bca4fbaa6f271081715dbc9ed7cee5493e28e4"
1249012490
integrity sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==

0 commit comments

Comments
 (0)