Newer
Older
import { emDash, ellipsis } from 'prosemirror-inputrules';
import { debounce } from 'lodash';
import {
InlineAnnotationsService,
ImageService,
LinkService,
ListsService,
BaseService,
DisplayBlockLevelService,
TextBlockLevelService,
NoteService,
TrackChangeService,
CommentsService,
CodeBlockService,
MathService,
FindAndReplaceService,
EditingSuggestingService,
FullScreenService,
SpecialCharactersService,
HighlightService,
BottomInfoService,
TransformService,
TrackOptionsToolGroupService,
TrackCommentOptionsToolGroupService,
CustomTagService,
import { TablesService, tableEditing, columnResizing } from 'wax-table-service';
import { EditoriaSchema } from 'wax-prosemirror-core';
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import invisibles, {
space,
hardBreak,
paragraph,
} from '@guardian/prosemirror-invisibles';
import CharactersList from './CharactersList';
// const updateTitle = title => {
// console.log(title);
// };
const updateTitle = debounce(title => {
// console.log(title);
}, 3000);
const saveTags = tags => {
// console.log(tags);
};
const updateTrackStatus = status => {
// console.log('status', status);
};
export default {
MenuService: [
{
templateArea: 'mainMenuToolBar',
toolGroups: [
'Base',
{
name: 'Annotations',
more: [
'Superscript',
'Subscript',
'SmallCaps',
'Underline',
'StrikeThrough',
],
},
'HighlightToolGroup',
'TransformToolGroup',
'CustomTagInline',
'Notes',
'Lists',
'Images',
'SpecialCharacters',
'CodeBlock',
'Tables',
'TrackingAndEditing',
'FullScreen',
],
},
{
templateArea: 'leftSideBar',
},
{
templateArea: 'commentTrackToolBar',
toolGroups: ['TrackCommentOptions'],
},
{
templateArea: 'BottomRightInfo',
toolGroups: ['InfoToolGroup'],
},
],
// CommentsService: { readOnly: true },
// OrderedListService: { subList: false },
// BulletListService: { subList: false },
// JoinUpService: { subList: false },
OENContainersService: [
{
groupHeader: 'Core Elements',
items: [
nestedHeadingLevel: null,
className: 'learning-objectives',
},
isSection: true,
nestedHeadingLevel: undefined,
className: 'whatever',
},
],
},
{
groupHeader: 'Core Elements 1',
items: [
{
SpecialCharactersService: CharactersList,
SchemaService: EditoriaSchema,
TitleService: { updateTitle },
RulesService: [emDash, ellipsis],
ShortCutsService: {},
EnableTrackChangeService: { enabled: false, toggle: true, updateTrackStatus },
AcceptTrackChangeService: {
own: {
accept: true,
},
others: {
accept: true,
},
},
RejectTrackChangeService: {
own: {
reject: true,
},
others: {
reject: true,
},
},
CustomTagService: {
tags: [
{ label: 'custom-tag-label-1', tagType: 'inline' },
{ label: 'custom-tag-label-2', tagType: 'inline' },
{ label: 'custom-tag-label-3', tagType: 'block' },
{ label: 'label 2', tagType: 'block' },
],
// updateTags: saveTags,
},
services: [
new CustomTagService(),
new DisplayBlockLevelService(),
new TextBlockLevelService(),
new ListsService(),
new LinkService(),
new InlineAnnotationsService(),
new TrackChangeService(),
new CommentsService(),
new ImageService(),
new TablesService(),
new BaseService(),
new NoteService(),
new CodeBlockService(),
new EditingSuggestingService(),
new MathService(),
new FindAndReplaceService(),
new FullScreenService(),
new SpecialCharactersService(),
new HighlightService(),
new BottomInfoService(),
new TransformService(),
new TrackOptionsToolGroupService(),
new TrackCommentOptionsToolGroupService(),
],
};