Socket
Socket
Sign inDemoInstall

@slate-editor/font-family-plugin

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slate-editor/font-family-plugin

SlateJS font family mark plugin.


Version published
Weekly downloads
1.3K
increased by18.25%
Maintainers
2
Weekly downloads
 
Created
Source
Nossas logo
Nossas Cidades logo

@slate-editor/font-family-plugin

SlateJS font family plugin.

npm package npm downloads

Installation

The @slate-editor/font-family-plugin is available as an npm package.

yarn add @slate-editor/font-family-plugin

Usage

Here is a quick example to get you started:

import React from 'react'
import { SlateEditor, SlateToolbar, SlateContent } from 'slate-editor'
import { FontFamilyPlugin, FontFamilyDropdown } from '@slate-editor/font-family-plugin'

const plugins = [
  FontFamilyPlugin()
]

const SlateRichTextEditor = () => (
  <SlateEditor plugins={plugins}>
    <SlateToolbar>
      <FontFamilyDropdown />
    </SlateToolbar>

    <SlateContent />
  </SlateEditor>
)

export default SlateRichTextEditor

API

NameDescription
FontFamilyMarkComponent that holds the html that will wrap the content with font family style.
FontFamilyUtilsGeneric file that holds the util common functions.
FontFamilyButtonButton component that have behaviour to wrap content with font family style.
FontFamilyKeyboardShortcutKeyboard shortcut file that manipulates onKeyDown event inside SlateJS.

TODO

  • Make accepts keyboard shortcuts?;
  • Add keyboard shortcut to apply font family to expanded selection;
  • Add keyboard shortcut to remove font family from expanded selection;
  • Add button to apply font family to expanded selection;
  • Add button to remove font family from expanded selection;
  • Add handle to manipulates collapsed selection to remove font family to anchor word;
  • Add behaviour to show which font family have applied to collapsed selection;
  • Add behaviour to show which font family have applied to expanded selection;

Keywords

FAQs

Package last updated on 25 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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