Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/superdoc/src/SuperDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ watch(getFloatingComments, () => {
v-click-outside="cancelPendingComment"
/>

<div class="floating-comments" v-if="!isCommentsListVisible">
<div class="floating-comments">
<FloatingComments
v-if="hasInitializedLocations && getFloatingComments.length > 0"
v-for="doc in documentsWithConverations"
Expand All @@ -606,8 +606,13 @@ watch(getFloatingComments, () => {
display: flex;
}

.right-sidebar {
min-width: 320px;
}

.floating-comments {
min-width: 300px;
width: 300px;
}

.superdoc--with-sidebar { /* */ }
Expand Down
2 changes: 1 addition & 1 deletion packages/superdoc/src/helpers/use-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ref, reactive, toRaw } from 'vue';
export default function useSelection(params) {
const documentId = ref(params.documentId);
const page = ref(params.page);
const selectionBounds = reactive(params.selectionBounds);
const selectionBounds = reactive(params.selectionBounds || {});
const source = ref(params.source);

/* Get the ID of the container */
Expand Down
4 changes: 2 additions & 2 deletions packages/superdoc/src/stores/comments-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ export const useCommentsStore = defineStore('comments', () => {
const newComment = useComment(comment.getValues());

if (pendingComment.value) newComment.setText({ text: currentCommentText.value, suppressUpdate: true });
else newComment.setText({ text: comment.commentText, suppressUpdate: true });
newComment.selection.source = pendingComment.value?.selection?.source;

// Set isInternal flag
Expand Down Expand Up @@ -390,7 +391,6 @@ export const useCommentsStore = defineStore('comments', () => {
// Emit event for end users
if (__IS_DEBUG__) console.debug('[addComment] emitting...', event);
superdoc.emit('comments-update', event);

};

const deleteComment = ({ commentId: commentIdToDelete, superdoc }) => {
Expand Down Expand Up @@ -550,8 +550,8 @@ export const useCommentsStore = defineStore('comments', () => {
generalCommentIds,
editorCommentIds,
commentsParentElement,
hasInitializedLocations,
editorCommentPositions,
hasInitializedLocations,

// Floating comments
floatingCommentsOffset,
Expand Down