mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 09:59:55 +08:00
aa052096c1
#### PR Dependency Tree * **PR #13464** 👈 * **PR #13465** This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * DOM-based SVG rendering for Brush and Highlighter with zoom, rotation, layering and improved visualization. * **Refactor** * Consolidated renderer exports into a single entry point for simpler integration. * **Chores** * Updated view registrations to include the new DOM renderer extensions. * Improved highlighter sizing consistency based on serialized bounds. * **Revert** * Removed highlighter renderer registration from the shape module. <!-- end of auto-generated comment: release notes by coderabbit.ai --> #### PR Dependency Tree * **PR #13464** 👈 * **PR #13465** * **PR #13471** * **PR #13472** * **PR #13473** This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import {
|
|
type ViewExtensionContext,
|
|
ViewExtensionProvider,
|
|
} from '@blocksuite/affine-ext-loader';
|
|
|
|
import { BrushTool } from './brush-tool';
|
|
import { effects } from './effects';
|
|
import { EraserTool } from './eraser-tool';
|
|
import { HighlighterTool } from './highlighter-tool';
|
|
import {
|
|
BrushDomRendererExtension,
|
|
BrushElementRendererExtension,
|
|
HighlighterDomRendererExtension,
|
|
HighlighterElementRendererExtension,
|
|
} from './renderer';
|
|
import {
|
|
brushToolbarExtension,
|
|
highlighterToolbarExtension,
|
|
} from './toolbar/configs';
|
|
import { penSeniorTool } from './toolbar/senior-tool';
|
|
|
|
export class BrushViewExtension extends ViewExtensionProvider {
|
|
override name = 'affine-brush-gfx';
|
|
|
|
override effect(): void {
|
|
super.effect();
|
|
effects();
|
|
}
|
|
|
|
override setup(context: ViewExtensionContext) {
|
|
super.setup(context);
|
|
|
|
context.register(BrushTool);
|
|
context.register(EraserTool);
|
|
context.register(HighlighterTool);
|
|
|
|
context.register(BrushElementRendererExtension);
|
|
context.register(BrushDomRendererExtension);
|
|
context.register(HighlighterElementRendererExtension);
|
|
context.register(HighlighterDomRendererExtension);
|
|
|
|
context.register(brushToolbarExtension);
|
|
context.register(highlighterToolbarExtension);
|
|
|
|
context.register(penSeniorTool);
|
|
}
|
|
}
|