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

canner-slate-editor-pkgs

v1000000.0.0

Published

Another rich text editor using Slate framework

Downloads

3

Readme

canner-slate-editor lerna Storybook

📝 Rich text / WYSIWYG editor focus on modularity and extensibility, build on top of Slate framework with beautiful designs and high-level APIs.

Features 😍

  • [x] 20+ Editor Features, support list
  • [x] Markdown Syntax, support list
  • [x] Hot Keys, support list
  • [x] Full Screen Edit mode
  • [x] Serialize and Deserialize into HTML
  • [x] Copy and Paste HTML in Editor
  • [x] Support Toolbar
  • [x] Support Sidebar

👇 canner-slate-editor is a modulized editor, everything is a npm module! You could 100% compose to your personal usage!

Why another Editor?

Since this project is originally started from Canner, we notice that there is NO SINGLE editor is going to fit in all varieties of requirements, so we think the only way to solve this issue is to design a modular-first editor.

There are many other rich text and WYSIWYG editors online, but as slate - why section mentioned that most of these solutions are

  1. Not small and reusable
  2. Hardcoded and hard to customize
  3. Re-inventing the view layer seemed inefficient and limiting
  4. ...

Hence, this repository will try to keep all the advantages slate framework provides and create a more high level APIs for developers could also easily reuse and customize their own version of editor. Also we are always welcome to all kinds of contributions! 🙌

Notice

This project is using Antd as our primiary UI library.

Why

  1. Complete React UI solutions.
  2. Easy to customize styles: https://ant.design/docs/react/customize-theme
  3. Build-in i18n: https://ant.design/docs/react/i18n

One of the downside of using it, is it will increase your bundle size. see here for solution

Setting up Webpack

You will need to add css and less test rules in your webpack setting.

...
rules: [
  {
    test: /\.js$/,
    use: {
      loader: "babel-loader"
    },
    exclude: /node_modules/
  },
  {
    test: /\.css$/,
    use: [
      {
        loader: "style-loader"
      },
      {
        loader: "css-loader"
      }
    ]
  },
  {
    test: /\.less$/,
    use: [
      {
        loader: "style-loader"
      },
      {
        loader: "css-loader"
      },
      {
        loader: "less-loader"
      }
    ]
  }
]
...

Project structure

This projects currently contains over 47+ npm modules, every features are packaged into npm modules, such as icons, helpers, plugins, utils, etc..., so this enable developers to pick modules to assemble into your own usages.

1. canner-slate-editor npm-image

Another rich text editor using Slate framework, with beautiful design

Installation

$ npm install --save canner-slate-editor

You will also need to install

$ npm install antd slate slate-react

2. slate-md-editor npm-image

A markdown editor, that allows you to edit live with hot keys support!

Installation

$ npm install --save slate-md-editor

You will also need to install

$ npm install antd slate slate-react

3. slate-icons

20+ shared slate icons and helpers for Slate editors.

Supported features:

👉 Learn more slate-icons

4. slate-selectors

shared slate selectors for Slate editors.

Supported selectors:

👉 Learn more slate-selectors

5. quill-icons npm-image

Icons extract from quill editor with React component wrapper, support 65+ icons!

Installation

$ npm install --save quill-icons

6. slate plugins

A set of slate plugins.

7. slate-utils & slate-changes

A set of changes and utility functions for Slate editors

8. Editor utils components

A set of editor utility components.

9. slate-constant

Share constants through repos.

👉 Learn more slate-constant

Development

We are using yarn workspace to manage all repos, learn more about Yarn workspace

To install packages

yarn

See demos

npm start

Test

You need to build js files through babel by entering

yarn run build:watch

Run test independently

yarn jest <...path/to/pkg> [--coverage]

FAQ

1. Why not use Slate directly?

Slate is a well-designed powerful editor framework that helps you deal with difficult parts when building an editor, such as data modeling, updating states, rendering, editor schemas, serializing... (you could learn more here), while you are trying to build your own editors, it still need a lot of efforts to build a simple beautiful editor up and running with the framework.

This repository aims to provide complete editors and plugins solutions that allows you to use it right away, instead of digging through slate documentations and using our high-level components you could almost build editors without any slate framework knowledge to use.

2. Editor's bundle size is too large?

canner-slate-editor is using an awesome React library called Ant Design, the library provides many commonly used React components such as Tooltip, Table, Modal, etc... which is widely used in rendering our editors. One of the downside of using the library is it's bundle size. If you are trying to tackle size issue, we recommend following solutions:

  1. At Canner, our solution is to external antd in your bundler, and use CDN instead.
  2. Use modularized antd to reduce your bundle size.