@emailmaker/emailmaker 1.0.107-dev.3 → 1.0.107-dev.4
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 +1 -1
- package/cli/dist/lib/cli/project.js +2 -16
- package/cli/dist/lib/config.js +20 -29
- package/cli/dist/lib/local-test.js +3 -19
- package/cli/dist/lib/paths.js +11 -0
- package/cli/dist/lib/resolveNpmSpawn.d.ts +20 -0
- package/cli/dist/lib/resolveNpmSpawn.js +71 -0
- package/cli/dist/lib/template-engine/context/pluginPackageJsonData.js +21 -19
- package/cli/dist/lib/template-engine/context/standVitePackageJsonData.js +7 -8
- package/cli/dist/lib/template-engine/resolveVariantDir.d.ts +5 -1
- package/cli/dist/lib/template-engine/resolveVariantDir.js +22 -0
- package/cli/dist/lib/templates/shared/i18n.js +2 -2
- package/cli/dist/lib/templates/shared/paths.js +3 -4
- package/cli/dist/lib/types/package-config.d.ts +1 -0
- package/cli/lib/cli/project.ts +2 -18
- package/cli/lib/config.ts +19 -30
- package/cli/lib/local-test.ts +3 -22
- package/cli/lib/paths.ts +15 -0
- package/cli/lib/resolveNpmSpawn.ts +72 -0
- package/cli/lib/template-engine/buildStandIndexHtml.test.ts +1 -0
- package/cli/lib/template-engine/context/pluginPackageJsonData.ts +23 -23
- package/cli/lib/template-engine/context/standVitePackageJsonData.ts +7 -12
- package/cli/lib/template-engine/pluginEtaParity.test.ts +1 -0
- package/cli/lib/template-engine/resolveVariantDir.ts +22 -0
- package/cli/lib/template-engine/standAdvancedViteDevHostEta.test.ts +4 -3
- package/cli/lib/template-engine/standWebpackDevHostEta.test.ts +7 -6
- package/cli/lib/templates/shared/i18n.ts +2 -2
- package/cli/lib/templates/shared/paths.ts +3 -4
- package/cli/lib/types/package-config.ts +1 -0
- package/cli/package.json +1 -1
- package/cli/project-templates/plugin/assets/vite/{plugin-build.config.mjs → plugin-build.config.ts} +7 -5
- package/cli/project-templates/plugin/assets/vite/{sandbox-build.config.mjs → sandbox-build.config.ts} +7 -5
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.legacy.module.cjs → plugin-build.legacy.module.ts} +20 -7
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.legacy.umd.cjs → plugin-build.legacy.umd.ts} +20 -7
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.modern.module.cjs → plugin-build.modern.module.ts} +9 -4
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.modern.umd.cjs → plugin-build.modern.umd.ts} +9 -4
- package/cli/project-templates/plugin/assets/webpack/{sandbox-build.config.cjs → sandbox-build.config.ts} +13 -3
- package/cli/project-templates/plugin/bundler-vite/release.html.eta +1 -0
- package/cli/project-templates/plugin/bundler-webpack/public/release.html.eta +1 -0
- package/cli/project-templates/plugin/shared-base/public/demo/product-1.svg +10 -0
- package/cli/project-templates/plugin/shared-base/public/demo/product-2.svg +10 -0
- package/cli/project-templates/plugin/shared-base/scripts/build-runner.ts +22 -0
- package/cli/project-templates/plugin/shared-base/scripts/build-types.ts +17 -0
- package/cli/project-templates/plugin/shared-base/scripts/clean.ts +16 -0
- package/cli/project-templates/plugin/shared-base/scripts/dev-runner.ts +52 -0
- package/cli/project-templates/plugin/shared-base/scripts/npmRun.ts +61 -0
- package/cli/project-templates/plugin/shared-base/scripts/release-runner.ts +18 -0
- package/cli/project-templates/plugin/shared-base/scripts/scriptRuntime.ts +10 -0
- package/cli/project-templates/plugin/shared-base/src/dev/hostApp.tsx.eta +1 -0
- package/cli/project-templates/plugin/shared-base/src/dev-release.tsx.eta +1 -0
- package/cli/project-templates/plugin/shared-base/src/dev.tsx.eta +1 -1
- package/cli/project-templates/shared/partials/plugin-dev-host-app-advanced.eta +93 -0
- package/cli/project-templates/shared/partials/plugin-dev-host-app-minimal.eta +54 -0
- package/cli/project-templates/shared/partials/plugin-dev-tsx-advanced.eta +3 -2
- package/cli/project-templates/shared/partials/plugin-dev-tsx-debug.eta +18 -0
- package/cli/project-templates/shared/partials/plugin-dev-tsx-release.eta +33 -0
- package/cli/project-templates/shared/partials/plugin-dev-tsx-runtime-helpers.eta +8 -8
- package/cli/project-templates/shared/partials/plugin-index-ts.eta +0 -1
- package/cli/project-templates/shared/partials/plugin-vite-dev-host.eta +9 -5
- package/cli/project-templates/shared/partials/plugin-vite-plugin-build.eta +7 -5
- package/cli/project-templates/shared/partials/plugin-vite-release-html.eta +12 -0
- package/cli/project-templates/shared/partials/plugin-vite-sandbox-build.eta +7 -5
- package/cli/project-templates/shared/partials/plugin-webpack-dev-host-legacy.eta +12 -5
- package/cli/project-templates/shared/partials/plugin-webpack-dev-host-modern.eta +13 -6
- package/cli/project-templates/shared/partials/plugin-webpack-release-html.eta +12 -0
- package/cli/project-templates/shared/partials/plugin-webpack-sandbox-build.eta +13 -3
- package/cli/project-templates/shared/partials/plugin-wp-legacy-module.eta +28 -10
- package/cli/project-templates/shared/partials/plugin-wp-legacy-umd.eta +28 -10
- package/cli/project-templates/shared/partials/plugin-wp-modern-module.eta +9 -4
- package/cli/project-templates/shared/partials/plugin-wp-modern-umd.eta +9 -4
- package/cli/project-templates/shared/partials/stand-dev-host-vite-memory.eta +3 -3
- package/cli/project-templates/shared/partials/stand-dev-host-vite-subpath.eta +8 -4
- package/cli/project-templates/shared/partials/stand-dev-host-vite-umd.eta +5 -5
- package/cli/project-templates/shared/partials/stand-dev-host-vite.eta +3 -3
- package/cli/project-templates/shared/partials/stand-dev-host-webpack-subpath.eta +8 -4
- package/cli/project-templates/shared/partials/stand-dev-host-webpack-umd.eta +9 -3
- package/cli/project-templates/shared/partials/stand-dev-host-webpack.eta +8 -4
- package/cli/project-templates/shared/partials/stand-dev-storage-middleware.eta +370 -0
- package/cli/project-templates/shared/stand-vite-base/config/lib/createViteStandConfig.ts +80 -0
- package/cli/project-templates/shared/stand-vite-base/scripts/devStorageMiddleware.ts.eta +1 -0
- package/cli/project-templates/shared/stand-webpack-base/config/lib/{createWebpackStandConfig.cjs → createWebpackStandConfig.ts} +31 -19
- package/cli/project-templates/{stand/advanced/umd/vite/config/lib/umdServeMiddleware.mjs → shared/stand-webpack-base/config/lib/umdServeMiddleware.ts} +19 -11
- package/cli/project-templates/shared/stand-webpack-base/scripts/devStorageMiddleware.ts.eta +1 -0
- package/cli/project-templates/stand/advanced/memory-usage/vite/config/lib/{createMemoryUsageStandConfig.mjs → createMemoryUsageStandConfig.ts} +25 -20
- package/cli/project-templates/stand/advanced/umd/vite/config/lib/umdServeMiddleware.ts +68 -0
- package/cli/project-templates/stand/react-adapter/webpack/README.md.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/config/dev-host.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/package.json.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/public/index.html.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/editorConfig.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/email.html.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/getAuthToken.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/oauthCredentials.ts +9 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/storageProvider.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/index.tsx.eta +1 -0
- package/cli/scripts/cli-matrix-smoke.ts +19 -10
- package/cli/scripts/verify-global-cli.ts +1 -1
- package/cli/scripts/vite-plugin-version-matrix.ts +299 -0
- package/cli/tsconfig.json +2 -2
- package/emailmaker-core.aa9efbce.js +1 -0
- package/emailmaker-esm.js +788 -153
- package/emailmaker.d.ts +32 -0
- package/emailmaker.js +4 -4
- package/iframe/js/amp.BGJMqoms.js +1 -1
- package/iframe/js/chunk.oX6nCJbK.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.BSaCN7eK.js +1 -1
- package/iframe/js/sanitize-html.Dy7Uwo8P.js +1 -1
- package/images/integrations/activecampaign.svg +4 -0
- package/images/integrations/bento.svg +9 -0
- package/images/integrations/brevo.svg +7 -0
- package/images/integrations/campaign_monitor.svg +10 -0
- package/images/integrations/constant_contact.svg +24 -0
- package/images/integrations/dotdigital.svg +144 -0
- package/images/integrations/getresponse.svg +23 -0
- package/images/integrations/hubspot.svg +3 -0
- package/images/integrations/klaviyo.svg +10 -0
- package/images/integrations/mailchimp.svg +9 -0
- package/images/integrations/salesforce.svg +20 -0
- package/js/browser-image-compression.js +9 -0
- package/package.json +2 -5
- package/runtime/@ant-design/cssinjs/index.js +1 -1
- package/runtime/@ant-design/icons/index.js +1 -1
- package/runtime/@ant-design/pro-layout/index.js +1 -1
- package/runtime/README.md +13 -13
- package/runtime/antd/index.js +1 -1
- package/runtime/app-core/index.js +1 -2
- package/runtime/classnames/index.js +1 -1
- package/runtime/core/index.js +6 -6
- package/runtime/dayjs/index.js +1 -1
- package/runtime/di/index.js +1 -2
- package/runtime/disposable/index.js +1 -2
- package/runtime/errors-runtime/index.js +1 -2
- package/runtime/guid/index.js +1 -2
- package/runtime/index.js +2 -4
- package/runtime/package.json +2 -3
- package/runtime/prop-types/index.js +1 -1
- package/runtime/react/index.js +1 -1
- package/runtime/react/jsx-dev-runtime/index.js +1 -1
- package/runtime/react/jsx-runtime/index.js +1 -1
- package/runtime/react-dom/client/index.js +1 -1
- package/runtime/react-dom/index.js +1 -1
- package/runtime/react-router-dom/index.js +1 -1
- package/runtime/uuid/index.js +1 -1
- package/static/amd/{8fc2a596.js → 19aeb269.js} +88 -88
- package/static/core/192ec827.js +1 -0
- package/static/core/22c1de2e2.js +1 -0
- package/static/core/24faedf0.js +1 -0
- package/static/core/29231645.js +1 -0
- package/static/core/2a3177fc2.js +1 -0
- package/static/core/346aabd2.js +3 -0
- package/static/core/3b800ed6.js +1 -0
- package/static/core/3e840e90.js +1 -0
- package/static/core/40cc9fd7.js +1 -0
- package/static/core/421bdec22.js +1 -0
- package/static/core/4aaa358b2.js +903 -0
- package/static/core/50ff48bc.js +4 -0
- package/static/core/5282795d2.js +6 -0
- package/static/core/563a283d.js +1 -0
- package/static/core/5d47e095.js +47 -0
- package/static/core/5f574386.js +1 -0
- package/static/core/67a41193.js +1 -0
- package/static/core/698dace4.js +7 -0
- package/static/core/6b648e2d.js +1 -0
- package/static/core/7629adfd.js +1 -0
- package/static/core/7717f2932.js +3 -0
- package/static/core/776cb34a.js +1 -0
- package/static/core/78a1e31e.js +1 -0
- package/static/core/7d56d643.js +1 -0
- package/static/core/841752212.js +40 -0
- package/static/core/8477e97e.js +1 -0
- package/static/core/8756d562.js +1 -0
- package/static/core/91d328d8.js +1 -0
- package/static/core/9270dbb6.js +6 -0
- package/static/core/96371334.js +566 -0
- package/static/core/9b9ddaef2.js +168 -0
- package/static/core/af1da4b4.js +1 -0
- package/static/core/b5096b152.js +471 -0
- package/static/core/bde6775a.js +1 -0
- package/static/core/bf1b888c.js +4 -0
- package/static/core/cec8d739.js +11 -0
- package/static/core/cf45bf332.js +598 -0
- package/static/core/cfac3d32.js +1 -0
- package/static/core/d21c95cf2.js +1 -0
- package/static/core/dbd9ca52.js +1 -0
- package/static/core/dc590181.js +1 -0
- package/static/core/e0039d55.js +1 -0
- package/static/core/e4071c1a.js +4 -0
- package/static/core/ef87b75c.js +41 -0
- package/static/core/f47701f32.js +20 -0
- package/static/core/f83d7ac42.js +3 -0
- package/static/core/fcc67e6b.js +1 -0
- package/static/core/fd40d85c.js +1 -0
- package/static/core/fe638847.js +1 -0
- package/static/esm/{e8401d17.js → 203c9644.js} +3 -3
- package/static/esm/4b679053.js +27 -0
- package/static/esm/{b273a6c2.js → f31a26c6.js} +1 -1
- package/static/runtime/disposable-CD74igiJ.js +1 -0
- package/static/runtime/guid-C0wuVR8v.js +1 -0
- package/vite/index.d.ts +17 -6
- package/vite/index.js +315 -270
- package/vite/pluginDev/index.d.ts +10 -19
- package/vite/pluginDev/index.js +251 -204
- package/webpack/index.d.ts +24 -5
- package/webpack/index.js +168 -144
- package/webpack/pluginDev/index.d.ts +21 -22
- package/webpack/pluginDev/index.js +242 -177
- package/cli/dist/lib/template-engine/buildStandIndexHtml.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/buildStandIndexHtml.test.js +0 -89
- package/cli/dist/lib/template-engine/emitEtaTree.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/emitEtaTree.test.js +0 -34
- package/cli/dist/lib/template-engine/pluginEtaParity.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/pluginEtaParity.test.js +0 -105
- package/cli/dist/lib/template-engine/resolveVariantDir.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/resolveVariantDir.test.js +0 -52
- package/cli/dist/lib/template-engine/standAdvancedViteDevHostEta.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/standAdvancedViteDevHostEta.test.js +0 -67
- package/cli/dist/lib/template-engine/standWebpackDevHostEta.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/standWebpackDevHostEta.test.js +0 -83
- package/cli/dist/lib/template-engine/storageProviderEta.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/storageProviderEta.test.js +0 -26
- package/cli/project-templates/plugin/shared-base/scripts/build-types.cjs +0 -8
- package/cli/project-templates/plugin/shared-base/scripts/clean.cjs +0 -6
- package/cli/project-templates/plugin/shared-base/scripts/dev-runner.cjs +0 -48
- package/cli/project-templates/plugin/shared-base/scripts/release-runner.cjs +0 -63
- package/cli/project-templates/shared/stand-vite-base/config/lib/createViteStandConfig.mjs +0 -80
- package/cli/project-templates/shared/stand-vite-base/scripts/devStorageMiddleware.cjs +0 -235
- package/cli/project-templates/shared/stand-webpack-base/config/lib/umdServeMiddleware.cjs +0 -38
- package/cli/project-templates/shared/stand-webpack-base/scripts/devStorageMiddleware.cjs +0 -235
- package/emailmaker-core.80d62b88.js +0 -569
- package/runtime/_core/app-core/index.js +0 -1
- package/runtime/_core/chunks/app-core-DphKKh8f.js +0 -1
- package/runtime/_core/chunks/chunk-oqAt0Dze.js +0 -1
- package/runtime/_core/chunks/di-BHUzE57z.js +0 -1
- package/runtime/_core/chunks/disposable-PhM3rJkj.js +0 -1
- package/runtime/_core/chunks/errors-runtime-VjCOXaQX.js +0 -1
- package/runtime/_core/chunks/guid-D2-FTZQG.js +0 -1
- package/runtime/_core/di/index.js +0 -1
- package/runtime/_core/disposable/index.js +0 -1
- package/runtime/_core/errors-runtime/index.js +0 -1
- package/runtime/_core/guid/index.js +0 -1
- package/runtime/_core/index.js +0 -1
- package/shared/hostBootstrap.js +0 -47
- package/shared/pluginDevOptions.js +0 -31
- package/shared/runtimeManifest.js +0 -72
- package/shared/stringCase.js +0 -16
- package/static/core/2360f32a.js +0 -3
- package/static/core/2687db56.js +0 -3
- package/static/core/2b250af6.js +0 -1261
- package/static/core/3469930c.js +0 -302
- package/static/core/34ce9042.js +0 -201
- package/static/core/4091ba5b.js +0 -25
- package/static/core/41ce3a6a.js +0 -173
- package/static/core/4ac4908c.js +0 -2213
- package/static/core/519096c1.js +0 -2597
- package/static/core/5fa1772b.js +0 -116550
- package/static/core/61312909.js +0 -3
- package/static/core/62a98c07.js +0 -75301
- package/static/core/6309c0f2.js +0 -3
- package/static/core/68d9f440.js +0 -3
- package/static/core/73b645ab.js +0 -2
- package/static/core/81019351.js +0 -280
- package/static/core/835b37ef.js +0 -591
- package/static/core/91242fb3.js +0 -3
- package/static/core/972b15b0.js +0 -92399
- package/static/core/974ef468.js +0 -493
- package/static/core/a17614422.js +0 -38078
- package/static/core/a2fa7b5b.js +0 -4232
- package/static/core/a513adfd.js +0 -89857
- package/static/core/a7c73a9b.js +0 -3813
- package/static/core/b64c7c90.js +0 -228
- package/static/core/cdc9ba92.js +0 -4711
- package/static/core/d1db685d.js +0 -2193
- package/static/core/d661febc.js +0 -3
- package/static/core/d6d2d2d0.js +0 -23
- package/static/core/df1a1225.js +0 -607
- package/static/core/e5bff179.js +0 -1302
- package/static/core/e5d602f5.js +0 -2
- package/static/core/eb029366.js +0 -1532
- package/static/core/f46c035a.js +0 -2
- package/static/core/f8b9d89a.js +0 -461
- package/static/core/fd897ad7.js +0 -3
- package/static/core/fdd890c7.js +0 -6168
- package/static/esm/29eb18ff.js +0 -164
- package/vite/mime-types.js +0 -179
- package/vite/utils.js +0 -44
- /package/cli/project-templates/plugin/bundler-vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-vite/config/{plugin-build.mjs.eta → plugin-build.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-vite/config/{sandbox-build.mjs.eta → sandbox-build.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-webpack/config/{plugin-build.cjs.eta → plugin-build.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-webpack/config/{sandbox-build.cjs.eta → sandbox-build.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/memory-usage/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/shadow-dom/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/shadow-dom/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/subpath/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/subpath/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/umd/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/umd/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/closed-loop/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/closed-loop/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/oauth/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/oauth/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/react-adapter/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/iframe/{iframe-eblock.80d62b88.html → iframe-eblock.aa9efbce.html} +0 -0
- /package/iframe/{iframe.80d62b88.html → iframe.aa9efbce.html} +0 -0
- /package/{runtime/chunks → static/runtime}/DownloadOutlined-a2ZUz7zB.js +0 -0
- /package/{runtime/chunks → static/runtime}/chunk-D-iEO58U.js +0 -0
- /package/{runtime/chunks → static/runtime}/classnames-DBEldvch.js +0 -0
- /package/{runtime/chunks → static/runtime}/client-5XqXGmAI.js +0 -0
- /package/{runtime/chunks → static/runtime}/dayjs.min-CO3mzOeV.js +0 -0
- /package/{runtime/_core/chunks/defineProperty-BGJFuFMq.js → static/runtime/defineProperty-CGNmw-jw.js} +0 -0
- /package/{runtime/chunks → static/runtime}/dist-Cns8cA2n.js +0 -0
- /package/{runtime/chunks → static/runtime}/dist-Ct0xRt3Y.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-0FFT3fCz.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-BwJ3eGbx.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-D8EsVtRL.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-Da4O25Kw.js +0 -0
- /package/{runtime/chunks → static/runtime}/jsx-dev-runtime-V4_MuHNS.js +0 -0
- /package/{runtime/chunks → static/runtime}/jsx-runtime-DBeCoE0b.js +0 -0
- /package/{runtime/chunks → static/runtime}/objectWithoutProperties-Bk0EDksJ.js +0 -0
- /package/{runtime/chunks → static/runtime}/prop-types-DxD5wgQ0.js +0 -0
- /package/{runtime/chunks → static/runtime}/react-TEeeBWTl.js +0 -0
- /package/{runtime/chunks → static/runtime}/react-dom-BKKa1g6U.js +0 -0
package/static/core/835b37ef.js
DELETED
|
@@ -1,591 +0,0 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.setAttribute(`data-emailmaker`,`true`),e.appendChild(document.createTextNode(`.monaco-editor{width:100%;height:100%}.monaco-editor .monaco-hover{border-radius:6px}.monaco-editor .monaco-editor .scroll-decoration{box-shadow:none}.monaco-editor,.monaco-editor *,.monaco-editor .view-lines,.monaco-editor .view-lines *,.monaco-editor .view-lines .view-line,.monaco-editor .view-lines .monaco-mouse-cursor-text,.monaco-editor .view-line,.monaco-editor .monaco-mouse-cursor-text{font-family:var(--monaco-editor-font-family,"Source Code Pro", Consolas, "Courier New", monospace)!important}.monaco-editor .view-line,.monaco-editor .view-line span,.monaco-editor .view-line span.inline-selected-text{font-variant-ligatures:none;font-feature-settings:"liga" 0, "calt" 0;font-kerning:none;white-space:pre;font-family:var(--monaco-monospace-font,var(--monaco-editor-font-family,"Source Code Pro", Consolas, "Courier New", monospace))!important;font-size:var(--monaco-editor-font-size,14px)!important;font-weight:400!important}.blocks-app .colorpicker-body .saturation-box,.blocks-app .colorpicker-body .strip{border-radius:4px}.blocks-app .scrollbar.vertical{width:5px!important}.blocks-app .scrollbar.vertical .slider{border-radius:5px!important;width:5px!important}.blocks-app .user-cursor{z-index:10;border-left:2px solid #ff00e1;width:2px;height:20px;position:absolute}.blocks-app .cursor-hover{color:#fff;text-wrap-mode:nowrap;z-index:10000;border-radius:7px 7px 7px 0;margin-left:-2px;padding:0 5px;font-size:12px;position:absolute;top:-17px}.blocks-app .user-selection-decoration{background-color:#8080eb4d}.monaco-editor__spin{z-index:1000;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { s as e } from "./d6d2d2d0.js";
|
|
2
|
-
import "./4091ba5b.js";
|
|
3
|
-
import { Bt as t, Ft as n, I as r, K as i, P as a, g as o, j as s, q as c, v as l } from "./cdc9ba92.js";
|
|
4
|
-
import { I as u, h as d, m as f, w as p } from "./4ac4908c.js";
|
|
5
|
-
import { a as m, i as ee, n as h, r as g, t as _, v } from "./a513adfd.js";
|
|
6
|
-
import { i as y, r as b } from "./a2fa7b5b.js";
|
|
7
|
-
import { d as x, l as S } from "./972b15b0.js";
|
|
8
|
-
import { M as te, i as ne, r as re, v as C } from "./34ce9042.js";
|
|
9
|
-
import "./5fa1772b.js";
|
|
10
|
-
import { S as w, b as T, h as E, i as D, v as O, vt as k, w as A } from "./df1a1225.js";
|
|
11
|
-
import { D as j, I as M, N, _ as P, a as F, c as I, f as L, i as R, m as z, r as ie, s as B, t as ae, u as oe, x as V } from "./81019351.js";
|
|
12
|
-
import { i as H, n as U, r as se } from "./a7c73a9b.js";
|
|
13
|
-
//#region src/helpers/monaco/overrideContribution.ts
|
|
14
|
-
var ce = /* @__PURE__ */ e(g()), W = /* @__PURE__ */ e(t());
|
|
15
|
-
function G(e, t) {
|
|
16
|
-
let n = v.getEditorContributions().find((t) => t.id === e);
|
|
17
|
-
if (!n) throw Error(`No contribution ${e}`);
|
|
18
|
-
n.ctor = t(n);
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/helpers/monaco/colorDetector.js
|
|
22
|
-
var K = 100, q = 500, J = !1;
|
|
23
|
-
function Y(e) {
|
|
24
|
-
return class extends e {
|
|
25
|
-
_editor;
|
|
26
|
-
constructor(e, t, n, r) {
|
|
27
|
-
super(e, t, n, r), this._editor = e;
|
|
28
|
-
}
|
|
29
|
-
_onScrollDisposable = null;
|
|
30
|
-
updateColorDecorators(e) {
|
|
31
|
-
if (this._onScrollDisposable &&= (this._onScrollDisposable.dispose(), null), e.length >= q) {
|
|
32
|
-
let t = this._editor, [n, r] = [Number.MAX_VALUE, Number.MIN_VALUE], i = () => {
|
|
33
|
-
let [i, a] = t.getVisibleRanges().reduce((e, { startLineNumber: t, endLineNumber: n }) => [Math.min(t, e[0]), Math.max(n, e[1])], [Number.MAX_VALUE, Number.MIN_VALUE]);
|
|
34
|
-
if (n - i > K || a - r > K) {
|
|
35
|
-
let t = e.filter(({ colorInfo: e }) => {
|
|
36
|
-
let { startLineNumber: t, endLineNumber: n } = e.range;
|
|
37
|
-
return i - t < K && n - a < K;
|
|
38
|
-
});
|
|
39
|
-
super.updateColorDecorators(t);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
this._onScrollDisposable = t.onDidScrollChange(i), i();
|
|
43
|
-
} else super.updateColorDecorators(e);
|
|
44
|
-
}
|
|
45
|
-
dispose() {
|
|
46
|
-
this._onScrollDisposable?.dispose(), super.dispose();
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function le() {
|
|
51
|
-
J || (J = !0, import("./e5d602f5.js").then(({ ColorDetector: e }) => {
|
|
52
|
-
let t = Y(e);
|
|
53
|
-
t.ID = e.ID, G(t.ID, () => t);
|
|
54
|
-
}).catch((e) => {}));
|
|
55
|
-
}
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/modules/components/CollaborateEditor/helpers.ts
|
|
58
|
-
var ue = (e, t) => (Z(), de(e.user.color, t), e.cursor ? [{
|
|
59
|
-
range: new M.Range(e.cursor.lineNumber, e.cursor.column, e.cursor.lineNumber, e.cursor.column),
|
|
60
|
-
options: {
|
|
61
|
-
className: `applyColorToThis backgroundPrefix-${e.user.color.slice(1)}`,
|
|
62
|
-
afterContentClassName: "cursor-hover",
|
|
63
|
-
beforeContentClassName: "",
|
|
64
|
-
style: `--cursor-color: ${e.user.color};`
|
|
65
|
-
}
|
|
66
|
-
}] : []), X = (e) => e.selection ? [{
|
|
67
|
-
range: new M.Range(e.selection.startLineNumber, e.selection.startColumn, e.selection.endLineNumber, e.selection.endColumn),
|
|
68
|
-
options: { className: "user-selection-decoration" }
|
|
69
|
-
}] : [], Z = () => {
|
|
70
|
-
let e = document.styleSheets[0];
|
|
71
|
-
Array.from(e.cssRules).some((e) => e.cssText.includes(".applyColorToThis")) || e.insertRule(".applyColorToThis {\n border-left: 2px solid var(--cursor-color, #000);\n color: var(--cursor-color, #000);\n }", e.cssRules.length);
|
|
72
|
-
}, de = (e, t) => {
|
|
73
|
-
let n = `backgroundPrefix-${e.slice(1)}`, r = document.styleSheets[0];
|
|
74
|
-
Array.from(r.cssRules).some((e) => e.cssText.includes(`.${n}`)) || r.insertRule(`.${n} { --cursor-color: ${e === t.color ? "#000000" : e}; }`, r.cssRules.length);
|
|
75
|
-
}, fe = (e, t, n, r, i) => {
|
|
76
|
-
for (let a = 0; a < e.length; a++) {
|
|
77
|
-
let o = e[a], s = o.className.split(" ");
|
|
78
|
-
for (let e of s) if (e.startsWith(t)) {
|
|
79
|
-
let a = `#${e.replace(t, "")}`, s = r.find((e) => e.user.color === a);
|
|
80
|
-
s && (n && a !== i?.color ? Q(o, a, s?.user?.name?.first_name ? `${s?.user?.name?.first_name} ${s?.user?.name?.last_name}`.replace(/[\n\r]/g, "") : s.user.name.email.split("@")[0]) : o.style.backgroundColor = a);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}, Q = (e, t, n) => {
|
|
84
|
-
if (!e.textContent) {
|
|
85
|
-
let r = document.createElement("div");
|
|
86
|
-
r.style.background = t, r.style.color = "#fff", r.textContent = n, r.className = "cursor-hover", e.appendChild(r);
|
|
87
|
-
}
|
|
88
|
-
}, pe = (e, t, n, r, i, a) => {
|
|
89
|
-
if (r) return;
|
|
90
|
-
i(!0);
|
|
91
|
-
let o = e.flatMap((e) => [...ue(e, a), ...X(e)]);
|
|
92
|
-
n.current = t.deltaDecorations(n.current, o.map((e) => ({
|
|
93
|
-
range: e.range,
|
|
94
|
-
options: e.options
|
|
95
|
-
}))), fe(document.getElementsByClassName("applyColorToThis"), "backgroundPrefix-", !0, e, a), i(!1);
|
|
96
|
-
}, me = (e, t) => {
|
|
97
|
-
t.setLocalStateField("cursor", e.position);
|
|
98
|
-
}, he = (e, t) => {
|
|
99
|
-
let n = e.selection;
|
|
100
|
-
t.setLocalStateField("selection", {
|
|
101
|
-
startLineNumber: n.startLineNumber,
|
|
102
|
-
startColumn: n.startColumn,
|
|
103
|
-
endLineNumber: n.endLineNumber,
|
|
104
|
-
endColumn: n.endColumn
|
|
105
|
-
});
|
|
106
|
-
}, ge = (e, t) => e.filter((e) => e.user.color !== t.color), _e = () => {
|
|
107
|
-
let e = (e, t, n) => e > 100 && t > 50 && t < 150 && n < 100, t = (e, t, n) => {
|
|
108
|
-
let r = (e) => {
|
|
109
|
-
let t = e / 255;
|
|
110
|
-
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
111
|
-
}, i = r(e), a = r(t), o = r(n);
|
|
112
|
-
return .2126 * i + .7152 * a + .0722 * o;
|
|
113
|
-
}, n = (e, n, r) => {
|
|
114
|
-
let i = t(255, 255, 255), a = t(e, n, r);
|
|
115
|
-
return (i + .05) / (a + .05) >= 4.5;
|
|
116
|
-
}, r;
|
|
117
|
-
do {
|
|
118
|
-
let t = Math.floor(Math.random() * 206 + 50), i = Math.floor(Math.random() * 206 + 50), a = Math.floor(Math.random() * 206 + 50);
|
|
119
|
-
t + i + a >= 400 && !e(t, i, a) && n(t, i, a) && (r = `#${(t << 16 | i << 8 | a).toString(16).padStart(6, "0")}`);
|
|
120
|
-
} while (!r);
|
|
121
|
-
return r;
|
|
122
|
-
}, ve = ({ CHECK_INTERVAL: e, SLEEP_THRESHOLD: t, provider: n, handleOfflineCollaboration: r, isNewEmailGeneration: i, saveEmailFromEditor: a }) => {
|
|
123
|
-
let o = Date.now();
|
|
124
|
-
return setInterval(() => {
|
|
125
|
-
let e = Date.now(), r = e - o;
|
|
126
|
-
r > t && n && (a(), window.location.reload(), window.location.reload()), r < t && !n && document.visibilityState, o = e;
|
|
127
|
-
}, e);
|
|
128
|
-
};
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region src/modules/components/CollaborateEditor/hooks/useSaveEmailFromCurrentEditor.ts
|
|
131
|
-
function ye(e, t) {
|
|
132
|
-
let [n] = f(), r = b(p);
|
|
133
|
-
return { saveEmailFromEditor: (0, W.useCallback)(() => {
|
|
134
|
-
let a = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " "), o = i.isPlugin ? r : e.project, s = {
|
|
135
|
-
parent: e?.id,
|
|
136
|
-
title: e.title,
|
|
137
|
-
author: e.author,
|
|
138
|
-
project: o,
|
|
139
|
-
html: t?.getValue() || "",
|
|
140
|
-
excerpt: a,
|
|
141
|
-
subject: e.subject,
|
|
142
|
-
preheader: e.preheader,
|
|
143
|
-
common_styles: e.common_styles,
|
|
144
|
-
parent_email: e.parent_email
|
|
145
|
-
};
|
|
146
|
-
n({
|
|
147
|
-
emailId: e?.id,
|
|
148
|
-
body: s
|
|
149
|
-
}).catch((e) => {});
|
|
150
|
-
}, [
|
|
151
|
-
t,
|
|
152
|
-
e,
|
|
153
|
-
r,
|
|
154
|
-
n
|
|
155
|
-
]) };
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region src/modules/components/CollaborateEditor/hooks/useKeyPress.ts
|
|
159
|
-
var be = () => {
|
|
160
|
-
let [e, t] = (0, W.useState)(!1);
|
|
161
|
-
return (0, W.useEffect)(() => {
|
|
162
|
-
let e = navigator.platform.toUpperCase().includes("MAC"), n = (n) => {
|
|
163
|
-
let r = (e ? n.metaKey : n.ctrlKey) && n.code === "KeyZ", i = r && n.shiftKey;
|
|
164
|
-
(r || i) && (t(!0), n.preventDefault());
|
|
165
|
-
}, r = () => {
|
|
166
|
-
t(!1);
|
|
167
|
-
}, i = (e) => {
|
|
168
|
-
e.data?.operation === "application_action" && (e.data.action === "undo" || e.data.action === "redo") && (t(!0), setTimeout(() => t(!1), 500));
|
|
169
|
-
};
|
|
170
|
-
return document.addEventListener("keydown", n, !0), document.addEventListener("keyup", r, !0), window.addEventListener("message", i), () => {
|
|
171
|
-
document.removeEventListener("keydown", n, !0), document.removeEventListener("keyup", r, !0), window.removeEventListener("message", i);
|
|
172
|
-
};
|
|
173
|
-
}, []), e;
|
|
174
|
-
}, xe = ({ email: e, editorRef: t, setIsSpin: n, newEmailAiGeneratorRef: r }) => {
|
|
175
|
-
let a = (0, W.useMemo)(() => new H(), []), s = oe(), c = (0, W.useRef)([]), l = (0, W.useRef)([]), u = (0, W.useRef)(!1), f = (0, W.useRef)(0), p = (0, W.useRef)(""), [m, ee] = (0, W.useState)(null), [h, g] = (0, W.useState)(null), [_, v] = (0, W.useState)(!1), [y, x] = (0, W.useState)([]), [S, te] = (0, W.useState)(!1), [ne, re] = (0, W.useState)(!1), C = z(s), w = b(T), { saveEmailFromEditor: E } = ye(e, m), D = (0, W.useRef)(null), [O, k] = (0, W.useState)(!1), [A] = d(), j = e?.id, M = !!(j === "3769995" || i.isPlugin), N = (0, W.useMemo)(() => ({
|
|
176
|
-
name: {
|
|
177
|
-
first_name: M ? w?.username : w?.first_name,
|
|
178
|
-
last_name: M ? "" : w?.last_name,
|
|
179
|
-
email: w?.email
|
|
180
|
-
},
|
|
181
|
-
color: _e()
|
|
182
|
-
}), [w, M]), P = (0, W.useMemo)(() => ge(y, N), [N, y]), F = (0, W.useCallback)(() => {
|
|
183
|
-
h && (h?.destroy(), g(null));
|
|
184
|
-
}, [h]), L = (0, W.useCallback)(() => {
|
|
185
|
-
try {
|
|
186
|
-
E();
|
|
187
|
-
} catch (e) {
|
|
188
|
-
console.error(e);
|
|
189
|
-
}
|
|
190
|
-
}, [E]), R = (0, W.useCallback)(async (e) => {
|
|
191
|
-
try {
|
|
192
|
-
return await A({
|
|
193
|
-
emailId: j,
|
|
194
|
-
source: "editor",
|
|
195
|
-
html: e
|
|
196
|
-
}).unwrap(), !0;
|
|
197
|
-
} catch (e) {
|
|
198
|
-
return console.error("Failed to save email:", e), !1;
|
|
199
|
-
}
|
|
200
|
-
}, [j, A]), ae = (0, W.useCallback)(async (e) => {
|
|
201
|
-
if (await R(e) && O) {
|
|
202
|
-
let e = setTimeout(() => {
|
|
203
|
-
k(!1);
|
|
204
|
-
}, 0);
|
|
205
|
-
return () => clearTimeout(e);
|
|
206
|
-
}
|
|
207
|
-
}, [
|
|
208
|
-
R,
|
|
209
|
-
k,
|
|
210
|
-
O
|
|
211
|
-
]);
|
|
212
|
-
(0, W.useEffect)(() => {
|
|
213
|
-
!j || !o.isEditor || (y.length === 1 && f.current > 1 && h && L(), f.current = y.length);
|
|
214
|
-
}, [
|
|
215
|
-
y.length,
|
|
216
|
-
h,
|
|
217
|
-
L
|
|
218
|
-
]), (0, W.useEffect)(() => {
|
|
219
|
-
if (!j || !o.isEditor || O) return;
|
|
220
|
-
let e = new se(I, M ? `${j}-plugin` : `${j}-collaborate`, a);
|
|
221
|
-
return g(e), e.awareness.setLocalStateField("user", N), () => {
|
|
222
|
-
e?.destroy(), a?.destroy();
|
|
223
|
-
};
|
|
224
|
-
}, [
|
|
225
|
-
a,
|
|
226
|
-
N,
|
|
227
|
-
M,
|
|
228
|
-
j,
|
|
229
|
-
O
|
|
230
|
-
]);
|
|
231
|
-
let V = (0, W.useCallback)((e) => {
|
|
232
|
-
if (!u.current) {
|
|
233
|
-
u.current = !0;
|
|
234
|
-
try {
|
|
235
|
-
let t = l.current, n = Array.from(e.getStates().values());
|
|
236
|
-
(n.length > 1 || n.length !== t.length) && (x(n), requestAnimationFrame(() => {
|
|
237
|
-
pe(n, m, c, _, v, N);
|
|
238
|
-
})), l.current = n;
|
|
239
|
-
} finally {
|
|
240
|
-
u.current = !1;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}, [
|
|
244
|
-
m,
|
|
245
|
-
c,
|
|
246
|
-
_,
|
|
247
|
-
v,
|
|
248
|
-
N
|
|
249
|
-
]);
|
|
250
|
-
(0, W.useEffect)(() => {
|
|
251
|
-
if (!h || !m || !o.isEditor || !t.current || !m.getModel() || O) return;
|
|
252
|
-
let e = null, r = h.awareness, i = a.getText("monaco"), s = async (a) => {
|
|
253
|
-
let o = Array.from(r.getStates().values());
|
|
254
|
-
if (a) {
|
|
255
|
-
if (i._length > 0 && o.length > 1 && !D.current) {
|
|
256
|
-
let e = m?.getModel()?.getValue()?.toString() || "", r = (e) => e.replace(/\s+/g, " ").trim();
|
|
257
|
-
r(e) !== r(i.toString()) && (await ce(t, n), n?.(!1), m.executeEdits("collaboration", [{
|
|
258
|
-
range: m.getModel().getFullModelRange(),
|
|
259
|
-
text: i.toString(),
|
|
260
|
-
forceMoveMarkers: !0
|
|
261
|
-
}]));
|
|
262
|
-
}
|
|
263
|
-
i._length > 0 && o.length === 1 && !D.current && i.applyDelta([{ delete: i._length }, { insert: t.current?.getModel().getValue() }]), i._length === 0 && i.insert(0, t.current?.getModel().getValue()), D.current && i.applyDelta([{ delete: i._length }, { insert: D.current }]), e = new U(i, m?.getModel(), new Set([m]), r), m?.onDidChangeCursorPosition((e) => me(e, r)), m?.onDidChangeCursorSelection((e) => he(e, r)), r.on("change", () => V(r)), D.current = null;
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
return h.on("sync", s), () => {
|
|
267
|
-
e && e.destroy(), h.off("sync", s);
|
|
268
|
-
};
|
|
269
|
-
}, [
|
|
270
|
-
m,
|
|
271
|
-
h,
|
|
272
|
-
a,
|
|
273
|
-
t,
|
|
274
|
-
V,
|
|
275
|
-
n,
|
|
276
|
-
O
|
|
277
|
-
]), (0, W.useEffect)(() => {
|
|
278
|
-
if (!h || !m || !o.isEditor || !t.current || O) return;
|
|
279
|
-
let e = h?.awareness, n = setInterval(() => {
|
|
280
|
-
V(e);
|
|
281
|
-
}, 500);
|
|
282
|
-
return () => clearInterval(n);
|
|
283
|
-
}, [
|
|
284
|
-
h,
|
|
285
|
-
m,
|
|
286
|
-
_,
|
|
287
|
-
t,
|
|
288
|
-
S,
|
|
289
|
-
V,
|
|
290
|
-
F,
|
|
291
|
-
O
|
|
292
|
-
]);
|
|
293
|
-
async function ce(e, t) {
|
|
294
|
-
await new Promise((n) => {
|
|
295
|
-
let r = () => {
|
|
296
|
-
t?.(!0), (e.current?.getModel()?.getValue()?.length || 0) > 0 ? n() : setTimeout(r, 100);
|
|
297
|
-
};
|
|
298
|
-
r();
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
if ((0, W.useEffect)(() => {
|
|
302
|
-
if (!j || !o.isEditor || S) return;
|
|
303
|
-
let e = ve({
|
|
304
|
-
CHECK_INTERVAL: ie,
|
|
305
|
-
SLEEP_THRESHOLD: B,
|
|
306
|
-
provider: h,
|
|
307
|
-
handleOfflineCollaboration: F,
|
|
308
|
-
isNewEmailGeneration: O,
|
|
309
|
-
saveEmailFromEditor: E
|
|
310
|
-
});
|
|
311
|
-
return () => {
|
|
312
|
-
clearInterval(e);
|
|
313
|
-
};
|
|
314
|
-
}, [
|
|
315
|
-
j,
|
|
316
|
-
h,
|
|
317
|
-
S,
|
|
318
|
-
F,
|
|
319
|
-
te,
|
|
320
|
-
O
|
|
321
|
-
]), m && P.length > 0) {
|
|
322
|
-
let e = m?.getModel()?.getValue()?.toString() || "";
|
|
323
|
-
p.current !== e && "clear" in C && C.clear(), p.current = e;
|
|
324
|
-
}
|
|
325
|
-
let G = be() && P.length > 0;
|
|
326
|
-
return (0, W.useEffect)(() => {
|
|
327
|
-
if (!j || !o.isEditor) return;
|
|
328
|
-
let e = setInterval(() => {
|
|
329
|
-
if (r?.current && !O && (F(), k(!0)), !r?.current && O) {
|
|
330
|
-
let e = s?.getValue();
|
|
331
|
-
D.current = e, ae(e);
|
|
332
|
-
}
|
|
333
|
-
}, 300);
|
|
334
|
-
return () => clearInterval(e);
|
|
335
|
-
}, [
|
|
336
|
-
O,
|
|
337
|
-
h,
|
|
338
|
-
j,
|
|
339
|
-
o.isEditor
|
|
340
|
-
]), (0, W.useEffect)(() => {
|
|
341
|
-
if (!j || !o.isEditor) return;
|
|
342
|
-
let e = () => {
|
|
343
|
-
document.visibilityState === "hidden" && E();
|
|
344
|
-
};
|
|
345
|
-
return document.addEventListener("visibilitychange", e), () => {
|
|
346
|
-
document.removeEventListener("visibilitychange", e);
|
|
347
|
-
};
|
|
348
|
-
}, [
|
|
349
|
-
e,
|
|
350
|
-
j,
|
|
351
|
-
o.isEditor
|
|
352
|
-
]), [
|
|
353
|
-
m,
|
|
354
|
-
P,
|
|
355
|
-
ee,
|
|
356
|
-
S,
|
|
357
|
-
G
|
|
358
|
-
];
|
|
359
|
-
}, Se = /* @__PURE__ */ e(x()), $ = S();
|
|
360
|
-
m.config({ monaco: M }), M.languages.html?.htmlDefaults?.options?.format ? M.languages.html.htmlDefaults.options.format.wrapLineLength = 0 : M.languages.onLanguage("html", () => {
|
|
361
|
-
setTimeout(() => {
|
|
362
|
-
M.languages.html?.htmlDefaults?.options?.format && (M.languages.html.htmlDefaults.options.format.wrapLineLength = 0);
|
|
363
|
-
}, 100);
|
|
364
|
-
}), h(M), _(M, ["html"]);
|
|
365
|
-
var { useToken: Ce } = Se.theme, we = "'Source Code Pro', Consolas, 'Courier New', monospace", Te = 14, Ee = ({ email: e, readOnly: t, setOtherUsers: d, newEmailAiGeneratorRef: f }) => {
|
|
366
|
-
let p = oe();
|
|
367
|
-
p.getLanguageId() !== "html" && M.editor.setModelLanguage(p, "html");
|
|
368
|
-
let m = E(n.ON_CODE_VALIDATE_ID), h = k(), g = b(ne), _ = b(j), v = b(re), x = e?.hasOwnProperty("type") ? _ : g, S = b(w), T = y(), I = (0, W.useRef)(null), z = (0, W.useRef)(null), ie = (0, W.useRef)(null), B = (0, W.useRef)([]), H = u(), U = (0, W.useCallback)(() => {
|
|
369
|
-
T(A(!1));
|
|
370
|
-
}, [T]), [se, G] = (0, W.useState)(!1), K = D(), { __: q } = O(), { token: J } = Ce(), [, Y, ue, X, Z] = xe({
|
|
371
|
-
email: e,
|
|
372
|
-
editorRef: z,
|
|
373
|
-
setIsSpin: G,
|
|
374
|
-
newEmailAiGeneratorRef: f
|
|
375
|
-
});
|
|
376
|
-
B.current = Y, (0, W.useEffect)(() => {
|
|
377
|
-
t || d(B.current);
|
|
378
|
-
}, [
|
|
379
|
-
Y?.length,
|
|
380
|
-
d,
|
|
381
|
-
t
|
|
382
|
-
]);
|
|
383
|
-
let de = (0, W.useMemo)(() => () => {
|
|
384
|
-
K.error({ message: q(F) });
|
|
385
|
-
}, [q, K]), fe = (0, W.useMemo)(() => () => {
|
|
386
|
-
K.warning({ message: q(R) });
|
|
387
|
-
}, [q, K]);
|
|
388
|
-
(0, W.useEffect)(() => {
|
|
389
|
-
X && de();
|
|
390
|
-
}, [X, de]), (0, W.useEffect)(() => {
|
|
391
|
-
Z && fe();
|
|
392
|
-
}, [Z, fe]), (0, W.useEffect)(() => U(), [U]), (0, W.useEffect)(() => {
|
|
393
|
-
if (v) {
|
|
394
|
-
let { current: e } = I;
|
|
395
|
-
e && (e.revealRangeInCenterIfOutsideViewport(v), e.setSelection(v));
|
|
396
|
-
}
|
|
397
|
-
}, [v]);
|
|
398
|
-
let Q = (0, W.useCallback)(() => {
|
|
399
|
-
if (I.current) {
|
|
400
|
-
let e = I.current.getDomNode();
|
|
401
|
-
if (e) {
|
|
402
|
-
let t = S.fontFamily || we, n = S.fontSize || Te;
|
|
403
|
-
e.style.setProperty("--monaco-editor-font-family", t, "important"), e.style.setProperty("--monaco-monospace-font", t, "important"), e.style.setProperty("--monaco-editor-font-size", `${n}px`, "important"), e.style.setProperty("font-family", t, "important"), e.style.setProperty("font-size", `${n}px`, "important");
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
}, [S.fontFamily, S.fontSize]);
|
|
407
|
-
(0, W.useEffect)(() => {
|
|
408
|
-
if (Q(), I.current) {
|
|
409
|
-
let e = I.current.getDomNode();
|
|
410
|
-
if (e) {
|
|
411
|
-
let t = new MutationObserver(() => {
|
|
412
|
-
Q();
|
|
413
|
-
});
|
|
414
|
-
return t.observe(e, {
|
|
415
|
-
childList: !0,
|
|
416
|
-
subtree: !0
|
|
417
|
-
}), () => {
|
|
418
|
-
t.disconnect();
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}, [S.fontFamily, Q]);
|
|
423
|
-
let pe = (e) => {
|
|
424
|
-
let { current: t } = I;
|
|
425
|
-
if (t && !t.hasTextFocus()) {
|
|
426
|
-
let n = t.getModel(), r = n.getPositionAt(e.start), i = n.getPositionAt(e.end), a = {
|
|
427
|
-
startColumn: r.column,
|
|
428
|
-
startLineNumber: r.lineNumber,
|
|
429
|
-
endColumn: i.column,
|
|
430
|
-
endLineNumber: i.lineNumber
|
|
431
|
-
};
|
|
432
|
-
t.revealRangeInCenterIfOutsideViewport(a), t.setSelection(a);
|
|
433
|
-
}
|
|
434
|
-
}, me = async (e) => {
|
|
435
|
-
let { current: t } = I;
|
|
436
|
-
if (t) {
|
|
437
|
-
let n = t.getModel();
|
|
438
|
-
h({
|
|
439
|
-
operation: s.UPDATE_EDITOR_POSITION_FROM_EDITOR,
|
|
440
|
-
data: n.getOffsetAt(e)
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
(0, W.useEffect)(() => {
|
|
445
|
-
matchMedia(c).addEventListener("change", (t) => {
|
|
446
|
-
let n = window.localStorage.getItem(r.em_color_scheme), i = t.matches ? l : a;
|
|
447
|
-
e.hasOwnProperty("type") ? T(N(n ? n === "dark" ? `vs-${n}` : a : i === "dark" ? `vs-${i}` : a)) : T(C(n ? n === "dark" ? `vs-${n}` : a : i === "dark" ? `vs-${i}` : a));
|
|
448
|
-
});
|
|
449
|
-
}, [T, e]), (0, W.useEffect)(() => {
|
|
450
|
-
let t = window.localStorage.getItem(r.em_color_scheme), n = matchMedia("(prefers-color-scheme: dark)").matches ? l : a;
|
|
451
|
-
e?.hasOwnProperty("type") ? T(N(t ? t === "dark" ? `vs-${t}` : a : n === "dark" ? `vs-${n}` : a)) : T(C(t ? t === "dark" ? `vs-${t}` : a : n === "dark" ? `vs-${n}` : a));
|
|
452
|
-
}, [T, e]);
|
|
453
|
-
let he = (e, t) => {
|
|
454
|
-
I.current = e, z.current = e, L(), le();
|
|
455
|
-
let n = () => {
|
|
456
|
-
let t = e.getContribution("editor.linkDetector");
|
|
457
|
-
if (!t?.openerService) {
|
|
458
|
-
setTimeout(n, 100);
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
let r = t.openerService, i = r.open.bind(r), a = document.createElement("div");
|
|
462
|
-
r.open = (e) => (a.innerHTML = e, i(a.textContent));
|
|
463
|
-
};
|
|
464
|
-
n();
|
|
465
|
-
let r = new ce.default(e, M, {
|
|
466
|
-
"doctype-html5": !1,
|
|
467
|
-
"html-lang-require": !1,
|
|
468
|
-
"head-script-disabled": !1,
|
|
469
|
-
"style-disabled": !1,
|
|
470
|
-
"script-disabled": !1,
|
|
471
|
-
"attr-lowercase": !1,
|
|
472
|
-
"attr-value-single-quotes": !1,
|
|
473
|
-
"attr-value-not-empty": !1,
|
|
474
|
-
"attr-sorted": !1,
|
|
475
|
-
"attr-whitespace": !1,
|
|
476
|
-
"input-requires-label": !1,
|
|
477
|
-
"tag-self-close": !1,
|
|
478
|
-
"tagname-lowercase": !1,
|
|
479
|
-
"href-abs-or-rel": !1,
|
|
480
|
-
"inline-style-disabled": !1,
|
|
481
|
-
"space-tab-mixed-disabled": !1,
|
|
482
|
-
"attr-no-unnecessary-whitespace": !0,
|
|
483
|
-
"tags-check": {
|
|
484
|
-
img: {
|
|
485
|
-
selfclosing: !1,
|
|
486
|
-
attrsRequired: ["src", "alt"]
|
|
487
|
-
},
|
|
488
|
-
a: {
|
|
489
|
-
selfclosing: !1,
|
|
490
|
-
attrsRequired: ["href"]
|
|
491
|
-
}
|
|
492
|
-
},
|
|
493
|
-
"empty-tag-not-self-closed": !1,
|
|
494
|
-
"attr-value-double-quotes": !0,
|
|
495
|
-
"doctype-first": !0,
|
|
496
|
-
"tag-pair": !0,
|
|
497
|
-
"spec-char-escape": !0,
|
|
498
|
-
"id-unique": !0,
|
|
499
|
-
"src-not-empty": !0,
|
|
500
|
-
"attr-no-duplication": !0,
|
|
501
|
-
"title-require": !0,
|
|
502
|
-
"alt-require": !0,
|
|
503
|
-
"inline-script-disabled": !0,
|
|
504
|
-
"id-class-value": !1,
|
|
505
|
-
"id-class-ad-disabled": !0,
|
|
506
|
-
"attr-unsafe-chars": !0,
|
|
507
|
-
csslint: {
|
|
508
|
-
"display-property-grouping": !0,
|
|
509
|
-
"known-properties": !0
|
|
510
|
-
}
|
|
511
|
-
});
|
|
512
|
-
o.isEditor && z.current && ue(z.current), r.watch(), T(A(!0)), e.onMouseUp(() => {
|
|
513
|
-
let t = e.getSelection();
|
|
514
|
-
t.startColumn === t.endColumn && t.startLineNumber === t.endLineNumber && me(e.getPosition());
|
|
515
|
-
}), e.onDidBlurEditorWidget(() => {
|
|
516
|
-
h({
|
|
517
|
-
operation: s.EDITOR_CHANGE_FOCUS,
|
|
518
|
-
data: !1
|
|
519
|
-
}), T(V(!1));
|
|
520
|
-
}), e.onDidFocusEditorWidget(() => {
|
|
521
|
-
h({
|
|
522
|
-
operation: s.EDITOR_CHANGE_FOCUS,
|
|
523
|
-
data: !0
|
|
524
|
-
}), T(V(!0));
|
|
525
|
-
}), e.onDidChangeModelContent(() => {
|
|
526
|
-
setTimeout(() => {
|
|
527
|
-
Q();
|
|
528
|
-
}, 0);
|
|
529
|
-
}), setTimeout(() => {
|
|
530
|
-
Q();
|
|
531
|
-
}, 100);
|
|
532
|
-
};
|
|
533
|
-
P((e) => {
|
|
534
|
-
let t = e.data.operation, n = e.data;
|
|
535
|
-
ie.current = t, t === s.UPDATE_EDITOR_POSITION_FROM_IFRAME && pe(n.data);
|
|
536
|
-
});
|
|
537
|
-
let ge = (0, W.useMemo)(() => document.createElement("div"), []), _e = (0, W.useMemo)(() => ({
|
|
538
|
-
...S,
|
|
539
|
-
fontFamily: S.fontFamily || we,
|
|
540
|
-
fontSize: S.fontSize || Te,
|
|
541
|
-
fontWeight: S.fontWeight || "normal",
|
|
542
|
-
domReadOnly: t,
|
|
543
|
-
readOnly: t,
|
|
544
|
-
unusualLineTerminators: "off",
|
|
545
|
-
mouseWheelZoom: !0,
|
|
546
|
-
wordWrap: H.onlyCodeModeInMobile ? "off" : S.wordWrap,
|
|
547
|
-
ariaContainerElement: ge,
|
|
548
|
-
unicodeHighlight: {
|
|
549
|
-
ambiguousCharacters: !1,
|
|
550
|
-
invisibleCharacters: !1
|
|
551
|
-
}
|
|
552
|
-
}), [
|
|
553
|
-
S,
|
|
554
|
-
H.onlyCodeModeInMobile,
|
|
555
|
-
t,
|
|
556
|
-
ge
|
|
557
|
-
]);
|
|
558
|
-
function ve(e) {
|
|
559
|
-
e[0]?.message !== "Doctype must be declared first." && (i.isPlugin && m.fire(e), T(te(e)));
|
|
560
|
-
}
|
|
561
|
-
return p?.uri && /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [se && /* @__PURE__ */ (0, $.jsx)(ae, {
|
|
562
|
-
wrap: !0,
|
|
563
|
-
style: {
|
|
564
|
-
position: "fixed",
|
|
565
|
-
width: "100%",
|
|
566
|
-
height: "100%",
|
|
567
|
-
top: 0,
|
|
568
|
-
left: 0,
|
|
569
|
-
zIndex: J?.zIndexPopupBase,
|
|
570
|
-
background: J?.colorBgLayout
|
|
571
|
-
}
|
|
572
|
-
}), /* @__PURE__ */ (0, $.jsx)("div", {
|
|
573
|
-
id: "monaco-editor-root",
|
|
574
|
-
style: {
|
|
575
|
-
width: "100%",
|
|
576
|
-
height: "100%"
|
|
577
|
-
},
|
|
578
|
-
children: /* @__PURE__ */ (0, $.jsx)(ee, {
|
|
579
|
-
theme: x,
|
|
580
|
-
className: "monaco-editor",
|
|
581
|
-
defaultLanguage: "html",
|
|
582
|
-
onMount: he,
|
|
583
|
-
options: _e,
|
|
584
|
-
keepCurrentModel: !0,
|
|
585
|
-
path: p.uri.toString(),
|
|
586
|
-
onValidate: ve
|
|
587
|
-
})
|
|
588
|
-
})] });
|
|
589
|
-
};
|
|
590
|
-
//#endregion
|
|
591
|
-
export { Ee as default };
|
package/static/core/91242fb3.js
DELETED