Socket
Socket
Sign inDemoInstall

@slate-editor/font-size-plugin

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slate-editor/font-size-plugin - npm Package Compare versions

Comparing version 5.0.0-alpha.f7181996 to 5.0.0

CHANGELOG.md

23

package.json
{
"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;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc