From 3a88989a8430e36b91d9e3ce23bec1bbbf5ea9a8 Mon Sep 17 00:00:00 2001 From: Rostislav Wolny Date: Thu, 12 Oct 2023 20:01:48 +0200 Subject: [PATCH] Rename custom email editor to email editor [MAILPOET-5637] --- .../engine/components/block-editor/block-editor.tsx | 4 ++-- .../engine/components/block-editor/index.scss | 0 .../engine/components/block-editor/index.ts | 0 .../engine/components/header/header.tsx | 0 .../engine/components/header/index.ts | 0 .../engine/components/header/more-menu.tsx | 0 .../engine/components/header/save-button.tsx | 0 .../components/inserter-sidebar/inserter-sidebar.tsx | 0 .../components/listview-sidebar/listview-sidebar.tsx | 0 .../engine/components/preview/index.scss | 0 .../engine/components/preview/index.ts | 0 .../engine/components/preview/preview-dropdown.tsx | 0 .../engine/components/preview/send-preview-email.tsx | 0 .../engine/components/sidebar/details-panel.tsx | 0 .../engine/components/sidebar/email-settings.tsx | 0 .../engine/components/sidebar/email-type-info.tsx | 0 .../engine/components/sidebar/header.tsx | 0 .../engine/components/sidebar/sidebar.tsx | 0 .../engine/editor.tsx | 0 .../engine/store/actions.ts | 0 .../engine/store/constants.ts | 0 .../engine/store/index.ts | 0 .../engine/store/initial-state.ts | 0 .../engine/store/reducer.ts | 0 .../engine/store/selectors.ts | 0 .../engine/store/store.ts | 0 .../engine/store/types.ts | 0 .../src/{email-editor-custom => email-editor}/global.d.ts | 0 .../js/src/{email-editor-custom => email-editor}/index.ts | 2 +- mailpoet/lib/AdminPages/Pages/EmailEditor.php | 6 +++--- mailpoet/webpack.config.js | 8 ++++---- 31 files changed, 10 insertions(+), 10 deletions(-) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/block-editor/block-editor.tsx (98%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/block-editor/index.scss (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/block-editor/index.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/header/header.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/header/index.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/header/more-menu.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/header/save-button.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/inserter-sidebar/inserter-sidebar.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/listview-sidebar/listview-sidebar.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/preview/index.scss (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/preview/index.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/preview/preview-dropdown.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/preview/send-preview-email.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/sidebar/details-panel.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/sidebar/email-settings.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/sidebar/email-type-info.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/sidebar/header.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/components/sidebar/sidebar.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/editor.tsx (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/store/actions.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/store/constants.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/store/index.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/store/initial-state.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/store/reducer.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/store/selectors.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/store/store.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/engine/store/types.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/global.d.ts (100%) rename mailpoet/assets/js/src/{email-editor-custom => email-editor}/index.ts (60%) diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/block-editor/block-editor.tsx b/mailpoet/assets/js/src/email-editor/engine/components/block-editor/block-editor.tsx similarity index 98% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/block-editor/block-editor.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/block-editor/block-editor.tsx index e8fe58e88d..a7ea825741 100644 --- a/mailpoet/assets/js/src/email-editor-custom/engine/components/block-editor/block-editor.tsx +++ b/mailpoet/assets/js/src/email-editor/engine/components/block-editor/block-editor.tsx @@ -16,9 +16,9 @@ import { } from '@wordpress/block-editor'; import classnames from 'classnames'; import { useSelect } from '@wordpress/data'; -import { storeName } from 'email-editor-custom/engine/store'; - import { useEntityBlockEditor } from '@wordpress/core-data'; + +import { storeName } from '../../store'; import { Sidebar } from '../sidebar/sidebar'; import { ListviewSidebar } from '../listview-sidebar/listview-sidebar'; diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/block-editor/index.scss b/mailpoet/assets/js/src/email-editor/engine/components/block-editor/index.scss similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/block-editor/index.scss rename to mailpoet/assets/js/src/email-editor/engine/components/block-editor/index.scss diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/block-editor/index.ts b/mailpoet/assets/js/src/email-editor/engine/components/block-editor/index.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/block-editor/index.ts rename to mailpoet/assets/js/src/email-editor/engine/components/block-editor/index.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/header/header.tsx b/mailpoet/assets/js/src/email-editor/engine/components/header/header.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/header/header.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/header/header.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/header/index.ts b/mailpoet/assets/js/src/email-editor/engine/components/header/index.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/header/index.ts rename to mailpoet/assets/js/src/email-editor/engine/components/header/index.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/header/more-menu.tsx b/mailpoet/assets/js/src/email-editor/engine/components/header/more-menu.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/header/more-menu.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/header/more-menu.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/header/save-button.tsx b/mailpoet/assets/js/src/email-editor/engine/components/header/save-button.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/header/save-button.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/header/save-button.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/inserter-sidebar/inserter-sidebar.tsx b/mailpoet/assets/js/src/email-editor/engine/components/inserter-sidebar/inserter-sidebar.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/inserter-sidebar/inserter-sidebar.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/inserter-sidebar/inserter-sidebar.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/listview-sidebar/listview-sidebar.tsx b/mailpoet/assets/js/src/email-editor/engine/components/listview-sidebar/listview-sidebar.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/listview-sidebar/listview-sidebar.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/listview-sidebar/listview-sidebar.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/preview/index.scss b/mailpoet/assets/js/src/email-editor/engine/components/preview/index.scss similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/preview/index.scss rename to mailpoet/assets/js/src/email-editor/engine/components/preview/index.scss diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/preview/index.ts b/mailpoet/assets/js/src/email-editor/engine/components/preview/index.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/preview/index.ts rename to mailpoet/assets/js/src/email-editor/engine/components/preview/index.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/preview/preview-dropdown.tsx b/mailpoet/assets/js/src/email-editor/engine/components/preview/preview-dropdown.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/preview/preview-dropdown.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/preview/preview-dropdown.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/preview/send-preview-email.tsx b/mailpoet/assets/js/src/email-editor/engine/components/preview/send-preview-email.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/preview/send-preview-email.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/preview/send-preview-email.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/sidebar/details-panel.tsx b/mailpoet/assets/js/src/email-editor/engine/components/sidebar/details-panel.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/sidebar/details-panel.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/sidebar/details-panel.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/sidebar/email-settings.tsx b/mailpoet/assets/js/src/email-editor/engine/components/sidebar/email-settings.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/sidebar/email-settings.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/sidebar/email-settings.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/sidebar/email-type-info.tsx b/mailpoet/assets/js/src/email-editor/engine/components/sidebar/email-type-info.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/sidebar/email-type-info.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/sidebar/email-type-info.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/sidebar/header.tsx b/mailpoet/assets/js/src/email-editor/engine/components/sidebar/header.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/sidebar/header.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/sidebar/header.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/components/sidebar/sidebar.tsx b/mailpoet/assets/js/src/email-editor/engine/components/sidebar/sidebar.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/components/sidebar/sidebar.tsx rename to mailpoet/assets/js/src/email-editor/engine/components/sidebar/sidebar.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/editor.tsx b/mailpoet/assets/js/src/email-editor/engine/editor.tsx similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/editor.tsx rename to mailpoet/assets/js/src/email-editor/engine/editor.tsx diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/store/actions.ts b/mailpoet/assets/js/src/email-editor/engine/store/actions.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/store/actions.ts rename to mailpoet/assets/js/src/email-editor/engine/store/actions.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/store/constants.ts b/mailpoet/assets/js/src/email-editor/engine/store/constants.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/store/constants.ts rename to mailpoet/assets/js/src/email-editor/engine/store/constants.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/store/index.ts b/mailpoet/assets/js/src/email-editor/engine/store/index.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/store/index.ts rename to mailpoet/assets/js/src/email-editor/engine/store/index.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/store/initial-state.ts b/mailpoet/assets/js/src/email-editor/engine/store/initial-state.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/store/initial-state.ts rename to mailpoet/assets/js/src/email-editor/engine/store/initial-state.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/store/reducer.ts b/mailpoet/assets/js/src/email-editor/engine/store/reducer.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/store/reducer.ts rename to mailpoet/assets/js/src/email-editor/engine/store/reducer.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/store/selectors.ts b/mailpoet/assets/js/src/email-editor/engine/store/selectors.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/store/selectors.ts rename to mailpoet/assets/js/src/email-editor/engine/store/selectors.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/store/store.ts b/mailpoet/assets/js/src/email-editor/engine/store/store.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/store/store.ts rename to mailpoet/assets/js/src/email-editor/engine/store/store.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/engine/store/types.ts b/mailpoet/assets/js/src/email-editor/engine/store/types.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/engine/store/types.ts rename to mailpoet/assets/js/src/email-editor/engine/store/types.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/global.d.ts b/mailpoet/assets/js/src/email-editor/global.d.ts similarity index 100% rename from mailpoet/assets/js/src/email-editor-custom/global.d.ts rename to mailpoet/assets/js/src/email-editor/global.d.ts diff --git a/mailpoet/assets/js/src/email-editor-custom/index.ts b/mailpoet/assets/js/src/email-editor/index.ts similarity index 60% rename from mailpoet/assets/js/src/email-editor-custom/index.ts rename to mailpoet/assets/js/src/email-editor/index.ts index 0a6bcfc494..164fd26f01 100644 --- a/mailpoet/assets/js/src/email-editor-custom/index.ts +++ b/mailpoet/assets/js/src/email-editor/index.ts @@ -1,4 +1,4 @@ -import { initialize } from 'email-editor-custom/engine/editor'; +import { initialize } from 'email-editor/engine/editor'; window.addEventListener('DOMContentLoaded', () => { initialize('mailpoet-email-editor'); diff --git a/mailpoet/lib/AdminPages/Pages/EmailEditor.php b/mailpoet/lib/AdminPages/Pages/EmailEditor.php index cdee06468f..9ab2f2544f 100644 --- a/mailpoet/lib/AdminPages/Pages/EmailEditor.php +++ b/mailpoet/lib/AdminPages/Pages/EmailEditor.php @@ -24,17 +24,17 @@ class EmailEditor { return; } - $assetsParams = require_once Env::$assetsPath . '/dist/js/email-editor-custom/email_editor.asset.php'; + $assetsParams = require_once Env::$assetsPath . '/dist/js/email-editor/email_editor.asset.php'; $this->wp->wpEnqueueScript( 'mailpoet_email_editor', - Env::$assetsUrl . '/dist/js/email-editor-custom/email_editor.js', + Env::$assetsUrl . '/dist/js/email-editor/email_editor.js', $assetsParams['dependencies'], $assetsParams['version'], true ); $this->wp->wpEnqueueStyle( 'mailpoet_email_editor', - Env::$assetsUrl . '/dist/js/email-editor-custom/email_editor.css', + Env::$assetsUrl . '/dist/js/email-editor/email_editor.css', [], $assetsParams['version'] ); diff --git a/mailpoet/webpack.config.js b/mailpoet/webpack.config.js index b3cc3e77f5..2fa6f311ec 100644 --- a/mailpoet/webpack.config.js +++ b/mailpoet/webpack.config.js @@ -440,13 +440,13 @@ const marketingOptinBlock = Object.assign({}, wpScriptConfig, { }); const emailEditorCustom = Object.assign({}, wpScriptConfig, { - name: 'email_editor_custom', + name: 'email_editor', entry: { - email_editor: 'email-editor-custom/index.ts', + email_editor: 'email-editor/index.ts', }, output: { filename: '[name].js', - path: path.join(__dirname, 'assets/dist/js/email-editor-custom'), + path: path.join(__dirname, 'assets/dist/js/email-editor'), }, resolve: { ...wpScriptConfig.resolve, @@ -469,7 +469,7 @@ module.exports = configs.map((conf) => { const config = Object.assign({}, conf); if ( config.name === 'marketing_optin_block' || - config.name === 'email_editor_custom' + config.name === 'email_editor' ) { return config; }