Skip to content

Commit

Permalink
Using @usewaypoint/email-builder base exports
Browse files Browse the repository at this point in the history
  • Loading branch information
cohitre committed Mar 4, 2024
1 parent 2944bb2 commit 0fdff4b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
8 changes: 4 additions & 4 deletions packages/editor-sample/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/editor-sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@usewaypoint/block-spacer": "^0.0.2",
"@usewaypoint/block-text": "^0.0.2",
"@usewaypoint/document-core": "^0.0.4",
"@usewaypoint/email-builder": "^0.0.2",
"@usewaypoint/email-builder": "^0.0.3",
"highlight.js": "^11.9.0",
"prettier": "^3.2.5",
"react": "^18.2.0",
Expand Down
17 changes: 2 additions & 15 deletions packages/editor-sample/src/App/TemplatePanel/HtmlPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
import React, { useMemo } from 'react';
import { renderToStaticMarkup } from 'react-dom/server';

import Reader from '@usewaypoint/email-builder/dist/Reader/core';
import { renderToStaticMarkup } from '@usewaypoint/email-builder';

import { useDocument } from '../../documents/editor/EditorContext';

import HighlightedCodePanel from './helper/HighlightedCodePanel';

export default function HtmlPanel() {
const document = useDocument();
const code = useMemo(() => {
return (
'<!DOCTYPE html>' +
renderToStaticMarkup(
<html>
<body>
<Reader document={document} rootBlockId="root" />
</body>
</html>
)
);
}, [document]);

const code = useMemo(() => renderToStaticMarkup(document, { rootBlockId: 'root' }), [document]);
return <HighlightedCodePanel type="html" value={code} />;
}
2 changes: 1 addition & 1 deletion packages/editor-sample/src/App/TemplatePanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import { MonitorOutlined, PhoneIphoneOutlined } from '@mui/icons-material';
import { Box, Stack, SxProps, ToggleButton, ToggleButtonGroup, Tooltip } from '@mui/material';
import Reader from '@usewaypoint/email-builder/dist/Reader/core';
import { Reader } from '@usewaypoint/email-builder';

import EditorBlock from '../../documents/editor/EditorBlock';
import {
Expand Down

0 comments on commit 0fdff4b

Please sign in to comment.