Commit Graph

57 Commits

Author SHA1 Message Date
Mike Jolley
b058880b83 font size typo 2024-04-22 12:43:17 +01:00
Mike Jolley
05fe64d8f9 testItRendersFontSize 2024-04-22 12:43:17 +01:00
Mike Jolley
1220641417 Adjust font size tests 2024-04-22 12:43:17 +01:00
Rostislav Wolny
fd04141141 Use Text renderer also for paragraph block
[MAILPOET-5798]
2024-04-18 12:45:15 +02:00
Rostislav Wolny
d49f3e8988 Rename Heading renderer to Text renderer
[MAILPOET-5798]
2024-04-18 12:45:15 +02:00
Mike Jolley
37e901c809 Restore content renderer styles to fix remaining tests 2024-04-10 11:42:50 +02:00
Mike Jolley
5085fee15d Update color selectors 2024-03-25 12:11:11 +01:00
Mike Jolley
fc384424ac Update tests to reflect markup changes 2024-03-25 12:11:11 +01:00
Jan Lysý
4c3f86e552 Update integration tests
[MAILPOET-5640]
2024-03-22 17:19:44 +01:00
Mike Jolley
2d75acfeb1 remove debugging code 2024-03-13 10:02:00 +01:00
Mike Jolley
e44745109a Attempt to target specific block for column test 2024-03-13 10:02:00 +01:00
Mike Jolley
f21462d563 Missing is-vertically-aligned-stretch 2024-03-13 10:02:00 +01:00
Mike Jolley
b91568ed74 Fix invalid block markup 2024-03-13 10:02:00 +01:00
Mike Jolley
44d95d9e6b Fixing tests and adding debug information to show generated HTML 2024-03-13 10:02:00 +01:00
Mike Jolley
a8ea1d3453 Adjust tests so wrapper has styles 2024-03-13 10:02:00 +01:00
Mike Jolley
880f157fb0 Update tests due to moving some classnames and styles 2024-03-13 10:02:00 +01:00
Mike Jolley
69f78e97ce remove some potentially unwanted rules in unit tests 2024-03-13 10:02:00 +01:00
Rostislav Wolny
970b321de5 Fix border color fallback for button block
When the border color is not set, a block uses text color as a fallback.
This was not working properly for the button block when the font color was picked from the color palette.
This PR fixes the issue and adds the proper border color class.

[MAILPOET-5919]
2024-03-12 08:38:56 +01:00
Jan Lysý
eea5ca0b83 Update integration test for column and columns
After refactoring the styles are composed a bit differently, so we need to update tests.
[MAILPOET-5638]
2024-02-29 11:05:55 +01:00
Jan Lysý
9e8647f046 Add support for rendering column and columns borders
[MAILPOET-5821]
2024-02-29 11:05:55 +01:00
Rostislav Wolny
875fde56e9 Add colors from palette support to the button
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
Rostislav Wolny
299d51effa Add support for palette colors for column and columns
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
Rostislav Wolny
5ad27b6038 Adjust the list block renderer to support inlined colors
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
Rostislav Wolny
330b4c5a6c Adjust Paragraph block to work with inlined color palette CSS
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
Rostislav Wolny
2645d57dcb Adjust Paragraph block to work with inlined color palette CSS
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
Rostislav Wolny
b90a35d80a Add definition of default heading font-sizes and renderer support
Initially, I tried to place the definition to theme.json
(It could set it in styles.block.core/heading or styles.elements.h1...)
It was not possible to use theme.json because of the fluid typography
feature which, when enabled for a site, causes font sizes to being
converted to the fluid definition (clamp(x, y, z)) and which
is not usable for an email due to very little client support.

We need to make some changes in Gutenberg to be able to disable the feature.
Currently, the code for generating font sizes in CSS generated from the theme.json
looks directly at the global settings of the site.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
4b55bb5bb3 Move default core/button styles configuration to integration
[MAILPOET-5814]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
cd274c0738 Add basic style for buttons
Default background rendering has to be handled on the button renderer level
because of a specific markup for Outlook (bgcolor attribute). Default text color and paddings are
handled via CSS inlining. That's why they are tested in RendererTest

I used the same background color and font color as the one defined for the button
element in WP core theme.json, and I also used similar padding values
(In core they use "calc(0.667em + 2px) calc(1.333em + 2px)")
[MAILPOET-5814]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
daf2d9f854 Update button renderer to read font size set by preprocessor
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
e8bb1b5ac0 Refactor font family rendering using CSS inlining
We don't reset font family on any level, so there is no need to
bubble the setting using a preprocessor and render the inline styles
explicitly in every block.

In this commit, I change how font-family settings are distributed/rendered
in the email renderer. In the new approach, we rely on class names defining font-family
and a generated CSS sheet with font-family definitions.
We apply the font-family CSS by inlining CSS rules for families in the later phase of
rendering after all individual blocks are processed.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Jan Lysý
56c566d189 Update Image block test
[MAILPOET-5788]
2024-01-16 12:22:54 +01:00
Rostislav Wolny
b35e0af691 Remove old code that was handling creating emails for the new editor
The code is no longer needed because the new emails are created via API.
[MAILPOET-5810]
2024-01-14 19:43:26 +05:00
Rostislav Wolny
b2c17fcdf4 Fix formatting and add return type hints to buttons related tests
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
70273c626d Add Button renderer test
This commit adds a button renderer test and fixes a couple of issues
found when working on the test
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
d54847ce83 Refactor construction of NewsletterEntity when creating an email in the new editor
When we create a new email in the new editor we ensure there is
also an associated NewsletterEntity.
This commit improves this functionality by replacing custom code with
 NewsletterSaveController, which ensures that the sender name and address are set.
[MAILPOET-5646]
2024-01-08 12:04:06 +05:00
Jan Lysý
efd9abcf76 Skip width style setting in blocks paragraph and heading
[MAILPOET-5642]
2024-01-05 10:17:23 +01:00
Jan Lysý
1331e7e257 Extend block paragraph integration test
[MAILPOET-5642]
2024-01-05 10:17:23 +01:00
Jan Lysý
67a2e92d8c Add image block integration test
[MAILPOET-5705]
2023-11-27 12:54:30 +01:00
Oluwaseun Olorunsola
4f412282e6 Add tests for Heading Block Renderer
MAILPOET-5643
2023-11-17 09:49:06 +01:00
Jan Lysý
81e079ceab Unify used assert function in test class
[MAILPOET-5690]
2023-11-13 06:58:52 +01:00
Jan Lysý
e7e569e3ee Extend column block integration test about vertical-alignment
[MAILPOET-5690]
2023-11-13 06:58:52 +01:00
Jan Lysý
d60004da2a Add ListBlock integration test
As a part of this commit is a new method validating HTML. I moved it to the bootstrap to avoid repetition in the future.
[MAILPOET-5645]
2023-11-11 09:38:35 +04:00
Jan Lysý
5644cab9e3 Refactor BlocksRegistry to pass dependencies as an argument
For better extensibility of 3rd party developers, I refactored to pass Settings Controller as an argument.
[MAILPOET-5591]
2023-11-09 09:06:33 +01:00
Jan Lysý
3cb9891235 Add integration Paragraph test
[MAILPOET-5591]
2023-11-09 09:06:33 +01:00
Jan Lysý
6cadd1273a Add integration Column test
[MAILPOET-5591]
2023-11-09 09:06:33 +01:00
Jan Lysý
180f06f1a8 Update integration Columns test
[MAILPOET-5591]
2023-11-09 09:06:33 +01:00
Jan Lysý
2ce6fd8688 Remove BlocksRenderer and fix tests
[MAILPOET-5591]
2023-11-09 09:06:33 +01:00
Jan Lysý
0ac72d43e6 Merge StylesController to SettingsController
[MAILPOET-5591]
2023-11-09 09:06:33 +01:00
Rodrigo Primo
fa9236d8c9 Replace expect()->greaterThan() with verify()->greaterThan()
codeception/verify 2.1 removed support for expect()->greaterThan() so we need
to replace it with verify()->greaterThan().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Rodrigo Primo
0d2f6e0776 Replace expect()->stringContainsString() with verify()->stringContainsString()
codeception/verify 2.1 removed support for expect()->stringContainsString() so we need
to replace it with verify()->stringContainsString().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00