@eeacms/volto-embed 9.0.6 → 9.0.7

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
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [9.0.7](https://github.com/eea/volto-embed/compare/9.0.6...9.0.7) - 11 January 2024
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - include useeffect dep [andreiggr - [`1c967fa`](https://github.com/eea/volto-embed/commit/1c967faea495f1fea9427a2ce92b6755574dd7fa)]
12
+ - screenshot internal/external url [andreiggr - [`62f2e04`](https://github.com/eea/volto-embed/commit/62f2e04023de461bb83cf5d5f5868146a329e022)]
13
+ - add snapshot [andreiggr - [`dbf1ebc`](https://github.com/eea/volto-embed/commit/dbf1ebc629448f75f2e48cc190742b4b6a00bcd7)]
14
+ - tests update2 [andreiggr - [`1c3c656`](https://github.com/eea/volto-embed/commit/1c3c656ae0868bccf9dac6984d550cd9ab7835b2)]
15
+ - tests update [andreiggr - [`c2483e1`](https://github.com/eea/volto-embed/commit/c2483e1fd2e788f5d990c5a0791beb43dd8ef4cf)]
16
+ - clean console [andreiggr - [`a2da2be`](https://github.com/eea/volto-embed/commit/a2da2beb10ebb00ab257f5992a75c2fedce0f094)]
17
+ - set publicUrl in tests [andreiggr - [`fb9e209`](https://github.com/eea/volto-embed/commit/fb9e209c67745c7053f8f08efe5d4f77d66721a8)]
18
+ - screenshot url should be absolute [andreiggr - [`78e4a11`](https://github.com/eea/volto-embed/commit/78e4a1123d2ce7169f87b1e2a2be6411dca1f041)]
7
19
  ### [9.0.6](https://github.com/eea/volto-embed/compare/9.0.5...9.0.6) - 10 January 2024
8
20
 
9
21
  #### :rocket: New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-embed",
3
- "version": "9.0.6",
3
+ "version": "9.0.7",
4
4
  "description": "Embed external content",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -9,6 +9,11 @@ import installEmbedMaps from '.';
9
9
 
10
10
  installEmbedMaps(config);
11
11
 
12
+ config.settings = {
13
+ ...config.settings,
14
+ publicURL: 'https://www.eea.europa.eu/',
15
+ };
16
+
12
17
  config.blocks.blocksConfig = {
13
18
  ...config.blocks.blocksConfig,
14
19
  maps: {
@@ -15,7 +15,7 @@ import { serializeNodes } from '@plone/volto-slate/editor/render';
15
15
  import { defineMessages, injectIntl } from 'react-intl';
16
16
  import { toast } from 'react-toastify';
17
17
  import config from '@plone/volto/registry';
18
- import { getBaseUrl } from '@plone/volto/helpers';
18
+ import { getBaseUrl, toPublicURL, isInternalURL } from '@plone/volto/helpers';
19
19
  import { Toast } from '@plone/volto/components';
20
20
  import {
21
21
  getConnectedDataParametersForContext,
@@ -136,6 +136,8 @@ const PrivacyProtection = (props) => {
136
136
  [checkExistance],
137
137
  );
138
138
 
139
+ const urlToScreenshot = isInternalURL(url) ? toPublicURL(url) : url;
140
+
139
141
  //screenshot api
140
142
  React.useEffect(() => {
141
143
  if (enabled && !bgImg && !show && url) {
@@ -143,8 +145,8 @@ const PrivacyProtection = (props) => {
143
145
  `${getBaseUrl(
144
146
  '',
145
147
  )}/cors-proxy/https://screenshot.eea.europa.eu/api/v1/retrieve_image_for_url?url=${encodeURIComponent(
146
- url,
147
- )}&w=1920&waitfor=4000`,
148
+ urlToScreenshot,
149
+ )}&w=1920&h=1000&waitfor=4000`,
148
150
  )
149
151
  .then((e) => e.blob())
150
152
  .then((blob) => {
@@ -166,7 +168,17 @@ const PrivacyProtection = (props) => {
166
168
  }
167
169
  });
168
170
  }
169
- }, [enabled, url, path, dispatch, bgImg, show, intl, editable]);
171
+ }, [
172
+ enabled,
173
+ url,
174
+ path,
175
+ dispatch,
176
+ bgImg,
177
+ show,
178
+ intl,
179
+ editable,
180
+ urlToScreenshot,
181
+ ]);
170
182
 
171
183
  return (
172
184
  <VisibilitySensor
@@ -5,6 +5,11 @@ import config from '@plone/volto/registry';
5
5
 
6
6
  import MapView from './MapView';
7
7
 
8
+ config.settings = {
9
+ ...config.settings,
10
+ publicURL: 'https://www.eea.europa.eu/',
11
+ };
12
+
8
13
  config.blocks.blocksConfig = {
9
14
  ...config.blocks.blocksConfig,
10
15
  maps: {