@vvedantb/native-ui 0.17.2 → 0.18.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/AlertDialog.jsx +123 -0
- package/dist/AmbientBackground.jsx +73 -0
- package/dist/ArtifactList.jsx +59 -0
- package/dist/Avatar.jsx +285 -0
- package/dist/Badge.jsx +154 -0
- package/dist/BottomSheetContainer.jsx +208 -0
- package/dist/BulkActionBar.jsx +717 -0
- package/dist/Button.jsx +344 -0
- package/dist/CaptureButton.jsx +104 -0
- package/dist/Card.jsx +371 -0
- package/dist/Checkbox.jsx +177 -0
- package/dist/Chip.jsx +79 -0
- package/dist/ColorSwatches.jsx +159 -0
- package/dist/ConfirmDialog.jsx +157 -0
- package/dist/DateTimeField.jsx +204 -0
- package/dist/Dialog.jsx +614 -0
- package/dist/DividedList.jsx +120 -0
- package/dist/DropdownMenu.jsx +849 -0
- package/dist/EmptyState.jsx +434 -0
- package/dist/ExpoWebRoot.jsx +134 -0
- package/dist/FloatingFAB.jsx +95 -0
- package/dist/FloatingSurface.jsx +226 -0
- package/dist/FloatingTabBar.jsx +403 -0
- package/dist/HeaderIconButton.jsx +53 -0
- package/dist/IconButton.jsx +157 -0
- package/dist/Input.jsx +96 -0
- package/dist/Label.jsx +96 -0
- package/dist/LabeledSwitchRow.jsx +170 -0
- package/dist/LiquidGlass.jsx +2 -0
- package/dist/ListRow.jsx +281 -0
- package/dist/LoadingState.jsx +205 -0
- package/dist/PageIndicator.jsx +128 -0
- package/dist/PageTitle.jsx +205 -0
- package/dist/Pager.jsx +105 -0
- package/dist/PasswordInput.jsx +120 -0
- package/dist/PillTabs.jsx +300 -0
- package/dist/PinnedBotTile.jsx +212 -0
- package/dist/Progress.jsx +147 -0
- package/dist/SafeAreaContainer.jsx +38 -0
- package/dist/ScreenContainer.jsx +117 -0
- package/dist/SearchInput.jsx +150 -0
- package/dist/SectionLabel.jsx +128 -0
- package/dist/Select.jsx +223 -0
- package/dist/Separator.jsx +95 -0
- package/dist/Sheet.jsx +343 -0
- package/dist/SheetRow.jsx +198 -0
- package/dist/Skeleton.jsx +311 -0
- package/dist/Spinner.jsx +195 -0
- package/dist/StackPageHeader.jsx +160 -0
- package/dist/StatGrid.jsx +74 -0
- package/dist/StatusDot.jsx +129 -0
- package/dist/SurfaceRow.jsx +143 -0
- package/dist/SwipeableRow.jsx +50 -0
- package/dist/Switch.jsx +130 -0
- package/dist/Tabs.jsx +385 -0
- package/dist/Textarea.jsx +103 -0
- package/dist/ThemeToggle.jsx +78 -0
- package/dist/Toast.jsx +396 -0
- package/dist/ai/activity-step-detail.jsx +179 -0
- package/dist/ai/activity-step-label.js +816 -0
- package/dist/ai/activity-step-types.js +14 -0
- package/dist/ai/activity-step.jsx +98 -0
- package/dist/ai/activity-tasks-utils.js +172 -0
- package/dist/ai/activity-timeline.js +47 -0
- package/dist/ai/attachments.jsx +258 -0
- package/dist/ai/card-button.jsx +188 -0
- package/dist/ai/chain-of-thought.jsx +459 -0
- package/dist/ai/chat-jump-rail.jsx +57 -0
- package/dist/ai/chat-text.js +44 -0
- package/dist/ai/chat-thread.jsx +135 -0
- package/dist/ai/choice-question.jsx +925 -0
- package/dist/ai/code-block.jsx +574 -0
- package/dist/ai/collapsible.jsx +275 -0
- package/dist/ai/conversation.jsx +723 -0
- package/dist/ai/file-chip.jsx +198 -0
- package/dist/ai/icon-button.jsx +179 -0
- package/dist/ai/index.js +37 -0
- package/dist/ai/message-action-sheet.jsx +408 -0
- package/dist/ai/message-quote.jsx +241 -0
- package/dist/ai/message.jsx +739 -0
- package/dist/ai/prompt-input-menu.jsx +365 -0
- package/dist/ai/prompt-input.jsx +626 -0
- package/dist/ai/reasoning.jsx +446 -0
- package/dist/ai/reply-quote-chip.jsx +278 -0
- package/dist/ai/response-text.jsx +130 -0
- package/dist/ai/shimmer.jsx +149 -0
- package/dist/ai/sources.jsx +260 -0
- package/dist/ai/subagent-cards.jsx +645 -0
- package/dist/ai/suggestion.jsx +186 -0
- package/dist/ai/tool-approval-card.jsx +359 -0
- package/dist/ai/trace.jsx +728 -0
- package/dist/ai/unified-diff.jsx +280 -0
- package/dist/ai/use-streaming-disclosure.js +70 -0
- package/dist/auth/AuthProviders.jsx +27 -0
- package/dist/auth/AuthScreen.jsx +292 -0
- package/dist/auth/GoogleSignInButton.jsx +188 -0
- package/dist/auth/SecondFactorScreen.jsx +133 -0
- package/dist/auth/SignInScreen.jsx +482 -0
- package/dist/auth/authErrors.js +131 -0
- package/dist/auth/index.js +11 -0
- package/dist/auth/totp.js +378 -0
- package/dist/blur.js +36 -0
- package/dist/brand/AppIcons.jsx +118 -0
- package/dist/brand/AppMark.jsx +128 -0
- package/dist/brand/AppWordmark.jsx +138 -0
- package/dist/brand/GoogleMark.jsx +71 -0
- package/dist/brand/ProviderIcon.jsx +192 -0
- package/dist/brand/familyApps.js +33 -0
- package/dist/brand/index.js +11 -0
- package/dist/brand/svg.js +252 -0
- package/dist/brand/vProAppBenefits.js +19 -0
- package/dist/cn.js +5 -0
- package/dist/colors.js +15 -0
- package/dist/configureTheme.js +72 -0
- package/dist/controlStyles.js +520 -0
- package/dist/definiteSize.js +12 -0
- package/dist/dialogLayout.js +18 -0
- package/dist/entries/ai.js +4 -0
- package/dist/entries/ambient.js +3 -0
- package/dist/entries/auth.js +5 -0
- package/dist/entries/bottom-sheet.js +2 -0
- package/dist/entries/brand.js +2 -0
- package/dist/entries/button.js +2 -0
- package/dist/entries/date-time.js +3 -0
- package/dist/entries/expo-router.js +4 -0
- package/dist/entries/expo-web-root.js +3 -0
- package/dist/entries/floating.js +7 -0
- package/dist/entries/gesture-handler.js +4 -0
- package/dist/entries/keyboard-controller.js +4 -0
- package/dist/entries/layout.js +16 -0
- package/dist/entries/markdown.js +4 -0
- package/dist/entries/marketing.js +3 -0
- package/dist/entries/page-title.js +7 -0
- package/dist/entries/password-input.js +3 -0
- package/dist/entries/primitives.js +57 -0
- package/dist/entries/search-input.js +3 -0
- package/dist/entries/tab-bar.js +4 -0
- package/dist/entries/theme.js +7 -0
- package/dist/entries/toast.js +5 -0
- package/dist/entries/video.js +3 -0
- package/dist/entries/webview.js +4 -0
- package/dist/examples/AiChatGallery.jsx +509 -0
- package/dist/examples/ParityGallery.jsx +1307 -0
- package/dist/floating.js +62 -0
- package/dist/glassBlur.jsx +145 -0
- package/dist/gradient.js +17 -0
- package/dist/haptics.js +44 -0
- package/dist/highlight.js +382 -0
- package/dist/index.js +85 -0
- package/dist/initials.js +4 -0
- package/dist/loadingGrid.js +81 -0
- package/dist/markdown/Markdown.jsx +515 -0
- package/dist/markdown/MarkdownTable.jsx +443 -0
- package/dist/markdown/tableText.js +68 -0
- package/dist/marketing/PricingModal.jsx +608 -0
- package/dist/marketing/UpgradeToProCard.jsx +164 -0
- package/dist/marketing/pricing.js +34 -0
- package/dist/media/ImageGallery.jsx +580 -0
- package/dist/media/MediaCard.jsx +162 -0
- package/dist/media/imageGrid.js +54 -0
- package/dist/motion.js +33 -0
- package/dist/pagerSwipe.js +104 -0
- package/dist/palette.js +104 -0
- package/dist/primitives/button.jsx +127 -0
- package/dist/primitives/card.jsx +249 -0
- package/dist/primitives/icon.jsx +37 -0
- package/dist/primitives/input.jsx +56 -0
- package/dist/primitives/keyboard-controller.jsx +207 -0
- package/dist/primitives/keyboard-parts.jsx +75 -0
- package/dist/primitives/native-only-animated-view.jsx +68 -0
- package/dist/primitives/overlay.jsx +391 -0
- package/dist/primitives/pager-gesture.jsx +131 -0
- package/dist/primitives/select-host.jsx +103 -0
- package/dist/primitives/select.jsx +555 -0
- package/dist/primitives/sheet-drag.jsx +420 -0
- package/dist/primitives/sheet-gesture.jsx +219 -0
- package/dist/primitives/swipe-row-gesture.jsx +341 -0
- package/dist/primitives/switch.jsx +105 -0
- package/dist/primitives/text.jsx +145 -0
- package/dist/primitives/toast-drag-gesture.jsx +94 -0
- package/dist/primitives/use-controllable-state.js +40 -0
- package/dist/primitives/web-click-guard.js +69 -0
- package/dist/push.js +166 -0
- package/dist/relativeTime.js +70 -0
- package/dist/router/RouterStackPageHeader.jsx +53 -0
- package/dist/selectA11y.js +32 -0
- package/dist/settings/MoreFromProjectV.jsx +168 -0
- package/dist/settings/SettingsEmptyState.jsx +102 -0
- package/dist/settings/SettingsField.jsx +49 -0
- package/dist/settings/SettingsSection.jsx +101 -0
- package/dist/settings/SettingsStack.jsx +17 -0
- package/dist/settings/SettingsToggleRow.jsx +163 -0
- package/dist/settings/projectVMobileApps.js +126 -0
- package/dist/settings/relaxedSizeStyle.js +11 -0
- package/dist/sheetDrag.js +76 -0
- package/dist/svgA11y.js +46 -0
- package/dist/swipeRow.js +161 -0
- package/dist/tabBarRoutes.js +41 -0
- package/dist/tabIndicator.js +139 -0
- package/dist/tailwind-preset.cjs +255 -0
- package/dist/tailwind-preset.d.cts +55 -0
- package/dist/theme.jsx +62 -0
- package/dist/toastChrome.js +110 -0
- package/dist/toastDrag.js +51 -0
- package/dist/toastStore.js +54 -0
- package/dist/tokens.js +70 -0
- package/dist/typography.js +40 -0
- package/dist/useReduceMotion.js +32 -0
- package/dist/useReduceTransparency.js +27 -0
- package/dist/useScheme.js +15 -0
- package/dist/video/InlineVideo.jsx +115 -0
- package/dist/webview/HtmlView.jsx +169 -0
- package/dist/webview/HtmlView.web.jsx +63 -0
- package/dist/webview/htmlView.js +43 -0
- package/package.json +70 -33
- package/src/DropdownMenu.tsx +28 -16
- package/src/FloatingTabBar.tsx +78 -41
- package/src/ai/conversation.tsx +12 -8
- package/src/glassBlur.tsx +47 -22
- package/src/primitives/swipe-row-gesture.tsx +11 -2
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Pressable, ScrollView, Text, View } from "react-native";
|
|
3
|
+
import { sizeStyle, textStyle } from "../controlStyles";
|
|
4
|
+
import { palette, withAlpha } from "../palette";
|
|
5
|
+
import { tokens } from "../tokens";
|
|
6
|
+
import { useLargerText } from "../theme";
|
|
7
|
+
import { useScheme } from "../useScheme";
|
|
8
|
+
import { MONO_FONT, chatTextSize } from "./chat-text";
|
|
9
|
+
|
|
10
|
+
/** One row of a unified diff: a hunk separator, or a line with its old and new line numbers. */
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The web Code tab type (`--diffs-font-size: 14px`, `--diffs-line-height: 22px`),
|
|
14
|
+
* the gutter padding and the width of one gutter digit.
|
|
15
|
+
*/
|
|
16
|
+
export const UNIFIED_DIFF = {
|
|
17
|
+
fontSize: 14,
|
|
18
|
+
lineHeight: 22,
|
|
19
|
+
gutterPadding: 8,
|
|
20
|
+
digitWidth: 8.5
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Larger text steps the code up as `chatTextSize("small")` does (`text-lg`), keeping the 22/14 leading. */
|
|
24
|
+
const LARGER_FONT_SIZE = 18;
|
|
25
|
+
|
|
26
|
+
/** Web `bg-emerald-500/10` and `text-emerald-700` (dark `text-emerald-300`): edit and diff added lines. */
|
|
27
|
+
export const EMERALD = {
|
|
28
|
+
fill: "#10b981",
|
|
29
|
+
light: "#047857",
|
|
30
|
+
dark: "#6ee7b7"
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** Web `text-emerald-600` (dark `text-emerald-400`), the `+n` of a diff stat. */
|
|
34
|
+
const ADDED_TEXT = {
|
|
35
|
+
light: "#059669",
|
|
36
|
+
dark: "#34d399"
|
|
37
|
+
};
|
|
38
|
+
const SIGN = {
|
|
39
|
+
added: "+",
|
|
40
|
+
removed: "-",
|
|
41
|
+
context: " "
|
|
42
|
+
};
|
|
43
|
+
const TABULAR = {
|
|
44
|
+
fontVariant: ["tabular-nums"]
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* One file's diff in one column, as the web Code tab draws it in unified view
|
|
48
|
+
* (`@pierre/diffs`): a line number gutter (the old number on a removed line,
|
|
49
|
+
* the new one otherwise), the `+`/`-` marker, and the line in mono 14 / 22.
|
|
50
|
+
* Added lines tint green and removed lines red, each at 10%; a hunk header is
|
|
51
|
+
* a muted row on the secondary surface. Long lines do not wrap: the whole
|
|
52
|
+
* diff scrolls sideways, and every row spans the widest line. With
|
|
53
|
+
* `onLinePress` a code row is a button (`Line N`); `markedLines` fills the
|
|
54
|
+
* gutter of the rows it names at 12% of the primary colour.
|
|
55
|
+
*/
|
|
56
|
+
export function UnifiedDiff(t0) {
|
|
57
|
+
const $ = _c(30);
|
|
58
|
+
const {
|
|
59
|
+
lines,
|
|
60
|
+
onLinePress,
|
|
61
|
+
linePressHint,
|
|
62
|
+
markedLines,
|
|
63
|
+
className
|
|
64
|
+
} = t0;
|
|
65
|
+
const scheme = useScheme();
|
|
66
|
+
const largerText = useLargerText();
|
|
67
|
+
const fontSize = largerText ? LARGER_FONT_SIZE : UNIFIED_DIFF.fontSize;
|
|
68
|
+
let t1;
|
|
69
|
+
if ($[0] !== lines) {
|
|
70
|
+
t1 = lines.reduce(_temp, 0);
|
|
71
|
+
$[0] = lines;
|
|
72
|
+
$[1] = t1;
|
|
73
|
+
} else {
|
|
74
|
+
t1 = $[1];
|
|
75
|
+
}
|
|
76
|
+
const widest = t1;
|
|
77
|
+
const scale = fontSize / UNIFIED_DIFF.fontSize;
|
|
78
|
+
const gutter = String(widest).length * UNIFIED_DIFF.digitWidth * scale + UNIFIED_DIFF.gutterPadding * 2;
|
|
79
|
+
const t2 = UNIFIED_DIFF.lineHeight * scale;
|
|
80
|
+
let T0;
|
|
81
|
+
let T1;
|
|
82
|
+
let t3;
|
|
83
|
+
let t4;
|
|
84
|
+
let t5;
|
|
85
|
+
let t6;
|
|
86
|
+
let t7;
|
|
87
|
+
if ($[2] !== className || $[3] !== fontSize || $[4] !== gutter || $[5] !== linePressHint || $[6] !== lines || $[7] !== markedLines || $[8] !== onLinePress || $[9] !== scheme || $[10] !== t2) {
|
|
88
|
+
const mono = {
|
|
89
|
+
fontFamily: MONO_FONT,
|
|
90
|
+
fontSize,
|
|
91
|
+
lineHeight: t2
|
|
92
|
+
};
|
|
93
|
+
T1 = ScrollView;
|
|
94
|
+
t5 = true;
|
|
95
|
+
t6 = className;
|
|
96
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
97
|
+
t7 = {
|
|
98
|
+
minWidth: "100%"
|
|
99
|
+
};
|
|
100
|
+
$[18] = t7;
|
|
101
|
+
} else {
|
|
102
|
+
t7 = $[18];
|
|
103
|
+
}
|
|
104
|
+
T0 = View;
|
|
105
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
106
|
+
t3 = {
|
|
107
|
+
flexGrow: 1
|
|
108
|
+
};
|
|
109
|
+
$[19] = t3;
|
|
110
|
+
} else {
|
|
111
|
+
t3 = $[19];
|
|
112
|
+
}
|
|
113
|
+
t4 = lines.map((line_0, index) => {
|
|
114
|
+
if (line_0.kind === "hunk") {
|
|
115
|
+
return <Text key={index} numberOfLines={1} style={[mono, textStyle("muted", scheme), {
|
|
116
|
+
backgroundColor: tokens.color.surfaceSecondary[scheme],
|
|
117
|
+
paddingHorizontal: UNIFIED_DIFF.gutterPadding
|
|
118
|
+
}]}>{line_0.text}</Text>;
|
|
119
|
+
}
|
|
120
|
+
const tint = line_0.kind === "added" ? withAlpha(EMERALD.fill, 0.1) : line_0.kind === "removed" ? withAlpha(palette.danger[scheme], 0.1) : undefined;
|
|
121
|
+
const number = line_0.kind === "removed" ? line_0.oldLine : line_0.newLine;
|
|
122
|
+
const cells = [<Text key="gutter" style={[mono, textStyle(markedLines?.has(index) ? "foreground" : "muted", scheme), TABULAR, {
|
|
123
|
+
width: gutter,
|
|
124
|
+
paddingHorizontal: UNIFIED_DIFF.gutterPadding,
|
|
125
|
+
textAlign: "right"
|
|
126
|
+
}, markedLines?.has(index) ? {
|
|
127
|
+
backgroundColor: withAlpha(palette.primary[scheme], 0.12)
|
|
128
|
+
} : null]}>{number ?? ""}</Text>, <Text key="code" selectable={onLinePress === undefined} style={[mono, textStyle("foreground", scheme), {
|
|
129
|
+
paddingRight: UNIFIED_DIFF.gutterPadding * 2
|
|
130
|
+
}]}>{`${SIGN[line_0.kind]} ${line_0.text}`}</Text>];
|
|
131
|
+
if (onLinePress === undefined) {
|
|
132
|
+
return <View key={index} className="flex-row" style={{
|
|
133
|
+
backgroundColor: tint
|
|
134
|
+
}}>{cells}</View>;
|
|
135
|
+
}
|
|
136
|
+
return <Pressable key={index} accessibilityRole="button" accessibilityLabel={`Line ${number ?? ""}`} accessibilityHint={linePressHint} hitSlop={0} onPress={() => onLinePress(index)} className="flex-row active:opacity-60" style={{
|
|
137
|
+
backgroundColor: tint
|
|
138
|
+
}}>{cells}</Pressable>;
|
|
139
|
+
});
|
|
140
|
+
$[2] = className;
|
|
141
|
+
$[3] = fontSize;
|
|
142
|
+
$[4] = gutter;
|
|
143
|
+
$[5] = linePressHint;
|
|
144
|
+
$[6] = lines;
|
|
145
|
+
$[7] = markedLines;
|
|
146
|
+
$[8] = onLinePress;
|
|
147
|
+
$[9] = scheme;
|
|
148
|
+
$[10] = t2;
|
|
149
|
+
$[11] = T0;
|
|
150
|
+
$[12] = T1;
|
|
151
|
+
$[13] = t3;
|
|
152
|
+
$[14] = t4;
|
|
153
|
+
$[15] = t5;
|
|
154
|
+
$[16] = t6;
|
|
155
|
+
$[17] = t7;
|
|
156
|
+
} else {
|
|
157
|
+
T0 = $[11];
|
|
158
|
+
T1 = $[12];
|
|
159
|
+
t3 = $[13];
|
|
160
|
+
t4 = $[14];
|
|
161
|
+
t5 = $[15];
|
|
162
|
+
t6 = $[16];
|
|
163
|
+
t7 = $[17];
|
|
164
|
+
}
|
|
165
|
+
let t8;
|
|
166
|
+
if ($[20] !== T0 || $[21] !== t3 || $[22] !== t4) {
|
|
167
|
+
t8 = <T0 style={t3}>{t4}</T0>;
|
|
168
|
+
$[20] = T0;
|
|
169
|
+
$[21] = t3;
|
|
170
|
+
$[22] = t4;
|
|
171
|
+
$[23] = t8;
|
|
172
|
+
} else {
|
|
173
|
+
t8 = $[23];
|
|
174
|
+
}
|
|
175
|
+
let t9;
|
|
176
|
+
if ($[24] !== T1 || $[25] !== t5 || $[26] !== t6 || $[27] !== t7 || $[28] !== t8) {
|
|
177
|
+
t9 = <T1 horizontal={t5} className={t6} contentContainerStyle={t7}>{t8}</T1>;
|
|
178
|
+
$[24] = T1;
|
|
179
|
+
$[25] = t5;
|
|
180
|
+
$[26] = t6;
|
|
181
|
+
$[27] = t7;
|
|
182
|
+
$[28] = t8;
|
|
183
|
+
$[29] = t9;
|
|
184
|
+
} else {
|
|
185
|
+
t9 = $[29];
|
|
186
|
+
}
|
|
187
|
+
return t9;
|
|
188
|
+
}
|
|
189
|
+
function _temp(max, line) {
|
|
190
|
+
return line.kind === "hunk" ? max : Math.max(max, line.oldLine ?? 0, line.newLine ?? 0);
|
|
191
|
+
}
|
|
192
|
+
/** The web `PrDiffStat`: `+n` in emerald and `−m` in the destructive colour, tabular mono. */
|
|
193
|
+
export function DiffStat(t0) {
|
|
194
|
+
const $ = _c(21);
|
|
195
|
+
const {
|
|
196
|
+
additions,
|
|
197
|
+
deletions,
|
|
198
|
+
hideZero: t1,
|
|
199
|
+
className
|
|
200
|
+
} = t0;
|
|
201
|
+
const hideZero = t1 === undefined ? false : t1;
|
|
202
|
+
const scheme = useScheme();
|
|
203
|
+
const largerText = useLargerText();
|
|
204
|
+
let t2;
|
|
205
|
+
if ($[0] !== largerText) {
|
|
206
|
+
t2 = sizeStyle(chatTextSize("small", largerText));
|
|
207
|
+
$[0] = largerText;
|
|
208
|
+
$[1] = t2;
|
|
209
|
+
} else {
|
|
210
|
+
t2 = $[1];
|
|
211
|
+
}
|
|
212
|
+
let t3;
|
|
213
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
214
|
+
t3 = {
|
|
215
|
+
fontFamily: MONO_FONT
|
|
216
|
+
};
|
|
217
|
+
$[2] = t3;
|
|
218
|
+
} else {
|
|
219
|
+
t3 = $[2];
|
|
220
|
+
}
|
|
221
|
+
let t4;
|
|
222
|
+
if ($[3] !== t2) {
|
|
223
|
+
t4 = [t2, TABULAR, t3];
|
|
224
|
+
$[3] = t2;
|
|
225
|
+
$[4] = t4;
|
|
226
|
+
} else {
|
|
227
|
+
t4 = $[4];
|
|
228
|
+
}
|
|
229
|
+
const stat = t4;
|
|
230
|
+
const t5 = `${additions} additions, ${deletions} deletions`;
|
|
231
|
+
let t6;
|
|
232
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
233
|
+
t6 = {
|
|
234
|
+
flexDirection: "row",
|
|
235
|
+
flexShrink: 0,
|
|
236
|
+
gap: 4
|
|
237
|
+
};
|
|
238
|
+
$[5] = t6;
|
|
239
|
+
} else {
|
|
240
|
+
t6 = $[5];
|
|
241
|
+
}
|
|
242
|
+
let t7;
|
|
243
|
+
if ($[6] !== additions || $[7] !== hideZero || $[8] !== scheme || $[9] !== stat) {
|
|
244
|
+
t7 = hideZero && additions === 0 ? null : <Text style={[stat, {
|
|
245
|
+
color: ADDED_TEXT[scheme]
|
|
246
|
+
}]}>{`+${additions.toLocaleString()}`}</Text>;
|
|
247
|
+
$[6] = additions;
|
|
248
|
+
$[7] = hideZero;
|
|
249
|
+
$[8] = scheme;
|
|
250
|
+
$[9] = stat;
|
|
251
|
+
$[10] = t7;
|
|
252
|
+
} else {
|
|
253
|
+
t7 = $[10];
|
|
254
|
+
}
|
|
255
|
+
let t8;
|
|
256
|
+
if ($[11] !== deletions || $[12] !== hideZero || $[13] !== scheme || $[14] !== stat) {
|
|
257
|
+
t8 = hideZero && deletions === 0 ? null : <Text style={[stat, {
|
|
258
|
+
color: palette.danger[scheme]
|
|
259
|
+
}]}>{`−${deletions.toLocaleString()}`}</Text>;
|
|
260
|
+
$[11] = deletions;
|
|
261
|
+
$[12] = hideZero;
|
|
262
|
+
$[13] = scheme;
|
|
263
|
+
$[14] = stat;
|
|
264
|
+
$[15] = t8;
|
|
265
|
+
} else {
|
|
266
|
+
t8 = $[15];
|
|
267
|
+
}
|
|
268
|
+
let t9;
|
|
269
|
+
if ($[16] !== className || $[17] !== t5 || $[18] !== t7 || $[19] !== t8) {
|
|
270
|
+
t9 = <View accessible={true} accessibilityLabel={t5} className={className} style={t6}>{t7}{t8}</View>;
|
|
271
|
+
$[16] = className;
|
|
272
|
+
$[17] = t5;
|
|
273
|
+
$[18] = t7;
|
|
274
|
+
$[19] = t8;
|
|
275
|
+
$[20] = t9;
|
|
276
|
+
} else {
|
|
277
|
+
t9 = $[20];
|
|
278
|
+
}
|
|
279
|
+
return t9;
|
|
280
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
const AUTO_CLOSE_DELAY_MS = 1000;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Open state for a fold that follows a live stream: it opens when streaming
|
|
7
|
+
* starts so the text is readable as it lands, and closes once, a second after
|
|
8
|
+
* streaming stops. A reader's own toggle cancels a pending auto-close. A port
|
|
9
|
+
* of the web `useStreamingDisclosure`; spread the result on a `Collapsible`
|
|
10
|
+
* or `AgentTraceCollapsible`.
|
|
11
|
+
*/
|
|
12
|
+
export function useStreamingDisclosure(isStreaming) {
|
|
13
|
+
const $ = _c(6);
|
|
14
|
+
const [open, setOpen] = useState(isStreaming);
|
|
15
|
+
const [wasStreaming, setWasStreaming] = useState(isStreaming);
|
|
16
|
+
const [closeDue, setCloseDue] = useState(false);
|
|
17
|
+
if (isStreaming !== wasStreaming) {
|
|
18
|
+
setWasStreaming(isStreaming);
|
|
19
|
+
if (isStreaming) {
|
|
20
|
+
setOpen(true);
|
|
21
|
+
setCloseDue(false);
|
|
22
|
+
} else {
|
|
23
|
+
setCloseDue(true);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
let t0;
|
|
27
|
+
let t1;
|
|
28
|
+
if ($[0] !== closeDue) {
|
|
29
|
+
t0 = () => {
|
|
30
|
+
if (!closeDue) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const timer = setTimeout(() => {
|
|
34
|
+
setOpen(false);
|
|
35
|
+
setCloseDue(false);
|
|
36
|
+
}, AUTO_CLOSE_DELAY_MS);
|
|
37
|
+
return () => clearTimeout(timer);
|
|
38
|
+
};
|
|
39
|
+
t1 = [closeDue];
|
|
40
|
+
$[0] = closeDue;
|
|
41
|
+
$[1] = t0;
|
|
42
|
+
$[2] = t1;
|
|
43
|
+
} else {
|
|
44
|
+
t0 = $[1];
|
|
45
|
+
t1 = $[2];
|
|
46
|
+
}
|
|
47
|
+
useEffect(t0, t1);
|
|
48
|
+
let t2;
|
|
49
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
50
|
+
t2 = next => {
|
|
51
|
+
setCloseDue(false);
|
|
52
|
+
setOpen(next);
|
|
53
|
+
};
|
|
54
|
+
$[3] = t2;
|
|
55
|
+
} else {
|
|
56
|
+
t2 = $[3];
|
|
57
|
+
}
|
|
58
|
+
let t3;
|
|
59
|
+
if ($[4] !== open) {
|
|
60
|
+
t3 = {
|
|
61
|
+
open,
|
|
62
|
+
onOpenChange: t2
|
|
63
|
+
};
|
|
64
|
+
$[4] = open;
|
|
65
|
+
$[5] = t3;
|
|
66
|
+
} else {
|
|
67
|
+
t3 = $[5];
|
|
68
|
+
}
|
|
69
|
+
return t3;
|
|
70
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ClerkLoaded, ClerkProvider, useAuth as useClerkAuth } from "@clerk/clerk-expo";
|
|
2
|
+
import { ConvexProvider } from "convex/react";
|
|
3
|
+
import { ConvexProviderWithClerk } from "convex/react-clerk";
|
|
4
|
+
/**
|
|
5
|
+
* The Clerk and Convex providers from the apps' root `_layout.tsx`:
|
|
6
|
+
* `ClerkProvider` › `ConvexProviderWithClerk` (with `convex`) › `ClerkLoaded`
|
|
7
|
+
* (with `loaded`) › children.
|
|
8
|
+
*/
|
|
9
|
+
export function AuthProviders({
|
|
10
|
+
children,
|
|
11
|
+
publishableKey,
|
|
12
|
+
tokenCache,
|
|
13
|
+
convex,
|
|
14
|
+
useAuth = useClerkAuth,
|
|
15
|
+
loaded = true,
|
|
16
|
+
clerk = true
|
|
17
|
+
}) {
|
|
18
|
+
if (!clerk) {
|
|
19
|
+
return convex ? <ConvexProvider client={convex}>{children}</ConvexProvider> : <>{children}</>;
|
|
20
|
+
}
|
|
21
|
+
const inner = loaded ? <ClerkLoaded>{children}</ClerkLoaded> : children;
|
|
22
|
+
return <ClerkProvider publishableKey={publishableKey} tokenCache={tokenCache}>
|
|
23
|
+
{convex ? <ConvexProviderWithClerk client={convex} useAuth={useAuth}>
|
|
24
|
+
{inner}
|
|
25
|
+
</ConvexProviderWithClerk> : inner}
|
|
26
|
+
</ClerkProvider>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { Keyboard, KeyboardAvoidingView, ScrollView, StyleSheet, Text, View } from "react-native";
|
|
4
|
+
import { cn } from "../cn";
|
|
5
|
+
import { textStyle, typeStyle } from "../controlStyles";
|
|
6
|
+
import { palette } from "../palette";
|
|
7
|
+
import { tokens } from "../tokens";
|
|
8
|
+
import { useScheme } from "../useScheme";
|
|
9
|
+
/** Space under the form while the keyboard is open, on top of its height. */
|
|
10
|
+
const KEYBOARD_EXTRA = 24;
|
|
11
|
+
|
|
12
|
+
/** The height of the open soft keyboard, or 0. Edge-to-edge Android ignores `adjustResize`, so the screen pads itself. */
|
|
13
|
+
function useKeyboardHeight() {
|
|
14
|
+
const $ = _c(2);
|
|
15
|
+
const [height, setHeight] = useState(0);
|
|
16
|
+
let t0;
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
19
|
+
t0 = () => {
|
|
20
|
+
const show = event => setHeight(event.endCoordinates.height);
|
|
21
|
+
const hide = () => setHeight(0);
|
|
22
|
+
const subs = [Keyboard.addListener("keyboardWillShow", show), Keyboard.addListener("keyboardDidShow", show), Keyboard.addListener("keyboardWillHide", hide), Keyboard.addListener("keyboardDidHide", hide)];
|
|
23
|
+
return () => subs.forEach(_temp);
|
|
24
|
+
};
|
|
25
|
+
t1 = [];
|
|
26
|
+
$[0] = t0;
|
|
27
|
+
$[1] = t1;
|
|
28
|
+
} else {
|
|
29
|
+
t0 = $[0];
|
|
30
|
+
t1 = $[1];
|
|
31
|
+
}
|
|
32
|
+
useEffect(t0, t1);
|
|
33
|
+
return height;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The sign-in and sign-up frame: a keyboard-avoiding scroll view on the
|
|
38
|
+
* background colour, with a title, subtitle and the form in a column of 16.
|
|
39
|
+
* The form is centred until the keyboard opens. Then it aligns to the top and
|
|
40
|
+
* the scroll content gains the keyboard height as bottom space, so the focused
|
|
41
|
+
* field and the submit button scroll above the keyboard.
|
|
42
|
+
*/
|
|
43
|
+
function _temp(sub) {
|
|
44
|
+
return sub.remove();
|
|
45
|
+
}
|
|
46
|
+
export function AuthScreen(t0) {
|
|
47
|
+
const $ = _c(39);
|
|
48
|
+
const {
|
|
49
|
+
title,
|
|
50
|
+
subtitle,
|
|
51
|
+
children,
|
|
52
|
+
header,
|
|
53
|
+
footer,
|
|
54
|
+
testID,
|
|
55
|
+
className
|
|
56
|
+
} = t0;
|
|
57
|
+
const scheme = useScheme();
|
|
58
|
+
const keyboardHeight = useKeyboardHeight();
|
|
59
|
+
const keyboardOpen = keyboardHeight > 0;
|
|
60
|
+
const t1 = tokens.color.background[scheme];
|
|
61
|
+
let t2;
|
|
62
|
+
if ($[0] !== t1) {
|
|
63
|
+
t2 = {
|
|
64
|
+
backgroundColor: t1
|
|
65
|
+
};
|
|
66
|
+
$[0] = t1;
|
|
67
|
+
$[1] = t2;
|
|
68
|
+
} else {
|
|
69
|
+
t2 = $[1];
|
|
70
|
+
}
|
|
71
|
+
const t3 = keyboardOpen ? "justify-start" : "justify-center";
|
|
72
|
+
let t4;
|
|
73
|
+
if ($[2] !== className || $[3] !== t3) {
|
|
74
|
+
t4 = cn("grow px-6 py-12", t3, className);
|
|
75
|
+
$[2] = className;
|
|
76
|
+
$[3] = t3;
|
|
77
|
+
$[4] = t4;
|
|
78
|
+
} else {
|
|
79
|
+
t4 = $[4];
|
|
80
|
+
}
|
|
81
|
+
let t5;
|
|
82
|
+
if ($[5] !== keyboardHeight || $[6] !== keyboardOpen) {
|
|
83
|
+
t5 = keyboardOpen ? {
|
|
84
|
+
paddingBottom: keyboardHeight + KEYBOARD_EXTRA
|
|
85
|
+
} : undefined;
|
|
86
|
+
$[5] = keyboardHeight;
|
|
87
|
+
$[6] = keyboardOpen;
|
|
88
|
+
$[7] = t5;
|
|
89
|
+
} else {
|
|
90
|
+
t5 = $[7];
|
|
91
|
+
}
|
|
92
|
+
let t6;
|
|
93
|
+
if ($[8] !== scheme) {
|
|
94
|
+
t6 = textStyle("foreground", scheme);
|
|
95
|
+
$[8] = scheme;
|
|
96
|
+
$[9] = t6;
|
|
97
|
+
} else {
|
|
98
|
+
t6 = $[9];
|
|
99
|
+
}
|
|
100
|
+
let t7;
|
|
101
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
102
|
+
t7 = typeStyle("semibold");
|
|
103
|
+
$[10] = t7;
|
|
104
|
+
} else {
|
|
105
|
+
t7 = $[10];
|
|
106
|
+
}
|
|
107
|
+
let t8;
|
|
108
|
+
if ($[11] !== t6) {
|
|
109
|
+
t8 = [t6, t7];
|
|
110
|
+
$[11] = t6;
|
|
111
|
+
$[12] = t8;
|
|
112
|
+
} else {
|
|
113
|
+
t8 = $[12];
|
|
114
|
+
}
|
|
115
|
+
let t9;
|
|
116
|
+
if ($[13] !== t8 || $[14] !== title) {
|
|
117
|
+
t9 = <Text accessibilityRole="header" className="font-instrument-sans-semibold text-2xl" style={t8}>{title}</Text>;
|
|
118
|
+
$[13] = t8;
|
|
119
|
+
$[14] = title;
|
|
120
|
+
$[15] = t9;
|
|
121
|
+
} else {
|
|
122
|
+
t9 = $[15];
|
|
123
|
+
}
|
|
124
|
+
let t10;
|
|
125
|
+
if ($[16] !== scheme || $[17] !== subtitle) {
|
|
126
|
+
t10 = subtitle ? <Text className="font-instrument-sans text-base" style={textStyle("muted", scheme)}>{subtitle}</Text> : null;
|
|
127
|
+
$[16] = scheme;
|
|
128
|
+
$[17] = subtitle;
|
|
129
|
+
$[18] = t10;
|
|
130
|
+
} else {
|
|
131
|
+
t10 = $[18];
|
|
132
|
+
}
|
|
133
|
+
let t11;
|
|
134
|
+
if ($[19] !== t10 || $[20] !== t9) {
|
|
135
|
+
t11 = <View className="gap-2">{t9}{t10}</View>;
|
|
136
|
+
$[19] = t10;
|
|
137
|
+
$[20] = t9;
|
|
138
|
+
$[21] = t11;
|
|
139
|
+
} else {
|
|
140
|
+
t11 = $[21];
|
|
141
|
+
}
|
|
142
|
+
let t12;
|
|
143
|
+
if ($[22] !== children) {
|
|
144
|
+
t12 = <View className="gap-4">{children}</View>;
|
|
145
|
+
$[22] = children;
|
|
146
|
+
$[23] = t12;
|
|
147
|
+
} else {
|
|
148
|
+
t12 = $[23];
|
|
149
|
+
}
|
|
150
|
+
let t13;
|
|
151
|
+
if ($[24] !== footer) {
|
|
152
|
+
t13 = footer ? <View className="flex-row flex-wrap items-center justify-center gap-1">{footer}</View> : null;
|
|
153
|
+
$[24] = footer;
|
|
154
|
+
$[25] = t13;
|
|
155
|
+
} else {
|
|
156
|
+
t13 = $[25];
|
|
157
|
+
}
|
|
158
|
+
let t14;
|
|
159
|
+
if ($[26] !== header || $[27] !== t11 || $[28] !== t12 || $[29] !== t13) {
|
|
160
|
+
t14 = <View className="w-full max-w-sm self-center gap-6">{header}{t11}{t12}{t13}</View>;
|
|
161
|
+
$[26] = header;
|
|
162
|
+
$[27] = t11;
|
|
163
|
+
$[28] = t12;
|
|
164
|
+
$[29] = t13;
|
|
165
|
+
$[30] = t14;
|
|
166
|
+
} else {
|
|
167
|
+
t14 = $[30];
|
|
168
|
+
}
|
|
169
|
+
let t15;
|
|
170
|
+
if ($[31] !== t14 || $[32] !== t4 || $[33] !== t5 || $[34] !== testID) {
|
|
171
|
+
t15 = <ScrollView testID={testID} className="flex-1" contentContainerClassName={t4} contentContainerStyle={t5} keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag">{t14}</ScrollView>;
|
|
172
|
+
$[31] = t14;
|
|
173
|
+
$[32] = t4;
|
|
174
|
+
$[33] = t5;
|
|
175
|
+
$[34] = testID;
|
|
176
|
+
$[35] = t15;
|
|
177
|
+
} else {
|
|
178
|
+
t15 = $[35];
|
|
179
|
+
}
|
|
180
|
+
let t16;
|
|
181
|
+
if ($[36] !== t15 || $[37] !== t2) {
|
|
182
|
+
t16 = <KeyboardAvoidingView behavior="padding" className="flex-1" style={t2}>{t15}</KeyboardAvoidingView>;
|
|
183
|
+
$[36] = t15;
|
|
184
|
+
$[37] = t2;
|
|
185
|
+
$[38] = t16;
|
|
186
|
+
} else {
|
|
187
|
+
t16 = $[38];
|
|
188
|
+
}
|
|
189
|
+
return t16;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** A separator, "or", a separator: between Google and the email fields. */
|
|
193
|
+
export function OrDivider(t0) {
|
|
194
|
+
const $ = _c(15);
|
|
195
|
+
const {
|
|
196
|
+
label: t1
|
|
197
|
+
} = t0;
|
|
198
|
+
const label = t1 === undefined ? "or" : t1;
|
|
199
|
+
const scheme = useScheme();
|
|
200
|
+
const t2 = tokens.color.separator[scheme];
|
|
201
|
+
let t3;
|
|
202
|
+
if ($[0] !== t2) {
|
|
203
|
+
t3 = {
|
|
204
|
+
height: StyleSheet.hairlineWidth,
|
|
205
|
+
backgroundColor: t2
|
|
206
|
+
};
|
|
207
|
+
$[0] = t2;
|
|
208
|
+
$[1] = t3;
|
|
209
|
+
} else {
|
|
210
|
+
t3 = $[1];
|
|
211
|
+
}
|
|
212
|
+
const line = t3;
|
|
213
|
+
let t4;
|
|
214
|
+
if ($[2] !== line) {
|
|
215
|
+
t4 = <View className="flex-1" style={line} />;
|
|
216
|
+
$[2] = line;
|
|
217
|
+
$[3] = t4;
|
|
218
|
+
} else {
|
|
219
|
+
t4 = $[3];
|
|
220
|
+
}
|
|
221
|
+
let t5;
|
|
222
|
+
if ($[4] !== scheme) {
|
|
223
|
+
t5 = textStyle("muted", scheme);
|
|
224
|
+
$[4] = scheme;
|
|
225
|
+
$[5] = t5;
|
|
226
|
+
} else {
|
|
227
|
+
t5 = $[5];
|
|
228
|
+
}
|
|
229
|
+
let t6;
|
|
230
|
+
if ($[6] !== label || $[7] !== t5) {
|
|
231
|
+
t6 = <Text className="font-instrument-sans text-sm" style={t5}>{label}</Text>;
|
|
232
|
+
$[6] = label;
|
|
233
|
+
$[7] = t5;
|
|
234
|
+
$[8] = t6;
|
|
235
|
+
} else {
|
|
236
|
+
t6 = $[8];
|
|
237
|
+
}
|
|
238
|
+
let t7;
|
|
239
|
+
if ($[9] !== line) {
|
|
240
|
+
t7 = <View className="flex-1" style={line} />;
|
|
241
|
+
$[9] = line;
|
|
242
|
+
$[10] = t7;
|
|
243
|
+
} else {
|
|
244
|
+
t7 = $[10];
|
|
245
|
+
}
|
|
246
|
+
let t8;
|
|
247
|
+
if ($[11] !== t4 || $[12] !== t6 || $[13] !== t7) {
|
|
248
|
+
t8 = <View className="flex-row items-center gap-3" accessibilityElementsHidden={true} importantForAccessibility="no-hide-descendants">{t4}{t6}{t7}</View>;
|
|
249
|
+
$[11] = t4;
|
|
250
|
+
$[12] = t6;
|
|
251
|
+
$[13] = t7;
|
|
252
|
+
$[14] = t8;
|
|
253
|
+
} else {
|
|
254
|
+
t8 = $[14];
|
|
255
|
+
}
|
|
256
|
+
return t8;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** An inline error under a form, read out when it appears. Nothing without a message. */
|
|
260
|
+
export function FieldError(t0) {
|
|
261
|
+
const $ = _c(6);
|
|
262
|
+
const {
|
|
263
|
+
message,
|
|
264
|
+
testID
|
|
265
|
+
} = t0;
|
|
266
|
+
const scheme = useScheme();
|
|
267
|
+
if (!message) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
const t1 = palette.danger[scheme];
|
|
271
|
+
let t2;
|
|
272
|
+
if ($[0] !== t1) {
|
|
273
|
+
t2 = {
|
|
274
|
+
color: t1
|
|
275
|
+
};
|
|
276
|
+
$[0] = t1;
|
|
277
|
+
$[1] = t2;
|
|
278
|
+
} else {
|
|
279
|
+
t2 = $[1];
|
|
280
|
+
}
|
|
281
|
+
let t3;
|
|
282
|
+
if ($[2] !== message || $[3] !== t2 || $[4] !== testID) {
|
|
283
|
+
t3 = <Text testID={testID} accessibilityLiveRegion="polite" accessibilityRole="alert" className="font-instrument-sans text-sm" style={t2}>{message}</Text>;
|
|
284
|
+
$[2] = message;
|
|
285
|
+
$[3] = t2;
|
|
286
|
+
$[4] = testID;
|
|
287
|
+
$[5] = t3;
|
|
288
|
+
} else {
|
|
289
|
+
t3 = $[5];
|
|
290
|
+
}
|
|
291
|
+
return t3;
|
|
292
|
+
}
|