limbo-component 3.5.4 → 3.5.5

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.es.js CHANGED
@@ -151,7 +151,7 @@ return c("div",{className:"limbo-image-card lb:animate-pulse",role:"status","ari
151
151
  /* @__PURE__ */s("div",{className:"limbo-image-card-name lb:opacity-100 lb:position-relative lb:bottom-0 lb:p-2",children:/* @__PURE__ */s("div",{className:"lb:h-4 lb:bg-neutral-gray-200 lb:rounded lb:w-3/4"})}),
152
152
  /* @__PURE__ */s("span",{className:"lb:sr-only",children:"Cargando imágen..."})]})}function Te({variant:e="info",toast:l=!1,fixed:r=!1,onClose:a,className:i="",children:o,role:u}){const[d,b]=t(!1);if(n(()=>{b(!1)},[o]),d)return null;const m=l||r;/* @__PURE__ */
153
153
  return c("div",{className:`${m?`${r?"lb:fixed lb:top-4 lb:right-4 lb:z-10000":l?"lb:absolute lb:top-5 lb:right-5 lb:w-fit lb:m-4 lb:z-50":""} ${{success:"lb:bg-green-600",danger:"lb:bg-red-500",warning:"lb:bg-yellow-500",info:"lb:bg-blue-500"}[e]||"lb:bg-gray-600"} lb:text-white lb:px-5 lb:py-3 lb:rounded-lg lb:shadow-lg lb:transition-all lb:duration-300 lb:animate-fade-in`:`limbo-alert limbo-alert-${e}`} lb:pr-8 ${i}`,role:u||"alert",children:[o,
154
- /* @__PURE__ */s("button",{type:"button",onClick:e=>{e.stopPropagation(),a?a():b(!0)},className:"lb:absolute lb:top-1/2 lb:-translate-y-1/2 lb:right-2 lb:p-1 lb:rounded-full lb:opacity-60 lb:hover:opacity-100 lb:transition-opacity lb:cursor-pointer","aria-label":"Cerrar",children:/* @__PURE__ */s("span",{className:`icon ${m?"icon-close-small-white":"icon-close"} icon--sm`,"aria-hidden":"true"})})]})}const Le=[{value:"",label:"Todos los tipos"},{value:"image",label:"Imágenes"},{value:"video",label:"Videos"},{value:"document",label:"Documentos"},{value:"audio",label:"Audio"}];function Ae({onSelect:e,onCrop:l,onDelete:a,deletingId:o,images:u,loading:m,error:h,filters:p={name:"",dateFrom:"",dateTo:"",uploadedBy:"",assetType:"",folder:""},debouncedFilters:f=null,onFiltersChange:g,filterConfig:v={showNameFilter:!0,showUploadedByFilter:!1,showDateFilter:!0,showTypeFilter:!1},loadingConfig:y={showPlaceholders:!0,placeholderCount:10,showSpinner:!0},allowedActions:w={select:!0,download:!0,copy:!0,delete:!0,crop:!0,variants:!0},allowedCategories:x=null,resolvedAccept:k=null,folderConfig:C=null,onFolderChange:N=null}){const{isSearching:S,searchPending:E}=function(e,l,a){const[i,o]=t(!1),s=r(null);return n(()=>(Object.keys(e).some(t=>e[t]!==l[t])?s.current=setTimeout(()=>{o(!0)},150):(s.current&&clearTimeout(s.current),o(!1)),()=>{s.current&&clearTimeout(s.current)}),[e,l]),{isSearching:i||a,searchPending:i}}(p,f||p,m),$=!1!==v.showNameFilter,_=!0===v.showUploadedByFilter,z=!1!==v.showDateFilter,T=!1!==v.showTypeFilter,L=!0===C?.showFolderFilter,A=C?.include?.length>0?C.include:null,I=C?.exclude?.length>0?C.exclude:null,P=!1!==C?.showFolderInfo,M=!1!==C?.allowMoveFolder&&!!N,D=!0===C?.allowCreateFolder,O=i(()=>{const e=k&&!k.isAllTypes?function(e){if(!e||e.isAllTypes)return null;const t=new Set(e.categories);for(const n of e.extensions){const e=d[n]||[];for(const n of e)for(const[e,l]of Object.entries(b))l.includes(n)&&t.add(e)}for(const n of e.mimeTypes)for(const[e,l]of Object.entries(b))(l.includes(n)||n.startsWith(e+"/"))&&t.add(e);return t.size>0?[...t]:null}(k):x;return e?Le.filter(t=>""===t.value||e.includes(t.value)):Le},[k,x]),R=r(null),j=window.limboCore?.accessibilityManager;n(()=>{if(R.current&&window.limboCore?.keyboardManager){const e="gallery-grid";R.current.setAttribute("data-grid-id",e),window.limboCore.keyboardManager.setupGridNavigation(R.current,{itemSelector:".limbo-image-card",gridId:e,columns:"auto"})}},[u]),n(()=>{if(!m&&u.length>0){const e=u.slice(0,12).map(e=>e.url||e.path).filter(Boolean);e.length>0&&F(e,4)}},[m,u]);const U=i(()=>{if(!p.assetType)return"archivos";return{image:"imágenes",video:"videos",document:"documentos",audio:"archivos de audio"}[p.assetType]||"archivos"},[p.assetType]);n(()=>{m?j?.announceLoading(!0,"galería"):m||h?h&&j?.announceError(h,"galería"):(j?.announceLoading(!1,"galería"),u.length>0&&j?.announce(`Se encontraron ${u.length} ${U} en la galería`))},[m,h,u.length,j,U]),n(()=>{E&&j?.announce("Buscando...","polite")},[E,j]);const B=e=>{const{name:t,value:n}=e.target;g&&g({...p,[t]:n})},W=p.name||p.dateFrom||p.dateTo||p.uploadedBy||p.assetType||p.folder,q=S&&u.length>0&&!m;/* @__PURE__ */
154
+ /* @__PURE__ */s("button",{type:"button",onClick:e=>{e.stopPropagation(),a?a():b(!0)},className:"lb:absolute lb:top-1/2 lb:-translate-y-1/2 lb:right-2 lb:p-1 lb:rounded-full lb:opacity-60 lb:hover:opacity-100 lb:transition-opacity lb:cursor-pointer","aria-label":"Cerrar",children:/* @__PURE__ */s("span",{className:`icon ${m?"icon-close-small- white":"icon-close"} icon--sm`,"aria-hidden":"true"})})]})}const Le=[{value:"",label:"Todos los tipos"},{value:"image",label:"Imágenes"},{value:"video",label:"Videos"},{value:"document",label:"Documentos"},{value:"audio",label:"Audio"}];function Ae({onSelect:e,onCrop:l,onDelete:a,deletingId:o,images:u,loading:m,error:h,filters:p={name:"",dateFrom:"",dateTo:"",uploadedBy:"",assetType:"",folder:""},debouncedFilters:f=null,onFiltersChange:g,filterConfig:v={showNameFilter:!0,showUploadedByFilter:!1,showDateFilter:!0,showTypeFilter:!1},loadingConfig:y={showPlaceholders:!0,placeholderCount:10,showSpinner:!0},allowedActions:w={select:!0,download:!0,copy:!0,delete:!0,crop:!0,variants:!0},allowedCategories:x=null,resolvedAccept:k=null,folderConfig:C=null,onFolderChange:N=null}){const{isSearching:S,searchPending:E}=function(e,l,a){const[i,o]=t(!1),s=r(null);return n(()=>(Object.keys(e).some(t=>e[t]!==l[t])?s.current=setTimeout(()=>{o(!0)},150):(s.current&&clearTimeout(s.current),o(!1)),()=>{s.current&&clearTimeout(s.current)}),[e,l]),{isSearching:i||a,searchPending:i}}(p,f||p,m),$=!1!==v.showNameFilter,_=!0===v.showUploadedByFilter,z=!1!==v.showDateFilter,T=!1!==v.showTypeFilter,L=!0===C?.showFolderFilter,A=C?.include?.length>0?C.include:null,I=C?.exclude?.length>0?C.exclude:null,P=!1!==C?.showFolderInfo,M=!1!==C?.allowMoveFolder&&!!N,D=!0===C?.allowCreateFolder,O=i(()=>{const e=k&&!k.isAllTypes?function(e){if(!e||e.isAllTypes)return null;const t=new Set(e.categories);for(const n of e.extensions){const e=d[n]||[];for(const n of e)for(const[e,l]of Object.entries(b))l.includes(n)&&t.add(e)}for(const n of e.mimeTypes)for(const[e,l]of Object.entries(b))(l.includes(n)||n.startsWith(e+"/"))&&t.add(e);return t.size>0?[...t]:null}(k):x;return e?Le.filter(t=>""===t.value||e.includes(t.value)):Le},[k,x]),R=r(null),j=window.limboCore?.accessibilityManager;n(()=>{if(R.current&&window.limboCore?.keyboardManager){const e="gallery-grid";R.current.setAttribute("data-grid-id",e),window.limboCore.keyboardManager.setupGridNavigation(R.current,{itemSelector:".limbo-image-card",gridId:e,columns:"auto"})}},[u]),n(()=>{if(!m&&u.length>0){const e=u.slice(0,12).map(e=>e.url||e.path).filter(Boolean);e.length>0&&F(e,4)}},[m,u]);const U=i(()=>{if(!p.assetType)return"archivos";return{image:"imágenes",video:"videos",document:"documentos",audio:"archivos de audio"}[p.assetType]||"archivos"},[p.assetType]);n(()=>{m?j?.announceLoading(!0,"galería"):m||h?h&&j?.announceError(h,"galería"):(j?.announceLoading(!1,"galería"),u.length>0&&j?.announce(`Se encontraron ${u.length} ${U} en la galería`))},[m,h,u.length,j,U]),n(()=>{E&&j?.announce("Buscando...","polite")},[E,j]);const B=e=>{const{name:t,value:n}=e.target;g&&g({...p,[t]:n})},W=p.name||p.dateFrom||p.dateTo||p.uploadedBy||p.assetType||p.folder,q=S&&u.length>0&&!m;/* @__PURE__ */
155
155
  return c("div",{className:"lb:w-full lb:max-w-full lb:py-2 lb:overflow-x-hidden lb:box-border",children:[
156
156
  /* @__PURE__ */s("div",{className:"lb:px-2 lb:mb-3 lb:mx-2 lb:max-w-full lb:overflow-x-hidden lb:box-border",children:/* @__PURE__ */c("form",{className:"limbo-filters lb:flex lb:items-stretch lb:content-stretch lb:flex-row",onSubmit:e=>e.preventDefault(),role:"search","aria-label":"Filtrar archivos",children:[$&&/* @__PURE__ */c("div",{className:"limbo-filter-group limbo-filter-group--name",children:[
157
157
  /* @__PURE__ */c("label",{htmlFor:"name",className:"limbo-filter-label",children:["Nombre",E&&/* @__PURE__ */s("span",{className:"limbo-filter-searching","aria-hidden":"true",children:/* @__PURE__ */s("span",{className:"icon icon-spinner lb:animate-spin lb:w-3 lb:h-3"})})]}),