limbo-component 2.5.1 → 2.5.2
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 +9 -5
- 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/Gallery.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/limbo.es.js
CHANGED
|
@@ -62,9 +62,9 @@ return s(c,{children:[
|
|
|
62
62
|
return s("div",{className:"limbo-image-card lb:animate-pulse",role:"status","aria-label":"Cargando imágen...",children:[
|
|
63
63
|
/* @__PURE__ */o("div",{className:"lb:w-full lb:aspect-square lb:bg-neutral-gray-200 lb:rounded-md lb:flex lb:items-center lb:justify-center",children:/* @__PURE__ */o("span",{className:"icon icon-spinner"})}),
|
|
64
64
|
/* @__PURE__ */o("div",{className:"limbo-image-card-name lb:opacity-100 lb:position-relative lb:bottom-0 lb:p-2",children:/* @__PURE__ */o("div",{className:"lb:h-4 lb:bg-neutral-gray-200 lb:rounded lb:w-3/4"})}),
|
|
65
|
-
/* @__PURE__ */o("span",{className:"lb:sr-only",children:"Cargando imágen..."})]})}function ee({onSelect:e,onCrop:r,onDelete:a,deletingId:i,images:c,loading:u,error:d,filters:b={name:"",dateFrom:"",dateTo:"",uploadedBy:""},debouncedFilters:m=null,onFiltersChange:h,filterConfig:p={showNameFilter:!0,showUploadedByFilter:!1,showDateFilter:!0},loadingConfig:f={showPlaceholders:!0,placeholderCount:10,showSpinner:!0},allowedActions:g={select:!0,download:!0,copy:!0,delete:!0,crop:!0,variants:!0}}){const{isSearching:y,searchPending:v}=function(e,r,a){const[i,o]=t(!1),s=l(null);return n(()=>(Object.keys(e).some(t=>e[t]!==r[t])?s.current=setTimeout(()=>{o(!0)},150):(s.current&&clearTimeout(s.current),o(!1)),()=>{s.current&&clearTimeout(s.current)}),[e,r]),{isSearching:i||a,searchPending:i}}(b,m||b,u),w=!1!==p.showNameFilter,x=!0===p.showUploadedByFilter,k=!1!==p.showDateFilter,C=l(null),S=window.limboCore?.accessibilityManager;n(()=>{if(C.current&&window.limboCore?.keyboardManager){const e="gallery-grid";C.current.setAttribute("data-grid-id",e),window.limboCore.keyboardManager.setupGridNavigation(C.current,{itemSelector:".limbo-image-card",gridId:e,columns:"auto"})}},[c]),n(()=>{if(!u&&c.length>0){const e=c.slice(0,12).map(e=>e.url||e.path).filter(Boolean);e.length>0&&M(e,4)}},[u,c]),n(()=>{u?S?.announceLoading(!0,"galería"):u||d?d&&S?.announceError(d,"galería"):(S?.announceLoading(!1,"galería"),c.length>0&&S?.announce(`Se encontraron ${c.length} imágenes en la galería`))},[u,d,c.length,S]),n(()=>{v&&S?.announce("Buscando...","polite")},[v,S]);const N=e=>{const{name:t,value:n}=e.target;h&&h({...b,[t]:n})},E=y&&c.length>0&&!u;/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */o("span",{className:"lb:sr-only",children:"Cargando imágen..."})]})}function ee({onSelect:e,onCrop:r,onDelete:a,deletingId:i,images:c,loading:u,error:d,filters:b={name:"",dateFrom:"",dateTo:"",uploadedBy:""},debouncedFilters:m=null,onFiltersChange:h,filterConfig:p={showNameFilter:!0,showUploadedByFilter:!1,showDateFilter:!0},loadingConfig:f={showPlaceholders:!0,placeholderCount:10,showSpinner:!0},allowedActions:g={select:!0,download:!0,copy:!0,delete:!0,crop:!0,variants:!0}}){const{isSearching:y,searchPending:v}=function(e,r,a){const[i,o]=t(!1),s=l(null);return n(()=>(Object.keys(e).some(t=>e[t]!==r[t])?s.current=setTimeout(()=>{o(!0)},150):(s.current&&clearTimeout(s.current),o(!1)),()=>{s.current&&clearTimeout(s.current)}),[e,r]),{isSearching:i||a,searchPending:i}}(b,m||b,u),w=!1!==p.showNameFilter,x=!0===p.showUploadedByFilter,k=!1!==p.showDateFilter,C=l(null),S=window.limboCore?.accessibilityManager;n(()=>{if(C.current&&window.limboCore?.keyboardManager){const e="gallery-grid";C.current.setAttribute("data-grid-id",e),window.limboCore.keyboardManager.setupGridNavigation(C.current,{itemSelector:".limbo-image-card",gridId:e,columns:"auto"})}},[c]),n(()=>{if(!u&&c.length>0){const e=c.slice(0,12).map(e=>e.url||e.path).filter(Boolean);e.length>0&&M(e,4)}},[u,c]),n(()=>{u?S?.announceLoading(!0,"galería"):u||d?d&&S?.announceError(d,"galería"):(S?.announceLoading(!1,"galería"),c.length>0&&S?.announce(`Se encontraron ${c.length} imágenes en la galería`))},[u,d,c.length,S]),n(()=>{v&&S?.announce("Buscando...","polite")},[v,S]);const N=e=>{const{name:t,value:n}=e.target;h&&h({...b,[t]:n})},E=b.name||b.dateFrom||b.dateTo||b.uploadedBy,$=y&&c.length>0&&!u;/* @__PURE__ */
|
|
66
66
|
return s("div",{className:"lb:w-full lb:py-2",children:[
|
|
67
|
-
/* @__PURE__ */o("div",{className:"lb:px-2 lb:mb-3 lb:mx-2 lb:w-max lb:max-w-full",children:/* @__PURE__ */s("form",{className:"limbo-filters",onSubmit:e=>e.preventDefault(),role:"search","aria-label":"Filtrar imágenes",children:[w&&/* @__PURE__ */s("div",{className:"limbo-filter-group limbo-filter-group--name",children:[
|
|
67
|
+
/* @__PURE__ */o("div",{className:"lb:px-2 lb:mb-3 lb:mx-2 lb:w-max lb:max-w-full",children:/* @__PURE__ */s("form",{className:"limbo-filters lb:flex lb:items-stretch lb:content-stretch lb:flex-row",onSubmit:e=>e.preventDefault(),role:"search","aria-label":"Filtrar imágenes",children:[w&&/* @__PURE__ */s("div",{className:"limbo-filter-group limbo-filter-group--name",children:[
|
|
68
68
|
/* @__PURE__ */s("label",{htmlFor:"name",className:"limbo-filter-label",children:["Nombre",v&&/* @__PURE__ */o("span",{className:"limbo-filter-searching","aria-hidden":"true",children:/* @__PURE__ */o("span",{className:"icon icon-spinner lb:animate-spin lb:w-3 lb:h-3"})})]}),
|
|
69
69
|
/* @__PURE__ */o("input",{type:"text",name:"name",id:"name",placeholder:"Buscar...",value:b.name,onChange:N,className:"limbo-filter-input",autoComplete:"off"})]}),k&&/* @__PURE__ */s("div",{className:"limbo-filter-dates",children:[
|
|
70
70
|
/* @__PURE__ */s("div",{className:"limbo-filter-group limbo-filter-group--date",children:[
|
|
@@ -74,13 +74,17 @@ return s("div",{className:"lb:w-full lb:py-2",children:[
|
|
|
74
74
|
/* @__PURE__ */o("label",{htmlFor:"dateTo",className:"limbo-filter-label",children:"Hasta"}),
|
|
75
75
|
/* @__PURE__ */o("input",{type:"date",name:"dateTo",id:"dateTo",value:b.dateTo,onChange:N,className:"limbo-filter-input"})]})]}),x&&/* @__PURE__ */s("div",{className:"limbo-filter-group",children:[
|
|
76
76
|
/* @__PURE__ */o("label",{htmlFor:"uploadedBy",className:"limbo-filter-label",children:"Subido por"}),
|
|
77
|
-
/* @__PURE__ */o("input",{type:"text",name:"uploadedBy",id:"uploadedBy",placeholder:"Usuario...",value:b.uploadedBy,onChange:N,className:"limbo-filter-input",style:{minWidth:"100px",maxWidth:"140px"}})]})
|
|
77
|
+
/* @__PURE__ */o("input",{type:"text",name:"uploadedBy",id:"uploadedBy",placeholder:"Usuario...",value:b.uploadedBy,onChange:N,className:"limbo-filter-input",style:{minWidth:"100px",maxWidth:"140px"}})]}),
|
|
78
|
+
/* @__PURE__ */s("div",{children:[
|
|
79
|
+
/* @__PURE__ */o("span",{}),
|
|
80
|
+
/* @__PURE__ */s("button",{type:"button",onClick:()=>{h&&h({name:"",uploadedBy:"",dateFrom:"",dateTo:""})},disabled:!E,className:"limbo-filter-clear-btn","aria-label":"Limpiar todos los filtros",title:"Limpiar filtros",children:[
|
|
81
|
+
/* @__PURE__ */o("span",{className:"icon icon-close-small"}),"Limpiar"]})]})]})}),u?/* @__PURE__ */s("div",{className:"lb:relative",children:[
|
|
78
82
|
/* @__PURE__ */o("div",{className:"lb:absolute lb:inset-0 lb:flex lb:items-center lb:justify-center lb:bg-white/80 lb:z-10 lb:min-h-75",children:/* @__PURE__ */s("div",{className:"lb:flex lb:flex-col lb:items-center lb:gap-3",children:[
|
|
79
83
|
/* @__PURE__ */o("span",{className:"icon icon-spinner lb:p-4 lb:animate-spin"}),
|
|
80
|
-
/* @__PURE__ */o("span",{className:"lb:text-sm lb:text-gray-600 lb:font-medium",children:"Cargando imágenes..."})]})}),f.showPlaceholders&&/* @__PURE__ */o("div",{ref:C,className:"limbo-gallery lb:opacity-30","data-limbo-responsive":!0,role:"grid","aria-label":"Cargando imágenes de la galería","aria-busy":"true",children:Array.from({length:f.placeholderCount}).map((e,t)=>/* @__PURE__ */o("div",{role:"gridcell","aria-posinset":t+1,"aria-setsize":f.placeholderCount,children:/* @__PURE__ */o(Z,{})},`skeleton-${t}`))})]}):d?/* @__PURE__ */o("div",{className:"alert alert-danger lb:text-center",children:d}):/* @__PURE__ */s("div",{className:"lb:relative",children:[
|
|
84
|
+
/* @__PURE__ */o("span",{className:"lb:text-sm lb:text-gray-600 lb:font-medium",children:"Cargando imágenes..."})]})}),f.showPlaceholders&&/* @__PURE__ */o("div",{ref:C,className:"limbo-gallery lb:opacity-30","data-limbo-responsive":!0,role:"grid","aria-label":"Cargando imágenes de la galería","aria-busy":"true",children:Array.from({length:f.placeholderCount}).map((e,t)=>/* @__PURE__ */o("div",{role:"gridcell","aria-posinset":t+1,"aria-setsize":f.placeholderCount,children:/* @__PURE__ */o(Z,{})},`skeleton-${t}`))})]}):d?/* @__PURE__ */o("div",{className:"alert alert-danger lb:text-center",children:d}):/* @__PURE__ */s("div",{className:"lb:relative",children:[$&&/* @__PURE__ */o("div",{className:"limbo-search-overlay",role:"status","aria-live":"polite","aria-label":"Buscando imágenes",children:/* @__PURE__ */s("div",{className:"limbo-search-overlay__content",children:[
|
|
81
85
|
/* @__PURE__ */o("span",{className:"icon icon-spinner lb:animate-spin"}),
|
|
82
86
|
/* @__PURE__ */o("span",{children:"Buscando..."})]})}),
|
|
83
|
-
/* @__PURE__ */o("div",{ref:C,className:"limbo-gallery lb:px-3 "+(
|
|
87
|
+
/* @__PURE__ */o("div",{ref:C,className:"limbo-gallery lb:px-3 "+($?"lb:opacity-50 lb:pointer-events-none":""),"data-limbo-responsive":!0,"data-grid-id":"gallery-grid",role:"grid","aria-label":"Galería de imágenes. Use las flechas para navegar entre imágenes","aria-busy":$,children:c.length>0?c.map((t,n)=>/* @__PURE__ */o("div",{role:"gridcell","aria-posinset":n+1,"aria-setsize":c.length,children:/* @__PURE__ */o(J,{image:t,onSelect:e,onCrop:r,onDelete:g.delete&&a?()=>a(t.id):null,thumbnailSize:32,isDeleting:i===t.id,allowedActions:g})},t.id)):/* @__PURE__ */o("div",{className:"lb:col-span-full lb:text-center lb:text-gray-500 lb:py-8",role:"status","aria-live":"polite",children:/* @__PURE__ */o("p",{children:"No se han encontrado imágenes"})})})]})]})}function te({image:e,onDiscard:r,onRetry:l,onDownload:a,onSelect:i,showRetry:c=!1,disabled:u=!1}){const[d,b]=t(null),[m,h]=t({name:"",size:"",type:""}),[p,f]=t(!1),[g,y]=t(!1),[v,w]=t("");n(()=>{if(!e)return void b(null);const t=URL.createObjectURL(e);b(t);const n=e.name||"imagen.webp",r=(e=>{const t=e?.split(".")[0]?.toLowerCase()||"";return["ai-image","ai_image","generated","imagen-ia","imagen_ia"].some(e=>t.startsWith(e))})(n);return h({name:n,size:x(e.size||0),type:e.type||"image/webp"}),r?(w(""),y(!1)):w(n.split(".")[0]),()=>{URL.revokeObjectURL(t)}},[e]);const x=e=>{if(0===e)return"0 Bytes";const t=Math.floor(Math.log(e)/Math.log(1024));return Math.round(e/Math.pow(1024,t)*100)/100+" "+["Bytes","KB","MB","GB"][t]};return e&&d?/* @__PURE__ */s("div",{className:"lb:w-fit lb:md:w-full lb:bg-white lb:border lb:border-gray-200 lb:rounded-lg lb:px-1 lb:sm:px-3 lb:py-2 lb:m-0 lb:shadow-sm",children:[
|
|
84
88
|
/* @__PURE__ */s("div",{className:"lb:flex lb:items-center lb:justify-between lb:mb-4 lb:px-1",children:[
|
|
85
89
|
/* @__PURE__ */o("h3",{className:"lb:text-sm lb:font-medium lb:text-gray-700",children:"Vista previa de imagen"}),
|
|
86
90
|
/* @__PURE__ */o("button",{type:"button",onClick:r,disabled:u,className:"lb:p-1.5 lb:text-gray-400 lb:cursor-pointer lb:hover:text-gray-600 lb:hover:bg-red-300 lb:rounded lb:transition-colors lb:disabled:opacity-50 lb:disabled:cursor-not-allowed","aria-label":"Descartar imagen",title:"Descartar imagen",children:/* @__PURE__ */o("span",{className:"icon icon-close-small icon--md"})})]}),
|