@slopmachine/react 0.1.10 → 0.1.13
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/Agents.md +34 -0
- package/README.md +1 -1
- package/dist/index.d.mts +62 -3
- package/dist/index.d.ts +62 -3
- package/dist/index.js +287 -6
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +290 -6
- package/dist/index.mjs.map +1 -0
- package/package.json +3 -2
- package/src/components/SlopImage.tsx +155 -121
- package/src/components/SlopVideo.tsx +312 -0
- package/src/index.ts +8 -1
- package/tsconfig.json +1 -0
- package/tsup.config.ts +5 -4
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import React, { useMemo, useState } from "react";
|
|
3
3
|
import { clsx } from "clsx";
|
|
4
4
|
import { twMerge } from "tailwind-merge";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
buildImageUrl
|
|
7
|
+
} from "@slopmachine/core";
|
|
6
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
9
|
function cn(...inputs) {
|
|
8
10
|
return twMerge(clsx(inputs));
|
|
@@ -81,15 +83,17 @@ var SlopImage = ({
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
` }),
|
|
84
|
-
/* @__PURE__ */ jsxs(
|
|
86
|
+
/* @__PURE__ */ jsx("div", { className, style: props.style, children: /* @__PURE__ */ jsxs(
|
|
85
87
|
"div",
|
|
86
88
|
{
|
|
87
|
-
className:
|
|
89
|
+
className: "slop-wrapper relative overflow-hidden w-full h-full",
|
|
88
90
|
style: {
|
|
89
91
|
aspectRatio: String(aspectRatio).replace(":", "/"),
|
|
90
92
|
backgroundColor: "var(--muted, #f3f4f6)",
|
|
91
93
|
position: "relative",
|
|
92
|
-
overflow: "hidden"
|
|
94
|
+
overflow: "hidden",
|
|
95
|
+
width: "100%",
|
|
96
|
+
height: "100%"
|
|
93
97
|
},
|
|
94
98
|
children: [
|
|
95
99
|
loader ? /* @__PURE__ */ jsx(
|
|
@@ -249,9 +253,289 @@ var SlopImage = ({
|
|
|
249
253
|
)
|
|
250
254
|
]
|
|
251
255
|
}
|
|
252
|
-
)
|
|
256
|
+
) })
|
|
257
|
+
] });
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// src/components/SlopVideo.tsx
|
|
261
|
+
import { useMemo as useMemo2, useState as useState2, useRef, useEffect } from "react";
|
|
262
|
+
import { clsx as clsx2 } from "clsx";
|
|
263
|
+
import { twMerge as twMerge2 } from "tailwind-merge";
|
|
264
|
+
import {
|
|
265
|
+
buildVideoUrl
|
|
266
|
+
} from "@slopmachine/core";
|
|
267
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
268
|
+
function cn2(...inputs) {
|
|
269
|
+
return twMerge2(clsx2(inputs));
|
|
270
|
+
}
|
|
271
|
+
var SlopVideo = ({
|
|
272
|
+
bucketId,
|
|
273
|
+
className,
|
|
274
|
+
aspectRatio = "16:9",
|
|
275
|
+
version,
|
|
276
|
+
resultId,
|
|
277
|
+
model,
|
|
278
|
+
variables = {},
|
|
279
|
+
duration,
|
|
280
|
+
baseUrl,
|
|
281
|
+
loader,
|
|
282
|
+
autoPlay = true,
|
|
283
|
+
loop = true,
|
|
284
|
+
muted = true,
|
|
285
|
+
playsInline = true,
|
|
286
|
+
...props
|
|
287
|
+
}) => {
|
|
288
|
+
const rawSrc = useMemo2(
|
|
289
|
+
() => buildVideoUrl({
|
|
290
|
+
bucketId,
|
|
291
|
+
aspectRatio,
|
|
292
|
+
version,
|
|
293
|
+
resultId,
|
|
294
|
+
variables,
|
|
295
|
+
duration,
|
|
296
|
+
baseUrl,
|
|
297
|
+
model
|
|
298
|
+
}),
|
|
299
|
+
[
|
|
300
|
+
bucketId,
|
|
301
|
+
aspectRatio,
|
|
302
|
+
version,
|
|
303
|
+
resultId,
|
|
304
|
+
variables,
|
|
305
|
+
duration,
|
|
306
|
+
baseUrl,
|
|
307
|
+
model
|
|
308
|
+
]
|
|
309
|
+
);
|
|
310
|
+
const [src, setSrc] = useState2(rawSrc);
|
|
311
|
+
useEffect(() => {
|
|
312
|
+
const timer = setTimeout(() => {
|
|
313
|
+
setSrc(rawSrc);
|
|
314
|
+
}, 100);
|
|
315
|
+
return () => clearTimeout(timer);
|
|
316
|
+
}, [rawSrc]);
|
|
317
|
+
const [isLoading, setIsLoading] = useState2(true);
|
|
318
|
+
const [currentSrc, setCurrentSrc] = useState2(src);
|
|
319
|
+
const videoRef = useRef(null);
|
|
320
|
+
if (src !== currentSrc) {
|
|
321
|
+
setCurrentSrc(src);
|
|
322
|
+
setIsLoading(true);
|
|
323
|
+
}
|
|
324
|
+
useEffect(() => {
|
|
325
|
+
if (!src) return;
|
|
326
|
+
fetch(src, { method: "HEAD" }).then(async (res) => {
|
|
327
|
+
if (!res.ok) {
|
|
328
|
+
try {
|
|
329
|
+
const errRes = await fetch(src);
|
|
330
|
+
const errJson = await errRes.json();
|
|
331
|
+
console.error("SlopVideo error:", res.status, errJson.error);
|
|
332
|
+
} catch (e) {
|
|
333
|
+
}
|
|
334
|
+
setIsLoading(false);
|
|
335
|
+
}
|
|
336
|
+
}).catch((err) => {
|
|
337
|
+
console.error(`Error fetching video from ${src}:`, err);
|
|
338
|
+
setIsLoading(false);
|
|
339
|
+
});
|
|
340
|
+
}, [src]);
|
|
341
|
+
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
342
|
+
/* @__PURE__ */ jsx2("style", { children: `
|
|
343
|
+
@keyframes slop-shimmer {
|
|
344
|
+
0% {
|
|
345
|
+
background-position: 200% 0;
|
|
346
|
+
}
|
|
347
|
+
100% {
|
|
348
|
+
background-position: -200% 0;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
@keyframes slop-spin {
|
|
352
|
+
from {
|
|
353
|
+
transform: rotate(0deg);
|
|
354
|
+
}
|
|
355
|
+
to {
|
|
356
|
+
transform: rotate(360deg);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
` }),
|
|
360
|
+
/* @__PURE__ */ jsx2("div", { className, style: props.style, children: /* @__PURE__ */ jsxs2(
|
|
361
|
+
"div",
|
|
362
|
+
{
|
|
363
|
+
className: "slop-wrapper relative overflow-hidden w-full h-full",
|
|
364
|
+
style: {
|
|
365
|
+
aspectRatio: String(aspectRatio).replace(":", "/"),
|
|
366
|
+
backgroundColor: "var(--muted, #f3f4f6)",
|
|
367
|
+
position: "relative",
|
|
368
|
+
overflow: "hidden",
|
|
369
|
+
width: "100%",
|
|
370
|
+
height: "100%"
|
|
371
|
+
},
|
|
372
|
+
children: [
|
|
373
|
+
loader ? /* @__PURE__ */ jsx2(
|
|
374
|
+
"div",
|
|
375
|
+
{
|
|
376
|
+
className: cn2(
|
|
377
|
+
"absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300",
|
|
378
|
+
isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
379
|
+
),
|
|
380
|
+
style: {
|
|
381
|
+
position: "absolute",
|
|
382
|
+
top: 0,
|
|
383
|
+
left: 0,
|
|
384
|
+
right: 0,
|
|
385
|
+
bottom: 0,
|
|
386
|
+
zIndex: 10,
|
|
387
|
+
display: "flex",
|
|
388
|
+
alignItems: "center",
|
|
389
|
+
justifyContent: "center",
|
|
390
|
+
opacity: isLoading ? 1 : 0,
|
|
391
|
+
pointerEvents: isLoading ? "auto" : "none",
|
|
392
|
+
transition: "opacity 300ms ease-in-out"
|
|
393
|
+
},
|
|
394
|
+
children: loader
|
|
395
|
+
}
|
|
396
|
+
) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
397
|
+
/* @__PURE__ */ jsx2(
|
|
398
|
+
"div",
|
|
399
|
+
{
|
|
400
|
+
className: cn2(
|
|
401
|
+
"absolute inset-0 z-10 flex items-center justify-center bg-muted transition-opacity duration-300",
|
|
402
|
+
isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
403
|
+
),
|
|
404
|
+
style: {
|
|
405
|
+
position: "absolute",
|
|
406
|
+
top: 0,
|
|
407
|
+
left: 0,
|
|
408
|
+
right: 0,
|
|
409
|
+
bottom: 0,
|
|
410
|
+
zIndex: 10,
|
|
411
|
+
display: "flex",
|
|
412
|
+
alignItems: "center",
|
|
413
|
+
justifyContent: "center",
|
|
414
|
+
backgroundColor: "var(--muted, #f3f4f6)",
|
|
415
|
+
opacity: isLoading ? 1 : 0,
|
|
416
|
+
pointerEvents: isLoading ? "auto" : "none",
|
|
417
|
+
transition: "opacity 300ms ease-in-out"
|
|
418
|
+
},
|
|
419
|
+
children: /* @__PURE__ */ jsxs2(
|
|
420
|
+
"div",
|
|
421
|
+
{
|
|
422
|
+
className: "flex flex-col items-center gap-2",
|
|
423
|
+
style: {
|
|
424
|
+
display: "flex",
|
|
425
|
+
flexDirection: "column",
|
|
426
|
+
alignItems: "center",
|
|
427
|
+
gap: "0.5rem"
|
|
428
|
+
},
|
|
429
|
+
children: [
|
|
430
|
+
/* @__PURE__ */ jsxs2(
|
|
431
|
+
"svg",
|
|
432
|
+
{
|
|
433
|
+
className: "spinner size-6 text-muted-foreground",
|
|
434
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
435
|
+
fill: "none",
|
|
436
|
+
viewBox: "0 0 24 24",
|
|
437
|
+
style: {
|
|
438
|
+
width: "24px",
|
|
439
|
+
height: "24px",
|
|
440
|
+
color: "var(--muted-foreground, #6b7280)",
|
|
441
|
+
animation: "slop-spin 1s linear infinite"
|
|
442
|
+
},
|
|
443
|
+
children: [
|
|
444
|
+
/* @__PURE__ */ jsx2(
|
|
445
|
+
"circle",
|
|
446
|
+
{
|
|
447
|
+
className: "opacity-25",
|
|
448
|
+
cx: "12",
|
|
449
|
+
cy: "12",
|
|
450
|
+
r: "10",
|
|
451
|
+
stroke: "currentColor",
|
|
452
|
+
strokeWidth: "4",
|
|
453
|
+
style: { opacity: 0.25 }
|
|
454
|
+
}
|
|
455
|
+
),
|
|
456
|
+
/* @__PURE__ */ jsx2(
|
|
457
|
+
"path",
|
|
458
|
+
{
|
|
459
|
+
className: "opacity-75",
|
|
460
|
+
fill: "currentColor",
|
|
461
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",
|
|
462
|
+
style: { opacity: 0.75 }
|
|
463
|
+
}
|
|
464
|
+
)
|
|
465
|
+
]
|
|
466
|
+
}
|
|
467
|
+
),
|
|
468
|
+
/* @__PURE__ */ jsx2(
|
|
469
|
+
"span",
|
|
470
|
+
{
|
|
471
|
+
className: "text-xs text-muted-foreground",
|
|
472
|
+
style: {
|
|
473
|
+
fontSize: "0.75rem",
|
|
474
|
+
color: "var(--muted-foreground, #6b7280)"
|
|
475
|
+
},
|
|
476
|
+
children: "Loading..."
|
|
477
|
+
}
|
|
478
|
+
)
|
|
479
|
+
]
|
|
480
|
+
}
|
|
481
|
+
)
|
|
482
|
+
}
|
|
483
|
+
),
|
|
484
|
+
/* @__PURE__ */ jsx2(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
className: cn2(
|
|
488
|
+
"shimmer-effect absolute inset-0 bg-gradient-to-r from-muted via-muted/50 to-muted",
|
|
489
|
+
isLoading ? "opacity-100" : "opacity-0"
|
|
490
|
+
),
|
|
491
|
+
style: {
|
|
492
|
+
position: "absolute",
|
|
493
|
+
top: 0,
|
|
494
|
+
left: 0,
|
|
495
|
+
right: 0,
|
|
496
|
+
bottom: 0,
|
|
497
|
+
background: "linear-gradient(90deg, var(--muted, #f3f4f6) 0%, var(--muted-foreground, #e5e7eb) 50%, var(--muted, #f3f4f6) 100%)",
|
|
498
|
+
backgroundSize: "200% 100%",
|
|
499
|
+
animation: "slop-shimmer 2s ease-in-out infinite",
|
|
500
|
+
opacity: isLoading ? 1 : 0,
|
|
501
|
+
transition: "opacity 300ms"
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
)
|
|
505
|
+
] }),
|
|
506
|
+
/* @__PURE__ */ jsx2(
|
|
507
|
+
"video",
|
|
508
|
+
{
|
|
509
|
+
ref: videoRef,
|
|
510
|
+
src,
|
|
511
|
+
autoPlay,
|
|
512
|
+
loop,
|
|
513
|
+
muted,
|
|
514
|
+
playsInline,
|
|
515
|
+
onLoadedData: () => setIsLoading(false),
|
|
516
|
+
onError: () => setIsLoading(false),
|
|
517
|
+
className: cn2(
|
|
518
|
+
"h-full w-full object-cover transition-opacity duration-500",
|
|
519
|
+
isLoading ? "opacity-0" : "opacity-100"
|
|
520
|
+
),
|
|
521
|
+
style: {
|
|
522
|
+
height: "100%",
|
|
523
|
+
width: "100%",
|
|
524
|
+
objectFit: "cover",
|
|
525
|
+
transition: "opacity 500ms",
|
|
526
|
+
opacity: isLoading ? 0 : 1
|
|
527
|
+
},
|
|
528
|
+
...props
|
|
529
|
+
},
|
|
530
|
+
src
|
|
531
|
+
)
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
) })
|
|
253
535
|
] });
|
|
254
536
|
};
|
|
255
537
|
export {
|
|
256
|
-
SlopImage
|
|
538
|
+
SlopImage,
|
|
539
|
+
SlopVideo
|
|
257
540
|
};
|
|
541
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/SlopImage.tsx","../src/components/SlopVideo.tsx"],"sourcesContent":["import React, { useMemo, useState } from \"react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nimport {\n buildImageUrl,\n type SlopImageOptions,\n type ImageAspectRatio,\n} from \"@slopmachine/core\";\n\n// Utility for Tailwind classes\nfunction cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport interface SlopImageProps\n extends\n Omit<React.ImgHTMLAttributes<HTMLImageElement>, \"src\" | \"alt\">,\n Omit<SlopImageOptions, \"aspectRatio\"> {\n /**\n * The aspect ratio of the generated image. Defaults to \"1:1\".\n */\n aspectRatio?: ImageAspectRatio;\n /**\n * Custom React node to display while the image is loading.\n * If not provided, a default spinner and shimmer effect will be shown.\n */\n loader?: React.ReactNode;\n}\n\n/**\n * Renders an image generated by Slop Machine.\n *\n * This component automatically constructs the correct URL for the Slop Machine API,\n * displays a loading skeleton or custom loader while fetching, and handles errors.\n *\n * @example\n * ```tsx\n * <SlopImage\n * bucketId=\"my-bucket\"\n * resultId=\"some-result\"\n * aspectRatio=\"16:9\"\n * className=\"rounded-lg\"\n * />\n * ```\n *\n * @version 0.1.13\n */\nexport const SlopImage: React.FC<SlopImageProps> = ({\n bucketId,\n className,\n aspectRatio = \"1:1\",\n version,\n resultId,\n model,\n variables = {},\n baseUrl,\n loader,\n ...props\n}) => {\n // Construct API URL\n const rawSrc = useMemo(\n () =>\n buildImageUrl({\n bucketId,\n aspectRatio,\n version,\n resultId,\n variables,\n baseUrl,\n model,\n }),\n [bucketId, aspectRatio, version, resultId, variables, baseUrl, model],\n );\n\n const [src, setSrc] = useState(rawSrc);\n\n React.useEffect(() => {\n const timer = setTimeout(() => {\n setSrc(rawSrc);\n }, 100);\n return () => clearTimeout(timer);\n }, [rawSrc]);\n\n const alt = \"Generated image\";\n\n const [isLoading, setIsLoading] = useState(true);\n const [currentSrc, setCurrentSrc] = useState(src);\n\n if (src !== currentSrc) {\n setCurrentSrc(src);\n setIsLoading(true);\n }\n\n React.useEffect(() => {\n if (!src) return;\n\n fetch(src, { method: \"HEAD\" })\n .then(async (res) => {\n if (!res.ok) {\n // console.error(\n // `Failed to load image from ${src}. Status: ${res.status} ${res.statusText}`,\n // );\n try {\n const errRes = await fetch(src);\n const errJson = await errRes.json();\n console.error(\"SlopImage error:\", res.status, errJson.error);\n } catch (e) {\n // Failed to fetch or parse error details\n }\n setIsLoading(false);\n }\n })\n .catch((err) => {\n console.error(`Error fetching image from ${src}:`, err);\n setIsLoading(false);\n });\n }, [src]);\n\n return (\n <>\n <style>{`\n @keyframes slop-shimmer {\n 0% {\n background-position: 200% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n }\n @keyframes slop-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n `}</style>\n <div className={className} style={props.style}>\n <div\n className=\"slop-wrapper relative overflow-hidden w-full h-full\"\n style={{\n aspectRatio: String(aspectRatio).replace(\":\", \"/\"),\n backgroundColor: \"var(--muted, #f3f4f6)\",\n position: \"relative\",\n overflow: \"hidden\",\n width: \"100%\",\n height: \"100%\",\n }}\n >\n {/* Loading UI */}\n {loader ? (\n <div\n className={cn(\n \"absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300\",\n isLoading ? \"opacity-100\" : \"opacity-0 pointer-events-none\",\n )}\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n zIndex: 10,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: isLoading ? 1 : 0,\n pointerEvents: isLoading ? \"auto\" : \"none\",\n transition: \"opacity 300ms ease-in-out\",\n }}\n >\n {loader}\n </div>\n ) : (\n <>\n {/* Loading overlay */}\n <div\n className={cn(\n \"absolute inset-0 z-10 flex items-center justify-center bg-muted transition-opacity duration-300\",\n isLoading ? \"opacity-100\" : \"opacity-0 pointer-events-none\",\n )}\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n zIndex: 10,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: \"var(--muted, #f3f4f6)\",\n opacity: isLoading ? 1 : 0,\n pointerEvents: isLoading ? \"auto\" : \"none\",\n transition: \"opacity 300ms ease-in-out\",\n }}\n >\n <div\n className=\"flex flex-col items-center gap-2\"\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: \"0.5rem\",\n }}\n >\n <svg\n className=\"spinner size-6 text-muted-foreground\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n style={{\n width: \"24px\",\n height: \"24px\",\n color: \"var(--muted-foreground, #6b7280)\",\n animation: \"slop-spin 1s linear infinite\",\n }}\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n style={{ opacity: 0.25 }}\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n style={{ opacity: 0.75 }}\n />\n </svg>\n <span\n className=\"text-xs text-muted-foreground\"\n style={{\n fontSize: \"0.75rem\",\n color: \"var(--muted-foreground, #6b7280)\",\n }}\n >\n Loading...\n </span>\n </div>\n </div>\n\n {/* Shimmer effect underneath */}\n <div\n className={cn(\n \"shimmer-effect absolute inset-0 bg-gradient-to-r from-muted via-muted/50 to-muted\",\n isLoading ? \"opacity-100\" : \"opacity-0\",\n )}\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n background:\n \"linear-gradient(90deg, var(--muted, #f3f4f6) 0%, var(--muted-foreground, #e5e7eb) 50%, var(--muted, #f3f4f6) 100%)\",\n backgroundSize: \"200% 100%\",\n animation: \"slop-shimmer 2s ease-in-out infinite\",\n opacity: isLoading ? 1 : 0,\n transition: \"opacity 300ms\",\n }}\n />\n </>\n )}\n\n {/* Image */}\n <img\n key={src}\n src={src}\n alt={alt}\n onLoad={() => setIsLoading(false)}\n onError={() => setIsLoading(false)}\n className={cn(\n \"h-full w-full object-cover transition-opacity duration-500\",\n isLoading ? \"opacity-0\" : \"opacity-100\",\n )}\n style={{\n height: \"100%\",\n width: \"100%\",\n objectFit: \"cover\",\n transition: \"opacity 500ms\",\n opacity: isLoading ? 0 : 1,\n }}\n {...props}\n />\n </div>\n </div>\n </>\n );\n};\n","import React, { useMemo, useState, useRef, useEffect } from \"react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nimport {\n buildVideoUrl,\n type SlopVideoOptions,\n type VideoAspectRatio,\n} from \"@slopmachine/core\";\n\n// Utility for Tailwind classes\nfunction cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport interface SlopVideoProps\n extends\n Omit<React.VideoHTMLAttributes<HTMLVideoElement>, \"src\">,\n Omit<SlopVideoOptions, \"aspectRatio\"> {\n /**\n * The aspect ratio of the generated video. Defaults to \"16:9\".\n */\n aspectRatio?: VideoAspectRatio;\n /**\n * Custom React node to display while the video is loading.\n * If not provided, a default spinner and shimmer effect will be shown.\n */\n loader?: React.ReactNode;\n}\n\n/**\n * Renders a video generated by Slop Machine.\n *\n * This component automatically constructs the correct URL for the Slop Machine API,\n * displays a loading skeleton or custom loader while fetching, and handles errors.\n *\n * @example\n * ```tsx\n * <SlopVideo\n * bucketId=\"my-bucket\"\n * resultId=\"some-result\"\n * aspectRatio=\"16:9\"\n * className=\"rounded-lg\"\n * autoPlay\n * loop\n * muted\n * />\n * ```\n */\nexport const SlopVideo: React.FC<SlopVideoProps> = ({\n bucketId,\n className,\n aspectRatio = \"16:9\",\n version,\n resultId,\n model,\n variables = {},\n duration,\n baseUrl,\n loader,\n autoPlay = true,\n loop = true,\n muted = true,\n playsInline = true,\n ...props\n}) => {\n // Construct API URL\n const rawSrc = useMemo(\n () =>\n buildVideoUrl({\n bucketId,\n aspectRatio,\n version,\n resultId,\n variables,\n duration,\n baseUrl,\n model,\n }),\n [\n bucketId,\n aspectRatio,\n version,\n resultId,\n variables,\n duration,\n baseUrl,\n model,\n ],\n );\n\n const [src, setSrc] = useState(rawSrc);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setSrc(rawSrc);\n }, 100);\n return () => clearTimeout(timer);\n }, [rawSrc]);\n\n const [isLoading, setIsLoading] = useState(true);\n const [currentSrc, setCurrentSrc] = useState(src);\n const videoRef = useRef<HTMLVideoElement>(null);\n\n if (src !== currentSrc) {\n setCurrentSrc(src);\n setIsLoading(true);\n }\n\n useEffect(() => {\n if (!src) return;\n\n fetch(src, { method: \"HEAD\" })\n .then(async (res) => {\n if (!res.ok) {\n try {\n const errRes = await fetch(src);\n const errJson = await errRes.json();\n console.error(\"SlopVideo error:\", res.status, errJson.error);\n } catch (e) {\n // Failed to fetch or parse error details\n }\n setIsLoading(false);\n }\n })\n .catch((err) => {\n console.error(`Error fetching video from ${src}:`, err);\n setIsLoading(false);\n });\n }, [src]);\n\n return (\n <>\n <style>{`\n @keyframes slop-shimmer {\n 0% {\n background-position: 200% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n }\n @keyframes slop-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n `}</style>\n <div className={className} style={props.style}>\n <div\n className=\"slop-wrapper relative overflow-hidden w-full h-full\"\n style={{\n aspectRatio: String(aspectRatio).replace(\":\", \"/\"),\n backgroundColor: \"var(--muted, #f3f4f6)\",\n position: \"relative\",\n overflow: \"hidden\",\n width: \"100%\",\n height: \"100%\",\n }}\n >\n {/* Loading UI */}\n {loader ? (\n <div\n className={cn(\n \"absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300\",\n isLoading ? \"opacity-100\" : \"opacity-0 pointer-events-none\",\n )}\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n zIndex: 10,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: isLoading ? 1 : 0,\n pointerEvents: isLoading ? \"auto\" : \"none\",\n transition: \"opacity 300ms ease-in-out\",\n }}\n >\n {loader}\n </div>\n ) : (\n <>\n {/* Loading overlay */}\n <div\n className={cn(\n \"absolute inset-0 z-10 flex items-center justify-center bg-muted transition-opacity duration-300\",\n isLoading ? \"opacity-100\" : \"opacity-0 pointer-events-none\",\n )}\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n zIndex: 10,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: \"var(--muted, #f3f4f6)\",\n opacity: isLoading ? 1 : 0,\n pointerEvents: isLoading ? \"auto\" : \"none\",\n transition: \"opacity 300ms ease-in-out\",\n }}\n >\n <div\n className=\"flex flex-col items-center gap-2\"\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: \"0.5rem\",\n }}\n >\n <svg\n className=\"spinner size-6 text-muted-foreground\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n style={{\n width: \"24px\",\n height: \"24px\",\n color: \"var(--muted-foreground, #6b7280)\",\n animation: \"slop-spin 1s linear infinite\",\n }}\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n style={{ opacity: 0.25 }}\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n style={{ opacity: 0.75 }}\n />\n </svg>\n <span\n className=\"text-xs text-muted-foreground\"\n style={{\n fontSize: \"0.75rem\",\n color: \"var(--muted-foreground, #6b7280)\",\n }}\n >\n Loading...\n </span>\n </div>\n </div>\n\n {/* Shimmer effect underneath */}\n <div\n className={cn(\n \"shimmer-effect absolute inset-0 bg-gradient-to-r from-muted via-muted/50 to-muted\",\n isLoading ? \"opacity-100\" : \"opacity-0\",\n )}\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n background:\n \"linear-gradient(90deg, var(--muted, #f3f4f6) 0%, var(--muted-foreground, #e5e7eb) 50%, var(--muted, #f3f4f6) 100%)\",\n backgroundSize: \"200% 100%\",\n animation: \"slop-shimmer 2s ease-in-out infinite\",\n opacity: isLoading ? 1 : 0,\n transition: \"opacity 300ms\",\n }}\n />\n </>\n )}\n\n {/* Video */}\n <video\n key={src}\n ref={videoRef}\n src={src}\n autoPlay={autoPlay}\n loop={loop}\n muted={muted}\n playsInline={playsInline}\n onLoadedData={() => setIsLoading(false)}\n onError={() => setIsLoading(false)}\n className={cn(\n \"h-full w-full object-cover transition-opacity duration-500\",\n isLoading ? \"opacity-0\" : \"opacity-100\",\n )}\n style={{\n height: \"100%\",\n width: \"100%\",\n objectFit: \"cover\",\n transition: \"opacity 500ms\",\n opacity: isLoading ? 0 : 1,\n }}\n {...props}\n />\n </div>\n </div>\n </>\n );\n};\n"],"mappings":";AAAA,OAAO,SAAS,SAAS,gBAAgB;AACzC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAExB;AAAA,EACE;AAAA,OAGK;AAiHD,SAuDM,UAvDN,KAuFY,YAvFZ;AA9GN,SAAS,MAAM,QAAsB;AACnC,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;AAmCO,IAAM,YAAsC,CAAC;AAAA,EAClD;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,CAAC;AAAA,EACb;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AAEJ,QAAM,SAAS;AAAA,IACb,MACE,cAAc;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,IACH,CAAC,UAAU,aAAa,SAAS,UAAU,WAAW,SAAS,KAAK;AAAA,EACtE;AAEA,QAAM,CAAC,KAAK,MAAM,IAAI,SAAS,MAAM;AAErC,QAAM,UAAU,MAAM;AACpB,UAAM,QAAQ,WAAW,MAAM;AAC7B,aAAO,MAAM;AAAA,IACf,GAAG,GAAG;AACN,WAAO,MAAM,aAAa,KAAK;AAAA,EACjC,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,MAAM;AAEZ,QAAM,CAAC,WAAW,YAA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sBACA,gBAAAA;AAAA,wBAAC;AAAA;AAAA,0BACC,WAAU;AAAA,0BACV,OAAO;AAAA,4BACL,UAAU;AAAA,4BACV,OAAO;AAAA,0BACT;AAAA,0BACD;AAAA;AAAA,sBAED;AAAA;AAAA;AAAA,gBACF;AAAA;AAAA,YACF;AAAA,YAGA,gBAAAA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAWE;AAAA,kBACT;AAAA,kBACA,YAAY,gBAAgB;AAAA,gBAC9B;AAAA,gBACA,OAAO;AAAA,kBACL,UAAU;AAAA,kBACV,KAAK;AAAA,kBACL,MAAM;AAAA,kBACN,OAAO;AAAA,kBACP,QAAQ;AAAA,kBACR,YACE;AAAA,kBACF,gBAAgB;AAAA,kBAChB,WAAW;AAAA,kBACX,SAAS,YAAY,IAAI;AAAA,kBACzB,YAAY;AAAA,gBACd;AAAA;AAAA,YACF;AAAA,aACF;AAAA,UAIF,gBAAAF;AAAA,YAAC;AAAA;AAAA,cAEC,KAAK;AAAA,cACL;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,cAAc,MAAM,aAAa,KAAK;AAAA,cACtC,SAAS,MAAM,aAAa,KAAK;AAAA,cACjC,WAAWE;AAAA,gBACT;AAAA,gBACA,YAAY,cAAc;AAAA,cAC5B;AAAA,cACA,OAAO;AAAA,gBACL,QAAQ;AAAA,gBACR,OAAO;AAAA,gBACP,WAAW;AAAA,gBACX,YAAY;AAAA,gBACZ,SAAS,YAAY,IAAI;AAAA,cAC3B;AAAA,cACC,GAAG;AAAA;AAAA,YApBC;AAAA,UAqBP;AAAA;AAAA;AAAA,IACF,GACF;AAAA,KACF;AAEJ;","names":["useMemo","useState","clsx","twMerge","Fragment","jsx","jsxs","cn"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slopmachine/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "The official React SDK for Slop Machine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.mjs",
|
|
12
|
-
"require": "./dist/index.js"
|
|
12
|
+
"require": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
13
14
|
}
|
|
14
15
|
},
|
|
15
16
|
"scripts": {
|