mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 01:50:06 +02:00
refactor examples
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
|
||||
html {
|
||||
background: #eee;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
main {
|
||||
background: #fff;
|
||||
padding: 10px;
|
||||
max-width: 40em;
|
||||
margin: 0 auto;
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Editor | Plain Text Example</title>
|
||||
<link rel="stylesheet" href="index.css">
|
||||
</head>
|
||||
<body>
|
||||
<main></main>
|
||||
<script src="build.js"></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,7 +1,6 @@
|
||||
|
||||
import Editor, { Character, Document, Block, State, Text } from '../..'
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import state from './state.json'
|
||||
|
||||
/**
|
||||
@@ -41,12 +40,12 @@ function serialize(state) {
|
||||
}
|
||||
|
||||
/**
|
||||
* The example app.
|
||||
* The plain text example.
|
||||
*
|
||||
* @type {Component} App
|
||||
* @type {Component} PlainText
|
||||
*/
|
||||
|
||||
class App extends React.Component {
|
||||
class PlainText extends React.Component {
|
||||
|
||||
/**
|
||||
* Deserialize the initial editor state.
|
||||
@@ -83,9 +82,7 @@ class App extends React.Component {
|
||||
}
|
||||
|
||||
/**
|
||||
* Mount the example app.
|
||||
* Export.
|
||||
*/
|
||||
|
||||
const app = <App />
|
||||
const root = document.body.querySelector('main')
|
||||
ReactDOM.render(app, root)
|
||||
export default PlainText
|
||||
|
Reference in New Issue
Block a user