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

[FR] Outline view #567

Open
leevigraham opened this issue May 3, 2022 · 3 comments
Open

[FR] Outline view #567

leevigraham opened this issue May 3, 2022 · 3 comments

Comments

@leevigraham
Copy link
Contributor

Description

Still fleshing this idea out but some kind of outline view could be very cool.

Webflow has a content navigator:

Screen Shot 2022-05-04 at 8 50 45 am

Combine this with a double click -> slide out editor for each block this could be a powerful editing experience.

@leevigraham
Copy link
Contributor Author

@ttempleton I was going to have a crack as this as a plugin first.

I see there are some events on the field for addBlock and removeBlock but nothing like blocksChanged or some kind of event that covers other updates like dragging.

I was thinking if there was some kind of catch all change event then I could parse the tree and create the outline.

Then I started thinking about the idea of keeping an internal tree structure inside the input.js. Is there anything like that… I can see there's a blocks property.

@ttempleton
Copy link
Contributor

The _blocks property is just an array of all the blocks in the field. I've made some changes today, for the next release, that would allow you to call an input's getBlocks(1) to get all top level blocks, then call the blocks' getChildren(), etc. to traverse the block structure, if that helps. Otherwise, happy to add anything you need.

@ttempleton
Copy link
Contributor

Also just added an updateBlockOrder event, and will have a look at a general 'any change to the field' event later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants