diff --git a/wax-prosemirror-plugins/src/FindAndReplacePlugin.js b/wax-prosemirror-plugins/src/FindAndReplacePlugin.js index a8031dea4ee4f54acab719b660f7675fe5780036..d12bfff66114cae1400cd33832d528bf1e946ece 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;