Skip to content
Snippets Groups Projects
Commit 5aa5214a authored by chris's avatar chris
Browse files

rename service

parent 90d20e75
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ import {
EssayToolGroupService,
MatchingService,
MatchingToolGroupService,
ChatService,
EnterService,
} from 'wax-prosemirror-services';
import { DefaultSchema } from 'wax-prosemirror-utilities';
......@@ -68,14 +68,14 @@ export default {
},
],
ChatService: { getContentOnEnter },
EnterService: { getContentOnEnter },
SchemaService: DefaultSchema,
RulesService: [emDash, ellipsis],
PmPlugins: [columnResizing(), tableEditing(), invisibles([hardBreak()])],
services: [
// new ChatService(),
new EnterService(),
new MatchingService(),
new MatchingToolGroupService(),
new FillTheGapQuestionService(),
......
......@@ -11,4 +11,4 @@ export { default as mathSelectPlugin } from './src/math/math-select';
export { default as FindAndReplacePlugin } from './src/findAndReplace/FindAndReplacePlugin';
export { default as PlaceHolderPlugin } from './src/images/placeHolderPlugin';
export { default as captionPlugin } from './src/images/captionPlugin';
export { default as ChatPlugin } from './src/ChatPlugin';
export { default as GetContentOnEnterPlugin } from './src/GetContentOnEnterPlugin';
......@@ -2,7 +2,7 @@ import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
// eslint-disable-next-line import/no-extraneous-dependencies
import { DOMSerializer, DOMParser } from 'prosemirror-model';
const chatPlugin = new PluginKey('chatPlugin');
const getContentOnEnterPlugin = new PluginKey('getContentOnEnterPlugin');
const serializer = schema => {
const WaxSerializer = DOMSerializer.fromSchema(schema);
......@@ -26,7 +26,7 @@ const parser = schema => {
export default props => {
return new Plugin({
key: chatPlugin,
key: getContentOnEnterPlugin,
state: {
init: (_, state) => {},
apply(tr, prev, _, newState) {},
......
......@@ -50,7 +50,7 @@ export { default as TrueFalseQuestionService } from './src/MultipleChoiceQuestio
export { default as FillTheGapQuestionService } from './src/FillTheGapQuestionService/FillTheGapQuestionService';
export { default as EssayService } from './src/EssayService/EssayService';
export { default as MatchingService } from './src/MatchingService/MatchingService';
export { default as ChatService } from './src/ChatService/ChatService';
export { default as EnterService } from './src/EnterService/EnterService';
/*
ToolGroups
*/
......
import { ChatPlugin } from 'wax-prosemirror-plugins';
import Service from '../Service';
class ChatService extends Service {
name = 'ChatService';
boot() {
this.app.PmPlugins.add('chatPlugin', ChatPlugin(this.config));
}
}
export default ChatService;
import { GetContentOnEnterPlugin } from 'wax-prosemirror-plugins';
import Service from '../Service';
class EnterService extends Service {
name = 'EnterService';
boot() {
this.app.PmPlugins.add(
'getContentOnEnterPlugin',
GetContentOnEnterPlugin(this.config),
);
}
}
export default EnterService;
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