Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Update deps for and cleanup playground example (#2368)
Browse files Browse the repository at this point in the history
Summary:
**Summary**

The "playground" example needed some work: there were unused files, the link to the docs was out of date, the dependencies were out of date, and there were some CSS improvements to make panel resizing better. I apply said improvements in this change.

**Test Plan**

`yarn && yarn start` + play with the example.
Pull Request resolved: #2368

Reviewed By: claudiopro

Differential Revision: D20680357

Pulled By: mrkev

fbshipit-source-id: 305271e7bb6d4fa0f7cb1135827256fc2fafdcb0
  • Loading branch information
mrkev authored and facebook-github-bot committed Mar 31, 2020
1 parent d53fa7a commit 2658dd6
Show file tree
Hide file tree
Showing 8 changed files with 2,591 additions and 2,706 deletions.
18 changes: 9 additions & 9 deletions examples/draft-0-10-0/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"codemirror": "^5.32.0",
"draft-convert": "^2.0.1",
"codemirror": "^5.52.2",
"draft-convert": "^2.1.8",
"draft-js": "file:../../..",
"immutable": "^3.8.2",
"react": "^16.2.0",
"react-app-polyfill": "^1.0.4",
"react-codemirror2": "^3.0.7",
"react-dom": "^16.2.0",
"react-json-tree": "^0.11.0",
"react-panelgroup": "^1.0.5",
"react-scripts": "3.2.0"
"react": "^16.13.1",
"react-app-polyfill": "^1.0.6",
"react-codemirror2": "^7.1.0",
"react-dom": "^16.13.1",
"react-json-tree": "^0.11.2",
"react-panelgroup": "^1.0.10",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
4 changes: 0 additions & 4 deletions examples/draft-0-10-0/playground/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@
background: var(--main-background) !important;
}

.RichEditor-editor {
padding: 10px 20px;
}

/**
* basic style for handling nested lists
*/
Expand Down
9 changes: 3 additions & 6 deletions examples/draft-0-10-0/playground/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @format
*/

import React, {Component} from 'react';
import React from 'react';
import './DraftJsPlaygroundContainer.css';
import {Controlled as CodeMirror} from 'react-codemirror2';
import 'codemirror/lib/codemirror.css';
Expand Down Expand Up @@ -92,7 +92,7 @@ const BASE_CONTENT = {
html: baseHtmlContent,
};

class DraftJsPlaygroundContainer extends Component {
class DraftJsPlaygroundContainer extends React.Component {
constructor(props: Props) {
super(props);
this.state = {
Expand Down Expand Up @@ -133,13 +133,11 @@ class DraftJsPlaygroundContainer extends Component {

_setHTMLContent(html) {
const parsedHtml = fromHTML(html);

if (!parsedHtml) {
return;
}

const {contentBlocks, entityMap} = parsedHtml;

if (!contentBlocks) {
return;
}
Expand All @@ -160,7 +158,6 @@ class DraftJsPlaygroundContainer extends Component {

setContent = () => {
const {mode, codeMirrorValue} = this.state;

if (mode === 'html') {
this._setHTMLContent(codeMirrorValue);
} else {
Expand Down Expand Up @@ -224,7 +221,7 @@ class DraftJsPlaygroundContainer extends Component {
<a
target="_blank"
rel="noopener noreferrer"
href="https://draftjs.org/docs/overview.html#content">
href="https://draftjs.org/docs/getting-started">
Docs
</a>
</li>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
.DraftJsPlaygroundContainer-editor {
padding: 0;
background: #fff;
padding-top: 30px;
height: auto;
}

Expand All @@ -29,7 +28,6 @@
.RichEditor-editor {
cursor: text;
font-size: 16px;
margin-top: 10px;
}

.RichEditor-editor .public-DraftEditorPlaceholder-root,
Expand Down Expand Up @@ -63,9 +61,6 @@
}

.RichEditor-controls-container {
position: fixed;
top: 50px;
padding: 20px 0 0;
border-bottom: 1px solid #ccc;
background: #fff;
z-index: 10;
Expand Down
Loading

0 comments on commit 2658dd6

Please sign in to comment.