@farcaster/snap 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ import { SnapViewCore, SnapLoadingOverlay } from "../snap-view-core.js";
6
6
  import { resolveSnapPaletteHex } from "../lib/resolve-palette-hex.js";
7
7
  const SNAP_MAX_HEIGHT = 500;
8
8
  const SNAP_WARNING_HEIGHT = 700;
9
+ const SHOW_MORE_OVERHANG = 14;
9
10
  // ─── Default validation error fallback ────────────────
10
11
  function SnapValidationFallback({ appearance, message, }) {
11
12
  const isDark = appearance === "dark";
@@ -83,7 +84,9 @@ export function SnapCardV2({ snap, handlers, loading = false, appearance = "dark
83
84
  }, [isExpandable]);
84
85
  const isClipped = !showOverflowWarning && isExpandable && !isExpanded;
85
86
  const containerMaxHeight = showOverflowWarning ? SNAP_WARNING_HEIGHT : undefined;
86
- return (_jsxs(_Fragment, { children: [_jsxs("div", { style: {
87
+ return (_jsxs("div", { style: {
88
+ paddingBottom: !showOverflowWarning && isExpandable ? SHOW_MORE_OVERHANG : 0,
89
+ }, children: [_jsxs("div", { style: {
87
90
  position: "relative",
88
91
  width: "100%",
89
92
  maxWidth,
@@ -7,6 +7,7 @@ import { validateSnapResponse, } from "@farcaster/snap";
7
7
  // ─── Constants ───────────────────────────────────────
8
8
  const SNAP_MAX_HEIGHT = 500;
9
9
  const SNAP_WARNING_HEIGHT = 700;
10
+ const SHOW_MORE_OVERHANG = 14;
10
11
  // ─── Validation fallback ─────────────────────────────
11
12
  function SnapValidationFallback({ message }) {
12
13
  const { colors } = useSnapTheme();
@@ -85,7 +86,7 @@ function SnapCardV2Inner({ snap, handlers, loading, borderRadius, showOverflowWa
85
86
  const isDark = mode === "dark";
86
87
  const pillBg = isDark ? "rgba(40,40,40,0.92)" : "rgba(255,255,255,0.92)";
87
88
  const pillBgPressed = isDark ? "rgba(60,60,60,0.95)" : "rgba(240,240,240,0.95)";
88
- return (_jsxs(_Fragment, { children: [_jsxs(View, { style: { position: "relative" }, children: [_jsxs(View, { style: {
89
+ return (_jsxs(View, { style: { paddingBottom: isExpandable ? SHOW_MORE_OVERHANG : 0 }, children: [_jsxs(View, { style: { position: "relative" }, children: [_jsxs(View, { style: {
89
90
  borderRadius,
90
91
  borderWidth: 1,
91
92
  borderColor: colors.border,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farcaster/snap",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Farcaster Snaps 🫰",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,6 +9,7 @@ import type { SnapPage, SnapActionHandlers } from "../index";
9
9
 
10
10
  const SNAP_MAX_HEIGHT = 500;
11
11
  const SNAP_WARNING_HEIGHT = 700;
12
+ const SHOW_MORE_OVERHANG = 14;
12
13
 
13
14
  // ─── Default validation error fallback ────────────────
14
15
 
@@ -166,7 +167,12 @@ export function SnapCardV2({
166
167
  const containerMaxHeight = showOverflowWarning ? SNAP_WARNING_HEIGHT : undefined;
167
168
 
168
169
  return (
169
- <>
170
+ <div
171
+ style={{
172
+ paddingBottom:
173
+ !showOverflowWarning && isExpandable ? SHOW_MORE_OVERHANG : 0,
174
+ }}
175
+ >
170
176
  <div
171
177
  style={{
172
178
  position: "relative",
@@ -307,6 +313,6 @@ export function SnapCardV2({
307
313
  {actionError}
308
314
  </div>
309
315
  )}
310
- </>
316
+ </div>
311
317
  );
312
318
  }
@@ -17,6 +17,7 @@ import type { SnapPage, SnapActionHandlers } from "../types";
17
17
 
18
18
  const SNAP_MAX_HEIGHT = 500;
19
19
  const SNAP_WARNING_HEIGHT = 700;
20
+ const SHOW_MORE_OVERHANG = 14;
20
21
 
21
22
  // ─── Validation fallback ─────────────────────────────
22
23
 
@@ -229,7 +230,7 @@ function SnapCardV2Inner({
229
230
  const pillBgPressed = isDark ? "rgba(60,60,60,0.95)" : "rgba(240,240,240,0.95)";
230
231
 
231
232
  return (
232
- <>
233
+ <View style={{ paddingBottom: isExpandable ? SHOW_MORE_OVERHANG : 0 }}>
233
234
  <View style={{ position: "relative" }}>
234
235
  <View
235
236
  style={{
@@ -307,7 +308,7 @@ function SnapCardV2Inner({
307
308
  {actionError}
308
309
  </Text>
309
310
  )}
310
- </>
311
+ </View>
311
312
  );
312
313
  }
313
314