@geekapps/silo-elements-nextjs 0.2.30 → 0.2.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ interface ThumbnailProps {
|
|
|
48
48
|
fileKey: string;
|
|
49
49
|
/** Bucket the file is in */
|
|
50
50
|
bucket?: string;
|
|
51
|
+
/** Pre-resolved direct URL — skips the signed-URL fetch when provided (e.g. for public files) */
|
|
52
|
+
src?: string | null;
|
|
51
53
|
/** MIME type — used to render a video thumbnail placeholder for video files */
|
|
52
54
|
mimeType?: string;
|
|
53
55
|
/** Width in px or CSS string (default: "100%") */
|
|
@@ -64,7 +66,7 @@ interface ThumbnailProps {
|
|
|
64
66
|
style?: CSSProperties;
|
|
65
67
|
alt?: string;
|
|
66
68
|
}
|
|
67
|
-
declare function Thumbnail({ fileKey, bucket, mimeType, width, height, fit, borderRadius, placeholder, className, style, alt, }: ThumbnailProps): react.JSX.Element;
|
|
69
|
+
declare function Thumbnail({ fileKey, bucket, mimeType, src, width, height, fit, borderRadius, placeholder, className, style, alt, }: ThumbnailProps): react.JSX.Element;
|
|
68
70
|
|
|
69
71
|
interface BackgroundProps {
|
|
70
72
|
/** Silo file key for the background image */
|
package/dist/index.js
CHANGED
|
@@ -2504,6 +2504,7 @@ function Thumbnail({
|
|
|
2504
2504
|
fileKey,
|
|
2505
2505
|
bucket,
|
|
2506
2506
|
mimeType,
|
|
2507
|
+
src,
|
|
2507
2508
|
width = "100%",
|
|
2508
2509
|
height = 160,
|
|
2509
2510
|
fit = "cover",
|
|
@@ -2513,7 +2514,9 @@ function Thumbnail({
|
|
|
2513
2514
|
style,
|
|
2514
2515
|
alt = "thumbnail"
|
|
2515
2516
|
}) {
|
|
2516
|
-
const { url, loading } = useSignedUrl(fileKey);
|
|
2517
|
+
const { url: signedUrl, loading: signedLoading } = useSignedUrl(src != null ? null : fileKey);
|
|
2518
|
+
const url = src ?? signedUrl;
|
|
2519
|
+
const loading = src != null ? false : signedLoading;
|
|
2517
2520
|
const [error, setError] = useState(false);
|
|
2518
2521
|
const isVideo = mimeType?.startsWith("video/");
|
|
2519
2522
|
const wrapper = {
|