Skip to content
Snippets Groups Projects
Commit 549f6666 authored by chris's avatar chris
Browse files

more editoria nodes

parent fc524844
No related branches found
No related tags found
1 merge request!16Develop
......@@ -14,15 +14,14 @@ const blockActive = (type, attrs = {}) => state => {
};
export default {
plain: {
title: "Change to General Text",
// content: icons.paragraph,
content: "General Text",
title: {
title: "Change to Title",
content: "Title",
enable: state => {
return setBlockType(state.config.schema.nodes.paragraph)(state);
return setBlockType(state.config.schema.nodes.title)(state);
},
run(state, dispatch) {
setBlockType(state.config.schema.nodes.paragraph)(state, dispatch);
setBlockType(state.config.schema.nodes.title)(state, dispatch);
},
select: state => true,
......@@ -40,6 +39,56 @@ export default {
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
author: {
title: "Change to Author",
content: "Author",
enable: state => {
return setBlockType(state.config.schema.nodes.author)(state);
},
run(state, dispatch) {
setBlockType(state.config.schema.nodes.author)(state, dispatch);
},
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
epigraphPoetry: {
title: "Change to Epigraph Poetry",
content: "Epigraph Poetry",
enable: state => {
return setBlockType(state.config.schema.nodes.epigraphPoetry)(state);
},
run(state, dispatch) {
setBlockType(state.config.schema.nodes.epigraphPoetry)(state, dispatch);
},
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
epigraphProse: {
title: "Change to Epigraph Prose",
content: "Epigraph Prose",
enable: state => {
return setBlockType(state.config.schema.nodes.epigraphProse)(state);
},
run(state, dispatch) {
setBlockType(state.config.schema.nodes.epigraphProse)(state, dispatch);
},
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
plain: {
title: "Change to General Text",
// content: icons.paragraph,
content: "General Text",
enable: state => {
return setBlockType(state.config.schema.nodes.paragraph)(state);
},
run(state, dispatch) {
setBlockType(state.config.schema.nodes.paragraph)(state, dispatch);
},
select: state => true,
menu: props => <Button key={uuid()} {...props} />
},
heading1: {
title: "Change to heading level 1",
content: "Heading 1",
......
......@@ -2,6 +2,7 @@
display: flex;
flex-direction: column;
height: 100%;
font-family: var(--wax-font-family);
}
.wax-l-editoria .main-menu-container {
......
......@@ -35,6 +35,182 @@ const EditoriaSchema = {
return pDOM;
}
},
author: {
content: "inline*",
group: "block",
priority: 0,
defining: true,
attrs: {
class: { default: "author" }
},
parseDOM: [
{
tag: "p",
getAttrs(dom) {
return {
class: dom.getAttribute("class")
};
}
}
],
toDOM(node) {
return ["p", node.attrs, 0];
}
},
epigraphProse: {
content: "inline*",
group: "block",
priority: 0,
defining: true,
attrs: {
class: { default: "epigraph-prose" }
},
parseDOM: [
{
tag: "p",
getAttrs(dom) {
return {
class: dom.getAttribute("class")
};
}
}
],
toDOM(node) {
return ["p", node.attrs, 0];
}
},
epigraphPoetry: {
content: "inline*",
group: "block",
priority: 0,
defining: true,
attrs: {
class: { default: "epigraph-poetry" }
},
parseDOM: [
{
tag: "p",
getAttrs(dom) {
return {
class: dom.getAttribute("class")
};
}
}
],
toDOM(node) {
return ["p", node.attrs, 0];
}
},
sourceNote: {
content: "inline*",
group: "block",
priority: 0,
defining: true,
attrs: {
class: { default: "source-note" }
},
parseDOM: [
{
tag: "p",
getAttrs(dom) {
return {
class: dom.getAttribute("class")
};
}
}
],
toDOM(node) {
return ["p", node.attrs, 0];
}
},
paragraphCont: {
content: "inline*",
group: "block",
priority: 0,
defining: true,
attrs: {
class: { default: "paragraph-cont" }
},
parseDOM: [
{
tag: "p",
getAttrs(dom) {
return {
class: dom.getAttribute("class")
};
}
}
],
toDOM(node) {
return ["p", node.attrs, 0];
}
},
extractProse: {
content: "inline*",
group: "block",
priority: 0,
defining: true,
attrs: {
class: { default: "extract-prose" }
},
parseDOM: [
{
tag: "p",
getAttrs(dom) {
return {
class: dom.getAttribute("class")
};
}
}
],
toDOM(node) {
return ["p", node.attrs, 0];
}
},
extractPoetry: {
content: "inline*",
group: "block",
priority: 0,
defining: true,
attrs: {
class: { default: "extract-poetry" }
},
parseDOM: [
{
tag: "p",
getAttrs(dom) {
return {
class: dom.getAttribute("class")
};
}
}
],
toDOM(node) {
return ["p", node.attrs, 0];
}
},
title: {
content: "inline*",
group: "block",
priority: 0,
defining: true,
attrs: {
class: { default: "title" }
},
parseDOM: [
{
tag: "p",
getAttrs(dom) {
return {
class: dom.getAttribute("class")
};
}
}
],
toDOM(node) {
return ["p", node.attrs, 0];
}
},
subtitle: {
content: "inline*",
group: "block",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment