diff --git a/wax-prosemirror-components/src/components/comments/CommentComponent.js b/wax-prosemirror-components/src/components/comments/CommentComponent.js index 299632185b584afad2953034c0224ad2e05a7b96..7a588618b8fce2530c5f2dc7179a9c62884cbec3 100644 --- a/wax-prosemirror-components/src/components/comments/CommentComponent.js +++ b/wax-prosemirror-components/src/components/comments/CommentComponent.js @@ -36,7 +36,9 @@ export default ({ area }) => { //annotation top if (area === "main") { commentEl = document.querySelector(`span[data-id="${id}"]`); - annotationTop = commentEl.getBoundingClientRect().top - WaxSurface.top; + if (commentEl) + annotationTop = + commentEl.getBoundingClientRect().top - WaxSurface.top; } else { const panelWrapper = document.getElementsByClassName("panelWrapper"); const panelWrapperHeight = panelWrapper[0].getBoundingClientRect() @@ -44,8 +46,9 @@ export default ({ area }) => { commentEl = document .querySelector("#notes-container") .querySelector(`span[data-id="${id}"]`); - annotationTop = - commentEl.getBoundingClientRect().top - panelWrapperHeight - 50; + if (commentEl) + annotationTop = + commentEl.getBoundingClientRect().top - panelWrapperHeight - 50; } // get height of this comment box @@ -148,7 +151,6 @@ const updateComments = view => { groupedComments[comment[0].attrs.group].push(comment[0]); } }); - return groupedComments; } return []; diff --git a/wax-prosemirror-components/src/components/notes/NoteEditorContainer.js b/wax-prosemirror-components/src/components/notes/NoteEditorContainer.js index 6657c7ed2845804a7301e4ca68be8fe643923098..a978fa279a90df4e18c7f8fe89515171513ebfc2 100644 --- a/wax-prosemirror-components/src/components/notes/NoteEditorContainer.js +++ b/wax-prosemirror-components/src/components/notes/NoteEditorContainer.js @@ -9,6 +9,7 @@ const NoteEditorContainerStyled = styled.div` min-height: 28px; width: 100%; position: relative; + margin-bottom: 5px; `; const NoteStyled = styled.div` diff --git a/wax-prosemirror-core/src/ioc-react.js b/wax-prosemirror-core/src/ioc-react.js index 36f768cc2e6548ff5e59035f16d6091392d81cc2..953832af6222980893dbb6f2f3afea34f429953d 100644 --- a/wax-prosemirror-core/src/ioc-react.js +++ b/wax-prosemirror-core/src/ioc-react.js @@ -19,7 +19,7 @@ export default props => { setContext({ ...context, view: Object.assign(context.view, view), - activeView: view.main || view, + activeView: view.activeView || view, activeViewId: view.activeViewId }); }, diff --git a/wax-prosemirror-core/src/services/LayoutService/Layout.js b/wax-prosemirror-core/src/services/LayoutService/Layout.js index 59bf0f1f46db61f976c3a002913fbf32aa216f30..28024d06371eb23e4183a15c608002cbc5532ae7 100644 --- a/wax-prosemirror-core/src/services/LayoutService/Layout.js +++ b/wax-prosemirror-core/src/services/LayoutService/Layout.js @@ -1,5 +1,5 @@ import { injectable } from "inversify"; -import { DefaultLayout } from "wax-prosemirror-layouts"; +import DefaultLayout from "wax-prosemirror-layouts/src/layouts/DefaultLayout"; import LayoutFactory from "./components/LayoutFactory"; @injectable() diff --git a/wax-prosemirror-layouts/src/layouts/EditoriaLayout.js b/wax-prosemirror-layouts/src/layouts/EditoriaLayout.js index 30f08b67e4b9b3be2dffb08358938e4306815b06..884c630552e69d9fc6fc9ca69df99a24cfdb1c5b 100644 --- a/wax-prosemirror-layouts/src/layouts/EditoriaLayout.js +++ b/wax-prosemirror-layouts/src/layouts/EditoriaLayout.js @@ -200,10 +200,17 @@ const hasNotes = main => { return notes; }; +const LeftSideBar = componentPlugin("leftSideBar"); +const RightSideBar = componentPlugin("rightSideBar"); +const TopBar = componentPlugin("topBar"); +const NotesArea = componentPlugin("notesArea"); +const CommentsArea = componentPlugin("commentsArea"); +const WaxOverlays = componentPlugin("waxOverlays"); + const withNotes = () => { return ( <NotesAreaContainer> - <NotesContainer id="notes-container"> + <NotesContainer> <NotesArea /> </NotesContainer> <CommentsContainer> @@ -214,13 +221,6 @@ const withNotes = () => { }; const EditoriaLayout = ({ editor }) => { - const LeftSideBar = componentPlugin("leftSideBar"); - const RightSideBar = componentPlugin("rightSideBar"); - const TopBar = componentPlugin("topBar"); - const NotesArea = componentPlugin("notesArea"); - const CommentsArea = componentPlugin("commentsArea"); - const WaxOverlays = componentPlugin("waxOverlays"); - const { view: { main } } = useContext(WaxContext); let AreasWithNotes = null;