Skip to content
Snippets Groups Projects
Commit 8e6cd3ba authored by chris's avatar chris
Browse files

move marks to services

parent e4a13bc0
No related branches found
No related tags found
1 merge request!418move marks to services
Showing
with 29 additions and 74 deletions
/* /*
LIST OF SUPPORTED MARKS
*/
export { default as codeMark } from './src/marks/codeMark';
export { default as strongMark } from './src/marks/strongMark';
export { default as linkMark } from './src/marks/linkMark';
export { default as emphasisMark } from './src/marks/emphasisMark';
export { default as subscriptMark } from './src/marks/subscriptMark';
export { default as superscriptMark } from './src/marks/superscriptMark';
export { default as strikethroughMark } from './src/marks/strikethroughMark';
export { default as underlineMark } from './src/marks/underlineMark';
export { default as smallcapsMark } from './src/marks/smallcapsMark';
export { default as sourceMark } from './src/marks/sourceMark';
export { default as commentMark } from './src/marks/commentMark';
export { default as mathSelectMark } from './src/marks/mathSelectMark';
export { default as highlightMark } from './src/marks/highlightMark';
export { default as customtagInlineMark } from './src/marks/customTagInlineMark';
/*
LIST OF TRACK CHANGES MARKS LIST OF TRACK CHANGES MARKS
*/ */
export { default as trackChangesMarks } from './src/marks/trackChangesMarks'; export { default as trackChangesMarks } from './src/marks/trackChangesMarks';
......
const code = {
parseDOM: { tag: "code" },
toDOM(hook, next) {
hook.value = ["code", 0];
next();
}
};
export default code;
const source = {
parseDOM: [{ tag: "cite" }],
toDOM() {
return ["cite", 0];
}
};
export default source;
const subscript = {
excludes: "superscript",
parseDOM: [{ tag: "sub" }, { style: "vertical-align=sub" }],
toDOM(hook, next) {
hook.value = ["sub"];
next();
}
};
export default subscript;
const superscript = {
excludes: "subscript",
parseDOM: [{ tag: "sup" }, { style: "vertical-align=super" }],
toDOM: (hook, next) => {
hook.value = ["sup"];
next();
}
};
export default superscript;
import { Service } from 'wax-prosemirror-core'; import { Service } from 'wax-prosemirror-core';
import { commentMark } from 'wax-prosemirror-schema';
import { RightArea, CommentBubbleComponent } from 'wax-prosemirror-components'; import { RightArea, CommentBubbleComponent } from 'wax-prosemirror-components';
import commentMark from './schema/commentMark';
import CommentPlugin from './plugins/CommentPlugin'; import CommentPlugin from './plugins/CommentPlugin';
import CopyPasteCommentPlugin from './plugins/CopyPasteCommentPlugin'; import CopyPasteCommentPlugin from './plugins/CopyPasteCommentPlugin';
import './comments.css'; import './comments.css';
......
const comment = { const commentMark = {
attrs: { attrs: {
class: { default: 'comment' }, class: { default: 'comment' },
id: { default: '' }, id: { default: '' },
...@@ -38,4 +38,4 @@ const comment = { ...@@ -38,4 +38,4 @@ const comment = {
}, },
}; };
export default comment; export default commentMark;
import { Service } from 'wax-prosemirror-core'; import { Service } from 'wax-prosemirror-core';
import { CustomTagInlineOverlayComponent } from 'wax-prosemirror-components'; import { CustomTagInlineOverlayComponent } from 'wax-prosemirror-components';
import { customtagInlineMark } from 'wax-prosemirror-schema'; import customtagInlineMark from './schema/customtagInlineMark';
import CustomTagInlineTool from './CustomTagInlineTool'; import CustomTagInlineTool from './CustomTagInlineTool';
class CustomTagInlineService extends Service { class CustomTagInlineService extends Service {
......
const customtagInline = { const customtagInlineMark = {
attrs: { attrs: {
class: { default: null }, class: { default: null },
tags: [], tags: [],
...@@ -32,4 +32,4 @@ const customtagInline = { ...@@ -32,4 +32,4 @@ const customtagInline = {
}, },
}; };
export default customtagInline; export default customtagInlineMark;
import { Service } from 'wax-prosemirror-core'; import { Service } from 'wax-prosemirror-core';
import { highlightMark } from 'wax-prosemirror-schema'; import highlightMark from './schema/highlightMark';
import TextHighlightTool from './TextHighlightTool'; import TextHighlightTool from './TextHighlightTool';
export default class HighlightService extends Service { export default class HighlightService extends Service {
......
const highlight = { const highlightMark = {
attrs: { attrs: {
style: { default: null }, style: { default: null },
class: { default: 'highlight' }, class: { default: 'highlight' },
...@@ -23,4 +23,4 @@ const highlight = { ...@@ -23,4 +23,4 @@ const highlight = {
}, },
}; };
export default highlight; export default highlightMark;
import { Service } from 'wax-prosemirror-core'; import { Service } from 'wax-prosemirror-core';
import { toggleMark } from 'prosemirror-commands'; import { toggleMark } from 'prosemirror-commands';
import { codeMark } from 'wax-prosemirror-schema'; import codeMark from './schema/codeMark';
import Code from './Code'; import Code from './Code';
class CodeService extends Service { class CodeService extends Service {
......
const codeMark = {
parseDOM: { tag: 'code' },
toDOM(hook, next) {
hook.value = ['code', 0];
next();
},
};
export default codeMark;
import { Service } from 'wax-prosemirror-core'; import { Service } from 'wax-prosemirror-core';
import { toggleMark } from 'prosemirror-commands'; import { toggleMark } from 'prosemirror-commands';
import { emphasisMark } from 'wax-prosemirror-schema'; import emphasisMark from './schema/emphasisMark';
import Emphasis from './Emphasis'; import Emphasis from './Emphasis';
class EmphasisService extends Service { class EmphasisService extends Service {
......
const em = { const emphasisMark = {
parseDOM: [{ tag: 'i' }, { tag: 'em' }, { style: 'font-style=italic' }], parseDOM: [{ tag: 'i' }, { tag: 'em' }, { style: 'font-style=italic' }],
toDOM(hook, next) { toDOM(hook, next) {
hook.value = ['em', 0]; hook.value = ['em', 0];
...@@ -6,4 +6,4 @@ const em = { ...@@ -6,4 +6,4 @@ const em = {
}, },
}; };
export default em; export default emphasisMark;
import { Service } from 'wax-prosemirror-core'; import { Service } from 'wax-prosemirror-core';
import { smallcapsMark } from 'wax-prosemirror-schema'; import smallcapsMark from './schema/smallcapsMark';
import SmallCaps from './SmallCaps'; import SmallCaps from './SmallCaps';
class SmallCapsService extends Service { class SmallCapsService extends Service {
......
const smallcaps = { const smallcapsMark = {
attrs: { attrs: {
class: { default: 'small-caps' }, class: { default: 'small-caps' },
}, },
...@@ -20,4 +20,4 @@ const smallcaps = { ...@@ -20,4 +20,4 @@ const smallcaps = {
}, },
}; };
export default smallcaps; export default smallcapsMark;
import { Service } from 'wax-prosemirror-core'; import { Service } from 'wax-prosemirror-core';
import { strikethroughMark } from 'wax-prosemirror-schema'; import strikethroughMark from './schema/strikethroughMark';
import StrikeThrough from './StrikeThrough'; import StrikeThrough from './StrikeThrough';
class StrikeThroughService extends Service { class StrikeThroughService extends Service {
......
const strikethrough = { const strikethroughMark = {
attrs: { attrs: {
class: { default: 'strikethrough' }, class: { default: 'strikethrough' },
style: { default: 'text-decoration:line-through' }, style: { default: 'text-decoration:line-through' },
...@@ -23,4 +23,4 @@ const strikethrough = { ...@@ -23,4 +23,4 @@ const strikethrough = {
}, },
}; };
export default strikethrough; export default strikethroughMark;
import { Service } from 'wax-prosemirror-core'; import { Service } from 'wax-prosemirror-core';
import { toggleMark } from 'prosemirror-commands'; import { toggleMark } from 'prosemirror-commands';
import { strongMark } from 'wax-prosemirror-schema'; import strongMark from './schema/strongMark';
import Strong from './Strong'; import Strong from './Strong';
import './strong.css'; import './strong.css';
......
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