Commit Graph

130 Commits

Author SHA1 Message Date
Rostislav Wolny
a5db2564c8 Add post_types field to the template REST API response
We want to use post_type for filtering email templates.
There is a PR that adds this property https://github.com/WordPress/wordpress-develop/pull/7530
but it is not merged.
This commit added the property and also future compatibility check
so that we don't attempt to add it after the PR is merged.
[MAILPOET-6356]
2024-12-20 15:14:30 +01:00
Rostislav Wolny
2fc0ad3c9e Switch template registration to use register_block_template
[MAILPOET-6356]
2024-12-20 15:14:30 +01:00
Jan Lysý
62b77b724c Change callback and function names
[MAILPOET-6376]
2024-12-20 10:12:04 +01:00
Jan Lysý
e56fe9a95e Add support for replacing written Personalization Tags with attributes
[MAILPOET-6376]
2024-12-20 10:12:04 +01:00
Jan Lysý
0e13133499 Use valueToInsert in Personalization Tag modal
[MAILPOET-6376]
2024-12-20 10:12:04 +01:00
Jan Lysý
6fbaebcc09 Add replacing Personalization Tags for subject and preheader
[MAILPOET-6376]
2024-12-20 10:12:04 +01:00
Jan Lysý
041d76830b Add filter replacing written Personalization Tags to email editor
[MAILPOET-6376]
2024-12-20 10:12:04 +01:00
Rostislav Wolny
891bc34efa Fix switching to template mode
When we switch to template mode RichTextButton, which is dependent
on mailpoetData fails to render. The panel is hidden but it is hidden
in a subsequent render so we need to add check if mailpoet data are available.
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
635ba35a52 Add small comment and performance improvements
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
0b44ccdb4a Use @ts-expect-error instead of @ts-ignore
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
9edd4a6096 Add link into modal header
I unified the link with the link in details panel.
The target link should be replaced later in a different task.
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
cece3711f8 Use useCallback for insert functions
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
bc1581b174 Change rich-text-utils filename extension
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
2aae43b91e Create new richText component with button
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
b264c74ce9 Refactor modal to pass insert callback and isOpened value
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
64264460e8 Refactor initial fetch tags into resolver
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
cc38100109 Move common functions into utils file
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
0173ddd38e Add inserting personalization tags to text blocks
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
29c1f7462a Add inserting personalization tags to subject and preheader
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
bbe2f988e0 Add onInsert callback into PersonalizationTags from store
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
74c2a99e80 Refactor category modal into smaller components
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
74e4b333ac Add search for filtering Personalization Tags by query
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
9282cf91c6 Add filtering personalization tags by category
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
d17faaa13a Add rendering Personalization tags to modal
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
2c031b01fc Add loading personalization to store
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
3a3b53545f Add personalization tags modal component
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
1d11502e93 Add personalizationTags state to custom editor
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
Jan Lysý
7f2f9ff7ca Add button with shortcode icon for subject and preheader
[MAILPOET-6354]
2024-12-18 14:15:05 +01:00
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