Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createP = () =>
Raw.deserializeNode({
kind: 'block',
type: 'paragraph',
nodes: [{ kind: 'text', text: '', ranges: [] }],
});toggle: ({ key }) => {
const p = Raw.deserializeNode({ kind: 'block', type: 'line', nodes: [{ kind: 'text', text: '', ranges: [] }] });
if (key === '+<<') {
const parent = state.document.getParent(node.key) || node;
editor.onChange(
state.transform()
.insertNodeByKey(parent.key, parent.nodes.indexOf(node), p)
.apply()
);
} else if (key === '-<<') {
editor.onChange(
state.transform()
.removeNodeByKey(prev.key)
.apply()
);
} else if (key === '+>>') {
const parent = state.document.getParent(node.key) || node;
editor.onChange(const createP = () => Raw.deserializeNode({ kind: 'block', type: 'paragraph', nodes: [{ kind: 'text', text: '', ranges: [] }] });const empty = () =>
Raw.deserializeNode({
kind: 'block',
type: 'paragraph',
nodes: [{ kind: 'text', text: '', ranges: [] }],
});
export default items =>const empty = () =>
Raw.deserializeNode({
kind: 'block',
type: 'paragraph',
nodes: [{ kind: 'text', text: '', ranges: [] }],
});
export default items =>setIndex(index, item) {
const nextDocument = this.document.setIn(['nodes', index], Raw.deserializeNode(sanityBlockNodeToSlateRaw(item)))
return new SlateValueContainer(nextDocument, this.context)
}toggle: ({ key }) => {
const p = Raw.deserializeNode({ kind: 'block', type: 'paragraph', nodes: [{ kind: 'text', text: '', ranges: [] }] });
if (key === '+<<') {
const parent = state.document.getParent(node.key) || node;
editor.onChange(
state.transform()
.insertNodeByKey(parent.key, parent.nodes.indexOf(node), p)
.apply()
);
} else if (key === '-<<') {
editor.onChange(
state.transform()
.removeNodeByKey(prev.key)
.apply()
);
} else if (key === '+>>') {
const parent = state.document.getParent(node.key) || node;
editor.onChange( const insertNodes = jsonNodes.map(node => Raw.deserializeNode(nodeToRaw(node)))toggle: ({ key }) => {
const p = Raw.deserializeNode({ kind: 'block', type: 'paragraph', nodes: [{ kind: 'text', text: '', ranges: [] }] });
if (key === '+<<') {
const parent = state.document.getParent(node.key) || node;
editor.onChange(
state.transform()
.insertNodeByKey(parent.key, parent.nodes.indexOf(node), p)
.apply()
);
} else if (key === '-<<') {
editor.onChange(
state.transform()
.removeNodeByKey(prev.key)
.apply()
);
} else if (key === '+>>') {
const parent = state.document.getParent(node.key) || node;
editor.onChange(setIndex(index, item) {
const nextDocument = this.document.setIn(['nodes', index], Raw.deserializeNode(sanityBlockNodeToSlateRaw(item)))
return new SlateValueContainer(nextDocument, this.context)
}