Commit Graph

46 Commits

Author SHA1 Message Date
Saul-Mirone
238ec59dd2 fix(editor): image icon color (#11536)
Closes: BS-2166
2025-04-08 09:18:26 +00:00
Saul-Mirone
1f45cc5dec refactor(editor): unify directories naming (#11516)
**Directory Structure Changes**

- Renamed multiple block-related directories by removing the "block-" prefix:
  - `block-attachment` → `attachment`
  - `block-bookmark` → `bookmark`
  - `block-callout` → `callout`
  - `block-code` → `code`
  - `block-data-view` → `data-view`
  - `block-database` → `database`
  - `block-divider` → `divider`
  - `block-edgeless-text` → `edgeless-text`
  - `block-embed` → `embed`
2025-04-07 12:34:40 +00:00
forehalo
40f218c898 chore: set base version to 0.21 2025-04-07 16:10:32 +08:00
Saul-Mirone
bb1270061a feat(editor): gfx template package (#11480) 2025-04-06 12:24:13 +00:00
Saul-Mirone
aed7f40568 refactor(editor): improve element adapters (#11473) 2025-04-05 09:40:13 +00:00
Saul-Mirone
2a1306c58c refactor(editor): separate the element renders (#11461) 2025-04-04 13:09:46 +00:00
Saul-Mirone
5a1106fb88 refactor(editor): extract brush element renderer (#11460) 2025-04-04 13:09:45 +00:00
CatsJuice
46d8d30e62 feat(editor): disable clickToDrag for edgeless toolbar shape and mindmap (#11310) 2025-04-04 05:10:05 +00:00
JimmFly
7a1d5ab252 feat(core): upgrade icons package (#11435) 2025-04-04 04:52:49 +00:00
doouding
ef76c83184 fix: connector should remain the same when its target or source switch to other
shape type (#11369)

Fixes [BS-1431](https://linear.app/affine-design/issue/BS-1431/改变-shape-形状后,connector-丢失)
2025-04-02 05:10:30 +00:00
fundon
f1882061a2 fix(editor): should exit drawing tools menu when Escape is pressed (#11306)
Closes: [BS-2978](https://linear.app/affine-design/issue/BS-2978/二级菜单的激活状态错误) [BS-2977](https://linear.app/affine-design/issue/BS-2977/pen和highlighter没做esc)
2025-03-31 11:05:01 +00:00
fundon
6a66bf53a8 fix(editor): adjust highlighter color (#11300)
Closes: [BS-2980](https://linear.app/affine-design/issue/BS-2980/highlighter透明度改为30percent) [BS-2979](https://linear.app/affine-design/issue/BS-2979/highlighter默认选择颜色为蓝色)
2025-03-31 09:11:26 +00:00
doodlewind
dffb89c388 feat(editor): add list block turbo renderer scaffold (#11266)
This PR allows placeholder in turbo renderer to cover list block as a basic scaffold.

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/lEGcysB4lFTEbCwZ8jMv/eda28656-e56e-4845-9fe6-885e70841697.png)
2025-03-29 04:49:25 +00:00
Saul-Mirone
205cd7a86d refactor(editor): rename block-std to std (#11250)
Closes: BS-2946
2025-03-28 07:20:34 +00:00
fundon
c0c0e5ea8f chore(editor): add event tracking to highlighter tool (#11232)
Closes: [BS-2947](https://linear.app/affine-design/issue/BS-2947/埋点相关)
2025-03-28 01:34:44 +00:00
CatsJuice
e855197acf feat(editor): responsive edgeless toolbar pen menu (#11150)
close BS-2855
2025-03-27 08:53:27 +00:00
fundon
2c4278058b feat(editor): add highlighter (#10573)
Closes: [BS-2909](https://linear.app/affine-design/issue/BS-2909/新增highlighter)

### What's Changed!

Currently the highlighter tool is very similar to brush, but for the future, it's a standalone module.

* Added `Highlighter` element model
* Added `Highlighter` tool
* Added `Highlighter` entry to the global toolbar
2025-03-27 08:53:26 +00:00
fundon
6ade2b7084 chore(editor): add event tracking to drawing tool (#11230)
Closes: [BS-2833](https://linear.app/affine-design/issue/BS-2833/考虑屏蔽或者降低brush-行为的采集密度)
2025-03-27 08:17:44 +00:00
doodlewind
bb1bbccd0f refactor(editor): rx state management in turbo renderer (#11200)
# Refactor Turbo Renderer State Management to Use RxJS

### TL;DR

Refactored the TurboRenderer state management to use RxJS observables instead of direct state mutations, improving state transitions and reactivity.

### What changed?

- Replaced the public `state` property with a private `state$` BehaviorSubject in `ViewportTurboRendererExtension`
- Added proper state transition logging using RxJS operators
- Combined multiple event subscriptions using `merge` operator for better organization
- Improved state transition logic in the `refresh()` method
- Updated the `zooming$` and `panning$` signals in the Viewport

### Why make this change?

This refactoring improves the codebase by:
1. Using a more consistent reactive programming model with RxJS
2. Making state transitions more explicit and traceable
3. Reducing potential bugs from manual state management
4. Improving code organization by combining related event streams
5. Ensuring proper cleanup of resources when components are disposed

The change maintains the same functionality while making the code more maintainable and the state management more robust.
2025-03-27 04:50:32 +00:00
doouding
ace5d44a61 refactor: rewrite dblclick and selection logic of default-tool (#11036)
continue #10824

### Changed
- Moved double-click-to-edit behavior from the default tool to individual model views
- Introduced `onSelected` callback interface in gfx view components to allows developers to override default selection logic
2025-03-26 07:32:43 +00:00
fundon
d7eccd10ee chore(editor): add edgeless scribbled style feature flag (#11127)
Closes: [BS-2805](https://linear.app/affine-design/issue/BS-2805/下掉线条样式切换功能,需添加-feature-flag)
2025-03-24 12:55:00 +00:00
Saul-Mirone
4d3eee3bad feat(editor): brush gfx package (#11131) 2025-03-24 09:28:46 +00:00
Saul-Mirone
ef1ed383cb feat(editor): command for ungroup and group (#11116) 2025-03-24 15:34:38 +09:00
Flrande
4bacfbd640 feat(editor): support member node (#11075)
Close [BS-2793](https://linear.app/affine-design/issue/BS-2793/inline-member)
2025-03-24 05:57:03 +00:00
Saul-Mirone
b8df65a2b0 refactor(editor): move mindmap transform to its package (#11115) 2025-03-24 05:19:30 +00:00
Saul-Mirone
5525c2bc8d refactor(editor): move mindmap view to mindmap package (#11102) 2025-03-24 03:14:23 +00:00
Saul-Mirone
8e08b9000d feat(editor): create gfx mindmap package (#11100) 2025-03-24 03:14:22 +00:00
Saul-Mirone
1f0fc9d47a feat(editor): gfx connector package (#11091) 2025-03-22 14:39:05 +00:00
Saul-Mirone
e3735f40b8 feat(editor): gfx note package (#11088) 2025-03-22 14:39:04 +00:00
Saul-Mirone
c1d426d8e9 refactor(editor): move frame toolbar config and components to its package (#11084) 2025-03-21 16:47:40 +00:00
Saul-Mirone
f5fb5c848e refactor(editor): move text toolbar config and components to its package (#11083) 2025-03-21 16:47:40 +00:00
Saul-Mirone
f762797772 refactor(editor): move shape toolbar config and components to its package (#11082) 2025-03-21 16:47:39 +00:00
Saul-Mirone
8109c718c7 feat(editor): gfx shape package (#11060) 2025-03-21 06:13:11 +00:00
Saul-Mirone
92d76ba571 refactor(editor): merge inline to std (#11025) 2025-03-20 05:46:56 +00:00
Saul-Mirone
7e6ff8d9c6 chore(editor): remove unused npm scripts (#10895) 2025-03-16 17:48:49 +00:00
doodlewind
d8dfea6ccf fix(editor): type import in vite worker env (#10856)
The dependencies of `@blocksuite/affine-gfx-turbo-renderer` in work is now all type imports.
2025-03-14 10:22:58 +00:00
doodlewind
d1c10f5401 chore(editor): hide tweakpane for turbo renderer (#10846) 2025-03-14 06:47:15 +00:00
Saul-Mirone
b8452f56a8 feat(editor): block painter extension (#10847) 2025-03-14 05:26:58 +00:00
doodlewind
be9f44fc4f fix(editor): worker loading in webpack env (#10832)
### TL;DR

Created dedicated worker entry points to avoid dynamic imports.

### What changed?

- Painters are provided during worker initialization
- Removed `ParagraphPaintConfigExtension` and the associated configuration system
- Created dedicated worker entry points in both the integration test and frontend packages
- Modified `ViewportLayoutPainter` to accept painters in its constructor
- Updated the `TurboRendererConfig` interface to require a `painterWorkerEntry` function

### Why make this change?

Webpack support. Extension objects in main thread are not available to be passed into workers. Dynamic painter path import is hard to support in webpack environment. With the [webpack-ignore](https://webpack.js.org/api/module-methods/#webpackignore) rule, there are still build errors in webpack.
2025-03-14 05:26:57 +00:00
Saul-Mirone
05f3069efd feat(editor): add i18n support for block meta display (#10831) 2025-03-13 11:28:56 +00:00
doodlewind
0f062b7157 refactor(editor): make turbo renderer a gfx extension (#10818)
This allows for easier debugging via `gfx.turboRenderer`
2025-03-13 07:45:05 +00:00
doodlewind
c023b724d0 refactor(editor): generic layout type support for turbo renderer (#10766)
This PR refactored the turbo renderer architecture to support multiple block layout types.

- New base class `BlockLayoutPainter` and `BlockLayoutProvider` are introduced for writing extendable per-block layout querying and painting logic.
- Paragraph-specific lines are all moved into dedicated classes (`ParagraphLayoutProvider` and `ParagraphLayoutPainter`) under the `/variants/paragraph` dir.
- The `renderer-utils.ts` doesn't contain paragraph-specific logic now.
- The `text-utils.ts` is also now scoped for paragraph only.
- Worker messages are now strongly typed.

Upcoming PR should further implement the block registration system using extension API. The `variants` dir could still exist, since there will be similar rendering logic that can be reused among block types (i.e., between paragraph block and list block).
2025-03-13 05:18:12 +00:00
akumatus
98a3cf8516 feat(core): update blocksuite icons (#10805) 2025-03-13 03:55:55 +00:00
Mirone
cd63e0ed8b feat(editor): replace slot with rxjs subject (#10768) 2025-03-12 11:29:24 +09:00
doodlewind
ad36a9de35 refactor(editor): add gfx turbo renderer package (#10745)
The `ViewportTurboRendererExtension` is now extracted from `@blocksuite/affine-shared` to `@blocksuite/affine-gfx-turbo-renderer` with minimal dependencies, mirroring the gfx text package in #10378.
2025-03-11 03:21:52 +00:00
Saul-Mirone
cac05e720a refactor(editor): gfx text package (#10738) 2025-03-10 10:25:21 +00:00