monto-email-builder 1.4.7 → 1.4.8
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/dist/HtmlEditor/index.d.ts.map +1 -1
- package/dist/html-editor.js +374 -367
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/HtmlEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6F,MAAM,OAAO,CAAC;AAmBlH,OAAO,EAaL,OAAO,EAIP,KAAK,EAKN,MAAM,eAAe,CAAC;AAWvB,OAAO,EAAE,QAAQ,EAAK,MAAM,SAAS,CAAC;AAWtC,OAAO,EAUL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,kCAAkC,EACxC,MAAM,aAAa,CAAC;AAYrB,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAC1D,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AACpD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,WAAW,CAAC;AACzD,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,kCAAkC,GACnC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,sBAAsB,EAAE,CAAC;IAC9C,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,EAAE,KAAK,IAAI,KAAK,sBAAsB,EAAE,CAAC;IACjG,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;IAC5D,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AA8DD,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;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACtC;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,sBAAsB,EAAE,KAAK,IAAI,CAAC;IAClE;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/HtmlEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6F,MAAM,OAAO,CAAC;AAmBlH,OAAO,EAaL,OAAO,EAIP,KAAK,EAKN,MAAM,eAAe,CAAC;AAWvB,OAAO,EAAE,QAAQ,EAAK,MAAM,SAAS,CAAC;AAWtC,OAAO,EAUL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,kCAAkC,EACxC,MAAM,aAAa,CAAC;AAYrB,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAC1D,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AACpD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,WAAW,CAAC;AACzD,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,kCAAkC,GACnC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,sBAAsB,EAAE,CAAC;IAC9C,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,EAAE,KAAK,IAAI,KAAK,sBAAsB,EAAE,CAAC;IACjG,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;IAC5D,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AA8DD,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;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACtC;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,sBAAsB,EAAE,KAAK,IAAI,CAAC;IAClE;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AA6/BD,QAAA,MAAM,mBAAmB,uFAevB,CAAC;AAGH,eAAe,mBAAmB,CAAC"}
|
package/dist/html-editor.js
CHANGED
|
@@ -1,383 +1,390 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { html as
|
|
5
|
-
import { xcodeDark as
|
|
1
|
+
import { jsx as n, jsxs as g, Fragment as Wt } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as pt, useState as V, useRef as w, useEffect as z, useCallback as k, useMemo as Q, useImperativeHandle as jt } from "react";
|
|
3
|
+
import Gt from "@uiw/react-codemirror";
|
|
4
|
+
import { html as Ut } from "@codemirror/lang-html";
|
|
5
|
+
import { xcodeDark as qt, tomorrowNightBlue as Yt, dracula as ft, basicDark as Kt, abcdef as Xt, bbedit as Jt, noctisLilac as Qt, gruvboxLight as Zt, tokyoNightDay as er, vscodeLight as tr, xcodeLight as rr } from "@uiw/codemirror-themes-all";
|
|
6
6
|
import Z from "@mui/material/ToggleButton";
|
|
7
|
-
import
|
|
8
|
-
import { ThemeProvider as
|
|
9
|
-
import { alpha as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
17
|
-
import * as
|
|
18
|
-
import * as
|
|
19
|
-
import { B as
|
|
20
|
-
const
|
|
21
|
-
function
|
|
22
|
-
return (
|
|
7
|
+
import at from "@mui/material/ToggleButtonGroup";
|
|
8
|
+
import { ThemeProvider as nr, ScopedCssBaseline as or, useTheme as ar, Box as h, Tooltip as U, FormControl as ir, InputLabel as lr, Select as sr, ListSubheader as it, MenuItem as lt, Button as He, Tabs as cr, Tab as st, Typography as A, Accordion as dr, AccordionSummary as ur, AccordionDetails as mr, TextField as we, Divider as hr } from "@mui/material";
|
|
9
|
+
import { alpha as he } from "@mui/material/styles";
|
|
10
|
+
import * as br from "@mui/icons-material/AddOutlined";
|
|
11
|
+
import * as pr from "@mui/icons-material/Code";
|
|
12
|
+
import * as fr from "@mui/icons-material/DataObjectOutlined";
|
|
13
|
+
import * as gr from "@mui/icons-material/ExpandMoreOutlined";
|
|
14
|
+
import * as xr from "@mui/icons-material/HelpOutlined";
|
|
15
|
+
import * as vr from "@mui/icons-material/Visibility";
|
|
16
|
+
import * as yr from "@mui/icons-material/ViewColumn";
|
|
17
|
+
import * as Ir from "@mui/icons-material/MonitorOutlined";
|
|
18
|
+
import * as Er from "@mui/icons-material/PhoneIphoneOutlined";
|
|
19
|
+
import { B as Vr, V as B, r as R, T as Cr, a as ct, t as Tr } from "./chunks/chunk-C6lRuHXq.js";
|
|
20
|
+
const De = Vr, q = "unsubscribe_link", pe = /\{\{\s*([^{}]+?)\s*\}\}/g, dt = /\{%\s*([^{}%]+?)\s*%\}/g;
|
|
21
|
+
function Se(r) {
|
|
22
|
+
return (r || "").replace(pe, (l, u, c, x) => {
|
|
23
23
|
const i = c + l.length;
|
|
24
|
-
if (!
|
|
24
|
+
if (!fe(x, c, i, "{", "}")) return l;
|
|
25
25
|
const m = String(u).trim();
|
|
26
|
-
return !m || !
|
|
26
|
+
return !m || !B.test(m) || m !== q ? l : `{%${m}%}`;
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function fe(r, a, l, u, c) {
|
|
30
|
+
return r[a - 1] !== u && r[l] !== c;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return a === "builtin" || a === "system" ? `{%${
|
|
32
|
+
function gt(r, a = "user") {
|
|
33
|
+
return a === "builtin" || a === "system" ? `{%${r}%}` : `{{${r}}}`;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
const a = typeof
|
|
35
|
+
function Hr(r) {
|
|
36
|
+
const a = typeof r == "string" ? r.trim() : "";
|
|
37
37
|
if (a.startsWith("{{") && a.endsWith("}}")) {
|
|
38
38
|
const l = a.slice(2, -2).trim();
|
|
39
|
-
if (
|
|
39
|
+
if (B.test(l))
|
|
40
40
|
return {
|
|
41
41
|
attribute: l,
|
|
42
|
-
type: l ===
|
|
42
|
+
type: l === q ? "system" : "user"
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
if (a.startsWith("{%") && a.endsWith("%}")) {
|
|
46
46
|
const l = a.slice(2, -2).trim();
|
|
47
|
-
if (
|
|
47
|
+
if (B.test(l)) return { attribute: l, type: "system" };
|
|
48
48
|
}
|
|
49
49
|
return null;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const l =
|
|
53
|
-
return !b || !
|
|
54
|
-
id: Number(
|
|
55
|
-
variableInstanceId:
|
|
51
|
+
function wr(r, a) {
|
|
52
|
+
const l = r.variable ?? r.Variable ?? r.key ?? "", u = Hr(l), c = String(r.attribute ?? r.Attribute ?? (u == null ? void 0 : u.attribute) ?? "").trim(), x = r.type ?? r.Type ?? (u == null ? void 0 : u.type) ?? (c === q ? "system" : "user"), i = c === q || x === "system" ? "system" : "user", m = r.attribute ?? r.Attribute ?? (u == null ? void 0 : u.attribute) ?? "", b = String(m).trim();
|
|
53
|
+
return !b || !B.test(b) ? null : {
|
|
54
|
+
id: Number(r.id) || a + 1,
|
|
55
|
+
variableInstanceId: r.variableInstanceId ?? r.VariableInstanceId,
|
|
56
56
|
variable: i === "system" ? `{%${b}%}` : `{{${b}}}`,
|
|
57
57
|
type: i,
|
|
58
58
|
attribute: b,
|
|
59
|
-
default: String(
|
|
59
|
+
default: String(r.default ?? r.Default ?? r.value ?? "")
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
return Array.isArray(
|
|
62
|
+
function ut(r) {
|
|
63
|
+
return Array.isArray(r) ? r.map((a, l) => wr(a, l)).filter((a) => !!a).map((a, l) => ({
|
|
64
64
|
...a,
|
|
65
65
|
id: l + 1,
|
|
66
|
-
variableInstanceId: a.variableInstanceId ||
|
|
66
|
+
variableInstanceId: a.variableInstanceId || Le(a.type, a.attribute, l)
|
|
67
67
|
})) : [];
|
|
68
68
|
}
|
|
69
|
-
function ee(
|
|
70
|
-
const a =
|
|
69
|
+
function ee(r) {
|
|
70
|
+
const a = r || "", l = [], u = (i, m, b) => {
|
|
71
71
|
l.push({ attribute: i, type: m, start: b });
|
|
72
72
|
};
|
|
73
73
|
let c;
|
|
74
|
-
for (
|
|
74
|
+
for (pe.lastIndex = 0; c = pe.exec(a); ) {
|
|
75
75
|
const i = c.index, m = i + c[0].length;
|
|
76
|
-
if (!
|
|
76
|
+
if (!fe(a, i, m, "{", "}")) continue;
|
|
77
77
|
const b = c[1].trim();
|
|
78
|
-
!b || !
|
|
78
|
+
!b || !B.test(b) || u(b, "user", i);
|
|
79
79
|
}
|
|
80
|
-
let
|
|
81
|
-
for (
|
|
82
|
-
const i =
|
|
83
|
-
if (!
|
|
84
|
-
const b =
|
|
85
|
-
!b || !
|
|
80
|
+
let x;
|
|
81
|
+
for (dt.lastIndex = 0; x = dt.exec(a); ) {
|
|
82
|
+
const i = x.index, m = i + x[0].length;
|
|
83
|
+
if (!fe(a, i, m, "{", "}")) continue;
|
|
84
|
+
const b = x[1].trim();
|
|
85
|
+
!b || !B.test(b) || u(b, "system", i);
|
|
86
86
|
}
|
|
87
87
|
return l.sort((i, m) => i.start - m.start), l.map((i, m) => ({
|
|
88
88
|
id: m + 1,
|
|
89
|
-
variableInstanceId:
|
|
89
|
+
variableInstanceId: Lr(i.type, i.attribute, i.start),
|
|
90
90
|
variable: i.type === "system" ? `{%${i.attribute}%}` : `{{${i.attribute}}}`,
|
|
91
91
|
type: i.type,
|
|
92
92
|
attribute: i.attribute,
|
|
93
93
|
default: ""
|
|
94
94
|
}));
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function be(r, a) {
|
|
97
97
|
const l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
98
98
|
return a.forEach((c) => {
|
|
99
|
-
const
|
|
99
|
+
const x = { item: c, consumed: !1 };
|
|
100
100
|
if (c.variableInstanceId) {
|
|
101
101
|
const b = l.get(c.variableInstanceId) ?? [];
|
|
102
|
-
b.push(
|
|
102
|
+
b.push(x), l.set(c.variableInstanceId, b);
|
|
103
103
|
}
|
|
104
104
|
const i = `${c.type}:${c.attribute}`, m = u.get(i) ?? [];
|
|
105
|
-
m.push(
|
|
106
|
-
}),
|
|
107
|
-
var
|
|
108
|
-
const i = `${c.type}:${c.attribute}`, m = c.variableInstanceId ? (
|
|
109
|
-
return
|
|
105
|
+
m.push(x), u.set(i, m);
|
|
106
|
+
}), r.map((c, x) => {
|
|
107
|
+
var N;
|
|
108
|
+
const i = `${c.type}:${c.attribute}`, m = c.variableInstanceId ? (N = l.get(c.variableInstanceId)) == null ? void 0 : N.find((v) => !v.consumed) : void 0, b = (u.get(i) ?? []).find((v) => !v.consumed), S = m ?? b;
|
|
109
|
+
return S && (S.consumed = !0), {
|
|
110
110
|
...c,
|
|
111
|
-
id:
|
|
112
|
-
variableInstanceId: c.variableInstanceId ||
|
|
113
|
-
default: c.type === "system" ? "" : (
|
|
111
|
+
id: x + 1,
|
|
112
|
+
variableInstanceId: c.variableInstanceId || Le(c.type, c.attribute, x),
|
|
113
|
+
default: c.type === "system" ? "" : (S == null ? void 0 : S.item.default) ?? c.default ?? ""
|
|
114
114
|
};
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
117
|
+
function Sr(r) {
|
|
118
|
+
return r.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function mt(r, a) {
|
|
121
121
|
const l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
122
122
|
a.forEach((i) => {
|
|
123
123
|
i.type === "user" && (i.variableInstanceId && l.set(i.variableInstanceId, i.default ?? ""), u.has(i.attribute) || u.set(i.attribute, i.default ?? ""));
|
|
124
124
|
});
|
|
125
|
-
const c = ee(
|
|
125
|
+
const c = ee(r), x = /* @__PURE__ */ new Map();
|
|
126
126
|
return c.forEach((i) => {
|
|
127
127
|
const m = Number(String(i.variableInstanceId ?? "").split("-at-")[1]);
|
|
128
|
-
Number.isFinite(m) &&
|
|
129
|
-
}), (
|
|
128
|
+
Number.isFinite(m) && x.set(m, i);
|
|
129
|
+
}), (r || "").replace(pe, (i, m, b, S) => {
|
|
130
130
|
var te;
|
|
131
|
-
const
|
|
132
|
-
if (!
|
|
131
|
+
const N = b + i.length;
|
|
132
|
+
if (!fe(S, b, N, "{", "}")) return i;
|
|
133
133
|
const v = String(m).trim();
|
|
134
|
-
if (!v || !
|
|
135
|
-
const
|
|
136
|
-
return
|
|
134
|
+
if (!v || !B.test(v)) return i;
|
|
135
|
+
const $ = (te = x.get(b)) == null ? void 0 : te.variableInstanceId, O = ($ ? l.get($) : void 0) ?? (a.filter((s) => s.type === "user" && s.attribute === v).length === 1 ? u.get(v) : void 0);
|
|
136
|
+
return O === void 0 || O === "" ? i : Sr(O);
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
const u =
|
|
141
|
-
if (!u || !
|
|
139
|
+
function ht(r, a, l = "") {
|
|
140
|
+
const u = r.trim();
|
|
141
|
+
if (!u || !B.test(u)) return null;
|
|
142
142
|
const c = a === "builtin" ? "system" : "user";
|
|
143
143
|
return {
|
|
144
144
|
id: 1,
|
|
145
|
-
variableInstanceId:
|
|
146
|
-
variable:
|
|
145
|
+
variableInstanceId: Le(c, u, 0),
|
|
146
|
+
variable: gt(u, a),
|
|
147
147
|
type: c,
|
|
148
148
|
attribute: u,
|
|
149
149
|
default: c === "system" ? "" : l
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
const a =
|
|
154
|
-
return a ?
|
|
152
|
+
function Dr(r) {
|
|
153
|
+
const a = r.trim();
|
|
154
|
+
return a ? De.some((l) => l.items.some((u) => u.name === a)) : !1;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
const l =
|
|
158
|
-
return a === "builtin" && l ===
|
|
156
|
+
function Mr(r, a) {
|
|
157
|
+
const l = r.trim();
|
|
158
|
+
return a === "builtin" && l === q ? `<a href="{%${q}%}">Unsubscribe Link</a>` : gt(l, a);
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
return `html-${
|
|
160
|
+
function Le(r, a, l) {
|
|
161
|
+
return `html-${r}-${a}-${l + 1}`;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return `html-${
|
|
163
|
+
function Lr(r, a, l) {
|
|
164
|
+
return `html-${r}-${a}-at-${l}`;
|
|
165
165
|
}
|
|
166
|
-
const
|
|
166
|
+
const kr = R(br), Ar = R(pr), Br = R(fr), Rr = R(gr), Fr = R(xr), $r = R(vr), zr = R(yr), Nr = R(Ir), Or = R(Er), Me = {
|
|
167
167
|
// 浅色主题
|
|
168
|
-
xcodeLight:
|
|
169
|
-
vscodeLight:
|
|
170
|
-
tokyoNightDay:
|
|
171
|
-
gruvboxLight:
|
|
172
|
-
noctisLilac:
|
|
173
|
-
bbedit:
|
|
168
|
+
xcodeLight: rr,
|
|
169
|
+
vscodeLight: tr,
|
|
170
|
+
tokyoNightDay: er,
|
|
171
|
+
gruvboxLight: Zt,
|
|
172
|
+
noctisLilac: Qt,
|
|
173
|
+
bbedit: Jt,
|
|
174
174
|
// 深色主题
|
|
175
|
-
abcdef:
|
|
176
|
-
basicDark:
|
|
177
|
-
dracula:
|
|
178
|
-
tomorrowNightBlue:
|
|
179
|
-
xcodeDark:
|
|
180
|
-
},
|
|
175
|
+
abcdef: Xt,
|
|
176
|
+
basicDark: Kt,
|
|
177
|
+
dracula: ft,
|
|
178
|
+
tomorrowNightBlue: Yt,
|
|
179
|
+
xcodeDark: qt
|
|
180
|
+
}, Pr = {
|
|
181
181
|
xcodeLight: "Xcode Light (Light)",
|
|
182
182
|
vscodeLight: "VSCode Light (Light)",
|
|
183
183
|
tokyoNightDay: "Tokyo Night Day (Light)",
|
|
184
184
|
gruvboxLight: "Gruvbox Light (Light)",
|
|
185
185
|
noctisLilac: "Noctis Lilac (Light)",
|
|
186
186
|
bbedit: "BBEdit (Light)"
|
|
187
|
-
},
|
|
187
|
+
}, _r = {
|
|
188
188
|
abcdef: "ABCDEF (Dark)",
|
|
189
189
|
basicDark: "Basic Dark (Dark)",
|
|
190
190
|
dracula: "Dracula (Dark)",
|
|
191
191
|
tomorrowNightBlue: "Tomorrow Night Blue (Dark)",
|
|
192
192
|
xcodeDark: "Xcode Dark (Dark)"
|
|
193
|
-
},
|
|
194
|
-
function
|
|
195
|
-
const a =
|
|
193
|
+
}, xt = "html-editor-theme", bt = "dracula";
|
|
194
|
+
function Wr(r = bt) {
|
|
195
|
+
const a = r && Me[r] ? r : bt;
|
|
196
196
|
if (typeof window > "u") return a;
|
|
197
197
|
try {
|
|
198
|
-
const l = localStorage.getItem(
|
|
199
|
-
if (l &&
|
|
198
|
+
const l = localStorage.getItem(xt);
|
|
199
|
+
if (l && Me[l]) return l;
|
|
200
200
|
} catch {
|
|
201
201
|
console.error("Failed to get HTML Editor stored theme");
|
|
202
202
|
}
|
|
203
203
|
return a;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function jr(r) {
|
|
206
206
|
try {
|
|
207
|
-
localStorage.setItem(
|
|
207
|
+
localStorage.setItem(xt, r);
|
|
208
208
|
} catch {
|
|
209
|
-
console.error("Failed to set HTML Editor stored theme",
|
|
209
|
+
console.error("Failed to set HTML Editor stored theme", r);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
value:
|
|
212
|
+
function Gr({
|
|
213
|
+
value: r,
|
|
214
214
|
onChange: a,
|
|
215
215
|
language: l = "zh",
|
|
216
216
|
initialMode: u = "split",
|
|
217
217
|
initialDevice: c = "desktop",
|
|
218
|
-
codeEditorHeight:
|
|
218
|
+
codeEditorHeight: x = "100%",
|
|
219
219
|
previewHeight: i = "100%",
|
|
220
220
|
sx: m,
|
|
221
221
|
showToolbar: b = !0,
|
|
222
|
-
initialTheme:
|
|
223
|
-
initialRightTab:
|
|
222
|
+
initialTheme: S,
|
|
223
|
+
initialRightTab: N = "preview",
|
|
224
224
|
variables: v,
|
|
225
|
-
onVariablesChange:
|
|
226
|
-
requireVariableDefaults:
|
|
225
|
+
onVariablesChange: $,
|
|
226
|
+
requireVariableDefaults: O = !0
|
|
227
227
|
}, te) {
|
|
228
|
-
var
|
|
229
|
-
const s = (e, t) =>
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
228
|
+
var Pe, _e, We, je, Ge, Ue, qe, Ye, Ke, Xe, Je, Qe, Ze, et, tt, rt, nt, ot;
|
|
229
|
+
const s = (e, t) => Tr(e, t, l), [D, yt] = V(u), [P, It] = V(c), [ke, Et] = V(() => Wr(S)), [I, ge] = V(() => Se(r)), re = w(Se(r)), [ne, _] = V(N), [H, xe] = V(() => ut(v)), [Vt, Ct] = V(!1), [Tt, Ht] = V(null), [W, Ae] = V(""), [j, Be] = V(""), [ve, oe] = V(!1), [ye, ae] = V(!1), Y = w(null), Ie = w(null), C = w(H), ie = w(null), Re = w(r), Fe = w(null), $e = w(null), Ee = w(!1), le = w(null);
|
|
230
|
+
z(() => {
|
|
231
|
+
re.current = I;
|
|
232
|
+
}, [I]), z(() => {
|
|
233
|
+
if (r === Re.current) return;
|
|
234
|
+
if (Re.current = r, r === ie.current) {
|
|
235
|
+
ie.current = null;
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
ie.current = null;
|
|
239
|
+
const e = Se(r);
|
|
240
|
+
e !== re.current && (re.current = e, ge(e));
|
|
241
|
+
}, [r]), z(() => {
|
|
234
242
|
if (v === void 0) return;
|
|
235
|
-
const e =
|
|
236
|
-
|
|
237
|
-
}, [v]),
|
|
243
|
+
const e = ut(v);
|
|
244
|
+
C.current = e, xe(e);
|
|
245
|
+
}, [v]), z(() => {
|
|
238
246
|
if (v !== void 0) return;
|
|
239
|
-
const e = ee(I), t =
|
|
240
|
-
(t.length !==
|
|
241
|
-
const p =
|
|
247
|
+
const e = ee(I), t = be(e, C.current);
|
|
248
|
+
(t.length !== C.current.length || t.some((d, y) => {
|
|
249
|
+
const p = C.current[y];
|
|
242
250
|
return !p || p.variableInstanceId !== d.variableInstanceId || p.attribute !== d.attribute || p.type !== d.type || p.default !== d.default;
|
|
243
|
-
})) && (
|
|
251
|
+
})) && (C.current = t, xe(t));
|
|
244
252
|
}, [I, v]);
|
|
245
|
-
const F =
|
|
253
|
+
const F = k(
|
|
246
254
|
(e) => {
|
|
247
|
-
const t = e.map((
|
|
248
|
-
...
|
|
255
|
+
const t = e.map((o, d) => ({
|
|
256
|
+
...o,
|
|
249
257
|
id: d + 1,
|
|
250
|
-
default:
|
|
258
|
+
default: o.type === "system" ? "" : o.default ?? ""
|
|
251
259
|
}));
|
|
252
|
-
return
|
|
260
|
+
return C.current = t, xe(t), $ == null || $(t), t;
|
|
253
261
|
},
|
|
254
|
-
[
|
|
255
|
-
),
|
|
256
|
-
var t,
|
|
257
|
-
const e = (
|
|
262
|
+
[$]
|
|
263
|
+
), M = k(() => {
|
|
264
|
+
var t, o;
|
|
265
|
+
const e = (o = (t = Ie.current) == null ? void 0 : t.state) == null ? void 0 : o.doc;
|
|
258
266
|
return e && typeof e.toString == "function" ? e.toString() : I;
|
|
259
|
-
}, [I]),
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
a == null || a(t);
|
|
267
|
+
}, [I]), Ve = (e) => {
|
|
268
|
+
ie.current = e, re.current = e, ge(e), Y.current && clearTimeout(Y.current), Y.current = setTimeout(() => {
|
|
269
|
+
a == null || a(e);
|
|
263
270
|
}, 300);
|
|
264
|
-
}, K =
|
|
271
|
+
}, K = k(
|
|
265
272
|
(e) => {
|
|
266
|
-
const t = ee(e ??
|
|
267
|
-
return F(
|
|
273
|
+
const t = ee(e ?? M()), o = be(t, C.current);
|
|
274
|
+
return F(o);
|
|
268
275
|
},
|
|
269
|
-
[
|
|
270
|
-
),
|
|
271
|
-
const e =
|
|
272
|
-
e !== I &&
|
|
273
|
-
const t = K(e),
|
|
274
|
-
(d) => d.type === "user" &&
|
|
276
|
+
[M, F]
|
|
277
|
+
), se = k(() => {
|
|
278
|
+
const e = M();
|
|
279
|
+
e !== I && ge(e);
|
|
280
|
+
const t = K(e), o = O ? t.filter(
|
|
281
|
+
(d) => d.type === "user" && ct(d.attribute, "user") && d.default.trim() === ""
|
|
275
282
|
) : [];
|
|
276
|
-
return
|
|
277
|
-
valid:
|
|
283
|
+
return Ct(o.length > 0), o.length > 0 && _("variables"), {
|
|
284
|
+
valid: o.length === 0,
|
|
278
285
|
variables: t,
|
|
279
|
-
missing:
|
|
286
|
+
missing: o
|
|
280
287
|
};
|
|
281
|
-
}, [
|
|
282
|
-
|
|
283
|
-
}, [
|
|
284
|
-
|
|
285
|
-
if (
|
|
288
|
+
}, [M, I, O, K]), wt = k(() => {
|
|
289
|
+
Ee.current = !0, se(), _("variables");
|
|
290
|
+
}, [se]);
|
|
291
|
+
z(() => {
|
|
292
|
+
if (ne !== "variables" || !Ee.current) return;
|
|
286
293
|
const e = window.requestAnimationFrame(() => {
|
|
287
|
-
const t =
|
|
288
|
-
t &&
|
|
289
|
-
top: Math.max(
|
|
294
|
+
const t = Fe.current, o = $e.current;
|
|
295
|
+
t && o && t.scrollTo({
|
|
296
|
+
top: Math.max(o.offsetTop - 8, 0),
|
|
290
297
|
behavior: "auto"
|
|
291
|
-
}),
|
|
298
|
+
}), Ee.current = !1;
|
|
292
299
|
});
|
|
293
300
|
return () => window.cancelAnimationFrame(e);
|
|
294
|
-
}, [
|
|
301
|
+
}, [ne, H.length]), z(() => () => {
|
|
295
302
|
Y.current && clearTimeout(Y.current);
|
|
296
303
|
}, []);
|
|
297
|
-
const
|
|
304
|
+
const St = (e) => {
|
|
298
305
|
var f, E, X;
|
|
299
306
|
const t = e || "";
|
|
300
|
-
let
|
|
307
|
+
let o = t;
|
|
301
308
|
if (!t.trim())
|
|
302
|
-
|
|
309
|
+
o = "<!DOCTYPE html><html><head></head><body></body></html>";
|
|
303
310
|
else {
|
|
304
|
-
const
|
|
305
|
-
if (!
|
|
306
|
-
const
|
|
307
|
-
|
|
311
|
+
const L = new DOMParser().parseFromString(t, "text/html"), Te = ((f = L.documentElement) == null ? void 0 : f.tagName.toLowerCase()) === "html", Ot = ((E = L.head) == null ? void 0 : E.tagName.toLowerCase()) === "head", Pt = ((X = L.body) == null ? void 0 : X.tagName.toLowerCase()) === "body";
|
|
312
|
+
if (!Te || !Ot || !Pt) {
|
|
313
|
+
const _t = L.body ? L.body.innerHTML : t;
|
|
314
|
+
o = `<!DOCTYPE html><html><head>${L.head ? L.head.innerHTML : ""}</head><body>${_t}</body></html>`;
|
|
308
315
|
} else
|
|
309
|
-
|
|
316
|
+
o = `<!DOCTYPE html>${L.documentElement.outerHTML}`;
|
|
310
317
|
}
|
|
311
|
-
const d = ["script", "iframe", "object", "embed", "canvas"], p = new DOMParser().parseFromString(
|
|
318
|
+
const d = ["script", "iframe", "object", "embed", "canvas"], p = new DOMParser().parseFromString(o, "text/html");
|
|
312
319
|
return d.forEach((J) => {
|
|
313
|
-
p.querySelectorAll(J).forEach((
|
|
314
|
-
}),
|
|
315
|
-
},
|
|
316
|
-
() =>
|
|
320
|
+
p.querySelectorAll(J).forEach((Te) => Te.remove());
|
|
321
|
+
}), o = `<!DOCTYPE html>${p.documentElement.outerHTML}`, o;
|
|
322
|
+
}, ze = Q(
|
|
323
|
+
() => mt(I, H),
|
|
317
324
|
[H, I]
|
|
318
|
-
),
|
|
319
|
-
|
|
325
|
+
), ce = Q(() => St(ze), [ze]);
|
|
326
|
+
jt(
|
|
320
327
|
te,
|
|
321
328
|
() => ({
|
|
322
|
-
getValue: () =>
|
|
323
|
-
getPreviewHtml: () =>
|
|
324
|
-
scanVariables: () => K(
|
|
329
|
+
getValue: () => M(),
|
|
330
|
+
getPreviewHtml: () => mt(M(), C.current),
|
|
331
|
+
scanVariables: () => K(M()),
|
|
325
332
|
getVariables: (e) => {
|
|
326
|
-
const t = K(
|
|
333
|
+
const t = K(M());
|
|
327
334
|
return e == null || e(t), t;
|
|
328
335
|
},
|
|
329
|
-
validateVariables:
|
|
330
|
-
showVariables: () =>
|
|
336
|
+
validateVariables: se,
|
|
337
|
+
showVariables: () => _("variables")
|
|
331
338
|
}),
|
|
332
|
-
[
|
|
333
|
-
),
|
|
334
|
-
|
|
335
|
-
}, [
|
|
336
|
-
const
|
|
337
|
-
t !== null &&
|
|
338
|
-
},
|
|
339
|
-
(t === "desktop" || t === "mobile") &&
|
|
340
|
-
},
|
|
339
|
+
[M, K, se]
|
|
340
|
+
), z(() => {
|
|
341
|
+
le.current && le.current.srcdoc !== ce && (le.current.srcdoc = ce);
|
|
342
|
+
}, [ce]);
|
|
343
|
+
const Dt = (e, t) => {
|
|
344
|
+
t !== null && yt(t);
|
|
345
|
+
}, Mt = (e, t) => {
|
|
346
|
+
(t === "desktop" || t === "mobile") && It(t);
|
|
347
|
+
}, de = k(
|
|
341
348
|
(e) => {
|
|
342
349
|
var d, y;
|
|
343
|
-
const t =
|
|
350
|
+
const t = Ie.current;
|
|
344
351
|
if (t != null && t.state && (t != null && t.dispatch)) {
|
|
345
352
|
const p = (d = t.state.selection) == null ? void 0 : d.main, f = t.state.doc.toString(), E = (p == null ? void 0 : p.from) ?? t.state.doc.length, X = (p == null ? void 0 : p.to) ?? E, J = `${f.slice(0, E)}${e}${f.slice(X)}`;
|
|
346
353
|
return t.dispatch({
|
|
347
354
|
changes: { from: E, to: X, insert: e },
|
|
348
355
|
selection: { anchor: E + e.length }
|
|
349
|
-
}), (y = t.focus) == null || y.call(t),
|
|
356
|
+
}), (y = t.focus) == null || y.call(t), Ve(J), J;
|
|
350
357
|
}
|
|
351
|
-
const
|
|
352
|
-
return
|
|
358
|
+
const o = `${I}${e}`;
|
|
359
|
+
return Ve(o), o;
|
|
353
360
|
},
|
|
354
361
|
[I]
|
|
355
|
-
),
|
|
362
|
+
), Lt = k(
|
|
356
363
|
(e, t) => {
|
|
357
|
-
const
|
|
364
|
+
const o = C.current;
|
|
358
365
|
F(
|
|
359
|
-
|
|
366
|
+
o.map(
|
|
360
367
|
(d) => d.variableInstanceId === e ? { ...d, default: t } : d
|
|
361
368
|
)
|
|
362
369
|
);
|
|
363
370
|
},
|
|
364
371
|
[F]
|
|
365
|
-
),
|
|
372
|
+
), kt = k(
|
|
366
373
|
(e, t) => {
|
|
367
|
-
if (!
|
|
368
|
-
const d =
|
|
369
|
-
F(p),
|
|
374
|
+
if (!ht(e, t)) return;
|
|
375
|
+
const d = de(Mr(e, t)), y = ee(d), p = be(y, C.current);
|
|
376
|
+
F(p), _("variables");
|
|
370
377
|
},
|
|
371
|
-
[
|
|
372
|
-
),
|
|
373
|
-
const e = _.trim();
|
|
374
|
-
return e ? A.test(e) ? Hr(e) || H.some((t) => t.type === "user" && t.attribute === e) ? s("text.variables.customVariableNameDuplicate") : "" : s("text.variables.customVariableNameInvalid") : s("text.variables.customVariableNameRequired");
|
|
375
|
-
}, [_, H]), Mt = L(() => {
|
|
378
|
+
[de, F]
|
|
379
|
+
), ue = Q(() => {
|
|
376
380
|
const e = W.trim();
|
|
377
|
-
|
|
378
|
-
|
|
381
|
+
return e ? B.test(e) ? Dr(e) || H.some((t) => t.type === "user" && t.attribute === e) ? s("text.variables.customVariableNameDuplicate") : "" : s("text.variables.customVariableNameInvalid") : s("text.variables.customVariableNameRequired");
|
|
382
|
+
}, [W, H]), At = k(() => {
|
|
383
|
+
const e = j.trim();
|
|
384
|
+
if (oe(!0), ae(!0), ue || e === "") return;
|
|
385
|
+
const t = ht(W.trim(), "user", e);
|
|
379
386
|
if (!t) return;
|
|
380
|
-
const
|
|
387
|
+
const o = de(t.variable), d = ee(o), y = be(d, C.current);
|
|
381
388
|
let p = -1;
|
|
382
389
|
for (let f = y.length - 1; f >= 0; f -= 1) {
|
|
383
390
|
const E = y[f];
|
|
@@ -390,34 +397,34 @@ function _r({
|
|
|
390
397
|
y.map(
|
|
391
398
|
(f, E) => E === p ? { ...f, default: t.default } : f
|
|
392
399
|
)
|
|
393
|
-
),
|
|
394
|
-
}, [
|
|
400
|
+
), Ae(""), Be(""), oe(!1), ae(!1), _("variables");
|
|
401
|
+
}, [j, W, ue, de, F]), Bt = Q(() => {
|
|
395
402
|
const e = /* @__PURE__ */ new Set();
|
|
396
|
-
return [{ id: "custom", items: H.filter((
|
|
397
|
-
name:
|
|
398
|
-
labelKey:
|
|
403
|
+
return [{ id: "custom", items: H.filter((o) => o.type === "user").filter((o) => !De.some((d) => d.items.some((y) => y.name === o.attribute))).filter((o) => e.has(o.attribute) ? !1 : (e.add(o.attribute), !0)).map((o) => ({
|
|
404
|
+
name: o.attribute,
|
|
405
|
+
labelKey: o.attribute,
|
|
399
406
|
kind: "user"
|
|
400
|
-
})) }, ...
|
|
401
|
-
}, [H]),
|
|
407
|
+
})) }, ...De];
|
|
408
|
+
}, [H]), me = Q(
|
|
402
409
|
() => H.filter((e) => e.type !== "system"),
|
|
403
410
|
[H]
|
|
404
|
-
),
|
|
405
|
-
(
|
|
406
|
-
const
|
|
411
|
+
), Rt = (e) => e === "custom" ? "text.variables.groupCustom" : e === "contacts" ? "text.variables.groupContacts" : e === "email" ? "text.variables.groupEmail" : e === "organization" ? "text.variables.groupOrganization" : e === "date" ? "text.variables.groupDate" : "text.variables.groupLinks", T = ar(), Ft = P === "desktop" || P === "mobile" ? P : "desktop", $t = D === "split" || D === "code" || D === "preview" ? D : "split";
|
|
412
|
+
(_e = (Pe = T.palette) == null ? void 0 : Pe.action) == null || _e.selected, (je = (We = T.palette) == null ? void 0 : We.primary) == null || je.main, (Ue = (Ge = T.palette) == null ? void 0 : Ge.action) == null || Ue.selected, (Ye = (qe = T.palette) == null ? void 0 : qe.background) == null || Ye.paper, (Xe = (Ke = T.palette) == null ? void 0 : Ke.text) == null || Xe.primary, (Qe = (Je = T.palette) == null ? void 0 : Je.action) == null || Qe.hover;
|
|
413
|
+
const G = {
|
|
407
414
|
tooltip: {
|
|
408
415
|
sx: {
|
|
409
416
|
fontSize: "13px",
|
|
410
417
|
fontWeight: 400,
|
|
411
418
|
lineHeight: 1.45,
|
|
412
419
|
maxWidth: 360,
|
|
413
|
-
backgroundColor:
|
|
414
|
-
color: ((
|
|
420
|
+
backgroundColor: he(((et = (Ze = T.palette) == null ? void 0 : Ze.text) == null ? void 0 : et.primary) ?? "#1F1F21", 0.9),
|
|
421
|
+
color: ((rt = (tt = T.palette) == null ? void 0 : tt.common) == null ? void 0 : rt.white) ?? "#fff"
|
|
415
422
|
}
|
|
416
423
|
},
|
|
417
424
|
arrow: {
|
|
418
|
-
sx: { color:
|
|
425
|
+
sx: { color: he(((ot = (nt = T.palette) == null ? void 0 : nt.text) == null ? void 0 : ot.primary) ?? "#1F1F21", 0.9) }
|
|
419
426
|
}
|
|
420
|
-
},
|
|
427
|
+
}, Ce = {
|
|
421
428
|
component: "div",
|
|
422
429
|
sx: {
|
|
423
430
|
mt: 0.5,
|
|
@@ -425,20 +432,20 @@ function _r({
|
|
|
425
432
|
minHeight: 18,
|
|
426
433
|
lineHeight: 1.5
|
|
427
434
|
}
|
|
428
|
-
},
|
|
435
|
+
}, Ne = () => /* @__PURE__ */ g(
|
|
429
436
|
h,
|
|
430
437
|
{
|
|
431
438
|
sx: {
|
|
432
|
-
height:
|
|
439
|
+
height: x,
|
|
433
440
|
minHeight: 0,
|
|
434
441
|
display: "flex",
|
|
435
442
|
flexDirection: "column",
|
|
436
443
|
position: "relative",
|
|
437
|
-
borderRight:
|
|
444
|
+
borderRight: D === "split" ? "1px solid" : "none",
|
|
438
445
|
borderColor: "divider"
|
|
439
446
|
},
|
|
440
447
|
children: [
|
|
441
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ n(
|
|
442
449
|
h,
|
|
443
450
|
{
|
|
444
451
|
sx: {
|
|
@@ -469,16 +476,16 @@ function _r({
|
|
|
469
476
|
opacity: 1
|
|
470
477
|
}
|
|
471
478
|
},
|
|
472
|
-
children: /* @__PURE__ */
|
|
473
|
-
|
|
479
|
+
children: /* @__PURE__ */ n(
|
|
480
|
+
Gt,
|
|
474
481
|
{
|
|
475
482
|
value: I,
|
|
476
483
|
height: "100%",
|
|
477
|
-
extensions: [
|
|
478
|
-
theme:
|
|
479
|
-
onChange:
|
|
484
|
+
extensions: [Ut()],
|
|
485
|
+
theme: Me[ke] || ft,
|
|
486
|
+
onChange: Ve,
|
|
480
487
|
onCreateEditor: (e) => {
|
|
481
|
-
|
|
488
|
+
Ie.current = e;
|
|
482
489
|
},
|
|
483
490
|
basicSetup: {
|
|
484
491
|
lineNumbers: !0,
|
|
@@ -490,13 +497,13 @@ function _r({
|
|
|
490
497
|
)
|
|
491
498
|
}
|
|
492
499
|
),
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
|
|
500
|
+
/* @__PURE__ */ n(
|
|
501
|
+
He,
|
|
495
502
|
{
|
|
496
503
|
size: "small",
|
|
497
504
|
variant: "contained",
|
|
498
|
-
startIcon: /* @__PURE__ */
|
|
499
|
-
onClick:
|
|
505
|
+
startIcon: /* @__PURE__ */ n(Br, { fontSize: "small" }),
|
|
506
|
+
onClick: wt,
|
|
500
507
|
sx: {
|
|
501
508
|
position: "absolute",
|
|
502
509
|
right: 16,
|
|
@@ -510,28 +517,28 @@ function _r({
|
|
|
510
517
|
)
|
|
511
518
|
]
|
|
512
519
|
}
|
|
513
|
-
),
|
|
520
|
+
), zt = () => /* @__PURE__ */ n(h, { sx: {
|
|
514
521
|
height: i,
|
|
515
522
|
overflow: "auto",
|
|
516
523
|
backgroundColor: "#F5F5F5",
|
|
517
|
-
padding:
|
|
524
|
+
padding: P === "mobile" ? "32px 16px" : "16px",
|
|
518
525
|
display: "flex",
|
|
519
526
|
justifyContent: "center"
|
|
520
|
-
}, children: /* @__PURE__ */
|
|
527
|
+
}, children: /* @__PURE__ */ n(
|
|
521
528
|
h,
|
|
522
529
|
{
|
|
523
530
|
sx: {
|
|
524
531
|
width: "100%",
|
|
525
|
-
maxWidth:
|
|
526
|
-
height:
|
|
532
|
+
maxWidth: P === "mobile" ? "370px" : "100%",
|
|
533
|
+
height: P === "mobile" ? "800px" : "100%",
|
|
527
534
|
border: "none",
|
|
528
535
|
overflow: "hidden"
|
|
529
536
|
},
|
|
530
|
-
children: /* @__PURE__ */
|
|
537
|
+
children: /* @__PURE__ */ n(
|
|
531
538
|
"iframe",
|
|
532
539
|
{
|
|
533
|
-
ref:
|
|
534
|
-
srcDoc:
|
|
540
|
+
ref: le,
|
|
541
|
+
srcDoc: ce,
|
|
535
542
|
style: {
|
|
536
543
|
width: "100%",
|
|
537
544
|
height: "100%",
|
|
@@ -543,10 +550,10 @@ function _r({
|
|
|
543
550
|
}
|
|
544
551
|
)
|
|
545
552
|
}
|
|
546
|
-
) }),
|
|
553
|
+
) }), Nt = () => /* @__PURE__ */ g(
|
|
547
554
|
h,
|
|
548
555
|
{
|
|
549
|
-
ref:
|
|
556
|
+
ref: Fe,
|
|
550
557
|
sx: {
|
|
551
558
|
flex: 1,
|
|
552
559
|
height: "100%",
|
|
@@ -558,23 +565,23 @@ function _r({
|
|
|
558
565
|
pb: 6
|
|
559
566
|
},
|
|
560
567
|
children: [
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ n(h, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 1, mb: 1.5 }, children: /* @__PURE__ */ g(h, { sx: { minWidth: 0 }, children: [
|
|
569
|
+
/* @__PURE__ */ g(h, { sx: { display: "flex", alignItems: "center", gap: 0.75 }, children: [
|
|
570
|
+
/* @__PURE__ */ n(A, { variant: "subtitle1", sx: { fontWeight: 700 }, children: s("htmlEditor.variables.title") }),
|
|
571
|
+
/* @__PURE__ */ n(U, { title: s("htmlEditor.variables.help"), arrow: !0, slotProps: G, children: /* @__PURE__ */ n(h, { component: "span", sx: { display: "inline-flex", color: "text.secondary", cursor: "help" }, children: /* @__PURE__ */ n(Fr, { fontSize: "small" }) }) })
|
|
565
572
|
] }),
|
|
566
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ n(A, { component: "div", variant: "body2", color: "text.secondary", children: s("htmlEditor.variables.scanHint") })
|
|
567
574
|
] }) }),
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
const t =
|
|
570
|
-
return /* @__PURE__ */
|
|
571
|
-
|
|
575
|
+
/* @__PURE__ */ n(h, { sx: { mb: 2 }, children: Bt.map((e) => {
|
|
576
|
+
const t = Tt === e.id;
|
|
577
|
+
return /* @__PURE__ */ g(
|
|
578
|
+
dr,
|
|
572
579
|
{
|
|
573
580
|
disableGutters: !0,
|
|
574
581
|
square: !0,
|
|
575
582
|
elevation: 0,
|
|
576
583
|
expanded: t,
|
|
577
|
-
onChange: (
|
|
584
|
+
onChange: (o, d) => Ht(d ? e.id : null),
|
|
578
585
|
sx: {
|
|
579
586
|
"&:before": { display: "none" },
|
|
580
587
|
border: 1,
|
|
@@ -584,66 +591,66 @@ function _r({
|
|
|
584
591
|
mb: 1
|
|
585
592
|
},
|
|
586
593
|
children: [
|
|
587
|
-
/* @__PURE__ */
|
|
588
|
-
|
|
594
|
+
/* @__PURE__ */ n(
|
|
595
|
+
ur,
|
|
589
596
|
{
|
|
590
|
-
expandIcon: /* @__PURE__ */
|
|
597
|
+
expandIcon: /* @__PURE__ */ n(Rr, { fontSize: "small" }),
|
|
591
598
|
sx: {
|
|
592
599
|
minHeight: 44,
|
|
593
600
|
"& .MuiAccordionSummary-content": { my: 1 }
|
|
594
601
|
},
|
|
595
|
-
children: /* @__PURE__ */
|
|
602
|
+
children: /* @__PURE__ */ n(A, { component: "div", variant: "body2", color: "text.primary", children: s(Rt(e.id)) })
|
|
596
603
|
}
|
|
597
604
|
),
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
e.id === "custom" && /* @__PURE__ */
|
|
600
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ g(mr, { sx: { pt: 0, pb: 1.25 }, children: [
|
|
606
|
+
e.id === "custom" && /* @__PURE__ */ g(h, { sx: { mb: 1 }, children: [
|
|
607
|
+
/* @__PURE__ */ n(
|
|
601
608
|
we,
|
|
602
609
|
{
|
|
603
610
|
size: "small",
|
|
604
611
|
fullWidth: !0,
|
|
605
612
|
label: s("text.variables.customVariableName"),
|
|
606
|
-
value:
|
|
613
|
+
value: W,
|
|
607
614
|
placeholder: "e.g. order_id",
|
|
608
|
-
onChange: (
|
|
609
|
-
|
|
615
|
+
onChange: (o) => {
|
|
616
|
+
Ae(o.target.value), !ve && o.target.value.trim() !== "" && oe(!0);
|
|
610
617
|
},
|
|
611
618
|
onBlur: () => {
|
|
612
|
-
|
|
619
|
+
W.trim() !== "" && oe(!0);
|
|
613
620
|
},
|
|
614
|
-
error:
|
|
615
|
-
helperText:
|
|
616
|
-
FormHelperTextProps:
|
|
621
|
+
error: ve && !!ue,
|
|
622
|
+
helperText: ve && ue || " ",
|
|
623
|
+
FormHelperTextProps: Ce,
|
|
617
624
|
sx: { mb: 1 }
|
|
618
625
|
}
|
|
619
626
|
),
|
|
620
|
-
/* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ n(
|
|
621
628
|
we,
|
|
622
629
|
{
|
|
623
630
|
size: "small",
|
|
624
631
|
fullWidth: !0,
|
|
625
632
|
label: s("text.variables.defaultValueLabel"),
|
|
626
|
-
value:
|
|
633
|
+
value: j,
|
|
627
634
|
placeholder: s("text.variables.defaultPlaceholder"),
|
|
628
|
-
onChange: (
|
|
629
|
-
|
|
635
|
+
onChange: (o) => {
|
|
636
|
+
Be(o.target.value), !ye && o.target.value.trim() !== "" && ae(!0);
|
|
630
637
|
},
|
|
631
638
|
onBlur: () => {
|
|
632
|
-
|
|
639
|
+
j.trim() !== "" && ae(!0);
|
|
633
640
|
},
|
|
634
|
-
error:
|
|
635
|
-
helperText:
|
|
636
|
-
FormHelperTextProps:
|
|
641
|
+
error: ye && j.trim() === "",
|
|
642
|
+
helperText: ye && j.trim() === "" ? s("text.variables.defaultRequired") : " ",
|
|
643
|
+
FormHelperTextProps: Ce
|
|
637
644
|
}
|
|
638
645
|
),
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
|
|
646
|
+
/* @__PURE__ */ n(
|
|
647
|
+
He,
|
|
641
648
|
{
|
|
642
649
|
fullWidth: !0,
|
|
643
650
|
size: "small",
|
|
644
651
|
variant: "outlined",
|
|
645
|
-
startIcon: /* @__PURE__ */
|
|
646
|
-
onClick:
|
|
652
|
+
startIcon: /* @__PURE__ */ n(kr, { fontSize: "small" }),
|
|
653
|
+
onClick: At,
|
|
647
654
|
sx: {
|
|
648
655
|
justifyContent: "center",
|
|
649
656
|
borderColor: "divider",
|
|
@@ -655,33 +662,33 @@ function _r({
|
|
|
655
662
|
}
|
|
656
663
|
)
|
|
657
664
|
] }),
|
|
658
|
-
e.items.length > 0 && /* @__PURE__ */
|
|
659
|
-
|
|
665
|
+
e.items.length > 0 && /* @__PURE__ */ n(h, { sx: { display: "grid", gap: 0.75 }, children: e.items.map((o) => /* @__PURE__ */ n(
|
|
666
|
+
He,
|
|
660
667
|
{
|
|
661
668
|
size: "small",
|
|
662
669
|
variant: "outlined",
|
|
663
|
-
onClick: () =>
|
|
670
|
+
onClick: () => kt(o.name, o.kind),
|
|
664
671
|
sx: {
|
|
665
672
|
justifyContent: "flex-start",
|
|
666
673
|
borderColor: "divider",
|
|
667
674
|
color: "text.secondary",
|
|
668
675
|
textTransform: "none"
|
|
669
676
|
},
|
|
670
|
-
children: /* @__PURE__ */
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
/* @__PURE__ */
|
|
673
|
-
|
|
677
|
+
children: /* @__PURE__ */ g(h, { sx: { textAlign: "left", minWidth: 0 }, children: [
|
|
678
|
+
/* @__PURE__ */ n(A, { component: "div", variant: "body2", color: "text.primary", children: e.id === "custom" ? o.name : s(o.labelKey) }),
|
|
679
|
+
/* @__PURE__ */ n(
|
|
680
|
+
A,
|
|
674
681
|
{
|
|
675
682
|
component: "div",
|
|
676
683
|
variant: "caption",
|
|
677
684
|
color: "text.secondary",
|
|
678
685
|
sx: { fontFamily: "monospace" },
|
|
679
|
-
children:
|
|
686
|
+
children: o.kind === "builtin" ? `{%${o.name}%}` : `{{${o.name}}}`
|
|
680
687
|
}
|
|
681
688
|
)
|
|
682
689
|
] })
|
|
683
690
|
},
|
|
684
|
-
`${e.id}:${
|
|
691
|
+
`${e.id}:${o.name}`
|
|
685
692
|
)) })
|
|
686
693
|
] })
|
|
687
694
|
]
|
|
@@ -689,10 +696,10 @@ function _r({
|
|
|
689
696
|
e.id
|
|
690
697
|
);
|
|
691
698
|
}) }),
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
|
|
699
|
+
/* @__PURE__ */ n(hr, { sx: { my: 2 } }),
|
|
700
|
+
/* @__PURE__ */ n(A, { component: "div", ref: $e, variant: "subtitle2", sx: { mb: 0.5 }, children: s("htmlEditor.variables.detected") }),
|
|
701
|
+
/* @__PURE__ */ n(A, { component: "div", variant: "caption", color: "text.secondary", sx: { display: "block", mb: 1 }, children: s("htmlEditor.variables.defaultHelp") }),
|
|
702
|
+
me.length === 0 ? /* @__PURE__ */ n(
|
|
696
703
|
h,
|
|
697
704
|
{
|
|
698
705
|
sx: {
|
|
@@ -706,9 +713,9 @@ function _r({
|
|
|
706
713
|
},
|
|
707
714
|
children: s("htmlEditor.variables.empty")
|
|
708
715
|
}
|
|
709
|
-
) : /* @__PURE__ */
|
|
710
|
-
const
|
|
711
|
-
return /* @__PURE__ */
|
|
716
|
+
) : /* @__PURE__ */ n(h, { sx: { display: "grid", gap: 0.75 }, children: me.map((e, t) => {
|
|
717
|
+
const o = e.type === "user" && ct(e.attribute, "user"), d = Vt && o && e.default.trim() === "", y = me.filter((f) => f.type === e.type && f.attribute === e.attribute).length, p = me.slice(0, t + 1).filter((f) => f.type === e.type && f.attribute === e.attribute).length;
|
|
718
|
+
return /* @__PURE__ */ g(
|
|
712
719
|
h,
|
|
713
720
|
{
|
|
714
721
|
sx: {
|
|
@@ -722,16 +729,16 @@ function _r({
|
|
|
722
729
|
borderColor: d ? "error.main" : "transparent",
|
|
723
730
|
borderRadius: 1,
|
|
724
731
|
borderBottomColor: d ? "error.main" : "divider",
|
|
725
|
-
backgroundColor: d ?
|
|
732
|
+
backgroundColor: d ? he(T.palette.error.main, 0.04) : "transparent",
|
|
726
733
|
transition: "background-color 120ms ease, border-color 120ms ease",
|
|
727
734
|
"&:hover": {
|
|
728
|
-
backgroundColor: d ?
|
|
735
|
+
backgroundColor: d ? he(T.palette.error.main, 0.04) : "action.hover",
|
|
729
736
|
borderColor: d ? "error.main" : "divider"
|
|
730
737
|
}
|
|
731
738
|
},
|
|
732
739
|
children: [
|
|
733
|
-
/* @__PURE__ */
|
|
734
|
-
|
|
740
|
+
/* @__PURE__ */ n(
|
|
741
|
+
A,
|
|
735
742
|
{
|
|
736
743
|
component: "div",
|
|
737
744
|
variant: "body2",
|
|
@@ -745,7 +752,7 @@ function _r({
|
|
|
745
752
|
children: y > 1 ? `${e.variable} (${p})` : e.variable
|
|
746
753
|
}
|
|
747
754
|
),
|
|
748
|
-
|
|
755
|
+
o ? /* @__PURE__ */ n(
|
|
749
756
|
we,
|
|
750
757
|
{
|
|
751
758
|
size: "small",
|
|
@@ -755,8 +762,8 @@ function _r({
|
|
|
755
762
|
placeholder: s("text.variables.defaultPlaceholder"),
|
|
756
763
|
error: d,
|
|
757
764
|
helperText: d ? s("text.variables.defaultRequired") : " ",
|
|
758
|
-
FormHelperTextProps:
|
|
759
|
-
onChange: (f) =>
|
|
765
|
+
FormHelperTextProps: Ce,
|
|
766
|
+
onChange: (f) => Lt(e.variableInstanceId, f.target.value),
|
|
760
767
|
sx: {
|
|
761
768
|
"& .MuiOutlinedInput-root": {
|
|
762
769
|
minHeight: 40,
|
|
@@ -768,7 +775,7 @@ function _r({
|
|
|
768
775
|
}
|
|
769
776
|
}
|
|
770
777
|
}
|
|
771
|
-
) : /* @__PURE__ */
|
|
778
|
+
) : /* @__PURE__ */ n(A, { component: "div", variant: "body2", color: "text.secondary", sx: { fontSize: 13 }, children: s("htmlEditor.variables.systemDefault") })
|
|
772
779
|
]
|
|
773
780
|
},
|
|
774
781
|
e.variableInstanceId || `${e.type}:${e.attribute}:${e.id}`
|
|
@@ -776,12 +783,12 @@ function _r({
|
|
|
776
783
|
}) })
|
|
777
784
|
]
|
|
778
785
|
}
|
|
779
|
-
),
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
|
|
786
|
+
), Oe = () => /* @__PURE__ */ g(h, { sx: { height: i, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
|
|
787
|
+
/* @__PURE__ */ g(
|
|
788
|
+
cr,
|
|
782
789
|
{
|
|
783
|
-
value:
|
|
784
|
-
onChange: (e, t) =>
|
|
790
|
+
value: ne,
|
|
791
|
+
onChange: (e, t) => _(t),
|
|
785
792
|
sx: {
|
|
786
793
|
minHeight: 40,
|
|
787
794
|
borderBottom: "1px solid",
|
|
@@ -793,14 +800,14 @@ function _r({
|
|
|
793
800
|
}
|
|
794
801
|
},
|
|
795
802
|
children: [
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ n(st, { value: "preview", label: s("htmlEditor.tabs.preview") }),
|
|
804
|
+
/* @__PURE__ */ n(st, { value: "variables", label: s("htmlEditor.tabs.variables") })
|
|
798
805
|
]
|
|
799
806
|
}
|
|
800
807
|
),
|
|
801
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ n(h, { sx: { flex: 1, minHeight: 0, overflow: "hidden", display: "flex", flexDirection: "column" }, children: ne === "preview" ? zt() : Nt() })
|
|
802
809
|
] });
|
|
803
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ g(
|
|
804
811
|
h,
|
|
805
812
|
{
|
|
806
813
|
sx: {
|
|
@@ -813,7 +820,7 @@ function _r({
|
|
|
813
820
|
...m
|
|
814
821
|
},
|
|
815
822
|
children: [
|
|
816
|
-
b && /* @__PURE__ */
|
|
823
|
+
b && /* @__PURE__ */ g(
|
|
817
824
|
h,
|
|
818
825
|
{
|
|
819
826
|
sx: {
|
|
@@ -826,55 +833,55 @@ function _r({
|
|
|
826
833
|
backgroundColor: "background.paper"
|
|
827
834
|
},
|
|
828
835
|
children: [
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
|
|
836
|
+
/* @__PURE__ */ g(h, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
837
|
+
/* @__PURE__ */ g(
|
|
838
|
+
at,
|
|
832
839
|
{
|
|
833
|
-
value:
|
|
840
|
+
value: $t,
|
|
834
841
|
exclusive: !0,
|
|
835
|
-
onChange:
|
|
842
|
+
onChange: Dt,
|
|
836
843
|
size: "small",
|
|
837
844
|
"aria-label": s("htmlEditor.mode.split"),
|
|
838
845
|
children: [
|
|
839
|
-
/* @__PURE__ */
|
|
846
|
+
/* @__PURE__ */ n(U, { title: s("htmlEditor.tooltips.splitView"), arrow: !0, slotProps: G, children: /* @__PURE__ */ n(
|
|
840
847
|
Z,
|
|
841
848
|
{
|
|
842
849
|
value: "split",
|
|
843
850
|
"aria-label": s("htmlEditor.mode.split"),
|
|
844
|
-
children: /* @__PURE__ */
|
|
851
|
+
children: /* @__PURE__ */ n(zr, { fontSize: "small" })
|
|
845
852
|
}
|
|
846
853
|
) }),
|
|
847
|
-
/* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ n(U, { title: s("htmlEditor.tooltips.codeOnly"), arrow: !0, slotProps: G, children: /* @__PURE__ */ n(
|
|
848
855
|
Z,
|
|
849
856
|
{
|
|
850
857
|
value: "code",
|
|
851
858
|
"aria-label": s("htmlEditor.mode.code"),
|
|
852
|
-
children: /* @__PURE__ */
|
|
859
|
+
children: /* @__PURE__ */ n(Ar, { fontSize: "small" })
|
|
853
860
|
}
|
|
854
861
|
) }),
|
|
855
|
-
/* @__PURE__ */
|
|
862
|
+
/* @__PURE__ */ n(U, { title: s("htmlEditor.tooltips.previewOnly"), arrow: !0, slotProps: G, children: /* @__PURE__ */ n(
|
|
856
863
|
Z,
|
|
857
864
|
{
|
|
858
865
|
value: "preview",
|
|
859
866
|
"aria-label": s("htmlEditor.mode.preview"),
|
|
860
|
-
children: /* @__PURE__ */ r
|
|
867
|
+
children: /* @__PURE__ */ n($r, { fontSize: "small" })
|
|
861
868
|
}
|
|
862
869
|
) })
|
|
863
870
|
]
|
|
864
871
|
}
|
|
865
872
|
),
|
|
866
|
-
/* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
|
|
873
|
+
/* @__PURE__ */ g(ir, { size: "small", sx: { minWidth: 140 }, children: [
|
|
874
|
+
/* @__PURE__ */ n(lr, { id: "theme-select-label", children: s("htmlEditor.theme") }),
|
|
875
|
+
/* @__PURE__ */ g(
|
|
876
|
+
sr,
|
|
870
877
|
{
|
|
871
878
|
labelId: "theme-select-label",
|
|
872
879
|
id: "theme-select",
|
|
873
|
-
value:
|
|
880
|
+
value: ke,
|
|
874
881
|
label: s("htmlEditor.theme"),
|
|
875
882
|
onChange: (e) => {
|
|
876
883
|
const t = e.target.value;
|
|
877
|
-
|
|
884
|
+
Et(t), jr(t);
|
|
878
885
|
},
|
|
879
886
|
sx: {
|
|
880
887
|
// fontSize: '0.875rem',
|
|
@@ -883,38 +890,38 @@ function _r({
|
|
|
883
890
|
}
|
|
884
891
|
},
|
|
885
892
|
children: [
|
|
886
|
-
/* @__PURE__ */
|
|
887
|
-
Object.entries(
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
Object.entries(
|
|
893
|
+
/* @__PURE__ */ n(it, { children: s("htmlEditor.lightThemes") }),
|
|
894
|
+
Object.entries(Pr).map(([e, t]) => /* @__PURE__ */ n(lt, { value: e, children: t }, e)),
|
|
895
|
+
/* @__PURE__ */ n(it, { children: s("htmlEditor.darkThemes") }),
|
|
896
|
+
Object.entries(_r).map(([e, t]) => /* @__PURE__ */ n(lt, { value: e, children: t }, e))
|
|
890
897
|
]
|
|
891
898
|
}
|
|
892
899
|
)
|
|
893
900
|
] })
|
|
894
901
|
] }),
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
|
|
902
|
+
/* @__PURE__ */ n(h, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: D !== "code" && /* @__PURE__ */ g(
|
|
903
|
+
at,
|
|
897
904
|
{
|
|
898
|
-
value:
|
|
905
|
+
value: Ft,
|
|
899
906
|
exclusive: !0,
|
|
900
|
-
onChange:
|
|
907
|
+
onChange: Mt,
|
|
901
908
|
size: "small",
|
|
902
909
|
"aria-label": s("htmlEditor.device.desktop"),
|
|
903
910
|
children: [
|
|
904
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ n(U, { title: s("htmlEditor.tooltips.desktopView"), arrow: !0, slotProps: G, children: /* @__PURE__ */ n(
|
|
905
912
|
Z,
|
|
906
913
|
{
|
|
907
914
|
value: "desktop",
|
|
908
915
|
"aria-label": s("htmlEditor.device.desktop"),
|
|
909
|
-
children: /* @__PURE__ */
|
|
916
|
+
children: /* @__PURE__ */ n(Nr, { fontSize: "small" })
|
|
910
917
|
}
|
|
911
918
|
) }),
|
|
912
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ n(U, { title: s("htmlEditor.tooltips.mobileView"), arrow: !0, slotProps: G, children: /* @__PURE__ */ n(
|
|
913
920
|
Z,
|
|
914
921
|
{
|
|
915
922
|
value: "mobile",
|
|
916
923
|
"aria-label": s("htmlEditor.device.mobile"),
|
|
917
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ n(Or, { fontSize: "small" })
|
|
918
925
|
}
|
|
919
926
|
) })
|
|
920
927
|
]
|
|
@@ -923,7 +930,7 @@ function _r({
|
|
|
923
930
|
]
|
|
924
931
|
}
|
|
925
932
|
),
|
|
926
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ g(
|
|
927
934
|
h,
|
|
928
935
|
{
|
|
929
936
|
sx: {
|
|
@@ -934,12 +941,12 @@ function _r({
|
|
|
934
941
|
overflow: "hidden"
|
|
935
942
|
},
|
|
936
943
|
children: [
|
|
937
|
-
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
944
|
+
D === "split" && /* @__PURE__ */ g(Wt, { children: [
|
|
945
|
+
/* @__PURE__ */ n(h, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: Ne() }),
|
|
946
|
+
/* @__PURE__ */ n(h, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: Oe() })
|
|
940
947
|
] }),
|
|
941
|
-
|
|
942
|
-
|
|
948
|
+
D === "code" && /* @__PURE__ */ n(h, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: Ne() }),
|
|
949
|
+
D === "preview" && /* @__PURE__ */ n(h, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: Oe() })
|
|
943
950
|
]
|
|
944
951
|
}
|
|
945
952
|
)
|
|
@@ -947,10 +954,10 @@ function _r({
|
|
|
947
954
|
}
|
|
948
955
|
);
|
|
949
956
|
}
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
const
|
|
953
|
-
|
|
957
|
+
const vt = pt(Gr);
|
|
958
|
+
vt.displayName = "HtmlEditorContent";
|
|
959
|
+
const Ur = pt((r, a) => /* @__PURE__ */ n(nr, { theme: Cr, children: /* @__PURE__ */ n(
|
|
960
|
+
or,
|
|
954
961
|
{
|
|
955
962
|
sx: {
|
|
956
963
|
height: "100%",
|
|
@@ -960,11 +967,11 @@ const Wr = mt((o, a) => /* @__PURE__ */ r(er, { theme: Ir, children: /* @__PURE_
|
|
|
960
967
|
display: "flex",
|
|
961
968
|
flexDirection: "column"
|
|
962
969
|
},
|
|
963
|
-
children: /* @__PURE__ */
|
|
970
|
+
children: /* @__PURE__ */ n(vt, { ref: a, ...r })
|
|
964
971
|
}
|
|
965
972
|
) }));
|
|
966
|
-
|
|
973
|
+
Ur.displayName = "HtmlEditor";
|
|
967
974
|
export {
|
|
968
|
-
|
|
969
|
-
|
|
975
|
+
Ur as HtmlEditor,
|
|
976
|
+
Ur as default
|
|
970
977
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monto-email-builder",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8",
|
|
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",
|