1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 01:50:06 +02:00

refactor examples

This commit is contained in:
Ian Storm Taylor
2016-06-24 10:22:48 -07:00
parent 69d2a55d33
commit 2743c3741d
21 changed files with 259 additions and 330 deletions

View File

@@ -1,12 +0,0 @@
html {
background: #eee;
padding: 20px;
}
main {
background: #fff;
padding: 10px;
max-width: 40em;
margin: 0 auto;
}

View File

@@ -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>

View File

@@ -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