@emailmaker/emailmaker 1.0.116 → 1.0.117-alpha.2

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.
Files changed (45) hide show
  1. package/README.md +275 -109
  2. package/asset-manifest.json +30 -30
  3. package/emailmaker-esm.js +1 -1
  4. package/emailmaker.d.ts +235 -38
  5. package/emailmaker.js +1 -1
  6. package/iframe/429.js +1 -1
  7. package/iframe/766.js +1 -1
  8. package/iframe/iframe-eblock.a2b4cba226801fb40e4f.html +1 -0
  9. package/iframe/iframe.a2b4cba226801fb40e4f.html +1 -0
  10. package/iframe/index.html +1 -1
  11. package/iframe/js/525.89b7dd6f.js +1 -0
  12. package/iframe/js/667.23c93f69.js +1 -0
  13. package/iframe/js/882.8a1ec371.js +1 -0
  14. package/iframe/sandbox-eblock.js +1 -1
  15. package/package.json +1 -1
  16. package/static/css/5072.9ecbf93f.chunk.css +2 -0
  17. package/static/css/main.5ba0217b.css +2 -0
  18. package/static/js/{1902.9e9ca2af.js → 1902.59ed55f8.js} +3 -3
  19. package/static/js/{2854.10396f08.js → 2854.f3e9410f.js} +2 -2
  20. package/static/js/5072.a7444daa.js +3 -0
  21. package/static/js/817.03951add.js +2 -0
  22. package/static/js/8245.25efb6c8.js +2 -0
  23. package/static/js/8466.d3339ec9.js +2 -0
  24. package/static/js/{8580.4f3e7c56.js → 8580.47fa4f83.js} +2 -2
  25. package/static/js/{8727.97602af2.js → 8727.ef480f4b.js} +2 -2
  26. package/static/js/{emailmaker_core.d07551cd.js → emailmaker_core.caef2cdc.js} +2 -2
  27. package/vite/index.js +35 -5
  28. package/webpack/index.js +22 -2
  29. package/iframe/iframe-eblock.612f5e3292f38c64ed91.html +0 -1
  30. package/iframe/iframe.612f5e3292f38c64ed91.html +0 -1
  31. package/iframe/js/525.5461ecf3.js +0 -1
  32. package/iframe/js/667.25c21b63.js +0 -1
  33. package/iframe/js/882.de4b06e1.js +0 -1
  34. package/static/css/369.d740f134.chunk.css +0 -2
  35. package/static/css/main.8c8bed31.css +0 -2
  36. package/static/js/369.05739401.js +0 -3
  37. package/static/js/5215.a9897c36.js +0 -2
  38. package/static/js/6438.78acfa4a.js +0 -2
  39. package/static/js/8466.44341e69.js +0 -2
  40. /package/{fm_notification.d.ts → fileManager.d.ts} +0 -0
  41. /package/iframe/js/{525.5461ecf3.js.LICENSE.txt → 525.89b7dd6f.js.LICENSE.txt} +0 -0
  42. /package/iframe/js/{667.25c21b63.js.LICENSE.txt → 667.23c93f69.js.LICENSE.txt} +0 -0
  43. /package/iframe/js/{882.de4b06e1.js.LICENSE.txt → 882.8a1ec371.js.LICENSE.txt} +0 -0
  44. /package/static/js/{1902.9e9ca2af.js.LICENSE.txt → 1902.59ed55f8.js.LICENSE.txt} +0 -0
  45. /package/static/js/{369.05739401.js.LICENSE.txt → 5072.a7444daa.js.LICENSE.txt} +0 -0
package/vite/index.js CHANGED
@@ -12,6 +12,34 @@ const ESM_PACKAGE_ENTRY_NAME = `${APP_NAME}-esm.js`;
12
12
  const DEFAULT_OUTPUT_FOLDER = `/${APP_NAME}`;
13
13
  const DEFAULT_MODULES_PATH = 'node_modules';
14
14
 
15
+ /** Strip leading/trailing slashes so the output folder is a single pathname segment. */
16
+ function normalizeOutputFolderSegment(outputFolder) {
17
+ return String(outputFolder ?? '').replace(/^\/+|\/+$/g, '');
18
+ }
19
+
20
+ /**
21
+ * Build the runtime publicPath string for inject. Do not use path.posix.join with http(s) URLs — it breaks https://.
22
+ */
23
+ function buildInjectedPublicPath(publicPath, outputFolderOption) {
24
+ const raw = outputFolderOption !== undefined && outputFolderOption !== null && outputFolderOption !== ''
25
+ ? String(outputFolderOption)
26
+ : DEFAULT_OUTPUT_FOLDER;
27
+ const folder = normalizeOutputFolderSegment(raw);
28
+ const base = (publicPath || '').trim();
29
+
30
+ if (!base) {
31
+ return `/${folder}/`;
32
+ }
33
+
34
+ if (/^https?:\/\//i.test(base)) {
35
+ const baseUrl = base.endsWith('/') ? base : `${base}/`;
36
+ return new URL(`${folder}/`, baseUrl).href;
37
+ }
38
+
39
+ const normalized = `${base.replace(/\/+$/, '')}/${folder}/`;
40
+ return normalized;
41
+ }
42
+
15
43
  const IGNORED_PATTERNS = [
16
44
  /.*\.npmignore/,
17
45
  /.*\.gitignore/,
@@ -38,9 +66,11 @@ const ViteServePlugin = (options) => {
38
66
  apply: 'serve',
39
67
 
40
68
  transform: (code, id) => {
41
- return code.indexOf(PACKAGE_PATH) >= 0 ?
42
- `var ${ENVIRONMENT_VARIABLE}= { publicPath: "${options.outputFolder || DEFAULT_OUTPUT_FOLDER}/"}; ${code}`
43
- : code;
69
+ if (code.indexOf(PACKAGE_PATH) < 0) {
70
+ return code;
71
+ }
72
+ const dir = buildInjectedPublicPath(options.publicPath || '', options.outputFolder);
73
+ return `var ${ENVIRONMENT_VARIABLE}= { publicPath: ${JSON.stringify(dir)} }; ${code}`;
44
74
  },
45
75
 
46
76
  configureServer: (server) => {
@@ -96,8 +126,8 @@ const ViteBuildPlugin = (options) => {
96
126
  transform: (code, id) => {
97
127
  id = cleanUrl(id);
98
128
  if (id.endsWith(PACKAGE_ENTRY_NAME) || id.endsWith(ESM_PACKAGE_ENTRY_NAME)) {
99
- const dir = path.posix.join(publicPath, options.outputFolder || DEFAULT_OUTPUT_FOLDER);
100
- return `let ${ENVIRONMENT_VARIABLE}= { publicPath: "${dir}/"}; ${code}`;
129
+ const dir = buildInjectedPublicPath(publicPath, options.outputFolder);
130
+ return `let ${ENVIRONMENT_VARIABLE}= { publicPath: ${JSON.stringify(dir)} }; ${code}`;
101
131
  } else {
102
132
  return code;
103
133
  }
package/webpack/index.js CHANGED
@@ -19,6 +19,23 @@ const DEFAULT_MODULES_PATH = `node_modules`;
19
19
  const ESM_PACKAGE_ENTRY_NAME = `${APP_NAME}-esm.js`;
20
20
  const ENVIRONMENT_VARIABLE = `${toPascalCase(APP_NAME)}Environment`;
21
21
 
22
+ function normalizeWebpackOutputFolder(folder) {
23
+ return String(folder).replace(/^\/+|\/+$/g, '');
24
+ }
25
+
26
+ function buildWebpackInjectedPublicPath(publicPath, outputFolderBare) {
27
+ const pp = (publicPath || '').trim();
28
+ const f = normalizeWebpackOutputFolder(outputFolderBare);
29
+ if (!pp) {
30
+ return `/${f}/`;
31
+ }
32
+ if (/^https?:\/\//i.test(pp)) {
33
+ const base = pp.endsWith('/') ? pp : `${pp}/`;
34
+ return new URL(`${f}/`, base).href;
35
+ }
36
+ return `${pp.replace(/\/+$/, '')}/${f}/`;
37
+ }
38
+
22
39
  const IGNORED_PATTERNS = [
23
40
  /.*\.npmignore/,
24
41
  /.*\.gitignore/,
@@ -44,7 +61,9 @@ class WebpackPlugin {
44
61
  _sources = null;
45
62
  constructor(options = {}) {
46
63
  if (options.outputFolder !== undefined) {
47
- this._outputFolder = options.outputFolder;
64
+ this._outputFolder = normalizeWebpackOutputFolder(options.outputFolder);
65
+ } else {
66
+ this._outputFolder = normalizeWebpackOutputFolder(DEFAULT_OUTPUT_FOLDER);
48
67
  }
49
68
  if (options.modulesPath !== undefined) {
50
69
  this._modulesPath = options.modulesPath;
@@ -86,7 +105,8 @@ class WebpackPlugin {
86
105
  apply(compiler) {
87
106
  const optionsPublicPath = compiler.options.output.publicPath || '';
88
107
  const publicPath = this._publicPath === undefined ? optionsPublicPath : this._publicPath;
89
- const initFragment = `var ${ENVIRONMENT_VARIABLE} = { publicPath: "${publicPath + (publicPath.endsWith('/') ? '' : '/')}${this._outputFolder}/"};`;
108
+ const injected = buildWebpackInjectedPublicPath(publicPath, this._outputFolder);
109
+ const initFragment = `var ${ENVIRONMENT_VARIABLE} = { publicPath: ${JSON.stringify(injected)} };`;
90
110
  const webpack = compiler.webpack;
91
111
  const javascript = webpack.javascript;
92
112
  this._sources = webpack.sources;
@@ -1 +0,0 @@
1
- <!doctype html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><script defer="defer" src="js/667.25c21b63.js?612f5e3292f38c64ed91"></script><script defer="defer" src="sandbox-eblock.js?612f5e3292f38c64ed91"></script></head><body></body></html>
@@ -1 +0,0 @@
1
- <!doctype html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><script defer="defer" src="js/667.25c21b63.js?612f5e3292f38c64ed91"></script><script defer="defer" src="js/525.5461ecf3.js?612f5e3292f38c64ed91"></script><script defer="defer" src="js/882.de4b06e1.js?612f5e3292f38c64ed91"></script></head><body></body></html>