You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import grapesjs, { Editor } from "grapesjs";
import GjsEditor from "@grapesjs/react";
import pluginTailwind from "grapesjs-tailwind";
import pluginWebpage from "grapesjs-preset-webpage";
import pluginExport from "grapesjs-plugin-export";
import pluginCodeEditor from "grapesjs-component-code-editor";
"use client";
import React, { useState } from "react";
import grapesjs, { Editor } from "grapesjs";
import GjsEditor from "@grapesjs/react";
import pluginTailwind from "grapesjs-tailwind";
import pluginWebpage from "grapesjs-preset-webpage";
import pluginExport from "grapesjs-plugin-export";
import pluginCodeEditor from "grapesjs-component-code-editor";
import "grapesjs/dist/css/grapes.min.css";
import "grapesjs-component-code-editor/dist/grapesjs-component-code-editor.min.css";
import FormPublish from "./_components/form-publish";
import { componentsPlugin } from "@/components/grapesjs/plugins/components/modal";
export default function EditorPage() {
const [editor, setEditor] = useState();
function onEditor(newEditor: Editor) {
console.log("Editor loaded", { newEditor });
setEditor(newEditor);
}
return (
<>
<GjsEditor
grapesjs={grapesjs}
options={{
plugins: [
pluginWebpage,
pluginExport,
componentsPlugin,
pluginCodeEditor,
pluginTailwind,
],
pluginsOpts: {
[pluginWebpage]: {
// Ensure the correct reference here
modalImportTitle: "Import Template",
modalImportLabel:
'
modalImportContent: function (editor: Editor) {
return (
editor.getHtml() + "<style>" + editor.getCss() + "</style>"
);
},
},
},
height: "100vh",
fromElement: true,
showOffsets: true,
storageManager: {
type: "local",
autosave: true,
autoload: true,
stepsBeforeSave: 1,
},
selectorManager: {
componentFirst: true,
},
}}
onEditor={onEditor}
/>
);
}
The text was updated successfully, but these errors were encountered: