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: {
); }