Skip to content
Snippets Groups Projects
Commit 60eb826e authored by chris's avatar chris
Browse files

fix-tools

parent 1063fc87
No related branches found
No related tags found
1 merge request!341fix-tools
Showing
with 23 additions and 14 deletions
......@@ -27,8 +27,8 @@
"styled-components": "^5.3.0",
"use-deep-compare-effect": "^1.3.1",
"uuid": "^7.0.3",
"wax-prosemirror-core": "^0.1.7",
"wax-prosemirror-utilities": "^0.1.7"
"wax-prosemirror-core": "0.1.7",
"wax-prosemirror-utilities": "0.1.7"
},
"peerDependencies": {
"react": "^16.13.1",
......
......@@ -32,8 +32,8 @@
"reflect-metadata": "^0.1.13",
"styled-components": "^5.3.0",
"uuid": "^7.0.3",
"wax-prosemirror-services": "^0.1.7",
"wax-prosemirror-utilities": "^0.1.7"
"wax-prosemirror-services": "0.1.7",
"wax-prosemirror-utilities": "0.1.7"
},
"devDependencies": {
"mocha": "^3.4.2",
......
......@@ -22,8 +22,8 @@
"prosemirror-state": "1.3.3",
"prosemirror-transform": "1.2.6",
"prosemirror-view": "1.20.1",
"wax-prosemirror-components": "^0.1.7",
"wax-prosemirror-core": "^0.1.7",
"wax-prosemirror-utilities": "^0.1.7"
"wax-prosemirror-components": "0.1.7",
"wax-prosemirror-core": "0.1.7",
"wax-prosemirror-utilities": "0.1.7"
}
}
......@@ -15,6 +15,6 @@
"dependencies": {
"prosemirror-schema-list": "^1.1.4",
"prosemirror-tables": "^1.1.1",
"wax-prosemirror-utilities": "^0.1.7"
"wax-prosemirror-utilities": "0.1.7"
}
}
......@@ -29,11 +29,11 @@
"styled-components": "^5.3.0",
"use-deep-compare-effect": "^1.3.1",
"uuid": "^7.0.3",
"wax-prosemirror-components": "^0.1.7",
"wax-prosemirror-core": "^0.1.7",
"wax-prosemirror-plugins": "^0.1.7",
"wax-prosemirror-schema": "^0.1.7",
"wax-prosemirror-utilities": "^0.1.7"
"wax-prosemirror-components": "0.1.7",
"wax-prosemirror-core": "0.1.7",
"wax-prosemirror-plugins": "0.1.7",
"wax-prosemirror-schema": "0.1.7",
"wax-prosemirror-utilities": "0.1.7"
},
"peerDependencies": {
"react": "^16.13.1",
......
......@@ -15,6 +15,7 @@ class CodeBlockTool extends Tools {
}
select = (state, activeViewId, activeView) => {
if (!activeView) return false;
const { disallowedTools } = activeView.props;
if (disallowedTools.includes('codeBlock')) return false;
return true;
......
......@@ -19,8 +19,9 @@ class FillTheGapQuestion extends Tools {
}
select = (state, activeViewId, activeView) => {
let status = true;
if (!activeView) return false;
const { disallowedTools } = activeView.props;
let status = true;
const { from, to } = state.selection;
if (from === null || disallowedTools.includes('Lists')) return false;
......
......@@ -20,6 +20,7 @@ class Image extends Tools {
}
select = activeView => {
if (!activeView) return false;
const {
selection: { from },
} = activeView.state;
......
......@@ -25,6 +25,7 @@ class BulletList extends Tools {
}
select = (state, activeViewId, activeView) => {
if (!activeView) return false;
const {
selection: { from },
} = state;
......
......@@ -10,6 +10,7 @@ class Lift extends Tools {
name = 'Lift';
select = (state, activeViewId, activeView) => {
if (!activeView) return false;
const { disallowedTools } = activeView.props;
if (disallowedTools.includes('lift')) return false;
return lift(state);
......
......@@ -23,6 +23,8 @@ class OrderedList extends Tools {
}
select = (state, activeViewId, activeView) => {
if (!activeView) return false;
const {
selection: { from },
} = state;
......
......@@ -66,6 +66,7 @@ class MultipleChoiceQuestion extends Tools {
}
select = (state, activeView) => {
if (!activeView) return false;
const { disallowedTools } = activeView.props;
if (disallowedTools.includes('MultipleChoice')) return false;
let status = true;
......
......@@ -20,6 +20,7 @@ class Table extends Tools {
}
select = activeView => {
if (!activeView) return false;
const {
selection: { from },
} = activeView.state;
......
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