From d409a824b03da37a2a0b001b42af48bdeaf331e2 Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Fri, 19 Jun 2020 15:21:03 +0300
Subject: [PATCH] set inclusive option in schema service

---
 editors/editoria/src/config/config.js                 | 2 +-
 wax-prosemirror-plugins/src/comments/ActiveComment.js | 2 ++
 wax-prosemirror-schema/src/marks/commentMark.js       | 1 +
 wax-prosemirror-services/src/SchemaService/Mark.js    | 2 ++
 4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/editors/editoria/src/config/config.js b/editors/editoria/src/config/config.js
index 95d93f699..51001e4d3 100644
--- a/editors/editoria/src/config/config.js
+++ b/editors/editoria/src/config/config.js
@@ -56,7 +56,7 @@ export default {
 
   PmPlugins: [columnResizing(), tableEditing(), invisibles([hardBreak()])],
 
-  // Always load first CommentsService and LinkService,
+  // Always load first TrackChangeService,
   //as it matters on how PM treats nodes and marks
   services: [
     new TrackChangeService(),
diff --git a/wax-prosemirror-plugins/src/comments/ActiveComment.js b/wax-prosemirror-plugins/src/comments/ActiveComment.js
index aa664d0ad..fffbe4c03 100644
--- a/wax-prosemirror-plugins/src/comments/ActiveComment.js
+++ b/wax-prosemirror-plugins/src/comments/ActiveComment.js
@@ -6,6 +6,8 @@ import { DocumentHelpers } from "wax-prosemirror-utilities";
 const activeComment = new PluginKey("activeComment");
 
 const getComment = state => {
+  if (state.selection.from !== state.selection.to) return;
+
   const commentMark = state.schema.marks["comment"];
   const commentOnSelection = DocumentHelpers.findMark(state, commentMark);
   if (commentOnSelection) {
diff --git a/wax-prosemirror-schema/src/marks/commentMark.js b/wax-prosemirror-schema/src/marks/commentMark.js
index cb155e807..2c2f36a33 100644
--- a/wax-prosemirror-schema/src/marks/commentMark.js
+++ b/wax-prosemirror-schema/src/marks/commentMark.js
@@ -6,6 +6,7 @@ const comment = {
     conversation: []
   },
   inclusive: false,
+  excludes: "",
   parseDOM: [
     {
       tag: "span.comment",
diff --git a/wax-prosemirror-services/src/SchemaService/Mark.js b/wax-prosemirror-services/src/SchemaService/Mark.js
index eaa0e99e9..95792c197 100644
--- a/wax-prosemirror-services/src/SchemaService/Mark.js
+++ b/wax-prosemirror-services/src/SchemaService/Mark.js
@@ -10,6 +10,7 @@ export default class Mark {
   group = "";
   content = "";
   draggable = false;
+  inclusive = true;
   _attrs = {};
   _parseRules = [];
 
@@ -60,6 +61,7 @@ export default class Mark {
       group: this.group,
       content: this.content,
       draggable: this.draggable,
+      inclusive: this.inclusive,
       attrs: this._attrs,
       parseDOM: this._parseRules.map(rule => rule.combineRules()),
       toDOM: node => {
-- 
GitLab