Commit 5400a38a7f for woocommerce
commit 5400a38a7f9316bdfd2b9c0bfcb422e49512586b
Author: Allison Levine <1689238+allilevine@users.noreply.github.com>
Date: Fri Feb 20 09:11:06 2026 -0500
Export EditTemplateModal and SelectTemplateModal from email editor package (#63374)
* Export EditTemplateModal and SelectTemplateModal from email editor package
Enables consumers (like CIAB) to build custom template selection UIs
while reusing the upstream modal components for editing and swapping
email templates.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add changelog entry for template modal exports
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
diff --git a/packages/js/email-editor/changelog/add-export-template-modals b/packages/js/email-editor/changelog/add-export-template-modals
new file mode 100644
index 0000000000..d5b0307d48
--- /dev/null
+++ b/packages/js/email-editor/changelog/add-export-template-modals
@@ -0,0 +1,4 @@
+Significance: patch
+Type: add
+
+Export EditTemplateModal and SelectTemplateModal from the email editor package for extensibility.
diff --git a/packages/js/email-editor/src/index.ts b/packages/js/email-editor/src/index.ts
index ec23c6b72d..b0f6d3a3c7 100644
--- a/packages/js/email-editor/src/index.ts
+++ b/packages/js/email-editor/src/index.ts
@@ -404,3 +404,36 @@ export { EmailActionsFill } from './components/sidebar/settings-panel';
* @since 1.0.0
*/
export { TemplateSelection } from './components/sidebar/template-selection';
+
+/**
+ * A confirmation modal shown before navigating to the template editor.
+ *
+ * Warns the user that editing a template affects all emails using it,
+ * then navigates to the template editor on confirmation. Used internally
+ * by `TemplateSelection` and exported for consumers building custom
+ * template selection UIs.
+ *
+ * @param props - Component properties
+ * @param props.close - Callback to close the modal without navigating
+ *
+ * @since 1.7.0
+ */
+export { EditTemplateModal } from './components/sidebar/edit-template-modal';
+
+/**
+ * A full-screen modal for browsing and selecting email templates.
+ *
+ * Displays available templates in a categorized grid with previews.
+ * Handles template selection by applying the chosen template to the
+ * current post. Used internally by `TemplateSelection` and exported
+ * for consumers building custom template selection UIs.
+ *
+ * @param props - Component properties
+ * @param props.onSelectCallback - Called after a template is selected
+ * @param props.closeCallback - Called when the modal is closed without selection
+ * @param props.previewContent - Custom email content for template previews
+ * @param props.postType - The post type of the current email
+ *
+ * @since 1.7.0
+ */
+export { SelectTemplateModal } from './components/template-select';