@vvedantb/native-ui 0.25.0 → 0.25.2
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.
- package/dist/ai/conversation-context.js +27 -0
- package/dist/ai/conversation.jsx +62 -52
- package/dist/ai/message-context-menu.jsx +414 -325
- package/dist/ai/message.jsx +98 -79
- package/dist/primitives/keyboard-controller.jsx +32 -26
- package/package.json +1 -1
- package/src/ai/conversation-context.ts +56 -0
- package/src/ai/conversation.tsx +12 -42
- package/src/ai/message-context-menu.tsx +80 -33
- package/src/ai/message.tsx +18 -5
- package/src/primitives/keyboard-controller.tsx +3 -0
- package/src/primitives/keyboard-parts.tsx +3 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
2
3
|
import { Modal, Pressable, StyleSheet, Text, View, useWindowDimensions } from "react-native";
|
|
3
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
5
|
import { cn } from "../cn";
|
|
@@ -21,10 +22,11 @@ import { MESSAGE_MENU, messageContextMenuLayout } from "./message-menu-layout";
|
|
|
21
22
|
* runs. `Message` opens it with `menu`.
|
|
22
23
|
*/
|
|
23
24
|
export function MessageContextMenu(t0) {
|
|
24
|
-
const $ = _c(
|
|
25
|
+
const $ = _c(78);
|
|
25
26
|
const {
|
|
26
27
|
open,
|
|
27
28
|
onClose,
|
|
29
|
+
onDismissed,
|
|
28
30
|
anchor,
|
|
29
31
|
align,
|
|
30
32
|
preview,
|
|
@@ -38,349 +40,436 @@ export function MessageContextMenu(t0) {
|
|
|
38
40
|
const largerText = useLargerText();
|
|
39
41
|
const reduceMotion = useReduceMotion();
|
|
40
42
|
const rowHeight = largerText ? 56 : 48;
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
let t2;
|
|
44
|
+
if ($[0] !== largerText) {
|
|
45
|
+
t2 = chatTextSize("body", largerText);
|
|
46
|
+
$[0] = largerText;
|
|
47
|
+
$[1] = t2;
|
|
48
|
+
} else {
|
|
49
|
+
t2 = $[1];
|
|
50
|
+
}
|
|
51
|
+
const body = t2;
|
|
52
|
+
if (!open || anchor === null) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const t3 = menu.actions.length * rowHeight;
|
|
56
|
+
const t4 = menu.reactions !== undefined;
|
|
57
|
+
let t5;
|
|
58
|
+
if ($[2] !== anchor || $[3] !== insets || $[4] !== t3 || $[5] !== t4 || $[6] !== window) {
|
|
59
|
+
t5 = messageContextMenuLayout({
|
|
60
|
+
anchor,
|
|
61
|
+
window,
|
|
62
|
+
insets,
|
|
63
|
+
menuHeight: t3,
|
|
64
|
+
hasReactions: t4
|
|
65
|
+
});
|
|
66
|
+
$[2] = anchor;
|
|
67
|
+
$[3] = insets;
|
|
68
|
+
$[4] = t3;
|
|
69
|
+
$[5] = t4;
|
|
70
|
+
$[6] = window;
|
|
71
|
+
$[7] = t5;
|
|
72
|
+
} else {
|
|
73
|
+
t5 = $[7];
|
|
74
|
+
}
|
|
75
|
+
const layout = t5;
|
|
76
|
+
let t6;
|
|
77
|
+
if ($[8] !== onClose) {
|
|
78
|
+
t6 = action => {
|
|
79
|
+
onClose();
|
|
80
|
+
action();
|
|
81
|
+
};
|
|
82
|
+
$[8] = onClose;
|
|
83
|
+
$[9] = t6;
|
|
84
|
+
} else {
|
|
85
|
+
t6 = $[9];
|
|
86
|
+
}
|
|
87
|
+
const run = t6;
|
|
88
|
+
let t7;
|
|
89
|
+
if ($[10] !== align || $[11] !== anchor.width || $[12] !== anchor.x || $[13] !== window.width) {
|
|
90
|
+
t7 = width => align === "end" ? {
|
|
91
|
+
left: Math.max(MESSAGE_MENU.edge, Math.min(anchor.x + anchor.width, window.width - MESSAGE_MENU.edge) - width)
|
|
92
|
+
} : {
|
|
93
|
+
left: Math.max(MESSAGE_MENU.edge, Math.min(anchor.x, window.width - MESSAGE_MENU.edge - width))
|
|
94
|
+
};
|
|
95
|
+
$[10] = align;
|
|
96
|
+
$[11] = anchor.width;
|
|
97
|
+
$[12] = anchor.x;
|
|
98
|
+
$[13] = window.width;
|
|
99
|
+
$[14] = t7;
|
|
100
|
+
} else {
|
|
101
|
+
t7 = $[14];
|
|
102
|
+
}
|
|
103
|
+
const side = t7;
|
|
104
|
+
const surface = tokens.color.surface[scheme];
|
|
105
|
+
let t8;
|
|
106
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
107
|
+
t8 = {
|
|
108
|
+
shadowColor: "#000",
|
|
109
|
+
shadowOpacity: 0.18,
|
|
110
|
+
shadowRadius: 16,
|
|
111
|
+
shadowOffset: {
|
|
112
|
+
width: 0,
|
|
113
|
+
height: 6
|
|
114
|
+
},
|
|
115
|
+
elevation: 8
|
|
116
|
+
};
|
|
117
|
+
$[15] = t8;
|
|
118
|
+
} else {
|
|
119
|
+
t8 = $[15];
|
|
120
|
+
}
|
|
121
|
+
const shadow = t8;
|
|
122
|
+
const pillWidth = Math.min(window.width - 2 * MESSAGE_MENU.edge, (menu.reactions?.items.length ?? 0) * 48 + 16);
|
|
123
|
+
const t9 = reduceMotion ? "none" : "fade";
|
|
44
124
|
let t10;
|
|
45
|
-
|
|
46
|
-
|
|
125
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
126
|
+
t10 = {
|
|
127
|
+
flex: 1
|
|
128
|
+
};
|
|
129
|
+
$[16] = t10;
|
|
130
|
+
} else {
|
|
131
|
+
t10 = $[16];
|
|
132
|
+
}
|
|
133
|
+
const t11 = `${testID}-backdrop`;
|
|
134
|
+
const t12 = tokens.color.background[scheme];
|
|
47
135
|
let t13;
|
|
136
|
+
if ($[17] !== t12) {
|
|
137
|
+
t13 = withAlpha(t12, 0.85);
|
|
138
|
+
$[17] = t12;
|
|
139
|
+
$[18] = t13;
|
|
140
|
+
} else {
|
|
141
|
+
t13 = $[18];
|
|
142
|
+
}
|
|
48
143
|
let t14;
|
|
144
|
+
if ($[19] !== t13) {
|
|
145
|
+
t14 = [StyleSheet.absoluteFill, {
|
|
146
|
+
backgroundColor: t13
|
|
147
|
+
}];
|
|
148
|
+
$[19] = t13;
|
|
149
|
+
$[20] = t14;
|
|
150
|
+
} else {
|
|
151
|
+
t14 = $[20];
|
|
152
|
+
}
|
|
49
153
|
let t15;
|
|
50
|
-
|
|
154
|
+
if ($[21] !== onClose || $[22] !== t11 || $[23] !== t14) {
|
|
155
|
+
t15 = <View style={StyleSheet.absoluteFill}><Pressable testID={t11} accessibilityRole="button" accessibilityLabel="Close menu" onPress={onClose} style={t14} /></View>;
|
|
156
|
+
$[21] = onClose;
|
|
157
|
+
$[22] = t11;
|
|
158
|
+
$[23] = t14;
|
|
159
|
+
$[24] = t15;
|
|
160
|
+
} else {
|
|
161
|
+
t15 = $[24];
|
|
162
|
+
}
|
|
163
|
+
const t16 = tokens.color.background[scheme];
|
|
51
164
|
let t17;
|
|
165
|
+
if ($[25] !== anchor.width || $[26] !== anchor.x || $[27] !== layout.previewHeight || $[28] !== layout.previewTop || $[29] !== t16) {
|
|
166
|
+
t17 = {
|
|
167
|
+
position: "absolute",
|
|
168
|
+
top: layout.previewTop,
|
|
169
|
+
left: anchor.x,
|
|
170
|
+
width: anchor.width,
|
|
171
|
+
height: layout.previewHeight,
|
|
172
|
+
overflow: "hidden",
|
|
173
|
+
backgroundColor: t16,
|
|
174
|
+
borderRadius: tokens.radius.card,
|
|
175
|
+
...shadow
|
|
176
|
+
};
|
|
177
|
+
$[25] = anchor.width;
|
|
178
|
+
$[26] = anchor.x;
|
|
179
|
+
$[27] = layout.previewHeight;
|
|
180
|
+
$[28] = layout.previewTop;
|
|
181
|
+
$[29] = t16;
|
|
182
|
+
$[30] = t17;
|
|
183
|
+
} else {
|
|
184
|
+
t17 = $[30];
|
|
185
|
+
}
|
|
186
|
+
let t18;
|
|
187
|
+
if ($[31] !== preview || $[32] !== t17) {
|
|
188
|
+
t18 = <View pointerEvents="none" style={t17}>{preview}</View>;
|
|
189
|
+
$[31] = preview;
|
|
190
|
+
$[32] = t17;
|
|
191
|
+
$[33] = t18;
|
|
192
|
+
} else {
|
|
193
|
+
t18 = $[33];
|
|
194
|
+
}
|
|
195
|
+
let t19;
|
|
196
|
+
if ($[34] !== layout.pillTop || $[35] !== menu.reactions || $[36] !== pillWidth || $[37] !== run || $[38] !== scheme || $[39] !== side || $[40] !== surface || $[41] !== testID) {
|
|
197
|
+
t19 = menu.reactions ? <View accessibilityRole="toolbar" style={{
|
|
198
|
+
position: "absolute",
|
|
199
|
+
top: layout.pillTop,
|
|
200
|
+
...side(pillWidth),
|
|
201
|
+
height: MESSAGE_MENU.pillHeight,
|
|
202
|
+
borderRadius: MESSAGE_MENU.pillHeight / 2,
|
|
203
|
+
backgroundColor: surface,
|
|
204
|
+
...shadow
|
|
205
|
+
}} className="flex-row items-center px-2">{menu.reactions.items.map(item => {
|
|
206
|
+
const selected = item.selected === true;
|
|
207
|
+
return <Pressable key={item.key} testID={`${testID}-reaction-${item.key}`} accessibilityRole="button" accessibilityLabel={item.label} accessibilityState={{
|
|
208
|
+
selected
|
|
209
|
+
}} onPress={() => run(() => menu.reactions?.onPress(item.key))} className="size-11 items-center justify-center rounded-full active:opacity-70" style={{
|
|
210
|
+
marginHorizontal: 2,
|
|
211
|
+
backgroundColor: selected ? withAlpha(palette.primary[scheme], 0.12) : "transparent"
|
|
212
|
+
}}>{item.render(selected)}</Pressable>;
|
|
213
|
+
})}</View> : null;
|
|
214
|
+
$[34] = layout.pillTop;
|
|
215
|
+
$[35] = menu.reactions;
|
|
216
|
+
$[36] = pillWidth;
|
|
217
|
+
$[37] = run;
|
|
218
|
+
$[38] = scheme;
|
|
219
|
+
$[39] = side;
|
|
220
|
+
$[40] = surface;
|
|
221
|
+
$[41] = testID;
|
|
222
|
+
$[42] = t19;
|
|
223
|
+
} else {
|
|
224
|
+
t19 = $[42];
|
|
225
|
+
}
|
|
226
|
+
const t20 = layout.menuTop;
|
|
227
|
+
let t21;
|
|
228
|
+
if ($[43] !== side) {
|
|
229
|
+
t21 = side(MESSAGE_MENU.menuWidth);
|
|
230
|
+
$[43] = side;
|
|
231
|
+
$[44] = t21;
|
|
232
|
+
} else {
|
|
233
|
+
t21 = $[44];
|
|
234
|
+
}
|
|
235
|
+
const t22 = window.width - 2 * MESSAGE_MENU.edge;
|
|
236
|
+
let t23;
|
|
237
|
+
if ($[45] !== layout.menuTop || $[46] !== surface || $[47] !== t21 || $[48] !== t22) {
|
|
238
|
+
t23 = {
|
|
239
|
+
position: "absolute",
|
|
240
|
+
top: t20,
|
|
241
|
+
...t21,
|
|
242
|
+
width: MESSAGE_MENU.menuWidth,
|
|
243
|
+
maxWidth: t22,
|
|
244
|
+
borderRadius: tokens.radius.card,
|
|
245
|
+
backgroundColor: surface,
|
|
246
|
+
overflow: "hidden",
|
|
247
|
+
...shadow
|
|
248
|
+
};
|
|
249
|
+
$[45] = layout.menuTop;
|
|
250
|
+
$[46] = surface;
|
|
251
|
+
$[47] = t21;
|
|
252
|
+
$[48] = t22;
|
|
253
|
+
$[49] = t23;
|
|
254
|
+
} else {
|
|
255
|
+
t23 = $[49];
|
|
256
|
+
}
|
|
257
|
+
let t24;
|
|
258
|
+
if ($[50] !== body || $[51] !== largerText || $[52] !== menu.actions || $[53] !== rowHeight || $[54] !== run || $[55] !== testID) {
|
|
259
|
+
let t25;
|
|
260
|
+
if ($[57] !== body || $[58] !== largerText || $[59] !== rowHeight || $[60] !== run || $[61] !== testID) {
|
|
261
|
+
t25 = (action_0, index) => <MenuCardRow key={action_0.key} testID={`${testID}-action-${action_0.key}`} action={action_0} first={index === 0} rowHeight={rowHeight} body={body} iconSize={largerText ? 22 : 20} onPress={() => run(action_0.onPress)} />;
|
|
262
|
+
$[57] = body;
|
|
263
|
+
$[58] = largerText;
|
|
264
|
+
$[59] = rowHeight;
|
|
265
|
+
$[60] = run;
|
|
266
|
+
$[61] = testID;
|
|
267
|
+
$[62] = t25;
|
|
268
|
+
} else {
|
|
269
|
+
t25 = $[62];
|
|
270
|
+
}
|
|
271
|
+
t24 = menu.actions.map(t25);
|
|
272
|
+
$[50] = body;
|
|
273
|
+
$[51] = largerText;
|
|
274
|
+
$[52] = menu.actions;
|
|
275
|
+
$[53] = rowHeight;
|
|
276
|
+
$[54] = run;
|
|
277
|
+
$[55] = testID;
|
|
278
|
+
$[56] = t24;
|
|
279
|
+
} else {
|
|
280
|
+
t24 = $[56];
|
|
281
|
+
}
|
|
282
|
+
let t25;
|
|
283
|
+
if ($[63] !== t23 || $[64] !== t24) {
|
|
284
|
+
t25 = <View accessibilityRole="menu" style={t23}>{t24}</View>;
|
|
285
|
+
$[63] = t23;
|
|
286
|
+
$[64] = t24;
|
|
287
|
+
$[65] = t25;
|
|
288
|
+
} else {
|
|
289
|
+
t25 = $[65];
|
|
290
|
+
}
|
|
291
|
+
let t26;
|
|
292
|
+
if ($[66] !== onClose || $[67] !== t15 || $[68] !== t18 || $[69] !== t19 || $[70] !== t25 || $[71] !== testID) {
|
|
293
|
+
t26 = <View style={t10} testID={testID} accessibilityViewIsModal={true} onAccessibilityEscape={onClose}>{t15}{t18}{t19}{t25}</View>;
|
|
294
|
+
$[66] = onClose;
|
|
295
|
+
$[67] = t15;
|
|
296
|
+
$[68] = t18;
|
|
297
|
+
$[69] = t19;
|
|
298
|
+
$[70] = t25;
|
|
299
|
+
$[71] = testID;
|
|
300
|
+
$[72] = t26;
|
|
301
|
+
} else {
|
|
302
|
+
t26 = $[72];
|
|
303
|
+
}
|
|
304
|
+
let t27;
|
|
305
|
+
if ($[73] !== onClose || $[74] !== onDismissed || $[75] !== t26 || $[76] !== t9) {
|
|
306
|
+
t27 = <Modal visible={true} transparent={true} animationType={t9} statusBarTranslucent={true} onRequestClose={onClose} onDismiss={onDismissed}>{t26}</Modal>;
|
|
307
|
+
$[73] = onClose;
|
|
308
|
+
$[74] = onDismissed;
|
|
309
|
+
$[75] = t26;
|
|
310
|
+
$[76] = t9;
|
|
311
|
+
$[77] = t27;
|
|
312
|
+
} else {
|
|
313
|
+
t27 = $[77];
|
|
314
|
+
}
|
|
315
|
+
return t27;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* One card row: label first, icon last. While pressed it takes the
|
|
320
|
+
* `SheetRow` pressed fill, so the finger sees which row it is on.
|
|
321
|
+
*/
|
|
322
|
+
function MenuCardRow(t0) {
|
|
323
|
+
const $ = _c(41);
|
|
324
|
+
const {
|
|
325
|
+
testID,
|
|
326
|
+
action,
|
|
327
|
+
first,
|
|
328
|
+
rowHeight,
|
|
329
|
+
body,
|
|
330
|
+
iconSize,
|
|
331
|
+
onPress
|
|
332
|
+
} = t0;
|
|
333
|
+
const scheme = useScheme();
|
|
334
|
+
const [pressed, setPressed] = useState(false);
|
|
335
|
+
const disabled = action.disabled === true;
|
|
336
|
+
const Icon = action.icon;
|
|
337
|
+
const color = action.destructive ? palette.danger[scheme] : tokens.color.foreground[scheme];
|
|
338
|
+
const t1 = action.label;
|
|
52
339
|
let t2;
|
|
340
|
+
if ($[0] !== disabled) {
|
|
341
|
+
t2 = {
|
|
342
|
+
disabled
|
|
343
|
+
};
|
|
344
|
+
$[0] = disabled;
|
|
345
|
+
$[1] = t2;
|
|
346
|
+
} else {
|
|
347
|
+
t2 = $[1];
|
|
348
|
+
}
|
|
53
349
|
let t3;
|
|
54
350
|
let t4;
|
|
55
|
-
|
|
56
|
-
|
|
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
|
+
}
|
|
360
|
+
const t5 = disabled ? 0.5 : 1;
|
|
361
|
+
const t6 = pressed && !disabled ? palette.default[scheme] : "transparent";
|
|
57
362
|
let t7;
|
|
363
|
+
if ($[4] !== rowHeight || $[5] !== t5 || $[6] !== t6) {
|
|
364
|
+
t7 = {
|
|
365
|
+
minHeight: rowHeight,
|
|
366
|
+
opacity: t5,
|
|
367
|
+
backgroundColor: t6
|
|
368
|
+
};
|
|
369
|
+
$[4] = rowHeight;
|
|
370
|
+
$[5] = t5;
|
|
371
|
+
$[6] = t6;
|
|
372
|
+
$[7] = t7;
|
|
373
|
+
} else {
|
|
374
|
+
t7 = $[7];
|
|
375
|
+
}
|
|
58
376
|
let t8;
|
|
377
|
+
if ($[8] !== first || $[9] !== scheme) {
|
|
378
|
+
t8 = !first && {
|
|
379
|
+
borderTopWidth: StyleSheet.hairlineWidth,
|
|
380
|
+
borderTopColor: tokens.color.separator[scheme]
|
|
381
|
+
};
|
|
382
|
+
$[8] = first;
|
|
383
|
+
$[9] = scheme;
|
|
384
|
+
$[10] = t8;
|
|
385
|
+
} else {
|
|
386
|
+
t8 = $[10];
|
|
387
|
+
}
|
|
59
388
|
let t9;
|
|
60
|
-
if ($[
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
$[33] = insets;
|
|
81
|
-
$[34] = t18;
|
|
82
|
-
$[35] = t19;
|
|
83
|
-
$[36] = window;
|
|
84
|
-
$[37] = t20;
|
|
85
|
-
} else {
|
|
86
|
-
t20 = $[37];
|
|
87
|
-
}
|
|
88
|
-
const layout = t20;
|
|
89
|
-
let t21;
|
|
90
|
-
if ($[38] !== onClose) {
|
|
91
|
-
t21 = action => {
|
|
92
|
-
onClose();
|
|
93
|
-
action();
|
|
94
|
-
};
|
|
95
|
-
$[38] = onClose;
|
|
96
|
-
$[39] = t21;
|
|
97
|
-
} else {
|
|
98
|
-
t21 = $[39];
|
|
99
|
-
}
|
|
100
|
-
const run = t21;
|
|
101
|
-
let t22;
|
|
102
|
-
if ($[40] !== align || $[41] !== anchor.width || $[42] !== anchor.x || $[43] !== window.width) {
|
|
103
|
-
t22 = width => align === "end" ? {
|
|
104
|
-
left: Math.max(MESSAGE_MENU.edge, Math.min(anchor.x + anchor.width, window.width - MESSAGE_MENU.edge) - width)
|
|
105
|
-
} : {
|
|
106
|
-
left: Math.max(MESSAGE_MENU.edge, Math.min(anchor.x, window.width - MESSAGE_MENU.edge - width))
|
|
107
|
-
};
|
|
108
|
-
$[40] = align;
|
|
109
|
-
$[41] = anchor.width;
|
|
110
|
-
$[42] = anchor.x;
|
|
111
|
-
$[43] = window.width;
|
|
112
|
-
$[44] = t22;
|
|
113
|
-
} else {
|
|
114
|
-
t22 = $[44];
|
|
115
|
-
}
|
|
116
|
-
const side = t22;
|
|
117
|
-
const surface = tokens.color.surface[scheme];
|
|
118
|
-
let t23;
|
|
119
|
-
if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
|
|
120
|
-
t23 = {
|
|
121
|
-
shadowColor: "#000",
|
|
122
|
-
shadowOpacity: 0.18,
|
|
123
|
-
shadowRadius: 16,
|
|
124
|
-
shadowOffset: {
|
|
125
|
-
width: 0,
|
|
126
|
-
height: 6
|
|
127
|
-
},
|
|
128
|
-
elevation: 8
|
|
129
|
-
};
|
|
130
|
-
$[45] = t23;
|
|
131
|
-
} else {
|
|
132
|
-
t23 = $[45];
|
|
133
|
-
}
|
|
134
|
-
const shadow = t23;
|
|
135
|
-
const pillWidth = Math.min(window.width - 2 * MESSAGE_MENU.edge, (menu.reactions?.items.length ?? 0) * 48 + 16);
|
|
136
|
-
T2 = Modal;
|
|
137
|
-
t12 = true;
|
|
138
|
-
t13 = true;
|
|
139
|
-
t14 = reduceMotion ? "none" : "fade";
|
|
140
|
-
t15 = true;
|
|
141
|
-
t16 = onClose;
|
|
142
|
-
T1 = View;
|
|
143
|
-
if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
|
|
144
|
-
t5 = {
|
|
145
|
-
flex: 1
|
|
146
|
-
};
|
|
147
|
-
$[46] = t5;
|
|
148
|
-
} else {
|
|
149
|
-
t5 = $[46];
|
|
150
|
-
}
|
|
151
|
-
t6 = testID;
|
|
152
|
-
t7 = true;
|
|
153
|
-
t8 = onClose;
|
|
154
|
-
const t24 = `${testID}-backdrop`;
|
|
155
|
-
const t25 = tokens.color.background[scheme];
|
|
156
|
-
let t26;
|
|
157
|
-
if ($[47] !== t25) {
|
|
158
|
-
t26 = withAlpha(t25, 0.85);
|
|
159
|
-
$[47] = t25;
|
|
160
|
-
$[48] = t26;
|
|
161
|
-
} else {
|
|
162
|
-
t26 = $[48];
|
|
163
|
-
}
|
|
164
|
-
let t27;
|
|
165
|
-
if ($[49] !== t26) {
|
|
166
|
-
t27 = [StyleSheet.absoluteFill, {
|
|
167
|
-
backgroundColor: t26
|
|
168
|
-
}];
|
|
169
|
-
$[49] = t26;
|
|
170
|
-
$[50] = t27;
|
|
171
|
-
} else {
|
|
172
|
-
t27 = $[50];
|
|
173
|
-
}
|
|
174
|
-
if ($[51] !== onClose || $[52] !== t24 || $[53] !== t27) {
|
|
175
|
-
t9 = <View style={StyleSheet.absoluteFill}><Pressable testID={t24} accessibilityRole="button" accessibilityLabel="Close menu" onPress={onClose} style={t27} /></View>;
|
|
176
|
-
$[51] = onClose;
|
|
177
|
-
$[52] = t24;
|
|
178
|
-
$[53] = t27;
|
|
179
|
-
$[54] = t9;
|
|
180
|
-
} else {
|
|
181
|
-
t9 = $[54];
|
|
182
|
-
}
|
|
183
|
-
let t28;
|
|
184
|
-
if ($[55] !== anchor.width || $[56] !== anchor.x || $[57] !== layout.previewHeight || $[58] !== layout.previewTop) {
|
|
185
|
-
t28 = {
|
|
186
|
-
position: "absolute",
|
|
187
|
-
top: layout.previewTop,
|
|
188
|
-
left: anchor.x,
|
|
189
|
-
width: anchor.width,
|
|
190
|
-
height: layout.previewHeight,
|
|
191
|
-
overflow: "hidden",
|
|
192
|
-
...shadow
|
|
193
|
-
};
|
|
194
|
-
$[55] = anchor.width;
|
|
195
|
-
$[56] = anchor.x;
|
|
196
|
-
$[57] = layout.previewHeight;
|
|
197
|
-
$[58] = layout.previewTop;
|
|
198
|
-
$[59] = t28;
|
|
199
|
-
} else {
|
|
200
|
-
t28 = $[59];
|
|
201
|
-
}
|
|
202
|
-
if ($[60] !== preview || $[61] !== t28) {
|
|
203
|
-
t10 = <View pointerEvents="none" style={t28}>{preview}</View>;
|
|
204
|
-
$[60] = preview;
|
|
205
|
-
$[61] = t28;
|
|
206
|
-
$[62] = t10;
|
|
207
|
-
} else {
|
|
208
|
-
t10 = $[62];
|
|
209
|
-
}
|
|
210
|
-
if ($[63] !== layout.pillTop || $[64] !== menu.reactions || $[65] !== pillWidth || $[66] !== run || $[67] !== scheme || $[68] !== side || $[69] !== surface || $[70] !== testID) {
|
|
211
|
-
t11 = menu.reactions ? <View accessibilityRole="toolbar" style={{
|
|
212
|
-
position: "absolute",
|
|
213
|
-
top: layout.pillTop,
|
|
214
|
-
...side(pillWidth),
|
|
215
|
-
height: MESSAGE_MENU.pillHeight,
|
|
216
|
-
borderRadius: MESSAGE_MENU.pillHeight / 2,
|
|
217
|
-
backgroundColor: surface,
|
|
218
|
-
...shadow
|
|
219
|
-
}} className="flex-row items-center px-2">{menu.reactions.items.map(item => {
|
|
220
|
-
const selected = item.selected === true;
|
|
221
|
-
return <Pressable key={item.key} testID={`${testID}-reaction-${item.key}`} accessibilityRole="button" accessibilityLabel={item.label} accessibilityState={{
|
|
222
|
-
selected
|
|
223
|
-
}} onPress={() => run(() => menu.reactions?.onPress(item.key))} className="size-11 items-center justify-center rounded-full active:opacity-70" style={{
|
|
224
|
-
marginHorizontal: 2,
|
|
225
|
-
backgroundColor: selected ? withAlpha(palette.primary[scheme], 0.12) : "transparent"
|
|
226
|
-
}}>{item.render(selected)}</Pressable>;
|
|
227
|
-
})}</View> : null;
|
|
228
|
-
$[63] = layout.pillTop;
|
|
229
|
-
$[64] = menu.reactions;
|
|
230
|
-
$[65] = pillWidth;
|
|
231
|
-
$[66] = run;
|
|
232
|
-
$[67] = scheme;
|
|
233
|
-
$[68] = side;
|
|
234
|
-
$[69] = surface;
|
|
235
|
-
$[70] = testID;
|
|
236
|
-
$[71] = t11;
|
|
237
|
-
} else {
|
|
238
|
-
t11 = $[71];
|
|
239
|
-
}
|
|
240
|
-
T0 = View;
|
|
241
|
-
t2 = "menu";
|
|
242
|
-
const t29 = layout.menuTop;
|
|
243
|
-
let t30;
|
|
244
|
-
if ($[72] !== side) {
|
|
245
|
-
t30 = side(MESSAGE_MENU.menuWidth);
|
|
246
|
-
$[72] = side;
|
|
247
|
-
$[73] = t30;
|
|
248
|
-
} else {
|
|
249
|
-
t30 = $[73];
|
|
250
|
-
}
|
|
251
|
-
const t31 = window.width - 2 * MESSAGE_MENU.edge;
|
|
252
|
-
if ($[74] !== layout.menuTop || $[75] !== surface || $[76] !== t30 || $[77] !== t31) {
|
|
253
|
-
t3 = {
|
|
254
|
-
position: "absolute",
|
|
255
|
-
top: t29,
|
|
256
|
-
...t30,
|
|
257
|
-
width: MESSAGE_MENU.menuWidth,
|
|
258
|
-
maxWidth: t31,
|
|
259
|
-
borderRadius: tokens.radius.card,
|
|
260
|
-
backgroundColor: surface,
|
|
261
|
-
overflow: "hidden",
|
|
262
|
-
...shadow
|
|
263
|
-
};
|
|
264
|
-
$[74] = layout.menuTop;
|
|
265
|
-
$[75] = surface;
|
|
266
|
-
$[76] = t30;
|
|
267
|
-
$[77] = t31;
|
|
268
|
-
$[78] = t3;
|
|
269
|
-
} else {
|
|
270
|
-
t3 = $[78];
|
|
271
|
-
}
|
|
272
|
-
t4 = menu.actions.map((action_0, index) => {
|
|
273
|
-
const Icon = action_0.icon;
|
|
274
|
-
const color = action_0.destructive ? palette.danger[scheme] : tokens.color.foreground[scheme];
|
|
275
|
-
return <Pressable key={action_0.key} testID={`${testID}-action-${action_0.key}`} accessibilityRole="menuitem" accessibilityLabel={action_0.label} accessibilityState={{
|
|
276
|
-
disabled: action_0.disabled === true
|
|
277
|
-
}} disabled={action_0.disabled === true} onPress={() => run(action_0.onPress)} className="flex-row items-center gap-3 px-4 active:opacity-70" style={[{
|
|
278
|
-
minHeight: rowHeight,
|
|
279
|
-
opacity: action_0.disabled ? 0.5 : 1
|
|
280
|
-
}, index > 0 && {
|
|
281
|
-
borderTopWidth: StyleSheet.hairlineWidth,
|
|
282
|
-
borderTopColor: tokens.color.separator[scheme]
|
|
283
|
-
}]}><Text numberOfLines={1} className={cn(body, "min-w-0 flex-1 font-instrument-sans")} style={[sizeStyle(body), typeStyle("medium"), {
|
|
284
|
-
color
|
|
285
|
-
}]}>{action_0.label}</Text>{Icon ? <Icon size={largerText ? 22 : 20} color={color} /> : null}</Pressable>;
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
$[0] = align;
|
|
289
|
-
$[1] = anchor;
|
|
290
|
-
$[2] = insets;
|
|
291
|
-
$[3] = largerText;
|
|
292
|
-
$[4] = menu;
|
|
293
|
-
$[5] = onClose;
|
|
294
|
-
$[6] = open;
|
|
295
|
-
$[7] = preview;
|
|
296
|
-
$[8] = reduceMotion;
|
|
297
|
-
$[9] = rowHeight;
|
|
298
|
-
$[10] = scheme;
|
|
299
|
-
$[11] = testID;
|
|
300
|
-
$[12] = window;
|
|
301
|
-
$[13] = T0;
|
|
302
|
-
$[14] = T1;
|
|
303
|
-
$[15] = T2;
|
|
304
|
-
$[16] = t10;
|
|
389
|
+
if ($[11] !== t7 || $[12] !== t8) {
|
|
390
|
+
t9 = [t7, t8];
|
|
391
|
+
$[11] = t7;
|
|
392
|
+
$[12] = t8;
|
|
393
|
+
$[13] = t9;
|
|
394
|
+
} else {
|
|
395
|
+
t9 = $[13];
|
|
396
|
+
}
|
|
397
|
+
let t10;
|
|
398
|
+
if ($[14] !== body) {
|
|
399
|
+
t10 = cn(body, "min-w-0 flex-1 font-instrument-sans");
|
|
400
|
+
$[14] = body;
|
|
401
|
+
$[15] = t10;
|
|
402
|
+
} else {
|
|
403
|
+
t10 = $[15];
|
|
404
|
+
}
|
|
405
|
+
let t11;
|
|
406
|
+
if ($[16] !== body) {
|
|
407
|
+
t11 = sizeStyle(body);
|
|
408
|
+
$[16] = body;
|
|
305
409
|
$[17] = t11;
|
|
306
|
-
$[18] = t12;
|
|
307
|
-
$[19] = t13;
|
|
308
|
-
$[20] = t14;
|
|
309
|
-
$[21] = t15;
|
|
310
|
-
$[22] = t16;
|
|
311
|
-
$[23] = t17;
|
|
312
|
-
$[24] = t2;
|
|
313
|
-
$[25] = t3;
|
|
314
|
-
$[26] = t4;
|
|
315
|
-
$[27] = t5;
|
|
316
|
-
$[28] = t6;
|
|
317
|
-
$[29] = t7;
|
|
318
|
-
$[30] = t8;
|
|
319
|
-
$[31] = t9;
|
|
320
410
|
} else {
|
|
321
|
-
T0 = $[13];
|
|
322
|
-
T1 = $[14];
|
|
323
|
-
T2 = $[15];
|
|
324
|
-
t10 = $[16];
|
|
325
411
|
t11 = $[17];
|
|
412
|
+
}
|
|
413
|
+
let t12;
|
|
414
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
415
|
+
t12 = typeStyle("medium");
|
|
416
|
+
$[18] = t12;
|
|
417
|
+
} else {
|
|
326
418
|
t12 = $[18];
|
|
327
|
-
t13 = $[19];
|
|
328
|
-
t14 = $[20];
|
|
329
|
-
t15 = $[21];
|
|
330
|
-
t16 = $[22];
|
|
331
|
-
t17 = $[23];
|
|
332
|
-
t2 = $[24];
|
|
333
|
-
t3 = $[25];
|
|
334
|
-
t4 = $[26];
|
|
335
|
-
t5 = $[27];
|
|
336
|
-
t6 = $[28];
|
|
337
|
-
t7 = $[29];
|
|
338
|
-
t8 = $[30];
|
|
339
|
-
t9 = $[31];
|
|
340
|
-
}
|
|
341
|
-
if (t17 !== Symbol.for("react.early_return_sentinel")) {
|
|
342
|
-
return t17;
|
|
343
419
|
}
|
|
344
|
-
let
|
|
345
|
-
if ($[
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[83] = t18;
|
|
420
|
+
let t13;
|
|
421
|
+
if ($[19] !== color) {
|
|
422
|
+
t13 = {
|
|
423
|
+
color
|
|
424
|
+
};
|
|
425
|
+
$[19] = color;
|
|
426
|
+
$[20] = t13;
|
|
352
427
|
} else {
|
|
353
|
-
|
|
428
|
+
t13 = $[20];
|
|
354
429
|
}
|
|
355
|
-
let
|
|
356
|
-
if ($[
|
|
357
|
-
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
|
|
362
|
-
$[
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
$[
|
|
430
|
+
let t14;
|
|
431
|
+
if ($[21] !== t11 || $[22] !== t13) {
|
|
432
|
+
t14 = [t11, t12, t13];
|
|
433
|
+
$[21] = t11;
|
|
434
|
+
$[22] = t13;
|
|
435
|
+
$[23] = t14;
|
|
436
|
+
} else {
|
|
437
|
+
t14 = $[23];
|
|
438
|
+
}
|
|
439
|
+
let t15;
|
|
440
|
+
if ($[24] !== action.label || $[25] !== t10 || $[26] !== t14) {
|
|
441
|
+
t15 = <Text numberOfLines={1} className={t10} style={t14}>{action.label}</Text>;
|
|
442
|
+
$[24] = action.label;
|
|
443
|
+
$[25] = t10;
|
|
444
|
+
$[26] = t14;
|
|
445
|
+
$[27] = t15;
|
|
446
|
+
} else {
|
|
447
|
+
t15 = $[27];
|
|
448
|
+
}
|
|
449
|
+
let t16;
|
|
450
|
+
if ($[28] !== Icon || $[29] !== color || $[30] !== iconSize) {
|
|
451
|
+
t16 = Icon ? <Icon size={iconSize} color={color} /> : null;
|
|
452
|
+
$[28] = Icon;
|
|
453
|
+
$[29] = color;
|
|
454
|
+
$[30] = iconSize;
|
|
455
|
+
$[31] = t16;
|
|
368
456
|
} else {
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
let
|
|
372
|
-
if ($[
|
|
373
|
-
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
457
|
+
t16 = $[31];
|
|
458
|
+
}
|
|
459
|
+
let t17;
|
|
460
|
+
if ($[32] !== action.label || $[33] !== disabled || $[34] !== onPress || $[35] !== t15 || $[36] !== t16 || $[37] !== t2 || $[38] !== t9 || $[39] !== testID) {
|
|
461
|
+
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;
|
|
465
|
+
$[35] = t15;
|
|
466
|
+
$[36] = t16;
|
|
467
|
+
$[37] = t2;
|
|
468
|
+
$[38] = t9;
|
|
469
|
+
$[39] = testID;
|
|
470
|
+
$[40] = t17;
|
|
382
471
|
} else {
|
|
383
|
-
|
|
472
|
+
t17 = $[40];
|
|
384
473
|
}
|
|
385
|
-
return
|
|
474
|
+
return t17;
|
|
386
475
|
}
|