@vvedantb/native-ui 0.26.1 → 0.28.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.
- package/dist/ai/activity-question.jsx +302 -0
- package/dist/ai/choice-question.jsx +1 -1
- package/dist/ai/index.js +1 -0
- package/dist/ai/message-context-menu.jsx +111 -113
- package/dist/entries/primitives.js +2 -0
- package/dist/media/ImageGallery.jsx +12 -15
- package/dist/primitives/window-layer.jsx +212 -0
- package/package.json +1 -1
- package/src/ai/activity-question.tsx +179 -0
- package/src/ai/choice-question.tsx +1 -1
- package/src/ai/index.ts +2 -0
- package/src/ai/message-context-menu.tsx +11 -10
- package/src/entries/primitives.ts +3 -0
- package/src/media/ImageGallery.tsx +6 -5
- package/src/primitives/window-layer.tsx +133 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Text, View } from "react-native";
|
|
3
|
+
import { IconCheck, IconMessageQuestion, IconPencil } from "@tabler/icons-react-native";
|
|
4
|
+
import { sizeStyle, textStyle, typeStyle } from "../controlStyles";
|
|
5
|
+
import { palette } from "../palette";
|
|
6
|
+
import { useLargerText } from "../theme";
|
|
7
|
+
import { tokens } from "../tokens";
|
|
8
|
+
import { useScheme } from "../useScheme";
|
|
9
|
+
import { chatTextSize } from "./chat-text";
|
|
10
|
+
import { TopicBadge } from "./choice-question";
|
|
11
|
+
const LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The offered labels the user picked. A whole-answer match wins first, so a
|
|
15
|
+
* single-select label holding ", " is not read as several picks; only a
|
|
16
|
+
* multi-select answer is split on the ", " the dock joins it with.
|
|
17
|
+
*/
|
|
18
|
+
export function selectedLabels(answer, question) {
|
|
19
|
+
if (answer === undefined) return [];
|
|
20
|
+
const offered = new Set(question.options.map(option => option.label));
|
|
21
|
+
if (offered.has(answer)) return [answer];
|
|
22
|
+
if (!question.multiSelect) return [];
|
|
23
|
+
return answer.split(", ").filter(label => offered.has(label));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Free text typed into "Other": an answer that matches no offered label. */
|
|
27
|
+
export function freeTextAnswer(answer, chosen) {
|
|
28
|
+
if (answer === undefined || answer.trim().length === 0) return null;
|
|
29
|
+
return chosen.length > 0 ? null : answer;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The read-only record of an AskUserQuestion prompt and the answer given, as
|
|
33
|
+
* the web `ActivityQuestionCard`: "Question(s)" over each question with its
|
|
34
|
+
* topic badge, its lettered options with the picked ones filled and checked,
|
|
35
|
+
* the free "Other" text with a pencil, and "Answered in the next message" when
|
|
36
|
+
* no structured answer was kept. The live prompt is `ChoiceQuestion`; this is
|
|
37
|
+
* what the transcript keeps once it is answered. Nothing here is pressable.
|
|
38
|
+
*/
|
|
39
|
+
export function ActivityQuestionCard(t0) {
|
|
40
|
+
const $ = _c(11);
|
|
41
|
+
const {
|
|
42
|
+
questions,
|
|
43
|
+
answers
|
|
44
|
+
} = t0;
|
|
45
|
+
const scheme = useScheme();
|
|
46
|
+
const largerText = useLargerText();
|
|
47
|
+
if (questions.length === 0) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
let t1;
|
|
51
|
+
if ($[0] !== answers || $[1] !== largerText || $[2] !== questions || $[3] !== scheme) {
|
|
52
|
+
const caption = chatTextSize("caption", largerText);
|
|
53
|
+
const small = chatTextSize("small", largerText);
|
|
54
|
+
const title = questions.length > 1 ? "Questions" : "Question";
|
|
55
|
+
const t2 = tokens.color.surface[scheme];
|
|
56
|
+
let t3;
|
|
57
|
+
if ($[5] !== t2) {
|
|
58
|
+
t3 = {
|
|
59
|
+
borderRadius: tokens.radius.lg,
|
|
60
|
+
backgroundColor: t2,
|
|
61
|
+
padding: 12,
|
|
62
|
+
gap: 12
|
|
63
|
+
};
|
|
64
|
+
$[5] = t2;
|
|
65
|
+
$[6] = t3;
|
|
66
|
+
} else {
|
|
67
|
+
t3 = $[6];
|
|
68
|
+
}
|
|
69
|
+
let t4;
|
|
70
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
71
|
+
t4 = {
|
|
72
|
+
gap: 6
|
|
73
|
+
};
|
|
74
|
+
$[7] = t4;
|
|
75
|
+
} else {
|
|
76
|
+
t4 = $[7];
|
|
77
|
+
}
|
|
78
|
+
const t5 = largerText ? 18 : 14;
|
|
79
|
+
const t6 = tokens.color.muted[scheme];
|
|
80
|
+
let t7;
|
|
81
|
+
if ($[8] !== t5 || $[9] !== t6) {
|
|
82
|
+
t7 = <IconMessageQuestion size={t5} color={t6} />;
|
|
83
|
+
$[8] = t5;
|
|
84
|
+
$[9] = t6;
|
|
85
|
+
$[10] = t7;
|
|
86
|
+
} else {
|
|
87
|
+
t7 = $[10];
|
|
88
|
+
}
|
|
89
|
+
t1 = <View accessibilityLabel={title} style={t3}><View className="flex-row items-center" style={t4}>{t7}<Text className="font-instrument-sans-medium" style={[sizeStyle(caption), textStyle("muted", scheme), typeStyle("medium")]}>{title}</Text></View>{questions.map((question, questionIndex) => {
|
|
90
|
+
const answer = answers?.[question.question];
|
|
91
|
+
const chosen = selectedLabels(answer, question);
|
|
92
|
+
const freeText = freeTextAnswer(answer, chosen);
|
|
93
|
+
const answered = answer !== undefined && answer.trim().length > 0;
|
|
94
|
+
return <View key={`${question.question}-${questionIndex}`} style={{
|
|
95
|
+
gap: 6
|
|
96
|
+
}}><View className="flex-row items-start justify-between" style={{
|
|
97
|
+
gap: 8
|
|
98
|
+
}}><Text className="min-w-0 flex-1 font-instrument-sans-medium" style={[sizeStyle(small), textStyle("foreground", scheme), typeStyle("medium")]}>{question.question}</Text>{question.header ? <TopicBadge>{question.header}</TopicBadge> : null}</View><View style={{
|
|
99
|
+
gap: 2
|
|
100
|
+
}}>{question.options.map((option, optionIndex) => <RecordRow key={`${option.label}-${optionIndex}`} mark={chosen.includes(option.label) ? "check" : LETTERS[optionIndex] ?? String(optionIndex + 1)} label={option.label} description={option.description} selected={chosen.includes(option.label)} />)}{freeText ? <RecordRow mark="other" label="Other" description={freeText} selected={true} /> : null}</View>{answered ? null : <Text className="font-instrument-sans" style={[sizeStyle(caption), textStyle("muted", scheme)]}>Answered in the next message</Text>}</View>;
|
|
101
|
+
})}</View>;
|
|
102
|
+
$[0] = answers;
|
|
103
|
+
$[1] = largerText;
|
|
104
|
+
$[2] = questions;
|
|
105
|
+
$[3] = scheme;
|
|
106
|
+
$[4] = t1;
|
|
107
|
+
} else {
|
|
108
|
+
t1 = $[4];
|
|
109
|
+
}
|
|
110
|
+
return t1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* One option as recorded (web `OptionRow`): a 20 rounded mark (the letter, a
|
|
115
|
+
* check when picked, a pencil for "Other"), the label and its description.
|
|
116
|
+
* Picked: the row on the tertiary fill, the mark on primary, the label medium.
|
|
117
|
+
*/
|
|
118
|
+
function RecordRow(t0) {
|
|
119
|
+
const $ = _c(56);
|
|
120
|
+
const {
|
|
121
|
+
mark,
|
|
122
|
+
label,
|
|
123
|
+
description,
|
|
124
|
+
selected
|
|
125
|
+
} = t0;
|
|
126
|
+
const scheme = useScheme();
|
|
127
|
+
const largerText = useLargerText();
|
|
128
|
+
let T0;
|
|
129
|
+
let T1;
|
|
130
|
+
let t1;
|
|
131
|
+
let t2;
|
|
132
|
+
let t3;
|
|
133
|
+
let t4;
|
|
134
|
+
let t5;
|
|
135
|
+
let t6;
|
|
136
|
+
let t7;
|
|
137
|
+
let t8;
|
|
138
|
+
if ($[0] !== description || $[1] !== label || $[2] !== largerText || $[3] !== mark || $[4] !== scheme || $[5] !== selected) {
|
|
139
|
+
const caption = chatTextSize("caption", largerText);
|
|
140
|
+
const small = chatTextSize("small", largerText);
|
|
141
|
+
const markSize = largerText ? 26 : 20;
|
|
142
|
+
const markColor = selected ? palette.primaryForeground[scheme] : tokens.color.muted[scheme];
|
|
143
|
+
const glyph = largerText ? 15 : 12;
|
|
144
|
+
T1 = View;
|
|
145
|
+
t4 = selected ? `${label}, chosen` : label;
|
|
146
|
+
t5 = description || undefined;
|
|
147
|
+
t6 = "flex-row items-start";
|
|
148
|
+
const t9 = selected ? palette.surfaceTertiary[scheme] : "transparent";
|
|
149
|
+
if ($[16] !== t9) {
|
|
150
|
+
t7 = {
|
|
151
|
+
gap: 8,
|
|
152
|
+
borderRadius: tokens.radius.md,
|
|
153
|
+
paddingHorizontal: 8,
|
|
154
|
+
paddingVertical: 6,
|
|
155
|
+
backgroundColor: t9
|
|
156
|
+
};
|
|
157
|
+
$[16] = t9;
|
|
158
|
+
$[17] = t7;
|
|
159
|
+
} else {
|
|
160
|
+
t7 = $[17];
|
|
161
|
+
}
|
|
162
|
+
const t10 = selected ? palette.primary[scheme] : palette.default[scheme];
|
|
163
|
+
let t11;
|
|
164
|
+
if ($[18] !== markSize || $[19] !== t10) {
|
|
165
|
+
t11 = {
|
|
166
|
+
width: markSize,
|
|
167
|
+
height: markSize,
|
|
168
|
+
marginTop: 2,
|
|
169
|
+
borderRadius: 6,
|
|
170
|
+
alignItems: "center",
|
|
171
|
+
justifyContent: "center",
|
|
172
|
+
backgroundColor: t10
|
|
173
|
+
};
|
|
174
|
+
$[18] = markSize;
|
|
175
|
+
$[19] = t10;
|
|
176
|
+
$[20] = t11;
|
|
177
|
+
} else {
|
|
178
|
+
t11 = $[20];
|
|
179
|
+
}
|
|
180
|
+
let t12;
|
|
181
|
+
if ($[21] !== glyph || $[22] !== largerText || $[23] !== mark || $[24] !== markColor) {
|
|
182
|
+
t12 = mark === "check" ? <IconCheck size={glyph} strokeWidth={3} color={markColor} /> : mark === "other" ? <IconPencil size={glyph} strokeWidth={3} color={markColor} /> : <Text className="font-instrument-sans-semibold" style={[{
|
|
183
|
+
fontSize: largerText ? 13 : 10,
|
|
184
|
+
color: markColor
|
|
185
|
+
}, typeStyle("semibold")]}>{mark}</Text>;
|
|
186
|
+
$[21] = glyph;
|
|
187
|
+
$[22] = largerText;
|
|
188
|
+
$[23] = mark;
|
|
189
|
+
$[24] = markColor;
|
|
190
|
+
$[25] = t12;
|
|
191
|
+
} else {
|
|
192
|
+
t12 = $[25];
|
|
193
|
+
}
|
|
194
|
+
if ($[26] !== t11 || $[27] !== t12) {
|
|
195
|
+
t8 = <View style={t11}>{t12}</View>;
|
|
196
|
+
$[26] = t11;
|
|
197
|
+
$[27] = t12;
|
|
198
|
+
$[28] = t8;
|
|
199
|
+
} else {
|
|
200
|
+
t8 = $[28];
|
|
201
|
+
}
|
|
202
|
+
T0 = View;
|
|
203
|
+
t1 = "min-w-0 flex-1";
|
|
204
|
+
const T2 = Text;
|
|
205
|
+
const t13 = selected ? "font-instrument-sans-medium" : "font-instrument-sans";
|
|
206
|
+
const t14 = sizeStyle(small, "snug");
|
|
207
|
+
const t15 = selected ? "foreground" : "muted";
|
|
208
|
+
let t16;
|
|
209
|
+
if ($[29] !== scheme || $[30] !== t15) {
|
|
210
|
+
t16 = textStyle(t15, scheme);
|
|
211
|
+
$[29] = scheme;
|
|
212
|
+
$[30] = t15;
|
|
213
|
+
$[31] = t16;
|
|
214
|
+
} else {
|
|
215
|
+
t16 = $[31];
|
|
216
|
+
}
|
|
217
|
+
let t17;
|
|
218
|
+
if ($[32] !== selected) {
|
|
219
|
+
t17 = selected ? typeStyle("medium") : null;
|
|
220
|
+
$[32] = selected;
|
|
221
|
+
$[33] = t17;
|
|
222
|
+
} else {
|
|
223
|
+
t17 = $[33];
|
|
224
|
+
}
|
|
225
|
+
let t18;
|
|
226
|
+
if ($[34] !== t14 || $[35] !== t16 || $[36] !== t17) {
|
|
227
|
+
t18 = [t14, t16, t17];
|
|
228
|
+
$[34] = t14;
|
|
229
|
+
$[35] = t16;
|
|
230
|
+
$[36] = t17;
|
|
231
|
+
$[37] = t18;
|
|
232
|
+
} else {
|
|
233
|
+
t18 = $[37];
|
|
234
|
+
}
|
|
235
|
+
if ($[38] !== T2 || $[39] !== label || $[40] !== t13 || $[41] !== t18) {
|
|
236
|
+
t2 = <T2 className={t13} style={t18}>{label}</T2>;
|
|
237
|
+
$[38] = T2;
|
|
238
|
+
$[39] = label;
|
|
239
|
+
$[40] = t13;
|
|
240
|
+
$[41] = t18;
|
|
241
|
+
$[42] = t2;
|
|
242
|
+
} else {
|
|
243
|
+
t2 = $[42];
|
|
244
|
+
}
|
|
245
|
+
t3 = description ? <Text className="font-instrument-sans" style={[sizeStyle(caption), textStyle("muted", scheme), {
|
|
246
|
+
marginTop: 2
|
|
247
|
+
}]}>{description}</Text> : null;
|
|
248
|
+
$[0] = description;
|
|
249
|
+
$[1] = label;
|
|
250
|
+
$[2] = largerText;
|
|
251
|
+
$[3] = mark;
|
|
252
|
+
$[4] = scheme;
|
|
253
|
+
$[5] = selected;
|
|
254
|
+
$[6] = T0;
|
|
255
|
+
$[7] = T1;
|
|
256
|
+
$[8] = t1;
|
|
257
|
+
$[9] = t2;
|
|
258
|
+
$[10] = t3;
|
|
259
|
+
$[11] = t4;
|
|
260
|
+
$[12] = t5;
|
|
261
|
+
$[13] = t6;
|
|
262
|
+
$[14] = t7;
|
|
263
|
+
$[15] = t8;
|
|
264
|
+
} else {
|
|
265
|
+
T0 = $[6];
|
|
266
|
+
T1 = $[7];
|
|
267
|
+
t1 = $[8];
|
|
268
|
+
t2 = $[9];
|
|
269
|
+
t3 = $[10];
|
|
270
|
+
t4 = $[11];
|
|
271
|
+
t5 = $[12];
|
|
272
|
+
t6 = $[13];
|
|
273
|
+
t7 = $[14];
|
|
274
|
+
t8 = $[15];
|
|
275
|
+
}
|
|
276
|
+
let t9;
|
|
277
|
+
if ($[43] !== T0 || $[44] !== t1 || $[45] !== t2 || $[46] !== t3) {
|
|
278
|
+
t9 = <T0 className={t1}>{t2}{t3}</T0>;
|
|
279
|
+
$[43] = T0;
|
|
280
|
+
$[44] = t1;
|
|
281
|
+
$[45] = t2;
|
|
282
|
+
$[46] = t3;
|
|
283
|
+
$[47] = t9;
|
|
284
|
+
} else {
|
|
285
|
+
t9 = $[47];
|
|
286
|
+
}
|
|
287
|
+
let t10;
|
|
288
|
+
if ($[48] !== T1 || $[49] !== t4 || $[50] !== t5 || $[51] !== t6 || $[52] !== t7 || $[53] !== t8 || $[54] !== t9) {
|
|
289
|
+
t10 = <T1 accessibilityLabel={t4} accessibilityHint={t5} className={t6} style={t7}>{t8}{t9}</T1>;
|
|
290
|
+
$[48] = T1;
|
|
291
|
+
$[49] = t4;
|
|
292
|
+
$[50] = t5;
|
|
293
|
+
$[51] = t6;
|
|
294
|
+
$[52] = t7;
|
|
295
|
+
$[53] = t8;
|
|
296
|
+
$[54] = t9;
|
|
297
|
+
$[55] = t10;
|
|
298
|
+
} else {
|
|
299
|
+
t10 = $[55];
|
|
300
|
+
}
|
|
301
|
+
return t10;
|
|
302
|
+
}
|
|
@@ -515,7 +515,7 @@ export function ChoiceQuestion(t0) {
|
|
|
515
515
|
* `text-3xs font-semibold` (10 / 14, 600) in a `px-2.5 py-0.5` pill. Drawn here
|
|
516
516
|
* because `Badge` sets its own size and weight.
|
|
517
517
|
*/
|
|
518
|
-
function TopicBadge(t0) {
|
|
518
|
+
export function TopicBadge(t0) {
|
|
519
519
|
const $ = _c(15);
|
|
520
520
|
const {
|
|
521
521
|
children
|
package/dist/ai/index.js
CHANGED
|
@@ -33,6 +33,7 @@ export { ChatJumpRail } from "./chat-jump-rail";
|
|
|
33
33
|
export { CodeBlock, CodeBlockCopyButton } from "./code-block";
|
|
34
34
|
export { ResponseText, ChatTextColorContext } from "./response-text";
|
|
35
35
|
export { ChoiceQuestion, choiceAnswers } from "./choice-question";
|
|
36
|
+
export { ActivityQuestionCard, freeTextAnswer, selectedLabels } from "./activity-question";
|
|
36
37
|
export { ActivityStepDetail } from "./activity-step-detail";
|
|
37
38
|
export { UnifiedDiff, DiffStat, UNIFIED_DIFF } from "./unified-diff";
|
|
38
39
|
export { ToolApprovalCard, ToolDraftCard, summarizeArgs, ARGS_MAX_CHARS, changedDraftEdits, DRAFT_ROLE_LABELS } from "./tool-approval-card";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Pressable, StyleSheet, Text, View, useWindowDimensions } from "react-native";
|
|
3
3
|
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
|
|
4
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
5
|
import { cn } from "../cn";
|
|
6
|
+
import { WindowLayer } from "../primitives/window-layer";
|
|
6
7
|
import { PANEL_SCALE_FROM, POPOVER_ENTER } from "../motion";
|
|
7
8
|
import { sizeStyle, typeStyle } from "../controlStyles";
|
|
8
9
|
import { palette, withAlpha } from "../palette";
|
|
9
10
|
import { useLargerText } from "../theme";
|
|
10
11
|
import { tokens } from "../tokens";
|
|
11
|
-
import { useReduceMotion } from "../useReduceMotion";
|
|
12
12
|
import { useScheme } from "../useScheme";
|
|
13
13
|
import { chatTextSize } from "./chat-text";
|
|
14
14
|
import { MESSAGE_MENU, messageContextMenuLayout } from "./message-menu-layout";
|
|
@@ -21,8 +21,9 @@ const LIFT_SCALE = 1.02;
|
|
|
21
21
|
* The iMessage hold menu for a chat message: the chat fades under a frosted
|
|
22
22
|
* wash of the screen colour, the held message stays in place,
|
|
23
23
|
* lifted, with the quick reactions in a pill above it and the actions in a
|
|
24
|
-
* card below it, label first and icon last. It
|
|
25
|
-
*
|
|
24
|
+
* card below it, label first and icon last. It draws in the app's window
|
|
25
|
+
* (`WindowLayer`) and fades in and out as one; with Reduce Motion on, it
|
|
26
|
+
* appears at once. As it fades
|
|
26
27
|
* in, the pill and the card grow into place from the message's side (0.96 to
|
|
27
28
|
* 1) and the held message lifts a little (to 1.02), in 150 ms; with Reduce
|
|
28
29
|
* Motion they are in place at once. A tap outside, Android back
|
|
@@ -30,7 +31,7 @@ const LIFT_SCALE = 1.02;
|
|
|
30
31
|
* runs. `Message` opens it with `menu`.
|
|
31
32
|
*/
|
|
32
33
|
export function MessageContextMenu(t0) {
|
|
33
|
-
const $ = _c(
|
|
34
|
+
const $ = _c(89);
|
|
34
35
|
const {
|
|
35
36
|
open,
|
|
36
37
|
onClose,
|
|
@@ -46,7 +47,6 @@ export function MessageContextMenu(t0) {
|
|
|
46
47
|
const window = useWindowDimensions();
|
|
47
48
|
const insets = useSafeAreaInsets();
|
|
48
49
|
const largerText = useLargerText();
|
|
49
|
-
const reduceMotion = useReduceMotion();
|
|
50
50
|
const rowHeight = largerText ? 56 : 48;
|
|
51
51
|
let t2;
|
|
52
52
|
if ($[0] !== largerText) {
|
|
@@ -151,57 +151,56 @@ export function MessageContextMenu(t0) {
|
|
|
151
151
|
}
|
|
152
152
|
const shadow = t9;
|
|
153
153
|
const pillWidth = Math.min(window.width - 2 * MESSAGE_MENU.edge, (menu.reactions?.items.length ?? 0) * 48 + 16);
|
|
154
|
-
|
|
155
|
-
let t11;
|
|
154
|
+
let t10;
|
|
156
155
|
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
157
|
-
|
|
156
|
+
t10 = {
|
|
158
157
|
flex: 1
|
|
159
158
|
};
|
|
160
|
-
$[18] =
|
|
159
|
+
$[18] = t10;
|
|
161
160
|
} else {
|
|
162
|
-
|
|
161
|
+
t10 = $[18];
|
|
163
162
|
}
|
|
164
|
-
const
|
|
165
|
-
const
|
|
166
|
-
let
|
|
167
|
-
if ($[19] !==
|
|
168
|
-
|
|
169
|
-
$[19] =
|
|
170
|
-
$[20] =
|
|
163
|
+
const t11 = `${testID}-backdrop`;
|
|
164
|
+
const t12 = tokens.color.background[scheme];
|
|
165
|
+
let t13;
|
|
166
|
+
if ($[19] !== t12) {
|
|
167
|
+
t13 = withAlpha(t12, 0.85);
|
|
168
|
+
$[19] = t12;
|
|
169
|
+
$[20] = t13;
|
|
171
170
|
} else {
|
|
172
|
-
|
|
171
|
+
t13 = $[20];
|
|
173
172
|
}
|
|
174
|
-
let
|
|
175
|
-
if ($[21] !==
|
|
176
|
-
|
|
177
|
-
backgroundColor:
|
|
173
|
+
let t14;
|
|
174
|
+
if ($[21] !== t13) {
|
|
175
|
+
t14 = [StyleSheet.absoluteFill, {
|
|
176
|
+
backgroundColor: t13
|
|
178
177
|
}];
|
|
179
|
-
$[21] =
|
|
180
|
-
$[22] =
|
|
178
|
+
$[21] = t13;
|
|
179
|
+
$[22] = t14;
|
|
181
180
|
} else {
|
|
182
|
-
|
|
181
|
+
t14 = $[22];
|
|
183
182
|
}
|
|
184
|
-
let
|
|
185
|
-
if ($[23] !== onClose || $[24] !==
|
|
186
|
-
|
|
183
|
+
let t15;
|
|
184
|
+
if ($[23] !== onClose || $[24] !== t11 || $[25] !== t14) {
|
|
185
|
+
t15 = <View style={StyleSheet.absoluteFill}><Pressable testID={t11} accessibilityRole="button" accessibilityLabel="Close menu" onPress={onClose} style={t14} /></View>;
|
|
187
186
|
$[23] = onClose;
|
|
188
|
-
$[24] =
|
|
189
|
-
$[25] =
|
|
190
|
-
$[26] =
|
|
187
|
+
$[24] = t11;
|
|
188
|
+
$[25] = t14;
|
|
189
|
+
$[26] = t15;
|
|
191
190
|
} else {
|
|
192
|
-
|
|
191
|
+
t15 = $[26];
|
|
193
192
|
}
|
|
194
|
-
const
|
|
195
|
-
let
|
|
196
|
-
if ($[27] !== anchor.width || $[28] !== anchor.x || $[29] !== layout.previewHeight || $[30] !== layout.previewTop || $[31] !==
|
|
197
|
-
|
|
193
|
+
const t16 = tokens.color.background[scheme];
|
|
194
|
+
let t17;
|
|
195
|
+
if ($[27] !== anchor.width || $[28] !== anchor.x || $[29] !== layout.previewHeight || $[30] !== layout.previewTop || $[31] !== t16) {
|
|
196
|
+
t17 = {
|
|
198
197
|
position: "absolute",
|
|
199
198
|
top: layout.previewTop,
|
|
200
199
|
left: anchor.x,
|
|
201
200
|
width: anchor.width,
|
|
202
201
|
height: layout.previewHeight,
|
|
203
202
|
overflow: "hidden",
|
|
204
|
-
backgroundColor:
|
|
203
|
+
backgroundColor: t16,
|
|
205
204
|
borderRadius: tokens.radius.card,
|
|
206
205
|
...shadow
|
|
207
206
|
};
|
|
@@ -209,32 +208,32 @@ export function MessageContextMenu(t0) {
|
|
|
209
208
|
$[28] = anchor.x;
|
|
210
209
|
$[29] = layout.previewHeight;
|
|
211
210
|
$[30] = layout.previewTop;
|
|
212
|
-
$[31] =
|
|
213
|
-
$[32] =
|
|
211
|
+
$[31] = t16;
|
|
212
|
+
$[32] = t17;
|
|
214
213
|
} else {
|
|
215
|
-
|
|
214
|
+
t17 = $[32];
|
|
216
215
|
}
|
|
217
|
-
let
|
|
218
|
-
if ($[33] !== liftStyle || $[34] !==
|
|
219
|
-
|
|
216
|
+
let t18;
|
|
217
|
+
if ($[33] !== liftStyle || $[34] !== t17) {
|
|
218
|
+
t18 = [t17, liftStyle];
|
|
220
219
|
$[33] = liftStyle;
|
|
221
|
-
$[34] =
|
|
222
|
-
$[35] =
|
|
220
|
+
$[34] = t17;
|
|
221
|
+
$[35] = t18;
|
|
223
222
|
} else {
|
|
224
|
-
|
|
223
|
+
t18 = $[35];
|
|
225
224
|
}
|
|
226
|
-
let
|
|
227
|
-
if ($[36] !== preview || $[37] !==
|
|
228
|
-
|
|
225
|
+
let t19;
|
|
226
|
+
if ($[36] !== preview || $[37] !== t18) {
|
|
227
|
+
t19 = <Animated.View pointerEvents="none" style={t18}>{preview}</Animated.View>;
|
|
229
228
|
$[36] = preview;
|
|
230
|
-
$[37] =
|
|
231
|
-
$[38] =
|
|
229
|
+
$[37] = t18;
|
|
230
|
+
$[38] = t19;
|
|
232
231
|
} else {
|
|
233
|
-
|
|
232
|
+
t19 = $[38];
|
|
234
233
|
}
|
|
235
|
-
let
|
|
234
|
+
let t20;
|
|
236
235
|
if ($[39] !== align || $[40] !== layout.pillTop || $[41] !== menu.reactions || $[42] !== pillWidth || $[43] !== popStyle || $[44] !== run || $[45] !== scheme || $[46] !== side || $[47] !== surface || $[48] !== testID) {
|
|
237
|
-
|
|
236
|
+
t20 = menu.reactions ? <Animated.View accessibilityRole="toolbar" style={[{
|
|
238
237
|
position: "absolute",
|
|
239
238
|
top: layout.pillTop,
|
|
240
239
|
...side(pillWidth),
|
|
@@ -265,113 +264,112 @@ export function MessageContextMenu(t0) {
|
|
|
265
264
|
$[46] = side;
|
|
266
265
|
$[47] = surface;
|
|
267
266
|
$[48] = testID;
|
|
268
|
-
$[49] =
|
|
267
|
+
$[49] = t20;
|
|
269
268
|
} else {
|
|
270
|
-
|
|
269
|
+
t20 = $[49];
|
|
271
270
|
}
|
|
272
|
-
const
|
|
273
|
-
let
|
|
271
|
+
const t21 = layout.menuTop;
|
|
272
|
+
let t22;
|
|
274
273
|
if ($[50] !== side) {
|
|
275
|
-
|
|
274
|
+
t22 = side(MESSAGE_MENU.menuWidth);
|
|
276
275
|
$[50] = side;
|
|
277
|
-
$[51] =
|
|
276
|
+
$[51] = t22;
|
|
278
277
|
} else {
|
|
279
|
-
|
|
278
|
+
t22 = $[51];
|
|
280
279
|
}
|
|
281
|
-
const
|
|
282
|
-
const
|
|
283
|
-
let
|
|
284
|
-
if ($[52] !== layout.menuTop || $[53] !== surface || $[54] !==
|
|
285
|
-
|
|
280
|
+
const t23 = window.width - 2 * MESSAGE_MENU.edge;
|
|
281
|
+
const t24 = align === "end" ? "right top" : "left top";
|
|
282
|
+
let t25;
|
|
283
|
+
if ($[52] !== layout.menuTop || $[53] !== surface || $[54] !== t22 || $[55] !== t23 || $[56] !== t24) {
|
|
284
|
+
t25 = {
|
|
286
285
|
position: "absolute",
|
|
287
|
-
top:
|
|
288
|
-
...
|
|
286
|
+
top: t21,
|
|
287
|
+
...t22,
|
|
289
288
|
width: MESSAGE_MENU.menuWidth,
|
|
290
|
-
maxWidth:
|
|
289
|
+
maxWidth: t23,
|
|
291
290
|
borderRadius: tokens.radius.card,
|
|
292
291
|
backgroundColor: surface,
|
|
293
292
|
overflow: "hidden",
|
|
294
|
-
transformOrigin:
|
|
293
|
+
transformOrigin: t24,
|
|
295
294
|
...shadow
|
|
296
295
|
};
|
|
297
296
|
$[52] = layout.menuTop;
|
|
298
297
|
$[53] = surface;
|
|
299
|
-
$[54] =
|
|
300
|
-
$[55] =
|
|
301
|
-
$[56] =
|
|
302
|
-
$[57] =
|
|
298
|
+
$[54] = t22;
|
|
299
|
+
$[55] = t23;
|
|
300
|
+
$[56] = t24;
|
|
301
|
+
$[57] = t25;
|
|
303
302
|
} else {
|
|
304
|
-
|
|
303
|
+
t25 = $[57];
|
|
305
304
|
}
|
|
306
|
-
let
|
|
307
|
-
if ($[58] !== popStyle || $[59] !==
|
|
308
|
-
|
|
305
|
+
let t26;
|
|
306
|
+
if ($[58] !== popStyle || $[59] !== t25) {
|
|
307
|
+
t26 = [t25, popStyle];
|
|
309
308
|
$[58] = popStyle;
|
|
310
|
-
$[59] =
|
|
311
|
-
$[60] =
|
|
309
|
+
$[59] = t25;
|
|
310
|
+
$[60] = t26;
|
|
312
311
|
} else {
|
|
313
|
-
|
|
312
|
+
t26 = $[60];
|
|
314
313
|
}
|
|
315
|
-
let
|
|
314
|
+
let t27;
|
|
316
315
|
if ($[61] !== body || $[62] !== largerText || $[63] !== menu.actions || $[64] !== rowHeight || $[65] !== run || $[66] !== testID) {
|
|
317
|
-
let
|
|
316
|
+
let t28;
|
|
318
317
|
if ($[68] !== body || $[69] !== largerText || $[70] !== rowHeight || $[71] !== run || $[72] !== testID) {
|
|
319
|
-
|
|
318
|
+
t28 = (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)} />;
|
|
320
319
|
$[68] = body;
|
|
321
320
|
$[69] = largerText;
|
|
322
321
|
$[70] = rowHeight;
|
|
323
322
|
$[71] = run;
|
|
324
323
|
$[72] = testID;
|
|
325
|
-
$[73] =
|
|
324
|
+
$[73] = t28;
|
|
326
325
|
} else {
|
|
327
|
-
|
|
326
|
+
t28 = $[73];
|
|
328
327
|
}
|
|
329
|
-
|
|
328
|
+
t27 = menu.actions.map(t28);
|
|
330
329
|
$[61] = body;
|
|
331
330
|
$[62] = largerText;
|
|
332
331
|
$[63] = menu.actions;
|
|
333
332
|
$[64] = rowHeight;
|
|
334
333
|
$[65] = run;
|
|
335
334
|
$[66] = testID;
|
|
336
|
-
$[67] =
|
|
335
|
+
$[67] = t27;
|
|
337
336
|
} else {
|
|
338
|
-
|
|
337
|
+
t27 = $[67];
|
|
339
338
|
}
|
|
340
|
-
let
|
|
341
|
-
if ($[74] !==
|
|
342
|
-
|
|
343
|
-
$[74] =
|
|
344
|
-
$[75] =
|
|
345
|
-
$[76] =
|
|
339
|
+
let t28;
|
|
340
|
+
if ($[74] !== t26 || $[75] !== t27) {
|
|
341
|
+
t28 = <Animated.View accessibilityRole="menu" style={t26}>{t27}</Animated.View>;
|
|
342
|
+
$[74] = t26;
|
|
343
|
+
$[75] = t27;
|
|
344
|
+
$[76] = t28;
|
|
346
345
|
} else {
|
|
347
|
-
|
|
346
|
+
t28 = $[76];
|
|
348
347
|
}
|
|
349
|
-
let
|
|
350
|
-
if ($[77] !== appear || $[78] !== onClose || $[79] !==
|
|
351
|
-
|
|
348
|
+
let t29;
|
|
349
|
+
if ($[77] !== appear || $[78] !== onClose || $[79] !== t15 || $[80] !== t19 || $[81] !== t20 || $[82] !== t28 || $[83] !== testID) {
|
|
350
|
+
t29 = <View style={t10} testID={testID} accessibilityViewIsModal={true} onAccessibilityEscape={onClose} onLayout={appear}>{t15}{t19}{t20}{t28}</View>;
|
|
352
351
|
$[77] = appear;
|
|
353
352
|
$[78] = onClose;
|
|
354
|
-
$[79] =
|
|
355
|
-
$[80] =
|
|
356
|
-
$[81] =
|
|
357
|
-
$[82] =
|
|
353
|
+
$[79] = t15;
|
|
354
|
+
$[80] = t19;
|
|
355
|
+
$[81] = t20;
|
|
356
|
+
$[82] = t28;
|
|
358
357
|
$[83] = testID;
|
|
359
|
-
$[84] =
|
|
358
|
+
$[84] = t29;
|
|
360
359
|
} else {
|
|
361
|
-
|
|
360
|
+
t29 = $[84];
|
|
362
361
|
}
|
|
363
|
-
let
|
|
364
|
-
if ($[85] !== onClose || $[86] !== onDismissed || $[87] !==
|
|
365
|
-
|
|
362
|
+
let t30;
|
|
363
|
+
if ($[85] !== onClose || $[86] !== onDismissed || $[87] !== t29) {
|
|
364
|
+
t30 = <WindowLayer onRequestClose={onClose} onDismiss={onDismissed}>{t29}</WindowLayer>;
|
|
366
365
|
$[85] = onClose;
|
|
367
366
|
$[86] = onDismissed;
|
|
368
|
-
$[87] =
|
|
367
|
+
$[87] = t29;
|
|
369
368
|
$[88] = t30;
|
|
370
|
-
$[89] = t31;
|
|
371
369
|
} else {
|
|
372
|
-
|
|
370
|
+
t30 = $[88];
|
|
373
371
|
}
|
|
374
|
-
return
|
|
372
|
+
return t30;
|
|
375
373
|
}
|
|
376
374
|
|
|
377
375
|
/**
|
|
@@ -58,3 +58,5 @@ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLab
|
|
|
58
58
|
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHandle, SheetHeader, SheetTitle, SheetDescription, SheetBody, SheetFooter } from "../Sheet";
|
|
59
59
|
export { Toaster } from "../Toast";
|
|
60
60
|
export { toast } from "../toastStore";
|
|
61
|
+
// Overlays in the app's window (the hold menu, the image viewer): wrap the navigator once.
|
|
62
|
+
export { WindowLayerHost } from "../primitives/window-layer";
|