Skip to content
This repository was archived by the owner on May 31, 2020. It is now read-only.

Commit 58e7b19

Browse files
Merge pull request #27 from draft-js-plugins/docs/core-patch
Update docs for core and atomic-block
2 parents 9c969c8 + dced12a commit 58e7b19

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

packages/atomic-block/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
# djs@atomic-block - Not released, please use with caution ;)
1+
# @djsp/atomic-block
22

33
![file size](http://img.badgesize.io/https://unpkg.com/@djsp/atomic-block/dist/index.js?label=size&style=flat-square)
44
[![NPM](https://img.shields.io/npm/v/@djsp/atomic-block.svg)](https://www.npmjs.com/package/@djsp/atomic-block) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
55

6+
## Installation
67

7-
Example:
8+
`@djsp/atomic-block` depends on `@djsp/utils` which must also be installed.
9+
10+
```sh
11+
npm install --save @djsp/utils @djsp/atomic-block
12+
# or alternately
13+
yarn add @djsp/utils @djsp/atomic-block
14+
```
15+
16+
## Usage
817

918
```jsx
1019
<EditorContainer>
@@ -19,3 +28,6 @@ Example:
1928
</AtomicBlock>
2029
</EditorContainer>
2130
```
31+
32+
## Examples
33+
- [Editor with image](https://codesandbox.io/s/github/draft-js-plugins/next/tree/master/examples/atomic-block)

packages/core/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020

2121
### Usage
2222

23-
`EditorContainer` contains all props for the draft js Editor which it passes down to plugins and the `Editor` via the React context api.
23+
`EditorContainer` contains all props for the draft js Editor which it passes down to plugins and the `Editor` via the [React context api](https://reactjs.org/docs/context.html).
2424

2525
```js
2626
import { EditorContainer } from '@djsp/core'
@@ -38,6 +38,7 @@ Here are the props that `EditorContainer` accepts, all of the below props are in
3838
| - | - | - | - |
3939
| `editorState` | `EditorState` | required | The state of the editor. Identical to the [draft js editorState prop](https://draftjs.org/docs/api-reference-editor#editorstate) |
4040
| `onChange` | `(EditorState) => void` | required | Fired when content changes. Identical to the [draft js onChange prop](https://draftjs.org/docs/api-reference-editor#onchange) |
41+
| `editorKey` | `string` | optional | Overrides [props set via plugin](#setEditorProps) |
4142
| `textAlignment` | `"left" or "center" or "right"` | optional | Overrides [props set via plugin](#setEditorProps) |
4243
| `textDirectionality` | `"LTR" or "RTL"` | optional | Overrides [props set via plugin](#setEditorProps) |
4344
| `placeholder` | `string` | optional | Overrides [props set via plugin](#setEditorProps) |
@@ -139,7 +140,7 @@ The `Plugin` also accepts an optional render prop which exposes the plugin conte
139140
| - | - | - |
140141
| `editorState` | `EditorState` | The `EditorState` object |
141142
| `setEditorState` | `(editorState: EditorState) => void` | Lets you update the editorState |
142-
| `editorProps` | `Object` | Contains props that can be set via `setEditorProps`, these are `editorKey` `placeholder` `textAlignment` `textDirectionality` `readOnly` `spellCheck` `stripPastedStyles` `tabIndex` `autoCapitalize` `autoComplete` `autoCorrect` `ariaActiveDescendantID` `ariaAutoComplete` `ariaControls` `ariaDescribedBy` `ariaExpanded` `ariaLabel` `ariaLabelledBy` `ariaMultiline` `webDriverTestID` |
143+
| `editorProps` | `Object` | Contains the [props for `EditorContainer`](#props) except `editorState` and `onChange` |
143144
| `setEditorProps` | `(editorProps: Object) => void` | lets you set the above editorProps. Be aware that editor props set via Plugins are overridden by `EditorContainer` props |
144145
| `editorRef` | `Ref<DraftEditor>` | A React reference to the draft js editor |
145146

0 commit comments

Comments
 (0)