@ewizardjs/blocks-renderer
v1.3.0
Published
**Module render wiz blocks**
Downloads
116
Keywords
Readme
Render Blocks module
Module render wiz blocks
For use module
- For create puppeteer class instance
const puppeteer = FacadePuppeteer.create();
- For create page
await puppeteer.createPage(url, requirePuppeteer, { waitUntil: 'networkidle0' });
- For render only different blocks
const blocksByTheme = ['blockTheme1', 'blockTheme3']; // optional argument, to render only blocks for current theme email
await Promise.all([
await puppeteer.renderBlocks(opts, blocksByTheme),
]);
- For render blocks by window.__blocks
await Promise.all([
await puppeteer.createRequestInterceptor(opts, 'settings.json'), // optional class method
await puppeteer.renderBlocks(opts),
]);
- For inject scripts to page
const editorJS = join(presentationPath, 'build', 'dev', 'editor.js');
await puppeteer.addedScriptsToPage([editorJS]); // inject any scripts for puppeter page
- For get data from window puppeteer page
const { __blocks, __blocksList } = await puppeteer.getWindowData(['__blocks', '__blocksList']);
- For close Browser
await puppeteer.closeBrowser()
Install
- npm ci
Develop
- npm run build
- npm run build:watch
Run tests
- npm run test
- npm run test:debug