Giter VIP home page Giter VIP logo

Comments (2)

ingeniumed avatar ingeniumed commented on July 18, 2024

First and most importantly, I'm not sure how to make a ruleset work where I allow core/list nested in a block and can interact with it's children core/list-item blocks. I can only apply these rules at the root level, but not in a nested block. This seems like a bug, or I'm missing a configuration step.

This applies not only here, but also to attempt 3 and attempt 4.

This is definitely a bug. It's actually a TODO in the block-utils.js code but wasn't documented in the limitations in the README. For block searches within a child we only go one level in the parent-child hierarchy in the governance rules. This means that, while attempt 4 is correct it's not being parsed correctly.

Our default ruleset makes it easy to avoid repeating rules like core/paragraph everywhere, but it only applies to the root set of blocks. Once we start making inner allowedBlocks, we're still required to repeat that. We should consider solutions where that isn't necessary.

This one has been tricky to come up with a solution because while we do want to make it easy to use, we also want to be restrictive. The root level allowed blocks should be separate from the parent-child allowed blocks in case someone does want to keep them different.

This may be another potential area of improvement. Some blocks like core/list or core/columns are only usable with their child blocks enabled. Potentially we can hardcode some core blocks to support necessary child items to remove this responsibility from the rules file creator.

This was how the original code was, but the challenge is that we have to maintain this list and that can get tedious. That's also not going to work for custom blocks, which is the onus was changed to be on the rule maker. I'm trying to see if we can use the allowedBlocks property within the innerBlocks of a block to determine this, but that's not exposed AFAIK.

Hope that makes sense as to why this is happening. I'll open up a bug for that undocumented limitation.

from vip-governance-plugin.

ingeniumed avatar ingeniumed commented on July 18, 2024

Opened #31 for this

from vip-governance-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.