mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-03-10 00:10:18 +01:00
* rename state to value in slate core, as deprecation * rename all references to state to value in slate core * migrate slate-base64-serializer * migrate slate-html-serializer * migrate slate-hyperscript * migrate slate-plain-serializer * migrate slate-prop-types * migrate slate-simulator * fix change.setState compat * deprecate references to state in slate-react * remove all references to state in slate-react * remove `value` and `schema` from props to all components * fix default renderPlaceholder * fix tests * update examples * update walkthroughs * update guides * update reference
47 lines
716 B
JavaScript
47 lines
716 B
JavaScript
|
|
/** @jsx h */
|
|
|
|
import h from '../helpers/h'
|
|
|
|
export const config = {
|
|
rules: [
|
|
{
|
|
deserialize(el, next) {
|
|
switch (el.tagName.toLowerCase()) {
|
|
case 'p': {
|
|
return {
|
|
kind: '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>
|
|
)
|