@ecomplus/storefront-renderer 2.10.4 → 2.10.6

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.10.6](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-renderer@2.10.5...@ecomplus/storefront-renderer@2.10.6) (2023-05-12)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **renderer/image-size:** properly handling fallback dimensions ([e5953a1](https://github.com/ecomplus/storefront/commit/e5953a123087237b8407bd9aa4c3a87e46bf63f8))
11
+
12
+ ## [2.10.5](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-renderer@2.10.4...@ecomplus/storefront-renderer@2.10.5) (2023-05-11)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **template/banners:** rendering sizes for mobile version <source> ([c580e67](https://github.com/ecomplus/storefront/commit/c580e67e1a9f64277438e6707b444c725d2f9e17))
17
+
6
18
  ## [2.10.4](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-renderer@2.10.3...@ecomplus/storefront-renderer@2.10.4) (2023-04-24)
7
19
 
8
20
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecomplus/storefront-renderer",
3
- "version": "2.10.4",
3
+ "version": "2.10.6",
4
4
  "description": "SSR for Storefront EJS views with E-Com Plus APIs",
5
5
  "main": "src/index.js",
6
6
  "repository": {
package/src/renderer.js CHANGED
@@ -109,7 +109,7 @@ cmsCollections.forEach(collection => {
109
109
  })
110
110
 
111
111
  // abstracting comming image size handler for local images
112
- const tryImageSize = src => {
112
+ const tryImageSize = (src, fallbackDimensions = {}) => {
113
113
  let dimensions = {}
114
114
  if (typeof src === 'string' && src.startsWith('/')) {
115
115
  try {
@@ -118,6 +118,9 @@ const tryImageSize = src => {
118
118
  dimensions = {}
119
119
  }
120
120
  }
121
+ if (fallbackDimensions && !dimensions.width && fallbackDimensions.width) {
122
+ return fallbackDimensions
123
+ }
121
124
  return dimensions
122
125
  }
123
126