@slate-editor/embed-plugin
Advanced tools
Comparing version 5.0.0-alpha.f7181996 to 5.0.0
{ | ||
"name": "@slate-editor/embed-plugin", | ||
"version": "5.0.0-alpha.f7181996", | ||
"description": "SlateJS embed node content editable plugin.", | ||
"version": "5.0.0", | ||
"description": "SlateJS embed node plugin.", | ||
"main": "dist/index.js", | ||
@@ -12,2 +12,17 @@ "repository": "https://github.com/nossas/slate-editor", | ||
}, | ||
"files": [ | ||
"README.md", | ||
"CHANGELOG.md", | ||
"dist" | ||
], | ||
"keywords": [ | ||
"slate", | ||
"rich-text", | ||
"editor", | ||
"react", | ||
"slate-plugins" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/nossas/slate-editor/issues" | ||
}, | ||
"scripts": { | ||
@@ -17,5 +32,8 @@ "prepare": "babel src --out-dir dist --copy-files" | ||
"dependencies": { | ||
"@slate-editor/components": "^5.0.0-alpha.f7181996", | ||
"@slate-editor/utils": "^5.0.0-alpha.f7181996", | ||
"react": "^16.2.0" | ||
"@slate-editor/components": "^5.0.0", | ||
"@slate-editor/utils": "^5.0.0", | ||
"classnames": "^2.2.5", | ||
"exenv": "^1.2.1", | ||
"react": "^16.2.0", | ||
"react-fontawesome": "^1.6.1" | ||
}, | ||
@@ -22,0 +40,0 @@ "devDependencies": { |
@@ -1,13 +0,45 @@ | ||
<img src="https://www.psdmockups.com/wp-content/uploads/2016/07/slatejs-520x292.jpg" alt="Nossas Cidades logo" title="Nossas Cidades" align="right" height="70"/> | ||
<img src="https://avatars2.githubusercontent.com/u/1479357?v=3&s=250" alt="Nossas Cidades logo" title="Nossas Cidades" align="right" height="70"/> | ||
<div align="center"> | ||
<a href="https://www.en.nossas.org" rel="noopener" target="_blank"> | ||
<img | ||
width="200" | ||
src="https://s3.amazonaws.com/hub-central/uploads/logo-nossas-20170517185909.svg" | ||
alt="Nossas logo" | ||
title="Nossas" | ||
/> | ||
</a> | ||
</div> | ||
<div align="center"> | ||
<img | ||
src="https://www.psdmockups.com/wp-content/uploads/2016/07/slatejs-520x292.jpg" | ||
alt="Nossas Cidades logo" | ||
title="Nossas Cidades" | ||
height="50" | ||
/> | ||
</div> | ||
# [SlateJS](https://github.com/ianstormtaylor/slate) - Embed Plugin | ||
The goal of this plugin is to offers an easy handling of SlateJS embed node content editable. Providing a simple API and easy usage, basing on concept of plugin-centric by SlateJS framework. | ||
<h1 align="center">@slate-editor/embed-plugin</h1> | ||
# Usage | ||
<div align="center"> | ||
#### SlateJS Embed Plugin | ||
[SlateJS](https://github.com/ianstormtaylor/slate) embed plugin. | ||
[![npm package](https://img.shields.io/npm/v/@slate-editor/embed-plugin.svg?maxAge=60)](https://www.npmjs.com/package/@slate-editor/embed-plugin) | ||
[![npm downloads](https://img.shields.io/npm/dt/@slate-editor/embed-plugin.svg?maxAge=60)](https://www.npmjs.com/package/@slate-editor/embed-plugin) | ||
</div> | ||
## Installation | ||
The **@slate-editor/embed-plugin** is available as an [npm package](https://www.npmjs.com/package/@slate-editor/embed-plugin). | ||
``` | ||
yarn add @slate-editor/embed-plugin | ||
``` | ||
## Usage | ||
Here is a quick example to get you started: | ||
```js | ||
import React, { Component } from 'react' | ||
import EmbedPlugin from 'slate-embed-plugin' | ||
import React from 'react' | ||
import { SlateEditor, SlateToolbar, SlateContent } from 'slate-editor' | ||
import { EmbedPlugin, EmbedButton } from '@slate-editor/embed-plugin' | ||
@@ -18,38 +50,13 @@ const plugins = [ | ||
class SlateEditor extends Component { | ||
onChange(state) { | ||
this.setState({ state }) | ||
} | ||
render() { | ||
return ( | ||
<Editor | ||
plugins={plugins} | ||
state={this.state.state} | ||
onChange={this.onChange.bind(this)} | ||
/> | ||
) | ||
} | ||
} | ||
``` | ||
const SlateRichTextEditor = () => ( | ||
<SlateEditor plugins={plugins}> | ||
<SlateToolbar> | ||
<EmbedButton /> | ||
</SlateToolbar> | ||
#### SlateJS Embed Plugin Button | ||
```js | ||
import React, { Component } from 'react' | ||
import { EmbedButton } from 'slate-embed-plugin' | ||
<SlateContent /> | ||
</SlateEditor> | ||
) | ||
class SlateEditor extends Component { | ||
onChange(state) { | ||
this.setState({ state }) | ||
} | ||
render() { | ||
return ( | ||
<div className="editor--toolbar"> | ||
<EmbedButton | ||
state={this.state.state} | ||
onChange={this.onChange.bind(this)} | ||
/> | ||
</div> | ||
) | ||
} | ||
} | ||
export default SlateRichTextEditor | ||
``` | ||
@@ -59,3 +66,3 @@ | ||
| Platform | Shortcut | | ||
| OS | Shortcut | | ||
|--------------------------|----------| | ||
@@ -67,3 +74,3 @@ | ![Apple Logo][apple] | `⌘`+`e` | | ||
| Target | Description | | ||
| Name | Description | | ||
|-----------------------|----------------------------------------------------------------------------| | ||
@@ -70,0 +77,0 @@ | EmbedNode | Component that holds the html that will wrap the content with embed style. | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
1
85
9319
6
+ Addedclassnames@^2.2.5
+ Addedexenv@^1.2.1
+ Addedreact-fontawesome@^1.6.1
+ Addedreact-fontawesome@1.7.1(transitive)
Updated@slate-editor/utils@^5.0.0