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

Commit 78dd79c

Browse files
Merge branch 'master' into example/divider
2 parents 3778b9f + 880e0ab commit 78dd79c

File tree

7 files changed

+125
-17
lines changed

7 files changed

+125
-17
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ script:
77
- ./node_modules/.bin/lerna bootstrap --hoist
88
- npm run build
99
- npm run lint
10-
- npm run flow

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# draft-js-plugins@next
22
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors)
33
![Build Status](https://travis-ci.org/draft-js-plugins/next.svg?branch=master)
4+
![codeship](https://img.shields.io/codeship/julian-little-haze-31/master.svg)
45

56
# DISCLAIMER: This project isn't usable yet
67

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
},
4848
"husky": {
4949
"hooks": {
50-
"pre-commit": "yarn format && yarn lint"
50+
"pre-commit": "npm run format",
51+
"pre-push": "npm run lint && npm test && npm run flow"
5152
}
5253
},
5354
"dependencies": {}

packages/atomic-block/README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
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
6+
[Atomic blocks](https://draftjs.org/docs/advanced-topics-block-components#defining-custom-block-components) are draft-js's abstraction for displaying media that isn't text. Like images or embedded videos.
7+
8+
The Atomic block plugin solves two common problems:
9+
- Focusing atomic blocks.
10+
- Keyboard interaction with atomic blocks.
711

8-
`@djsp/atomic-block` depends on `@djsp/utils` which must also be installed.
12+
## Installation
913

1014
```sh
11-
npm install --save @djsp/utils @djsp/atomic-block
15+
npm install --save @djsp/utils @djsp/core @djsp/atomic-block
1216
# or alternately
1317
yarn add @djsp/utils @djsp/atomic-block
1418
```
@@ -29,6 +33,14 @@ yarn add @djsp/utils @djsp/atomic-block
2933
</EditorContainer>
3034
```
3135

36+
## API Props
37+
38+
- `type` - A `string`. Entity type of the atomic block. e.g. `IMAGE`, `VIDEO`, `EMBED` or whatever you want to call your block type :)
39+
- `children` - Render Prop.
40+
41+
42+
43+
3244
## Examples
3345
- [Editor with image](https://codesandbox.io/s/github/draft-js-plugins/next/tree/master/examples/atomic-block)
3446
- [Editor with divider](https://codesandbox.io/s/github/draft-js-plugins/next/tree/master/examples/divider-example)

packages/atomic-block/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const setSelection = (
7272
)
7373
}
7474

75-
class AtomicBlockPlugin extends Component<Props, State> {
75+
class AtomicBlockPlugin extends Component<Props> {
7676
unregister: () => void
7777

7878
constructor(props) {

packages/utils/package-lock.json

Lines changed: 105 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"files": [
3636
"dist"
3737
],
38-
"peerDependencies": {
38+
"dependencies": {
3939
"draft-js": "^0.10.5"
4040
}
4141
}

0 commit comments

Comments
 (0)