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

Merge branch 'fix-mobile-view' into 'master'

Fix mobile view

See merge request !214
parents 43923447 22ae8904
No related branches found
No related tags found
1 merge request!214Fix mobile view
...@@ -13,7 +13,6 @@ Wax Editor is built on top of the Prosemirror library. Check Prosemirror [websit ...@@ -13,7 +13,6 @@ Wax Editor is built on top of the Prosemirror library. Check Prosemirror [websit
Wax-prosemirror is under active development. The current roadmap is as follows: Wax-prosemirror is under active development. The current roadmap is as follows:
### December 2020 ### December 2020
Beta version, including some new features: Beta version, including some new features:
...@@ -101,13 +100,12 @@ debug; // dev-tools (https://github.com/d4rkr00t/prosemirror-dev-tools) ...@@ -101,13 +100,12 @@ debug; // dev-tools (https://github.com/d4rkr00t/prosemirror-dev-tools)
10. _TrackChange Tool group_: `TrackChange` 10. _TrackChange Tool group_: `TrackChange`
11. _Math_: `math` (https://github.com/benrbray/prosemirror-math) 11. _Math_: `math` (https://github.com/benrbray/prosemirror-math)
12._Special Character_: `SpecialCharacters` 12._Special Character_: `SpecialCharacters`
13. _Find And Replace_: `` 13. _Find And Replace_: ``
<h2> wax-prosemirror-core </h2> <h2> wax-prosemirror-core </h2>
The role of wax-core is The role of wax-core is
...@@ -419,11 +417,11 @@ Is used for adding menus to the editor. ...@@ -419,11 +417,11 @@ Is used for adding menus to the editor.
## Latest versions ## Latest versions
- wax-prosemirror-components@0.0.26 - wax-prosemirror-components@0.0.27
- wax-prosemirror-core@0.0.26 - wax-prosemirror-core@0.0.27
- wax-prosemirror-layouts@0.0.26 - wax-prosemirror-layouts@0.0.27
- wax-prosemirror-plugins@0.0.26 - wax-prosemirror-plugins@0.0.27
- wax-prosemirror-schema@0.0.26 - wax-prosemirror-schema@0.0.27
- wax-prosemirror-services@0.0.26 - wax-prosemirror-services@0.0.27
- wax-prosemirror-themes@0.0.26 - wax-prosemirror-themes@0.0.27
- wax-prosemirror-utilities@0.0.26 - wax-prosemirror-utilities@0.0.27
...@@ -30,6 +30,8 @@ import { ...@@ -30,6 +30,8 @@ import {
TextHighlightToolGroupServices, TextHighlightToolGroupServices,
} from 'wax-prosemirror-services'; } from 'wax-prosemirror-services';
import { DefaultSchema } from 'wax-prosemirror-utilities';
import { WaxSelectionPlugin } from 'wax-prosemirror-plugins'; import { WaxSelectionPlugin } from 'wax-prosemirror-plugins';
import invisibles, { import invisibles, {
...@@ -60,6 +62,7 @@ export default { ...@@ -60,6 +62,7 @@ export default {
}, },
], ],
SchemaService: DefaultSchema,
RulesService: [emDash, ellipsis], RulesService: [emDash, ellipsis],
ShortCutsService: {}, ShortCutsService: {},
EnableTrackChangeService: { enabled: false }, EnableTrackChangeService: { enabled: false },
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"version": "0.0.27", "version": "0.0.27",
"description": "Wax prosemirror UI components", "description": "Wax prosemirror UI components",
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "index.js",
"files": [ "files": [
"dist" "dist"
], ],
......
...@@ -107,6 +107,8 @@ const SpecialCharactersComponent = ({ close }) => { ...@@ -107,6 +107,8 @@ const SpecialCharactersComponent = ({ close }) => {
const searchRef = useRef(null); const searchRef = useRef(null);
const { activeView } = useContext(WaxContext); const { activeView } = useContext(WaxContext);
const [searchValue, setSearchValue] = useState(''); const [searchValue, setSearchValue] = useState('');
const [isFirstRun, setFirstRun] = useState(true);
const [specialCharactersList, setSpecialCharactersList] = useState( const [specialCharactersList, setSpecialCharactersList] = useState(
CharactersList, CharactersList,
); );
...@@ -130,12 +132,21 @@ const SpecialCharactersComponent = ({ close }) => { ...@@ -130,12 +132,21 @@ const SpecialCharactersComponent = ({ close }) => {
useEffect(() => { useEffect(() => {
delayedSearch(); delayedSearch();
if (isFirstRun) {
setTimeout(() => {
searchRef.current.focus();
setFirstRun(false);
});
}
}, [searchValue, delayedSearch]); }, [searchValue, delayedSearch]);
const insertCharacter = character => { const insertCharacter = character => {
const { state, dispatch } = activeView; const { state, dispatch } = activeView;
const { from, to } = state.selection; const { from, to } = state.selection;
dispatch(state.tr.insertText(character.unicode, from, to)); dispatch(state.tr.insertText(character.unicode, from, to));
setTimeout(() => {
activeView.focus();
});
}; };
const renderList = () => { const renderList = () => {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"version": "0.0.27", "version": "0.0.27",
"description": "Wax prosemirror core", "description": "Wax prosemirror core",
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "index.js",
"files": [ "files": [
"dist" "dist"
], ],
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"version": "0.0.27", "version": "0.0.27",
"description": "Wax prosemirror plugins", "description": "Wax prosemirror plugins",
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "index.js",
"files": [ "files": [
"dist" "dist"
], ],
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"version": "0.0.27", "version": "0.0.27",
"description": "Wax prosemirror schema", "description": "Wax prosemirror schema",
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "index.js",
"files": [ "files": [
"dist" "dist"
], ],
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"version": "0.0.27", "version": "0.0.27",
"description": "Wax prosemirror services", "description": "Wax prosemirror services",
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "index.js",
"files": [ "files": [
"dist" "dist"
], ],
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"version": "0.0.27", "version": "0.0.27",
"description": "Wax prosemirror utilities", "description": "Wax prosemirror utilities",
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "index.js",
"files": [ "files": [
"dist" "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