Render Blocks module
Module render wiz blocks
For use module
- For create puppeteer class instance
const puppeteer = FacadePuppeteer.create();
await puppeteer.createPage(url, requirePuppeteer, { waitUntil: 'networkidle0' });
- For render only different blocks
const blocksByTheme = ['blockTheme1', 'blockTheme3'];
await Promise.all([
await puppeteer.renderBlocks(opts, blocksByTheme),
]);
- For render blocks by window.__blocks
await Promise.all([
await puppeteer.createRequestInterceptor(opts, 'settings.json'),
await puppeteer.renderBlocks(opts),
]);
- For inject scripts to page
const editorJS = join(presentationPath, 'build', 'dev', 'editor.js');
await puppeteer.addedScriptsToPage([editorJS]);
- For get data from window puppeteer page
const { __blocks, __blocksList } = await puppeteer.getWindowData(['__blocks', '__blocksList']);
await puppeteer.closeBrowser()
Install
Develop
- npm run build
- npm run build:watch
Run tests
- npm run test
- npm run test:debug