mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 06:01:24 +02:00
This reverts commit b71fdbbb3d
.
This commit is contained in:
@@ -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
|
|
@@ -9,7 +9,6 @@ import DOMPlugin from '../dom'
|
|||||||
import RestoreDOMPlugin from './restore-dom'
|
import RestoreDOMPlugin from './restore-dom'
|
||||||
import DebugEventsPlugin from '../debug/debug-events'
|
import DebugEventsPlugin from '../debug/debug-events'
|
||||||
import DebugBatchEventsPlugin from '../debug/debug-batch-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.
|
* 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')
|
const debugBatchEventsPlugin = Debug.enabled('slate:batch-events')
|
||||||
? DebugBatchEventsPlugin(options)
|
? DebugBatchEventsPlugin(options)
|
||||||
: null
|
: null
|
||||||
const noopPlugin = Debug.enabled('slate:noop') ? NoopPlugin(options) : null
|
|
||||||
const renderingPlugin = RenderingPlugin(options)
|
const renderingPlugin = RenderingPlugin(options)
|
||||||
const commandsPlugin = CommandsPlugin(options)
|
const commandsPlugin = CommandsPlugin(options)
|
||||||
const queriesPlugin = QueriesPlugin(options)
|
const queriesPlugin = QueriesPlugin(options)
|
||||||
@@ -47,7 +45,6 @@ function ReactPlugin(options = {}) {
|
|||||||
return [
|
return [
|
||||||
debugEventsPlugin,
|
debugEventsPlugin,
|
||||||
debugBatchEventsPlugin,
|
debugBatchEventsPlugin,
|
||||||
noopPlugin,
|
|
||||||
domPlugin,
|
domPlugin,
|
||||||
restoreDomPlugin,
|
restoreDomPlugin,
|
||||||
placeholderPlugin,
|
placeholderPlugin,
|
||||||
|
Reference in New Issue
Block a user