@eeacms/volto-flourish 0.1.5 → 1.0.0
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 +20 -5
- package/DEVELOP.md +19 -17
- package/README.md +33 -19
- package/docker-compose.yml +1 -1
- package/jest-addon.config.js +11 -4
- package/locales/volto.pot +2 -2
- package/package.json +1 -1
- package/src/blocks/EmbedFlourish/Edit.test.jsx +1 -1
- package/src/blocks/EmbedFlourish/View.js +29 -5
- package/src/blocks/EmbedFlourish/View.test.jsx +1 -1
- package/src/components/Flourish.jsx +32 -21
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,29 @@ 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
|
-
### [0.
|
|
7
|
+
### [1.0.0](https://github.com/eea/volto-flourish/compare/0.1.6...1.0.0) - 25 March 2026
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: Volto 18 support - refs #287700 [Alin Voinea - [`4f58ae4`](https://github.com/eea/volto-flourish/commit/4f58ae4abd83bd40467656d93ec24b65b3d06ecc)]
|
|
12
|
+
|
|
13
|
+
#### :house: Internal changes
|
|
14
|
+
|
|
8
15
|
|
|
9
16
|
#### :hammer_and_wrench: Others
|
|
10
17
|
|
|
11
|
-
-
|
|
18
|
+
- tests: Fix Sonar Qube tags - refs #297339 [Alin Voinea - [`a2dded8`](https://github.com/eea/volto-flourish/commit/a2dded891d50efc1b1315bb2a6d341c6d2f80047)]
|
|
19
|
+
### [0.1.6](https://github.com/eea/volto-flourish/compare/0.1.5...0.1.6) - 28 February 2025
|
|
20
|
+
|
|
21
|
+
#### :hammer_and_wrench: Others
|
|
22
|
+
|
|
23
|
+
- Improve loading [Tiberiu Ichim - [`68ed505`](https://github.com/eea/volto-flourish/commit/68ed50596010f0a259eec3131ed7b620b1d10b0e)]
|
|
24
|
+
- test: update snapshot [kreafox - [`b5a149e`](https://github.com/eea/volto-flourish/commit/b5a149e49fd568e890dfb9ceb4e8d0309292e590)]
|
|
25
|
+
- Lower delay [Tiberiu Ichim - [`980d567`](https://github.com/eea/volto-flourish/commit/980d5673f2d34b1c20442e3354efb92148d6dd4c)]
|
|
26
|
+
- Code cleanup [Tiberiu Ichim - [`8c02bb7`](https://github.com/eea/volto-flourish/commit/8c02bb75096190698b31b2ae674e5ee4dd0e433b)]
|
|
27
|
+
- Try again [Tiberiu Ichim - [`c26d3e0`](https://github.com/eea/volto-flourish/commit/c26d3e02844932b7eac06698d21280c5ce094000)]
|
|
28
|
+
### [0.1.5](https://github.com/eea/volto-flourish/compare/0.1.4...0.1.5) - 20 February 2025
|
|
29
|
+
|
|
12
30
|
### [0.1.4](https://github.com/eea/volto-flourish/compare/0.1.3...0.1.4) - 18 February 2025
|
|
13
31
|
|
|
14
32
|
### [0.1.3](https://github.com/eea/volto-flourish/compare/0.1.2...0.1.3) - 17 February 2025
|
|
@@ -26,9 +44,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
26
44
|
- Embed [Tiberiu Ichim - [`65a99d6`](https://github.com/eea/volto-flourish/commit/65a99d6a3cbf69a33e0b3a485a92afc53a2835b8)]
|
|
27
45
|
- Embed [Tiberiu Ichim - [`0bd365b`](https://github.com/eea/volto-flourish/commit/0bd365b91802227f921b3d7127a2722f56d33e97)]
|
|
28
46
|
- Embed [Tiberiu Ichim - [`1bc7ee6`](https://github.com/eea/volto-flourish/commit/1bc7ee667a6168a15f50a51b2263e216ffbecc52)]
|
|
29
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`9c0d692`](https://github.com/eea/volto-flourish/commit/9c0d692ee158e264bc33fe7d05eafcee1ccb6066)]
|
|
30
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`aae3813`](https://github.com/eea/volto-flourish/commit/aae3813cf0f792b7cdaedb9f7b4ebc9d4bb6cd53)]
|
|
31
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`5ca27c2`](https://github.com/eea/volto-flourish/commit/5ca27c29e49291471d6cd2585922c39e87d46a84)]
|
|
32
47
|
### [0.1.2](https://github.com/eea/volto-flourish/compare/0.1.1...0.1.2) - 16 September 2024
|
|
33
48
|
|
|
34
49
|
#### :house: Internal changes
|
package/DEVELOP.md
CHANGED
|
@@ -26,21 +26,20 @@
|
|
|
26
26
|
|
|
27
27
|
### Or add @eeacms/volto-flourish to your Volto project
|
|
28
28
|
|
|
29
|
-
Before starting make sure your development environment is properly set. See [Volto
|
|
29
|
+
Before starting make sure your development environment is properly set. See the official Plone documentation for [creating a project with Cookieplone](https://6.docs.plone.org/install/create-project-cookieplone.html) and [installing an add-on in development mode in Volto 18 and 19](https://6.docs.plone.org/volto/development/add-ons/install-an-add-on-dev-18.html).
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
For new Volto 18+ projects, use Cookieplone. It includes `mrs-developer` by default.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
1. Create a new Volto project with Cookieplone
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
yo @plone/volto my-volto-project --addon @eeacms/volto-flourish --skip-install
|
|
38
|
-
cd my-volto-project
|
|
35
|
+
uvx cookieplone project
|
|
36
|
+
cd project-title
|
|
39
37
|
|
|
40
38
|
1. Add the following to `mrs.developer.json`:
|
|
41
39
|
|
|
42
40
|
{
|
|
43
41
|
"volto-flourish": {
|
|
42
|
+
"output": "packages",
|
|
44
43
|
"url": "https://github.com/eea/volto-flourish.git",
|
|
45
44
|
"package": "@eeacms/volto-flourish",
|
|
46
45
|
"branch": "develop",
|
|
@@ -48,28 +47,31 @@ Before starting make sure your development environment is properly set. See [Vol
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
1.
|
|
50
|
+
1. Add `@eeacms/volto-flourish` to the `addons` key in your project `volto.config.js`
|
|
51
|
+
|
|
52
|
+
1. Install or refresh the project setup
|
|
52
53
|
|
|
53
|
-
make
|
|
54
|
-
yarn
|
|
54
|
+
make install
|
|
55
55
|
|
|
56
|
-
1. Start backend
|
|
56
|
+
1. Start backend in one terminal
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
make backend-start
|
|
59
59
|
|
|
60
|
-
...wait for backend to setup and start
|
|
60
|
+
...wait for backend to setup and start, ending with `Ready to handle requests`
|
|
61
61
|
|
|
62
62
|
...you can also check http://localhost:8080/Plone
|
|
63
63
|
|
|
64
|
-
1. Start frontend
|
|
64
|
+
1. Start frontend in a second terminal
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
make frontend-start
|
|
67
67
|
|
|
68
68
|
1. Go to http://localhost:3000
|
|
69
69
|
|
|
70
70
|
1. Happy hacking!
|
|
71
71
|
|
|
72
|
-
cd
|
|
72
|
+
cd packages/volto-flourish
|
|
73
|
+
|
|
74
|
+
For legacy Volto 17 projects, keep using the yarn-based workflow from the Volto 17 documentation.
|
|
73
75
|
|
|
74
76
|
## Cypress
|
|
75
77
|
|
|
@@ -81,7 +83,7 @@ project where you added `volto-flourish` to `mrs.developer.json`
|
|
|
81
83
|
Go to:
|
|
82
84
|
|
|
83
85
|
```BASH
|
|
84
|
-
cd
|
|
86
|
+
cd packages/volto-flourish/
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
Start:
|
package/README.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
[](https://github.com/eea/volto-flourish/releases)
|
|
4
4
|
|
|
5
5
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-flourish/job/master/display/redirect)
|
|
6
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-flourish
|
|
6
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-flourish)
|
|
7
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-flourish)
|
|
8
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-flourish)
|
|
9
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-flourish)
|
|
10
10
|
|
|
11
11
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-flourish/job/develop/display/redirect)
|
|
12
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-flourish
|
|
12
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-flourish&branch=develop)
|
|
13
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-flourish&branch=develop)
|
|
14
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-flourish&branch=develop)
|
|
15
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-flourish&branch=develop)
|
|
16
16
|
|
|
17
17
|
[Volto](https://github.com/plone/volto) add-on
|
|
18
18
|
|
|
@@ -34,6 +34,11 @@ Flourish integration
|
|
|
34
34
|
|
|
35
35
|
Go to http://localhost:3000
|
|
36
36
|
|
|
37
|
+
`make start` now defaults to Volto 18. To run the same setup against Volto 17, use:
|
|
38
|
+
|
|
39
|
+
VOLTO_VERSION=17 make
|
|
40
|
+
VOLTO_VERSION=17 make start
|
|
41
|
+
|
|
37
42
|
### Add volto-flourish to your Volto project
|
|
38
43
|
|
|
39
44
|
1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
|
|
@@ -47,30 +52,39 @@ Go to http://localhost:3000
|
|
|
47
52
|
- If you already have a volto project, just update `package.json`:
|
|
48
53
|
|
|
49
54
|
```JSON
|
|
50
|
-
"addons": [
|
|
51
|
-
"@eeacms/volto-flourish"
|
|
52
|
-
],
|
|
53
|
-
|
|
54
55
|
"dependencies": {
|
|
55
56
|
"@eeacms/volto-flourish": "*"
|
|
56
57
|
}
|
|
57
58
|
```
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
and `volto.config.js`:
|
|
61
|
+
|
|
62
|
+
```JavaScript
|
|
63
|
+
const addons = ['@eeacms/volto-flourish'];
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- If not, create one with Cookieplone, as recommended by the official Plone documentation for Volto 18+:
|
|
60
67
|
|
|
61
68
|
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
cd my-volto-project
|
|
69
|
+
uvx cookieplone project
|
|
70
|
+
cd project-title
|
|
65
71
|
```
|
|
66
72
|
|
|
67
|
-
1. Install
|
|
73
|
+
1. Install or update dependencies, then start the project:
|
|
68
74
|
|
|
69
75
|
```
|
|
70
|
-
|
|
71
|
-
yarn start
|
|
76
|
+
make install
|
|
72
77
|
```
|
|
73
78
|
|
|
79
|
+
For a Cookieplone project, start the backend and frontend in separate terminals:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
make backend-start
|
|
83
|
+
make frontend-start
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For a legacy Volto 17 project, install the package with `yarn` and restart the frontend as usual.
|
|
87
|
+
|
|
74
88
|
1. Go to http://localhost:3000
|
|
75
89
|
|
|
76
90
|
1. Happy editing!
|
package/docker-compose.yml
CHANGED
package/jest-addon.config.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
require('dotenv').config({ path: __dirname + '/.env' })
|
|
2
2
|
|
|
3
|
+
const fs = require('fs')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
|
|
6
|
+
const voltoSlatePath = fs.existsSync(
|
|
7
|
+
path.join(__dirname, '../../../node_modules/@plone/volto-slate/src'),
|
|
8
|
+
)
|
|
9
|
+
? '<rootDir>/node_modules/@plone/volto-slate/src'
|
|
10
|
+
: '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src'
|
|
11
|
+
|
|
3
12
|
module.exports = {
|
|
4
13
|
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
5
14
|
collectCoverageFrom: [
|
|
@@ -17,10 +26,8 @@ module.exports = {
|
|
|
17
26
|
'@eeacms/search/(.*)$': '<rootDir>/src/addons/volto-searchlib/searchlib/$1',
|
|
18
27
|
'@eeacms/search': '<rootDir>/src/addons/volto-searchlib/searchlib',
|
|
19
28
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
|
|
20
|
-
'@plone/volto-slate$':
|
|
21
|
-
|
|
22
|
-
'@plone/volto-slate/(.*)$':
|
|
23
|
-
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
|
|
29
|
+
'@plone/volto-slate$': voltoSlatePath,
|
|
30
|
+
'@plone/volto-slate/(.*)$': `${voltoSlatePath}/$1`,
|
|
24
31
|
'~/(.*)$': '<rootDir>/src/$1',
|
|
25
32
|
'load-volto-addons':
|
|
26
33
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
package/locales/volto.pot
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
msgid ""
|
|
2
2
|
msgstr ""
|
|
3
3
|
"Project-Id-Version: Plone\n"
|
|
4
|
-
"POT-Creation-Date:
|
|
4
|
+
"POT-Creation-Date: 2026-03-10T22:13:04.847Z\n"
|
|
5
5
|
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
6
|
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
|
-
"MIME-Version: 1.0\n"
|
|
8
7
|
"Content-Type: text/plain; charset=utf-8\n"
|
|
9
8
|
"Content-Transfer-Encoding: 8bit\n"
|
|
10
9
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
10
|
+
"MIME-Version: 1.0\n"
|
|
11
11
|
"Language-Code: en\n"
|
|
12
12
|
"Language-Name: English\n"
|
|
13
13
|
"Preferred-Encodings: utf-8\n"
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { MemoryRouter } from 'react-router-dom';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { render } from '@testing-library/react';
|
|
5
|
-
import '@testing-library/jest-dom
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
6
|
import { Provider } from 'react-intl-redux';
|
|
7
7
|
import Edit from './Edit';
|
|
8
8
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
1
|
+
import { useEffect, useMemo } from 'react';
|
|
2
2
|
import { useSelector, useDispatch } from 'react-redux';
|
|
3
3
|
import { getContent } from '@plone/volto/actions';
|
|
4
4
|
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
5
5
|
import { default as Flourish } from '@eeacms/volto-flourish/components/Flourish';
|
|
6
|
+
import { v4 as uuid } from 'uuid';
|
|
6
7
|
// import { Sources } from '@eeacms/volto-embed/Toolbar';
|
|
7
8
|
|
|
8
9
|
import {
|
|
@@ -13,8 +14,24 @@ import {
|
|
|
13
14
|
Enlarge,
|
|
14
15
|
} from '@eeacms/volto-embed/Toolbar';
|
|
15
16
|
|
|
17
|
+
// const overlayStyles = {
|
|
18
|
+
// position: 'absolute',
|
|
19
|
+
// top: 0,
|
|
20
|
+
// left: 0,
|
|
21
|
+
// width: '100%',
|
|
22
|
+
// backgroundColor: 'rgba(255, 255, 255, 0)',
|
|
23
|
+
// zIndex: 20000,
|
|
24
|
+
// pointerEvents: 'none',
|
|
25
|
+
// height: '100%',
|
|
26
|
+
// };
|
|
27
|
+
|
|
16
28
|
export default function View(props) {
|
|
17
|
-
const {
|
|
29
|
+
const {
|
|
30
|
+
id,
|
|
31
|
+
data,
|
|
32
|
+
// mode = 'view'
|
|
33
|
+
} = props;
|
|
34
|
+
const uid = useMemo(() => uuid(), []);
|
|
18
35
|
|
|
19
36
|
const {
|
|
20
37
|
with_sources,
|
|
@@ -41,11 +58,18 @@ export default function View(props) {
|
|
|
41
58
|
}
|
|
42
59
|
}, [dispatch, vis_url, id]);
|
|
43
60
|
|
|
61
|
+
// const editOverlay =
|
|
62
|
+
// mode === 'edit' ? (
|
|
63
|
+
// <div className="edit-overlay" style={overlayStyles} />
|
|
64
|
+
// ) : null;
|
|
65
|
+
|
|
44
66
|
return (
|
|
45
67
|
<div className="embed-flourish">
|
|
46
68
|
{flourish_item_url ? (
|
|
47
|
-
|
|
48
|
-
<Flourish baseUrl={flourish_item_url} />
|
|
69
|
+
<>
|
|
70
|
+
<Flourish baseUrl={flourish_item_url} key={uid} id={uid} />
|
|
71
|
+
{/* {editOverlay} */}
|
|
72
|
+
|
|
49
73
|
{flourishItemContent && (
|
|
50
74
|
<div className="visualization-toolbar">
|
|
51
75
|
<div className="left-col">
|
|
@@ -82,7 +106,7 @@ export default function View(props) {
|
|
|
82
106
|
</div>
|
|
83
107
|
</div>
|
|
84
108
|
)}
|
|
85
|
-
|
|
109
|
+
</>
|
|
86
110
|
) : props.mode ? (
|
|
87
111
|
<div>Embed flourish</div>
|
|
88
112
|
) : null}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { MemoryRouter } from 'react-router-dom';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { render } from '@testing-library/react';
|
|
5
|
-
import '@testing-library/jest-dom
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
6
|
import { Provider } from 'react-intl-redux';
|
|
7
7
|
import View from './View';
|
|
8
8
|
|
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
export default function Flourish({ baseUrl }) {
|
|
3
|
+
export default function Flourish({ baseUrl, id }) {
|
|
4
4
|
const flourishUrl = `${baseUrl}/@@flourish/index.html`;
|
|
5
|
+
const nodeRef = useRef(null);
|
|
5
6
|
const scriptUrl = `${baseUrl}/@@flourish/flourish.embed.js`;
|
|
6
7
|
|
|
7
8
|
useEffect(() => {
|
|
8
9
|
if (!baseUrl) return;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
const container = nodeRef.current;
|
|
13
|
+
if (!container) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
script.src = scriptUrl;
|
|
15
|
-
script.async = true;
|
|
16
|
-
script.onload = () => {};
|
|
17
|
+
container.setAttribute('data-src', flourishUrl);
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
if (
|
|
20
|
+
document.querySelectorAll('script.flourish-embed-script').length === 0
|
|
21
|
+
) {
|
|
22
|
+
const script = document.createElement('script');
|
|
23
|
+
script.src = scriptUrl;
|
|
24
|
+
script.className = 'flourish-embed-script';
|
|
25
|
+
script.id = id;
|
|
26
|
+
script.onload = () => {
|
|
27
|
+
//eslint-disable-next-line no-console
|
|
28
|
+
console.log('loaded script', id);
|
|
29
|
+
};
|
|
30
|
+
document.body.appendChild(script);
|
|
31
|
+
} else {
|
|
32
|
+
const node = document.getElementById(id);
|
|
33
|
+
if (node && window.Flourish?.loadEmbed) {
|
|
34
|
+
//eslint-disable-next-line no-console
|
|
35
|
+
console.log('Loading embed', node.id);
|
|
36
|
+
window.Flourish.loadEmbed(node);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}, 200);
|
|
29
40
|
|
|
30
41
|
return () => {};
|
|
31
|
-
}, [baseUrl, scriptUrl]);
|
|
42
|
+
}, [baseUrl, scriptUrl, id, flourishUrl]);
|
|
32
43
|
|
|
33
|
-
return <div className="flourish-embed"
|
|
44
|
+
return <div className="flourish-embed" id={id} ref={nodeRef}></div>;
|
|
34
45
|
}
|