Skip to content

A free and open-source block-based email template builder.

More sample template and styles cleanup (#36)

Jordan Isip51ccf25b3918
diff --git a/packages/editor-sample/index.html b/packages/editor-sample/index.html
index 6e4825e..d8c1abf 100644
--- a/packages/editor-sample/index.html
+++ b/packages/editor-sample/index.html
@@ -5,7 +5,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="/src/favicon/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/src/favicon/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/src/favicon/favicon-16x16.png" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="viewport" content="width=900, initial-scale=1.0" />
<meta name="description" content="EmailBuilder.js interactive playground. Brought to you by Waypoint." />
<title>EmailBuilder.js &mdash; Free and Open Source Template Builder</title>
<style>
diff --git a/packages/editor-sample/src/App/InspectorDrawer/index.tsx b/packages/editor-sample/src/App/InspectorDrawer/index.tsx
index 3ec6014..38e17e1 100644
--- a/packages/editor-sample/src/App/InspectorDrawer/index.tsx
+++ b/packages/editor-sample/src/App/InspectorDrawer/index.tsx
@@ -7,7 +7,7 @@ import { useEditorState } from '../../documents/editor/EditorContext';
import ConfigurationPanel from './ConfigurationPanel';
import StylesPanel from './StylesPanel';
-export const INSPECTOR_DRAWER_WIDTH = 240;
+export const INSPECTOR_DRAWER_WIDTH = 320;
export default function InspectorDrawer() {
const [{ selectedSidebarTab, inspectorDrawerOpen }, setEditorState] = useEditorState();
diff --git a/packages/editor-sample/src/App/TemplatePanel/ShareButton.tsx b/packages/editor-sample/src/App/TemplatePanel/ShareButton.tsx
index 0b67e99..5e0f71c 100644
--- a/packages/editor-sample/src/App/TemplatePanel/ShareButton.tsx
+++ b/packages/editor-sample/src/App/TemplatePanel/ShareButton.tsx
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
-import { Button, Snackbar } from '@mui/material';
+import { IosShareOutlined } from '@mui/icons-material';
+import { IconButton, Snackbar, Tooltip } from '@mui/material';
import { useEditorState } from '../../documents/editor/EditorContext';
@@ -26,7 +27,11 @@ export default function ShareButton() {
return (
<>
- <Button onClick={onClick}>Share</Button>
+ <IconButton onClick={onClick}>
+ <Tooltip title="Share current template">
+ <IosShareOutlined fontSize="small" />
+ </Tooltip>
+ </IconButton>
<Snackbar
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
open={message !== null}
diff --git a/packages/editor-sample/src/App/TemplatePanel/index.tsx b/packages/editor-sample/src/App/TemplatePanel/index.tsx
index 75ee89b..8d8d7ee 100644
--- a/packages/editor-sample/src/App/TemplatePanel/index.tsx
+++ b/packages/editor-sample/src/App/TemplatePanel/index.tsx
@@ -1,6 +1,7 @@
import React from 'react';
-import { Box, Stack, Tab, Tabs } from '@mui/material';
+import { CodeOutlined, DataObjectOutlined, EditOutlined, PreviewOutlined } from '@mui/icons-material';
+import { Box, Stack, Tab, Tabs, Tooltip } from '@mui/material';
import EditorBlock from '../../documents/editor/EditorBlock';
import { useEditorState } from '../../documents/editor/EditorContext';
@@ -56,10 +57,38 @@ export default function TemplatePanel() {
<ToggleSamplesPanelButton />
<Stack px={2} direction="row" gap={2} width="100%" justifyContent="space-between" alignItems="center">
<Tabs value={selectedMainTab} onChange={(_, v) => setEditorState({ selectedMainTab: v })}>
- <Tab value="editor" label="Edit" />
- <Tab value="preview" label="Preview" />
- <Tab value="html" label="HTML" />
- <Tab value="data" label="JSON" />
+ <Tab
+ value="editor"
+ label={
+ <Tooltip title="Edit">
+ <EditOutlined fontSize="small" />
+ </Tooltip>
+ }
+ />
+ <Tab
+ value="preview"
+ label={
+ <Tooltip title="Preview">
+ <PreviewOutlined fontSize="small" />
+ </Tooltip>
+ }
+ />
+ <Tab
+ value="html"
+ label={
+ <Tooltip title="HTML output">
+ <CodeOutlined fontSize="small" />
+ </Tooltip>
+ }
+ />
+ <Tab
+ value="data"
+ label={
+ <Tooltip title="JSON output">
+ <DataObjectOutlined fontSize="small" />
+ </Tooltip>
+ }
+ />
</Tabs>
<ShareButton />
@@ -67,7 +96,7 @@ export default function TemplatePanel() {
<ToggleInspectorPanelButton />
</Stack>
- <Box sx={{ height: 'calc(100% - 49px)', overflow: 'auto' }}>{renderMainPanel()}</Box>
+ <Box sx={{ height: 'calc(100% - 49px)', overflow: 'auto', minWidth: 370 }}>{renderMainPanel()}</Box>
</>
);
}
diff --git a/packages/editor-sample/src/App/index.tsx b/packages/editor-sample/src/App/index.tsx
index 16d80f7..626cfaf 100644
--- a/packages/editor-sample/src/App/index.tsx
+++ b/packages/editor-sample/src/App/index.tsx
@@ -21,7 +21,6 @@ export default function App() {
sx={{
marginRight: inspectorDrawerOpen ? `${INSPECTOR_DRAWER_WIDTH}px` : 0,
marginLeft: samplesDrawerOpen ? `${SAMPLES_DRAWER_WIDTH}px` : 0,
-
transition: [
theme.transitions.create('margin-left', {
easing: !samplesDrawerOpen ? theme.transitions.easing.sharp : theme.transitions.easing.easeOut,
diff --git a/packages/editor-sample/src/getConfiguration/sample/order-ecommerce.ts b/packages/editor-sample/src/getConfiguration/sample/order-ecommerce.ts
index 1ce06a0..3de91e0 100644
--- a/packages/editor-sample/src/getConfiguration/sample/order-ecommerce.ts
+++ b/packages/editor-sample/src/getConfiguration/sample/order-ecommerce.ts
@@ -621,7 +621,7 @@ const ORDER_ECOMMERCE: TEditorConfiguration = {
},
props: {
lineHeight: 1,
- lineColor: '#5696e5',
+ lineColor: '#EEEEEE',
},
},
},
@@ -1193,7 +1193,7 @@ const ORDER_ECOMMERCE: TEditorConfiguration = {
},
props: {
lineHeight: 1,
- lineColor: '#5696e5',
+ lineColor: '#EEEEEE',
},
},
},
@@ -1652,7 +1652,7 @@ const ORDER_ECOMMERCE: TEditorConfiguration = {
},
props: {
lineHeight: 1,
- lineColor: '#5696e5',
+ lineColor: '#EEEEEE',
},
},
},
diff --git a/packages/editor-sample/src/getConfiguration/sample/post-metrics-report.ts b/packages/editor-sample/src/getConfiguration/sample/post-metrics-report.ts
index 1821467..8417782 100644
--- a/packages/editor-sample/src/getConfiguration/sample/post-metrics-report.ts
+++ b/packages/editor-sample/src/getConfiguration/sample/post-metrics-report.ts
@@ -364,7 +364,7 @@ const POST_METRICS_REPORT: TEditorConfiguration = {
},
props: {
lineHeight: 1,
- lineColor: '#24AF7F',
+ lineColor: '#EEEEEE',
},
},
},
diff --git a/packages/editor-sample/src/getConfiguration/sample/reset-password.ts b/packages/editor-sample/src/getConfiguration/sample/reset-password.ts
index 136fedc..36bbfbb 100644
--- a/packages/editor-sample/src/getConfiguration/sample/reset-password.ts
+++ b/packages/editor-sample/src/getConfiguration/sample/reset-password.ts
@@ -124,7 +124,7 @@ const RESET_PASSWORD: TEditorConfiguration = {
},
props: {
lineHeight: 1,
- lineColor: '#2458AF',
+ lineColor: '#EEEEEE',
},
},
},
diff --git a/packages/editor-sample/src/getConfiguration/sample/respond-to-message.ts b/packages/editor-sample/src/getConfiguration/sample/respond-to-message.ts
index 96087f0..7d4ca33 100644
--- a/packages/editor-sample/src/getConfiguration/sample/respond-to-message.ts
+++ b/packages/editor-sample/src/getConfiguration/sample/respond-to-message.ts
@@ -57,7 +57,7 @@ const RESPOND_TO_MESSAGE: TEditorConfiguration = {
},
props: {
level: 'h2',
- text: 'Respond to Anna&apos;s Inquiry',
+ text: `Respond to Anna's Inquiry`,
},
},
},