mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
### TL;DR Added DOM-based renderer for connector elements in the AFFiNE editor. ### What changed? - Created a new DOM-based renderer for connector elements that uses SVG for rendering - Implemented `ConnectorDomRendererExtension` to register the DOM renderer for connector elements - Added support for rendering connector paths, endpoints (arrows, triangles, circles, diamonds), stroke styles, and labels - Registered the new DOM renderer extension in the connector view setup - Added comprehensive tests to verify DOM rendering functionality ### How to test? 1. Enable the DOM renderer flag in the editor 2. Create connector elements between shapes or with fixed positions 3. Verify that connectors render correctly with different styles: - Try different stroke styles (solid, dashed) - Test various endpoint styles (Arrow, Triangle, Circle, Diamond) - Add text labels to connectors 4. Check that connectors update properly when connected elements move 5. Verify that connectors are removed when deleted ### Why make this change? The DOM-based renderer provides an alternative to the Canvas-based renderer, offering better accessibility and potentially improved performance for certain use cases. This implementation allows connectors to be rendered as SVG elements within the DOM, which can be more easily inspected, styled with CSS, and interacted with by assistive technologies.
BlockSuite Framework
Here are the vanilla framework packages in BlockSuite.