Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(edgeless): allow canvas content interleaving with DOM based on LayerManager #5347

Merged
merged 38 commits into from
Nov 28, 2023

Conversation

doouding
Copy link
Member

@doouding doouding commented Nov 16, 2023

Design

In order to allow canvas content to interleave with the DOM content, the canvas content should be able to be rendered on an isolated canvas. The isolated canvas can have its own z-index property, allowing it to be rendered between stacked DOM elements.

We have introduced the LayerManager component that places elements into different layers based on their index property and rendering type. If multiple elements with consecutive indices have the same rendering type, they will be placed within the same layer.

In the following example, the elements have been grouped into three layers:

Screenshot 2023-11-28 at 11 37 22 AM

After building layers, we are able to decide which layer could and should be rendered on an isolated canvas. In this example, the first layer should be rendered on an isolated canvas with the lowest index, and the third layer can be rendered on the main canvas which is always rendered on the very top.

Todo:

  • LayerManager
  • Add support of multiple canvases rendering for surface block
  • Bug & Test

@doouding doouding added the dont merge Experimental pull requests label Nov 16, 2023
Copy link

vercel bot commented Nov 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2023 2:55am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
blocksuite-docs ⬜️ Ignored (Inspect) Visit Preview Nov 28, 2023 2:55am

@doodlewind doodlewind added notable Major improvement worth emphasizing and removed dont merge Experimental pull requests labels Nov 18, 2023
@doouding
Copy link
Member Author

Finally

@doodlewind doodlewind changed the title feat(edgeless): allow surface elements to adjust index along with block feat(edgeless): allow canvas content interleaving with DOM based on LayerManager Nov 28, 2023
Copy link
Member

@doodlewind doodlewind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, thanks!

@doodlewind doodlewind merged commit fc857d5 into master Nov 28, 2023
19 checks passed
@doodlewind doodlewind deleted the feat/surface-fusion branch November 28, 2023 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notable Major improvement worth emphasizing
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants