-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable grid control strategies for components which don't support st…
…yle props (#6610) **Problem:** Now it is possible to use the gap and the grid resize controls on components which do not support style props. **Fix:** We somehow have to decide whether a component supports style props or not. I implemented the following heuristics, but we can improve that later if necessary: 1. If a component has a descriptor and it allows 'layout-system' section to be shown then it supports style props. 2. If it doesn't have a descriptor then we check if the component implementation takes the necessary style props (similarly to the already existing `targetSupportsPropsSize` function). This returns true when the component implementation can not be found (if it is an external component) Note: When the component does not support the necessary style props: - I don't show the gap control, but it is just misleading if it is there - I show the grid resize controls, because they show information (row/column size), which is meaningful even if the control is not interactive. These are just draft solution, so a followup task is necessary to design/implement the the non-interactive state of the controls **Commit Details:** (< vv pls delete this section if's not relevant) -`targetRegisteredStyleControlsOrHonoursStyleProps` is the main function which decides whether a component supports style props for the actual control. You can give an inspector section to check (if that is enabled from the annotation, it returns true), and a list of props (if they are referred inside the component we return true). **Manual Tests:** I hereby swear that: - [x] I opened a hydrogen project and it loaded - [x] I could navigate to various routes in Play mode
- Loading branch information
Showing
7 changed files
with
151 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters