Skip to content
This repository was archived by the owner on May 31, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions packages/atomic-block/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# djs@atomic-block - Not released, please use with caution ;)
# @djsp/atomic-block

![file size](http://img.badgesize.io/https://unpkg.com/@djsp/atomic-block/dist/index.js?label=size&style=flat-square)
[![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)

## Installation

Example:
`@djsp/atomic-block` depends on `@djsp/utils` which must also be installed.

```sh
npm install --save @djsp/utils @djsp/atomic-block
# or alternately
yarn add @djsp/utils @djsp/atomic-block
```

## Usage

```jsx
<EditorContainer>
Expand All @@ -19,3 +28,6 @@ Example:
</AtomicBlock>
</EditorContainer>
```

## Examples
- [Editor with image](https://codesandbox.io/s/github/draft-js-plugins/next/tree/master/examples/atomic-block)
5 changes: 3 additions & 2 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {

### Usage

`EditorContainer` contains all props for the draft js Editor which it passes down to plugins and the `Editor` via the React context api.
`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).

```js
import { EditorContainer } from '@djsp/core'
Expand All @@ -38,6 +38,7 @@ Here are the props that `EditorContainer` accepts, all of the below props are in
| - | - | - | - |
| `editorState` | `EditorState` | required | The state of the editor. Identical to the [draft js editorState prop](https://draftjs.org/docs/api-reference-editor#editorstate) |
| `onChange` | `(EditorState) => void` | required | Fired when content changes. Identical to the [draft js onChange prop](https://draftjs.org/docs/api-reference-editor#onchange) |
| `editorKey` | `string` | optional | Overrides [props set via plugin](#setEditorProps) |
| `textAlignment` | `"left" or "center" or "right"` | optional | Overrides [props set via plugin](#setEditorProps) |
| `textDirectionality` | `"LTR" or "RTL"` | optional | Overrides [props set via plugin](#setEditorProps) |
| `placeholder` | `string` | optional | Overrides [props set via plugin](#setEditorProps) |
Expand Down Expand Up @@ -139,7 +140,7 @@ The `Plugin` also accepts an optional render prop which exposes the plugin conte
| - | - | - |
| `editorState` | `EditorState` | The `EditorState` object |
| `setEditorState` | `(editorState: EditorState) => void` | Lets you update the editorState |
| `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` |
| `editorProps` | `Object` | Contains the [props for `EditorContainer`](#props) except `editorState` and `onChange` |
| `setEditorProps` | `(editorProps: Object) => void` | lets you set the above editorProps. Be aware that editor props set via Plugins are overridden by `EditorContainer` props |
| `editorRef` | `Ref<DraftEditor>` | A React reference to the draft js editor |

Expand Down