Commit Graph

52 Commits

Author SHA1 Message Date
Mike Jolley
48cc71f98f Attempt to fix mock 2024-05-17 11:26:44 +02:00
Mike Jolley
d20b4bb6c9 Add group support w/ support for contentSize 2024-05-17 11:26:44 +02:00
Mike Jolley
8bc52a29b9 Inline styles using emogrifier 2024-05-01 11:15:27 +01:00
Rostislav Wolny
47a4871600 Remove unused SettingsController::convertStylesToString method
[MAILPOET-5798]
2024-04-18 12:45:15 +02:00
Jan Lysý
95f3766b4d Add theme styles component for email editor
[MAILPOET-5640]
2024-03-22 17:19:44 +01:00
Jan Lysý
5ceef236bf Use the same format for styles as it is in theme.json
This should be the first step to using theme.json format in DB and merging more style configurations to the final one.
[MAILPOET-5640]
2024-03-15 16:57:41 +01:00
Jan Lysý
c415f1efce Move heading styles from CSS file to theme.json
Because we want to have all editor configurations in theme.json, I moved heading font sized to theme.json and removed redundant filters.
[MAILPOET-5640]
2024-03-15 16:57:41 +01:00
Jan Lysý
698c41b77b Use styles from settings controller in preview
[MAILPOET-5638]
2024-03-01 16:36:52 +01:00
Jan Lysý
db8dac03d2 Prepare styles in store for sidebar
[MAILPOET-5638]
2024-03-01 16:36:52 +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
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
Jan Lysý
6ccbf84cdf Use gap size as email layout padding
[MAILPOET-5816]
2024-01-24 15:38:13 +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
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
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
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
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
Rostislav Wolny
9b05e46690 Use theme.json defined background in renderer
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
c5ad2405aa Add Flex Renderer test
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
2032370f03 Add default core editor styles
We accidentally removed them when adding layout styles.
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
bfa7b509cc Add buttons block rendering
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
6807189df3 Enable border-related settings in the email editor
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
3a74c1c4a0 Enable blocks and register dummy button/buttons renderers
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Jan Lysý
37d893ff47 Disable fontWeight settings for Paragraphs
[MAILPOET-5642]
2024-01-05 10:17:23 +01:00
Jan Lysý
52214962a6 Disable dropCap settings for Paragraphs
[MAILPOET-5642]
2024-01-05 10:17:23 +01:00
Jan Lysý
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
Jan Lysý
a854c3407a Enable alignWide in BlockEditor
[MAILPOET-5688]
2023-12-21 13:04:10 +01:00
Jan Lysý
aa40d7eb7b Set BlockList layout
[MAILPOET-5688]
2023-12-21 13:04:10 +01:00
Jan Lysý
7792331999 Add rendering improvements for Outlook
[MAILPOET-5705]
2023-11-27 12:54:30 +01:00
Jan Lysý
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
Oluwaseun Olorunsola
0d771a7fc5 Add support for creating styles from block attributes e.g., text alignment styles
MAILPOET-5643
2023-11-17 09:49:06 +01:00
Rostislav Wolny
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
Jan Lysý
1b73e0f4db Allow core/list, core/list-item blocks in email editor
[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ý
0ac72d43e6 Merge StylesController to SettingsController
[MAILPOET-5591]
2023-11-09 09:06:33 +01:00