1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-02 11:42:53 +02:00

add draggable nodes, first steps

This commit is contained in:
Ian Storm Taylor
2016-07-24 17:52:22 -07:00
parent c7fac3456e
commit 3bd000d118
78 changed files with 1405 additions and 143 deletions

View File

@@ -1,11 +1,10 @@
import { Editor, Mark, Raw, Void } from '../..'
import { Editor, Draggable, Raw, Void } from '../..'
import React from 'react'
import ReactDOM from 'react-dom'
import initialState from './state.json'
import isImage from 'is-image'
import isUrl from 'is-url'
import { Map } from 'immutable'
/**
* Define a set of node renderers.
@@ -18,9 +17,11 @@ const NODES = {
const { node, state } = props
const src = node.data.get('src')
return (
<Void {...props} className="image-block">
<img {...props.attributes} src={src} />
</Void>
<Draggable {...props}>
<Void {...props} className="image-block">
<img {...props.attributes} src={src} />
</Void>
</Draggable>
)
}
}