Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
});
state = Value.fromJSON({
document: {
nodes: newValue.nodes,
kind: 'document',
data: { signal },
},
kind: 'value',
});
} else {
state = Plain.deserialize('');
}
return {
value: state,
base64: Base64.serialize(state),
toc: value && value.toc,
};
}),
stateWrapper,
propagateChange = value => {
this.base64 = Base64.serialize(value);
if (this.base64 !== this.props.base64) {
const json = value.toJSON();
const { nodes } = json.document;
let text = '';
let title = null;
let image = null;
this.getAllBlocks(value.document.nodes, (node, parent) => {
if (
node.type === 'paragraph' &&
(!parent ||
(parent.type && parent.type.indexOf('heading') === -1)) &&
node.text
) {
text += `${node.text}\n`;
}
if (