problem is right after applying any bold or italic it is getting disappeard once i click somewhere.
onMounted(async () => {
componentsTypeScript.value = {};
componentsDefaults.value = {};
editor.value.on('rte:enable',()=>{
console.log("hello world 222222222222")
})
// Assuming you have access to the Rich Text Editor instance
const rte = editor.value.RichTextEditor;
From the official demo it looks to work as expected, so I guess it's related to your custom logic.
Please provide a minimal reproducible demo of the issue.
GrapesJS version
What browser are you using?
chrome
Reproducible demo link
i have given the code in issues
Describe the bug
Screencast from 12-06-24 03:09:58 PM IST.webm
problem is right after applying any bold or italic it is getting disappeard once i click somewhere. onMounted(async () => { componentsTypeScript.value = {}; componentsDefaults.value = {};
appId.value = useRoute().query.appId;
designerStore.bAppLoaded = false;
await designerStore.getPlugins();
// try { // const idbPlugins: Plugin[] = await loadPlugins() // if (idbPlugins.length === 0) { // const allPlugins: Plugin[] = await designerStore.getPlugins() // storePlugins(allPlugins) // } else { // console.log('idbPlugins', idbPlugins) // designerStore.setStoredPlugins(idbPlugins) // designerStore.getPlugins().then(function (pluginResponse: Plugin[]) { // storePlugins(pluginResponse) // }) // } // } catch (error) { // const allPlugins: Plugin[] = await designerStore.getPlugins() // storePlugins(allPlugins) // }
designerStore.bAppLoaded = true;
// let latestVersion= await designerStore.getAppLatestVersion(appId.value); designerStore.currentBAApplication = await designerStore.getApp(appId.value, undefined)//,latestVersion.version); designerStore.currentBAApplication={...designerStore.currentBAApplication,id:designerStore.currentBAApplication.clonedBAId} designerStore.modifiedAppName = appNameTuner(designerStore.currentBAApplication.baAppName); // Get Primary Dependencies to initialize the editor with const baAppDependencies = await designerStore.getDependencies();
const libs = baAppDependencies; const jsLibs: any[] = []; const cssLibs: any[] = [];
libs.forEach((link) => { if (link.endsWith(".js")) { jsLibs.push(link); } else if (link.endsWith(".css")) { cssLibs.push(link); } });
// const uniqCssLibs = uniq(cssLibs)
// libs.forEach((dep: any) => { // if (dep.type == 'css') { // cssLibs.push(dep.src) // } else if (dep.type == 'js') { // jsLibs.push(dep.src) // } // }) let uniqCssLibs = uniq(cssLibs); let uniqJsLibs = uniq(jsLibs);
uniqJsLibs = [ "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js", "https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js", "https://cdnjs.cloudflare.com/ajax/libs/primeui/4.1.15/primeui.min.js", ...uniqJsLibs, ];
editorNonReactive= grapesjs.init({ height: "100%", container: "#canvasBlock", fromElement: true, canvasCss:
.gjs-selected { outline: 2px solid #c200fdb8 !important; }
, layerManager: { custom: true }, richTextEditor:{ stylePrefix: 'rte-', adjustToolbar: true, actions: ['bold', 'italic', 'underline', 'strikethrough', 'link', 'wrap'], custom: true, }, selectorManager: { appendTo: "#selectors", // This is make grapesjs to use class styles as the priority and change styles of class instead of id provided by grapesjs componentFirst: true, }, styleManager: { appendTo: "#styles", }, colorPicker: { appendTo: "parent", showButtons: false, showSelectionPalette: false, show: function (this: any) { const sideBarElement: any = document.getElementById("widgetResizable");});
editor.value =editorNonReactive;
editor.value.on('rte:enable',()=>{ console.log("hello world 222222222222") }) // Assuming you have access to the Rich Text Editor instance const rte = editor.value.RichTextEditor;
editor.value.onReady(async (e: any) => { console.log("Ready", e); editorStore.setEditor(editorNonReactive); editorStore.setLayers(editorNonReactive.Layers); // editor.value.runCommand("open-layers");
editor.value.on("component:add", (model: any) => {
}); designerStore.changeFunctionality(); editor.value.runCommand("zoom-in-out-canvas", { value: 100 }); editor.value.on("run:ruler-visibility", (): void => { console.log(toggleRuler.value); toggleRuler.value = !toggleRuler.value; }); // search plagiun hide and show // designerStore.addSerchFilterToPlugins(); });
here is my code
Code of Conduct