• Stars
    star
    1,127
  • Rank 41,286 (Top 0.9 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ“Rich Text / WYSIWYG Editor built for Modularity and Extensibility.

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 ๐Ÿ˜

  • 20+ Editor Features, support list
  • Markdown Syntax, support list
  • Hot Keys, support list
  • Full Screen Edit mode
  • Serialize and Deserialize into HTML
  • Copy and Paste HTML in Editor
  • Support Toolbar
  • 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.

More Repositories

1

cannercms

โšก๏ธ Content Management Framework creates custom CMS fast and easy. Support data sources such as Firebase/Firestore, GraphQL and Restful APIs.
JavaScript
2,430
star
2

WrenAI

๐Ÿš€ Open-source SQL AI Agent for Text-to-SQL. Supporting PostgreSQL, DuckDB, MySQL, MS SQL, ClickHouse, Trino, JSON, CSV, Parquet data sources, ane more! ๐Ÿš€
TypeScript
1,858
star
3

vulcan-sql

Data API Framework for AI Agents and Data Apps
TypeScript
635
star
4

apollo-link-firebase

๐Ÿ”ฅ ๐Ÿ”— apollo-link-firebase provides you a simple way to use Firebase with graphQL.
TypeScript
413
star
5

gqlify

[NOT MAINTAINED]An API integration framework using GraphQL
TypeScript
178
star
6

canner-firebase-cms

๐Ÿ”ฅ Content management for Firebase Realtime Database with SSR supported with NextJS, for blog, ecommerce, mobile apps and even chatbot! This project is based on Canner CMS
JavaScript
119
star
7

wren-engine

๐Ÿค– The semantic engine for LLMs, bringing semantic context to AI agents. ๐Ÿ”ฅ
Java
118
star
8

graphql-rbac

GraphQL Role-based access control (RBAC) middleware
TypeScript
36
star
9

canner-firestore-cms

The example of building the CMS with Canner and Firestore
JavaScript
25
star
10

graphql-i18n

An i18n middleware for GraphQL
TypeScript
22
star
11

cms30

๐Ÿ™Œ #CMS30 | Free 30 CMS templates
JavaScript
22
star
12

vulcan-sql-examples

Curated VulcanSQL show cases
Jupyter Notebook
19
star
13

react-loading-image

A react image loader.
JavaScript
13
star
14

canner-demo

๐Ÿ˜ป Collection of demos to demonstrate how Canner can accomplish in different use cases.
CSS
13
star
15

antd-geosuggest

Antd based geo suggestion for Google maps places API
JavaScript
11
star
16

typescript-koa-boilerplate

typescript-koa-boilerplate
HCL
11
star
17

image-upload

Based on antd image uploader
JavaScript
9
star
18

emoji-mart-picker

emoji popup picker
JavaScript
7
star
19

create-table-picker

Table creater based on react-hovertable
JavaScript
7
star
20

grid-draggable

grid draggable system
JavaScript
4
star
21

antd-canner-components

๐ŸคกModular Ant design based CMS components for Canner, over 40+ components
JavaScript
4
star
22

canner-udf-example

Canner UDF example
Java
3
star
23

generator-canner-react

A yeoman generator for canner react projects
JavaScript
2
star
24

npm-check-install

Check whether a npm module is installed, otherwise installed it.
JavaScript
2
star
25

image-gallery

A gallery for photos.
JavaScript
2
star
26

docs.canner.io

Canner official documentation
JavaScript
1
star
27

react-window-detect-dimensions

Wrapper component that detects window resize and pass down to children
JavaScript
1
star
28

get-selection-range

Get current cursor's selection range
JavaScript
1
star
29

gatsby-plugin-canner-schema

Gatsby plugin for using Canner schema
JavaScript
1
star
30

docs.gqlify.com

Document of gqlify
JavaScript
1
star
31

image-service-config

Help you setup configurations in ant design uploader, support imgur, Firebase client, Firebase admin
JavaScript
1
star
32

canner-quick-start

The simplest example of building a CMS with Canner
JavaScript
1
star
33

grid-breakpoint

Automatically add breakpoints to your grids
JavaScript
1
star
34

antd-cms-component-docs

๐Ÿœ Documentation for antd-cms-component
JavaScript
1
star
35

victory-canner-components

A chart library for Canner, based on Victory Chart
JavaScript
1
star