Commit Graph

130 Commits

Author SHA1 Message Date
Jan Lysý
db8dac03d2 Prepare styles in store for sidebar
[MAILPOET-5638]
2024-03-01 16:36:52 +01:00
Jan Lysý
3a2573bb5b Fix column and columns width when border is set
[MAILPOET-5821]
2024-02-29 11:05:55 +01:00
Jan Lysý
a693c6f4ae Fix width for full-width blocks with borders
[MAILPOET-5821]
2024-02-29 11:05:55 +01:00
Jan Lysý
2636bc1055 Update BlocksWidthPreprocessor to calculate with borders
[MAILPOET-5821]
2024-02-29 11:05:55 +01:00
Rostislav Wolny
f2dd786d19 Remove unused method from SettingsController
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
Rostislav Wolny
5f2b5e4bd4 Add support for the site theme's color palette
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
Rostislav Wolny
e5d11f99d4 Cache WP_Theme_JSON instance
This is a slight improvement to avoid building WP_Theme_JSON instance repeatedly.
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
Rostislav Wolny
b724ef4ac2 Extract Theme related methods from SettingsController as ThemeController
I want to avoid the SettingsController becoming some kind of a god class
so in this step, I extracted themejson-related stuff to an extra class.

In the future, we should also move methods for manipulating CSS to a helper.
[MAILPOET-5741]
2024-02-28 09:01:20 +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
f3392168ca Add color palette classes to CSS for renderer
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
Rostislav Wolny
2858a21783 Add spacing sizes presets
This commit addresses an issue that padding control in the email
an editor is rendered without a slider.
This change makes the padding control render the same as in TT4 theme
[MAILPOET-5714]
2024-02-19 11:44:33 +01:00
Jan Lysý
1338554c41 Change property name to better fit to new classname
[MAILPOET-5809]
2024-02-19 11:18:58 +01:00
Jan Lysý
dc96fa2b1c Add postprocessor for replacing mark tag to span
[MAILPOET-5809]
2024-02-19 11:18:58 +01:00
Jan Lysý
9b54217049 Rename PreprocessManager class to ProcessManager
As we want to add rendering postprocessing, it's better to use a different name for this class.
[MAILPOET-5809]
2024-02-19 11:18:58 +01:00
Jan Lysý
a671a88956 Remove replacing space in image URL
This fix should not be used anymore.
[MAILPOET-5809]
2024-02-19 11:18:58 +01:00
Jan Lysý
b6538cd1c6 Set default line-height for the rendered email
[MAILPOET-5809]
2024-02-19 11:18:58 +01:00
Pavel Dohnal
9cf2eef721 Register send status
[MAILPOET-5851]
2024-02-15 10:43:46 +01:00
Jan Lysý
851a9626c9 Enable typography appearance
[MAILPOET-5840]
2024-02-14 14:43:10 +01:00
Jan Lysý
436349a980 Remove skipping core/columns in spacing preprocessor
[MAILPOET-5816]
2024-01-24 15:38:13 +01:00
Jan Lysý
d2ebd587a0 Remove a space in style causing failing integration test
[MAILPOET-5816]
2024-01-24 15:38:13 +01:00
Jan Lysý
fc79e3eee9 Implement margin-top for core block renderers
[MAILPOET-5816]
2024-01-24 15:38:13 +01:00
Jan Lysý
92fec6eb2f Fix spaces around list elements in Outlook
[MAILPOET-5816]
2024-01-24 15:38:13 +01:00
Jan Lysý
48b4388992 Add block spacing preprocessing
[MAILPOET-5816]
2024-01-24 15:38:13 +01:00
Jan Lysý
9e0209f0c6 Reduce resetting styles for email rendering
Because a lot of reset styles make the email HTML hardly readable, I decided to reduce reset styles.
[MAILPOET-5816]
2024-01-24 15:38:13 +01:00
Jan Lysý
6ccbf84cdf Use gap size as email layout padding
[MAILPOET-5816]
2024-01-24 15:38:13 +01:00
Jan Lysý
7ab562bdd2 Set default block gap
[MAILPOET-5816]
2024-01-24 15:38:13 +01:00
Rostislav Wolny
d6e83a3471 Add documentation for theme.json
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
3574e6b2ca Move gradients config to theme.json
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
c75f30ce4e Move border settings for the editor to theme.json
[MAILPOET-5740]
2024-01-23 16:47:48 +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
6f3ebc10b8 Remove unnecessary editor styles
These styles were later overwritten by $editorTheme->get_stylesheet()
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
89a02fce39 Remove unnecessary settings in the DEFAULT_SETTINGS constant
These settings are later completely replaced by settings generated
from theme.json
[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
0daf720d34 Add hook for changing default theme for email editor
[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
b9b57cc574 Refactor getSettings to work with the mered theme
The method was loading both themes separately. This commit changes
the behavior so that it uses only the email theme which contains
also the core theme settings.
Instead of modifying the core theme settings in PHP we can now
move these settings into the email editor theme, which is merged
into the core theme.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
512d47609e Use merged theme in renderer CSS and for font-size slug translation
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
55dd1d0ab0 Improve getTheme to return merged core theme + email theme
The idea is that the core theme is a base and we add email-specific
modifications on top of and create a core email theme.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
0e04a892c2 Inline style declaration from font-size classes
This is needed for cases where we don't touch the HTML output
to insert font size from the preprocessor (e.g., list item)
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
a472df257a Replace font size slugs with values in typography preprocessor
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
d62f3c1938 Render email main font family CSS rules in the content wrapper
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
2573042431 Remove default content styles
These are no longer needed.
I also found that the settings for font-size for headings were
not used anywhere.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
c4586d60e9 Move the default font family and font size settings to the theme.json
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
07e6940162 Add the basic list of font families
Add basic font families. For now, we use know-how from the current editor
and we use the same list of fonts as were used in the current editor
[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
Rostislav Wolny
a7aaf97070 Improve typography preprocessor to get font family value from slugs
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
890050fdc8 Fix font-family processing in the typography preprocessor.
The font-family property is not included under styles but at the top level
of block attributes.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
429f0ce081 Enable font family selection in email editor
Initially, we use just basic serif and sans serif fonts.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Pavel Dohnal
db9813a3aa Remove gradients from the new email editor
[MAILPOET-5824]
2024-01-19 13:13:27 +01:00
Jan Lysý
b68df77aee Simplify ListBlock renderer
Because for nesting is better to doesn't have any wrapper, we add configured styles directly to the list tag
[MAILPOET-5790]
2024-01-11 14:39:08 +01:00