npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

slate-plugins

v1.7.2

Published

slate plugin collections

Downloads

133

Readme

slate-plugins NPM version Build Status Dependency Status

slate plugin collections

Installation

$ npm install --save slate-plugins

Usage

var slatePlugins = require('slate-plugins');

// access blocks
slatePlugins.blocks;
// access inlines
slatePlugins.inlines;
// access marks
slatePlugins.marks;

Plugins

Blocks

addDataToCurrent

addDataToCurrent(state: State, data: Object)

This update current type with additional data, this could be useful in align...

blockquote

blockquote(state: State, options: Object)

This plugin is based on https://github.com/GitbookIO/slate-edit-blockquote, will wrapped block quote if the selection is not within a blockquote, unwrapped otherwise.

clearDataByKeyToCurrent

clearDataByKeyToCurrent(state: State, dataKey: String)

This delete a data's key in current block type

heading

heading(state: State, options: Object)

Transform block to heading, if it is already wrapped unwrap it.

insertBlock

insertBlock(state: State, options: Object)

Insert a new block with settings in options.

list

list(state: State, options: Object)

This plugin is based on https://github.com/GitbookIO/slate-edit-list/, will wrap to list, if it's wrapped unwrap it.

setBlock

setBlock(state: State, options: Object)

update block with new option settings.

History

undo

undo(state: State)

do undo once.

Inlines

insetInline

insertInline(state: State, options: Object)

insert a new inline with option settings.

links

links(state: State, type: String, options: Object)

insert a link with options.href settings, wrapped inline if the selection is expanded, and unwrap if it is a link.

Marks

addMarkOverwrite

addMarkOverwrite(state: State, options: Object)

if the selection is equal to options.type it will remove the original one and add a new mark with the option settings.

removeMarkAll

removeMarkAll(state: State)

remove all marks in the selection.

removeMarkTypeAll

removeMarkTypeAll(state: State, type: String)

remove mark in the selection with the same mark type.

toggleMark

toggleMark(state: State, options: Object)

toggle mark with option settings.

Utilities

get

getMarkType

getMarkType(state: State, type: String)

get all marks of a type in a selection.

getBlockType

getBlockType(state: State, type: String)

get all blocks of a type in a selection.

have

haveMarks

haveMarks(state: State, type: String) => Boolean

have mark of a type in the selection.

haveBlocks

haveBlocks(state: State, type: String) => Boolean

have block of a type in the selection.

haveInlines

haveInlines(state: State, type: String) => Boolean

have inline of a type in the selection.

haveDataKeyInSomeBlocks

haveDataKeyInSomeBlocks(state: State, dataKey: String) => Boolean

have data key in some blocks in the selection

haveDataKeyInSomeMarks

haveDataKeyInSomeMarks(state: State, dataKey: String) => Boolean

have data key in some marks in the selection.

is

isList

isList(state: State, type: String, options: Object) => Boolean

isBlockquote

isBlockquote(state: State, options: Object) => Boolean

isTable

isTable(state: State, options: Object) => Boolean

what

whatMarkTypes

whatMarkTypes(state: State)

what are the mark types in a selection.

whatBlockTypes

whatBlockTypes(state: State)

what are the block types in a selection.

whatInlineTypes

whatInlineTypes(state: State)

what are the inline types in a selection

Start example server

node devServer.js

Maintainer

chilijung

License

MIT © Canner