Skip to content

Commit

Permalink
fix: Updated the config for the new Ibexa version 4.6 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
DuvanGonzalezAplyca authored Aug 20, 2024
1 parent 166a865 commit e12f33c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aplyca/ibexa-pagebuilder-block-refresher",
"version": "1.0.7",
"version": "1.0.8",
"description": "This module help you refresing the blocks preview in Ibexa admin. You can specific a function to render Vue Components, React Components or anything that you need rendering after edit blocks fields. This module supports Ibexa Platform, Ibexa DXP 3.* and Ibexa DXP 4.*",
"main": "src/index.js",
"keywords": [],
Expand Down
9 changes: 7 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const IbexaPageBuilderBlockRefresher = (ibexaVersion = "3.*", fn) => {
const supportedVersions = ["ezplatform", "3.*", "4.*"];
const supportedVersions = ["ezplatform", "3.*", "4.*", "4.6.*"];
if(supportedVersions.includes(ibexaVersion)){
let eventName = "";
let dataIdReference = "";
Expand All @@ -21,6 +21,11 @@ export const IbexaPageBuilderBlockRefresher = (ibexaVersion = "3.*", fn) => {
dataIdReference = "data-ez-block-id";
classPreviewReference = "c-pb-block-preview";
break;
case "4.6.*":
eventName = "ibexa-post-update-blocks-preview";
dataIdReference = "data-ez-block-id";
classPreviewReference = "c-pb-block-preview__inner";
break;
}

if(window.self !== window.top){
Expand All @@ -45,4 +50,4 @@ export const IbexaPageBuilderBlockRefresher = (ibexaVersion = "3.*", fn) => {
} else {
console.warn("You must pass a supported version as a the second parameter to the IbexaPageBuilderBlockRefresher function");
}
}
}

0 comments on commit e12f33c

Please sign in to comment.