Add basic email editor build config
MAILPOET-6215
This commit is contained in:
committed by
Oluwaseun Olorunsola
parent
f787e6d98c
commit
632c381b73
1
packages/js/email-editor/.babelrc.js
Normal file
1
packages/js/email-editor/.babelrc.js
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from '../../../babel.config.js';
|
4
packages/js/email-editor/.gitignore
vendored
Normal file
4
packages/js/email-editor/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/build
|
||||
/build-module
|
||||
/build-style
|
||||
/build-types
|
50
packages/js/email-editor/package.json
Normal file
50
packages/js/email-editor/package.json
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "@mailpoet/email-editor",
|
||||
"private": true,
|
||||
"sideEffects": [
|
||||
"build-style/**",
|
||||
"src/**/*.scss"
|
||||
],
|
||||
"version": "0.1.0",
|
||||
"scripts": {
|
||||
"build": "wp-scripts build",
|
||||
"start": "wp-scripts start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wordpress/api-fetch": "^7.0.0",
|
||||
"@wordpress/block-editor": "^13.0.0",
|
||||
"@wordpress/block-library": "^9.0.0",
|
||||
"@wordpress/blocks": "^13.0.0",
|
||||
"@wordpress/components": "^28.0.0",
|
||||
"@wordpress/compose": "^7.0.0",
|
||||
"@wordpress/core-data": "^7.0.0",
|
||||
"@wordpress/data": "^10.0.0",
|
||||
"@wordpress/data-controls": "^4.0.0",
|
||||
"@wordpress/edit-post": "^8.0.0",
|
||||
"@wordpress/editor": "^14.0.0",
|
||||
"@wordpress/element": "^6.0.0",
|
||||
"@wordpress/format-library": "^5.0.0",
|
||||
"@wordpress/hooks": "^4.0.0",
|
||||
"@wordpress/html-entities": "^4.0.0",
|
||||
"@wordpress/i18n": "^5.0.0",
|
||||
"@wordpress/icons": "^10.0.0",
|
||||
"@wordpress/interface": "^6.0.0",
|
||||
"@wordpress/keyboard-shortcuts": "^5.0.0",
|
||||
"@wordpress/keycodes": "^4.0.0",
|
||||
"@wordpress/media-utils": "^5.0.0",
|
||||
"@wordpress/notices": "^5.0.0",
|
||||
"@wordpress/preferences": "^4.0.0",
|
||||
"@wordpress/private-apis": "^1.0.0",
|
||||
"@wordpress/rich-text": "^7.0.0",
|
||||
"@wordpress/url": "^4.0.0",
|
||||
"@wordpress/is-shallow-equal": "^5.0.0",
|
||||
"@wordpress/base-styles": "^5.0.0",
|
||||
"classnames": "^2.5.1",
|
||||
"deepmerge": "^4.3.1",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1"
|
||||
},
|
||||
"volta": {
|
||||
"extends": "../../../package.json"
|
||||
}
|
||||
}
|
@@ -4,7 +4,7 @@ import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
|
||||
import { PanelBody, RadioControl, Icon } from '@wordpress/components';
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import metadata from './block.json';
|
||||
import { storeName } from '../../../engine/store/constants';
|
||||
import { storeName } from '../../engine/store';
|
||||
import MailPoetIcon from './mailpoet-icon';
|
||||
|
||||
function LogoImage({
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import '@wordpress/format-library'; // Enables text formatting capabilities
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import { StrictMode, createRoot } from '@wordpress/element';
|
||||
import { withNpsPoll } from '../../nps-poll';
|
||||
// import { withNpsPoll } from '../../nps-poll'; // TODO: need to fix this import. custom component from core MP plugin
|
||||
import { initBlocks } from './blocks';
|
||||
import { initializeLayout } from './layouts/flex-email';
|
||||
import { InnerEditor } from './components/block-editor/editor';
|
||||
@@ -32,8 +32,6 @@ function Editor() {
|
||||
);
|
||||
}
|
||||
|
||||
const EditorWithPool = withNpsPoll(Editor);
|
||||
|
||||
export function initialize(elementId: string) {
|
||||
const container = document.getElementById(elementId);
|
||||
if (!container) {
|
||||
@@ -44,5 +42,5 @@ export function initialize(elementId: string) {
|
||||
initBlocks();
|
||||
initHooks();
|
||||
const root = createRoot(container);
|
||||
root.render(<EditorWithPool />);
|
||||
root.render(<Editor />);
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { initialize } from 'email-editor/engine/editor';
|
||||
import { initialize } from './engine/editor';
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
initialize('mailpoet-email-editor');
|
||||
|
11
packages/js/email-editor/tsconfig.json
Normal file
11
packages/js/email-editor/tsconfig.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"include": ["src/**/*", "src/**/*.json"],
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "build-types",
|
||||
"paths": {
|
||||
"email-editor/*": ["./src/*"]
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user