@slopmachine/react 0.1.9 → 0.1.12
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 +63 -3
- package/dist/index.d.ts +63 -3
- package/dist/index.js +386 -83
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +389 -83
- package/dist/index.mjs.map +1 -0
- package/package.json +3 -2
- package/src/components/SlopImage.tsx +144 -83
- package/src/components/SlopVideo.tsx +308 -0
- package/src/index.ts +8 -1
- package/tsconfig.json +1 -0
- package/tsup.config.ts +5 -4
package/dist/index.js
CHANGED
|
@@ -30,7 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
SlopImage: () => SlopImage
|
|
33
|
+
SlopImage: () => SlopImage,
|
|
34
|
+
SlopVideo: () => SlopVideo
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(index_exports);
|
|
36
37
|
|
|
@@ -52,6 +53,7 @@ var SlopImage = ({
|
|
|
52
53
|
model,
|
|
53
54
|
variables = {},
|
|
54
55
|
baseUrl,
|
|
56
|
+
loader,
|
|
55
57
|
...props
|
|
56
58
|
}) => {
|
|
57
59
|
const rawSrc = (0, import_react.useMemo)(
|
|
@@ -127,11 +129,11 @@ var SlopImage = ({
|
|
|
127
129
|
overflow: "hidden"
|
|
128
130
|
},
|
|
129
131
|
children: [
|
|
130
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
+
loader ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
131
133
|
"div",
|
|
132
134
|
{
|
|
133
135
|
className: cn(
|
|
134
|
-
"absolute inset-0 z-10 flex items-center justify-center
|
|
136
|
+
"absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300",
|
|
135
137
|
isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
136
138
|
),
|
|
137
139
|
style: {
|
|
@@ -144,82 +146,265 @@ var SlopImage = ({
|
|
|
144
146
|
display: "flex",
|
|
145
147
|
alignItems: "center",
|
|
146
148
|
justifyContent: "center",
|
|
147
|
-
backgroundColor: "var(--muted, #f3f4f6)",
|
|
148
149
|
opacity: isLoading ? 1 : 0,
|
|
149
150
|
pointerEvents: isLoading ? "auto" : "none",
|
|
150
151
|
transition: "opacity 300ms ease-in-out"
|
|
151
152
|
},
|
|
152
|
-
children:
|
|
153
|
-
"div",
|
|
154
|
-
{
|
|
155
|
-
className: "flex flex-col items-center gap-2",
|
|
156
|
-
style: {
|
|
157
|
-
display: "flex",
|
|
158
|
-
flexDirection: "column",
|
|
159
|
-
alignItems: "center",
|
|
160
|
-
gap: "0.5rem"
|
|
161
|
-
},
|
|
162
|
-
children: [
|
|
163
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
164
|
-
"svg",
|
|
165
|
-
{
|
|
166
|
-
className: "spinner size-6 text-muted-foreground",
|
|
167
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
168
|
-
fill: "none",
|
|
169
|
-
viewBox: "0 0 24 24",
|
|
170
|
-
style: {
|
|
171
|
-
width: "24px",
|
|
172
|
-
height: "24px",
|
|
173
|
-
color: "var(--muted-foreground, #6b7280)",
|
|
174
|
-
animation: "slop-spin 1s linear infinite"
|
|
175
|
-
},
|
|
176
|
-
children: [
|
|
177
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
178
|
-
"circle",
|
|
179
|
-
{
|
|
180
|
-
className: "opacity-25",
|
|
181
|
-
cx: "12",
|
|
182
|
-
cy: "12",
|
|
183
|
-
r: "10",
|
|
184
|
-
stroke: "currentColor",
|
|
185
|
-
strokeWidth: "4",
|
|
186
|
-
style: { opacity: 0.25 }
|
|
187
|
-
}
|
|
188
|
-
),
|
|
189
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
190
|
-
"path",
|
|
191
|
-
{
|
|
192
|
-
className: "opacity-75",
|
|
193
|
-
fill: "currentColor",
|
|
194
|
-
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",
|
|
195
|
-
style: { opacity: 0.75 }
|
|
196
|
-
}
|
|
197
|
-
)
|
|
198
|
-
]
|
|
199
|
-
}
|
|
200
|
-
),
|
|
201
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
202
|
-
"span",
|
|
203
|
-
{
|
|
204
|
-
className: "text-xs text-muted-foreground",
|
|
205
|
-
style: {
|
|
206
|
-
fontSize: "0.75rem",
|
|
207
|
-
color: "var(--muted-foreground, #6b7280)"
|
|
208
|
-
},
|
|
209
|
-
children: "Loading..."
|
|
210
|
-
}
|
|
211
|
-
)
|
|
212
|
-
]
|
|
213
|
-
}
|
|
214
|
-
)
|
|
153
|
+
children: loader
|
|
215
154
|
}
|
|
216
|
-
),
|
|
155
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
156
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
className: cn(
|
|
160
|
+
"absolute inset-0 z-10 flex items-center justify-center bg-muted transition-opacity duration-300",
|
|
161
|
+
isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
162
|
+
),
|
|
163
|
+
style: {
|
|
164
|
+
position: "absolute",
|
|
165
|
+
top: 0,
|
|
166
|
+
left: 0,
|
|
167
|
+
right: 0,
|
|
168
|
+
bottom: 0,
|
|
169
|
+
zIndex: 10,
|
|
170
|
+
display: "flex",
|
|
171
|
+
alignItems: "center",
|
|
172
|
+
justifyContent: "center",
|
|
173
|
+
backgroundColor: "var(--muted, #f3f4f6)",
|
|
174
|
+
opacity: isLoading ? 1 : 0,
|
|
175
|
+
pointerEvents: isLoading ? "auto" : "none",
|
|
176
|
+
transition: "opacity 300ms ease-in-out"
|
|
177
|
+
},
|
|
178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
className: "flex flex-col items-center gap-2",
|
|
182
|
+
style: {
|
|
183
|
+
display: "flex",
|
|
184
|
+
flexDirection: "column",
|
|
185
|
+
alignItems: "center",
|
|
186
|
+
gap: "0.5rem"
|
|
187
|
+
},
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
190
|
+
"svg",
|
|
191
|
+
{
|
|
192
|
+
className: "spinner size-6 text-muted-foreground",
|
|
193
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
194
|
+
fill: "none",
|
|
195
|
+
viewBox: "0 0 24 24",
|
|
196
|
+
style: {
|
|
197
|
+
width: "24px",
|
|
198
|
+
height: "24px",
|
|
199
|
+
color: "var(--muted-foreground, #6b7280)",
|
|
200
|
+
animation: "slop-spin 1s linear infinite"
|
|
201
|
+
},
|
|
202
|
+
children: [
|
|
203
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
204
|
+
"circle",
|
|
205
|
+
{
|
|
206
|
+
className: "opacity-25",
|
|
207
|
+
cx: "12",
|
|
208
|
+
cy: "12",
|
|
209
|
+
r: "10",
|
|
210
|
+
stroke: "currentColor",
|
|
211
|
+
strokeWidth: "4",
|
|
212
|
+
style: { opacity: 0.25 }
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
216
|
+
"path",
|
|
217
|
+
{
|
|
218
|
+
className: "opacity-75",
|
|
219
|
+
fill: "currentColor",
|
|
220
|
+
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",
|
|
221
|
+
style: { opacity: 0.75 }
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
228
|
+
"span",
|
|
229
|
+
{
|
|
230
|
+
className: "text-xs text-muted-foreground",
|
|
231
|
+
style: {
|
|
232
|
+
fontSize: "0.75rem",
|
|
233
|
+
color: "var(--muted-foreground, #6b7280)"
|
|
234
|
+
},
|
|
235
|
+
children: "Loading..."
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
className: cn(
|
|
247
|
+
"shimmer-effect absolute inset-0 bg-gradient-to-r from-muted via-muted/50 to-muted",
|
|
248
|
+
isLoading ? "opacity-100" : "opacity-0"
|
|
249
|
+
),
|
|
250
|
+
style: {
|
|
251
|
+
position: "absolute",
|
|
252
|
+
top: 0,
|
|
253
|
+
left: 0,
|
|
254
|
+
right: 0,
|
|
255
|
+
bottom: 0,
|
|
256
|
+
background: "linear-gradient(90deg, var(--muted, #f3f4f6) 0%, var(--muted-foreground, #e5e7eb) 50%, var(--muted, #f3f4f6) 100%)",
|
|
257
|
+
backgroundSize: "200% 100%",
|
|
258
|
+
animation: "slop-shimmer 2s ease-in-out infinite",
|
|
259
|
+
opacity: isLoading ? 1 : 0,
|
|
260
|
+
transition: "opacity 300ms"
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
] }),
|
|
217
265
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
218
|
-
"
|
|
266
|
+
"img",
|
|
219
267
|
{
|
|
268
|
+
src,
|
|
269
|
+
alt,
|
|
270
|
+
onLoad: () => setIsLoading(false),
|
|
271
|
+
onError: () => setIsLoading(false),
|
|
220
272
|
className: cn(
|
|
221
|
-
"
|
|
222
|
-
isLoading ? "opacity-
|
|
273
|
+
"h-full w-full object-cover transition-opacity duration-500",
|
|
274
|
+
isLoading ? "opacity-0" : "opacity-100"
|
|
275
|
+
),
|
|
276
|
+
style: {
|
|
277
|
+
height: "100%",
|
|
278
|
+
width: "100%",
|
|
279
|
+
objectFit: "cover",
|
|
280
|
+
transition: "opacity 500ms",
|
|
281
|
+
opacity: isLoading ? 0 : 1
|
|
282
|
+
},
|
|
283
|
+
...props
|
|
284
|
+
},
|
|
285
|
+
src
|
|
286
|
+
)
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
] });
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
// src/components/SlopVideo.tsx
|
|
294
|
+
var import_react2 = require("react");
|
|
295
|
+
var import_clsx2 = require("clsx");
|
|
296
|
+
var import_tailwind_merge2 = require("tailwind-merge");
|
|
297
|
+
var import_core2 = require("@slopmachine/core");
|
|
298
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
299
|
+
function cn2(...inputs) {
|
|
300
|
+
return (0, import_tailwind_merge2.twMerge)((0, import_clsx2.clsx)(inputs));
|
|
301
|
+
}
|
|
302
|
+
var SlopVideo = ({
|
|
303
|
+
bucketId,
|
|
304
|
+
className,
|
|
305
|
+
aspectRatio = "16:9",
|
|
306
|
+
version,
|
|
307
|
+
resultId,
|
|
308
|
+
model,
|
|
309
|
+
variables = {},
|
|
310
|
+
duration,
|
|
311
|
+
baseUrl,
|
|
312
|
+
loader,
|
|
313
|
+
autoPlay = true,
|
|
314
|
+
loop = true,
|
|
315
|
+
muted = true,
|
|
316
|
+
playsInline = true,
|
|
317
|
+
...props
|
|
318
|
+
}) => {
|
|
319
|
+
const rawSrc = (0, import_react2.useMemo)(
|
|
320
|
+
() => (0, import_core2.buildVideoUrl)({
|
|
321
|
+
bucketId,
|
|
322
|
+
aspectRatio,
|
|
323
|
+
version,
|
|
324
|
+
resultId,
|
|
325
|
+
variables,
|
|
326
|
+
duration,
|
|
327
|
+
baseUrl,
|
|
328
|
+
model
|
|
329
|
+
}),
|
|
330
|
+
[
|
|
331
|
+
bucketId,
|
|
332
|
+
aspectRatio,
|
|
333
|
+
version,
|
|
334
|
+
resultId,
|
|
335
|
+
variables,
|
|
336
|
+
duration,
|
|
337
|
+
baseUrl,
|
|
338
|
+
model
|
|
339
|
+
]
|
|
340
|
+
);
|
|
341
|
+
const [src, setSrc] = (0, import_react2.useState)(rawSrc);
|
|
342
|
+
(0, import_react2.useEffect)(() => {
|
|
343
|
+
const timer = setTimeout(() => {
|
|
344
|
+
setSrc(rawSrc);
|
|
345
|
+
}, 100);
|
|
346
|
+
return () => clearTimeout(timer);
|
|
347
|
+
}, [rawSrc]);
|
|
348
|
+
const [isLoading, setIsLoading] = (0, import_react2.useState)(true);
|
|
349
|
+
const [currentSrc, setCurrentSrc] = (0, import_react2.useState)(src);
|
|
350
|
+
const videoRef = (0, import_react2.useRef)(null);
|
|
351
|
+
if (src !== currentSrc) {
|
|
352
|
+
setCurrentSrc(src);
|
|
353
|
+
setIsLoading(true);
|
|
354
|
+
}
|
|
355
|
+
(0, import_react2.useEffect)(() => {
|
|
356
|
+
if (!src) return;
|
|
357
|
+
fetch(src, { method: "HEAD" }).then(async (res) => {
|
|
358
|
+
if (!res.ok) {
|
|
359
|
+
try {
|
|
360
|
+
const errRes = await fetch(src);
|
|
361
|
+
const errJson = await errRes.json();
|
|
362
|
+
console.error("SlopVideo error:", res.status, errJson.error);
|
|
363
|
+
} catch (e) {
|
|
364
|
+
}
|
|
365
|
+
setIsLoading(false);
|
|
366
|
+
}
|
|
367
|
+
}).catch((err) => {
|
|
368
|
+
console.error(`Error fetching video from ${src}:`, err);
|
|
369
|
+
setIsLoading(false);
|
|
370
|
+
});
|
|
371
|
+
}, [src]);
|
|
372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
373
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", { children: `
|
|
374
|
+
@keyframes slop-shimmer {
|
|
375
|
+
0% {
|
|
376
|
+
background-position: 200% 0;
|
|
377
|
+
}
|
|
378
|
+
100% {
|
|
379
|
+
background-position: -200% 0;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
@keyframes slop-spin {
|
|
383
|
+
from {
|
|
384
|
+
transform: rotate(0deg);
|
|
385
|
+
}
|
|
386
|
+
to {
|
|
387
|
+
transform: rotate(360deg);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
` }),
|
|
391
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
392
|
+
"div",
|
|
393
|
+
{
|
|
394
|
+
className: cn2("relative overflow-hidden", className),
|
|
395
|
+
style: {
|
|
396
|
+
aspectRatio: String(aspectRatio).replace(":", "/"),
|
|
397
|
+
backgroundColor: "var(--muted, #f3f4f6)",
|
|
398
|
+
position: "relative",
|
|
399
|
+
overflow: "hidden"
|
|
400
|
+
},
|
|
401
|
+
children: [
|
|
402
|
+
loader ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
403
|
+
"div",
|
|
404
|
+
{
|
|
405
|
+
className: cn2(
|
|
406
|
+
"absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300",
|
|
407
|
+
isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
223
408
|
),
|
|
224
409
|
style: {
|
|
225
410
|
position: "absolute",
|
|
@@ -227,22 +412,138 @@ var SlopImage = ({
|
|
|
227
412
|
left: 0,
|
|
228
413
|
right: 0,
|
|
229
414
|
bottom: 0,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
415
|
+
zIndex: 10,
|
|
416
|
+
display: "flex",
|
|
417
|
+
alignItems: "center",
|
|
418
|
+
justifyContent: "center",
|
|
233
419
|
opacity: isLoading ? 1 : 0,
|
|
234
|
-
|
|
235
|
-
|
|
420
|
+
pointerEvents: isLoading ? "auto" : "none",
|
|
421
|
+
transition: "opacity 300ms ease-in-out"
|
|
422
|
+
},
|
|
423
|
+
children: loader
|
|
236
424
|
}
|
|
237
|
-
),
|
|
238
|
-
|
|
239
|
-
|
|
425
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
426
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
427
|
+
"div",
|
|
428
|
+
{
|
|
429
|
+
className: cn2(
|
|
430
|
+
"absolute inset-0 z-10 flex items-center justify-center bg-muted transition-opacity duration-300",
|
|
431
|
+
isLoading ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
432
|
+
),
|
|
433
|
+
style: {
|
|
434
|
+
position: "absolute",
|
|
435
|
+
top: 0,
|
|
436
|
+
left: 0,
|
|
437
|
+
right: 0,
|
|
438
|
+
bottom: 0,
|
|
439
|
+
zIndex: 10,
|
|
440
|
+
display: "flex",
|
|
441
|
+
alignItems: "center",
|
|
442
|
+
justifyContent: "center",
|
|
443
|
+
backgroundColor: "var(--muted, #f3f4f6)",
|
|
444
|
+
opacity: isLoading ? 1 : 0,
|
|
445
|
+
pointerEvents: isLoading ? "auto" : "none",
|
|
446
|
+
transition: "opacity 300ms ease-in-out"
|
|
447
|
+
},
|
|
448
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
449
|
+
"div",
|
|
450
|
+
{
|
|
451
|
+
className: "flex flex-col items-center gap-2",
|
|
452
|
+
style: {
|
|
453
|
+
display: "flex",
|
|
454
|
+
flexDirection: "column",
|
|
455
|
+
alignItems: "center",
|
|
456
|
+
gap: "0.5rem"
|
|
457
|
+
},
|
|
458
|
+
children: [
|
|
459
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
460
|
+
"svg",
|
|
461
|
+
{
|
|
462
|
+
className: "spinner size-6 text-muted-foreground",
|
|
463
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
464
|
+
fill: "none",
|
|
465
|
+
viewBox: "0 0 24 24",
|
|
466
|
+
style: {
|
|
467
|
+
width: "24px",
|
|
468
|
+
height: "24px",
|
|
469
|
+
color: "var(--muted-foreground, #6b7280)",
|
|
470
|
+
animation: "slop-spin 1s linear infinite"
|
|
471
|
+
},
|
|
472
|
+
children: [
|
|
473
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
474
|
+
"circle",
|
|
475
|
+
{
|
|
476
|
+
className: "opacity-25",
|
|
477
|
+
cx: "12",
|
|
478
|
+
cy: "12",
|
|
479
|
+
r: "10",
|
|
480
|
+
stroke: "currentColor",
|
|
481
|
+
strokeWidth: "4",
|
|
482
|
+
style: { opacity: 0.25 }
|
|
483
|
+
}
|
|
484
|
+
),
|
|
485
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
486
|
+
"path",
|
|
487
|
+
{
|
|
488
|
+
className: "opacity-75",
|
|
489
|
+
fill: "currentColor",
|
|
490
|
+
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",
|
|
491
|
+
style: { opacity: 0.75 }
|
|
492
|
+
}
|
|
493
|
+
)
|
|
494
|
+
]
|
|
495
|
+
}
|
|
496
|
+
),
|
|
497
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
498
|
+
"span",
|
|
499
|
+
{
|
|
500
|
+
className: "text-xs text-muted-foreground",
|
|
501
|
+
style: {
|
|
502
|
+
fontSize: "0.75rem",
|
|
503
|
+
color: "var(--muted-foreground, #6b7280)"
|
|
504
|
+
},
|
|
505
|
+
children: "Loading..."
|
|
506
|
+
}
|
|
507
|
+
)
|
|
508
|
+
]
|
|
509
|
+
}
|
|
510
|
+
)
|
|
511
|
+
}
|
|
512
|
+
),
|
|
513
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
514
|
+
"div",
|
|
515
|
+
{
|
|
516
|
+
className: cn2(
|
|
517
|
+
"shimmer-effect absolute inset-0 bg-gradient-to-r from-muted via-muted/50 to-muted",
|
|
518
|
+
isLoading ? "opacity-100" : "opacity-0"
|
|
519
|
+
),
|
|
520
|
+
style: {
|
|
521
|
+
position: "absolute",
|
|
522
|
+
top: 0,
|
|
523
|
+
left: 0,
|
|
524
|
+
right: 0,
|
|
525
|
+
bottom: 0,
|
|
526
|
+
background: "linear-gradient(90deg, var(--muted, #f3f4f6) 0%, var(--muted-foreground, #e5e7eb) 50%, var(--muted, #f3f4f6) 100%)",
|
|
527
|
+
backgroundSize: "200% 100%",
|
|
528
|
+
animation: "slop-shimmer 2s ease-in-out infinite",
|
|
529
|
+
opacity: isLoading ? 1 : 0,
|
|
530
|
+
transition: "opacity 300ms"
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
)
|
|
534
|
+
] }),
|
|
535
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
536
|
+
"video",
|
|
240
537
|
{
|
|
538
|
+
ref: videoRef,
|
|
241
539
|
src,
|
|
242
|
-
|
|
243
|
-
|
|
540
|
+
autoPlay,
|
|
541
|
+
loop,
|
|
542
|
+
muted,
|
|
543
|
+
playsInline,
|
|
544
|
+
onLoadedData: () => setIsLoading(false),
|
|
244
545
|
onError: () => setIsLoading(false),
|
|
245
|
-
className:
|
|
546
|
+
className: cn2(
|
|
246
547
|
"h-full w-full object-cover transition-opacity duration-500",
|
|
247
548
|
isLoading ? "opacity-0" : "opacity-100"
|
|
248
549
|
),
|
|
@@ -264,5 +565,7 @@ var SlopImage = ({
|
|
|
264
565
|
};
|
|
265
566
|
// Annotate the CommonJS export names for ESM import in node:
|
|
266
567
|
0 && (module.exports = {
|
|
267
|
-
SlopImage
|
|
568
|
+
SlopImage,
|
|
569
|
+
SlopVideo
|
|
268
570
|
});
|
|
571
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/components/SlopImage.tsx","../src/components/SlopVideo.tsx"],"sourcesContent":["export { SlopImage, type SlopImageProps } from \"./components/SlopImage\";\nexport { SlopVideo, type SlopVideoProps } from \"./components/SlopVideo\";\nexport type {\n ImageAspectRatio,\n VideoAspectRatio,\n SlopImageOptions,\n SlopVideoOptions,\n} from \"@slopmachine/core\";\n","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.12\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\n className={cn(\"relative overflow-hidden\", className)}\n style={{\n aspectRatio: String(aspectRatio).replace(\":\", \"/\"),\n backgroundColor: \"var(--muted, #f3f4f6)\",\n position: \"relative\",\n overflow: \"hidden\",\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 </>\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\n className={cn(\"relative overflow-hidden\", className)}\n style={{\n aspectRatio: String(aspectRatio).replace(\":\", \"/\"),\n backgroundColor: \"var(--muted, #f3f4f6)\",\n position: \"relative\",\n overflow: \"hidden\",\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 </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAyC;AACzC,kBAAsC;AACtC,4BAAwB;AAExB,kBAIO;AAiHD;AA9GN,SAAS,MAAM,QAAsB;AACnC,aAAO,mCAAQ,kBAAK,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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import_react","import_clsx","import_tailwind_merge","import_core","import_jsx_runtime","cn"]}
|