Using a package called GrapeJs allowing editor to make dynmaic templates. Recently I upgrade my React Project, below are the packages that I upgraded.
"grapesjs": "^0.18.1",
"grapesjs-preset-webpage": "^0.1.11",
"react": "^18.2.0",
"react-device-detect": "^2.2.2",
"react-dom": "^18.2.0",
"next": "^13.1.1",
"next-images": "^1.8.4",
Suddenly Images with external urls stopped working, if I download the same image in my local and save it in pulbic folder, it works.
Also images with external urls are working all over the project, just not in GrapeJs logic.
Below is my code :
export const customBlocks = (editordata) => {
const blockManager = editordata.BlockManager
blockManager.add('footer1', {
content: `<img id="ioje" src="https://img.icons8.com/windows/32/00a6a6/left2.png" class="ioje"/>`,
category: 'Footers',
attributes: {
title: 'Predefined Footer',
},
})
blockManager.add('footer12', {
content: `<img id="ioje" src=${require("../../../public/left2.png")} class="ioje"/>`,
category: 'Footers',
attributes: {
title: 'Predefined Footer1',
},
})
}
Here footer1 is not working, as it has an external link image, while footer12 is coming as it is coming from public folder