@emailmaker/emailmaker 1.0.106 → 1.0.107-dev.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.
- package/README.md +1 -1
- package/cli/lib/config.js +1 -1
- package/emailmaker-esm.js +7 -7
- package/emailmaker.d.ts +44 -213
- package/emailmaker.js +2 -2
- package/iframe/js/amp.CBamu9Jy.js +1 -0
- 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/package.json +3 -4
- package/react/index.js +4 -4
- package/runtime/@ant-design/cssinjs/index.js +1 -1
- package/runtime/@ant-design/pro-layout/index.js +1 -1
- package/runtime/antd/index.js +1 -1
- package/runtime/chunks/es-86-u14x5.js +407 -0
- package/runtime/chunks/{es-CO7WpZVp.js → es-BRjT21eG.js} +1 -1
- package/runtime/chunks/es-C3X1_iRJ.js +4 -0
- package/static/amd/{3410ae4c.js → 106c1c44.js} +3 -3
- package/static/amd/{f1412d1b.js → 19494006.js} +1 -1
- package/static/amd/{e8b0ce702.js → 28f4634f2.js} +1 -1
- package/static/amd/{34ee9141.js → 2f60af9f.js} +1 -1
- package/static/amd/{bdff951a.js → 368d792c.js} +1 -1
- package/static/amd/{1dca3566.js → 3b4d5d23.js} +2 -2
- package/static/amd/401182d4.js +1 -0
- package/static/amd/{3f397bbd.js → 502761e0.js} +3 -3
- package/static/amd/{2f1e7ffb.js → 50c7eb6c.js} +1 -1
- package/static/amd/{5c18d97d2.js → 534fa9082.js} +1 -1
- package/static/amd/626c39be.js +1 -0
- package/static/amd/{62985723.js → 75616837.js} +2 -2
- package/static/amd/{ad924d2d2.js → 7683aed32.js} +1 -1
- package/static/amd/76cadc91.js +1 -0
- package/static/amd/{2e738d66.js → 846684a0.js} +1 -1
- package/static/amd/{cf56bf8e.js → 8678c217.js} +1 -1
- package/static/amd/{d3e49443.js → 8af477e8.js} +35 -35
- package/static/amd/{647aeb89.js → 8c80ca60.js} +1 -1
- package/static/amd/{59f1eb21.js → 91174af6.js} +1 -1
- package/static/amd/{db53b13b2.js → a0db9bc52.js} +1 -1
- package/static/amd/{3c045c05.js → a208672b.js} +1 -1
- package/static/amd/{51f74c23.js → b3ea6c2b.js} +1 -1
- package/static/amd/{3a544ab7.js → be8bfd98.js} +1 -1
- package/static/amd/{4f7b7e7b.js → d6ebf258.js} +1 -1
- package/static/amd/da5e5be92.js +47 -0
- package/static/amd/{45fc63362.js → dd3a2c7f2.js} +5 -5
- package/static/amd/{da3c98572.js → ddbaadd22.js} +1 -1
- package/static/amd/f0773d02.js +1 -0
- package/static/amd/{ea7fcdd22.js → f0a443f72.js} +1 -1
- package/static/amd/{edf12452.js → fd51d75b.js} +1 -1
- package/static/amd/{127166bb.js → fd995713.js} +25 -25
- package/static/core/{7478008a2.js → 112814fb2.js} +5 -5
- package/static/core/{3c58018a.js → 12623967.js} +23 -0
- package/static/core/12d586d6.js +2 -0
- package/static/core/{3aa1accd.js → 175a42e3.js} +2 -2
- package/static/core/{3929de6a.js → 2b2c49f5.js} +1 -1
- package/static/core/{b43d62502.js → 3106db502.js} +1 -1
- package/static/core/{7ede5bb32.js → 36a93fbc2.js} +1 -1
- package/static/core/{a42cb1892.js → 3a3fd9482.js} +7160 -7206
- package/static/core/{dd1b48732.js → 3ef8b3172.js} +44 -62
- package/static/core/404e7156.js +25 -0
- package/static/core/{950736cb.js → 42607e0b.js} +2 -2
- package/static/core/{37f5c2e2.js → 4d4236d42.js} +6 -8
- package/static/core/{f402cdb02.js → 4ef9e9292.js} +2 -2
- package/static/core/{f8b68b562.js → 4f5874c32.js} +9 -9
- package/static/core/{356406472.js → 5daae05b2.js} +4 -4
- package/static/core/648686e8.js +3 -0
- package/static/core/6a07fdd9.js +17 -0
- package/static/core/{dd819c97.js → 71a549aa.js} +2 -2
- package/static/core/{dff461712.js → 75c365b22.js} +2 -2
- package/static/core/869ed3c1.js +88 -0
- package/static/core/{da0c7c5f2.js → 87e43e8f2.js} +165 -164
- package/static/core/{c714cdff2.js → 88a09d732.js} +57 -66
- package/static/core/{85bd6ac0.js → 9608479b.js} +33 -37
- package/static/core/970aa3c0.js +3 -0
- package/static/core/{2898e7aa2.js → 9f5c7c092.js} +2 -2
- package/static/core/{a8844025.js → b09f9769.js} +2 -2
- package/static/core/b19a3fa4.js +54 -0
- package/static/core/{239366ec2.js → bb1ecd2f2.js} +1 -1
- package/static/core/{84829538.js → c6b9e0932.js} +14 -21
- package/static/core/cc53df61.js +3 -0
- package/static/core/{2dc46694.js → d32193e5.js} +2 -2
- package/static/core/{c615024a2.js → d81bea0e2.js} +13 -12
- package/static/core/e3ca5f72.js +3 -0
- package/static/core/{f4b3eea52.js → e735ab4e2.js} +4 -4
- package/static/core/{e61f10d22.js → efaf9d352.js} +2 -2
- package/static/core/{9238a7c32.js → f8a0a5292.js} +2 -2
- package/static/core/{408b13ec2.js → fddc1ad02.js} +10 -10
- package/iframe/js/amp.Hj8A4hcJ.js +0 -1
- package/runtime/chunks/es-CEL9YonN.js +0 -4
- package/runtime/chunks/es-Dc0YYbhY.js +0 -407
- package/static/amd/7634e85e2.js +0 -47
- package/static/amd/90fc6abd.js +0 -1
- package/static/amd/b6593123.js +0 -1
- package/static/amd/e459f307.js +0 -1
- package/static/amd/f2ec6999.js +0 -1
- package/static/core/3cd7aecb.js +0 -3
- package/static/core/56649294.js +0 -3
- package/static/core/5cdc0d83.js +0 -3
- package/static/core/9eb43b50.js +0 -2
- package/static/core/de2a198b.js +0 -3
- package/static/core/f33680b1.js +0 -28
- /package/iframe/{iframe-eblock.986ee288.html → iframe-eblock.abd61d56.html} +0 -0
- /package/iframe/{iframe.986ee288.html → iframe.abd61d56.html} +0 -0
- /package/static/core/{1b08a9cc.js → 0a8c3cd4.js} +0 -0
- /package/static/core/{dc11e0c2.js → 13a32c93.js} +0 -0
- /package/static/core/{aa6d1b3c.js → 15c3e303.js} +0 -0
- /package/static/core/{432a48e72.js → 1c83f7f62.js} +0 -0
- /package/static/core/{73a54dd5.js → 2423f182.js} +0 -0
- /package/static/core/{16d77cfa.js → 26bcc803.js} +0 -0
- /package/static/core/{5e245313.js → 3301f9b2.js} +0 -0
- /package/static/core/{8e816ff3.js → 3ce618bb.js} +0 -0
- /package/static/core/{75260591.js → 68bb7a74.js} +0 -0
- /package/static/core/{71a2973c.js → 88f5cc0f.js} +0 -0
- /package/static/core/{8d0a7b7c.js → 9ac04a2e.js} +0 -0
- /package/static/core/{4dedb700.js → 9faf360e.js} +0 -0
- /package/static/core/{cb527115.js → a1f54cad.js} +0 -0
- /package/static/core/{ac7a72f4.js → a3aeb012.js} +0 -0
- /package/static/core/{a8632524.js → aa66c7a7.js} +0 -0
- /package/static/core/{ef18be3f.js → ba484ecf.js} +0 -0
- /package/static/core/{f2efcf13.js → baa68b06.js} +0 -0
- /package/static/core/{a453cd4e.js → c0f2f2c0.js} +0 -0
- /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 "./
|
|
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 {
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { M as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
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("./
|
|
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
|
|
62
|
-
range: new
|
|
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
|
-
}] : []),
|
|
70
|
-
range: new
|
|
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
|
-
}] : [],
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 ?
|
|
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
|
-
},
|
|
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
|
-
},
|
|
92
|
+
}, ye = (e, t, n, r, i, a) => {
|
|
92
93
|
if (r) return;
|
|
93
94
|
i(!0);
|
|
94
|
-
let o = e.flatMap((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
|
-
}))),
|
|
99
|
-
},
|
|
99
|
+
}))), _e(document.getElementsByClassName("applyColorToThis"), "backgroundPrefix-", !0, e, a), i(!1);
|
|
100
|
+
}, Q = (e, t) => {
|
|
100
101
|
t.setLocalStateField("cursor", e.position);
|
|
101
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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] =
|
|
136
|
-
return { saveEmailFromEditor:
|
|
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] =
|
|
164
|
-
return
|
|
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 =
|
|
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:
|
|
181
|
-
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:
|
|
185
|
-
}), [C,
|
|
186
|
-
|
|
187
|
-
}, [
|
|
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]),
|
|
194
|
+
}, [w]), W = z(async (e) => {
|
|
194
195
|
try {
|
|
195
196
|
return await O({
|
|
196
|
-
emailId:
|
|
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
|
-
}, [
|
|
204
|
-
if (await
|
|
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
|
-
|
|
212
|
+
W,
|
|
212
213
|
D,
|
|
213
214
|
E
|
|
214
215
|
]);
|
|
215
|
-
|
|
216
|
-
!
|
|
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
|
-
|
|
220
|
+
m,
|
|
220
221
|
L
|
|
221
|
-
]),
|
|
222
|
-
if (!
|
|
223
|
-
let e = new R(
|
|
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 =
|
|
235
|
-
if (!
|
|
236
|
-
|
|
235
|
+
let K = z((e) => {
|
|
236
|
+
if (!l.current) {
|
|
237
|
+
l.current = !0;
|
|
237
238
|
try {
|
|
238
|
-
let t =
|
|
239
|
+
let t = ee.current, n = Array.from(e.getStates().values());
|
|
239
240
|
(n.length > 1 || n.length !== t.length) && (ne(n), requestAnimationFrame(() => {
|
|
240
|
-
|
|
241
|
-
})),
|
|
241
|
+
ye(n, f, c, _, v, P);
|
|
242
|
+
})), ee.current = n;
|
|
242
243
|
} finally {
|
|
243
|
-
|
|
244
|
+
l.current = !1;
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
247
|
}, [
|
|
247
|
-
|
|
248
|
+
f,
|
|
248
249
|
c,
|
|
249
250
|
_,
|
|
250
251
|
v,
|
|
251
252
|
P
|
|
252
253
|
]);
|
|
253
|
-
|
|
254
|
-
if (!
|
|
255
|
-
let e = null, r =
|
|
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 =
|
|
260
|
-
r(e) !== r(o.toString()) && (await q(t, n), n?.(!1),
|
|
261
|
-
range:
|
|
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
|
|
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
|
|
270
|
-
e && e.destroy(),
|
|
270
|
+
return m.on("sync", s), () => {
|
|
271
|
+
e && e.destroy(), m.off("sync", s);
|
|
271
272
|
};
|
|
272
273
|
}, [
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
f,
|
|
275
|
+
m,
|
|
275
276
|
a,
|
|
276
277
|
t,
|
|
277
278
|
K,
|
|
278
279
|
n,
|
|
279
280
|
E
|
|
280
|
-
]),
|
|
281
|
-
if (!
|
|
282
|
-
let e =
|
|
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
|
-
|
|
288
|
-
|
|
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 (
|
|
305
|
-
if (!
|
|
306
|
-
let e =
|
|
307
|
-
CHECK_INTERVAL:
|
|
308
|
-
SLEEP_THRESHOLD:
|
|
309
|
-
provider:
|
|
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
|
-
|
|
319
|
-
|
|
319
|
+
k,
|
|
320
|
+
m,
|
|
320
321
|
x,
|
|
321
322
|
I,
|
|
322
323
|
re,
|
|
323
324
|
E
|
|
324
|
-
]),
|
|
325
|
-
let e =
|
|
326
|
-
|
|
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
|
|
330
|
-
if (!
|
|
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
|
-
|
|
341
|
-
|
|
341
|
+
m,
|
|
342
|
+
k,
|
|
342
343
|
i.isEditor
|
|
343
|
-
]),
|
|
344
|
-
if (!
|
|
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
|
-
|
|
354
|
+
k,
|
|
354
355
|
i.isEditor
|
|
355
356
|
]), [
|
|
356
|
-
|
|
357
|
+
f,
|
|
357
358
|
F,
|
|
358
|
-
|
|
359
|
+
p,
|
|
359
360
|
x,
|
|
360
361
|
ue
|
|
361
362
|
];
|
|
362
363
|
};
|
|
363
|
-
u.config({ monaco:
|
|
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
|
-
|
|
366
|
+
w.languages.html?.htmlDefaults?.options?.format && (w.languages.html.htmlDefaults.options.format.wrapLineLength = 0);
|
|
366
367
|
}, 100);
|
|
367
|
-
}), f(
|
|
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 =
|
|
370
|
-
p.getLanguageId() !== "html" &&
|
|
371
|
-
let
|
|
372
|
-
|
|
373
|
-
}, [
|
|
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
|
-
|
|
380
|
-
l || u(
|
|
380
|
+
le.current = me, B(() => {
|
|
381
|
+
l || u(le.current);
|
|
381
382
|
}, [
|
|
382
|
-
|
|
383
|
+
me?.length,
|
|
383
384
|
u,
|
|
384
385
|
l
|
|
385
386
|
]);
|
|
386
|
-
let
|
|
387
|
-
X.error({ message: Z(
|
|
388
|
-
}, [Z, X]),
|
|
389
|
-
X.warning({ message: Z(
|
|
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
|
-
|
|
392
|
-
he && _e();
|
|
393
|
-
}, [he, _e]), V(() => {
|
|
392
|
+
B(() => {
|
|
394
393
|
ge && ve();
|
|
395
|
-
}, [ge, ve]),
|
|
394
|
+
}, [ge, ve]), B(() => {
|
|
395
|
+
_e && ye();
|
|
396
|
+
}, [_e, ye]), B(() => J(), [J]), B(() => {
|
|
396
397
|
if (b) {
|
|
397
|
-
let { current: e } =
|
|
398
|
+
let { current: e } = N;
|
|
398
399
|
e && (e.revealRangeInCenterIfOutsideViewport(b), e.setSelection(b));
|
|
399
400
|
}
|
|
400
401
|
}, [b]);
|
|
401
|
-
let
|
|
402
|
-
if (
|
|
403
|
-
let e =
|
|
402
|
+
let Q = z(() => {
|
|
403
|
+
if (N.current) {
|
|
404
|
+
let e = N.current.getDomNode();
|
|
404
405
|
if (e) {
|
|
405
|
-
let t =
|
|
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
|
-
}, [
|
|
410
|
-
|
|
411
|
-
if (
|
|
412
|
-
let e =
|
|
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
|
-
}, [
|
|
426
|
-
let
|
|
427
|
-
let { current: t } =
|
|
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
|
-
},
|
|
438
|
-
let { current: t } =
|
|
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
|
-
|
|
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") ?
|
|
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
|
-
}, [
|
|
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") ?
|
|
455
|
-
}, [
|
|
456
|
-
let
|
|
457
|
-
|
|
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,
|
|
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 &&
|
|
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 &&
|
|
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
|
-
}),
|
|
523
|
+
}), j(E(!1));
|
|
523
524
|
}), e.onDidFocusEditorWidget(() => {
|
|
524
|
-
|
|
525
|
+
v({
|
|
525
526
|
operation: r.EDITOR_CHANGE_FOCUS,
|
|
526
527
|
data: !0
|
|
527
|
-
}),
|
|
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
|
-
|
|
537
|
+
O((e) => {
|
|
537
538
|
let t = e.data.operation, n = e.data;
|
|
538
|
-
ce.current = t, t === r.UPDATE_EDITOR_POSITION_FROM_IFRAME &&
|
|
539
|
+
ce.current = t, t === r.UPDATE_EDITOR_POSITION_FROM_IFRAME && be(n.data);
|
|
539
540
|
});
|
|
540
|
-
let
|
|
541
|
-
...
|
|
542
|
-
fontFamily:
|
|
543
|
-
fontSize:
|
|
544
|
-
fontWeight:
|
|
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" :
|
|
550
|
-
ariaContainerElement:
|
|
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
|
-
|
|
557
|
+
A,
|
|
557
558
|
q.onlyCodeModeInMobile,
|
|
558
559
|
l,
|
|
559
|
-
|
|
560
|
+
$
|
|
560
561
|
]);
|
|
561
562
|
function we(e) {
|
|
562
|
-
e[0]?.message !== "Doctype must be declared first." && (s.isPlugin &&
|
|
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(
|
|
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:
|
|
573
|
-
background:
|
|
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:
|
|
583
|
+
theme: se,
|
|
583
584
|
className: "monaco-editor",
|
|
584
585
|
defaultLanguage: "html",
|
|
585
|
-
onMount:
|
|
586
|
+
onMount: Se,
|
|
586
587
|
options: Ce,
|
|
587
588
|
keepCurrentModel: !0,
|
|
588
589
|
path: p.uri.toString(),
|