Skip to content

Commit 906a52b

Browse files
authored
Merge branch 'trunk' into add/fulfillments-documentation
2 parents b6a152f + ae189f7 commit 906a52b

File tree

45 files changed

+1712
-286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1712
-286
lines changed

packages/js/email-editor/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## [1.0.2](https://www.npmjs.com/package/@woocommerce/email-editor/v/1.0.2) - 2025-08-01
6+
7+
- Patch - Fix backward compatibility when personalization tag post types are not set. [#60134]
8+
59
## [1.0.1](https://www.npmjs.com/package/@woocommerce/email-editor/v/1.0.1) - 2025-07-31
610

711
- Patch - Email Editor: show “Send” button when editing a new (unsaved) email draft. [#59931]

packages/js/email-editor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@woocommerce/email-editor",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Gutenberg based email editor that is used in WooCommerce emails.",
55
"author": "Automattic",
66
"license": "GPL-2.0-or-later",

packages/js/email-editor/src/hooks/use-is-email-editor.ts

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,43 @@ export function useIsEmailEditor(): boolean {
3636
const currentPostId = select( editorStore ).getCurrentPostId();
3737
const currentPostType = select( editorStore ).getCurrentPostType();
3838

39-
// For non-template posts, check if the current post matches the email editor post
40-
if ( currentPostType !== 'wp_template' ) {
41-
return (
42-
String( currentPostId ) === String( emailPostId ) &&
43-
String( currentPostType ) === String( emailPostType )
44-
);
39+
// Check if the current post matches the email editor post
40+
const currentPostMatch =
41+
String( currentPostId ) === String( emailPostId ) &&
42+
String( currentPostType ) === String( emailPostType );
43+
44+
// If the current post matches the email editor post, we are in the email editor context
45+
if ( currentPostMatch ) {
46+
return true;
4547
}
4648

4749
// If we're editing a template, check if it's associated with the email editor post
48-
// Get the current template being edited
49-
const currentTemplate = emailEditorStore.getCurrentTemplate();
50-
if ( ! currentTemplate ) {
51-
return false;
52-
}
50+
if ( currentPostType === 'wp_template' ) {
51+
// If we're editing a template, check if it's associated with the email editor post
52+
// Get the current template being edited
53+
const currentTemplate = emailEditorStore.getCurrentTemplate();
54+
if ( ! currentTemplate ) {
55+
return false;
56+
}
5357

54-
// Check if this template is associated with the email editor post
55-
// We need to check if the template is used by the email post type
56-
const emailTemplates =
57-
emailEditorStore.getEmailTemplates() as EmailTemplate[];
58-
if ( ! emailTemplates ) {
59-
return false;
60-
}
58+
// Check if this template is associated with the email editor post
59+
// We need to check if the template is used by the email post type
60+
const emailTemplates =
61+
emailEditorStore.getEmailTemplates() as EmailTemplate[];
62+
if ( ! emailTemplates ) {
63+
return false;
64+
}
6165

62-
// Check if the current template is in the list of email templates
63-
// and if it's associated with the email post type
64-
const isEmailTemplate = emailTemplates.some( ( template ) => {
65-
return (
66-
template.id === currentTemplate.id &&
67-
template.post_types?.includes( emailPostType )
68-
);
69-
} );
70-
return isEmailTemplate;
66+
// Check if the current template is in the list of email templates
67+
// and if it's associated with the email post type
68+
const isEmailTemplate = emailTemplates.some( ( template ) => {
69+
return (
70+
template.id === currentTemplate.id &&
71+
template.post_types?.includes( emailPostType )
72+
);
73+
} );
74+
return isEmailTemplate;
75+
}
76+
return false;
7177
}, [] );
7278
}

packages/js/email-editor/src/store/selectors.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ export const getPersonalizationTagsList = createRegistrySelector(
376376
const postTemplate = select( storeName ).getCurrentTemplate();
377377
return tags.filter( ( tag ) => {
378378
return (
379+
tag.postTypes === undefined ||
379380
tag.postTypes.length === 0 ||
380381
( Array.isArray( postTemplate.post_types ) &&
381382
postTemplate.post_types.some( ( pt ) =>
@@ -387,7 +388,9 @@ export const getPersonalizationTagsList = createRegistrySelector(
387388

388389
return tags.filter( ( tag ) => {
389390
return (
390-
tag.postTypes.length === 0 || tag.postTypes.includes( postType )
391+
tag.postTypes === undefined ||
392+
tag.postTypes.length === 0 ||
393+
tag.postTypes.includes( postType )
391394
);
392395
} );
393396
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
Comment: Fixes a bug where listing Woo orders on the REST API will crash if the order has a coupon with a malformed date.
4+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
4+
Fix returning customer detection for guest orders with existing email addresses
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
Comment: Product Button: Using `wp_interactivity_get_context` insdie state callback to ensure the serverside directive processing work as expected.
4+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
4+
Add id and aria-label attributes to Photoswipe dialog
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
4+
Fix Payments Settings WooPayments test-to-live flow when site is installed in a subdirectory.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
4+
Reset quantities when adding to cart a grouped product fails with the Add to Cart + Options block

0 commit comments

Comments
 (0)