remove unused file
This commit is contained in:
@@ -1,55 +0,0 @@
|
|||||||
import { markIsActive, nodeIsActive, getMarkAttrs } from 'tiptap-utils'
|
|
||||||
|
|
||||||
export default function ({
|
|
||||||
schema, state, commands, editable,
|
|
||||||
}) {
|
|
||||||
|
|
||||||
const nodes = Object.entries(schema.nodes)
|
|
||||||
.map(([name]) => {
|
|
||||||
const active = (attrs = {}) => nodeIsActive(state, schema.nodes[name], attrs)
|
|
||||||
const command = commands[name] ? commands[name] : () => {}
|
|
||||||
|
|
||||||
return {
|
|
||||||
name,
|
|
||||||
active,
|
|
||||||
command: editable ? command : () => {},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.reduce((actions, { name, active, command }) => ({
|
|
||||||
...actions,
|
|
||||||
[name]: {
|
|
||||||
active,
|
|
||||||
command,
|
|
||||||
},
|
|
||||||
}), {})
|
|
||||||
|
|
||||||
const marks = Object.entries(schema.marks)
|
|
||||||
.map(([name]) => {
|
|
||||||
const active = () => markIsActive(state, schema.marks[name])
|
|
||||||
const attrs = getMarkAttrs(state, schema.marks[name])
|
|
||||||
const command = commands[name] ? commands[name] : () => {}
|
|
||||||
|
|
||||||
return {
|
|
||||||
name,
|
|
||||||
active,
|
|
||||||
attrs,
|
|
||||||
command: editable ? command : () => {},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.reduce((actions, {
|
|
||||||
name, active, attrs, command,
|
|
||||||
}) => ({
|
|
||||||
...actions,
|
|
||||||
[name]: {
|
|
||||||
active,
|
|
||||||
attrs,
|
|
||||||
command,
|
|
||||||
},
|
|
||||||
}), {})
|
|
||||||
|
|
||||||
return {
|
|
||||||
nodes,
|
|
||||||
marks,
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
export { default as buildMenuActions } from './buildMenuActions'
|
|
||||||
export { default as builtInKeymap } from './builtInKeymap'
|
export { default as builtInKeymap } from './builtInKeymap'
|
||||||
export { default as ComponentView } from './ComponentView'
|
export { default as ComponentView } from './ComponentView'
|
||||||
export { default as initNodeViews } from './initNodeViews'
|
export { default as initNodeViews } from './initNodeViews'
|
||||||
|
|||||||
Reference in New Issue
Block a user