diff --git a/examples/draft-0-9-1/color/color.html b/examples/draft-0-9-1/color/color.html deleted file mode 100644 index f82955a6db..0000000000 --- a/examples/draft-0-9-1/color/color.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - Draft • Color - - - -
- This example demonstrates how custom inline styles can be used to create - editors with an unlimited range of style combinations. Note also that - the state of the editor can be manipulated to enforce that only one - color may be active at any time. -
-
- - - - - - - - - diff --git a/examples/draft-0-9-1/convertFromHTML/convert.html b/examples/draft-0-9-1/convertFromHTML/convert.html deleted file mode 100644 index d5752e8bad..0000000000 --- a/examples/draft-0-9-1/convertFromHTML/convert.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - Draft • Convert from HTML - - - -
- - - - - - - - - diff --git a/examples/draft-0-9-1/entity/entity.html b/examples/draft-0-9-1/entity/entity.html deleted file mode 100644 index dfc7de72bf..0000000000 --- a/examples/draft-0-9-1/entity/entity.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - Draft • Entity Editor - - - -
- - - - - - - - - diff --git a/examples/draft-0-9-1/link/link.html b/examples/draft-0-9-1/link/link.html deleted file mode 100644 index fc57df632d..0000000000 --- a/examples/draft-0-9-1/link/link.html +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - Draft • Link Editor - - - -
- - - - - - - - - diff --git a/examples/draft-0-9-1/media/media.html b/examples/draft-0-9-1/media/media.html deleted file mode 100644 index c4f585e190..0000000000 --- a/examples/draft-0-9-1/media/media.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - Draft • Media Editor - - - -
- - - - - - - - - diff --git a/examples/draft-0-9-1/media/media.mp3 b/examples/draft-0-9-1/media/media.mp3 deleted file mode 100644 index 05f1bfb2e1..0000000000 Binary files a/examples/draft-0-9-1/media/media.mp3 and /dev/null differ diff --git a/examples/draft-0-9-1/media/media.mp4 b/examples/draft-0-9-1/media/media.mp4 deleted file mode 100644 index 8afa96ecf4..0000000000 Binary files a/examples/draft-0-9-1/media/media.mp4 and /dev/null differ diff --git a/examples/draft-0-9-1/media/media.png b/examples/draft-0-9-1/media/media.png deleted file mode 100644 index 3da03c55f7..0000000000 Binary files a/examples/draft-0-9-1/media/media.png and /dev/null differ diff --git a/examples/draft-0-9-1/plaintext/plaintext.html b/examples/draft-0-9-1/plaintext/plaintext.html deleted file mode 100644 index 4176265926..0000000000 --- a/examples/draft-0-9-1/plaintext/plaintext.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - Draft • Plain Text Editor - - - -
- - - - - - - - - diff --git a/examples/draft-0-9-1/rich/RichEditor.css b/examples/draft-0-9-1/rich/RichEditor.css deleted file mode 100644 index f6eb65c0ca..0000000000 --- a/examples/draft-0-9-1/rich/RichEditor.css +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. - * - * This file provided by Facebook is for non-commercial testing and evaluation - * purposes only. Facebook reserves all rights not expressly granted. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -.RichEditor-root { - background: #fff; - border: 1px solid #ddd; - font-family: 'Georgia', serif; - font-size: 14px; - padding: 15px; -} - -.RichEditor-editor { - border-top: 1px solid #ddd; - cursor: text; - font-size: 16px; - margin-top: 10px; -} - -.RichEditor-editor .public-DraftEditorPlaceholder-root, -.RichEditor-editor .public-DraftEditor-content { - margin: 0 -15px -15px; - padding: 15px; -} - -.RichEditor-editor .public-DraftEditor-content { - min-height: 100px; -} - -.RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root { - display: none; -} - -.RichEditor-editor .RichEditor-blockquote { - border-left: 5px solid #eee; - color: #666; - font-family: 'Hoefler Text', 'Georgia', serif; - font-style: italic; - margin: 16px 0; - padding: 10px 20px; -} - -.RichEditor-editor .public-DraftStyleDefault-pre { - background-color: rgba(0, 0, 0, 0.05); - font-family: 'Inconsolata', 'Menlo', 'Consolas', monospace; - font-size: 16px; - padding: 20px; -} - -.RichEditor-controls { - font-family: 'Helvetica', sans-serif; - font-size: 14px; - margin-bottom: 5px; - user-select: none; -} - -.RichEditor-styleButton { - color: #999; - cursor: pointer; - margin-right: 16px; - padding: 2px 0; - display: inline-block; -} - -.RichEditor-activeButton { - color: #5890ff; -} diff --git a/examples/draft-0-9-1/rich/rich.html b/examples/draft-0-9-1/rich/rich.html deleted file mode 100644 index e464592fb2..0000000000 --- a/examples/draft-0-9-1/rich/rich.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - Draft • Rich Text - - - - - -
- - - - - - - - - diff --git a/examples/draft-0-9-1/tex/.babelrc b/examples/draft-0-9-1/tex/.babelrc deleted file mode 100644 index 9d8d516562..0000000000 --- a/examples/draft-0-9-1/tex/.babelrc +++ /dev/null @@ -1 +0,0 @@ -{ "presets": ["es2015"] } diff --git a/examples/draft-0-9-1/tex/js/app.js b/examples/draft-0-9-1/tex/js/app.js deleted file mode 100644 index 2717c2a8bb..0000000000 --- a/examples/draft-0-9-1/tex/js/app.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. - * - * This file provided by Facebook is for non-commercial testing and evaluation - * purposes only. Facebook reserves all rights not expressly granted. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -'use strict'; - -import TeXEditorExample from './components/TeXEditorExample'; -import React from 'react'; -import ReactDOM from 'react-dom'; - -ReactDOM.render( - , - document.getElementById('target'), -); diff --git a/examples/draft-0-9-1/tex/js/components/TeXBlock.js b/examples/draft-0-9-1/tex/js/components/TeXBlock.js deleted file mode 100644 index 8631d6485b..0000000000 --- a/examples/draft-0-9-1/tex/js/components/TeXBlock.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. - * - * This file provided by Facebook is for non-commercial testing and evaluation - * purposes only. Facebook reserves all rights not expressly granted. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -'use strict'; - -import katex from 'katex'; -import React from 'react'; -import {Entity} from 'draft-js'; - -class KatexOutput extends React.Component { - constructor(props) { - super(props); - } - - _update() { - katex.render( - this.props.content, - this.container, - {displayMode: true}, - ); - } - - componentDidMount() { - this._update(); - } - - componentDidUpdate(prevProps, prevState) { - if (prevProps.content !== this.props.content) { - this._update(); - } - } - - render() { - return ( -
this.container = ref} - onClick={this.props.onClick} - /> - ); - } -} - -export default class TeXBlock extends React.Component { - constructor(props) { - super(props); - this.state = {editMode: false}; - - this._onClick = () => { - if (this.state.editMode) { - return; - } - - this.setState({ - editMode: true, - texValue: this._getValue(), - }, () => { - this._startEdit(); - }); - }; - - this._onValueChange = evt => { - var value = evt.target.value; - var invalid = false; - try { - katex.__parse(value); - } catch (e) { - invalid = true; - } finally { - this.setState({ - invalidTeX: invalid, - texValue: value, - }); - } - }; - - this._save = () => { - var entityKey = this.props.block.getEntityAt(0); - Entity.mergeData(entityKey, {content: this.state.texValue}); - this.setState({ - invalidTeX: false, - editMode: false, - texValue: null, - }, this._finishEdit); - }; - - this._remove = () => { - this.props.blockProps.onRemove(this.props.block.getKey()); - }; - this._startEdit = () => { - this.props.blockProps.onStartEdit(this.props.block.getKey()); - }; - this._finishEdit = () => { - this.props.blockProps.onFinishEdit(this.props.block.getKey()); - }; - } - - _getValue() { - return Entity - .get(this.props.block.getEntityAt(0)) - .getData()['content']; - } - - render() { - var texContent = null; - if (this.state.editMode) { - if (this.state.invalidTeX) { - texContent = ''; - } else { - texContent = this.state.texValue; - } - } else { - texContent = this._getValue(); - } - - var className = 'TeXEditor-tex'; - if (this.state.editMode) { - className += ' TeXEditor-activeTeX'; - } - - var editPanel = null; - if (this.state.editMode) { - var buttonClass = 'TeXEditor-saveButton'; - if (this.state.invalidTeX) { - buttonClass += ' TeXEditor-invalidButton'; - } - - editPanel = -
-