Skip to content

Releases: toeverything/blocksuite

v0.14.0

10 May 05:49
2314f10
Compare
Choose a tag to compare

BlockSuite v0.14.0 is now released with 348 PRs landed and 5 new contributors.
It's currently used in Affine 0.14. This release includes a lot of new features, improvements, and bug fixes.
And it's a version centered around the AI features.

AI Features

Important

The AI features are only available in the Affine AI due to the dependency on the backend service.

AI

We have added a lot of AI features in this release to support the Affine AI project.
Thanks to our team members and contributors (@Flrande, @pengx17, @fundon, @donteatfriedrice, @zzj3720, @doouding, @regischen) for their hard work on this release.

  • AI Action Infra: The AI features are supported by a new AI action infrastructure.
  • Ask AI Format Bar: The format bar now has a new button to ask AI for help.
  • AI Chat Panel: A new AI panel is added to the right sidebar. It can generate text, images, and slides.
  • Edgeless AI: The edgeless elements and blocks now can be interacted with AI actions.

Contribution Details

Infra Improvements

  • Rewrite the view store to support the new block collection and selector. (#6521, #6672, #6534, #6737, #6780)
    In previous versions, the view store is responsible for managing the views of the blocks.
    It was designed to control different views of the same block, such as the editor view and the preview view.
    However, we found that it's a anti-pattern to render different views of the same block in the same block tree.
    Which makes it hard to track the view by the block model.
    In this release, we introduce the block collection and selector to make it easier to render different views of the same block.

  • Introduced the draft model for the transformer. (#6630)
    The draft model is a new model that can be used to transform the block model to a new model.
    It's useful when you want to transform the block model to a new model without changing the original block model.

  • Bson for clipboard. (#6526, #6562)
    We use bson for the clipboard mime to optimize the clipboard data serialization and deserialization.

  • Add spec builder. (#6976)
    The spec builder is a new tool to manage the block specs.

  • Switch to es2022 targets. (#6527)
    We have switched to the es2022 targets to support the latest JavaScript features.

  • refactor(store): support streaming editor.doc from empty state @doodlewind (#6522)

  • refactor(examples): sync collection lifecycle with provider @doodlewind (#6683)

Embed Doc Polishing

In this release, we have polished the embed doc feature to make it more user-friendly.

  • Move embed reload button. (#6502)
  • Polish the styles. (#6523, #6536)
  • Make embed card toolbar a widget. (#6635)
  • Fix the issue that creating linked doc from block selection will loss data. (#6510)
  • Fix the issue that users can't jump into doc inside embed synced doc. (#6531)

Database Enhancements

In this release, the Database has seen a series of enhancements aimed at increasing the fluidity of the editing experience, with improvements to keyboard shortcuts and cursor behavior:

  1. Supports using the Tab key to move the cursor to the next field (#6565)
  2. Supports selecting additional rows using arrow keys (#6941)
  3. Clicking on “New Record” now focuses on the title cell of the new row (#6561)
  4. Supports filling a column with the same content via drag-and-drop (#6895)

Additionally, enhancements to the title column now allow it to link to another page (#6572).
When you drag Kanban cards to the edge, the Kanban will now automatically scroll (#6614).
The Database will display as many views as possible instead of just three (#6642), and the same goes for filters (#6739).

There are also some experimental features that can be enabled through feature flags:

  1. Table now includes a statistics feature (#6560)
  2. The Database now supports using Todo blocks from all pages as a data source (#6785)

Documentation Improvements

We've added some new examples thanks to @doodlewind, @L-Sun.

  • Add vanilla-indexeddb example. (#6525)
  • Add react-indexeddb example. (#6689)
  • Add react-websocket example. (#6624)

Community Features

Detailed Bug Fixes and Improvements

Read more

v0.13.0 - API Overhaul and Rich Examples

19 Mar 04:32
b48b0e2
Compare
Choose a tag to compare

BlockSuite v0.13.0 is now released with 153 PRs landed and 4 new contributors. It's currently used in AFFiNE 0.13. This is a transitional version centered on bug fixes and the clearing of technical debt.

BlockSuite Examples

From 0.13, BlockSuite maintains multiple framework-specific examples demonstrating editor integration for major frameworks (currently including React, Vue, Angular, Preact, Svelte, Solid). There are also examples about using BlockSuite with Next.js and SQLite. You can checkout these examples in the quick start guide.

These examples are maintained in a standalone workspace. There'll be more examples incoming and feel free to make your own!

Framework Features and API Overhaul

  • Text Style Commands Enhancement (#6406, #6416): Added commands to facilitate operations on selected text content, including toggleBold, toggleItalic, toggleUnderline, toggleStrike, toggleCode, toggleLink, getTextStyle, and isTextStyleActive. These commands support chainable combination calls, simplifying common rich text style operations.
  • Format Bar Config API (#6433): Introduced a new format bar widget configuration API, allowing for the customization of format bar menu items. This supports the configuration of existing menu items and the registration of custom menu items, including paragraph dropdowns, style toggles (e.g., bold, italic), highlighter dropdowns, and block type switches with custom icons.
// In root spec:
const defaultSetup = rootSpec.setup;
const mySpec = {
  ...rootSpec,
  setup: (slots, disposableGroup) => {
    defaultSetup(slots, disposableGroup);

    const onFormatBarConnected = slots.widgetConnected.on(view => {
      if (view.component instanceof AffineFormatBarWidget) {
        configureFormatBar(view.component);
      }
    });

    disposableGroup.add(onFormatBarConnected);
  },
};

function configureFormatBar(formatBar: AffineFormatBarWidget) {
  formatBar
    .clearConfig()
    .addParagraphDropdown()
    .addDivider()
    .addTextStyleToggle({
      key: 'bold',
      action: chain => chain.toggleBold().run(),
      icon: BoldIcon,
    })
    .addTextStyleToggle({
      key: 'italic',
      action: chain => chain.toggleItalic().run(),
      icon: ItalicIcon,
    })
    .addDivider()
    .addHighlighterDropdown()
    .addDivider()
    .addBlockTypeSwitch({
      flavour: 'affine:paragraph',
      type: 'h1',
      name: 'Heading 1',
      icon: Heading1Icon,
    })
    .addBlockTypeSwitch({
      flavour: 'affine:paragraph',
      type: 'h2',
      name: 'Heading 2',
      icon: Heading2Icon,
    })
}
  • Standard Error Types and Handler (#6340): Introduced BlockSuiteError to facilitate application-level exception categorization.
  • Renaming page to doc (#6290): We now refer to BlockSuite documents as docs, aligning API concepts with this terminology change (e.g., page.addBlock -> doc.addBlock). This clarifies the document-centric nature of the API.
  • Renaming Workspace to DocCollection (#6436): Replaced the Workspace concept, which was more specific to AFFiNE product features, with DocCollection. This moves towards a more generalized framework structure (e.g., workspace.createDoc to collection.createDoc).
  • Command API Simplification (#6428, #6421, #6277): Streamlined command usage by eliminating the need for .withHost and .getChainCtx. The API for initiating command chains has been intuitively changed from .pipe to .chain, simplifying command execution syntax.
// before
std.command
  .pipe()
  .withHost()
  .getSelectedBlocks()
  .run();

// after
std.command
  .chain()
  .getSelectedBlocks()
  .run();
  • Schema Entry Renaming (#6312, #6319): Removed deprecated __unstableSchemas and enhanced consistency when importing default block schemas. This unifies the exposed schema, reinforcing a consistent framework for developers.
// Before
import { AffineSchemas, __unstableSchemas } from '@blocksuite/blocks/models';

// After
import { AffineSchemas } from '@blocksuite/blocks/schemas';
  • Typed getService (#6284): The getService API is now strongly typed with different service specific to block flavours.

Product Features

  • Batch Import (#6360): Enabled batch importing of multiple markdown or HTML files through the file picker.
  • Pressure Sensitivity for Brush Mode (#6348): Added pressure sensitivity support for the brush tool, offering more natural drawing experience on tablets.
  • Comment Feature POC (#6302): Introduced a preliminary support for a commenting feature, setting the stage for enhanced collaboration capabilities that will be further refined in future updates.

Detailed Bugfixes

Read more

v0.12.0 - Embeds, Sync Engine, and Cross-Browser Support!

26 Feb 08:15
0868ac6
Compare
Choose a tag to compare

The BlockSuite v0.12.0 release comes with 220 landed PRs, which is the version used in AFFiNE 0.12, with many major framework improvements and product features in the editor.

Note that from this version, BlockSuite is released using the version installed in AFFiNE Stable.

Notable Framework Enhancements

  • Support for Safari and Firefox by moving to single contenteditable (#5850)
  • New @blocksuite/sync package that provides an docSources option for syncing the overall workspace, which replaces previous providers. The BlockSuite playground apps have migrated to the new sync engine (#6204)
  • Reorganized edgeless API exposed on service (#5972 #6108 #6165 #6180)
  • Refactored editor initializing flow that allows for simpler code setup for creating editor with existing content (#6167)
  • New setup function in block spec for passing in custom configs (#6122)
  • Move to per-block version that allow co-existing of multiple block versions in same doc (#6065)
  • Improved API for pulling out context of a command (#6265)

Also, the BlockSuite documentation site now adds the new components and blog entries. We'll keep them updated in the following!

Notable Product Features

  • The card view and embed view of documents that allow experience like Synced Block in Notion (#6193 #5955)
  • The embed view of Figma, GitHub, Loom and attachment (#5927 #5988 #5955 #6224 #6069)
  • New note slicer that splits note blocks in an easier way (#6029)
  • New bi-directional link panel for inbound and outbound bi-directional links (#6010)
  • Better note visibility between doc and edgeless editors (#5994)

Detailed Bugfixes

Read more

v0.11.0 - The Editor Framework!

11 Jan 07:33
Compare
Choose a tag to compare
blocksuite-cover

The BlockSuite v0.11.0 release is now available! With 317 PRs landed and 6 new contributors, this version marks a milestone in our journey: evolving from a proprietary editor to a general-purpose editing framework.

BlockSuite originated as an editor designed to meet the needs of the AFFiNE knowledge base, which is why, for a long time, it provided a default EditorContainer that included both document editing and whiteboard functionalities. Early updates also focused heavily on specific features for AFFiNE products.

However, during the development of BlockSuite, we've built a range of front-end infrastructures from the ground up, spanning from rich text editing to whiteboard rendering. This version introduces extensive engineering refactoring and modular layering, resulting in the birth of a new, universal editing framework.

Traditionally, developing a stable rich text editor could take years of challenging work. But the evolution of BlockSuite has far outpaced this. We believe our work stems from embracing a new architectural pattern called document-centric, which simplifies the complex architecture of traditional editors by natively building the data layer in the editor with CRDT, thereby providing a more efficient development experience.

Key changes in BlockSuite 0.11.0 for developers include:

  • The new @blocksuite/presets package, which splits the independently usable DocEditor and EdgelessEditor, among others.
  • Distinct structuring of the BlockSuite framework layer, including atomic concepts like Editor, Block, Fragment, Widget, and definitive guides on how they combine. The current DocEditor and EdgelessEditor are based on this headless framework layer.
  • Based on BlockSuite headless, the accompanying front-end framework has been switched from lit to atomico for the experimental editor abed. This proves the feasibility of using the BlockSuite framework independently of specific front-end frameworks. We're also embracing React, Vue, and more diverse front-end frameworks, and there's more to come in terms of framework adaptation!
  • Completely rewritten BlockSuite framework tutorial and architectural exploration documentation, also available in Chinese for convenience.

We've also switched to the new home page blocksuite.io, welcome to give it a spin!

The establishment of the framework layer is just the first step in BlockSuite's longer-term vision. The current stable framework layer modules and APIs are still akin to the more low-level, headless part of tools like ProseMirror. Plans are already in place for more out-of-the-box preset support. Stay tuned!

Notable Product Features in 0.11

  • Support for Linked Page Previews (#5813): Added the basic functionality to support linked page previews in the Table of Contents (TOC), enhancing user navigation experience.
  • Enhanced Bookmark Functionality (#5636): Improved the bookmark block to appear directly at the top level of the edgeless canvas, simplifying the process of pasting elements into the whiteboard.
  • Consistent Dragging Behavior (#5613): Improved the consistency of dragging behavior, support dragging paragraphs and images outside of the note block.
  • Frame Sidebar Support (#5584): Added support for frame sidebars fragment, which brings more intuitive control in edgeless editor.
  • Frame Navigator Optimization (#5498): Optimized the frame navigator, enhancing user navigation efficiency and experience.
  • New Table of Contents (TOC) (#5539): Introduced a new TOC fragment, enhancing document organization and navigation capabilities.
  • Embed View for Certain Attachment Types (#5475): Added embed view support for certain attachment types, enhancing the presentation and interactivity of multimedia content.

Notable Framework Enhancements in 0.11

  • Canvas Content Interleaving Based on LayerManager (#5347): Enabled canvas content interleaving with DOM based on LayerManager, enhancing the editor's visual representation and flexibility.
  • Support for Multiple Editor Instances (#5878): Implemented support for multiple editor instances, increasing the flexibility and scalability of the editing environment.
  • Vitest Browser Test Runner (#5536): Added the DOM-based Vitest browser test runner, making easier for writing integration tests.
  • Support for Custom Inline Nodes (#5909): Introduced the custom InlineSpec feature, enhancing flexibility in text editing, especially for advanced content editing like inline LaTeX.
  • Surface Elements API (#5874): Introduced a new surface elements API, avoid raw Y.Map manipulations.
  • Replaced Export Manager (#5934): Fully removed the last part of legacy ContentParser and introduced a new export manager based on snapshot and adapter mechanisms, greatly enhancing support for third-party formats and scalability.
  • Persisting Editing Session State (#5804): Implemented the temporary storage of user toolbar options and other temporary states through SessionStorage, enhancing usability in frequent switching scenarios.
  • Multi-Instance Selection Enhancement (#5852): Refactored the surface selection mechanism to support multiple instances, making the SurfaceSelection in EdgelessEditor more aligned with DocEditor.
  • Optimized Zoom In/Out Performance (#5791): Performance optimization for zoom in and out functionalities, improving response speed and smoothness.
  • Inline Editor Renaming (#5671): Renamed VirgoEditor to InlineEditor to more accurately reflect its functionality.
  • Stash and Pop for Reactive Proxy (#5627): Introduced stash and pop functionalities for reactive proxies, making state management of local non-collaborative fields easier.
  • Splitting Editor Container into Sub-Editors (#5612): Divided the EditorContainer into multiple sub-editors, improving manageability and modularization.
  • Editor and Presets Package Reorg (#5570): Renamed @blocksuite/editor to @blocksuite/presets to more accurately reflect its function and purpose.
  • Embed Block Helper (#5518): Added an createEmbedBlock helper API in @blocksuite/blocks, simplifying the creation and management of embedded content.

Detailed Bugfixes

Read more

v0.10.0 - Almost Beta!

27 Nov 10:28
4208b26
Compare
Choose a tag to compare

The v0.10.0 release of BlockSuite includes a total of 246 PRs and welcomes 10 new contributors. Besides the continuous enhancement of the framework and more product features for the prebuilt AFFiNE editors, with an increased number of bug fixes and broader usage in production environments, we believe BlockSuite has been very close to its beta stage. This signifies:

  • For first-party editors based on BlockSuite, their stability is now sufficient for production environment usage, and common functionalities are covered by E2E tests. Notably, about 20% of the BlockSuite codebase are test cases, ensuring a robust and reliable experience. Except for a few edge cases, interactions like selection and shortcuts should mostly align with intuition during typical operations.
  • The architecture of the block-editing framework is now established, with best practices for operation data flow and event stream determined. Some legacy logic will be gradually refactored and removed, such as the _legacy directory in the @blocksuite/blocks package. Documentation about the relevant API surface is being continuously improved. However, understanding the usage for customizing blocks and extending selections may still require code consultation at this point.
  • Subsequent releases may still feature API breaking changes, but data will continue to be forward compatible.

We plan to enter the beta phase of BlockSuite in the next upcoming release. Exciting updates are on the way!

Below is a brief overview of the framework improvements and editor features in 0.10.0:

Framework Refinements

  • Enhanced Documentation (#5263): Added comprehensive API documentation for key packages and updated getting started guides to align with new API designs. The BlockSuite documentation site has also been vastly updated.
  • Page Load Callback Functionality (#5325): The new page.load API distinguishes between creating and loading documents, offering more precise control. Details are provided in the BlockSuite Data Persistence Tutorial.
  • Partial Update Support in Store (#5396): Refactored the store event stream to support incremental updates to nested object structures, removing events that could lead to leakage of underlying Yjs abstractions.
  • Optimized Batch Drag Update Size (#5272): Optimized the batch drag update size to reduce redundant ydoc writes, minimizing the update patch sizes in collaborative edits.
  • Recursive Deletion in deleteBlock (#5224): Modified deleteBlock to allow recursive deletion of child nodes by default, with configurable behavior.
  • Garbage Collection in Blob Manager (#5196): The BlobManager now actively removes unlinked resources, enhancing efficiency in resource management.
  • Configurable Block-Level Config (#5158): Support for dynamic configuration (e.g., maximum file size for attachment block) via service config.

Editor Features

  • Surface Reference Block (#5013): The new affine:surface-ref block enables embedding whiteboard frames or groups into the document mode.
  • Grouping Capability in Edgeless (#5069): Enhanced ability to group edgeless elements, with support for nested groupings.
  • New Style Collapsible Note in Edgeless (#5337): Edgeless now supports note blocks with various shadow, corner, and border styles, including preset effects for visually rich notes.
  • Per-Element Selected Box in Edgeless (#5322): Multi-selection now shows individual selection boxes for each selected element, enhancing clarity in grouped selections.
  • Auto-Connect Indicator and Index Label (#5136): Automatically connects and indexes content visible in document mode, enhancing navigational clarity.
  • New Connector Addition Method (#5161): Introduces a new way to add connectors by dragging with an auto-complete button, along with widgets for easy connector shape selection.
  • Optimized Double Click for Canvas Text Edit in Hollow Shapes (#5043): Enhanced click detection for text-filled shapes, preserving transparency effects for easier selection of elements beneath hollow shapes.
  • Extended Font Support in Canvas Text (#5339): Introduced new preset fonts like Satoshi, Lora, and Bebas Nene, alongside an updated toolbar UI for easier font adjustments.
  • Revamped Text Highlighting (#5434): Enhanced text highlighting now allows setting the text color itself, not just the background color.
  • Expanded Connector Arrow Styles (#5064): Added new connector endpoint styles including Triangle, Circle, and Diamond.
  • Linked Page Creation from Selected Text (#5171): Quickly create and link new pages from selected text using a simple keystroke.
  • Refined Indent Behavior (#5072): Improved indent behavior for maintaining child node hierarchy more intuitively.

Detailed Bugfixes

Read more

v0.9.0

18 Oct 12:24
afc6b1e
Compare
Choose a tag to compare

🔥 The BlockSuite 0.9.0 release incorporates over 300 PRs and welcomes 5 new contributors. Over the past weeks, we have not only continued to ship the functionalities in AFFiNE, but also landed significant enhancements in editor infra.

Editor Infrastructure

Many of the APIs mentioned below have yet to be fully clarified. We'll prioritize updating the documentation in the next release.

  • BlockTransformer (#4191) establishes a standardized block structure conversion API. This module is beginning to replace the existing ContentParser specific to markdown and HTML. It offers more reliable transformations for third-party data structures and isomorphically supports both clipboard actions and data import/export (#4757). Based on the block transformer, the new markdown adapter (#4624 #4797) implements markdown compatibility targeting block snapshots using unified and mdast.
  • The new BlockSnapshot format (#4609 #4614) allows storing a workspace or page as a JSON block tree. This format, built on the block transformer foundation, serves as an equivalent alternative to CRDT binary and supports packaging it with blob content into a zip-formatted block bundle.
  • The new CommandManager facilitates the registration and reuse of a set of block operations, with support for chained calls, better modeling complex updates to the block tree (#4471 #4626).
  • The Virgo-based RichText component offers out-of-the-box controls for undo/redo and clipboard actions, positioning it as a replacement for the more low-level virgo-input component (#4956).
  • Existing workspace methods have been segregated based on the addon concept (#4492).

Edgeless Editing Features

  • Direct insertion of image blocks at the top level of surface blocks without the need for encapsulation within note blocks is now supported (#4894).
  • Frame blocks can be inserted at the surface block top level, serving as a substitute for the previous frame element (#4711).
  • Elements can now be connected using curved connectors (#4516).
  • A new note can be swiftly created on a selected note (#4881).
  • Multi-selection alignment of elements is now available (#4456).
  • Transitioned to a transformer-based clipboard (#5023).

Document Editing Features

  • Display of YouTube-style embed bookmark block types is now available (#4523).
  • Popups featuring secure triangle areas and transitions have been introduced (#4965 #4958).

Database Editing Features

  • Group view is now supported (#4727).
  • A new filter-usable UI has been introduced (#4339).
  • There's support for an independent preview modal (#4628).

Other Notable Updates

  • Rendering performance for edgeless has been optimized (#4746 #4939).
  • The original phasor package has been integrated into the edgeless editor (#4518).

Detailed Bugfixes

Read more

v0.8.0

29 Aug 14:46
daadb64
Compare
Choose a tag to compare

🎉 Announcing BlockSuite 0.8.0! This version is bundled in AFFiNE 0.8.0, incorporating over 500 new merged pull requests and 12 new contributors. In the past weeks, we have refactored the selection data flow of the editor, together with multiple new editing functionalities. Highlights:

Selection Manager Refactoring

In 0.8.0, we rewrote the selection manager following the block spec RFC (#3165). All selections could be created, managed and shared by the same data flow now.

selection-manager

The new selection follows the unidirectional data flow. Which means all selections on page will be stored as a piece of selection data called selection model.

  1. The blocks can subscribe to the changes of the selection models and render them as what they want.
  2. Every time users select something else on the page, the selection model will be updated first.
  3. Then, the blocks know the models are updated and they will try to rerender the selections.

An example of selection model:

TextSelection {
  type: 'text',
  group: 'note',
  from: {
    path: ['some-block-parent-id', 'some-block-id'],
    index: 5,
    length: 20,
  },
  to: {
    path: ['some-other-block-parent-id', 'some-other-block-id'],
    index: 0,
    length: 30
  }
}

BlockSelection {
  type: 'block',
  group: 'note',
  path: ['some-block-id'],
}

SurfaceSelection {
  type: 'surface',
  group: 'edgeless',
  path: ['some-block-id'],
  elements: ['shape-circle'],
}

In BlockSuite, this piece of data is stored in the Yjs awareness store to make sure it can be shared between clients to support remote selection. This also makes the support of the undo and redo features work as expected.

Block Schema

The new block-level migration API is introduced, usage:

import { Schema, Workspace } from '@blocksuite/store';

const schema = new Schema();
schema.register(AffineBlocks);

// Migration can run without workspace
schema.upgradePage(oldBlockVersions, oldYDoc);

// create workspace with schema
const workspace = new Workspace({ schema });

See #3826 for the guide writing migrations.

Also, the model proxy now supports defining plain JSON types using NativeWrapper, instead of mapping nested array and objects into their Y-alternatives. See #4020 for the detailed usage.

Block UI Components

In @blocksuite/blocks, the new createLitPortal and createSimplePortal API can be used to create portals in editor (#3830 #4291). The new computePosition option is supported, so as to place the tooltips and popups in proper position.

In @blocksuite/virgo, there are also new APIs:

  • Introduced createVirgoKeyDownHandler, facilitating the development of logic for the keydown event (#4279).
  • Added hooks support, allowing for the injection of default behavior into Virgo (#4386).
  • Introduced isEmbed options that allows treating a text node as a unified entity, which can be selected or removed entirety (#3659).

Doc Editing Functionalities

  • Supported the new affine:attachment block flavour (#2952).
  • Updated the new drag handle (#3695 #3162 #4314).
  • Supported text highlight (#3961).
  • Supported image files in exported HTML and markdown (#3791).

Edgeless Editing Functionalities

  • Supported the new frame element (#3701).
  • Supported full screen presentation mode (#4101).
  • Supported ToC panel for notes (#3138).
  • Supported flowchart auto-complete creation (#3596).
  • Supported moving element using arrow keys (#4143).
  • Adapted to the new selection manager (#3693).
  • Reduced re-rendering (#4276 #3911 #3823).
  • Updated connector and shape toolbar UI (#3714).

Database Editing Functionalities

  • Added the new kanban view (#2401).
  • Added the new header UI (#3868).
  • Supported clipboard operations under custom database selection (#2309).

Playground and Package Infra

  • New local-first playground with multi-player collaboration support (#3589 #3776). This entry is localhost:5173 while the previous entry with different starter templates are located in localhost:5173/starter/.
  • The circular dependencies in the project has been fully cleared (4214).

Detailed Bugfixes

Read more

v0.7.0

17 Jul 15:56
a676391
Compare
Choose a tag to compare

🎉 Announcing BlockSuite 0.7.0! This version is bundled in AFFiNE Client 0.7-beta, incorporating 318 new merged pull requests and an addition of 7 contributors. In the past few weeks, we have significantly enhanced data persistence and whiteboard usability. Feature highlights:

So far, the primary focus of the BlockSuite project has been on feature-richness. However, with the next major release, we plan to make the editing feature more adaptable with a new API surface. Stay tuned!

Detailed Commits

Read more

v0.6.0

06 Jun 13:53
Compare
Choose a tag to compare

🍬 We are excited to announce the release of BlockSuite 0.6.0! This version is shipped in AFFiNE Client 0.6.0, including 351 new pull requests merged and 18 more new contributors. In this version, we mainly focused on improving the usability of doc editing and whiteboard editing. Here are the updates:

Read more

0.5.0

25 Apr 17:01
Compare
Choose a tag to compare

🍬 We're thrilled to announce the release of BlockSuite 0.5.0! This version is shipped in the first AFFiNE Client, including 660 pull requests merged from our vibrant community of developers, with 14 more new contributors. Here are some highlights of what you can expect from this release:

  • 🔮 There is now support for nestable block model fields definitions.
  • 🗄️ A new DatabaseBlock is available to use as a table. The data structure has been redesigned and moved to the block level.
  • 🔎 Cross-page indexing is possible through the SearchIndexer and BacklinkIndexer.
  • 🎨 There are many enhanced edgeless and whiteboard editing capabilities, including a new @blocksuite/connector package that provides pathfinding support for computing shape connectors.
  • 📖 The documentation site is available, including onboarding documents and tutorials. The site can be accessed at blocksuite.affine.pro.

🚀 Features

  • Store (@Saul-Mirone @lawvs @doodlewind)
    • Array proxy (#2088), Y.Map deep proxy (#2111), and support for deep proxied values (#2145).
    • Support DisposableGroup.addFromEvent (#1527).
    • Support role in block schema (#2023).
    • Support Slots on model for blocks (#2067).
    • Indexer (#2091) and normalization of subpage in meta (#2167).
  • Edgeless (@alt1o @doodlewind)
    • Support for various tools and modes, including drag and drop (#1417), view control panel (#1423), brush tool (#1418, #1458), text tool (#1563), and component toolbar (#1703).
    • Basic hotkeys support (#1750) and pressing the ESC key to return to the default state (#1833).
    • Active state maintenance between clicking frames (#1836) and support for bringToFront and sendToBack (#1945).
    • Connectors can be attached to elements at any position (#1963) and copy-paste support in edgeless clipboard (#1965).
    • Edgeless frame background (#2027), shape fill and stroke color support (#2042), and background grid optimization (#2047).
    • Double-click the blank space to add text (#2163).
    • Additional shapes (#1339) and brush support (#1337).
    • Connector support (#1793) and shape border style support (#2166).
  • Subpage (@lawvs)
    • Addition of subPageIds in pageMeta and related events (#1716).
    • Unification of subpage and slot naming (#1782).
    • Addition of subpage test case (#1832).
    • Refactoring to check subpage reference (#2022).
    • Normalization of subpage in meta (#2167).
    • Subpage meta synchronization (#2190).
  • Database block (@zqran)
    • Rich-text column soft enter support (#1765).
    • Improved handling of placeholders, insertion, and selection (#1785, #1795, #1770).
    • Enhanced database styling (#1831, #1855, #1861) and column operations (#1879, #1884, #1887).
    • Tag color selection (#1917), renaming and deletion (#1891), and copy-paste support (#1908).
    • More actions support (#1916) and drag and drop column width adjustment (#1931).
    • Database conversion (#1941) and column operations with shortcuts (#2019).
    • Title and tag length limits (#2000) and drag and drop row insertion (#2046).
    • Icon and style updates (#2063, #2068) and mobile compatibility (#2187).
    • Virgo integration for number input replacement (#2144) and select tag length limit update (#2230).
  • Virgo (@Flrande)
    • Dynamic attribute schema and renderer (#1462).
    • Handler to take over Virgo input (#1495).
    • Support VEditor.requestUpdate and v-text update (#1523).
    • Support setMarks (#1711).
    • VEditor support for string parameter (#1895).
    • Support setText (#2107).
  • Selection (@fundon)
    • ExtendBlockRange API (#1684) and dragged content preview (#1872).
    • Dragging blocks under block-level selection (#1946) and scroll wheel support to move dragging blocks (#1977).
    • Highlight selected blocks in edgeless (#2024) and triple-click to select all text of block (#2037).

🙌 New Contributors

🐛 Detailed Refactoring and Bugfixes

  • refactor: add text prop in schema (#1281)
  • refactor: migrate SelectedBlock to BlockRange (#1334)
  • refactor: remove redundant cachedSelectedBlocks (#1332)
  • refactor: add side effect in store (#1340)
  • refactor: optimize some code in virgo (#1360)
  • refactor: remove code block button (#1365)
  • refactor: remove depth and parentIndex from BaseBlockModel (#1372)
  • refactor: reorganize range structure (#1366)
  • refactor: detect elements with Node.compareDocumentPosition in block selection (#1356)
  • refactor: simplify test (#1379)
  • refactor: migrate BlockSuiteModelProps to BlockModelProps (#1408)
  • refactor: clearly distinguish lit's state and property (#1428)
  • refactor: remove handlePageEvent timer (#1431)
  • refactor: simplify keyboard behavior (#1438)
  • refactor: Signal -> Slot (#1481)
  • refactor: simplify code block language list logic (#1486)
  • refactor: split basic DefaultSelectionManager modules (#1494)
  • refactor: remove redundant selection manager fields (#1496)
  • refactor: SelectionRect -> DraggingArea (#1500)
  • refactor: extract setSelectedBlocks and slot effects (#1502)
  • refactor: remove resetSelectedBlockByRect (#1503)
  • refactor: switch to selection.viewport (#1506)
  • refactor: remove redundant selection manager fields (#1507)
  • refactor: switch to page.readonly (#1511)
  • refactor: add selection.state.draggingArea (#1512)
  • refactor: extract block hub templates (#1521)
  • refactor: move codeBlockOption to code block (#1519)
  • refactor: Slot.disposableListener -> Slot.fromEvent (#1526)
  • refactor: code option use viewport element (#1565)
  • refactor: remove the deprecated addBlock api (#1613)
  • refactor: add async query for dom mutation scenario (#1621)
  • refactor: replace getRichTextByModel with getVirgoByModel (#1626)
  • refactor: strict text attributes check (#1731)
  • refactor: migrate nativeKeydown to hotkey (#1751)
  • refactor: replace input tag with VEditor in database block (#1746)
  • refactor: extract getPopperPosition function (#1816)
  • refactor: add getRichTextBoundingBox test action (#1819)
  • refactor: improve stability of inline suggestion (#1817)
  • refactor: split handleLineStartBackspace (#1910)
  • refactor: check subpage reference (#2022)
  • refactor: clean short key (#2051)
  • refactor: extract keydown observer (#2062)
  • refactor: remove redundant slot (#2140)
  • refactor: remove @blocksuite/react package (#2179)
  • refactor: subpage meta sync (#2190)
  • refactor: use @toeverything/y-indexeddb (#2207)
  • refactor: use virgo element as the ref node when obtaining the vRange (#2239)
  • refactor: subpage update (#2264)
  • refactor(blocks): replace textarea in title with virgo (#1168)
  • refactor(blocks): replace quill with virgo (#1433)
  • refactor(blocks): improve code-block highlight performance (#1682)
  • refactor(blocks): add cache for highlight in code-block (#1762)
  • refactor(blocks): builtInSchemas -> AffineSchemas (#1763)
  • refactor(blocks): prevent auto scroll in edgeless mode (#1830)
  • refactor(code): replace setTimeout with ResizeObserver (#1680)
  • refactor(database): tag -> column (#1739)
  • refactor(database): optimize column related naming (#1913)
  • refactor(database): remove mode in crdt model (#1918)
  • refactor(database): flatten internalProperty and property (#1919)
  • refactor(database): add DatabaseManager and page.db entity (#1922)
  • refactor(database): columns -> cells (#1925)
  • refactor(database): columnSchema -> column (#1934)
  • refactor(database): split column header component file (#1957)
  • refactor(database): columnSchema -> column (#1960)
  • refactor(database): column header (#1987)
  • refactor(database): toolbar and row container (#1989)
  • refactor(database): separate title (#1997)
  • refactor(database): separate select type column (#1998)
  • refactor(edgeless): split toolbar modules (#1348)
  • refactor(edgeless): hotkeys (#1835)
  • refactor(edgeless): add frame and update selection (#1834)
  • refactor(editor): move content parser out of editor lifecycle (#1748)
  • refactor(global): move global database types into blocks (#2278)
  • refactor(phasor): switch to getElementsBound (#1445)
  • refactor(phasor): move edgeless viewport to surface.viewport (#1477)
  • refactor(selection): switch to document.elementsFromPoint (#1530)
  • refactor(selection): keep setSelectedBlocks logic simple (#1706)
  • refactor(store): remove redundant type param (#1756)
  • refactor(store): support synchronous createPage (#1760)
  • refactor(store): addBlockByFlavour -> addBlock (#1764)
  • refactor(store): remove redundant moveBlocksToParent (#1787)
  • refactor(store): remove deleteBlockById and updateBlockById (#1923)
  • refactor(store): set doc.guid to workspace id (#1958)
  • refactor(store): init internal props should respect ext in schema (#2025)
  • refactor(store): move cell and column to database props and add database model (#2053)
  • refactor(store): use map proxy for object props (#2128)
  • refactor(virgo): switch to rootElement (#1454)
  • refactor(virgo): use tuple (#...
Read more