better-react-email-editor 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +354 -339
- package/dist/index.js.map +1 -1
- package/dist/styles.css +9 -0
- package/dist/types/core/select-all.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -364,8 +364,23 @@ function vt(e) {
|
|
|
364
364
|
}
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/core/select-all.ts
|
|
367
|
-
var yt = k.create({
|
|
367
|
+
var yt = /* @__PURE__ */ new Set(["columnsColumn", "codeBlock"]), bt = k.create({
|
|
368
368
|
name: "selectAllFix",
|
|
369
|
+
priority: 101,
|
|
370
|
+
addKeyboardShortcuts() {
|
|
371
|
+
return { "Mod-a": ({ editor: e }) => {
|
|
372
|
+
let { state: t } = e, { $from: n } = t.selection;
|
|
373
|
+
for (let e = n.depth; e > 0; e--) if (yt.has(n.node(e).type.name) && (t.selection.from !== n.start(e) || t.selection.to !== n.end(e))) return !1;
|
|
374
|
+
let r = -1;
|
|
375
|
+
t.doc.forEach((e, t) => {
|
|
376
|
+
r < 0 && e.type.name === "container" && (r = t);
|
|
377
|
+
});
|
|
378
|
+
let i = r < 0 ? null : t.doc.nodeAt(r);
|
|
379
|
+
if (!i) return !1;
|
|
380
|
+
let a = r + 1, o = r + i.nodeSize - 1;
|
|
381
|
+
return (t.selection.from !== a || t.selection.to !== o) && e.view.dispatch(t.tr.setSelection(O.create(t.doc, a, o))), !0;
|
|
382
|
+
} };
|
|
383
|
+
},
|
|
369
384
|
addProseMirrorPlugins() {
|
|
370
385
|
return [new T({
|
|
371
386
|
key: new E("selectAllFix"),
|
|
@@ -384,7 +399,7 @@ var yt = k.create({
|
|
|
384
399
|
});
|
|
385
400
|
//#endregion
|
|
386
401
|
//#region src/core/stores.ts
|
|
387
|
-
function
|
|
402
|
+
function xt() {
|
|
388
403
|
let e = null;
|
|
389
404
|
return {
|
|
390
405
|
get: () => e,
|
|
@@ -396,7 +411,7 @@ function bt() {
|
|
|
396
411
|
}
|
|
397
412
|
};
|
|
398
413
|
}
|
|
399
|
-
function
|
|
414
|
+
function St() {
|
|
400
415
|
let e = null, t = /* @__PURE__ */ new Set();
|
|
401
416
|
return {
|
|
402
417
|
get: () => e,
|
|
@@ -413,7 +428,7 @@ function xt() {
|
|
|
413
428
|
}
|
|
414
429
|
//#endregion
|
|
415
430
|
//#region src/i18n/en.ts
|
|
416
|
-
var
|
|
431
|
+
var Ct = {
|
|
417
432
|
topBar: {
|
|
418
433
|
layers: "Layers",
|
|
419
434
|
toggleLayers: "Show / hide layers",
|
|
@@ -682,7 +697,7 @@ var St = {
|
|
|
682
697
|
starterTitle: "Our favourites"
|
|
683
698
|
},
|
|
684
699
|
slashCommands: {}
|
|
685
|
-
},
|
|
700
|
+
}, wt = {
|
|
686
701
|
topBar: {
|
|
687
702
|
layers: "Calques",
|
|
688
703
|
toggleLayers: "Afficher / masquer les calques",
|
|
@@ -1008,43 +1023,43 @@ var St = {
|
|
|
1008
1023
|
description: "Mise en page sur quatre colonnes"
|
|
1009
1024
|
}
|
|
1010
1025
|
}
|
|
1011
|
-
},
|
|
1012
|
-
en:
|
|
1013
|
-
fr:
|
|
1026
|
+
}, Tt = {
|
|
1027
|
+
en: Ct,
|
|
1028
|
+
fr: wt
|
|
1014
1029
|
};
|
|
1015
|
-
function
|
|
1030
|
+
function Et(e, t) {
|
|
1016
1031
|
return typeof e == "function" ? e(t) : e;
|
|
1017
1032
|
}
|
|
1018
|
-
function
|
|
1033
|
+
function Dt(e) {
|
|
1019
1034
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1020
1035
|
}
|
|
1021
|
-
function
|
|
1022
|
-
if (!
|
|
1036
|
+
function Ot(e, t) {
|
|
1037
|
+
if (!Dt(t) || !Dt(e)) return t ?? e;
|
|
1023
1038
|
let n = { ...e };
|
|
1024
|
-
for (let [e, r] of Object.entries(t)) r !== void 0 && (n[e] =
|
|
1039
|
+
for (let [e, r] of Object.entries(t)) r !== void 0 && (n[e] = Dt(r) && Dt(n[e]) ? Ot(n[e], r) : r);
|
|
1025
1040
|
return n;
|
|
1026
1041
|
}
|
|
1027
|
-
function
|
|
1028
|
-
let n =
|
|
1029
|
-
return t ?
|
|
1042
|
+
function kt(e, t) {
|
|
1043
|
+
let n = Tt[e] ?? Ct;
|
|
1044
|
+
return t ? Ot(n, t) : n;
|
|
1030
1045
|
}
|
|
1031
1046
|
//#endregion
|
|
1032
1047
|
//#region src/components/icons.tsx
|
|
1033
|
-
var
|
|
1034
|
-
CopyIcon: () =>
|
|
1035
|
-
DesktopIcon: () =>
|
|
1036
|
-
GripIcon: () =>
|
|
1037
|
-
LayersIcon: () =>
|
|
1038
|
-
MobileIcon: () =>
|
|
1039
|
-
OneColumnIcon: () =>
|
|
1040
|
-
ParentIcon: () =>
|
|
1041
|
-
PipetteIcon: () =>
|
|
1042
|
-
RedoIcon: () =>
|
|
1043
|
-
SocialIcon: () =>
|
|
1044
|
-
SpacerIcon: () =>
|
|
1045
|
-
SpacerTileIcon: () =>
|
|
1046
|
-
TrashIcon: () =>
|
|
1047
|
-
UndoIcon: () =>
|
|
1048
|
+
var At = /* @__PURE__ */ Be({
|
|
1049
|
+
CopyIcon: () => Mt,
|
|
1050
|
+
DesktopIcon: () => Lt,
|
|
1051
|
+
GripIcon: () => jt,
|
|
1052
|
+
LayersIcon: () => zt,
|
|
1053
|
+
MobileIcon: () => Rt,
|
|
1054
|
+
OneColumnIcon: () => Wt,
|
|
1055
|
+
ParentIcon: () => Pt,
|
|
1056
|
+
PipetteIcon: () => Bt,
|
|
1057
|
+
RedoIcon: () => It,
|
|
1058
|
+
SocialIcon: () => Ut,
|
|
1059
|
+
SpacerIcon: () => Vt,
|
|
1060
|
+
SpacerTileIcon: () => Ht,
|
|
1061
|
+
TrashIcon: () => Nt,
|
|
1062
|
+
UndoIcon: () => Ft
|
|
1048
1063
|
}), B = (e, t = 2) => ({
|
|
1049
1064
|
viewBox: "0 0 24 24",
|
|
1050
1065
|
width: e,
|
|
@@ -1055,7 +1070,7 @@ var kt = /* @__PURE__ */ Be({
|
|
|
1055
1070
|
strokeLinecap: "round",
|
|
1056
1071
|
strokeLinejoin: "round",
|
|
1057
1072
|
"aria-hidden": !0
|
|
1058
|
-
}),
|
|
1073
|
+
}), jt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
|
|
1059
1074
|
viewBox: "0 0 24 24",
|
|
1060
1075
|
width: e,
|
|
1061
1076
|
height: e,
|
|
@@ -1074,7 +1089,7 @@ var kt = /* @__PURE__ */ Be({
|
|
|
1074
1089
|
cy: e,
|
|
1075
1090
|
r: "1.6"
|
|
1076
1091
|
})] }, e))
|
|
1077
|
-
}),
|
|
1092
|
+
}), Mt = ({ size: e = 14 }) => /* @__PURE__ */ L("svg", {
|
|
1078
1093
|
...B(e),
|
|
1079
1094
|
children: [/* @__PURE__ */ I("rect", {
|
|
1080
1095
|
x: "8",
|
|
@@ -1083,19 +1098,19 @@ var kt = /* @__PURE__ */ Be({
|
|
|
1083
1098
|
height: "12",
|
|
1084
1099
|
rx: "2"
|
|
1085
1100
|
}), /* @__PURE__ */ I("path", { d: "M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" })]
|
|
1086
|
-
}),
|
|
1101
|
+
}), Nt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
|
|
1087
1102
|
...B(e),
|
|
1088
1103
|
children: /* @__PURE__ */ I("path", { d: "M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3" })
|
|
1089
|
-
}),
|
|
1104
|
+
}), Pt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
|
|
1090
1105
|
...B(e),
|
|
1091
1106
|
children: /* @__PURE__ */ I("path", { d: "M12 19V5M6 11l6-6 6 6" })
|
|
1092
|
-
}),
|
|
1107
|
+
}), Ft = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
|
|
1093
1108
|
...B(e),
|
|
1094
1109
|
children: [/* @__PURE__ */ I("path", { d: "M9 14 4 9l5-5" }), /* @__PURE__ */ I("path", { d: "M4 9h10.5a5.5 5.5 0 0 1 0 11H11" })]
|
|
1095
|
-
}),
|
|
1110
|
+
}), It = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
|
|
1096
1111
|
...B(e),
|
|
1097
1112
|
children: [/* @__PURE__ */ I("path", { d: "m15 14 5-5-5-5" }), /* @__PURE__ */ I("path", { d: "M20 9H9.5a5.5 5.5 0 0 0 0 11H13" })]
|
|
1098
|
-
}),
|
|
1113
|
+
}), Lt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
|
|
1099
1114
|
...B(e),
|
|
1100
1115
|
children: [/* @__PURE__ */ I("rect", {
|
|
1101
1116
|
x: "3",
|
|
@@ -1104,7 +1119,7 @@ var kt = /* @__PURE__ */ Be({
|
|
|
1104
1119
|
height: "12",
|
|
1105
1120
|
rx: "2"
|
|
1106
1121
|
}), /* @__PURE__ */ I("path", { d: "M8 20h8M12 16v4" })]
|
|
1107
|
-
}),
|
|
1122
|
+
}), Rt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
|
|
1108
1123
|
...B(e),
|
|
1109
1124
|
children: [/* @__PURE__ */ I("rect", {
|
|
1110
1125
|
x: "7",
|
|
@@ -1113,23 +1128,23 @@ var kt = /* @__PURE__ */ Be({
|
|
|
1113
1128
|
height: "20",
|
|
1114
1129
|
rx: "2"
|
|
1115
1130
|
}), /* @__PURE__ */ I("path", { d: "M11 18h2" })]
|
|
1116
|
-
}),
|
|
1131
|
+
}), zt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
|
|
1117
1132
|
...B(e),
|
|
1118
1133
|
children: [/* @__PURE__ */ I("path", { d: "m12 3 9 5-9 5-9-5 9-5Z" }), /* @__PURE__ */ I("path", { d: "m3 13 9 5 9-5" })]
|
|
1119
|
-
}),
|
|
1134
|
+
}), Bt = ({ size: e = 15 }) => /* @__PURE__ */ L("svg", {
|
|
1120
1135
|
...B(e),
|
|
1121
1136
|
children: [
|
|
1122
1137
|
/* @__PURE__ */ I("path", { d: "m2 22 1-1h3l9-9" }),
|
|
1123
1138
|
/* @__PURE__ */ I("path", { d: "M3 21v-3l9-9" }),
|
|
1124
1139
|
/* @__PURE__ */ I("path", { d: "m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z" })
|
|
1125
1140
|
]
|
|
1126
|
-
}),
|
|
1141
|
+
}), Vt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
|
|
1127
1142
|
...B(e),
|
|
1128
1143
|
children: /* @__PURE__ */ I("path", { d: "M4 4h16M4 20h16M12 8v8" })
|
|
1129
|
-
}),
|
|
1144
|
+
}), Ht = ({ size: e = 22 }) => /* @__PURE__ */ I("svg", {
|
|
1130
1145
|
...B(e, 1.8),
|
|
1131
1146
|
children: /* @__PURE__ */ I("path", { d: "M4 4h16M4 20h16M12 7v10M9 9.5 12 7l3 2.5M9 14.5l3 2.5 3-2.5" })
|
|
1132
|
-
}),
|
|
1147
|
+
}), Ut = ({ size: e = 22 }) => /* @__PURE__ */ L("svg", {
|
|
1133
1148
|
...B(e, 1.8),
|
|
1134
1149
|
children: [
|
|
1135
1150
|
/* @__PURE__ */ I("circle", {
|
|
@@ -1149,7 +1164,7 @@ var kt = /* @__PURE__ */ Be({
|
|
|
1149
1164
|
}),
|
|
1150
1165
|
/* @__PURE__ */ I("path", { d: "m8.2 10.8 7.6-3.6M8.2 13.2l7.6 3.6" })
|
|
1151
1166
|
]
|
|
1152
|
-
}),
|
|
1167
|
+
}), Wt = ({ size: e = 22 }) => /* @__PURE__ */ I("svg", {
|
|
1153
1168
|
...B(e, 1.8),
|
|
1154
1169
|
children: /* @__PURE__ */ I("rect", {
|
|
1155
1170
|
x: "4",
|
|
@@ -1195,12 +1210,12 @@ function H({ label: e, children: t, stacked: n, className: r, style: i }) {
|
|
|
1195
1210
|
})]
|
|
1196
1211
|
});
|
|
1197
1212
|
}
|
|
1198
|
-
function
|
|
1213
|
+
function Gt(e) {
|
|
1199
1214
|
let [t, n] = l(e), [r, i] = l(e);
|
|
1200
1215
|
return Object.is(e, r) || (i(e), n(e)), [t, n];
|
|
1201
1216
|
}
|
|
1202
1217
|
function U({ value: e, onChange: t, placeholder: n, type: r = "text", className: i, style: a }) {
|
|
1203
|
-
let [o, s] =
|
|
1218
|
+
let [o, s] = Gt(e);
|
|
1204
1219
|
return /* @__PURE__ */ I("input", {
|
|
1205
1220
|
className: R("bree-input", i),
|
|
1206
1221
|
style: a,
|
|
@@ -1214,8 +1229,8 @@ function U({ value: e, onChange: t, placeholder: n, type: r = "text", className:
|
|
|
1214
1229
|
}
|
|
1215
1230
|
});
|
|
1216
1231
|
}
|
|
1217
|
-
function
|
|
1218
|
-
let [a, o] =
|
|
1232
|
+
function Kt({ value: e, onChange: t, rows: n = 8, className: r, style: i }) {
|
|
1233
|
+
let [a, o] = Gt(e);
|
|
1219
1234
|
return /* @__PURE__ */ I("textarea", {
|
|
1220
1235
|
className: R("bree-input bree-textarea", r),
|
|
1221
1236
|
style: i,
|
|
@@ -1226,13 +1241,13 @@ function Gt({ value: e, onChange: t, rows: n = 8, className: r, style: i }) {
|
|
|
1226
1241
|
onBlur: () => a !== e && t(a)
|
|
1227
1242
|
});
|
|
1228
1243
|
}
|
|
1229
|
-
function
|
|
1244
|
+
function qt(e) {
|
|
1230
1245
|
if (e == null || e === "" || e === "auto") return "";
|
|
1231
1246
|
let t = Number.parseFloat(String(e));
|
|
1232
1247
|
return Number.isFinite(t) ? t : "";
|
|
1233
1248
|
}
|
|
1234
1249
|
function W({ value: e, onChange: t, unit: n = "px", min: r = 0, max: i, step: a = 1, placeholder: o, className: s, style: c }) {
|
|
1235
|
-
let l = $(), [u, d] =
|
|
1250
|
+
let l = $(), [u, d] = Gt(String(qt(e))), f = (e) => {
|
|
1236
1251
|
if (e.trim() === "") return t("");
|
|
1237
1252
|
let n = Number.parseFloat(e);
|
|
1238
1253
|
Number.isFinite(n) && t(Math.max(r, i === void 0 ? n : Math.min(i, n)));
|
|
@@ -1250,7 +1265,7 @@ function W({ value: e, onChange: t, unit: n = "px", min: r = 0, max: i, step: a
|
|
|
1250
1265
|
onKeyDown: (e) => {
|
|
1251
1266
|
if (e.key === "Enter" && f(u), e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
1252
1267
|
e.preventDefault();
|
|
1253
|
-
let t = (
|
|
1268
|
+
let t = (qt(u) || 0) + (e.key === "ArrowUp" ? a : -a) * (e.shiftKey ? 10 : 1);
|
|
1254
1269
|
d(String(t)), f(String(t));
|
|
1255
1270
|
}
|
|
1256
1271
|
}
|
|
@@ -1260,8 +1275,8 @@ function W({ value: e, onChange: t, unit: n = "px", min: r = 0, max: i, step: a
|
|
|
1260
1275
|
})]
|
|
1261
1276
|
});
|
|
1262
1277
|
}
|
|
1263
|
-
function
|
|
1264
|
-
let s =
|
|
1278
|
+
function Jt({ value: e, onChange: t, min: n, max: r, unit: i = "px", className: a, style: o }) {
|
|
1279
|
+
let s = qt(e) || n;
|
|
1265
1280
|
return /* @__PURE__ */ L("span", {
|
|
1266
1281
|
className: R("bree-range", a),
|
|
1267
1282
|
style: o,
|
|
@@ -1277,7 +1292,7 @@ function qt({ value: e, onChange: t, min: n, max: r, unit: i = "px", className:
|
|
|
1277
1292
|
})]
|
|
1278
1293
|
});
|
|
1279
1294
|
}
|
|
1280
|
-
var
|
|
1295
|
+
var Yt = [
|
|
1281
1296
|
"#111827",
|
|
1282
1297
|
"#374151",
|
|
1283
1298
|
"#6b7280",
|
|
@@ -1297,15 +1312,15 @@ var Jt = [
|
|
|
1297
1312
|
"#ecfdf5",
|
|
1298
1313
|
"#fef3c7"
|
|
1299
1314
|
];
|
|
1300
|
-
function
|
|
1315
|
+
function Xt(e) {
|
|
1301
1316
|
let t = e.trim().toLowerCase();
|
|
1302
1317
|
if (/^#[0-9a-f]{6}$/.test(t)) return t;
|
|
1303
1318
|
if (/^#[0-9a-f]{3}$/.test(t)) return `#${[...t.slice(1)].map((e) => e + e).join("")}`;
|
|
1304
1319
|
let n = t.match(/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/);
|
|
1305
1320
|
return n ? `#${n.slice(1, 4).map((e) => Number(e).toString(16).padStart(2, "0")).join("")}` : null;
|
|
1306
1321
|
}
|
|
1307
|
-
function G({ value: e, onChange: t, presets: n = [], swatches: r =
|
|
1308
|
-
let d = $(), f = a ?? d.fields.colorDefault, p = typeof e == "string" ? e : "", m =
|
|
1322
|
+
function G({ value: e, onChange: t, presets: n = [], swatches: r = Yt, placeholder: a, className: o, style: s, popoverClassName: u }) {
|
|
1323
|
+
let d = $(), f = a ?? d.fields.colorDefault, p = typeof e == "string" ? e : "", m = Xt(p), [h, g] = l(!1), [_, v] = l(m ?? "#ffffff"), y = c(t);
|
|
1309
1324
|
i(() => {
|
|
1310
1325
|
y.current = t;
|
|
1311
1326
|
});
|
|
@@ -1314,8 +1329,8 @@ function G({ value: e, onChange: t, presets: n = [], swatches: r = Jt, placehold
|
|
|
1314
1329
|
}, C = (e) => {
|
|
1315
1330
|
v(e), b.current = e, x.current ||= window.setTimeout(S, 60);
|
|
1316
1331
|
}, w = (e) => {
|
|
1317
|
-
b.current = null, window.clearTimeout(x.current), x.current = 0, v(
|
|
1318
|
-
}, T = typeof window < "u" ? window.EyeDropper : void 0, E = [...new Set(n.map((e) =>
|
|
1332
|
+
b.current = null, window.clearTimeout(x.current), x.current = 0, v(Xt(e) ?? _), y.current(e);
|
|
1333
|
+
}, T = typeof window < "u" ? window.EyeDropper : void 0, E = [...new Set(n.map((e) => Xt(e)).filter((e) => !!e))].slice(0, 9);
|
|
1319
1334
|
return /* @__PURE__ */ L(Ae.Root, {
|
|
1320
1335
|
open: h,
|
|
1321
1336
|
onOpenChange: (e) => {
|
|
@@ -1369,7 +1384,7 @@ function G({ value: e, onChange: t, presets: n = [], swatches: r = Jt, placehold
|
|
|
1369
1384
|
className: "bree-icon-button",
|
|
1370
1385
|
title: d.fields.eyedropper,
|
|
1371
1386
|
onClick: () => new T().open().then((e) => w(e.sRGBHex)).catch(() => {}),
|
|
1372
|
-
children: /* @__PURE__ */ I(
|
|
1387
|
+
children: /* @__PURE__ */ I(Bt, {})
|
|
1373
1388
|
})
|
|
1374
1389
|
]
|
|
1375
1390
|
}),
|
|
@@ -1412,7 +1427,7 @@ function G({ value: e, onChange: t, presets: n = [], swatches: r = Jt, placehold
|
|
|
1412
1427
|
}) }) })]
|
|
1413
1428
|
});
|
|
1414
1429
|
}
|
|
1415
|
-
function
|
|
1430
|
+
function Zt({ value: e, onChange: t, options: n, className: r, style: i }) {
|
|
1416
1431
|
return /* @__PURE__ */ I("select", {
|
|
1417
1432
|
className: R("bree-input bree-select", r),
|
|
1418
1433
|
style: i,
|
|
@@ -1424,7 +1439,7 @@ function Xt({ value: e, onChange: t, options: n, className: r, style: i }) {
|
|
|
1424
1439
|
}, e))
|
|
1425
1440
|
});
|
|
1426
1441
|
}
|
|
1427
|
-
function
|
|
1442
|
+
function Qt({ value: e, onChange: t, options: n, ariaLabel: r, className: i, style: a }) {
|
|
1428
1443
|
return /* @__PURE__ */ I("span", {
|
|
1429
1444
|
className: R("bree-segmented", i),
|
|
1430
1445
|
style: a,
|
|
@@ -1441,9 +1456,9 @@ function Zt({ value: e, onChange: t, options: n, ariaLabel: r, className: i, sty
|
|
|
1441
1456
|
}, n.value))
|
|
1442
1457
|
});
|
|
1443
1458
|
}
|
|
1444
|
-
function
|
|
1459
|
+
function $t({ value: e, onChange: t, className: n, style: r }) {
|
|
1445
1460
|
let i = $();
|
|
1446
|
-
return /* @__PURE__ */ I(
|
|
1461
|
+
return /* @__PURE__ */ I(Qt, {
|
|
1447
1462
|
className: n,
|
|
1448
1463
|
style: r,
|
|
1449
1464
|
value: e || "left",
|
|
@@ -1467,13 +1482,13 @@ function Qt({ value: e, onChange: t, className: n, style: r }) {
|
|
|
1467
1482
|
]
|
|
1468
1483
|
});
|
|
1469
1484
|
}
|
|
1470
|
-
function
|
|
1485
|
+
function en({ get: e, set: t, className: n, style: r }) {
|
|
1471
1486
|
let i = $(), a = [
|
|
1472
1487
|
"Top",
|
|
1473
1488
|
"Right",
|
|
1474
1489
|
"Bottom",
|
|
1475
1490
|
"Left"
|
|
1476
|
-
], o = a.map((t) =>
|
|
1491
|
+
], o = a.map((t) => qt(e(t))), s = o.every((e) => e === o[0]), [c, u] = l(!s), d = {
|
|
1477
1492
|
Top: i.fields.top,
|
|
1478
1493
|
Right: i.fields.right,
|
|
1479
1494
|
Bottom: i.fields.bottom,
|
|
@@ -1507,7 +1522,7 @@ function $t({ get: e, set: t, className: n, style: r }) {
|
|
|
1507
1522
|
//#endregion
|
|
1508
1523
|
//#region src/components/inspectors/groups.tsx
|
|
1509
1524
|
var K = (e) => e;
|
|
1510
|
-
function
|
|
1525
|
+
function tn({ ctx: e, alignment: t, setAlignment: n, className: r, style: i }) {
|
|
1511
1526
|
let a = $().inspector;
|
|
1512
1527
|
return /* @__PURE__ */ L(V, {
|
|
1513
1528
|
title: a.typography,
|
|
@@ -1534,7 +1549,7 @@ function en({ ctx: e, alignment: t, setAlignment: n, className: r, style: i }) {
|
|
|
1534
1549
|
}),
|
|
1535
1550
|
/* @__PURE__ */ I(H, {
|
|
1536
1551
|
label: a.weight,
|
|
1537
|
-
children: /* @__PURE__ */ I(
|
|
1552
|
+
children: /* @__PURE__ */ I(Zt, {
|
|
1538
1553
|
value: String(e.getStyle(K("fontWeight")) ?? "400"),
|
|
1539
1554
|
onChange: (t) => e.setStyle(K("fontWeight"), t),
|
|
1540
1555
|
options: [
|
|
@@ -1559,7 +1574,7 @@ function en({ ctx: e, alignment: t, setAlignment: n, className: r, style: i }) {
|
|
|
1559
1574
|
}),
|
|
1560
1575
|
n && /* @__PURE__ */ I(H, {
|
|
1561
1576
|
label: a.alignment,
|
|
1562
|
-
children: /* @__PURE__ */ I(
|
|
1577
|
+
children: /* @__PURE__ */ I($t, {
|
|
1563
1578
|
value: t ?? "left",
|
|
1564
1579
|
onChange: n
|
|
1565
1580
|
})
|
|
@@ -1567,7 +1582,7 @@ function en({ ctx: e, alignment: t, setAlignment: n, className: r, style: i }) {
|
|
|
1567
1582
|
]
|
|
1568
1583
|
});
|
|
1569
1584
|
}
|
|
1570
|
-
function
|
|
1585
|
+
function nn({ ctx: e, title: t, className: n, style: r }) {
|
|
1571
1586
|
let i = $();
|
|
1572
1587
|
return /* @__PURE__ */ I(V, {
|
|
1573
1588
|
title: t ?? i.inspector.spacing,
|
|
@@ -1576,7 +1591,7 @@ function q({ ctx: e, title: t, className: n, style: r }) {
|
|
|
1576
1591
|
children: /* @__PURE__ */ I(H, {
|
|
1577
1592
|
label: i.inspector.padding,
|
|
1578
1593
|
stacked: !0,
|
|
1579
|
-
children: /* @__PURE__ */ I(
|
|
1594
|
+
children: /* @__PURE__ */ I(en, {
|
|
1580
1595
|
get: (t) => e.getStyle(K(`padding${t}`)) ?? e.getStyle(K("padding")),
|
|
1581
1596
|
set: (t) => e.batchSetStyle([{
|
|
1582
1597
|
prop: K("padding"),
|
|
@@ -1589,7 +1604,7 @@ function q({ ctx: e, title: t, className: n, style: r }) {
|
|
|
1589
1604
|
})
|
|
1590
1605
|
});
|
|
1591
1606
|
}
|
|
1592
|
-
function
|
|
1607
|
+
function rn({ ctx: e, className: t, style: n }) {
|
|
1593
1608
|
let r = $().inspector;
|
|
1594
1609
|
return /* @__PURE__ */ L(V, {
|
|
1595
1610
|
title: r.box,
|
|
@@ -1639,7 +1654,7 @@ function tn({ ctx: e, className: t, style: n }) {
|
|
|
1639
1654
|
}
|
|
1640
1655
|
//#endregion
|
|
1641
1656
|
//#region src/components/inspectors/ButtonInspector.tsx
|
|
1642
|
-
function
|
|
1657
|
+
function an({ ctx: e, className: t, style: n }) {
|
|
1643
1658
|
let r = $().inspector;
|
|
1644
1659
|
return /* @__PURE__ */ L("div", {
|
|
1645
1660
|
className: R("bree-inspector", t),
|
|
@@ -1662,7 +1677,7 @@ function nn({ ctx: e, className: t, style: n }) {
|
|
|
1662
1677
|
children: [
|
|
1663
1678
|
/* @__PURE__ */ I(H, {
|
|
1664
1679
|
label: r.alignment,
|
|
1665
|
-
children: /* @__PURE__ */ I(
|
|
1680
|
+
children: /* @__PURE__ */ I($t, {
|
|
1666
1681
|
value: String(e.getAttr("alignment") ?? "left"),
|
|
1667
1682
|
onChange: (t) => e.setAttr("alignment", t)
|
|
1668
1683
|
})
|
|
@@ -1703,7 +1718,7 @@ function nn({ ctx: e, className: t, style: n }) {
|
|
|
1703
1718
|
})
|
|
1704
1719
|
]
|
|
1705
1720
|
}),
|
|
1706
|
-
/* @__PURE__ */ I(
|
|
1721
|
+
/* @__PURE__ */ I(nn, {
|
|
1707
1722
|
ctx: e,
|
|
1708
1723
|
title: r.buttonPadding
|
|
1709
1724
|
})
|
|
@@ -1712,7 +1727,7 @@ function nn({ ctx: e, className: t, style: n }) {
|
|
|
1712
1727
|
}
|
|
1713
1728
|
//#endregion
|
|
1714
1729
|
//#region src/components/inspectors/ColumnsInspector.tsx
|
|
1715
|
-
function
|
|
1730
|
+
function on({ ctx: e, className: t, style: n }) {
|
|
1716
1731
|
let { editor: r, t: i } = Q(), a = i.inspector, o = {
|
|
1717
1732
|
twoColumns: 2,
|
|
1718
1733
|
threeColumns: 3,
|
|
@@ -1786,7 +1801,7 @@ function rn({ ctx: e, className: t, style: n }) {
|
|
|
1786
1801
|
}
|
|
1787
1802
|
//#endregion
|
|
1788
1803
|
//#region src/components/inspectors/HeadingInspector.tsx
|
|
1789
|
-
function
|
|
1804
|
+
function sn({ ctx: e, className: t, style: n }) {
|
|
1790
1805
|
let r = $();
|
|
1791
1806
|
return /* @__PURE__ */ L("div", {
|
|
1792
1807
|
className: R("bree-inspector", t),
|
|
@@ -1796,7 +1811,7 @@ function an({ ctx: e, className: t, style: n }) {
|
|
|
1796
1811
|
title: r.inspector.heading,
|
|
1797
1812
|
children: /* @__PURE__ */ I(H, {
|
|
1798
1813
|
label: r.inspector.level,
|
|
1799
|
-
children: /* @__PURE__ */ I(
|
|
1814
|
+
children: /* @__PURE__ */ I(Qt, {
|
|
1800
1815
|
value: String(e.getAttr("level") ?? 1),
|
|
1801
1816
|
onChange: (t) => e.setAttr("level", Number(t)),
|
|
1802
1817
|
options: [
|
|
@@ -1816,19 +1831,19 @@ function an({ ctx: e, className: t, style: n }) {
|
|
|
1816
1831
|
})
|
|
1817
1832
|
})
|
|
1818
1833
|
}),
|
|
1819
|
-
/* @__PURE__ */ I(
|
|
1834
|
+
/* @__PURE__ */ I(tn, {
|
|
1820
1835
|
ctx: e,
|
|
1821
1836
|
alignment: String(e.getAttr("alignment") ?? "left"),
|
|
1822
1837
|
setAlignment: (t) => e.setAttr("alignment", t)
|
|
1823
1838
|
}),
|
|
1824
|
-
/* @__PURE__ */ I(
|
|
1825
|
-
/* @__PURE__ */ I(
|
|
1839
|
+
/* @__PURE__ */ I(nn, { ctx: e }),
|
|
1840
|
+
/* @__PURE__ */ I(rn, { ctx: e })
|
|
1826
1841
|
]
|
|
1827
1842
|
});
|
|
1828
1843
|
}
|
|
1829
1844
|
//#endregion
|
|
1830
1845
|
//#region src/components/inspectors/ImageInspector.tsx
|
|
1831
|
-
function
|
|
1846
|
+
function cn({ ctx: e, className: t, style: n }) {
|
|
1832
1847
|
let { t: r, uploadImage: i } = Q(), a = r.inspector, o = String(e.getAttr("width") ?? "auto");
|
|
1833
1848
|
return /* @__PURE__ */ L("div", {
|
|
1834
1849
|
className: R("bree-inspector", t),
|
|
@@ -1888,7 +1903,7 @@ function on({ ctx: e, className: t, style: n }) {
|
|
|
1888
1903
|
}),
|
|
1889
1904
|
o !== "auto" && /* @__PURE__ */ I(H, {
|
|
1890
1905
|
label: a.width,
|
|
1891
|
-
children: /* @__PURE__ */ I(
|
|
1906
|
+
children: /* @__PURE__ */ I(Jt, {
|
|
1892
1907
|
value: o,
|
|
1893
1908
|
min: 20,
|
|
1894
1909
|
max: 900,
|
|
@@ -1897,7 +1912,7 @@ function on({ ctx: e, className: t, style: n }) {
|
|
|
1897
1912
|
}),
|
|
1898
1913
|
/* @__PURE__ */ I(H, {
|
|
1899
1914
|
label: a.alignment,
|
|
1900
|
-
children: /* @__PURE__ */ I(
|
|
1915
|
+
children: /* @__PURE__ */ I($t, {
|
|
1901
1916
|
value: String(e.getAttr("alignment") ?? "center"),
|
|
1902
1917
|
onChange: (t) => e.setAttr("alignment", t)
|
|
1903
1918
|
})
|
|
@@ -1923,13 +1938,13 @@ function on({ ctx: e, className: t, style: n }) {
|
|
|
1923
1938
|
})
|
|
1924
1939
|
})
|
|
1925
1940
|
}),
|
|
1926
|
-
/* @__PURE__ */ I(
|
|
1941
|
+
/* @__PURE__ */ I(nn, { ctx: e })
|
|
1927
1942
|
]
|
|
1928
1943
|
});
|
|
1929
1944
|
}
|
|
1930
1945
|
//#endregion
|
|
1931
1946
|
//#region src/components/inspectors/SimpleInspectors.tsx
|
|
1932
|
-
function
|
|
1947
|
+
function ln({ ctx: e, className: t, style: n }) {
|
|
1933
1948
|
let r = $();
|
|
1934
1949
|
return /* @__PURE__ */ I("div", {
|
|
1935
1950
|
className: R("bree-inspector", t),
|
|
@@ -1938,7 +1953,7 @@ function sn({ ctx: e, className: t, style: n }) {
|
|
|
1938
1953
|
title: r.inspector.spacer,
|
|
1939
1954
|
children: /* @__PURE__ */ I(H, {
|
|
1940
1955
|
label: r.inspector.height,
|
|
1941
|
-
children: /* @__PURE__ */ I(
|
|
1956
|
+
children: /* @__PURE__ */ I(Jt, {
|
|
1942
1957
|
value: e.getAttr("height"),
|
|
1943
1958
|
min: 4,
|
|
1944
1959
|
max: 160,
|
|
@@ -1948,14 +1963,14 @@ function sn({ ctx: e, className: t, style: n }) {
|
|
|
1948
1963
|
})
|
|
1949
1964
|
});
|
|
1950
1965
|
}
|
|
1951
|
-
function
|
|
1966
|
+
function un({ ctx: e, className: t, style: n }) {
|
|
1952
1967
|
let r = $();
|
|
1953
1968
|
return /* @__PURE__ */ I("div", {
|
|
1954
1969
|
className: R("bree-inspector", t),
|
|
1955
1970
|
style: n,
|
|
1956
1971
|
children: /* @__PURE__ */ L(V, {
|
|
1957
1972
|
title: r.inspector.htmlCode,
|
|
1958
|
-
children: [/* @__PURE__ */ I(
|
|
1973
|
+
children: [/* @__PURE__ */ I(Kt, {
|
|
1959
1974
|
value: String(e.getAttr("html") ?? ""),
|
|
1960
1975
|
onChange: (t) => e.setAttr("html", t),
|
|
1961
1976
|
rows: 14
|
|
@@ -1966,7 +1981,7 @@ function cn({ ctx: e, className: t, style: n }) {
|
|
|
1966
1981
|
})
|
|
1967
1982
|
});
|
|
1968
1983
|
}
|
|
1969
|
-
function
|
|
1984
|
+
function dn({ ctx: e, className: t, style: n }) {
|
|
1970
1985
|
let r = $().inspector;
|
|
1971
1986
|
return /* @__PURE__ */ I("div", {
|
|
1972
1987
|
className: R("bree-inspector", t),
|
|
@@ -2000,7 +2015,7 @@ function ln({ ctx: e, className: t, style: n }) {
|
|
|
2000
2015
|
}),
|
|
2001
2016
|
/* @__PURE__ */ I(H, {
|
|
2002
2017
|
label: r.lineStyle,
|
|
2003
|
-
children: /* @__PURE__ */ I(
|
|
2018
|
+
children: /* @__PURE__ */ I(Qt, {
|
|
2004
2019
|
value: String(e.getStyle(K("borderTopStyle")) ?? "solid"),
|
|
2005
2020
|
onChange: (t) => e.setStyle(K("borderTopStyle"), t),
|
|
2006
2021
|
options: [
|
|
@@ -2023,16 +2038,16 @@ function ln({ ctx: e, className: t, style: n }) {
|
|
|
2023
2038
|
})
|
|
2024
2039
|
});
|
|
2025
2040
|
}
|
|
2026
|
-
function
|
|
2041
|
+
function fn({ ctx: e, className: t, style: n }) {
|
|
2027
2042
|
return /* @__PURE__ */ L("div", {
|
|
2028
2043
|
className: R("bree-inspector", t),
|
|
2029
2044
|
style: n,
|
|
2030
|
-
children: [/* @__PURE__ */ I(
|
|
2045
|
+
children: [/* @__PURE__ */ I(rn, { ctx: e }), /* @__PURE__ */ I(nn, { ctx: e })]
|
|
2031
2046
|
});
|
|
2032
2047
|
}
|
|
2033
2048
|
//#endregion
|
|
2034
2049
|
//#region src/core/style-utils.ts
|
|
2035
|
-
function
|
|
2050
|
+
function pn(e) {
|
|
2036
2051
|
if (typeof e != "string" || !e.trim()) return {};
|
|
2037
2052
|
let t = {};
|
|
2038
2053
|
for (let n of e.split(";")) {
|
|
@@ -2045,18 +2060,18 @@ function dn(e) {
|
|
|
2045
2060
|
}
|
|
2046
2061
|
//#endregion
|
|
2047
2062
|
//#region src/nodes/custom-nodes.tsx
|
|
2048
|
-
var
|
|
2063
|
+
var mn = { style: {
|
|
2049
2064
|
default: null,
|
|
2050
2065
|
parseHTML: (e) => e.getAttribute("style"),
|
|
2051
2066
|
renderHTML: (e) => e.style ? { style: e.style } : {}
|
|
2052
|
-
} },
|
|
2067
|
+
} }, hn = g.create({
|
|
2053
2068
|
name: "spacer",
|
|
2054
2069
|
group: "block",
|
|
2055
2070
|
atom: !0,
|
|
2056
2071
|
selectable: !0,
|
|
2057
2072
|
addAttributes() {
|
|
2058
2073
|
return {
|
|
2059
|
-
...
|
|
2074
|
+
...mn,
|
|
2060
2075
|
height: {
|
|
2061
2076
|
default: 32,
|
|
2062
2077
|
parseHTML: (e) => Number(e.dataset.height) || 32,
|
|
@@ -2081,12 +2096,12 @@ var fn = { style: {
|
|
|
2081
2096
|
height: t,
|
|
2082
2097
|
lineHeight: `${t}px`,
|
|
2083
2098
|
fontSize: "1px",
|
|
2084
|
-
...
|
|
2099
|
+
...pn(e.attrs?.style)
|
|
2085
2100
|
},
|
|
2086
2101
|
children: "\xA0"
|
|
2087
2102
|
});
|
|
2088
2103
|
}
|
|
2089
|
-
}),
|
|
2104
|
+
}), gn = {
|
|
2090
2105
|
facebook: {
|
|
2091
2106
|
label: "Facebook",
|
|
2092
2107
|
slug: "facebook",
|
|
@@ -2122,13 +2137,13 @@ var fn = { style: {
|
|
|
2122
2137
|
slug: "github",
|
|
2123
2138
|
color: "181717"
|
|
2124
2139
|
}
|
|
2125
|
-
},
|
|
2126
|
-
function
|
|
2127
|
-
if (
|
|
2128
|
-
let t =
|
|
2140
|
+
}, _n = { linkedin: "https://cdn.jsdelivr.net/npm/simple-icons@9.21.0/icons/linkedin.svg" };
|
|
2141
|
+
function vn(e) {
|
|
2142
|
+
if (_n[e]) return _n[e];
|
|
2143
|
+
let t = gn[e] ?? gn.facebook;
|
|
2129
2144
|
return `https://cdn.simpleicons.org/${t.slug}/${t.color}`;
|
|
2130
2145
|
}
|
|
2131
|
-
function
|
|
2146
|
+
function yn(e) {
|
|
2132
2147
|
if (Array.isArray(e)) return e;
|
|
2133
2148
|
if (typeof e == "string") try {
|
|
2134
2149
|
return JSON.parse(e);
|
|
@@ -2137,14 +2152,14 @@ function _n(e) {
|
|
|
2137
2152
|
}
|
|
2138
2153
|
return [];
|
|
2139
2154
|
}
|
|
2140
|
-
var
|
|
2155
|
+
var bn = g.create({
|
|
2141
2156
|
name: "socialLinks",
|
|
2142
2157
|
group: "block",
|
|
2143
2158
|
atom: !0,
|
|
2144
2159
|
selectable: !0,
|
|
2145
2160
|
addAttributes() {
|
|
2146
2161
|
return {
|
|
2147
|
-
...
|
|
2162
|
+
...mn,
|
|
2148
2163
|
links: {
|
|
2149
2164
|
default: [
|
|
2150
2165
|
{
|
|
@@ -2164,7 +2179,7 @@ var vn = g.create({
|
|
|
2164
2179
|
url: "https://linkedin.com/"
|
|
2165
2180
|
}
|
|
2166
2181
|
],
|
|
2167
|
-
parseHTML: (e) =>
|
|
2182
|
+
parseHTML: (e) => yn(e.dataset.links),
|
|
2168
2183
|
renderHTML: (e) => ({ "data-links": JSON.stringify(e.links ?? []) })
|
|
2169
2184
|
},
|
|
2170
2185
|
size: { default: 28 },
|
|
@@ -2176,7 +2191,7 @@ var vn = g.create({
|
|
|
2176
2191
|
return [{ tag: "div[data-type=\"social-links\"]" }];
|
|
2177
2192
|
},
|
|
2178
2193
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
2179
|
-
let n = Number(e.attrs.size), r = Number(e.attrs.gap), i =
|
|
2194
|
+
let n = Number(e.attrs.size), r = Number(e.attrs.gap), i = yn(e.attrs.links);
|
|
2180
2195
|
return [
|
|
2181
2196
|
"div",
|
|
2182
2197
|
te(t, {
|
|
@@ -2191,18 +2206,18 @@ var vn = g.create({
|
|
|
2191
2206
|
style: `margin-left:${t === 0 ? 0 : r}px`
|
|
2192
2207
|
},
|
|
2193
2208
|
["img", {
|
|
2194
|
-
src:
|
|
2209
|
+
src: vn(e.network),
|
|
2195
2210
|
width: String(n),
|
|
2196
2211
|
height: String(n),
|
|
2197
|
-
alt:
|
|
2212
|
+
alt: gn[e.network]?.label ?? e.network
|
|
2198
2213
|
}]
|
|
2199
2214
|
])
|
|
2200
2215
|
];
|
|
2201
2216
|
},
|
|
2202
2217
|
renderToReactEmail({ node: e }) {
|
|
2203
|
-
let t = Number(e.attrs?.size ?? 28), n = Number(e.attrs?.gap ?? 12), r =
|
|
2218
|
+
let t = Number(e.attrs?.size ?? 28), n = Number(e.attrs?.gap ?? 12), r = yn(e.attrs?.links), i = e.attrs?.alignment ?? "center";
|
|
2204
2219
|
return /* @__PURE__ */ I(Le, {
|
|
2205
|
-
style:
|
|
2220
|
+
style: pn(e.attrs?.style),
|
|
2206
2221
|
children: /* @__PURE__ */ I(Ie, { children: /* @__PURE__ */ I(Ne, {
|
|
2207
2222
|
align: i,
|
|
2208
2223
|
children: r.map((e, r) => /* @__PURE__ */ I(Fe, {
|
|
@@ -2212,16 +2227,16 @@ var vn = g.create({
|
|
|
2212
2227
|
marginLeft: r === 0 ? 0 : n
|
|
2213
2228
|
},
|
|
2214
2229
|
children: /* @__PURE__ */ I(Pe, {
|
|
2215
|
-
src:
|
|
2230
|
+
src: vn(e.network),
|
|
2216
2231
|
width: t,
|
|
2217
2232
|
height: t,
|
|
2218
|
-
alt:
|
|
2233
|
+
alt: gn[e.network]?.label ?? e.network
|
|
2219
2234
|
})
|
|
2220
2235
|
}, `${e.network}-${r}`))
|
|
2221
2236
|
}) })
|
|
2222
2237
|
});
|
|
2223
2238
|
}
|
|
2224
|
-
}),
|
|
2239
|
+
}), xn = g.create({
|
|
2225
2240
|
name: "htmlBlock",
|
|
2226
2241
|
group: "block",
|
|
2227
2242
|
atom: !0,
|
|
@@ -2261,7 +2276,7 @@ var vn = g.create({
|
|
|
2261
2276
|
});
|
|
2262
2277
|
//#endregion
|
|
2263
2278
|
//#region src/components/inspectors/SocialLinksInspector.tsx
|
|
2264
|
-
function
|
|
2279
|
+
function Sn({ ctx: e, className: t, style: n }) {
|
|
2265
2280
|
let r = $().inspector, i = e.getAttr("links"), a = Array.isArray(i) ? i : [], o = (t) => e.setAttr("links", t);
|
|
2266
2281
|
return /* @__PURE__ */ L("div", {
|
|
2267
2282
|
className: R("bree-inspector", t),
|
|
@@ -2274,13 +2289,13 @@ function bn({ ctx: e, className: t, style: n }) {
|
|
|
2274
2289
|
children: a.map((e, t) => /* @__PURE__ */ L("div", {
|
|
2275
2290
|
className: "bree-social-row",
|
|
2276
2291
|
children: [
|
|
2277
|
-
/* @__PURE__ */ I(
|
|
2292
|
+
/* @__PURE__ */ I(Zt, {
|
|
2278
2293
|
value: e.network,
|
|
2279
2294
|
onChange: (e) => o(a.map((n, r) => r === t ? {
|
|
2280
2295
|
...n,
|
|
2281
2296
|
network: e
|
|
2282
2297
|
} : n)),
|
|
2283
|
-
options: Object.entries(
|
|
2298
|
+
options: Object.entries(gn).map(([e, t]) => [e, t.label])
|
|
2284
2299
|
}),
|
|
2285
2300
|
/* @__PURE__ */ I(U, {
|
|
2286
2301
|
value: e.url,
|
|
@@ -2313,7 +2328,7 @@ function bn({ ctx: e, className: t, style: n }) {
|
|
|
2313
2328
|
children: [
|
|
2314
2329
|
/* @__PURE__ */ I(H, {
|
|
2315
2330
|
label: r.iconSize,
|
|
2316
|
-
children: /* @__PURE__ */ I(
|
|
2331
|
+
children: /* @__PURE__ */ I(Jt, {
|
|
2317
2332
|
value: e.getAttr("size"),
|
|
2318
2333
|
min: 16,
|
|
2319
2334
|
max: 64,
|
|
@@ -2322,7 +2337,7 @@ function bn({ ctx: e, className: t, style: n }) {
|
|
|
2322
2337
|
}),
|
|
2323
2338
|
/* @__PURE__ */ I(H, {
|
|
2324
2339
|
label: r.gap,
|
|
2325
|
-
children: /* @__PURE__ */ I(
|
|
2340
|
+
children: /* @__PURE__ */ I(Jt, {
|
|
2326
2341
|
value: e.getAttr("gap"),
|
|
2327
2342
|
min: 0,
|
|
2328
2343
|
max: 40,
|
|
@@ -2331,24 +2346,24 @@ function bn({ ctx: e, className: t, style: n }) {
|
|
|
2331
2346
|
}),
|
|
2332
2347
|
/* @__PURE__ */ I(H, {
|
|
2333
2348
|
label: r.alignment,
|
|
2334
|
-
children: /* @__PURE__ */ I(
|
|
2349
|
+
children: /* @__PURE__ */ I($t, {
|
|
2335
2350
|
value: String(e.getAttr("alignment") ?? "center"),
|
|
2336
2351
|
onChange: (t) => e.setAttr("alignment", t)
|
|
2337
2352
|
})
|
|
2338
2353
|
})
|
|
2339
2354
|
]
|
|
2340
2355
|
}),
|
|
2341
|
-
/* @__PURE__ */ I(
|
|
2356
|
+
/* @__PURE__ */ I(nn, { ctx: e })
|
|
2342
2357
|
]
|
|
2343
2358
|
});
|
|
2344
2359
|
}
|
|
2345
2360
|
//#endregion
|
|
2346
2361
|
//#region src/registry/default-nodes.tsx
|
|
2347
|
-
function
|
|
2362
|
+
function Cn(e, t = 36) {
|
|
2348
2363
|
let n = e.replace(/\s+/g, " ").trim();
|
|
2349
2364
|
return n.length > t ? `${n.slice(0, t)}…` : n;
|
|
2350
2365
|
}
|
|
2351
|
-
var
|
|
2366
|
+
var wn = (e, { t }) => Cn(e.textContent) || t.layers.empty, Tn = () => "", En = [
|
|
2352
2367
|
{
|
|
2353
2368
|
type: "paragraph",
|
|
2354
2369
|
icon: Ee
|
|
@@ -2356,20 +2371,20 @@ var Sn = (e, { t }) => xn(e.textContent) || t.layers.empty, Cn = () => "", wn =
|
|
|
2356
2371
|
{
|
|
2357
2372
|
type: "heading",
|
|
2358
2373
|
icon: de,
|
|
2359
|
-
inspector:
|
|
2374
|
+
inspector: sn
|
|
2360
2375
|
},
|
|
2361
2376
|
{
|
|
2362
2377
|
type: "image",
|
|
2363
2378
|
icon: fe,
|
|
2364
|
-
inspector:
|
|
2379
|
+
inspector: cn,
|
|
2365
2380
|
preview: (e, { t }) => {
|
|
2366
2381
|
let { attrs: n } = e;
|
|
2367
|
-
if (n.alt) return
|
|
2382
|
+
if (n.alt) return Cn(n.alt);
|
|
2368
2383
|
let r = String(n.src ?? "");
|
|
2369
2384
|
if (r.startsWith("data:")) return t.layers.uploadedImage;
|
|
2370
2385
|
try {
|
|
2371
2386
|
let e = new URL(r);
|
|
2372
|
-
return
|
|
2387
|
+
return Cn(e.searchParams.get("text") ?? decodeURIComponent(e.pathname.split("/").pop() ?? ""));
|
|
2373
2388
|
} catch {
|
|
2374
2389
|
return "";
|
|
2375
2390
|
}
|
|
@@ -2378,64 +2393,64 @@ var Sn = (e, { t }) => xn(e.textContent) || t.layers.empty, Cn = () => "", wn =
|
|
|
2378
2393
|
{
|
|
2379
2394
|
type: "button",
|
|
2380
2395
|
icon: ye,
|
|
2381
|
-
inspector:
|
|
2396
|
+
inspector: an
|
|
2382
2397
|
},
|
|
2383
2398
|
{
|
|
2384
2399
|
type: "horizontalRule",
|
|
2385
2400
|
icon: ve,
|
|
2386
|
-
inspector:
|
|
2387
|
-
preview:
|
|
2401
|
+
inspector: dn,
|
|
2402
|
+
preview: Tn
|
|
2388
2403
|
},
|
|
2389
2404
|
{
|
|
2390
2405
|
type: "spacer",
|
|
2391
|
-
icon:
|
|
2392
|
-
inspector:
|
|
2406
|
+
icon: Vt,
|
|
2407
|
+
inspector: ln,
|
|
2393
2408
|
preview: (e) => `${e.attrs.height}px`,
|
|
2394
|
-
extensions: [
|
|
2409
|
+
extensions: [hn]
|
|
2395
2410
|
},
|
|
2396
2411
|
{
|
|
2397
2412
|
type: "socialLinks",
|
|
2398
2413
|
icon: he,
|
|
2399
|
-
inspector:
|
|
2414
|
+
inspector: Sn,
|
|
2400
2415
|
preview: (e) => Array.isArray(e.attrs.links) ? e.attrs.links.map((e) => e.network).join(", ") : "",
|
|
2401
|
-
extensions: [
|
|
2416
|
+
extensions: [bn]
|
|
2402
2417
|
},
|
|
2403
2418
|
{
|
|
2404
2419
|
type: "htmlBlock",
|
|
2405
2420
|
icon: Ce,
|
|
2406
|
-
inspector:
|
|
2407
|
-
preview: (e) =>
|
|
2408
|
-
extensions: [
|
|
2421
|
+
inspector: un,
|
|
2422
|
+
preview: (e) => Cn(String(e.attrs.html ?? "").replace(/<[^>]+>/g, " ")),
|
|
2423
|
+
extensions: [xn]
|
|
2409
2424
|
},
|
|
2410
2425
|
{
|
|
2411
2426
|
type: "section",
|
|
2412
2427
|
icon: me,
|
|
2413
|
-
inspector:
|
|
2414
|
-
preview:
|
|
2428
|
+
inspector: fn,
|
|
2429
|
+
preview: Tn
|
|
2415
2430
|
},
|
|
2416
2431
|
{
|
|
2417
2432
|
type: "columnsColumn",
|
|
2418
2433
|
icon: be,
|
|
2419
|
-
inspector:
|
|
2420
|
-
preview:
|
|
2434
|
+
inspector: fn,
|
|
2435
|
+
preview: Tn
|
|
2421
2436
|
},
|
|
2422
2437
|
{
|
|
2423
2438
|
type: "twoColumns",
|
|
2424
2439
|
icon: ce,
|
|
2425
|
-
inspector:
|
|
2426
|
-
preview:
|
|
2440
|
+
inspector: on,
|
|
2441
|
+
preview: Tn
|
|
2427
2442
|
},
|
|
2428
2443
|
{
|
|
2429
2444
|
type: "threeColumns",
|
|
2430
2445
|
icon: le,
|
|
2431
|
-
inspector:
|
|
2432
|
-
preview:
|
|
2446
|
+
inspector: on,
|
|
2447
|
+
preview: Tn
|
|
2433
2448
|
},
|
|
2434
2449
|
{
|
|
2435
2450
|
type: "fourColumns",
|
|
2436
2451
|
icon: ue,
|
|
2437
|
-
inspector:
|
|
2438
|
-
preview:
|
|
2452
|
+
inspector: on,
|
|
2453
|
+
preview: Tn
|
|
2439
2454
|
},
|
|
2440
2455
|
{
|
|
2441
2456
|
type: "bulletList",
|
|
@@ -2457,44 +2472,44 @@ var Sn = (e, { t }) => xn(e.textContent) || t.layers.empty, Cn = () => "", wn =
|
|
|
2457
2472
|
type: "table",
|
|
2458
2473
|
icon: we
|
|
2459
2474
|
}
|
|
2460
|
-
],
|
|
2461
|
-
button: () =>
|
|
2462
|
-
column: () =>
|
|
2463
|
-
columns: () =>
|
|
2464
|
-
doc: () =>
|
|
2465
|
-
heading: () =>
|
|
2466
|
-
image: () =>
|
|
2467
|
-
link: () =>
|
|
2468
|
-
padding: () =>
|
|
2469
|
-
paragraph: () =>
|
|
2470
|
-
placeholderImage: () =>
|
|
2471
|
-
section: () =>
|
|
2472
|
-
sized: () =>
|
|
2473
|
-
text: () =>
|
|
2474
|
-
}),
|
|
2475
|
+
], Dn = /* @__PURE__ */ Be({
|
|
2476
|
+
button: () => On,
|
|
2477
|
+
column: () => An,
|
|
2478
|
+
columns: () => X,
|
|
2479
|
+
doc: () => In,
|
|
2480
|
+
heading: () => Y,
|
|
2481
|
+
image: () => kn,
|
|
2482
|
+
link: () => Pn,
|
|
2483
|
+
padding: () => Nn,
|
|
2484
|
+
paragraph: () => J,
|
|
2485
|
+
placeholderImage: () => Fn,
|
|
2486
|
+
section: () => Mn,
|
|
2487
|
+
sized: () => jn,
|
|
2488
|
+
text: () => q
|
|
2489
|
+
}), q = (e, t) => ({
|
|
2475
2490
|
type: "text",
|
|
2476
2491
|
text: e,
|
|
2477
2492
|
...t ? { marks: t } : {}
|
|
2478
|
-
}),
|
|
2493
|
+
}), J = (e = "", t = {}) => ({
|
|
2479
2494
|
type: "paragraph",
|
|
2480
2495
|
attrs: t,
|
|
2481
|
-
content: typeof e == "string" ? e ? [
|
|
2482
|
-
}),
|
|
2496
|
+
content: typeof e == "string" ? e ? [q(e)] : [] : e
|
|
2497
|
+
}), Y = (e, t, n = {}) => ({
|
|
2483
2498
|
type: "heading",
|
|
2484
2499
|
attrs: {
|
|
2485
2500
|
level: e,
|
|
2486
2501
|
...n
|
|
2487
2502
|
},
|
|
2488
|
-
content: [
|
|
2489
|
-
}),
|
|
2503
|
+
content: [q(t)]
|
|
2504
|
+
}), On = (e, t = {}) => ({
|
|
2490
2505
|
type: "button",
|
|
2491
2506
|
attrs: {
|
|
2492
2507
|
href: "https://example.com",
|
|
2493
2508
|
alignment: "center",
|
|
2494
2509
|
...t
|
|
2495
2510
|
},
|
|
2496
|
-
content: [
|
|
2497
|
-
}),
|
|
2511
|
+
content: [q(e)]
|
|
2512
|
+
}), kn = (e, t = {}) => ({
|
|
2498
2513
|
type: "image",
|
|
2499
2514
|
attrs: {
|
|
2500
2515
|
src: e,
|
|
@@ -2502,103 +2517,103 @@ var Sn = (e, { t }) => xn(e.textContent) || t.layers.empty, Cn = () => "", wn =
|
|
|
2502
2517
|
alignment: "center",
|
|
2503
2518
|
...t
|
|
2504
2519
|
}
|
|
2505
|
-
}),
|
|
2520
|
+
}), An = (...e) => ({
|
|
2506
2521
|
type: "columnsColumn",
|
|
2507
|
-
content: e.length ? e : [
|
|
2508
|
-
}),
|
|
2522
|
+
content: e.length ? e : [J()]
|
|
2523
|
+
}), jn = (e, t) => ({
|
|
2509
2524
|
...e,
|
|
2510
2525
|
attrs: {
|
|
2511
2526
|
...e.attrs,
|
|
2512
2527
|
style: `width:${t}%`
|
|
2513
2528
|
}
|
|
2514
|
-
}),
|
|
2529
|
+
}), X = (e, t, n) => ({
|
|
2515
2530
|
type: {
|
|
2516
2531
|
2: "twoColumns",
|
|
2517
2532
|
3: "threeColumns",
|
|
2518
2533
|
4: "fourColumns"
|
|
2519
2534
|
}[e],
|
|
2520
2535
|
...n ? { attrs: n } : {},
|
|
2521
|
-
content: t ?? Array.from({ length: e }, () =>
|
|
2522
|
-
}),
|
|
2536
|
+
content: t ?? Array.from({ length: e }, () => An())
|
|
2537
|
+
}), Mn = (e, ...t) => ({
|
|
2523
2538
|
type: "section",
|
|
2524
2539
|
attrs: { style: e },
|
|
2525
2540
|
content: t
|
|
2526
|
-
}),
|
|
2541
|
+
}), Nn = (e, t = e) => `padding-top:${e}px;padding-right:${t}px;padding-bottom:${e}px;padding-left:${t}px`, Pn = (e) => [{
|
|
2527
2542
|
type: "link",
|
|
2528
2543
|
attrs: { href: e }
|
|
2529
|
-
}],
|
|
2544
|
+
}], Fn = (e, t, n = "Image") => `https://placehold.co/${e}x${t}/e2e8f0/64748b/png?text=${encodeURIComponent(n)}`, In = (...e) => ({
|
|
2530
2545
|
type: "doc",
|
|
2531
2546
|
content: e
|
|
2532
|
-
}),
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
], { alignment: t }),
|
|
2547
|
+
}), Ln = ({ t: e }, t = "center") => J([
|
|
2548
|
+
q(e.content.menuHome, Pn("https://example.com")),
|
|
2549
|
+
q(" · "),
|
|
2550
|
+
q(e.content.menuShop, Pn("https://example.com/shop")),
|
|
2551
|
+
q(" · "),
|
|
2552
|
+
q(e.content.menuBlog, Pn("https://example.com/blog")),
|
|
2553
|
+
q(" · "),
|
|
2554
|
+
q(e.content.menuContact, Pn("https://example.com/contact"))
|
|
2555
|
+
], { alignment: t }), Rn = [{
|
|
2541
2556
|
id: "layout",
|
|
2542
2557
|
title: ({ t: e }) => e.sidebar.layoutTitle
|
|
2543
2558
|
}, {
|
|
2544
2559
|
id: "content",
|
|
2545
2560
|
title: ({ t: e }) => e.sidebar.contentTitle
|
|
2546
|
-
}],
|
|
2561
|
+
}], zn = [
|
|
2547
2562
|
{
|
|
2548
2563
|
id: "section",
|
|
2549
2564
|
group: "layout",
|
|
2550
2565
|
label: ({ t: e }) => e.palette.oneColumn,
|
|
2551
|
-
icon: /* @__PURE__ */ I(
|
|
2552
|
-
content: () => [
|
|
2566
|
+
icon: /* @__PURE__ */ I(Wt, {}),
|
|
2567
|
+
content: () => [Mn(Nn(16), J())]
|
|
2553
2568
|
},
|
|
2554
2569
|
{
|
|
2555
2570
|
id: "columns-2",
|
|
2556
2571
|
group: "layout",
|
|
2557
2572
|
label: ({ t: e }) => e.palette.twoColumns,
|
|
2558
2573
|
icon: /* @__PURE__ */ I(ce, { size: 22 }),
|
|
2559
|
-
content: () => [
|
|
2574
|
+
content: () => [X(2)]
|
|
2560
2575
|
},
|
|
2561
2576
|
{
|
|
2562
2577
|
id: "columns-3",
|
|
2563
2578
|
group: "layout",
|
|
2564
2579
|
label: ({ t: e }) => e.palette.threeColumns,
|
|
2565
2580
|
icon: /* @__PURE__ */ I(le, { size: 22 }),
|
|
2566
|
-
content: () => [
|
|
2581
|
+
content: () => [X(3)]
|
|
2567
2582
|
},
|
|
2568
2583
|
{
|
|
2569
2584
|
id: "columns-4",
|
|
2570
2585
|
group: "layout",
|
|
2571
2586
|
label: ({ t: e }) => e.palette.fourColumns,
|
|
2572
2587
|
icon: /* @__PURE__ */ I(ue, { size: 22 }),
|
|
2573
|
-
content: () => [
|
|
2588
|
+
content: () => [X(4)]
|
|
2574
2589
|
},
|
|
2575
2590
|
{
|
|
2576
2591
|
id: "heading",
|
|
2577
2592
|
group: "content",
|
|
2578
2593
|
label: ({ t: e }) => e.palette.heading,
|
|
2579
2594
|
icon: /* @__PURE__ */ I(de, { size: 22 }),
|
|
2580
|
-
content: ({ t: e }) => [
|
|
2595
|
+
content: ({ t: e }) => [Y(2, e.content.heading)]
|
|
2581
2596
|
},
|
|
2582
2597
|
{
|
|
2583
2598
|
id: "text",
|
|
2584
2599
|
group: "content",
|
|
2585
2600
|
label: ({ t: e }) => e.palette.text,
|
|
2586
2601
|
icon: /* @__PURE__ */ I(Ee, { size: 22 }),
|
|
2587
|
-
content: ({ t: e }) => [
|
|
2602
|
+
content: ({ t: e }) => [J(e.content.text)]
|
|
2588
2603
|
},
|
|
2589
2604
|
{
|
|
2590
2605
|
id: "button",
|
|
2591
2606
|
group: "content",
|
|
2592
2607
|
label: ({ t: e }) => e.palette.button,
|
|
2593
2608
|
icon: /* @__PURE__ */ I(ye, { size: 22 }),
|
|
2594
|
-
content: ({ t: e }) => [
|
|
2609
|
+
content: ({ t: e }) => [On(e.content.button)]
|
|
2595
2610
|
},
|
|
2596
2611
|
{
|
|
2597
2612
|
id: "image",
|
|
2598
2613
|
group: "content",
|
|
2599
2614
|
label: ({ t: e }) => e.palette.image,
|
|
2600
2615
|
icon: /* @__PURE__ */ I(fe, { size: 22 }),
|
|
2601
|
-
content: ({ t: e }) => [
|
|
2616
|
+
content: ({ t: e }) => [kn(Fn(600, 300, e.content.image))]
|
|
2602
2617
|
},
|
|
2603
2618
|
{
|
|
2604
2619
|
id: "divider",
|
|
@@ -2611,7 +2626,7 @@ var Sn = (e, { t }) => xn(e.textContent) || t.layers.empty, Cn = () => "", wn =
|
|
|
2611
2626
|
id: "spacer",
|
|
2612
2627
|
group: "content",
|
|
2613
2628
|
label: ({ t: e }) => e.palette.spacer,
|
|
2614
|
-
icon: /* @__PURE__ */ I(
|
|
2629
|
+
icon: /* @__PURE__ */ I(Ht, {}),
|
|
2615
2630
|
content: () => [{
|
|
2616
2631
|
type: "spacer",
|
|
2617
2632
|
attrs: { height: 32 }
|
|
@@ -2621,7 +2636,7 @@ var Sn = (e, { t }) => xn(e.textContent) || t.layers.empty, Cn = () => "", wn =
|
|
|
2621
2636
|
id: "social",
|
|
2622
2637
|
group: "content",
|
|
2623
2638
|
label: ({ t: e }) => e.palette.social,
|
|
2624
|
-
icon: /* @__PURE__ */ I(
|
|
2639
|
+
icon: /* @__PURE__ */ I(Ut, {}),
|
|
2625
2640
|
content: () => [{ type: "socialLinks" }]
|
|
2626
2641
|
},
|
|
2627
2642
|
{
|
|
@@ -2629,7 +2644,7 @@ var Sn = (e, { t }) => xn(e.textContent) || t.layers.empty, Cn = () => "", wn =
|
|
|
2629
2644
|
group: "content",
|
|
2630
2645
|
label: ({ t: e }) => e.palette.menu,
|
|
2631
2646
|
icon: /* @__PURE__ */ I(xe, { size: 22 }),
|
|
2632
|
-
content: (e) => [
|
|
2647
|
+
content: (e) => [Ln(e)]
|
|
2633
2648
|
},
|
|
2634
2649
|
{
|
|
2635
2650
|
id: "list",
|
|
@@ -2640,7 +2655,7 @@ var Sn = (e, { t }) => xn(e.textContent) || t.layers.empty, Cn = () => "", wn =
|
|
|
2640
2655
|
type: "bulletList",
|
|
2641
2656
|
content: e.content.listItems.map((e) => ({
|
|
2642
2657
|
type: "listItem",
|
|
2643
|
-
content: [
|
|
2658
|
+
content: [J(e)]
|
|
2644
2659
|
}))
|
|
2645
2660
|
}]
|
|
2646
2661
|
},
|
|
@@ -2651,7 +2666,7 @@ var Sn = (e, { t }) => xn(e.textContent) || t.layers.empty, Cn = () => "", wn =
|
|
|
2651
2666
|
icon: /* @__PURE__ */ I(Te, { size: 22 }),
|
|
2652
2667
|
content: ({ t: e }) => [{
|
|
2653
2668
|
type: "blockquote",
|
|
2654
|
-
content: [
|
|
2669
|
+
content: [J(e.content.quote)]
|
|
2655
2670
|
}]
|
|
2656
2671
|
},
|
|
2657
2672
|
{
|
|
@@ -2669,7 +2684,7 @@ var Sn = (e, { t }) => xn(e.textContent) || t.layers.empty, Cn = () => "", wn =
|
|
|
2669
2684
|
group: "content",
|
|
2670
2685
|
label: ({ t: e }) => e.palette.card,
|
|
2671
2686
|
icon: /* @__PURE__ */ I(me, { size: 22 }),
|
|
2672
|
-
content: ({ t: e }) => [
|
|
2687
|
+
content: ({ t: e }) => [Mn(`${Nn(24)};background-color:#f1f5f9;border-radius:12px`, Y(3, e.content.cardTitle), J(e.content.cardText))]
|
|
2673
2688
|
}
|
|
2674
2689
|
];
|
|
2675
2690
|
//#endregion
|
|
@@ -2685,47 +2700,47 @@ function Z({ variant: e }) {
|
|
|
2685
2700
|
]
|
|
2686
2701
|
});
|
|
2687
2702
|
}
|
|
2688
|
-
var
|
|
2703
|
+
var Bn = [
|
|
2689
2704
|
{
|
|
2690
2705
|
id: "header",
|
|
2691
2706
|
label: ({ t: e }) => e.templates.header,
|
|
2692
2707
|
description: ({ t: e }) => e.templates.headerDescription,
|
|
2693
2708
|
thumbnail: /* @__PURE__ */ I(Z, { variant: "header" }),
|
|
2694
|
-
content: (e) => [
|
|
2709
|
+
content: (e) => [X(2, [jn(An(kn(Fn(140, 40, e.t.content.logo), {
|
|
2695
2710
|
alignment: "left",
|
|
2696
2711
|
width: "140"
|
|
2697
|
-
})), 33),
|
|
2712
|
+
})), 33), jn(An(Ln(e, "right")), 67)])]
|
|
2698
2713
|
},
|
|
2699
2714
|
{
|
|
2700
2715
|
id: "hero",
|
|
2701
2716
|
label: ({ t: e }) => e.templates.hero,
|
|
2702
2717
|
description: ({ t: e }) => e.templates.heroDescription,
|
|
2703
2718
|
thumbnail: /* @__PURE__ */ I(Z, { variant: "hero" }),
|
|
2704
|
-
content: ({ t: e }) => [
|
|
2719
|
+
content: ({ t: e }) => [Mn(`${Nn(40, 24)};background-color:#eef2ff;border-radius:12px`, Y(1, e.content.heroTitle, { alignment: "center" }), J(e.content.heroText, { alignment: "center" }), On(e.content.heroButton, { style: `background-color:#4f46e5;color:#ffffff;${Nn(12, 24)};border-radius:8px` }))]
|
|
2705
2720
|
},
|
|
2706
2721
|
{
|
|
2707
2722
|
id: "products",
|
|
2708
2723
|
label: ({ t: e }) => e.templates.products,
|
|
2709
2724
|
description: ({ t: e }) => e.templates.productsDescription,
|
|
2710
2725
|
thumbnail: /* @__PURE__ */ I(Z, { variant: "products" }),
|
|
2711
|
-
content: ({ t: e }) => [
|
|
2726
|
+
content: ({ t: e }) => [X(2, [e.content.productA, e.content.productB].map((t) => An(kn(Fn(280, 200, t)), Y(3, t, { alignment: "center" }), J(e.content.productText, { alignment: "center" }), On(e.content.productButton))), { cellspacing: 16 })]
|
|
2712
2727
|
},
|
|
2713
2728
|
{
|
|
2714
2729
|
id: "features",
|
|
2715
2730
|
label: ({ t: e }) => e.templates.features,
|
|
2716
2731
|
description: ({ t: e }) => e.templates.featuresDescription,
|
|
2717
2732
|
thumbnail: /* @__PURE__ */ I(Z, { variant: "features" }),
|
|
2718
|
-
content: ({ t: e }) => [
|
|
2733
|
+
content: ({ t: e }) => [X(3, e.content.features.map((t) => An(Y(3, t, { alignment: "center" }), J(e.content.featureText, { alignment: "center" }))))]
|
|
2719
2734
|
},
|
|
2720
2735
|
{
|
|
2721
2736
|
id: "testimonial",
|
|
2722
2737
|
label: ({ t: e }) => e.templates.testimonial,
|
|
2723
2738
|
description: ({ t: e }) => e.templates.testimonialDescription,
|
|
2724
2739
|
thumbnail: /* @__PURE__ */ I(Z, { variant: "testimonial" }),
|
|
2725
|
-
content: ({ t: e }) => [
|
|
2740
|
+
content: ({ t: e }) => [Mn(`${Nn(24)};background-color:#f8fafc;border-radius:12px`, {
|
|
2726
2741
|
type: "blockquote",
|
|
2727
|
-
content: [
|
|
2728
|
-
},
|
|
2742
|
+
content: [J(e.content.testimonialQuote)]
|
|
2743
|
+
}, J(e.content.testimonialAuthor, {
|
|
2729
2744
|
alignment: "right",
|
|
2730
2745
|
style: "color:#64748b"
|
|
2731
2746
|
}))]
|
|
@@ -2738,18 +2753,18 @@ var zn = [
|
|
|
2738
2753
|
content: ({ t: e }) => [
|
|
2739
2754
|
{ type: "horizontalRule" },
|
|
2740
2755
|
{ type: "socialLinks" },
|
|
2741
|
-
|
|
2756
|
+
J(e.content.footerAddress, {
|
|
2742
2757
|
alignment: "center",
|
|
2743
2758
|
style: "color:#94a3b8;font-size:12px"
|
|
2744
2759
|
}),
|
|
2745
|
-
|
|
2760
|
+
J([q(e.content.unsubscribe, Pn("https://example.com/unsubscribe"))], {
|
|
2746
2761
|
alignment: "center",
|
|
2747
2762
|
style: "font-size:12px"
|
|
2748
2763
|
})
|
|
2749
2764
|
]
|
|
2750
2765
|
}
|
|
2751
|
-
],
|
|
2752
|
-
function
|
|
2766
|
+
], Vn = (e, t) => Bn.find((t) => t.id === e)?.content(t) ?? [];
|
|
2767
|
+
function Hn(e) {
|
|
2753
2768
|
let t = {
|
|
2754
2769
|
type: "spacer",
|
|
2755
2770
|
attrs: { height: 16 }
|
|
@@ -2757,39 +2772,39 @@ function Vn(e) {
|
|
|
2757
2772
|
return {
|
|
2758
2773
|
type: "doc",
|
|
2759
2774
|
content: [
|
|
2760
|
-
...
|
|
2775
|
+
...Vn("header", e),
|
|
2761
2776
|
t,
|
|
2762
|
-
...
|
|
2777
|
+
...Vn("hero", e),
|
|
2763
2778
|
t,
|
|
2764
|
-
|
|
2765
|
-
...
|
|
2779
|
+
Y(2, e.t.content.starterTitle, { alignment: "center" }),
|
|
2780
|
+
...Vn("products", e),
|
|
2766
2781
|
t,
|
|
2767
|
-
...
|
|
2782
|
+
...Vn("footer", e)
|
|
2768
2783
|
]
|
|
2769
2784
|
};
|
|
2770
2785
|
}
|
|
2771
2786
|
//#endregion
|
|
2772
2787
|
//#region src/context.tsx
|
|
2773
|
-
var
|
|
2788
|
+
var Un = e(null);
|
|
2774
2789
|
function Q() {
|
|
2775
|
-
let e = r(
|
|
2790
|
+
let e = r(Un);
|
|
2776
2791
|
if (!e) throw Error("useEmailEditor must be used inside <EditorRoot> or <BetterEmailEditor>.");
|
|
2777
2792
|
return e;
|
|
2778
2793
|
}
|
|
2779
|
-
function
|
|
2780
|
-
return r(
|
|
2794
|
+
function Wn() {
|
|
2795
|
+
return r(Un);
|
|
2781
2796
|
}
|
|
2782
2797
|
function $() {
|
|
2783
|
-
return r(
|
|
2798
|
+
return r(Un)?.t ?? Ct;
|
|
2784
2799
|
}
|
|
2785
|
-
function
|
|
2800
|
+
function Gn() {
|
|
2786
2801
|
let { locale: e, t } = Q();
|
|
2787
2802
|
return s(() => ({
|
|
2788
2803
|
locale: e,
|
|
2789
2804
|
t
|
|
2790
2805
|
}), [e, t]);
|
|
2791
2806
|
}
|
|
2792
|
-
var
|
|
2807
|
+
var Kn = x("basic", {
|
|
2793
2808
|
body: {
|
|
2794
2809
|
backgroundColor: "#eef1f5",
|
|
2795
2810
|
padding: "32px 16px"
|
|
@@ -2799,18 +2814,18 @@ var Gn = x("basic", {
|
|
|
2799
2814
|
padding: "24px",
|
|
2800
2815
|
borderRadius: "12px"
|
|
2801
2816
|
}
|
|
2802
|
-
}),
|
|
2817
|
+
}), qn = (e) => new Promise((t, n) => {
|
|
2803
2818
|
let r = new FileReader();
|
|
2804
2819
|
r.onload = () => t({ url: String(r.result) }), r.onerror = n, r.readAsDataURL(e);
|
|
2805
|
-
}),
|
|
2820
|
+
}), Jn = {
|
|
2806
2821
|
type: "doc",
|
|
2807
2822
|
content: [{ type: "paragraph" }]
|
|
2808
2823
|
};
|
|
2809
|
-
function
|
|
2824
|
+
function Yn(e) {
|
|
2810
2825
|
return typeof e == "object" && !!e && "doc" in e;
|
|
2811
2826
|
}
|
|
2812
|
-
function
|
|
2813
|
-
return e ?
|
|
2827
|
+
function Xn(e) {
|
|
2828
|
+
return e ? Yn(e) ? {
|
|
2814
2829
|
doc: e.doc,
|
|
2815
2830
|
settings: {
|
|
2816
2831
|
...e.settings,
|
|
@@ -2820,31 +2835,31 @@ function Yn(e) {
|
|
|
2820
2835
|
doc: e,
|
|
2821
2836
|
settings: { previewText: "" }
|
|
2822
2837
|
} : {
|
|
2823
|
-
doc:
|
|
2838
|
+
doc: Jn,
|
|
2824
2839
|
settings: { previewText: "" }
|
|
2825
2840
|
};
|
|
2826
2841
|
}
|
|
2827
|
-
function
|
|
2842
|
+
function Zn(e, t, r) {
|
|
2828
2843
|
let [i, a] = l(t);
|
|
2829
2844
|
return [e === void 0 ? i : e, n((t) => {
|
|
2830
2845
|
e === void 0 && a(t), r?.(t);
|
|
2831
2846
|
}, [e, r])];
|
|
2832
2847
|
}
|
|
2833
|
-
var
|
|
2834
|
-
let A = s(() =>
|
|
2848
|
+
var Qn = t(function({ defaultValue: e, onChange: t, onReady: r, locale: u = "en", messages: f, nodes: h = En, palette: g = zn, paletteGroups: v = Rn, templates: x = Bn, starterDocument: C = Hn, extensions: w, theme: T = Kn, uploadImage: E = qn, editable: D = !0, device: O, defaultDevice: ee = "desktop", onDeviceChange: k, layersOpen: te, defaultLayersOpen: ne = !0, onLayersOpenChange: re, className: ie, style: ae, children: oe }, se) {
|
|
2849
|
+
let A = s(() => kt(u, f), [u, f]), [ce] = l(() => Xn(e)), [le, ue] = l(ce.settings), j = c(le), de = c(A), fe = c(t), M = c(r), pe = c(E);
|
|
2835
2850
|
o(() => {
|
|
2836
2851
|
de.current = A, fe.current = t, M.current = r, pe.current = E;
|
|
2837
2852
|
});
|
|
2838
|
-
let [me, he] =
|
|
2839
|
-
dragSession:
|
|
2840
|
-
hoverStore:
|
|
2853
|
+
let [me, he] = Zn(O, ee, k), [ge, _e] = Zn(te, ne, re), [ve] = l(() => ({
|
|
2854
|
+
dragSession: xt(),
|
|
2855
|
+
hoverStore: St()
|
|
2841
2856
|
})), ye = n((e) => pe.current(e), []), be = S({ uploadImage: ye }), [xe] = l(() => [
|
|
2842
2857
|
y.configure({
|
|
2843
2858
|
TiptapStarterKit: { dropcursor: !1 },
|
|
2844
2859
|
Button: !1
|
|
2845
2860
|
}),
|
|
2846
2861
|
ct,
|
|
2847
|
-
|
|
2862
|
+
bt,
|
|
2848
2863
|
d.configure({
|
|
2849
2864
|
placeholder: ({ node: e }) => e.type.name === "heading" ? de.current.placeholder.heading : de.current.placeholder.paragraph,
|
|
2850
2865
|
includeChildren: !0
|
|
@@ -2864,7 +2879,7 @@ var Zn = t(function({ defaultValue: e, onChange: t, onReady: r, locale: u = "en"
|
|
|
2864
2879
|
N?.setEditable(D);
|
|
2865
2880
|
}, [N, D]);
|
|
2866
2881
|
let Se = n(() => ({
|
|
2867
|
-
doc: N?.getJSON() ??
|
|
2882
|
+
doc: N?.getJSON() ?? Jn,
|
|
2868
2883
|
settings: j.current
|
|
2869
2884
|
}), [N]), Ce = n((e) => {
|
|
2870
2885
|
let t = {
|
|
@@ -2887,9 +2902,9 @@ var Zn = t(function({ defaultValue: e, onChange: t, onReady: r, locale: u = "en"
|
|
|
2887
2902
|
return {
|
|
2888
2903
|
editor: N,
|
|
2889
2904
|
getValue: Se,
|
|
2890
|
-
getJSON: () => N?.getJSON() ??
|
|
2905
|
+
getJSON: () => N?.getJSON() ?? Jn,
|
|
2891
2906
|
setValue: (e) => {
|
|
2892
|
-
let t =
|
|
2907
|
+
let t = Xn(e);
|
|
2893
2908
|
j.current = t.settings, ue(t.settings), N?.commands.setContent(t.doc, { emitUpdate: !0 });
|
|
2894
2909
|
},
|
|
2895
2910
|
exportEmail: e,
|
|
@@ -2925,7 +2940,7 @@ var Zn = t(function({ defaultValue: e, onChange: t, onReady: r, locale: u = "en"
|
|
|
2925
2940
|
nodes: we,
|
|
2926
2941
|
nodeLabel: (t) => {
|
|
2927
2942
|
let n = we.get(t)?.label;
|
|
2928
|
-
return n ?
|
|
2943
|
+
return n ? Et(n, e) : A.nodes[t] ?? t;
|
|
2929
2944
|
},
|
|
2930
2945
|
palette: g,
|
|
2931
2946
|
paletteGroups: v,
|
|
@@ -2968,7 +2983,7 @@ var Zn = t(function({ defaultValue: e, onChange: t, onReady: r, locale: u = "en"
|
|
|
2968
2983
|
lang: u,
|
|
2969
2984
|
children: Te && /* @__PURE__ */ I(p.Provider, {
|
|
2970
2985
|
value: Ee,
|
|
2971
|
-
children: /* @__PURE__ */ I(
|
|
2986
|
+
children: /* @__PURE__ */ I(Un.Provider, {
|
|
2972
2987
|
value: Te,
|
|
2973
2988
|
children: oe
|
|
2974
2989
|
})
|
|
@@ -2977,7 +2992,7 @@ var Zn = t(function({ defaultValue: e, onChange: t, onReady: r, locale: u = "en"
|
|
|
2977
2992
|
});
|
|
2978
2993
|
//#endregion
|
|
2979
2994
|
//#region src/components/CanvasOverlay.tsx
|
|
2980
|
-
function
|
|
2995
|
+
function $n(e, t) {
|
|
2981
2996
|
let n = e.getBoundingClientRect();
|
|
2982
2997
|
return {
|
|
2983
2998
|
top: t.top - n.top + e.scrollTop,
|
|
@@ -2986,23 +3001,23 @@ function Qn(e, t) {
|
|
|
2986
3001
|
height: t.height ?? 0
|
|
2987
3002
|
};
|
|
2988
3003
|
}
|
|
2989
|
-
function
|
|
3004
|
+
function er(e, t, n) {
|
|
2990
3005
|
if (!n) return null;
|
|
2991
3006
|
let r = e.view.nodeDOM(n.pos);
|
|
2992
|
-
return r instanceof HTMLElement ?
|
|
3007
|
+
return r instanceof HTMLElement ? $n(t, r.getBoundingClientRect()) : null;
|
|
2993
3008
|
}
|
|
2994
|
-
function
|
|
3009
|
+
function tr(e, t, n) {
|
|
2995
3010
|
let r = e.view.posAtCoords({
|
|
2996
3011
|
left: t,
|
|
2997
3012
|
top: n
|
|
2998
3013
|
});
|
|
2999
3014
|
return r && r.inside >= 0 ? z(e.state.doc, r.inside) : null;
|
|
3000
3015
|
}
|
|
3001
|
-
function
|
|
3016
|
+
function nr(e) {
|
|
3002
3017
|
let t = e.node.type.name;
|
|
3003
3018
|
return Ve.has(t) || He.has(t);
|
|
3004
3019
|
}
|
|
3005
|
-
function
|
|
3020
|
+
function rr({ editor: e, host: t }) {
|
|
3006
3021
|
let { dragSession: r, hoverStore: a, nodeLabel: s, t: d } = Q(), f = c(s);
|
|
3007
3022
|
o(() => {
|
|
3008
3023
|
f.current = s;
|
|
@@ -3035,7 +3050,7 @@ function nr({ editor: e, host: t }) {
|
|
|
3035
3050
|
]), i(() => {
|
|
3036
3051
|
let n = 0, i = (t) => {
|
|
3037
3052
|
r.get() || t.target.closest(".bree-ov-toolbar, .bree-ov-handle, .bree-ov-tag") || (cancelAnimationFrame(n), n = requestAnimationFrame(() => {
|
|
3038
|
-
a.set(
|
|
3053
|
+
a.set(tr(e, t.clientX, t.clientY)?.pos ?? null);
|
|
3039
3054
|
}));
|
|
3040
3055
|
}, o = () => a.set(null);
|
|
3041
3056
|
return t.addEventListener("mousemove", i), t.addEventListener("mouseleave", o), () => {
|
|
@@ -3059,8 +3074,8 @@ function nr({ editor: e, host: t }) {
|
|
|
3059
3074
|
t instanceof HTMLElement && t.blur(), e.commands.blur();
|
|
3060
3075
|
return;
|
|
3061
3076
|
}
|
|
3062
|
-
let r =
|
|
3063
|
-
if (r &&
|
|
3077
|
+
let r = tr(e, n.clientX, n.clientY);
|
|
3078
|
+
if (r && nr(r)) {
|
|
3064
3079
|
n.preventDefault(), it(e, r);
|
|
3065
3080
|
return;
|
|
3066
3081
|
}
|
|
@@ -3131,7 +3146,7 @@ function nr({ editor: e, host: t }) {
|
|
|
3131
3146
|
t.dataTransfer.setDragImage(i, Math.min(24, e.width / 2), Math.min(24, e.height / 2));
|
|
3132
3147
|
}
|
|
3133
3148
|
requestAnimationFrame(() => b(n.pos));
|
|
3134
|
-
}, E = y !== null, D = g && g.pos !== C?.pos ?
|
|
3149
|
+
}, E = y !== null, D = g && g.pos !== C?.pos ? er(e, t, g) : null, O = er(e, t, C), ee = E ? er(e, t, z(e.state.doc, y)) : null, k = C ? nt(e.state.doc, C) : null;
|
|
3135
3150
|
return /* @__PURE__ */ L("div", {
|
|
3136
3151
|
className: "bree-ov-layer",
|
|
3137
3152
|
children: [
|
|
@@ -3163,7 +3178,7 @@ function nr({ editor: e, host: t }) {
|
|
|
3163
3178
|
title: d.canvas.move,
|
|
3164
3179
|
"aria-label": d.canvas.moveLabel(s(C.node.type.name)),
|
|
3165
3180
|
onDragStart: (e) => T(e, C),
|
|
3166
|
-
children: /* @__PURE__ */ I(
|
|
3181
|
+
children: /* @__PURE__ */ I(jt, {})
|
|
3167
3182
|
}) }),
|
|
3168
3183
|
/* @__PURE__ */ I(j, { children: /* @__PURE__ */ L("div", {
|
|
3169
3184
|
className: "bree-ov-toolbar",
|
|
@@ -3173,19 +3188,19 @@ function nr({ editor: e, host: t }) {
|
|
|
3173
3188
|
className: "bree-ov-tool",
|
|
3174
3189
|
title: d.canvas.selectParent(s(k.node.type.name)),
|
|
3175
3190
|
onClick: () => it(e, k),
|
|
3176
|
-
children: /* @__PURE__ */ I(
|
|
3191
|
+
children: /* @__PURE__ */ I(Pt, {})
|
|
3177
3192
|
}), !tt(C) && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("button", {
|
|
3178
3193
|
type: "button",
|
|
3179
3194
|
className: "bree-ov-tool",
|
|
3180
3195
|
title: d.canvas.duplicate,
|
|
3181
3196
|
onClick: () => at(e, C),
|
|
3182
|
-
children: /* @__PURE__ */ I(
|
|
3197
|
+
children: /* @__PURE__ */ I(Mt, {})
|
|
3183
3198
|
}), /* @__PURE__ */ I("button", {
|
|
3184
3199
|
type: "button",
|
|
3185
3200
|
className: "bree-ov-tool bree-ov-danger",
|
|
3186
3201
|
title: d.canvas.delete,
|
|
3187
3202
|
onClick: () => ot(e, C),
|
|
3188
|
-
children: /* @__PURE__ */ I(
|
|
3203
|
+
children: /* @__PURE__ */ I(Nt, {})
|
|
3189
3204
|
})] })]
|
|
3190
3205
|
}) })
|
|
3191
3206
|
]
|
|
@@ -3194,7 +3209,7 @@ function nr({ editor: e, host: t }) {
|
|
|
3194
3209
|
className: "bree-ov-frame bree-ov-source",
|
|
3195
3210
|
style: ee
|
|
3196
3211
|
}),
|
|
3197
|
-
_ && /* @__PURE__ */ I(
|
|
3212
|
+
_ && /* @__PURE__ */ I(ir, {
|
|
3198
3213
|
host: t,
|
|
3199
3214
|
target: _,
|
|
3200
3215
|
label: r.get()?.label ?? "",
|
|
@@ -3203,9 +3218,9 @@ function nr({ editor: e, host: t }) {
|
|
|
3203
3218
|
]
|
|
3204
3219
|
});
|
|
3205
3220
|
}
|
|
3206
|
-
function
|
|
3221
|
+
function ir({ host: e, target: t, label: n, messages: r }) {
|
|
3207
3222
|
if (t.emptyZone) {
|
|
3208
|
-
let i =
|
|
3223
|
+
let i = $n(e, t.emptyZone);
|
|
3209
3224
|
return /* @__PURE__ */ I("div", {
|
|
3210
3225
|
className: "bree-ov-dropzone",
|
|
3211
3226
|
style: i,
|
|
@@ -3217,7 +3232,7 @@ function rr({ host: e, target: t, label: n, messages: r }) {
|
|
|
3217
3232
|
});
|
|
3218
3233
|
}
|
|
3219
3234
|
if (!t.line) return null;
|
|
3220
|
-
let i =
|
|
3235
|
+
let i = $n(e, {
|
|
3221
3236
|
...t.line,
|
|
3222
3237
|
height: 0
|
|
3223
3238
|
});
|
|
@@ -3236,7 +3251,7 @@ function rr({ host: e, target: t, label: n, messages: r }) {
|
|
|
3236
3251
|
}
|
|
3237
3252
|
//#endregion
|
|
3238
3253
|
//#region src/components/Canvas.tsx
|
|
3239
|
-
function
|
|
3254
|
+
function ar({ overlay: e = !0, bubbleMenu: t = !0, slashCommands: n = !0, className: r, style: i, children: a }) {
|
|
3240
3255
|
let { editor: o, device: c, t: u } = Q(), [d, p] = l(null), m = s(() => Array.isArray(n) ? n : ke.map((e) => ({
|
|
3241
3256
|
...e,
|
|
3242
3257
|
...u.slashCommands[e.title]
|
|
@@ -3261,7 +3276,7 @@ function ir({ overlay: e = !0, bubbleMenu: t = !0, slashCommands: n = !0, classN
|
|
|
3261
3276
|
/* @__PURE__ */ I(se.ImageDefault, {})
|
|
3262
3277
|
] }),
|
|
3263
3278
|
n !== !1 && /* @__PURE__ */ I(Se, { items: m }),
|
|
3264
|
-
e && d && /* @__PURE__ */ I(
|
|
3279
|
+
e && d && /* @__PURE__ */ I(rr, {
|
|
3265
3280
|
editor: o,
|
|
3266
3281
|
host: d
|
|
3267
3282
|
}),
|
|
@@ -3271,14 +3286,14 @@ function ir({ overlay: e = !0, bubbleMenu: t = !0, slashCommands: n = !0, classN
|
|
|
3271
3286
|
}
|
|
3272
3287
|
//#endregion
|
|
3273
3288
|
//#region src/core/layers.ts
|
|
3274
|
-
function
|
|
3289
|
+
function or(e, t) {
|
|
3275
3290
|
let n = e.child(t);
|
|
3276
3291
|
return t === e.childCount - 1 && e.childCount > 1 && Ke(n) && e.child(t - 1).type.name !== "paragraph";
|
|
3277
3292
|
}
|
|
3278
|
-
function
|
|
3293
|
+
function sr(e, t, n, r) {
|
|
3279
3294
|
let i = [];
|
|
3280
3295
|
return e.forEach((a, o, s) => {
|
|
3281
|
-
if (
|
|
3296
|
+
if (or(e, s)) return;
|
|
3282
3297
|
let c = t + 1 + o, l = a.type.name, u = `${r}${s}`, d = Ve.has(l), f = d && a.childCount === 1 && Ke(a.firstChild), p = d || He.has(l);
|
|
3283
3298
|
i.push({
|
|
3284
3299
|
key: u,
|
|
@@ -3286,21 +3301,21 @@ function or(e, t, n, r) {
|
|
|
3286
3301
|
node: a,
|
|
3287
3302
|
depth: n,
|
|
3288
3303
|
index: s + 1,
|
|
3289
|
-
children: p && !f ?
|
|
3304
|
+
children: p && !f ? sr(a, c, n + 1, `${u}.`) : [],
|
|
3290
3305
|
accepts: d,
|
|
3291
3306
|
fixed: l === "columnsColumn",
|
|
3292
3307
|
empty: f
|
|
3293
3308
|
});
|
|
3294
3309
|
}), i;
|
|
3295
3310
|
}
|
|
3296
|
-
function
|
|
3311
|
+
function cr(e) {
|
|
3297
3312
|
let t = qe(e);
|
|
3298
|
-
return t ?
|
|
3313
|
+
return t ? sr(t.node, t.pos, 0, "") : [];
|
|
3299
3314
|
}
|
|
3300
|
-
function
|
|
3315
|
+
function lr(e, t) {
|
|
3301
3316
|
return e.fixed ? "inside" : e.accepts ? t < .25 ? "before" : t > .75 ? "after" : "inside" : t < .5 ? "before" : "after";
|
|
3302
3317
|
}
|
|
3303
|
-
function
|
|
3318
|
+
function ur(e, t, n, r, i) {
|
|
3304
3319
|
let a, o;
|
|
3305
3320
|
if (n === "inside") {
|
|
3306
3321
|
if (!t.accepts) return null;
|
|
@@ -3318,8 +3333,8 @@ function lr(e, t, n, r, i) {
|
|
|
3318
3333
|
}
|
|
3319
3334
|
//#endregion
|
|
3320
3335
|
//#region src/components/LayersPanel.tsx
|
|
3321
|
-
function
|
|
3322
|
-
let { editor: o, t: d, locale: f, nodes: p, nodeLabel: m, dragSession: g, hoverStore: _ } = Q(), v = (e) => e.node.type.name === "columnsColumn" ? d.layers.column(e.index) : m(e.node.type.name), y = (e) => (p.get(e.node.type.name)?.preview ??
|
|
3336
|
+
function dr({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r, style: a }) {
|
|
3337
|
+
let { editor: o, t: d, locale: f, nodes: p, nodeLabel: m, dragSession: g, hoverStore: _ } = Q(), v = (e) => e.node.type.name === "columnsColumn" ? d.layers.column(e.index) : m(e.node.type.name), y = (e) => (p.get(e.node.type.name)?.preview ?? wn)(e.node, {
|
|
3323
3338
|
locale: f,
|
|
3324
3339
|
t: d
|
|
3325
3340
|
}), b = h({
|
|
@@ -3329,7 +3344,7 @@ function ur({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r,
|
|
|
3329
3344
|
}), x = h({
|
|
3330
3345
|
editor: o,
|
|
3331
3346
|
selector: ({ editor: e }) => e?.isFocused ? rt(e)?.pos ?? null : null
|
|
3332
|
-
}), S = u(_.subscribe, _.get), C = s(() => b ?
|
|
3347
|
+
}), S = u(_.subscribe, _.get), C = s(() => b ? cr(b) : [], [b]), [w, T] = l(() => /* @__PURE__ */ new Set()), [E, D] = l(null), O = c(null);
|
|
3333
3348
|
i(() => {
|
|
3334
3349
|
x !== null && O.current?.querySelector("[aria-selected=\"true\"]")?.scrollIntoView({ block: "nearest" });
|
|
3335
3350
|
}, [x]);
|
|
@@ -3351,10 +3366,10 @@ function ur({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r,
|
|
|
3351
3366
|
if (!n) return null;
|
|
3352
3367
|
let r = Ye(o.view, n);
|
|
3353
3368
|
if (!r) return null;
|
|
3354
|
-
let i = e.currentTarget.getBoundingClientRect(), a =
|
|
3369
|
+
let i = e.currentTarget.getBoundingClientRect(), a = lr(t, (e.clientY - i.top) / i.height), s = n.kind === "move" ? o.state.doc.nodeAt(n.pos) : null, c = n.kind === "move" && s ? {
|
|
3355
3370
|
from: n.pos,
|
|
3356
3371
|
to: n.pos + s.nodeSize
|
|
3357
|
-
} : void 0, l =
|
|
3372
|
+
} : void 0, l = ur(o.state.doc, t, a, r, c);
|
|
3358
3373
|
return l ? {
|
|
3359
3374
|
zone: a,
|
|
3360
3375
|
target: l,
|
|
@@ -3498,32 +3513,32 @@ function ur({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r,
|
|
|
3498
3513
|
}
|
|
3499
3514
|
//#endregion
|
|
3500
3515
|
//#region src/components/inspectors/DefaultInspector.tsx
|
|
3501
|
-
function
|
|
3516
|
+
function fr({ ctx: e, className: t, style: n }) {
|
|
3502
3517
|
return /* @__PURE__ */ L("div", {
|
|
3503
3518
|
className: R("bree-inspector", t),
|
|
3504
3519
|
style: n,
|
|
3505
3520
|
children: [
|
|
3506
|
-
/* @__PURE__ */ I(
|
|
3521
|
+
/* @__PURE__ */ I(tn, {
|
|
3507
3522
|
ctx: e,
|
|
3508
3523
|
alignment: String(e.getAttr("alignment") ?? "left"),
|
|
3509
3524
|
setAlignment: (t) => e.setAttr("alignment", t)
|
|
3510
3525
|
}),
|
|
3511
|
-
/* @__PURE__ */ I(
|
|
3512
|
-
/* @__PURE__ */ I(
|
|
3526
|
+
/* @__PURE__ */ I(nn, { ctx: e }),
|
|
3527
|
+
/* @__PURE__ */ I(rn, { ctx: e })
|
|
3513
3528
|
]
|
|
3514
3529
|
});
|
|
3515
3530
|
}
|
|
3516
3531
|
//#endregion
|
|
3517
3532
|
//#region src/components/PropertiesPanel.tsx
|
|
3518
|
-
function
|
|
3533
|
+
function pr() {
|
|
3519
3534
|
let { editor: e } = Q();
|
|
3520
3535
|
return () => {
|
|
3521
3536
|
let t = document.activeElement;
|
|
3522
3537
|
t instanceof HTMLElement && t.blur(), e.commands.blur();
|
|
3523
3538
|
};
|
|
3524
3539
|
}
|
|
3525
|
-
function
|
|
3526
|
-
let { t: a, nodeLabel: o } = Q(), s =
|
|
3540
|
+
function mr({ title: e, children: t, breadcrumb: n = !0, className: r, style: i }) {
|
|
3541
|
+
let { t: a, nodeLabel: o } = Q(), s = pr();
|
|
3527
3542
|
return /* @__PURE__ */ L("div", {
|
|
3528
3543
|
className: R("bree-properties", r),
|
|
3529
3544
|
style: i,
|
|
@@ -3566,9 +3581,9 @@ function pr({ title: e, children: t, breadcrumb: n = !0, className: r, style: i
|
|
|
3566
3581
|
}
|
|
3567
3582
|
//#endregion
|
|
3568
3583
|
//#region src/components/BlockProperties.tsx
|
|
3569
|
-
function
|
|
3570
|
-
let { nodes: r, nodeLabel: i } = Q(), a = r.get(e.nodeType)?.inspector ??
|
|
3571
|
-
return /* @__PURE__ */ I(
|
|
3584
|
+
function hr({ ctx: e, className: t, style: n }) {
|
|
3585
|
+
let { nodes: r, nodeLabel: i } = Q(), a = r.get(e.nodeType)?.inspector ?? fr;
|
|
3586
|
+
return /* @__PURE__ */ I(mr, {
|
|
3572
3587
|
title: i(e.nodeType),
|
|
3573
3588
|
className: t,
|
|
3574
3589
|
style: n,
|
|
@@ -3577,7 +3592,7 @@ function mr({ ctx: e, className: t, style: n }) {
|
|
|
3577
3592
|
}
|
|
3578
3593
|
//#endregion
|
|
3579
3594
|
//#region src/components/useDraggableBlock.ts
|
|
3580
|
-
function
|
|
3595
|
+
function gr(e, t) {
|
|
3581
3596
|
let { editor: n, dragSession: r } = Q();
|
|
3582
3597
|
return {
|
|
3583
3598
|
draggable: !0,
|
|
@@ -3594,8 +3609,8 @@ function hr(e, t) {
|
|
|
3594
3609
|
}
|
|
3595
3610
|
//#endregion
|
|
3596
3611
|
//#region src/components/BlocksTab.tsx
|
|
3597
|
-
function
|
|
3598
|
-
let r =
|
|
3612
|
+
function _r({ template: e, className: t, style: n }) {
|
|
3613
|
+
let r = Gn(), i = Et(e.label, r), a = gr(i, () => e.content(r));
|
|
3599
3614
|
return /* @__PURE__ */ L("button", {
|
|
3600
3615
|
type: "button",
|
|
3601
3616
|
className: R("bree-block-card", t),
|
|
@@ -3603,21 +3618,21 @@ function gr({ template: e, className: t, style: n }) {
|
|
|
3603
3618
|
...a,
|
|
3604
3619
|
children: [e.thumbnail ?? /* @__PURE__ */ I(Z, { variant: "default" }), /* @__PURE__ */ L("span", {
|
|
3605
3620
|
className: "bree-block-text",
|
|
3606
|
-
children: [/* @__PURE__ */ I("strong", { children: i }), e.description && /* @__PURE__ */ I("span", { children:
|
|
3621
|
+
children: [/* @__PURE__ */ I("strong", { children: i }), e.description && /* @__PURE__ */ I("span", { children: Et(e.description, r) })]
|
|
3607
3622
|
})]
|
|
3608
3623
|
});
|
|
3609
3624
|
}
|
|
3610
|
-
function
|
|
3625
|
+
function vr({ templates: e, className: t, style: n }) {
|
|
3611
3626
|
let r = Q();
|
|
3612
3627
|
return /* @__PURE__ */ I("div", {
|
|
3613
3628
|
className: R("bree-block-list", t),
|
|
3614
3629
|
style: n,
|
|
3615
|
-
children: (e ?? r.templates).map((e) => /* @__PURE__ */ I(
|
|
3630
|
+
children: (e ?? r.templates).map((e) => /* @__PURE__ */ I(_r, { template: e }, e.id))
|
|
3616
3631
|
});
|
|
3617
3632
|
}
|
|
3618
3633
|
//#endregion
|
|
3619
3634
|
//#region src/components/BodyTab.tsx
|
|
3620
|
-
function
|
|
3635
|
+
function yr({ ctx: e, className: t, style: n }) {
|
|
3621
3636
|
let { settings: r, updateSettings: i, t: a } = Q(), o = a.body, { findStyleValue: s, setGlobalStyle: c } = e;
|
|
3622
3637
|
return /* @__PURE__ */ L("div", {
|
|
3623
3638
|
className: R("bree-body-tab", t),
|
|
@@ -3746,8 +3761,8 @@ function vr({ ctx: e, className: t, style: n }) {
|
|
|
3746
3761
|
}
|
|
3747
3762
|
//#endregion
|
|
3748
3763
|
//#region src/components/ContentTab.tsx
|
|
3749
|
-
function
|
|
3750
|
-
let r =
|
|
3764
|
+
function br({ item: e, className: t, style: n }) {
|
|
3765
|
+
let r = Gn(), i = Et(e.label, r), a = gr(i, () => e.content(r));
|
|
3751
3766
|
return /* @__PURE__ */ L("button", {
|
|
3752
3767
|
type: "button",
|
|
3753
3768
|
className: R("bree-tile", t),
|
|
@@ -3763,7 +3778,7 @@ function yr({ item: e, className: t, style: n }) {
|
|
|
3763
3778
|
})]
|
|
3764
3779
|
});
|
|
3765
3780
|
}
|
|
3766
|
-
function
|
|
3781
|
+
function xr({ items: e, groups: t, hint: n, className: r, style: i }) {
|
|
3767
3782
|
let a = Q(), o = e ?? a.palette, s = t ?? a.paletteGroups, c = [...s, ...[...new Set(o.map((e) => e.group))].filter((e) => !s.some((t) => t.id === e)).map((e) => ({
|
|
3768
3783
|
id: e,
|
|
3769
3784
|
title: e
|
|
@@ -3775,10 +3790,10 @@ function br({ items: e, groups: t, hint: n, className: r, style: i }) {
|
|
|
3775
3790
|
let t = o.filter((t) => t.group === e.id);
|
|
3776
3791
|
return t.length ? /* @__PURE__ */ L("section", { children: [/* @__PURE__ */ I("h3", {
|
|
3777
3792
|
className: "bree-panel-title",
|
|
3778
|
-
children:
|
|
3793
|
+
children: Et(e.title, a)
|
|
3779
3794
|
}), /* @__PURE__ */ I("div", {
|
|
3780
3795
|
className: "bree-tiles",
|
|
3781
|
-
children: t.map((e) => /* @__PURE__ */ I(
|
|
3796
|
+
children: t.map((e) => /* @__PURE__ */ I(br, { item: e }, e.id))
|
|
3782
3797
|
})] }, e.id) : null;
|
|
3783
3798
|
}), n !== null && /* @__PURE__ */ I("p", {
|
|
3784
3799
|
className: "bree-hint",
|
|
@@ -3788,7 +3803,7 @@ function br({ items: e, groups: t, hint: n, className: r, style: i }) {
|
|
|
3788
3803
|
}
|
|
3789
3804
|
//#endregion
|
|
3790
3805
|
//#region src/components/ContentPanel.tsx
|
|
3791
|
-
function
|
|
3806
|
+
function Sr({ ctx: e, tabs: t = [
|
|
3792
3807
|
"content",
|
|
3793
3808
|
"blocks",
|
|
3794
3809
|
"body"
|
|
@@ -3797,17 +3812,17 @@ function xr({ ctx: e, tabs: t = [
|
|
|
3797
3812
|
content: {
|
|
3798
3813
|
id: "content",
|
|
3799
3814
|
label: a.sidebar.tabContent,
|
|
3800
|
-
render: () => /* @__PURE__ */ I(
|
|
3815
|
+
render: () => /* @__PURE__ */ I(xr, {})
|
|
3801
3816
|
},
|
|
3802
3817
|
blocks: {
|
|
3803
3818
|
id: "blocks",
|
|
3804
3819
|
label: a.sidebar.tabBlocks,
|
|
3805
|
-
render: () => /* @__PURE__ */ I(
|
|
3820
|
+
render: () => /* @__PURE__ */ I(vr, {})
|
|
3806
3821
|
},
|
|
3807
3822
|
body: {
|
|
3808
3823
|
id: "body",
|
|
3809
3824
|
label: a.sidebar.tabBody,
|
|
3810
|
-
render: (e) => /* @__PURE__ */ I(
|
|
3825
|
+
render: (e) => /* @__PURE__ */ I(yr, { ctx: e })
|
|
3811
3826
|
}
|
|
3812
3827
|
}, s = t.map((e) => typeof e == "string" ? o[e] : e), [c, u] = l(n ?? s[0]?.id), d = s.find((e) => e.id === c) ?? s[0];
|
|
3813
3828
|
return /* @__PURE__ */ L("div", {
|
|
@@ -3832,7 +3847,7 @@ function xr({ ctx: e, tabs: t = [
|
|
|
3832
3847
|
}
|
|
3833
3848
|
//#endregion
|
|
3834
3849
|
//#region src/components/TextProperties.tsx
|
|
3835
|
-
function
|
|
3850
|
+
function Cr({ ctx: e, className: t, style: n }) {
|
|
3836
3851
|
let r = $(), i = r.inspector, a = [
|
|
3837
3852
|
{
|
|
3838
3853
|
mark: "bold",
|
|
@@ -3855,7 +3870,7 @@ function Sr({ ctx: e, className: t, style: n }) {
|
|
|
3855
3870
|
title: i.strike
|
|
3856
3871
|
}
|
|
3857
3872
|
];
|
|
3858
|
-
return /* @__PURE__ */ L(
|
|
3873
|
+
return /* @__PURE__ */ L(mr, {
|
|
3859
3874
|
title: r.sidebar.selectedText,
|
|
3860
3875
|
className: t,
|
|
3861
3876
|
style: n,
|
|
@@ -3874,7 +3889,7 @@ function Sr({ ctx: e, className: t, style: n }) {
|
|
|
3874
3889
|
}, t))
|
|
3875
3890
|
})
|
|
3876
3891
|
}),
|
|
3877
|
-
/* @__PURE__ */ I(
|
|
3892
|
+
/* @__PURE__ */ I(tn, {
|
|
3878
3893
|
ctx: e,
|
|
3879
3894
|
alignment: e.alignment,
|
|
3880
3895
|
setAlignment: e.setAlignment
|
|
@@ -3903,7 +3918,7 @@ function Sr({ ctx: e, className: t, style: n }) {
|
|
|
3903
3918
|
}
|
|
3904
3919
|
//#endregion
|
|
3905
3920
|
//#region src/components/Sidebar.tsx
|
|
3906
|
-
function
|
|
3921
|
+
function wr({ renderDocument: e = (e) => /* @__PURE__ */ I(Sr, { ctx: e }), renderNode: t = (e) => /* @__PURE__ */ I(hr, { ctx: e }), renderText: n = (e) => /* @__PURE__ */ I(Cr, { ctx: e }), className: r, style: i }) {
|
|
3907
3922
|
let { t: a } = Q();
|
|
3908
3923
|
return /* @__PURE__ */ L(M.Root, {
|
|
3909
3924
|
className: R("bree-sidebar", r),
|
|
@@ -3918,11 +3933,11 @@ function Cr({ renderDocument: e = (e) => /* @__PURE__ */ I(xr, { ctx: e }), rend
|
|
|
3918
3933
|
}
|
|
3919
3934
|
//#endregion
|
|
3920
3935
|
//#region src/components/PreviewDialog.tsx
|
|
3921
|
-
function
|
|
3936
|
+
function Tr(e, t, n) {
|
|
3922
3937
|
let r = URL.createObjectURL(new Blob([t], { type: n })), i = document.createElement("a");
|
|
3923
3938
|
i.href = r, i.download = e, i.click(), URL.revokeObjectURL(r);
|
|
3924
3939
|
}
|
|
3925
|
-
function
|
|
3940
|
+
function Er({ onClose: e, defaultView: t = "desktop", views: n = [
|
|
3926
3941
|
"desktop",
|
|
3927
3942
|
"mobile",
|
|
3928
3943
|
"html",
|
|
@@ -3975,7 +3990,7 @@ function Tr({ onClose: e, defaultView: t = "desktop", views: n = [
|
|
|
3975
3990
|
p && /* @__PURE__ */ I("button", {
|
|
3976
3991
|
type: "button",
|
|
3977
3992
|
className: "bree-btn bree-primary",
|
|
3978
|
-
onClick: () =>
|
|
3993
|
+
onClick: () => Tr(r, p.unformattedHtml, "text/html"),
|
|
3979
3994
|
children: b.download
|
|
3980
3995
|
}),
|
|
3981
3996
|
/* @__PURE__ */ I("button", {
|
|
@@ -4021,7 +4036,7 @@ function Tr({ onClose: e, defaultView: t = "desktop", views: n = [
|
|
|
4021
4036
|
}
|
|
4022
4037
|
//#endregion
|
|
4023
4038
|
//#region src/components/TopBar.tsx
|
|
4024
|
-
function
|
|
4039
|
+
function Dr({ className: e, style: t }) {
|
|
4025
4040
|
let { layersOpen: n, setLayersOpen: r, t: i } = Q();
|
|
4026
4041
|
return /* @__PURE__ */ L("button", {
|
|
4027
4042
|
type: "button",
|
|
@@ -4031,13 +4046,13 @@ function Er({ className: e, style: t }) {
|
|
|
4031
4046
|
onClick: () => r(!n),
|
|
4032
4047
|
title: i.topBar.toggleLayers,
|
|
4033
4048
|
children: [
|
|
4034
|
-
/* @__PURE__ */ I(
|
|
4049
|
+
/* @__PURE__ */ I(zt, {}),
|
|
4035
4050
|
" ",
|
|
4036
4051
|
i.topBar.layers
|
|
4037
4052
|
]
|
|
4038
4053
|
});
|
|
4039
4054
|
}
|
|
4040
|
-
function
|
|
4055
|
+
function Or({ className: e, style: t }) {
|
|
4041
4056
|
let { editor: n, t: r } = Q(), i = h({
|
|
4042
4057
|
editor: n,
|
|
4043
4058
|
selector: ({ editor: e }) => ({
|
|
@@ -4054,26 +4069,26 @@ function Dr({ className: e, style: t }) {
|
|
|
4054
4069
|
title: r.topBar.undo,
|
|
4055
4070
|
disabled: !i?.undo,
|
|
4056
4071
|
onClick: () => n.chain().focus().undo().run(),
|
|
4057
|
-
children: /* @__PURE__ */ I(
|
|
4072
|
+
children: /* @__PURE__ */ I(Ft, {})
|
|
4058
4073
|
}), /* @__PURE__ */ I("button", {
|
|
4059
4074
|
type: "button",
|
|
4060
4075
|
className: "bree-icon-button",
|
|
4061
4076
|
title: r.topBar.redo,
|
|
4062
4077
|
disabled: !i?.redo,
|
|
4063
4078
|
onClick: () => n.chain().focus().redo().run(),
|
|
4064
|
-
children: /* @__PURE__ */ I(
|
|
4079
|
+
children: /* @__PURE__ */ I(It, {})
|
|
4065
4080
|
})]
|
|
4066
4081
|
});
|
|
4067
4082
|
}
|
|
4068
|
-
function
|
|
4083
|
+
function kr({ className: e, style: t }) {
|
|
4069
4084
|
let { device: n, setDevice: r, t: i } = Q(), a = [{
|
|
4070
4085
|
id: "desktop",
|
|
4071
4086
|
label: i.topBar.desktop,
|
|
4072
|
-
Icon:
|
|
4087
|
+
Icon: Lt
|
|
4073
4088
|
}, {
|
|
4074
4089
|
id: "mobile",
|
|
4075
4090
|
label: i.topBar.mobile,
|
|
4076
|
-
Icon:
|
|
4091
|
+
Icon: Rt
|
|
4077
4092
|
}];
|
|
4078
4093
|
return /* @__PURE__ */ I("div", {
|
|
4079
4094
|
className: R("bree-segmented bree-device-toggle", e),
|
|
@@ -4091,7 +4106,7 @@ function Or({ className: e, style: t }) {
|
|
|
4091
4106
|
}, e))
|
|
4092
4107
|
});
|
|
4093
4108
|
}
|
|
4094
|
-
function
|
|
4109
|
+
function Ar({ className: e, style: t }) {
|
|
4095
4110
|
let { editor: n, starterDocument: r, locale: i, t: a } = Q();
|
|
4096
4111
|
return /* @__PURE__ */ I("button", {
|
|
4097
4112
|
type: "button",
|
|
@@ -4106,7 +4121,7 @@ function kr({ className: e, style: t }) {
|
|
|
4106
4121
|
children: a.topBar.template
|
|
4107
4122
|
});
|
|
4108
4123
|
}
|
|
4109
|
-
function
|
|
4124
|
+
function jr({ className: e, style: t }) {
|
|
4110
4125
|
let { handle: n, t: r } = Q(), i = c(null), a = async (e) => {
|
|
4111
4126
|
try {
|
|
4112
4127
|
n.setValue(JSON.parse(await e.text()));
|
|
@@ -4131,17 +4146,17 @@ function Ar({ className: e, style: t }) {
|
|
|
4131
4146
|
}
|
|
4132
4147
|
})] });
|
|
4133
4148
|
}
|
|
4134
|
-
function
|
|
4149
|
+
function Mr({ className: e, style: t, filename: n = "email.json" }) {
|
|
4135
4150
|
let { handle: r, t: i } = Q();
|
|
4136
4151
|
return /* @__PURE__ */ I("button", {
|
|
4137
4152
|
type: "button",
|
|
4138
4153
|
className: R("bree-btn bree-ghost", e),
|
|
4139
4154
|
style: t,
|
|
4140
|
-
onClick: () =>
|
|
4155
|
+
onClick: () => Tr(n, JSON.stringify(r.getValue(), null, 2), "application/json"),
|
|
4141
4156
|
children: i.topBar.exportJson
|
|
4142
4157
|
});
|
|
4143
4158
|
}
|
|
4144
|
-
function
|
|
4159
|
+
function Nr({ view: e = "desktop", variant: t = "default", children: n, className: r, style: i }) {
|
|
4145
4160
|
let { t: a } = Q(), [o, s] = l(!1);
|
|
4146
4161
|
return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("button", {
|
|
4147
4162
|
type: "button",
|
|
@@ -4149,21 +4164,21 @@ function Mr({ view: e = "desktop", variant: t = "default", children: n, classNam
|
|
|
4149
4164
|
style: i,
|
|
4150
4165
|
onClick: () => s(!0),
|
|
4151
4166
|
children: n ?? a.topBar.preview
|
|
4152
|
-
}), o && /* @__PURE__ */ I(
|
|
4167
|
+
}), o && /* @__PURE__ */ I(Er, {
|
|
4153
4168
|
defaultView: e,
|
|
4154
4169
|
onClose: () => s(!1)
|
|
4155
4170
|
})] });
|
|
4156
4171
|
}
|
|
4157
|
-
function
|
|
4172
|
+
function Pr(e) {
|
|
4158
4173
|
let { t } = Q();
|
|
4159
|
-
return /* @__PURE__ */ I(
|
|
4174
|
+
return /* @__PURE__ */ I(Nr, {
|
|
4160
4175
|
view: "html",
|
|
4161
4176
|
variant: "primary",
|
|
4162
4177
|
...e,
|
|
4163
4178
|
children: t.topBar.exportHtml
|
|
4164
4179
|
});
|
|
4165
4180
|
}
|
|
4166
|
-
function
|
|
4181
|
+
function Fr({ brand: e, actions: t, children: n, className: r, style: i }) {
|
|
4167
4182
|
return /* @__PURE__ */ I(j, { children: /* @__PURE__ */ L("header", {
|
|
4168
4183
|
className: R("bree-topbar", r),
|
|
4169
4184
|
style: i,
|
|
@@ -4172,17 +4187,17 @@ function Pr({ brand: e, actions: t, children: n, className: r, style: i }) {
|
|
|
4172
4187
|
children: e
|
|
4173
4188
|
}), n ?? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
|
|
4174
4189
|
className: "bree-topbar-center",
|
|
4175
|
-
children: /* @__PURE__ */ I(
|
|
4190
|
+
children: /* @__PURE__ */ I(kr, {})
|
|
4176
4191
|
}), /* @__PURE__ */ L("div", {
|
|
4177
4192
|
className: "bree-topbar-actions",
|
|
4178
|
-
children: [t, /* @__PURE__ */ I(
|
|
4193
|
+
children: [t, /* @__PURE__ */ I(Pr, {})]
|
|
4179
4194
|
})] })]
|
|
4180
4195
|
}) });
|
|
4181
4196
|
}
|
|
4182
4197
|
//#endregion
|
|
4183
4198
|
//#region src/components/BetterEmailEditor.tsx
|
|
4184
|
-
function
|
|
4185
|
-
let { layersOpen: a } = Q(), { TopBar: o =
|
|
4199
|
+
function Ir({ showTopBar: e = !0, showLayers: t = !0, showSidebar: n = !0, components: r = {}, slotProps: i = {} }) {
|
|
4200
|
+
let { layersOpen: a } = Q(), { TopBar: o = Fr, LayersPanel: s = dr, Canvas: c = ar, Sidebar: l = wr } = r, u = t && a;
|
|
4186
4201
|
return /* @__PURE__ */ L("div", {
|
|
4187
4202
|
className: R("bree-layout", e && "bree-with-topbar", u && "bree-with-layers", n && "bree-with-sidebar"),
|
|
4188
4203
|
children: [
|
|
@@ -4193,11 +4208,11 @@ function Fr({ showTopBar: e = !0, showLayers: t = !0, showSidebar: n = !0, compo
|
|
|
4193
4208
|
]
|
|
4194
4209
|
});
|
|
4195
4210
|
}
|
|
4196
|
-
var
|
|
4197
|
-
return /* @__PURE__ */ I(
|
|
4211
|
+
var Lr = t(function({ showTopBar: e, showLayers: t, showSidebar: n, components: r, slotProps: i, ...a }, o) {
|
|
4212
|
+
return /* @__PURE__ */ I(Qn, {
|
|
4198
4213
|
ref: o,
|
|
4199
4214
|
...a,
|
|
4200
|
-
children: /* @__PURE__ */ I(
|
|
4215
|
+
children: /* @__PURE__ */ I(Ir, {
|
|
4201
4216
|
showTopBar: e,
|
|
4202
4217
|
showLayers: t,
|
|
4203
4218
|
showSidebar: n,
|
|
@@ -4207,6 +4222,6 @@ var Ir = t(function({ showTopBar: e, showLayers: t, showSidebar: n, components:
|
|
|
4207
4222
|
});
|
|
4208
4223
|
});
|
|
4209
4224
|
//#endregion
|
|
4210
|
-
export {
|
|
4225
|
+
export { $t as AlignInput, Ve as BLOCK_CONTAINERS, Lr as BetterEmailEditor, hr as BlockProperties, vr as BlocksTab, yr as BodyTab, rn as BoxGroup, an as ButtonInspector, He as COLUMN_PARENTS, ar as Canvas, rr as CanvasOverlay, G as ColorInput, on as ColumnsInspector, fn as ContainerInspector, Sr as ContentPanel, xr as ContentTab, Yt as DEFAULT_SWATCHES, fr as DefaultInspector, kr as DeviceToggle, dn as DividerInspector, Qn as EditorRoot, ct as EmailButton, Pr as ExportHtmlButton, Mr as ExportJsonButton, H as Field, V as Group, sn as HeadingInspector, xn as HtmlBlock, un as HtmlInspector, cn as ImageInspector, jr as ImportButton, dr as LayersPanel, Dr as LayersToggle, W as NumberInput, en as PaddingInput, br as PaletteTile, Nr as PreviewButton, Er as PreviewDialog, mr as PropertiesPanel, Jt as RangeInput, gn as SOCIAL_NETWORKS, Qt as Segmented, Zt as Select, wr as Sidebar, bn as SocialLinks, Sn as SocialLinksInspector, hn as Spacer, ln as SpacerInspector, nn as SpacingGroup, Ar as TemplateButton, _r as TemplateCard, Z as TemplateThumbnail, Kt as TextArea, U as TextInput, Cr as TextProperties, Fr as TopBar, tn as TypographyGroup, Or as UndoRedo, st as appendBlocks, $e as applyDrop, Dn as content, Hn as createStarterDocument, K as css, R as cx, En as defaultNodes, zn as defaultPalette, Rn as defaultPaletteGroups, Bn as defaultTemplates, Kn as defaultTheme, ot as deleteUnit, Tr as download, at as duplicateUnit, Ct as en, Je as findDropTarget, wt as fr, vn as iconUrl, At as icons, pn as inlineStyleToObject, Tt as locales, Ln as menuParagraph, nt as parentUnit, qn as readFileAsDataUrl, Et as resolveLabel, kt as resolveMessages, it as selectUnit, rt as selectedUnit, wn as textPreview, Xt as toHex, Cn as truncate, z as unitAt, pr as useDeselect, gr as useDraggableBlock, Q as useEmailEditor, Gn as useI18n, $ as useMessages, Wn as useOptionalEmailEditor };
|
|
4211
4226
|
|
|
4212
4227
|
//# sourceMappingURL=index.js.map
|