@jetshop/ui 6.5.2 → 6.5.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.
|
@@ -3,7 +3,7 @@ export const getSrcSetFromWidths = (src, widths, aspect, options = { crop: false
|
|
|
3
3
|
const p = [];
|
|
4
4
|
for (const w of widths) {
|
|
5
5
|
const prop = createSrcWithProperties(w, aspect, src, true, options, modifiedDate);
|
|
6
|
-
p.push(`${baseUrl}/cdn-cgi/image/${prop}/${src}${modifiedDate ? `?timestamp=${modifiedDate}` : ''}
|
|
6
|
+
p.push(`${baseUrl}/cdn-cgi/image/${prop}/${src}${modifiedDate ? `?timestamp=${modifiedDate}` : ''} ${w}w`);
|
|
7
7
|
}
|
|
8
8
|
return p.join(', ');
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSrcSetFromWidths.js","sourceRoot":"","sources":["getSrcSetFromWidths.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAW7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,GAAW,EACX,MAAgB,EAChB,MAAmB,EACnB,UAA6B,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EACzD,YAAqB,EACrB,OAAgB,EAChB,EAAE;IACF,MAAM,CAAC,GAAG,EAAE,CAAC;IAEb,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;QACtB,MAAM,IAAI,GAAG,uBAAuB,CAClC,CAAC,EACD,MAAM,EACN,GAAG,EACH,IAAI,EACJ,OAAO,EACP,YAAY,CACb,CAAC;QACF,CAAC,CAAC,IAAI,CACJ,GAAG,OAAO,kBAAkB,IAAI,IAAI,GAAG,GACrC,YAAY,CAAC,CAAC,CAAC,cAAc,YAAY,EAAE,CAAC,CAAC,CAAC,EAChD,
|
|
1
|
+
{"version":3,"file":"getSrcSetFromWidths.js","sourceRoot":"","sources":["getSrcSetFromWidths.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAW7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,GAAW,EACX,MAAgB,EAChB,MAAmB,EACnB,UAA6B,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EACzD,YAAqB,EACrB,OAAgB,EAChB,EAAE;IACF,MAAM,CAAC,GAAG,EAAE,CAAC;IAEb,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;QACtB,MAAM,IAAI,GAAG,uBAAuB,CAClC,CAAC,EACD,MAAM,EACN,GAAG,EACH,IAAI,EACJ,OAAO,EACP,YAAY,CACb,CAAC;QACF,CAAC,CAAC,IAAI,CACJ,GAAG,OAAO,kBAAkB,IAAI,IAAI,GAAG,GACrC,YAAY,CAAC,CAAC,CAAC,cAAc,YAAY,EAAE,CAAC,CAAC,CAAC,EAChD,IAAI,CAAC,GAAG,CACT,CAAC;KACH;IAED,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC,CAAC"}
|
|
@@ -18,28 +18,25 @@ src,
|
|
|
18
18
|
includeViewportSize = true, options = { crop: false, webp: false },
|
|
19
19
|
// @ts-ignore
|
|
20
20
|
timestamp) {
|
|
21
|
-
// Akamai
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
// which avoids inflating payloads when the source is smaller
|
|
26
|
-
// than the requested size)
|
|
27
|
-
const resizeMethod = options.crop ? 'crop' : 'scale-down';
|
|
21
|
+
// Always fit=cover — Cloudflare has no edge-pixel-sample analogue for Akamai's
|
|
22
|
+
// `extend=copy`, so flat-background padding (fit=pad) shows visible color bands
|
|
23
|
+
// on aspect mismatch. Crop-to-fill is the right default for full-bleed e-commerce
|
|
24
|
+
// surfaces; explicit padding can be opted into later if a case arises.
|
|
28
25
|
const quality = options.quality;
|
|
29
26
|
const height = aspect
|
|
30
27
|
? Math.round(width * aspectRatioToFraction(aspect))
|
|
31
28
|
: null;
|
|
32
29
|
const properties = [];
|
|
33
30
|
if (height) {
|
|
34
|
-
properties.push(`width=${width},height=${height},fit
|
|
31
|
+
properties.push(`width=${width},height=${height},fit=cover`);
|
|
35
32
|
}
|
|
36
33
|
else {
|
|
37
|
-
properties.push(`width=${width},fit
|
|
34
|
+
properties.push(`width=${width},fit=cover`);
|
|
38
35
|
}
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
36
|
+
// Gravity (and focal-point override) only meaningful when aspect-driven height is
|
|
37
|
+
// set — mirrors Akamai's helper. Focal points trump the keyword since Cloudflare
|
|
38
|
+
// can only carry one gravity value, and Akamai's `RegionOfInterestCrop` trumped
|
|
39
|
+
// the keyword the same way.
|
|
43
40
|
if (height) {
|
|
44
41
|
if (options.focalPointX && options.focalPointY) {
|
|
45
42
|
properties.push(`gravity=${options.focalPointX}x${options.focalPointY}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSrcWithParams.js","sourceRoot":"","sources":["getSrcWithParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,uEAAuE;AAEvE,uDAAuD;AACvD,sFAAsF;AACtF,wDAAwD;AACxD,MAAM,WAAW,GAA4B;IAC3C,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,UAAU,uBAAuB,CACrC,KAAa,EACb,MAAmB;AACnB,aAAa;AACb,GAAW;AACX,aAAa;AACb,mBAAmB,GAAG,IAAI,EAC1B,UAA6B,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;AACzD,aAAa;AACb,SAAkB;IAElB,
|
|
1
|
+
{"version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,CAAC,WAAW,EAAE,CACxD,CAAC;SACH;aAAM,IAAI,OAAO,CAAC,OAAO,EAAE;YAC1B,UAAU,CAAC,IAAI,CAAC,WAAW,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SAC5D;KACF;IAED,mFAAmF;IACnF,oFAAoF;IACpF,IAAI,OAAO,EAAE;QACX,UAAU,CAAC,IAAI,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC;KACvC;IACD,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KAChC;IAED,OAAO,UAAU,CAAC,QAAQ,EAAE,CAAC;AAC/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetshop/ui",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"react": "^18",
|
|
62
62
|
"react-dom": "^18"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "ef9be3f92099a2415eaa00b1534cf5f0c3920ffa"
|
|
65
65
|
}
|