Commit Graph

57 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Rostislav Wolny
1717a0a235 Extract template reset modal to an extra component
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
c7049468c2 Add revert template confirmation modal
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
fb74526d9d Move revert template function from component file to store action
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
ebefee4de7 Add template actions menu toggle with dummy reset template action
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
9ebcf9b506 Add info text to the template info panel in sidebar.
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
1cff0c5ee1 Update text in template mode warning popup
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
c612eb1c4e Rename document tab in sidebar based on editor mode
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
ed8d64816c Rename mainSidebarEmailTab constant to mainSidebarDocumentTab
The email name was misleading because in the template mode we want to show Template.
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Rostislav Wolny
ab00d505b9 Replace logic for detection of editor mode by the useEditorMode hook
[MAILPOET-6336]
2024-12-06 12:21:19 +01:00
Oluwaseun Olorunsola
98bc96b1b8 Add loading state and remove custom button position.
Based on PR feedback https://github.com/mailpoet/mailpoet/pull/5972#issuecomment-2516596159, The Email editor cannot work without a template. So, we currently don't need to set up workflow to support template not loading

MAILPOET-6331
2024-12-04 13:29:00 +01:00
Oluwaseun Olorunsola
abf03d6cc7 Update "Start from scratch" button styles when no template is registered
MAILPOET-6333
2024-12-04 13:29:00 +01:00
Oluwaseun Olorunsola
46c8ae94bc Add "Start from scratch" to the template selector
MAILPOET-6333
2024-12-04 13:29:00 +01:00
Oluwaseun Olorunsola
3386f9f4f1 Fix eslint warnings: Post not found and useSelect has a missing dependency
MAILPOET-6316
2024-11-27 18:02:35 +01:00
Oluwaseun Olorunsola
f9458c2b7f Fix eslint warnings: block and blockinstance
MAILPOET-6316
2024-11-27 18:02:35 +01:00
Rostislav Wolny
b631e509ef Export StylesColorPanel from private-apis file
[MAILPOET-6319]
2024-11-26 16:44:11 +01:00
Rostislav Wolny
ceecfe69a5 Move unlocking core store and block editor store to private apis
[MAILPOET-6319]
2024-11-26 16:44:11 +01:00