@trafilea/afrodita-components 7.18.3 → 7.19.3
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as i,__assign as t}from"tslib";import{jsx as r}from"react/jsx-runtime";import{useState as e}from"react";import"../../../types/enums.js";import{useTheme as o}from"../../../core/theme/Theme.js";import{buildImageUrl as s}from"../../../utils/buildImageUrl/buildImageUrl.js";import{buildSrcSetOptimized as a}from"../../../utils/buildSrcSetOptimized/buildSrcSetOptimized.js";import{StyledImage as c}from"./styled.js";var d=function(d){var m=d.src,l=d.alt,g=d.height,n=d.width,h=d.quality,f=d.xSizes,u=d.fallbackImg,p=d.srcSet;d.sizes;var v=d.loading,y=void 0===v?"lazy":v,S=d.decoding,b=void 0===S?"async":S,z=d.fetchPriority,j=void 0===z?"auto":z,w=i(d,["src","alt","height","width","quality","xSizes","fallbackImg","srcSet","sizes","loading","decoding","fetchPriority"]),x=o(),I=x.config,k=x.assets,q=I||{},
|
|
1
|
+
import{__rest as i,__assign as t}from"tslib";import{jsx as r}from"react/jsx-runtime";import{useState as e}from"react";import"../../../types/enums.js";import{useTheme as o}from"../../../core/theme/Theme.js";import{buildImageUrl as s}from"../../../utils/buildImageUrl/buildImageUrl.js";import{buildSrcSetOptimized as a}from"../../../utils/buildSrcSetOptimized/buildSrcSetOptimized.js";import{StyledImage as c}from"./styled.js";var d=function(d){var m=d.src,l=d.alt,g=d.height,n=d.width,h=d.quality,f=d.xSizes,u=d.fallbackImg,p=d.srcSet;d.sizes;var v=d.loading,y=void 0===v?"lazy":v,S=d.decoding,b=void 0===S?"async":S,z=d.fetchPriority,j=void 0===z?"auto":z,w=i(d,["src","alt","height","width","quality","xSizes","fallbackImg","srcSet","sizes","loading","decoding","fetchPriority"]),x=o(),I=x.config,k=x.assets,q=I||{},O=q.cdn,P=q.useTrafileaImages,T=e(0),U=T[0],E=T[1],_=P&&O?s({cdn:O,src:m,height:g,width:n,quality:h}):m,A=p||(O&&P?a({cdn:O,image:{src:m,height:g,width:n},xSizes:f}):void 0);return r(c,t({onError:function(i){var t="".concat(k.cdn,"/images/fallback_img.svg"),r=i.target;0===U&&u?(r.src=u,E(1)):U<=1&&(r.src=t,E(2))},src:_,srcSet:A,loading:y,decoding:b,alt:l,height:g,width:n},w,{fetchpriority:j}),void 0)};export{d as Image,d as default};
|
|
2
2
|
//# sourceMappingURL=Image.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as t}from"tslib";import
|
|
1
|
+
import{__makeTemplateObject as t}from"tslib";import o from"@emotion/is-prop-valid";import i from"@emotion/styled";var n,r=i("img",{shouldForwardProp:function(t){return"fetchpriority"===t||o(t)}})(n||(n=t(["\n height: ",";\n width: ",";\n border-radius: ",";\n object-fit: ",";\n object-position: ",";\n"],["\n height: ",";\n width: ",";\n border-radius: ",";\n object-fit: ",";\n object-position: ",";\n"])),(function(t){return t.height}),(function(t){return t.width}),(function(t){return t.borderRadius}),(function(t){return t.objectFit}),(function(t){return t.objectPosition}));export{r as StyledImage};
|
|
2
2
|
//# sourceMappingURL=styled.js.map
|
package/build/index.d.ts
CHANGED
|
@@ -235,7 +235,6 @@ declare type ImageStyleProps = {
|
|
|
235
235
|
borderRadius?: string;
|
|
236
236
|
objectFit?: string;
|
|
237
237
|
objectPosition?: string;
|
|
238
|
-
fetchPriority?: 'auto' | 'high' | 'low';
|
|
239
238
|
};
|
|
240
239
|
|
|
241
240
|
declare type ImgAttributes = React.ImgHTMLAttributes<HTMLImageElement>;
|
|
@@ -246,6 +245,7 @@ declare type ImageProps = InheritedAttributes & ImageStyleProps & {
|
|
|
246
245
|
quality?: number;
|
|
247
246
|
xSizes?: number[];
|
|
248
247
|
fallbackImg?: string;
|
|
248
|
+
fetchPriority?: 'auto' | 'high' | 'low';
|
|
249
249
|
};
|
|
250
250
|
declare const Image: React.FC<ImageProps>;
|
|
251
251
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),r=require("react");require("../../../types/enums.js");var t=require("../../../core/theme/Theme.js"),s=require("../../../utils/buildImageUrl/buildImageUrl.js"),a=require("../../../utils/buildSrcSetOptimized/buildSrcSetOptimized.js"),c=require("./styled.js"),d=function(d){var l=d.src,u=d.alt,o=d.height,g=d.width,n=d.quality,h=d.xSizes,m=d.fallbackImg,S=d.srcSet;d.sizes;var f=d.loading,v=void 0===f?"lazy":f,y=d.decoding,b=void 0===y?"async":y,q=d.fetchPriority,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),r=require("react");require("../../../types/enums.js");var t=require("../../../core/theme/Theme.js"),s=require("../../../utils/buildImageUrl/buildImageUrl.js"),a=require("../../../utils/buildSrcSetOptimized/buildSrcSetOptimized.js"),c=require("./styled.js"),d=function(d){var l=d.src,u=d.alt,o=d.height,g=d.width,n=d.quality,h=d.xSizes,m=d.fallbackImg,S=d.srcSet;d.sizes;var f=d.loading,v=void 0===f?"lazy":f,y=d.decoding,b=void 0===y?"async":y,q=d.fetchPriority,p=void 0===q?"auto":q,z=e.__rest(d,["src","alt","height","width","quality","xSizes","fallbackImg","srcSet","sizes","loading","decoding","fetchPriority"]),j=t.useTheme(),x=j.config,I=j.assets,_=x||{},w=_.cdn,O=_.useTrafileaImages,k=r.useState(0),P=k[0],T=k[1],U=O&&w?s.buildImageUrl({cdn:w,src:l,height:o,width:g,quality:n}):l,E=S||(w&&O?a.buildSrcSetOptimized({cdn:w,image:{src:l,height:o,width:g},xSizes:h}):void 0);return i.jsx(c.StyledImage,e.__assign({onError:function(e){var i="".concat(I.cdn,"/images/fallback_img.svg"),r=e.target;0===P&&m?(r.src=m,T(1)):P<=1&&(r.src=i,T(2))},src:U,srcSet:E,loading:v,decoding:b,alt:u,height:o,width:g},z,{fetchpriority:p}),void 0)};exports.Image=d,exports.default=d;
|
|
2
2
|
//# sourceMappingURL=Image.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),e=require("@emotion/is-prop-valid"),r=require("@emotion/styled");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i,o=n(e),u=n(r).default("img",{shouldForwardProp:function(t){return"fetchpriority"===t||o.default(t)}})(i||(i=t.__makeTemplateObject(["\n height: ",";\n width: ",";\n border-radius: ",";\n object-fit: ",";\n object-position: ",";\n"],["\n height: ",";\n width: ",";\n border-radius: ",";\n object-fit: ",";\n object-position: ",";\n"])),(function(t){return t.height}),(function(t){return t.width}),(function(t){return t.borderRadius}),(function(t){return t.objectFit}),(function(t){return t.objectPosition}));exports.StyledImage=u;
|
|
2
2
|
//# sourceMappingURL=styled.js.map
|
package/package.json
CHANGED