@vvedantb/native-ui 0.37.2 → 0.39.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/README.md +8 -7
- package/dist/Avatar.jsx +22 -19
- package/dist/BottomSheetContainer.jsx +0 -6
- package/dist/BulkActionBar.jsx +0 -24
- package/dist/Button.jsx +92 -116
- package/dist/Card.jsx +56 -50
- package/dist/ColorSwatches.jsx +0 -6
- package/dist/Dialog.jsx +0 -12
- package/dist/DropdownMenu.jsx +0 -10
- package/dist/EmptyState.jsx +0 -3
- package/dist/ExpoWebRoot.jsx +0 -6
- package/dist/Field.jsx +0 -17
- package/dist/FloatingSurface.jsx +95 -80
- package/dist/FloatingTabBar.jsx +0 -23
- package/dist/IconButton.jsx +0 -1
- package/dist/LoadingState.jsx +0 -6
- package/dist/PasswordInput.jsx +0 -15
- package/dist/PillTabs.jsx +39 -36
- package/dist/SearchInput.jsx +0 -13
- package/dist/SectionLabel.jsx +0 -1
- package/dist/SharedTransition.jsx +0 -3
- package/dist/Skeleton.jsx +0 -2
- package/dist/Spinner.jsx +0 -2
- package/dist/StatusDot.jsx +0 -5
- package/dist/Switch.jsx +32 -22
- package/dist/Tabs.jsx +27 -26
- package/dist/Textarea.jsx +0 -1
- package/dist/ThemeToggle.jsx +0 -1
- package/dist/Toast.jsx +80 -91
- package/dist/UpdateChecker.jsx +0 -1
- package/dist/ai/activity-question.jsx +0 -6
- package/dist/ai/activity-step-label.js +0 -6
- package/dist/ai/activity-step-types.js +0 -4
- package/dist/ai/activity-tasks-utils.js +0 -17
- package/dist/ai/activity-timeline.js +0 -8
- package/dist/ai/attachments.jsx +0 -2
- package/dist/ai/chain-of-thought.jsx +0 -3
- package/dist/ai/chat-text.js +0 -1
- package/dist/ai/chat-thread.jsx +0 -1
- package/dist/ai/choice-question.jsx +0 -10
- package/dist/ai/code-block.jsx +0 -31
- package/dist/ai/collapsible.jsx +0 -14
- package/dist/ai/conversation-context.js +0 -3
- package/dist/ai/conversation.jsx +2 -48
- package/dist/ai/file-chip.jsx +0 -2
- package/dist/ai/icon-button.jsx +0 -8
- package/dist/ai/index.js +0 -5
- package/dist/ai/message-context-menu.jsx +0 -7
- package/dist/ai/message.jsx +0 -21
- package/dist/ai/prompt-input-menu.jsx +0 -3
- package/dist/ai/prompt-input.jsx +0 -27
- package/dist/ai/response-text.jsx +0 -6
- package/dist/ai/sources.jsx +0 -1
- package/dist/ai/suggestion.jsx +0 -1
- package/dist/ai/trace.jsx +0 -11
- package/dist/ai/unified-diff.jsx +0 -4
- package/dist/app-root/AuthGroupGate.jsx +65 -0
- package/dist/app-root/SsoCallbackScreen.jsx +97 -0
- package/dist/app-root/fonts.js +88 -0
- package/dist/app-root/index.js +3 -0
- package/dist/auth/AuthScreen.jsx +250 -77
- package/dist/auth/GoogleSignInButton.jsx +0 -3
- package/dist/auth/SecondFactorScreen.jsx +18 -14
- package/dist/auth/SignInScreen.jsx +40 -34
- package/dist/auth/authErrors.js +0 -4
- package/dist/auth/clerkCore3.js +0 -7
- package/dist/auth/index.js +0 -4
- package/dist/auth/totp.js +0 -2
- package/dist/brand/GoogleMark.jsx +0 -1
- package/dist/brand/ProviderIcon.jsx +0 -2
- package/dist/brand/index.js +0 -3
- package/dist/brand/svg.js +0 -6
- package/dist/configureTheme.js +0 -9
- package/dist/controlStyles.js +0 -14
- package/dist/crash/LastCrashDialog.jsx +56 -0
- package/dist/crash/lastCrash.js +192 -0
- package/dist/entries/ai.js +0 -3
- package/dist/entries/ambient.js +0 -2
- package/dist/entries/app-root.js +1 -0
- package/dist/entries/auth.js +0 -4
- package/dist/entries/bottom-sheet.js +0 -2
- package/dist/entries/brand.js +0 -1
- package/dist/entries/button.js +0 -1
- package/dist/entries/crash.js +2 -0
- package/dist/entries/date-time.js +0 -2
- package/dist/entries/expo-router.js +0 -3
- package/dist/entries/expo-web-root.js +0 -2
- package/dist/entries/floating.js +0 -2
- package/dist/entries/generative-ui.js +0 -4
- package/dist/entries/gesture-handler.js +0 -3
- package/dist/entries/keyboard-controller.js +0 -3
- package/dist/entries/layout.js +0 -2
- package/dist/entries/markdown.js +0 -3
- package/dist/entries/marketing.js +0 -1
- package/dist/entries/page-title.js +0 -5
- package/dist/entries/password-input.js +0 -2
- package/dist/entries/paste-input.js +0 -3
- package/dist/entries/primitives.js +0 -6
- package/dist/entries/search-input.js +0 -2
- package/dist/entries/tab-bar.js +0 -2
- package/dist/entries/theme.js +4 -2
- package/dist/entries/toast.js +0 -3
- package/dist/entries/video.js +0 -2
- package/dist/entries/webview.js +0 -2
- package/dist/examples/AiChatGallery.jsx +0 -11
- package/dist/examples/ParityGallery.jsx +0 -12
- package/dist/floating.js +0 -8
- package/dist/generative-ui/GenerativeUiPanel.jsx +0 -2
- package/dist/generative-ui/components.jsx +0 -8
- package/dist/glass.js +55 -0
- package/dist/glassBlur.jsx +0 -12
- package/dist/highlight.js +0 -26
- package/dist/index.js +4 -2
- package/dist/loadingGrid.js +0 -13
- package/dist/markdown/Markdown.jsx +0 -59
- package/dist/markdown/MarkdownTable.jsx +0 -18
- package/dist/markdown/tableText.js +0 -5
- package/dist/marketing/UpgradeToProCard.jsx +0 -5
- package/dist/marketing/pricing.js +0 -3
- package/dist/media/ImageGallery.jsx +0 -16
- package/dist/media/imageZoom.js +0 -4
- package/dist/media/zoom-image-gesture.jsx +0 -8
- package/dist/media/zoomImage.js +0 -3
- package/dist/motion.js +0 -3
- package/dist/neutralTheme.js +158 -0
- package/dist/pagerSwipe.js +0 -16
- package/dist/palette.js +0 -10
- package/dist/primitives/button.jsx +0 -5
- package/dist/primitives/icon.jsx +0 -4
- package/dist/primitives/keyboard-controller.jsx +0 -27
- package/dist/primitives/native-only-animated-view.jsx +0 -5
- package/dist/primitives/overlay.jsx +0 -2
- package/dist/primitives/pager-gesture.jsx +3 -29
- package/dist/primitives/paste-input.jsx +0 -5
- package/dist/primitives/select.jsx +0 -10
- package/dist/primitives/sheet-drag.jsx +0 -3
- package/dist/primitives/sheet-gesture.jsx +0 -8
- package/dist/primitives/swipe-row-gesture.jsx +3 -45
- package/dist/primitives/text.jsx +0 -5
- package/dist/primitives/toast-drag-gesture.jsx +4 -24
- package/dist/primitives/web-click-guard.js +0 -3
- package/dist/primitives/window-layer.jsx +0 -14
- package/dist/push.js +0 -6
- package/dist/relativeTime.js +0 -13
- package/dist/settings/MoreFromProjectV.jsx +0 -5
- package/dist/settings/ThemeModePicker.jsx +2 -9
- package/dist/settings/projectVMobileApps.js +1 -6
- package/dist/sheetDrag.js +0 -10
- package/dist/swipeRow.js +0 -15
- package/dist/tabBarRoutes.js +0 -4
- package/dist/tabIndicator.js +0 -4
- package/dist/tailwind-preset.cjs +0 -54
- package/dist/tailwind-preset.d.cts +0 -8
- package/dist/theme.jsx +29 -21
- package/dist/themeModeStore.js +62 -0
- package/dist/themeModes.js +9 -0
- package/dist/toastChrome.js +0 -6
- package/dist/toastDrag.js +0 -14
- package/dist/toastStore.js +0 -4
- package/dist/updateCheck.js +0 -7
- package/dist/video/InlineVideo.jsx +0 -2
- package/dist/webview/htmlView.js +0 -5
- package/package.json +47 -19
- package/src/ArtifactList.tsx +0 -2
- package/src/Avatar.tsx +3 -3
- package/src/Badge.tsx +0 -1
- package/src/BottomSheetContainer.tsx +0 -11
- package/src/BulkActionBar.tsx +0 -66
- package/src/Button.tsx +4 -40
- package/src/CaptureButton.tsx +0 -1
- package/src/Card.tsx +3 -15
- package/src/Checkbox.tsx +0 -2
- package/src/ColorSwatches.tsx +0 -9
- package/src/ConfirmDialog.tsx +0 -7
- package/src/DateTimeField.tsx +0 -5
- package/src/Dialog.tsx +0 -27
- package/src/DividedList.tsx +0 -1
- package/src/DropdownMenu.tsx +0 -51
- package/src/EmptyState.tsx +0 -5
- package/src/ExpoWebRoot.tsx +0 -10
- package/src/Field.tsx +0 -14
- package/src/FloatingFAB.tsx +0 -3
- package/src/FloatingSurface.tsx +11 -8
- package/src/FloatingTabBar.tsx +0 -25
- package/src/IconButton.tsx +0 -5
- package/src/Input.tsx +0 -1
- package/src/Label.tsx +0 -1
- package/src/LabeledSwitchRow.tsx +0 -2
- package/src/ListRow.tsx +0 -12
- package/src/LoadingState.tsx +0 -12
- package/src/MenuSheet.tsx +0 -2
- package/src/PageIndicator.tsx +0 -2
- package/src/PageTitle.tsx +0 -15
- package/src/Pager.tsx +0 -9
- package/src/PasswordInput.tsx +0 -24
- package/src/PillTabs.tsx +3 -11
- package/src/PinnedBotTile.tsx +0 -6
- package/src/Progress.tsx +0 -3
- package/src/ReactionRow.tsx +0 -8
- package/src/ScreenContainer.tsx +0 -4
- package/src/SearchInput.tsx +0 -25
- package/src/SectionLabel.tsx +0 -2
- package/src/Select.tsx +0 -6
- package/src/Separator.tsx +0 -2
- package/src/SharedTransition.tsx +0 -7
- package/src/Sheet.tsx +0 -3
- package/src/SheetRow.tsx +0 -12
- package/src/Skeleton.tsx +0 -10
- package/src/Spinner.tsx +0 -6
- package/src/StackPageHeader.tsx +0 -16
- package/src/StatGrid.tsx +0 -1
- package/src/StatusDot.tsx +0 -6
- package/src/SurfaceRow.tsx +0 -12
- package/src/SwipeableRow.tsx +0 -4
- package/src/Switch.tsx +3 -4
- package/src/Tabs.tsx +3 -27
- package/src/Textarea.tsx +0 -2
- package/src/ThemeToggle.tsx +0 -1
- package/src/Toast.tsx +3 -19
- package/src/UpdateChecker.tsx +0 -46
- package/src/ai/activity-question.tsx +0 -8
- package/src/ai/activity-step-detail.tsx +0 -5
- package/src/ai/activity-step-label.ts +0 -5
- package/src/ai/activity-step-types.ts +0 -24
- package/src/ai/activity-step.tsx +0 -4
- package/src/ai/activity-tasks-utils.ts +0 -13
- package/src/ai/activity-timeline.ts +0 -6
- package/src/ai/attachments.tsx +0 -13
- package/src/ai/chain-of-thought.tsx +0 -5
- package/src/ai/chat-jump-rail.tsx +0 -2
- package/src/ai/chat-text.ts +0 -1
- package/src/ai/chat-thread.tsx +0 -9
- package/src/ai/choice-question.tsx +0 -36
- package/src/ai/code-block.tsx +0 -52
- package/src/ai/collapsible.tsx +0 -12
- package/src/ai/conversation-context.ts +0 -14
- package/src/ai/conversation.tsx +0 -58
- package/src/ai/file-chip.tsx +0 -1
- package/src/ai/icon-button.tsx +0 -17
- package/src/ai/index.ts +0 -5
- package/src/ai/message-action-sheet.tsx +0 -8
- package/src/ai/message-context-menu.tsx +0 -22
- package/src/ai/message-quote.tsx +0 -4
- package/src/ai/message.tsx +0 -66
- package/src/ai/prompt-input-menu.tsx +0 -19
- package/src/ai/prompt-input.tsx +0 -97
- package/src/ai/reasoning.tsx +0 -6
- package/src/ai/reply-quote-chip.tsx +0 -5
- package/src/ai/response-text.tsx +0 -8
- package/src/ai/shimmer.tsx +0 -2
- package/src/ai/sources.tsx +0 -3
- package/src/ai/subagent-cards.tsx +0 -13
- package/src/ai/suggestion.tsx +0 -4
- package/src/ai/tool-approval-card.tsx +0 -14
- package/src/ai/trace.tsx +0 -23
- package/src/ai/unified-diff.tsx +0 -16
- package/src/ai/use-streaming-disclosure.ts +0 -4
- package/src/app-root/AuthGroupGate.tsx +38 -0
- package/src/app-root/SsoCallbackScreen.tsx +52 -0
- package/src/app-root/fonts.ts +53 -0
- package/src/app-root/index.ts +6 -0
- package/src/auth/AccountScreens.tsx +0 -16
- package/src/auth/AuthProviders.tsx +0 -13
- package/src/auth/AuthScreen.tsx +95 -6
- package/src/auth/GoogleSignInButton.tsx +0 -12
- package/src/auth/SecondFactorScreen.tsx +17 -15
- package/src/auth/SignInScreen.tsx +103 -105
- package/src/auth/authErrors.ts +0 -6
- package/src/auth/clerkCore3.ts +0 -6
- package/src/auth/index.ts +0 -4
- package/src/auth/totp.ts +0 -13
- package/src/brand/AppIcons.tsx +0 -6
- package/src/brand/AppMark.tsx +0 -5
- package/src/brand/AppWordmark.tsx +0 -7
- package/src/brand/GoogleMark.tsx +0 -4
- package/src/brand/ProviderIcon.tsx +0 -6
- package/src/brand/familyApps.ts +0 -2
- package/src/brand/index.ts +0 -3
- package/src/brand/svg.ts +0 -9
- package/src/configureTheme.ts +0 -10
- package/src/controlStyles.ts +0 -12
- package/src/crash/LastCrashDialog.tsx +36 -0
- package/src/crash/lastCrash.ts +218 -0
- package/src/entries/ai.ts +0 -3
- package/src/entries/ambient.ts +0 -2
- package/src/entries/app-root.ts +1 -0
- package/src/entries/auth.ts +0 -4
- package/src/entries/bottom-sheet.ts +0 -2
- package/src/entries/brand.ts +0 -1
- package/src/entries/button.ts +0 -1
- package/src/entries/crash.ts +13 -0
- package/src/entries/date-time.ts +0 -2
- package/src/entries/expo-router.ts +0 -3
- package/src/entries/expo-web-root.ts +0 -2
- package/src/entries/floating.ts +0 -2
- package/src/entries/generative-ui.ts +0 -4
- package/src/entries/gesture-handler.ts +0 -3
- package/src/entries/keyboard-controller.ts +0 -3
- package/src/entries/layout.ts +0 -2
- package/src/entries/markdown.ts +0 -3
- package/src/entries/marketing.ts +0 -1
- package/src/entries/page-title.ts +0 -5
- package/src/entries/password-input.ts +0 -2
- package/src/entries/paste-input.ts +0 -3
- package/src/entries/primitives.ts +0 -6
- package/src/entries/search-input.ts +0 -2
- package/src/entries/tab-bar.ts +0 -2
- package/src/entries/theme.ts +8 -2
- package/src/entries/toast.ts +0 -3
- package/src/entries/video.ts +0 -2
- package/src/entries/webview.ts +0 -2
- package/src/examples/AiChatGallery.tsx +0 -11
- package/src/examples/ParityGallery.tsx +0 -25
- package/src/floating.ts +0 -6
- package/src/generative-ui/GenerativeUiPanel.tsx +0 -15
- package/src/generative-ui/components.tsx +0 -9
- package/src/generative-ui/context.ts +0 -2
- package/src/glass.ts +31 -0
- package/src/glassBlur.tsx +0 -15
- package/src/highlight.ts +1 -21
- package/src/index.ts +7 -2
- package/src/loadingGrid.ts +0 -12
- package/src/markdown/Markdown.tsx +0 -71
- package/src/markdown/MarkdownTable.tsx +0 -23
- package/src/markdown/tableText.ts +0 -3
- package/src/marketing/PricingModal.tsx +0 -13
- package/src/marketing/UpgradeToProCard.tsx +0 -14
- package/src/marketing/pricing.ts +0 -12
- package/src/media/ImageGallery.tsx +0 -18
- package/src/media/MediaCard.tsx +0 -8
- package/src/media/imageZoom.ts +0 -4
- package/src/media/zoom-image-gesture.tsx +0 -9
- package/src/media/zoomImage.ts +0 -5
- package/src/motion.ts +0 -3
- package/src/neutralTheme.ts +127 -0
- package/src/pagerSwipe.ts +0 -13
- package/src/palette.ts +0 -10
- package/src/pressScale.ts +0 -7
- package/src/primitives/button.tsx +0 -4
- package/src/primitives/card.tsx +0 -1
- package/src/primitives/icon.tsx +0 -2
- package/src/primitives/input.tsx +0 -4
- package/src/primitives/keyboard-controller.tsx +0 -25
- package/src/primitives/keyboard-parts.tsx +0 -27
- package/src/primitives/native-only-animated-view.tsx +0 -5
- package/src/primitives/overlay.tsx +0 -25
- package/src/primitives/pager-gesture.tsx +0 -20
- package/src/primitives/paste-input.tsx +0 -4
- package/src/primitives/paste-parts.tsx +0 -1
- package/src/primitives/select.tsx +0 -18
- package/src/primitives/sheet-drag.tsx +0 -19
- package/src/primitives/sheet-gesture.tsx +0 -22
- package/src/primitives/swipe-row-gesture.tsx +0 -33
- package/src/primitives/switch.tsx +0 -4
- package/src/primitives/text.tsx +0 -4
- package/src/primitives/toast-drag-gesture.tsx +0 -13
- package/src/primitives/web-click-guard.ts +0 -2
- package/src/primitives/window-layer.tsx +0 -18
- package/src/push.ts +0 -15
- package/src/relativeTime.ts +0 -21
- package/src/router/RouterStackPageHeader.tsx +0 -1
- package/src/settings/MoreFromProjectV.tsx +0 -8
- package/src/settings/SettingsEmptyState.tsx +0 -2
- package/src/settings/SettingsSection.tsx +0 -3
- package/src/settings/SettingsToggleRow.tsx +0 -4
- package/src/settings/ThemeModePicker.tsx +2 -16
- package/src/settings/projectVMobileApps.ts +0 -8
- package/src/sheetDrag.ts +0 -9
- package/src/swipeRow.ts +0 -23
- package/src/tabBarRoutes.ts +0 -13
- package/src/tabIndicator.ts +0 -5
- package/src/tailwind-preset.cjs +0 -54
- package/src/tailwind-preset.d.cts +0 -8
- package/src/theme.tsx +11 -2
- package/src/themeModeStore.ts +85 -0
- package/src/themeModes.ts +10 -0
- package/src/toastChrome.ts +0 -6
- package/src/toastDrag.ts +0 -13
- package/src/toastStore.ts +0 -7
- package/src/updateCheck.ts +0 -15
- package/src/video/InlineVideo.tsx +0 -5
- package/src/webview/HtmlView.tsx +0 -23
- package/src/webview/HtmlView.web.tsx +0 -1
- package/src/webview/htmlView.ts +0 -5
- package/types/prism-react-renderer.d.ts +22 -0
package/dist/ai/conversation.jsx
CHANGED
|
@@ -192,32 +192,14 @@ export function Conversation(t0) {
|
|
|
192
192
|
}
|
|
193
193
|
return t12;
|
|
194
194
|
}
|
|
195
|
-
|
|
196
|
-
/** The scroll handlers a thread's scroller passes on, as `ScrollView` and `FlatList` both take them. */
|
|
197
195
|
function _temp(current) {
|
|
198
196
|
return current === "closing" ? "none" : current;
|
|
199
197
|
}
|
|
200
|
-
/**
|
|
201
|
-
* Taps reach rows while the keyboard is up; a drag lowers it (interactively
|
|
202
|
-
* on iOS, and on Android 11+ with `KeyboardControllerProvider`, in
|
|
203
|
-
* `ConversationList`); scroll events at 60 Hz.
|
|
204
|
-
*/
|
|
205
198
|
const SCROLL_DEFAULTS = {
|
|
206
199
|
keyboardShouldPersistTaps: "handled",
|
|
207
200
|
keyboardDismissMode: Platform.OS === "ios" ? "interactive" : "on-drag",
|
|
208
201
|
scrollEventThrottle: 16
|
|
209
202
|
};
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* The wiring `ConversationContent` and `ConversationList` share: the ref the
|
|
213
|
-
* scroll button and the follow use, taps that reach rows while the keyboard is
|
|
214
|
-
* up, and the handlers that track the bottom and follow new content. The
|
|
215
|
-
* defaults come first so `props` can override them; the handlers come last
|
|
216
|
-
* and call the app's own after the thread's. An inverted list needs no
|
|
217
|
-
* follow: its newest message is at offset 0, so it stays in view as the
|
|
218
|
-
* content and the view change. While `paused` is true the bottom is not
|
|
219
|
-
* tracked: something other than the reader scrolls the list.
|
|
220
|
-
*/
|
|
221
203
|
function useConversationScroll({
|
|
222
204
|
onScroll,
|
|
223
205
|
onScrollBeginDrag,
|
|
@@ -245,12 +227,10 @@ function useConversationScroll({
|
|
|
245
227
|
conversation.settleOverlay();
|
|
246
228
|
onScrollBeginDrag?.(event_0);
|
|
247
229
|
},
|
|
248
|
-
// The app's handler first, so a scroller that measures itself (`ConversationList`) has the new size to follow.
|
|
249
230
|
onContentSizeChange: (width, height) => {
|
|
250
231
|
onContentSizeChange?.(width, height);
|
|
251
232
|
if (!inverted) conversation.followContent();
|
|
252
233
|
},
|
|
253
|
-
// The keyboard or composer resizing the view keeps the end in view too.
|
|
254
234
|
onLayout: event_1 => {
|
|
255
235
|
onLayout?.(event_1);
|
|
256
236
|
if (!inverted) conversation.followContent();
|
|
@@ -356,21 +336,14 @@ export function ConversationList({
|
|
|
356
336
|
const keyboard = useKeyboardParts();
|
|
357
337
|
const insets = useSafeAreaInsets();
|
|
358
338
|
const inverted = props.inverted === true;
|
|
359
|
-
// Sizes from the list's own events, for the scroll offset; no render reads
|
|
360
|
-
// them. `inset` is the keyboard's space past the content (before offset 0
|
|
361
|
-
// when inverted); `keyboardMoving` is true while the keyboard scrolls the
|
|
362
|
-
// list, which is not the reader leaving the bottom.
|
|
363
339
|
const size = useRef({
|
|
364
340
|
content: 0,
|
|
365
341
|
view: 0,
|
|
366
342
|
inset: 0,
|
|
367
343
|
keyboardMoving: false
|
|
368
344
|
});
|
|
369
|
-
// The list, and the row `scrollToIndex` last asked for, for its retry when that row was not drawn.
|
|
370
345
|
const listRef = useRef(null);
|
|
371
346
|
const indexTarget = useRef(null);
|
|
372
|
-
// Not inverted: hidden until the first jump to the end (see above). An
|
|
373
|
-
// empty list (a spinner, an empty state) shows at once.
|
|
374
347
|
const hasRows = (props.data?.length ?? 0) > 0;
|
|
375
348
|
const [placed, setPlaced] = useState(false);
|
|
376
349
|
const placeOnce = () => {
|
|
@@ -395,30 +368,17 @@ export function ConversationList({
|
|
|
395
368
|
inverted,
|
|
396
369
|
paused: () => size.current.keyboardMoving
|
|
397
370
|
});
|
|
398
|
-
// An inverted list would draw its empty state at the bottom, flipped back
|
|
399
|
-
// only if the element takes a `style`: draw it the right way up instead.
|
|
400
371
|
if (inverted && !hasRows) {
|
|
401
372
|
const Empty = props.ListEmptyComponent;
|
|
402
373
|
return <View style={styles.fill}>{isValidElement(Empty) ? Empty : typeof Empty === "function" ? <Empty /> : null}</View>;
|
|
403
374
|
}
|
|
404
|
-
// The newest message's offset: inverted, 0 less the space before it.
|
|
405
375
|
const end = () => inverted ? size.current.inset > 0 ? -size.current.inset : 0 : Math.max(0, size.current.content + size.current.inset - size.current.view);
|
|
406
|
-
const list_1 = <FlatList className={cn("flex-1", className)}
|
|
407
|
-
// Inverted, the column's end is the top: a short thread sits there.
|
|
408
|
-
contentContainerClassName={cn("px-3 py-3", inverted && "grow justify-end", contentContainerClassName)} {...wired} style={[wired.style, !inverted && hasRows && !placed ? styles.hidden : null]}
|
|
409
|
-
// At the bottom, a new message shows at offset 0; scrolled up, it must not move what the reader sees.
|
|
410
|
-
maintainVisibleContentPosition={props.maintainVisibleContentPosition ?? (inverted && !conversation.isAtBottom ? KEEP_VISIBLE : undefined)} keyboardDismissMode={props.keyboardDismissMode ?? (keyboard?.interactive ? "interactive" : SCROLL_DEFAULTS.keyboardDismissMode)} renderScrollComponent={keyboard ? scrollProps => <keyboard.ChatScrollView {...scrollProps} inverted={inverted} freeze={conversation.overlay !== "none"}
|
|
411
|
-
// The composer pads the bottom inset, which the keyboard covers: the content rises by the rest.
|
|
412
|
-
bottomOffset={insets.bottom} onInsetChange={inset => {
|
|
376
|
+
const list_1 = <FlatList className={cn("flex-1", className)} contentContainerClassName={cn("px-3 py-3", inverted && "grow justify-end", contentContainerClassName)} {...wired} style={[wired.style, !inverted && hasRows && !placed ? styles.hidden : null]} maintainVisibleContentPosition={props.maintainVisibleContentPosition ?? (inverted && !conversation.isAtBottom ? KEEP_VISIBLE : undefined)} keyboardDismissMode={props.keyboardDismissMode ?? (keyboard?.interactive ? "interactive" : SCROLL_DEFAULTS.keyboardDismissMode)} renderScrollComponent={keyboard ? scrollProps => <keyboard.ChatScrollView {...scrollProps} inverted={inverted} freeze={conversation.overlay !== "none"} bottomOffset={insets.bottom} onInsetChange={inset => {
|
|
413
377
|
size.current.inset = inset;
|
|
414
378
|
}} onKeyboardMove={moving => {
|
|
415
379
|
size.current.keyboardMoving = moving;
|
|
416
|
-
// The closing menu's window hands the focus back with a keyboard event: frozen until it ends.
|
|
417
380
|
if (!moving) conversation.settleOverlay();
|
|
418
|
-
}} /> : props.renderScrollComponent}
|
|
419
|
-
// A row the list has not drawn yet (it draws only those near the view):
|
|
420
|
-
// go to its estimated offset, which draws it, then to the row itself.
|
|
421
|
-
onScrollToIndexFailed={props.onScrollToIndexFailed ?? (info => {
|
|
381
|
+
}} /> : props.renderScrollComponent} onScrollToIndexFailed={props.onScrollToIndexFailed ?? (info => {
|
|
422
382
|
const list = listRef.current;
|
|
423
383
|
const target = indexTarget.current;
|
|
424
384
|
if (!list || !target || target.index !== info.index || target.tries >= 3) return;
|
|
@@ -445,13 +405,10 @@ export function ConversationList({
|
|
|
445
405
|
};
|
|
446
406
|
}} />;
|
|
447
407
|
if (!keyboard) return list_1;
|
|
448
|
-
// The keyboard follows the finger from the composer's top: the dock less the inset it pads.
|
|
449
408
|
return <keyboard.GestureArea offset={Math.max(0, conversation.dockHeight - insets.bottom)} style={styles.fill}>
|
|
450
409
|
{list_1}
|
|
451
410
|
</keyboard.GestureArea>;
|
|
452
411
|
}
|
|
453
|
-
|
|
454
|
-
/** Scrolled up in an inverted list: the first drawn row in view keeps its place as rows are added or grow. */
|
|
455
412
|
const KEEP_VISIBLE = {
|
|
456
413
|
minIndexForVisible: 0
|
|
457
414
|
};
|
|
@@ -618,11 +575,8 @@ export function ConversationDock(t0) {
|
|
|
618
575
|
}
|
|
619
576
|
return t4;
|
|
620
577
|
}
|
|
621
|
-
/** The scroll button fades in and out on the strong ease-out. */
|
|
622
578
|
const SCROLL_BUTTON_ENTER = FadeIn.duration(150).easing(EASE_OUT);
|
|
623
579
|
const SCROLL_BUTTON_EXIT = FadeOut.duration(120).easing(EASE_OUT);
|
|
624
|
-
|
|
625
|
-
/** The labelled pill's height (web `h-7`). */
|
|
626
580
|
const SCROLL_PILL_HEIGHT = 28;
|
|
627
581
|
|
|
628
582
|
/**
|
package/dist/ai/file-chip.jsx
CHANGED
|
@@ -9,8 +9,6 @@ import { useLargerText } from "../theme";
|
|
|
9
9
|
import { tokens } from "../tokens";
|
|
10
10
|
import { useScheme } from "../useScheme";
|
|
11
11
|
import { MONO_FONT, chatTextSize } from "./chat-text";
|
|
12
|
-
|
|
13
|
-
/** A `text-xs` line with the web `py-0.5` and border: 22 high. The slop brings it to 44. */
|
|
14
12
|
const CHIP_HEIGHT = 22;
|
|
15
13
|
function FileChipLabel(t0) {
|
|
16
14
|
const $ = _c(36);
|
package/dist/ai/icon-button.jsx
CHANGED
|
@@ -9,14 +9,6 @@ import { useScheme } from "../useScheme";
|
|
|
9
9
|
|
|
10
10
|
/** The web `icon-sm` button: 32 square with a 16 icon. */
|
|
11
11
|
export const CHAT_ICON_BUTTON_SIZE = 32;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Side and icon per size: `sm` is the web `icon-sm` (32, 16 icon), `xs` the
|
|
15
|
-
* web `icon-xs` (28, 14 icon) and `md` the web `size-9` (36, 16 icon), Eva's
|
|
16
|
-
* composer send button. `touch` has no web twin: a 44 square with a 16 icon,
|
|
17
|
-
* for a row of ghost buttons a thumb taps (the message actions), where the
|
|
18
|
-
* web 28 squares 2 apart are a mouse's density.
|
|
19
|
-
*/
|
|
20
12
|
const CHAT_ICON_BUTTON = {
|
|
21
13
|
xs: {
|
|
22
14
|
side: 28,
|
package/dist/ai/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// AI chat parts, ported from the `@vvedantb/ui` AI elements for touch. On the
|
|
2
|
-
// `@vvedantb/native-ui/ai` entry only, so apps without a chat do not bundle
|
|
3
|
-
// them. Generic: no model names and no app logic.
|
|
4
1
|
export { useStreamingDisclosure } from "./use-streaming-disclosure";
|
|
5
2
|
export { chatTextSize, formatElapsed, META_TEXT_STYLE, MONO_FONT } from "./chat-text";
|
|
6
3
|
export { Shimmer, SHIMMER_LOW_OPACITY } from "./shimmer";
|
|
@@ -16,8 +13,6 @@ export { Reasoning, ReasoningTrigger, ReasoningContent, useReasoning, reasoningM
|
|
|
16
13
|
export { AgentTrace, AgentTraceLine, AgentTraceIcon, AgentTraceTitle, AgentTraceDescription, AgentTraceCollapsible, AgentTraceCollapsibleTrigger, AgentTraceCollapsibleContent, AgentTraceFold, traceLineColor } from "./trace";
|
|
17
14
|
export { ChainOfThought, ChainOfThoughtHeader, ChainOfThoughtContent, ChainOfThoughtStep, ChainOfThoughtSearchResults, ChainOfThoughtSearchResult } from "./chain-of-thought";
|
|
18
15
|
export { ActivityStep } from "./activity-step";
|
|
19
|
-
// The web timeline's pure logic (byte-identical copies) and its folded rules.
|
|
20
|
-
// The step type is `ActivityTimelineStep` here: `ActivityStep` is the line above.
|
|
21
16
|
export { activityStepHasRichDetail } from "./activity-step-types";
|
|
22
17
|
export { deriveActionGroupSummary, deriveReadableCommandDisplay, deriveStepRowPresentation, resolveCommandVisualKind } from "./activity-step-label";
|
|
23
18
|
export { activityRowKey, activitySegmentKey, buildActivityRows, groupActivityRows } from "./activity-tasks-utils";
|
|
@@ -13,8 +13,6 @@ import { useScheme } from "../useScheme";
|
|
|
13
13
|
import { chatTextSize } from "./chat-text";
|
|
14
14
|
import { MESSAGE_MENU, messageContextMenuLayout } from "./message-menu-layout";
|
|
15
15
|
import { usePressed } from "../usePressed";
|
|
16
|
-
|
|
17
|
-
/** How far the held message lifts as the menu opens: a little, so a tall one stays in its room. */
|
|
18
16
|
const LIFT_SCALE = 1.02;
|
|
19
17
|
|
|
20
18
|
/**
|
|
@@ -371,11 +369,6 @@ export function MessageContextMenu(t0) {
|
|
|
371
369
|
}
|
|
372
370
|
return t30;
|
|
373
371
|
}
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* One card row: label first, icon last. While pressed it takes the
|
|
377
|
-
* `SheetRow` pressed fill, so the finger sees which row it is on.
|
|
378
|
-
*/
|
|
379
372
|
function MenuCardRow(t0) {
|
|
380
373
|
const $ = _c(41);
|
|
381
374
|
const {
|
package/dist/ai/message.jsx
CHANGED
|
@@ -24,8 +24,6 @@ const MessageContext = createContext("assistant");
|
|
|
24
24
|
|
|
25
25
|
/** How long the highlight wash takes to fade, in milliseconds. */
|
|
26
26
|
export const MESSAGE_HIGHLIGHT_MS = 1400;
|
|
27
|
-
|
|
28
|
-
/** Peak opacity of the highlight wash (the primary colour). */
|
|
29
27
|
const HIGHLIGHT_WASH = 0.18;
|
|
30
28
|
function MessageHighlight() {
|
|
31
29
|
const $ = _c(14);
|
|
@@ -101,26 +99,7 @@ function MessageHighlight() {
|
|
|
101
99
|
}
|
|
102
100
|
return t7;
|
|
103
101
|
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* One message: the web `w-full max-w-[95%] flex-col gap-2`. A user message
|
|
107
|
-
* sits at the end of the row with its parts at the end; an assistant message
|
|
108
|
-
* at the start, its parts full width.
|
|
109
|
-
*
|
|
110
|
-
* With `onLongPress` or `actions` the message is a `Pressable` (same layout,
|
|
111
|
-
* `className`, `style` and view props): a 350 ms hold dims it a little,
|
|
112
|
-
* fires a medium haptic, runs `onLongPress` and opens the
|
|
113
|
-
* `MessageActionSheet`; TalkBack reaches it as the `longpress` action. It stays
|
|
114
|
-
* a non-accessible container so its buttons and links keep their own focus:
|
|
115
|
-
* also offer the actions in a `MessageActionsBar` for screen reader users. `highlighted` draws the quote-jump highlight.
|
|
116
|
-
*/
|
|
117
|
-
/** How long a hold takes, in ms: shorter than React Native's 500, as iMessage. */
|
|
118
102
|
const HOLD_DELAY_MS = 350;
|
|
119
|
-
/**
|
|
120
|
-
* A held message dims a little. It does not shrink: the hold menu measures the
|
|
121
|
-
* message while it is held, and a scaled box would draw the lifted copy smaller
|
|
122
|
-
* (and could wrap its text differently).
|
|
123
|
-
*/
|
|
124
103
|
const HELD_STYLE = {
|
|
125
104
|
opacity: 0.9
|
|
126
105
|
};
|
|
@@ -125,13 +125,10 @@ export function PromptInputMenu(t0) {
|
|
|
125
125
|
}
|
|
126
126
|
return t10;
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
/** Web badge chip: `rounded-md bg-muted px-1.5 py-0.5 text-3xs font-medium` (10). */
|
|
130
128
|
const BADGE_TEXT = {
|
|
131
129
|
fontSize: 10,
|
|
132
130
|
lineHeight: 12
|
|
133
131
|
};
|
|
134
|
-
/** A description longer than this is cut with "…", as the web `previewOneLine`. */
|
|
135
132
|
const DESCRIPTION_MAX = 72;
|
|
136
133
|
function oneLine(text) {
|
|
137
134
|
const line = text.replace(/\s+/g, " ").trim();
|
package/dist/ai/prompt-input.jsx
CHANGED
|
@@ -22,11 +22,6 @@ import { ChatIconButton } from "./icon-button";
|
|
|
22
22
|
export function isGenerating(status) {
|
|
23
23
|
return status === "submitted" || status === "streaming";
|
|
24
24
|
}
|
|
25
|
-
// The web `PromptInputSubmit` and `PromptInputButton` keep `shape="rounded"`
|
|
26
|
-
// (`rounded-lg`, 16) as field addons. At the 32 `icon-sm` size 16 is half the
|
|
27
|
-
// side, so the web draws a circle. These stay pills: the same circle at 32, and
|
|
28
|
-
// still a circle at 44 with larger text, where 16 would draw a rounded square.
|
|
29
|
-
|
|
30
25
|
/**
|
|
31
26
|
* Send, or stop while the AI answers: the web `default` `icon-sm` button
|
|
32
27
|
* (32, round, slop to 44). Send is an up arrow on the primary fill, faded by
|
|
@@ -104,9 +99,7 @@ export const PROMPT_INPUT_CHIP = {
|
|
|
104
99
|
chevronSize: 12,
|
|
105
100
|
chevronOpacity: 0.6,
|
|
106
101
|
suffixOpacity: 0.7,
|
|
107
|
-
/** The narrowest label worth drawing: about two characters and the ellipsis at `text-sm` (2em). */
|
|
108
102
|
labelMinWidth: 28,
|
|
109
|
-
/** `size="touch"`: 36 on screen, 4 slop above and below, so a 44 bar holds its whole target. */
|
|
110
103
|
touchHeight: 36
|
|
111
104
|
};
|
|
112
105
|
/**
|
|
@@ -342,15 +335,7 @@ export function PromptInputChip(t0) {
|
|
|
342
335
|
function _temp(part) {
|
|
343
336
|
return part !== undefined;
|
|
344
337
|
}
|
|
345
|
-
/** The web `Composer` inline radius, `rounded-[1.25rem]`. */
|
|
346
338
|
const INLINE_RADIUS = 20;
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Eva's `pill` composer: 48 high on one line (border 1, then 5 around a 36
|
|
350
|
-
* field: the web `h-12 py-1` centres the 36 field and send button in 38),
|
|
351
|
-
* `pl-1.5` / `pr-1.5`, and radius 24 (`rounded-full` at 48). Its placeholder
|
|
352
|
-
* is the muted colour at 90% (`data-empty:before:text-muted-foreground/90`).
|
|
353
|
-
*/
|
|
354
339
|
const PILL = {
|
|
355
340
|
radius: 24,
|
|
356
341
|
paddingY: 5,
|
|
@@ -358,18 +343,10 @@ const PILL = {
|
|
|
358
343
|
lineHeight: 36,
|
|
359
344
|
placeholderAlpha: 0.9
|
|
360
345
|
};
|
|
361
|
-
|
|
362
|
-
/** The field grows to this height, then scrolls: about 6 lines of 24 (with `py-2.5`), and about 8 of `text-xl` with larger text. */
|
|
363
346
|
const MAX_FIELD_HEIGHT = {
|
|
364
347
|
regular: 160,
|
|
365
348
|
larger: 240
|
|
366
349
|
};
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* React Native Web draws a multiline field as a `textarea` with the HTML
|
|
370
|
-
* default of 2 rows, and the auto-grow keeps that height. One row there; on
|
|
371
|
-
* native, `numberOfLines` would lock the line count on Android, so none.
|
|
372
|
-
*/
|
|
373
350
|
const ONE_ROW = Platform.OS === "web" ? 1 : undefined;
|
|
374
351
|
|
|
375
352
|
/**
|
|
@@ -631,14 +608,10 @@ export function PromptInput(t0) {
|
|
|
631
608
|
}
|
|
632
609
|
return t25;
|
|
633
610
|
}
|
|
634
|
-
|
|
635
|
-
/** In the inline row the paste target takes the field's place: it grows across, and the field fills it. */
|
|
636
611
|
const PASTE_TARGET_INLINE = {
|
|
637
612
|
flex: 1,
|
|
638
613
|
minWidth: 0
|
|
639
614
|
};
|
|
640
|
-
|
|
641
|
-
/** The field inside the app's paste target (`PasteInputProvider`), or the field alone. */
|
|
642
615
|
function PasteTarget(t0) {
|
|
643
616
|
const $ = _c(5);
|
|
644
617
|
const {
|
|
@@ -7,12 +7,6 @@ import { useLargerText } from "../theme";
|
|
|
7
7
|
import { useScheme } from "../useScheme";
|
|
8
8
|
import { chatTextSize } from "./chat-text";
|
|
9
9
|
|
|
10
|
-
// Markdown stub. The web renders replies with Streamdown; native-ui has no
|
|
11
|
-
// markdown peer, so `ResponseText` draws the text as it is, newlines kept.
|
|
12
|
-
// An app that wants markdown can render one of these in its place:
|
|
13
|
-
// `react-native-markdown-display`, `@ronradtke/react-native-markdown-display`
|
|
14
|
-
// (a maintained fork) or `react-native-marked`.
|
|
15
|
-
|
|
16
10
|
/**
|
|
17
11
|
* The text colour `MessageContent` hands down: React Native text does not
|
|
18
12
|
* inherit a colour from its parent view, as web text does from `color`.
|
package/dist/ai/sources.jsx
CHANGED
package/dist/ai/suggestion.jsx
CHANGED
package/dist/ai/trace.jsx
CHANGED
|
@@ -11,18 +11,10 @@ import { chatTextSize, formatElapsed } from "./chat-text";
|
|
|
11
11
|
import { Collapsible, CollapsibleChevron, CollapsibleContent, CollapsibleTrigger, useCollapsible } from "./collapsible";
|
|
12
12
|
import { ResponseText } from "./response-text";
|
|
13
13
|
import { Shimmer } from "./shimmer";
|
|
14
|
-
|
|
15
|
-
// One agent step as one line: icon, title, optional faded description and an
|
|
16
|
-
// optional fold. Reasoning, tool calls, grouped calls and to-dos can all
|
|
17
|
-
// render through these parts, as on the web (`trace.tsx`). The web icon
|
|
18
|
-
// crossfade (`iconKey`) is not ported: the icon swaps at once.
|
|
19
|
-
|
|
20
14
|
/** Text and icon colour of a line: muted, or the danger colour for an error (web `text-destructive`). */
|
|
21
15
|
export function traceLineColor(status, scheme) {
|
|
22
16
|
return status === "error" ? palette.danger[scheme] : tokens.color.muted[scheme];
|
|
23
17
|
}
|
|
24
|
-
|
|
25
|
-
// Native text and icons do not inherit a colour, so the line hands its own down.
|
|
26
18
|
const TraceLineColorContext = createContext(undefined);
|
|
27
19
|
function useTraceColor() {
|
|
28
20
|
const scheme = useScheme();
|
|
@@ -394,15 +386,12 @@ export function AgentTraceCollapsible(t0) {
|
|
|
394
386
|
}
|
|
395
387
|
return t2;
|
|
396
388
|
}
|
|
397
|
-
/** No slop: the 28 high line is the whole target, as trace lines stack with no gap. */
|
|
398
389
|
const LINE_SLOP = {
|
|
399
390
|
top: 0,
|
|
400
391
|
bottom: 0,
|
|
401
392
|
left: 0,
|
|
402
393
|
right: 0
|
|
403
394
|
};
|
|
404
|
-
|
|
405
|
-
/** The chevron's slop: 4 back toward the line, 14 on past it (a 34 wide target), none above or below. */
|
|
406
395
|
const CHEVRON_SLOP = {
|
|
407
396
|
top: 0,
|
|
408
397
|
bottom: 0,
|
package/dist/ai/unified-diff.jsx
CHANGED
|
@@ -19,8 +19,6 @@ export const UNIFIED_DIFF = {
|
|
|
19
19
|
gutterPadding: 8,
|
|
20
20
|
digitWidth: 8.5
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
/** Larger text steps the code up as `chatTextSize("small")` does (`text-lg`), keeping the 22/14 leading. */
|
|
24
22
|
const LARGER_FONT_SIZE = 18;
|
|
25
23
|
|
|
26
24
|
/** Web `bg-emerald-500/10` and `text-emerald-700` (dark `text-emerald-300`): edit and diff added lines. */
|
|
@@ -29,8 +27,6 @@ export const EMERALD = {
|
|
|
29
27
|
light: "#047857",
|
|
30
28
|
dark: "#6ee7b7"
|
|
31
29
|
};
|
|
32
|
-
|
|
33
|
-
/** Web `text-emerald-600` (dark `text-emerald-400`), the `+n` of a diff stat. */
|
|
34
30
|
const ADDED_TEXT = {
|
|
35
31
|
light: "#059669",
|
|
36
32
|
dark: "#34d399"
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useAuth } from "@clerk/expo";
|
|
3
|
+
import { Redirect } from "expo-router";
|
|
4
|
+
/**
|
|
5
|
+
* The layout of an `(auth)` route group: waits for Clerk when asked, sends signed-in
|
|
6
|
+
* users on, and renders the auth stack otherwise. The app passes its own loading UI.
|
|
7
|
+
*/
|
|
8
|
+
export function AuthGroupGate(t0) {
|
|
9
|
+
const $ = _c(7);
|
|
10
|
+
const {
|
|
11
|
+
children,
|
|
12
|
+
waitForLoaded: t1,
|
|
13
|
+
loading: t2,
|
|
14
|
+
treatPendingAsSignedOut,
|
|
15
|
+
signedInHref: t3,
|
|
16
|
+
withAnchor,
|
|
17
|
+
skipSignedInRedirect: t4,
|
|
18
|
+
previewHref
|
|
19
|
+
} = t0;
|
|
20
|
+
const waitForLoaded = t1 === undefined ? true : t1;
|
|
21
|
+
const loading = t2 === undefined ? null : t2;
|
|
22
|
+
const signedInHref = t3 === undefined ? "/" : t3;
|
|
23
|
+
const skipSignedInRedirect = t4 === undefined ? false : t4;
|
|
24
|
+
let t5;
|
|
25
|
+
if ($[0] !== treatPendingAsSignedOut) {
|
|
26
|
+
t5 = treatPendingAsSignedOut === undefined ? undefined : {
|
|
27
|
+
treatPendingAsSignedOut
|
|
28
|
+
};
|
|
29
|
+
$[0] = treatPendingAsSignedOut;
|
|
30
|
+
$[1] = t5;
|
|
31
|
+
} else {
|
|
32
|
+
t5 = $[1];
|
|
33
|
+
}
|
|
34
|
+
const {
|
|
35
|
+
isSignedIn,
|
|
36
|
+
isLoaded
|
|
37
|
+
} = useAuth(t5);
|
|
38
|
+
if (waitForLoaded && !isLoaded) {
|
|
39
|
+
return loading;
|
|
40
|
+
}
|
|
41
|
+
if (isSignedIn && !skipSignedInRedirect) {
|
|
42
|
+
let t6;
|
|
43
|
+
if ($[2] !== signedInHref || $[3] !== withAnchor) {
|
|
44
|
+
t6 = <Redirect href={signedInHref} withAnchor={withAnchor} />;
|
|
45
|
+
$[2] = signedInHref;
|
|
46
|
+
$[3] = withAnchor;
|
|
47
|
+
$[4] = t6;
|
|
48
|
+
} else {
|
|
49
|
+
t6 = $[4];
|
|
50
|
+
}
|
|
51
|
+
return t6;
|
|
52
|
+
}
|
|
53
|
+
if (previewHref) {
|
|
54
|
+
let t6;
|
|
55
|
+
if ($[5] !== previewHref) {
|
|
56
|
+
t6 = <Redirect href={previewHref} />;
|
|
57
|
+
$[5] = previewHref;
|
|
58
|
+
$[6] = t6;
|
|
59
|
+
} else {
|
|
60
|
+
t6 = $[6];
|
|
61
|
+
}
|
|
62
|
+
return t6;
|
|
63
|
+
}
|
|
64
|
+
return children;
|
|
65
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useAuth } from "@clerk/expo";
|
|
3
|
+
import { Redirect, useRouter } from "expo-router";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
import { Button } from "../Button";
|
|
6
|
+
import { CenteredSpinner } from "../Spinner";
|
|
7
|
+
const DEFAULT_LOADING = <CenteredSpinner label="Signing in" />;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The `sso-callback` route of the Google sign-in redirect. `useSSO` completes the
|
|
11
|
+
* session; this screen only waits for it, then opens the app.
|
|
12
|
+
*/
|
|
13
|
+
export function SsoCallbackScreen(t0) {
|
|
14
|
+
const $ = _c(19);
|
|
15
|
+
const {
|
|
16
|
+
signedInHref: t1,
|
|
17
|
+
signedOutHref: t2,
|
|
18
|
+
withAnchor,
|
|
19
|
+
treatPendingAsSignedOut,
|
|
20
|
+
loading: t3,
|
|
21
|
+
backLabel,
|
|
22
|
+
className: t4
|
|
23
|
+
} = t0;
|
|
24
|
+
const signedInHref = t1 === undefined ? "/" : t1;
|
|
25
|
+
const signedOutHref = t2 === undefined ? "/sign-in" : t2;
|
|
26
|
+
const loading = t3 === undefined ? DEFAULT_LOADING : t3;
|
|
27
|
+
const className = t4 === undefined ? "flex-1 items-center justify-center gap-6 px-6" : t4;
|
|
28
|
+
let t5;
|
|
29
|
+
if ($[0] !== treatPendingAsSignedOut) {
|
|
30
|
+
t5 = treatPendingAsSignedOut === undefined ? undefined : {
|
|
31
|
+
treatPendingAsSignedOut
|
|
32
|
+
};
|
|
33
|
+
$[0] = treatPendingAsSignedOut;
|
|
34
|
+
$[1] = t5;
|
|
35
|
+
} else {
|
|
36
|
+
t5 = $[1];
|
|
37
|
+
}
|
|
38
|
+
const {
|
|
39
|
+
isLoaded,
|
|
40
|
+
isSignedIn
|
|
41
|
+
} = useAuth(t5);
|
|
42
|
+
const router = useRouter();
|
|
43
|
+
if (isLoaded && isSignedIn) {
|
|
44
|
+
let t6;
|
|
45
|
+
if ($[2] !== signedInHref || $[3] !== withAnchor) {
|
|
46
|
+
t6 = <Redirect href={signedInHref} withAnchor={withAnchor} />;
|
|
47
|
+
$[2] = signedInHref;
|
|
48
|
+
$[3] = withAnchor;
|
|
49
|
+
$[4] = t6;
|
|
50
|
+
} else {
|
|
51
|
+
t6 = $[4];
|
|
52
|
+
}
|
|
53
|
+
return t6;
|
|
54
|
+
}
|
|
55
|
+
if (backLabel === undefined) {
|
|
56
|
+
let t6;
|
|
57
|
+
if ($[5] !== isLoaded || $[6] !== loading || $[7] !== signedOutHref) {
|
|
58
|
+
t6 = isLoaded ? <Redirect href={signedOutHref} /> : loading;
|
|
59
|
+
$[5] = isLoaded;
|
|
60
|
+
$[6] = loading;
|
|
61
|
+
$[7] = signedOutHref;
|
|
62
|
+
$[8] = t6;
|
|
63
|
+
} else {
|
|
64
|
+
t6 = $[8];
|
|
65
|
+
}
|
|
66
|
+
return t6;
|
|
67
|
+
}
|
|
68
|
+
let t6;
|
|
69
|
+
if ($[9] !== router || $[10] !== signedOutHref) {
|
|
70
|
+
t6 = () => router.replace(signedOutHref);
|
|
71
|
+
$[9] = router;
|
|
72
|
+
$[10] = signedOutHref;
|
|
73
|
+
$[11] = t6;
|
|
74
|
+
} else {
|
|
75
|
+
t6 = $[11];
|
|
76
|
+
}
|
|
77
|
+
let t7;
|
|
78
|
+
if ($[12] !== backLabel || $[13] !== t6) {
|
|
79
|
+
t7 = <Button variant="ghost" fullWidth={false} onPress={t6}>{backLabel}</Button>;
|
|
80
|
+
$[12] = backLabel;
|
|
81
|
+
$[13] = t6;
|
|
82
|
+
$[14] = t7;
|
|
83
|
+
} else {
|
|
84
|
+
t7 = $[14];
|
|
85
|
+
}
|
|
86
|
+
let t8;
|
|
87
|
+
if ($[15] !== className || $[16] !== loading || $[17] !== t7) {
|
|
88
|
+
t8 = <View className={className}>{loading}{t7}</View>;
|
|
89
|
+
$[15] = className;
|
|
90
|
+
$[16] = loading;
|
|
91
|
+
$[17] = t7;
|
|
92
|
+
$[18] = t8;
|
|
93
|
+
} else {
|
|
94
|
+
t8 = $[18];
|
|
95
|
+
}
|
|
96
|
+
return t8;
|
|
97
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { InstrumentSans_400Regular } from "@expo-google-fonts/instrument-sans/400Regular";
|
|
3
|
+
import { InstrumentSans_500Medium } from "@expo-google-fonts/instrument-sans/500Medium";
|
|
4
|
+
import { InstrumentSans_600SemiBold } from "@expo-google-fonts/instrument-sans/600SemiBold";
|
|
5
|
+
import { InstrumentSans_700Bold } from "@expo-google-fonts/instrument-sans/700Bold";
|
|
6
|
+
import { InstrumentSans_400Regular_Italic } from "@expo-google-fonts/instrument-sans/400Regular_Italic";
|
|
7
|
+
import { InstrumentSans_500Medium_Italic } from "@expo-google-fonts/instrument-sans/500Medium_Italic";
|
|
8
|
+
import { InstrumentSans_600SemiBold_Italic } from "@expo-google-fonts/instrument-sans/600SemiBold_Italic";
|
|
9
|
+
import { InstrumentSans_700Bold_Italic } from "@expo-google-fonts/instrument-sans/700Bold_Italic";
|
|
10
|
+
import { useFonts } from "expo-font";
|
|
11
|
+
import * as SplashScreen from "expo-splash-screen";
|
|
12
|
+
import { useEffect } from "react";
|
|
13
|
+
|
|
14
|
+
/** The font sources `useFonts` takes: family name to module. */
|
|
15
|
+
|
|
16
|
+
const UPRIGHT = {
|
|
17
|
+
InstrumentSans_400Regular,
|
|
18
|
+
InstrumentSans_500Medium,
|
|
19
|
+
InstrumentSans_600SemiBold,
|
|
20
|
+
InstrumentSans_700Bold
|
|
21
|
+
};
|
|
22
|
+
const ITALIC = {
|
|
23
|
+
InstrumentSans_400Regular_Italic,
|
|
24
|
+
InstrumentSans_500Medium_Italic,
|
|
25
|
+
InstrumentSans_600SemiBold_Italic,
|
|
26
|
+
InstrumentSans_700Bold_Italic
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** The Instrument Sans fonts the `font-instrument-sans*` classes use, plus any `extra`. */
|
|
30
|
+
export function instrumentSansFontMap({
|
|
31
|
+
italics = false,
|
|
32
|
+
extra
|
|
33
|
+
} = {}) {
|
|
34
|
+
return {
|
|
35
|
+
...extra,
|
|
36
|
+
...UPRIGHT,
|
|
37
|
+
...(italics ? ITALIC : undefined)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** `[loaded, error]` as `useFonts` returns them, for the Instrument Sans map. */
|
|
42
|
+
export function useInstrumentSansFonts(t0) {
|
|
43
|
+
const $ = _c(4);
|
|
44
|
+
let t1;
|
|
45
|
+
if ($[0] !== t0) {
|
|
46
|
+
t1 = t0 === undefined ? {} : t0;
|
|
47
|
+
$[0] = t0;
|
|
48
|
+
$[1] = t1;
|
|
49
|
+
} else {
|
|
50
|
+
t1 = $[1];
|
|
51
|
+
}
|
|
52
|
+
const options = t1;
|
|
53
|
+
let t2;
|
|
54
|
+
if ($[2] !== options) {
|
|
55
|
+
t2 = instrumentSansFontMap(options);
|
|
56
|
+
$[2] = options;
|
|
57
|
+
$[3] = t2;
|
|
58
|
+
} else {
|
|
59
|
+
t2 = $[3];
|
|
60
|
+
}
|
|
61
|
+
return useFonts(t2);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Hides the native splash once `ready` is true. Call `SplashScreen.preventAutoHideAsync()`
|
|
66
|
+
* at module load in the app, so the call site keeps the timing. A failed hide is ignored.
|
|
67
|
+
*/
|
|
68
|
+
export function useHideSplashWhenReady(ready) {
|
|
69
|
+
const $ = _c(3);
|
|
70
|
+
let t0;
|
|
71
|
+
let t1;
|
|
72
|
+
if ($[0] !== ready) {
|
|
73
|
+
t0 = () => {
|
|
74
|
+
if (ready) {
|
|
75
|
+
SplashScreen.hideAsync().catch(_temp);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
t1 = [ready];
|
|
79
|
+
$[0] = ready;
|
|
80
|
+
$[1] = t0;
|
|
81
|
+
$[2] = t1;
|
|
82
|
+
} else {
|
|
83
|
+
t0 = $[1];
|
|
84
|
+
t1 = $[2];
|
|
85
|
+
}
|
|
86
|
+
useEffect(t0, t1);
|
|
87
|
+
}
|
|
88
|
+
function _temp() {}
|