-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Pullquote: add block support #30951
Pullquote: add block support #30951
Conversation
4b873c9
to
a1acc07
Compare
packages/e2e-tests/fixtures/blocks/core__pullquote__deprecated-4.parsed.json
Outdated
Show resolved
Hide resolved
packages/e2e-tests/fixtures/blocks/core__pullquote__main-color.json
Outdated
Show resolved
Hide resolved
packages/e2e-tests/fixtures/blocks/core__pullquote__main-color.parsed.json
Outdated
Show resolved
Hide resolved
packages/e2e-tests/fixtures/blocks/core__pullquote__deprecated-3.serialized.html
Outdated
Show resolved
Hide resolved
packages/e2e-tests/fixtures/blocks/core__pullquote__main-color__deprecated-4.serialized.html
Outdated
Show resolved
Hide resolved
54636e6
to
42aeddc
Compare
It's the style variant CSS driving this I think. It's my opinion that we can remove the style variations in the next iteration as mention in the description. |
packages/e2e-tests/fixtures/blocks/core__pullquote__deprecated-4.parsed.json
Outdated
Show resolved
Hide resolved
I believe this is a theme issue. The theme sets a solid border style for the top and bottom borders. The "Solid color" block style has more specific CSS that sets |
5b95058
to
e81d100
Compare
Thanks for the ping. I've just rebased the branch and have started retesting. quote-example-after-rebase.mp4I haven't come across the double color panel conundrum yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've given this another test after the latest rebase. Everything works as advertised for me.
Still no sign of a duplicate color panel. I'm comfortable saying that was a one-off in Joen's local environment.
There are also a couple of e2e failures still. Re-running the tests didn't get them passing. The failures do appear unrelated to this PR so once they pass we should be right to merge.
Thanks for all the hard work on this @ramonjd 👍
Thanks a lot for the final check @aaronrobertshaw ! Looks like some of the fixtures are now failing 🤷 Maybe that's the cause of the E2E failures. I'll rebase and 🤞 |
7aa5427
to
888e6f3
Compare
Merged changes from #33502 which move block e2e fixtures |
d8ca82c
to
dfe8544
Compare
Adding some TODOs for later cleanups
…ustom colors in the deprecation and newer versions. Removing hanging empty blocks in parsed JSON
save: to make blockquote class assignment more consistent with figure class assignment migrate: to make customMainColor/style logic neater and clearer Remove state wrapper around pullquote export Rebuilding fixtures with the (for now) expected hanging block in parsed.json files. We could trim them in `getBlockFixtureHTML`
…or deprecation v3 where there is no solid style, a mainColor attribute and an existing inline border style on the figure. Regnerated fixtures. Removing textColor from block attributes as they're adding by supports hooks
…unction require it, are returning the required attributes for the latest version.
… the default and solid block styles were, aside from the text alignment, redundant. So we have removed them. To compensate for the alignment, this commit adds a text alignment block control. Deprecated blocks will still have the `is-style-solid-class`, so we keep the styles targeting it, and also ensure that we set the new attribute `textAlign` to "left" when it's present. Add specificity to the left and right text align styles so that the block alignment controls have a great chance of overriding theme styles.
All we needed to do was add `__deprecated` to the file name so that the fixture test regex could find it :)
dfe8544
to
db08851
Compare
Description
In this PR, we're adding border and color block support to the Pullquote block.
Given that we can now achieve border and background variations using block supports, we're removing the existing styles and adding a
textAlign
attribute to compensate.Furthermore, because the new block supports already offers the controls we need to style the Pullquote, the current controls are not required. We have therefore removed those and also the styles/border/classes logic.
ℹ️ There was some discussion about whether this PR could be split into two: adding first border support, then color support in a later PR. I believe this block is a special case because, at present, the background colour control determines both the border colour and background colour, depending on which block style we select.
How has this been tested?
Manually, in the editor (web and mobile device)
Because this PR deprecates the current version of Pullquote, we've updated the fixtures (version 4 is the last previous version).
Check that fixtures are valid:
npm run fixtures:regenerate test/integration/full-content/full-content.test.js
And by pasting current fixture block code into the editor and making sure a valid transform takes place.
Check in a native mobile device that the block works as intended.
Screenshots
Types of changes
These changes add experimental border and color block support to the Pullquote block.
The attributes are changing, hence we've added a deprecation (v4).
Block support controls supersede the block's original controls, so we have removed them. So too, there's now no longer any need to differentiate between the usage of
mainColor
for background and border, since we can control each independently.Part of #28913
cc @aaronrobertshaw