hata6502 / editorjs-layout

Layout block tool for Editor.js.

Home Page:https://hata6502.github.io/editorjs-layout/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Editor layout to Editor Layout

moomoo-dev opened this issue · comments

Would you know of a way to add at least another level of Editor Layout to editor layout other than creating a bunch of copy's of the same object?

Actually i think I found it, I'm going to try to add a configuration that will allow you to add levels of copy.

I figured out how to do this with vanilla JS, but I need to figure how to do it with Typescript. So hopefully by next week I can have this knocked out.

hey did you find a workaround?

hey did you find a workaround?

Yes, while I'm still looking for the way to infinite nested levels... I had to put the project that I was using this on hold.. but you can copy your base config that had the editorJS Layout component. So the editorJSConfig will go into editorConfig..... I'm trying to figure out how I can nest finitely.

let editorJSConfig = {

add_another_layout_here1: {

},
add_another_layout_here2: {

},
header: {
class: Header,
inlineToolbar: true,
//https://editorjs.io/configuration/#inline-toolbar-order
// tunes: ['anyTuneName']
},
};

let editorConfig = {
oneheader: {
class: EditorJSLayout.LayoutBlockTool,
config: {
EditorJS,
editorJSConfig, //<---- add a copy of your base config here
enableLayoutEditing: false,
enableLayoutSaving: true,
initialData: {
itemContent: {
1: {
blocks: [{
type: "paragraph",
data: {
text: "Start typing here",
},
}, ]
},
},
layout: {
type: "container",
id: "",
className: "",
style: "",
children: [{
type: "item",
id: "",
className: "",
style: "",
itemContentId: "1",
}, ],
},
},
},
toolbox: {
icon: ``,
title: "1 column",
},
}
};