chore: builds

This commit is contained in:
James
2024-03-07 10:23:12 -05:00
parent 647e0236bb
commit 60e3b21596
15 changed files with 39 additions and 56 deletions

View File

@@ -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

View File

@@ -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,
}