Skip to content

Commit

Permalink
Merge branch 'main' into blocks-nav-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
MAX-786 committed Jun 30, 2024
2 parents d68f196 + 9ba8249 commit 799a1ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 250 deletions.
248 changes: 0 additions & 248 deletions examples/hydra-nextjs/src/utils/hydra.js

This file was deleted.

12 changes: 11 additions & 1 deletion packages/hydra-js/hydra.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Bridge {
onEditChange(callback) {
this.realTimeDataHandler = (event) => {
if (event.origin === this.adminOrigin) {
if (event.data.type === 'FORM') {
if (event.data.type === 'FORM_DATA') {
if (event.data.data) {
callback(event.data.data);
} else {
Expand Down Expand Up @@ -278,6 +278,7 @@ class Bridge {
.volto-hydra-quantaToolbar {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
background: white;
box-shadow: 3px 3px 10px rgb(0 0 0 / 53%);
Expand All @@ -287,6 +288,7 @@ class Bridge {
left: 0;
box-sizing: border-box;
width: 70px;
height: 40px;
}
.volto-hydra-drag-button,
.volto-hydra-menu-button {
Expand All @@ -301,6 +303,8 @@ class Bridge {
background: #E4E8EC;
border-radius: 6px;
padding: 9px 6px;
height: 40px;
display: flex;
}
.volto-hydra-dropdown-menu {
display: none;
Expand All @@ -315,6 +319,7 @@ class Bridge {
margin-top: -8px;
width: 180px;
box-sizing: border-box;
height: 80px;
}
.volto-hydra-dropdown-menu.visible {
display: block;
Expand All @@ -326,6 +331,11 @@ class Bridge {
padding: 10px;
cursor: pointer;
transition: background 0.2s;
height: 40px;
}
.volto-hydra-dropdown-text {
font-size: 15px;
font-weight: 500;
}
.volto-hydra-dropdown-item svg {
margin-right: 1em;
Expand Down
3 changes: 2 additions & 1 deletion packages/volto-hydra/src/components/Iframe/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,10 @@ const Iframe = (props) => {
useEffect(() => {
if (form && Object.keys(form).length > 0 && isValidUrl(src)) {
// Send the form data to the iframe
const origin = new URL(src).origin;
document
.getElementById('previewIframe')
.contentWindow.postMessage({ type: 'FORM', data: form }, '*');
.contentWindow.postMessage({ type: 'FORM_DATA', data: form }, origin);
}
}, [form, initialUrl, src]);

Expand Down

0 comments on commit 799a1ad

Please sign in to comment.