@eeacms/volto-embed 2.0.6 → 2.0.10

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,8 +4,41 @@ 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
+ #### [2.0.10](https://github.com/eea/volto-embed/compare/2.0.9...2.0.10)
8
+
9
+ - improve arcgis map view [`#14`](https://github.com/eea/volto-embed/pull/14)
10
+ - no hardcoded text [`4001bb4`](https://github.com/eea/volto-embed/commit/4001bb414df05c1516f95e4dcec4a328406dc63f)
11
+ - fix [`a41ca9a`](https://github.com/eea/volto-embed/commit/a41ca9a2795a59f2633fb97938244e335dca8c43)
12
+ - Update package.json [`a95b014`](https://github.com/eea/volto-embed/commit/a95b014a26651e11224b2f6531add7a599812d2a)
13
+
14
+ #### [2.0.9](https://github.com/eea/volto-embed/compare/2.0.8...2.0.9)
15
+
16
+ > 11 November 2021
17
+
18
+ - Update package.json [`#13`](https://github.com/eea/volto-embed/pull/13)
19
+
20
+ #### [2.0.8](https://github.com/eea/volto-embed/compare/2.0.7...2.0.8)
21
+
22
+ > 28 October 2021
23
+
24
+ - Develop [`#12`](https://github.com/eea/volto-embed/pull/12)
25
+ - Style [`#11`](https://github.com/eea/volto-embed/pull/11)
26
+ - encode url to have the right country screenshot [`#9`](https://github.com/eea/volto-embed/pull/9)
27
+ - correctly center center page [`cb47367`](https://github.com/eea/volto-embed/commit/cb47367aa3a4ab87c5e0bacde93d7cc27fca7723)
28
+ - style [`878f9ad`](https://github.com/eea/volto-embed/commit/878f9adadc4cee17cd63a89144d3d702222cf08a)
29
+ - style privacy div in center of map [`cf05b57`](https://github.com/eea/volto-embed/commit/cf05b570fc5ffbcc79e3c75587fe4ce46c75fe15)
30
+
31
+ #### [2.0.7](https://github.com/eea/volto-embed/compare/2.0.6...2.0.7)
32
+
33
+ > 13 October 2021
34
+
35
+ - Develop sync [`#10`](https://github.com/eea/volto-embed/pull/10)
36
+
7
37
  #### [2.0.6](https://github.com/eea/volto-embed/compare/2.0.5...2.0.6)
8
38
 
39
+ > 12 October 2021
40
+
41
+ - `waitforselector` attribute while querying factsheet pages in screenshot api [`#8`](https://github.com/eea/volto-embed/pull/8)
9
42
  - decreased wait time [`0686e19`](https://github.com/eea/volto-embed/commit/0686e19518dfb8e53a64300badb13887575b031a)
10
43
  - more specific selector [`9707bab`](https://github.com/eea/volto-embed/commit/9707bab87cad8bb98b9ff780b501e6b32882bddc)
11
44
  - add param to dep array [`6927395`](https://github.com/eea/volto-embed/commit/6927395bd8ee3535768d211895b503787de5a63e)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-embed",
3
- "version": "2.0.6",
3
+ "version": "2.0.10",
4
4
  "description": "Embed external content",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -17,12 +17,12 @@
17
17
  "addons": [
18
18
  "@eeacms/volto-corsproxy",
19
19
  "@eeacms/volto-datablocks",
20
- "volto-slate:asDefault"
20
+ "volto-slate"
21
21
  ],
22
22
  "dependencies": {
23
- "volto-slate": "2.9.1",
23
+ "volto-slate": "4.2.1",
24
24
  "@eeacms/volto-datablocks": "*",
25
- "@eeacms/volto-corsproxy": "2.1.2",
25
+ "@eeacms/volto-corsproxy": "*",
26
26
  "react-visibility-sensor": "5.1.1"
27
27
  },
28
28
  "devDependencies": {
@@ -17,6 +17,7 @@ import { createImageUrl } from './helpers';
17
17
  import { getBaseUrl } from '@plone/volto/helpers';
18
18
  import { Toast } from '@plone/volto/components';
19
19
  import { getConnectedDataParametersForContext } from '@eeacms/volto-datablocks/helpers';
20
+ import { ProtectionSchema } from './schema';
20
21
 
21
22
  const messages = defineMessages({
22
23
  success: {
@@ -85,7 +86,9 @@ export default injectIntl(
85
86
  const [visible, setVisibility] = useState(false);
86
87
  const defaultShow = canShow(dataprotection.privacy_cookie_key);
87
88
  const [show, setShow] = useState(defaultShow);
88
- const [remember, setRemember] = useState(defaultShow);
89
+ const [remember, setRemember] = useState(
90
+ cookieExist(dataprotection.privacy_cookie_key) ? defaultShow : true,
91
+ );
89
92
  const dispatch = useDispatch();
90
93
  const checkExistance = CookieWatcher(dataprotection.privacy_cookie_key);
91
94
  const queryParam = useSelector((state) => {
@@ -109,8 +112,8 @@ export default injectIntl(
109
112
 
110
113
  const styles = {
111
114
  height: `${height}px`,
115
+ position: 'relative',
112
116
  };
113
-
114
117
  React.useEffect(() => {
115
118
  if (bgImg) {
116
119
  setImage(createImageUrl(bgImg)); //create imageUrl from uploaded image
@@ -134,9 +137,9 @@ export default injectIntl(
134
137
  fetch(
135
138
  `${getBaseUrl(
136
139
  '',
137
- )}/cors-proxy/https://screenshot.eea.europa.eu/api/v1/retrieve_image_for_url?url=${url}&w=1920&waitfor=4000${
138
- param ? `&waitforselector=img[src*=${param}]` : ''
139
- }`,
140
+ )}/cors-proxy/https://screenshot.eea.europa.eu/api/v1/retrieve_image_for_url?url=${encodeURIComponent(
141
+ url,
142
+ )}&w=1920&waitfor=4000`,
140
143
  )
141
144
  .then((e) => e.blob())
142
145
  .then((blob) => {
@@ -152,7 +155,7 @@ export default injectIntl(
152
155
  }
153
156
  });
154
157
  }
155
- }, [enabled, url, path, param, dispatch, bgImg, show, intl, isEditMode]);
158
+ }, [enabled, url, path, dispatch, bgImg, show, intl, isEditMode]);
156
159
 
157
160
  return (
158
161
  <VisibilitySensor
@@ -179,17 +182,14 @@ export default injectIntl(
179
182
  ? {
180
183
  backgroundImage: `url(${image})`,
181
184
  backgroundRepeat: 'no-repeat',
182
- backgroundPosition: 'center',
183
185
  backgroundSize: 'cover',
186
+ backgroundPosition: 'center -70px',
184
187
  }
185
188
  : {}
186
189
  }
187
190
  >
188
191
  <div className="overlay">
189
192
  <div className="wrapped">
190
- <div className="privacy-statement">
191
- {serializeNodes(dataprotection.privacy_statement || [])}
192
- </div>
193
193
  <div className="privacy-button">
194
194
  <Button
195
195
  primary
@@ -223,6 +223,13 @@ export default injectIntl(
223
223
  {config.settings.ownDomain || '.eea.europa.eu'} that will
224
224
  expire in {getExpDays()} days.
225
225
  </p>
226
+ <p className="discreet">
227
+ {serializeNodes(
228
+ dataprotection.privacy_statement ||
229
+ ProtectionSchema().properties.privacy_statement
230
+ .defaultValue,
231
+ )}
232
+ </p>
226
233
  </div>
227
234
  </div>
228
235
  </div>
@@ -20,6 +20,29 @@ export const ProtectionSchema = () => ({
20
20
  description: 'Defined in template. Change only if necessary',
21
21
  widget: 'slate_richtext',
22
22
  className: 'slate-Widget',
23
+ defaultValue: [
24
+ {
25
+ children: [
26
+ {
27
+ text:
28
+ 'This map is hosted by a third party, Environmental Systems Research Institute. By showing the external content you accept the terms and conditions of ',
29
+ },
30
+ {
31
+ type: 'a',
32
+ url: 'https://www.esri.com',
33
+ children: [
34
+ {
35
+ text: 'esri.com',
36
+ },
37
+ ],
38
+ },
39
+ {
40
+ text:
41
+ '. This includes their cookie policies, which we have no control over.',
42
+ },
43
+ ],
44
+ },
45
+ ],
23
46
  },
24
47
  privacy_cookie_key: {
25
48
  title: 'Privacy cookie key',
@@ -16,15 +16,21 @@
16
16
  }
17
17
 
18
18
  .wrapped {
19
+ position: absolute;
20
+ top: 50%;
21
+ left: 50%;
19
22
  width: 300px;
20
23
  padding: 1.4rem;
21
24
  margin: 0 auto;
22
25
  background: white;
23
26
  border-radius: 5px;
24
- opacity: 0.6;
27
+ opacity: 0.8;
28
+ -ms-transform: translate(-50%, -50%);
29
+ transform: translate(-50%, -50%);
25
30
  }
26
31
 
27
- .discreet {
32
+ .discreet,
33
+ .discreet > p {
28
34
  color: grey;
29
35
  font-size: 14px;
30
36
  }