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]
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]
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]
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]
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]
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]
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]
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]