react-skeleton-image
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,2 +0,2 @@ | ||
"use strict";var V=Object.create;var a=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var n=(e,l)=>a(e,"name",{value:l,configurable:!0});var N=(e,l)=>{for(var t in l)a(e,t,{get:l[t],enumerable:!0})},g=(e,l,t,s)=>{if(l&&typeof l=="object"||typeof l=="function")for(let r of C(l))!M.call(e,r)&&r!==t&&a(e,r,{get:()=>l[r],enumerable:!(s=x(l,r))||s.enumerable});return e};var h=(e,l,t)=>(t=e!=null?V(E(e)):{},g(l||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e)),P=e=>g(a({},"__esModule",{value:!0}),e);var S={};N(S,{Image:()=>k});module.exports=P(S);var o=h(require("react"));var c=h(require("react"));var Z=n(e=>c.default.createElement("svg",{viewBox:"0 0 15 15",fill:"none",width:"40",height:"40",...e},c.default.createElement("path",{d:"M2.5 1h10A1.5 1.5 0 0 1 14 2.5v10a1.5 1.5 0 0 1-1.5 1.5h-10A1.5 1.5 0 0 1 1 12.5v-10A1.5 1.5 0 0 1 2.5 1Zm0 1a.5.5 0 0 0-.5.5v5.864l1.682-1.682a.45.45 0 0 1 .647.01l3.545 3.798 2.808-2.808a.45.45 0 0 1 .636 0L13 9.364V2.5a.5.5 0 0 0-.5-.5h-10ZM2 12.5V9.636l1.989-1.988 3.542 3.794L8.941 13H2.5a.5.5 0 0 1-.5-.5Zm10.5.5h-2.345l-1.672-1.847L11 8.636l2 2V12.5a.5.5 0 0 1-.5.5ZM6.65 5.5a.85.85 0 1 1 1.7 0 .85.85 0 0 1-1.7 0Zm.85-1.75a1.75 1.75 0 1 0 0 3.5 1.75 1.75 0 0 0 0-3.5Z",fill:"#868E96",fillRule:"evenodd",clipRule:"evenodd"})),"FallbackIcon"),p=Z;var y=n(e=>{let[l,t]=(0,o.useState)(!1),[s,r]=(0,o.useState)(!1),v=(0,o.useRef)(null),{skeleton:f=!0,skeletonClassName:b="",className:I="",width:i="",height:m="",style:L={},onClick:u,...d}=e,w=l?"block":"hidden";return s?o.default.createElement("div",{className:"flex justify-center items-center w-full h-full bg-fallback cursor-pointer",onClick:u,style:{width:i,height:m}},o.default.createElement(p,null)):o.default.createElement(o.default.Fragment,null,o.default.createElement("img",{ref:v,...d,alt:d.alt,onLoad:()=>t(!0),onError:()=>r(!0),className:`w-full h-full object-cover object-center ${f?w:""} ${I}`,style:{width:i,height:m,...L}}),f&&!l&&!s&&o.default.createElement("div",{className:`bg-skeleton w-full h-full rounded-inherit cursor-pointer animate-skeleton ${b}`,onClick:u,style:{width:i,height:m}}))},"Image"),k=y;0&&(module.exports={Image}); | ||
"use strict";var C=Object.create;var r=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var m=(e,l)=>r(e,"name",{value:l,configurable:!0});var Z=(e,l)=>{for(var a in l)r(e,a,{get:l[a],enumerable:!0})},p=(e,l,a,t)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of M(l))!P.call(e,s)&&s!==a&&r(e,s,{get:()=>l[s],enumerable:!(t=E(l,s))||t.enumerable});return e};var h=(e,l,a)=>(a=e!=null?C(N(e)):{},p(l||!e||!e.__esModule?r(a,"default",{value:e,enumerable:!0}):a,e)),x=e=>p(r({},"__esModule",{value:!0}),e);var y={};Z(y,{Image:()=>k});module.exports=x(y);var o=h(require("react"));var d=h(require("react"));var S=m(e=>d.default.createElement("svg",{viewBox:"0 0 15 15",fill:"none",width:"40",height:"40",...e},d.default.createElement("path",{d:"M2.5 1h10A1.5 1.5 0 0 1 14 2.5v10a1.5 1.5 0 0 1-1.5 1.5h-10A1.5 1.5 0 0 1 1 12.5v-10A1.5 1.5 0 0 1 2.5 1Zm0 1a.5.5 0 0 0-.5.5v5.864l1.682-1.682a.45.45 0 0 1 .647.01l3.545 3.798 2.808-2.808a.45.45 0 0 1 .636 0L13 9.364V2.5a.5.5 0 0 0-.5-.5h-10ZM2 12.5V9.636l1.989-1.988 3.542 3.794L8.941 13H2.5a.5.5 0 0 1-.5-.5Zm10.5.5h-2.345l-1.672-1.847L11 8.636l2 2V12.5a.5.5 0 0 1-.5.5ZM6.65 5.5a.85.85 0 1 1 1.7 0 .85.85 0 0 1-1.7 0Zm.85-1.75a1.75 1.75 0 1 0 0 3.5 1.75 1.75 0 0 0 0-3.5Z",fill:"#868E96",fillRule:"evenodd",clipRule:"evenodd"})),"FallbackIcon"),u=S;var w=m(e=>{let[l,a]=(0,o.useState)(!1),[t,s]=(0,o.useState)(!1),v=(0,o.useRef)(null),{skeleton:g=!0,skeletonClassName:I="",className:L="",width:n="",height:i="",style:b={},onClick:c,...f}=e,V=l?"block":"hidden";return t?o.default.createElement("div",{className:"fallback",onClick:c,style:{width:n,height:i}},o.default.createElement(u,null)):o.default.createElement(o.default.Fragment,null,o.default.createElement("img",{ref:v,...f,alt:f.alt,onLoad:()=>a(!0),onError:()=>s(!0),className:`image ${g?V:""} ${L}`,style:{width:n,height:i,...b}}),g&&!l&&!t&&o.default.createElement("div",{className:`skeleton ${I}`,onClick:c,style:{width:n,height:i}}))},"Image"),k=w;0&&(module.exports={Image}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "react-skeleton-image", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A skeleton image component which handles the image's loading and error state.", | ||
@@ -43,3 +43,2 @@ "main": "dist/index.js", | ||
"react-dom": "^18.2.0", | ||
"tailwindcss": "^3.2.7", | ||
"tslib": "^2.5.0", | ||
@@ -46,0 +45,0 @@ "tsup": "^6.6.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12
10007
19