Skip to content
Snippets Groups Projects
Commit 666451b8 authored by chris's avatar chris
Browse files

new track comment options toolgroup service

parent 8e5480d5
No related branches found
No related tags found
1 merge request!226Ui components
...@@ -40,6 +40,7 @@ import { ...@@ -40,6 +40,7 @@ import {
TransformToolGroupService, TransformToolGroupService,
TrackOptionsService, TrackOptionsService,
TrackOptionsToolGroupService, TrackOptionsToolGroupService,
TrackCommentOptionsToolGroupService,
} from 'wax-prosemirror-services'; } from 'wax-prosemirror-services';
import { DefaultSchema } from 'wax-prosemirror-utilities'; import { DefaultSchema } from 'wax-prosemirror-utilities';
...@@ -90,20 +91,7 @@ export default { ...@@ -90,20 +91,7 @@ export default {
}, },
{ {
templateArea: 'commentTrackToolBar', templateArea: 'commentTrackToolBar',
toolGroups: [ toolGroups: ['TrackCommentOptions'],
{
name: 'Annotations',
more: [
'Superscript',
'Subscript',
'SmallCaps',
'Emphasis',
'Code',
'Underline',
'StrikeThrough',
],
},
],
}, },
{ {
templateArea: 'BottomRightInfo', templateArea: 'BottomRightInfo',
...@@ -183,7 +171,7 @@ export default { ...@@ -183,7 +171,7 @@ export default {
new BottomInfoService(), new BottomInfoService(),
new TransformService(), new TransformService(),
new TransformToolGroupService(), new TransformToolGroupService(),
new TrackOptionsService(),
new TrackOptionsToolGroupService(), new TrackOptionsToolGroupService(),
new TrackCommentOptionsToolGroupService(),
], ],
}; };
...@@ -59,3 +59,4 @@ export { default as TextHighlightToolGroupServices } from './src/WaxToolGroups/T ...@@ -59,3 +59,4 @@ export { default as TextHighlightToolGroupServices } from './src/WaxToolGroups/T
export { default as EditorInfoToolGroupServices } from './src/WaxToolGroups/BottomToolGroupService/InfoToolGroupService/EditorInfoToolGroupService'; export { default as EditorInfoToolGroupServices } from './src/WaxToolGroups/BottomToolGroupService/InfoToolGroupService/EditorInfoToolGroupService';
export { default as TransformToolGroupService } from './src/WaxToolGroups/TransformToolGroupService/TransformToolGroupService'; export { default as TransformToolGroupService } from './src/WaxToolGroups/TransformToolGroupService/TransformToolGroupService';
export { default as TrackOptionsToolGroupService } from './src/WaxToolGroups/TrackOptionsToolGroupService/TrackOptionsToolGroupService'; export { default as TrackOptionsToolGroupService } from './src/WaxToolGroups/TrackOptionsToolGroupService/TrackOptionsToolGroupService';
export { default as TrackCommentOptionsToolGroupService } from './src/WaxToolGroups/TrackCommentOptionsToolGroupService/TrackCommentOptionsToolGroupService';
import React, { useMemo } from 'react';
import { injectable, inject } from 'inversify';
import { BlockLevelTools, Tabs, ToolGroups } from 'wax-prosemirror-components';
import { isEmpty } from 'lodash';
import styled from 'styled-components';
import { v4 as uuidv4 } from 'uuid';
import ToolGroup from '../../lib/ToolGroup';
const Empty = styled.div`
background: khaki;
height: 100%;
`;
@injectable()
class TrackCommentOptions extends ToolGroup {
tools = [];
toolGroups = [];
constructor(@inject('TrackOptions') trackOptions, @inject('Text') text) {
super();
this.toolGroups = [
{
groups: [trackOptions, text],
},
];
}
renderTools(view) {
if (isEmpty(view)) return null;
return <span>Options</span>;
}
}
export default TrackCommentOptions;
import Service from '../../Service';
import TrackCommentOptions from './TrackCommentOptions';
class TrackCommentOptionsToolGroupService extends Service {
register() {
this.container.bind('TrackCommentOptions').to(TrackCommentOptions);
}
}
export default TrackCommentOptionsToolGroupService;
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