@vvedantb/native-ui 0.25.0 → 0.25.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.
|
@@ -21,7 +21,7 @@ import { MESSAGE_MENU, messageContextMenuLayout } from "./message-menu-layout";
|
|
|
21
21
|
* runs. `Message` opens it with `menu`.
|
|
22
22
|
*/
|
|
23
23
|
export function MessageContextMenu(t0) {
|
|
24
|
-
const $ = _c(
|
|
24
|
+
const $ = _c(103);
|
|
25
25
|
const {
|
|
26
26
|
open,
|
|
27
27
|
onClose,
|
|
@@ -180,15 +180,18 @@ export function MessageContextMenu(t0) {
|
|
|
180
180
|
} else {
|
|
181
181
|
t9 = $[54];
|
|
182
182
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
const t28 = tokens.color.background[scheme];
|
|
184
|
+
let t29;
|
|
185
|
+
if ($[55] !== anchor.width || $[56] !== anchor.x || $[57] !== layout.previewHeight || $[58] !== layout.previewTop || $[59] !== t28) {
|
|
186
|
+
t29 = {
|
|
186
187
|
position: "absolute",
|
|
187
188
|
top: layout.previewTop,
|
|
188
189
|
left: anchor.x,
|
|
189
190
|
width: anchor.width,
|
|
190
191
|
height: layout.previewHeight,
|
|
191
192
|
overflow: "hidden",
|
|
193
|
+
backgroundColor: t28,
|
|
194
|
+
borderRadius: tokens.radius.card,
|
|
192
195
|
...shadow
|
|
193
196
|
};
|
|
194
197
|
$[55] = anchor.width;
|
|
@@ -196,18 +199,19 @@ export function MessageContextMenu(t0) {
|
|
|
196
199
|
$[57] = layout.previewHeight;
|
|
197
200
|
$[58] = layout.previewTop;
|
|
198
201
|
$[59] = t28;
|
|
202
|
+
$[60] = t29;
|
|
199
203
|
} else {
|
|
200
|
-
|
|
204
|
+
t29 = $[60];
|
|
201
205
|
}
|
|
202
|
-
if ($[
|
|
203
|
-
t10 = <View pointerEvents="none" style={
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
206
|
+
if ($[61] !== preview || $[62] !== t29) {
|
|
207
|
+
t10 = <View pointerEvents="none" style={t29}>{preview}</View>;
|
|
208
|
+
$[61] = preview;
|
|
209
|
+
$[62] = t29;
|
|
210
|
+
$[63] = t10;
|
|
207
211
|
} else {
|
|
208
|
-
t10 = $[
|
|
212
|
+
t10 = $[63];
|
|
209
213
|
}
|
|
210
|
-
if ($[
|
|
214
|
+
if ($[64] !== layout.pillTop || $[65] !== menu.reactions || $[66] !== pillWidth || $[67] !== run || $[68] !== scheme || $[69] !== side || $[70] !== surface || $[71] !== testID) {
|
|
211
215
|
t11 = menu.reactions ? <View accessibilityRole="toolbar" style={{
|
|
212
216
|
position: "absolute",
|
|
213
217
|
top: layout.pillTop,
|
|
@@ -225,49 +229,49 @@ export function MessageContextMenu(t0) {
|
|
|
225
229
|
backgroundColor: selected ? withAlpha(palette.primary[scheme], 0.12) : "transparent"
|
|
226
230
|
}}>{item.render(selected)}</Pressable>;
|
|
227
231
|
})}</View> : null;
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
232
|
+
$[64] = layout.pillTop;
|
|
233
|
+
$[65] = menu.reactions;
|
|
234
|
+
$[66] = pillWidth;
|
|
235
|
+
$[67] = run;
|
|
236
|
+
$[68] = scheme;
|
|
237
|
+
$[69] = side;
|
|
238
|
+
$[70] = surface;
|
|
239
|
+
$[71] = testID;
|
|
240
|
+
$[72] = t11;
|
|
237
241
|
} else {
|
|
238
|
-
t11 = $[
|
|
242
|
+
t11 = $[72];
|
|
239
243
|
}
|
|
240
244
|
T0 = View;
|
|
241
245
|
t2 = "menu";
|
|
242
|
-
const
|
|
243
|
-
let
|
|
244
|
-
if ($[
|
|
245
|
-
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
246
|
+
const t30 = layout.menuTop;
|
|
247
|
+
let t31;
|
|
248
|
+
if ($[73] !== side) {
|
|
249
|
+
t31 = side(MESSAGE_MENU.menuWidth);
|
|
250
|
+
$[73] = side;
|
|
251
|
+
$[74] = t31;
|
|
248
252
|
} else {
|
|
249
|
-
|
|
253
|
+
t31 = $[74];
|
|
250
254
|
}
|
|
251
|
-
const
|
|
252
|
-
if ($[
|
|
255
|
+
const t32 = window.width - 2 * MESSAGE_MENU.edge;
|
|
256
|
+
if ($[75] !== layout.menuTop || $[76] !== surface || $[77] !== t31 || $[78] !== t32) {
|
|
253
257
|
t3 = {
|
|
254
258
|
position: "absolute",
|
|
255
|
-
top:
|
|
256
|
-
...
|
|
259
|
+
top: t30,
|
|
260
|
+
...t31,
|
|
257
261
|
width: MESSAGE_MENU.menuWidth,
|
|
258
|
-
maxWidth:
|
|
262
|
+
maxWidth: t32,
|
|
259
263
|
borderRadius: tokens.radius.card,
|
|
260
264
|
backgroundColor: surface,
|
|
261
265
|
overflow: "hidden",
|
|
262
266
|
...shadow
|
|
263
267
|
};
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[76] = t30;
|
|
268
|
+
$[75] = layout.menuTop;
|
|
269
|
+
$[76] = surface;
|
|
267
270
|
$[77] = t31;
|
|
268
|
-
$[78] =
|
|
271
|
+
$[78] = t32;
|
|
272
|
+
$[79] = t3;
|
|
269
273
|
} else {
|
|
270
|
-
t3 = $[
|
|
274
|
+
t3 = $[79];
|
|
271
275
|
}
|
|
272
276
|
t4 = menu.actions.map((action_0, index) => {
|
|
273
277
|
const Icon = action_0.icon;
|
|
@@ -342,45 +346,45 @@ export function MessageContextMenu(t0) {
|
|
|
342
346
|
return t17;
|
|
343
347
|
}
|
|
344
348
|
let t18;
|
|
345
|
-
if ($[
|
|
349
|
+
if ($[80] !== T0 || $[81] !== t2 || $[82] !== t3 || $[83] !== t4) {
|
|
346
350
|
t18 = <T0 accessibilityRole={t2} style={t3}>{t4}</T0>;
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
351
|
+
$[80] = T0;
|
|
352
|
+
$[81] = t2;
|
|
353
|
+
$[82] = t3;
|
|
354
|
+
$[83] = t4;
|
|
355
|
+
$[84] = t18;
|
|
352
356
|
} else {
|
|
353
|
-
t18 = $[
|
|
357
|
+
t18 = $[84];
|
|
354
358
|
}
|
|
355
359
|
let t19;
|
|
356
|
-
if ($[
|
|
360
|
+
if ($[85] !== T1 || $[86] !== t10 || $[87] !== t11 || $[88] !== t18 || $[89] !== t5 || $[90] !== t6 || $[91] !== t7 || $[92] !== t8 || $[93] !== t9) {
|
|
357
361
|
t19 = <T1 style={t5} testID={t6} accessibilityViewIsModal={t7} onAccessibilityEscape={t8}>{t9}{t10}{t11}{t18}</T1>;
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
362
|
+
$[85] = T1;
|
|
363
|
+
$[86] = t10;
|
|
364
|
+
$[87] = t11;
|
|
365
|
+
$[88] = t18;
|
|
366
|
+
$[89] = t5;
|
|
367
|
+
$[90] = t6;
|
|
368
|
+
$[91] = t7;
|
|
369
|
+
$[92] = t8;
|
|
370
|
+
$[93] = t9;
|
|
371
|
+
$[94] = t19;
|
|
368
372
|
} else {
|
|
369
|
-
t19 = $[
|
|
373
|
+
t19 = $[94];
|
|
370
374
|
}
|
|
371
375
|
let t20;
|
|
372
|
-
if ($[
|
|
376
|
+
if ($[95] !== T2 || $[96] !== t12 || $[97] !== t13 || $[98] !== t14 || $[99] !== t15 || $[100] !== t16 || $[101] !== t19) {
|
|
373
377
|
t20 = <T2 visible={t12} transparent={t13} animationType={t14} statusBarTranslucent={t15} onRequestClose={t16}>{t19}</T2>;
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
378
|
+
$[95] = T2;
|
|
379
|
+
$[96] = t12;
|
|
380
|
+
$[97] = t13;
|
|
381
|
+
$[98] = t14;
|
|
382
|
+
$[99] = t15;
|
|
383
|
+
$[100] = t16;
|
|
384
|
+
$[101] = t19;
|
|
385
|
+
$[102] = t20;
|
|
382
386
|
} else {
|
|
383
|
-
t20 = $[
|
|
387
|
+
t20 = $[102];
|
|
384
388
|
}
|
|
385
389
|
return t20;
|
|
386
390
|
}
|
package/dist/ai/message.jsx
CHANGED
|
@@ -106,7 +106,7 @@ function MessageHighlight() {
|
|
|
106
106
|
* at the start, its parts full width.
|
|
107
107
|
*
|
|
108
108
|
* With `onLongPress` or `actions` the message is a `Pressable` (same layout,
|
|
109
|
-
* `className`, `style` and view props): a 350 ms hold
|
|
109
|
+
* `className`, `style` and view props): a 350 ms hold dims it a little,
|
|
110
110
|
* fires a medium haptic, runs `onLongPress` and opens the
|
|
111
111
|
* `MessageActionSheet`; TalkBack reaches it as the `longpress` action. It stays
|
|
112
112
|
* a non-accessible container so its buttons and links keep their own focus:
|
|
@@ -114,11 +114,12 @@ function MessageHighlight() {
|
|
|
114
114
|
*/
|
|
115
115
|
/** How long a hold takes, in ms: shorter than React Native's 500, as iMessage. */
|
|
116
116
|
const HOLD_DELAY_MS = 350;
|
|
117
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* A held message dims a little. It does not shrink: the hold menu measures the
|
|
119
|
+
* message while it is held, and a scaled box would draw the lifted copy smaller
|
|
120
|
+
* (and could wrap its text differently).
|
|
121
|
+
*/
|
|
118
122
|
const HELD_STYLE = {
|
|
119
|
-
transform: [{
|
|
120
|
-
scale: 0.98
|
|
121
|
-
}],
|
|
122
123
|
opacity: 0.9
|
|
123
124
|
};
|
|
124
125
|
export function Message(t0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvedantb/native-ui",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared React Native / Expo UI primitives. Floating surfaces, forms, overlays, toasts, settings chrome, tab bar, AI chat parts, the family app marks, a NativeWind preset, the Expo web root and Clerk + Convex auth screens.",
|
|
6
6
|
"type": "module",
|
|
@@ -84,7 +84,7 @@ export function MessageContextMenu({
|
|
|
84
84
|
style={[StyleSheet.absoluteFill, { backgroundColor: withAlpha(tokens.color.background[scheme], 0.85) }]}
|
|
85
85
|
/>
|
|
86
86
|
</View>
|
|
87
|
-
{/* The held message, lifted: in place, a shadow
|
|
87
|
+
{/* The held message, lifted: in place, on the screen colour with a shadow, clipped when it is taller than the room. */}
|
|
88
88
|
<View
|
|
89
89
|
pointerEvents="none"
|
|
90
90
|
style={{
|
|
@@ -94,6 +94,9 @@ export function MessageContextMenu({
|
|
|
94
94
|
width: anchor.width,
|
|
95
95
|
height: layout.previewHeight,
|
|
96
96
|
overflow: "hidden",
|
|
97
|
+
// The screen colour behind the copy: a reply without a bubble would show the dimmed original through it.
|
|
98
|
+
backgroundColor: tokens.color.background[scheme],
|
|
99
|
+
borderRadius: tokens.radius.card,
|
|
97
100
|
...shadow,
|
|
98
101
|
}}
|
|
99
102
|
>
|
package/src/ai/message.tsx
CHANGED
|
@@ -107,7 +107,7 @@ function MessageHighlight() {
|
|
|
107
107
|
* at the start, its parts full width.
|
|
108
108
|
*
|
|
109
109
|
* With `onLongPress` or `actions` the message is a `Pressable` (same layout,
|
|
110
|
-
* `className`, `style` and view props): a 350 ms hold
|
|
110
|
+
* `className`, `style` and view props): a 350 ms hold dims it a little,
|
|
111
111
|
* fires a medium haptic, runs `onLongPress` and opens the
|
|
112
112
|
* `MessageActionSheet`; TalkBack reaches it as the `longpress` action. It stays
|
|
113
113
|
* a non-accessible container so its buttons and links keep their own focus:
|
|
@@ -115,8 +115,12 @@ function MessageHighlight() {
|
|
|
115
115
|
*/
|
|
116
116
|
/** How long a hold takes, in ms: shorter than React Native's 500, as iMessage. */
|
|
117
117
|
const HOLD_DELAY_MS = 350;
|
|
118
|
-
/**
|
|
119
|
-
|
|
118
|
+
/**
|
|
119
|
+
* A held message dims a little. It does not shrink: the hold menu measures the
|
|
120
|
+
* message while it is held, and a scaled box would draw the lifted copy smaller
|
|
121
|
+
* (and could wrap its text differently).
|
|
122
|
+
*/
|
|
123
|
+
const HELD_STYLE = { opacity: 0.9 };
|
|
120
124
|
|
|
121
125
|
export function Message({
|
|
122
126
|
from,
|
|
@@ -169,7 +173,7 @@ export function Message({
|
|
|
169
173
|
ref={pressable}
|
|
170
174
|
accessible={false}
|
|
171
175
|
className={merged}
|
|
172
|
-
// While held it
|
|
176
|
+
// While held it dims a little: the feedback before the menu opens. A state, not a
|
|
173
177
|
// style function: with a `className`, NativeWind drops a style function, layout and all.
|
|
174
178
|
style={[layout, pressing ? HELD_STYLE : null]}
|
|
175
179
|
onPressIn={() => setPressing(true)}
|