monto-email-builder 1.2.0 → 1.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/HtmlEditor/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAUL,OAAO,EACP,KAAK,EAEN,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,QAAQ,EAAK,MAAM,SAAS,CAAC;AAEtC,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAC1D,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AA8DpD,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;;OAGG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,QAAe,EACf,WAAqB,EACrB,aAAyB,EACzB,gBAAyB,EACzB,aAAsB,EACtB,EAAE,EACF,WAAkB,EAClB,YAAY,GACb,EAAE,eAAe,2CAgVjB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/HtmlEditor/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EASL,OAAO,EACP,KAAK,EAGN,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,QAAQ,EAAK,MAAM,SAAS,CAAC;AAEtC,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAC1D,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AA8DpD,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;;OAGG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,QAAe,EACf,WAAqB,EACrB,aAAyB,EACzB,gBAAyB,EACzB,aAAsB,EACtB,EAAE,EACF,WAAkB,EAClB,YAAY,GACb,EAAE,eAAe,2CA4WjB"}
@@ -1,116 +1,134 @@
1
- import { jsxs as d, jsx as e, Fragment as re } from "react/jsx-runtime";
2
- import { useState as v, useRef as N, useEffect as w, useMemo as ie } from "react";
3
- import le from "@uiw/react-codemirror";
4
- import { html as ne } from "@codemirror/lang-html";
5
- import { xcodeDark as de, tomorrowNightBlue as ae, dracula as W, basicDark as se, abcdef as ce, bbedit as he, noctisLilac as me, gruvboxLight as ue, tokyoNightDay as pe, vscodeLight as fe, xcodeLight as ge } from "@uiw/codemirror-themes-all";
6
- import { Box as i, ToggleButtonGroup as O, Tooltip as u, ToggleButton as p, FormControl as xe, InputLabel as be, Select as ve, ListSubheader as z, MenuItem as B } from "@mui/material";
7
- import { ViewColumn as Ee, Code as we, Visibility as ye, DesktopWindowsOutlined as Le, PhoneAndroid as Te } from "@mui/icons-material";
8
- import { t as De } from "./chunks/chunk-CxhtzHBZ.js";
9
- const y = {
1
+ import { jsxs as d, jsx as e, Fragment as ye } from "react/jsx-runtime";
2
+ import { useState as E, useRef as q, useEffect as T, useMemo as Ee } from "react";
3
+ import we from "@uiw/react-codemirror";
4
+ import { html as Le } from "@codemirror/lang-html";
5
+ import { xcodeDark as Te, tomorrowNightBlue as Ce, dracula as ee, basicDark as De, abcdef as ke, bbedit as Se, noctisLilac as He, gruvboxLight as Fe, tokyoNightDay as Me, vscodeLight as Pe, xcodeLight as Oe } from "@uiw/codemirror-themes-all";
6
+ import { useTheme as Ne, Box as i, ToggleButtonGroup as K, Tooltip as g, ToggleButton as x, FormControl as ze, InputLabel as Be, Select as Ie, ListSubheader as U, MenuItem as J } from "@mui/material";
7
+ import { alpha as Q } from "@mui/material/styles";
8
+ import { ViewColumn as We, Code as Ve, Visibility as je, MonitorOutlined as _e, PhoneIphoneOutlined as Re } from "@mui/icons-material";
9
+ import { t as Ye } from "./chunks/chunk-CxhtzHBZ.js";
10
+ const C = {
10
11
  // 浅色主题
11
- xcodeLight: ge,
12
- vscodeLight: fe,
13
- tokyoNightDay: pe,
14
- gruvboxLight: ue,
15
- noctisLilac: me,
16
- bbedit: he,
12
+ xcodeLight: Oe,
13
+ vscodeLight: Pe,
14
+ tokyoNightDay: Me,
15
+ gruvboxLight: Fe,
16
+ noctisLilac: He,
17
+ bbedit: Se,
17
18
  // 深色主题
18
- abcdef: ce,
19
- basicDark: se,
20
- dracula: W,
21
- tomorrowNightBlue: ae,
22
- xcodeDark: de
23
- }, Ce = {
19
+ abcdef: ke,
20
+ basicDark: De,
21
+ dracula: ee,
22
+ tomorrowNightBlue: Ce,
23
+ xcodeDark: Te
24
+ }, Ae = {
24
25
  xcodeLight: "Xcode Light (Light)",
25
26
  vscodeLight: "VSCode Light (Light)",
26
27
  tokyoNightDay: "Tokyo Night Day (Light)",
27
28
  gruvboxLight: "Gruvbox Light (Light)",
28
29
  noctisLilac: "Noctis Lilac (Light)",
29
30
  bbedit: "BBEdit (Light)"
30
- }, Se = {
31
+ }, Ge = {
31
32
  abcdef: "ABCDEF (Dark)",
32
33
  basicDark: "Basic Dark (Dark)",
33
34
  dracula: "Dracula (Dark)",
34
35
  tomorrowNightBlue: "Tomorrow Night Blue (Dark)",
35
36
  xcodeDark: "Xcode Dark (Dark)"
36
- }, I = "html-editor-theme", P = "dracula";
37
- function He(l = P) {
38
- const a = l && y[l] ? l : P;
39
- if (typeof window > "u") return a;
37
+ }, te = "html-editor-theme", Z = "dracula";
38
+ function $e(l = Z) {
39
+ const s = l && C[l] ? l : Z;
40
+ if (typeof window > "u") return s;
40
41
  try {
41
- const h = localStorage.getItem(I);
42
- if (h && y[h]) return h;
42
+ const p = localStorage.getItem(te);
43
+ if (p && C[p]) return p;
43
44
  } catch {
44
45
  console.error("Failed to get HTML Editor stored theme");
45
46
  }
46
- return a;
47
+ return s;
47
48
  }
48
- function ke(l) {
49
+ function Xe(l) {
49
50
  try {
50
- localStorage.setItem(I, l);
51
+ localStorage.setItem(te, l);
51
52
  } catch {
52
53
  console.error("Failed to set HTML Editor stored theme", l);
53
54
  }
54
55
  }
55
- function Ve({
56
+ function lt({
56
57
  value: l,
57
- onChange: a,
58
- language: h = "zh",
59
- initialMode: j = "split",
60
- initialDevice: V = "desktop",
61
- codeEditorHeight: _ = "100%",
62
- previewHeight: R = "100%",
63
- sx: A,
64
- showToolbar: Y = !0,
65
- initialTheme: G
58
+ onChange: s,
59
+ language: p = "zh",
60
+ initialMode: oe = "split",
61
+ initialDevice: re = "desktop",
62
+ codeEditorHeight: ie = "100%",
63
+ previewHeight: le = "100%",
64
+ sx: ne,
65
+ showToolbar: de = !0,
66
+ initialTheme: se
66
67
  }) {
67
- const r = (o, t) => De(o, t, h), [s, $] = v(j), [f, X] = v(V), [L, q] = v(() => He(G)), [g, T] = v(l), m = N(null), x = N(null);
68
- w(() => {
69
- l !== g && T(l);
68
+ var M, P, O, N, z, B, I, W, V, j, _, R;
69
+ const r = (o, t) => Ye(o, t, p), [a, ae] = E(oe), [c, ce] = E(re), [D, he] = E(() => $e(se)), [b, k] = E(l), u = q(null), v = q(null);
70
+ T(() => {
71
+ l !== b && k(l);
70
72
  }, [l]);
71
- const K = (o) => {
72
- T(o), m.current && clearTimeout(m.current), m.current = setTimeout(() => {
73
- a == null || a(o);
73
+ const me = (o) => {
74
+ k(o), u.current && clearTimeout(u.current), u.current = setTimeout(() => {
75
+ s == null || s(o);
74
76
  }, 300);
75
77
  };
76
- w(() => () => {
77
- m.current && clearTimeout(m.current);
78
+ T(() => () => {
79
+ u.current && clearTimeout(u.current);
78
80
  }, []);
79
- const U = (o) => {
80
- var H, k, F;
81
+ const pe = (o) => {
82
+ var A, G, $;
81
83
  const t = o || "";
82
- let c = t;
84
+ let m = t;
83
85
  if (!t.trim())
84
- c = "<!DOCTYPE html><html><head></head><body></body></html>";
86
+ m = "<!DOCTYPE html><html><head></head><body></body></html>";
85
87
  else {
86
- const n = new DOMParser().parseFromString(t, "text/html"), E = ((H = n.documentElement) == null ? void 0 : H.tagName.toLowerCase()) === "html", ee = ((k = n.head) == null ? void 0 : k.tagName.toLowerCase()) === "head", te = ((F = n.body) == null ? void 0 : F.tagName.toLowerCase()) === "body";
87
- if (!E || !ee || !te) {
88
- const oe = n.body ? n.body.innerHTML : t;
89
- c = `<!DOCTYPE html><html><head>${n.head ? n.head.innerHTML : ""}</head><body>${oe}</body></html>`;
88
+ const n = new DOMParser().parseFromString(t, "text/html"), L = ((A = n.documentElement) == null ? void 0 : A.tagName.toLowerCase()) === "html", xe = ((G = n.head) == null ? void 0 : G.tagName.toLowerCase()) === "head", be = (($ = n.body) == null ? void 0 : $.tagName.toLowerCase()) === "body";
89
+ if (!L || !xe || !be) {
90
+ const ve = n.body ? n.body.innerHTML : t;
91
+ m = `<!DOCTYPE html><html><head>${n.head ? n.head.innerHTML : ""}</head><body>${ve}</body></html>`;
90
92
  } else
91
- c = `<!DOCTYPE html>${n.documentElement.outerHTML}`;
93
+ m = `<!DOCTYPE html>${n.documentElement.outerHTML}`;
92
94
  }
93
- const Z = ["script", "iframe", "object", "embed", "canvas"], S = new DOMParser().parseFromString(c, "text/html");
94
- return Z.forEach((M) => {
95
- S.querySelectorAll(M).forEach((E) => E.remove());
96
- }), c = `<!DOCTYPE html>${S.documentElement.outerHTML}`, c;
97
- }, b = ie(() => U(g), [g]);
98
- w(() => {
99
- x.current && x.current.srcdoc !== b && (x.current.srcdoc = b);
100
- }, [b]);
101
- const J = (o, t) => {
102
- t !== null && $(t);
103
- }, Q = (o, t) => {
104
- t !== null && X(t);
105
- }, D = () => /* @__PURE__ */ e(
95
+ const ge = ["script", "iframe", "object", "embed", "canvas"], Y = new DOMParser().parseFromString(m, "text/html");
96
+ return ge.forEach((X) => {
97
+ Y.querySelectorAll(X).forEach((L) => L.remove());
98
+ }), m = `<!DOCTYPE html>${Y.documentElement.outerHTML}`, m;
99
+ }, y = Ee(() => pe(b), [b]);
100
+ T(() => {
101
+ v.current && v.current.srcdoc !== y && (v.current.srcdoc = y);
102
+ }, [y]);
103
+ const ue = (o, t) => {
104
+ t !== null && ae(t);
105
+ }, fe = (o, t) => {
106
+ (t === "desktop" || t === "mobile") && ce(t);
107
+ }, h = Ne(), w = c === "desktop" || c === "mobile" ? c : "desktop", S = {
108
+ backgroundColor: ((P = (M = h.palette) == null ? void 0 : M.action) == null ? void 0 : P.selected) ?? "rgba(25, 118, 210, 0.12)",
109
+ color: ((N = (O = h.palette) == null ? void 0 : O.primary) == null ? void 0 : N.main) ?? "#1976d2",
110
+ "&:hover": { backgroundColor: ((B = (z = h.palette) == null ? void 0 : z.action) == null ? void 0 : B.selected) ?? "rgba(25, 118, 210, 0.12)" }
111
+ }, f = {
112
+ tooltip: {
113
+ sx: {
114
+ fontSize: "11px",
115
+ fontWeight: 300,
116
+ backgroundColor: Q(((W = (I = h.palette) == null ? void 0 : I.text) == null ? void 0 : W.primary) ?? "#1F1F21", 0.9),
117
+ color: ((j = (V = h.palette) == null ? void 0 : V.common) == null ? void 0 : j.white) ?? "#fff"
118
+ }
119
+ },
120
+ arrow: {
121
+ sx: { color: Q(((R = (_ = h.palette) == null ? void 0 : _.text) == null ? void 0 : R.primary) ?? "#1F1F21", 0.9) }
122
+ }
123
+ }, H = () => /* @__PURE__ */ e(
106
124
  i,
107
125
  {
108
126
  sx: {
109
- height: _,
127
+ height: ie,
110
128
  minHeight: 0,
111
129
  display: "flex",
112
130
  flexDirection: "column",
113
- borderRight: s === "split" ? "1px solid" : "none",
131
+ borderRight: a === "split" ? "1px solid" : "none",
114
132
  borderColor: "divider"
115
133
  },
116
134
  children: /* @__PURE__ */ e(
@@ -145,13 +163,13 @@ function Ve({
145
163
  }
146
164
  },
147
165
  children: /* @__PURE__ */ e(
148
- le,
166
+ we,
149
167
  {
150
- value: g,
168
+ value: b,
151
169
  height: "100%",
152
- extensions: [ne()],
153
- theme: y[L] || W,
154
- onChange: K,
170
+ extensions: [Le()],
171
+ theme: C[D] || ee,
172
+ onChange: me,
155
173
  basicSetup: {
156
174
  lineNumbers: !0,
157
175
  foldGutter: !0,
@@ -163,11 +181,11 @@ function Ve({
163
181
  }
164
182
  )
165
183
  }
166
- ), C = () => /* @__PURE__ */ e(i, { sx: {
167
- height: R,
184
+ ), F = () => /* @__PURE__ */ e(i, { sx: {
185
+ height: le,
168
186
  overflow: "auto",
169
187
  backgroundColor: "#F5F5F5",
170
- padding: f === "mobile" ? "32px 16px" : "16px",
188
+ padding: c === "mobile" ? "32px 16px" : "16px",
171
189
  display: "flex",
172
190
  justifyContent: "center"
173
191
  }, children: /* @__PURE__ */ e(
@@ -175,16 +193,16 @@ function Ve({
175
193
  {
176
194
  sx: {
177
195
  width: "100%",
178
- maxWidth: f === "mobile" ? "370px" : "100%",
179
- height: f === "mobile" ? "800px" : "100%",
196
+ maxWidth: c === "mobile" ? "370px" : "100%",
197
+ height: c === "mobile" ? "800px" : "100%",
180
198
  border: "none",
181
199
  overflow: "hidden"
182
200
  },
183
201
  children: /* @__PURE__ */ e(
184
202
  "iframe",
185
203
  {
186
- ref: x,
187
- srcDoc: b,
204
+ ref: v,
205
+ srcDoc: y,
188
206
  style: {
189
207
  width: "100%",
190
208
  height: "100%",
@@ -207,10 +225,10 @@ function Ve({
207
225
  width: "100%",
208
226
  minHeight: 0,
209
227
  minWidth: 0,
210
- ...A
228
+ ...ne
211
229
  },
212
230
  children: [
213
- Y && /* @__PURE__ */ d(
231
+ de && /* @__PURE__ */ d(
214
232
  i,
215
233
  {
216
234
  sx: {
@@ -225,60 +243,76 @@ function Ve({
225
243
  children: [
226
244
  /* @__PURE__ */ d(i, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
227
245
  /* @__PURE__ */ d(
228
- O,
246
+ K,
229
247
  {
230
- value: s,
248
+ value: a,
231
249
  exclusive: !0,
232
- onChange: J,
250
+ onChange: ue,
233
251
  size: "small",
234
252
  "aria-label": r("htmlEditor.mode.split"),
235
253
  children: [
236
- /* @__PURE__ */ e(u, { title: r("htmlEditor.tooltips.splitView"), arrow: !0, children: /* @__PURE__ */ e(p, { value: "split", "aria-label": r("htmlEditor.mode.split"), children: /* @__PURE__ */ e(Ee, { fontSize: "small" }) }) }),
237
- /* @__PURE__ */ e(u, { title: r("htmlEditor.tooltips.codeOnly"), arrow: !0, children: /* @__PURE__ */ e(p, { value: "code", "aria-label": r("htmlEditor.mode.code"), children: /* @__PURE__ */ e(we, { fontSize: "small" }) }) }),
238
- /* @__PURE__ */ e(u, { title: r("htmlEditor.tooltips.previewOnly"), arrow: !0, children: /* @__PURE__ */ e(p, { value: "preview", "aria-label": r("htmlEditor.mode.preview"), children: /* @__PURE__ */ e(ye, { fontSize: "small" }) }) })
254
+ /* @__PURE__ */ e(g, { title: r("htmlEditor.tooltips.splitView"), arrow: !0, slotProps: f, children: /* @__PURE__ */ e(x, { value: "split", "aria-label": r("htmlEditor.mode.split"), children: /* @__PURE__ */ e(We, { fontSize: "small" }) }) }),
255
+ /* @__PURE__ */ e(g, { title: r("htmlEditor.tooltips.codeOnly"), arrow: !0, slotProps: f, children: /* @__PURE__ */ e(x, { value: "code", "aria-label": r("htmlEditor.mode.code"), children: /* @__PURE__ */ e(Ve, { fontSize: "small" }) }) }),
256
+ /* @__PURE__ */ e(g, { title: r("htmlEditor.tooltips.previewOnly"), arrow: !0, slotProps: f, children: /* @__PURE__ */ e(x, { value: "preview", "aria-label": r("htmlEditor.mode.preview"), children: /* @__PURE__ */ e(je, { fontSize: "small" }) }) })
239
257
  ]
240
258
  }
241
259
  ),
242
- /* @__PURE__ */ d(xe, { size: "small", sx: { minWidth: 140 }, children: [
243
- /* @__PURE__ */ e(be, { id: "theme-select-label", children: r("htmlEditor.theme") }),
260
+ /* @__PURE__ */ d(ze, { size: "small", sx: { minWidth: 140 }, children: [
261
+ /* @__PURE__ */ e(Be, { id: "theme-select-label", children: r("htmlEditor.theme") }),
244
262
  /* @__PURE__ */ d(
245
- ve,
263
+ Ie,
246
264
  {
247
265
  labelId: "theme-select-label",
248
266
  id: "theme-select",
249
- value: L,
267
+ value: D,
250
268
  label: r("htmlEditor.theme"),
251
269
  onChange: (o) => {
252
270
  const t = o.target.value;
253
- q(t), console.log("theme changed to", t), ke(t);
271
+ he(t), console.log("theme changed to", t), Xe(t);
254
272
  },
255
273
  sx: {
256
- fontSize: "0.875rem",
274
+ // fontSize: '0.875rem',
257
275
  "& .MuiSelect-select": {
258
276
  py: 0.5
259
277
  }
260
278
  },
261
279
  children: [
262
- /* @__PURE__ */ e(z, { children: r("htmlEditor.lightThemes") }),
263
- Object.entries(Ce).map(([o, t]) => /* @__PURE__ */ e(B, { value: o, children: t }, o)),
264
- /* @__PURE__ */ e(z, { children: r("htmlEditor.darkThemes") }),
265
- Object.entries(Se).map(([o, t]) => /* @__PURE__ */ e(B, { value: o, children: t }, o))
280
+ /* @__PURE__ */ e(U, { children: r("htmlEditor.lightThemes") }),
281
+ Object.entries(Ae).map(([o, t]) => /* @__PURE__ */ e(J, { value: o, children: t }, o)),
282
+ /* @__PURE__ */ e(U, { children: r("htmlEditor.darkThemes") }),
283
+ Object.entries(Ge).map(([o, t]) => /* @__PURE__ */ e(J, { value: o, children: t }, o))
266
284
  ]
267
285
  }
268
286
  )
269
287
  ] })
270
288
  ] }),
271
- /* @__PURE__ */ e(i, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: s !== "code" && /* @__PURE__ */ d(
272
- O,
289
+ /* @__PURE__ */ e(i, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: a !== "code" && /* @__PURE__ */ d(
290
+ K,
273
291
  {
274
- value: f,
292
+ value: w,
275
293
  exclusive: !0,
276
- onChange: Q,
294
+ onChange: fe,
277
295
  size: "small",
278
296
  "aria-label": r("htmlEditor.device.desktop"),
279
297
  children: [
280
- /* @__PURE__ */ e(u, { title: r("htmlEditor.tooltips.desktopView"), arrow: !0, children: /* @__PURE__ */ e(p, { value: "desktop", "aria-label": r("htmlEditor.device.desktop"), children: /* @__PURE__ */ e(Le, { fontSize: "small" }) }) }),
281
- /* @__PURE__ */ e(u, { title: r("htmlEditor.tooltips.mobileView"), arrow: !0, children: /* @__PURE__ */ e(p, { value: "mobile", "aria-label": r("htmlEditor.device.mobile"), children: /* @__PURE__ */ e(Te, { fontSize: "small" }) }) })
298
+ /* @__PURE__ */ e(g, { title: r("htmlEditor.tooltips.desktopView"), arrow: !0, slotProps: f, children: /* @__PURE__ */ e(
299
+ x,
300
+ {
301
+ value: "desktop",
302
+ "aria-label": r("htmlEditor.device.desktop"),
303
+ sx: w === "desktop" ? S : void 0,
304
+ children: /* @__PURE__ */ e(_e, { fontSize: "small" })
305
+ }
306
+ ) }),
307
+ /* @__PURE__ */ e(g, { title: r("htmlEditor.tooltips.mobileView"), arrow: !0, slotProps: f, children: /* @__PURE__ */ e(
308
+ x,
309
+ {
310
+ value: "mobile",
311
+ "aria-label": r("htmlEditor.device.mobile"),
312
+ sx: w === "mobile" ? S : void 0,
313
+ children: /* @__PURE__ */ e(Re, { fontSize: "small" })
314
+ }
315
+ ) })
282
316
  ]
283
317
  }
284
318
  ) })
@@ -296,12 +330,12 @@ function Ve({
296
330
  overflow: "hidden"
297
331
  },
298
332
  children: [
299
- s === "split" && /* @__PURE__ */ d(re, { children: [
300
- /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: D() }),
301
- /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: C() })
333
+ a === "split" && /* @__PURE__ */ d(ye, { children: [
334
+ /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: H() }),
335
+ /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: F() })
302
336
  ] }),
303
- s === "code" && /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: D() }),
304
- s === "preview" && /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: C() })
337
+ a === "code" && /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: H() }),
338
+ a === "preview" && /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: F() })
305
339
  ]
306
340
  }
307
341
  )
@@ -310,6 +344,6 @@ function Ve({
310
344
  );
311
345
  }
312
346
  export {
313
- Ve as HtmlEditor,
314
- Ve as default
347
+ lt as HtmlEditor,
348
+ lt as default
315
349
  };
package/dist/index.js CHANGED
@@ -325,7 +325,7 @@ function ui({
325
325
  function di() {
326
326
  return fo($o);
327
327
  }
328
- const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6DC9F", mi = "#6C0E7C", fi = "#CC996C", hi = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', gi = 'ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace', y = ko({
328
+ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6DC9F", mi = "#6C0E7C", fi = "#CC996C", hi = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', gi = 'ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace', I = ko({
329
329
  palette: {
330
330
  background: {
331
331
  default: "#f2f5f7"
@@ -338,7 +338,7 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
338
338
  typography: {
339
339
  fontFamily: hi
340
340
  }
341
- }), Ci = ko(y, {
341
+ }), Ci = ko(I, {
342
342
  palette: {
343
343
  brand: {
344
344
  navy: pi,
@@ -400,7 +400,7 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
400
400
  MuiAlert: {
401
401
  styleOverrides: {
402
402
  root: {
403
- fontSize: y.typography.pxToRem(14)
403
+ fontSize: I.typography.pxToRem(14)
404
404
  },
405
405
  action: {
406
406
  paddingTop: 0,
@@ -414,7 +414,7 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
414
414
  MuiStepLabel: {
415
415
  styleOverrides: {
416
416
  label: {
417
- fontWeight: y.typography.fontWeightMedium
417
+ fontWeight: I.typography.fontWeightMedium
418
418
  }
419
419
  }
420
420
  },
@@ -424,15 +424,15 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
424
424
  },
425
425
  styleOverrides: {
426
426
  paper: {
427
- borderRadius: y.spacing(1)
427
+ borderRadius: I.spacing(1)
428
428
  }
429
429
  }
430
430
  },
431
431
  MuiDialogContent: {
432
432
  styleOverrides: {
433
433
  root: {
434
- paddingTop: y.spacing(1),
435
- paddingBottom: y.spacing(2)
434
+ paddingTop: I.spacing(1),
435
+ paddingBottom: I.spacing(2)
436
436
  }
437
437
  }
438
438
  },
@@ -442,8 +442,8 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
442
442
  },
443
443
  styleOverrides: {
444
444
  root: {
445
- paddingTop: y.spacing(3),
446
- paddingBottom: y.spacing(1)
445
+ paddingTop: I.spacing(3),
446
+ paddingBottom: I.spacing(1)
447
447
  }
448
448
  }
449
449
  },
@@ -451,23 +451,23 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
451
451
  styleOverrides: {
452
452
  root: {
453
453
  borderTop: "1px solid",
454
- borderTopColor: y.palette.divider,
455
- marginTop: y.spacing(2.5),
456
- padding: `${y.spacing(1.5)} ${y.spacing(3)}`
454
+ borderTopColor: I.palette.divider,
455
+ marginTop: I.spacing(2.5),
456
+ padding: `${I.spacing(1.5)} ${I.spacing(3)}`
457
457
  }
458
458
  }
459
459
  },
460
460
  MuiTableCell: {
461
461
  styleOverrides: {
462
462
  root: {
463
- ...y.typography.body2,
464
- borderColor: y.palette.grey[200]
463
+ ...I.typography.body2,
464
+ borderColor: I.palette.grey[200]
465
465
  },
466
466
  head: {
467
- ...y.typography.overline,
468
- fontWeight: y.typography.fontWeightMedium,
467
+ ...I.typography.overline,
468
+ fontWeight: I.typography.fontWeightMedium,
469
469
  letterSpacing: "0.075em",
470
- color: y.palette.text.secondary
470
+ color: I.palette.text.secondary
471
471
  }
472
472
  }
473
473
  },
@@ -484,7 +484,7 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
484
484
  styleOverrides: {
485
485
  root: {
486
486
  textTransform: "uppercase",
487
- fontSize: y.typography.pxToRem(14)
487
+ fontSize: I.typography.pxToRem(14)
488
488
  }
489
489
  }
490
490
  },
@@ -492,23 +492,23 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
492
492
  styleOverrides: {
493
493
  root: {
494
494
  "&.MuiChip-filledError, &.MuiChip-filledSuccess": {
495
- fill: y.palette.primary.contrastText
495
+ fill: I.palette.primary.contrastText
496
496
  }
497
497
  },
498
498
  sizeSmall: {
499
- borderRadius: y.spacing(0.5),
499
+ borderRadius: I.spacing(0.5),
500
500
  fontSize: 12
501
501
  },
502
502
  iconSmall: {
503
503
  fontSize: 14,
504
- marginLeft: y.spacing(1)
504
+ marginLeft: I.spacing(1)
505
505
  },
506
506
  colorSecondary: {
507
- borderColor: y.palette.grey[400],
508
- color: y.palette.text.secondary
507
+ borderColor: I.palette.grey[400],
508
+ color: I.palette.text.secondary
509
509
  },
510
510
  label: {
511
- fontWeight: y.typography.fontWeightMedium
511
+ fontWeight: I.typography.fontWeightMedium
512
512
  }
513
513
  }
514
514
  },
@@ -522,11 +522,11 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
522
522
  MuiTooltip: {
523
523
  styleOverrides: {
524
524
  tooltip: {
525
- fontSize: y.typography.pxToRem(12),
526
- backgroundColor: wt(y.palette.text.primary, 0.9)
525
+ // fontSize: BASE_THEME.typography.pxToRem(12),
526
+ backgroundColor: wt(I.palette.text.primary, 0.9)
527
527
  },
528
528
  arrow: {
529
- color: wt(y.palette.text.primary, 0.9)
529
+ color: wt(I.palette.text.primary, 0.9)
530
530
  }
531
531
  }
532
532
  },
@@ -541,10 +541,10 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
541
541
  },
542
542
  rail: {
543
543
  height: 1,
544
- backgroundColor: y.palette.grey[500]
544
+ backgroundColor: I.palette.grey[500]
545
545
  },
546
546
  mark: {
547
- backgroundColor: y.palette.grey[500]
547
+ backgroundColor: I.palette.grey[500]
548
548
  },
549
549
  markActive: {
550
550
  height: 0
@@ -576,7 +576,7 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
576
576
  styleOverrides: {
577
577
  root: {
578
578
  "&.MuiButton-containedSecondary.Mui-disabled": {
579
- backgroundColor: y.palette.grey[100]
579
+ backgroundColor: I.palette.grey[100]
580
580
  }
581
581
  }
582
582
  }
@@ -589,10 +589,10 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
589
589
  MuiIconButton: {
590
590
  styleOverrides: {
591
591
  edgeStart: {
592
- marginLeft: y.spacing(-1)
592
+ marginLeft: I.spacing(-1)
593
593
  },
594
594
  colorSecondary: {
595
- color: y.palette.grey[500]
595
+ color: I.palette.grey[500]
596
596
  }
597
597
  }
598
598
  },
@@ -605,10 +605,10 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
605
605
  borderRadius: 8
606
606
  },
607
607
  textPrimary: {
608
- color: y.palette.text.primary
608
+ color: I.palette.text.primary
609
609
  },
610
610
  textSecondary: {
611
- color: y.palette.text.secondary
611
+ color: I.palette.text.secondary
612
612
  },
613
613
  outlinedPrimary: {
614
614
  // borderColor: BASE_THEME.palette.grey[300],
@@ -619,13 +619,13 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
619
619
  // },
620
620
  },
621
621
  containedSecondary: {
622
- backgroundColor: y.palette.common.white,
623
- border: `1px solid ${y.palette.grey[300]}`,
624
- color: y.palette.text.primary,
622
+ backgroundColor: I.palette.common.white,
623
+ border: `1px solid ${I.palette.grey[300]}`,
624
+ color: I.palette.text.primary,
625
625
  "&:hover, &:active, &:focus": {
626
- backgroundColor: y.palette.common.white,
627
- borderColor: y.palette.grey[500],
628
- color: y.palette.text.primary
626
+ backgroundColor: I.palette.common.white,
627
+ borderColor: I.palette.grey[500],
628
+ color: I.palette.text.primary
629
629
  }
630
630
  }
631
631
  }
@@ -633,8 +633,8 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
633
633
  MuiToggleButton: {
634
634
  styleOverrides: {
635
635
  root: {
636
- paddingLeft: y.spacing(1.5),
637
- paddingRight: y.spacing(1.5)
636
+ paddingLeft: I.spacing(1.5),
637
+ paddingRight: I.spacing(1.5)
638
638
  }
639
639
  }
640
640
  },
@@ -642,35 +642,35 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
642
642
  styleOverrides: {
643
643
  root: {
644
644
  "&:not(.Mui-disabled, .Mui-error):before": {
645
- borderBottom: `1px solid ${y.palette.grey[400]}`
645
+ borderBottom: `1px solid ${I.palette.grey[400]}`
646
646
  },
647
647
  "&:hover:not(.Mui-disabled, .Mui-error):before": {
648
- borderBottom: `1px solid ${y.palette.grey[500]} !important`
648
+ borderBottom: `1px solid ${I.palette.grey[500]} !important`
649
649
  },
650
650
  "&:after": {
651
- borderBottom: `1px solid ${y.palette.text.primary} !important`
651
+ borderBottom: `1px solid ${I.palette.text.primary} !important`
652
652
  },
653
653
  "&.MuiOutlinedInput-root:not(.Mui-error)": {
654
654
  "& fieldset": {
655
- borderColor: y.palette.grey[300],
655
+ borderColor: I.palette.grey[300],
656
656
  transition: "border-color 0.2s"
657
657
  }
658
658
  },
659
659
  "&.MuiOutlinedInput-root:not(.Mui-disabled, .Mui-error)": {
660
660
  "&:hover fieldset": {
661
- borderColor: y.palette.grey[400]
661
+ borderColor: I.palette.grey[400]
662
662
  },
663
663
  "&.Mui-focused fieldset": {
664
- borderColor: y.palette.text.secondary,
664
+ borderColor: I.palette.text.secondary,
665
665
  borderWidth: 1
666
666
  }
667
667
  }
668
668
  },
669
669
  input: {
670
- fontSize: y.typography.pxToRem(14),
670
+ fontSize: I.typography.pxToRem(14),
671
671
  "&.Mui-disabled": {
672
672
  WebkitTextFillColor: "inherit",
673
- color: y.palette.text.secondary
673
+ color: I.palette.text.secondary
674
674
  }
675
675
  },
676
676
  inputSizeSmall: {}
@@ -690,8 +690,8 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
690
690
  styleOverrides: {
691
691
  root: {
692
692
  "& .MuiTypography-root": {
693
- fontSize: y.typography.pxToRem(14),
694
- color: y.palette.text.secondary
693
+ fontSize: I.typography.pxToRem(14),
694
+ color: I.palette.text.secondary
695
695
  }
696
696
  }
697
697
  }
@@ -703,9 +703,9 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
703
703
  styleOverrides: {
704
704
  shrink: {
705
705
  transform: "scale(0.85)",
706
- fontWeight: y.typography.fontWeightMedium,
706
+ fontWeight: I.typography.fontWeightMedium,
707
707
  "&.Mui-focused": {
708
- color: y.palette.text.primary
708
+ color: I.palette.text.primary
709
709
  },
710
710
  "&.MuiInputLabel-standard": {
711
711
  transform: "translate(0, -4px) scale(0.85)",
@@ -724,7 +724,7 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
724
724
  styleOverrides: {
725
725
  indicator: {
726
726
  height: 1,
727
- backgroundColor: y.palette.text.primary
727
+ backgroundColor: I.palette.text.primary
728
728
  }
729
729
  }
730
730
  },
@@ -732,19 +732,19 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
732
732
  styleOverrides: {
733
733
  root: {
734
734
  textTransform: "none",
735
- minWidth: y.spacing(2),
736
- paddingLeft: y.spacing(1.5),
737
- paddingRight: y.spacing(1.5),
738
- fontSize: y.typography.pxToRem(14),
739
- fontFamily: y.typography.fontFamily,
735
+ minWidth: I.spacing(2),
736
+ paddingLeft: I.spacing(1.5),
737
+ paddingRight: I.spacing(1.5),
738
+ fontSize: I.typography.pxToRem(14),
739
+ fontFamily: I.typography.fontFamily,
740
740
  lineHeight: 1.5,
741
- fontWeight: y.typography.fontWeightMedium,
741
+ fontWeight: I.typography.fontWeightMedium,
742
742
  transition: "color 0.2s",
743
743
  "&.Mui-selected": {
744
- color: y.palette.text.primary
744
+ color: I.palette.text.primary
745
745
  },
746
746
  "&:hover": {
747
- color: y.palette.text.primary
747
+ color: I.palette.text.primary
748
748
  }
749
749
  }
750
750
  }
@@ -759,69 +759,69 @@ const pi = "#212443", et = "#1E40AF", Vn = "#1F8466", nt = "#E81212", kn = "#F6D
759
759
  MuiCardHeader: {
760
760
  styleOverrides: {
761
761
  title: {
762
- fontSize: y.typography.pxToRem(18),
763
- fontWeight: y.typography.fontWeightMedium
762
+ fontSize: I.typography.pxToRem(18),
763
+ fontWeight: I.typography.fontWeightMedium
764
764
  }
765
765
  }
766
766
  }
767
767
  },
768
768
  typography: {
769
- fontFamily: y.typography.fontFamily,
769
+ fontFamily: I.typography.fontFamily,
770
770
  h1: {
771
- fontFamily: y.typography.fontFamily,
772
- fontSize: y.typography.pxToRem(40),
771
+ fontFamily: I.typography.fontFamily,
772
+ fontSize: I.typography.pxToRem(40),
773
773
  lineHeight: 1.2,
774
774
  letterSpacing: "-0.02em",
775
- fontWeight: y.typography.fontWeightMedium
775
+ fontWeight: I.typography.fontWeightMedium
776
776
  },
777
777
  h2: {
778
- fontFamily: y.typography.fontFamily,
779
- fontSize: y.typography.pxToRem(32),
778
+ fontFamily: I.typography.fontFamily,
779
+ fontSize: I.typography.pxToRem(32),
780
780
  lineHeight: 1.2,
781
781
  letterSpacing: "-0.02em",
782
- fontWeight: y.typography.fontWeightMedium
782
+ fontWeight: I.typography.fontWeightMedium
783
783
  },
784
784
  h3: {
785
- fontFamily: y.typography.fontFamily,
786
- fontSize: y.typography.pxToRem(24),
785
+ fontFamily: I.typography.fontFamily,
786
+ fontSize: I.typography.pxToRem(24),
787
787
  lineHeight: 1.5,
788
788
  letterSpacing: "-0.01em",
789
- fontWeight: y.typography.fontWeightMedium
789
+ fontWeight: I.typography.fontWeightMedium
790
790
  },
791
791
  h4: {
792
- fontFamily: y.typography.fontFamily,
793
- fontSize: y.typography.pxToRem(20),
792
+ fontFamily: I.typography.fontFamily,
793
+ fontSize: I.typography.pxToRem(20),
794
794
  lineHeight: 1.5,
795
795
  letterSpacing: "-0.01em",
796
- fontWeight: y.typography.fontWeightMedium
796
+ fontWeight: I.typography.fontWeightMedium
797
797
  },
798
798
  h5: {
799
- fontFamily: y.typography.fontFamily,
800
- fontSize: y.typography.pxToRem(18),
799
+ fontFamily: I.typography.fontFamily,
800
+ fontSize: I.typography.pxToRem(18),
801
801
  lineHeight: 1.5,
802
802
  letterSpacing: "-0.01em",
803
- fontWeight: y.typography.fontWeightMedium
803
+ fontWeight: I.typography.fontWeightMedium
804
804
  },
805
805
  h6: {
806
- fontFamily: y.typography.fontFamily,
807
- fontSize: y.typography.pxToRem(16),
806
+ fontFamily: I.typography.fontFamily,
807
+ fontSize: I.typography.pxToRem(16),
808
808
  lineHeight: 1.5,
809
809
  letterSpacing: "-0.005em",
810
- fontWeight: y.typography.fontWeightMedium
810
+ fontWeight: I.typography.fontWeightMedium
811
811
  },
812
812
  body1: {
813
- fontSize: y.typography.pxToRem(14)
813
+ fontSize: I.typography.pxToRem(14)
814
814
  },
815
815
  body2: {
816
- fontSize: y.typography.pxToRem(12)
816
+ fontSize: I.typography.pxToRem(12)
817
817
  },
818
818
  overline: {
819
- fontWeight: y.typography.fontWeightMedium,
819
+ fontWeight: I.typography.fontWeightMedium,
820
820
  letterSpacing: "0.05em"
821
821
  },
822
822
  button: {
823
823
  textTransform: "none",
824
- fontWeight: y.typography.fontWeightMedium,
824
+ fontWeight: I.typography.fontWeightMedium,
825
825
  lineHeight: 1.5
826
826
  },
827
827
  caption: {
@@ -1501,7 +1501,7 @@ function Oi({ data: e, setData: o }) {
1501
1501
  else
1502
1502
  g.length === v ? R = g : R = Array.from(
1503
1503
  { length: v },
1504
- (I, k) => g[k] || { childrenIds: [] }
1504
+ (y, k) => g[k] || { childrenIds: [] }
1505
1505
  );
1506
1506
  r({
1507
1507
  ...e,
@@ -2428,22 +2428,22 @@ const Un = [
2428
2428
  };
2429
2429
  function Ui({ data: e, setData: o }) {
2430
2430
  var v, O, R;
2431
- const { t, language: i } = q(), [, s] = M(null), [l, r] = M(null), [u, a] = M(null), [c, d] = M(null), g = ce(!1), f = (I) => {
2432
- const k = er.safeParse(I);
2431
+ const { t, language: i } = q(), [, s] = M(null), [l, r] = M(null), [u, a] = M(null), [c, d] = M(null), g = ce(!1), f = (y) => {
2432
+ const k = er.safeParse(y);
2433
2433
  k.success ? (o(k.data), s(null)) : s(k.error);
2434
2434
  }, h = ((v = e.props) == null ? void 0 : v.iconStyle) || "origin-colorful", p = ((O = e.props) == null ? void 0 : O.iconSize) ?? 36, x = ((R = e.props) == null ? void 0 : R.socials) || [];
2435
- x.map((I) => I.platform);
2436
- const b = (I) => {
2435
+ x.map((y) => y.platform);
2436
+ const b = (y) => {
2437
2437
  f({
2438
2438
  ...e,
2439
2439
  props: {
2440
2440
  ...e.props,
2441
- iconStyle: I
2441
+ iconStyle: y
2442
2442
  }
2443
2443
  });
2444
- }, B = (I, k) => {
2444
+ }, B = (y, k) => {
2445
2445
  const z = [...x];
2446
- z[I] = { ...z[I], url: k }, f({
2446
+ z[y] = { ...z[y], url: k }, f({
2447
2447
  ...e,
2448
2448
  props: {
2449
2449
  ...e.props,
@@ -2451,9 +2451,9 @@ function Ui({ data: e, setData: o }) {
2451
2451
  socials: z
2452
2452
  }
2453
2453
  });
2454
- }, m = (I, k) => {
2454
+ }, m = (y, k) => {
2455
2455
  const z = [...x];
2456
- z[I] = { ...z[I], platform: k }, f({
2456
+ z[y] = { ...z[y], platform: k }, f({
2457
2457
  ...e,
2458
2458
  props: {
2459
2459
  ...e.props,
@@ -2461,8 +2461,8 @@ function Ui({ data: e, setData: o }) {
2461
2461
  socials: z
2462
2462
  }
2463
2463
  });
2464
- }, A = (I) => {
2465
- const k = x.filter((z, $) => $ !== I);
2464
+ }, A = (y) => {
2465
+ const k = x.filter((z, $) => $ !== y);
2466
2466
  f({
2467
2467
  ...e,
2468
2468
  props: {
@@ -2472,7 +2472,7 @@ function Ui({ data: e, setData: o }) {
2472
2472
  }
2473
2473
  });
2474
2474
  }, P = () => {
2475
- const I = new Set(x.map((U) => U.platform)), z = Un.find((U) => !I.has(U)) || Un[0], $ = [...x, { platform: z, url: null }];
2475
+ const y = new Set(x.map((U) => U.platform)), z = Un.find((U) => !y.has(U)) || Un[0], $ = [...x, { platform: z, url: null }];
2476
2476
  f({
2477
2477
  ...e,
2478
2478
  props: {
@@ -2481,35 +2481,35 @@ function Ui({ data: e, setData: o }) {
2481
2481
  socials: $
2482
2482
  }
2483
2483
  });
2484
- }, X = (I, k) => {
2484
+ }, X = (y, k) => {
2485
2485
  if (!g.current) {
2486
2486
  k.preventDefault();
2487
2487
  return;
2488
2488
  }
2489
- r(I), k.dataTransfer.effectAllowed = "move", k.dataTransfer.setData("text/plain", `social-${I}`);
2489
+ r(y), k.dataTransfer.effectAllowed = "move", k.dataTransfer.setData("text/plain", `social-${y}`);
2490
2490
  }, T = () => {
2491
2491
  g.current = !0;
2492
2492
  };
2493
2493
  Z(() => {
2494
- const I = () => {
2494
+ const y = () => {
2495
2495
  g.current = !1;
2496
2496
  };
2497
- return document.addEventListener("mouseup", I), () => {
2498
- document.removeEventListener("mouseup", I);
2497
+ return document.addEventListener("mouseup", y), () => {
2498
+ document.removeEventListener("mouseup", y);
2499
2499
  };
2500
2500
  }, []);
2501
- const K = (I, k) => {
2502
- if (I.preventDefault(), I.stopPropagation(), l === null) return;
2501
+ const K = (y, k) => {
2502
+ if (y.preventDefault(), y.stopPropagation(), l === null) return;
2503
2503
  if (l === k) {
2504
2504
  a(null), d(null);
2505
2505
  return;
2506
2506
  }
2507
- const z = I.currentTarget.getBoundingClientRect(), $ = I.clientY, U = z.top + z.height / 2, Y = $ < U ? "top" : "bottom";
2507
+ const z = y.currentTarget.getBoundingClientRect(), $ = y.clientY, U = z.top + z.height / 2, Y = $ < U ? "top" : "bottom";
2508
2508
  a(k), d(Y);
2509
- }, re = (I) => {
2510
- I.preventDefault(), I.stopPropagation();
2511
- }, G = (I, k) => {
2512
- if (I.preventDefault(), I.stopPropagation(), l === null) {
2509
+ }, re = (y) => {
2510
+ y.preventDefault(), y.stopPropagation();
2511
+ }, G = (y, k) => {
2512
+ if (y.preventDefault(), y.stopPropagation(), l === null) {
2513
2513
  r(null), a(null), d(null);
2514
2514
  return;
2515
2515
  }
@@ -2537,10 +2537,10 @@ function Ui({ data: e, setData: o }) {
2537
2537
  V,
2538
2538
  {
2539
2539
  spacing: 1,
2540
- onDragOver: (I) => {
2540
+ onDragOver: (y) => {
2541
2541
  if (l !== null) {
2542
- I.preventDefault(), I.stopPropagation(), I.dataTransfer.dropEffect = "move";
2543
- const k = I.clientY, z = Array.from(I.currentTarget.querySelectorAll(".MuiPaper-root"));
2542
+ y.preventDefault(), y.stopPropagation(), y.dataTransfer.dropEffect = "move";
2543
+ const k = y.clientY, z = Array.from(y.currentTarget.querySelectorAll(".MuiPaper-root"));
2544
2544
  for (let $ = 0; $ < z.length; $++) {
2545
2545
  const U = z[$].getBoundingClientRect(), Y = U.top - 24, ue = U.bottom + 24;
2546
2546
  if (k >= Y && k <= ue) {
@@ -2551,11 +2551,11 @@ function Ui({ data: e, setData: o }) {
2551
2551
  }
2552
2552
  }
2553
2553
  },
2554
- onDrop: (I) => {
2555
- l !== null && u !== null && (I.preventDefault(), I.stopPropagation(), G(I, u));
2554
+ onDrop: (y) => {
2555
+ l !== null && u !== null && (y.preventDefault(), y.stopPropagation(), G(y, u));
2556
2556
  },
2557
- children: x.map((I, k) => {
2558
- const z = C ? rt[I.platform].zh : rt[I.platform].en, $ = l === k, U = u === k, Y = U && c === "top", ue = U && c === "bottom", he = `social-${k}`;
2557
+ children: x.map((y, k) => {
2558
+ const z = C ? rt[y.platform].zh : rt[y.platform].en, $ = l === k, U = u === k, Y = U && c === "top", ue = U && c === "bottom", he = `social-${k}`;
2559
2559
  return /* @__PURE__ */ w($e.Fragment, { children: [
2560
2560
  Y && /* @__PURE__ */ n(
2561
2561
  N,
@@ -2632,7 +2632,7 @@ function Ui({ data: e, setData: o }) {
2632
2632
  /* @__PURE__ */ n(
2633
2633
  br,
2634
2634
  {
2635
- value: I.platform,
2635
+ value: y.platform,
2636
2636
  onChange: (F) => m(k, F.target.value),
2637
2637
  size: "small",
2638
2638
  sx: { flex: 1, fontSize: "12px" },
@@ -2659,7 +2659,7 @@ function Ui({ data: e, setData: o }) {
2659
2659
  {
2660
2660
  label: "",
2661
2661
  placeholder: `${t("socials.iconUrl")} - ${z}`,
2662
- defaultValue: I.url || "",
2662
+ defaultValue: y.url || "",
2663
2663
  onChange: (F) => B(k, F || null)
2664
2664
  }
2665
2665
  ) })
@@ -2721,14 +2721,14 @@ function Ui({ data: e, setData: o }) {
2721
2721
  /* @__PURE__ */ n(at, { sx: { my: 1 } }),
2722
2722
  /* @__PURE__ */ w(N, { sx: { mb: 2 }, children: [
2723
2723
  /* @__PURE__ */ n(ie, { variant: "body2", sx: { color: "text.secondary", mb: 1, fontSize: "12px", fontWeight: 500 }, children: t("socials.iconStyle") }),
2724
- /* @__PURE__ */ n(V, { spacing: 1, sx: { mt: 1 }, children: Zo.map((I) => {
2725
- const k = C ? ro[I].zh : ro[I].en;
2724
+ /* @__PURE__ */ n(V, { spacing: 1, sx: { mt: 1 }, children: Zo.map((y) => {
2725
+ const k = C ? ro[y].zh : ro[y].en;
2726
2726
  return /* @__PURE__ */ n(
2727
2727
  zl,
2728
2728
  {
2729
- value: I,
2730
- selected: h === I,
2731
- onChange: () => b(I),
2729
+ value: y,
2730
+ selected: h === y,
2731
+ onChange: () => b(y),
2732
2732
  fullWidth: !0,
2733
2733
  size: "small",
2734
2734
  sx: {
@@ -2738,7 +2738,7 @@ function Ui({ data: e, setData: o }) {
2738
2738
  },
2739
2739
  children: k
2740
2740
  },
2741
- I
2741
+ y
2742
2742
  );
2743
2743
  }) })
2744
2744
  ] }),
@@ -2749,12 +2749,12 @@ function Ui({ data: e, setData: o }) {
2749
2749
  label: t("socials.iconSize"),
2750
2750
  iconLabel: /* @__PURE__ */ n(Bo, { sx: { fontSize: 16 } }),
2751
2751
  defaultValue: p,
2752
- onChange: (I) => {
2752
+ onChange: (y) => {
2753
2753
  f({
2754
2754
  ...e,
2755
2755
  props: {
2756
2756
  ...e.props,
2757
- iconSize: I
2757
+ iconSize: y
2758
2758
  }
2759
2759
  });
2760
2760
  },
@@ -2770,7 +2770,7 @@ function Ui({ data: e, setData: o }) {
2770
2770
  {
2771
2771
  names: ["backgroundColor", "padding"],
2772
2772
  value: e.style,
2773
- onChange: (I) => f({ ...e, style: I })
2773
+ onChange: (y) => f({ ...e, style: y })
2774
2774
  }
2775
2775
  )
2776
2776
  ] });
@@ -3578,8 +3578,8 @@ function Vt({ childrenIds: e, onChange: o, containerId: t, allowReplace: i = !1,
3578
3578
  D.preventDefault(), D.stopPropagation();
3579
3579
  const v = Dn();
3580
3580
  if (v) {
3581
- const O = _n(), R = _.getState().document, I = gn(O, t, R);
3582
- d(!I), I ? (D.dataTransfer.effectAllowed = "move", D.dataTransfer.dropEffect = "move") : (D.dataTransfer.effectAllowed = "none", D.dataTransfer.dropEffect = "none"), r(v);
3581
+ const O = _n(), R = _.getState().document, y = gn(O, t, R);
3582
+ d(!y), y ? (D.dataTransfer.effectAllowed = "move", D.dataTransfer.dropEffect = "move") : (D.dataTransfer.effectAllowed = "none", D.dataTransfer.dropEffect = "none"), r(v);
3583
3583
  const k = D.currentTarget.getBoundingClientRect(), z = D.clientY, $ = k.top + k.height / 2;
3584
3584
  if (z < $)
3585
3585
  a(C);
@@ -3625,7 +3625,7 @@ function Vt({ childrenIds: e, onChange: o, containerId: t, allowReplace: i = !1,
3625
3625
  window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, window.__isSidebarBlock = !1, r(null), a(null);
3626
3626
  return;
3627
3627
  }
3628
- const I = window.__isSidebarBlock === !0, k = I ? tn() : v;
3628
+ const y = window.__isSidebarBlock === !0, k = y ? tn() : v;
3629
3629
  if (t && k === t) {
3630
3630
  window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, r(null), a(null);
3631
3631
  return;
@@ -3637,9 +3637,9 @@ function Vt({ childrenIds: e, onChange: o, containerId: t, allowReplace: i = !1,
3637
3637
  }
3638
3638
  const $ = [...e];
3639
3639
  i && C >= 0 && C < e.length ? $.splice(C, 1, k) : $.splice(C, 0, k);
3640
- const U = I ? { containerId: null, columnIndex: null } : Q(z, v), Y = !I && U.containerId === t && U.columnIndex !== null;
3640
+ const U = y ? { containerId: null, columnIndex: null } : Q(z, v), Y = !y && U.containerId === t && U.columnIndex !== null;
3641
3641
  let ue = z;
3642
- !I && !Y && (ue = Cn(z, v, U), ee(ue)), setTimeout(() => {
3642
+ !y && !Y && (ue = Cn(z, v, U), ee(ue)), setTimeout(() => {
3643
3643
  o({
3644
3644
  blockId: k,
3645
3645
  block: R,
@@ -3680,14 +3680,14 @@ function Vt({ childrenIds: e, onChange: o, containerId: t, allowReplace: i = !1,
3680
3680
  window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, r(null), a(null);
3681
3681
  return;
3682
3682
  }
3683
- const I = _.getState().document;
3684
- if (!gn(v, t, I)) {
3683
+ const y = _.getState().document;
3684
+ if (!gn(v, t, y)) {
3685
3685
  window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, r(null), a(null), d(!1);
3686
3686
  return;
3687
3687
  }
3688
- const k = [R], z = O ? { containerId: null, columnIndex: null } : Q(I, C), $ = !O && z.containerId === t && z.columnIndex !== null;
3689
- let U = I;
3690
- !O && !$ && (U = Cn(I, C, z), ee(U)), setTimeout(() => {
3688
+ const k = [R], z = O ? { containerId: null, columnIndex: null } : Q(y, C), $ = !O && z.containerId === t && z.columnIndex !== null;
3689
+ let U = y;
3690
+ !O && !$ && (U = Cn(y, C, z), ee(U)), setTimeout(() => {
3691
3691
  o({
3692
3692
  blockId: R,
3693
3693
  block: v,
@@ -3724,7 +3724,7 @@ function Vt({ childrenIds: e, onChange: o, containerId: t, allowReplace: i = !1,
3724
3724
  e && e.length > 0;
3725
3725
  const re = /* @__PURE__ */ w(Yn, { children: [
3726
3726
  e.map((D, C) => {
3727
- const v = C === e.length - 1, O = l !== null && l !== D && !e.includes(l), R = u === C && l !== null && l !== D && !O, I = (v && u === e.length || !v && u === C + 1) && l !== null && l !== D && (!O || !i), k = l ? Q(S, l) : null, z = Q(S, D), $ = l && l !== D && k && k.columnIndex !== null && z.columnIndex !== null && k.containerId === z.containerId && k.containerId !== null && k.columnIndex !== z.columnIndex, U = k && k.columnIndex !== null && z.columnIndex !== null && k.containerId === z.containerId && k.columnIndex !== z.columnIndex, Y = l ? S[l] : null, ue = (Y == null ? void 0 : Y.type) === "Container" || (Y == null ? void 0 : Y.type) === "ColumnsContainer", he = O && k && k.columnIndex === null && // 外部元素不在列中
3727
+ const v = C === e.length - 1, O = l !== null && l !== D && !e.includes(l), R = u === C && l !== null && l !== D && !O, y = (v && u === e.length || !v && u === C + 1) && l !== null && l !== D && (!O || !i), k = l ? Q(S, l) : null, z = Q(S, D), $ = l && l !== D && k && k.columnIndex !== null && z.columnIndex !== null && k.containerId === z.containerId && k.containerId !== null && k.columnIndex !== z.columnIndex, U = k && k.columnIndex !== null && z.columnIndex !== null && k.containerId === z.containerId && k.columnIndex !== z.columnIndex, Y = l ? S[l] : null, ue = (Y == null ? void 0 : Y.type) === "Container" || (Y == null ? void 0 : Y.type) === "ColumnsContainer", he = O && k && k.columnIndex === null && // 外部元素不在列中
3728
3728
  z.columnIndex !== null && // 目标在列中
3729
3729
  !i && // 列有元素
3730
3730
  !U && // 不是跨列拖拽
@@ -4160,7 +4160,7 @@ function Vt({ childrenIds: e, onChange: o, containerId: t, allowReplace: i = !1,
4160
4160
  backgroundColor: c ? "#d3d9dd" : "primary.main",
4161
4161
  zIndex: 1e3,
4162
4162
  pointerEvents: "none"
4163
- } : I || ar ? {
4163
+ } : y || ar ? {
4164
4164
  content: '""',
4165
4165
  position: "absolute",
4166
4166
  bottom: -2,
@@ -4213,17 +4213,17 @@ function pa({ style: e, props: o }) {
4213
4213
  }
4214
4214
  let O = T, R = X;
4215
4215
  v !== null && X.type && (O = `block-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, R = JSON.parse(JSON.stringify(X)));
4216
- const I = [];
4216
+ const y = [];
4217
4217
  for (let Y = 0; Y < a; Y++)
4218
4218
  if (Y === P) {
4219
4219
  const ue = v !== null ? K.map((he) => he === T ? O : he) : K;
4220
- I.push({ childrenIds: ue });
4220
+ y.push({ childrenIds: ue });
4221
4221
  } else if (Y === v) {
4222
4222
  const ue = C[Y], he = ((ue == null ? void 0 : ue.childrenIds) || []).filter((F) => F !== T);
4223
- I.push({ childrenIds: he });
4223
+ y.push({ childrenIds: he });
4224
4224
  } else {
4225
4225
  const ue = C[Y];
4226
- I.push(ue ? { childrenIds: ue.childrenIds || [] } : { childrenIds: [] });
4226
+ y.push(ue ? { childrenIds: ue.childrenIds || [] } : { childrenIds: [] });
4227
4227
  }
4228
4228
  const k = {
4229
4229
  [t]: {
@@ -4233,12 +4233,12 @@ function pa({ style: e, props: o }) {
4233
4233
  props: {
4234
4234
  ...u,
4235
4235
  columnsCount: a,
4236
- columns: I
4236
+ columns: y
4237
4237
  }
4238
4238
  })
4239
4239
  }
4240
4240
  };
4241
- k[t].data.props && (k[t].data.props.columns = I, k[t].data.props.columnsCount = a), X.type ? (v !== null ? k[O] = R : G || (k[T] = X), ee(k), X.type && Ve(O)) : ee(k);
4241
+ k[t].data.props && (k[t].data.props.columns = y, k[t].data.props.columnsCount = a), X.type ? (v !== null ? k[O] = R : G || (k[T] = X), ee(k), X.type && Ve(O)) : ee(k);
4242
4242
  }, f = ve()[t], h = f && f.type === "ColumnsContainer" && ((A = f.data.props) == null ? void 0 : A.columns) || c, S = ((u == null ? void 0 : u.contentAlignment) ?? "middle") === "stretch", x = u == null ? void 0 : u.columnHeights, b = {
4243
4243
  width: "100%",
4244
4244
  height: "100%",
@@ -4419,25 +4419,25 @@ function ba(e) {
4419
4419
  }
4420
4420
  };
4421
4421
  } else {
4422
- const v = D.data, R = (D.type === "Container" ? ((re = v.props) == null ? void 0 : re.childrenIds) || [] : v.childrenIds || []).filter((I) => I !== c);
4422
+ const v = D.data, R = (D.type === "Container" ? ((re = v.props) == null ? void 0 : re.childrenIds) || [] : v.childrenIds || []).filter((y) => y !== c);
4423
4423
  if (D.type === "Container") {
4424
- const I = D.data;
4424
+ const y = D.data;
4425
4425
  C[G.containerId] = {
4426
4426
  ...D,
4427
4427
  data: {
4428
- ...I,
4428
+ ...y,
4429
4429
  props: {
4430
- ...I.props,
4430
+ ...y.props,
4431
4431
  childrenIds: R
4432
4432
  }
4433
4433
  }
4434
4434
  };
4435
4435
  } else {
4436
- const I = D.data;
4436
+ const y = D.data;
4437
4437
  C[G.containerId] = {
4438
4438
  ...D,
4439
4439
  data: {
4440
- ...I,
4440
+ ...y,
4441
4441
  childrenIds: R
4442
4442
  }
4443
4443
  };
@@ -5851,8 +5851,8 @@ function Xa() {
5851
5851
  s && /* @__PURE__ */ n(Pa, {}),
5852
5852
  s && /* @__PURE__ */ n(Va, {}),
5853
5853
  /* @__PURE__ */ w(go, { size: "small", value: i, exclusive: !0, onChange: r, children: [
5854
- /* @__PURE__ */ n(W, { value: "desktop", children: /* @__PURE__ */ n(Be, { title: e("common.desktopView"), arrow: !0, children: /* @__PURE__ */ n(Cl, { fontSize: "small" }) }) }),
5855
- /* @__PURE__ */ n(W, { value: "mobile", children: /* @__PURE__ */ n(Be, { title: e("common.mobileView"), arrow: !0, children: /* @__PURE__ */ n(bl, { fontSize: "small" }) }) })
5854
+ /* @__PURE__ */ n(Be, { title: e("common.desktopView"), arrow: !0, children: /* @__PURE__ */ n(W, { value: "desktop", children: /* @__PURE__ */ n(Cl, { fontSize: "small" }) }) }),
5855
+ /* @__PURE__ */ n(Be, { title: e("common.mobileView"), arrow: !0, children: /* @__PURE__ */ n(W, { value: "mobile", children: /* @__PURE__ */ n(bl, { fontSize: "small" }) }) })
5856
5856
  ] })
5857
5857
  ] })
5858
5858
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monto-email-builder",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "A powerful and customizable email template builder React component library with visual editing, internationalization, and image upload support",
5
5
  "keywords": [
6
6
  "email",