limbo-component 2.0.3 → 2.1.0
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/limbo.cjs.js +1 -1
- package/dist/limbo.cjs.map +1 -1
- package/dist/limbo.css +1 -1
- package/dist/limbo.es.js +54 -67
- package/dist/limbo.es.map +1 -1
- package/dist/limbo.min.js +1 -1
- package/dist/limbo.min.js.map +1 -1
- package/dist/limbo.umd.js +1 -1
- package/dist/limbo.umd.js.map +1 -1
- package/dist/types/components/ImageCard.d.ts.map +1 -1
- package/dist/types/components/ImageVariantsModal.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/limbo.es.js
CHANGED
|
@@ -13338,7 +13338,7 @@ function ImageVariantsModal({
|
|
|
13338
13338
|
return /* @__PURE__ */ jsx(
|
|
13339
13339
|
"div",
|
|
13340
13340
|
{
|
|
13341
|
-
className: "
|
|
13341
|
+
className: "fixed inset-0 bg-black/70 flex items-center justify-center z-[1000] p-5",
|
|
13342
13342
|
onClick: onClose,
|
|
13343
13343
|
role: "dialog",
|
|
13344
13344
|
"aria-modal": "true",
|
|
@@ -13346,18 +13346,18 @@ function ImageVariantsModal({
|
|
|
13346
13346
|
children: /* @__PURE__ */ jsxs(
|
|
13347
13347
|
"div",
|
|
13348
13348
|
{
|
|
13349
|
-
className: "
|
|
13349
|
+
className: "bg-white rounded-xl max-w-[90vw] max-h-[90vh] overflow-hidden shadow-2xl flex flex-col w-[900px] md:w-[95vw] md:max-h-[95vh]",
|
|
13350
13350
|
onClick: (e) => e.stopPropagation(),
|
|
13351
13351
|
children: [
|
|
13352
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
13353
|
-
/* @__PURE__ */ jsxs("h2", { id: "variants-modal-title", children: [
|
|
13352
|
+
/* @__PURE__ */ jsxs("div", { className: "p-6 md:p-4 border-b border-gray-200 flex justify-between items-center bg-gray-50", children: [
|
|
13353
|
+
/* @__PURE__ */ jsxs("h2", { id: "variants-modal-title", className: "m-0 text-xl font-semibold text-gray-800", children: [
|
|
13354
13354
|
"Recortes de ",
|
|
13355
13355
|
image?.filename
|
|
13356
13356
|
] }),
|
|
13357
13357
|
/* @__PURE__ */ jsx(
|
|
13358
13358
|
"button",
|
|
13359
13359
|
{
|
|
13360
|
-
className: "
|
|
13360
|
+
className: "bg-transparent border-none text-2xl cursor-pointer text-gray-500 px-2 rounded-md transition-all hover:bg-gray-200 hover:text-gray-700",
|
|
13361
13361
|
onClick: onClose,
|
|
13362
13362
|
"aria-label": "Cerrar modal de recortes",
|
|
13363
13363
|
children: "✕"
|
|
@@ -13367,23 +13367,15 @@ function ImageVariantsModal({
|
|
|
13367
13367
|
deleteMessage && /* @__PURE__ */ jsx(
|
|
13368
13368
|
"div",
|
|
13369
13369
|
{
|
|
13370
|
-
className: `
|
|
13370
|
+
className: `mx-5 mb-4 mt-0 p-3 rounded ${deleteMessageType === "success" ? "bg-green-100 text-green-800 border border-green-200" : "bg-red-100 text-red-800 border border-red-200"}`,
|
|
13371
13371
|
role: "alert",
|
|
13372
|
-
style: {
|
|
13373
|
-
padding: "12px 20px",
|
|
13374
|
-
margin: "0 20px 15px 20px",
|
|
13375
|
-
borderRadius: "4px",
|
|
13376
|
-
backgroundColor: deleteMessageType === "success" ? "#d4edda" : "#f8d7da",
|
|
13377
|
-
color: deleteMessageType === "success" ? "#155724" : "#721c24",
|
|
13378
|
-
border: `1px solid ${deleteMessageType === "success" ? "#c3e6cb" : "#f5c6cb"}`
|
|
13379
|
-
},
|
|
13380
13372
|
children: deleteMessage
|
|
13381
13373
|
}
|
|
13382
13374
|
),
|
|
13383
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
13384
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
13375
|
+
/* @__PURE__ */ jsx("div", { className: "p-6 md:p-4 overflow-y-auto flex-1", children: loading ? /* @__PURE__ */ jsxs("div", { className: "text-center py-10 px-5 text-gray-500", children: [
|
|
13376
|
+
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 border-[3px] border-gray-200 border-t-blue-500 rounded-full animate-spin mx-auto mb-4" }),
|
|
13385
13377
|
/* @__PURE__ */ jsx("p", { children: "Cargando recortes..." })
|
|
13386
|
-
] }) : error ? /* @__PURE__ */ jsxs("div", { className: "
|
|
13378
|
+
] }) : error ? /* @__PURE__ */ jsxs("div", { className: "text-center py-10 px-5 text-red-600", children: [
|
|
13387
13379
|
/* @__PURE__ */ jsxs("p", { children: [
|
|
13388
13380
|
"Error al cargar recortes: ",
|
|
13389
13381
|
error
|
|
@@ -13392,42 +13384,50 @@ function ImageVariantsModal({
|
|
|
13392
13384
|
"button",
|
|
13393
13385
|
{
|
|
13394
13386
|
onClick: () => loadVariants(image.id),
|
|
13395
|
-
className: "
|
|
13387
|
+
className: "mt-3 text-xs px-3 py-1.5 rounded-md border cursor-pointer transition-all bg-[#001978] border-[#001978] text-white hover:bg-[#334793] hover:border-[#334793]",
|
|
13396
13388
|
children: "Reintentar"
|
|
13397
13389
|
}
|
|
13398
13390
|
)
|
|
13399
|
-
] }) : variants.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "
|
|
13391
|
+
] }) : variants.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "text-center py-10 px-5 text-gray-500", children: [
|
|
13400
13392
|
/* @__PURE__ */ jsx("p", { children: "Esta imagen no tiene recortes aún." }),
|
|
13401
|
-
/* @__PURE__ */ jsx("small", { children: "Los recortes aparecerán aquí después de hacer recortes o redimensionados." })
|
|
13393
|
+
/* @__PURE__ */ jsx("small", { className: "block mt-2 text-sm text-gray-400", children: "Los recortes aparecerán aquí después de hacer recortes o redimensionados." })
|
|
13402
13394
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13403
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
13404
|
-
/* @__PURE__ */ jsx("h3", { children: "Imagen original" }),
|
|
13395
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-8 last:mb-0", children: [
|
|
13396
|
+
/* @__PURE__ */ jsx("h3", { className: "m-0 mb-4 text-lg font-semibold text-gray-800 border-b-2 border-gray-200 pb-2", children: "Imagen original" }),
|
|
13405
13397
|
/* @__PURE__ */ jsxs(
|
|
13406
13398
|
"div",
|
|
13407
13399
|
{
|
|
13408
13400
|
onClick: handleViewOriginal,
|
|
13409
|
-
className: "
|
|
13401
|
+
className: "border border-sky-500 rounded-lg overflow-hidden bg-sky-50 transition-all hover:border-blue-500 hover:shadow-lg cursor-pointer",
|
|
13410
13402
|
children: [
|
|
13411
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
|
|
13415
|
-
|
|
13403
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-40 md:h-[120px] bg-gray-100 flex items-center justify-center overflow-hidden py-1", children: /* @__PURE__ */ jsx(
|
|
13404
|
+
"img",
|
|
13405
|
+
{
|
|
13406
|
+
src: image.url,
|
|
13407
|
+
alt: image.filename,
|
|
13408
|
+
loading: "lazy",
|
|
13409
|
+
className: "max-w-full max-h-full object-contain rounded"
|
|
13410
|
+
}
|
|
13411
|
+
) }),
|
|
13412
|
+
/* @__PURE__ */ jsxs("div", { className: "p-3", children: [
|
|
13413
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold text-gray-800 mb-1 text-sm break-words", children: image.filename }),
|
|
13414
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2 mb-2 text-xs text-gray-500 flex-wrap", children: [
|
|
13415
|
+
/* @__PURE__ */ jsxs("span", { className: "bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap", children: [
|
|
13416
13416
|
image.width,
|
|
13417
13417
|
"×",
|
|
13418
13418
|
image.height
|
|
13419
13419
|
] }),
|
|
13420
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
13420
|
+
/* @__PURE__ */ jsxs("span", { className: "bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap", children: [
|
|
13421
13421
|
Math.round(image.file_size / 1024),
|
|
13422
13422
|
" KB"
|
|
13423
13423
|
] })
|
|
13424
13424
|
] })
|
|
13425
13425
|
] }),
|
|
13426
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
13426
|
+
/* @__PURE__ */ jsxs("div", { className: "p-3 border-t border-gray-100 flex gap-2 flex-wrap", children: [
|
|
13427
13427
|
shouldShowSelectButton && /* @__PURE__ */ jsx(
|
|
13428
13428
|
"button",
|
|
13429
13429
|
{
|
|
13430
|
-
className: "
|
|
13430
|
+
className: "px-2 py-1 text-xs rounded-md border cursor-pointer transition-all no-underline inline-flex items-center justify-center min-w-auto bg-[#128851] border-[#128851] text-white hover:bg-[#41a074] hover:border-[#41a074]",
|
|
13431
13431
|
onClick: (e) => {
|
|
13432
13432
|
e.stopPropagation();
|
|
13433
13433
|
onSelect?.(image);
|
|
@@ -13440,7 +13440,7 @@ function ImageVariantsModal({
|
|
|
13440
13440
|
shouldShowCropButton && /* @__PURE__ */ jsx(
|
|
13441
13441
|
"button",
|
|
13442
13442
|
{
|
|
13443
|
-
className: "
|
|
13443
|
+
className: "px-2 py-1 text-xs rounded-md border cursor-pointer transition-all no-underline inline-flex items-center justify-center min-w-auto bg-[#7581b1] border-[#7581b1] text-white hover:bg-[#9da6cc] hover:border-[#9da6cc]",
|
|
13444
13444
|
onClick: (e) => {
|
|
13445
13445
|
e.stopPropagation();
|
|
13446
13446
|
handleCropOriginal();
|
|
@@ -13452,7 +13452,7 @@ function ImageVariantsModal({
|
|
|
13452
13452
|
shouldShowCopyButton && /* @__PURE__ */ jsx(
|
|
13453
13453
|
"button",
|
|
13454
13454
|
{
|
|
13455
|
-
className: "
|
|
13455
|
+
className: "px-2 py-1 text-xs rounded-md border cursor-pointer transition-all no-underline inline-flex items-center justify-center min-w-auto bg-[#888a91] border-[#888a91] text-white hover:bg-[#b6b7bb] hover:border-[#b6b7bb]",
|
|
13456
13456
|
onClick: (e) => {
|
|
13457
13457
|
e.stopPropagation();
|
|
13458
13458
|
handleCopyOriginalUrl();
|
|
@@ -13464,7 +13464,7 @@ function ImageVariantsModal({
|
|
|
13464
13464
|
shouldShowDownloadButton && /* @__PURE__ */ jsx(
|
|
13465
13465
|
"button",
|
|
13466
13466
|
{
|
|
13467
|
-
className: "
|
|
13467
|
+
className: "px-2 py-1 text-xs rounded-md border cursor-pointer transition-all no-underline inline-flex items-center justify-center min-w-auto bg-[#001978] border-[#001978] text-white hover:bg-[#334793] hover:border-[#334793]",
|
|
13468
13468
|
onClick: (e) => {
|
|
13469
13469
|
e.stopPropagation();
|
|
13470
13470
|
handleDownloadOriginal();
|
|
@@ -13476,7 +13476,7 @@ function ImageVariantsModal({
|
|
|
13476
13476
|
shouldShowDeleteButton && onDelete && /* @__PURE__ */ jsx(
|
|
13477
13477
|
"button",
|
|
13478
13478
|
{
|
|
13479
|
-
className: "
|
|
13479
|
+
className: "px-2 py-1 text-xs rounded-md border cursor-pointer transition-all no-underline inline-flex items-center justify-center min-w-auto bg-red-600 border-red-600 text-white hover:bg-red-700 hover:border-red-700",
|
|
13480
13480
|
onClick: (e) => {
|
|
13481
13481
|
e.stopPropagation();
|
|
13482
13482
|
handleDeleteOriginal();
|
|
@@ -13490,21 +13490,21 @@ function ImageVariantsModal({
|
|
|
13490
13490
|
}
|
|
13491
13491
|
)
|
|
13492
13492
|
] }),
|
|
13493
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
13494
|
-
/* @__PURE__ */ jsxs("h3", { children: [
|
|
13493
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-8 last:mb-0", children: [
|
|
13494
|
+
/* @__PURE__ */ jsxs("h3", { className: "m-0 mb-4 text-lg font-semibold text-gray-800 border-b-2 border-gray-200 pb-2", children: [
|
|
13495
13495
|
"Recortes (",
|
|
13496
13496
|
variants.length,
|
|
13497
13497
|
")"
|
|
13498
13498
|
] }),
|
|
13499
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
13499
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4 md:grid-cols-4 md:gap-3", children: variants.map((variant) => {
|
|
13500
13500
|
const hasImageError = failedVariants.has(variant.id);
|
|
13501
13501
|
return /* @__PURE__ */ jsxs(
|
|
13502
13502
|
"div",
|
|
13503
13503
|
{
|
|
13504
|
-
className: `
|
|
13504
|
+
className: `border border-gray-200 rounded-lg overflow-hidden bg-white transition-all hover:border-blue-500 hover:shadow-lg ${!hasImageError ? "cursor-pointer" : ""}`,
|
|
13505
13505
|
onClick: !hasImageError ? () => handleViewVariant(variant) : void 0,
|
|
13506
13506
|
children: [
|
|
13507
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
13507
|
+
/* @__PURE__ */ jsxs("div", { className: "relative h-40 md:h-[120px] bg-gray-100 flex items-center justify-center overflow-hidden py-1", children: [
|
|
13508
13508
|
/* @__PURE__ */ jsx(
|
|
13509
13509
|
"img",
|
|
13510
13510
|
{
|
|
@@ -13512,52 +13512,39 @@ function ImageVariantsModal({
|
|
|
13512
13512
|
alt: variant.name || variant.filename || `Variante ${variant.id}`,
|
|
13513
13513
|
loading: "eager",
|
|
13514
13514
|
onError: () => handleVariantImageError(variant.id),
|
|
13515
|
+
className: "max-w-full max-h-full object-contain rounded",
|
|
13515
13516
|
style: {
|
|
13516
13517
|
display: hasImageError ? "none" : "block"
|
|
13517
13518
|
}
|
|
13518
13519
|
}
|
|
13519
13520
|
),
|
|
13520
|
-
hasImageError && /* @__PURE__ */ jsx(
|
|
13521
|
-
"div",
|
|
13522
|
-
{
|
|
13523
|
-
className: "limbo-variant-error",
|
|
13524
|
-
style: {
|
|
13525
|
-
display: "flex",
|
|
13526
|
-
alignItems: "center",
|
|
13527
|
-
justifyContent: "center",
|
|
13528
|
-
height: "100px",
|
|
13529
|
-
backgroundColor: "#f5f5f5",
|
|
13530
|
-
color: "#666"
|
|
13531
|
-
},
|
|
13532
|
-
children: /* @__PURE__ */ jsx("span", { children: "Error al cargar preview" })
|
|
13533
|
-
}
|
|
13534
|
-
)
|
|
13521
|
+
hasImageError && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[100px] bg-gray-100 text-gray-500", children: /* @__PURE__ */ jsx("span", { children: "Error al cargar preview" }) })
|
|
13535
13522
|
] }),
|
|
13536
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
13537
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
13538
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
13539
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
13523
|
+
/* @__PURE__ */ jsxs("div", { className: "p-3", children: [
|
|
13524
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold text-gray-800 mb-1 text-[0.9rem] break-words", children: variant.name || variant.filename || `Variante ${variant.id}` }),
|
|
13525
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2 mb-2 text-xs text-gray-500 flex-wrap", children: [
|
|
13526
|
+
/* @__PURE__ */ jsxs("span", { className: "bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap", children: [
|
|
13540
13527
|
variant.width,
|
|
13541
13528
|
"×",
|
|
13542
13529
|
variant.height
|
|
13543
13530
|
] }),
|
|
13544
|
-
/* @__PURE__ */ jsx("span", { children: (variant.format || "jpg").toUpperCase() }),
|
|
13545
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
13531
|
+
/* @__PURE__ */ jsx("span", { className: "bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap", children: (variant.format || "jpg").toUpperCase() }),
|
|
13532
|
+
/* @__PURE__ */ jsxs("span", { className: "bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap", children: [
|
|
13546
13533
|
Math.round((variant.file_size || 0) / 1024),
|
|
13547
13534
|
" KB"
|
|
13548
13535
|
] })
|
|
13549
13536
|
] }),
|
|
13550
|
-
variant.crop_params && /* @__PURE__ */ jsxs("div", { className: "
|
|
13537
|
+
variant.crop_params && /* @__PURE__ */ jsxs("div", { className: "inline-block bg-green-100 text-green-800 px-2 py-0.5 rounded text-xs font-medium", children: [
|
|
13551
13538
|
/* @__PURE__ */ jsx("span", { className: "icon icon-scissors icon--xs" }),
|
|
13552
13539
|
" ",
|
|
13553
13540
|
"Recortada"
|
|
13554
13541
|
] })
|
|
13555
13542
|
] }),
|
|
13556
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
13543
|
+
/* @__PURE__ */ jsxs("div", { className: "p-3 border-t border-gray-100 flex gap-2 flex-wrap", children: [
|
|
13557
13544
|
shouldShowSelectButton && /* @__PURE__ */ jsx(
|
|
13558
13545
|
"button",
|
|
13559
13546
|
{
|
|
13560
|
-
className: "
|
|
13547
|
+
className: "px-2 py-1 text-[0.75rem] rounded-md border cursor-pointer transition-all no-underline inline-flex items-center justify-center min-w-auto bg-[#128851] border-[#128851] text-white hover:bg-[#41a074] hover:border-[#41a074]",
|
|
13561
13548
|
onClick: (e) => {
|
|
13562
13549
|
e.stopPropagation();
|
|
13563
13550
|
handleSelectVariant(variant);
|
|
@@ -13569,7 +13556,7 @@ function ImageVariantsModal({
|
|
|
13569
13556
|
shouldShowCopyButton && /* @__PURE__ */ jsx(
|
|
13570
13557
|
"button",
|
|
13571
13558
|
{
|
|
13572
|
-
className: "
|
|
13559
|
+
className: "px-2 py-1 text-[0.75rem] rounded-md border cursor-pointer transition-all no-underline inline-flex items-center justify-center min-w-auto bg-[#888a91] border-[#888a91] text-white hover:bg-[#b6b7bb] hover:border-[#b6b7bb]",
|
|
13573
13560
|
onClick: (e) => {
|
|
13574
13561
|
e.stopPropagation();
|
|
13575
13562
|
handleCopyVariantUrl(variant);
|
|
@@ -13581,7 +13568,7 @@ function ImageVariantsModal({
|
|
|
13581
13568
|
shouldShowDownloadButton && /* @__PURE__ */ jsx(
|
|
13582
13569
|
"button",
|
|
13583
13570
|
{
|
|
13584
|
-
className: "
|
|
13571
|
+
className: "px-2 py-1 text-[0.75rem] rounded-md border cursor-pointer transition-all no-underline inline-flex items-center justify-center min-w-auto bg-[#001978] border-[#001978] text-white hover:bg-[#334793] hover:border-[#334793]",
|
|
13585
13572
|
onClick: (e) => {
|
|
13586
13573
|
e.stopPropagation();
|
|
13587
13574
|
handleDownloadVariant(variant);
|
|
@@ -13593,7 +13580,7 @@ function ImageVariantsModal({
|
|
|
13593
13580
|
shouldShowDeleteButton && /* @__PURE__ */ jsx(
|
|
13594
13581
|
"button",
|
|
13595
13582
|
{
|
|
13596
|
-
className: "
|
|
13583
|
+
className: "px-2 py-1 text-[0.75rem] rounded-md border cursor-pointer transition-all no-underline inline-flex items-center justify-center min-w-auto bg-red-600 border-red-600 text-white hover:bg-red-700 hover:border-red-700",
|
|
13597
13584
|
onClick: (e) => {
|
|
13598
13585
|
e.stopPropagation();
|
|
13599
13586
|
handleDeleteVariant(variant);
|