useblocks 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +195 -0
- package/android-chrome-192x192.png +0 -0
- package/android-chrome-512x512.png +0 -0
- package/apple-touch-icon-b.png +0 -0
- package/apple-touch-icon.png +0 -0
- package/asset-manifest.json +207 -0
- package/css.worker.js +2 -0
- package/css.worker.js.LICENSE.txt +6 -0
- package/editor.worker.js +1 -0
- package/emailmaker.d.ts +571 -0
- package/favicon-16x16.png +0 -0
- package/favicon-32x32.png +0 -0
- package/favicon-b.ico +0 -0
- package/favicon.ico +0 -0
- package/html.worker.js +2 -0
- package/html.worker.js.LICENSE.txt +14 -0
- package/icon-192.png +0 -0
- package/icon-512.png +0 -0
- package/icon.svg +2 -0
- package/iframe/css/line-awesome/line-awesome.min.css +2 -0
- package/iframe/css/line-awesome/line-awesome.min.css.js +0 -0
- package/iframe/css/sandbox-dark.css +301 -0
- package/iframe/css/sandbox-dark.css.js +0 -0
- package/iframe/css/sandbox-darktheme.css +234 -0
- package/iframe/css/sandbox-darktheme.css.js +0 -0
- package/iframe/css/sandbox-light.css +197 -0
- package/iframe/css/sandbox-light.css.js +0 -0
- package/iframe/css/sandbox.css +1553 -0
- package/iframe/css/sandbox.css.js +0 -0
- package/iframe/css/sandbox.locale.en_en.css +16 -0
- package/iframe/css/sandbox.locale.en_en.css.js +0 -0
- package/iframe/css/sandbox.locale.ru_ru.css +16 -0
- package/iframe/css/sandbox.locale.ru_ru.css.js +0 -0
- package/iframe/fonts/line-awesome/la-solid-900.ttf +0 -0
- package/iframe/fonts/line-awesome/la-solid-900.woff +0 -0
- package/iframe/fonts/line-awesome/la-solid-900.woff2 +0 -0
- package/iframe/iframe-eblock.05e1526f20b9547b019f.html +18 -0
- package/iframe/iframe.05e1526f20b9547b019f.html +20 -0
- package/iframe/iframe.html +33 -0
- package/iframe/img/drag-insert.svg +5 -0
- package/iframe/img/icon-code.svg +10 -0
- package/iframe/img/icon-img.svg +10 -0
- package/iframe/img/left-arrow.svg +3 -0
- package/iframe/img/loader-1-dark.gif +0 -0
- package/iframe/img/loader-1-light.gif +0 -0
- package/iframe/js/cssbeautify.js +1 -0
- package/iframe/js/csso.min.js +1 -0
- package/iframe/js/emmet-monaco.min.js +2 -0
- package/iframe/js/emmet-monaco.min.js.LICENSE.txt +14 -0
- package/iframe/js/iframeResizer.contentWindow.min.js +2 -0
- package/iframe/js/iframeResizer.contentWindow.min.js.LICENSE.txt +7 -0
- package/iframe/js/sandbox.locale.en_us.js +1 -0
- package/iframe/js/sandbox.locale.ru_ru.js +1 -0
- package/iframe/js/typograf/typograf.all.min.js +2 -0
- package/iframe/js/typograf/typograf.all.min.js.LICENSE.txt +1 -0
- package/iframe/sandbox-eblock.js +1 -0
- package/iframe/sandbox-eblock.js.LICENSE.txt +10 -0
- package/iframe/sandbox.js +1 -0
- package/iframe/sandbox.js.LICENSE.txt +8 -0
- package/images/video-playButtons/youtube_red.png +0 -0
- package/json.worker.js +2 -0
- package/json.worker.js.LICENSE.txt +6 -0
- package/manifest-b.json +16 -0
- package/manifest.json +17 -0
- package/package.json +10 -0
- package/plugin.html +115 -0
- package/plugin_default.html +56 -0
- package/plugin_s.html +31 -0
- package/react/index.d.ts +11 -0
- package/react/index.jsx +34 -0
- package/robots.txt +3 -0
- package/static/css/2859.3f78309e.css +1 -0
- package/static/css/4225.7ff43163.css +1 -0
- package/static/css/4625.0a8a91b6.css +1 -0
- package/static/css/4872.36457ae6.css +1 -0
- package/static/js/111.cbd98290.chunk.js +2 -0
- package/static/js/111.cbd98290.chunk.js.LICENSE.txt +6 -0
- package/static/js/1115.fb08b320.chunk.js +2 -0
- package/static/js/1115.fb08b320.chunk.js.LICENSE.txt +6 -0
- package/static/js/1247.6885a0da.chunk.js +2 -0
- package/static/js/1247.6885a0da.chunk.js.LICENSE.txt +6 -0
- package/static/js/1375.9309af3d.chunk.js +2 -0
- package/static/js/1375.9309af3d.chunk.js.LICENSE.txt +6 -0
- package/static/js/1727.05b807df.chunk.js +2 -0
- package/static/js/1727.05b807df.chunk.js.LICENSE.txt +6 -0
- package/static/js/1863.7fa7c875.chunk.js +2 -0
- package/static/js/1863.7fa7c875.chunk.js.LICENSE.txt +6 -0
- package/static/js/2095.35960898.chunk.js +2 -0
- package/static/js/2095.35960898.chunk.js.LICENSE.txt +6 -0
- package/static/js/215.184294a2.chunk.js +2 -0
- package/static/js/215.184294a2.chunk.js.LICENSE.txt +6 -0
- package/static/js/2175.7bfdf72e.chunk.js +2 -0
- package/static/js/2175.7bfdf72e.chunk.js.LICENSE.txt +6 -0
- package/static/js/223.86871df9.chunk.js +2 -0
- package/static/js/223.86871df9.chunk.js.LICENSE.txt +6 -0
- package/static/js/255.96cc3f0a.chunk.js +2 -0
- package/static/js/255.96cc3f0a.chunk.js.LICENSE.txt +6 -0
- package/static/js/2777.93e2f4b9.chunk.js +2 -0
- package/static/js/2777.93e2f4b9.chunk.js.LICENSE.txt +6 -0
- package/static/js/2799.a8352a8e.chunk.js +2 -0
- package/static/js/2799.a8352a8e.chunk.js.LICENSE.txt +6 -0
- package/static/js/2807.13d244f7.js +2 -0
- package/static/js/2807.13d244f7.js.LICENSE.txt +51 -0
- package/static/js/2859.5daa8189.js +1 -0
- package/static/js/2959.37c71ed2.chunk.js +2 -0
- package/static/js/2959.37c71ed2.chunk.js.LICENSE.txt +6 -0
- package/static/js/3.cc80fb69.chunk.js +2 -0
- package/static/js/3.cc80fb69.chunk.js.LICENSE.txt +6 -0
- package/static/js/303.4b451722.chunk.js +2 -0
- package/static/js/303.4b451722.chunk.js.LICENSE.txt +6 -0
- package/static/js/3095.27a8a7ce.chunk.js +2 -0
- package/static/js/3095.27a8a7ce.chunk.js.LICENSE.txt +6 -0
- package/static/js/3116.b4e4c747.chunk.js +2 -0
- package/static/js/3116.b4e4c747.chunk.js.LICENSE.txt +6 -0
- package/static/js/33.7087137f.chunk.js +2 -0
- package/static/js/33.7087137f.chunk.js.LICENSE.txt +6 -0
- package/static/js/3321.3369560d.chunk.js +2 -0
- package/static/js/3321.3369560d.chunk.js.LICENSE.txt +6 -0
- package/static/js/351.800cfa64.chunk.js +2 -0
- package/static/js/351.800cfa64.chunk.js.LICENSE.txt +10 -0
- package/static/js/363.36407050.chunk.js +2 -0
- package/static/js/363.36407050.chunk.js.LICENSE.txt +6 -0
- package/static/js/3756.4539bf2a.chunk.js +2 -0
- package/static/js/3756.4539bf2a.chunk.js.LICENSE.txt +6 -0
- package/static/js/3887.1d2dfdb9.chunk.js +2 -0
- package/static/js/3887.1d2dfdb9.chunk.js.LICENSE.txt +6 -0
- package/static/js/4123.3cb83836.chunk.js +2 -0
- package/static/js/4123.3cb83836.chunk.js.LICENSE.txt +6 -0
- package/static/js/4225.a897394b.js +2 -0
- package/static/js/4225.a897394b.js.LICENSE.txt +8 -0
- package/static/js/4311.af4a59a5.chunk.js +2 -0
- package/static/js/4311.af4a59a5.chunk.js.LICENSE.txt +6 -0
- package/static/js/4459.b6de1b05.chunk.js +2 -0
- package/static/js/4459.b6de1b05.chunk.js.LICENSE.txt +6 -0
- package/static/js/4461.371ffb79.chunk.js +2 -0
- package/static/js/4461.371ffb79.chunk.js.LICENSE.txt +6 -0
- package/static/js/4501.6e4ba4d8.js +2 -0
- package/static/js/4501.6e4ba4d8.js.LICENSE.txt +42 -0
- package/static/js/4625.fbf35b9d.js +1 -0
- package/static/js/4791.c9177129.chunk.js +2 -0
- package/static/js/4791.c9177129.chunk.js.LICENSE.txt +6 -0
- package/static/js/4872.aaa5bfac.js +2 -0
- package/static/js/4872.aaa5bfac.js.LICENSE.txt +200 -0
- package/static/js/4879.8556f136.chunk.js +2 -0
- package/static/js/4879.8556f136.chunk.js.LICENSE.txt +6 -0
- package/static/js/4932.6c513f63.chunk.js +2 -0
- package/static/js/4932.6c513f63.chunk.js.LICENSE.txt +6 -0
- package/static/js/5051.b9a57eb1.chunk.js +2 -0
- package/static/js/5051.b9a57eb1.chunk.js.LICENSE.txt +6 -0
- package/static/js/5068.5d29e1a9.chunk.js +1 -0
- package/static/js/5227.6c918241.chunk.js +2 -0
- package/static/js/5227.6c918241.chunk.js.LICENSE.txt +6 -0
- package/static/js/5293.7e051b80.chunk.js +2 -0
- package/static/js/5293.7e051b80.chunk.js.LICENSE.txt +6 -0
- package/static/js/5423.bddd4a43.chunk.js +2 -0
- package/static/js/5423.bddd4a43.chunk.js.LICENSE.txt +6 -0
- package/static/js/543.82f27022.chunk.js +2 -0
- package/static/js/543.82f27022.chunk.js.LICENSE.txt +6 -0
- package/static/js/5535.3244c148.chunk.js +2 -0
- package/static/js/5535.3244c148.chunk.js.LICENSE.txt +6 -0
- package/static/js/5613.62288e00.chunk.js +2 -0
- package/static/js/5613.62288e00.chunk.js.LICENSE.txt +6 -0
- package/static/js/5615.6ccde06b.chunk.js +2 -0
- package/static/js/5615.6ccde06b.chunk.js.LICENSE.txt +6 -0
- package/static/js/5693.3d4fe88d.chunk.js +2 -0
- package/static/js/5693.3d4fe88d.chunk.js.LICENSE.txt +6 -0
- package/static/js/5763.37c30999.chunk.js +2 -0
- package/static/js/5763.37c30999.chunk.js.LICENSE.txt +6 -0
- package/static/js/5919.dd3128af.chunk.js +2 -0
- package/static/js/5919.dd3128af.chunk.js.LICENSE.txt +6 -0
- package/static/js/6009.f189e5ae.chunk.js +2 -0
- package/static/js/6009.f189e5ae.chunk.js.LICENSE.txt +6 -0
- package/static/js/6447.cfdb8875.chunk.js +2 -0
- package/static/js/6447.cfdb8875.chunk.js.LICENSE.txt +6 -0
- package/static/js/6639.bbbbe601.chunk.js +2 -0
- package/static/js/6639.bbbbe601.chunk.js.LICENSE.txt +6 -0
- package/static/js/6675.3a2d412d.chunk.js +2 -0
- package/static/js/6675.3a2d412d.chunk.js.LICENSE.txt +6 -0
- package/static/js/6713.b7412fee.chunk.js +2 -0
- package/static/js/6713.b7412fee.chunk.js.LICENSE.txt +6 -0
- package/static/js/6735.a97baca4.chunk.js +2 -0
- package/static/js/6735.a97baca4.chunk.js.LICENSE.txt +6 -0
- package/static/js/6901.e7fcecf2.chunk.js +1 -0
- package/static/js/6933.74b38c02.chunk.js +2 -0
- package/static/js/6933.74b38c02.chunk.js.LICENSE.txt +6 -0
- package/static/js/6987.76422d40.js +1 -0
- package/static/js/7073.605ee411.chunk.js +2 -0
- package/static/js/7073.605ee411.chunk.js.LICENSE.txt +6 -0
- package/static/js/7119.ca1d70c7.chunk.js +2 -0
- package/static/js/7119.ca1d70c7.chunk.js.LICENSE.txt +6 -0
- package/static/js/7175.5dd62a53.chunk.js +2 -0
- package/static/js/7175.5dd62a53.chunk.js.LICENSE.txt +6 -0
- package/static/js/7241.0040848f.chunk.js +2 -0
- package/static/js/7241.0040848f.chunk.js.LICENSE.txt +6 -0
- package/static/js/7260.df86f79c.chunk.js +2 -0
- package/static/js/7260.df86f79c.chunk.js.LICENSE.txt +6 -0
- package/static/js/7473.703ab781.chunk.js +2 -0
- package/static/js/7473.703ab781.chunk.js.LICENSE.txt +6 -0
- package/static/js/7533.ff47b1c6.chunk.js +2 -0
- package/static/js/7533.ff47b1c6.chunk.js.LICENSE.txt +6 -0
- package/static/js/7567.5b36aa1e.chunk.js +2 -0
- package/static/js/7567.5b36aa1e.chunk.js.LICENSE.txt +6 -0
- package/static/js/7568.abd309a5.chunk.js +2 -0
- package/static/js/7568.abd309a5.chunk.js.LICENSE.txt +6 -0
- package/static/js/7663.9dadc8ad.chunk.js +2 -0
- package/static/js/7663.9dadc8ad.chunk.js.LICENSE.txt +6 -0
- package/static/js/779.7ec500b4.chunk.js +2 -0
- package/static/js/779.7ec500b4.chunk.js.LICENSE.txt +6 -0
- package/static/js/7803.0edbb2ab.chunk.js +2 -0
- package/static/js/7803.0edbb2ab.chunk.js.LICENSE.txt +6 -0
- package/static/js/7855.90402a9a.chunk.js +2 -0
- package/static/js/7855.90402a9a.chunk.js.LICENSE.txt +6 -0
- package/static/js/7878.a2ba845f.chunk.js +2 -0
- package/static/js/7878.a2ba845f.chunk.js.LICENSE.txt +6 -0
- package/static/js/7963.8d0e0875.chunk.js +2 -0
- package/static/js/7963.8d0e0875.chunk.js.LICENSE.txt +6 -0
- package/static/js/7999.0ef327fe.chunk.js +2 -0
- package/static/js/7999.0ef327fe.chunk.js.LICENSE.txt +6 -0
- package/static/js/8287.60007a30.chunk.js +2 -0
- package/static/js/8287.60007a30.chunk.js.LICENSE.txt +6 -0
- package/static/js/8525.164b4ef1.chunk.js +2 -0
- package/static/js/8525.164b4ef1.chunk.js.LICENSE.txt +6 -0
- package/static/js/8614.4df07be3.chunk.js +2 -0
- package/static/js/8614.4df07be3.chunk.js.LICENSE.txt +6 -0
- package/static/js/863.6162bd02.chunk.js +2 -0
- package/static/js/863.6162bd02.chunk.js.LICENSE.txt +6 -0
- package/static/js/8675.4011b507.chunk.js +2 -0
- package/static/js/8675.4011b507.chunk.js.LICENSE.txt +6 -0
- package/static/js/8799.eaf2f1c6.chunk.js +2 -0
- package/static/js/8799.eaf2f1c6.chunk.js.LICENSE.txt +6 -0
- package/static/js/8871.25143e00.chunk.js +2 -0
- package/static/js/8871.25143e00.chunk.js.LICENSE.txt +6 -0
- package/static/js/8991.19d7f941.chunk.js +2 -0
- package/static/js/8991.19d7f941.chunk.js.LICENSE.txt +6 -0
- package/static/js/9059.695b4670.chunk.js +2 -0
- package/static/js/9059.695b4670.chunk.js.LICENSE.txt +6 -0
- package/static/js/9137.564a2d8b.chunk.js +2 -0
- package/static/js/9137.564a2d8b.chunk.js.LICENSE.txt +6 -0
- package/static/js/9199.9d74e16f.chunk.js +2 -0
- package/static/js/9199.9d74e16f.chunk.js.LICENSE.txt +6 -0
- package/static/js/9225.25bc13dc.chunk.js +2 -0
- package/static/js/9225.25bc13dc.chunk.js.LICENSE.txt +6 -0
- package/static/js/9368.cc07f295.js +1 -0
- package/static/js/9503.80f871a1.chunk.js +2 -0
- package/static/js/9503.80f871a1.chunk.js.LICENSE.txt +6 -0
- package/static/js/9541.7d3756bf.js +1 -0
- package/static/js/9655.2e8d4a8e.chunk.js +2 -0
- package/static/js/9655.2e8d4a8e.chunk.js.LICENSE.txt +6 -0
- package/static/js/9823.a7ba133e.chunk.js +2 -0
- package/static/js/9823.a7ba133e.chunk.js.LICENSE.txt +6 -0
- package/static/js/9875.3b739db7.js +2 -0
- package/static/js/9875.3b739db7.js.LICENSE.txt +86 -0
- package/static/js/9935.f14200e3.chunk.js +2 -0
- package/static/js/9935.f14200e3.chunk.js.LICENSE.txt +6 -0
- package/static/js/ant-locale/locale0.bc9eb989.chunk.js +1 -0
- package/static/js/ant-locale/locale1.79afa8d5.chunk.js +1 -0
- package/static/js/ant-locale/locale10.931ba183.chunk.js +1 -0
- package/static/js/ant-locale/locale11.7c905a2e.chunk.js +1 -0
- package/static/js/ant-locale/locale13.8c7e33f9.chunk.js +1 -0
- package/static/js/ant-locale/locale14.a6d2b694.chunk.js +1 -0
- package/static/js/ant-locale/locale15.e521e6c8.chunk.js +1 -0
- package/static/js/ant-locale/locale16.6bf080c9.chunk.js +1 -0
- package/static/js/ant-locale/locale17.8db23aba.chunk.js +1 -0
- package/static/js/ant-locale/locale18.2378252e.chunk.js +1 -0
- package/static/js/ant-locale/locale19.a9518e0a.chunk.js +1 -0
- package/static/js/ant-locale/locale2.49423b7a.chunk.js +1 -0
- package/static/js/ant-locale/locale20.4195bdf5.chunk.js +1 -0
- package/static/js/ant-locale/locale21.479ba0df.chunk.js +1 -0
- package/static/js/ant-locale/locale22.4c3baa93.chunk.js +1 -0
- package/static/js/ant-locale/locale23.58be86ea.chunk.js +1 -0
- package/static/js/ant-locale/locale24.a44b9124.chunk.js +1 -0
- package/static/js/ant-locale/locale25.efe23431.chunk.js +1 -0
- package/static/js/ant-locale/locale26.52c7a0fc.chunk.js +1 -0
- package/static/js/ant-locale/locale27.cc9719d7.chunk.js +1 -0
- package/static/js/ant-locale/locale28.8b89909a.chunk.js +1 -0
- package/static/js/ant-locale/locale3.547b47e0.chunk.js +1 -0
- package/static/js/ant-locale/locale30.fb7b325a.chunk.js +1 -0
- package/static/js/ant-locale/locale31.2700fff5.chunk.js +1 -0
- package/static/js/ant-locale/locale32.27d17521.chunk.js +1 -0
- package/static/js/ant-locale/locale33.3f671b7f.chunk.js +1 -0
- package/static/js/ant-locale/locale34.6eea3a7c.chunk.js +1 -0
- package/static/js/ant-locale/locale35.1c169a8f.chunk.js +1 -0
- package/static/js/ant-locale/locale36.a0f5d209.chunk.js +1 -0
- package/static/js/ant-locale/locale37.d7a93cd8.chunk.js +1 -0
- package/static/js/ant-locale/locale38.a167fb02.chunk.js +1 -0
- package/static/js/ant-locale/locale39.88330df8.chunk.js +1 -0
- package/static/js/ant-locale/locale4.a14d4f60.chunk.js +1 -0
- package/static/js/ant-locale/locale40.26a0f7b4.chunk.js +1 -0
- package/static/js/ant-locale/locale41.2c575f45.chunk.js +1 -0
- package/static/js/ant-locale/locale42.bd705058.chunk.js +1 -0
- package/static/js/ant-locale/locale43.4c318c1e.chunk.js +1 -0
- package/static/js/ant-locale/locale44.ae6fc942.chunk.js +1 -0
- package/static/js/ant-locale/locale45.4fcc0acf.chunk.js +1 -0
- package/static/js/ant-locale/locale46.8d7fca54.chunk.js +1 -0
- package/static/js/ant-locale/locale47.6a8d9ee9.chunk.js +1 -0
- package/static/js/ant-locale/locale48.db4fb3e9.chunk.js +1 -0
- package/static/js/ant-locale/locale49.876e9846.chunk.js +1 -0
- package/static/js/ant-locale/locale5.179f1d8d.chunk.js +1 -0
- package/static/js/ant-locale/locale50.8d63ce0a.chunk.js +1 -0
- package/static/js/ant-locale/locale51.691274b8.chunk.js +1 -0
- package/static/js/ant-locale/locale52.b9a49d71.chunk.js +1 -0
- package/static/js/ant-locale/locale53.7a7722e3.chunk.js +1 -0
- package/static/js/ant-locale/locale54.0c75bb80.chunk.js +1 -0
- package/static/js/ant-locale/locale55.f5c0d904.chunk.js +1 -0
- package/static/js/ant-locale/locale56.bb2a06a4.chunk.js +1 -0
- package/static/js/ant-locale/locale57.648ebc5b.chunk.js +1 -0
- package/static/js/ant-locale/locale58.fd6a6d0e.chunk.js +1 -0
- package/static/js/ant-locale/locale59.05c85397.chunk.js +1 -0
- package/static/js/ant-locale/locale60.23e6b029.chunk.js +1 -0
- package/static/js/ant-locale/locale61.30ad8fdf.chunk.js +1 -0
- package/static/js/ant-locale/locale62.2ba4458e.chunk.js +1 -0
- package/static/js/ant-locale/locale63.e0e3072c.chunk.js +1 -0
- package/static/js/ant-locale/locale64.d9db34fb.chunk.js +1 -0
- package/static/js/ant-locale/locale65.aa10f18f.chunk.js +1 -0
- package/static/js/ant-locale/locale66.586f32ee.chunk.js +1 -0
- package/static/js/ant-locale/locale68.d2a63a32.chunk.js +1 -0
- package/static/js/ant-locale/locale69.b786c422.chunk.js +1 -0
- package/static/js/ant-locale/locale7.e847d0ec.chunk.js +1 -0
- package/static/js/ant-locale/locale70.75d26f29.chunk.js +1 -0
- package/static/js/ant-locale/locale71.e5c07b26.chunk.js +1 -0
- package/static/js/ant-locale/locale8.f139c7f8.chunk.js +1 -0
- package/static/js/ant-locale/locale9.b69465db.chunk.js +1 -0
- package/static/js/mergeTags/locale0.d3379239.chunk.js +1 -0
- package/static/js/mergeTags/locale1.9462df85.chunk.js +1 -0
- package/static/js/useblocks_core.fd86c4d2.js +1 -0
- package/static/media/codicon.f13d28f3.ttf +0 -0
- package/static/media/frame_dark.318d7ed5.png +0 -0
- package/static/media/frame_light.22a9b4ec.png +0 -0
- package/static/media/frame_template_gallery.85693b39.png +0 -0
- package/static/media/icon-border-radius.2a56b93a7711558098a622296b7ae2e1.svg +1 -0
- package/static/media/icon-create-block.0b077f4000bf7907b9ea871d28c7fb1e.svg +1 -0
- package/static/media/typewriter.c11b8204.png +0 -0
- package/translations.pot +3959 -0
- package/ts.worker.js +2 -0
- package/ts.worker.js.LICENSE.txt +21 -0
- package/useblocks-esm.js +1 -0
- package/useblocks.d.ts +978 -0
- package/useblocks.js +1 -0
- package/vite/index.d.ts +11 -0
- package/vite/index.js +134 -0
- package/vite/mime-types.js +179 -0
- package/vite/utils.js +58 -0
- package/webpack/index.d.ts +12 -0
- package/webpack/index.js +109 -0
package/useblocks.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,a){"object"===typeof exports&&"object"===typeof module?module.exports=a():"function"===typeof define&&define.amd?define([],a):"object"===typeof exports?exports.useblocks=a():e.useblocks=a()}(globalThis,(()=>(()=>{var e={93318:(e,a,l)=>{var c;let t="https://unpkg.com/email-maker-dev/",o="useblocks";if("object"===typeof EmailmakerEnvironment&&null!==(c=EmailmakerEnvironment)&&void 0!==c&&c.publicPath){var n;t=null===(n=EmailmakerEnvironment)||void 0===n?void 0:n.publicPath}else{let e="";const a=document.querySelector(`script[src*=${o}\\.js]`)||document.querySelector(`script[src*=${o}-esm\\.js]`);a instanceof HTMLScriptElement&&(e=a.src),e&&(t=e.replaceAll("\\","/").split("/").slice(0,-1).join("/")+"/")}l.p=t}},a={};function l(c){var t=a[c];if(void 0!==t)return t.exports;var o=a[c]={id:c,loaded:!1,exports:{}};return e[c].call(o.exports,o,o.exports,l),o.loaded=!0,o.exports}l.m=e,l.amdD=function(){throw new Error("define cannot be used indirect")},l.amdO={},l.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return l.d(a,{a:a}),a},(()=>{var e,a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;l.t=function(c,t){if(1&t&&(c=this(c)),8&t)return c;if("object"===typeof c&&c){if(4&t&&c.__esModule)return c;if(16&t&&"function"===typeof c.then)return c}var o=Object.create(null);l.r(o);var n={};e=e||[null,a({}),a([]),a(a)];for(var r=2&t&&c;"object"==typeof r&&!~e.indexOf(r);r=a(r))Object.getOwnPropertyNames(r).forEach((e=>n[e]=()=>c[e]));return n.default=()=>c,l.d(o,n),o}})(),l.d=(e,a)=>{for(var c in a)l.o(a,c)&&!l.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce(((a,c)=>(l.f[c](e,a),a)),[])),l.u=e=>4872===e?"static/js/4872.aaa5bfac.js":9875===e?"static/js/9875.3b739db7.js":4501===e?"static/js/4501.6e4ba4d8.js":9368===e?"static/js/9368.cc07f295.js":4225===e?"static/js/4225.a897394b.js":9541===e?"static/js/9541.7d3756bf.js":4625===e?"static/js/4625.fbf35b9d.js":2859===e?"static/js/2859.5daa8189.js":"static/js/"+({302:"/ant-locale/locale1",732:"/ant-locale/locale16",735:"/ant-locale/locale46",805:"/ant-locale/locale53",881:"/ant-locale/locale13",1279:"/ant-locale/locale8",1290:"/ant-locale/locale5",1401:"/ant-locale/locale26",1712:"/ant-locale/locale41",1723:"/ant-locale/locale42",1782:"/ant-locale/locale58",1788:"/ant-locale/locale38",1793:"/ant-locale/locale57",2104:"/ant-locale/locale70",2169:"/ant-locale/locale35",2180:"/ant-locale/locale30",2466:"/mergeTags/locale0",3157:"/ant-locale/locale66",3222:"/ant-locale/locale21",3541:"/ant-locale/locale17",3544:"/ant-locale/locale49",3614:"/ant-locale/locale50",3690:"/ant-locale/locale10",4145:"/ant-locale/locale62",4210:"/ant-locale/locale25",4221:"/ant-locale/locale22",4286:"/ant-locale/locale14",4521:"/ant-locale/locale40",4532:"/ant-locale/locale45",4591:"/ant-locale/locale59",4597:"/ant-locale/locale39",4602:"/ant-locale/locale54",4684:"/ant-locale/locale3",4695:"/ant-locale/locale0",4913:"/ant-locale/locale71",4989:"/ant-locale/locale31",5122:"/ant-locale/locale69",5187:"/ant-locale/locale55",5506:"/ant-locale/locale18",5523:"/ant-locale/locale4",5574:"/ant-locale/locale32",5672:"/ant-locale/locale7",5955:"/ant-locale/locale60",5966:"/ant-locale/locale65",6031:"/ant-locale/locale20",6353:"/ant-locale/locale48",6562:"/ant-locale/locale36",6859:"/mergeTags/locale1",6954:"/ant-locale/locale61",7008:"/ant-locale/locale27",7019:"/ant-locale/locale24",7095:"/ant-locale/locale15",7330:"/ant-locale/locale43",7341:"/ant-locale/locale44",7493:"/ant-locale/locale2",7923:"/ant-locale/locale11",7926:"/ant-locale/locale47",7931:"/ant-locale/locale68",7996:"/ant-locale/locale52",8007:"/ant-locale/locale51",8315:"/ant-locale/locale19",8383:"/ant-locale/locale33",8470:"/ant-locale/locale9",8775:"/ant-locale/locale64",8984:"/ant-locale/locale56",9360:"/ant-locale/locale34",9371:"/ant-locale/locale37",9447:"/ant-locale/locale28",9752:"/ant-locale/locale63",9828:"/ant-locale/locale23"}[e]||e)+"."+{3:"cc80fb69",33:"7087137f",111:"cbd98290",215:"184294a2",223:"86871df9",255:"96cc3f0a",302:"79afa8d5",303:"4b451722",351:"800cfa64",363:"36407050",543:"82f27022",732:"6bf080c9",735:"8d7fca54",779:"7ec500b4",805:"7a7722e3",863:"6162bd02",881:"8c7e33f9",1115:"fb08b320",1247:"6885a0da",1279:"f139c7f8",1290:"179f1d8d",1375:"9309af3d",1401:"52c7a0fc",1712:"2c575f45",1723:"bd705058",1727:"05b807df",1782:"fd6a6d0e",1788:"a167fb02",1793:"648ebc5b",1863:"7fa7c875",2095:"35960898",2104:"75d26f29",2169:"1c169a8f",2175:"7bfdf72e",2180:"fb7b325a",2466:"d3379239",2777:"93e2f4b9",2799:"a8352a8e",2959:"37c71ed2",3095:"27a8a7ce",3116:"b4e4c747",3157:"586f32ee",3222:"479ba0df",3321:"3369560d",3541:"8db23aba",3544:"876e9846",3614:"8d63ce0a",3690:"931ba183",3756:"4539bf2a",3887:"1d2dfdb9",4123:"3cb83836",4145:"2ba4458e",4210:"efe23431",4221:"4c3baa93",4286:"a6d2b694",4311:"af4a59a5",4459:"b6de1b05",4461:"371ffb79",4521:"26a0f7b4",4532:"4fcc0acf",4591:"05c85397",4597:"88330df8",4602:"0c75bb80",4684:"547b47e0",4695:"bc9eb989",4791:"c9177129",4879:"8556f136",4913:"e5c07b26",4932:"6c513f63",4989:"2700fff5",5051:"b9a57eb1",5068:"5d29e1a9",5122:"b786c422",5187:"f5c0d904",5227:"6c918241",5293:"7e051b80",5423:"bddd4a43",5506:"2378252e",5523:"a14d4f60",5535:"3244c148",5574:"27d17521",5613:"62288e00",5615:"6ccde06b",5672:"e847d0ec",5693:"3d4fe88d",5763:"37c30999",5919:"dd3128af",5955:"23e6b029",5966:"aa10f18f",6009:"f189e5ae",6031:"4195bdf5",6353:"db4fb3e9",6447:"cfdb8875",6562:"a0f5d209",6639:"bbbbe601",6675:"3a2d412d",6713:"b7412fee",6735:"a97baca4",6859:"9462df85",6901:"e7fcecf2",6933:"74b38c02",6954:"30ad8fdf",7008:"cc9719d7",7019:"a44b9124",7073:"605ee411",7095:"e521e6c8",7119:"ca1d70c7",7175:"5dd62a53",7241:"0040848f",7260:"df86f79c",7330:"4c318c1e",7341:"ae6fc942",7473:"703ab781",7493:"49423b7a",7533:"ff47b1c6",7567:"5b36aa1e",7568:"abd309a5",7663:"9dadc8ad",7803:"0edbb2ab",7855:"90402a9a",7878:"a2ba845f",7923:"7c905a2e",7926:"6a8d9ee9",7931:"d2a63a32",7963:"8d0e0875",7996:"b9a49d71",7999:"0ef327fe",8007:"691274b8",8287:"60007a30",8315:"a9518e0a",8383:"3f671b7f",8470:"b69465db",8525:"164b4ef1",8614:"4df07be3",8675:"4011b507",8775:"d9db34fb",8799:"eaf2f1c6",8871:"25143e00",8984:"bb2a06a4",8991:"19d7f941",9059:"695b4670",9137:"564a2d8b",9199:"9d74e16f",9225:"25bc13dc",9360:"6eea3a7c",9371:"d7a93cd8",9447:"8b89909a",9503:"80f871a1",9655:"2e8d4a8e",9752:"e0e3072c",9823:"a7ba133e",9828:"58be86ea",9935:"f14200e3"}[e]+".chunk.js",l.miniCssF=e=>4872===e?"static/css/4872.36457ae6.css":4225===e?"static/css/4225.7ff43163.css":4625===e?"static/css/4625.0a8a91b6.css":2859===e?"static/css/2859.3f78309e.css":void 0,l.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),l.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),l.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{var e={},a="email-maker:";l.l=(c,t,o,n)=>{if(e[c])e[c].push(t);else{var r,d;if(void 0!==o)for(var f=document.getElementsByTagName("script"),i=0;i<f.length;i++){var s=f[i];if(s.getAttribute("src")==c||s.getAttribute("data-webpack")==a+o){r=s;break}}r||(d=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,l.nc&&r.setAttribute("nonce",l.nc),r.setAttribute("data-webpack",a+o),r.src=c),e[c]=[t];var b=(a,l)=>{r.onerror=r.onload=null,clearTimeout(u);var t=e[c];if(delete e[c],r.parentNode&&r.parentNode.removeChild(r),t&&t.forEach((e=>e(l))),a)return a(l)},u=setTimeout(b.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=b.bind(null,r.onerror),r.onload=b.bind(null,r.onload),d&&document.head.appendChild(r)}}})(),l.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.p="/",(()=>{if("undefined"!==typeof document){var e=e=>new Promise(((a,c)=>{var t=l.miniCssF(e),o=l.p+t;if(((e,a)=>{for(var l=document.getElementsByTagName("link"),c=0;c<l.length;c++){var t=(n=l[c]).getAttribute("data-href")||n.getAttribute("href");if("stylesheet"===n.rel&&(t===e||t===a))return n}var o=document.getElementsByTagName("style");for(c=0;c<o.length;c++){var n;if((t=(n=o[c]).getAttribute("data-href"))===e||t===a)return n}})(t,o))return a();((e,a,c,t,o)=>{var n=document.createElement("link");n.rel="stylesheet",n.type="text/css",l.nc&&(n.nonce=l.nc),n.onerror=n.onload=l=>{if(n.onerror=n.onload=null,"load"===l.type)t();else{var c=l&&l.type,r=l&&l.target&&l.target.href||a,d=new Error("Loading CSS chunk "+e+" failed.\n("+c+": "+r+")");d.name="ChunkLoadError",d.code="CSS_CHUNK_LOAD_FAILED",d.type=c,d.request=r,n.parentNode&&n.parentNode.removeChild(n),o(d)}},n.href=a,c?c.parentNode.insertBefore(n,c.nextSibling):document.head.appendChild(n)})(e,o,null,a,c)})),a={5294:0,884:0};l.f.miniCss=(l,c)=>{a[l]?c.push(a[l]):0!==a[l]&&{2859:1,4225:1,4625:1,4872:1}[l]&&c.push(a[l]=e(l).then((()=>{a[l]=0}),(e=>{throw delete a[l],e})))}}})(),(()=>{var e={5294:0,884:0};l.f.j=(a,c)=>{var t=l.o(e,a)?e[a]:void 0;if(0!==t)if(t)c.push(t[2]);else{var o=new Promise(((l,c)=>t=e[a]=[l,c]));c.push(t[2]=o);var n=l.p+l.u(a),r=new Error;l.l(n,(c=>{if(l.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var o=c&&("load"===c.type?"missing":c.type),n=c&&c.target&&c.target.src;r.message="Loading chunk "+a+" failed.\n("+o+": "+n+")",r.name="ChunkLoadError",r.type=o,r.request=n,t[1](r)}}),"chunk-"+a,a)}};var a=(a,c)=>{var t,o,[n,r,d]=c,f=0;if(n.some((a=>0!==e[a]))){for(t in r)l.o(r,t)&&(l.m[t]=r[t]);if(d)d(l)}for(a&&a(c);f<n.length;f++)o=n[f],l.o(e,o)&&e[o]&&e[o][0](),e[o]=0},c=globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[];c.forEach(a.bind(null,0)),c.push=a.bind(null,c.push.bind(c))})(),l.nc=void 0;var c={};return(()=>{"use strict";l.r(c),l.d(c,{init:()=>a,version:()=>t});l(93318);let e;function a(a){return e||(e=Promise.all([l.e(4872),l.e(9875),l.e(4501),l.e(9368),l.e(4225),l.e(9541),l.e(4625),l.e(2859),l.e(6901)]).then(l.bind(l,26901))),e.then((e=>e.init(a)))}const t="1.0.0"})(),c})()));
|
package/vite/index.d.ts
ADDED
package/vite/index.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const MIME_TYPES = require("./mime-types");
|
|
4
|
+
const { toPascalCase, cleanUrl, normalizePath, copyFolder } = require("./utils");
|
|
5
|
+
|
|
6
|
+
const APP_NAME = "emailmaker";
|
|
7
|
+
const ENVIRONMENT_VARIABLE = `${toPascalCase(APP_NAME)}Environment`;
|
|
8
|
+
const PLUGIN_NAME = `${APP_NAME}-vite-plugin`;
|
|
9
|
+
const PACKAGE_ENTRY_NAME = `${APP_NAME}.js`;
|
|
10
|
+
const ESM_PACKAGE_ENTRY_NAME = `${APP_NAME}-esm.js`;
|
|
11
|
+
const PACKAGE_PATH = `email-maker-dev`;
|
|
12
|
+
const DEFAULT_OUTPUT_FOLDER = `/${APP_NAME}`;
|
|
13
|
+
const DEFAULT_MODULES_PATH = "node_modules";
|
|
14
|
+
|
|
15
|
+
const IGNORED_PATTERNS = [
|
|
16
|
+
/.*\.npmignore/,
|
|
17
|
+
/.*\.gitignore/,
|
|
18
|
+
/.*\.md$/,
|
|
19
|
+
/.*\.ts$/,
|
|
20
|
+
/.*\.d\.ts$/,
|
|
21
|
+
/.*\.json$/,
|
|
22
|
+
/.*\.ico$/,
|
|
23
|
+
/.*\.pot$/,
|
|
24
|
+
/^.*(?<!iframe\..{1,})\.html$/,
|
|
25
|
+
/vite\\?.*$/,
|
|
26
|
+
/webpack\\?.*$/,
|
|
27
|
+
/react\\?.*$/,
|
|
28
|
+
/robots.txt$/,
|
|
29
|
+
/main\..*\.js$/,
|
|
30
|
+
/.*\\sandbox-eblock.*$/
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const ViteServePlugin = (options) => {
|
|
34
|
+
const rootPath = process.cwd();
|
|
35
|
+
const destPath = path.posix.join(rootPath, options.outputFolder || DEFAULT_OUTPUT_FOLDER);
|
|
36
|
+
return {
|
|
37
|
+
name: PLUGIN_NAME,
|
|
38
|
+
apply: 'serve',
|
|
39
|
+
|
|
40
|
+
transform: (code, id) => {
|
|
41
|
+
id = cleanUrl(id);
|
|
42
|
+
return (id.endsWith(`${PACKAGE_PATH}.js`) || id.endsWith(ESM_PACKAGE_ENTRY_NAME)) ? `var ${ENVIRONMENT_VARIABLE}= { publicPath: "${options.outputFolder || DEFAULT_OUTPUT_FOLDER}/"}; ${code}` : code;
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
configureServer: (server) => {
|
|
46
|
+
server.middlewares.use('/', async (req, res, next) => {
|
|
47
|
+
if (!req.url) {
|
|
48
|
+
next();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const absReqPath = path.posix.join(rootPath, cleanUrl(req.url));
|
|
52
|
+
if (absReqPath.startsWith(destPath)) {
|
|
53
|
+
const sourcePath = path.posix.join(options.modulesPath || DEFAULT_MODULES_PATH, PACKAGE_PATH, absReqPath.replace(destPath, ""));
|
|
54
|
+
if (!IGNORED_PATTERNS.some((pattern) => pattern.test(sourcePath)) && fs.existsSync(sourcePath)) {
|
|
55
|
+
await sendContentByFilePath(sourcePath);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
next()
|
|
60
|
+
|
|
61
|
+
async function sendContentByFilePath(filePath) {
|
|
62
|
+
const handledPath = normalizePath(filePath);
|
|
63
|
+
if (!fs.existsSync(handledPath)) {
|
|
64
|
+
next();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (!fs.statSync(handledPath).isFile()) {
|
|
68
|
+
next();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const content = await fs.promises.readFile(handledPath);
|
|
72
|
+
const filePathParts = filePath.split(".");
|
|
73
|
+
const ext = filePathParts.length > 1 ? filePathParts[filePathParts.length - 1] : "";
|
|
74
|
+
res.writeHead(200, {
|
|
75
|
+
'Content-Type': ext && MIME_TYPES[ext] || 'text/plain'
|
|
76
|
+
});
|
|
77
|
+
res.end(content)
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const ViteBuildPlugin = (options) => {
|
|
86
|
+
const publicPath = options.publicPath || "";
|
|
87
|
+
const sourcePath = path.posix.join(options.modulesPath || DEFAULT_MODULES_PATH, PACKAGE_PATH);
|
|
88
|
+
let resolvedConfig = undefined;
|
|
89
|
+
return {
|
|
90
|
+
name: PLUGIN_NAME,
|
|
91
|
+
apply: 'build',
|
|
92
|
+
transform: (code, id) => {
|
|
93
|
+
id = cleanUrl(id);
|
|
94
|
+
if (id.endsWith(PACKAGE_ENTRY_NAME) || id.endsWith(ESM_PACKAGE_ENTRY_NAME)) {
|
|
95
|
+
const dir = path.posix.join(publicPath, options.outputFolder || DEFAULT_OUTPUT_FOLDER);
|
|
96
|
+
return `let ${ENVIRONMENT_VARIABLE}= { publicPath: "${dir}/"}; ${code}`;
|
|
97
|
+
} else {
|
|
98
|
+
return code;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
configResolved(config) {
|
|
102
|
+
resolvedConfig = config
|
|
103
|
+
},
|
|
104
|
+
async closeBundle() {
|
|
105
|
+
const outDir = path.posix.join(
|
|
106
|
+
resolvedConfig.root,
|
|
107
|
+
resolvedConfig.build.outDir
|
|
108
|
+
)
|
|
109
|
+
const destPath = path.posix.join(outDir, options.outputFolder || DEFAULT_OUTPUT_FOLDER);
|
|
110
|
+
|
|
111
|
+
if (!fs.existsSync(sourcePath)) {
|
|
112
|
+
return
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
const stat = await fs.promises.stat(sourcePath)
|
|
117
|
+
|
|
118
|
+
if (stat.isDirectory()) {
|
|
119
|
+
await copyFolder(sourcePath, destPath, (sourcePath) => {
|
|
120
|
+
console.log(`${sourcePath} ${!IGNORED_PATTERNS.some((pattern) => pattern.test(sourcePath))}`);
|
|
121
|
+
return !IGNORED_PATTERNS.some((pattern) => pattern.test(sourcePath));
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const VitePlugin = (options = {}) => {
|
|
131
|
+
return [ViteServePlugin(options), ViteBuildPlugin(options)]
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
module.exports = VitePlugin;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
// File Extension MIME Type
|
|
3
|
+
'abs': 'audio/x-mpeg',
|
|
4
|
+
'ai': 'application/postscript',
|
|
5
|
+
'aif': 'audio/x-aiff',
|
|
6
|
+
'aifc': 'audio/x-aiff',
|
|
7
|
+
'aiff': 'audio/x-aiff',
|
|
8
|
+
'aim': 'application/x-aim',
|
|
9
|
+
'art': 'image/x-jg',
|
|
10
|
+
'asf': 'video/x-ms-asf',
|
|
11
|
+
'asx': 'video/x-ms-asf',
|
|
12
|
+
'au': 'audio/basic',
|
|
13
|
+
'avi': 'video/x-msvideo',
|
|
14
|
+
'avx': 'video/x-rad-screenplay',
|
|
15
|
+
'bcpio': 'application/x-bcpio',
|
|
16
|
+
'bin': 'application/octet-stream',
|
|
17
|
+
'bmp': 'image/bmp',
|
|
18
|
+
'body': 'text/html',
|
|
19
|
+
'cdf': 'application/x-cdf',
|
|
20
|
+
'cer': 'application/pkix-cert',
|
|
21
|
+
'class': 'application/java',
|
|
22
|
+
'cpio': 'application/x-cpio',
|
|
23
|
+
'csh': 'application/x-csh',
|
|
24
|
+
'css': 'text/css',
|
|
25
|
+
'dib': 'image/bmp',
|
|
26
|
+
'doc': 'application/msword',
|
|
27
|
+
'dtd': 'application/xml-dtd',
|
|
28
|
+
'dv': 'video/x-dv',
|
|
29
|
+
'dvi': 'application/x-dvi',
|
|
30
|
+
'eot': 'application/vnd.ms-fontobject',
|
|
31
|
+
'eps': 'application/postscript',
|
|
32
|
+
'etx': 'text/x-setext',
|
|
33
|
+
'exe': 'application/octet-stream',
|
|
34
|
+
'gif': 'image/gif',
|
|
35
|
+
'gtar': 'application/x-gtar',
|
|
36
|
+
'gz': 'application/x-gzip',
|
|
37
|
+
'hdf': 'application/x-hdf',
|
|
38
|
+
'hqx': 'application/mac-binhex40',
|
|
39
|
+
'htc': 'text/x-component',
|
|
40
|
+
'htm': 'text/html',
|
|
41
|
+
'html': 'text/html',
|
|
42
|
+
'ief': 'image/ief',
|
|
43
|
+
'jad': 'text/vnd.sun.j2me.app-descriptor',
|
|
44
|
+
'jar': 'application/java-archive',
|
|
45
|
+
'java': 'text/x-java-source',
|
|
46
|
+
'jnlp': 'application/x-java-jnlp-file',
|
|
47
|
+
'jpe': 'image/jpeg',
|
|
48
|
+
'jpeg': 'image/jpeg',
|
|
49
|
+
'jpg': 'image/jpeg',
|
|
50
|
+
'js': 'application/javascript',
|
|
51
|
+
'jsf': 'text/plain',
|
|
52
|
+
'json': 'application/json',
|
|
53
|
+
'jspf': 'text/plain',
|
|
54
|
+
'kar': 'audio/midi',
|
|
55
|
+
'latex': 'application/x-latex',
|
|
56
|
+
'm3u': 'audio/x-mpegurl',
|
|
57
|
+
'mac': 'image/x-macpaint',
|
|
58
|
+
'man': 'text/troff',
|
|
59
|
+
'mathml': 'application/mathml+xml',
|
|
60
|
+
'me': 'text/troff',
|
|
61
|
+
'mid': 'audio/midi',
|
|
62
|
+
'midi': 'audio/midi',
|
|
63
|
+
'mif': 'application/x-mif',
|
|
64
|
+
'mov': 'video/quicktime',
|
|
65
|
+
'movie': 'video/x-sgi-movie',
|
|
66
|
+
'mp1': 'audio/mpeg',
|
|
67
|
+
'mp2': 'audio/mpeg',
|
|
68
|
+
'mp3': 'audio/mpeg',
|
|
69
|
+
'mp4': 'video/mp4',
|
|
70
|
+
'mpa': 'audio/mpeg',
|
|
71
|
+
'mpe': 'video/mpeg',
|
|
72
|
+
'mpeg': 'video/mpeg',
|
|
73
|
+
'mpega': 'audio/x-mpeg',
|
|
74
|
+
'mpg': 'video/mpeg',
|
|
75
|
+
'mpv2': 'video/mpeg2',
|
|
76
|
+
'ms': 'application/x-wais-source',
|
|
77
|
+
'nc': 'application/x-netcdf',
|
|
78
|
+
'oda': 'application/oda',
|
|
79
|
+
'odb': 'application/vnd.oasis.opendocument.database',
|
|
80
|
+
'odc': 'application/vnd.oasis.opendocument.chart',
|
|
81
|
+
'odf': 'application/vnd.oasis.opendocument.formula',
|
|
82
|
+
'odg': 'application/vnd.oasis.opendocument.graphics',
|
|
83
|
+
'odi': 'application/vnd.oasis.opendocument.image',
|
|
84
|
+
'odm': 'application/vnd.oasis.opendocument.text-master',
|
|
85
|
+
'odp': 'application/vnd.oasis.opendocument.presentation',
|
|
86
|
+
'ods': 'application/vnd.oasis.opendocument.spreadsheet',
|
|
87
|
+
'odt': 'application/vnd.oasis.opendocument.text',
|
|
88
|
+
'otg': 'application/vnd.oasis.opendocument.graphics-template',
|
|
89
|
+
'oth': 'application/vnd.oasis.opendocument.text-web',
|
|
90
|
+
'otp': 'application/vnd.oasis.opendocument.presentation-template',
|
|
91
|
+
'ots': 'application/vnd.oasis.opendocument.spreadsheet-template',
|
|
92
|
+
'ott': 'application/vnd.oasis.opendocument.text-template',
|
|
93
|
+
'ogx': 'application/ogg',
|
|
94
|
+
'ogv': 'video/ogg',
|
|
95
|
+
'oga': 'audio/ogg',
|
|
96
|
+
'ogg': 'audio/ogg',
|
|
97
|
+
'otf': 'application/x-font-opentype',
|
|
98
|
+
'spx': 'audio/ogg',
|
|
99
|
+
'flac': 'audio/flac',
|
|
100
|
+
'anx': 'application/annodex',
|
|
101
|
+
'axa': 'audio/annodex',
|
|
102
|
+
'axv': 'video/annodex',
|
|
103
|
+
'xspf': 'application/xspf+xml',
|
|
104
|
+
'pbm': 'image/x-portable-bitmap',
|
|
105
|
+
'pct': 'image/pict',
|
|
106
|
+
'pdf': 'application/pdf',
|
|
107
|
+
'pgm': 'image/x-portable-graymap',
|
|
108
|
+
'pic': 'image/pict',
|
|
109
|
+
'pict': 'image/pict',
|
|
110
|
+
'pls': 'audio/x-scpls',
|
|
111
|
+
'png': 'image/png',
|
|
112
|
+
'pnm': 'image/x-portable-anymap',
|
|
113
|
+
'pnt': 'image/x-macpaint',
|
|
114
|
+
'ppm': 'image/x-portable-pixmap',
|
|
115
|
+
'ppt': 'application/vnd.ms-powerpoint',
|
|
116
|
+
'pps': 'application/vnd.ms-powerpoint',
|
|
117
|
+
'ps': 'application/postscript',
|
|
118
|
+
'psd': 'image/vnd.adobe.photoshop',
|
|
119
|
+
'qt': 'video/quicktime',
|
|
120
|
+
'qti': 'image/x-quicktime',
|
|
121
|
+
'qtif': 'image/x-quicktime',
|
|
122
|
+
'ras': 'image/x-cmu-raster',
|
|
123
|
+
'rdf': 'application/rdf+xml',
|
|
124
|
+
'rgb': 'image/x-rgb',
|
|
125
|
+
'rm': 'application/vnd.rn-realmedia',
|
|
126
|
+
'roff': 'text/troff',
|
|
127
|
+
'rtf': 'application/rtf',
|
|
128
|
+
'rtx': 'text/richtext',
|
|
129
|
+
'sfnt': 'application/font-sfnt',
|
|
130
|
+
'sh': 'application/x-sh',
|
|
131
|
+
'shar': 'application/x-shar',
|
|
132
|
+
'sit': 'application/x-stuffit',
|
|
133
|
+
'snd': 'audio/basic',
|
|
134
|
+
'src': 'application/x-wais-source',
|
|
135
|
+
'sv4cpio': 'application/x-sv4cpio',
|
|
136
|
+
'sv4crc': 'application/x-sv4crc',
|
|
137
|
+
'svg': 'image/svg+xml',
|
|
138
|
+
'svgz': 'image/svg+xml',
|
|
139
|
+
'swf': 'application/x-shockwave-flash',
|
|
140
|
+
't': 'text/troff',
|
|
141
|
+
'tar': 'application/x-tar',
|
|
142
|
+
'tcl': 'application/x-tcl',
|
|
143
|
+
'tex': 'application/x-tex',
|
|
144
|
+
'texi': 'application/x-texinfo',
|
|
145
|
+
'texinfo': 'application/x-texinfo',
|
|
146
|
+
'tif': 'image/tiff',
|
|
147
|
+
'tiff': 'image/tiff',
|
|
148
|
+
'tr': 'text/troff',
|
|
149
|
+
'tsv': 'text/tab-separated-values',
|
|
150
|
+
'ttf': 'application/x-font-ttf',
|
|
151
|
+
'txt': 'text/plain',
|
|
152
|
+
'ulw': 'audio/basic',
|
|
153
|
+
'ustar': 'application/x-ustar',
|
|
154
|
+
'vxml': 'application/voicexml+xml',
|
|
155
|
+
'xbm': 'image/x-xbitmap',
|
|
156
|
+
'xht': 'application/xhtml+xml',
|
|
157
|
+
'xhtml': 'application/xhtml+xml',
|
|
158
|
+
'xls': 'application/vnd.ms-excel',
|
|
159
|
+
'xml': 'application/xml',
|
|
160
|
+
'xpm': 'image/x-xpixmap',
|
|
161
|
+
'xsl': 'application/xml',
|
|
162
|
+
'xslt': 'application/xslt+xml',
|
|
163
|
+
'xul': 'application/vnd.mozilla.xul+xml',
|
|
164
|
+
'xwd': 'image/x-xwindowdump',
|
|
165
|
+
'vsd': 'application/vnd.visio',
|
|
166
|
+
'wav': 'audio/x-wav',
|
|
167
|
+
'wbmp': 'image/vnd.wap.wbmp',
|
|
168
|
+
'wml': 'text/vnd.wap.wml',
|
|
169
|
+
'wmlc': 'application/vnd.wap.wmlc',
|
|
170
|
+
'wmls': 'text/vnd.wap.wmlsc',
|
|
171
|
+
'wmlscriptc': 'application/vnd.wap.wmlscriptc',
|
|
172
|
+
'wmv': 'video/x-ms-wmv',
|
|
173
|
+
'woff': 'application/font-woff',
|
|
174
|
+
'woff2': 'application/font-woff2',
|
|
175
|
+
'wrl': 'model/vrml',
|
|
176
|
+
'wspolicy': 'application/wspolicy+xml',
|
|
177
|
+
'z': 'application/x-compress',
|
|
178
|
+
'zip': 'application/zip'
|
|
179
|
+
};
|
package/vite/utils.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const os = require("os");
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
mkdir,
|
|
6
|
+
readdir,
|
|
7
|
+
copyFile,
|
|
8
|
+
stat
|
|
9
|
+
} = require("fs").promises;
|
|
10
|
+
|
|
11
|
+
function toPascalCase(string) {
|
|
12
|
+
return `${string}`
|
|
13
|
+
.toLowerCase()
|
|
14
|
+
.replace(new RegExp(/[-_]+/, 'g'), ' ')
|
|
15
|
+
.replace(new RegExp(/[^\w\s]/, 'g'), '')
|
|
16
|
+
.replace(
|
|
17
|
+
new RegExp(/\s+(.)(\w*)/, 'g'),
|
|
18
|
+
($1, $2, $3) => `${$2.toUpperCase() + $3}`
|
|
19
|
+
)
|
|
20
|
+
.replace(new RegExp(/\w/), s => s.toUpperCase());
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function slash(p) {
|
|
24
|
+
return p.replace(/\\/g, '/')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const cleanUrl = (url) => {
|
|
28
|
+
const QUERY_RE = /\?.*$/s
|
|
29
|
+
const HASH_RE = /#.*$/s
|
|
30
|
+
return url.replace(HASH_RE, '').replace(QUERY_RE, '')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function normalizePath(id) {
|
|
34
|
+
const isWindows = os.platform() === 'win32'
|
|
35
|
+
return path.posix.normalize(isWindows ? slash(id) : id)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const fileExists = async path => !!(await stat(path).catch(e => false));
|
|
39
|
+
|
|
40
|
+
async function copyFolder(src, dest, filter) {
|
|
41
|
+
if (!await fileExists(dest)) {
|
|
42
|
+
await mkdir(dest);
|
|
43
|
+
}
|
|
44
|
+
const entries = await readdir(src);
|
|
45
|
+
return Promise.all(entries.map(async entry => {
|
|
46
|
+
const srcPath = path.join(src, entry);
|
|
47
|
+
if (filter(srcPath)) {
|
|
48
|
+
const destPath = path.join(dest, entry);
|
|
49
|
+
const _stat = await stat(srcPath);
|
|
50
|
+
if (_stat.isFile()) {
|
|
51
|
+
copyFile(srcPath, destPath);
|
|
52
|
+
} else if (_stat.isDirectory()) {
|
|
53
|
+
copyFolder(srcPath, destPath, filter);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
module.exports = { toPascalCase, cleanUrl, normalizePath, copyFolder };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Compiler, WebpackPluginInstance } from "webpack";
|
|
2
|
+
|
|
3
|
+
export type WebpackPluginOptions = {
|
|
4
|
+
outputFolder?: string;
|
|
5
|
+
modulesPath?: string;
|
|
6
|
+
publicPath?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default class WebpackPlugin implements WebpackPluginInstance {
|
|
10
|
+
constructor(options: WebpackPluginOptions);
|
|
11
|
+
apply: (compiler: Compiler) => void;
|
|
12
|
+
}
|
package/webpack/index.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const { javascript } = require("webpack");
|
|
4
|
+
const { ConcatSource, RawSource } = require("webpack-sources");
|
|
5
|
+
|
|
6
|
+
function toPascalCase(string) {
|
|
7
|
+
return `${string}`
|
|
8
|
+
.toLowerCase()
|
|
9
|
+
.replace(new RegExp(/[-_]+/, 'g'), ' ')
|
|
10
|
+
.replace(new RegExp(/[^\w\s]/, 'g'), '')
|
|
11
|
+
.replace(
|
|
12
|
+
new RegExp(/\s+(.)(\w*)/, 'g'),
|
|
13
|
+
($1, $2, $3) => `${$2.toUpperCase() + $3}`
|
|
14
|
+
)
|
|
15
|
+
.replace(new RegExp(/\w/), s => s.toUpperCase());
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const APP_NAME = "emailmaker";
|
|
20
|
+
const PLUGIN_NAME = `${toPascalCase(APP_NAME)}WebpackPlugin`;
|
|
21
|
+
const PACKAGE_ENTRY_NAME = `${APP_NAME}.js`;
|
|
22
|
+
const PACKAGE_PATH = `email-maker-dev`;
|
|
23
|
+
const DEFAULT_OUTPUT_FOLDER = APP_NAME;
|
|
24
|
+
const DEFAULT_MODULES_PATH = `node_modules`;
|
|
25
|
+
const ESM_PACKAGE_ENTRY_NAME = `${APP_NAME}-esm.js`;
|
|
26
|
+
const ENVIRONMENT_VARIABLE = `${toPascalCase(APP_NAME)}Environment`;
|
|
27
|
+
|
|
28
|
+
const IGNORED_PATTERNS = [
|
|
29
|
+
/.*\.npmignore/,
|
|
30
|
+
/.*\.gitignore/,
|
|
31
|
+
/.*\.md$/,
|
|
32
|
+
/.*\.ts$/,
|
|
33
|
+
/.*\.d\.ts$/,
|
|
34
|
+
/.*\.json$/,
|
|
35
|
+
/.*\.ico$/,
|
|
36
|
+
/.*\.pot$/,
|
|
37
|
+
/^.*(?<!iframe\..{1,})\.html$/,
|
|
38
|
+
/vite\\?.*$/,
|
|
39
|
+
/webpack\\?.*$/,
|
|
40
|
+
/react\\?.*$/,
|
|
41
|
+
/robots.txt$/,
|
|
42
|
+
/main\..*\.js$/,
|
|
43
|
+
/.*\\sandbox-eblock.*$/
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
class EmailmakerWebpackPlugin {
|
|
47
|
+
_outputFolder = DEFAULT_OUTPUT_FOLDER;
|
|
48
|
+
_modulesPath = DEFAULT_MODULES_PATH;
|
|
49
|
+
_publicPath = undefined;
|
|
50
|
+
constructor(options = {}) {
|
|
51
|
+
if (options.outputFolder !== undefined) { this._outputFolder = options.outputFolder; };
|
|
52
|
+
if (options.modulesPath !== undefined) { this._modulesPath = options.modulesPath };
|
|
53
|
+
if (options.publicPath !== undefined) { this._publicPath = options.publicPath };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
addAsset = async (compilation, sourcePath, destPath) => {
|
|
58
|
+
const filePath = path.resolve(compilation.compiler.context, sourcePath);
|
|
59
|
+
if (IGNORED_PATTERNS.some((pattern) => pattern.test(filePath))) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (!compilation.getAsset(destPath)) {
|
|
63
|
+
const [stat, data] = await Promise.all([fs.promises.stat(filePath), fs.promises.readFile(filePath)]);
|
|
64
|
+
const { size } = stat;
|
|
65
|
+
const source = new RawSource(data, true);
|
|
66
|
+
compilation.fileDependencies.add(filePath);
|
|
67
|
+
compilation.emitAsset(destPath, source, { size });
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
copyFiles = async (compilation, source, destination) => {
|
|
72
|
+
const directoryEntries = await fs.promises.readdir(source, { withFileTypes: true });
|
|
73
|
+
// console.log(destination);
|
|
74
|
+
// await fs.promises.mkdir(destination, { recursive: true });
|
|
75
|
+
return Promise.all(
|
|
76
|
+
directoryEntries.map(async (entry) => {
|
|
77
|
+
const sourcePath = path.join(source, entry.name);
|
|
78
|
+
const destinationPath = path.join(destination, entry.name);
|
|
79
|
+
return entry.isDirectory() ?
|
|
80
|
+
this.copyFiles(compilation, sourcePath, destinationPath) :
|
|
81
|
+
this.addAsset(compilation, sourcePath, destinationPath);
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
apply(compiler) {
|
|
88
|
+
const optionsPublicPath = compiler.options.output.publicPath || "";
|
|
89
|
+
const publicPath = this._publicPath === undefined ? optionsPublicPath : this._publicPath;
|
|
90
|
+
const initFragment = `var ${ENVIRONMENT_VARIABLE} = { publicPath: "${publicPath + (publicPath.endsWith("/") ? "" : "/")}${this._outputFolder}/"};`;
|
|
91
|
+
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
|
92
|
+
compilation.hooks.processAssets.tapAsync({
|
|
93
|
+
name: PLUGIN_NAME,
|
|
94
|
+
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,
|
|
95
|
+
},
|
|
96
|
+
(_unusedAssets, cb) => this.copyFiles(compilation, path.join(this._modulesPath, PACKAGE_PATH), this._outputFolder).then(() => cb(null), e => cb(e)));
|
|
97
|
+
const hooks = javascript.JavascriptModulesPlugin.getCompilationHooks(compilation);
|
|
98
|
+
hooks.renderModuleContent.tap(PLUGIN_NAME, (source, module) => {
|
|
99
|
+
const name = module && module.nameForCondition();
|
|
100
|
+
if (typeof name === "string" && (name.indexOf(PACKAGE_ENTRY_NAME) >= 0 || name.indexOf(ESM_PACKAGE_ENTRY_NAME) >= 0)) {
|
|
101
|
+
return new ConcatSource(initFragment, source);
|
|
102
|
+
}
|
|
103
|
+
return source;
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
module.exports = EmailmakerWebpackPlugin;
|