Commit 09bef3f999 for woocommerce
commit 09bef3f9994040b548babf22b806d0c68b9e0c30
Author: Yuliyan Slavchev <yuliyan.slavchev@gmail.com>
Date: Tue Feb 17 12:07:27 2026 +0200
Email Editor: Add customSavePanel prop (#63323)
* Email Editor: Add customSavePanel prop
* Add changelog
diff --git a/packages/js/email-editor/changelog/stomail-7603-implement-review-email-campaign-sidebar-panels b/packages/js/email-editor/changelog/stomail-7603-implement-review-email-campaign-sidebar-panels
new file mode 100644
index 0000000000..0ab162a669
--- /dev/null
+++ b/packages/js/email-editor/changelog/stomail-7603-implement-review-email-campaign-sidebar-panels
@@ -0,0 +1,4 @@
+Significance: patch
+Type: add
+
+Add `customSavePanel` prop to the Email Editor component and pass it down to the Gutenberg Editor component
diff --git a/packages/js/email-editor/src/components/block-editor/editor.tsx b/packages/js/email-editor/src/components/block-editor/editor.tsx
index f84bef8655..434b362a02 100644
--- a/packages/js/email-editor/src/components/block-editor/editor.tsx
+++ b/packages/js/email-editor/src/components/block-editor/editor.tsx
@@ -45,6 +45,13 @@ export function InnerEditor( {
postType: initialPostType,
settings,
contentRef,
+ customSavePanel,
+}: {
+ postId: number | string;
+ postType: string;
+ settings: Record< string, unknown >;
+ contentRef?: React.Ref< HTMLDivElement > | null;
+ customSavePanel?: React.ReactElement;
} ) {
const {
currentPost,
@@ -161,6 +168,7 @@ export function InnerEditor( {
templateId={ template && template.id }
contentRef={ contentRef }
styles={ styles } // This is needed for BC for Gutenberg below v22
+ customSavePanel={ customSavePanel }
>
<AutosaveMonitor />
<LocalAutosaveMonitor />
diff --git a/packages/js/email-editor/src/editor.tsx b/packages/js/email-editor/src/editor.tsx
index 3987b70349..04bcd506f3 100644
--- a/packages/js/email-editor/src/editor.tsx
+++ b/packages/js/email-editor/src/editor.tsx
@@ -43,11 +43,13 @@ function Editor( {
postType,
isPreview = false,
contentRef = null,
+ customSavePanel,
}: {
postId: number | string;
postType: string;
isPreview?: boolean;
contentRef?: React.Ref< HTMLDivElement > | null;
+ customSavePanel?: React.ReactElement;
} ) {
const [ isInitialized, setIsInitialized ] = useState( false );
const { settings } = useSelect(
@@ -90,6 +92,7 @@ function Editor( {
postType={ postType }
settings={ editorSettings }
contentRef={ mergedContentRef }
+ customSavePanel={ customSavePanel }
/>
</StrictMode>
);
@@ -149,12 +152,14 @@ export function ExperimentalEmailEditor( {
isPreview = false,
contentRef = null,
config,
+ customSavePanel,
}: {
postId: string;
postType: string;
isPreview?: boolean;
contentRef?: React.Ref< HTMLDivElement > | null;
config?: EmailEditorConfig;
+ customSavePanel?: React.ReactElement;
} ) {
const [ isInitialized, setIsInitialized ] = useState( false );
@@ -193,6 +198,7 @@ export function ExperimentalEmailEditor( {
postType={ postType }
isPreview={ isPreview }
contentRef={ contentRef }
+ customSavePanel={ customSavePanel }
/>
);
}
diff --git a/packages/js/email-editor/src/hooks/use-navigate-to-entity-record.js b/packages/js/email-editor/src/hooks/use-navigate-to-entity-record.js
index bbf07d71c8..ac528f32cd 100644
--- a/packages/js/email-editor/src/hooks/use-navigate-to-entity-record.js
+++ b/packages/js/email-editor/src/hooks/use-navigate-to-entity-record.js
@@ -13,7 +13,7 @@ import { store as editorStore } from '@wordpress/editor';
*
* Used to control displaying UI elements like the back button.
*
- * @param {number} initialPostId The post id of the post when the editor loaded.
+ * @param {number|string} initialPostId The post id of the post when the editor loaded.
* @param {string} initialPostType The post type of the post when the editor loaded.
* @param {string} defaultRenderingMode The rendering mode to switch to when navigating.
*