Skip to content
Snippets Groups Projects
Commit 70947326 authored by Giannis Kopanas's avatar Giannis Kopanas
Browse files

fix(findand replace): test plugins load

parent 448dc61a
No related branches found
No related tags found
1 merge request!45Develop
......@@ -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;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment