|
1 | 1 | importReactfrom'react'
|
| 2 | +import{Provider}from'mobx-react' |
2 | 3 |
|
| 4 | +importinitRootStorefrom'@stores/init' |
| 5 | +importThemeWrapperfrom'@containers/ThemeWrapper' |
3 | 6 | importRichEditorfrom'@containers/RichEditor'
|
4 | 7 | // import EditorJS from '@editorjs/editorjs'
|
5 | 8 |
|
6 | 9 | consthtml=
|
7 |
| -'<div class="cps-viewer"><h2>Editor.js</h2><p>Hey. Meet the new Editor. On this page you can see it in action — try to edit this text.</p><h3>Key features</h3><ul><li>It is a block-styled editor</li><li>It returns clean data output in JSON</li><li>Designed to be extendable and pluggable with a simple API</li></ul><h3>Key features</h3><ol><li>It is a block-styled editor</li><li>It returns clean data output in JSON</li><li>Designed to be extendable and pluggable with a simple API</li></ol><h3>What does it mean «block-styled editor»</h3><div class="cps-viewer-checklist"><div>This is a block-styled editor</div><div>Clean output data</div><div>Simple and powerful API</div></div><p>Workspace in classic editors is made of a single contenteditable element, used to create different HTML markups. Editor.js <mark class="cdx-marker">workspace consists of separate Blocks: paragraphs, headings, images, lists, quotes, etc</mark>. Each of them is an independent contenteditable element (or more complex structure) provided by Plugin and united by Editor\'s Core.</p><p>There are dozens of <a href="https://github.com/editor-js">ready-to-use Blocks</a> and the <a href="https://editorjs.io/creating-a-block-tool">simple API</a> for creation any Block you need. For example, you can implement Blocks for Tweets, Instagram posts, surveys and polls, CTA-buttons and even games.</p><h3>What does it mean clean data output</h3><p>Classic WYSIWYG-editors produce raw HTML-markup with both content data and content appearance. On the contrary, Editor.js outputs JSON object with data of each Block. You can see an example below</p><p>Given data can be used as you want: render with HTML for <code class="inline-code">Web clients</code>, render natively for <code class="inline-code">mobile apps</code>, create markup for <code class="inline-code">Facebook Instant Articles</code> or <code class="inline-code">Google AMP</code>, generate an <code class="inline-code">audio version</code> and so on.</p><p>Clean data is useful to sanitize, validate and process on the backend.</p><div class="cps-viewer-delimiter"></div><p>We have been working on this project more than three years. Several large media projects help us to test and debug the Editor, to make it\'s core more stable. At the same time we significantly improved the API. Now, it can be used to create any plugin for any task. Hope you enjoy. 😏</p><div class="cps-viewer-image"><img src="https://codex.so/upload/redactor_images/o_e48549d1855c7fc1807308dd14990126.jpg" /></div><div class="cps-viewer-linker"><a href="https://www.github.com">https://www.github.com</a></div><div class="cps-viewer-quote">quote demo text</div><div>' |
| 10 | +'<div class="cps-viewer"><h2 class="cps-viewer-header">Editor.js</h2><p class="cps-viewer-paragraph">Hey. Meet the new Editor. On this page you can see it in action — try to edit this text.</p><h3 class="cps-viewer-header">Key features</h3><ul><li>It is a block-styled editor</li><li>It returns clean data output in JSON</li><li>Designed to be extendable and pluggable with a simple API</li></ul><h3 class="cps-viewer-header">Key features</h3><ol><li>It is a block-styled editor</li><li>It returns clean data output in JSON</li><li>Designed to be extendable and pluggable with a simple API</li></ol><h3 class="cps-viewer-header">What does it mean «block-styled editor»</h3><div class="cps-viewer-checklist"><div>This is a block-styled editor</div><div>Clean output data</div><div>Simple and powerful API</div></div><p class="cps-viewer-paragraph">Workspace in classic editors is made of a single contenteditable element, used to create different HTML markups. Editor.js <mark class="cdx-marker">workspace consists of separate Blocks: paragraphs, headings, images, lists, quotes, etc</mark>. Each of them is an independent contenteditable element (or more complex structure) provided by Plugin and united by Editor\'s Core.</p><p class="cps-viewer-paragraph">There are dozens of <a href="https://github.com/editor-js">ready-to-use Blocks</a> and the <a href="https://editorjs.io/creating-a-block-tool">simple API</a> for creation any Block you need. For example, you can implement Blocks for Tweets, Instagram posts, surveys and polls, CTA-buttons and even games.</p><h3 class="cps-viewer-header">What does it mean clean data output</h3><p class="cps-viewer-paragraph">Classic WYSIWYG-editors produce raw HTML-markup with both content data and content appearance. On the contrary, Editor.js outputs JSON object with data of each Block. You can see an example below</p><p class="cps-viewer-paragraph">Given data can be used as you want: render with HTML for <code class="inline-code">Web clients</code>, render natively for <code class="inline-code">mobile apps</code>, create markup for <code class="inline-code">Facebook Instant Articles</code> or <code class="inline-code">Google AMP</code>, generate an <code class="inline-code">audio version</code> and so on.</p><p class="cps-viewer-paragraph">Clean data is useful to sanitize, validate and process on the backend.</p><div class="cps-viewer-delimiter"></div><p class="cps-viewer-paragraph">We have been working on this project more than three years. Several large media projects help us to test and debug the Editor, to make it\'s core more stable. At the same time we significantly improved the API. Now, it can be used to create any plugin for any task. Hope you enjoy. 😏</p><div class="cps-viewer-image"><img src="https://codex.so/upload/redactor_images/o_e48549d1855c7fc1807308dd14990126.jpg" /></div><div class="cps-viewer-linker"><a href="https://www.github.com">https://www.github.com</a></div><div class="cps-viewer-quote">quote demo text</div><div>' |
8 | 11 |
|
9 | 12 | constEditor=()=>{
|
| 13 | +conststore=initRootStore({langSetup:{}}) |
| 14 | + |
10 | 15 | return(
|
11 |
| -<div |
12 |
| -style={{ |
13 |
| -border:'1px solid lightgrey', |
14 |
| -width:'800px', |
15 |
| -margin:'10% 20%', |
16 |
| -}} |
17 |
| -> |
18 |
| -<div |
19 |
| -dangerouslySetInnerHTML={{ |
20 |
| -__html:html, |
21 |
| -}} |
22 |
| -/> |
23 |
| -<hr/> |
24 |
| -<br/> |
25 |
| -<RichEditor/> |
26 |
| -</div> |
| 16 | +<Providerstore={store}> |
| 17 | +<ThemeWrapper> |
| 18 | +<div |
| 19 | +style={{ |
| 20 | +border:'1px solid lightgrey', |
| 21 | +background:'lightgrey', |
| 22 | +width:'100%', |
| 23 | +padding:'30px', |
| 24 | +height:'100%', |
| 25 | +}} |
| 26 | +> |
| 27 | +<div |
| 28 | +dangerouslySetInnerHTML={{ |
| 29 | +__html:html, |
| 30 | +}} |
| 31 | +/> |
| 32 | +<hr/> |
| 33 | +<br/> |
| 34 | +<RichEditor/> |
| 35 | +</div> |
| 36 | +</ThemeWrapper> |
| 37 | +</Provider> |
27 | 38 | )
|
28 | 39 | }
|
29 | 40 |
|
|