diff --git a/editors/demo/src/Editoria/layout/EditoriaLayout.js b/editors/demo/src/Editoria/layout/EditoriaLayout.js index 3b4478111af461fb175c0ad23c6899ffd48c3739..bc4a0b7a08a871c436e1b453c6fe342bdbacd8a7 100644 --- a/editors/demo/src/Editoria/layout/EditoriaLayout.js +++ b/editors/demo/src/Editoria/layout/EditoriaLayout.js @@ -207,7 +207,7 @@ const BottomRightInfo = ComponentPlugin('BottomRightInfo'); const EditoriaLayout = ({ editor }) => { const { - view: { main }, + pmViews: { main }, options, } = useContext(WaxContext); diff --git a/wax-prosemirror-components/src/components/Button.js b/wax-prosemirror-components/src/components/Button.js index 4c4e8fab4c42bb9ef6eba6a373c4147d97843848..911932b5d60da5a8a12d462c38f0af2e189a6149 100644 --- a/wax-prosemirror-components/src/components/Button.js +++ b/wax-prosemirror-components/src/components/Button.js @@ -7,7 +7,7 @@ const Button = ({ view = {}, item }) => { const { active, icon, label, run, select, title } = item; const context = useContext(WaxContext); const { - view: { main }, + pmViews: { main }, activeViewId, activeView, } = context; diff --git a/wax-prosemirror-components/src/components/EditorInfo/CounterInfo/EditorInfoTool.js b/wax-prosemirror-components/src/components/EditorInfo/CounterInfo/EditorInfoTool.js index 23e5a44382937781b8cb6f1fdf0095ff4c1bf25d..6460d9682a12f7953ec29ff752455a9f0123b319 100644 --- a/wax-prosemirror-components/src/components/EditorInfo/CounterInfo/EditorInfoTool.js +++ b/wax-prosemirror-components/src/components/EditorInfo/CounterInfo/EditorInfoTool.js @@ -96,7 +96,7 @@ const EditorInfoTool = ({ view: { state }, item }) => { const ref = useRef(); const { activeView, - view: { main }, + pmViews: { main }, } = useContext(WaxContext); const allBlockNodes = DocumentHelpers.findBlockNodes(main.state.doc); const InlineNodes = DocumentHelpers.findInlineNodes(main.state.doc); diff --git a/wax-prosemirror-components/src/components/SaveButton.js b/wax-prosemirror-components/src/components/SaveButton.js index 33f4490fed7728c73b73b9dafb2ef66f47c75e8c..8eec53b41e68449cdcae68ea2eff40dc53c1e56b 100644 --- a/wax-prosemirror-components/src/components/SaveButton.js +++ b/wax-prosemirror-components/src/components/SaveButton.js @@ -7,7 +7,7 @@ const SaveButton = ({ view = {}, item }) => { const { icon, label, select, title } = item; const { - view: { main }, + pmViews: { main }, activeViewId, activeView, } = useContext(WaxContext); diff --git a/wax-prosemirror-components/src/components/TitleButton.js b/wax-prosemirror-components/src/components/TitleButton.js index 4e6ada5e7beff42e2e825690e6de06e1ab9ba10f..f3c14f7e0d05c3e6a415a4c527c33b1ef773eb66 100644 --- a/wax-prosemirror-components/src/components/TitleButton.js +++ b/wax-prosemirror-components/src/components/TitleButton.js @@ -9,7 +9,7 @@ const TitleButton = ({ view = {}, item }) => { const { app, - view: { main }, + pmViews: { main }, activeViewId, activeView, } = useContext(WaxContext); diff --git a/wax-prosemirror-components/src/components/UndoRedoButton.js b/wax-prosemirror-components/src/components/UndoRedoButton.js index 834b053ff3cacc0b0b0cd1ddf8eed7ca5ad88388..5b4ca8563028bf8622bbc1e286d7929893578a16 100644 --- a/wax-prosemirror-components/src/components/UndoRedoButton.js +++ b/wax-prosemirror-components/src/components/UndoRedoButton.js @@ -7,7 +7,7 @@ const UndoRedoButton = ({ view = {}, item }) => { const { active, icon, label, run, select, title } = item; const { - view: { main }, + pmViews: { main }, activeViewId, activeView, } = useContext(WaxContext); diff --git a/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js b/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js index 1dd8c1f5fe74ccbc391079a99d56f0e47a70a3d5..bb0c95d1331ce0ccc25724d04badd4fa6ed219ba 100644 --- a/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js +++ b/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js @@ -12,6 +12,7 @@ const CommentBubbleComponent = ({ }) => { const { activeView, activeViewId } = useContext(WaxContext); const { state, dispatch } = activeView; + useLayoutEffect(() => { const WaxSurface = activeView.dom.getBoundingClientRect(); const { selection } = activeView.state; diff --git a/wax-prosemirror-components/src/components/comments/ConnectedComment.js b/wax-prosemirror-components/src/components/comments/ConnectedComment.js index 03aee95c09023c2bfc2f0067d4d0fc320db67a83..82b40920034516da72f1b694ab788ab4484bee5f 100644 --- a/wax-prosemirror-components/src/components/comments/ConnectedComment.js +++ b/wax-prosemirror-components/src/components/comments/ConnectedComment.js @@ -19,8 +19,8 @@ const ConnectedCommentStyled = styled.div` export default ({ comment, top, commentId, recalculateTops }) => { const context = useContext(WaxContext); const { - view, - view: { + pmViews, + pmViews: { main: { props: { user }, }, @@ -36,9 +36,9 @@ export default ({ comment, top, commentId, recalculateTops }) => { const viewId = comment.attrs.viewid; let allCommentsWithSameId = []; - if (view[viewId]) { + if (pmViews[viewId]) { allCommentsWithSameId = DocumentHelpers.findAllMarksWithSameId( - view[viewId].state, + pmViews[viewId].state, comment, ); } @@ -94,7 +94,7 @@ export default ({ comment, top, commentId, recalculateTops }) => { const onClickBox = () => { if (isActive) { - view[viewId].focus(); + pmViews[viewId].focus(); return false; } @@ -103,13 +103,13 @@ export default ({ comment, top, commentId, recalculateTops }) => { const maxPos = maxBy(allCommentsWithSameId, 'pos'); maxPos.pos += last(allCommentsWithSameId).node.nodeSize; - view[viewId].dispatch( - view[viewId].state.tr.setSelection( - new TextSelection(view[viewId].state.tr.doc.resolve(maxPos.pos)), + pmViews[viewId].dispatch( + pmViews[viewId].state.tr.setSelection( + new TextSelection(pmViews[viewId].state.tr.doc.resolve(maxPos.pos)), ), ); - view[viewId].focus(); + pmViews[viewId].focus(); return true; }; diff --git a/wax-prosemirror-components/src/components/customtag/CustomTagBlockComponent.js b/wax-prosemirror-components/src/components/customtag/CustomTagBlockComponent.js index 4fd430a83f9045dfba02b0a224ca7aa25d6c0989..2e1ddd8e915874880e63976d29728de4f4c39c11 100644 --- a/wax-prosemirror-components/src/components/customtag/CustomTagBlockComponent.js +++ b/wax-prosemirror-components/src/components/customtag/CustomTagBlockComponent.js @@ -74,12 +74,12 @@ const CustomTagBlockComponent = ({ isShowTag, item }) => { const { app, - view: { main }, + pmViews: { main }, activeView, activeViewId, } = useContext(WaxContext); - const { state, dispatch } = main; + const { state } = main; const { $from } = state.selection; const className = $from.parent.attrs.class ? $from.parent.attrs.class : ''; diff --git a/wax-prosemirror-components/src/components/customtag/CustomTagInlineComponent.js b/wax-prosemirror-components/src/components/customtag/CustomTagInlineComponent.js index a75341ccc23bd4a3410ef853a3e07344fa077676..e85a8ee4bfe1f7d7597a42ef3dfe24880e14b5ea 100644 --- a/wax-prosemirror-components/src/components/customtag/CustomTagInlineComponent.js +++ b/wax-prosemirror-components/src/components/customtag/CustomTagInlineComponent.js @@ -19,13 +19,14 @@ const CustomTagInlineComponent = ({ view: { state }, item }) => { ); const { - view: { main }, + pmViews: { main }, } = useContext(WaxContext); let isDisabled = false; const isEditable = main.props.editable(editable => { return editable; }); + if (!isEditable) isDisabled = true; const onClickIcon = () => { diff --git a/wax-prosemirror-components/src/components/customtag/CustomTagInlineOverlayCompoment.js b/wax-prosemirror-components/src/components/customtag/CustomTagInlineOverlayCompoment.js index 8b0190dd5f25c3bfc795ec1d99b6e027e397666d..61ff08bc318d4947018c03511532c79cdb0d2698 100644 --- a/wax-prosemirror-components/src/components/customtag/CustomTagInlineOverlayCompoment.js +++ b/wax-prosemirror-components/src/components/customtag/CustomTagInlineOverlayCompoment.js @@ -91,7 +91,7 @@ const CustomTagInlineOverlayComponent = ({ mark, setPosition, position }) => { const { app, - view: { main }, + pmViews: { main }, } = useContext(WaxContext); const { state, dispatch } = main; const { diff --git a/wax-prosemirror-components/src/components/editingSuggesting/EditingSuggestingDropDown.js b/wax-prosemirror-components/src/components/editingSuggesting/EditingSuggestingDropDown.js index 0713631b9c6ca559694de7403b87259a3569d00a..f939fcee8f6418a141b7ab4c40b10240e1aa304b 100644 --- a/wax-prosemirror-components/src/components/editingSuggesting/EditingSuggestingDropDown.js +++ b/wax-prosemirror-components/src/components/editingSuggesting/EditingSuggestingDropDown.js @@ -80,11 +80,11 @@ const dropDownOptions = [ ]; const EditingSuggesting = ({ view: { dispatch, state }, item }) => { - const { app, activeView, view } = useContext(WaxContext); + const { app, activeView, pmViews } = useContext(WaxContext); const enableService = app.config.get('config.EnableTrackChangeService'); const isDisabled = enableService.toggle; - const isEditable = view.main.props.editable(editable => { + const isEditable = pmViews.main.props.editable(editable => { return editable; }); diff --git a/wax-prosemirror-components/src/components/findAndReplace/ExpandedFindAndReplaceComponent.js b/wax-prosemirror-components/src/components/findAndReplace/ExpandedFindAndReplaceComponent.js index d5f2f5b3649af1210f1b944aa96ba2fed4e1177b..cb908ed4d9a3f740c3c0919cd0e8c0a06d5adcf9 100644 --- a/wax-prosemirror-components/src/components/findAndReplace/ExpandedFindAndReplaceComponent.js +++ b/wax-prosemirror-components/src/components/findAndReplace/ExpandedFindAndReplaceComponent.js @@ -144,7 +144,7 @@ const ExpandedFindAndReplaceComponent = ({ nonExpandedText, setMatchCaseValue, }) => { - const { app, view, activeViewId } = useContext(WaxContext); + const { app, pmViews, activeViewId } = useContext(WaxContext); const searchRef = useRef(null); const replaceRef = useRef(null); const [searchValue, setSearchValue] = useState(nonExpandedText); @@ -156,7 +156,7 @@ const ExpandedFindAndReplaceComponent = ({ const allStates = []; - each(view, (singleView, viewId) => { + each(pmViews, (singleView, viewId) => { allStates.push(singleView.state); }); @@ -174,7 +174,7 @@ const ExpandedFindAndReplaceComponent = ({ useEffect(() => { searchDocument(); let counter = 0; - counter = helpers.getMatchesByView(view, searchValue, matchCaseSearch); + counter = helpers.getMatchesByView(pmViews, searchValue, matchCaseSearch); setCounterSearches(counter); }, [debouncedSearchTerm, matchCaseSearch, JSON.stringify(allStates)]); @@ -186,10 +186,10 @@ const ExpandedFindAndReplaceComponent = ({ state: { selection: { from, to }, }, - } = view[activeViewId]; + } = pmViews[activeViewId]; const results = helpers.getAllResultsByView( - view, + pmViews, searchValue, matchCaseSearch, ); @@ -206,7 +206,7 @@ const ExpandedFindAndReplaceComponent = ({ } } else { if (resultsFrom.main) counterMatch = resultsFrom.main.length; - const notesIds = helpers.getNotesIds(view.main); + const notesIds = helpers.getNotesIds(pmViews.main); for (let i = 0; i < notesIds.length; i += 1) { if (resultsFrom[notesIds[i]] && activeViewId !== notesIds[i]) { @@ -236,7 +236,7 @@ const ExpandedFindAndReplaceComponent = ({ // setCounterSearches(counter); if (searchRef.current === document.activeElement) { - eachRight(view, (singleView, viewId) => { + eachRight(pmViews, (singleView, viewId) => { singleView.dispatch(singleView.state.tr); }); } @@ -249,15 +249,15 @@ const ExpandedFindAndReplaceComponent = ({ const replace = () => { if (match.length === 1) { const { from, to } = match[0]; - view[activeViewId].dispatch( - view[activeViewId].state.tr.insertText(replaceValue, from, to), + pmViews[activeViewId].dispatch( + pmViews[activeViewId].state.tr.insertText(replaceValue, from, to), ); findNextMatch(searchValue, matchCaseOption); } }; const replaceAll = () => { - each(view, (singleView, viewId) => { + each(pmViews, (singleView, viewId) => { const results = DocumentHelpers.findMatches( singleView.state.doc, searchValue, @@ -275,7 +275,7 @@ const ExpandedFindAndReplaceComponent = ({ const closeFind = () => { findAndReplacePlugin.props.setSearchText(''); - each(view, (singleView, viewId) => { + each(pmViews, (singleView, viewId) => { singleView.dispatch(singleView.state.tr); }); close(); @@ -300,8 +300,8 @@ const ExpandedFindAndReplaceComponent = ({ <InputWrapper> <FindReplaceInput - onChange={onChangeSearchInput} id="search-input" + onChange={onChangeSearchInput} placeholder="Something is this doc" ref={searchRef} type="text" diff --git a/wax-prosemirror-components/src/components/findAndReplace/FindAndReplaceComponent.js b/wax-prosemirror-components/src/components/findAndReplace/FindAndReplaceComponent.js index d9e4267489cfb29ef88b5d0ecb89e99757dd798a..b8f2429d1902241536aa583d3470648608ae02f4 100644 --- a/wax-prosemirror-components/src/components/findAndReplace/FindAndReplaceComponent.js +++ b/wax-prosemirror-components/src/components/findAndReplace/FindAndReplaceComponent.js @@ -10,7 +10,7 @@ let lastActiveViewId; let lastSelection; const FindAndReplaceComponent = ({ close }) => { - const { view, activeViewId } = useContext(WaxContext); + const { pmViews, activeViewId } = useContext(WaxContext); const [isExpanded, setExpanded] = useState(false); const [nonExpandedText, setNonExpandedText] = useState(''); const [matchCaseOption, setMatchCaseOption] = useState(false); @@ -27,8 +27,8 @@ const FindAndReplaceComponent = ({ close }) => { }; useEffect(() => { - if (view[activeViewId].state.selection.from !== 0) { - lastSelection = view[activeViewId].state.selection; + if (pmViews[activeViewId].state.selection.from !== 0) { + lastSelection = pmViews[activeViewId].state.selection; lastActiveViewId = activeViewId; } }, []); @@ -36,10 +36,10 @@ const FindAndReplaceComponent = ({ close }) => { const nextInNotes = (notesIds, results, findViewWithMatches) => { for (let i = 0; i < notesIds.length; i += 1) { if (results[notesIds[i]].length > 0 && notesIds[i] !== lastActiveViewId) { - helpers.clearViewSelection(view, lastActiveViewId); - helpers.moveToMatch(view, notesIds[i], results, 0); + helpers.clearViewSelection(pmViews, lastActiveViewId); + helpers.moveToMatch(pmViews, notesIds[i], results, 0); lastActiveViewId = findViewWithMatches; - lastSelection = view[lastActiveViewId].state.selection; + lastSelection = pmViews[lastActiveViewId].state.selection; break; } @@ -47,40 +47,42 @@ const FindAndReplaceComponent = ({ close }) => { }; const findNextMatch = (searchValue, matchCaseSearch) => { - if (!view[activeViewId].focused) view[activeViewId].focus(); + if (!pmViews[activeViewId].focused) pmViews[activeViewId].focus(); const counter = helpers.getMatchesByView( - view, + pmViews, searchValue, matchCaseSearch, ); if (counter === 0) return; lastActiveViewId = activeViewId; - lastSelection = view[activeViewId].state.selection; + lastSelection = pmViews[activeViewId].state.selection; const results = helpers.getAllResultsByView( - view, + pmViews, searchValue, matchCaseSearch, ); const resultsFrom = helpers.getResultsFrom(results); - const notesIds = helpers.getNotesIds(view.main); + const notesIds = helpers.getNotesIds(pmViews.main); const findViewWithMatches = helpers.findViewWithMatchesForward( results, - view, + pmViews, lastActiveViewId, ); /* if no matches are found on focused view */ if (!resultsFrom[lastActiveViewId]) { - view[findViewWithMatches].dispatch( - view[findViewWithMatches].state.tr.setSelection( - new TextSelection(view[findViewWithMatches].state.tr.doc.resolve(0)), + pmViews[findViewWithMatches].dispatch( + pmViews[findViewWithMatches].state.tr.setSelection( + new TextSelection( + pmViews[findViewWithMatches].state.tr.doc.resolve(0), + ), ), ); - view[findViewWithMatches].focus(); + pmViews[findViewWithMatches].focus(); lastActiveViewId = findViewWithMatches; - lastSelection = view[lastActiveViewId].state.selection; + lastSelection = pmViews[lastActiveViewId].state.selection; } const found = helpers.getClosestMatch( @@ -91,14 +93,14 @@ const FindAndReplaceComponent = ({ close }) => { const position = resultsFrom[lastActiveViewId].indexOf(found); /* User selection lesser than found */ if (lastSelection.from < found) { - helpers.moveToMatch(view, lastActiveViewId, results, position); + helpers.moveToMatch(pmViews, lastActiveViewId, results, position); } /* User selection greater than found move to next if not already at the end of results for the view */ if ( lastSelection.from >= found && position < resultsFrom[lastActiveViewId].length - 1 ) { - helpers.moveToMatch(view, lastActiveViewId, results, position + 1); + helpers.moveToMatch(pmViews, lastActiveViewId, results, position + 1); } /* Last result of the specific view. Move to next view */ @@ -115,10 +117,10 @@ const FindAndReplaceComponent = ({ close }) => { ) { setTimeout(() => { lastActiveViewId = findViewWithMatches; - lastSelection = view[lastActiveViewId].state.selection; + lastSelection = pmViews[lastActiveViewId].state.selection; }, 50); - helpers.moveToMatch(view, 'main', results, 0); - helpers.clearViewSelection(view, lastActiveViewId); + helpers.moveToMatch(pmViews, 'main', results, 0); + helpers.clearViewSelection(pmViews, lastActiveViewId); } else { nextInNotes(notesIds, results, findViewWithMatches); } @@ -126,45 +128,45 @@ const FindAndReplaceComponent = ({ close }) => { }; const findPreviousMatch = (searchValue, matchCaseSearch) => { - if (!view[activeViewId].focused) view[activeViewId].focus(); + if (!pmViews[activeViewId].focused) pmViews[activeViewId].focus(); const counter = helpers.getMatchesByView( - view, + pmViews, searchValue, matchCaseSearch, ); if (counter === 0) return; lastActiveViewId = activeViewId; - lastSelection = view[activeViewId].state.selection; + lastSelection = pmViews[activeViewId].state.selection; const results = helpers.getAllResultsByView( - view, + pmViews, searchValue, matchCaseSearch, ); const resultsFrom = helpers.getResultsFrom(results); - const notesIds = helpers.getNotesIds(view.main); + const notesIds = helpers.getNotesIds(pmViews.main); const findViewWithMatches = helpers.findViewWithMatchesBackWards( results, - view, + pmViews, lastActiveViewId, ); /* if no matches are found on focused view */ if (!resultsFrom[lastActiveViewId]) { - view[findViewWithMatches].dispatch( - view[findViewWithMatches].state.tr.setSelection( + pmViews[findViewWithMatches].dispatch( + pmViews[findViewWithMatches].state.tr.setSelection( new TextSelection( - view[findViewWithMatches].state.tr.doc.resolve( - view[findViewWithMatches].state.doc.content.size, + pmViews[findViewWithMatches].state.tr.doc.resolve( + pmViews[findViewWithMatches].state.doc.content.size, ), ), ), ); - view[findViewWithMatches].focus(); + pmViews[findViewWithMatches].focus(); lastActiveViewId = findViewWithMatches; - lastSelection = view[lastActiveViewId].state.selection; + lastSelection = pmViews[lastActiveViewId].state.selection; } const found = helpers.getClosestMatch( @@ -177,11 +179,11 @@ const FindAndReplaceComponent = ({ close }) => { /* User selection lesser than found */ if (lastSelection.from > found) { - helpers.moveToMatch(view, lastActiveViewId, results, position); + helpers.moveToMatch(pmViews, lastActiveViewId, results, position); } if (lastSelection.from <= found && position !== 0) { - helpers.moveToMatch(view, lastActiveViewId, results, position - 1); + helpers.moveToMatch(pmViews, lastActiveViewId, results, position - 1); } if (lastSelection.from === found && position === 0) { @@ -192,14 +194,14 @@ const FindAndReplaceComponent = ({ close }) => { notesIds[i] !== lastActiveViewId ) { helpers.moveToMatch( - view, + pmViews, notesIds[i], results, results[notesIds[i]].length - 1, ); - lastSelection = view[activeViewId].state.selection; + lastSelection = pmViews[activeViewId].state.selection; lastActiveViewId = activeViewId; - helpers.clearViewSelection(view, lastActiveViewId); + helpers.clearViewSelection(pmViews, lastActiveViewId); break; } } @@ -213,14 +215,14 @@ const FindAndReplaceComponent = ({ close }) => { notesIds[i] !== lastActiveViewId ) { helpers.moveToMatch( - view, + pmViews, notesIds[i], results, results[notesIds[i]].length - 1, ); - lastSelection = view[activeViewId].state.selection; + lastSelection = pmViews[activeViewId].state.selection; lastActiveViewId = activeViewId; - helpers.clearViewSelection(view, lastActiveViewId); + helpers.clearViewSelection(pmViews, lastActiveViewId); break; } else { console.log('go to main', lastActiveViewId); diff --git a/wax-prosemirror-components/src/components/findAndReplace/FindAndReplaceTool.js b/wax-prosemirror-components/src/components/findAndReplace/FindAndReplaceTool.js index 943ab6f67075dca2f2e8323af65a03bd3a29d4f6..6d0a332de8efe83bb066bc8b8c7ffc16fc0a938c 100644 --- a/wax-prosemirror-components/src/components/findAndReplace/FindAndReplaceTool.js +++ b/wax-prosemirror-components/src/components/findAndReplace/FindAndReplaceTool.js @@ -28,7 +28,7 @@ const DropWrapper = styled.div` const FindAndReplaceTool = ({ view = {}, item }) => { const { - view: { main }, + pmViews: { main }, } = useContext(WaxContext); const { icon, title } = item; diff --git a/wax-prosemirror-components/src/components/findAndReplace/FindComponent.js b/wax-prosemirror-components/src/components/findAndReplace/FindComponent.js index 2a7b421c6b25b049627aaeff7967f4a875e97695..3cfb5597a1d8e7193cbe837f32efc4b80603aa45 100644 --- a/wax-prosemirror-components/src/components/findAndReplace/FindComponent.js +++ b/wax-prosemirror-components/src/components/findAndReplace/FindComponent.js @@ -103,7 +103,7 @@ const FindComponent = ({ findNextMatch, findPreviousMatch, }) => { - const { app, view, activeViewId } = useContext(WaxContext); + const { app, pmViews, activeViewId } = useContext(WaxContext); const searchRef = useRef(null); const [searchValue, setSearchValue] = useState(''); @@ -116,7 +116,7 @@ const FindComponent = ({ const debouncedSearchTerm = useDebounce(searchValue, 300); - each(view, (singleView, viewId) => { + each(pmViews, (singleView, viewId) => { allStates.push(singleView.state); }); @@ -142,10 +142,10 @@ const FindComponent = ({ state: { selection: { from, to }, }, - } = view[activeViewId]; + } = pmViews[activeViewId]; const results = helpers.getAllResultsByView( - view, + pmViews, searchValue, matchCaseSearch, ); @@ -161,7 +161,7 @@ const FindComponent = ({ } } else { if (resultsFrom.main) counterMatch = resultsFrom.main.length; - const notesIds = helpers.getNotesIds(view.main); + const notesIds = helpers.getNotesIds(pmViews.main); for (let i = 0; i < notesIds.length; i += 1) { if (resultsFrom[notesIds[i]] && activeViewId !== notesIds[i]) { @@ -187,12 +187,12 @@ const FindComponent = ({ findAndReplacePlugin.props.setSearchText(searchValue); findAndReplacePlugin.props.setSearchMatchCase(matchCaseSearch); - counter = helpers.getMatchesByView(view, searchValue, matchCaseSearch); + counter = helpers.getMatchesByView(pmViews, searchValue, matchCaseSearch); setCounterSearches(counter); if (searchRef.current === document.activeElement) { - eachRight(view, (singleView, viewId) => { + eachRight(pmViews, (singleView, viewId) => { singleView.dispatch(singleView.state.tr); }); } @@ -200,7 +200,7 @@ const FindComponent = ({ const closeFind = () => { findAndReplacePlugin.props.setSearchText(''); - each(view, (singleView, viewId) => { + each(pmViews, (singleView, viewId) => { singleView.dispatch(singleView.state.tr); }); close(); diff --git a/wax-prosemirror-components/src/components/images/ImageUpload.js b/wax-prosemirror-components/src/components/images/ImageUpload.js index 3b4edd6c15d892de15063ba9109afd9abb4355e1..ced0b167c948e3d8618f233c878520d991f7f340 100644 --- a/wax-prosemirror-components/src/components/images/ImageUpload.js +++ b/wax-prosemirror-components/src/components/images/ImageUpload.js @@ -19,7 +19,7 @@ const ImageUpload = ({ item, fileUpload, view }) => { app, activeView, activeViewId, - view: { main }, + pmViews: { main }, } = context; const inputRef = useRef(null); diff --git a/wax-prosemirror-components/src/components/rightArea/RightArea.js b/wax-prosemirror-components/src/components/rightArea/RightArea.js index 9fcbe9529f6c8c6bcc98752b9192aed0c2dab82f..c852b700efd6145cf15e3bf20385b691c78dabc1 100644 --- a/wax-prosemirror-components/src/components/rightArea/RightArea.js +++ b/wax-prosemirror-components/src/components/rightArea/RightArea.js @@ -9,11 +9,12 @@ import BoxList from './BoxList'; export default ({ area }) => { const { - view, - view: { main }, + pmViews, + pmViews: { main }, app, activeView, } = useContext(WaxContext); + const commentPlugin = app.PmPlugins.get('commentPlugin'); const trakChangePlugin = app.PmPlugins.get('trackChangePlugin'); @@ -147,7 +148,7 @@ export default ({ area }) => { }; useDeepCompareEffect(() => { - setMarksNodes(updateMarks(view)); + setMarksNodes(updateMarks(pmViews)); if (isFirstRun) { setTimeout(() => { setPosition(setTops()); @@ -156,16 +157,16 @@ export default ({ area }) => { } else { setPosition(setTops()); } - }, [updateMarks(view), setTops()]); + }, [updateMarks(pmViews), setTops()]); const CommentTrackComponent = useMemo( () => ( <BoxList - commentsTracks={marksNodes[area] || []} area={area} - view={main} + commentsTracks={marksNodes[area] || []} position={position} recalculateTops={recalculateTops} + view={main} /> ), [marksNodes[area] || [], position], @@ -173,17 +174,17 @@ export default ({ area }) => { return <>{CommentTrackComponent}</>; }; -const updateMarks = view => { - if (view.main) { +const updateMarks = views => { + if (views.main) { const allInlineNodes = []; - Object.keys(view).forEach(eachView => { + Object.keys(views).forEach(eachView => { allInlineNodes.push( - ...DocumentHelpers.findInlineNodes(view[eachView].state.doc), + ...DocumentHelpers.findInlineNodes(views[eachView].state.doc), ); }); - const allBlockNodes = DocumentHelpers.findBlockNodes(view.main.state.doc); + const allBlockNodes = DocumentHelpers.findBlockNodes(views.main.state.doc); const finalMarks = []; const finalNodes = []; diff --git a/wax-prosemirror-components/src/components/specialCharacters/CharactersList.js b/wax-prosemirror-components/src/components/specialCharacters/CharactersList.js index 4beef78f7371d5a817a31171817c11df8f58b89b..4bd2201eaa66dcd54cf33b709567f7dd1c93765d 100644 --- a/wax-prosemirror-components/src/components/specialCharacters/CharactersList.js +++ b/wax-prosemirror-components/src/components/specialCharacters/CharactersList.js @@ -1,315 +1,1058 @@ -export default -[ - { unicode: '\u00C0', name: 'Latin Capital Letter A with grave', group: 'Vowels' }, - { unicode: '\u00E0', name: 'Latin Small Letter A with grave', group: 'Vowels' }, - { unicode: '\u00C1', name: 'Latin Capital letter A with acute', group: 'Vowels' }, - { unicode: '\u00E1', name: 'Latin Small Letter A with acute', group: 'Vowels' }, - { unicode: '\u00C2', name: 'Latin Capital letter A with circumflex', group: 'Vowels' }, - { unicode: '\u00E2', name: 'Latin Small Letter A with circumflex', group: 'Vowels' }, - { unicode: '\u00C4', name: 'Latin Capital letter A with diaeresis', group: 'Vowels' }, - { unicode: '\u00E4', name: 'Latin Small Letter A with diaeresis', group: 'Vowels' }, - { unicode: '\u00C3', name: 'Latin Capital letter A with tilde', group: 'Vowels' }, - { unicode: '\u00E3', name: 'Latin Small Letter A with tilde', group: 'Vowels' }, - { unicode: '\u00C5', name: 'Latin Capital letter A with ring above', group: 'Vowels' }, - { unicode: '\u00E5', name: 'Latin Small Letter A with ring above', group: 'Vowels' }, - { unicode: '\u00C6', name: 'Latin Capital letter AE', group: 'Vowels' }, - { unicode: '\u00E6', name: 'Latin Small Letter AE', group: 'Vowels' }, - { unicode: '\u0100', name: 'Latin Capital Letter A with macron', group: 'Vowels' }, - { unicode: '\u0101', name: 'Latin Small Letter A with macron', group: 'Vowels' }, - { unicode: '\u01CD', name: 'Latin Capital Letter A with caron', group: 'Vowels' }, - { unicode: '\u01CE', name: 'Latin Small Letter A with caron', group: 'Vowels' }, - { unicode: '\u0104', name: 'Latin Capital Letter A with ogonek', group: 'Vowels' }, - { unicode: '\u0105', name: 'Latin Small Letter A with ogonek', group: 'Vowels' }, - // { unicode: '\u0102', name: 'Latin Capital Letter A with breve', group: 'Vowels' }, - // { unicode: '\u0103', name: 'Latin Small Letter A with breve', group: 'Vowels' }, +export default [ + { + unicode: '\u00C0', + name: 'Latin Capital Letter A with grave', + group: 'Vowels', + }, + { + unicode: '\u00E0', + name: 'Latin Small Letter A with grave', + group: 'Vowels', + }, + { + unicode: '\u00C1', + name: 'Latin Capital letter A with acute', + group: 'Vowels', + }, + { + unicode: '\u00E1', + name: 'Latin Small Letter A with acute', + group: 'Vowels', + }, + { + unicode: '\u00C2', + name: 'Latin Capital letter A with circumflex', + group: 'Vowels', + }, + { + unicode: '\u00E2', + name: 'Latin Small Letter A with circumflex', + group: 'Vowels', + }, + { + unicode: '\u00C4', + name: 'Latin Capital letter A with diaeresis', + group: 'Vowels', + }, + { + unicode: '\u00E4', + name: 'Latin Small Letter A with diaeresis', + group: 'Vowels', + }, + { + unicode: '\u00C3', + name: 'Latin Capital letter A with tilde', + group: 'Vowels', + }, + { + unicode: '\u00E3', + name: 'Latin Small Letter A with tilde', + group: 'Vowels', + }, + { + unicode: '\u00C5', + name: 'Latin Capital letter A with ring above', + group: 'Vowels', + }, + { + unicode: '\u00E5', + name: 'Latin Small Letter A with ring above', + group: 'Vowels', + }, + { unicode: '\u00C6', name: 'Latin Capital letter AE', group: 'Vowels' }, + { unicode: '\u00E6', name: 'Latin Small Letter AE', group: 'Vowels' }, + { + unicode: '\u0100', + name: 'Latin Capital Letter A with macron', + group: 'Vowels', + }, + { + unicode: '\u0101', + name: 'Latin Small Letter A with macron', + group: 'Vowels', + }, + { + unicode: '\u01CD', + name: 'Latin Capital Letter A with caron', + group: 'Vowels', + }, + { + unicode: '\u01CE', + name: 'Latin Small Letter A with caron', + group: 'Vowels', + }, + { + unicode: '\u0104', + name: 'Latin Capital Letter A with ogonek', + group: 'Vowels', + }, + { + unicode: '\u0105', + name: 'Latin Small Letter A with ogonek', + group: 'Vowels', + }, + // { unicode: '\u0102', name: 'Latin Capital Letter A with breve', group: 'Vowels' }, + // { unicode: '\u0103', name: 'Latin Small Letter A with breve', group: 'Vowels' }, - { unicode: '\u00C8', name: 'Latin Capital letter E with grave', group: 'Vowels' }, - { unicode: '\u00E8', name: 'Latin Small Letter E with grave', group: 'Vowels' }, - { unicode: '\u00C9', name: 'Latin Capital Letter E with acute', group: 'Vowels' }, - { unicode: '\u00E9', name: 'Latin Small Letter E with acute', group: 'Vowels' }, - { unicode: '\u00CA', name: 'Latin Capital letter E with circumflex', group: 'Vowels' }, - { unicode: '\u00EA', name: 'Latin Small Letter E with circumflex', group: 'Vowels' }, - { unicode: '\u00CB', name: 'Latin Capital Letter E with diaeresis', group: 'Vowels' }, - { unicode: '\u00EB', name: 'Latin Small Letter E with diaeresis', group: 'Vowels' }, - { unicode: '\u0112', name: 'Latin Capital Letter E with macron', group: 'Vowels' }, - { unicode: '\u0113', name: 'Latin Small Letter E with macron', group: 'Vowels' }, - { unicode: '\u011A', name: 'Latin Capital Letter E with caron', group: 'Vowels' }, - { unicode: '\u011B', name: 'Latin Small Letter E with caron', group: 'Vowels' }, - { unicode: '\u0118', name: 'Latin Capital Letter E with ogonek', group: 'Vowels' }, - { unicode: '\u0119', name: 'Latin Small Letter E with ogonek', group: 'Vowels' }, - // { unicode: '\u0114', name: 'Latin Capital Letter E with breve', group: 'Vowels' }, - // { unicode: '\u0115', name: 'Latin Small Letter E with breve', group: 'Vowels' }, - // { unicode: '\u0116', name: 'Latin Capital Letter E with dot above', group: 'Vowels' }, - // { unicode: '\u0117', name: 'Latin Small Letter E with dot above', group: 'Vowels' }, + { + unicode: '\u00C8', + name: 'Latin Capital letter E with grave', + group: 'Vowels', + }, + { + unicode: '\u00E8', + name: 'Latin Small Letter E with grave', + group: 'Vowels', + }, + { + unicode: '\u00C9', + name: 'Latin Capital Letter E with acute', + group: 'Vowels', + }, + { + unicode: '\u00E9', + name: 'Latin Small Letter E with acute', + group: 'Vowels', + }, + { + unicode: '\u00CA', + name: 'Latin Capital letter E with circumflex', + group: 'Vowels', + }, + { + unicode: '\u00EA', + name: 'Latin Small Letter E with circumflex', + group: 'Vowels', + }, + { + unicode: '\u00CB', + name: 'Latin Capital Letter E with diaeresis', + group: 'Vowels', + }, + { + unicode: '\u00EB', + name: 'Latin Small Letter E with diaeresis', + group: 'Vowels', + }, + { + unicode: '\u0112', + name: 'Latin Capital Letter E with macron', + group: 'Vowels', + }, + { + unicode: '\u0113', + name: 'Latin Small Letter E with macron', + group: 'Vowels', + }, + { + unicode: '\u011A', + name: 'Latin Capital Letter E with caron', + group: 'Vowels', + }, + { + unicode: '\u011B', + name: 'Latin Small Letter E with caron', + group: 'Vowels', + }, + { + unicode: '\u0118', + name: 'Latin Capital Letter E with ogonek', + group: 'Vowels', + }, + { + unicode: '\u0119', + name: 'Latin Small Letter E with ogonek', + group: 'Vowels', + }, + // { unicode: '\u0114', name: 'Latin Capital Letter E with breve', group: 'Vowels' }, + // { unicode: '\u0115', name: 'Latin Small Letter E with breve', group: 'Vowels' }, + // { unicode: '\u0116', name: 'Latin Capital Letter E with dot above', group: 'Vowels' }, + // { unicode: '\u0117', name: 'Latin Small Letter E with dot above', group: 'Vowels' }, - { unicode: '\u00CC', name: 'Latin Capital letter I with grave', group: 'Vowels' }, - { unicode: '\u00EC', name: 'Latin Small letter I with grave', group: 'Vowels' }, - { unicode: '\u00CD', name: 'Latin Capital letter I with acute', group: 'Vowels' }, - { unicode: '\u00ED', name: 'Latin Small letter I with acute', group: 'Vowels' }, - { unicode: '\u00CE', name: 'Latin Capital Letter I with circumflex', group: 'Vowels' }, - { unicode: '\u00EE', name: 'Latin Small Letter I with circumflex', group: 'Vowels' }, - { unicode: '\u00CF', name: 'Latin Capital letter I with diaeresis', group: 'Vowels' }, - { unicode: '\u00EF', name: 'Latin Small Letter I with diaeresis', group: 'Vowels' }, - { unicode: '\u012A', name: 'Latin Capital Letter I with macron', group: 'Vowels' }, - { unicode: '\u012B', name: 'Latin Small Letter I with macron', group: 'Vowels' }, - { unicode: '\u01CF', name: 'Latin Capital Letter I with caron', group: 'Vowels' }, - { unicode: '\u01D0', name: 'Latin Small Letter I with caron', group: 'Vowels' }, - { unicode: '\u0130', name: 'Latin Capital Letter I with dot above', group: 'Vowels' }, - { unicode: '\u0131', name: 'Latin Small Letter dotless I', group: 'Vowels' }, + { + unicode: '\u00CC', + name: 'Latin Capital letter I with grave', + group: 'Vowels', + }, + { + unicode: '\u00EC', + name: 'Latin Small letter I with grave', + group: 'Vowels', + }, + { + unicode: '\u00CD', + name: 'Latin Capital letter I with acute', + group: 'Vowels', + }, + { + unicode: '\u00ED', + name: 'Latin Small letter I with acute', + group: 'Vowels', + }, + { + unicode: '\u00CE', + name: 'Latin Capital Letter I with circumflex', + group: 'Vowels', + }, + { + unicode: '\u00EE', + name: 'Latin Small Letter I with circumflex', + group: 'Vowels', + }, + { + unicode: '\u00CF', + name: 'Latin Capital letter I with diaeresis', + group: 'Vowels', + }, + { + unicode: '\u00EF', + name: 'Latin Small Letter I with diaeresis', + group: 'Vowels', + }, + { + unicode: '\u012A', + name: 'Latin Capital Letter I with macron', + group: 'Vowels', + }, + { + unicode: '\u012B', + name: 'Latin Small Letter I with macron', + group: 'Vowels', + }, + { + unicode: '\u01CF', + name: 'Latin Capital Letter I with caron', + group: 'Vowels', + }, + { + unicode: '\u01D0', + name: 'Latin Small Letter I with caron', + group: 'Vowels', + }, + { + unicode: '\u0130', + name: 'Latin Capital Letter I with dot above', + group: 'Vowels', + }, + { unicode: '\u0131', name: 'Latin Small Letter dotless I', group: 'Vowels' }, - { unicode: '\u00D2', name: 'Latin Capital letter O with grave', group: 'Vowels' }, - { unicode: '\u00F2', name: 'Latin Small Letter O with grave', group: 'Vowels' }, - { unicode: '\u00D3', name: 'Latin Capital letter O with acute', group: 'Vowels' }, - { unicode: '\u00F3', name: 'Latin Small Letter O with acute', group: 'Vowels' }, - { unicode: '\u0150', name: 'Latin Capital Letter O with double acute', group: 'Vowels' }, - { unicode: '\u0151', name: 'Latin Small Letter O with double acute', group: 'Vowels' }, - { unicode: '\u00D8', name: 'Latin Capital letter O with stroke', group: 'Vowels' }, - { unicode: '\u00F8', name: 'Latin Small Letter O with stroke', group: 'Vowels' }, - { unicode: '\u00D4', name: 'Latin Capital letter O with circumflex', group: 'Vowels' }, - { unicode: '\u00F4', name: 'Latin Small Letter O with circumflex', group: 'Vowels' }, - { unicode: '\u00D6', name: 'Latin Capital letter O with diaeresis', group: 'Vowels' }, - { unicode: '\u00F6', name: 'Latin Small Letter O with diaeresis', group: 'Vowels' }, - { unicode: '\u00D5', name: 'Latin Capital letter O with tilde', group: 'Vowels' }, - { unicode: '\u00F5', name: 'Latin Small Letter O with tilde', group: 'Vowels' }, - { unicode: '\u014C', name: 'Latin Capital Letter O with macron', group: 'Vowels' }, - { unicode: '\u014D', name: 'Latin Small Letter O with macron', group: 'Vowels' }, - { unicode: '\u01D1', name: 'Latin Capital Letter O with caron', group: 'Vowels' }, - { unicode: '\u01D2', name: 'Latin Small Letter O with caron', group: 'Vowels' }, - { unicode: '\u01EA', name: 'Latin Capital Letter O with ogonek', group: 'Vowels' }, - { unicode: '\u01EB', name: 'Latin Small Letter O with ogonek', group: 'Vowels' }, + { + unicode: '\u00D2', + name: 'Latin Capital letter O with grave', + group: 'Vowels', + }, + { + unicode: '\u00F2', + name: 'Latin Small Letter O with grave', + group: 'Vowels', + }, + { + unicode: '\u00D3', + name: 'Latin Capital letter O with acute', + group: 'Vowels', + }, + { + unicode: '\u00F3', + name: 'Latin Small Letter O with acute', + group: 'Vowels', + }, + { + unicode: '\u0150', + name: 'Latin Capital Letter O with double acute', + group: 'Vowels', + }, + { + unicode: '\u0151', + name: 'Latin Small Letter O with double acute', + group: 'Vowels', + }, + { + unicode: '\u00D8', + name: 'Latin Capital letter O with stroke', + group: 'Vowels', + }, + { + unicode: '\u00F8', + name: 'Latin Small Letter O with stroke', + group: 'Vowels', + }, + { + unicode: '\u00D4', + name: 'Latin Capital letter O with circumflex', + group: 'Vowels', + }, + { + unicode: '\u00F4', + name: 'Latin Small Letter O with circumflex', + group: 'Vowels', + }, + { + unicode: '\u00D6', + name: 'Latin Capital letter O with diaeresis', + group: 'Vowels', + }, + { + unicode: '\u00F6', + name: 'Latin Small Letter O with diaeresis', + group: 'Vowels', + }, + { + unicode: '\u00D5', + name: 'Latin Capital letter O with tilde', + group: 'Vowels', + }, + { + unicode: '\u00F5', + name: 'Latin Small Letter O with tilde', + group: 'Vowels', + }, + { + unicode: '\u014C', + name: 'Latin Capital Letter O with macron', + group: 'Vowels', + }, + { + unicode: '\u014D', + name: 'Latin Small Letter O with macron', + group: 'Vowels', + }, + { + unicode: '\u01D1', + name: 'Latin Capital Letter O with caron', + group: 'Vowels', + }, + { + unicode: '\u01D2', + name: 'Latin Small Letter O with caron', + group: 'Vowels', + }, + { + unicode: '\u01EA', + name: 'Latin Capital Letter O with ogonek', + group: 'Vowels', + }, + { + unicode: '\u01EB', + name: 'Latin Small Letter O with ogonek', + group: 'Vowels', + }, - { unicode: '\u0152', name: 'Latin Capital Ligature OE', group: 'Vowels' }, - { unicode: '\u0153', name: 'Latin Small Ligature OE', group: 'Vowels' }, - { unicode: '\u00D9', name: 'Latin Capital Letter U with grave', group: 'Vowels' }, - { unicode: '\u00F9', name: 'Latin Small Letter U with grave', group: 'Vowels' }, - { unicode: '\u00DA', name: 'Latin Capital Letter U with acute', group: 'Vowels' }, - { unicode: '\u00FA', name: 'Latin Small Letter U with acute', group: 'Vowels' }, - { unicode: '\u0170', name: 'Latin Capital Letter U with double acute', group: 'Vowels' }, - { unicode: '\u0171', name: 'Latin Small Letter U with double acute', group: 'Vowels' }, - { unicode: '\u00DB', name: 'Latin Capital Letter U with circumflex', group: 'Vowels' }, - { unicode: '\u00FB', name: 'Latin Small Letter U with circumflex', group: 'Vowels' }, - { unicode: '\u00DC', name: 'Latin Capital Letter U with diaeresis', group: 'Vowels' }, - { unicode: '\u00FC', name: 'Latin Small Letter U with diaeresis', group: 'Vowels' }, - { unicode: '\u016E', name: 'Latin Capital Letter U with ring above', group: 'Vowels' }, - { unicode: '\u016F', name: 'Latin Small Letter U with ring above', group: 'Vowels' }, - { unicode: '\u016A', name: 'Latin Capital Letter U with macron', group: 'Vowels' }, - { unicode: '\u016B', name: 'Latin Small Letter U with macron', group: 'Vowels' }, - { unicode: '\u01D3', name: 'Latin Capital Letter U with caron', group: 'Vowels' }, - { unicode: '\u01D4', name: 'Latin Small Letter U with caron', group: 'Vowels' }, - { unicode: '\u0172', name: 'Latin Capital Letter U with ogonek', group: 'Vowels' }, - { unicode: '\u0173', name: 'Latin Small Letter U with ogonek', group: 'Vowels' }, + { unicode: '\u0152', name: 'Latin Capital Ligature OE', group: 'Vowels' }, + { unicode: '\u0153', name: 'Latin Small Ligature OE', group: 'Vowels' }, + { + unicode: '\u00D9', + name: 'Latin Capital Letter U with grave', + group: 'Vowels', + }, + { + unicode: '\u00F9', + name: 'Latin Small Letter U with grave', + group: 'Vowels', + }, + { + unicode: '\u00DA', + name: 'Latin Capital Letter U with acute', + group: 'Vowels', + }, + { + unicode: '\u00FA', + name: 'Latin Small Letter U with acute', + group: 'Vowels', + }, + { + unicode: '\u0170', + name: 'Latin Capital Letter U with double acute', + group: 'Vowels', + }, + { + unicode: '\u0171', + name: 'Latin Small Letter U with double acute', + group: 'Vowels', + }, + { + unicode: '\u00DB', + name: 'Latin Capital Letter U with circumflex', + group: 'Vowels', + }, + { + unicode: '\u00FB', + name: 'Latin Small Letter U with circumflex', + group: 'Vowels', + }, + { + unicode: '\u00DC', + name: 'Latin Capital Letter U with diaeresis', + group: 'Vowels', + }, + { + unicode: '\u00FC', + name: 'Latin Small Letter U with diaeresis', + group: 'Vowels', + }, + { + unicode: '\u016E', + name: 'Latin Capital Letter U with ring above', + group: 'Vowels', + }, + { + unicode: '\u016F', + name: 'Latin Small Letter U with ring above', + group: 'Vowels', + }, + { + unicode: '\u016A', + name: 'Latin Capital Letter U with macron', + group: 'Vowels', + }, + { + unicode: '\u016B', + name: 'Latin Small Letter U with macron', + group: 'Vowels', + }, + { + unicode: '\u01D3', + name: 'Latin Capital Letter U with caron', + group: 'Vowels', + }, + { + unicode: '\u01D4', + name: 'Latin Small Letter U with caron', + group: 'Vowels', + }, + { + unicode: '\u0172', + name: 'Latin Capital Letter U with ogonek', + group: 'Vowels', + }, + { + unicode: '\u0173', + name: 'Latin Small Letter U with ogonek', + group: 'Vowels', + }, - { unicode: '\u00DD', name: 'Latin Capital Letter Y with acute', group: 'Vowels' }, - { unicode: '\u00FD', name: 'Latin Small Letter Y with acute', group: 'Vowels' }, + { + unicode: '\u00DD', + name: 'Latin Capital Letter Y with acute', + group: 'Vowels', + }, + { + unicode: '\u00FD', + name: 'Latin Small Letter Y with acute', + group: 'Vowels', + }, - { unicode: '\u0042\u0324', name: 'Latin Capital Letter B with diaeresis below', group: 'Consonants' }, - { unicode: '\u0062\u0324', name: 'Latin Small Letter B with diaeresis below', group: 'Consonants' }, - // { unicode: '\u0180', name: 'Latin Small Letter B with stroke', group: 'Consonants' }, - // { unicode: '\u0181', name: 'Latin Capital Letter B with hook', group: 'Consonants' }, - // { unicode: '\u0182', name: 'Latin Capital Letter B with top bar', group: 'Consonants' }, - // { unicode: '\u0183', name: 'Latin Small Letter B with top bar', group: 'Consonants' }, + { + unicode: '\u0042\u0324', + name: 'Latin Capital Letter B with diaeresis below', + group: 'Consonants', + }, + { + unicode: '\u0062\u0324', + name: 'Latin Small Letter B with diaeresis below', + group: 'Consonants', + }, + // { unicode: '\u0180', name: 'Latin Small Letter B with stroke', group: 'Consonants' }, + // { unicode: '\u0181', name: 'Latin Capital Letter B with hook', group: 'Consonants' }, + // { unicode: '\u0182', name: 'Latin Capital Letter B with top bar', group: 'Consonants' }, + // { unicode: '\u0183', name: 'Latin Small Letter B with top bar', group: 'Consonants' }, - { unicode: '\u00C7', name: 'Latin Capital Letter C with cedilla', group: 'Consonants' }, - { unicode: '\u00E7', name: 'Latin Small Letter C with cedilla', group: 'Consonants' }, - { unicode: '\u0106', name: 'Latin Capital Letter C with acute', group: 'Consonants' }, - { unicode: '\u0107', name: 'Latin Small Letter C with acute', group: 'Consonants' }, - { unicode: '\u0108', name: 'Latin Capital Letter C with circumflex', group: 'Consonants' }, - { unicode: '\u0109', name: 'Latin Small Letter C with circumflex', group: 'Consonants' }, - { unicode: '\u010C', name: 'Latin Capital Letter C with caron', group: 'Consonants' }, - { unicode: '\u010D', name: 'Latin Small Letter C with caron', group: 'Consonants' }, - // { unicode: '\u010A', name: 'Latin Capital Letter C with dot above', group: 'Consonants' }, - // { unicode: '\u010B', name: 'Latin Small Letter C with dot above', group: 'Consonants' }, - // { unicode: '\u0188', name: 'Latin Small Letter C with hook', group: 'Consonants' }, - // { unicode: '\u0187', name: 'Latin Capital Letter C with hook', group: 'Consonants' }, + { + unicode: '\u00C7', + name: 'Latin Capital Letter C with cedilla', + group: 'Consonants', + }, + { + unicode: '\u00E7', + name: 'Latin Small Letter C with cedilla', + group: 'Consonants', + }, + { + unicode: '\u0106', + name: 'Latin Capital Letter C with acute', + group: 'Consonants', + }, + { + unicode: '\u0107', + name: 'Latin Small Letter C with acute', + group: 'Consonants', + }, + { + unicode: '\u0108', + name: 'Latin Capital Letter C with circumflex', + group: 'Consonants', + }, + { + unicode: '\u0109', + name: 'Latin Small Letter C with circumflex', + group: 'Consonants', + }, + { + unicode: '\u010C', + name: 'Latin Capital Letter C with caron', + group: 'Consonants', + }, + { + unicode: '\u010D', + name: 'Latin Small Letter C with caron', + group: 'Consonants', + }, + // { unicode: '\u010A', name: 'Latin Capital Letter C with dot above', group: 'Consonants' }, + // { unicode: '\u010B', name: 'Latin Small Letter C with dot above', group: 'Consonants' }, + // { unicode: '\u0188', name: 'Latin Small Letter C with hook', group: 'Consonants' }, + // { unicode: '\u0187', name: 'Latin Capital Letter C with hook', group: 'Consonants' }, - { unicode: '\u010E', name: 'Latin Capital Letter D with caron', group: 'Consonants' }, - { unicode: '\u010F', name: 'Latin Small Letter D with caron', group: 'Consonants' }, - { unicode: '\u0110', name: 'Latin Capital Letter D with stroke', group: 'Consonants' }, - { unicode: '\u0111', name: 'Latin Small Letter D with stroke', group: 'Consonants' }, - // { unicode: '\u0189', name: 'Latin Capital Letter African D', group: 'Consonants' }, - { unicode: '\u1E0C', name: 'Latin Capital Letter D with dot below', group: 'Consonants' }, - { unicode: '\u1E0D', name: 'Latin Small Letter D with dot below', group: 'Consonants' }, - { unicode: '\u0044\u0331', name: 'Latin Capital Letter D with macron below', group: 'Consonants' }, - { unicode: '\u0064\u0331', name: 'Latin Small Letter D with macron below', group: 'Consonants' }, - { unicode: '\u0044\u0324', name: 'Latin Capital Letter D with diaeresis below', group: 'Consonants' }, - { unicode: '\u0064\u0324', name: 'Latin Small Letter D with diaeresis below', group: 'Consonants' }, - // { unicode: '\u018A', name: 'Latin Capital Letter D with hook', group: 'Consonants' }, - // { unicode: '\u018B', name: 'Latin Capital Letter D with top bar', group: 'Consonants' }, - // { unicode: '\u018C', name: 'Latin Small Letter D with top bar', group: 'Consonants' }, + { + unicode: '\u010E', + name: 'Latin Capital Letter D with caron', + group: 'Consonants', + }, + { + unicode: '\u010F', + name: 'Latin Small Letter D with caron', + group: 'Consonants', + }, + { + unicode: '\u0110', + name: 'Latin Capital Letter D with stroke', + group: 'Consonants', + }, + { + unicode: '\u0111', + name: 'Latin Small Letter D with stroke', + group: 'Consonants', + }, + // { unicode: '\u0189', name: 'Latin Capital Letter African D', group: 'Consonants' }, + { + unicode: '\u1E0C', + name: 'Latin Capital Letter D with dot below', + group: 'Consonants', + }, + { + unicode: '\u1E0D', + name: 'Latin Small Letter D with dot below', + group: 'Consonants', + }, + { + unicode: '\u0044\u0331', + name: 'Latin Capital Letter D with macron below', + group: 'Consonants', + }, + { + unicode: '\u0064\u0331', + name: 'Latin Small Letter D with macron below', + group: 'Consonants', + }, + { + unicode: '\u0044\u0324', + name: 'Latin Capital Letter D with diaeresis below', + group: 'Consonants', + }, + { + unicode: '\u0064\u0324', + name: 'Latin Small Letter D with diaeresis below', + group: 'Consonants', + }, + // { unicode: '\u018A', name: 'Latin Capital Letter D with hook', group: 'Consonants' }, + // { unicode: '\u018B', name: 'Latin Capital Letter D with top bar', group: 'Consonants' }, + // { unicode: '\u018C', name: 'Latin Small Letter D with top bar', group: 'Consonants' }, - { unicode: '\u01E6', name: 'Latin Capital Letter G with caron', group: 'Consonants' }, - { unicode: '\u01E7', name: 'Latin Small Letter G with caron', group: 'Consonants' }, - { unicode: '\u0120', name: 'Latin Capital Letter G with dot above', group: 'Consonants' }, - { unicode: '\u0121', name: 'Latin Small Letter G with dot above', group: 'Consonants' }, - { unicode: '\u1E20', name: 'Latin Capital Letter G with macron', group: 'Consonants' }, - { unicode: '\u1E21', name: 'Latin Small Letter G with macron', group: 'Consonants' }, - { unicode: '\u011E', name: 'Latin Capital Letter G with breve', group: 'Consonants' }, - { unicode: '\u011F', name: 'Latin Small Letter G with breve', group: 'Consonants' }, - // { unicode: '\u011C', name: 'Latin Capital Letter G with circumflex', group: 'Consonants' }, - // { unicode: '\u011D', name: 'Latin Small Letter G with circumflex', group: 'Consonants' }, + { + unicode: '\u01E6', + name: 'Latin Capital Letter G with caron', + group: 'Consonants', + }, + { + unicode: '\u01E7', + name: 'Latin Small Letter G with caron', + group: 'Consonants', + }, + { + unicode: '\u0120', + name: 'Latin Capital Letter G with dot above', + group: 'Consonants', + }, + { + unicode: '\u0121', + name: 'Latin Small Letter G with dot above', + group: 'Consonants', + }, + { + unicode: '\u1E20', + name: 'Latin Capital Letter G with macron', + group: 'Consonants', + }, + { + unicode: '\u1E21', + name: 'Latin Small Letter G with macron', + group: 'Consonants', + }, + { + unicode: '\u011E', + name: 'Latin Capital Letter G with breve', + group: 'Consonants', + }, + { + unicode: '\u011F', + name: 'Latin Small Letter G with breve', + group: 'Consonants', + }, + // { unicode: '\u011C', name: 'Latin Capital Letter G with circumflex', group: 'Consonants' }, + // { unicode: '\u011D', name: 'Latin Small Letter G with circumflex', group: 'Consonants' }, - { unicode: '\u1E24', name: 'Latin Capital Letter H with dot below', group: 'Consonants' }, - { unicode: '\u1E25', name: 'Latin Small Letter H with dot below', group: 'Consonants' }, - { unicode: '\u0048\u032C', name: 'Latin Capital Letter H with caron below', group: 'Consonants' }, - { unicode: '\u0068\u032C', name: 'Latin Small Letter H with caron below', group: 'Consonants' }, + { + unicode: '\u1E24', + name: 'Latin Capital Letter H with dot below', + group: 'Consonants', + }, + { + unicode: '\u1E25', + name: 'Latin Small Letter H with dot below', + group: 'Consonants', + }, + { + unicode: '\u0048\u032C', + name: 'Latin Capital Letter H with caron below', + group: 'Consonants', + }, + { + unicode: '\u0068\u032C', + name: 'Latin Small Letter H with caron below', + group: 'Consonants', + }, - { unicode: '\u004A\u0301', name: 'Latin Capital Letter J with acute', group: 'Consonants' }, - { unicode: '\u006A\u0301', name: 'Latin Small Letter J with acute', group: 'Consonants' }, + { + unicode: '\u004A\u0301', + name: 'Latin Capital Letter J with acute', + group: 'Consonants', + }, + { + unicode: '\u006A\u0301', + name: 'Latin Small Letter J with acute', + group: 'Consonants', + }, - { unicode: '\u1E32', name: 'Latin Capital Letter K with dot below', group: 'Consonants' }, - { unicode: '\u1E33', name: 'Latin Small Letter K with dot below', group: 'Consonants' }, + { + unicode: '\u1E32', + name: 'Latin Capital Letter K with dot below', + group: 'Consonants', + }, + { + unicode: '\u1E33', + name: 'Latin Small Letter K with dot below', + group: 'Consonants', + }, - { unicode: '\u0141', name: 'Latin Capital Letter L with stroke', group: 'Consonants' }, - { unicode: '\u0142', name: 'Latin Small Letter L with stroke', group: 'Consonants' }, - { unicode: '\u1E36', name: 'Latin Capital Letter L with dot below', group: 'Consonants' }, - { unicode: '\u1E37', name: 'Latin Small Letter L with dot below', group: 'Consonants' }, - { unicode: '\u1E3A', name: 'Latin Capital Letter L with line below', group: 'Consonants' }, - { unicode: '\u1E3B', name: 'Latin Small Letter L with line below', group: 'Consonants' }, - { unicode: '\u004C\u0324', name: 'Latin Capital Letter L with two dots below', group: 'Consonants' }, - { unicode: '\u006C\u0324', name: 'Latin Small Letter L with two dots below', group: 'Consonants' }, + { + unicode: '\u0141', + name: 'Latin Capital Letter L with stroke', + group: 'Consonants', + }, + { + unicode: '\u0142', + name: 'Latin Small Letter L with stroke', + group: 'Consonants', + }, + { + unicode: '\u1E36', + name: 'Latin Capital Letter L with dot below', + group: 'Consonants', + }, + { + unicode: '\u1E37', + name: 'Latin Small Letter L with dot below', + group: 'Consonants', + }, + { + unicode: '\u1E3A', + name: 'Latin Capital Letter L with line below', + group: 'Consonants', + }, + { + unicode: '\u1E3B', + name: 'Latin Small Letter L with line below', + group: 'Consonants', + }, + { + unicode: '\u004C\u0324', + name: 'Latin Capital Letter L with two dots below', + group: 'Consonants', + }, + { + unicode: '\u006C\u0324', + name: 'Latin Small Letter L with two dots below', + group: 'Consonants', + }, - { unicode: '\u1E40', name: 'Latin Capital Letter M with dot above', group: 'Consonants' }, - { unicode: '\u1E41', name: 'Latin Small Letter M with dot above', group: 'Consonants' }, - { unicode: '\u1E42', name: 'Latin Capital Letter M with dot below', group: 'Consonants' }, - { unicode: '\u1E43', name: 'Latin Small Letter M with dot below', group: 'Consonants' }, - { unicode: '\u004D\u0310', name: 'Latin Capital Letter M with dot below', group: 'Consonants' }, - { unicode: '\u006D\u0310', name: 'Latin Small Letter M with dot below', group: 'Consonants' }, + { + unicode: '\u1E40', + name: 'Latin Capital Letter M with dot above', + group: 'Consonants', + }, + { + unicode: '\u1E41', + name: 'Latin Small Letter M with dot above', + group: 'Consonants', + }, + { + unicode: '\u1E42', + name: 'Latin Capital Letter M with dot below', + group: 'Consonants', + }, + { + unicode: '\u1E43', + name: 'Latin Small Letter M with dot below', + group: 'Consonants', + }, + { + unicode: '\u004D\u0310', + name: 'Latin Capital Letter M with dot below', + group: 'Consonants', + }, + { + unicode: '\u006D\u0310', + name: 'Latin Small Letter M with dot below', + group: 'Consonants', + }, - { unicode: '\u00D1', name: 'Latin Capital Letter N with tilde', group: 'Consonants' }, - { unicode: '\u00F1', name: 'Latin Small Letter N with tilde', group: 'Consonants' }, - { unicode: '\u0143', name: 'Latin Capital Letter N with acute', group: 'Consonants' }, - { unicode: '\u0144', name: 'Latin Small Letter N with acute', group: 'Consonants' }, - { unicode: '\u0147', name: 'Latin Capital Letter N with caron', group: 'Consonants' }, - { unicode: '\u0148', name: 'Latin Small Letter N with caron', group: 'Consonants' }, - { unicode: '\u1E44', name: 'Latin Capital Letter N with dot above', group: 'Consonants' }, - { unicode: '\u1E45', name: 'Latin Small Letter N with dot above', group: 'Consonants' }, - { unicode: '\u1E46', name: 'Latin Capital Letter N with dot below', group: 'Consonants' }, - { unicode: '\u1E47', name: 'Latin Small Letter N with dot below', group: 'Consonants' }, - { unicode: '\u1E48', name: 'Latin Capital Letter N with line below', group: 'Consonants' }, - { unicode: '\u1E49', name: 'Latin Small Letter N with line below', group: 'Consonants' }, + { + unicode: '\u00D1', + name: 'Latin Capital Letter N with tilde', + group: 'Consonants', + }, + { + unicode: '\u00F1', + name: 'Latin Small Letter N with tilde', + group: 'Consonants', + }, + { + unicode: '\u0143', + name: 'Latin Capital Letter N with acute', + group: 'Consonants', + }, + { + unicode: '\u0144', + name: 'Latin Small Letter N with acute', + group: 'Consonants', + }, + { + unicode: '\u0147', + name: 'Latin Capital Letter N with caron', + group: 'Consonants', + }, + { + unicode: '\u0148', + name: 'Latin Small Letter N with caron', + group: 'Consonants', + }, + { + unicode: '\u1E44', + name: 'Latin Capital Letter N with dot above', + group: 'Consonants', + }, + { + unicode: '\u1E45', + name: 'Latin Small Letter N with dot above', + group: 'Consonants', + }, + { + unicode: '\u1E46', + name: 'Latin Capital Letter N with dot below', + group: 'Consonants', + }, + { + unicode: '\u1E47', + name: 'Latin Small Letter N with dot below', + group: 'Consonants', + }, + { + unicode: '\u1E48', + name: 'Latin Capital Letter N with line below', + group: 'Consonants', + }, + { + unicode: '\u1E49', + name: 'Latin Small Letter N with line below', + group: 'Consonants', + }, - { unicode: '\u0158', name: 'Latin Capital Letter R with caron', group: 'Consonants' }, - { unicode: '\u0159', name: 'Latin Small Letter R with caron', group: 'Consonants' }, - { unicode: '\u1E5E', name: 'Latin Capital Letter R with macron below', group: 'Consonants' }, - { unicode: '\u1E5F', name: 'Latin Small Letter R with macron below', group: 'Consonants' }, - { unicode: '\u0156', name: 'Latin Capital Letter R with cedilla', group: 'Consonants' }, - { unicode: '\u0157', name: 'Latin Small Letter R with cedilla', group: 'Consonants' }, - { unicode: '\u1E58', name: 'Latin Capital Letter R with dot above', group: 'Consonants' }, - { unicode: '\u1E59', name: 'Latin Small Letter R with dot above', group: 'Consonants' }, - { unicode: '\u1E5C', name: 'Latin Capital Letter R with dot below and macron', group: 'Consonants' }, - { unicode: '\u1E5D', name: 'Latin Small Letter R with dot below and macron', group: 'Consonants' }, + { + unicode: '\u0158', + name: 'Latin Capital Letter R with caron', + group: 'Consonants', + }, + { + unicode: '\u0159', + name: 'Latin Small Letter R with caron', + group: 'Consonants', + }, + { + unicode: '\u1E5E', + name: 'Latin Capital Letter R with macron below', + group: 'Consonants', + }, + { + unicode: '\u1E5F', + name: 'Latin Small Letter R with macron below', + group: 'Consonants', + }, + { + unicode: '\u0156', + name: 'Latin Capital Letter R with cedilla', + group: 'Consonants', + }, + { + unicode: '\u0157', + name: 'Latin Small Letter R with cedilla', + group: 'Consonants', + }, + { + unicode: '\u1E58', + name: 'Latin Capital Letter R with dot above', + group: 'Consonants', + }, + { + unicode: '\u1E59', + name: 'Latin Small Letter R with dot above', + group: 'Consonants', + }, + { + unicode: '\u1E5C', + name: 'Latin Capital Letter R with dot below and macron', + group: 'Consonants', + }, + { + unicode: '\u1E5D', + name: 'Latin Small Letter R with dot below and macron', + group: 'Consonants', + }, - { unicode: '\u015A', name: 'Latin Capital Letter S with acute', group: 'Consonants' }, - { unicode: '\u015B', name: 'Latin Small Letter S with acute', group: 'Consonants' }, - { unicode: '\u015E', name: 'Latin Capital Letter S with cedilla', group: 'Consonants' }, - { unicode: '\u015F', name: 'Latin Small Letter S with cedilla', group: 'Consonants' }, - { unicode: '\u0160', name: 'Latin Capital Letter S with caron', group: 'Consonants' }, - { unicode: '\u0161', name: 'Latin Small Letter S with caron', group: 'Consonants' }, - { unicode: '\u0218', name: 'Latin Capital Letter S with comma below', group: 'Consonants' }, - { unicode: '\u0219', name: 'Latin Small Letter S with comma below', group: 'Consonants' }, - { unicode: '\u00DF', name: 'Latin Small Letter sharp S', group: 'Consonants' }, + { + unicode: '\u015A', + name: 'Latin Capital Letter S with acute', + group: 'Consonants', + }, + { + unicode: '\u015B', + name: 'Latin Small Letter S with acute', + group: 'Consonants', + }, + { + unicode: '\u015E', + name: 'Latin Capital Letter S with cedilla', + group: 'Consonants', + }, + { + unicode: '\u015F', + name: 'Latin Small Letter S with cedilla', + group: 'Consonants', + }, + { + unicode: '\u0160', + name: 'Latin Capital Letter S with caron', + group: 'Consonants', + }, + { + unicode: '\u0161', + name: 'Latin Small Letter S with caron', + group: 'Consonants', + }, + { + unicode: '\u0218', + name: 'Latin Capital Letter S with comma below', + group: 'Consonants', + }, + { + unicode: '\u0219', + name: 'Latin Small Letter S with comma below', + group: 'Consonants', + }, + { + unicode: '\u00DF', + name: 'Latin Small Letter sharp S', + group: 'Consonants', + }, - { unicode: '\u0162', name: 'Latin Capital Letter T with cedilla', group: 'Consonants' }, - { unicode: '\u0163', name: 'Latin Small Letter T with cedilla', group: 'Consonants' }, - { unicode: '\u0164', name: 'Latin Capital Letter T with caron', group: 'Consonants' }, - { unicode: '\u0165', name: 'Latin Small Letter T with caron', group: 'Consonants' }, - { unicode: '\u021A', name: 'Latin Capital Letter T with comma below', group: 'Consonants' }, - { unicode: '\u021B', name: 'Latin Small Letter T with comma below', group: 'Consonants' }, - { unicode: '\u1E6E', name: 'Latin Capital Letter T with bar below', group: 'Consonants' }, - { unicode: '\u1E6F', name: 'Latin Small Letter T with bar below', group: 'Consonants' }, - { unicode: '\u0054\u0324', name: 'Latin Capital Letter T with two dots below', group: 'Consonants' }, - { unicode: '\u0074\u0324', name: 'Latin Small Letter T with two dots below', group: 'Consonants' }, + { + unicode: '\u0162', + name: 'Latin Capital Letter T with cedilla', + group: 'Consonants', + }, + { + unicode: '\u0163', + name: 'Latin Small Letter T with cedilla', + group: 'Consonants', + }, + { + unicode: '\u0164', + name: 'Latin Capital Letter T with caron', + group: 'Consonants', + }, + { + unicode: '\u0165', + name: 'Latin Small Letter T with caron', + group: 'Consonants', + }, + { + unicode: '\u021A', + name: 'Latin Capital Letter T with comma below', + group: 'Consonants', + }, + { + unicode: '\u021B', + name: 'Latin Small Letter T with comma below', + group: 'Consonants', + }, + { + unicode: '\u1E6E', + name: 'Latin Capital Letter T with bar below', + group: 'Consonants', + }, + { + unicode: '\u1E6F', + name: 'Latin Small Letter T with bar below', + group: 'Consonants', + }, + { + unicode: '\u0054\u0324', + name: 'Latin Capital Letter T with two dots below', + group: 'Consonants', + }, + { + unicode: '\u0074\u0324', + name: 'Latin Small Letter T with two dots below', + group: 'Consonants', + }, - { unicode: '\u0179', name: 'Latin Capital Letter Z with acute', group: 'Consonants' }, - { unicode: '\u017A', name: 'Latin Small Letter Z with acute', group: 'Consonants' }, - { unicode: '\u017B', name: 'Latin Capital Letter Z with dot above', group: 'Consonants' }, - { unicode: '\u017C', name: 'Latin Small Letter Z with dot above', group: 'Consonants' }, - { unicode: '\u017D', name: 'Latin Capital Letter Z with caron', group: 'Consonants' }, - { unicode: '\u017E', name: 'Latin Small Letter Z with caron', group: 'Consonants' }, - { unicode: '\u1E92', name: 'Latin Capital Letter Z with dot below', group: 'Consonants' }, - { unicode: '\u1E93', name: 'Latin Small Letter Z with dot below', group: 'Consonants' }, + { + unicode: '\u0179', + name: 'Latin Capital Letter Z with acute', + group: 'Consonants', + }, + { + unicode: '\u017A', + name: 'Latin Small Letter Z with acute', + group: 'Consonants', + }, + { + unicode: '\u017B', + name: 'Latin Capital Letter Z with dot above', + group: 'Consonants', + }, + { + unicode: '\u017C', + name: 'Latin Small Letter Z with dot above', + group: 'Consonants', + }, + { + unicode: '\u017D', + name: 'Latin Capital Letter Z with caron', + group: 'Consonants', + }, + { + unicode: '\u017E', + name: 'Latin Small Letter Z with caron', + group: 'Consonants', + }, + { + unicode: '\u1E92', + name: 'Latin Capital Letter Z with dot below', + group: 'Consonants', + }, + { + unicode: '\u1E93', + name: 'Latin Small Letter Z with dot below', + group: 'Consonants', + }, - { unicode: '\u00D0', name: 'Latin Capital letter Eth', group: 'Latin' }, - { unicode: '\u00F0', name: 'Latin Small letter Eth', group: 'Latin' }, - { unicode: '\u00DE', name: 'Latin Capital Letter Thorn', group: 'Latin' }, - { unicode: '\u00FE', name: 'Latin Small Letter Thorn', group: 'Latin' }, + { unicode: '\u00D0', name: 'Latin Capital letter Eth', group: 'Latin' }, + { unicode: '\u00F0', name: 'Latin Small letter Eth', group: 'Latin' }, + { unicode: '\u00DE', name: 'Latin Capital Letter Thorn', group: 'Latin' }, + { unicode: '\u00FE', name: 'Latin Small Letter Thorn', group: 'Latin' }, - { unicode: '\u002B', name: 'Plus sign', group: 'Math' }, - { unicode: '\u2212', name: 'Minus sign', group: 'Math' }, - { unicode: '\u00D7', name: 'Multiplication sign', group: 'Math' }, - { unicode: '\u00F7', name: 'Division sign', group: 'Math' }, - { unicode: '\u002F', name: 'Solidus', group: 'Math' }, - { unicode: '\u003D', name: 'Equals sign', group: 'Math' }, - { unicode: '\u00B1', name: 'Plus-minus sign', group: 'Math' }, - { unicode: '\u003C', name: 'Less than sign', group: 'Math' }, - { unicode: '\u003E', name: 'Greater than sign', group: 'Math' }, - { unicode: '\u2264', name: 'Less than or equal to sign', group: 'Math' }, - { unicode: '\u2265', name: 'Greater than or equal to sign', group: 'Math' }, - { unicode: '\u00B0', name: 'Degree symbol', group: 'Math' }, - { unicode: '\u00B4', name: 'Acute accent', group: 'Math' }, - { unicode: '\u02DD', name: 'Double acute accent', group: 'Math' }, - { unicode: '\u007C', name: 'Vertical line', group: 'Math' }, - { unicode: '\u03C0', name: 'Greek Small Letter Pi ', group: 'Math' }, - { unicode: '\u2211', name: 'N-ary summation', group: 'Math' }, + { unicode: '\u002B', name: 'Plus sign', group: 'Math' }, + { unicode: '\u2212', name: 'Minus sign', group: 'Math' }, + { unicode: '\u00D7', name: 'Multiplication sign', group: 'Math' }, + { unicode: '\u00F7', name: 'Division sign', group: 'Math' }, + { unicode: '\u002F', name: 'Solidus', group: 'Math' }, + { unicode: '\u003D', name: 'Equals sign', group: 'Math' }, + { unicode: '\u00B1', name: 'Plus-minus sign', group: 'Math' }, + { unicode: '\u003C', name: 'Less than sign', group: 'Math' }, + { unicode: '\u003E', name: 'Greater than sign', group: 'Math' }, + { unicode: '\u2264', name: 'Less than or equal to sign', group: 'Math' }, + { unicode: '\u2265', name: 'Greater than or equal to sign', group: 'Math' }, + { unicode: '\u00B0', name: 'Degree symbol', group: 'Math' }, + { unicode: '\u00B4', name: 'Acute accent', group: 'Math' }, + { unicode: '\u02DD', name: 'Double acute accent', group: 'Math' }, + { unicode: '\u007C', name: 'Vertical line', group: 'Math' }, + { unicode: '\u03C0', name: 'Greek Small Letter Pi ', group: 'Math' }, + { unicode: '\u2211', name: 'N-ary summation', group: 'Math' }, - { unicode: '\u2018', name: 'Left Single Quotation Mark', group: 'Misc' }, - { unicode: '\u2019', name: 'Right Single Quotation Mark', group: 'Misc' }, - { unicode: '\u2026', name: 'Horizontal ellipsis', group: 'Misc' }, - { unicode: '\u2013', name: 'En dash', group: 'Misc' }, - { unicode: '\u2014', name: 'Em dash', group: 'Misc' }, - { unicode: '\u2E3B', name: 'Three-em dash', group: 'Misc' }, - { unicode: '\u2009', name: 'Thin space', group: 'Misc' }, - { unicode: '\u200A', name: 'Hair space', group: 'Misc' }, - { unicode: '\u2002', name: 'En space', group: 'Misc' }, - { unicode: '\u2003', name: 'Em Space', group: 'Misc' }, - { unicode: '\u00A9', name: 'Copyright', group: 'Misc' }, - { unicode: '\u2117', name: 'Sound recording copyright', group: 'Misc' }, - { unicode: '\u2122', name: 'Registered Trademark', group: 'Misc' }, - { unicode: '\u00AE', name: 'Registered sign', group: 'Misc' }, - { unicode: '\u00A1', name: 'Inverted Exclamation Mark', group: 'Misc' }, - { unicode: '\u00BF', name: 'Inverted Question Mark', group: 'Misc' }, - { unicode: '\u00AB', name: 'Left-pointing double-angle quotation mark', group: 'Misc' }, - { unicode: '\u00BB', name: 'Right-pointing double-angle quotation mark', group: 'Misc' }, - { unicode: '\u00B7', name: 'Middle dot', group: 'Misc' }, - { unicode: '\u00A7', name: 'Section symbol', group: 'Misc' }, - { unicode: '\u00B6', name: 'Pilcrow sign', group: 'Misc' }, - { unicode: '\u2020', name: 'Dagger', group: 'Misc' }, - { unicode: '\u2640', name: 'Female sign', group: 'Misc' }, - { unicode: '\u2642', name: 'Male sign', group: 'Misc' }, - { unicode: '\u00A3', name: 'Pound sign', group: 'Misc' }, - { unicode: '\u00A5', name: 'Yen sign', group: 'Misc' }, - { unicode: '\u20AC', name: 'Euro sign', group: 'Misc' }, - { unicode: '\u00A2', name: 'Cent sign', group: 'Misc' }, - { unicode: '\u2669', name: 'Quarter note', group: 'Misc' }, - { unicode: '\u266A', name: 'Eigth note', group: 'Misc' }, - { unicode: '\u266D', name: 'Flat sign', group: 'Misc' }, - { unicode: '\u266E', name: 'Natural sign', group: 'Misc' }, - { unicode: '\u266F', name: 'Sharp sign', group: 'Misc' }, + { unicode: '\u2018', name: 'Left Single Quotation Mark', group: 'Misc' }, + { unicode: '\u2019', name: 'Right Single Quotation Mark', group: 'Misc' }, + { unicode: '\u2026', name: 'Horizontal ellipsis', group: 'Misc' }, + { unicode: '\u2013', name: 'En dash', group: 'Misc' }, + { unicode: '\u2014', name: 'Em dash', group: 'Misc' }, + { unicode: '\u2E3B', name: 'Three-em dash', group: 'Misc' }, + { unicode: '\u2009', name: 'Thin space', group: 'Misc' }, + { unicode: '\u200A', name: 'Hair space', group: 'Misc' }, + { unicode: '\u2002', name: 'En space', group: 'Misc' }, + { unicode: '\u2003', name: 'Em Space', group: 'Misc' }, + { unicode: '\u00A9', name: 'Copyright', group: 'Misc' }, + { unicode: '\u2117', name: 'Sound recording copyright', group: 'Misc' }, + { unicode: '\u2122', name: 'Registered Trademark', group: 'Misc' }, + { unicode: '\u00AE', name: 'Registered sign', group: 'Misc' }, + { unicode: '\u00A1', name: 'Inverted Exclamation Mark', group: 'Misc' }, + { unicode: '\u00BF', name: 'Inverted Question Mark', group: 'Misc' }, + { + unicode: '\u00AB', + name: 'Left-pointing double-angle quotation mark', + group: 'Misc', + }, + { + unicode: '\u00BB', + name: 'Right-pointing double-angle quotation mark', + group: 'Misc', + }, + { unicode: '\u00B7', name: 'Middle dot', group: 'Misc' }, + { unicode: '\u00A7', name: 'Section symbol', group: 'Misc' }, + { unicode: '\u00B6', name: 'Pilcrow sign', group: 'Misc' }, + { unicode: '\u2020', name: 'Dagger', group: 'Misc' }, + { unicode: '\u2640', name: 'Female sign', group: 'Misc' }, + { unicode: '\u2642', name: 'Male sign', group: 'Misc' }, + { unicode: '\u00A3', name: 'Pound sign', group: 'Misc' }, + { unicode: '\u00A5', name: 'Yen sign', group: 'Misc' }, + { unicode: '\u20AC', name: 'Euro sign', group: 'Misc' }, + { unicode: '\u00A2', name: 'Cent sign', group: 'Misc' }, + { unicode: '\u2669', name: 'Quarter note', group: 'Misc' }, + { unicode: '\u266A', name: 'Eigth note', group: 'Misc' }, + { unicode: '\u266D', name: 'Flat sign', group: 'Misc' }, + { unicode: '\u266E', name: 'Natural sign', group: 'Misc' }, + { unicode: '\u266F', name: 'Sharp sign', group: 'Misc' }, - // { unicode: '\u00A4', name: 'Currency sign', group: 'Latin-Supplement' }, - // { unicode: '\u00A6', name: 'Broken bar', group: 'Latin-Supplement' }, - // { unicode: '\u00A7', name: 'Section sign', group: 'Latin-Supplement' }, - // { unicode: '\u00A8', name: 'Diaeresis', group: 'Latin-Supplement' }, - // { unicode: '\u00AA', name: 'Feminine Ordinal Indicator', group: 'Latin-Supplement' }, - // { unicode: '\u00AB', name: 'Left-pointing double angle quotation mark', group: 'Latin-Supplement' }, - // { unicode: '\u00AC', name: 'Not sign', group: 'Latin-Supplement' }, - // { unicode: '\u00AD', name: 'Soft hyphen', group: 'Latin-Supplement' }, - // { unicode: '\u00AF', name: 'macron', group: 'Latin-Supplement' }, - // { unicode: '\u00B2', name: 'Superscript two', group: 'Latin-Supplement' }, - // { unicode: '\u00B3', name: 'Superscript three', group: 'Latin-Supplement' }, - // { unicode: '\u00B4', name: 'Acute accent', group: 'Latin-Supplement' }, - // { unicode: '\u00B5', name: 'Micro sign', group: 'Latin-Supplement' }, - // { unicode: '\u00B8', name: 'Cedilla', group: 'Latin-Supplement' }, - // { unicode: '\u00B9', name: 'Superscript one', group: 'Latin-Supplement' }, - // { unicode: '\u00BA', name: 'Masculine ordinal indicator', group: 'Latin-Supplement' }, - // { unicode: '\u00BC', name: 'Vulgar fraction one quarter', group: 'Latin-Supplement' }, - // { unicode: '\u00BD', name: 'Vulgar fraction one half', group: 'Latin-Supplement' }, - // { unicode: '\u00BE', name: 'Vulgar fraction three quarters', group: 'Latin-Supplement' }, + // { unicode: '\u00A4', name: 'Currency sign', group: 'Latin-Supplement' }, + // { unicode: '\u00A6', name: 'Broken bar', group: 'Latin-Supplement' }, + // { unicode: '\u00A7', name: 'Section sign', group: 'Latin-Supplement' }, + // { unicode: '\u00A8', name: 'Diaeresis', group: 'Latin-Supplement' }, + // { unicode: '\u00AA', name: 'Feminine Ordinal Indicator', group: 'Latin-Supplement' }, + // { unicode: '\u00AB', name: 'Left-pointing double angle quotation mark', group: 'Latin-Supplement' }, + // { unicode: '\u00AC', name: 'Not sign', group: 'Latin-Supplement' }, + // { unicode: '\u00AD', name: 'Soft hyphen', group: 'Latin-Supplement' }, + // { unicode: '\u00AF', name: 'macron', group: 'Latin-Supplement' }, + // { unicode: '\u00B2', name: 'Superscript two', group: 'Latin-Supplement' }, + // { unicode: '\u00B3', name: 'Superscript three', group: 'Latin-Supplement' }, + // { unicode: '\u00B4', name: 'Acute accent', group: 'Latin-Supplement' }, + // { unicode: '\u00B5', name: 'Micro sign', group: 'Latin-Supplement' }, + // { unicode: '\u00B8', name: 'Cedilla', group: 'Latin-Supplement' }, + // { unicode: '\u00B9', name: 'Superscript one', group: 'Latin-Supplement' }, + // { unicode: '\u00BA', name: 'Masculine ordinal indicator', group: 'Latin-Supplement' }, + // { unicode: '\u00BC', name: 'Vulgar fraction one quarter', group: 'Latin-Supplement' }, + // { unicode: '\u00BD', name: 'Vulgar fraction one half', group: 'Latin-Supplement' }, + // { unicode: '\u00BE', name: 'Vulgar fraction three quarters', group: 'Latin-Supplement' }, - // { unicode: '\u0184', name: 'Latin Capital Letter Tone Six', group: 'Latin-Extended-B' }, - // { unicode: '\u0185', name: 'Latin Small Letter Tone Six', group: 'Latin-Extended-B' }, - // { unicode: '\u0186', name: 'Latin Capital Letter Open O', group: 'Latin-Extended-B' }, - // { unicode: '\u018D', name: 'Latin Small Letter Turned Delta', group: 'Latin-Extended-B' }, - // { unicode: '\u018E', name: 'Latin Capital Letter Reversed E', group: 'Latin-Extended-B' }, - // { unicode: '\u018F', name: 'Latin Capital Letter Schwa', group: 'Latin-Extended-B' } -] + // { unicode: '\u0184', name: 'Latin Capital Letter Tone Six', group: 'Latin-Extended-B' }, + // { unicode: '\u0185', name: 'Latin Small Letter Tone Six', group: 'Latin-Extended-B' }, + // { unicode: '\u0186', name: 'Latin Capital Letter Open O', group: 'Latin-Extended-B' }, + // { unicode: '\u018D', name: 'Latin Small Letter Turned Delta', group: 'Latin-Extended-B' }, + // { unicode: '\u018E', name: 'Latin Capital Letter Reversed E', group: 'Latin-Extended-B' }, + // { unicode: '\u018F', name: 'Latin Capital Letter Schwa', group: 'Latin-Extended-B' } +]; diff --git a/wax-prosemirror-components/src/components/specialCharacters/SpecialCharactersTool.js b/wax-prosemirror-components/src/components/specialCharacters/SpecialCharactersTool.js index aad6c61c6b711805bef8de1c7842928b0329903d..d517a3102c12cd957018c7e9edfb806aa147d673 100644 --- a/wax-prosemirror-components/src/components/specialCharacters/SpecialCharactersTool.js +++ b/wax-prosemirror-components/src/components/specialCharacters/SpecialCharactersTool.js @@ -21,7 +21,7 @@ const DropWrapper = styled.div` const SpecialCharactersTool = ({ view = {}, item }) => { const { - view: { main }, + pmViews: { main }, } = useContext(WaxContext); const { icon, title } = item; diff --git a/wax-prosemirror-components/src/components/tables/CreateTable.js b/wax-prosemirror-components/src/components/tables/CreateTable.js index f20dd3a0ede6f54f9e53537fe2c550947c067b0a..235e4d29f76a7254b33da57f2559b3a2bf36bcd0 100644 --- a/wax-prosemirror-components/src/components/tables/CreateTable.js +++ b/wax-prosemirror-components/src/components/tables/CreateTable.js @@ -21,7 +21,7 @@ const DropWrapper = styled.div` const CreateTable = ({ view = {}, item }) => { const { - view: { main }, + pmViews: { main }, activeView, } = useContext(WaxContext); diff --git a/wax-prosemirror-components/src/components/textHighlight/TextHighlightingTool.js b/wax-prosemirror-components/src/components/textHighlight/TextHighlightingTool.js index 1b9d641d1ba7da9077817d5d947d1d3aecebb8d3..bdbfd5e32f72082dfd86cf1b8605739da167d724 100644 --- a/wax-prosemirror-components/src/components/textHighlight/TextHighlightingTool.js +++ b/wax-prosemirror-components/src/components/textHighlight/TextHighlightingTool.js @@ -56,8 +56,8 @@ const TextHighlightingTool = ({ view: { dispatch, state }, item }) => { ]; const ref = useRef(); - const { activeViewId, activeView, view } = useContext(WaxContext); - const isEditable = view.main.props.editable(editable => { + const { activeViewId, activeView, pmViews } = useContext(WaxContext); + const isEditable = pmViews.main.props.editable(editable => { return editable; }); @@ -69,13 +69,13 @@ const TextHighlightingTool = ({ view: { dispatch, state }, item }) => { Object.keys(highlightDropDownOptions).forEach(key => { lists.push( <Highlighter + data-style={highlightDropDownOptions[key].value} + key={uuidv4()} onMouseDown={e => handleMouseDown(e, highlightDropDownOptions[key].value) } - key={uuidv4()} - title={highlightDropDownOptions[key].name} - data-style={highlightDropDownOptions[key].value} style={{ backgroundColor: highlightDropDownOptions[key].value }} + title={highlightDropDownOptions[key].name} />, ); }); @@ -102,12 +102,12 @@ const TextHighlightingTool = ({ view: { dispatch, state }, item }) => { const MenuButtonComponent = useMemo( () => ( - <Wrapper ref={ref} onDoubleClick={handleDblClk}> + <Wrapper onDoubleClick={handleDblClk} ref={ref}> <div disabled={isDisabled} style={{ backgroundColor: - localStorage.getItem('lastBgColor') != undefined + localStorage.getItem('lastBgColor') !== undefined ? localStorage.getItem('lastBgColor') : highlightDropDownOptions[0].name, opacity: isDisabled ? '0.6' : '1', @@ -126,12 +126,12 @@ const TextHighlightingTool = ({ view: { dispatch, state }, item }) => { {isOpen && ( <DropWrapper> <TextHighlightComponent - key={uuidv4()} - item={item} - view={(dispatch, state)} close={() => { setIsOpen(false); }} + item={item} + key={uuidv4()} + view={(dispatch, state)} > {renderList()} </TextHighlightComponent> diff --git a/wax-prosemirror-components/src/components/transformCase/TransformCaseComponent.js b/wax-prosemirror-components/src/components/transformCase/TransformCaseComponent.js index 5a9c9c35ce9c99db92e7bd4bcf3b12be32558fb1..7c59256b5517f3d1dad221f98e62ac182d4c9d46 100644 --- a/wax-prosemirror-components/src/components/transformCase/TransformCaseComponent.js +++ b/wax-prosemirror-components/src/components/transformCase/TransformCaseComponent.js @@ -43,8 +43,9 @@ const TransformCaseComponent = ({ view: { state }, item }) => { const { icon, title, select } = item; const [isOpen, setIsOpen] = useState(false); const ref = useRef(); - const { activeViewId, activeView, view } = useContext(WaxContext); - const isEditable = view.main.props.editable(editable => { + const { activeViewId, activeView, pmViews } = useContext(WaxContext); + + const isEditable = pmViews.main.props.editable(editable => { return editable; }); let isDisabled = !select(state, activeViewId, activeView); diff --git a/wax-prosemirror-components/src/components/various/LeftSideButton.js b/wax-prosemirror-components/src/components/various/LeftSideButton.js index 9df3369d954320d25d919ae9820774655451d5d2..ea0068fe0d31563b17e6b8a0eaa61e0342219341 100644 --- a/wax-prosemirror-components/src/components/various/LeftSideButton.js +++ b/wax-prosemirror-components/src/components/various/LeftSideButton.js @@ -16,7 +16,7 @@ const LeftSideButton = ({ view = {}, item }) => { const { active, icon, label, run, select, title } = item; const { - view: { main }, + pmViews: { main }, activeViewId, activeView, } = useContext(WaxContext); diff --git a/wax-prosemirror-core/src/WaxContext.js b/wax-prosemirror-core/src/WaxContext.js index 7437cdd24582dbb9b05ef65b875075c24f1f666f..15f652e532346e2c9976ca0a5726760f49fb6dc5 100644 --- a/wax-prosemirror-core/src/WaxContext.js +++ b/wax-prosemirror-core/src/WaxContext.js @@ -15,7 +15,7 @@ export const WaxContext = React.createContext({ export default props => { const [context, setContext] = useState({ app: props.app, - view: props.view || {}, + pmViews: props.view || {}, activeView: props.activeView || {}, activeViewId: props.activeViewId || {}, options: { fullScreen: false }, @@ -27,14 +27,14 @@ export default props => { Object.assign(context.options, option); }, removeView: deletedView => { - delete context.view[deletedView]; + delete context.pmViews[deletedView]; }, updateView: (newView, activeViewId) => { - const view = Object.assign(context.view, newView); - const activeView = view[activeViewId || context.activeViewId]; + const pmViews = Object.assign(context.pmViews, newView); + const activeView = pmViews[activeViewId || context.activeViewId]; setContext({ ...context, - view, + pmViews, activeView, activeViewId: activeViewId || context.activeViewId, }); diff --git a/wax-prosemirror-services/src/NoteService/Editor.js b/wax-prosemirror-services/src/NoteService/Editor.js index 67310911c038d18f9d099f0436de7e60e760f401..dc30aebcbf221d905a3207ac80c697eebc1a26e8 100644 --- a/wax-prosemirror-services/src/NoteService/Editor.js +++ b/wax-prosemirror-services/src/NoteService/Editor.js @@ -28,7 +28,13 @@ export default ({ node, view }) => { let clickInNote = false; let typing = false; - const isEditable = context.view.main.props.editable(editable => { + const { + activeViewId, + pmViews, + pmViews: { main }, + } = context; + + const isEditable = main.props.editable(editable => { return editable; }); @@ -47,12 +53,10 @@ export default ({ node, view }) => { disallowedTools: ['Tables', 'Images', 'Lists', 'CodeBlock'], handleDOMEvents: { blur: (editorView, event) => { - if (context.view[noteId]) { - context.view[noteId].dispatch( - context.view[noteId].state.tr.setSelection( - new TextSelection( - context.view[noteId].state.tr.doc.resolve(0), - ), + if (pmViews[noteId]) { + pmViews[noteId].dispatch( + pmViews[noteId].state.tr.setSelection( + new TextSelection(pmViews[noteId].state.tr.doc.resolve(0)), ), ); } @@ -81,8 +85,8 @@ export default ({ node, view }) => { }, noteId, ); - if (context.view[noteId]) { - context.view[noteId].focus(); + if (pmViews[noteId]) { + pmViews[noteId].focus(); } }, []); @@ -168,8 +172,8 @@ export default ({ node, view }) => { }; }; - if (context.view[noteId]) { - const { state } = context.view[noteId]; + if (pmViews[noteId]) { + const { state } = pmViews[noteId]; const start = node.content.findDiffStart(state.doc.content); if (start != null) { let { a: endA, b: endB } = node.content.findDiffEnd(state.doc.content); @@ -178,7 +182,7 @@ export default ({ node, view }) => { endA += overlap; endB += overlap; } - context.view[noteId].dispatch( + pmViews[noteId].dispatch( state.tr .replace(start, endB, node.slice(start, endA)) .setMeta('fromOutside', true), @@ -193,7 +197,7 @@ export default ({ node, view }) => { return ( <NoteContainer> {NoteEditorContainerComponent} - {context.activeViewId === noteId && <WaxOverlays group="notes" />} + {activeViewId === noteId && <WaxOverlays group="notes" />} </NoteContainer> ); };