@vvedantb/native-ui 0.25.2 → 0.26.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.
@@ -11,6 +11,7 @@ import { useLargerText } from "./theme";
11
11
  import { useReduceMotion } from "./useReduceMotion";
12
12
  import { useScheme } from "./useScheme";
13
13
  import { FLOATING_PILL_RADIUS, tabBarHeight, tabBarSlotStyle } from "./floating";
14
+ import { usePressed } from "./usePressed";
14
15
 
15
16
  /**
16
17
  * Space between the bar edge and the tabs, on every side of the active pill,
@@ -192,7 +193,7 @@ export function FloatingTabBar(t0) {
192
193
  * the caller's function.
193
194
  */
194
195
  function TabBarItem(t0) {
195
- const $ = _c(29);
196
+ const $ = _c(34);
196
197
  const {
197
198
  route,
198
199
  navigation,
@@ -204,6 +205,7 @@ function TabBarItem(t0) {
204
205
  testID,
205
206
  accessibilityLabel
206
207
  } = t0;
208
+ const press = usePressed();
207
209
  let t1;
208
210
  if ($[0] !== focused || $[1] !== navigation || $[2] !== route.key || $[3] !== route.name || $[4] !== route.params) {
209
211
  t1 = () => {
@@ -237,71 +239,87 @@ function TabBarItem(t0) {
237
239
  } else {
238
240
  t2 = $[7];
239
241
  }
240
- let t3;
241
- if ($[8] !== color || $[9] !== focused || $[10] !== largerText || $[11] !== renderIcon) {
242
- t3 = renderIcon ? renderIcon({
242
+ const t3 = press.onPressIn;
243
+ const t4 = press.onPressOut;
244
+ const t5 = press.pressed ? 0.7 : 1;
245
+ let t6;
246
+ if ($[8] !== t5) {
247
+ t6 = {
248
+ opacity: t5
249
+ };
250
+ $[8] = t5;
251
+ $[9] = t6;
252
+ } else {
253
+ t6 = $[9];
254
+ }
255
+ let t7;
256
+ if ($[10] !== color || $[11] !== focused || $[12] !== largerText || $[13] !== renderIcon) {
257
+ t7 = renderIcon ? renderIcon({
243
258
  focused,
244
259
  color,
245
260
  size: largerText ? 28 : 24
246
261
  }) : null;
247
- $[8] = color;
248
- $[9] = focused;
249
- $[10] = largerText;
250
- $[11] = renderIcon;
251
- $[12] = t3;
262
+ $[10] = color;
263
+ $[11] = focused;
264
+ $[12] = largerText;
265
+ $[13] = renderIcon;
266
+ $[14] = t7;
252
267
  } else {
253
- t3 = $[12];
268
+ t7 = $[14];
254
269
  }
255
- const t4 = `font-instrument-sans-semibold ${largerText ? "text-base" : "text-sm"}`;
256
- let t5;
257
- if ($[13] !== color) {
258
- t5 = {
270
+ const t8 = `font-instrument-sans-semibold ${largerText ? "text-base" : "text-sm"}`;
271
+ let t9;
272
+ if ($[15] !== color) {
273
+ t9 = {
259
274
  color
260
275
  };
261
- $[13] = color;
262
- $[14] = t5;
276
+ $[15] = color;
277
+ $[16] = t9;
263
278
  } else {
264
- t5 = $[14];
279
+ t9 = $[16];
265
280
  }
266
- let t6;
267
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
268
- t6 = typeStyle("semibold");
269
- $[15] = t6;
281
+ let t10;
282
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
283
+ t10 = typeStyle("semibold");
284
+ $[17] = t10;
270
285
  } else {
271
- t6 = $[15];
286
+ t10 = $[17];
272
287
  }
273
- let t7;
274
- if ($[16] !== t5) {
275
- t7 = [t5, t6];
276
- $[16] = t5;
277
- $[17] = t7;
288
+ let t11;
289
+ if ($[18] !== t9) {
290
+ t11 = [t9, t10];
291
+ $[18] = t9;
292
+ $[19] = t11;
278
293
  } else {
279
- t7 = $[17];
294
+ t11 = $[19];
280
295
  }
281
- let t8;
282
- if ($[18] !== label || $[19] !== t4 || $[20] !== t7) {
283
- t8 = <Text numberOfLines={1} maxFontSizeMultiplier={1.5} className={t4} style={t7}>{label}</Text>;
284
- $[18] = label;
285
- $[19] = t4;
286
- $[20] = t7;
287
- $[21] = t8;
296
+ let t12;
297
+ if ($[20] !== label || $[21] !== t11 || $[22] !== t8) {
298
+ t12 = <Text numberOfLines={1} maxFontSizeMultiplier={1.5} className={t8} style={t11}>{label}</Text>;
299
+ $[20] = label;
300
+ $[21] = t11;
301
+ $[22] = t8;
302
+ $[23] = t12;
288
303
  } else {
289
- t8 = $[21];
304
+ t12 = $[23];
290
305
  }
291
- let t9;
292
- if ($[22] !== accessibilityLabel || $[23] !== onPress || $[24] !== t2 || $[25] !== t3 || $[26] !== t8 || $[27] !== testID) {
293
- t9 = <Pressable testID={testID} accessibilityRole="tab" accessibilityState={t2} accessibilityLabel={accessibilityLabel} onPress={onPress} className="min-h-12 min-w-12 flex-1 items-center justify-center gap-1" style={_temp}>{t3}{t8}</Pressable>;
294
- $[22] = accessibilityLabel;
295
- $[23] = onPress;
296
- $[24] = t2;
297
- $[25] = t3;
298
- $[26] = t8;
299
- $[27] = testID;
300
- $[28] = t9;
306
+ let t13;
307
+ if ($[24] !== accessibilityLabel || $[25] !== onPress || $[26] !== press.onPressIn || $[27] !== press.onPressOut || $[28] !== t12 || $[29] !== t2 || $[30] !== t6 || $[31] !== t7 || $[32] !== testID) {
308
+ t13 = <Pressable testID={testID} accessibilityRole="tab" accessibilityState={t2} accessibilityLabel={accessibilityLabel} onPress={onPress} onPressIn={t3} onPressOut={t4} className="min-h-12 min-w-12 flex-1 items-center justify-center gap-1" style={t6}>{t7}{t12}</Pressable>;
309
+ $[24] = accessibilityLabel;
310
+ $[25] = onPress;
311
+ $[26] = press.onPressIn;
312
+ $[27] = press.onPressOut;
313
+ $[28] = t12;
314
+ $[29] = t2;
315
+ $[30] = t6;
316
+ $[31] = t7;
317
+ $[32] = testID;
318
+ $[33] = t13;
301
319
  } else {
302
- t9 = $[28];
320
+ t13 = $[33];
303
321
  }
304
- return t9;
322
+ return t13;
305
323
  }
306
324
 
307
325
  /**
@@ -313,14 +331,6 @@ function TabBarItem(t0) {
313
331
  * and moves at once with Reduce Motion. Behind the tablist, so assistive tech
314
332
  * reads only the tabs.
315
333
  */
316
- function _temp(t0) {
317
- const {
318
- pressed
319
- } = t0;
320
- return {
321
- opacity: pressed ? 0.7 : 1
322
- };
323
- }
324
334
  function ActiveTabPill(t0) {
325
335
  const $ = _c(14);
326
336
  const {
package/dist/SheetRow.jsx CHANGED
@@ -7,6 +7,7 @@ import { palette } from "./palette";
7
7
  import { useLargerText } from "./theme";
8
8
  import { tokens } from "./tokens";
9
9
  import { useScheme } from "./useScheme";
10
+ import { usePressed } from "./usePressed";
10
11
  /**
11
12
  * One action in a `Sheet` or bottom sheet, a touch size of the web menu item:
12
13
  * icon (or another `leading` mark), title and optional detail, at least 56 high (64 with larger text) with
@@ -16,7 +17,7 @@ import { useScheme } from "./useScheme";
16
17
  * item, and ignores presses.
17
18
  */
18
19
  export function SheetRow(t0) {
19
- const $ = _c(52);
20
+ const $ = _c(53);
20
21
  const {
21
22
  icon: Icon,
22
23
  leading,
@@ -34,6 +35,7 @@ export function SheetRow(t0) {
34
35
  const danger = t2 === undefined ? false : t2;
35
36
  const warning = t3 === undefined ? false : t3;
36
37
  const disabled = t4 === undefined ? false : t4;
38
+ const press = usePressed();
37
39
  const scheme = useScheme();
38
40
  const largerText = useLargerText();
39
41
  const color = danger ? palette.danger[scheme] : warning ? palette.warning[scheme] : tokens.color.foreground[scheme];
@@ -66,133 +68,132 @@ export function SheetRow(t0) {
66
68
  } else {
67
69
  t9 = $[5];
68
70
  }
69
- let t10;
70
- if ($[6] !== disabled || $[7] !== scheme) {
71
- t10 = t11 => {
72
- const {
73
- pressed
74
- } = t11;
75
- return {
76
- borderRadius: tokens.radius.sm,
77
- backgroundColor: pressed && !disabled ? palette.default[scheme] : "transparent"
78
- };
79
- };
80
- $[6] = disabled;
81
- $[7] = scheme;
82
- $[8] = t10;
83
- } else {
84
- t10 = $[8];
85
- }
86
- let t11;
87
- if ($[9] !== Icon || $[10] !== color || $[11] !== iconSize || $[12] !== leading) {
88
- t11 = leading ?? (Icon ? <Icon size={iconSize} color={color} /> : null);
89
- $[9] = Icon;
90
- $[10] = color;
91
- $[11] = iconSize;
92
- $[12] = leading;
93
- $[13] = t11;
94
- } else {
95
- t11 = $[13];
96
- }
97
- let t12;
98
- if ($[14] !== titleSize) {
99
- t12 = cn("font-instrument-sans-medium", titleSize);
100
- $[14] = titleSize;
101
- $[15] = t12;
102
- } else {
103
- t12 = $[15];
104
- }
71
+ const t10 = press.onPressIn;
72
+ const t11 = press.onPressOut;
73
+ const t12 = press.pressed && !disabled ? palette.default[scheme] : "transparent";
105
74
  let t13;
106
- if ($[16] !== color) {
75
+ if ($[6] !== t12) {
107
76
  t13 = {
108
- color
77
+ borderRadius: tokens.radius.sm,
78
+ backgroundColor: t12
109
79
  };
110
- $[16] = color;
111
- $[17] = t13;
80
+ $[6] = t12;
81
+ $[7] = t13;
112
82
  } else {
113
- t13 = $[17];
83
+ t13 = $[7];
114
84
  }
115
85
  let t14;
116
- if ($[18] !== titleSize) {
117
- t14 = sizeStyle(titleSize);
118
- $[18] = titleSize;
119
- $[19] = t14;
86
+ if ($[8] !== Icon || $[9] !== color || $[10] !== iconSize || $[11] !== leading) {
87
+ t14 = leading ?? (Icon ? <Icon size={iconSize} color={color} /> : null);
88
+ $[8] = Icon;
89
+ $[9] = color;
90
+ $[10] = iconSize;
91
+ $[11] = leading;
92
+ $[12] = t14;
120
93
  } else {
121
- t14 = $[19];
94
+ t14 = $[12];
122
95
  }
123
96
  let t15;
124
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
125
- t15 = typeStyle("medium");
126
- $[20] = t15;
97
+ if ($[13] !== titleSize) {
98
+ t15 = cn("font-instrument-sans-medium", titleSize);
99
+ $[13] = titleSize;
100
+ $[14] = t15;
127
101
  } else {
128
- t15 = $[20];
102
+ t15 = $[14];
129
103
  }
130
104
  let t16;
131
- if ($[21] !== t13 || $[22] !== t14) {
132
- t16 = [t13, t14, t15];
133
- $[21] = t13;
134
- $[22] = t14;
135
- $[23] = t16;
105
+ if ($[15] !== color) {
106
+ t16 = {
107
+ color
108
+ };
109
+ $[15] = color;
110
+ $[16] = t16;
136
111
  } else {
137
- t16 = $[23];
112
+ t16 = $[16];
138
113
  }
139
114
  let t17;
140
- if ($[24] !== t12 || $[25] !== t16 || $[26] !== title) {
141
- t17 = <Text className={t12} style={t16}>{title}</Text>;
142
- $[24] = t12;
143
- $[25] = t16;
144
- $[26] = title;
145
- $[27] = t17;
115
+ if ($[17] !== titleSize) {
116
+ t17 = sizeStyle(titleSize);
117
+ $[17] = titleSize;
118
+ $[18] = t17;
146
119
  } else {
147
- t17 = $[27];
120
+ t17 = $[18];
148
121
  }
149
122
  let t18;
150
- if ($[28] !== detail || $[29] !== detailSize || $[30] !== scheme) {
151
- t18 = detail ? <Text className={cn("font-instrument-sans", detailSize)} style={[textStyle("muted", scheme), sizeStyle(detailSize)]}>{detail}</Text> : null;
152
- $[28] = detail;
153
- $[29] = detailSize;
154
- $[30] = scheme;
155
- $[31] = t18;
123
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
124
+ t18 = typeStyle("medium");
125
+ $[19] = t18;
156
126
  } else {
157
- t18 = $[31];
127
+ t18 = $[19];
158
128
  }
159
129
  let t19;
160
- if ($[32] !== t17 || $[33] !== t18) {
161
- t19 = <View className="min-w-0 flex-1">{t17}{t18}</View>;
162
- $[32] = t17;
163
- $[33] = t18;
164
- $[34] = t19;
130
+ if ($[20] !== t16 || $[21] !== t17) {
131
+ t19 = [t16, t17, t18];
132
+ $[20] = t16;
133
+ $[21] = t17;
134
+ $[22] = t19;
165
135
  } else {
166
- t19 = $[34];
136
+ t19 = $[22];
167
137
  }
168
138
  let t20;
169
- if ($[35] !== active || $[36] !== color || $[37] !== iconSize) {
170
- t20 = active ? <IconCheck size={iconSize} color={color} strokeWidth={2} /> : null;
171
- $[35] = active;
172
- $[36] = color;
173
- $[37] = iconSize;
174
- $[38] = t20;
139
+ if ($[23] !== t15 || $[24] !== t19 || $[25] !== title) {
140
+ t20 = <Text className={t15} style={t19}>{title}</Text>;
141
+ $[23] = t15;
142
+ $[24] = t19;
143
+ $[25] = title;
144
+ $[26] = t20;
175
145
  } else {
176
- t20 = $[38];
146
+ t20 = $[26];
177
147
  }
178
148
  let t21;
179
- if ($[39] !== detail || $[40] !== disabled || $[41] !== onPress || $[42] !== t10 || $[43] !== t11 || $[44] !== t19 || $[45] !== t20 || $[46] !== t5 || $[47] !== t6 || $[48] !== t9 || $[49] !== testID || $[50] !== title) {
180
- t21 = <Pressable testID={testID} accessibilityRole={t5} accessibilityLabel={title} accessibilityHint={detail} accessibilityState={t6} disabled={disabled} onPress={onPress} className={t9} style={t10}>{t11}{t19}{t20}</Pressable>;
181
- $[39] = detail;
182
- $[40] = disabled;
183
- $[41] = onPress;
184
- $[42] = t10;
185
- $[43] = t11;
186
- $[44] = t19;
187
- $[45] = t20;
188
- $[46] = t5;
189
- $[47] = t6;
190
- $[48] = t9;
191
- $[49] = testID;
192
- $[50] = title;
193
- $[51] = t21;
149
+ if ($[27] !== detail || $[28] !== detailSize || $[29] !== scheme) {
150
+ t21 = detail ? <Text className={cn("font-instrument-sans", detailSize)} style={[textStyle("muted", scheme), sizeStyle(detailSize)]}>{detail}</Text> : null;
151
+ $[27] = detail;
152
+ $[28] = detailSize;
153
+ $[29] = scheme;
154
+ $[30] = t21;
155
+ } else {
156
+ t21 = $[30];
157
+ }
158
+ let t22;
159
+ if ($[31] !== t20 || $[32] !== t21) {
160
+ t22 = <View className="min-w-0 flex-1">{t20}{t21}</View>;
161
+ $[31] = t20;
162
+ $[32] = t21;
163
+ $[33] = t22;
164
+ } else {
165
+ t22 = $[33];
166
+ }
167
+ let t23;
168
+ if ($[34] !== active || $[35] !== color || $[36] !== iconSize) {
169
+ t23 = active ? <IconCheck size={iconSize} color={color} strokeWidth={2} /> : null;
170
+ $[34] = active;
171
+ $[35] = color;
172
+ $[36] = iconSize;
173
+ $[37] = t23;
174
+ } else {
175
+ t23 = $[37];
176
+ }
177
+ let t24;
178
+ if ($[38] !== detail || $[39] !== disabled || $[40] !== onPress || $[41] !== press.onPressIn || $[42] !== press.onPressOut || $[43] !== t13 || $[44] !== t14 || $[45] !== t22 || $[46] !== t23 || $[47] !== t5 || $[48] !== t6 || $[49] !== t9 || $[50] !== testID || $[51] !== title) {
179
+ t24 = <Pressable testID={testID} accessibilityRole={t5} accessibilityLabel={title} accessibilityHint={detail} accessibilityState={t6} disabled={disabled} onPress={onPress} className={t9} onPressIn={t10} onPressOut={t11} style={t13}>{t14}{t22}{t23}</Pressable>;
180
+ $[38] = detail;
181
+ $[39] = disabled;
182
+ $[40] = onPress;
183
+ $[41] = press.onPressIn;
184
+ $[42] = press.onPressOut;
185
+ $[43] = t13;
186
+ $[44] = t14;
187
+ $[45] = t22;
188
+ $[46] = t23;
189
+ $[47] = t5;
190
+ $[48] = t6;
191
+ $[49] = t9;
192
+ $[50] = testID;
193
+ $[51] = title;
194
+ $[52] = t24;
194
195
  } else {
195
- t21 = $[51];
196
+ t24 = $[52];
196
197
  }
197
- return t21;
198
+ return t24;
198
199
  }
@@ -1,5 +1,4 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useState } from "react";
3
2
  import { Modal, Pressable, StyleSheet, Text, View, useWindowDimensions } from "react-native";
4
3
  import { useSafeAreaInsets } from "react-native-safe-area-context";
5
4
  import { cn } from "../cn";
@@ -11,6 +10,7 @@ import { useReduceMotion } from "../useReduceMotion";
11
10
  import { useScheme } from "../useScheme";
12
11
  import { chatTextSize } from "./chat-text";
13
12
  import { MESSAGE_MENU, messageContextMenuLayout } from "./message-menu-layout";
13
+ import { usePressed } from "../usePressed";
14
14
 
15
15
  /**
16
16
  * The iMessage hold menu for a chat message: the chat fades under a frosted
@@ -331,7 +331,7 @@ function MenuCardRow(t0) {
331
331
  onPress
332
332
  } = t0;
333
333
  const scheme = useScheme();
334
- const [pressed, setPressed] = useState(false);
334
+ const press = usePressed();
335
335
  const disabled = action.disabled === true;
336
336
  const Icon = action.icon;
337
337
  const color = action.destructive ? palette.danger[scheme] : tokens.color.foreground[scheme];
@@ -346,122 +346,115 @@ function MenuCardRow(t0) {
346
346
  } else {
347
347
  t2 = $[1];
348
348
  }
349
- let t3;
350
- let t4;
351
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
352
- t3 = () => setPressed(true);
353
- t4 = () => setPressed(false);
354
- $[2] = t3;
355
- $[3] = t4;
356
- } else {
357
- t3 = $[2];
358
- t4 = $[3];
359
- }
349
+ const t3 = press.onPressIn;
350
+ const t4 = press.onPressOut;
360
351
  const t5 = disabled ? 0.5 : 1;
361
- const t6 = pressed && !disabled ? palette.default[scheme] : "transparent";
352
+ const t6 = press.pressed && !disabled ? palette.default[scheme] : "transparent";
362
353
  let t7;
363
- if ($[4] !== rowHeight || $[5] !== t5 || $[6] !== t6) {
354
+ if ($[2] !== rowHeight || $[3] !== t5 || $[4] !== t6) {
364
355
  t7 = {
365
356
  minHeight: rowHeight,
366
357
  opacity: t5,
367
358
  backgroundColor: t6
368
359
  };
369
- $[4] = rowHeight;
370
- $[5] = t5;
371
- $[6] = t6;
372
- $[7] = t7;
360
+ $[2] = rowHeight;
361
+ $[3] = t5;
362
+ $[4] = t6;
363
+ $[5] = t7;
373
364
  } else {
374
- t7 = $[7];
365
+ t7 = $[5];
375
366
  }
376
367
  let t8;
377
- if ($[8] !== first || $[9] !== scheme) {
368
+ if ($[6] !== first || $[7] !== scheme) {
378
369
  t8 = !first && {
379
370
  borderTopWidth: StyleSheet.hairlineWidth,
380
371
  borderTopColor: tokens.color.separator[scheme]
381
372
  };
382
- $[8] = first;
383
- $[9] = scheme;
384
- $[10] = t8;
373
+ $[6] = first;
374
+ $[7] = scheme;
375
+ $[8] = t8;
385
376
  } else {
386
- t8 = $[10];
377
+ t8 = $[8];
387
378
  }
388
379
  let t9;
389
- if ($[11] !== t7 || $[12] !== t8) {
380
+ if ($[9] !== t7 || $[10] !== t8) {
390
381
  t9 = [t7, t8];
391
- $[11] = t7;
392
- $[12] = t8;
393
- $[13] = t9;
382
+ $[9] = t7;
383
+ $[10] = t8;
384
+ $[11] = t9;
394
385
  } else {
395
- t9 = $[13];
386
+ t9 = $[11];
396
387
  }
397
388
  let t10;
398
- if ($[14] !== body) {
389
+ if ($[12] !== body) {
399
390
  t10 = cn(body, "min-w-0 flex-1 font-instrument-sans");
400
- $[14] = body;
401
- $[15] = t10;
391
+ $[12] = body;
392
+ $[13] = t10;
402
393
  } else {
403
- t10 = $[15];
394
+ t10 = $[13];
404
395
  }
405
396
  let t11;
406
- if ($[16] !== body) {
397
+ if ($[14] !== body) {
407
398
  t11 = sizeStyle(body);
408
- $[16] = body;
409
- $[17] = t11;
399
+ $[14] = body;
400
+ $[15] = t11;
410
401
  } else {
411
- t11 = $[17];
402
+ t11 = $[15];
412
403
  }
413
404
  let t12;
414
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
405
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
415
406
  t12 = typeStyle("medium");
416
- $[18] = t12;
407
+ $[16] = t12;
417
408
  } else {
418
- t12 = $[18];
409
+ t12 = $[16];
419
410
  }
420
411
  let t13;
421
- if ($[19] !== color) {
412
+ if ($[17] !== color) {
422
413
  t13 = {
423
414
  color
424
415
  };
425
- $[19] = color;
426
- $[20] = t13;
416
+ $[17] = color;
417
+ $[18] = t13;
427
418
  } else {
428
- t13 = $[20];
419
+ t13 = $[18];
429
420
  }
430
421
  let t14;
431
- if ($[21] !== t11 || $[22] !== t13) {
422
+ if ($[19] !== t11 || $[20] !== t13) {
432
423
  t14 = [t11, t12, t13];
433
- $[21] = t11;
434
- $[22] = t13;
435
- $[23] = t14;
424
+ $[19] = t11;
425
+ $[20] = t13;
426
+ $[21] = t14;
436
427
  } else {
437
- t14 = $[23];
428
+ t14 = $[21];
438
429
  }
439
430
  let t15;
440
- if ($[24] !== action.label || $[25] !== t10 || $[26] !== t14) {
431
+ if ($[22] !== action.label || $[23] !== t10 || $[24] !== t14) {
441
432
  t15 = <Text numberOfLines={1} className={t10} style={t14}>{action.label}</Text>;
442
- $[24] = action.label;
443
- $[25] = t10;
444
- $[26] = t14;
445
- $[27] = t15;
433
+ $[22] = action.label;
434
+ $[23] = t10;
435
+ $[24] = t14;
436
+ $[25] = t15;
446
437
  } else {
447
- t15 = $[27];
438
+ t15 = $[25];
448
439
  }
449
440
  let t16;
450
- if ($[28] !== Icon || $[29] !== color || $[30] !== iconSize) {
441
+ if ($[26] !== Icon || $[27] !== color || $[28] !== iconSize) {
451
442
  t16 = Icon ? <Icon size={iconSize} color={color} /> : null;
452
- $[28] = Icon;
453
- $[29] = color;
454
- $[30] = iconSize;
455
- $[31] = t16;
443
+ $[26] = Icon;
444
+ $[27] = color;
445
+ $[28] = iconSize;
446
+ $[29] = t16;
456
447
  } else {
457
- t16 = $[31];
448
+ t16 = $[29];
458
449
  }
459
450
  let t17;
460
- if ($[32] !== action.label || $[33] !== disabled || $[34] !== onPress || $[35] !== t15 || $[36] !== t16 || $[37] !== t2 || $[38] !== t9 || $[39] !== testID) {
451
+ if ($[30] !== action.label || $[31] !== disabled || $[32] !== onPress || $[33] !== press.onPressIn || $[34] !== press.onPressOut || $[35] !== t15 || $[36] !== t16 || $[37] !== t2 || $[38] !== t9 || $[39] !== testID) {
461
452
  t17 = <Pressable testID={testID} accessibilityRole="menuitem" accessibilityLabel={t1} accessibilityState={t2} disabled={disabled} onPress={onPress} onPressIn={t3} onPressOut={t4} className="flex-row items-center gap-3 px-4" style={t9}>{t15}{t16}</Pressable>;
462
- $[32] = action.label;
463
- $[33] = disabled;
464
- $[34] = onPress;
453
+ $[30] = action.label;
454
+ $[31] = disabled;
455
+ $[32] = onPress;
456
+ $[33] = press.onPressIn;
457
+ $[34] = press.onPressOut;
465
458
  $[35] = t15;
466
459
  $[36] = t16;
467
460
  $[37] = t2;
@@ -17,6 +17,7 @@ import { MESSAGE_ACTIONS_TITLE, MessageActionSheet } from "./message-action-shee
17
17
  import { useOptionalConversation } from "./conversation-context";
18
18
  import { MessageContextMenu } from "./message-context-menu";
19
19
  import { ChatTextColorContext, ResponseText } from "./response-text";
20
+ import { usePressed } from "../usePressed";
20
21
  const MessageContext = createContext("assistant");
21
22
 
22
23
  /** The bot behind an incoming message in a group chat. */
@@ -178,7 +179,7 @@ export function Message(t0) {
178
179
  const highlighted = t1 === undefined ? false : t1;
179
180
  const user = from === "user";
180
181
  const [sheetOpen, setSheetOpen] = useState(false);
181
- const [pressing, setPressing] = useState(false);
182
+ const press = usePressed();
182
183
  const [held, setHeld] = useState(null);
183
184
  const pressable = useRef(null);
184
185
  const hasActions = actions != null && actions.length > 0;
@@ -290,8 +291,8 @@ export function Message(t0) {
290
291
  }
291
292
  const parts = t11;
292
293
  let t12;
293
- if ($[36] !== actionSheetTitle || $[37] !== actions || $[38] !== closeMenu || $[39] !== conversation?.settleOverlay || $[40] !== from || $[41] !== hasActions || $[42] !== held || $[43] !== layout || $[44] !== longPress || $[45] !== longPressable || $[46] !== menu || $[47] !== merged || $[48] !== parts || $[49] !== pressing || $[50] !== props || $[51] !== sheetOpen || $[52] !== user) {
294
- t12 = longPressable ? <><Pressable ref={pressable} accessible={false} className={merged} style={[layout, pressing ? HELD_STYLE : null]} onPressIn={() => setPressing(true)} onPressOut={() => setPressing(false)} onLongPress={longPress} delayLongPress={HOLD_DELAY_MS} accessibilityActions={[{
294
+ if ($[36] !== actionSheetTitle || $[37] !== actions || $[38] !== closeMenu || $[39] !== conversation?.settleOverlay || $[40] !== from || $[41] !== hasActions || $[42] !== held || $[43] !== layout || $[44] !== longPress || $[45] !== longPressable || $[46] !== menu || $[47] !== merged || $[48] !== parts || $[49] !== press || $[50] !== props || $[51] !== sheetOpen || $[52] !== user) {
295
+ t12 = longPressable ? <><Pressable ref={pressable} accessible={false} className={merged} style={[layout, press.pressed ? HELD_STYLE : null]} onPressIn={press.onPressIn} onPressOut={press.onPressOut} onLongPress={longPress} delayLongPress={HOLD_DELAY_MS} accessibilityActions={[{
295
296
  name: "longpress",
296
297
  label: actionSheetTitle ?? MESSAGE_ACTIONS_TITLE
297
298
  }]} onAccessibilityAction={event => {
@@ -317,7 +318,7 @@ export function Message(t0) {
317
318
  $[46] = menu;
318
319
  $[47] = merged;
319
320
  $[48] = parts;
320
- $[49] = pressing;
321
+ $[49] = press;
321
322
  $[50] = props;
322
323
  $[51] = sheetOpen;
323
324
  $[52] = user;