Giter Club home page Giter Club logo

blocksuite's Introduction

BlockSuite

BlockSuite logo and name

Codecov Checks Status Issues Closed NPM Latest Release NPM Nightly Release Open in CodeSandbox Open in StackBlitz Join Discord


BlockSuite (pronounced "block sweet" ๐Ÿฌ) is the open-source editor project behind AFFiNE. It provides an out-of-the-box block-based editor built on top of a framework designed for general-purpose collaborative applications. This monorepo maintains both the editor and the underlying framework.

BlockSuite-based Editor in AFFiNE

BlockSuite-based Editor in AFFiNE

โš ๏ธ This project is under heavy development and is in a stage of rapid evolution. Stay tuned or see our roadmap here!

Introduction

BlockSuite works very differently than traditional rich text frameworks:

  • For the data model, BlockSuite eliminates the need to work with data-driven DSLs (e.g., operations, actions, commands, transforms). Instead, it utilizes CRDT as the single source of truth, offering a strongly-typed block tree model built on Yjs. With BlockSuite, manipulating blocks becomes as simple as updating a todo list. Moreover, by fully harnessing the power of CRDT, it supports zero-cost time travel, real-time collaboration, and out-of-the-box pluggable persistence backends.
  • For rich text editing, BlockSuite seamlessly organizes rich text content into discrete blocks. In BlockSuite, a document with 100 paragraphs can be rendered into 100 text blocks or 100 individual rich text editor instances, effectively eliminating the outdated practice of consolidating all content into a single, risky contenteditable monolith.
  • At the rendering layer, BlockSuite remains framework agnostic. It doesn't limit the block tree rendering to the DOM. Not only does it implement its entire document editing UI using Web Components, but it also offers a hybrid canvas-based renderer for whiteboard content sections. Both renderers can coexist on the same page and share a unified centralized data store.

BlockSuite is not intended to be yet another plugin-based rich text editing framework. Instead, it encourages building various collaborative applications directly through whatever UI framework you're comfortable with. To this end, we will try to open-source more foundational modules as reusable packages for this in the BlockSuite project.

Although BlockSuite is still in its early stages, you can already use the @blocksuite/editor package, the collaborative editor used in AFFiNE Alpha. Note that this editor is also a web component and is completely framework-independent!

Resources

Getting Started

To learn how to start using BlockSuite, visit blocksuite.affine.pro.

Current Status (@blocksuite/editor)

For more detailed planning and progress, please checkout our GitHub project.

  • Basic text editing
    • โœ… Paragraph with inline style
    • โœ… Nested list
    • โœ… Code block
    • โœ… Markdown shortcuts
  • Block-level editing
    • โœ… Inline text format bar
    • โœ… Inline slash menu
    • โœ… Block hub
    • โœ… Block drag handle
    • โœ… Block-level selection
  • Rich-content
    • โœ… Image block
    • โš›๏ธ Database block
    • ๐Ÿ“Œ Third-party embedded block
  • Whiteboard (edgeless mode)
    • โœ… Zooming and panning
    • โœ… Frame block
    • โœ… Shape element
    • โœ… Handwriting element
    • โš›๏ธ Shape connector
    • ๐Ÿšง Grouping
  • Playground
    • โœ… Multiplayer collaboration
    • โœ… Local data persistence
    • โœ… E2E test suite
  • Developer experience
    • โœ… Block tree update API
    • โœ… Zero cost time travel (undo/redo)
    • โœ… Reusable NPM package
    • ๐Ÿšง Dynamic component registration
    • ๐Ÿ“Œ Dynamic block registration

Icons above correspond to the following meanings:

  • โœ… - Beta
  • โš›๏ธ - Alpha
  • ๐Ÿšง - Developing
  • ๐Ÿ“Œ - Planned

Building

See BUILDING.md for instructions on how to build BlockSuite from source code.

Contributing

BlockSuite accepts pull requests on GitHub. Before you start contributing, please make sure you have read and accepted our Contributor License Agreement. To indicate your agreement, simply edit this file and submit a pull request.

License

MPL 2.0

blocksuite's People

Contributors

doodlewind avatar himself65 avatar lawvs avatar flrande avatar zqran avatar zuoxiaodong0815 avatar thorseraq avatar saikasakura avatar fundon avatar qishaoxuan avatar alt1o avatar diamondthree avatar saul-mirone avatar devlzl avatar jimmfly avatar darkskygit avatar innei avatar pengx17 avatar fi3ework avatar pionxzh avatar tzhangchi avatar donaldxdonald avatar perfectpan avatar github-actions[bot] avatar colelawrence avatar luke358 avatar lucinyan avatar akarachen avatar blurname avatar shortcipher5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.