@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/highlight.js
CHANGED
|
@@ -14,8 +14,6 @@ export function loadPrismReactRenderer() {
|
|
|
14
14
|
prismReactRenderer = null;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
// `?? null`: with the real peer types installed, TypeScript keeps `undefined`
|
|
18
|
-
// in the type after the `try` (the package typecheck only sees a stub).
|
|
19
17
|
return prismReactRenderer ?? null;
|
|
20
18
|
}
|
|
21
19
|
/**
|
|
@@ -48,8 +46,6 @@ export const GITHUB_CODE_COLORS = {
|
|
|
48
46
|
deleted: "#fdaeb7"
|
|
49
47
|
}
|
|
50
48
|
};
|
|
51
|
-
|
|
52
|
-
/** Prism token types to their GitHub role. Types not listed are plain. */
|
|
53
49
|
const PRISM_ROLE = {
|
|
54
50
|
comment: "comment",
|
|
55
51
|
prolog: "comment",
|
|
@@ -111,23 +107,17 @@ export const SCRIPT_LANGUAGES = new Set(["js", "jsx", "javascript", "mjs", "cjs"
|
|
|
111
107
|
|
|
112
108
|
/** Languages `shellTokens` colours. `prism-react-renderer` bundles no shell grammar. */
|
|
113
109
|
export const SHELL_LANGUAGES = new Set(["bash", "sh", "shell", "zsh", "shellscript", "console"]);
|
|
114
|
-
|
|
115
|
-
/** Keywords Shiki colours as constants (`constant.language`, `variable.language`, a `void` type). */
|
|
116
110
|
const SCRIPT_CONSTANT_KEYWORDS = new Set(["null", "undefined", "this", "super", "void"]);
|
|
117
111
|
const IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
|
118
|
-
|
|
119
|
-
/** A token's role before context: what Prism's types say, with the Shiki differences that need no context. */
|
|
120
112
|
function scriptBaseRole({
|
|
121
113
|
types,
|
|
122
114
|
content
|
|
123
115
|
}) {
|
|
124
|
-
// Inside `${…}` Shiki keeps the punctuation in the string colour and the code in its own.
|
|
125
116
|
const interpolation = types.lastIndexOf("interpolation");
|
|
126
117
|
if (interpolation >= 0) {
|
|
127
118
|
const inner = types.slice(interpolation + 1);
|
|
128
119
|
return inner.includes("punctuation") || inner.includes("interpolation-punctuation") ? "string" : prismRole(inner);
|
|
129
120
|
}
|
|
130
|
-
// A regex character class, brackets and escapes too.
|
|
131
121
|
if (types.includes("char-class")) return "constant";
|
|
132
122
|
const role = prismRole(types);
|
|
133
123
|
if (role === "keyword" && SCRIPT_CONSTANT_KEYWORDS.has(content)) return "constant";
|
|
@@ -135,7 +125,6 @@ function scriptBaseRole({
|
|
|
135
125
|
if (types.includes("function") && content === "constructor") return "keyword";
|
|
136
126
|
return role;
|
|
137
127
|
}
|
|
138
|
-
/** Splits a token so escapes in strings and each word of plain text get a role of their own. */
|
|
139
128
|
function splitPiece(piece) {
|
|
140
129
|
const parts = piece.role === "string" && !piece.types.includes("regex") ? piece.content.split(/(\\.)/) : piece.role === "plain" ? piece.content.split(/([A-Za-z_$][\w$]*)/) : [piece.content];
|
|
141
130
|
return parts.filter(part => part !== "").map(part => ({
|
|
@@ -162,7 +151,6 @@ export function scriptTokens(lines) {
|
|
|
162
151
|
role: scriptBaseRole(token),
|
|
163
152
|
line
|
|
164
153
|
})));
|
|
165
|
-
// Indices of the pieces that are not whitespace.
|
|
166
154
|
const sig = pieces.flatMap((piece, index) => piece.content.trim() === "" ? [] : [index]);
|
|
167
155
|
const at = position => {
|
|
168
156
|
const index = sig[position];
|
|
@@ -180,7 +168,6 @@ export function scriptTokens(lines) {
|
|
|
180
168
|
}
|
|
181
169
|
return undefined;
|
|
182
170
|
};
|
|
183
|
-
// An arrow function's parameters, or a declared function's or method's.
|
|
184
171
|
const isParameterList = (open, close) => {
|
|
185
172
|
const before = at(open - 1);
|
|
186
173
|
if (isWord(before, "function") || isWord(before, "constructor")) return true;
|
|
@@ -210,7 +197,6 @@ export function scriptTokens(lines) {
|
|
|
210
197
|
}
|
|
211
198
|
let inImport = false;
|
|
212
199
|
let constPattern = 0;
|
|
213
|
-
// `Map<string, number>`: Shiki draws type-argument brackets plain, Prism as operators.
|
|
214
200
|
let generic = 0;
|
|
215
201
|
for (let position = 0; position < sig.length; position += 1) {
|
|
216
202
|
const piece = at(position);
|
|
@@ -218,7 +204,6 @@ export function scriptTokens(lines) {
|
|
|
218
204
|
const previous = at(position - 1);
|
|
219
205
|
if (piece.role === "keyword" && piece.content === "import") inImport = true;
|
|
220
206
|
if (piece.role === "keyword" && piece.content === "from") inImport = false;
|
|
221
|
-
// `const { a, b } = …`: every name in the pattern.
|
|
222
207
|
if (isWord(previous, "const") && (piece.content === "{" || piece.content === "[")) constPattern = 1;else if (constPattern > 0 && (piece.content === "{" || piece.content === "[")) constPattern += 1;else if (constPattern > 0 && (piece.content === "}" || piece.content === "]")) constPattern -= 1;
|
|
223
208
|
if (piece.role === "keyword" && piece.content === "<" && pieces[(sig[position] ?? 0) - 1]?.role === "function") {
|
|
224
209
|
piece.role = "plain";
|
|
@@ -252,14 +237,8 @@ function mergeLines(pieces, count) {
|
|
|
252
237
|
}
|
|
253
238
|
return out;
|
|
254
239
|
}
|
|
255
|
-
|
|
256
|
-
/** Shell words Shiki colours as keywords. */
|
|
257
240
|
const SHELL_KEYWORDS = new Set(["if", "then", "else", "elif", "fi", "for", "while", "until", "do", "done", "case", "esac", "in", "function", "select", "break", "continue", "return", "export", "local", "readonly", "declare"]);
|
|
258
|
-
|
|
259
|
-
/** After these a new command starts. */
|
|
260
241
|
const SHELL_COMMAND_KEYWORDS = new Set(["then", "else", "do", "if", "while", "until", "elif"]);
|
|
261
|
-
|
|
262
|
-
/** Shell builtins Shiki colours as constants (`support.function.builtin`). */
|
|
263
242
|
const SHELL_BUILTINS = new Set(["echo", "cd", "printf", "source", "set", "unset", "exit", "pwd", "read", "eval", "exec", "shift", "trap", "wait", "type", "alias", "unalias", "true", "false", "test", "ulimit", "umask", "kill"]);
|
|
264
243
|
|
|
265
244
|
/**
|
|
@@ -283,9 +262,7 @@ export function shellTokens(code) {
|
|
|
283
262
|
};
|
|
284
263
|
let index = 0;
|
|
285
264
|
let command = true;
|
|
286
|
-
// `for NAME in`: the name is plain, then `in` is a keyword.
|
|
287
265
|
let forState = "none";
|
|
288
|
-
// Inside `[ … ]` Shiki draws test operators (`-f`) as keywords and words plain.
|
|
289
266
|
let inTest = false;
|
|
290
267
|
while (index < source.length) {
|
|
291
268
|
const rest = source.slice(index);
|
|
@@ -300,7 +277,6 @@ export function shellTokens(code) {
|
|
|
300
277
|
break;
|
|
301
278
|
}
|
|
302
279
|
if (rest.startsWith('"')) {
|
|
303
|
-
// Double quotes: the string colour, with `$VAR` and `${VAR}` names plain.
|
|
304
280
|
const end = rest.slice(1).search(/(?<!\\)"/);
|
|
305
281
|
const text = end < 0 ? rest : rest.slice(0, end + 2);
|
|
306
282
|
for (const part of text.split(/(\$\{[^}]*\}|\$[A-Za-z_]\w*)/)) {
|
|
@@ -326,7 +302,6 @@ export function shellTokens(code) {
|
|
|
326
302
|
const operator = /^(?:\d?>>?&?\d?|<|\|\||\||&&|;|&|\$\(|\(|\)|`)/.exec(rest);
|
|
327
303
|
if (operator) {
|
|
328
304
|
const text = operator[0];
|
|
329
|
-
// Shiki: `|`, `||` and redirects in the keyword colour, `&&` and `;` plain.
|
|
330
305
|
push(text, text === "&&" || text === ";" || text === "$(" || text === "(" || text === ")" || text === "`" ? "plain" : "keyword");
|
|
331
306
|
index += text.length;
|
|
332
307
|
command = text !== ")" && !/^\d?>/.test(text) && text !== "<";
|
|
@@ -348,7 +323,6 @@ export function shellTokens(code) {
|
|
|
348
323
|
forState = word === "for" ? "name" : "none";
|
|
349
324
|
continue;
|
|
350
325
|
}
|
|
351
|
-
// A test's brackets are plain, and what follows them is not a command.
|
|
352
326
|
if (word === "[" || word === "[[" || word === "]" || word === "]]") {
|
|
353
327
|
push(word, "plain");
|
|
354
328
|
command = false;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { cn } from "./cn";
|
|
2
|
-
export { tokens, NativeUiProvider, useNativeUi, useLargerText, useAccentColor, DEFAULT_ACCENT } from "./theme";
|
|
2
|
+
export { tokens, NativeUiProvider, useNativeUi, useLargerText, useAccentColor, useSurface, DEFAULT_ACCENT } from "./theme";
|
|
3
3
|
export { palette, withAlpha } from "./palette";
|
|
4
4
|
export { configureTheme } from "./configureTheme";
|
|
5
|
+
export { NEUTRAL_PALETTE, NEUTRAL_CHANNELS, paintDarkFamily } from "./neutralTheme";
|
|
6
|
+
export { parseThemeMode } from "./themeModes";
|
|
7
|
+
export { createThemeModeStore } from "./themeModeStore";
|
|
5
8
|
export { fontClass, fontFamily } from "./typography";
|
|
6
9
|
export { FLOATING_INSET, FLOATING_TAB_BAR_HEIGHT, FLOATING_TAB_BAR_HEIGHT_LARGE, FLOATING_RADIUS, FLOATING_ROW_RADIUS, FLOATING_PILL_RADIUS, floatingShadow, floatingHairline, floatingFill, floatingSolidFill, tabBarReserve } from "./floating";
|
|
7
10
|
export { impactHaptic, notificationHaptic, selectionHaptic } from "./haptics";
|
|
@@ -87,7 +90,6 @@ export { ArtifactList } from "./ArtifactList";
|
|
|
87
90
|
export { MoreFromProjectV, FromProjectV } from "./settings/MoreFromProjectV";
|
|
88
91
|
export { PROJECT_V_MOBILE_APPS, projectVMobileApp, otherProjectVMobileApps, openProjectVApp, projectVAppOpenSteps, VSTORE_HOME_URL, androidIntentUrl } from "./settings/projectVMobileApps";
|
|
89
92
|
export { PINK_50, PINK_100, PINK_600, PINK_700, NEUTRAL_100, NEUTRAL_500, NEUTRAL_900, Colors } from "./colors";
|
|
90
|
-
// Family app marks and their pure data (copied from `@vvedantb/ui/brand`), and `GoogleMark`.
|
|
91
93
|
export * from "./brand";
|
|
92
94
|
export { UpgradeToProCard } from "./marketing/UpgradeToProCard";
|
|
93
95
|
export { PricingModal } from "./marketing/PricingModal";
|
package/dist/loadingGrid.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The web `LoadingState` `Drive` pixel grid (`packages/ui/src/ui/loading-state.tsx`)
|
|
3
|
-
* as plain numbers, so the timing stays testable apart from Reanimated. Each
|
|
4
|
-
* function is a worklet: the grid runs it on the UI thread every frame.
|
|
5
|
-
*
|
|
6
|
-
* Nine cells in a 3x3 grid pulse in a chevron wavefront that drives right.
|
|
7
|
-
* The 650 ms cycle is shorter than the sweep (0-360 ms of delays), so two
|
|
8
|
-
* fronts are always in flight.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
1
|
/** One pulse of a cell, in ms: the web `PATTERNS.Drive.dur`. */
|
|
12
2
|
export const DRIVE_CYCLE_MS = 650;
|
|
13
|
-
|
|
14
|
-
/** A cell's opacity at the low and high keyframes. */
|
|
15
3
|
const LOW = 0.12;
|
|
16
4
|
const HIGH = 1;
|
|
17
5
|
/** A cell's still opacity before its delay ends: the web inline `opacity: 0.15`. */
|
|
@@ -54,7 +42,6 @@ export function cssEaseInOut(x) {
|
|
|
54
42
|
|
|
55
43
|
if (x <= 0) return 0;
|
|
56
44
|
if (x >= 1) return 1;
|
|
57
|
-
// x(t) = 3(1-t)^2 t x1 + 3(1-t) t^2 x2 + t^3 rises with t, so bisect for t.
|
|
58
45
|
const curve = (t, p1, p2) => 3 * (1 - t) * (1 - t) * t * p1 + 3 * (1 - t) * t * t * p2 + t * t * t;
|
|
59
46
|
let lo = 0;
|
|
60
47
|
let hi = 1;
|
|
@@ -158,8 +158,6 @@ export function markdownStyles(scheme, body, color, headings = "default") {
|
|
|
158
158
|
...trackingStyle(12, "wide"),
|
|
159
159
|
textTransform: "uppercase",
|
|
160
160
|
color: tokens.color.muted[scheme],
|
|
161
|
-
// With the half gap each block keeps (margins do not collapse): 16 above,
|
|
162
|
-
// the next block's 8 below (the web `mt-4 mb-1.5`, collapsed).
|
|
163
161
|
marginTop: MARKDOWN_SCALE.blockGap / 2,
|
|
164
162
|
marginBottom: 0,
|
|
165
163
|
paddingBottom: 0,
|
|
@@ -173,7 +171,6 @@ export function markdownStyles(scheme, body, color, headings = "default") {
|
|
|
173
171
|
letterSpacing: -0.01 * body.fontSize * scale,
|
|
174
172
|
color,
|
|
175
173
|
marginVertical: MARKDOWN_SCALE.blockGap / 2,
|
|
176
|
-
// `react-native-marked` rules h1 and h2 off; the web has no rule.
|
|
177
174
|
paddingBottom: 0,
|
|
178
175
|
borderBottomWidth: 0
|
|
179
176
|
});
|
|
@@ -181,8 +178,6 @@ export function markdownStyles(scheme, body, color, headings = "default") {
|
|
|
181
178
|
const gap = {
|
|
182
179
|
marginVertical: MARKDOWN_SCALE.blockGap / 2
|
|
183
180
|
};
|
|
184
|
-
// The library's inline styles start from its own 16 / 24 text, so each one
|
|
185
|
-
// restates the body size, or a bold or linked word grows the line.
|
|
186
181
|
const inline = {
|
|
187
182
|
fontSize: body.fontSize,
|
|
188
183
|
lineHeight: body.lineHeight
|
|
@@ -266,11 +261,6 @@ export function inlineCodeStyle(scheme, fontSize, color) {
|
|
|
266
261
|
} : null)
|
|
267
262
|
};
|
|
268
263
|
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* A paragraph block. A component of its own so `listItem` can find it in a
|
|
272
|
-
* loose list (the parser's own paragraph is a plain `View`).
|
|
273
|
-
*/
|
|
274
264
|
function Paragraph(t0) {
|
|
275
265
|
const $ = _c(3);
|
|
276
266
|
const {
|
|
@@ -288,11 +278,6 @@ function Paragraph(t0) {
|
|
|
288
278
|
}
|
|
289
279
|
return t1;
|
|
290
280
|
}
|
|
291
|
-
/**
|
|
292
|
-
* An inline-code chip (see `codespan`). A component of its own so
|
|
293
|
-
* `restyleText` can find it: NativeWind's JSX swaps a `Text` made in this
|
|
294
|
-
* file for its own wrapper, so the type no longer equals `Text`.
|
|
295
|
-
*/
|
|
296
281
|
function InlineCode(t0) {
|
|
297
282
|
const $ = _c(3);
|
|
298
283
|
const {
|
|
@@ -310,13 +295,6 @@ function InlineCode(t0) {
|
|
|
310
295
|
}
|
|
311
296
|
return t1;
|
|
312
297
|
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* `node` with `map` applied to the style of every `Text` in it. The parser
|
|
316
|
-
* bakes the text style into each `Text`, and React Native text takes no
|
|
317
|
-
* style from a parent view, so a block that restyles its text (a quote, a
|
|
318
|
-
* table) rewrites it here. Links keep their own style.
|
|
319
|
-
*/
|
|
320
298
|
function restyleText(node, map) {
|
|
321
299
|
return Children.map(node, child => {
|
|
322
300
|
if (!isValidElement(child)) return child;
|
|
@@ -330,8 +308,6 @@ function restyleText(node, map) {
|
|
|
330
308
|
return children === undefined ? child : cloneElement(child, {}, children);
|
|
331
309
|
});
|
|
332
310
|
}
|
|
333
|
-
|
|
334
|
-
/** A link's text with its styling stripped: the strings in it, in order. */
|
|
335
311
|
function plainText(node) {
|
|
336
312
|
let out = "";
|
|
337
313
|
Children.forEach(node, child => {
|
|
@@ -339,11 +315,6 @@ function plainText(node) {
|
|
|
339
315
|
});
|
|
340
316
|
return out;
|
|
341
317
|
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* A cell's plain text, as the web reads a cell's `textContent` for Copy
|
|
345
|
-
* table: inline code without the no-break spaces that pad its chip.
|
|
346
|
-
*/
|
|
347
318
|
function cellText(cell) {
|
|
348
319
|
return nodeText(cell).trim();
|
|
349
320
|
}
|
|
@@ -362,13 +333,6 @@ export const MARKDOWN_LIST = {
|
|
|
362
333
|
itemGap: 4,
|
|
363
334
|
disc: 5
|
|
364
335
|
};
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* `react-native-marked`'s renderer with native-ui code and lists: `CodeBlock`
|
|
368
|
-
* panels, inline-code chips, and lists drawn as the web `.markdown` lists
|
|
369
|
-
* (the library's own markers apply its marker style to every item). Links,
|
|
370
|
-
* quotes and tables are drawn here too.
|
|
371
|
-
*/
|
|
372
336
|
class NativeUiMarkdownRenderer extends Renderer {
|
|
373
337
|
constructor(scheme, fontSize, color, onCopyCode, onCopyTable, renderLink) {
|
|
374
338
|
super();
|
|
@@ -379,12 +343,6 @@ class NativeUiMarkdownRenderer extends Renderer {
|
|
|
379
343
|
this.onCopyTable = onCopyTable;
|
|
380
344
|
this.renderLink = renderLink;
|
|
381
345
|
}
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* Web `.markdown-link`, medium weight. The parser gives a link the
|
|
385
|
-
* paragraph's regular face, so the face is set here, on the link and the
|
|
386
|
-
* text in it.
|
|
387
|
-
*/
|
|
388
346
|
link(children, href, styles, title) {
|
|
389
347
|
const custom = this.renderLink?.(href, plainText(children));
|
|
390
348
|
if (custom !== undefined) return <Fragment key={this.getKey()}>{custom}</Fragment>;
|
|
@@ -396,11 +354,8 @@ class NativeUiMarkdownRenderer extends Renderer {
|
|
|
396
354
|
const content = typeof children === "string" ? children : Children.toArray(restyleText(children, medium));
|
|
397
355
|
return super.link(content, href, medium(styles ?? {}), title);
|
|
398
356
|
}
|
|
399
|
-
|
|
400
|
-
/** Web `.markdown blockquote`: the left rule, and the text in the muted colour. */
|
|
401
357
|
blockquote(children, styles) {
|
|
402
358
|
const muted = tokens.color.muted[this.scheme];
|
|
403
|
-
// The inner blocks' outer margins come off, as web margins collapse into the quote's.
|
|
404
359
|
return <View key={this.getKey()} style={styles}>
|
|
405
360
|
<View style={{
|
|
406
361
|
marginVertical: -MARKDOWN_SCALE.blockGap / 2
|
|
@@ -412,11 +367,6 @@ class NativeUiMarkdownRenderer extends Renderer {
|
|
|
412
367
|
</View>
|
|
413
368
|
</View>;
|
|
414
369
|
}
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* The web table on its panel (`MarkdownTable`): header cells semibold,
|
|
418
|
-
* rows split by a 70% border, and the table actions above it.
|
|
419
|
-
*/
|
|
420
370
|
table(header, rows) {
|
|
421
371
|
const {
|
|
422
372
|
fontScale,
|
|
@@ -424,7 +374,6 @@ class NativeUiMarkdownRenderer extends Renderer {
|
|
|
424
374
|
} = MARKDOWN_TABLE;
|
|
425
375
|
const small = style => {
|
|
426
376
|
const size = typeof style.fontSize === "number" ? style.fontSize * fontScale : this.fontSize * fontScale;
|
|
427
|
-
// Body text takes the table line height; inline code keeps its own.
|
|
428
377
|
return style.fontFamily === MONO_FONT ? {
|
|
429
378
|
...style,
|
|
430
379
|
fontSize: size
|
|
@@ -453,12 +402,6 @@ class NativeUiMarkdownRenderer extends Renderer {
|
|
|
453
402
|
{children}
|
|
454
403
|
</Paragraph>;
|
|
455
404
|
}
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* A loose list (items a blank line apart, as Eva's doc editor writes them)
|
|
459
|
-
* puts each item's text in a paragraph. Its outer margins come off, as in
|
|
460
|
-
* a quote, so the text sits on the marker's line, as the tight list.
|
|
461
|
-
*/
|
|
462
405
|
listItem(children, styles) {
|
|
463
406
|
const loose = children.some(child => isValidElement(child) && child.type === Paragraph);
|
|
464
407
|
if (!loose) return super.listItem(children, styles);
|
|
@@ -472,7 +415,6 @@ class NativeUiMarkdownRenderer extends Renderer {
|
|
|
472
415
|
return <CodeBlock key={this.getKey()} variant="markdown" code={text} language={language || undefined} onCopy={this.onCopyCode} />;
|
|
473
416
|
}
|
|
474
417
|
codespan(text) {
|
|
475
|
-
// Text in Text takes no padding: no-break spaces pad the chip and keep it on one line.
|
|
476
418
|
return <InlineCode key={this.getKey()} style={inlineCodeStyle(this.scheme, this.fontSize, this.color)}>
|
|
477
419
|
{`\u00A0${text}\u00A0`}
|
|
478
420
|
</InlineCode>;
|
|
@@ -480,7 +422,6 @@ class NativeUiMarkdownRenderer extends Renderer {
|
|
|
480
422
|
list(ordered, li, _listStyle, textStyle, startIndex = 1) {
|
|
481
423
|
const muted = tokens.color.muted[this.scheme];
|
|
482
424
|
const lineHeight = typeof textStyle?.lineHeight === "number" ? textStyle.lineHeight : 24;
|
|
483
|
-
// A drawn disc: the font's bullet glyph is far smaller than the web `disc` marker.
|
|
484
425
|
const disc = MARKDOWN_LIST.disc;
|
|
485
426
|
return <View key={this.getKey()} style={{
|
|
486
427
|
marginVertical: MARKDOWN_SCALE.blockGap / 2,
|
|
@@ -30,27 +30,14 @@ export const MARKDOWN_TABLE = {
|
|
|
30
30
|
bottom: 6
|
|
31
31
|
},
|
|
32
32
|
tableMargin: 10,
|
|
33
|
-
/** The web action row: 24 buttons in a 27 row. */
|
|
34
33
|
actionsHeight: 27,
|
|
35
|
-
/**
|
|
36
|
-
* The web buttons sit 4 apart; here 16, so each slops to 44 without
|
|
37
|
-
* taking its neighbour's taps.
|
|
38
|
-
*/
|
|
39
34
|
actionsGap: 16
|
|
40
35
|
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The full-screen table sizes each column to its text, as the web table does
|
|
44
|
-
* (`markdownTableColumnWidths`). 8.5 a character fits the 12 mono of inline
|
|
45
|
-
* code with its chip padding, so a code cell does not wrap; body text is narrower.
|
|
46
|
-
*/
|
|
47
36
|
const FULL_SCREEN_COLUMN = {
|
|
48
37
|
charWidth: 8.5,
|
|
49
38
|
min: 72,
|
|
50
39
|
max: 320
|
|
51
40
|
};
|
|
52
|
-
|
|
53
|
-
/** The web Copy table menu, in its order. */
|
|
54
41
|
const COPY_FORMATS = [{
|
|
55
42
|
format: "markdown",
|
|
56
43
|
title: "Markdown"
|
|
@@ -61,11 +48,6 @@ const COPY_FORMATS = [{
|
|
|
61
48
|
format: "tsv",
|
|
62
49
|
title: "TSV"
|
|
63
50
|
}];
|
|
64
|
-
/**
|
|
65
|
-
* The cells as rows. `widths` gives every column its own width (the
|
|
66
|
-
* full-screen view, which scrolls sideways); without it the columns share the
|
|
67
|
-
* width equally and the cells wrap, so they line up in a chat column.
|
|
68
|
-
*/
|
|
69
51
|
function TableRows(t0) {
|
|
70
52
|
const $ = _c(17);
|
|
71
53
|
const {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* and TSV), from each cell's plain text.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
/** CSV: a cell with a comma, quote or line break is quoted, its quotes doubled. Lines join with `\n`. */
|
|
8
7
|
function toCsv({
|
|
9
8
|
headers,
|
|
10
9
|
rows
|
|
@@ -12,8 +11,6 @@ function toCsv({
|
|
|
12
11
|
const cell = text => /[",\n\r]/.test(text) ? `"${text.replace(/"/g, '""')}"` : text;
|
|
13
12
|
return [...(headers.length > 0 ? [headers] : []), ...rows].map(row => row.map(cell).join(",")).join("\n");
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
/** TSV: tabs and line breaks in a cell are written as `\t`, `\n` and `\r`. */
|
|
17
14
|
function toTsv({
|
|
18
15
|
headers,
|
|
19
16
|
rows
|
|
@@ -29,8 +26,6 @@ const MARKDOWN_ESCAPES = {
|
|
|
29
26
|
"<": "<",
|
|
30
27
|
">": ">"
|
|
31
28
|
};
|
|
32
|
-
|
|
33
|
-
/** GitHub markdown: pipes and backslashes escaped, line breaks as `<br>`, short rows padded to the header. */
|
|
34
29
|
function toMarkdown({
|
|
35
30
|
headers,
|
|
36
31
|
rows
|
|
@@ -5,12 +5,7 @@ import { sizeStyle, textStyle, typeStyle } from "../controlStyles";
|
|
|
5
5
|
import { tokens } from "../tokens";
|
|
6
6
|
import { useLargerText } from "../theme";
|
|
7
7
|
import { useScheme } from "../useScheme";
|
|
8
|
-
|
|
9
|
-
/** Web `rounded-2xl` (16) on the card. */
|
|
10
8
|
const RADIUS = tokens.radius.lg;
|
|
11
|
-
|
|
12
|
-
// The web `Button` `sm` (`h-8 px-3 text-xs`) uses `max-sm:hit-target`, 8 on
|
|
13
|
-
// each side: 32 + 16 = 48, as the native `Button` `small`.
|
|
14
9
|
const HIT_SLOP = 8;
|
|
15
10
|
/**
|
|
16
11
|
* Upgrade prompt, the native `SidebarUpgradeCard`: the title and an "Upgrade"
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// Plan types and pure helpers for `PricingModal`, the same shapes and rules as
|
|
2
|
-
// the web `PricingModal` multi-plan layout. No React Native imports.
|
|
3
|
-
|
|
4
1
|
import { V_PRO_APP_BENEFITS } from "../brand/vProAppBenefits";
|
|
5
2
|
/** `featured`, else `highlighted` (the web rule: `featured ?? highlighted`). */
|
|
6
3
|
export function isEmphasised(plan) {
|
|
@@ -67,8 +67,6 @@ export function ImageGallery(t0) {
|
|
|
67
67
|
}
|
|
68
68
|
return t4;
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
/** The hairline-ringed, rounded frame of a gallery image or grid. */
|
|
72
70
|
function useMediaFrame() {
|
|
73
71
|
const $ = _c(3);
|
|
74
72
|
const scheme = useScheme();
|
|
@@ -91,12 +89,6 @@ function useMediaFrame() {
|
|
|
91
89
|
}
|
|
92
90
|
return t2;
|
|
93
91
|
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* A lone image, sized from the column and the image's own shape and capped
|
|
97
|
-
* at 384 high, so a tall capture keeps its shape instead of being cropped.
|
|
98
|
-
* Until both are known it holds a full-width 4:3 box.
|
|
99
|
-
*/
|
|
100
92
|
function SingleImage(t0) {
|
|
101
93
|
const $ = _c(18);
|
|
102
94
|
const {
|
|
@@ -185,12 +177,6 @@ function SingleImage(t0) {
|
|
|
185
177
|
}
|
|
186
178
|
return t9;
|
|
187
179
|
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Two columns of 4:3 tiles, filled as the web grid's rows are: tiles 0 and 2
|
|
191
|
-
* on the left, 1 and 3 on the right. With three, the first fills the left
|
|
192
|
-
* column, as tall as the two on the right.
|
|
193
|
-
*/
|
|
194
180
|
function ImageGrid(t0) {
|
|
195
181
|
const $ = _c(27);
|
|
196
182
|
const {
|
|
@@ -380,8 +366,6 @@ export function ImageViewer(t0) {
|
|
|
380
366
|
}
|
|
381
367
|
return t2;
|
|
382
368
|
}
|
|
383
|
-
|
|
384
|
-
/** The zoom parts' gesture root, when there are zoom parts. */
|
|
385
369
|
function ViewerRoot(t0) {
|
|
386
370
|
const $ = _c(3);
|
|
387
371
|
const {
|
package/dist/media/imageZoom.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// The zoom rules of `ImageViewer`, as plain worklets: the gesture part
|
|
2
|
-
// (`zoom-image-gesture`) runs them on the UI thread, and tests call them.
|
|
3
|
-
|
|
4
1
|
/** Fitted size is 1; a pinch goes up to 5 and rubber-bands a little past both ends. */
|
|
5
2
|
export const ZOOM = {
|
|
6
3
|
min: 1,
|
|
@@ -56,7 +53,6 @@ export function doubleTapZoom(scale, point, size) {
|
|
|
56
53
|
y: 0
|
|
57
54
|
};
|
|
58
55
|
const next = ZOOM.doubleTap;
|
|
59
|
-
// The tapped point, from centre, moves out by `next`; shift back by that much.
|
|
60
56
|
const x = -(point.x - size.width / 2) * (next - 1);
|
|
61
57
|
const y = -(point.y - size.height / 2) * (next - 1);
|
|
62
58
|
return {
|
|
@@ -4,12 +4,6 @@ import { Image, StyleSheet, View } from "react-native";
|
|
|
4
4
|
import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
|
|
5
5
|
import Animated, { ReduceMotion, runOnJS, useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated";
|
|
6
6
|
import { clampPan, doubleTapZoom, isZoomed, settleScale, zoomScale, ZOOM } from "./imageZoom";
|
|
7
|
-
|
|
8
|
-
// Pinch, pan and double tap for an `ImageViewer` page, on Gesture Handler: the
|
|
9
|
-
// track phase runs as worklets on the UI thread, so the image never lags the
|
|
10
|
-
// fingers. The rules are plain worklets in `imageZoom`.
|
|
11
|
-
|
|
12
|
-
/** The settle after a release or a double tap: quick, no bounce past the edges. */
|
|
13
7
|
const ZOOM_SPRING = {
|
|
14
8
|
duration: 300,
|
|
15
9
|
dampingRatio: 1,
|
|
@@ -172,8 +166,6 @@ function ZoomImage(t0) {
|
|
|
172
166
|
}
|
|
173
167
|
return t10;
|
|
174
168
|
}
|
|
175
|
-
|
|
176
|
-
/** Gestures inside a `Modal` need a root view of their own. */
|
|
177
169
|
function ZoomRoot(t0) {
|
|
178
170
|
const $ = _c(2);
|
|
179
171
|
const {
|
package/dist/media/zoomImage.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
|
|
3
|
-
// The seam between `ImageViewer` and its optional zoom (`zoom-image-gesture`),
|
|
4
|
-
// kept apart from both so the gesture provider does not load the viewer.
|
|
5
|
-
|
|
6
3
|
/** The zoomable page and the root its gestures need inside the viewer's `Modal`. */
|
|
7
4
|
|
|
8
5
|
/**
|
package/dist/motion.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Easing, ReduceMotion } from "react-native-reanimated";
|
|
2
2
|
import { useReduceMotion } from "./useReduceMotion";
|
|
3
3
|
|
|
4
|
-
// The kit's motion values, from the `animate-expo` tables, so every part
|
|
5
|
-
// eases and springs in one family.
|
|
6
|
-
|
|
7
4
|
/** Strong ease-out: things entering or leaving the screen. */
|
|
8
5
|
export const EASE_OUT = Easing.bezier(0.23, 1, 0.32, 1);
|
|
9
6
|
|