Commit Graph

44 Commits

Author SHA1 Message Date
db8dac03d2 Prepare styles in store for sidebar
[MAILPOET-5638]
2024-03-01 16:36:52 +01:00
f2dd786d19 Remove unused method from SettingsController
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
5f2b5e4bd4 Add support for the site theme's color palette
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
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
875fde56e9 Add colors from palette support to the button
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
f3392168ca Add color palette classes to CSS for renderer
[MAILPOET-5741]
2024-02-28 09:01:20 +01:00
6ccbf84cdf Use gap size as email layout padding
[MAILPOET-5816]
2024-01-24 15:38:13 +01:00
3574e6b2ca Move gradients config to theme.json
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
c75f30ce4e Move border settings for the editor to theme.json
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
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
6f3ebc10b8 Remove unnecessary editor styles
These styles were later overwritten by $editorTheme->get_stylesheet()
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
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
0daf720d34 Add hook for changing default theme for email editor
[MAILPOET-5814]
2024-01-23 16:47:48 +01:00
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
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
512d47609e Use merged theme in renderer CSS and for font-size slug translation
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
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
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
a472df257a Replace font size slugs with values in typography preprocessor
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
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
c4586d60e9 Move the default font family and font size settings to the theme.json
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
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
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
db9813a3aa Remove gradients from the new email editor
[MAILPOET-5824]
2024-01-19 13:13:27 +01:00
9b05e46690 Use theme.json defined background in renderer
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
c5ad2405aa Add Flex Renderer test
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
2032370f03 Add default core editor styles
We accidentally removed them when adding layout styles.
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
bfa7b509cc Add buttons block rendering
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
6807189df3 Enable border-related settings in the email editor
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
3a74c1c4a0 Enable blocks and register dummy button/buttons renderers
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
37d893ff47 Disable fontWeight settings for Paragraphs
[MAILPOET-5642]
2024-01-05 10:17:23 +01:00
52214962a6 Disable dropCap settings for Paragraphs
[MAILPOET-5642]
2024-01-05 10:17:23 +01:00
6ec1a46492 Add theme.json containing padding and email width
I used theme.json for generating classes useful for full-width in the email editor.
[MAILPOET-5688]
2023-12-21 13:04:10 +01:00
a854c3407a Enable alignWide in BlockEditor
[MAILPOET-5688]
2023-12-21 13:04:10 +01:00
aa40d7eb7b Set BlockList layout
[MAILPOET-5688]
2023-12-21 13:04:10 +01:00
7792331999 Add rendering improvements for Outlook
[MAILPOET-5705]
2023-11-27 12:54:30 +01:00
328fcfa260 Move method for composing styles to SettingsController
To avoid repetition I decided to move this method to better place.
[MAILPOET-5705]
2023-11-27 12:54:30 +01:00
0d771a7fc5 Add support for creating styles from block attributes e.g., text alignment styles
MAILPOET-5643
2023-11-17 09:49:06 +01:00
5eb9551d28 Load and apply layout styles in the email editor
This commit enables us to load styles for editor content.
The rules are prefixed by .editor-styles-wrapper class
[MAILPOET-5715]
2023-11-16 13:51:24 +01:00
1b73e0f4db Allow core/list, core/list-item blocks in email editor
[MAILPOET-5645]
2023-11-11 09:38:35 +04:00
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
0ac72d43e6 Merge StylesController to SettingsController
[MAILPOET-5591]
2023-11-09 09:06:33 +01:00
9f0e015f44 Load core editor setting as the base settings for the email editor
[MAILPOET-5660]
2023-10-26 10:43:00 +02:00
399ed61503 Introduce SettingsController for managing editor settings
[MAILPOET-5637]
2023-10-17 16:06:06 +02:00