framepexls-ui-lib 0.3.29 → 0.3.32

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.
@@ -5,11 +5,13 @@ type MediaCardProps = {
5
5
  title: string;
6
6
  subtitle?: string;
7
7
  copyUrl?: string;
8
+ mimeType?: string | null;
9
+ isPrivateImage?: boolean;
8
10
  onRename?: () => void;
9
11
  onReplace?: () => void;
10
12
  onDelete?: () => void;
11
13
  className?: string;
12
14
  };
13
- declare function MediaCard({ imageUrl, title, subtitle, copyUrl, onRename, onReplace, onDelete, className, }: MediaCardProps): react_jsx_runtime.JSX.Element;
15
+ declare function MediaCard({ imageUrl, title, subtitle, copyUrl, mimeType, isPrivateImage, onRename, onReplace, onDelete, className, }: MediaCardProps): react_jsx_runtime.JSX.Element;
14
16
 
15
17
  export { type MediaCardProps, MediaCard as default };
@@ -5,11 +5,13 @@ type MediaCardProps = {
5
5
  title: string;
6
6
  subtitle?: string;
7
7
  copyUrl?: string;
8
+ mimeType?: string | null;
9
+ isPrivateImage?: boolean;
8
10
  onRename?: () => void;
9
11
  onReplace?: () => void;
10
12
  onDelete?: () => void;
11
13
  className?: string;
12
14
  };
13
- declare function MediaCard({ imageUrl, title, subtitle, copyUrl, onRename, onReplace, onDelete, className, }: MediaCardProps): react_jsx_runtime.JSX.Element;
15
+ declare function MediaCard({ imageUrl, title, subtitle, copyUrl, mimeType, isPrivateImage, onRename, onReplace, onDelete, className, }: MediaCardProps): react_jsx_runtime.JSX.Element;
14
16
 
15
17
  export { type MediaCardProps, MediaCard as default };
package/dist/MediaCard.js CHANGED
@@ -43,6 +43,8 @@ function MediaCard({
43
43
  title,
44
44
  subtitle,
45
45
  copyUrl,
46
+ mimeType,
47
+ isPrivateImage,
46
48
  onRename,
47
49
  onReplace,
48
50
  onDelete,
@@ -69,16 +71,36 @@ function MediaCard({
69
71
  ].join(" "),
70
72
  children: [
71
73
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "aspect-square w-full bg-slate-100 relative", children: [
72
- imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
- import_image.default,
74
- {
75
- src: imageUrl,
76
- alt: title,
77
- fill: true,
78
- sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
79
- className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
74
+ (() => {
75
+ const isVideo = mimeType && mimeType.startsWith("video/") || !!copyUrl && /\.(mp4|webm|ogg)(\?|$)/i.test(copyUrl);
76
+ if (imageUrl && !isVideo) {
77
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
78
+ import_image.default,
79
+ {
80
+ src: imageUrl,
81
+ alt: title,
82
+ fill: true,
83
+ sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
84
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105",
85
+ unoptimized: Boolean(isPrivateImage)
86
+ }
87
+ );
80
88
  }
81
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full w-full" }),
89
+ if (isVideo && copyUrl) {
90
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
91
+ "video",
92
+ {
93
+ src: copyUrl,
94
+ className: "h-full w-full object-cover",
95
+ muted: true,
96
+ playsInline: true,
97
+ loop: true,
98
+ preload: "metadata"
99
+ }
100
+ );
101
+ }
102
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full w-full" });
103
+ })(),
82
104
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/30 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
83
105
  ] }),
84
106
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-2 p-2", children: [
@@ -10,6 +10,8 @@ function MediaCard({
10
10
  title,
11
11
  subtitle,
12
12
  copyUrl,
13
+ mimeType,
14
+ isPrivateImage,
13
15
  onRename,
14
16
  onReplace,
15
17
  onDelete,
@@ -36,16 +38,36 @@ function MediaCard({
36
38
  ].join(" "),
37
39
  children: [
38
40
  /* @__PURE__ */ jsxs("div", { className: "aspect-square w-full bg-slate-100 relative", children: [
39
- imageUrl ? /* @__PURE__ */ jsx(
40
- Image,
41
- {
42
- src: imageUrl,
43
- alt: title,
44
- fill: true,
45
- sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
46
- className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
41
+ (() => {
42
+ const isVideo = mimeType && mimeType.startsWith("video/") || !!copyUrl && /\.(mp4|webm|ogg)(\?|$)/i.test(copyUrl);
43
+ if (imageUrl && !isVideo) {
44
+ return /* @__PURE__ */ jsx(
45
+ Image,
46
+ {
47
+ src: imageUrl,
48
+ alt: title,
49
+ fill: true,
50
+ sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
51
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105",
52
+ unoptimized: Boolean(isPrivateImage)
53
+ }
54
+ );
47
55
  }
48
- ) : /* @__PURE__ */ jsx("div", { className: "h-full w-full" }),
56
+ if (isVideo && copyUrl) {
57
+ return /* @__PURE__ */ jsx(
58
+ "video",
59
+ {
60
+ src: copyUrl,
61
+ className: "h-full w-full object-cover",
62
+ muted: true,
63
+ playsInline: true,
64
+ loop: true,
65
+ preload: "metadata"
66
+ }
67
+ );
68
+ }
69
+ return /* @__PURE__ */ jsx("div", { className: "h-full w-full" });
70
+ })(),
49
71
  /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/30 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
50
72
  ] }),
51
73
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 p-2", children: [
@@ -6,6 +6,7 @@ type MediaTileProps = {
6
6
  subtitle?: string;
7
7
  copyUrl?: string;
8
8
  loading?: boolean;
9
+ isPrivateImage?: boolean;
9
10
  onPreview?: () => void;
10
11
  onRename?: () => void;
11
12
  onReplace?: () => void;
@@ -13,6 +14,6 @@ type MediaTileProps = {
13
14
  menuSize?: "sm" | "md" | "lg";
14
15
  className?: string;
15
16
  };
16
- declare function MediaTile({ imageUrl, title, subtitle, copyUrl, onPreview, onRename, onReplace, onDelete, loading, menuSize, className, }: MediaTileProps): react_jsx_runtime.JSX.Element;
17
+ declare function MediaTile({ imageUrl, title, subtitle, copyUrl, onPreview, onRename, onReplace, onDelete, isPrivateImage, loading, menuSize, className, }: MediaTileProps): react_jsx_runtime.JSX.Element;
17
18
 
18
19
  export { type MediaTileProps, MediaTile as default };
@@ -6,6 +6,7 @@ type MediaTileProps = {
6
6
  subtitle?: string;
7
7
  copyUrl?: string;
8
8
  loading?: boolean;
9
+ isPrivateImage?: boolean;
9
10
  onPreview?: () => void;
10
11
  onRename?: () => void;
11
12
  onReplace?: () => void;
@@ -13,6 +14,6 @@ type MediaTileProps = {
13
14
  menuSize?: "sm" | "md" | "lg";
14
15
  className?: string;
15
16
  };
16
- declare function MediaTile({ imageUrl, title, subtitle, copyUrl, onPreview, onRename, onReplace, onDelete, loading, menuSize, className, }: MediaTileProps): react_jsx_runtime.JSX.Element;
17
+ declare function MediaTile({ imageUrl, title, subtitle, copyUrl, onPreview, onRename, onReplace, onDelete, isPrivateImage, loading, menuSize, className, }: MediaTileProps): react_jsx_runtime.JSX.Element;
17
18
 
18
19
  export { type MediaTileProps, MediaTile as default };
package/dist/MediaTile.js CHANGED
@@ -48,6 +48,7 @@ function MediaTile({
48
48
  onRename,
49
49
  onReplace,
50
50
  onDelete,
51
+ isPrivateImage,
51
52
  loading,
52
53
  menuSize = "md",
53
54
  className
@@ -101,7 +102,8 @@ function MediaTile({
101
102
  alt: title,
102
103
  fill: true,
103
104
  sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
104
- className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
105
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105",
106
+ unoptimized: Boolean(isPrivateImage)
105
107
  }
106
108
  ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full w-full" }),
107
109
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/30 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
@@ -15,6 +15,7 @@ function MediaTile({
15
15
  onRename,
16
16
  onReplace,
17
17
  onDelete,
18
+ isPrivateImage,
18
19
  loading,
19
20
  menuSize = "md",
20
21
  className
@@ -68,7 +69,8 @@ function MediaTile({
68
69
  alt: title,
69
70
  fill: true,
70
71
  sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
71
- className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
72
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105",
73
+ unoptimized: Boolean(isPrivateImage)
72
74
  }
73
75
  ) : /* @__PURE__ */ jsx("div", { className: "h-full w-full" }),
74
76
  /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/30 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framepexls-ui-lib",
3
- "version": "0.3.29",
3
+ "version": "0.3.32",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "Componentes UI de Framepexls para React/Next.",