From 1639e8da49693775b5895392985b554027b055b2 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Tue, 21 May 2019 23:22:38 -0700 Subject: [PATCH] Revert "Add noop plugin (#2814)" (#2817) This reverts commit b71fdbbb3d14f77ad77d280bc27dc556d70a5f6f. --- .../slate-react/src/plugins/debug/noop.js | 41 ------------------- .../slate-react/src/plugins/react/index.js | 3 -- 2 files changed, 44 deletions(-) delete mode 100644 packages/slate-react/src/plugins/debug/noop.js diff --git a/packages/slate-react/src/plugins/debug/noop.js b/packages/slate-react/src/plugins/debug/noop.js deleted file mode 100644 index d68dfa15d..000000000 --- a/packages/slate-react/src/plugins/debug/noop.js +++ /dev/null @@ -1,41 +0,0 @@ -import EVENT_HANDLERS from '../../constants/event-handlers' - -/** - * A plugin immediately after any Debug plugins that prevents events from - * going any further. - * - * The purpose is to see how the editor events and mutations behave without - * the noise of the editor also adding its own events and mutations. - * - * @return {Object} - */ - -function NoopPlugin() { - /** - * Plugin Object - * - * @type {Object} - */ - - const plugin = {} - - for (const eventName of EVENT_HANDLERS) { - plugin[eventName] = function(event, editor, next) {} - } - - /** - * Return the plugin. - * - * @type {Object} - */ - - return plugin -} - -/** - * Export. - * - * @type {Function} - */ - -export default NoopPlugin diff --git a/packages/slate-react/src/plugins/react/index.js b/packages/slate-react/src/plugins/react/index.js index 633151c4c..346c4dd6c 100644 --- a/packages/slate-react/src/plugins/react/index.js +++ b/packages/slate-react/src/plugins/react/index.js @@ -9,7 +9,6 @@ import DOMPlugin from '../dom' import RestoreDOMPlugin from './restore-dom' import DebugEventsPlugin from '../debug/debug-events' import DebugBatchEventsPlugin from '../debug/debug-batch-events' -import NoopPlugin from '../debug/noop' /** * A plugin that adds the React-specific rendering logic to the editor. @@ -26,7 +25,6 @@ function ReactPlugin(options = {}) { const debugBatchEventsPlugin = Debug.enabled('slate:batch-events') ? DebugBatchEventsPlugin(options) : null - const noopPlugin = Debug.enabled('slate:noop') ? NoopPlugin(options) : null const renderingPlugin = RenderingPlugin(options) const commandsPlugin = CommandsPlugin(options) const queriesPlugin = QueriesPlugin(options) @@ -47,7 +45,6 @@ function ReactPlugin(options = {}) { return [ debugEventsPlugin, debugBatchEventsPlugin, - noopPlugin, domPlugin, restoreDomPlugin, placeholderPlugin,