import React from 'react';
import Block from './Block';
import styles from './index.css';
/* eslint react/prop-types: 0, react/no-multi-comp: 0 */
// Define the default node type.
export const DEFAULT_NODE = 'paragraph';
/**
* Define a schema.
*
* @type {Object}
*/
export const SCHEMA = {
nodes: {
'blockquote': (props) => {props.children},
'unordered_list': props => ,
'header_one': props => {props.children},
'header_two': props => {props.children},
'header_three': props => {props.children},
'header_four': props => {props.children},
'header_five': props => {props.children},
'header_six': props => {props.children},
'list_item': props =>
{props.children},
'paragraph': props => {props.children},
'hr': props => {
const { node, state } = props;
const isFocused = state.selection.hasEdgeIn(node);
const className = isFocused ? styles.active : null;
return (
);
},
'link': (props) => {
const { data } = props.node;
const href = data.get('href');
return {props.children};
},
'image': (props) => {
const { node, state } = props;
const isFocused = state.selection.hasEdgeIn(node);
const className = isFocused ? styles.active : null;
const src = node.data.get('src');
return (
);
}
},
marks: {
BOLD: {
fontWeight: 'bold'
},
ITALIC: {
fontStyle: 'italic'
},
CODE: {
fontFamily: 'monospace',
backgroundColor: '#eee',
padding: '3px',
borderRadius: '4px'
}
}
}