@ridi/ridi-prosemirror-editor
v0.0.3
Published
RIDI Select Article editor and viewer
Downloads
10
Readme
ridi-prosemirror-editor
🚧 This project is under development, not complete yet.
How to use
ArticleEditor
import { ArticleEditor } from '@ridi/ridi-prosemirror-editor';
const existingValue = JSON.parse(localStorage.getItem('content'));
class App extends Component {
onChange = (value) => {
localStorage.setItem('content', JSON.stringify(value.toJSON()));
};
render() {
return (
<ArticleEditor
initialValue={existingValue}
onChange={this.onChange}
/>
);
}
}
ReactDOM.render(
<App />,
document.getElementById('root'),
);
Article
import { Article } from '@ridi/ridi-prosemirror-editor';
const existingValue = JSON.parse(localStorage.getItem('content'));
ReactDOM.render(
<Article
json={existingValue}
style={{
background: 'white',
padding: '16px',
}}
/>,
document.getElementById('root'),
);
Development
To build
yarn build
To see demos with webpack-dev-server
cd playground
yarn start