Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
isLoading: false,
loading: {},
userIsWritingText: false
}
let displayValue = null
try {
displayValue =
deprecatedSchema || deprecatedBlockValue || invalidBlockValue
? deserialize([], type)
: deserialize(value, type)
} catch (err) {
// @ts-ignore
this.state.invalidBlockValue = true
displayValue = deserialize([], type)
}
this._blockContentFeatures = getBlockContentFeatures(type)
const editorSchema = buildEditorSchema(this._blockContentFeatures)
const controllerOpts = {
value: displayValue,
plugins: [
{
schema: editorSchema
}
]
}
this._controller = createEditorController(controllerOpts)
this.operationToPatches = createOperationToPatches(this._blockContentFeatures, type)
this.patchToOperations = createPatchToOperations(this._blockContentFeatures, type)
// @ts-ignore
this.state.editorValue = this._controller.value // Normalized value by editor schema
this._unsubscribePatches = props.subscribe(this.handleDocumentPatches)
this._changeSubscription = this.changes$.subscribe(this.handleChangeSet)