|
| 1 | +import React, { Component } from 'react'; |
| 2 | + |
| 3 | +// eslint-disable-next-line import/no-unresolved |
| 4 | +import simpleExampleCode from '!!../../../loaders/prism-loader?language=javascript!./DividerWithSideToolbarEditor'; |
| 5 | +// eslint-disable-next-line import/no-unresolved |
| 6 | +import simpleExampleEditorStylesCode from '!!../../../loaders/prism-loader?language=css!./DividerWithSideToolbarEditor/editorStyles.css'; |
| 7 | + |
| 8 | +// eslint-disable-next-line import/no-unresolved |
| 9 | +import gettingStarted from '!!../../../loaders/prism-loader?language=javascript!./gettingStarted'; |
| 10 | +// eslint-disable-next-line import/no-unresolved |
| 11 | +import webpackConfig from '!!../../../loaders/prism-loader?language=javascript!./webpackConfig'; |
| 12 | +// eslint-disable-next-line import/no-unresolved |
| 13 | +import webpackImport from '!!../../../loaders/prism-loader?language=javascript!./webpackImport'; |
| 14 | + |
| 15 | +import Container from '../../shared/Container'; |
| 16 | +import AlternateContainer from '../../shared/AlternateContainer'; |
| 17 | +import Heading from '../../shared/Heading'; |
| 18 | +import styles from './styles.css'; |
| 19 | +import Code from '../../shared/Code'; |
| 20 | +import DividerWithSideToolbarEditor from './DividerWithSideToolbarEditor'; |
| 21 | +import ExternalLink from '../../shared/Link'; |
| 22 | +import InlineCode from '../../shared/InlineCode'; |
| 23 | +import SocialBar from '../../shared/SocialBar'; |
| 24 | +import NavBar from '../../shared/NavBar'; |
| 25 | +import Separator from '../../shared/Separator'; |
| 26 | + |
| 27 | +export default class App extends Component { |
| 28 | + render() { |
| 29 | + return ( |
| 30 | + <div> |
| 31 | + <NavBar /> |
| 32 | + <Separator /> |
| 33 | + <Container> |
| 34 | + <Heading level={2}>Divider</Heading> |
| 35 | + <Heading level={3}>Supported Environment</Heading> |
| 36 | + <ul className={styles.list}> |
| 37 | + <li className={styles.listEntry}>Desktop: Yes</li> |
| 38 | + <li className={styles.listEntry}>Mobile: Yes</li> |
| 39 | + <li className={styles.listEntry}>Screen-reader: Yes</li> |
| 40 | + </ul> |
| 41 | + </Container> |
| 42 | + <AlternateContainer> |
| 43 | + <Heading level={2}>Getting Started</Heading> |
| 44 | + <Code code="npm install draft-js-plugins-editor" /> |
| 45 | + <Code code="npm install draft-js-divider-plugin" /> |
| 46 | + <Code code={gettingStarted} name="gettingStarted.js" /> |
| 47 | + <Heading level={3}>Importing the default styles</Heading> |
| 48 | + <p> |
| 49 | + The plugin ships with a default styling available at this location |
| 50 | + in the installed package: |
| 51 | + <InlineCode |
| 52 | + code={'node_modules/draft-js-divider-plugin/lib/plugin.css'} |
| 53 | + /> |
| 54 | + </p> |
| 55 | + <Heading level={4}>Webpack Usage</Heading> |
| 56 | + <ul className={styles.list}> |
| 57 | + <li className={styles.listEntry}> |
| 58 | + 1. Install Webpack loaders: |
| 59 | + <InlineCode code={'npm i style-loader css-loader --save-dev'} /> |
| 60 | + </li> |
| 61 | + <li className={styles.listEntry}> |
| 62 | + 2. Add the below section to Webpack config (if your config already |
| 63 | + has a loaders array, simply add the below loader object to your |
| 64 | + existing list. |
| 65 | + <Code code={webpackConfig} className={styles.guideCodeBlock} /> |
| 66 | + </li> |
| 67 | + <li className={styles.listEntry}> |
| 68 | + 3. Add the below import line to your component to tell Webpack to |
| 69 | + inject the style to your component. |
| 70 | + <Code code={webpackImport} className={styles.guideCodeBlock} /> |
| 71 | + </li> |
| 72 | + <li className={styles.listEntry}>4. Restart Webpack.</li> |
| 73 | + </ul> |
| 74 | + <Heading level={4}>Browserify Usage</Heading> |
| 75 | + <p> |
| 76 | + Please help, by submiting a Pull Request to the{' '} |
| 77 | + <ExternalLink href="https://github.com/draft-js-plugins/draft-js-plugins/blob/master/docs/client/components/pages/Image/index.js"> |
| 78 | + documentation |
| 79 | + </ExternalLink>. |
| 80 | + </p> |
| 81 | + </AlternateContainer> |
| 82 | + <Container> |
| 83 | + <Heading level={2}>Configuration Parameters</Heading> |
| 84 | + <div className={styles.param}> |
| 85 | + <span className={styles.paramName}>theme</span> |
| 86 | + <span>Object of CSS classes with the following keys.</span> |
| 87 | + <div className={styles.subParams}> |
| 88 | + <div className={styles.subParam}> |
| 89 | + <span className={styles.subParamName}>divider:</span> CSS class |
| 90 | + for the divider. |
| 91 | + </div> |
| 92 | + </div> |
| 93 | + </div> |
| 94 | + <div className={styles.param}> |
| 95 | + <span className={styles.paramName}>entityType</span> |
| 96 | + <span>Entity type for divider. default type is `divider`</span> |
| 97 | + </div> |
| 98 | + <div className={styles.param}> |
| 99 | + <span className={styles.paramName}>dividerComponent</span> |
| 100 | + <span>Pass in a custom divider component to be rendered.</span> |
| 101 | + </div> |
| 102 | + </Container> |
| 103 | + <Container> |
| 104 | + <Heading level={2}>Divider + SideToolbar + Focus Example</Heading> |
| 105 | + <DividerWithSideToolbarEditor /> |
| 106 | + <Code |
| 107 | + code={simpleExampleCode} |
| 108 | + name="DividerWithSideToolbarEditor.js" |
| 109 | + /> |
| 110 | + <Code code={simpleExampleEditorStylesCode} name="editorStyles.css" /> |
| 111 | + </Container> |
| 112 | + <SocialBar /> |
| 113 | + </div> |
| 114 | + ); |
| 115 | + } |
| 116 | +} |
0 commit comments