chore: builds
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
import elementTypes from './elements/index.js'
|
||||
import leafTypes from './leaves/index.js'
|
||||
|
||||
const addPluginReducer = (EditorWithPlugins, plugin) => {
|
||||
if (typeof plugin === 'function') return plugin(EditorWithPlugins)
|
||||
return EditorWithPlugins
|
||||
}
|
||||
|
||||
const enablePlugins = (CreatedEditor, functions) =>
|
||||
functions.reduce((CreatedEditorWithPlugins, func) => {
|
||||
if (typeof func === 'object' && Array.isArray(func.plugins)) {
|
||||
return func.plugins.reduce(addPluginReducer, CreatedEditorWithPlugins)
|
||||
}
|
||||
|
||||
if (typeof func === 'string') {
|
||||
if (elementTypes[func] && elementTypes[func].plugins) {
|
||||
return elementTypes[func].plugins.reduce(addPluginReducer, CreatedEditorWithPlugins)
|
||||
}
|
||||
|
||||
if (leafTypes[func] && leafTypes[func].plugins) {
|
||||
return leafTypes[func].plugins.reduce(addPluginReducer, CreatedEditorWithPlugins)
|
||||
}
|
||||
}
|
||||
|
||||
return CreatedEditorWithPlugins
|
||||
}, CreatedEditor)
|
||||
|
||||
export default enablePlugins
|
||||
@@ -1,15 +0,0 @@
|
||||
import { H1 } from './H1/index.js'
|
||||
import { H2 } from './H2/index.js'
|
||||
import { H3 } from './H3/index.js'
|
||||
import { H4 } from './H4/index.js'
|
||||
import { H5 } from './H5/index.js'
|
||||
import { H6 } from './H6/index.js'
|
||||
|
||||
export default {
|
||||
H1,
|
||||
H2,
|
||||
H3,
|
||||
H4,
|
||||
H5,
|
||||
H6,
|
||||
}
|
||||
Reference in New Issue
Block a user