From ca306df89239ca274d2b1f89cad99615ee76599b Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Thu, 16 Sep 2021 12:39:50 +0300
Subject: [PATCH] default nodeView

---
 editors/demo/src/HHMI/HHMI.js                 |  2 +-
 .../src/PortalService/AbstractNodeView.js     | 27 +++++--------------
 2 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/editors/demo/src/HHMI/HHMI.js b/editors/demo/src/HHMI/HHMI.js
index d17358782..3de249ab0 100644
--- a/editors/demo/src/HHMI/HHMI.js
+++ b/editors/demo/src/HHMI/HHMI.js
@@ -25,7 +25,7 @@ const Hhmi = () => {
         value=""
         // readonly
         layout={HhmiLayout}
-        onChange={source => console.log(source)}
+        // onChange={source => console.log(source)}
       />
     </>
   );
diff --git a/wax-prosemirror-services/src/PortalService/AbstractNodeView.js b/wax-prosemirror-services/src/PortalService/AbstractNodeView.js
index 43539bc90..37304f52e 100644
--- a/wax-prosemirror-services/src/PortalService/AbstractNodeView.js
+++ b/wax-prosemirror-services/src/PortalService/AbstractNodeView.js
@@ -26,25 +26,6 @@ export default class AbstractNodeView {
 
   update(node) {
     if (node.type !== this.node.type) return false;
-    if (!node.sameMarkup(this.node)) return false;
-    this.node = node;
-    if (this.context.view[node.attrs.id]) {
-      const { state } = this.context.view[node.attrs.id];
-      const start = node.content.findDiffStart(state.doc.content);
-      if (start != null) {
-        let { a: endA, b: endB } = node.content.findDiffEnd(state.doc.content);
-        const overlap = start - Math.min(endA, endB);
-        if (overlap > 0) {
-          endA += overlap;
-          endB += overlap;
-        }
-        this.context.view[node.attrs.id].dispatch(
-          state.tr
-            .replace(start, endB, node.slice(start, endA))
-            .setMeta('fromOutside', true),
-        );
-      }
-    }
 
     return true;
   }
@@ -63,7 +44,11 @@ export default class AbstractNodeView {
     return true;
   }
 
-  selectNode() {}
+  selectNode() {
+    return true;
+  }
 
-  deselectNode() {}
+  deselectNode() {
+    return true;
+  }
 }
-- 
GitLab