@eeacms/volto-flourish 0.1.3 → 0.1.4
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 +6 -1
- package/package.json +1 -1
- package/src/components/Flourish.jsx +18 -18
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,12 @@ 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.1.
|
|
7
|
+
### [0.1.4](https://github.com/eea/volto-flourish/compare/0.1.3...0.1.4) - 18 February 2025
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Fix re-display of flourish [Tiberiu Ichim - [`9c6a2c0`](https://github.com/eea/volto-flourish/commit/9c6a2c06c746bf4fb00aa1ed06ed4122152462ae)]
|
|
12
|
+
### [0.1.3](https://github.com/eea/volto-flourish/compare/0.1.2...0.1.3) - 17 February 2025
|
|
8
13
|
|
|
9
14
|
#### :bug: Bug Fixes
|
|
10
15
|
|
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { useEffect
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
export default function Flourish({ baseUrl }) {
|
|
4
|
-
const containerRef = useRef(null);
|
|
5
4
|
const flourishUrl = `${baseUrl}/@@flourish/index.html`;
|
|
6
5
|
const scriptUrl = `${baseUrl}/@@flourish/flourish.embed.js`;
|
|
7
6
|
|
|
8
7
|
useEffect(() => {
|
|
9
|
-
if (!baseUrl
|
|
8
|
+
if (!baseUrl) return;
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
script.async = true;
|
|
14
|
-
script.onload = () => {};
|
|
10
|
+
if (!window.FlourishLoaded) {
|
|
11
|
+
window.Flourish = { disable_autoload: true };
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
const script = document.createElement('script');
|
|
14
|
+
script.src = scriptUrl;
|
|
15
|
+
script.async = true;
|
|
16
|
+
script.onload = () => {};
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
document.body.appendChild(script);
|
|
19
|
+
} else {
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
const domNodes = document.querySelectorAll('.flourish-embed');
|
|
22
|
+
domNodes.forEach((domNode) => window.Flourish.loadEmbed(domNode));
|
|
23
|
+
}, 10);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return () => {};
|
|
21
27
|
}, [baseUrl, scriptUrl]);
|
|
22
28
|
|
|
23
|
-
return
|
|
24
|
-
<div
|
|
25
|
-
ref={containerRef}
|
|
26
|
-
className="flourish-embed"
|
|
27
|
-
data-src={flourishUrl}
|
|
28
|
-
></div>
|
|
29
|
-
);
|
|
29
|
+
return <div className="flourish-embed" data-src={flourishUrl}></div>;
|
|
30
30
|
}
|