@slate-editor/font-size-plugin
Advanced tools
Comparing version 5.0.0-alpha.f7181996 to 5.0.0
{ | ||
"name": "@slate-editor/font-size-plugin", | ||
"version": "5.0.0-alpha.f7181996", | ||
"description": "SlateJS font size mark content editable plugin.", | ||
"version": "5.0.0", | ||
"description": "SlateJS font size mark 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,3 +32,5 @@ "prepare": "babel src --out-dir dist --copy-files" | ||
"dependencies": { | ||
"@slate-editor/utils": "^5.0.0-alpha.f7181996", | ||
"@slate-editor/utils": "^5.0.0", | ||
"classnames": "^2.2.5", | ||
"exenv": "^1.2.1", | ||
"react": "^16.2.0" | ||
@@ -20,0 +37,0 @@ }, |
105
README.md
@@ -1,59 +0,68 @@ | ||
<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) - Font Size Plugin | ||
The goal of this plugin is to offers an easy handling of SlateJS font size mark content editable. Providing a simple API and easy usage, basing on concept of plugin-centric by SlateJS framework. | ||
<h1 align="center">@slate-editor/font-size-plugin</h1> | ||
# Usage | ||
<div align="center"> | ||
#### SlateJS Font Size Plugin | ||
[SlateJS](https://github.com/ianstormtaylor/slate) font size plugin. | ||
[![npm package](https://img.shields.io/npm/v/@slate-editor/font-size-plugin.svg?maxAge=60)](https://www.npmjs.com/package/@slate-editor/font-size-plugin) | ||
[![npm downloads](https://img.shields.io/npm/dt/@slate-editor/font-size-plugin.svg?maxAge=60)](https://www.npmjs.com/package/@slate-editor/font-size-plugin) | ||
</div> | ||
## Installation | ||
The **@slate-editor/font-size-plugin** is available as an [npm package](https://www.npmjs.com/package/@slate-editor/font-size-plugin). | ||
``` | ||
yarn add @slate-editor/font-size-plugin | ||
``` | ||
## Usage | ||
Here is a quick example to get you started: | ||
```js | ||
import React, { Component } from 'react' | ||
import FontSizePlugin from 'slate-font-size-plugin' | ||
import React from 'react' | ||
import { SlateEditor, SlateToolbar, SlateContent } from 'slate-editor' | ||
import { FontSizePlugin, FontSizeInput } from '@slate-editor/font-size-plugin' | ||
const fontSizePluginOptions = { initialFontSize: 16 } | ||
const plugins = [ | ||
FontSizePlugin() | ||
FontSizePlugin(fontSizePluginOptions) | ||
] | ||
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> | ||
<FontSizeInput {...fontSizePluginOptions} /> | ||
</SlateToolbar> | ||
#### SlateJS Font Size Plugin - Input | ||
```js | ||
import React, { Component } from 'react' | ||
import { FontSizeInput } from 'slate-font-size-plugin' | ||
<SlateContent /> | ||
</SlateEditor> | ||
) | ||
class SlateEditor extends Component { | ||
onChange(state) { | ||
this.setState({ state }) | ||
} | ||
render() { | ||
return ( | ||
<div className="editor--toolbar"> | ||
<FontSizeInput | ||
state={this.state.state} | ||
onChange={this.onChange.bind(this)} | ||
/> | ||
</div> | ||
) | ||
} | ||
} | ||
export default SlateRichTextEditor | ||
``` | ||
# Keyboard Shortcut | ||
## Keyboard Shortcut | ||
| Platform | Action | Shortcut | | ||
| OS | Action | Shortcut | | ||
|--------------------------|----------|----------------| | ||
@@ -65,5 +74,5 @@ | ![Apple Logo][apple] | Increase | <kbd>⌘</kbd>+<kbd>shift</kbd>+<kbd>></kbd> | | ||
# API | ||
## API | ||
| Target | Description | | ||
| Name | Description | | ||
|----------------------------|--------------------------------------------------------------------------------| | ||
@@ -75,3 +84,3 @@ | FontSizeMark | Component that holds the html that will wrap the content with font size style. | | ||
# TODO | ||
## TODO | ||
@@ -78,0 +87,0 @@ - Make keyboard shortcut accepts customization; |
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
96
15109
4
+ Addedclassnames@^2.2.5
+ Addedexenv@^1.2.1
+ Addedclassnames@2.5.1(transitive)
+ Addedexenv@1.2.2(transitive)
Updated@slate-editor/utils@^5.0.0