diff --git a/src/helpers/grapesEditor.ts b/src/helpers/grapesEditor.ts index f843d4f..66916bd 100644 --- a/src/helpers/grapesEditor.ts +++ b/src/helpers/grapesEditor.ts @@ -1,10 +1,11 @@ -import type { Editor } from "grapesjs"; +import type { AddComponentTypeOptions, BlockProperties, Editor } from "grapesjs"; export function configureEditor(editor: Editor): void { - editor.Panels.getPanel("devices-c")?.set("visible", false); + //editor.Panels.getPanel("devices-c")?.set("visible", false); editor.Panels.removeButton("devices-c", "set-device-mobile"); editor.Panels.removeButton("devices-c", "set-device-desktop"); editor.Panels.removeButton("views", "open-tm"); + editor.Panels.removeButton("views", "open-layers"); editor.Panels.removeButton("options", "export-template"); editor.Panels.removeButton("options", "preview"); // editor.Panels.removeButton("options", "fullscreen"); @@ -18,27 +19,6 @@ export function configureEditor(editor: Editor): void { editor.BlockManager.remove("sect37"); editor.BlockManager.remove("text-sect"); - editor.DomComponents.addType("heading", { - model: { - defaults: { - tagName: "h1", - content: "Heading", - }, - }, - isComponent(el) { - return el.tagName === "H1"; - }, - }); - editor.BlockManager.add("heading-block", { - label: "Heading", - content: { type: "heading" }, - category: "Text", - media: ` - - `, - }); editor.BlockManager.get("text").set("category", "Text"); editor.BlockManager.get("quote").set("category", "Text"); editor.BlockManager.get("link").set("category", "Text"); @@ -46,4 +26,119 @@ export function configureEditor(editor: Editor): void { editor.BlockManager.get("sect50").set("category", "Struktur"); editor.BlockManager.get("sect30").set("category", "Struktur"); editor.BlockManager.get("divider").set("category", "Struktur"); + editor.BlockManager.add("heading1-block", heading1_block); + editor.BlockManager.add("heading2-block", heading2_block); + editor.BlockManager.add("heading3-block", heading3_block); + editor.BlockManager.add("list_start", list_start_block); + editor.DomComponents.addType("list_end", list_end_block.type); + editor.BlockManager.add("list_end", list_end_block.block); + editor.BlockManager.add("list-block", list_block); + editor.BlockManager.add("list-inner-block", list_inner_block); } + +const heading1_block: BlockProperties = { + label: "Heading1", + category: "Text", + media: ` + + `, + content: ` +