design-comuni-plone-theme 8.4.0 → 8.4.2
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 +24 -0
- package/package.json +1 -1
- package/publiccode.yml +1 -1
- package/src/components/Image/helpers.js +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [8.4.2](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.4.1...v8.4.2) (2023-08-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* more external url fixes for images ([dc6da3a](https://github.com/RedTurtle/design-comuni-plone-theme/commit/dc6da3ac832bec31c372cc854ff6b199df32273e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
|
|
13
|
+
* updated publiccode ([ad343ef](https://github.com/RedTurtle/design-comuni-plone-theme/commit/ad343ef38c2d893c7ec7222c2e24baa7139ef4aa))
|
|
14
|
+
|
|
15
|
+
## [8.4.1](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.4.0...v8.4.1) (2023-08-24)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* external urls in images ([39429d6](https://github.com/RedTurtle/design-comuni-plone-theme/commit/39429d6b7b361f78c05e41f35d71e4b3184092dc))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Documentation
|
|
24
|
+
|
|
25
|
+
* updated publiccode ([21170fd](https://github.com/RedTurtle/design-comuni-plone-theme/commit/21170fdf50ff47f91d37c3dd0b5f11f97a94e6db))
|
|
26
|
+
|
|
3
27
|
## [8.4.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.3.2...v8.4.0) (2023-08-24)
|
|
4
28
|
|
|
5
29
|
|
package/package.json
CHANGED
package/publiccode.yml
CHANGED
|
@@ -3,6 +3,7 @@ import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers';
|
|
|
3
3
|
import config from '@plone/volto/registry';
|
|
4
4
|
|
|
5
5
|
const getImageIsFromBrain = (imageDownloadUrl) => {
|
|
6
|
+
if (typeof imageDownloadUrl !== 'string') return false;
|
|
6
7
|
// Old check against itemUrl truthyness isn't valid anymore.
|
|
7
8
|
// All brains have item[@id], need to check if image.download
|
|
8
9
|
// starts with @@images
|
|
@@ -47,7 +48,7 @@ export const getImageAttributes = (
|
|
|
47
48
|
// while regular content objects have scales with full urls (i.e. https://.../@@images/...)
|
|
48
49
|
let itemPath = flattenToAppURL(itemUrl ?? '');
|
|
49
50
|
if (itemPath.slice(-1) !== '/') itemPath = `${itemPath}/`;
|
|
50
|
-
const isFromBrain = getImageIsFromBrain(image?.download);
|
|
51
|
+
const isFromBrain = getImageIsFromBrain(image?.download ?? image);
|
|
51
52
|
|
|
52
53
|
const imageScales = config.settings.imageScales;
|
|
53
54
|
|
|
@@ -117,7 +118,7 @@ export const getImageAttributes = (
|
|
|
117
118
|
case 'internalUrl':
|
|
118
119
|
let baseUrl = `@@images/${imageField}`;
|
|
119
120
|
if (isFromBrain) baseUrl = `${itemPath}${baseUrl}`;
|
|
120
|
-
else baseUrl = `${image.split('
|
|
121
|
+
else baseUrl = `${image.split('/@@images')[0]}/${baseUrl}`;
|
|
121
122
|
baseUrl = flattenToAppURL(baseUrl);
|
|
122
123
|
|
|
123
124
|
attrs.src = `${baseUrl}/${minScale}`;
|