Comments (2)
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.
Opened #31 for this
from vip-governance-plugin.
Related Issues (20)
- Explore switching to Typescript
- Expand rules to be post type specific HOT 1
- Check parent-child hierarchy at all depths
- Add starter tests for javascript code
- Add tests for nested-governance-loader.js
- Add e2e condition that verifies colours
- Add tests for block-locking.jsx
- Use a better solution for determining core nested blocks HOT 2
- Automate the release process
- Incorporate useBlockEditingMode() for block locking
- Handle disabling non-theme colours
- Handle multisite support HOT 1
- Create a CLI validate command for the rules file
- Add support for automated styling
- Discussion: Non-WordPress VIP Support HOT 6
- Block recovery errors in WordPress 6.4
- Add filter to enable for programmatic JSON generation.
- Assets get enqueued with invalid URL on non-VIP deployments HOT 2
- Disallowed/locked blocks trigger browser console warning HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vip-governance-plugin.