Remove unused email editor core variables.
These variables are used by the core editor. We can remove them. MAILPOET-6430
This commit is contained in:
committed by
Oluwaseun Olorunsola
parent
1cb5eda659
commit
7dfdbef152
8
packages/js/email-editor/src/global.d.ts
vendored
8
packages/js/email-editor/src/global.d.ts
vendored
@@ -1,18 +1,12 @@
|
||||
interface Window {
|
||||
MailPoetEmailEditor: {
|
||||
json_api_root: string;
|
||||
api_token: string;
|
||||
api_version: string;
|
||||
cdn_url: string;
|
||||
is_premium_plugin_active: boolean;
|
||||
current_wp_user_email: string;
|
||||
user_theme_post_id: number;
|
||||
urls: {
|
||||
listings: string;
|
||||
send: string;
|
||||
};
|
||||
editor_settings: unknown; // Can't import type in global.d.ts. Typed in getEditorSettings() in store/settings.ts
|
||||
email_styles: unknown; // Can't import type in global.d.ts. Typed in getEmailStyles() in store/settings.ts
|
||||
editor_layout: unknown; // Can't import type in global.d.ts. Typed in getEmailLayout() in store/settings.ts
|
||||
editor_theme: unknown; // Can't import type in global.d.ts. Typed in getEditorTheme() in store/settings.ts
|
||||
current_post_type: string;
|
||||
current_post_id: string;
|
||||
|
@@ -3,13 +3,7 @@
|
||||
*/
|
||||
import { mainSidebarDocumentTab, editorCurrentPostId } from './constants';
|
||||
import { State } from './types';
|
||||
import {
|
||||
getEditorSettings,
|
||||
getCdnUrl,
|
||||
isPremiumPluginActive,
|
||||
getEditorTheme,
|
||||
getUrls,
|
||||
} from './settings';
|
||||
import { getEditorSettings, getEditorTheme, getUrls } from './settings';
|
||||
|
||||
export function getInitialState(): State {
|
||||
const postId = editorCurrentPostId;
|
||||
@@ -30,8 +24,6 @@ export function getInitialState(): State {
|
||||
globalStylesPostId: window.MailPoetEmailEditor.user_theme_post_id,
|
||||
},
|
||||
autosaveInterval: 60,
|
||||
cdnUrl: getCdnUrl(),
|
||||
isPremiumPluginActive: isPremiumPluginActive(),
|
||||
urls: getUrls(),
|
||||
preview: {
|
||||
deviceType: 'Desktop',
|
||||
|
@@ -353,14 +353,6 @@ export function getAutosaveInterval(
|
||||
return state.autosaveInterval;
|
||||
}
|
||||
|
||||
export function getCdnUrl( state: State ): State[ 'cdnUrl' ] {
|
||||
return state.cdnUrl;
|
||||
}
|
||||
|
||||
export function isPremiumPluginActive( state: State ): boolean {
|
||||
return state.isPremiumPluginActive;
|
||||
}
|
||||
|
||||
export function getTheme( state: State ): State[ 'theme' ] {
|
||||
return state.theme;
|
||||
}
|
||||
|
@@ -7,14 +7,6 @@ export function getEditorSettings(): EmailEditorSettings {
|
||||
return window.MailPoetEmailEditor.editor_settings as EmailEditorSettings;
|
||||
}
|
||||
|
||||
export function getCdnUrl(): string {
|
||||
return window.MailPoetEmailEditor.cdn_url;
|
||||
}
|
||||
|
||||
export function isPremiumPluginActive(): boolean {
|
||||
return window.MailPoetEmailEditor.is_premium_plugin_active;
|
||||
}
|
||||
|
||||
export function getEditorTheme(): EmailTheme {
|
||||
return window.MailPoetEmailEditor.editor_theme as EmailTheme;
|
||||
}
|
||||
|
@@ -195,9 +195,7 @@ export type State = {
|
||||
globalStylesPostId: number | null;
|
||||
};
|
||||
autosaveInterval: number;
|
||||
cdnUrl: string;
|
||||
urls: EmailEditorUrls;
|
||||
isPremiumPluginActive: boolean;
|
||||
preview: {
|
||||
deviceType: string;
|
||||
toEmail: string;
|
||||
|
Reference in New Issue
Block a user