Skip to content
Snippets Groups Projects
Commit db253fce authored by Christos's avatar Christos
Browse files

Merge branch 'ui-components' into 'master'

Ui components

See merge request !201
parents c47ae53e 63a16752
No related branches found
No related tags found
1 merge request!201Ui components
Showing
with 143 additions and 4 deletions
......@@ -4,7 +4,7 @@
"version": "0.0.26",
"description": "Wax prosemirror services",
"license": "MIT",
"main": "dist/index.js",
"main": "index.js",
"files": [
"dist"
],
......
import Service from '../Service';
import FullScreenTool from './FullScreenTool';
class FullScreenService extends Service {
name = 'FullScreenService';
register() {
this.container.bind('FullScreenTool').to(FullScreenTool);
}
}
export default FullScreenService;
import React from 'react';
import { isEmpty } from 'lodash';
import { injectable } from 'inversify';
import { FullScreen } from 'wax-prosemirror-components';
import Tools from '../lib/Tools';
export default
@injectable()
class FullScreenTool extends Tools {
title = 'full screen';
icon = 'fullScreen';
name = 'FullScreen';
get run() {
return () => true;
}
select = (state, activeViewId) => {
return true;
};
get enable() {
return state => {
return true;
};
}
renderTool(view) {
if (isEmpty(view)) return null;
return this._isDisplayed ? (
<FullScreen key="FullScreen" item={this.toJSON()} view={view} />
) : null;
}
}
......@@ -15,7 +15,7 @@ class Image extends Tools {
name = 'Image';
get run() {
return () => true;
return true;
}
select = (state, activeViewId) => {
......
import Service from '../Service';
import SpecialCharactersTool from './SpecialCharactersTool';
class SpecialCharactersService extends Service {
name = 'SpecialCharactersService';
register() {
this.container.bind('SpecialCharactersTool').to(SpecialCharactersTool);
}
}
export default SpecialCharactersService;
import React from 'react';
import { isEmpty } from 'lodash';
import { v4 as uuidv4 } from 'uuid';
import { injectable } from 'inversify';
import { SpecialCharactersTool } from 'wax-prosemirror-components';
import Tools from '../lib/Tools';
export default
@injectable()
class SpecialCharacters extends Tools {
title = 'Special Characters';
icon = 'specialCharacters';
name = 'specialCharacters';
get run() {
return (state, dispatch) => {};
}
select = (state, activeViewId) => {};
get enable() {
return state => {
return true;
};
}
renderTool(view) {
if (isEmpty(view)) return null;
return this._isDisplayed ? (
<SpecialCharactersTool key={uuidv4()} item={this.toJSON()} view={view} />
) : null;
}
}
......@@ -45,7 +45,7 @@ class DisplayText extends ToolGroup {
const second = {
id: '2',
icon: 'code',
icon: 'chapterList',
component: <Empty />,
};
......
import { injectable, inject } from 'inversify';
import ToolGroup from '../../lib/ToolGroup';
@injectable()
class FullScreen extends ToolGroup {
tools = [];
constructor(@inject('FullScreenTool') fullScreenTool) {
super();
this.tools = [fullScreenTool];
}
}
export default FullScreen;
import Service from '../../Service';
import FullScreen from './FullScreen';
class FullScreenToolGroupService extends Service {
register() {
this.container.bind('FullScreen').to(FullScreen);
}
}
export default FullScreenToolGroupService;
import { injectable, inject } from 'inversify';
import ToolGroup from '../../lib/ToolGroup';
@injectable()
class SpecialCharacters extends ToolGroup {
tools = [];
constructor(@inject('SpecialCharactersTool') specialCharactersTool) {
super();
this.tools = [specialCharactersTool];
}
}
export default SpecialCharacters;
/* eslint-disable */
import Service from '../../Service';
import SpecialCharacters from './SpecialCharacters';
class SpecialCharactersToolGroupService extends Service {
register() {
this.container.bind('SpecialCharacters').to(SpecialCharacters);
}
}
export default SpecialCharactersToolGroupService;
/* eslint-disable */
import React from 'react';
import { v4 as uuidv4 } from 'uuid';
import { isEmpty } from 'lodash';
......
......@@ -4,7 +4,7 @@
"version": "0.0.26",
"description": "Wax prosemirror utilities",
"license": "MIT",
"main": "dist/index.js",
"main": "index.js",
"files": [
"dist"
],
......
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