@emailmaker/emailmaker 1.0.106 → 1.0.107-dev.1

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 (121) hide show
  1. package/README.md +1 -1
  2. package/cli/lib/config.js +1 -1
  3. package/emailmaker-esm.js +7 -7
  4. package/emailmaker.js +2 -2
  5. package/iframe/js/amp.CBamu9Jy.js +1 -0
  6. package/iframe/js/chunk.oX6nCJbK.js +1 -1
  7. package/iframe/js/iframe-eblock.js +1 -1
  8. package/iframe/js/iframe.js +1 -1
  9. package/iframe/js/rules.BSaCN7eK.js +1 -1
  10. package/iframe/js/sanitize-html.Dy7Uwo8P.js +1 -1
  11. package/package.json +3 -4
  12. package/react/index.js +4 -4
  13. package/runtime/@ant-design/cssinjs/index.js +1 -1
  14. package/runtime/@ant-design/pro-layout/index.js +1 -1
  15. package/runtime/antd/index.js +1 -1
  16. package/runtime/chunks/es-86-u14x5.js +407 -0
  17. package/runtime/chunks/{es-CO7WpZVp.js → es-BRjT21eG.js} +1 -1
  18. package/runtime/chunks/es-C3X1_iRJ.js +4 -0
  19. package/static/amd/{3410ae4c.js → 106c1c44.js} +3 -3
  20. package/static/amd/{f1412d1b.js → 19494006.js} +1 -1
  21. package/static/amd/{127166bb.js → 2480eb3b.js} +25 -25
  22. package/static/amd/{e8b0ce702.js → 28f4634f2.js} +1 -1
  23. package/static/amd/{34ee9141.js → 2f60af9f.js} +1 -1
  24. package/static/amd/{bdff951a.js → 368d792c.js} +1 -1
  25. package/static/amd/{1dca3566.js → 3b4d5d23.js} +2 -2
  26. package/static/amd/{3f397bbd.js → 502761e0.js} +3 -3
  27. package/static/amd/{2f1e7ffb.js → 50c7eb6c.js} +1 -1
  28. package/static/amd/{5c18d97d2.js → 534fa9082.js} +1 -1
  29. package/static/amd/626c39be.js +1 -0
  30. package/static/amd/{62985723.js → 75616837.js} +2 -2
  31. package/static/amd/{ad924d2d2.js → 7683aed32.js} +1 -1
  32. package/static/amd/76cadc91.js +1 -0
  33. package/static/amd/{2e738d66.js → 846684a0.js} +1 -1
  34. package/static/amd/{cf56bf8e.js → 8678c217.js} +1 -1
  35. package/static/amd/{d3e49443.js → 8af477e8.js} +35 -35
  36. package/static/amd/{647aeb89.js → 8c80ca60.js} +1 -1
  37. package/static/amd/{59f1eb21.js → 91174af6.js} +1 -1
  38. package/static/amd/{db53b13b2.js → a0db9bc52.js} +1 -1
  39. package/static/amd/{3c045c05.js → a208672b.js} +1 -1
  40. package/static/amd/{51f74c23.js → b3ea6c2b.js} +1 -1
  41. package/static/amd/{3a544ab7.js → be8bfd98.js} +1 -1
  42. package/static/amd/{4f7b7e7b.js → d6ebf258.js} +1 -1
  43. package/static/amd/d9706ce7.js +1 -0
  44. package/static/amd/da5e5be92.js +47 -0
  45. package/static/amd/{45fc63362.js → dd3a2c7f2.js} +5 -5
  46. package/static/amd/{da3c98572.js → ddbaadd22.js} +1 -1
  47. package/static/amd/f0773d02.js +1 -0
  48. package/static/amd/{ea7fcdd22.js → f0a443f72.js} +1 -1
  49. package/static/amd/{edf12452.js → fd51d75b.js} +1 -1
  50. package/static/core/{7478008a2.js → 112814fb2.js} +5 -5
  51. package/static/core/{3c58018a.js → 12623967.js} +23 -0
  52. package/static/core/12d586d6.js +2 -0
  53. package/static/core/{3aa1accd.js → 175a42e3.js} +2 -2
  54. package/static/core/{3929de6a.js → 2b2c49f5.js} +1 -1
  55. package/static/core/{b43d62502.js → 3106db502.js} +1 -1
  56. package/static/core/{7ede5bb32.js → 36a93fbc2.js} +1 -1
  57. package/static/core/{dd1b48732.js → 3ef8b3172.js} +44 -62
  58. package/static/core/404e7156.js +25 -0
  59. package/static/core/{a42cb1892.js → 41900faf2.js} +7160 -7206
  60. package/static/core/{950736cb.js → 42607e0b.js} +2 -2
  61. package/static/core/{37f5c2e2.js → 4d4236d42.js} +6 -8
  62. package/static/core/{f402cdb02.js → 4ef9e9292.js} +2 -2
  63. package/static/core/{f8b68b562.js → 4f5874c32.js} +9 -9
  64. package/static/core/{356406472.js → 5daae05b2.js} +4 -4
  65. package/static/core/648686e8.js +3 -0
  66. package/static/core/6a07fdd9.js +17 -0
  67. package/static/core/{dd819c97.js → 71a549aa.js} +2 -2
  68. package/static/core/{dff461712.js → 75c365b22.js} +2 -2
  69. package/static/core/869ed3c1.js +88 -0
  70. package/static/core/{da0c7c5f2.js → 87e43e8f2.js} +165 -164
  71. package/static/core/{c714cdff2.js → 88a09d732.js} +57 -66
  72. package/static/core/{85bd6ac0.js → 9608479b.js} +33 -37
  73. package/static/core/970aa3c0.js +3 -0
  74. package/static/core/{2898e7aa2.js → 9f5c7c092.js} +2 -2
  75. package/static/core/{a8844025.js → b09f9769.js} +2 -2
  76. package/static/core/b19a3fa4.js +54 -0
  77. package/static/core/{239366ec2.js → bb1ecd2f2.js} +1 -1
  78. package/static/core/{84829538.js → c6b9e0932.js} +14 -21
  79. package/static/core/cc53df61.js +3 -0
  80. package/static/core/{2dc46694.js → d32193e5.js} +2 -2
  81. package/static/core/{c615024a2.js → d81bea0e2.js} +13 -12
  82. package/static/core/e3ca5f72.js +3 -0
  83. package/static/core/{f4b3eea52.js → e735ab4e2.js} +4 -4
  84. package/static/core/{e61f10d22.js → efaf9d352.js} +2 -2
  85. package/static/core/{408b13ec2.js → f6c370402.js} +10 -10
  86. package/static/core/{9238a7c32.js → f8a0a5292.js} +2 -2
  87. package/iframe/js/amp.Hj8A4hcJ.js +0 -1
  88. package/runtime/chunks/es-CEL9YonN.js +0 -4
  89. package/runtime/chunks/es-Dc0YYbhY.js +0 -407
  90. package/static/amd/7634e85e2.js +0 -47
  91. package/static/amd/90fc6abd.js +0 -1
  92. package/static/amd/b6593123.js +0 -1
  93. package/static/amd/e459f307.js +0 -1
  94. package/static/amd/f2ec6999.js +0 -1
  95. package/static/core/3cd7aecb.js +0 -3
  96. package/static/core/56649294.js +0 -3
  97. package/static/core/5cdc0d83.js +0 -3
  98. package/static/core/9eb43b50.js +0 -2
  99. package/static/core/de2a198b.js +0 -3
  100. package/static/core/f33680b1.js +0 -28
  101. /package/iframe/{iframe-eblock.986ee288.html → iframe-eblock.e2c5cb99.html} +0 -0
  102. /package/iframe/{iframe.986ee288.html → iframe.e2c5cb99.html} +0 -0
  103. /package/static/core/{1b08a9cc.js → 0a8c3cd4.js} +0 -0
  104. /package/static/core/{dc11e0c2.js → 13a32c93.js} +0 -0
  105. /package/static/core/{aa6d1b3c.js → 15c3e303.js} +0 -0
  106. /package/static/core/{432a48e72.js → 1c83f7f62.js} +0 -0
  107. /package/static/core/{73a54dd5.js → 2423f182.js} +0 -0
  108. /package/static/core/{16d77cfa.js → 26bcc803.js} +0 -0
  109. /package/static/core/{5e245313.js → 3301f9b2.js} +0 -0
  110. /package/static/core/{8e816ff3.js → 3ce618bb.js} +0 -0
  111. /package/static/core/{75260591.js → 68bb7a74.js} +0 -0
  112. /package/static/core/{71a2973c.js → 88f5cc0f.js} +0 -0
  113. /package/static/core/{8d0a7b7c.js → 9ac04a2e.js} +0 -0
  114. /package/static/core/{4dedb700.js → 9faf360e.js} +0 -0
  115. /package/static/core/{cb527115.js → a1f54cad.js} +0 -0
  116. /package/static/core/{ac7a72f4.js → a3aeb012.js} +0 -0
  117. /package/static/core/{a8632524.js → aa66c7a7.js} +0 -0
  118. /package/static/core/{ef18be3f.js → ba484ecf.js} +0 -0
  119. /package/static/core/{f2efcf13.js → baa68b06.js} +0 -0
  120. /package/static/core/{a453cd4e.js → c0f2f2c0.js} +0 -0
  121. /package/static/core/{bba72d91.js → f03fa3a22.js} +0 -0
@@ -1,17 +1,18 @@
1
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 { o as e } from "./305249fe.js";
2
- import { $ as t, F as n, J as r, N as i, Z as a, d as o, lt as s, ut as c } from "./3c58018a.js";
2
+ import { $ as t, F as n, J as r, N as i, Z as a, d as o, lt as s, ut as c } from "./12623967.js";
3
3
  import "./89c71a33.js";
4
- import { _ as l, a as u, i as d, n as f, r as p, t as ee } from "./85bd6ac0.js";
5
- import "./a8844025.js";
6
- import { l as m, u as h } from "./37f5c2e2.js";
7
- import "./84829538.js";
8
- import { A as g, N as _, d as v, f as te } from "./2898e7aa2.js";
9
- import { S as y, b, h as ne, i as x, v as re, vt as ie, w as ae } from "./356406472.js";
10
- import { D as S, I as C, N as w, _ as T, a as E, c as oe, f as D, i as O, m as k, r as A, s as j, t as M, u as se, x as N } from "./dd1b48732.js";
11
- import { M as P, i as F, r as I, v as L } from "./f402cdb02.js";
12
- import { n as R, r as ce, t as z } from "./b43d62502.js";
13
- import { useCallback as B, useEffect as V, useMemo as H, useRef as U, useState as W } from "@emailmaker/runtime/react";
14
- import { Fragment as le, jsx as G, jsxs as K } from "@emailmaker/runtime/react/jsx-runtime";
4
+ import { t as ee } from "./404e7156.js";
5
+ import { _ as l, a as u, i as d, n as f, r as p, t as m } from "./9608479b.js";
6
+ import "./b09f9769.js";
7
+ import { l as h, u as g } from "./4d4236d42.js";
8
+ import "./c6b9e0932.js";
9
+ import { A as _, N as v, d as y, f as te } from "./9f5c7c092.js";
10
+ import { S as ne, b, h as x, i as re, v as ie, vt as ae, w as S } from "./5daae05b2.js";
11
+ import { E as C, F as w, M as T, b as E, d as D, g as O, i as k, l as oe, n as se, o as A, p as j, r as M, s as N } from "./3ef8b3172.js";
12
+ import { M as P, i as F, r as I, v as L } from "./4ef9e9292.js";
13
+ import { n as R, r as ce, t as le } from "./3106db502.js";
14
+ import { useCallback as z, useEffect as B, useMemo as V, useRef as H, useState as U } from "@emailmaker/runtime/react";
15
+ import { Fragment as W, jsx as G, jsxs as K } from "@emailmaker/runtime/react/jsx-runtime";
15
16
  import { theme as q } from "@emailmaker/runtime/antd";
16
17
  //#region src/helpers/monaco/overrideContribution.ts
17
18
  var ue = /* @__PURE__ */ e(p());
@@ -51,54 +52,54 @@ function Z(e) {
51
52
  };
52
53
  }
53
54
  function fe() {
54
- X || (X = !0, import("./85bd6ac0.js").then((e) => e.c).then(({ ColorDetector: e }) => {
55
+ X || (X = !0, import("./9608479b.js").then((e) => e.c).then(({ ColorDetector: e }) => {
55
56
  let t = Z(e);
56
57
  t.ID = e.ID, J(t.ID, () => t);
57
58
  }).catch((e) => {}));
58
59
  }
59
60
  //#endregion
60
61
  //#region src/modules/components/CollaborateEditor/helpers.ts
61
- var Q = (e, t) => (me(), he(e.user.color, t), e.cursor ? [{
62
- range: new C.Range(e.cursor.lineNumber, e.cursor.column, e.cursor.lineNumber, e.cursor.column),
62
+ var pe = (e, t) => (he(), ge(e.user.color, t), e.cursor ? [{
63
+ range: new w.Range(e.cursor.lineNumber, e.cursor.column, e.cursor.lineNumber, e.cursor.column),
63
64
  options: {
64
65
  className: `applyColorToThis backgroundPrefix-${e.user.color.slice(1)}`,
65
66
  afterContentClassName: "cursor-hover",
66
67
  beforeContentClassName: "",
67
68
  style: `--cursor-color: ${e.user.color};`
68
69
  }
69
- }] : []), pe = (e) => e.selection ? [{
70
- range: new C.Range(e.selection.startLineNumber, e.selection.startColumn, e.selection.endLineNumber, e.selection.endColumn),
70
+ }] : []), me = (e) => e.selection ? [{
71
+ range: new w.Range(e.selection.startLineNumber, e.selection.startColumn, e.selection.endLineNumber, e.selection.endColumn),
71
72
  options: { className: "user-selection-decoration" }
72
- }] : [], me = () => {
73
+ }] : [], he = () => {
73
74
  let e = document.styleSheets[0];
74
75
  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);
75
- }, he = (e, t) => {
76
+ }, ge = (e, t) => {
76
77
  let n = `backgroundPrefix-${e.slice(1)}`, r = document.styleSheets[0];
77
78
  Array.from(r.cssRules).some((e) => e.cssText.includes(`.${n}`)) || r.insertRule(`.${n} { --cursor-color: ${e === t.color ? "#000000" : e}; }`, r.cssRules.length);
78
- }, ge = (e, t, n, r, i) => {
79
+ }, _e = (e, t, n, r, i) => {
79
80
  for (let a = 0; a < e.length; a++) {
80
81
  let o = e[a], s = o.className.split(" ");
81
82
  for (let e of s) if (e.startsWith(t)) {
82
83
  let a = `#${e.replace(t, "")}`, s = r.find((e) => e.user.color === a);
83
- s && (n && a !== i?.color ? _e(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);
84
+ s && (n && a !== i?.color ? ve(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);
84
85
  }
85
86
  }
86
- }, _e = (e, t, n) => {
87
+ }, ve = (e, t, n) => {
87
88
  if (!e.textContent) {
88
89
  let r = document.createElement("div");
89
90
  r.style.background = t, r.style.color = "#fff", r.textContent = n, r.className = "cursor-hover", e.appendChild(r);
90
91
  }
91
- }, ve = (e, t, n, r, i, a) => {
92
+ }, ye = (e, t, n, r, i, a) => {
92
93
  if (r) return;
93
94
  i(!0);
94
- let o = e.flatMap((e) => [...Q(e, a), ...pe(e)]);
95
+ let o = e.flatMap((e) => [...pe(e, a), ...me(e)]);
95
96
  n.current = t.deltaDecorations(n.current, o.map((e) => ({
96
97
  range: e.range,
97
98
  options: e.options
98
- }))), ge(document.getElementsByClassName("applyColorToThis"), "backgroundPrefix-", !0, e, a), i(!1);
99
- }, $ = (e, t) => {
99
+ }))), _e(document.getElementsByClassName("applyColorToThis"), "backgroundPrefix-", !0, e, a), i(!1);
100
+ }, Q = (e, t) => {
100
101
  t.setLocalStateField("cursor", e.position);
101
- }, ye = (e, t) => {
102
+ }, be = (e, t) => {
102
103
  let n = e.selection;
103
104
  t.setLocalStateField("selection", {
104
105
  startLineNumber: n.startLineNumber,
@@ -106,7 +107,7 @@ var Q = (e, t) => (me(), he(e.user.color, t), e.cursor ? [{
106
107
  endLineNumber: n.endLineNumber,
107
108
  endColumn: n.endColumn
108
109
  });
109
- }, be = (e, t) => e.filter((e) => e.user.color !== t.color), xe = () => {
110
+ }, xe = (e, t) => e.filter((e) => e.user.color !== t.color), Se = () => {
110
111
  let e = (e, t, n) => e > 100 && t > 50 && t < 150 && n < 100, t = (e, t, n) => {
111
112
  let r = (e) => {
112
113
  let t = e / 255;
@@ -122,7 +123,7 @@ var Q = (e, t) => (me(), he(e.user.color, t), e.cursor ? [{
122
123
  t + i + a >= 400 && !e(t, i, a) && n(t, i, a) && (r = `#${(t << 16 | i << 8 | a).toString(16).padStart(6, "0")}`);
123
124
  } while (!r);
124
125
  return r;
125
- }, Se = ({ CHECK_INTERVAL: e, SLEEP_THRESHOLD: t, provider: n, handleOfflineCollaboration: r, isNewEmailGeneration: i, saveEmailFromEditor: a }) => {
126
+ }, $ = ({ CHECK_INTERVAL: e, SLEEP_THRESHOLD: t, provider: n, handleOfflineCollaboration: r, isNewEmailGeneration: i, saveEmailFromEditor: a }) => {
126
127
  let o = Date.now();
127
128
  return setInterval(() => {
128
129
  let e = Date.now(), r = e - o;
@@ -132,8 +133,8 @@ var Q = (e, t) => (me(), he(e.user.color, t), e.cursor ? [{
132
133
  //#endregion
133
134
  //#region src/modules/components/CollaborateEditor/hooks/useSaveEmailFromCurrentEditor.ts
134
135
  function Ce(e, t) {
135
- let [n] = v(), r = m(_);
136
- return { saveEmailFromEditor: B(() => {
136
+ let [n] = y(), r = h(v);
137
+ return { saveEmailFromEditor: z(() => {
137
138
  let i = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " "), a = s.isPlugin ? r : e.project, o = {
138
139
  parent: e?.id,
139
140
  title: e.title,
@@ -160,8 +161,8 @@ function Ce(e, t) {
160
161
  //#endregion
161
162
  //#region src/modules/components/CollaborateEditor/hooks/useKeyPress.ts
162
163
  var we = () => {
163
- let [e, t] = W(!1);
164
- return V(() => {
164
+ let [e, t] = U(!1);
165
+ return B(() => {
165
166
  let e = navigator.platform.toUpperCase().includes("MAC"), n = (n) => {
166
167
  let r = (e ? n.metaKey : n.ctrlKey) && n.code === "KeyZ", i = r && n.shiftKey;
167
168
  (r || i) && (t(!0), n.preventDefault());
@@ -175,117 +176,117 @@ var we = () => {
175
176
  };
176
177
  }, []), e;
177
178
  }, Te = ({ email: e, editorRef: t, setIsSpin: n, newEmailAiGeneratorRef: r }) => {
178
- let a = H(() => new ce(), []), o = se(), c = U([]), l = U([]), u = U(!1), d = U(0), f = U(""), [p, ee] = W(null), [h, g] = W(null), [_, v] = W(!1), [y, ne] = W([]), [x, re] = W(!1), [ie, ae] = W(!1), S = k(o), C = m(b), { saveEmailFromEditor: w } = Ce(e, p), T = U(null), [E, D] = W(!1), [O] = te(), M = e?.id, N = !!(M === "3769995" || s.isPlugin), P = H(() => ({
179
+ let a = V(() => new ce(), []), o = oe(), c = H([]), ee = H([]), l = H(!1), u = H(0), d = H(""), [f, p] = U(null), [m, g] = U(null), [_, v] = U(!1), [y, ne] = U([]), [x, re] = U(!1), [ie, ae] = U(!1), S = j(o), C = h(b), { saveEmailFromEditor: w } = Ce(e, f), T = H(null), [E, D] = U(!1), [O] = te(), k = e?.id, M = !!(k === "3769995" || s.isPlugin), P = V(() => ({
179
180
  name: {
180
- first_name: N ? C?.username : C?.first_name,
181
- last_name: N ? "" : C?.last_name,
181
+ first_name: M ? C?.username : C?.first_name,
182
+ last_name: M ? "" : C?.last_name,
182
183
  email: C?.email
183
184
  },
184
- color: xe()
185
- }), [C, N]), F = H(() => be(y, P), [P, y]), I = B(() => {
186
- h && (h?.destroy(), g(null));
187
- }, [h]), L = B(() => {
185
+ color: Se()
186
+ }), [C, M]), F = V(() => xe(y, P), [P, y]), I = z(() => {
187
+ m && (m?.destroy(), g(null));
188
+ }, [m]), L = z(() => {
188
189
  try {
189
190
  w();
190
191
  } catch (e) {
191
192
  console.error(e);
192
193
  }
193
- }, [w]), le = B(async (e) => {
194
+ }, [w]), W = z(async (e) => {
194
195
  try {
195
196
  return await O({
196
- emailId: M,
197
+ emailId: k,
197
198
  source: "editor",
198
199
  html: e
199
200
  }).unwrap(), !0;
200
201
  } catch (e) {
201
202
  return console.error("Failed to save email:", e), !1;
202
203
  }
203
- }, [M, O]), G = B(async (e) => {
204
- if (await le(e) && E) {
204
+ }, [k, O]), G = z(async (e) => {
205
+ if (await W(e) && E) {
205
206
  let e = setTimeout(() => {
206
207
  D(!1);
207
208
  }, 0);
208
209
  return () => clearTimeout(e);
209
210
  }
210
211
  }, [
211
- le,
212
+ W,
212
213
  D,
213
214
  E
214
215
  ]);
215
- V(() => {
216
- !M || !i.isEditor || (y.length === 1 && d.current > 1 && h && L(), d.current = y.length);
216
+ B(() => {
217
+ !k || !i.isEditor || (y.length === 1 && u.current > 1 && m && L(), u.current = y.length);
217
218
  }, [
218
219
  y.length,
219
- h,
220
+ m,
220
221
  L
221
- ]), V(() => {
222
- if (!M || !i.isEditor || E) return;
223
- let e = new R(oe, N ? `${M}-plugin` : `${M}-collaborate`, a);
222
+ ]), B(() => {
223
+ if (!k || !i.isEditor || E) return;
224
+ let e = new R(N, M ? `${k}-plugin` : `${k}-collaborate`, a);
224
225
  return g(e), e.awareness.setLocalStateField("user", P), () => {
225
226
  e?.destroy(), a?.destroy();
226
227
  };
227
228
  }, [
228
229
  a,
229
230
  P,
230
- N,
231
231
  M,
232
+ k,
232
233
  E
233
234
  ]);
234
- let K = B((e) => {
235
- if (!u.current) {
236
- u.current = !0;
235
+ let K = z((e) => {
236
+ if (!l.current) {
237
+ l.current = !0;
237
238
  try {
238
- let t = l.current, n = Array.from(e.getStates().values());
239
+ let t = ee.current, n = Array.from(e.getStates().values());
239
240
  (n.length > 1 || n.length !== t.length) && (ne(n), requestAnimationFrame(() => {
240
- ve(n, p, c, _, v, P);
241
- })), l.current = n;
241
+ ye(n, f, c, _, v, P);
242
+ })), ee.current = n;
242
243
  } finally {
243
- u.current = !1;
244
+ l.current = !1;
244
245
  }
245
246
  }
246
247
  }, [
247
- p,
248
+ f,
248
249
  c,
249
250
  _,
250
251
  v,
251
252
  P
252
253
  ]);
253
- V(() => {
254
- if (!h || !p || !i.isEditor || !t.current || !p.getModel() || E) return;
255
- let e = null, r = h.awareness, o = a.getText("monaco"), s = async (i) => {
254
+ B(() => {
255
+ if (!m || !f || !i.isEditor || !t.current || !f.getModel() || E) return;
256
+ let e = null, r = m.awareness, o = a.getText("monaco"), s = async (i) => {
256
257
  let a = Array.from(r.getStates().values());
257
258
  if (i) {
258
259
  if (o._length > 0 && a.length > 1 && !T.current) {
259
- let e = p?.getModel()?.getValue()?.toString() || "", r = (e) => e.replace(/\s+/g, " ").trim();
260
- r(e) !== r(o.toString()) && (await q(t, n), n?.(!1), p.executeEdits("collaboration", [{
261
- range: p.getModel().getFullModelRange(),
260
+ let e = f?.getModel()?.getValue()?.toString() || "", r = (e) => e.replace(/\s+/g, " ").trim();
261
+ r(e) !== r(o.toString()) && (await q(t, n), n?.(!1), f.executeEdits("collaboration", [{
262
+ range: f.getModel().getFullModelRange(),
262
263
  text: o.toString(),
263
264
  forceMoveMarkers: !0
264
265
  }]));
265
266
  }
266
- o._length > 0 && a.length === 1 && !T.current && o.applyDelta([{ delete: o._length }, { insert: t.current?.getModel().getValue() }]), o._length === 0 && o.insert(0, t.current?.getModel().getValue()), T.current && o.applyDelta([{ delete: o._length }, { insert: T.current }]), e = new z(o, p?.getModel(), new Set([p]), r), p?.onDidChangeCursorPosition((e) => $(e, r)), p?.onDidChangeCursorSelection((e) => ye(e, r)), r.on("change", () => K(r)), T.current = null;
267
+ o._length > 0 && a.length === 1 && !T.current && o.applyDelta([{ delete: o._length }, { insert: t.current?.getModel().getValue() }]), o._length === 0 && o.insert(0, t.current?.getModel().getValue()), T.current && o.applyDelta([{ delete: o._length }, { insert: T.current }]), e = new le(o, f?.getModel(), new Set([f]), r), f?.onDidChangeCursorPosition((e) => Q(e, r)), f?.onDidChangeCursorSelection((e) => be(e, r)), r.on("change", () => K(r)), T.current = null;
267
268
  }
268
269
  };
269
- return h.on("sync", s), () => {
270
- e && e.destroy(), h.off("sync", s);
270
+ return m.on("sync", s), () => {
271
+ e && e.destroy(), m.off("sync", s);
271
272
  };
272
273
  }, [
273
- p,
274
- h,
274
+ f,
275
+ m,
275
276
  a,
276
277
  t,
277
278
  K,
278
279
  n,
279
280
  E
280
- ]), V(() => {
281
- if (!h || !p || !i.isEditor || !t.current || E) return;
282
- let e = h?.awareness, n = setInterval(() => {
281
+ ]), B(() => {
282
+ if (!m || !f || !i.isEditor || !t.current || E) return;
283
+ let e = m?.awareness, n = setInterval(() => {
283
284
  K(e);
284
285
  }, 500);
285
286
  return () => clearInterval(n);
286
287
  }, [
287
- h,
288
- p,
288
+ m,
289
+ f,
289
290
  _,
290
291
  t,
291
292
  x,
@@ -301,12 +302,12 @@ var we = () => {
301
302
  r();
302
303
  });
303
304
  }
304
- if (V(() => {
305
- if (!M || !i.isEditor || x) return;
306
- let e = Se({
307
- CHECK_INTERVAL: A,
308
- SLEEP_THRESHOLD: j,
309
- provider: h,
305
+ if (B(() => {
306
+ if (!k || !i.isEditor || x) return;
307
+ let e = $({
308
+ CHECK_INTERVAL: se,
309
+ SLEEP_THRESHOLD: A,
310
+ provider: m,
310
311
  handleOfflineCollaboration: I,
311
312
  isNewEmailGeneration: E,
312
313
  saveEmailFromEditor: w
@@ -315,19 +316,19 @@ var we = () => {
315
316
  clearInterval(e);
316
317
  };
317
318
  }, [
318
- M,
319
- h,
319
+ k,
320
+ m,
320
321
  x,
321
322
  I,
322
323
  re,
323
324
  E
324
- ]), p && F.length > 0) {
325
- let e = p?.getModel()?.getValue()?.toString() || "";
326
- f.current !== e && "clear" in S && S.clear(), f.current = e;
325
+ ]), f && F.length > 0) {
326
+ let e = f?.getModel()?.getValue()?.toString() || "";
327
+ d.current !== e && "clear" in S && S.clear(), d.current = e;
327
328
  }
328
329
  let ue = we() && F.length > 0;
329
- return V(() => {
330
- if (!M || !i.isEditor) return;
330
+ return B(() => {
331
+ if (!k || !i.isEditor) return;
331
332
  let e = setInterval(() => {
332
333
  if (r?.current && !E && (I(), D(!0)), !r?.current && E) {
333
334
  let e = o?.getValue();
@@ -337,11 +338,11 @@ var we = () => {
337
338
  return () => clearInterval(e);
338
339
  }, [
339
340
  E,
340
- h,
341
- M,
341
+ m,
342
+ k,
342
343
  i.isEditor
343
- ]), V(() => {
344
- if (!M || !i.isEditor) return;
344
+ ]), B(() => {
345
+ if (!k || !i.isEditor) return;
345
346
  let e = () => {
346
347
  document.visibilityState === "hidden" && w();
347
348
  };
@@ -350,69 +351,69 @@ var we = () => {
350
351
  };
351
352
  }, [
352
353
  e,
353
- M,
354
+ k,
354
355
  i.isEditor
355
356
  ]), [
356
- p,
357
+ f,
357
358
  F,
358
- ee,
359
+ p,
359
360
  x,
360
361
  ue
361
362
  ];
362
363
  };
363
- u.config({ monaco: C }), C.languages.html?.htmlDefaults?.options?.format ? C.languages.html.htmlDefaults.options.format.wrapLineLength = 0 : C.languages.onLanguage("html", () => {
364
+ u.config({ monaco: w }), w.languages.html?.htmlDefaults?.options?.format ? w.languages.html.htmlDefaults.options.format.wrapLineLength = 0 : w.languages.onLanguage("html", () => {
364
365
  setTimeout(() => {
365
- C.languages.html?.htmlDefaults?.options?.format && (C.languages.html.htmlDefaults.options.format.wrapLineLength = 0);
366
+ w.languages.html?.htmlDefaults?.options?.format && (w.languages.html.htmlDefaults.options.format.wrapLineLength = 0);
366
367
  }, 100);
367
- }), f(C), ee(C, ["html"]);
368
+ }), f(w), m(w, ["html"]);
368
369
  var { useToken: Ee } = q, De = "'Source Code Pro', Consolas, 'Courier New', monospace", Oe = 14, ke = ({ email: e, readOnly: l, setOtherUsers: u, newEmailAiGeneratorRef: f }) => {
369
- let p = se();
370
- p.getLanguageId() !== "html" && C.editor.setModelLanguage(p, "html");
371
- let ee = ne(o.ON_CODE_VALIDATE_ID), _ = ie(), v = m(F), te = m(S), b = m(I), oe = e?.hasOwnProperty("type") ? te : v, k = m(y), A = h(), j = U(null), R = U(null), ce = U(null), z = U([]), q = g(), J = B(() => {
372
- A(ae(!1));
373
- }, [A]), [Y, de] = W(!1), X = x(), { __: Z } = re(), { token: Q } = Ee(), [, pe, me, he, ge] = Te({
370
+ let p = oe();
371
+ p.getLanguageId() !== "html" && w.editor.setModelLanguage(p, "html");
372
+ let m = x(o.ON_CODE_VALIDATE_ID), v = ae(), y = h(F), te = h(C), b = h(I), se = e?.hasOwnProperty("type") ? te : y, A = h(ne), j = g(), N = H(null), R = H(null), ce = H(null), le = H([]), q = _(), J = z(() => {
373
+ j(S(!1));
374
+ }, [j]), [Y, de] = U(!1), X = re(), { __: Z } = ie(), { token: pe } = Ee(), [, me, he, ge, _e] = Te({
374
375
  email: e,
375
376
  editorRef: R,
376
377
  setIsSpin: de,
377
378
  newEmailAiGeneratorRef: f
378
379
  });
379
- z.current = pe, V(() => {
380
- l || u(z.current);
380
+ le.current = me, B(() => {
381
+ l || u(le.current);
381
382
  }, [
382
- pe?.length,
383
+ me?.length,
383
384
  u,
384
385
  l
385
386
  ]);
386
- let _e = H(() => () => {
387
- X.error({ message: Z(E) });
388
- }, [Z, X]), ve = H(() => () => {
389
- X.warning({ message: Z(O) });
387
+ let ve = V(() => () => {
388
+ X.error({ message: Z(k) });
389
+ }, [Z, X]), ye = V(() => () => {
390
+ X.warning({ message: Z(M) });
390
391
  }, [Z, X]);
391
- V(() => {
392
- he && _e();
393
- }, [he, _e]), V(() => {
392
+ B(() => {
394
393
  ge && ve();
395
- }, [ge, ve]), V(() => J(), [J]), V(() => {
394
+ }, [ge, ve]), B(() => {
395
+ _e && ye();
396
+ }, [_e, ye]), B(() => J(), [J]), B(() => {
396
397
  if (b) {
397
- let { current: e } = j;
398
+ let { current: e } = N;
398
399
  e && (e.revealRangeInCenterIfOutsideViewport(b), e.setSelection(b));
399
400
  }
400
401
  }, [b]);
401
- let $ = B(() => {
402
- if (j.current) {
403
- let e = j.current.getDomNode();
402
+ let Q = z(() => {
403
+ if (N.current) {
404
+ let e = N.current.getDomNode();
404
405
  if (e) {
405
- let t = k.fontFamily || De, n = k.fontSize || Oe;
406
+ let t = A.fontFamily || De, n = A.fontSize || Oe;
406
407
  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");
407
408
  }
408
409
  }
409
- }, [k.fontFamily, k.fontSize]);
410
- V(() => {
411
- if ($(), j.current) {
412
- let e = j.current.getDomNode();
410
+ }, [A.fontFamily, A.fontSize]);
411
+ B(() => {
412
+ if (Q(), N.current) {
413
+ let e = N.current.getDomNode();
413
414
  if (e) {
414
415
  let t = new MutationObserver(() => {
415
- $();
416
+ Q();
416
417
  });
417
418
  return t.observe(e, {
418
419
  childList: !0,
@@ -422,9 +423,9 @@ var { useToken: Ee } = q, De = "'Source Code Pro', Consolas, 'Courier New', mono
422
423
  };
423
424
  }
424
425
  }
425
- }, [k.fontFamily, $]);
426
- let ye = (e) => {
427
- let { current: t } = j;
426
+ }, [A.fontFamily, Q]);
427
+ let be = (e) => {
428
+ let { current: t } = N;
428
429
  if (t && !t.hasTextFocus()) {
429
430
  let n = t.getModel(), r = n.getPositionAt(e.start), i = n.getPositionAt(e.end), a = {
430
431
  startColumn: r.column,
@@ -434,27 +435,27 @@ var { useToken: Ee } = q, De = "'Source Code Pro', Consolas, 'Courier New', mono
434
435
  };
435
436
  t.revealRangeInCenterIfOutsideViewport(a), t.setSelection(a);
436
437
  }
437
- }, be = async (e) => {
438
- let { current: t } = j;
438
+ }, xe = async (e) => {
439
+ let { current: t } = N;
439
440
  if (t) {
440
441
  let n = t.getModel();
441
- _({
442
+ v({
442
443
  operation: r.UPDATE_EDITOR_POSITION_FROM_EDITOR,
443
444
  data: n.getOffsetAt(e)
444
445
  });
445
446
  }
446
447
  };
447
- V(() => {
448
+ B(() => {
448
449
  matchMedia(c).addEventListener("change", (r) => {
449
450
  let i = window.localStorage.getItem(t.em_color_scheme), o = r.matches ? n : a;
450
- e.hasOwnProperty("type") ? A(w(i ? i === "dark" ? `vs-${i}` : a : o === "dark" ? `vs-${o}` : a)) : A(L(i ? i === "dark" ? `vs-${i}` : a : o === "dark" ? `vs-${o}` : a));
451
+ e.hasOwnProperty("type") ? j(T(i ? i === "dark" ? `vs-${i}` : a : o === "dark" ? `vs-${o}` : a)) : j(L(i ? i === "dark" ? `vs-${i}` : a : o === "dark" ? `vs-${o}` : a));
451
452
  });
452
- }, [A, e]), V(() => {
453
+ }, [j, e]), B(() => {
453
454
  let r = window.localStorage.getItem(t.em_color_scheme), i = matchMedia("(prefers-color-scheme: dark)").matches ? n : a;
454
- e?.hasOwnProperty("type") ? A(w(r ? r === "dark" ? `vs-${r}` : a : i === "dark" ? `vs-${i}` : a)) : A(L(r ? r === "dark" ? `vs-${r}` : a : i === "dark" ? `vs-${i}` : a));
455
- }, [A, e]);
456
- let xe = (e, t) => {
457
- j.current = e, R.current = e, D(), fe();
455
+ e?.hasOwnProperty("type") ? j(T(r ? r === "dark" ? `vs-${r}` : a : i === "dark" ? `vs-${i}` : a)) : j(L(r ? r === "dark" ? `vs-${r}` : a : i === "dark" ? `vs-${i}` : a));
456
+ }, [j, e]);
457
+ let Se = (e, t) => {
458
+ N.current = e, R.current = e, D(), fe();
458
459
  let n = () => {
459
460
  let t = e.getContribution("editor.linkDetector");
460
461
  if (!t?.openerService) {
@@ -465,7 +466,7 @@ var { useToken: Ee } = q, De = "'Source Code Pro', Consolas, 'Courier New', mono
465
466
  r.open = (e) => (a.innerHTML = e, i(a.textContent));
466
467
  };
467
468
  n();
468
- let a = new ue.default(e, C, {
469
+ let a = new ue.default(e, w, {
469
470
  "doctype-html5": !1,
470
471
  "html-lang-require": !1,
471
472
  "head-script-disabled": !1,
@@ -512,56 +513,56 @@ var { useToken: Ee } = q, De = "'Source Code Pro', Consolas, 'Courier New', mono
512
513
  "known-properties": !0
513
514
  }
514
515
  });
515
- i.isEditor && R.current && me(R.current), a.watch(), A(ae(!0)), e.onMouseUp(() => {
516
+ i.isEditor && R.current && he(R.current), a.watch(), j(S(!0)), e.onMouseUp(() => {
516
517
  let t = e.getSelection();
517
- t.startColumn === t.endColumn && t.startLineNumber === t.endLineNumber && be(e.getPosition());
518
+ t.startColumn === t.endColumn && t.startLineNumber === t.endLineNumber && xe(e.getPosition());
518
519
  }), e.onDidBlurEditorWidget(() => {
519
- _({
520
+ v({
520
521
  operation: r.EDITOR_CHANGE_FOCUS,
521
522
  data: !1
522
- }), A(N(!1));
523
+ }), j(E(!1));
523
524
  }), e.onDidFocusEditorWidget(() => {
524
- _({
525
+ v({
525
526
  operation: r.EDITOR_CHANGE_FOCUS,
526
527
  data: !0
527
- }), A(N(!0));
528
+ }), j(E(!0));
528
529
  }), e.onDidChangeModelContent(() => {
529
530
  setTimeout(() => {
530
- $();
531
+ Q();
531
532
  }, 0);
532
533
  }), setTimeout(() => {
533
- $();
534
+ Q();
534
535
  }, 100);
535
536
  };
536
- T((e) => {
537
+ O((e) => {
537
538
  let t = e.data.operation, n = e.data;
538
- ce.current = t, t === r.UPDATE_EDITOR_POSITION_FROM_IFRAME && ye(n.data);
539
+ ce.current = t, t === r.UPDATE_EDITOR_POSITION_FROM_IFRAME && be(n.data);
539
540
  });
540
- let Se = H(() => document.createElement("div"), []), Ce = H(() => ({
541
- ...k,
542
- fontFamily: k.fontFamily || De,
543
- fontSize: k.fontSize || Oe,
544
- fontWeight: k.fontWeight || "normal",
541
+ let $ = V(() => document.createElement("div"), []), Ce = V(() => ({
542
+ ...A,
543
+ fontFamily: A.fontFamily || De,
544
+ fontSize: A.fontSize || Oe,
545
+ fontWeight: A.fontWeight || "normal",
545
546
  domReadOnly: l,
546
547
  readOnly: l,
547
548
  unusualLineTerminators: "off",
548
549
  mouseWheelZoom: !0,
549
- wordWrap: q.onlyCodeModeInMobile ? "off" : k.wordWrap,
550
- ariaContainerElement: Se,
550
+ wordWrap: q.onlyCodeModeInMobile ? "off" : A.wordWrap,
551
+ ariaContainerElement: $,
551
552
  unicodeHighlight: {
552
553
  ambiguousCharacters: !1,
553
554
  invisibleCharacters: !1
554
555
  }
555
556
  }), [
556
- k,
557
+ A,
557
558
  q.onlyCodeModeInMobile,
558
559
  l,
559
- Se
560
+ $
560
561
  ]);
561
562
  function we(e) {
562
- e[0]?.message !== "Doctype must be declared first." && (s.isPlugin && ee.fire(e), A(P(e)));
563
+ e[0]?.message !== "Doctype must be declared first." && (s.isPlugin && m.fire(e), j(P(e)));
563
564
  }
564
- return p?.uri && /* @__PURE__ */ K(le, { children: [Y && /* @__PURE__ */ G(M, {
565
+ return p?.uri && /* @__PURE__ */ K(W, { children: [Y && /* @__PURE__ */ G(ee, {
565
566
  wrap: !0,
566
567
  style: {
567
568
  position: "fixed",
@@ -569,8 +570,8 @@ var { useToken: Ee } = q, De = "'Source Code Pro', Consolas, 'Courier New', mono
569
570
  height: "100%",
570
571
  top: 0,
571
572
  left: 0,
572
- zIndex: Q?.zIndexPopupBase,
573
- background: Q?.colorBgLayout
573
+ zIndex: pe?.zIndexPopupBase,
574
+ background: pe?.colorBgLayout
574
575
  }
575
576
  }), /* @__PURE__ */ G("div", {
576
577
  id: "monaco-editor-root",
@@ -579,10 +580,10 @@ var { useToken: Ee } = q, De = "'Source Code Pro', Consolas, 'Courier New', mono
579
580
  height: "100%"
580
581
  },
581
582
  children: /* @__PURE__ */ G(d, {
582
- theme: oe,
583
+ theme: se,
583
584
  className: "monaco-editor",
584
585
  defaultLanguage: "html",
585
- onMount: xe,
586
+ onMount: Se,
586
587
  options: Ce,
587
588
  keepCurrentModel: !0,
588
589
  path: p.uri.toString(),