mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-21 14:41:23 +02:00
remove old, undocumented node-level mutating methods
This commit is contained in:
@@ -932,46 +932,6 @@ const Node = {
|
|||||||
return !!this.getClosest(key, parent => parent.isVoid)
|
return !!this.getClosest(key, parent => parent.isVoid)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Insert child `nodes` after child by `key`.
|
|
||||||
*
|
|
||||||
* @param {String or Node} key
|
|
||||||
* @param {List} nodes
|
|
||||||
* @return {Node} node
|
|
||||||
*/
|
|
||||||
|
|
||||||
insertChildrenAfter(key, nodes) {
|
|
||||||
const child = this.assertChild(key)
|
|
||||||
const index = this.nodes.indexOf(child)
|
|
||||||
|
|
||||||
nodes = this.nodes
|
|
||||||
.slice(0, index + 1)
|
|
||||||
.concat(nodes)
|
|
||||||
.concat(this.nodes.slice(index + 1))
|
|
||||||
|
|
||||||
return this.merge({ nodes })
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Insert child `nodes` before child by `key`.
|
|
||||||
*
|
|
||||||
* @param {String or Node} key
|
|
||||||
* @param {List} nodes
|
|
||||||
* @return {Node} node
|
|
||||||
*/
|
|
||||||
|
|
||||||
insertChildrenBefore(key, nodes) {
|
|
||||||
const child = this.assertChild(key)
|
|
||||||
const index = this.nodes.indexOf(child)
|
|
||||||
|
|
||||||
nodes = this.nodes
|
|
||||||
.slice(0, index)
|
|
||||||
.concat(nodes)
|
|
||||||
.concat(this.nodes.slice(index))
|
|
||||||
|
|
||||||
return this.merge({ nodes })
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert a `node` at `index`.
|
* Insert a `node` at `index`.
|
||||||
*
|
*
|
||||||
@@ -1129,34 +1089,6 @@ const Node = {
|
|||||||
return node
|
return node
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove children after a child by `key`.
|
|
||||||
*
|
|
||||||
* @param {String or Node} key
|
|
||||||
* @return {Node} node
|
|
||||||
*/
|
|
||||||
|
|
||||||
removeChildrenAfter(key) {
|
|
||||||
const child = this.assertChild(key)
|
|
||||||
const index = this.nodes.indexOf(child)
|
|
||||||
const nodes = this.nodes.slice(0, index + 1)
|
|
||||||
return this.merge({ nodes })
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove children after a child by `key`, including the child.
|
|
||||||
*
|
|
||||||
* @param {String or Node} key
|
|
||||||
* @return {Node} node
|
|
||||||
*/
|
|
||||||
|
|
||||||
removeChildrenAfterIncluding(key) {
|
|
||||||
const child = this.assertChild(key)
|
|
||||||
const index = this.nodes.indexOf(child)
|
|
||||||
const nodes = this.nodes.slice(0, index)
|
|
||||||
return this.merge({ nodes })
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a `node` from the children node map.
|
* Remove a `node` from the children node map.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user