From 7094732657b7d4eae73a36d88d04952c55bb8425 Mon Sep 17 00:00:00 2001
From: Giannis Kopanas <jkopanas@gmail.com>
Date: Thu, 14 Nov 2019 21:35:09 +0200
Subject: [PATCH] fix(findand replace): test plugins load

---
 .../src/FindAndReplacePlugin.js               | 39 ++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/wax-prosemirror-plugins/src/FindAndReplacePlugin.js b/wax-prosemirror-plugins/src/FindAndReplacePlugin.js
index a8031dea4..d12bfff66 100644
--- a/wax-prosemirror-plugins/src/FindAndReplacePlugin.js
+++ b/wax-prosemirror-plugins/src/FindAndReplacePlugin.js
@@ -75,7 +75,7 @@ const findNodesWithSameMark = (doc, from, to, markType) => {
   };
 };
 
-const WithStatePLugin = Component => ({ state }) => {
+const WithStatePlugin = Component => ({ state }) => {
   const { doc, selection, schema } = state;
   const markType = schema.marks.strong;
   if (!markType) {
@@ -101,3 +101,40 @@ const FindAndReplacePlugin = new Plugin({
 });
 
 export default FindAndReplacePlugin;
+
+const ToolBarPlugin = new Plugin({
+  key: FindAndReplaceKey,
+  state: {
+    init() {
+      return { component: WithStatePlugin(Component) };
+    },
+    apply(tr, oldState, newState) {
+      return this.getState(newState);
+    }
+  }
+});
+
+const LinkPlugin = new Plugin({
+  key: FindAndReplaceKey,
+  state: {
+    init() {
+      return { items };
+    },
+    apply(tr, oldState, newState) {
+      return this.getState(newState);
+    }
+  }
+});
+
+ToolBar(Plugin) = RenderReactComponentPlugin(
+  Component,
+  RenderArea,
+  ShowHideCommand
+);
+
+Component;
+RenderArea;
+ShowHideCommand;
+Position;
+items;
+ItemCommands;
-- 
GitLab