diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/AuthorService/Author.js b/wax-prosemirror-services/src/DisplayBlockLevel/AuthorService/Author.js new file mode 100644 index 0000000000000000000000000000000000000000..6be138dd84d3867dcf35a138f1efc71f55025856 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/AuthorService/Author.js @@ -0,0 +1,21 @@ +import Tools from "../../lib/Tools"; +import { injectable } from "inversify"; +import { setBlockType } from "prosemirror-commands"; + +@injectable() +export default class Author extends Tools { + title = "Change to Author"; + content = "Author"; + + get run() { + return (state, dispatch) => { + setBlockType(state.config.schema.nodes.author)(state, dispatch); + }; + } + + get enable() { + return state => { + return setBlockType(state.config.schema.nodes.author)(state); + }; + } +} diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/AuthorService/AuthorService.js b/wax-prosemirror-services/src/DisplayBlockLevel/AuthorService/AuthorService.js new file mode 100644 index 0000000000000000000000000000000000000000..09e110b3fcdedce4a6d676a19b305537e9ff92a9 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/AuthorService/AuthorService.js @@ -0,0 +1,12 @@ +import Service from "wax-prosemirror-core/src/services/Service"; +import Author from "./Author"; + +class AuthorService extends Service { + boot() {} + + register() { + this.container.bind("Author").to(Author); + } +} + +export default AuthorService; diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphPoetryService/EpigraphPoetry.js b/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphPoetryService/EpigraphPoetry.js new file mode 100644 index 0000000000000000000000000000000000000000..e3d63856ad2c61fd6adf2e4ed0d59a62ccb49597 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphPoetryService/EpigraphPoetry.js @@ -0,0 +1,21 @@ +import Tools from "../../lib/Tools"; +import { injectable } from "inversify"; +import { setBlockType } from "prosemirror-commands"; + +@injectable() +export default class EpigraphPoetry extends Tools { + title = "Change to Epigraph Poetry"; + content = "Epigraph Poetry"; + + get run() { + return (state, dispatch) => { + setBlockType(state.config.schema.nodes.epigraphPoetry)(state, dispatch); + }; + } + + get enable() { + return state => { + return setBlockType(state.config.schema.nodes.epigraphPoetry)(state); + }; + } +} diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphPoetryService/EpigraphPoetryService.js b/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphPoetryService/EpigraphPoetryService.js new file mode 100644 index 0000000000000000000000000000000000000000..0e6fa7861d8de0839f1ff5bb120029ae58ec5e19 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphPoetryService/EpigraphPoetryService.js @@ -0,0 +1,12 @@ +import Service from "wax-prosemirror-core/src/services/Service"; +import EpigraphPoetry from "./EpigraphPoetry"; + +class EpigraphPoetryService extends Service { + boot() {} + + register() { + this.container.bind("EpigraphPoetry").to(EpigraphPoetry); + } +} + +export default EpigraphPoetryService; diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphProseService/EpigraphProse.js b/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphProseService/EpigraphProse.js new file mode 100644 index 0000000000000000000000000000000000000000..8347f6bcba19e6d9775570556621f413bf7bdb68 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphProseService/EpigraphProse.js @@ -0,0 +1,21 @@ +import Tools from "../../lib/Tools"; +import { injectable } from "inversify"; +import { setBlockType } from "prosemirror-commands"; + +@injectable() +export default class EpigraphProse extends Tools { + title = "Change to Epigraph Prose"; + content = "Epigraph Prose"; + + get run() { + return (state, dispatch) => { + setBlockType(state.config.schema.nodes.epigraphProse)(state, dispatch); + }; + } + + get enable() { + return state => { + return setBlockType(state.config.schema.nodes.epigraphProse)(state); + }; + } +} diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphProseService/EpigraphProseService.js b/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphProseService/EpigraphProseService.js new file mode 100644 index 0000000000000000000000000000000000000000..1a098f520badbbcd43a40cec30c58cd93def90f0 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/EpigraphProseService/EpigraphProseService.js @@ -0,0 +1,12 @@ +import Service from "wax-prosemirror-core/src/services/Service"; +import EpigraphProse from "./EpigraphProse"; + +class EpigraphProseService extends Service { + boot() {} + + register() { + this.container.bind("EpigraphProse").to(EpigraphProse); + } +} + +export default EpigraphProseService; diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/Heading1.js b/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/Heading1.js new file mode 100644 index 0000000000000000000000000000000000000000..8ad2dc6815cae6e8a5f17475c58c0cbfefdde9df --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/Heading1.js @@ -0,0 +1,27 @@ +import Tools from "../../lib/Tools"; +import { injectable } from "inversify"; +import { setBlockType } from "prosemirror-commands"; + +@injectable() +export default class Heading1 extends Tools { + title = "Change to heading level 1"; + content = "Heading 1"; + + get run() { + return (state, dispatch) => { + setBlockType(state.config.schema.nodes.heading, { level: 1 })( + state, + dispatch + ); + }; + } + + get enable() { + return state => { + return setBlockType(state.config.schema.nodes.heading, { + level: 1, + track: [] + })(state); + }; + } +} diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/Heading2.js b/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/Heading2.js new file mode 100644 index 0000000000000000000000000000000000000000..80a7b88e85be051e845f935af071e30ea4d22e20 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/Heading2.js @@ -0,0 +1,27 @@ +import Tools from "../../lib/Tools"; +import { injectable } from "inversify"; +import { setBlockType } from "prosemirror-commands"; + +@injectable() +export default class Heading2 extends Tools { + title = "Change to heading level 2"; + content = "Heading 2"; + + get run() { + return (state, dispatch) => { + setBlockType(state.config.schema.nodes.heading, { level: 2 })( + state, + dispatch + ); + }; + } + + get enable() { + return state => { + return setBlockType(state.config.schema.nodes.heading, { + level: 2, + track: [] + })(state); + }; + } +} diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/Heading3.js b/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/Heading3.js new file mode 100644 index 0000000000000000000000000000000000000000..8163289fb5ed31ef2f65eea71069b16779202170 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/Heading3.js @@ -0,0 +1,27 @@ +import Tools from "../../lib/Tools"; +import { injectable } from "inversify"; +import { setBlockType } from "prosemirror-commands"; + +@injectable() +export default class Heading3 extends Tools { + title = "Change to heading level 3"; + content = "Heading 3"; + + get run() { + return (state, dispatch) => { + setBlockType(state.config.schema.nodes.heading, { level: 3 })( + state, + dispatch + ); + }; + } + + get enable() { + return state => { + return setBlockType(state.config.schema.nodes.heading, { + level: 3, + track: [] + })(state); + }; + } +} diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/HeadingService.js b/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/HeadingService.js new file mode 100644 index 0000000000000000000000000000000000000000..7233dbec08e867cae5c6efcbfff6a002b0835938 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/HeadingService/HeadingService.js @@ -0,0 +1,16 @@ +import Service from "wax-prosemirror-core/src/services/Service"; +import Heading1 from "./Heading1"; +import Heading2 from "./Heading3"; +import Heading3 from "./Heading3"; + +class HeadingService extends Service { + boot() {} + + register() { + this.container.bind("Heading1").to(Heading1); + this.container.bind("Heading2").to(Heading2); + this.container.bind("Heading3").to(Heading3); + } +} + +export default HeadingService; diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/SubTitleService/SubTitle.js b/wax-prosemirror-services/src/DisplayBlockLevel/SubTitleService/SubTitle.js new file mode 100644 index 0000000000000000000000000000000000000000..caac1427b53f761996822dabc87b6173bcf65b36 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/SubTitleService/SubTitle.js @@ -0,0 +1,21 @@ +import Tools from "../../lib/Tools"; +import { injectable } from "inversify"; +import { setBlockType } from "prosemirror-commands"; + +@injectable() +export default class SubTitle extends Tools { + title = "Change to Subtitle"; + content = "Subtitle"; + + get run() { + return (state, dispatch) => { + setBlockType(state.config.schema.nodes.subtitle)(state, dispatch); + }; + } + + get enable() { + return state => { + return setBlockType(state.config.schema.nodes.subtitle)(state); + }; + } +} diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/SubTitleService/SubTitleService.js b/wax-prosemirror-services/src/DisplayBlockLevel/SubTitleService/SubTitleService.js new file mode 100644 index 0000000000000000000000000000000000000000..6d2f9f689ccac2b66613cbcdef0c48729aa093b2 --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/SubTitleService/SubTitleService.js @@ -0,0 +1,12 @@ +import Service from "wax-prosemirror-core/src/services/Service"; +import SubTitle from "./SubTitle"; + +class SubTitleService extends Service { + boot() {} + + register() { + this.container.bind("SubTitle").to(SubTitle); + } +} + +export default SubTitleService; diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/TitleService/Title.js b/wax-prosemirror-services/src/DisplayBlockLevel/TitleService/Title.js new file mode 100644 index 0000000000000000000000000000000000000000..94c85205fdefdce0793fe1be02d8c14364ea7fee --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/TitleService/Title.js @@ -0,0 +1,22 @@ +import Tools from "../../lib/Tools"; +import { injectable } from "inversify"; +import { setBlockType } from "prosemirror-commands"; +import { blockActive } from "../../lib/Utils"; + +@injectable() +export default class Title extends Tools { + title = "Change to Title"; + content = "Title"; + + get run() { + return (state, dispatch) => { + setBlockType(state.config.schema.nodes.title)(state, dispatch); + }; + } + + get enable() { + return state => { + return setBlockType(state.config.schema.nodes.title)(state); + }; + } +} diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/TitleService/TitleService.js b/wax-prosemirror-services/src/DisplayBlockLevel/TitleService/TitleService.js new file mode 100644 index 0000000000000000000000000000000000000000..e1586b2227e998276b1c059a756f30d4a058995d --- /dev/null +++ b/wax-prosemirror-services/src/DisplayBlockLevel/TitleService/TitleService.js @@ -0,0 +1,12 @@ +import Service from "wax-prosemirror-core/src/services/Service"; +import Title from "./Title"; + +class TitleService extends Service { + boot() {} + + register() { + this.container.bind("Title").to(Title); + } +} + +export default TitleService; diff --git a/wax-prosemirror-services/src/DisplayBlockLevel/index.js b/wax-prosemirror-services/src/DisplayBlockLevel/index.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6e9670adff6ddceb74b8eade93a55b58d2e76781 100644 --- a/wax-prosemirror-services/src/DisplayBlockLevel/index.js +++ b/wax-prosemirror-services/src/DisplayBlockLevel/index.js @@ -0,0 +1,13 @@ +import AuthorService from "./AuthorService/AuthorService"; +import EpigraphPoetryService from "./EpigraphPoetryService/EpigraphPoetryService"; +import HeadingService from "./HeadingService/HeadingService"; +import SubTitleService from "./SubTitleService/SubTitleService"; +import TitleService from "./TitleService/TitleService"; + +export default [ + new AuthorService(), + new EpigraphPoetryService(), + new HeadingService(), + new SubTitleService(), + new TitleService() +]; diff --git a/wax-prosemirror-services/src/TextBlockLevel/ExtractPoetryService/ExtractPoetryService.js b/wax-prosemirror-services/src/TextBlockLevel/ExtractPoetryService/ExtractPoetryService.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/wax-prosemirror-services/src/TextBlockLevel/ExtractProseService/ExtractProseService.js b/wax-prosemirror-services/src/TextBlockLevel/ExtractProseService/ExtractProseService.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/wax-prosemirror-services/src/TextBlockLevel/ParagraphContinuedService/ParagraphContinuedService.js b/wax-prosemirror-services/src/TextBlockLevel/ParagraphContinuedService/ParagraphContinuedService.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/wax-prosemirror-services/src/TextBlockLevel/ParagraphService/ParagraphService.js b/wax-prosemirror-services/src/TextBlockLevel/ParagraphService/ParagraphService.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/wax-prosemirror-services/src/TextBlockLevel/SourceNoteService/SourceNoteService.js b/wax-prosemirror-services/src/TextBlockLevel/SourceNoteService/SourceNoteService.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/wax-prosemirror-services/src/TextBlockLevel/index.js b/wax-prosemirror-services/src/TextBlockLevel/index.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3bf999cd869e5c2d549d50ff0dcdad1a8b66c607 100644 --- a/wax-prosemirror-services/src/TextBlockLevel/index.js +++ b/wax-prosemirror-services/src/TextBlockLevel/index.js @@ -0,0 +1,13 @@ +// import ExtractPoetryService from "./ExtractPoetryService/ExtractPoetryService"; +// import ExtractProseService from "./ExtractProseService/ExtractProseService"; +// import ParagraphContinuedService from "./ParagraphContinuedService/ParagraphContinuedService"; +// import ParagraphService from "./ParagraphService/ParagraphService"; +// import SourceNoteService from "./SourceNoteService/SourceNoteService"; +// +// export default [ +// new ExtractPoetryService(), +// new ExtractProseService(), +// new ParagraphContinuedService(), +// new ParagraphService(), +// new SourceNoteService() +// ];