Commit Graph

239 Commits

Author SHA1 Message Date
Jan Lysý
99d4c3bcaf Add button with shortcode icon into richText panel
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
1a9b711b1f Replace TextArea by RichText component in Email editor details panel
RichText component allows us using HTML comments for subject and preheader
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
cd9b8dab64 Add missing CSS for HTML comments in RichText
Because CSS for HTML comments in RichText is a part of BlockEditor,
and we want to minimize the plugin build, this commit adds the necessary CSS.
[MAILPOET-6387]
2024-12-18 09:54:39 +01:00
Jan Lysý
132c247d97 Update email-editor @wordpress/rich-text dependency to 7.14.0
[MAILPOET-6387]
2024-12-18 09:54:39 +01:00
Rostislav Wolny
43f7542c64 Improve the look of labels in the save items popup in the editor
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
bc10ae7216 Cleanup JS code from styles - template association
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
269b55ed08 Use current styles from the store for template previews in the selector
This commit ensures that templates are previewed with the latest styles
set in the editor. Previously, we were using the version sent from the server that
might be out of date.
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
6472021359 Update notice text when saving template or global styles
The code triggers the same notice for changes in a template or changes in global styles.
This commit makes the text of the notice more generic to work for both.
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
d1166edbd8 Cleanup user styles before applying
We need to remove empty values that may occur when the user resets a value.
These empty values prevent applying defaults coming from editor theme after reset.
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
c908cabcf6 Fix saving styles to save only user-edited props
There was a typo in StylesColorPanel property, and we were passing incorrect values.
StylesColorPanel.value expects user set values
StylesColorPanel.inheritedValue expects merged styles
See b66f9ff095/packages/edit-site/src/components/global-styles/screen-colors.js (L23-L28)
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
b5e8cf84c8 Fix issue with CSS variables in the style panel
Some components in the style setting (e.g., SpacingSizesControl) don't work
with the CSS variables when present in valid CSS form (e.g., var(--wp--preset--spacing--10)).
To prevent issues, we need to transform CSS variables to the shortened variant.
The core uses more sophisticated functions for that, see
f2ba0fdb4c/packages/block-editor/src/components/global-styles/utils.js (L307-L358)
The functionality is private, so I've created a simpler version.
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
ebe7151269 Remove code related to template themes
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
fdc0d15b63 Load user styles in the email editor properly
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
de03e84eb4 Use global styles aka user theme for editor styles
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
8f512a7967 Add hook for working with email global styles
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Rostislav Wolny
f906cd686f Add functionality for fetching global styles from server
[MAILPOET-6335]
2024-12-17 10:36:39 +01:00
Oluwaseun Olorunsola
08ba9b1da9 Fix acceptance test
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
36130c9809 Ensure "Start from scratch" button sticks to the end of the modal
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
52a6122e74 Fix header and footer not showing for recent category email post templates
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
4f948dfd65 Filter out empty email post-content
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
f79c0cec55 Update template selector styles
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
a80a6bf5c5 Refactor SelectTemplateBody and use memo and useEffect when required to improve render performance
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
8661a169b3 Add basic optimization for usePreviewTemplates to improve render performance
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
bc0ce09d61 Add support for email-general and email-simple templates
The previous implementation only checks for email-general templates

MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
fb5166ab7c Fix an edge case where it might be possible for email content to have similar post-slug
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
16e4346d07 Fix using sent email post content as new email editor page template
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
651e80b8f0 Fetch emailPosts for use in template selection modal
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Oluwaseun Olorunsola
17bda157aa Add Selector to fetch mailpoet email editor post-types
MAILPOET-5949
2024-12-09 17:06:48 +01:00
Rostislav Wolny
c35bf6a008 Fix double sidebar header
The issue was fixed in @wordpress/interface but we were using
the older version.
The @wordpress/interface is not distributed standalone in WP Core
so we bundle it.
[MAILPOET-6371]
2024-12-09 14:47:09 +01:00
Rostislav Wolny
e181725127 Change the texts in the component with changes to save to match email context
This should be removed after the upstream
contextualize the template texts to match associated post types or uses more generic texts.
See https://github.com/WordPress/gutenberg/issues/67697
[MAILPOET-6342]
2024-12-09 14:16:04 +01:00
Rostislav Wolny
4b761ac74d Cleanup SaveEmailButton to work only with email
[MAILPOET-6342]
2024-12-09 14:16:04 +01:00
Rostislav Wolny
2e52419ffd Add save all button and logic for displaying it in the header
[MAILPOET-6342]
2024-12-09 14:16:04 +01:00
Rostislav Wolny
5b443027bf Rename SaveButton to SaveEmailButton
This component will be used for saving changes only in email content.
It is a link variant button and will still be present next to Save/Send button.
[MAILPOET-6342]
2024-12-09 14:16:04 +01:00
Oluwaseun Olorunsola
fbf4272e0e Update email editor acceptance test
MAILPOET-6331
2024-12-09 10:30:42 +01:00
Oluwaseun Olorunsola
8b1f7c9a88 Fix lint style errors
MAILPOET-6331
2024-12-09 10:30:42 +01:00
Oluwaseun Olorunsola
2896ed45eb Add text information for recent category templates
MAILPOET-6331
2024-12-09 10:30:42 +01:00
Oluwaseun Olorunsola
cec952fbde Add help icon to recent button
MAILPOET-6331
2024-12-09 10:30:42 +01:00
Oluwaseun Olorunsola
cb091e0dc6 Add support for basic tab navigation when selecting template
MAILPOET-6331
2024-12-09 10:30:42 +01:00
Oluwaseun Olorunsola
5743ccbc5f Separate SelectTemplateModal into smaller components
MAILPOET-6331
2024-12-09 10:30:42 +01:00
Rostislav Wolny
411943f39b Add a workaround for replacing core notice Site updated
I considered doing this using a filter 'i18n.gettext', but
with this approach, we would just replace the text. The notice also
contained an action with a link to the site's homepage, so I chose this mechanism instead.
Let's see if there will be more use-cases. We can eventually move it somewhere into the store
and proxy all messages via our store.
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
2334805b95 Use more informative text in the reset template dialog
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
1ce1ddc952 Add the cancel button to modal when switching to template mode
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
8b3f7a489f Add missing translation function to template info panel
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
45e0e56389 Hide command palette shortcut
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
d682b82bc5 Update variant of the dropdown button to match the native editor
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
4b29658adc Remove experimental templates panel
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
10b2c2b648 Use current email content when previewing templates when swapping
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
1fdda485d3 Add basic swap template functionality
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
9f273a3ff2 Add edit template modal
[MAILPOET-6336
2024-12-06 12:21:19 +01:00
Rostislav Wolny
7811535e72 Add dropdown with edit and swap template buttons
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00