1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-03-10 00:10:18 +01:00
Ian Storm Taylor 5444a300b8
rename kind to object for clarity (#1501)
* rename `kind` to `object` for clarity

* add deprecation warning for direct access

* add deprecation warning for node creation
2018-01-04 15:26:53 -08:00

47 lines
718 B
JavaScript

/** @jsx h */
import h from '../helpers/h'
export const config = {
rules: [
{
deserialize(el, next) {
switch (el.tagName.toLowerCase()) {
case 'p': {
return {
object: 'block',
type: 'paragraph',
nodes: next(el.childNodes),
}
}
}
}
}
],
defaultBlock: {
type: 'default',
data: {
thing: 'value'
}
}
}
export const input = `
<p>one</p>
<div>two</div>
`.trim()
export const output = (
<value>
<document>
<paragraph>
one
</paragraph>
<block type="default" data={{ thing: 'value' }}>
two
</block>
</document>
</value>
)