monto-email-builder 1.2.3 → 1.2.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/dist/App/InspectorDrawer/ToggleInspectorPanelButton.d.ts.map +1 -1
- package/dist/App/SamplesDrawer/ToggleSamplesPanelButton.d.ts.map +1 -1
- package/dist/App/TemplatePanel/MainTabsGroup.d.ts.map +1 -1
- package/dist/App/TemplatePanel/index.d.ts.map +1 -1
- package/dist/index.js +738 -724
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,40 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var gn = (e, t, n) =>
|
|
1
|
+
var Al = Object.defineProperty;
|
|
2
|
+
var Tl = (e, t, n) => t in e ? Al(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var gn = (e, t, n) => Tl(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as o, jsxs as w, Fragment as an } from "react/jsx-runtime";
|
|
5
|
-
import mt, { createContext as ho, useContext as hr, useState as z, useEffect as Ce, useRef as
|
|
6
|
-
import { Box as se, Typography as ke, Stack as Z, Button as
|
|
7
|
-
import { renderToStaticMarkup as yo, Reader as
|
|
8
|
-
import { create as
|
|
9
|
-
import { g as Er, s as Ar, t as
|
|
5
|
+
import mt, { createContext as ho, useContext as hr, useState as z, useEffect as Ce, useRef as Me, useMemo as ct, useCallback as en, Fragment as _l, useLayoutEffect as Qn, memo as Bl, forwardRef as Ol, useImperativeHandle as Ml } from "react";
|
|
6
|
+
import { Box as se, Typography as ke, Stack as Z, Button as Oe, InputLabel as At, Menu as br, ButtonBase as Fn, ToggleButtonGroup as bo, TextField as dt, ToggleButton as le, MenuItem as on, Slider as Nl, Dialog as Cr, DialogTitle as yr, DialogContent as xr, DialogActions as Sr, CircularProgress as jn, FormControlLabel as vr, Switch as Rl, IconButton as $e, Divider as rn, Popover as ao, Select as wr, Checkbox as Pl, Accordion as Fl, AccordionSummary as zl, AccordionDetails as Ll, Paper as Co, Drawer as Ir, Tabs as kr, Tab as Zt, Link as Wl, Fade as Hl, Tooltip as Ze, Alert as Vl, useTheme as Dr, ThemeProvider as Ul, CssBaseline as $l } from "@mui/material";
|
|
7
|
+
import { renderToStaticMarkup as yo, Reader as jl } from "monto-email-core";
|
|
8
|
+
import { create as Kl } from "zustand";
|
|
9
|
+
import { g as Er, s as Ar, t as ql } from "./chunks/chunk-_7XTjFEi.js";
|
|
10
10
|
import { E as sn } from "./chunks/chunk-Cc3ecmGS.js";
|
|
11
|
-
import { getFontFamily as Tr, styleToCss as _r, getResolvedTextBodyHtml as Ht, TextPropsSchema as Br, Text as
|
|
12
|
-
import { createTheme as
|
|
13
|
-
import { ButtonPropsDefaults as Kt, ButtonPropsSchema as
|
|
14
|
-
import { CloseOutlined as Nr, AddOutlined as xo, TextFieldsOutlined as
|
|
15
|
-
import { HexColorPicker as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
11
|
+
import { getFontFamily as Tr, styleToCss as _r, getResolvedTextBodyHtml as Ht, TextPropsSchema as Br, Text as Yl } from "monto-email-block-text";
|
|
12
|
+
import { createTheme as Or, alpha as eo, lighten as jt, darken as Ho } from "@mui/material/styles";
|
|
13
|
+
import { ButtonPropsDefaults as Kt, ButtonPropsSchema as Mr, Button as Xl } from "monto-email-block-button";
|
|
14
|
+
import { CloseOutlined as Nr, AddOutlined as xo, TextFieldsOutlined as Gl, TitleOutlined as Jl, AlignVerticalTopOutlined as Zl, AlignVerticalBottomOutlined as Ql, AlignHorizontalLeftOutlined as ei, AlignHorizontalRightOutlined as ti, FormatAlignLeftOutlined as ni, FormatAlignCenterOutlined as oi, FormatAlignRightOutlined as ri, RoundedCornerOutlined as li, SpaceBarOutlined as ii, VerticalAlignTopOutlined as So, VerticalAlignCenterOutlined as vo, VerticalAlignBottomOutlined as wo, UnfoldMoreOutlined as ai, HeightOutlined as Rr, AspectRatioOutlined as Pr, LinkOutlined as Kn, CloudUploadOutlined as Ft, DataObjectOutlined as si, DragIndicator as Fr, DeleteOutline as ci, Add as ui, HMobiledataOutlined as di, NotesOutlined as pi, SmartButtonOutlined as fi, ImageOutlined as mi, VideocamOutlined as gi, HorizontalRuleOutlined as hi, Crop32Outlined as bi, ShareOutlined as Ci, HtmlOutlined as yi, ViewColumnOutlined as xi, LibraryAddOutlined as Si, ArrowRightOutlined as vi, Check as zr, ArrowUpwardOutlined as wi, ArrowDownwardOutlined as Ii, ContentCopyOutlined as ki, DeleteOutlined as Di } from "@mui/icons-material";
|
|
15
|
+
import { HexColorPicker as Ei, HexColorInput as Ai } from "react-colorful";
|
|
16
|
+
import Ti from "@mui/icons-material/FormatBoldOutlined";
|
|
17
|
+
import _i from "@mui/icons-material/FormatItalicOutlined";
|
|
18
|
+
import Bi from "@mui/icons-material/FormatUnderlinedOutlined";
|
|
19
|
+
import Oi from "@mui/icons-material/StrikethroughSOutlined";
|
|
20
20
|
import { z as J } from "zod";
|
|
21
|
-
import { ColumnsContainerPropsSchema as
|
|
22
|
-
import { ContainerPropsSchema as
|
|
23
|
-
import { DividerPropsDefaults as Vo, DividerPropsSchema as
|
|
24
|
-
import { HeadingPropsDefaults as
|
|
25
|
-
import { HtmlPropsSchema as
|
|
26
|
-
import
|
|
27
|
-
import { html as
|
|
28
|
-
import { dracula as
|
|
29
|
-
import { ImagePropsSchema as
|
|
30
|
-
import { SpacerPropsDefaults as
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import {
|
|
37
|
-
|
|
21
|
+
import { ColumnsContainerPropsSchema as Lr, ColumnsContainer as Mi } from "monto-email-block-columns-container";
|
|
22
|
+
import { ContainerPropsSchema as Ni, Container as Ri } from "monto-email-block-container";
|
|
23
|
+
import { DividerPropsDefaults as Vo, DividerPropsSchema as Wr, Divider as Pi } from "monto-email-block-divider";
|
|
24
|
+
import { HeadingPropsDefaults as Fi, HeadingPropsSchema as Hr, Heading as zi } from "monto-email-block-heading";
|
|
25
|
+
import { HtmlPropsSchema as Vr, Html as Li } from "monto-email-block-html";
|
|
26
|
+
import Wi from "@uiw/react-codemirror";
|
|
27
|
+
import { html as Hi } from "@codemirror/lang-html";
|
|
28
|
+
import { dracula as Vi } from "@uiw/codemirror-themes-all";
|
|
29
|
+
import { ImagePropsSchema as Ur, Image as Ui } from "monto-email-block-image";
|
|
30
|
+
import { SpacerPropsDefaults as $i, SpacerPropsSchema as $r, Spacer as ji } from "monto-email-block-spacer";
|
|
31
|
+
import Ki from "@mui/icons-material/ExpandMoreOutlined";
|
|
32
|
+
import qi from "@mui/icons-material/LinkOutlined";
|
|
33
|
+
import Yi from "@mui/material/ToggleButton";
|
|
34
|
+
import Xi from "@mui/icons-material/MonitorOutlined";
|
|
35
|
+
import Gi from "@mui/icons-material/PhoneIphoneOutlined";
|
|
36
|
+
import { buildBlockConfigurationDictionary as Ji, buildBlockComponent as Zi, buildBlockConfigurationSchema as Qi } from "monto-email-document-core";
|
|
37
|
+
import { Video as ea } from "monto-email-block-video";
|
|
38
|
+
import { Socials as ta } from "monto-email-block-socials";
|
|
39
|
+
import na from "@mui/icons-material/AppRegistrationOutlined";
|
|
40
|
+
import oa from "@mui/icons-material/LastPageOutlined";
|
|
41
|
+
import ra from "@mui/icons-material/FirstPageOutlined";
|
|
42
|
+
import la from "@mui/icons-material/MenuOutlined";
|
|
43
|
+
import ia from "@mui/icons-material/FileDownloadOutlined";
|
|
44
|
+
import aa from "@mui/icons-material/FileUploadOutlined";
|
|
45
|
+
import sa from "@mui/icons-material/CodeOutlined";
|
|
46
|
+
import ca from "@mui/icons-material/DataObjectOutlined";
|
|
47
|
+
import ua from "@mui/icons-material/EditOutlined";
|
|
48
|
+
import da from "@mui/icons-material/PreviewOutlined";
|
|
49
|
+
import pa from "@mui/icons-material/RedoOutlined";
|
|
50
|
+
import fa from "@mui/icons-material/UndoOutlined";
|
|
51
|
+
class jr {
|
|
38
52
|
// 最多支持回退5步
|
|
39
53
|
constructor(t) {
|
|
40
54
|
gn(this, "past", []);
|
|
@@ -106,11 +120,11 @@ class Kr {
|
|
|
106
120
|
return JSON.stringify(t) === JSON.stringify(n);
|
|
107
121
|
}
|
|
108
122
|
}
|
|
109
|
-
let
|
|
110
|
-
function
|
|
123
|
+
let ma = 0, Hn = null, so = null, co = !0, uo = !0, He = null;
|
|
124
|
+
function ga(e) {
|
|
111
125
|
e != null && e.document && (Hn = e.document), e != null && e.language && (so = e.language), (e == null ? void 0 : e.showJsonFeatures) !== void 0 && (co = e.showJsonFeatures), (e == null ? void 0 : e.showSamplesDrawerTitle) !== void 0 && (uo = e.showSamplesDrawerTitle);
|
|
112
126
|
const t = (e == null ? void 0 : e.document) ?? Hn ?? sn, n = (e == null ? void 0 : e.language) ?? so ?? Er(), r = (e == null ? void 0 : e.showJsonFeatures) ?? co, i = (e == null ? void 0 : e.showSamplesDrawerTitle) ?? uo, l = (e == null ? void 0 : e.contactAttributes) ?? [];
|
|
113
|
-
He ? He.reset(t) : He = new
|
|
127
|
+
He ? He.reset(t) : He = new jr(t), O.setState({
|
|
114
128
|
document: t,
|
|
115
129
|
language: n,
|
|
116
130
|
showJsonFeatures: r,
|
|
@@ -128,9 +142,9 @@ function ma(e) {
|
|
|
128
142
|
}
|
|
129
143
|
if (!He) {
|
|
130
144
|
const e = Hn || sn;
|
|
131
|
-
He = new
|
|
145
|
+
He = new jr(e);
|
|
132
146
|
}
|
|
133
|
-
const
|
|
147
|
+
const O = Kl((e, t) => ({
|
|
134
148
|
document: Hn || sn,
|
|
135
149
|
selectedBlockId: null,
|
|
136
150
|
textSelection: null,
|
|
@@ -155,39 +169,39 @@ const M = ql((e, t) => ({
|
|
|
155
169
|
onSamplesDrawerToggle: void 0,
|
|
156
170
|
onInspectorDrawerToggle: void 0
|
|
157
171
|
}));
|
|
158
|
-
function
|
|
159
|
-
return
|
|
172
|
+
function ha(e) {
|
|
173
|
+
return O.setState({ contactAttributes: Array.isArray(e) ? e : [] });
|
|
160
174
|
}
|
|
161
|
-
function
|
|
162
|
-
return
|
|
175
|
+
function Kr() {
|
|
176
|
+
return O((e) => e.contactAttributes);
|
|
163
177
|
}
|
|
164
178
|
function Qe() {
|
|
165
|
-
return
|
|
179
|
+
return O((e) => e.document);
|
|
166
180
|
}
|
|
167
181
|
function cn() {
|
|
168
|
-
return
|
|
182
|
+
return O((e) => e.selectedBlockId);
|
|
169
183
|
}
|
|
170
|
-
function
|
|
171
|
-
return
|
|
184
|
+
function ba() {
|
|
185
|
+
return O((e) => e.selectedScreenSize);
|
|
172
186
|
}
|
|
173
187
|
function Io() {
|
|
174
|
-
return
|
|
188
|
+
return O((e) => e.selectedMainTab);
|
|
175
189
|
}
|
|
176
190
|
function po(e) {
|
|
177
|
-
return
|
|
191
|
+
return O.setState({ selectedMainTab: e });
|
|
178
192
|
}
|
|
179
|
-
function
|
|
180
|
-
return
|
|
193
|
+
function Ca() {
|
|
194
|
+
return O((e) => e.selectedSidebarTab);
|
|
181
195
|
}
|
|
182
196
|
function ko() {
|
|
183
|
-
return
|
|
197
|
+
return O((e) => e.inspectorDrawerOpen);
|
|
184
198
|
}
|
|
185
199
|
function Do() {
|
|
186
|
-
return
|
|
200
|
+
return O((e) => e.samplesDrawerOpen);
|
|
187
201
|
}
|
|
188
202
|
function nt(e) {
|
|
189
203
|
const t = e === null ? "styles" : "block-configuration", n = {};
|
|
190
|
-
return e !== null && (n.inspectorDrawerOpen = !0),
|
|
204
|
+
return e !== null && (n.inspectorDrawerOpen = !0), O.setState({
|
|
191
205
|
selectedBlockId: e,
|
|
192
206
|
textSelection: null,
|
|
193
207
|
textCaret: null,
|
|
@@ -198,43 +212,43 @@ function nt(e) {
|
|
|
198
212
|
});
|
|
199
213
|
}
|
|
200
214
|
function yt(e) {
|
|
201
|
-
return
|
|
215
|
+
return O.setState({ textSelection: e });
|
|
202
216
|
}
|
|
203
217
|
function Bn(e) {
|
|
204
|
-
return
|
|
218
|
+
return O.setState({ textCaret: e });
|
|
205
219
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
220
|
+
function qr() {
|
|
221
|
+
return O((e) => e.textSelection);
|
|
208
222
|
}
|
|
209
|
-
function
|
|
210
|
-
return
|
|
223
|
+
function Yr() {
|
|
224
|
+
return O((e) => e.textCaret);
|
|
211
225
|
}
|
|
212
226
|
function Sn() {
|
|
213
|
-
return
|
|
227
|
+
return O.setState({ lastInlineStyleApplyAt: Date.now() });
|
|
214
228
|
}
|
|
215
229
|
function hn(e) {
|
|
216
|
-
return
|
|
230
|
+
return O.setState({ lastTextBlockContent: e });
|
|
217
231
|
}
|
|
218
232
|
function qt(e, t) {
|
|
219
|
-
|
|
233
|
+
O.setState({
|
|
220
234
|
textDomApplyRequest: {
|
|
221
235
|
blockId: e,
|
|
222
|
-
id: ++
|
|
236
|
+
id: ++ma,
|
|
223
237
|
...t
|
|
224
238
|
}
|
|
225
239
|
});
|
|
226
240
|
}
|
|
227
241
|
function Yt() {
|
|
228
|
-
return
|
|
229
|
-
}
|
|
230
|
-
function Ca() {
|
|
231
|
-
return M((e) => e.textDomApplyRequest);
|
|
242
|
+
return O.setState({ textDomApplyRequest: null });
|
|
232
243
|
}
|
|
233
244
|
function ya() {
|
|
234
|
-
return
|
|
245
|
+
return O((e) => e.textDomApplyRequest);
|
|
235
246
|
}
|
|
236
|
-
function xa(
|
|
237
|
-
return
|
|
247
|
+
function xa() {
|
|
248
|
+
return O((e) => e.lastTextBlockContent);
|
|
249
|
+
}
|
|
250
|
+
function Sa(e) {
|
|
251
|
+
return O.setState({ selectedSidebarTab: e });
|
|
238
252
|
}
|
|
239
253
|
function wn(e, t) {
|
|
240
254
|
let n;
|
|
@@ -246,7 +260,7 @@ function wn(e, t) {
|
|
|
246
260
|
t(e, n);
|
|
247
261
|
}
|
|
248
262
|
function Rt(e) {
|
|
249
|
-
He && He.reset(e),
|
|
263
|
+
He && He.reset(e), O.setState({
|
|
250
264
|
document: e,
|
|
251
265
|
selectedSidebarTab: "styles",
|
|
252
266
|
selectedBlockId: null,
|
|
@@ -254,141 +268,141 @@ function Rt(e) {
|
|
|
254
268
|
lastTextBlockContent: null,
|
|
255
269
|
textDomApplyRequest: null
|
|
256
270
|
});
|
|
257
|
-
const t =
|
|
271
|
+
const t = O.getState().onChange;
|
|
258
272
|
t && queueMicrotask(() => {
|
|
259
273
|
wn(e, t);
|
|
260
274
|
});
|
|
261
275
|
}
|
|
262
276
|
function _e(e, t) {
|
|
263
277
|
const r = {
|
|
264
|
-
...
|
|
278
|
+
...O.getState().document,
|
|
265
279
|
...e
|
|
266
280
|
};
|
|
267
281
|
if (He) {
|
|
268
282
|
const i = He.record(r);
|
|
269
|
-
|
|
283
|
+
O.setState({
|
|
270
284
|
document: i
|
|
271
285
|
});
|
|
272
|
-
const l =
|
|
286
|
+
const l = O.getState().onChange;
|
|
273
287
|
l && queueMicrotask(() => {
|
|
274
288
|
wn(i, l);
|
|
275
289
|
});
|
|
276
290
|
} else {
|
|
277
|
-
|
|
291
|
+
O.setState({
|
|
278
292
|
document: r
|
|
279
293
|
});
|
|
280
|
-
const i =
|
|
294
|
+
const i = O.getState().onChange;
|
|
281
295
|
i && queueMicrotask(() => {
|
|
282
296
|
wn(r, i);
|
|
283
297
|
});
|
|
284
298
|
}
|
|
285
299
|
}
|
|
286
|
-
function
|
|
287
|
-
return
|
|
288
|
-
}
|
|
289
|
-
function va() {
|
|
290
|
-
const e = M.getState(), t = !e.inspectorDrawerOpen;
|
|
291
|
-
M.setState({ inspectorDrawerOpen: t }), e.onInspectorDrawerToggle && e.onInspectorDrawerToggle(t);
|
|
300
|
+
function va(e) {
|
|
301
|
+
return O.setState({ onChange: e });
|
|
292
302
|
}
|
|
293
303
|
function wa() {
|
|
294
|
-
const e =
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
function Uo(e) {
|
|
298
|
-
return M.setState({ selectedScreenSize: e });
|
|
304
|
+
const e = O.getState(), t = !e.inspectorDrawerOpen;
|
|
305
|
+
O.setState({ inspectorDrawerOpen: t }), e.onInspectorDrawerToggle && e.onInspectorDrawerToggle(t);
|
|
299
306
|
}
|
|
300
|
-
function
|
|
301
|
-
|
|
307
|
+
function Ia() {
|
|
308
|
+
const e = O.getState(), t = !e.samplesDrawerOpen;
|
|
309
|
+
O.setState({ samplesDrawerOpen: t }), e.onSamplesDrawerToggle && e.onSamplesDrawerToggle(t);
|
|
302
310
|
}
|
|
303
|
-
function
|
|
304
|
-
return
|
|
311
|
+
function Uo(e) {
|
|
312
|
+
return O.setState({ selectedScreenSize: e });
|
|
305
313
|
}
|
|
306
|
-
function
|
|
307
|
-
return
|
|
314
|
+
function Xr() {
|
|
315
|
+
return O((e) => e.imageUploadHandler);
|
|
308
316
|
}
|
|
309
317
|
function ka(e) {
|
|
310
|
-
return
|
|
318
|
+
return O.setState({ imageUploadHandler: e });
|
|
311
319
|
}
|
|
312
|
-
function
|
|
313
|
-
return
|
|
320
|
+
function Gr() {
|
|
321
|
+
return O((e) => e.videoUploadHandler);
|
|
314
322
|
}
|
|
315
|
-
function
|
|
316
|
-
return
|
|
323
|
+
function Da(e) {
|
|
324
|
+
return O.setState({ videoUploadHandler: e });
|
|
317
325
|
}
|
|
318
|
-
function
|
|
319
|
-
return
|
|
326
|
+
function Ea() {
|
|
327
|
+
return O((e) => e.language);
|
|
320
328
|
}
|
|
321
|
-
function
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
329
|
+
function Aa(e) {
|
|
330
|
+
return Ar(e), O.setState({ language: e });
|
|
331
|
+
}
|
|
332
|
+
function Ta() {
|
|
333
|
+
return O((e) => e.name);
|
|
325
334
|
}
|
|
326
335
|
function _a(e) {
|
|
327
|
-
|
|
336
|
+
O.setState({ name: e });
|
|
337
|
+
const t = O.getState().onNameChange;
|
|
338
|
+
t && t(e);
|
|
328
339
|
}
|
|
329
340
|
function Ba(e) {
|
|
330
|
-
return
|
|
341
|
+
return O.setState({ onNameChange: e });
|
|
342
|
+
}
|
|
343
|
+
function Oa(e) {
|
|
344
|
+
return O.setState({ onSamplesDrawerToggle: e });
|
|
331
345
|
}
|
|
332
346
|
function Ma(e) {
|
|
333
|
-
return
|
|
347
|
+
return O.setState({ onInspectorDrawerToggle: e });
|
|
334
348
|
}
|
|
335
|
-
function
|
|
336
|
-
return
|
|
349
|
+
function Jr() {
|
|
350
|
+
return O((e) => e.showJsonFeatures);
|
|
337
351
|
}
|
|
338
|
-
function
|
|
339
|
-
return
|
|
352
|
+
function Na(e) {
|
|
353
|
+
return O.setState({ showJsonFeatures: e });
|
|
340
354
|
}
|
|
341
|
-
function
|
|
342
|
-
return
|
|
355
|
+
function Ra() {
|
|
356
|
+
return O((e) => e.showSamplesDrawerTitle);
|
|
343
357
|
}
|
|
344
|
-
function
|
|
345
|
-
return
|
|
358
|
+
function Pa(e) {
|
|
359
|
+
return O.setState({ showSamplesDrawerTitle: e });
|
|
346
360
|
}
|
|
347
|
-
function
|
|
361
|
+
function Fa() {
|
|
348
362
|
return He ? He.canUndo() : !1;
|
|
349
363
|
}
|
|
350
|
-
function
|
|
364
|
+
function za() {
|
|
351
365
|
return He ? He.canRedo() : !1;
|
|
352
366
|
}
|
|
353
|
-
function
|
|
367
|
+
function Zr() {
|
|
354
368
|
if (!He) return !1;
|
|
355
369
|
const e = He.undo();
|
|
356
370
|
if (!e) return !1;
|
|
357
|
-
|
|
371
|
+
O.setState({
|
|
358
372
|
document: e
|
|
359
373
|
});
|
|
360
|
-
const t =
|
|
374
|
+
const t = O.getState().onChange;
|
|
361
375
|
return t && queueMicrotask(() => wn(e, t)), !0;
|
|
362
376
|
}
|
|
363
|
-
function
|
|
377
|
+
function Qr() {
|
|
364
378
|
if (!He) return !1;
|
|
365
379
|
const e = He.redo();
|
|
366
380
|
if (!e) return !1;
|
|
367
|
-
|
|
381
|
+
O.setState({
|
|
368
382
|
document: e
|
|
369
383
|
});
|
|
370
|
-
const t =
|
|
384
|
+
const t = O.getState().onChange;
|
|
371
385
|
return t && queueMicrotask(() => wn(e, t)), !0;
|
|
372
386
|
}
|
|
373
|
-
function za() {
|
|
374
|
-
const e = M((t) => t.document);
|
|
375
|
-
return mt.useMemo(() => Pa(), [e]);
|
|
376
|
-
}
|
|
377
387
|
function La() {
|
|
378
|
-
const e =
|
|
388
|
+
const e = O((t) => t.document);
|
|
379
389
|
return mt.useMemo(() => Fa(), [e]);
|
|
380
390
|
}
|
|
381
|
-
|
|
382
|
-
|
|
391
|
+
function Wa() {
|
|
392
|
+
const e = O((t) => t.document);
|
|
393
|
+
return mt.useMemo(() => za(), [e]);
|
|
394
|
+
}
|
|
395
|
+
const el = ho(null);
|
|
396
|
+
function Ha({
|
|
383
397
|
value: e,
|
|
384
398
|
children: t
|
|
385
399
|
}) {
|
|
386
|
-
return /* @__PURE__ */ o(
|
|
400
|
+
return /* @__PURE__ */ o(el.Provider, { value: e, children: t });
|
|
387
401
|
}
|
|
388
|
-
function
|
|
389
|
-
return hr(
|
|
402
|
+
function Va() {
|
|
403
|
+
return hr(el);
|
|
390
404
|
}
|
|
391
|
-
const
|
|
405
|
+
const Ua = [
|
|
392
406
|
"MODERN_SANS",
|
|
393
407
|
"BOOK_SANS",
|
|
394
408
|
"ORGANIC_SANS",
|
|
@@ -399,10 +413,10 @@ const Va = [
|
|
|
399
413
|
"BOOK_SERIF",
|
|
400
414
|
"MONOSPACE"
|
|
401
415
|
];
|
|
402
|
-
function
|
|
416
|
+
function $a(e) {
|
|
403
417
|
const t = e.trim().toLowerCase();
|
|
404
418
|
if (t)
|
|
405
|
-
for (const n of
|
|
419
|
+
for (const n of Ua) {
|
|
406
420
|
const r = Tr(n);
|
|
407
421
|
if (!r) continue;
|
|
408
422
|
const i = r.split(",")[0].replace(/"/g, "").trim().toLowerCase();
|
|
@@ -426,7 +440,7 @@ function Dt(e) {
|
|
|
426
440
|
function pt(e) {
|
|
427
441
|
return Dt(e).length;
|
|
428
442
|
}
|
|
429
|
-
function
|
|
443
|
+
function ja(e, t) {
|
|
430
444
|
if (t < 0) return null;
|
|
431
445
|
let n = 0;
|
|
432
446
|
const r = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);
|
|
@@ -451,10 +465,10 @@ function fo(e, t) {
|
|
|
451
465
|
return { node: i, offset: Math.max(0, t - n) };
|
|
452
466
|
n += a;
|
|
453
467
|
}
|
|
454
|
-
const l =
|
|
468
|
+
const l = Ka(e);
|
|
455
469
|
return l && t === n ? { node: l, offset: (l.textContent ?? "").length } : null;
|
|
456
470
|
}
|
|
457
|
-
function
|
|
471
|
+
function Ka(e) {
|
|
458
472
|
const t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);
|
|
459
473
|
let n, r = null;
|
|
460
474
|
for (; n = t.nextNode(); ) r = n;
|
|
@@ -484,7 +498,7 @@ function jo(e, t, n) {
|
|
|
484
498
|
function Vn(e) {
|
|
485
499
|
return Array.from(e.children).filter((t) => t.tagName === "P");
|
|
486
500
|
}
|
|
487
|
-
function
|
|
501
|
+
function tl(e) {
|
|
488
502
|
const t = [];
|
|
489
503
|
let n = 0;
|
|
490
504
|
for (const r of Vn(e)) {
|
|
@@ -493,7 +507,7 @@ function nl(e) {
|
|
|
493
507
|
}
|
|
494
508
|
return t;
|
|
495
509
|
}
|
|
496
|
-
function
|
|
510
|
+
function qa(e) {
|
|
497
511
|
let t;
|
|
498
512
|
for (; t = e.querySelector("a"); ) {
|
|
499
513
|
const n = t.parentNode;
|
|
@@ -503,7 +517,7 @@ function Ka(e) {
|
|
|
503
517
|
n.removeChild(t);
|
|
504
518
|
}
|
|
505
519
|
}
|
|
506
|
-
function
|
|
520
|
+
function nl(e) {
|
|
507
521
|
for (; ; ) {
|
|
508
522
|
const t = Array.from(e.querySelectorAll("span")).find((r) => !r.hasAttribute("data-text-variable"));
|
|
509
523
|
if (!t) break;
|
|
@@ -514,33 +528,33 @@ function ol(e) {
|
|
|
514
528
|
n.removeChild(t);
|
|
515
529
|
}
|
|
516
530
|
}
|
|
517
|
-
function
|
|
531
|
+
function Ya(e, t, n, r) {
|
|
518
532
|
const i = Et(e, t, n);
|
|
519
533
|
if (!i || i.collapsed) return;
|
|
520
534
|
const l = i.extractContents();
|
|
521
|
-
|
|
535
|
+
nl(l);
|
|
522
536
|
const a = document.createElement("span");
|
|
523
537
|
Un(a, r), a.appendChild(l), i.insertNode(a);
|
|
524
538
|
}
|
|
525
539
|
function In(e) {
|
|
526
540
|
e.style.color || (e.style.color = "inherit");
|
|
527
541
|
}
|
|
528
|
-
function
|
|
542
|
+
function Xa(e, t, n, r, i) {
|
|
529
543
|
const l = Et(e, t, n);
|
|
530
544
|
if (!l || l.collapsed) return;
|
|
531
545
|
const a = l.extractContents();
|
|
532
|
-
|
|
546
|
+
qa(a);
|
|
533
547
|
const c = document.createElement("a");
|
|
534
548
|
c.href = r, i && (c.target = "_blank", c.rel = "noopener noreferrer"), In(c), c.style.textDecoration || (c.style.textDecoration = "underline"), c.appendChild(a), l.insertNode(c);
|
|
535
549
|
}
|
|
536
|
-
function
|
|
550
|
+
function Ga(e) {
|
|
537
551
|
return e.tagName === "SPAN" && Dn(e);
|
|
538
552
|
}
|
|
539
|
-
function
|
|
553
|
+
function Ja(e) {
|
|
540
554
|
const t = Array.from(e.children);
|
|
541
555
|
if (t.length !== 1) return;
|
|
542
556
|
const n = t[0];
|
|
543
|
-
if (!
|
|
557
|
+
if (!Ga(n)) return;
|
|
544
558
|
const r = n, i = (e.textContent ?? "").replace(/\u200B/g, ""), l = (r.textContent ?? "").replace(/\u200B/g, "");
|
|
545
559
|
if (i !== l) return;
|
|
546
560
|
const a = r.style, c = (s) => {
|
|
@@ -550,11 +564,11 @@ function Ga(e) {
|
|
|
550
564
|
};
|
|
551
565
|
c("fontSize"), c("fontFamily"), c("fontWeight"), c("fontStyle"), c("letterSpacing"), c("color"), c("backgroundColor"), c("textDecoration"), zn(r);
|
|
552
566
|
}
|
|
553
|
-
function
|
|
567
|
+
function Za(e, t, n, r, i) {
|
|
554
568
|
const l = Et(e, t, n);
|
|
555
569
|
if (!l || l.collapsed) return;
|
|
556
570
|
const a = l.extractContents();
|
|
557
|
-
|
|
571
|
+
nl(a);
|
|
558
572
|
const c = document.createDocumentFragment(), s = [], d = () => {
|
|
559
573
|
if (s.length === 0) return;
|
|
560
574
|
const u = s.filter((m) => m.nodeType !== Node.TEXT_NODE ? !0 : (m.textContent ?? "").replace(/\u200B/g, "").length > 0);
|
|
@@ -581,7 +595,7 @@ function Ja(e, t, n, r, i) {
|
|
|
581
595
|
}
|
|
582
596
|
d(), l.insertNode(c);
|
|
583
597
|
}
|
|
584
|
-
function
|
|
598
|
+
function Qa(e) {
|
|
585
599
|
const t = {};
|
|
586
600
|
for (const [n, r] of Object.entries(e))
|
|
587
601
|
if (r != null && !(typeof r == "string" && (r === "undefined" || r === "null")) && !(typeof r == "number" && Number.isNaN(r)) && n !== "lineHeight") {
|
|
@@ -593,7 +607,7 @@ function Za(e) {
|
|
|
593
607
|
}
|
|
594
608
|
return t;
|
|
595
609
|
}
|
|
596
|
-
function
|
|
610
|
+
function es(e) {
|
|
597
611
|
const t = _r(e);
|
|
598
612
|
return delete t.lineHeight, t;
|
|
599
613
|
}
|
|
@@ -624,7 +638,7 @@ function kn(e, t) {
|
|
|
624
638
|
typeof i == "number" ? n("letterSpacing", `${i}px`) : n("letterSpacing", String(i));
|
|
625
639
|
}
|
|
626
640
|
}
|
|
627
|
-
function
|
|
641
|
+
function ts(e, t, n) {
|
|
628
642
|
const r = Array.from(e.querySelectorAll("span"));
|
|
629
643
|
for (const i of r) {
|
|
630
644
|
const l = document.createRange();
|
|
@@ -635,7 +649,7 @@ function es(e, t, n) {
|
|
|
635
649
|
}
|
|
636
650
|
return null;
|
|
637
651
|
}
|
|
638
|
-
function
|
|
652
|
+
function ns(e, t, n) {
|
|
639
653
|
const r = Array.from(e.querySelectorAll("span[data-text-variable]"));
|
|
640
654
|
for (const i of r) {
|
|
641
655
|
const l = document.createRange();
|
|
@@ -664,16 +678,16 @@ function ln(e) {
|
|
|
664
678
|
const t = (e ?? "").trim().toLowerCase();
|
|
665
679
|
return t ? t.split(";").map((r) => r.trim()).filter(Boolean).sort().join(";") : "";
|
|
666
680
|
}
|
|
667
|
-
function
|
|
681
|
+
function os(e, t) {
|
|
668
682
|
return !Dn(e) || !Dn(t) ? !1 : ln(e.getAttribute("style")) === ln(t.getAttribute("style"));
|
|
669
683
|
}
|
|
670
684
|
function Ko(e) {
|
|
671
685
|
return (e.getAttribute("href") ?? "").trim();
|
|
672
686
|
}
|
|
673
|
-
function
|
|
687
|
+
function rs(e, t) {
|
|
674
688
|
return Ko(e) !== Ko(t) || (e.getAttribute("target") ?? "") !== (t.getAttribute("target") ?? "") || (e.getAttribute("rel") ?? "") !== (t.getAttribute("rel") ?? "") ? !1 : ln(e.getAttribute("style")) === ln(t.getAttribute("style"));
|
|
675
689
|
}
|
|
676
|
-
function
|
|
690
|
+
function ls(e) {
|
|
677
691
|
return Dn(e) ? ln(e.getAttribute("style")) ? (e.textContent ?? "").replace(/\u200B/g, "").length === 0 : !0 : !1;
|
|
678
692
|
}
|
|
679
693
|
function Qt(e) {
|
|
@@ -688,7 +702,7 @@ function Qt(e) {
|
|
|
688
702
|
zn(l);
|
|
689
703
|
continue;
|
|
690
704
|
}
|
|
691
|
-
|
|
705
|
+
Ja(l), In(l);
|
|
692
706
|
}
|
|
693
707
|
if (l.tagName === "SPAN") {
|
|
694
708
|
const a = l;
|
|
@@ -696,7 +710,7 @@ function Qt(e) {
|
|
|
696
710
|
n.removeChild(a);
|
|
697
711
|
continue;
|
|
698
712
|
}
|
|
699
|
-
if (
|
|
713
|
+
if (ls(a)) {
|
|
700
714
|
zn(a);
|
|
701
715
|
continue;
|
|
702
716
|
}
|
|
@@ -713,7 +727,7 @@ function Qt(e) {
|
|
|
713
727
|
}
|
|
714
728
|
for (r = 0; r < n.childNodes.length - 1; ) {
|
|
715
729
|
const i = n.childNodes[r], l = n.childNodes[r + 1];
|
|
716
|
-
if (i.nodeType === Node.ELEMENT_NODE && l.nodeType === Node.ELEMENT_NODE && i.tagName === "SPAN" && l.tagName === "SPAN" &&
|
|
730
|
+
if (i.nodeType === Node.ELEMENT_NODE && l.nodeType === Node.ELEMENT_NODE && i.tagName === "SPAN" && l.tagName === "SPAN" && os(i, l)) {
|
|
717
731
|
const a = i, c = l;
|
|
718
732
|
for (; c.firstChild; )
|
|
719
733
|
a.appendChild(c.firstChild);
|
|
@@ -724,7 +738,7 @@ function Qt(e) {
|
|
|
724
738
|
}
|
|
725
739
|
for (r = 0; r < n.childNodes.length - 1; ) {
|
|
726
740
|
const i = n.childNodes[r], l = n.childNodes[r + 1];
|
|
727
|
-
if (i.nodeType === Node.ELEMENT_NODE && l.nodeType === Node.ELEMENT_NODE && i.tagName === "A" && l.tagName === "A" &&
|
|
741
|
+
if (i.nodeType === Node.ELEMENT_NODE && l.nodeType === Node.ELEMENT_NODE && i.tagName === "A" && l.tagName === "A" && rs(i, l)) {
|
|
728
742
|
const a = i, c = l;
|
|
729
743
|
for (; c.firstChild; )
|
|
730
744
|
a.appendChild(c.firstChild);
|
|
@@ -736,23 +750,23 @@ function Qt(e) {
|
|
|
736
750
|
};
|
|
737
751
|
t(e);
|
|
738
752
|
}
|
|
739
|
-
function
|
|
753
|
+
function is(e) {
|
|
740
754
|
const t = Array.from(e.querySelectorAll("[data-text-variable]"));
|
|
741
755
|
for (const n of t)
|
|
742
756
|
n.style.removeProperty("border"), n.style.removeProperty("border-radius"), n.style.removeProperty("padding"), n.style.removeProperty("box-shadow"), n.style.removeProperty("user-select"), n.style.removeProperty("-webkit-user-select");
|
|
743
757
|
}
|
|
744
|
-
function
|
|
758
|
+
function as(e) {
|
|
745
759
|
const t = {};
|
|
746
760
|
for (const [n, r] of Object.entries(e))
|
|
747
761
|
r !== void 0 && (t[n] = r);
|
|
748
762
|
return t;
|
|
749
763
|
}
|
|
750
|
-
function
|
|
764
|
+
function ss(e, t) {
|
|
751
765
|
kn(e, t);
|
|
752
766
|
}
|
|
753
|
-
function
|
|
767
|
+
function cs(e, t, n, r) {
|
|
754
768
|
var d, u;
|
|
755
|
-
const { patch: i, global: l } = r, a =
|
|
769
|
+
const { patch: i, global: l } = r, a = as(i ?? {}), c = Object.keys(a).length > 0, s = tl(e);
|
|
756
770
|
for (const { p: g, start: f, end: m } of s) {
|
|
757
771
|
const h = Math.max(t, f), b = Math.min(n, m);
|
|
758
772
|
if (h >= b) continue;
|
|
@@ -766,17 +780,17 @@ function ss(e, t, n, r) {
|
|
|
766
780
|
}
|
|
767
781
|
} catch {
|
|
768
782
|
}
|
|
769
|
-
const y =
|
|
783
|
+
const y = ns(g, h - f, b - f);
|
|
770
784
|
if (y) {
|
|
771
785
|
c && kn(y, a), Qt(g);
|
|
772
786
|
continue;
|
|
773
787
|
}
|
|
774
|
-
const k =
|
|
788
|
+
const k = ts(g, h - f, b - f);
|
|
775
789
|
if (k) {
|
|
776
|
-
c &&
|
|
790
|
+
c && ss(k, a), Qt(g);
|
|
777
791
|
continue;
|
|
778
792
|
}
|
|
779
|
-
const D =
|
|
793
|
+
const D = bs(e, h, b), E = { ...l, ...D, ...a }, N = Qa(es(E));
|
|
780
794
|
if (Object.keys(N).length === 0) continue;
|
|
781
795
|
const W = Et(g, h - f, b - f), P = () => {
|
|
782
796
|
if (!W || W.collapsed) return !1;
|
|
@@ -788,17 +802,17 @@ function ss(e, t, n, r) {
|
|
|
788
802
|
if (!W || W.collapsed) return !1;
|
|
789
803
|
const be = W.cloneContents();
|
|
790
804
|
return !!((ce = be.querySelector) != null && ce.call(be, "a,[data-text-variable]"));
|
|
791
|
-
})() ?
|
|
805
|
+
})() ? Za(g, h - f, b - f, N, a) : P() || Ya(g, h - f, b - f, N), Qt(g);
|
|
792
806
|
}
|
|
793
807
|
}
|
|
794
|
-
function
|
|
795
|
-
const l =
|
|
808
|
+
function us(e, t, n, r, i) {
|
|
809
|
+
const l = tl(e);
|
|
796
810
|
for (const { p: a, start: c, end: s } of l) {
|
|
797
811
|
const d = Math.max(t, c), u = Math.min(n, s);
|
|
798
|
-
d >= u || (
|
|
812
|
+
d >= u || (Xa(a, d - c, u - c, r, i), Qt(a));
|
|
799
813
|
}
|
|
800
814
|
}
|
|
801
|
-
function
|
|
815
|
+
function ds(e, t) {
|
|
802
816
|
const n = pt(e);
|
|
803
817
|
if (n === 0) return null;
|
|
804
818
|
const r = fo(e, Math.min(t, n - 1));
|
|
@@ -813,19 +827,19 @@ function us(e, t) {
|
|
|
813
827
|
}
|
|
814
828
|
return null;
|
|
815
829
|
}
|
|
816
|
-
function
|
|
830
|
+
function ps(e, t, n) {
|
|
817
831
|
const i = new DOMParser().parseFromString(e, "text/html").body.firstElementChild;
|
|
818
832
|
if (!i) return null;
|
|
819
833
|
const l = pt(i);
|
|
820
834
|
if (l === 0) return null;
|
|
821
835
|
const a = Math.max(0, Math.min(t, l - 1)), c = Math.max(a + 1, Math.min(n, l));
|
|
822
836
|
for (let s = a; s < c; s++) {
|
|
823
|
-
const d =
|
|
837
|
+
const d = ds(i, s);
|
|
824
838
|
if (d) return d;
|
|
825
839
|
}
|
|
826
840
|
return null;
|
|
827
841
|
}
|
|
828
|
-
function
|
|
842
|
+
function fs(e, t, n) {
|
|
829
843
|
const i = new DOMParser().parseFromString(e, "text/html").body.firstElementChild;
|
|
830
844
|
if (!i) return {};
|
|
831
845
|
const l = pt(i);
|
|
@@ -837,14 +851,14 @@ function ps(e, t, n) {
|
|
|
837
851
|
u = g;
|
|
838
852
|
break;
|
|
839
853
|
}
|
|
840
|
-
return
|
|
854
|
+
return Mt(i, u);
|
|
841
855
|
}
|
|
842
856
|
const mo = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
843
|
-
function
|
|
857
|
+
function ms(e) {
|
|
844
858
|
const t = new DOMParser().parseFromString(e, "text/html");
|
|
845
859
|
return Array.from(t.body.querySelectorAll("[data-text-variable]"));
|
|
846
860
|
}
|
|
847
|
-
function
|
|
861
|
+
function gs(e, t, n) {
|
|
848
862
|
const i = new DOMParser().parseFromString(e, "text/html").body.firstElementChild;
|
|
849
863
|
if (!i || t >= n) return null;
|
|
850
864
|
const l = Array.from(i.querySelectorAll("[data-text-variable]"));
|
|
@@ -876,7 +890,7 @@ function Eo(e) {
|
|
|
876
890
|
}
|
|
877
891
|
return null;
|
|
878
892
|
}
|
|
879
|
-
function
|
|
893
|
+
function ol() {
|
|
880
894
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `v_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 11)}`;
|
|
881
895
|
}
|
|
882
896
|
function bn(e, t) {
|
|
@@ -885,7 +899,7 @@ function bn(e, t) {
|
|
|
885
899
|
let r = !1;
|
|
886
900
|
const i = Array.from(e.querySelectorAll("[data-text-variable]"));
|
|
887
901
|
for (const f of i)
|
|
888
|
-
(d = f.getAttribute("data-variable-instance-id")) != null && d.trim() || (f.setAttribute("data-variable-instance-id",
|
|
902
|
+
(d = f.getAttribute("data-variable-instance-id")) != null && d.trim() || (f.setAttribute("data-variable-instance-id", ol()), r = !0);
|
|
889
903
|
const l = /* @__PURE__ */ new Set();
|
|
890
904
|
for (const f of i) {
|
|
891
905
|
const m = (u = f.getAttribute("data-variable-instance-id")) == null ? void 0 : u.trim();
|
|
@@ -910,7 +924,7 @@ function bn(e, t) {
|
|
|
910
924
|
}
|
|
911
925
|
function qn(e) {
|
|
912
926
|
const t = [];
|
|
913
|
-
for (const n of
|
|
927
|
+
for (const n of ms(e)) {
|
|
914
928
|
const r = Eo(n.getAttribute("data-text-variable") ?? "");
|
|
915
929
|
if (!r) continue;
|
|
916
930
|
const i = (n.getAttribute("data-variable-instance-id") ?? "").trim();
|
|
@@ -918,7 +932,7 @@ function qn(e) {
|
|
|
918
932
|
}
|
|
919
933
|
return t;
|
|
920
934
|
}
|
|
921
|
-
function
|
|
935
|
+
function hs(e, t) {
|
|
922
936
|
if (e.color && t.color == null) {
|
|
923
937
|
const n = e.color.trim();
|
|
924
938
|
t.color = n.startsWith("#") ? n : $o(n) ?? n;
|
|
@@ -932,7 +946,7 @@ function gs(e, t) {
|
|
|
932
946
|
Number.isNaN(n) || (t.fontSize = n);
|
|
933
947
|
}
|
|
934
948
|
if (e.fontFamily && e.fontFamily !== "undefined" && t.fontFamily == null) {
|
|
935
|
-
const n =
|
|
949
|
+
const n = $a(e.fontFamily);
|
|
936
950
|
n && (t.fontFamily = n);
|
|
937
951
|
}
|
|
938
952
|
if (t.fontWeight == null) {
|
|
@@ -948,11 +962,11 @@ function gs(e, t) {
|
|
|
948
962
|
t.letterSpacing = n;
|
|
949
963
|
}
|
|
950
964
|
}
|
|
951
|
-
function
|
|
965
|
+
function bs(e, t, n) {
|
|
952
966
|
const r = pt(e);
|
|
953
967
|
if (r === 0) return {};
|
|
954
968
|
const i = (u) => Math.max(0, Math.min(u, r - 1));
|
|
955
|
-
if (n <= t) return
|
|
969
|
+
if (n <= t) return Mt(e, i(t));
|
|
956
970
|
const l = [i(t), i(Math.floor((t + n - 1) / 2)), i(n - 1)], a = [...new Set(l)], c = {};
|
|
957
971
|
let s = -1;
|
|
958
972
|
const d = [
|
|
@@ -965,7 +979,7 @@ function hs(e, t, n) {
|
|
|
965
979
|
"letterSpacing"
|
|
966
980
|
];
|
|
967
981
|
for (const u of a) {
|
|
968
|
-
const g =
|
|
982
|
+
const g = Mt(e, u);
|
|
969
983
|
typeof g.fontSize == "number" && (s = Math.max(s, g.fontSize));
|
|
970
984
|
for (const f of d) {
|
|
971
985
|
const m = g[f];
|
|
@@ -974,14 +988,14 @@ function hs(e, t, n) {
|
|
|
974
988
|
}
|
|
975
989
|
return s >= 0 && (c.fontSize = s), c;
|
|
976
990
|
}
|
|
977
|
-
function
|
|
978
|
-
const n = pt(e), r = Math.min(t, Math.max(0, n - 1)), i =
|
|
991
|
+
function Mt(e, t) {
|
|
992
|
+
const n = pt(e), r = Math.min(t, Math.max(0, n - 1)), i = ja(e, r);
|
|
979
993
|
if (!i) return {};
|
|
980
994
|
let l = i.node.nodeType === Node.TEXT_NODE ? i.node.parentElement : i.node;
|
|
981
995
|
const a = {};
|
|
982
996
|
for (; l && l !== e; ) {
|
|
983
997
|
const c = l.tagName;
|
|
984
|
-
(c === "SPAN" || c === "A") &&
|
|
998
|
+
(c === "SPAN" || c === "A") && hs(l.style, a), (c === "STRONG" || c === "B") && a.fontWeight == null && (a.fontWeight = "bold"), (c === "I" || c === "EM") && a.fontStyle == null && (a.fontStyle = "italic"), l = l.parentElement;
|
|
985
999
|
}
|
|
986
1000
|
return a;
|
|
987
1001
|
}
|
|
@@ -995,7 +1009,7 @@ function xt(e) {
|
|
|
995
1009
|
for (const t of Vn(e))
|
|
996
1010
|
t.style.margin = "0", Dt(t).length === 0 && (t.textContent = "", t.appendChild(document.createTextNode(qo)), t.appendChild(document.createElement("br")));
|
|
997
1011
|
}
|
|
998
|
-
function
|
|
1012
|
+
function rl(e) {
|
|
999
1013
|
return Dt(e).replace(/\u200B/g, "");
|
|
1000
1014
|
}
|
|
1001
1015
|
function Cn(e) {
|
|
@@ -1003,10 +1017,10 @@ function Cn(e) {
|
|
|
1003
1017
|
xt(t);
|
|
1004
1018
|
for (const n of Vn(t))
|
|
1005
1019
|
Qt(n);
|
|
1006
|
-
return
|
|
1020
|
+
return is(t), t.outerHTML;
|
|
1007
1021
|
}
|
|
1008
1022
|
const Yo = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
1009
|
-
function
|
|
1023
|
+
function ll(e) {
|
|
1010
1024
|
const t = (e.attribute ?? "").trim();
|
|
1011
1025
|
if (t && Yo.test(t)) return t;
|
|
1012
1026
|
const n = (e.variable ?? "").trim();
|
|
@@ -1035,7 +1049,7 @@ function Xo(e, t = "root") {
|
|
|
1035
1049
|
u[y] !== S && (u[y] = S, g = !0);
|
|
1036
1050
|
continue;
|
|
1037
1051
|
}
|
|
1038
|
-
const k =
|
|
1052
|
+
const k = ll({
|
|
1039
1053
|
attribute: typeof h.attribute == "string" ? h.attribute : void 0,
|
|
1040
1054
|
variable: typeof h.variable == "string" ? h.variable : void 0
|
|
1041
1055
|
});
|
|
@@ -1054,7 +1068,7 @@ function Xo(e, t = "root") {
|
|
|
1054
1068
|
}, l = /* @__PURE__ */ new Set();
|
|
1055
1069
|
return e[t] && Yn(e, t, i, l), r ? n : e;
|
|
1056
1070
|
}
|
|
1057
|
-
function
|
|
1071
|
+
function Cs(e) {
|
|
1058
1072
|
const t = e.data;
|
|
1059
1073
|
if (!t || typeof t != "object") return [];
|
|
1060
1074
|
const n = [], r = t.childrenIds;
|
|
@@ -1082,11 +1096,11 @@ function Yn(e, t, n, r) {
|
|
|
1082
1096
|
const i = e[t];
|
|
1083
1097
|
if (i) {
|
|
1084
1098
|
r.add(t), n(t, i);
|
|
1085
|
-
for (const l of
|
|
1099
|
+
for (const l of Cs(i))
|
|
1086
1100
|
Yn(e, l, n, r);
|
|
1087
1101
|
}
|
|
1088
1102
|
}
|
|
1089
|
-
function
|
|
1103
|
+
function ys(e, t = "root") {
|
|
1090
1104
|
const n = [];
|
|
1091
1105
|
let r = 0;
|
|
1092
1106
|
const i = /* @__PURE__ */ new Map(), l = (c, s) => {
|
|
@@ -1122,7 +1136,7 @@ function to(e, t, n = "root") {
|
|
|
1122
1136
|
r.set(g, u);
|
|
1123
1137
|
continue;
|
|
1124
1138
|
}
|
|
1125
|
-
const f =
|
|
1139
|
+
const f = ll(d);
|
|
1126
1140
|
f && i.set(f, u);
|
|
1127
1141
|
}
|
|
1128
1142
|
if (r.size === 0 && i.size === 0) return e;
|
|
@@ -1159,10 +1173,10 @@ function Go() {
|
|
|
1159
1173
|
if (!t || !t.contains(e)) return;
|
|
1160
1174
|
const n = t.getAttribute("data-monto-text-block-id");
|
|
1161
1175
|
if (!n) return;
|
|
1162
|
-
const r =
|
|
1176
|
+
const r = O.getState().document[n];
|
|
1163
1177
|
!r || r.type !== "Text" || t.blur();
|
|
1164
1178
|
}
|
|
1165
|
-
const
|
|
1179
|
+
const xs = "#212443", On = "#1E40AF", yn = "#1F8466", Mn = "#E81212", Xt = "#F6DC9F", Ss = "#6C0E7C", vs = "#CC996C", ws = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Is = 'ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace', B = Or({
|
|
1166
1180
|
palette: {
|
|
1167
1181
|
background: {
|
|
1168
1182
|
default: "#f2f5f7"
|
|
@@ -1173,18 +1187,18 @@ const ys = "#212443", Mn = "#1E40AF", yn = "#1F8466", On = "#E81212", Xt = "#F6D
|
|
|
1173
1187
|
}
|
|
1174
1188
|
},
|
|
1175
1189
|
typography: {
|
|
1176
|
-
fontFamily:
|
|
1190
|
+
fontFamily: ws
|
|
1177
1191
|
}
|
|
1178
|
-
}),
|
|
1192
|
+
}), ks = Or(B, {
|
|
1179
1193
|
palette: {
|
|
1180
1194
|
brand: {
|
|
1181
|
-
navy:
|
|
1182
|
-
blue:
|
|
1183
|
-
red:
|
|
1195
|
+
navy: xs,
|
|
1196
|
+
blue: On,
|
|
1197
|
+
red: Mn,
|
|
1184
1198
|
green: yn,
|
|
1185
1199
|
yellow: Xt,
|
|
1186
|
-
purple:
|
|
1187
|
-
brown:
|
|
1200
|
+
purple: Ss,
|
|
1201
|
+
brown: vs
|
|
1188
1202
|
},
|
|
1189
1203
|
success: {
|
|
1190
1204
|
main: yn,
|
|
@@ -1192,9 +1206,9 @@ const ys = "#212443", Mn = "#1E40AF", yn = "#1F8466", On = "#E81212", Xt = "#F6D
|
|
|
1192
1206
|
dark: Ho(yn, 0.15)
|
|
1193
1207
|
},
|
|
1194
1208
|
error: {
|
|
1195
|
-
main:
|
|
1196
|
-
light: jt(
|
|
1197
|
-
dark: Ho(
|
|
1209
|
+
main: Mn,
|
|
1210
|
+
light: jt(Mn, 0.15),
|
|
1211
|
+
dark: Ho(Mn, 0.15)
|
|
1198
1212
|
},
|
|
1199
1213
|
cadet: {
|
|
1200
1214
|
100: "#F9FAFB",
|
|
@@ -1211,10 +1225,10 @@ const ys = "#212443", Mn = "#1E40AF", yn = "#1F8466", On = "#E81212", Xt = "#F6D
|
|
|
1211
1225
|
500: Xt
|
|
1212
1226
|
},
|
|
1213
1227
|
info: {
|
|
1214
|
-
main:
|
|
1228
|
+
main: On
|
|
1215
1229
|
},
|
|
1216
1230
|
primary: {
|
|
1217
|
-
main:
|
|
1231
|
+
main: On
|
|
1218
1232
|
}
|
|
1219
1233
|
},
|
|
1220
1234
|
components: {
|
|
@@ -1228,7 +1242,7 @@ const ys = "#212443", Mn = "#1E40AF", yn = "#1F8466", On = "#E81212", Xt = "#F6D
|
|
|
1228
1242
|
padding: 0;
|
|
1229
1243
|
}
|
|
1230
1244
|
pre {
|
|
1231
|
-
font-family: ${
|
|
1245
|
+
font-family: ${Is}
|
|
1232
1246
|
white-space: pre-wrap;
|
|
1233
1247
|
font-size: 12px;
|
|
1234
1248
|
}
|
|
@@ -1391,7 +1405,7 @@ const ys = "#212443", Mn = "#1E40AF", yn = "#1F8466", On = "#E81212", Xt = "#F6D
|
|
|
1391
1405
|
width: 16,
|
|
1392
1406
|
cursor: "col-resize",
|
|
1393
1407
|
"&:hover, &.Mui-active, &.Mui-focusVisible": {
|
|
1394
|
-
boxShadow: `0 0 0 4px ${eo(
|
|
1408
|
+
boxShadow: `0 0 0 4px ${eo(On, 0.2)}`
|
|
1395
1409
|
},
|
|
1396
1410
|
"&:before": {
|
|
1397
1411
|
display: "none"
|
|
@@ -1676,8 +1690,8 @@ const ys = "#212443", Mn = "#1E40AF", yn = "#1F8466", On = "#E81212", Xt = "#F6D
|
|
|
1676
1690
|
]
|
|
1677
1691
|
});
|
|
1678
1692
|
function Se() {
|
|
1679
|
-
const e =
|
|
1680
|
-
return { t: (n, r) =>
|
|
1693
|
+
const e = Ea();
|
|
1694
|
+
return { t: (n, r) => ql(n, r, e), language: e };
|
|
1681
1695
|
}
|
|
1682
1696
|
function it({ title: e, children: t }) {
|
|
1683
1697
|
return /* @__PURE__ */ w(se, { p: 2, sx: { width: "100%", maxWidth: "100%", boxSizing: "border-box" }, children: [
|
|
@@ -1685,17 +1699,17 @@ function it({ title: e, children: t }) {
|
|
|
1685
1699
|
/* @__PURE__ */ o(Z, { spacing: 3, mb: 3, sx: { width: "100%", maxWidth: "100%" }, children: t })
|
|
1686
1700
|
] });
|
|
1687
1701
|
}
|
|
1688
|
-
const
|
|
1702
|
+
const Ds = {
|
|
1689
1703
|
width: 24,
|
|
1690
1704
|
height: 24
|
|
1691
1705
|
};
|
|
1692
|
-
function
|
|
1706
|
+
function Es({ paletteColors: e, value: t, onChange: n }) {
|
|
1693
1707
|
const r = (i) => /* @__PURE__ */ o(
|
|
1694
|
-
|
|
1708
|
+
Oe,
|
|
1695
1709
|
{
|
|
1696
1710
|
onClick: () => n(i),
|
|
1697
1711
|
sx: {
|
|
1698
|
-
...
|
|
1712
|
+
...Ds,
|
|
1699
1713
|
backgroundColor: i,
|
|
1700
1714
|
border: "1px solid",
|
|
1701
1715
|
borderColor: t === i ? "black" : "grey.200",
|
|
@@ -1711,7 +1725,7 @@ function Ds({ paletteColors: e, value: t, onChange: n }) {
|
|
|
1711
1725
|
);
|
|
1712
1726
|
return /* @__PURE__ */ o(se, { width: "100%", sx: { display: "grid", gap: 1, gridTemplateColumns: "1fr 1fr 1fr 1fr 1fr 1fr" }, children: e.map((i) => r(i)) });
|
|
1713
1727
|
}
|
|
1714
|
-
const
|
|
1728
|
+
const As = [
|
|
1715
1729
|
"#E11D48",
|
|
1716
1730
|
"#DB2777",
|
|
1717
1731
|
"#C026D3",
|
|
@@ -1742,7 +1756,7 @@ const Es = [
|
|
|
1742
1756
|
"#171717",
|
|
1743
1757
|
"#0A0A0A",
|
|
1744
1758
|
"#000000"
|
|
1745
|
-
],
|
|
1759
|
+
], Ts = {
|
|
1746
1760
|
p: 1,
|
|
1747
1761
|
".react-colorful__pointer ": {
|
|
1748
1762
|
width: 16,
|
|
@@ -1772,11 +1786,11 @@ const Es = [
|
|
|
1772
1786
|
width: "100%"
|
|
1773
1787
|
}
|
|
1774
1788
|
};
|
|
1775
|
-
function
|
|
1776
|
-
return /* @__PURE__ */ w(Z, { spacing: 1, sx:
|
|
1777
|
-
/* @__PURE__ */ o(
|
|
1778
|
-
/* @__PURE__ */ o(
|
|
1779
|
-
/* @__PURE__ */ o(se, { pt: 1, children: /* @__PURE__ */ o(
|
|
1789
|
+
function _s({ value: e, onChange: t }) {
|
|
1790
|
+
return /* @__PURE__ */ w(Z, { spacing: 1, sx: Ts, children: [
|
|
1791
|
+
/* @__PURE__ */ o(Ei, { color: e, onChange: t }),
|
|
1792
|
+
/* @__PURE__ */ o(Es, { paletteColors: As, value: e, onChange: t }),
|
|
1793
|
+
/* @__PURE__ */ o(se, { pt: 1, children: /* @__PURE__ */ o(Ai, { prefixed: !0, color: e, onChange: t }) })
|
|
1780
1794
|
] });
|
|
1781
1795
|
}
|
|
1782
1796
|
const Jo = 24, Zo = {
|
|
@@ -1799,7 +1813,7 @@ const Jo = 24, Zo = {
|
|
|
1799
1813
|
minHeight: 40,
|
|
1800
1814
|
cursor: "pointer"
|
|
1801
1815
|
};
|
|
1802
|
-
function
|
|
1816
|
+
function il({ label: e, defaultValue: t, onChange: n, nullable: r }) {
|
|
1803
1817
|
const [i, l] = z(null), [a, c] = z(t);
|
|
1804
1818
|
Ce(() => {
|
|
1805
1819
|
c(t);
|
|
@@ -1834,7 +1848,7 @@ function al({ label: e, defaultValue: t, onChange: n, nullable: r }) {
|
|
|
1834
1848
|
sx: { height: "auto", padding: 0 }
|
|
1835
1849
|
},
|
|
1836
1850
|
children: /* @__PURE__ */ o(
|
|
1837
|
-
|
|
1851
|
+
_s,
|
|
1838
1852
|
{
|
|
1839
1853
|
value: a || "",
|
|
1840
1854
|
onChange: (g) => {
|
|
@@ -1847,10 +1861,10 @@ function al({ label: e, defaultValue: t, onChange: n, nullable: r }) {
|
|
|
1847
1861
|
] });
|
|
1848
1862
|
}
|
|
1849
1863
|
function nn(e) {
|
|
1850
|
-
return /* @__PURE__ */ o(
|
|
1864
|
+
return /* @__PURE__ */ o(il, { ...e, nullable: !1 });
|
|
1851
1865
|
}
|
|
1852
1866
|
function Ln(e) {
|
|
1853
|
-
return /* @__PURE__ */ o(
|
|
1867
|
+
return /* @__PURE__ */ o(il, { ...e, nullable: !0 });
|
|
1854
1868
|
}
|
|
1855
1869
|
function ft({ label: e, children: t, defaultValue: n, onChange: r }) {
|
|
1856
1870
|
const [i, l] = z(n);
|
|
@@ -1896,15 +1910,15 @@ function Pt({ helperText: e, label: t, placeholder: n, rows: r, InputProps: i, d
|
|
|
1896
1910
|
}
|
|
1897
1911
|
);
|
|
1898
1912
|
}
|
|
1899
|
-
function
|
|
1913
|
+
function Bs(e) {
|
|
1900
1914
|
return typeof e == "string" && e.includes("underline");
|
|
1901
1915
|
}
|
|
1902
|
-
function
|
|
1916
|
+
function Os(e) {
|
|
1903
1917
|
return typeof e == "string" && e.includes("line-through");
|
|
1904
1918
|
}
|
|
1905
1919
|
function Ms({ value: e, onChange: t }) {
|
|
1906
1920
|
const n = (e == null ? void 0 : e.fontWeight) ?? "normal", r = (e == null ? void 0 : e.fontStyle) ?? "normal", i = (e == null ? void 0 : e.textDecoration) ?? "none", l = [];
|
|
1907
|
-
return n === "bold" && l.push("bold"), r === "italic" && l.push("italic"),
|
|
1921
|
+
return n === "bold" && l.push("bold"), r === "italic" && l.push("italic"), Bs(i) && l.push("underline"), Os(i) && l.push("strikethrough"), /* @__PURE__ */ o(Z, { alignItems: "flex-start", children: /* @__PURE__ */ w(
|
|
1908
1922
|
bo,
|
|
1909
1923
|
{
|
|
1910
1924
|
size: "small",
|
|
@@ -1919,15 +1933,15 @@ function Ms({ value: e, onChange: t }) {
|
|
|
1919
1933
|
},
|
|
1920
1934
|
sx: { flexWrap: "nowrap" },
|
|
1921
1935
|
children: [
|
|
1922
|
-
/* @__PURE__ */ o(le, { value: "bold", "aria-label": "bold", children: /* @__PURE__ */ o(
|
|
1923
|
-
/* @__PURE__ */ o(le, { value: "italic", "aria-label": "italic", children: /* @__PURE__ */ o(
|
|
1924
|
-
/* @__PURE__ */ o(le, { value: "underline", "aria-label": "underline", children: /* @__PURE__ */ o(
|
|
1925
|
-
/* @__PURE__ */ o(le, { value: "strikethrough", "aria-label": "strikethrough", children: /* @__PURE__ */ o(
|
|
1936
|
+
/* @__PURE__ */ o(le, { value: "bold", "aria-label": "bold", children: /* @__PURE__ */ o(Ti, { fontSize: "small" }) }),
|
|
1937
|
+
/* @__PURE__ */ o(le, { value: "italic", "aria-label": "italic", children: /* @__PURE__ */ o(_i, { fontSize: "small" }) }),
|
|
1938
|
+
/* @__PURE__ */ o(le, { value: "underline", "aria-label": "underline", children: /* @__PURE__ */ o(Bi, { fontSize: "small" }) }),
|
|
1939
|
+
/* @__PURE__ */ o(le, { value: "strikethrough", "aria-label": "strikethrough", children: /* @__PURE__ */ o(Oi, { fontSize: "small" }) })
|
|
1926
1940
|
]
|
|
1927
1941
|
}
|
|
1928
1942
|
) });
|
|
1929
1943
|
}
|
|
1930
|
-
const
|
|
1944
|
+
const Ns = [
|
|
1931
1945
|
{
|
|
1932
1946
|
key: "MODERN_SANS",
|
|
1933
1947
|
label: "Modern sans",
|
|
@@ -1973,8 +1987,8 @@ const Os = [
|
|
|
1973
1987
|
label: "Monospace",
|
|
1974
1988
|
value: "monospace"
|
|
1975
1989
|
}
|
|
1976
|
-
],
|
|
1977
|
-
function
|
|
1990
|
+
], Rs = Ns.map((e) => /* @__PURE__ */ o(on, { value: e.key, sx: { fontFamily: e.value }, children: e.label }, e.key));
|
|
1991
|
+
function al({ label: e, onChange: t, defaultValue: n }) {
|
|
1978
1992
|
const [r, i] = z(n ?? "inherit");
|
|
1979
1993
|
return /* @__PURE__ */ w(
|
|
1980
1994
|
dt,
|
|
@@ -1989,7 +2003,7 @@ function sl({ label: e, onChange: t, defaultValue: n }) {
|
|
|
1989
2003
|
},
|
|
1990
2004
|
children: [
|
|
1991
2005
|
/* @__PURE__ */ o(on, { value: "inherit", children: "Match email settings" }),
|
|
1992
|
-
|
|
2006
|
+
Rs
|
|
1993
2007
|
]
|
|
1994
2008
|
}
|
|
1995
2009
|
);
|
|
@@ -1998,7 +2012,7 @@ function Vt({ iconLabel: e, value: t, setValue: n, units: r, ...i }) {
|
|
|
1998
2012
|
return /* @__PURE__ */ w(Z, { direction: "row", alignItems: "center", spacing: 2, justifyContent: "space-between", width: "100%", children: [
|
|
1999
2013
|
/* @__PURE__ */ o(se, { sx: { minWidth: 24, lineHeight: 1, flexShrink: 0 }, children: e }),
|
|
2000
2014
|
/* @__PURE__ */ o(
|
|
2001
|
-
|
|
2015
|
+
Nl,
|
|
2002
2016
|
{
|
|
2003
2017
|
...i,
|
|
2004
2018
|
value: t,
|
|
@@ -2015,7 +2029,7 @@ function Vt({ iconLabel: e, value: t, setValue: n, units: r, ...i }) {
|
|
|
2015
2029
|
] }) })
|
|
2016
2030
|
] });
|
|
2017
2031
|
}
|
|
2018
|
-
function
|
|
2032
|
+
function Ps({ label: e, defaultValue: t, onChange: n }) {
|
|
2019
2033
|
const r = t ?? 14, [i, l] = z(r);
|
|
2020
2034
|
return Ce(() => {
|
|
2021
2035
|
l(t ?? 14);
|
|
@@ -2024,7 +2038,7 @@ function Rs({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2024
2038
|
/* @__PURE__ */ o(
|
|
2025
2039
|
Vt,
|
|
2026
2040
|
{
|
|
2027
|
-
iconLabel: /* @__PURE__ */ o(
|
|
2041
|
+
iconLabel: /* @__PURE__ */ o(Gl, { sx: { fontSize: 16 } }),
|
|
2028
2042
|
value: i,
|
|
2029
2043
|
setValue: (c) => {
|
|
2030
2044
|
l(c), n(c);
|
|
@@ -2037,7 +2051,7 @@ function Rs({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2037
2051
|
)
|
|
2038
2052
|
] });
|
|
2039
2053
|
}
|
|
2040
|
-
function
|
|
2054
|
+
function Fs({ label: e, defaultValue: t, onChange: n }) {
|
|
2041
2055
|
const { t: r } = Se(), i = t || "normal", [l, a] = z(i);
|
|
2042
2056
|
return Ce(() => {
|
|
2043
2057
|
a(i);
|
|
@@ -2056,7 +2070,7 @@ function Ps({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2056
2070
|
}
|
|
2057
2071
|
);
|
|
2058
2072
|
}
|
|
2059
|
-
function
|
|
2073
|
+
function zs({ label: e, defaultValue: t, onChange: n }) {
|
|
2060
2074
|
const { t: r } = Se(), i = t ?? "normal", [l, a] = z(i);
|
|
2061
2075
|
return Ce(() => {
|
|
2062
2076
|
a(i);
|
|
@@ -2075,13 +2089,13 @@ function Fs({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2075
2089
|
}
|
|
2076
2090
|
);
|
|
2077
2091
|
}
|
|
2078
|
-
const
|
|
2092
|
+
const sl = -5, cl = 50, er = 0;
|
|
2079
2093
|
function tr(e) {
|
|
2080
2094
|
if (e == null) return er;
|
|
2081
2095
|
const t = typeof e == "number" ? e : parseFloat(String(e));
|
|
2082
|
-
return Number.isFinite(t) ? Math.max(
|
|
2096
|
+
return Number.isFinite(t) ? Math.max(sl, Math.min(cl, t)) : er;
|
|
2083
2097
|
}
|
|
2084
|
-
function
|
|
2098
|
+
function Ls({ label: e, defaultValue: t, onChange: n }) {
|
|
2085
2099
|
const r = tr(t), [i, l] = z(r);
|
|
2086
2100
|
return Ce(() => {
|
|
2087
2101
|
l(tr(t));
|
|
@@ -2090,21 +2104,21 @@ function zs({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2090
2104
|
/* @__PURE__ */ o(
|
|
2091
2105
|
Vt,
|
|
2092
2106
|
{
|
|
2093
|
-
iconLabel: /* @__PURE__ */ o(
|
|
2107
|
+
iconLabel: /* @__PURE__ */ o(Jl, { sx: { fontSize: 16 } }),
|
|
2094
2108
|
value: i,
|
|
2095
2109
|
setValue: (c) => {
|
|
2096
2110
|
l(c), n(c);
|
|
2097
2111
|
},
|
|
2098
2112
|
units: "px",
|
|
2099
2113
|
step: 1,
|
|
2100
|
-
min:
|
|
2101
|
-
max:
|
|
2114
|
+
min: sl,
|
|
2115
|
+
max: cl
|
|
2102
2116
|
}
|
|
2103
2117
|
)
|
|
2104
2118
|
] });
|
|
2105
2119
|
}
|
|
2106
|
-
const
|
|
2107
|
-
function
|
|
2120
|
+
const Ws = [1, 1.5, 2, 2.5, 3], nr = 1.5;
|
|
2121
|
+
function Hs({ label: e, defaultValue: t, onChange: n }) {
|
|
2108
2122
|
const [r, i] = z(t ?? nr);
|
|
2109
2123
|
return Ce(() => {
|
|
2110
2124
|
i(t ?? nr);
|
|
@@ -2120,11 +2134,11 @@ function Ws({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2120
2134
|
const a = Number(l.target.value);
|
|
2121
2135
|
i(a), n(a);
|
|
2122
2136
|
},
|
|
2123
|
-
children:
|
|
2137
|
+
children: Ws.map((l) => /* @__PURE__ */ o(on, { value: l, children: l }, l))
|
|
2124
2138
|
}
|
|
2125
2139
|
);
|
|
2126
2140
|
}
|
|
2127
|
-
function
|
|
2141
|
+
function Vs({ label: e, defaultValue: t, onChange: n }) {
|
|
2128
2142
|
const [r, i] = z(() => t || {
|
|
2129
2143
|
top: 0,
|
|
2130
2144
|
left: 0,
|
|
@@ -2143,7 +2157,7 @@ function Hs({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2143
2157
|
/* @__PURE__ */ o(
|
|
2144
2158
|
Vt,
|
|
2145
2159
|
{
|
|
2146
|
-
iconLabel: /* @__PURE__ */ o(
|
|
2160
|
+
iconLabel: /* @__PURE__ */ o(Zl, { sx: { fontSize: 16 } }),
|
|
2147
2161
|
value: r.top,
|
|
2148
2162
|
setValue: (a) => l("top", a),
|
|
2149
2163
|
units: "px",
|
|
@@ -2156,7 +2170,7 @@ function Hs({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2156
2170
|
/* @__PURE__ */ o(
|
|
2157
2171
|
Vt,
|
|
2158
2172
|
{
|
|
2159
|
-
iconLabel: /* @__PURE__ */ o(
|
|
2173
|
+
iconLabel: /* @__PURE__ */ o(Ql, { sx: { fontSize: 16 } }),
|
|
2160
2174
|
value: r.bottom,
|
|
2161
2175
|
setValue: (a) => l("bottom", a),
|
|
2162
2176
|
units: "px",
|
|
@@ -2169,7 +2183,7 @@ function Hs({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2169
2183
|
/* @__PURE__ */ o(
|
|
2170
2184
|
Vt,
|
|
2171
2185
|
{
|
|
2172
|
-
iconLabel: /* @__PURE__ */ o(
|
|
2186
|
+
iconLabel: /* @__PURE__ */ o(ei, { sx: { fontSize: 16 } }),
|
|
2173
2187
|
value: r.left,
|
|
2174
2188
|
setValue: (a) => l("left", a),
|
|
2175
2189
|
units: "px",
|
|
@@ -2182,7 +2196,7 @@ function Hs({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2182
2196
|
/* @__PURE__ */ o(
|
|
2183
2197
|
Vt,
|
|
2184
2198
|
{
|
|
2185
|
-
iconLabel: /* @__PURE__ */ o(
|
|
2199
|
+
iconLabel: /* @__PURE__ */ o(ti, { sx: { fontSize: 16 } }),
|
|
2186
2200
|
value: r.right,
|
|
2187
2201
|
setValue: (a) => l("right", a),
|
|
2188
2202
|
units: "px",
|
|
@@ -2210,7 +2224,7 @@ function un({ label: e, defaultValue: t, onChange: n, ...r }) {
|
|
|
2210
2224
|
)
|
|
2211
2225
|
] });
|
|
2212
2226
|
}
|
|
2213
|
-
function
|
|
2227
|
+
function Us({ label: e, defaultValue: t, onChange: n }) {
|
|
2214
2228
|
const [r, i] = z(t ?? "left");
|
|
2215
2229
|
return /* @__PURE__ */ w(
|
|
2216
2230
|
ft,
|
|
@@ -2221,14 +2235,14 @@ function Vs({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2221
2235
|
i(l), n(l);
|
|
2222
2236
|
},
|
|
2223
2237
|
children: [
|
|
2224
|
-
/* @__PURE__ */ o(le, { value: "left", children: /* @__PURE__ */ o(
|
|
2225
|
-
/* @__PURE__ */ o(le, { value: "center", children: /* @__PURE__ */ o(
|
|
2226
|
-
/* @__PURE__ */ o(le, { value: "right", children: /* @__PURE__ */ o(
|
|
2238
|
+
/* @__PURE__ */ o(le, { value: "left", children: /* @__PURE__ */ o(ni, { fontSize: "small" }) }),
|
|
2239
|
+
/* @__PURE__ */ o(le, { value: "center", children: /* @__PURE__ */ o(oi, { fontSize: "small" }) }),
|
|
2240
|
+
/* @__PURE__ */ o(le, { value: "right", children: /* @__PURE__ */ o(ri, { fontSize: "small" }) })
|
|
2227
2241
|
]
|
|
2228
2242
|
}
|
|
2229
2243
|
);
|
|
2230
2244
|
}
|
|
2231
|
-
function
|
|
2245
|
+
function $s({ label: e, defaultValue: t, onChange: n }) {
|
|
2232
2246
|
const { t: r } = Se(), i = t || "none", [l, a] = z(i);
|
|
2233
2247
|
return Ce(() => {
|
|
2234
2248
|
a(i);
|
|
@@ -2261,7 +2275,7 @@ function or({ name: e, value: t, onChange: n }) {
|
|
|
2261
2275
|
return /* @__PURE__ */ o(
|
|
2262
2276
|
un,
|
|
2263
2277
|
{
|
|
2264
|
-
iconLabel: /* @__PURE__ */ o(
|
|
2278
|
+
iconLabel: /* @__PURE__ */ o(li, {}),
|
|
2265
2279
|
units: "px",
|
|
2266
2280
|
step: 4,
|
|
2267
2281
|
marks: !0,
|
|
@@ -2275,32 +2289,32 @@ function or({ name: e, value: t, onChange: n }) {
|
|
|
2275
2289
|
case "color":
|
|
2276
2290
|
return /* @__PURE__ */ o(Ln, { label: r("style.textColor"), defaultValue: i, onChange: l });
|
|
2277
2291
|
case "fontFamily":
|
|
2278
|
-
return /* @__PURE__ */ o(
|
|
2292
|
+
return /* @__PURE__ */ o(al, { label: r("style.fontFamily"), defaultValue: i, onChange: l });
|
|
2279
2293
|
case "fontSize":
|
|
2280
|
-
return /* @__PURE__ */ o(
|
|
2294
|
+
return /* @__PURE__ */ o(Ps, { label: r("style.fontSize"), defaultValue: i, onChange: l });
|
|
2281
2295
|
case "fontWeight":
|
|
2282
|
-
return /* @__PURE__ */ o(
|
|
2296
|
+
return /* @__PURE__ */ o(zs, { label: r("style.fontWeight"), defaultValue: i, onChange: l });
|
|
2283
2297
|
case "fontStyle":
|
|
2284
|
-
return /* @__PURE__ */ o(
|
|
2298
|
+
return /* @__PURE__ */ o(Fs, { label: r("style.fontStyle"), defaultValue: i, onChange: l });
|
|
2285
2299
|
case "textDecoration":
|
|
2286
|
-
return /* @__PURE__ */ o(
|
|
2300
|
+
return /* @__PURE__ */ o($s, { label: r("style.textDecoration"), defaultValue: i, onChange: l });
|
|
2287
2301
|
case "lineHeight":
|
|
2288
|
-
return /* @__PURE__ */ o(
|
|
2302
|
+
return /* @__PURE__ */ o(Hs, { label: r("style.lineHeight"), defaultValue: i, onChange: l });
|
|
2289
2303
|
case "letterSpacing":
|
|
2290
|
-
return /* @__PURE__ */ o(
|
|
2304
|
+
return /* @__PURE__ */ o(Ls, { label: r("style.letterSpacing"), defaultValue: i, onChange: l });
|
|
2291
2305
|
case "textAlign":
|
|
2292
|
-
return /* @__PURE__ */ o(
|
|
2306
|
+
return /* @__PURE__ */ o(Us, { label: r("style.alignment"), defaultValue: i, onChange: l });
|
|
2293
2307
|
case "padding":
|
|
2294
|
-
return /* @__PURE__ */ o(
|
|
2308
|
+
return /* @__PURE__ */ o(Vs, { label: r("style.padding"), defaultValue: i, onChange: l });
|
|
2295
2309
|
}
|
|
2296
2310
|
}
|
|
2297
|
-
const
|
|
2298
|
-
function
|
|
2299
|
-
return
|
|
2311
|
+
const ul = ["fontWeight", "fontStyle", "textDecoration"];
|
|
2312
|
+
function js(e) {
|
|
2313
|
+
return ul.every((t) => e.includes(t));
|
|
2300
2314
|
}
|
|
2301
2315
|
function gt({ names: e, value: t, onChange: n }) {
|
|
2302
|
-
const { t: r } = Se(), i =
|
|
2303
|
-
return /* @__PURE__ */ o(an, { children: e.map((l) =>
|
|
2316
|
+
const { t: r } = Se(), i = js(e);
|
|
2317
|
+
return /* @__PURE__ */ o(an, { children: e.map((l) => ul.includes(l) ? null : l === "letterSpacing" && i ? /* @__PURE__ */ w(mt.Fragment, { children: [
|
|
2304
2318
|
/* @__PURE__ */ o(or, { name: "letterSpacing", value: t || {}, onChange: n }),
|
|
2305
2319
|
/* @__PURE__ */ w(Z, { alignItems: "flex-start", sx: { mt: 1 }, children: [
|
|
2306
2320
|
/* @__PURE__ */ o(At, { shrink: !0, children: r("style.formatGroup") }),
|
|
@@ -2308,10 +2322,10 @@ function gt({ names: e, value: t, onChange: n }) {
|
|
|
2308
2322
|
] })
|
|
2309
2323
|
] }, "letterSpacing-and-format") : /* @__PURE__ */ o(or, { name: l, value: t || {}, onChange: n }, l)) });
|
|
2310
2324
|
}
|
|
2311
|
-
function
|
|
2325
|
+
function Ks({ data: e, setData: t }) {
|
|
2312
2326
|
var g, f, m, h, b, S;
|
|
2313
2327
|
const { t: n } = Se(), [, r] = z(null), i = (y) => {
|
|
2314
|
-
const k =
|
|
2328
|
+
const k = Mr.safeParse(y);
|
|
2315
2329
|
k.success ? (t(k.data), r(null)) : r(k.error);
|
|
2316
2330
|
}, l = ((g = e.props) == null ? void 0 : g.url) ?? Kt.url, a = ((f = e.props) == null ? void 0 : f.fullWidth) ?? Kt.fullWidth, c = ((m = e.props) == null ? void 0 : m.size) ?? Kt.size, s = ((h = e.props) == null ? void 0 : h.buttonStyle) ?? Kt.buttonStyle, d = ((b = e.props) == null ? void 0 : b.buttonTextColor) ?? Kt.buttonTextColor, u = ((S = e.props) == null ? void 0 : S.buttonBackgroundColor) ?? Kt.buttonBackgroundColor;
|
|
2317
2331
|
return /* @__PURE__ */ w(it, { title: n("button.title"), children: [
|
|
@@ -2388,10 +2402,10 @@ function js({ data: e, setData: t }) {
|
|
|
2388
2402
|
)
|
|
2389
2403
|
] });
|
|
2390
2404
|
}
|
|
2391
|
-
const
|
|
2392
|
-
style:
|
|
2405
|
+
const qs = Lr.shape.props.unwrap().unwrap().shape, Xn = J.object({
|
|
2406
|
+
style: Lr.shape.style,
|
|
2393
2407
|
props: J.object({
|
|
2394
|
-
...
|
|
2408
|
+
...qs,
|
|
2395
2409
|
columnsCount: J.number().min(1).max(4).optional().nullable(),
|
|
2396
2410
|
columns: J.array(J.object({ childrenIds: J.array(J.string()) })).min(1).max(4),
|
|
2397
2411
|
fixedWidths: J.tuple([
|
|
@@ -2402,7 +2416,7 @@ const Ks = Wr.shape.props.unwrap().unwrap().shape, Xn = J.object({
|
|
|
2402
2416
|
]).optional().nullable()
|
|
2403
2417
|
}).optional().nullable()
|
|
2404
2418
|
});
|
|
2405
|
-
function
|
|
2419
|
+
function Ys({ data: e, setData: t }) {
|
|
2406
2420
|
var P, he, be, ce, _;
|
|
2407
2421
|
const { t: n } = Se(), r = Qe(), i = cn(), [, l] = z(null), a = (x) => {
|
|
2408
2422
|
const T = Xn.safeParse(x);
|
|
@@ -2609,7 +2623,7 @@ function qs({ data: e, setData: t }) {
|
|
|
2609
2623
|
un,
|
|
2610
2624
|
{
|
|
2611
2625
|
label: n("columns.gap"),
|
|
2612
|
-
iconLabel: /* @__PURE__ */ o(
|
|
2626
|
+
iconLabel: /* @__PURE__ */ o(ii, { sx: { color: "text.secondary" } }),
|
|
2613
2627
|
units: "px",
|
|
2614
2628
|
step: 4,
|
|
2615
2629
|
marks: !0,
|
|
@@ -2631,7 +2645,7 @@ function qs({ data: e, setData: t }) {
|
|
|
2631
2645
|
/* @__PURE__ */ o(le, { value: "top", title: n("columns.alignmentTop"), children: /* @__PURE__ */ o(So, { fontSize: "small" }) }),
|
|
2632
2646
|
/* @__PURE__ */ o(le, { value: "middle", title: n("columns.alignmentMiddle"), children: /* @__PURE__ */ o(vo, { fontSize: "small" }) }),
|
|
2633
2647
|
/* @__PURE__ */ o(le, { value: "bottom", title: n("columns.alignmentBottom"), children: /* @__PURE__ */ o(wo, { fontSize: "small" }) }),
|
|
2634
|
-
/* @__PURE__ */ o(le, { value: "stretch", title: n("columns.alignmentStretch"), children: /* @__PURE__ */ o(
|
|
2648
|
+
/* @__PURE__ */ o(le, { value: "stretch", title: n("columns.alignmentStretch"), children: /* @__PURE__ */ o(ai, { fontSize: "small" }) })
|
|
2635
2649
|
]
|
|
2636
2650
|
}
|
|
2637
2651
|
),
|
|
@@ -2647,21 +2661,21 @@ function qs({ data: e, setData: t }) {
|
|
|
2647
2661
|
/* @__PURE__ */ o(yr, { children: n("columns.confirmChangeTitle") }),
|
|
2648
2662
|
/* @__PURE__ */ o(xr, { children: /* @__PURE__ */ o(ke, { children: n("columns.confirmChangeMessage") }) }),
|
|
2649
2663
|
/* @__PURE__ */ w(Sr, { children: [
|
|
2650
|
-
/* @__PURE__ */ o(
|
|
2651
|
-
/* @__PURE__ */ o(
|
|
2664
|
+
/* @__PURE__ */ o(Oe, { variant: "outlined", color: "primary", onClick: () => h(!1), children: n("columns.cancel") }),
|
|
2665
|
+
/* @__PURE__ */ o(Oe, { variant: "contained", color: "error", onClick: () => h(!0), children: n("columns.confirm") })
|
|
2652
2666
|
] })
|
|
2653
2667
|
] })
|
|
2654
2668
|
] });
|
|
2655
2669
|
}
|
|
2656
|
-
const
|
|
2657
|
-
style:
|
|
2670
|
+
const dl = J.object({
|
|
2671
|
+
style: Ni.shape.style,
|
|
2658
2672
|
props: J.object({
|
|
2659
2673
|
childrenIds: J.array(J.string()).optional().nullable()
|
|
2660
2674
|
}).optional().nullable()
|
|
2661
2675
|
});
|
|
2662
|
-
function
|
|
2676
|
+
function Xs({ data: e, setData: t }) {
|
|
2663
2677
|
const { t: n } = Se(), [, r] = z(null), i = (l) => {
|
|
2664
|
-
const a =
|
|
2678
|
+
const a = dl.safeParse(l);
|
|
2665
2679
|
a.success ? (t(a.data), r(null)) : r(a.error);
|
|
2666
2680
|
};
|
|
2667
2681
|
return /* @__PURE__ */ o(it, { title: n("container.title"), children: /* @__PURE__ */ o(
|
|
@@ -2673,10 +2687,10 @@ function Ys({ data: e, setData: t }) {
|
|
|
2673
2687
|
}
|
|
2674
2688
|
) });
|
|
2675
2689
|
}
|
|
2676
|
-
function
|
|
2690
|
+
function Gs({ data: e, setData: t }) {
|
|
2677
2691
|
var c, s;
|
|
2678
2692
|
const { t: n } = Se(), [, r] = z(null), i = (d) => {
|
|
2679
|
-
const u =
|
|
2693
|
+
const u = Wr.safeParse(d);
|
|
2680
2694
|
u.success ? (t(u.data), r(null)) : r(u.error);
|
|
2681
2695
|
}, l = ((c = e.props) == null ? void 0 : c.lineColor) ?? Vo.lineColor, a = ((s = e.props) == null ? void 0 : s.lineHeight) ?? Vo.lineHeight;
|
|
2682
2696
|
return /* @__PURE__ */ w(it, { title: n("divider.title"), children: [
|
|
@@ -2711,7 +2725,7 @@ function Xs({ data: e, setData: t }) {
|
|
|
2711
2725
|
)
|
|
2712
2726
|
] });
|
|
2713
2727
|
}
|
|
2714
|
-
const Nn = J.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),
|
|
2728
|
+
const Nn = J.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(), Js = J.enum([
|
|
2715
2729
|
"MODERN_SANS",
|
|
2716
2730
|
"BOOK_SANS",
|
|
2717
2731
|
"ORGANIC_SANS",
|
|
@@ -2721,19 +2735,19 @@ const Nn = J.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(), Gs = J.e
|
|
|
2721
2735
|
"MODERN_SERIF",
|
|
2722
2736
|
"BOOK_SERIF",
|
|
2723
2737
|
"MONOSPACE"
|
|
2724
|
-
]).nullable().optional(),
|
|
2738
|
+
]).nullable().optional(), pl = J.object({
|
|
2725
2739
|
backdropColor: Nn,
|
|
2726
2740
|
borderColor: Nn,
|
|
2727
2741
|
borderRadius: J.number().optional().nullable(),
|
|
2728
2742
|
canvasColor: Nn,
|
|
2729
2743
|
textColor: Nn,
|
|
2730
|
-
fontFamily:
|
|
2744
|
+
fontFamily: Js,
|
|
2731
2745
|
width: J.number().optional().nullable(),
|
|
2732
2746
|
childrenIds: J.array(J.string()).optional().nullable()
|
|
2733
2747
|
});
|
|
2734
|
-
function
|
|
2748
|
+
function fl({ data: e, setData: t }) {
|
|
2735
2749
|
const { t: n } = Se(), [, r] = z(null), i = (l) => {
|
|
2736
|
-
const a =
|
|
2750
|
+
const a = pl.safeParse(l);
|
|
2737
2751
|
a.success ? (t(a.data), r(null)) : r(a.error);
|
|
2738
2752
|
};
|
|
2739
2753
|
return /* @__PURE__ */ w(it, { title: n("emailLayout.global"), children: [
|
|
@@ -2776,7 +2790,7 @@ function ml({ data: e, setData: t }) {
|
|
|
2776
2790
|
}
|
|
2777
2791
|
),
|
|
2778
2792
|
/* @__PURE__ */ o(
|
|
2779
|
-
|
|
2793
|
+
al,
|
|
2780
2794
|
{
|
|
2781
2795
|
label: n("emailLayout.fontFamily"),
|
|
2782
2796
|
defaultValue: "MODERN_SANS",
|
|
@@ -2793,10 +2807,10 @@ function ml({ data: e, setData: t }) {
|
|
|
2793
2807
|
)
|
|
2794
2808
|
] });
|
|
2795
2809
|
}
|
|
2796
|
-
function
|
|
2810
|
+
function Zs({ data: e, setData: t }) {
|
|
2797
2811
|
var l;
|
|
2798
2812
|
const { t: n } = Se(), [, r] = z(null), i = (a) => {
|
|
2799
|
-
const c =
|
|
2813
|
+
const c = Hr.safeParse(a);
|
|
2800
2814
|
c.success ? (t(c.data), r(null)) : r(c.error);
|
|
2801
2815
|
};
|
|
2802
2816
|
return /* @__PURE__ */ w(it, { title: n("heading.title"), children: [
|
|
@@ -2804,7 +2818,7 @@ function Js({ data: e, setData: t }) {
|
|
|
2804
2818
|
ft,
|
|
2805
2819
|
{
|
|
2806
2820
|
label: n("heading.level"),
|
|
2807
|
-
defaultValue: ((l = e.props) == null ? void 0 : l.level) ??
|
|
2821
|
+
defaultValue: ((l = e.props) == null ? void 0 : l.level) ?? Fi.level,
|
|
2808
2822
|
onChange: (a) => {
|
|
2809
2823
|
i({ ...e, props: { ...e.props, level: a } });
|
|
2810
2824
|
},
|
|
@@ -2825,8 +2839,8 @@ function Js({ data: e, setData: t }) {
|
|
|
2825
2839
|
)
|
|
2826
2840
|
] });
|
|
2827
2841
|
}
|
|
2828
|
-
function
|
|
2829
|
-
const [i, l] = mt.useState(t), a =
|
|
2842
|
+
function Qs({ label: e, value: t, onChange: n, height: r = "200px" }) {
|
|
2843
|
+
const [i, l] = mt.useState(t), a = Me(null);
|
|
2830
2844
|
Ce(() => {
|
|
2831
2845
|
t !== i && l(t);
|
|
2832
2846
|
}, [t]);
|
|
@@ -2855,12 +2869,12 @@ function Zs({ label: e, value: t, onChange: n, height: r = "200px" }) {
|
|
|
2855
2869
|
}
|
|
2856
2870
|
},
|
|
2857
2871
|
children: /* @__PURE__ */ o(
|
|
2858
|
-
|
|
2872
|
+
Wi,
|
|
2859
2873
|
{
|
|
2860
2874
|
value: i,
|
|
2861
2875
|
height: r,
|
|
2862
|
-
extensions: [
|
|
2863
|
-
theme:
|
|
2876
|
+
extensions: [Hi()],
|
|
2877
|
+
theme: Vi,
|
|
2864
2878
|
onChange: c,
|
|
2865
2879
|
basicSetup: {
|
|
2866
2880
|
lineNumbers: !0,
|
|
@@ -2874,15 +2888,15 @@ function Zs({ label: e, value: t, onChange: n, height: r = "200px" }) {
|
|
|
2874
2888
|
)
|
|
2875
2889
|
] });
|
|
2876
2890
|
}
|
|
2877
|
-
function
|
|
2891
|
+
function ec({ data: e, setData: t }) {
|
|
2878
2892
|
var l;
|
|
2879
2893
|
const { t: n } = Se(), [, r] = z(null), i = (a) => {
|
|
2880
|
-
const c =
|
|
2894
|
+
const c = Vr.safeParse(a);
|
|
2881
2895
|
c.success ? (t(c.data), r(null)) : r(c.error);
|
|
2882
2896
|
};
|
|
2883
2897
|
return /* @__PURE__ */ w(it, { title: n("html.title"), children: [
|
|
2884
2898
|
/* @__PURE__ */ o(
|
|
2885
|
-
|
|
2899
|
+
Qs,
|
|
2886
2900
|
{
|
|
2887
2901
|
label: n("html.content"),
|
|
2888
2902
|
value: ((l = e.props) == null ? void 0 : l.contents) ?? "",
|
|
@@ -2920,10 +2934,10 @@ function $n({ label: e, defaultValue: t, onChange: n }) {
|
|
|
2920
2934
|
}
|
|
2921
2935
|
);
|
|
2922
2936
|
}
|
|
2923
|
-
function
|
|
2937
|
+
function tc({ data: e, setData: t }) {
|
|
2924
2938
|
var m, h, b, S, y, k;
|
|
2925
|
-
const { t: n } = Se(), [, r] = z(null), [i, l] = z("url"), [a, c] = z(!1), s =
|
|
2926
|
-
const E =
|
|
2939
|
+
const { t: n } = Se(), [, r] = z(null), [i, l] = z("url"), [a, c] = z(!1), s = Me(null), d = Xr(), u = (D) => {
|
|
2940
|
+
const E = Ur.safeParse(D);
|
|
2927
2941
|
E.success ? (t(E.data), r(null)) : r(E.error);
|
|
2928
2942
|
}, g = async (D) => {
|
|
2929
2943
|
var N;
|
|
@@ -2997,7 +3011,7 @@ function ec({ data: e, setData: t }) {
|
|
|
2997
3011
|
}
|
|
2998
3012
|
),
|
|
2999
3013
|
/* @__PURE__ */ o(
|
|
3000
|
-
|
|
3014
|
+
Oe,
|
|
3001
3015
|
{
|
|
3002
3016
|
variant: "outlined",
|
|
3003
3017
|
startIcon: a ? /* @__PURE__ */ o(jn, { size: 16 }) : /* @__PURE__ */ o(Ft, {}),
|
|
@@ -3070,7 +3084,7 @@ function ec({ data: e, setData: t }) {
|
|
|
3070
3084
|
)
|
|
3071
3085
|
] });
|
|
3072
3086
|
}
|
|
3073
|
-
function
|
|
3087
|
+
function ml() {
|
|
3074
3088
|
return J.object({
|
|
3075
3089
|
top: J.number(),
|
|
3076
3090
|
bottom: J.number(),
|
|
@@ -3078,7 +3092,7 @@ function gl() {
|
|
|
3078
3092
|
left: J.number()
|
|
3079
3093
|
});
|
|
3080
3094
|
}
|
|
3081
|
-
const
|
|
3095
|
+
const gl = J.object({
|
|
3082
3096
|
props: J.object({
|
|
3083
3097
|
url: J.string().nullable().optional(),
|
|
3084
3098
|
alt: J.string().optional().nullable(),
|
|
@@ -3092,7 +3106,7 @@ const hl = J.object({
|
|
|
3092
3106
|
controls: J.boolean().optional().nullable()
|
|
3093
3107
|
}).optional().nullable(),
|
|
3094
3108
|
style: J.object({
|
|
3095
|
-
padding:
|
|
3109
|
+
padding: ml().optional().nullable(),
|
|
3096
3110
|
backgroundColor: J.string().optional().nullable(),
|
|
3097
3111
|
textAlign: J.enum(["left", "center", "right"]).optional().nullable()
|
|
3098
3112
|
}).optional().nullable()
|
|
@@ -3104,7 +3118,7 @@ function Rn({ label: e, defaultValue: t, onChange: n }) {
|
|
|
3104
3118
|
{
|
|
3105
3119
|
label: e,
|
|
3106
3120
|
control: /* @__PURE__ */ o(
|
|
3107
|
-
|
|
3121
|
+
Rl,
|
|
3108
3122
|
{
|
|
3109
3123
|
checked: r,
|
|
3110
3124
|
onChange: (l, a) => {
|
|
@@ -3115,10 +3129,10 @@ function Rn({ label: e, defaultValue: t, onChange: n }) {
|
|
|
3115
3129
|
}
|
|
3116
3130
|
);
|
|
3117
3131
|
}
|
|
3118
|
-
function
|
|
3132
|
+
function nc({ data: e, setData: t }) {
|
|
3119
3133
|
var m, h, b, S, y, k, D, E, N, W;
|
|
3120
|
-
const { t: n } = Se(), [, r] = z(null), [i, l] = z("url"), [a, c] = z(!1), s =
|
|
3121
|
-
const he =
|
|
3134
|
+
const { t: n } = Se(), [, r] = z(null), [i, l] = z("url"), [a, c] = z(!1), s = Me(null), d = Gr(), u = (P) => {
|
|
3135
|
+
const he = gl.safeParse(P);
|
|
3122
3136
|
he.success ? (t(he.data), r(null)) : r(he.error);
|
|
3123
3137
|
}, g = async (P) => {
|
|
3124
3138
|
var be;
|
|
@@ -3192,7 +3206,7 @@ function tc({ data: e, setData: t }) {
|
|
|
3192
3206
|
}
|
|
3193
3207
|
),
|
|
3194
3208
|
/* @__PURE__ */ o(
|
|
3195
|
-
|
|
3209
|
+
Oe,
|
|
3196
3210
|
{
|
|
3197
3211
|
variant: "outlined",
|
|
3198
3212
|
startIcon: a ? /* @__PURE__ */ o(jn, { size: 16 }) : /* @__PURE__ */ o(Ft, {}),
|
|
@@ -3311,10 +3325,10 @@ function tc({ data: e, setData: t }) {
|
|
|
3311
3325
|
)
|
|
3312
3326
|
] });
|
|
3313
3327
|
}
|
|
3314
|
-
function
|
|
3328
|
+
function oc({ data: e, setData: t }) {
|
|
3315
3329
|
var l;
|
|
3316
3330
|
const { t: n } = Se(), [, r] = z(null), i = (a) => {
|
|
3317
|
-
const c =
|
|
3331
|
+
const c = $r.safeParse(a);
|
|
3318
3332
|
c.success ? (t(c.data), r(null)) : r(c.error);
|
|
3319
3333
|
};
|
|
3320
3334
|
return /* @__PURE__ */ o(it, { title: n("spacer.title"), children: /* @__PURE__ */ o(
|
|
@@ -3326,7 +3340,7 @@ function nc({ data: e, setData: t }) {
|
|
|
3326
3340
|
step: 4,
|
|
3327
3341
|
min: 4,
|
|
3328
3342
|
max: 128,
|
|
3329
|
-
defaultValue: ((l = e.props) == null ? void 0 : l.height) ??
|
|
3343
|
+
defaultValue: ((l = e.props) == null ? void 0 : l.height) ?? $i.height,
|
|
3330
3344
|
onChange: (a) => i({ ...e, props: { ...e.props, height: a } })
|
|
3331
3345
|
}
|
|
3332
3346
|
) });
|
|
@@ -3381,7 +3395,7 @@ const Ao = [
|
|
|
3381
3395
|
items: [{ name: "unsubscribe_link", labelKey: "text.variables.unsubscribeLink", kind: "user" }]
|
|
3382
3396
|
}
|
|
3383
3397
|
];
|
|
3384
|
-
function
|
|
3398
|
+
function rc(e) {
|
|
3385
3399
|
const t = e.baseGroups ?? Ao, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
3386
3400
|
for (const l of t)
|
|
3387
3401
|
for (const a of l.items)
|
|
@@ -3404,7 +3418,7 @@ const rr = [
|
|
|
3404
3418
|
"fontWeight",
|
|
3405
3419
|
"fontStyle",
|
|
3406
3420
|
"textDecoration"
|
|
3407
|
-
],
|
|
3421
|
+
], lc = [
|
|
3408
3422
|
"color",
|
|
3409
3423
|
"backgroundColor",
|
|
3410
3424
|
"fontFamily",
|
|
@@ -3413,30 +3427,30 @@ const rr = [
|
|
|
3413
3427
|
"fontWeight",
|
|
3414
3428
|
"fontStyle",
|
|
3415
3429
|
"textDecoration"
|
|
3416
|
-
],
|
|
3417
|
-
function
|
|
3430
|
+
], ic = ["lineHeight", "textAlign", "padding"], ac = Ao;
|
|
3431
|
+
function sc({ blockId: e, data: t, setData: n }) {
|
|
3418
3432
|
var fe;
|
|
3419
|
-
const { t: r } = Se(), [, i] = z(null), l =
|
|
3420
|
-
|
|
3421
|
-
const a =
|
|
3422
|
-
const I = (R) => typeof R == "string" ? R.trim() : "",
|
|
3433
|
+
const { t: r } = Se(), [, i] = z(null), l = qr();
|
|
3434
|
+
Yr();
|
|
3435
|
+
const a = xa(), c = Kr(), s = ct(() => {
|
|
3436
|
+
const I = (R) => typeof R == "string" ? R.trim() : "", M = (Array.isArray(c) ? c : []).filter((R) => {
|
|
3423
3437
|
if (!I(R == null ? void 0 : R.AttrField)) return !1;
|
|
3424
3438
|
const Ee = R == null ? void 0 : R.Enable;
|
|
3425
3439
|
return !(Ee === 0 || Ee === !1);
|
|
3426
3440
|
}).map((R) => {
|
|
3427
3441
|
const de = I(R == null ? void 0 : R.AttrField), Ee = I(R == null ? void 0 : R.AttrComment) || I(R == null ? void 0 : R.Name) || de;
|
|
3428
3442
|
return { name: de, labelKey: Ee, kind: "user", isCustomLabel: !0 };
|
|
3429
|
-
}), $ =
|
|
3443
|
+
}), $ = ac.map((R) => ({
|
|
3430
3444
|
...R,
|
|
3431
3445
|
items: R.items.map((de) => ({ ...de, isCustomLabel: !1 }))
|
|
3432
3446
|
})), j = $.find((R) => R.id === "contacts");
|
|
3433
3447
|
if (j) {
|
|
3434
3448
|
const R = new Set(j.items.map((de) => de.name));
|
|
3435
|
-
for (const de of
|
|
3449
|
+
for (const de of M)
|
|
3436
3450
|
R.has(de.name) || j.items.push(de);
|
|
3437
3451
|
}
|
|
3438
3452
|
return $;
|
|
3439
|
-
}, [c]), d =
|
|
3453
|
+
}, [c]), d = Me({}), u = Me(null), g = en(() => {
|
|
3440
3454
|
u.current = null;
|
|
3441
3455
|
const I = d.current;
|
|
3442
3456
|
d.current = {}, Object.keys(I).length !== 0 && (Sn(), qt(e, { kind: "style", style: I }));
|
|
@@ -3447,23 +3461,23 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3447
3461
|
const f = (l == null ? void 0 : l.blockId) === e && l.start < l.end, m = ct(() => {
|
|
3448
3462
|
const I = t.style ?? {};
|
|
3449
3463
|
if (!f || !l) return I;
|
|
3450
|
-
const
|
|
3464
|
+
const M = Ht(t.props ?? null), $ = fs(M, l.start, l.end);
|
|
3451
3465
|
if ($ && Object.keys($).length) return { ...I, ...$ };
|
|
3452
3466
|
const j = (a == null ? void 0 : a.blockId) === e ? a.styleSnapshot : void 0;
|
|
3453
3467
|
return j && Object.keys(j).length ? { ...I, ...j } : I;
|
|
3454
3468
|
}, [t.style, t.props, f, l, a, e]), h = (I) => {
|
|
3455
|
-
const
|
|
3456
|
-
|
|
3469
|
+
const M = Br.safeParse(I);
|
|
3470
|
+
M.success ? (n(M.data), i(null)) : i(M.error);
|
|
3457
3471
|
}, b = (I) => {
|
|
3458
|
-
const
|
|
3472
|
+
const M = m, $ = I, j = [...rr, "lineHeight", "textAlign", "padding"], R = {};
|
|
3459
3473
|
for (const xe of j)
|
|
3460
|
-
if ($[xe] !==
|
|
3474
|
+
if ($[xe] !== M[xe]) {
|
|
3461
3475
|
const ge = $[xe];
|
|
3462
3476
|
if (ge === void 0) continue;
|
|
3463
3477
|
R[xe] = ge;
|
|
3464
3478
|
}
|
|
3465
3479
|
const de = ["fontWeight", "fontStyle", "textDecoration"];
|
|
3466
|
-
if (de.some((xe) => $[xe] !==
|
|
3480
|
+
if (de.some((xe) => $[xe] !== M[xe]))
|
|
3467
3481
|
for (const xe of de) {
|
|
3468
3482
|
const ge = $[xe];
|
|
3469
3483
|
ge !== void 0 && (R[xe] = ge);
|
|
@@ -3485,39 +3499,39 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3485
3499
|
}, S = (a == null ? void 0 : a.blockId) === e ? a.text : "", y = f && l ? S.slice(l.start, l.end) : "", k = f, D = ct(() => {
|
|
3486
3500
|
if (!f || !l) return null;
|
|
3487
3501
|
const I = Ht(t.props ?? null);
|
|
3488
|
-
return
|
|
3502
|
+
return gs(I, l.start, l.end);
|
|
3489
3503
|
}, [f, l, t.props]), E = !f || !!D, N = ct(() => Ht(t.props ?? null), [t.props]), W = ct(() => {
|
|
3490
3504
|
const I = /* @__PURE__ */ new Set();
|
|
3491
|
-
for (const
|
|
3492
|
-
for (const $ of
|
|
3505
|
+
for (const M of s)
|
|
3506
|
+
for (const $ of M.items)
|
|
3493
3507
|
$.kind === "user" && I.add($.name);
|
|
3494
3508
|
return I;
|
|
3495
3509
|
}, [s]), P = ct(() => {
|
|
3496
|
-
const I = qn(N),
|
|
3510
|
+
const I = qn(N), M = [], $ = /* @__PURE__ */ new Map();
|
|
3497
3511
|
for (const j of I) {
|
|
3498
3512
|
if (j.builtin || !W.has(j.name) || !j.instanceId) continue;
|
|
3499
3513
|
const R = $.get(j.name) ?? 0;
|
|
3500
3514
|
$.set(j.name, R + 1);
|
|
3501
3515
|
const de = R === 0 ? `{{${j.name}}}` : `{{${j.name}}} (${R + 1})`;
|
|
3502
|
-
|
|
3516
|
+
M.push({
|
|
3503
3517
|
instanceId: j.instanceId,
|
|
3504
3518
|
name: j.name,
|
|
3505
3519
|
label: de
|
|
3506
3520
|
});
|
|
3507
3521
|
}
|
|
3508
|
-
return
|
|
3509
|
-
}, [N, W]), he = ((fe = t.props) == null ? void 0 : fe.variableDefaults) ?? null, [be, ce] = z(null), [_, x] = z(null), [T, U] = z("contacts"), [ie, C] = z("pick"), [p, F] = z(null), [X, V] = z(""), [me, ve] = z(!1), [we, K] = z("web"), [Re, je] = z(""), [_t, ht] = z(!0), [pe, q] = z(!1), v =
|
|
3510
|
-
const
|
|
3511
|
-
if (!
|
|
3512
|
-
const j =
|
|
3522
|
+
return M;
|
|
3523
|
+
}, [N, W]), he = ((fe = t.props) == null ? void 0 : fe.variableDefaults) ?? null, [be, ce] = z(null), [_, x] = z(null), [T, U] = z("contacts"), [ie, C] = z("pick"), [p, F] = z(null), [X, V] = z(""), [me, ve] = z(!1), [we, K] = z("web"), [Re, je] = z(""), [_t, ht] = z(!0), [pe, q] = z(!1), v = Me(null), Y = /^(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/, ee = /^(?:\[(?:[A-Fa-f0-9:.]+)\]|(?:[A-Za-z0-9\-._~!$&'()*+,;=]|%[0-9A-Fa-f]{2})+)$/, L = (I) => {
|
|
3524
|
+
const M = I.match(/^[A-Za-z][A-Za-z0-9+.-]*:\/\/([^/?#]*)/);
|
|
3525
|
+
if (!M) return null;
|
|
3526
|
+
const j = M[1].replace(/^.*@/, "");
|
|
3513
3527
|
if (!j) return null;
|
|
3514
3528
|
if (j.startsWith("[")) {
|
|
3515
3529
|
const R = j.indexOf("]");
|
|
3516
3530
|
return R <= 0 ? null : j.slice(0, R + 1);
|
|
3517
3531
|
}
|
|
3518
3532
|
return j.split(":")[0] || null;
|
|
3519
|
-
}, G = (I,
|
|
3520
|
-
const $ =
|
|
3533
|
+
}, G = (I, M) => {
|
|
3534
|
+
const $ = M.trim();
|
|
3521
3535
|
if (!$) return null;
|
|
3522
3536
|
if (/^\{\{[A-Za-z_][A-Za-z0-9_]*\}\}$/.test($) || /^\{\%[A-Za-z_][A-Za-z0-9_]*\%\}$/.test($))
|
|
3523
3537
|
return $;
|
|
@@ -3533,30 +3547,30 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3533
3547
|
} catch {
|
|
3534
3548
|
return null;
|
|
3535
3549
|
}
|
|
3536
|
-
}, ae = (I,
|
|
3550
|
+
}, ae = (I, M) => {
|
|
3537
3551
|
const $ = Ht(t.props ?? null);
|
|
3538
|
-
return
|
|
3552
|
+
return ps($, I, M);
|
|
3539
3553
|
}, re = (I) => {
|
|
3540
3554
|
if (!k || !l) return;
|
|
3541
|
-
const
|
|
3542
|
-
|
|
3555
|
+
const M = ae(l.start, l.end);
|
|
3556
|
+
M ? (/^mailto:/i.test(M.href) ? (K("email"), je(M.href.replace(/^mailto:/i, ""))) : (K("web"), je(M.href)), ht(!!M.targetBlank)) : (K("web"), je(""), ht(!0)), q(!1), ce(I.currentTarget);
|
|
3543
3557
|
}, ue = () => {
|
|
3544
3558
|
ce(null), q(!1);
|
|
3545
3559
|
}, te = ct(() => {
|
|
3546
|
-
const I = s.find((
|
|
3560
|
+
const I = s.find((M) => M.id === "links");
|
|
3547
3561
|
return I ? I.items : [];
|
|
3548
3562
|
}, [s]), Q = (I) => {
|
|
3549
|
-
const
|
|
3550
|
-
if (!
|
|
3563
|
+
const M = v.current;
|
|
3564
|
+
if (!M) {
|
|
3551
3565
|
je(I);
|
|
3552
3566
|
return;
|
|
3553
3567
|
}
|
|
3554
|
-
const $ =
|
|
3568
|
+
const $ = M.selectionStart ?? Re.length, j = M.selectionEnd ?? Re.length, R = Re.slice(0, $) + I + Re.slice(j);
|
|
3555
3569
|
je(R), requestAnimationFrame(() => {
|
|
3556
3570
|
try {
|
|
3557
|
-
|
|
3571
|
+
M.focus();
|
|
3558
3572
|
const de = $ + I.length;
|
|
3559
|
-
|
|
3573
|
+
M.setSelectionRange(de, de);
|
|
3560
3574
|
} catch {
|
|
3561
3575
|
}
|
|
3562
3576
|
});
|
|
@@ -3564,9 +3578,9 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3564
3578
|
E && (x(I.currentTarget), U("contacts"), C("pick"), F(null), V(""), ve(!1));
|
|
3565
3579
|
}, ne = () => {
|
|
3566
3580
|
x(null), C("pick"), F(null), V(""), ve(!1);
|
|
3567
|
-
}, A = (I,
|
|
3581
|
+
}, A = (I, M) => {
|
|
3568
3582
|
if (E) {
|
|
3569
|
-
if (
|
|
3583
|
+
if (M === "builtin") {
|
|
3570
3584
|
const $ = `{%${I}%}`;
|
|
3571
3585
|
D && l ? qt(e, {
|
|
3572
3586
|
kind: "replaceVariable",
|
|
@@ -3576,7 +3590,7 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3576
3590
|
}) : qt(e, { kind: "variable", token: $ }), ne();
|
|
3577
3591
|
return;
|
|
3578
3592
|
}
|
|
3579
|
-
F({ name: I, kind:
|
|
3593
|
+
F({ name: I, kind: M }), V(""), ve(!1), C("default");
|
|
3580
3594
|
}
|
|
3581
3595
|
}, H = () => {
|
|
3582
3596
|
C("pick"), ve(!1);
|
|
@@ -3584,16 +3598,16 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3584
3598
|
if (!p) return;
|
|
3585
3599
|
const I = X.trim();
|
|
3586
3600
|
if (I === "") return;
|
|
3587
|
-
const
|
|
3601
|
+
const M = p.kind === "builtin" ? `{%${p.name}%}` : `{{${p.name}}}`;
|
|
3588
3602
|
D && l ? qt(e, {
|
|
3589
3603
|
kind: "replaceVariable",
|
|
3590
|
-
token:
|
|
3604
|
+
token: M,
|
|
3591
3605
|
start: l.start,
|
|
3592
3606
|
end: l.end,
|
|
3593
3607
|
defaultValue: I
|
|
3594
3608
|
}) : qt(e, {
|
|
3595
3609
|
kind: "variable",
|
|
3596
|
-
token:
|
|
3610
|
+
token: M,
|
|
3597
3611
|
defaultValue: I
|
|
3598
3612
|
}), ne();
|
|
3599
3613
|
}, oe = () => {
|
|
@@ -3644,14 +3658,14 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3644
3658
|
/* @__PURE__ */ w(Z, { direction: "row", alignItems: "start", flexDirection: "column", justifyContent: "space-between", children: [
|
|
3645
3659
|
/* @__PURE__ */ o(At, { shrink: !0, children: r("text.link") }),
|
|
3646
3660
|
/* @__PURE__ */ o(Z, { direction: "row", spacing: 1, sx: { mt: 0.5, alignSelf: "flex-start" }, children: /* @__PURE__ */ o(
|
|
3647
|
-
|
|
3661
|
+
Oe,
|
|
3648
3662
|
{
|
|
3649
3663
|
size: "small",
|
|
3650
3664
|
variant: "outlined",
|
|
3651
3665
|
onClick: re,
|
|
3652
3666
|
disabled: !k,
|
|
3653
3667
|
"aria-label": r("text.link"),
|
|
3654
|
-
startIcon: /* @__PURE__ */ o(
|
|
3668
|
+
startIcon: /* @__PURE__ */ o(qi, { fontSize: "small" }),
|
|
3655
3669
|
sx: {
|
|
3656
3670
|
color: "text.secondary",
|
|
3657
3671
|
borderColor: "divider",
|
|
@@ -3669,14 +3683,14 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3669
3683
|
/* @__PURE__ */ w(Z, { direction: "row", alignItems: "start", flexDirection: "column", justifyContent: "space-between", sx: { mt: 2 }, children: [
|
|
3670
3684
|
/* @__PURE__ */ o(At, { shrink: !0, children: r("text.variables.title") }),
|
|
3671
3685
|
/* @__PURE__ */ o(Z, { direction: "row", spacing: 1, alignItems: "center", sx: { mt: 0.5, alignSelf: "flex-start" }, children: /* @__PURE__ */ o(
|
|
3672
|
-
|
|
3686
|
+
Oe,
|
|
3673
3687
|
{
|
|
3674
3688
|
size: "small",
|
|
3675
3689
|
variant: "outlined",
|
|
3676
3690
|
onClick: Ie,
|
|
3677
3691
|
disabled: !E,
|
|
3678
3692
|
"aria-label": r("text.addVariables"),
|
|
3679
|
-
startIcon: /* @__PURE__ */ o(
|
|
3693
|
+
startIcon: /* @__PURE__ */ o(si, { fontSize: "small" }),
|
|
3680
3694
|
sx: {
|
|
3681
3695
|
color: "text.secondary",
|
|
3682
3696
|
borderColor: "divider",
|
|
@@ -3726,9 +3740,9 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3726
3740
|
},
|
|
3727
3741
|
value: (he && he[I.instanceId]) ?? "",
|
|
3728
3742
|
placeholder: r("text.variables.defaultPlaceholder"),
|
|
3729
|
-
onChange: (
|
|
3743
|
+
onChange: (M) => {
|
|
3730
3744
|
const $ = { ...he ?? {} };
|
|
3731
|
-
$[I.instanceId] =
|
|
3745
|
+
$[I.instanceId] = M.target.value, h({ ...t, props: { ...t.props, variableDefaults: $ } });
|
|
3732
3746
|
}
|
|
3733
3747
|
}
|
|
3734
3748
|
)
|
|
@@ -3737,9 +3751,9 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3737
3751
|
I.instanceId
|
|
3738
3752
|
))
|
|
3739
3753
|
] }),
|
|
3740
|
-
/* @__PURE__ */ o(gt, { names: rc, value: m, onChange: b }),
|
|
3741
|
-
/* @__PURE__ */ o(rn, { sx: { my: 2 } }),
|
|
3742
3754
|
/* @__PURE__ */ o(gt, { names: lc, value: m, onChange: b }),
|
|
3755
|
+
/* @__PURE__ */ o(rn, { sx: { my: 2 } }),
|
|
3756
|
+
/* @__PURE__ */ o(gt, { names: ic, value: m, onChange: b }),
|
|
3743
3757
|
/* @__PURE__ */ o(
|
|
3744
3758
|
ao,
|
|
3745
3759
|
{
|
|
@@ -3784,7 +3798,7 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3784
3798
|
te.length > 0 && /* @__PURE__ */ w(Z, { spacing: 0.75, children: [
|
|
3785
3799
|
/* @__PURE__ */ o(ke, { variant: "body2", color: "text.secondary", children: r("text.linkVariables") }),
|
|
3786
3800
|
/* @__PURE__ */ o(Z, { direction: "row", spacing: 1, sx: { flexWrap: "wrap" }, children: te.map((I) => /* @__PURE__ */ o(
|
|
3787
|
-
|
|
3801
|
+
Oe,
|
|
3788
3802
|
{
|
|
3789
3803
|
size: "small",
|
|
3790
3804
|
variant: "outlined",
|
|
@@ -3798,13 +3812,13 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3798
3812
|
/* @__PURE__ */ o(
|
|
3799
3813
|
vr,
|
|
3800
3814
|
{
|
|
3801
|
-
control: /* @__PURE__ */ o(
|
|
3815
|
+
control: /* @__PURE__ */ o(Pl, { checked: _t, onChange: (I) => ht(I.target.checked) }),
|
|
3802
3816
|
label: r("text.linkTargetBlank")
|
|
3803
3817
|
}
|
|
3804
3818
|
),
|
|
3805
3819
|
/* @__PURE__ */ w(se, { sx: { display: "flex", gap: 1, justifyContent: "flex-end", pt: 1 }, children: [
|
|
3806
|
-
/* @__PURE__ */ o(
|
|
3807
|
-
/* @__PURE__ */ o(
|
|
3820
|
+
/* @__PURE__ */ o(Oe, { variant: "outlined", onClick: ue, children: r("common.cancel") }),
|
|
3821
|
+
/* @__PURE__ */ o(Oe, { variant: "contained", onClick: oe, disabled: !G(we, Re), children: r("common.save") })
|
|
3808
3822
|
] })
|
|
3809
3823
|
] })
|
|
3810
3824
|
}
|
|
@@ -3820,10 +3834,10 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3820
3834
|
PaperProps: { sx: { width: 360, p: 2.5, maxHeight: 500, overflowY: "auto" } },
|
|
3821
3835
|
children: /* @__PURE__ */ w(Z, { spacing: 1.5, children: [
|
|
3822
3836
|
/* @__PURE__ */ o(ke, { variant: "subtitle1", sx: { fontWeight: 700 }, children: r(ie === "pick" ? "text.addVariables" : "text.variables.setDefaultTitle") }),
|
|
3823
|
-
ie === "pick" ? /* @__PURE__ */ o(se, { children: s.map((I,
|
|
3837
|
+
ie === "pick" ? /* @__PURE__ */ o(se, { children: s.map((I, M) => {
|
|
3824
3838
|
const $ = I.id === "contacts" ? "text.variables.groupContacts" : I.id === "email" ? "text.variables.groupEmail" : I.id === "organization" ? "text.variables.groupOrganization" : I.id === "date" ? "text.variables.groupDate" : "text.variables.groupLinks", j = T === I.id;
|
|
3825
3839
|
return /* @__PURE__ */ w(
|
|
3826
|
-
|
|
3840
|
+
Fl,
|
|
3827
3841
|
{
|
|
3828
3842
|
disableGutters: !0,
|
|
3829
3843
|
square: !0,
|
|
@@ -3840,9 +3854,9 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3840
3854
|
},
|
|
3841
3855
|
children: [
|
|
3842
3856
|
/* @__PURE__ */ o(
|
|
3843
|
-
|
|
3857
|
+
zl,
|
|
3844
3858
|
{
|
|
3845
|
-
expandIcon: /* @__PURE__ */ o(
|
|
3859
|
+
expandIcon: /* @__PURE__ */ o(Ki, { fontSize: "small" }),
|
|
3846
3860
|
sx: {
|
|
3847
3861
|
minHeight: 40,
|
|
3848
3862
|
"& .MuiAccordionSummary-content": { my: 0.75 }
|
|
@@ -3850,8 +3864,8 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3850
3864
|
children: /* @__PURE__ */ o(ke, { variant: "overline", color: "text.secondary", children: r($) })
|
|
3851
3865
|
}
|
|
3852
3866
|
),
|
|
3853
|
-
/* @__PURE__ */ o(
|
|
3854
|
-
|
|
3867
|
+
/* @__PURE__ */ o(Ll, { sx: { pt: 0, pb: 1.25 }, children: /* @__PURE__ */ o(Z, { sx: { mt: 0.5 }, children: I.items.map((R) => /* @__PURE__ */ o(
|
|
3868
|
+
Oe,
|
|
3855
3869
|
{
|
|
3856
3870
|
size: "small",
|
|
3857
3871
|
variant: "outlined",
|
|
@@ -3916,9 +3930,9 @@ function ac({ blockId: e, data: t, setData: n }) {
|
|
|
3916
3930
|
}
|
|
3917
3931
|
),
|
|
3918
3932
|
/* @__PURE__ */ w(se, { sx: { display: "flex", gap: 1, justifyContent: "flex-end", pt: 0.5 }, children: [
|
|
3919
|
-
/* @__PURE__ */ o(
|
|
3933
|
+
/* @__PURE__ */ o(Oe, { variant: "outlined", onClick: H, children: r("text.variables.back") }),
|
|
3920
3934
|
/* @__PURE__ */ o(
|
|
3921
|
-
|
|
3935
|
+
Oe,
|
|
3922
3936
|
{
|
|
3923
3937
|
variant: "contained",
|
|
3924
3938
|
onClick: De,
|
|
@@ -3947,7 +3961,7 @@ const vn = [
|
|
|
3947
3961
|
"reddit",
|
|
3948
3962
|
"twitch",
|
|
3949
3963
|
"threads"
|
|
3950
|
-
],
|
|
3964
|
+
], hl = [
|
|
3951
3965
|
"no-border-black",
|
|
3952
3966
|
// 深色 (Glyph Dark) -> glyph-dark
|
|
3953
3967
|
"no-border-white",
|
|
@@ -3966,12 +3980,12 @@ const vn = [
|
|
|
3966
3980
|
// 线性·浅色 (Circular Outline Light) -> circular-outline-light
|
|
3967
3981
|
"standard"
|
|
3968
3982
|
// 标准 (Standard) -> standard
|
|
3969
|
-
],
|
|
3983
|
+
], bl = J.object({
|
|
3970
3984
|
props: J.object({
|
|
3971
3985
|
// 选中的社媒平台列表
|
|
3972
3986
|
platforms: J.array(J.enum(vn)).optional().nullable(),
|
|
3973
3987
|
// 图标类别
|
|
3974
|
-
iconStyle: J.enum(
|
|
3988
|
+
iconStyle: J.enum(hl).optional().nullable(),
|
|
3975
3989
|
// 图标统一尺寸(宽高相同)
|
|
3976
3990
|
iconSize: J.number().optional().nullable(),
|
|
3977
3991
|
// 每个平台的配置
|
|
@@ -3983,7 +3997,7 @@ const vn = [
|
|
|
3983
3997
|
).optional().nullable()
|
|
3984
3998
|
}).optional().nullable(),
|
|
3985
3999
|
style: J.object({
|
|
3986
|
-
padding:
|
|
4000
|
+
padding: ml().optional().nullable(),
|
|
3987
4001
|
backgroundColor: J.string().optional().nullable(),
|
|
3988
4002
|
textAlign: J.enum(["left", "center", "right"]).optional().nullable()
|
|
3989
4003
|
}).optional().nullable()
|
|
@@ -4012,10 +4026,10 @@ const vn = [
|
|
|
4012
4026
|
"with-border-line-white": { zh: "线性·浅色", en: "Circular Outline Light" },
|
|
4013
4027
|
standard: { zh: "标准", en: "Standard" }
|
|
4014
4028
|
};
|
|
4015
|
-
function
|
|
4029
|
+
function cc({ data: e, setData: t }) {
|
|
4016
4030
|
var T, U, ie;
|
|
4017
|
-
const { t: n, language: r } = Se(), [, i] = z(null), [l, a] = z(null), [c, s] = z(null), [d, u] = z(null), g =
|
|
4018
|
-
const p =
|
|
4031
|
+
const { t: n, language: r } = Se(), [, i] = z(null), [l, a] = z(null), [c, s] = z(null), [d, u] = z(null), g = Me(!1), f = (C) => {
|
|
4032
|
+
const p = bl.safeParse(C);
|
|
4019
4033
|
p.success ? (t(p.data), i(null)) : i(p.error);
|
|
4020
4034
|
}, m = ((T = e.props) == null ? void 0 : T.iconStyle) || "origin-colorful", h = ((U = e.props) == null ? void 0 : U.iconSize) ?? 36, S = ((ie = e.props) == null ? void 0 : ie.socials) || [];
|
|
4021
4035
|
S.map((C) => C.platform);
|
|
@@ -4212,7 +4226,7 @@ function sc({ data: e, setData: t }) {
|
|
|
4212
4226
|
onMouseDown: (K) => {
|
|
4213
4227
|
K.stopPropagation(), P();
|
|
4214
4228
|
},
|
|
4215
|
-
children: /* @__PURE__ */ o(
|
|
4229
|
+
children: /* @__PURE__ */ o(Fr, { fontSize: "small" })
|
|
4216
4230
|
}
|
|
4217
4231
|
),
|
|
4218
4232
|
/* @__PURE__ */ o(
|
|
@@ -4292,7 +4306,7 @@ function sc({ data: e, setData: t }) {
|
|
|
4292
4306
|
}
|
|
4293
4307
|
),
|
|
4294
4308
|
/* @__PURE__ */ o(
|
|
4295
|
-
|
|
4309
|
+
Oe,
|
|
4296
4310
|
{
|
|
4297
4311
|
startIcon: /* @__PURE__ */ o(ui, {}),
|
|
4298
4312
|
onClick: N,
|
|
@@ -4307,10 +4321,10 @@ function sc({ data: e, setData: t }) {
|
|
|
4307
4321
|
/* @__PURE__ */ o(rn, { sx: { my: 1 } }),
|
|
4308
4322
|
/* @__PURE__ */ w(se, { sx: { mb: 2 }, children: [
|
|
4309
4323
|
/* @__PURE__ */ o(ke, { variant: "body2", sx: { color: "text.secondary", mb: 1, fontSize: "12px", fontWeight: 500 }, children: n("socials.iconStyle") }),
|
|
4310
|
-
/* @__PURE__ */ o(Z, { spacing: 1, sx: { mt: 1 }, children:
|
|
4324
|
+
/* @__PURE__ */ o(Z, { spacing: 1, sx: { mt: 1 }, children: hl.map((C) => {
|
|
4311
4325
|
const p = x ? lr[C].zh : lr[C].en;
|
|
4312
4326
|
return /* @__PURE__ */ o(
|
|
4313
|
-
|
|
4327
|
+
Yi,
|
|
4314
4328
|
{
|
|
4315
4329
|
value: C,
|
|
4316
4330
|
selected: m === C,
|
|
@@ -4364,7 +4378,7 @@ function sc({ data: e, setData: t }) {
|
|
|
4364
4378
|
function ir(e) {
|
|
4365
4379
|
return /* @__PURE__ */ o(se, { sx: { m: 3, p: 1, border: "1px dashed", borderColor: "divider" }, children: /* @__PURE__ */ o(ke, { color: "text.secondary", children: e }) });
|
|
4366
4380
|
}
|
|
4367
|
-
function
|
|
4381
|
+
function uc() {
|
|
4368
4382
|
const { t: e } = Se(), t = Qe(), n = cn();
|
|
4369
4383
|
if (!n)
|
|
4370
4384
|
return ir(e("inspector.clickBlockToInspect"));
|
|
@@ -4374,28 +4388,28 @@ function cc() {
|
|
|
4374
4388
|
const i = (c) => _e({ [n]: c }), { data: l, type: a } = r;
|
|
4375
4389
|
switch (a) {
|
|
4376
4390
|
case "Button":
|
|
4377
|
-
return /* @__PURE__ */ o(
|
|
4391
|
+
return /* @__PURE__ */ o(Ks, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4378
4392
|
case "ColumnsContainer":
|
|
4379
|
-
return /* @__PURE__ */ o(qs, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4380
|
-
case "Container":
|
|
4381
4393
|
return /* @__PURE__ */ o(Ys, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4382
|
-
case "
|
|
4394
|
+
case "Container":
|
|
4383
4395
|
return /* @__PURE__ */ o(Xs, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4396
|
+
case "Divider":
|
|
4397
|
+
return /* @__PURE__ */ o(Gs, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4384
4398
|
case "Heading":
|
|
4385
|
-
return /* @__PURE__ */ o(
|
|
4399
|
+
return /* @__PURE__ */ o(Zs, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4386
4400
|
case "Html":
|
|
4387
|
-
return /* @__PURE__ */ o(Qs, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4388
|
-
case "Image":
|
|
4389
4401
|
return /* @__PURE__ */ o(ec, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4390
|
-
case "
|
|
4402
|
+
case "Image":
|
|
4391
4403
|
return /* @__PURE__ */ o(tc, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4404
|
+
case "Video":
|
|
4405
|
+
return /* @__PURE__ */ o(nc, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4392
4406
|
case "EmailLayout":
|
|
4393
|
-
return /* @__PURE__ */ o(
|
|
4407
|
+
return /* @__PURE__ */ o(fl, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4394
4408
|
case "Spacer":
|
|
4395
|
-
return /* @__PURE__ */ o(
|
|
4409
|
+
return /* @__PURE__ */ o(oc, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4396
4410
|
case "Text":
|
|
4397
4411
|
return /* @__PURE__ */ o(
|
|
4398
|
-
|
|
4412
|
+
sc,
|
|
4399
4413
|
{
|
|
4400
4414
|
blockId: n,
|
|
4401
4415
|
data: l,
|
|
@@ -4404,28 +4418,28 @@ function cc() {
|
|
|
4404
4418
|
n
|
|
4405
4419
|
);
|
|
4406
4420
|
case "Socials":
|
|
4407
|
-
return /* @__PURE__ */ o(
|
|
4421
|
+
return /* @__PURE__ */ o(cc, { data: l, setData: (c) => i({ type: a, data: c }) }, n);
|
|
4408
4422
|
default:
|
|
4409
4423
|
return /* @__PURE__ */ o("pre", { children: JSON.stringify(r, null, " ") });
|
|
4410
4424
|
}
|
|
4411
4425
|
}
|
|
4412
|
-
function
|
|
4426
|
+
function dc() {
|
|
4413
4427
|
const e = Qe().root;
|
|
4414
4428
|
if (!e)
|
|
4415
4429
|
return /* @__PURE__ */ o("p", { children: "Block not found" });
|
|
4416
4430
|
const { data: t, type: n } = e;
|
|
4417
4431
|
if (n !== "EmailLayout")
|
|
4418
4432
|
throw new Error('Expected "root" element to be of type EmailLayout');
|
|
4419
|
-
return /* @__PURE__ */ o(
|
|
4433
|
+
return /* @__PURE__ */ o(fl, { data: t, setData: (r) => _e({ root: { type: n, data: r } }) }, "root");
|
|
4420
4434
|
}
|
|
4421
4435
|
const ar = 320;
|
|
4422
|
-
function
|
|
4423
|
-
const { t: e } = Se(), t =
|
|
4436
|
+
function pc() {
|
|
4437
|
+
const { t: e } = Se(), t = Ca(), n = ko(), i = Io() === "preview", l = () => {
|
|
4424
4438
|
switch (t) {
|
|
4425
4439
|
case "block-configuration":
|
|
4426
|
-
return /* @__PURE__ */ o(cc, {});
|
|
4427
|
-
case "styles":
|
|
4428
4440
|
return /* @__PURE__ */ o(uc, {});
|
|
4441
|
+
case "styles":
|
|
4442
|
+
return /* @__PURE__ */ o(dc, {});
|
|
4429
4443
|
}
|
|
4430
4444
|
};
|
|
4431
4445
|
return /* @__PURE__ */ w(
|
|
@@ -4457,7 +4471,7 @@ function dc() {
|
|
|
4457
4471
|
}
|
|
4458
4472
|
},
|
|
4459
4473
|
children: [
|
|
4460
|
-
/* @__PURE__ */ o(se, { px: 2, children: /* @__PURE__ */ w(kr, { value: t, onChange: (a, c) =>
|
|
4474
|
+
/* @__PURE__ */ o(se, { px: 2, children: /* @__PURE__ */ w(kr, { value: t, onChange: (a, c) => Sa(c), children: [
|
|
4461
4475
|
/* @__PURE__ */ o(Zt, { value: "styles", label: e("inspector.styles") }),
|
|
4462
4476
|
/* @__PURE__ */ o(Zt, { value: "block-configuration", label: e("inspector.inspect") })
|
|
4463
4477
|
] }) }),
|
|
@@ -4479,7 +4493,7 @@ function dc() {
|
|
|
4479
4493
|
}
|
|
4480
4494
|
);
|
|
4481
4495
|
}
|
|
4482
|
-
const
|
|
4496
|
+
const fc = {
|
|
4483
4497
|
welcome: () => import("./chunks/chunk-Cc3ecmGS.js").then((e) => e.w).then((e) => e.default),
|
|
4484
4498
|
"one-time-password": () => import("./chunks/chunk-Cc3ecmGS.js").then((e) => e.o).then((e) => e.default),
|
|
4485
4499
|
"order-ecomerce": () => import("./chunks/chunk-Cc3ecmGS.js").then((e) => e.a).then((e) => e.default),
|
|
@@ -4496,8 +4510,8 @@ const pc = {
|
|
|
4496
4510
|
"uspeedo-mothers-day": () => import("./chunks/chunk-Cc3ecmGS.js").then((e) => e.h).then((e) => e.default),
|
|
4497
4511
|
"uspeedo-shopping-cart": () => import("./chunks/chunk-Cc3ecmGS.js").then((e) => e.i).then((e) => e.default)
|
|
4498
4512
|
}, no = {};
|
|
4499
|
-
async function
|
|
4500
|
-
const t =
|
|
4513
|
+
async function mc(e) {
|
|
4514
|
+
const t = fc[e];
|
|
4501
4515
|
if (!t)
|
|
4502
4516
|
return sn;
|
|
4503
4517
|
if (no[e])
|
|
@@ -4507,10 +4521,10 @@ async function fc(e) {
|
|
|
4507
4521
|
}
|
|
4508
4522
|
function Ye({ sampleName: e, children: t }) {
|
|
4509
4523
|
const [n, r] = z(!1);
|
|
4510
|
-
return /* @__PURE__ */ o(
|
|
4524
|
+
return /* @__PURE__ */ o(Oe, { size: "small", onClick: async () => {
|
|
4511
4525
|
r(!0);
|
|
4512
4526
|
try {
|
|
4513
|
-
const l = await
|
|
4527
|
+
const l = await mc(e);
|
|
4514
4528
|
Rt(l);
|
|
4515
4529
|
} catch {
|
|
4516
4530
|
} finally {
|
|
@@ -4518,7 +4532,7 @@ function Ye({ sampleName: e, children: t }) {
|
|
|
4518
4532
|
}
|
|
4519
4533
|
}, disabled: n, children: n ? "Loading..." : t });
|
|
4520
4534
|
}
|
|
4521
|
-
const
|
|
4535
|
+
const gc = { p: 1.5, display: "flex", flexDirection: "column" }, hc = {
|
|
4522
4536
|
mb: 0.75,
|
|
4523
4537
|
width: "100%",
|
|
4524
4538
|
bgcolor: "cadet.200",
|
|
@@ -4528,7 +4542,7 @@ const mc = { p: 1.5, display: "flex", flexDirection: "column" }, gc = {
|
|
|
4528
4542
|
border: "1px solid",
|
|
4529
4543
|
borderColor: "cadet.300"
|
|
4530
4544
|
};
|
|
4531
|
-
function
|
|
4545
|
+
function Cl({ label: e, icon: t, onClick: n, disabled: r = !1, block: i, onDragStart: l }) {
|
|
4532
4546
|
const [a, c] = mt.useState(!1), s = mt.useRef(null), d = (g) => {
|
|
4533
4547
|
if (!i || r) {
|
|
4534
4548
|
g.preventDefault();
|
|
@@ -4549,11 +4563,11 @@ function yl({ label: e, icon: t, onClick: n, disabled: r = !1, block: i, onDragS
|
|
|
4549
4563
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, window.__isSidebarBlock = !1, c(!1);
|
|
4550
4564
|
};
|
|
4551
4565
|
return /* @__PURE__ */ w(
|
|
4552
|
-
|
|
4566
|
+
Oe,
|
|
4553
4567
|
{
|
|
4554
4568
|
ref: s,
|
|
4555
4569
|
sx: {
|
|
4556
|
-
...
|
|
4570
|
+
...gc,
|
|
4557
4571
|
// cursor: disabled ? 'default' : 'move',
|
|
4558
4572
|
outline: a ? "2px dashed rgba(0,121,204, 0.8)" : "none",
|
|
4559
4573
|
outlineOffset: a ? "-2px" : "0",
|
|
@@ -4572,13 +4586,13 @@ function yl({ label: e, icon: t, onClick: n, disabled: r = !1, block: i, onDragS
|
|
|
4572
4586
|
g.stopPropagation(), r || n();
|
|
4573
4587
|
},
|
|
4574
4588
|
children: [
|
|
4575
|
-
/* @__PURE__ */ o(se, { sx:
|
|
4589
|
+
/* @__PURE__ */ o(se, { sx: hc, children: t }),
|
|
4576
4590
|
/* @__PURE__ */ o(ke, { variant: "body2", children: e })
|
|
4577
4591
|
]
|
|
4578
4592
|
}
|
|
4579
4593
|
);
|
|
4580
4594
|
}
|
|
4581
|
-
const
|
|
4595
|
+
const yl = [
|
|
4582
4596
|
{
|
|
4583
4597
|
label: "Heading",
|
|
4584
4598
|
icon: /* @__PURE__ */ o(di, {}),
|
|
@@ -4754,7 +4768,7 @@ const xl = [
|
|
|
4754
4768
|
}
|
|
4755
4769
|
// { label: 'ProgressBar', icon: <ProgressBarOutlined />, block: () => ({}) },
|
|
4756
4770
|
// { label: 'LoopContainer', icon: <ViewListOutlined />, block: () => ({}) },
|
|
4757
|
-
],
|
|
4771
|
+
], bc = (e) => ({
|
|
4758
4772
|
Heading: "heading.name",
|
|
4759
4773
|
Text: "text.name",
|
|
4760
4774
|
Button: "button.name",
|
|
@@ -4767,15 +4781,15 @@ const xl = [
|
|
|
4767
4781
|
ColumnsContainer: "columns.name",
|
|
4768
4782
|
Container: "container.name"
|
|
4769
4783
|
})[e] || e;
|
|
4770
|
-
function
|
|
4771
|
-
const { t: r } = Se(), i =
|
|
4784
|
+
function Cc({ onSelect: e, disableContainerBlocks: t = !1, containerType: n = null }) {
|
|
4785
|
+
const { t: r } = Se(), i = yl.filter((l) => {
|
|
4772
4786
|
const a = l.block(), c = a.type === "Container" || a.type === "ColumnsContainer";
|
|
4773
4787
|
return !(t && c && (n === "Container" && a.type === "ColumnsContainer" || n === "ColumnsContainer" && a.type === "ColumnsContainer" || !n || n !== "Container" && n !== "ColumnsContainer"));
|
|
4774
4788
|
});
|
|
4775
4789
|
return /* @__PURE__ */ o(se, { sx: { p: 1, display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 0.5 }, children: i.map((l, a) => {
|
|
4776
|
-
const c = l.block(), s =
|
|
4790
|
+
const c = l.block(), s = bc(c.type), d = r(s);
|
|
4777
4791
|
return /* @__PURE__ */ o(
|
|
4778
|
-
|
|
4792
|
+
Cl,
|
|
4779
4793
|
{
|
|
4780
4794
|
label: d,
|
|
4781
4795
|
icon: l.icon,
|
|
@@ -4788,18 +4802,18 @@ function bc({ onSelect: e, disableContainerBlocks: t = !1, containerType: n = nu
|
|
|
4788
4802
|
}) });
|
|
4789
4803
|
}
|
|
4790
4804
|
const sr = 240;
|
|
4791
|
-
function
|
|
4805
|
+
function yc() {
|
|
4792
4806
|
return `block-${Date.now()}`;
|
|
4793
4807
|
}
|
|
4794
|
-
function
|
|
4795
|
-
const { t: e } = Se(), t = Do(), n = Qe(), r =
|
|
4808
|
+
function xc() {
|
|
4809
|
+
const { t: e } = Se(), t = Do(), n = Qe(), r = Ra(), i = Va(), l = () => {
|
|
4796
4810
|
Rt(sn);
|
|
4797
4811
|
}, a = () => {
|
|
4798
4812
|
for (const [m, h] of Object.entries(n))
|
|
4799
4813
|
if (h.type === "EmailLayout")
|
|
4800
4814
|
return m;
|
|
4801
4815
|
return null;
|
|
4802
|
-
}, [c, s] = z(null), d =
|
|
4816
|
+
}, [c, s] = z(null), d = Me(null), u = (m) => {
|
|
4803
4817
|
d.current && clearTimeout(d.current), s(m.currentTarget);
|
|
4804
4818
|
}, g = (m = 0) => {
|
|
4805
4819
|
d.current && clearTimeout(d.current), m ? d.current = setTimeout(() => s(null), m) : (d.current = null, s(null));
|
|
@@ -4807,7 +4821,7 @@ function yc() {
|
|
|
4807
4821
|
const h = a();
|
|
4808
4822
|
if (!h)
|
|
4809
4823
|
return;
|
|
4810
|
-
const b =
|
|
4824
|
+
const b = yc(), S = n[h];
|
|
4811
4825
|
if (!S || S.type !== "EmailLayout")
|
|
4812
4826
|
return;
|
|
4813
4827
|
const k = [...S.data.childrenIds || [], b];
|
|
@@ -4854,7 +4868,7 @@ function yc() {
|
|
|
4854
4868
|
r && /* @__PURE__ */ w(an, { children: [
|
|
4855
4869
|
/* @__PURE__ */ o(ke, { variant: "h6", component: "h1", sx: { p: 0.75 }, children: e("common.emailBuilder") }),
|
|
4856
4870
|
/* @__PURE__ */ o(Z, { spacing: 1, alignItems: "flex-start", style: { marginTop: r ? 0 : 8 }, children: /* @__PURE__ */ o(
|
|
4857
|
-
|
|
4871
|
+
Oe,
|
|
4858
4872
|
{
|
|
4859
4873
|
variant: "contained",
|
|
4860
4874
|
color: "primary",
|
|
@@ -4887,7 +4901,7 @@ function yc() {
|
|
|
4887
4901
|
onMouseLeave: () => g(180),
|
|
4888
4902
|
sx: { width: "100%" },
|
|
4889
4903
|
children: /* @__PURE__ */ w(
|
|
4890
|
-
|
|
4904
|
+
Oe,
|
|
4891
4905
|
{
|
|
4892
4906
|
size: "small",
|
|
4893
4907
|
sx: { cursor: "default", width: "100%", justifyContent: "space-between" },
|
|
@@ -4900,7 +4914,7 @@ function yc() {
|
|
|
4900
4914
|
}
|
|
4901
4915
|
),
|
|
4902
4916
|
/* @__PURE__ */ o(
|
|
4903
|
-
|
|
4917
|
+
Wl,
|
|
4904
4918
|
{
|
|
4905
4919
|
href: "https://uspeedo.com/email",
|
|
4906
4920
|
target: "_blank",
|
|
@@ -4944,17 +4958,17 @@ function yc() {
|
|
|
4944
4958
|
i || null,
|
|
4945
4959
|
/* @__PURE__ */ w(Z, { spacing: 1, sx: { mt: r ? 0 : "16px !important" }, children: [
|
|
4946
4960
|
/* @__PURE__ */ o(ke, { variant: "caption", color: "text.secondary", sx: { px: 0.75, fontWeight: 500 }, children: e("common.addContentBlocks") }),
|
|
4947
|
-
/* @__PURE__ */ o(
|
|
4961
|
+
/* @__PURE__ */ o(Cc, { onSelect: f, disableContainerBlocks: !1 })
|
|
4948
4962
|
] })
|
|
4949
4963
|
] }) })
|
|
4950
4964
|
}
|
|
4951
4965
|
);
|
|
4952
4966
|
}
|
|
4953
|
-
const
|
|
4954
|
-
function
|
|
4955
|
-
return /* @__PURE__ */ o(
|
|
4967
|
+
const Sc = ho(!1);
|
|
4968
|
+
function vc({ value: e, children: t }) {
|
|
4969
|
+
return /* @__PURE__ */ o(Sc.Provider, { value: e, children: t });
|
|
4956
4970
|
}
|
|
4957
|
-
const
|
|
4971
|
+
const wc = (e) => ({
|
|
4958
4972
|
Heading: "heading.name",
|
|
4959
4973
|
Text: "text.name",
|
|
4960
4974
|
Button: "button.name",
|
|
@@ -4967,7 +4981,7 @@ const vc = (e) => ({
|
|
|
4967
4981
|
ColumnsContainer: "columns.name",
|
|
4968
4982
|
Container: "container.name"
|
|
4969
4983
|
})[e] || e;
|
|
4970
|
-
function
|
|
4984
|
+
function Ic({ anchorEl: e, setAnchorEl: t, onSelect: n, disableContainerBlocks: r = !1, containerType: i = null }) {
|
|
4971
4985
|
const { t: l } = Se(), a = () => {
|
|
4972
4986
|
t(null);
|
|
4973
4987
|
}, c = (d) => {
|
|
@@ -4975,7 +4989,7 @@ function wc({ anchorEl: e, setAnchorEl: t, onSelect: n, disableContainerBlocks:
|
|
|
4975
4989
|
};
|
|
4976
4990
|
if (e === null)
|
|
4977
4991
|
return null;
|
|
4978
|
-
const s =
|
|
4992
|
+
const s = yl.filter((d) => {
|
|
4979
4993
|
const u = d.block(), g = u.type === "Container" || u.type === "ColumnsContainer";
|
|
4980
4994
|
return !(r && g && (i === "Container" && u.type === "ColumnsContainer" || i === "ColumnsContainer" && u.type === "ColumnsContainer" || !i || i !== "Container" && i !== "ColumnsContainer"));
|
|
4981
4995
|
});
|
|
@@ -4988,9 +5002,9 @@ function wc({ anchorEl: e, setAnchorEl: t, onSelect: n, disableContainerBlocks:
|
|
|
4988
5002
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
4989
5003
|
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
4990
5004
|
children: /* @__PURE__ */ o(se, { sx: { p: 1, display: "grid", gridTemplateColumns: "1fr 1fr 1fr 1fr" }, children: s.map((d, u) => {
|
|
4991
|
-
const g = d.block(), f =
|
|
5005
|
+
const g = d.block(), f = wc(g.type), m = l(f);
|
|
4992
5006
|
return /* @__PURE__ */ o(
|
|
4993
|
-
|
|
5007
|
+
Cl,
|
|
4994
5008
|
{
|
|
4995
5009
|
label: m,
|
|
4996
5010
|
icon: d.icon,
|
|
@@ -5003,7 +5017,7 @@ function wc({ anchorEl: e, setAnchorEl: t, onSelect: n, disableContainerBlocks:
|
|
|
5003
5017
|
}
|
|
5004
5018
|
);
|
|
5005
5019
|
}
|
|
5006
|
-
function
|
|
5020
|
+
function kc({ buttonElement: e, onClick: t }) {
|
|
5007
5021
|
const [n, r] = z(!1);
|
|
5008
5022
|
return Ce(() => {
|
|
5009
5023
|
function i({ clientX: l, clientY: a }) {
|
|
@@ -5019,7 +5033,7 @@ function Ic({ buttonElement: e, onClick: t }) {
|
|
|
5019
5033
|
return window.addEventListener("mousemove", i), () => {
|
|
5020
5034
|
window.removeEventListener("mousemove", i);
|
|
5021
5035
|
};
|
|
5022
|
-
}, [e, r]), /* @__PURE__ */ o(
|
|
5036
|
+
}, [e, r]), /* @__PURE__ */ o(Hl, { in: n, children: /* @__PURE__ */ o(
|
|
5023
5037
|
$e,
|
|
5024
5038
|
{
|
|
5025
5039
|
size: "small",
|
|
@@ -5044,7 +5058,7 @@ function Ic({ buttonElement: e, onClick: t }) {
|
|
|
5044
5058
|
}
|
|
5045
5059
|
) });
|
|
5046
5060
|
}
|
|
5047
|
-
function
|
|
5061
|
+
function Dc({ onClick: e }) {
|
|
5048
5062
|
return /* @__PURE__ */ o(
|
|
5049
5063
|
Fn,
|
|
5050
5064
|
{
|
|
@@ -5079,13 +5093,13 @@ function oo({ onSelect: e, placeholder: t, disableContainerBlocks: n = !1, conta
|
|
|
5079
5093
|
l(a);
|
|
5080
5094
|
};
|
|
5081
5095
|
return /* @__PURE__ */ w(an, { children: [
|
|
5082
|
-
/* @__PURE__ */ o("div", { ref: c, style: { position: "relative" }, children: t ? /* @__PURE__ */ o(
|
|
5083
|
-
/* @__PURE__ */ o(
|
|
5096
|
+
/* @__PURE__ */ o("div", { ref: c, style: { position: "relative" }, children: t ? /* @__PURE__ */ o(Dc, { onClick: s }) : /* @__PURE__ */ o(kc, { buttonElement: a, onClick: s }) }),
|
|
5097
|
+
/* @__PURE__ */ o(Ic, { anchorEl: i, setAnchorEl: l, onSelect: e, disableContainerBlocks: n, containerType: r })
|
|
5084
5098
|
] });
|
|
5085
5099
|
}
|
|
5086
|
-
let
|
|
5100
|
+
let Ec = 0;
|
|
5087
5101
|
function kt() {
|
|
5088
|
-
return `block-${Date.now()}-${++
|
|
5102
|
+
return `block-${Date.now()}-${++Ec}`;
|
|
5089
5103
|
}
|
|
5090
5104
|
const Gt = () => window.__currentDraggedBlockId || null, Jt = () => window.__currentDraggedBlock || null;
|
|
5091
5105
|
function Te(e, t) {
|
|
@@ -5167,7 +5181,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5167
5181
|
typeof document < "u" && document.body && (document.body.style.cursor = "");
|
|
5168
5182
|
};
|
|
5169
5183
|
}, [d]);
|
|
5170
|
-
const b =
|
|
5184
|
+
const b = O.getState().document, S = n ? (ce = b[n]) == null ? void 0 : ce.type : null, y = S === "Container" || S === "ColumnsContainer", k = S === "ColumnsContainer", D = (_) => {
|
|
5171
5185
|
const x = kt();
|
|
5172
5186
|
return t({
|
|
5173
5187
|
blockId: x,
|
|
@@ -5185,7 +5199,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5185
5199
|
_.preventDefault(), _.stopPropagation();
|
|
5186
5200
|
const T = Gt();
|
|
5187
5201
|
if (T) {
|
|
5188
|
-
const U = Jt(), ie =
|
|
5202
|
+
const U = Jt(), ie = O.getState().document, C = Lt(U, n, ie);
|
|
5189
5203
|
u(!C), C ? (_.dataTransfer.effectAllowed = "move", _.dataTransfer.dropEffect = "move") : (_.dataTransfer.effectAllowed = "none", _.dataTransfer.dropEffect = "none"), a(T);
|
|
5190
5204
|
const p = _.currentTarget.getBoundingClientRect(), F = _.clientY, X = p.top + p.height / 2;
|
|
5191
5205
|
if (F < X)
|
|
@@ -5237,7 +5251,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5237
5251
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, a(null), s(null);
|
|
5238
5252
|
return;
|
|
5239
5253
|
}
|
|
5240
|
-
const F =
|
|
5254
|
+
const F = O.getState().document;
|
|
5241
5255
|
if (!Lt(ie, n, F)) {
|
|
5242
5256
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, a(null), s(null), u(!1);
|
|
5243
5257
|
return;
|
|
@@ -5265,7 +5279,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5265
5279
|
_.preventDefault(), _.stopPropagation();
|
|
5266
5280
|
const x = Gt();
|
|
5267
5281
|
if (x) {
|
|
5268
|
-
const T = Jt(), U =
|
|
5282
|
+
const T = Jt(), U = O.getState().document, ie = Lt(T, n, U);
|
|
5269
5283
|
u(!ie), ie ? (_.dataTransfer.effectAllowed = "move", _.dataTransfer.dropEffect = "move") : (_.dataTransfer.effectAllowed = "none", _.dataTransfer.dropEffect = "none"), a(x), s(0);
|
|
5270
5284
|
}
|
|
5271
5285
|
},
|
|
@@ -5287,7 +5301,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5287
5301
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, a(null), s(null);
|
|
5288
5302
|
return;
|
|
5289
5303
|
}
|
|
5290
|
-
const C =
|
|
5304
|
+
const C = O.getState().document;
|
|
5291
5305
|
if (!Lt(T, n, C)) {
|
|
5292
5306
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, a(null), s(null), u(!1);
|
|
5293
5307
|
return;
|
|
@@ -5336,17 +5350,17 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5336
5350
|
!r && // 列有元素
|
|
5337
5351
|
!V && // 不是跨列拖拽
|
|
5338
5352
|
ve, K = r && c === x && U || X && c === x, Re = !r && c === x && U && !X && !we && !V, je = !r && T && c === e.length && U && !we && !V;
|
|
5339
|
-
return /* @__PURE__ */ w(
|
|
5353
|
+
return /* @__PURE__ */ w(_l, { children: [
|
|
5340
5354
|
!k && /* @__PURE__ */ o(se, { component: "span", sx: { flex: "none", alignSelf: "flex-start" }, children: /* @__PURE__ */ o(oo, { onSelect: (pe) => E(pe, x), disableContainerBlocks: y, containerType: S }) }),
|
|
5341
5355
|
/* @__PURE__ */ o(
|
|
5342
5356
|
se,
|
|
5343
5357
|
{
|
|
5344
5358
|
onDragOver: (pe) => {
|
|
5345
|
-
var fe, I,
|
|
5359
|
+
var fe, I, M, $, j, R, de, Ee, Pe;
|
|
5346
5360
|
pe.preventDefault(), pe.stopPropagation();
|
|
5347
5361
|
const q = Gt();
|
|
5348
5362
|
if (!q) return;
|
|
5349
|
-
const v = Jt(), Y =
|
|
5363
|
+
const v = Jt(), Y = O.getState().document, ee = Lt(v, n, Y);
|
|
5350
5364
|
u(!ee), ee ? (pe.dataTransfer.effectAllowed = "move", pe.dataTransfer.dropEffect = "move") : (pe.dataTransfer.effectAllowed = "none", pe.dataTransfer.dropEffect = "none");
|
|
5351
5365
|
const L = !e.includes(q), ae = window.__isSidebarBlock === !0 ? { containerId: null, columnIndex: null } : Te(Y, q), re = Te(Y, _), ue = ae.columnIndex !== null, te = re.columnIndex !== null, Q = ue && te && re.containerId !== null && // 如果是同一个容器,需要是不同的列(避免同一列内部拖拽)
|
|
5352
5366
|
// 如果是不同的容器,只要都在列中即可(允许跨容器拖拽)
|
|
@@ -5360,7 +5374,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5360
5374
|
if (ye) {
|
|
5361
5375
|
const Be = Y[ye];
|
|
5362
5376
|
if (Be && Be.type === "ColumnsContainer") {
|
|
5363
|
-
if ((((fe = Be.data.props) == null ? void 0 : fe.columnsCount) || ((
|
|
5377
|
+
if ((((fe = Be.data.props) == null ? void 0 : fe.columnsCount) || ((M = (I = Be.data.props) == null ? void 0 : I.columns) == null ? void 0 : M.length) || 0) >= 4) {
|
|
5364
5378
|
u(!0), pe.dataTransfer.effectAllowed = "none", pe.dataTransfer.dropEffect = "none", f(null), h(null), s(null);
|
|
5365
5379
|
return;
|
|
5366
5380
|
}
|
|
@@ -5400,14 +5414,14 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5400
5414
|
a(q), s(null), An < Tn ? f("left") : f("right"), h(x);
|
|
5401
5415
|
return;
|
|
5402
5416
|
}
|
|
5403
|
-
const St = pe.currentTarget.getBoundingClientRect(), Bt = pe.clientX, vt = pe.clientY,
|
|
5417
|
+
const St = pe.currentTarget.getBoundingClientRect(), Bt = pe.clientX, vt = pe.clientY, Ot = St.bottom, zt = St.width * 0.15;
|
|
5404
5418
|
if (Bt < St.left + zt) {
|
|
5405
5419
|
a(q), f("left"), h(x), s(null);
|
|
5406
5420
|
return;
|
|
5407
5421
|
} else if (Bt > St.right - zt) {
|
|
5408
5422
|
a(q), f("right"), h(x), s(null);
|
|
5409
5423
|
return;
|
|
5410
|
-
} else if (vt >
|
|
5424
|
+
} else if (vt > Ot - St.height / 2) {
|
|
5411
5425
|
a(q), s(e.length), f(null), h(null);
|
|
5412
5426
|
return;
|
|
5413
5427
|
}
|
|
@@ -5432,8 +5446,8 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5432
5446
|
return;
|
|
5433
5447
|
}
|
|
5434
5448
|
if (We) {
|
|
5435
|
-
const vt = pe.currentTarget.getBoundingClientRect(),
|
|
5436
|
-
a(q), s(null),
|
|
5449
|
+
const vt = pe.currentTarget.getBoundingClientRect(), Ot = pe.clientX, zt = vt.left + vt.width / 2;
|
|
5450
|
+
a(q), s(null), Ot < zt ? f("left") : f("right"), h(x);
|
|
5437
5451
|
return;
|
|
5438
5452
|
}
|
|
5439
5453
|
const Xe = pe.currentTarget.getBoundingClientRect(), Ke = pe.clientX, $t = pe.clientY;
|
|
@@ -5449,8 +5463,8 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5449
5463
|
if (a(q), f(null), h(null), $t < St)
|
|
5450
5464
|
s(x);
|
|
5451
5465
|
else {
|
|
5452
|
-
const vt = (e == null ? void 0 : e.length) || 0,
|
|
5453
|
-
s(
|
|
5466
|
+
const vt = (e == null ? void 0 : e.length) || 0, Ot = Math.min(x + 1, vt);
|
|
5467
|
+
s(Ot);
|
|
5454
5468
|
}
|
|
5455
5469
|
return;
|
|
5456
5470
|
}
|
|
@@ -5464,7 +5478,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5464
5478
|
},
|
|
5465
5479
|
onDragLeave: W,
|
|
5466
5480
|
onDrop: (pe) => {
|
|
5467
|
-
var vt,
|
|
5481
|
+
var vt, Ot, zt, dn, An, Tn, Bo, Oo, Mo, No, Ro, Po, Fo, zo;
|
|
5468
5482
|
pe.preventDefault(), pe.stopPropagation();
|
|
5469
5483
|
const q = pe.dataTransfer.getData("text/plain") || Gt();
|
|
5470
5484
|
if (!q || !e) {
|
|
@@ -5476,7 +5490,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5476
5490
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, window.__isSidebarBlock = !1, a(null), s(null), f(null), h(null);
|
|
5477
5491
|
return;
|
|
5478
5492
|
}
|
|
5479
|
-
const Y = window.__isSidebarBlock === !0, ee = _, L =
|
|
5493
|
+
const Y = window.__isSidebarBlock === !0, ee = _, L = O.getState().document, G = L[ee], ae = (v == null ? void 0 : v.type) === "Container" || (v == null ? void 0 : v.type) === "ColumnsContainer", re = (G == null ? void 0 : G.type) === "Container" || (G == null ? void 0 : G.type) === "ColumnsContainer", ue = Y ? { containerId: null, columnIndex: null } : Te(L, q), te = Te(L, ee), Q = ue.columnIndex !== null, Ie = te.columnIndex !== null, ne = Q && Ie && ue.containerId === te.containerId && ue.containerId !== null && ue.columnIndex !== te.columnIndex, A = Q && Ie && ue.containerId === te.containerId && ue.columnIndex === te.columnIndex;
|
|
5480
5494
|
if (ne && !ae && !re && q !== ee) {
|
|
5481
5495
|
const Ne = ue.columnIndex, ze = te.columnIndex, Fe = ue.containerId, qe = L[Fe];
|
|
5482
5496
|
if (qe && qe.type === "ColumnsContainer") {
|
|
@@ -5575,7 +5589,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5575
5589
|
if (et) {
|
|
5576
5590
|
const tt = L[et];
|
|
5577
5591
|
if (tt && tt.type === "ColumnsContainer") {
|
|
5578
|
-
const lt = ((
|
|
5592
|
+
const lt = ((Ot = tt.data.props) == null ? void 0 : Ot.columnsCount) || ((dn = (zt = tt.data.props) == null ? void 0 : zt.columns) == null ? void 0 : dn.length) || 0;
|
|
5579
5593
|
if (lt >= 4) {
|
|
5580
5594
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, window.__isSidebarBlock = !1, a(null), s(null), u(!1);
|
|
5581
5595
|
return;
|
|
@@ -5590,7 +5604,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5590
5604
|
const Lo = Ne ? { containerId: null, columnIndex: null } : Te(L, q);
|
|
5591
5605
|
let Wo = L;
|
|
5592
5606
|
!Ne && Lo.containerId && (Wo = Wt(L, q, Lo));
|
|
5593
|
-
const
|
|
5607
|
+
const El = {
|
|
5594
5608
|
...tt,
|
|
5595
5609
|
data: {
|
|
5596
5610
|
...tt.data,
|
|
@@ -5604,7 +5618,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5604
5618
|
};
|
|
5605
5619
|
_e({
|
|
5606
5620
|
...Wo,
|
|
5607
|
-
[et]:
|
|
5621
|
+
[et]: El,
|
|
5608
5622
|
[pn]: v
|
|
5609
5623
|
}), window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, window.__isSidebarBlock = !1, a(null), s(null), f(null), h(null);
|
|
5610
5624
|
return;
|
|
@@ -5667,7 +5681,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5667
5681
|
if (Ne) {
|
|
5668
5682
|
const ze = L[Ne];
|
|
5669
5683
|
if (ze && ze.type === "ColumnsContainer") {
|
|
5670
|
-
const Fe = ((
|
|
5684
|
+
const Fe = ((Oo = ze.data.props) == null ? void 0 : Oo.columnsCount) || ((No = (Mo = ze.data.props) == null ? void 0 : Mo.columns) == null ? void 0 : No.length) || 0;
|
|
5671
5685
|
if (Fe >= 4) {
|
|
5672
5686
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, a(null), s(null), u(!1);
|
|
5673
5687
|
return;
|
|
@@ -5780,7 +5794,7 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5780
5794
|
} : {}
|
|
5781
5795
|
}
|
|
5782
5796
|
},
|
|
5783
|
-
children: /* @__PURE__ */ o(
|
|
5797
|
+
children: /* @__PURE__ */ o(kl, { id: _ })
|
|
5784
5798
|
}
|
|
5785
5799
|
)
|
|
5786
5800
|
] }, _);
|
|
@@ -5789,8 +5803,8 @@ function To({ childrenIds: e, onChange: t, containerId: n, allowReplace: r = !1,
|
|
|
5789
5803
|
] });
|
|
5790
5804
|
return i ? /* @__PURE__ */ o(se, { sx: cr, children: be }) : be;
|
|
5791
5805
|
}
|
|
5792
|
-
const
|
|
5793
|
-
function
|
|
5806
|
+
const Ac = [{ childrenIds: [] }], Tc = [{ childrenIds: [] }, { childrenIds: [] }], _c = [{ childrenIds: [] }, { childrenIds: [] }, { childrenIds: [] }], Bc = [{ childrenIds: [] }, { childrenIds: [] }, { childrenIds: [] }, { childrenIds: [] }];
|
|
5807
|
+
function Oc({ style: e, props: t }) {
|
|
5794
5808
|
var E;
|
|
5795
5809
|
const n = Tt();
|
|
5796
5810
|
Qe();
|
|
@@ -5803,10 +5817,10 @@ function Bc({ style: e, props: t }) {
|
|
|
5803
5817
|
N.push({ childrenIds: [] });
|
|
5804
5818
|
return N;
|
|
5805
5819
|
}
|
|
5806
|
-
return s === 1 ?
|
|
5820
|
+
return s === 1 ? Ac : s === 2 ? Tc : s === 4 ? Bc : _c;
|
|
5807
5821
|
}, [i, s]), u = (N, { block: W, blockId: P, childrenIds: he }) => {
|
|
5808
5822
|
var F, X, V;
|
|
5809
|
-
const be =
|
|
5823
|
+
const be = O.getState().document, ce = be[P] && be[P].type, _ = be[n];
|
|
5810
5824
|
let x = d;
|
|
5811
5825
|
if (_ && _.type === "ColumnsContainer") {
|
|
5812
5826
|
const me = (F = _.data.props) == null ? void 0 : F.columns;
|
|
@@ -5872,13 +5886,13 @@ function Bc({ style: e, props: t }) {
|
|
|
5872
5886
|
fillHeight: b || ce
|
|
5873
5887
|
}
|
|
5874
5888
|
) }, W);
|
|
5875
|
-
return b || ce ? /* @__PURE__ */ o(
|
|
5889
|
+
return b || ce ? /* @__PURE__ */ o(vc, { value: !0, children: x }, W) : x;
|
|
5876
5890
|
}), D = {
|
|
5877
5891
|
...c && typeof c == "object" ? c : {},
|
|
5878
5892
|
columnsCount: s
|
|
5879
5893
|
};
|
|
5880
5894
|
return /* @__PURE__ */ o(se, { sx: { color: "inherit", width: "100%", minWidth: 0, maxWidth: "100%", boxSizing: "border-box" }, children: /* @__PURE__ */ o(
|
|
5881
|
-
|
|
5895
|
+
Mi,
|
|
5882
5896
|
{
|
|
5883
5897
|
props: D,
|
|
5884
5898
|
style: e,
|
|
@@ -5888,7 +5902,7 @@ function Bc({ style: e, props: t }) {
|
|
|
5888
5902
|
}
|
|
5889
5903
|
function Mc({ style: e, props: t }) {
|
|
5890
5904
|
const n = (t == null ? void 0 : t.childrenIds) ?? [], r = Qe(), i = Tt();
|
|
5891
|
-
return /* @__PURE__ */ o(
|
|
5905
|
+
return /* @__PURE__ */ o(Ri, { style: e, children: /* @__PURE__ */ o(
|
|
5892
5906
|
To,
|
|
5893
5907
|
{
|
|
5894
5908
|
childrenIds: n,
|
|
@@ -5906,7 +5920,7 @@ function Mc({ style: e, props: t }) {
|
|
|
5906
5920
|
}
|
|
5907
5921
|
});
|
|
5908
5922
|
else {
|
|
5909
|
-
const s =
|
|
5923
|
+
const s = O.getState().document, d = s[a] && s[a].type, u = {
|
|
5910
5924
|
[i]: {
|
|
5911
5925
|
type: "Container",
|
|
5912
5926
|
data: {
|
|
@@ -5921,12 +5935,12 @@ function Mc({ style: e, props: t }) {
|
|
|
5921
5935
|
}
|
|
5922
5936
|
) });
|
|
5923
5937
|
}
|
|
5924
|
-
let
|
|
5925
|
-
function
|
|
5926
|
-
return `block-${Date.now()}-${++
|
|
5938
|
+
let Nc = 0;
|
|
5939
|
+
function Rc() {
|
|
5940
|
+
return `block-${Date.now()}-${++Nc}`;
|
|
5927
5941
|
}
|
|
5928
|
-
const ur = () => window.__currentDraggedBlockId || null,
|
|
5929
|
-
function
|
|
5942
|
+
const ur = () => window.__currentDraggedBlockId || null, Pc = () => window.__currentDraggedBlock || null;
|
|
5943
|
+
function Fc(e) {
|
|
5930
5944
|
switch (e ?? "MODERN_SANS") {
|
|
5931
5945
|
case "MODERN_SANS":
|
|
5932
5946
|
return "Helvetica, Arial, sans-serif";
|
|
@@ -5948,7 +5962,7 @@ function Pc(e) {
|
|
|
5948
5962
|
return "monospace";
|
|
5949
5963
|
}
|
|
5950
5964
|
}
|
|
5951
|
-
function
|
|
5965
|
+
function zc(e) {
|
|
5952
5966
|
const t = e.childrenIds ?? [], n = Qe(), r = Tt();
|
|
5953
5967
|
return /* @__PURE__ */ o(
|
|
5954
5968
|
"div",
|
|
@@ -5971,7 +5985,7 @@ function Fc(e) {
|
|
|
5971
5985
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, window.__isSidebarBlock = !1;
|
|
5972
5986
|
return;
|
|
5973
5987
|
}
|
|
5974
|
-
const u = window.__isSidebarBlock === !0, g =
|
|
5988
|
+
const u = window.__isSidebarBlock === !0, g = Pc();
|
|
5975
5989
|
if (!g) {
|
|
5976
5990
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, window.__isSidebarBlock = !1;
|
|
5977
5991
|
return;
|
|
@@ -5980,12 +5994,12 @@ function Fc(e) {
|
|
|
5980
5994
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, window.__isSidebarBlock = !1;
|
|
5981
5995
|
return;
|
|
5982
5996
|
}
|
|
5983
|
-
const f = u ?
|
|
5997
|
+
const f = u ? Rc() : d;
|
|
5984
5998
|
if (f === r) {
|
|
5985
5999
|
window.__currentDraggedBlockId = null, window.__currentDraggedBlock = null, window.__isSidebarBlock = !1;
|
|
5986
6000
|
return;
|
|
5987
6001
|
}
|
|
5988
|
-
const m =
|
|
6002
|
+
const m = O.getState().document;
|
|
5989
6003
|
if (!u) {
|
|
5990
6004
|
let ce = { containerId: null, columnIndex: null };
|
|
5991
6005
|
for (const [_, x] of Object.entries(m)) {
|
|
@@ -6053,7 +6067,7 @@ function Fc(e) {
|
|
|
6053
6067
|
_e(x);
|
|
6054
6068
|
}
|
|
6055
6069
|
}
|
|
6056
|
-
const h = [...t, f], b =
|
|
6070
|
+
const h = [...t, f], b = O.getState().document, S = b[f] && b[f].type, y = {
|
|
6057
6071
|
[r]: {
|
|
6058
6072
|
type: "EmailLayout",
|
|
6059
6073
|
data: {
|
|
@@ -6067,7 +6081,7 @@ function Fc(e) {
|
|
|
6067
6081
|
style: {
|
|
6068
6082
|
backgroundColor: e.backdropColor ?? "#F5F5F5",
|
|
6069
6083
|
color: e.textColor ?? "#262626",
|
|
6070
|
-
fontFamily:
|
|
6084
|
+
fontFamily: Fc(e.fontFamily),
|
|
6071
6085
|
fontSize: "16px",
|
|
6072
6086
|
fontWeight: "400",
|
|
6073
6087
|
letterSpacing: "0.15008px",
|
|
@@ -6117,7 +6131,7 @@ function Fc(e) {
|
|
|
6117
6131
|
}
|
|
6118
6132
|
});
|
|
6119
6133
|
else {
|
|
6120
|
-
const d =
|
|
6134
|
+
const d = O.getState().document, u = d[c] && d[c].type, g = {
|
|
6121
6135
|
[r]: {
|
|
6122
6136
|
type: "EmailLayout",
|
|
6123
6137
|
data: {
|
|
@@ -6136,9 +6150,9 @@ function Fc(e) {
|
|
|
6136
6150
|
}
|
|
6137
6151
|
);
|
|
6138
6152
|
}
|
|
6139
|
-
function
|
|
6153
|
+
function Lc(e) {
|
|
6140
6154
|
var g;
|
|
6141
|
-
const { t } = Se(), n = Tt(), r =
|
|
6155
|
+
const { t } = Se(), n = Tt(), r = Xr(), [i, l] = z("url"), [a, c] = z(!1), [s, d] = z(""), u = Me(null);
|
|
6142
6156
|
if (!((g = e.props) != null && g.url)) {
|
|
6143
6157
|
const f = async (y) => {
|
|
6144
6158
|
var D;
|
|
@@ -6146,7 +6160,7 @@ function zc(e) {
|
|
|
6146
6160
|
if (!(!k || !r)) {
|
|
6147
6161
|
c(!0);
|
|
6148
6162
|
try {
|
|
6149
|
-
const E = await r(k), N =
|
|
6163
|
+
const E = await r(k), N = O.getState().document[n];
|
|
6150
6164
|
N && N.type === "Image" && _e({
|
|
6151
6165
|
[n]: {
|
|
6152
6166
|
...N,
|
|
@@ -6168,7 +6182,7 @@ function zc(e) {
|
|
|
6168
6182
|
var k;
|
|
6169
6183
|
y.stopPropagation(), y.preventDefault(), (k = u.current) == null || k.click();
|
|
6170
6184
|
}, h = () => {
|
|
6171
|
-
const y = s.trim().length === 0 ? null : s.trim(), k =
|
|
6185
|
+
const y = s.trim().length === 0 ? null : s.trim(), k = O.getState().document[n];
|
|
6172
6186
|
k && k.type === "Image" && _e({
|
|
6173
6187
|
[n]: {
|
|
6174
6188
|
...k,
|
|
@@ -6255,7 +6269,7 @@ function zc(e) {
|
|
|
6255
6269
|
}
|
|
6256
6270
|
),
|
|
6257
6271
|
/* @__PURE__ */ o(
|
|
6258
|
-
|
|
6272
|
+
Oe,
|
|
6259
6273
|
{
|
|
6260
6274
|
variant: "contained",
|
|
6261
6275
|
size: "small",
|
|
@@ -6264,7 +6278,7 @@ function zc(e) {
|
|
|
6264
6278
|
},
|
|
6265
6279
|
onMouseDown: (y) => y.stopPropagation(),
|
|
6266
6280
|
sx: { minWidth: "auto", px: 2 },
|
|
6267
|
-
children: /* @__PURE__ */ o(
|
|
6281
|
+
children: /* @__PURE__ */ o(zr, { fontSize: "small" })
|
|
6268
6282
|
}
|
|
6269
6283
|
)
|
|
6270
6284
|
] }) : /* @__PURE__ */ w(Z, { spacing: 1, children: [
|
|
@@ -6279,7 +6293,7 @@ function zc(e) {
|
|
|
6279
6293
|
}
|
|
6280
6294
|
),
|
|
6281
6295
|
/* @__PURE__ */ o(
|
|
6282
|
-
|
|
6296
|
+
Oe,
|
|
6283
6297
|
{
|
|
6284
6298
|
variant: "outlined",
|
|
6285
6299
|
startIcon: a ? /* @__PURE__ */ o(jn, { size: 16 }) : /* @__PURE__ */ o(Ft, {}),
|
|
@@ -6303,13 +6317,13 @@ function zc(e) {
|
|
|
6303
6317
|
onClick: (f) => {
|
|
6304
6318
|
},
|
|
6305
6319
|
sx: { display: "inline-block", width: "100%" },
|
|
6306
|
-
children: /* @__PURE__ */ o(
|
|
6320
|
+
children: /* @__PURE__ */ o(Ui, { ...e })
|
|
6307
6321
|
}
|
|
6308
6322
|
);
|
|
6309
6323
|
}
|
|
6310
|
-
function
|
|
6324
|
+
function Wc(e) {
|
|
6311
6325
|
var g, f, m;
|
|
6312
|
-
const { t } = Se(), n = Tt(), r =
|
|
6326
|
+
const { t } = Se(), n = Tt(), r = Gr(), [i, l] = z("url"), [a, c] = z(!1), [s, d] = z(""), u = Me(null);
|
|
6313
6327
|
if (!((g = e.props) != null && g.url)) {
|
|
6314
6328
|
const h = async (D) => {
|
|
6315
6329
|
var N;
|
|
@@ -6317,7 +6331,7 @@ function Lc(e) {
|
|
|
6317
6331
|
if (!(!E || !r)) {
|
|
6318
6332
|
c(!0);
|
|
6319
6333
|
try {
|
|
6320
|
-
const W = await r(E), P =
|
|
6334
|
+
const W = await r(E), P = O.getState().document[n];
|
|
6321
6335
|
P && P.type === "Video" && _e({
|
|
6322
6336
|
[n]: {
|
|
6323
6337
|
...P,
|
|
@@ -6339,7 +6353,7 @@ function Lc(e) {
|
|
|
6339
6353
|
var E;
|
|
6340
6354
|
D.stopPropagation(), D.preventDefault(), (E = u.current) == null || E.click();
|
|
6341
6355
|
}, S = () => {
|
|
6342
|
-
const D = s.trim().length === 0 ? null : s.trim(), E =
|
|
6356
|
+
const D = s.trim().length === 0 ? null : s.trim(), E = O.getState().document[n];
|
|
6343
6357
|
E && E.type === "Video" && _e({
|
|
6344
6358
|
[n]: {
|
|
6345
6359
|
...E,
|
|
@@ -6426,7 +6440,7 @@ function Lc(e) {
|
|
|
6426
6440
|
}
|
|
6427
6441
|
),
|
|
6428
6442
|
/* @__PURE__ */ o(
|
|
6429
|
-
|
|
6443
|
+
Oe,
|
|
6430
6444
|
{
|
|
6431
6445
|
variant: "contained",
|
|
6432
6446
|
size: "small",
|
|
@@ -6435,7 +6449,7 @@ function Lc(e) {
|
|
|
6435
6449
|
},
|
|
6436
6450
|
onMouseDown: (D) => D.stopPropagation(),
|
|
6437
6451
|
sx: { minWidth: "auto", px: 2 },
|
|
6438
|
-
children: /* @__PURE__ */ o(
|
|
6452
|
+
children: /* @__PURE__ */ o(zr, { fontSize: "small" })
|
|
6439
6453
|
}
|
|
6440
6454
|
)
|
|
6441
6455
|
] }) : /* @__PURE__ */ w(Z, { spacing: 1, children: [
|
|
@@ -6450,7 +6464,7 @@ function Lc(e) {
|
|
|
6450
6464
|
}
|
|
6451
6465
|
),
|
|
6452
6466
|
/* @__PURE__ */ o(
|
|
6453
|
-
|
|
6467
|
+
Oe,
|
|
6454
6468
|
{
|
|
6455
6469
|
variant: "outlined",
|
|
6456
6470
|
startIcon: a ? /* @__PURE__ */ o(jn, { size: 16 }) : /* @__PURE__ */ o(Ft, {}),
|
|
@@ -6481,11 +6495,11 @@ function Lc(e) {
|
|
|
6481
6495
|
backgroundColor: ((f = e.style) == null ? void 0 : f.backgroundColor) || void 0,
|
|
6482
6496
|
textAlign: ((m = e.style) == null ? void 0 : m.textAlign) || void 0
|
|
6483
6497
|
},
|
|
6484
|
-
children: /* @__PURE__ */ o(
|
|
6498
|
+
children: /* @__PURE__ */ o(ea, { ...e })
|
|
6485
6499
|
}
|
|
6486
6500
|
);
|
|
6487
6501
|
}
|
|
6488
|
-
function
|
|
6502
|
+
function Hc(e) {
|
|
6489
6503
|
var l, a;
|
|
6490
6504
|
const { t } = Se(), n = ((l = e.props) == null ? void 0 : l.socials) || [], r = ((a = e.props) == null ? void 0 : a.platforms) || [];
|
|
6491
6505
|
return (n.length > 0 ? n.map((c) => c.platform) : r).length === 0 ? /* @__PURE__ */ o(
|
|
@@ -6503,14 +6517,14 @@ function Wc(e) {
|
|
|
6503
6517
|
},
|
|
6504
6518
|
children: /* @__PURE__ */ o(ke, { variant: "body2", sx: { textAlign: "center", px: 2 }, children: t("socials.placeholder") })
|
|
6505
6519
|
}
|
|
6506
|
-
) : /* @__PURE__ */ o(
|
|
6520
|
+
) : /* @__PURE__ */ o(ta, { ...e });
|
|
6507
6521
|
}
|
|
6508
|
-
function
|
|
6522
|
+
function Vc(e) {
|
|
6509
6523
|
const t = e == null ? void 0 : e.padding;
|
|
6510
6524
|
if (t)
|
|
6511
6525
|
return `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;
|
|
6512
6526
|
}
|
|
6513
|
-
function
|
|
6527
|
+
function Uc(e, t) {
|
|
6514
6528
|
e.focus();
|
|
6515
6529
|
const n = t.replace(/\r\n/g, `
|
|
6516
6530
|
`);
|
|
@@ -6521,7 +6535,7 @@ function Vc(e, t) {
|
|
|
6521
6535
|
}
|
|
6522
6536
|
xt(e);
|
|
6523
6537
|
}
|
|
6524
|
-
function
|
|
6538
|
+
function $c(e, t, n) {
|
|
6525
6539
|
const r = document;
|
|
6526
6540
|
let i = null;
|
|
6527
6541
|
if (r.caretPositionFromPoint) {
|
|
@@ -6532,7 +6546,7 @@ function Uc(e, t, n) {
|
|
|
6532
6546
|
const l = window.getSelection();
|
|
6533
6547
|
return l == null || l.removeAllRanges(), l == null || l.addRange(i), !0;
|
|
6534
6548
|
}
|
|
6535
|
-
function
|
|
6549
|
+
function xl(e) {
|
|
6536
6550
|
const t = window.getSelection();
|
|
6537
6551
|
if (!t) return;
|
|
6538
6552
|
const n = document.createRange();
|
|
@@ -6542,7 +6556,7 @@ function Nt(e) {
|
|
|
6542
6556
|
xt(e);
|
|
6543
6557
|
const t = e.querySelectorAll("p"), n = t.length ? t[t.length - 1] : null;
|
|
6544
6558
|
if (!n) {
|
|
6545
|
-
|
|
6559
|
+
xl(e);
|
|
6546
6560
|
return;
|
|
6547
6561
|
}
|
|
6548
6562
|
const r = window.getSelection();
|
|
@@ -6550,7 +6564,7 @@ function Nt(e) {
|
|
|
6550
6564
|
const i = document.createRange();
|
|
6551
6565
|
i.selectNodeContents(n), i.collapse(!1), r.removeAllRanges(), r.addRange(i);
|
|
6552
6566
|
}
|
|
6553
|
-
function
|
|
6567
|
+
function jc(e) {
|
|
6554
6568
|
const t = window.getSelection();
|
|
6555
6569
|
if (!t || t.rangeCount === 0) return;
|
|
6556
6570
|
const n = t.getRangeAt(0);
|
|
@@ -6558,11 +6572,11 @@ function $c(e) {
|
|
|
6558
6572
|
const i = document.createRange();
|
|
6559
6573
|
i.setStart(n.endContainer, n.endOffset), i.collapse(!0), t.removeAllRanges(), t.addRange(i);
|
|
6560
6574
|
}
|
|
6561
|
-
function
|
|
6575
|
+
function Sl(e) {
|
|
6562
6576
|
const t = document.createElement("span");
|
|
6563
|
-
return t.textContent = e, t.setAttribute("data-text-variable", e), t.setAttribute("data-variable-instance-id",
|
|
6577
|
+
return t.textContent = e, t.setAttribute("data-text-variable", e), t.setAttribute("data-variable-instance-id", ol()), t.contentEditable = "false", t.setAttribute("contenteditable", "false"), t.setAttribute("contentEditable", "false"), t.style.whiteSpace = "nowrap", t.style.display = "inline-block", t.style.overflowWrap = "normal", t.style.wordBreak = "normal", vl(t), t;
|
|
6564
6578
|
}
|
|
6565
|
-
function
|
|
6579
|
+
function vl(e) {
|
|
6566
6580
|
e.style.userSelect = "all", e.style.webkitUserSelect = "all", e.style.border = "1px solid rgba(25, 118, 210, 0.55)", e.style.borderRadius = "4px", e.style.padding = "0 4px", e.style.boxShadow = "inset 0 -999px 0 rgba(25, 118, 210, 0.08)";
|
|
6567
6581
|
}
|
|
6568
6582
|
function dr(e) {
|
|
@@ -6574,7 +6588,7 @@ function dr(e) {
|
|
|
6574
6588
|
e.setAttribute("contenteditable", "false"), e.setAttribute("contentEditable", "false");
|
|
6575
6589
|
}
|
|
6576
6590
|
}
|
|
6577
|
-
function
|
|
6591
|
+
function Kc(e) {
|
|
6578
6592
|
try {
|
|
6579
6593
|
e.contentEditable = "true";
|
|
6580
6594
|
} catch {
|
|
@@ -6592,12 +6606,12 @@ function xn(e) {
|
|
|
6592
6606
|
n.push("");
|
|
6593
6607
|
continue;
|
|
6594
6608
|
}
|
|
6595
|
-
n.push(
|
|
6609
|
+
n.push(rl(r));
|
|
6596
6610
|
}
|
|
6597
6611
|
return n.join(`
|
|
6598
6612
|
`);
|
|
6599
6613
|
}
|
|
6600
|
-
function
|
|
6614
|
+
function qc(e) {
|
|
6601
6615
|
return qn(e).filter((t) => t.instanceId).map((t) => {
|
|
6602
6616
|
const n = t.builtin ? "system" : "user";
|
|
6603
6617
|
return {
|
|
@@ -6608,7 +6622,7 @@ function Kc(e) {
|
|
|
6608
6622
|
};
|
|
6609
6623
|
});
|
|
6610
6624
|
}
|
|
6611
|
-
function
|
|
6625
|
+
function Yc(e, t) {
|
|
6612
6626
|
const n = window.getSelection();
|
|
6613
6627
|
if (!n || (n.rangeCount === 0 && Nt(e), n.rangeCount === 0)) return null;
|
|
6614
6628
|
const r = n.getRangeAt(0);
|
|
@@ -6622,31 +6636,31 @@ function qc(e, t) {
|
|
|
6622
6636
|
}
|
|
6623
6637
|
const u = n.getRangeAt(0);
|
|
6624
6638
|
u.deleteContents();
|
|
6625
|
-
const g =
|
|
6639
|
+
const g = Sl(t);
|
|
6626
6640
|
u.insertNode(g);
|
|
6627
6641
|
const f = document.createRange();
|
|
6628
6642
|
return f.setStartAfter(g), f.collapse(!0), n.removeAllRanges(), n.addRange(f), g.getAttribute("data-variable-instance-id");
|
|
6629
6643
|
}
|
|
6630
|
-
function
|
|
6644
|
+
function Xc(e, t, n, r) {
|
|
6631
6645
|
const i = Et(e, t, n);
|
|
6632
6646
|
if (!i) return null;
|
|
6633
6647
|
const l = window.getSelection();
|
|
6634
6648
|
if (!l) return null;
|
|
6635
6649
|
l.removeAllRanges(), l.addRange(i), i.deleteContents();
|
|
6636
|
-
const a =
|
|
6650
|
+
const a = Sl(r);
|
|
6637
6651
|
i.insertNode(a);
|
|
6638
6652
|
const c = document.createRange();
|
|
6639
6653
|
return c.setStartAfter(a), c.collapse(!0), l.removeAllRanges(), l.addRange(c), a.getAttribute("data-variable-instance-id");
|
|
6640
6654
|
}
|
|
6641
|
-
function
|
|
6655
|
+
function Gc(e) {
|
|
6642
6656
|
var E, N, W, P, he, be, ce, _, x, T, U, ie;
|
|
6643
|
-
const t = Tt(), n = cn(), r =
|
|
6644
|
-
() =>
|
|
6657
|
+
const t = Tt(), n = cn(), r = qr(), i = Yr(), l = Kr(), a = ya(), c = Me(null), s = Me(null), d = Me(""), u = Me(!1), g = Me(null), f = Me(null), m = n === t, { allowedUser: h, allowedBuiltin: b } = ct(
|
|
6658
|
+
() => rc({ baseGroups: Ao, contactAttributes: l }),
|
|
6645
6659
|
[l]
|
|
6646
6660
|
), S = {
|
|
6647
6661
|
..._r(e.style ?? null),
|
|
6648
6662
|
textAlign: ((E = e.style) == null ? void 0 : E.textAlign) ?? void 0,
|
|
6649
|
-
padding:
|
|
6663
|
+
padding: Vc(e.style ?? null),
|
|
6650
6664
|
margin: 0
|
|
6651
6665
|
}, y = en(() => {
|
|
6652
6666
|
if (!m) return;
|
|
@@ -6662,10 +6676,10 @@ function Xc(e) {
|
|
|
6662
6676
|
}, [y, (N = e.props) == null ? void 0 : N.html, (W = e.props) == null ? void 0 : W.text, (P = e.props) == null ? void 0 : P.message, (he = e.props) == null ? void 0 : he.variables, m]);
|
|
6663
6677
|
const k = en(
|
|
6664
6678
|
(C, p, F) => {
|
|
6665
|
-
const X =
|
|
6679
|
+
const X = O.getState().document[t];
|
|
6666
6680
|
if (!X || X.type !== "Text") return;
|
|
6667
6681
|
d.current = C;
|
|
6668
|
-
const V =
|
|
6682
|
+
const V = qc(C);
|
|
6669
6683
|
_e({
|
|
6670
6684
|
[t]: {
|
|
6671
6685
|
...X,
|
|
@@ -6711,9 +6725,9 @@ function Xc(e) {
|
|
|
6711
6725
|
s.current = C.firstElementChild;
|
|
6712
6726
|
const p = s.current;
|
|
6713
6727
|
if (!p) return;
|
|
6714
|
-
|
|
6728
|
+
Kc(p), p.setAttribute("data-monto-text-block-id", t), p.style.outline = "none", p.style.cursor = "text";
|
|
6715
6729
|
for (const v of Array.from(p.querySelectorAll("[data-text-variable]")))
|
|
6716
|
-
dr(v),
|
|
6730
|
+
dr(v), vl(v);
|
|
6717
6731
|
const F = { current: !1 }, X = (v) => {
|
|
6718
6732
|
var Ie, ne;
|
|
6719
6733
|
if (F.current || v.rangeCount === 0) return null;
|
|
@@ -6779,7 +6793,7 @@ function Xc(e) {
|
|
|
6779
6793
|
yt(null), Bn({ blockId: t, offset: re });
|
|
6780
6794
|
return;
|
|
6781
6795
|
}
|
|
6782
|
-
const te =
|
|
6796
|
+
const te = Mt(p, re);
|
|
6783
6797
|
hn({ blockId: t, text: ae, styleSnapshot: te }), yt({ blockId: t, start: re, end: ue }), Bn({ blockId: t, offset: ue });
|
|
6784
6798
|
}, me = () => {
|
|
6785
6799
|
f.current = null;
|
|
@@ -6789,7 +6803,7 @@ function Xc(e) {
|
|
|
6789
6803
|
const L = Y.getRangeAt(0);
|
|
6790
6804
|
if (p.contains(L.startContainer) && p.contains(L.endContainer)) {
|
|
6791
6805
|
const { start: G } = tn(p, L);
|
|
6792
|
-
ee =
|
|
6806
|
+
ee = Mt(p, Math.min(Math.max(G, 0), Math.max(v.length - 1, 0)));
|
|
6793
6807
|
}
|
|
6794
6808
|
}
|
|
6795
6809
|
hn({ blockId: t, text: v, styleSnapshot: ee });
|
|
@@ -6815,11 +6829,11 @@ function Xc(e) {
|
|
|
6815
6829
|
}
|
|
6816
6830
|
} catch {
|
|
6817
6831
|
}
|
|
6818
|
-
|
|
6832
|
+
Uc(p, Y);
|
|
6819
6833
|
}, Re = (v) => {
|
|
6820
6834
|
var ee;
|
|
6821
6835
|
v.preventDefault();
|
|
6822
|
-
const Y =
|
|
6836
|
+
const Y = rl(p);
|
|
6823
6837
|
(ee = v.clipboardData) == null || ee.setData("text/plain", Y);
|
|
6824
6838
|
}, je = (v) => {
|
|
6825
6839
|
var Y, ee, L, G, ae, re, ue;
|
|
@@ -6849,9 +6863,9 @@ function Xc(e) {
|
|
|
6849
6863
|
const $ = document.createRange();
|
|
6850
6864
|
$.setStartAfter(fe), $.collapse(!0), te.removeAllRanges(), te.addRange($);
|
|
6851
6865
|
}
|
|
6852
|
-
const I = document.createTextNode(v.key),
|
|
6853
|
-
if (
|
|
6854
|
-
|
|
6866
|
+
const I = document.createTextNode(v.key), M = te.rangeCount > 0 ? te.getRangeAt(0) : null;
|
|
6867
|
+
if (M && p.contains(M.startContainer)) {
|
|
6868
|
+
M.insertNode(I);
|
|
6855
6869
|
const $ = document.createRange();
|
|
6856
6870
|
$.setStartAfter(I), $.collapse(!0), te.removeAllRanges(), te.addRange($);
|
|
6857
6871
|
}
|
|
@@ -6871,8 +6885,8 @@ function Xc(e) {
|
|
|
6871
6885
|
if (De || oe || (() => {
|
|
6872
6886
|
var I;
|
|
6873
6887
|
try {
|
|
6874
|
-
const
|
|
6875
|
-
return !!((I =
|
|
6888
|
+
const M = Q.cloneContents();
|
|
6889
|
+
return !!((I = M.querySelector) != null && I.call(M, "a,[data-text-variable]"));
|
|
6876
6890
|
} catch {
|
|
6877
6891
|
return !1;
|
|
6878
6892
|
}
|
|
@@ -6903,12 +6917,12 @@ function Xc(e) {
|
|
|
6903
6917
|
try {
|
|
6904
6918
|
const fe = document.createRange();
|
|
6905
6919
|
if (fe.setStart(A, 0), fe.setEnd(Q.startContainer, Q.startOffset), fe.toString().replace(/\u200B/g, "").length === 0) {
|
|
6906
|
-
let
|
|
6907
|
-
for (;
|
|
6908
|
-
const j =
|
|
6920
|
+
let M = A.previousElementSibling, $ = !1;
|
|
6921
|
+
for (; M && M.tagName === "P"; ) {
|
|
6922
|
+
const j = M, R = (j.textContent ?? "").replace(/\u200B/g, "");
|
|
6909
6923
|
if (!(!!j.querySelector("br") && R.length === 0)) break;
|
|
6910
6924
|
const Ee = j;
|
|
6911
|
-
|
|
6925
|
+
M = Ee.previousElementSibling, (G = Ee.parentElement) == null || G.removeChild(Ee), $ = !0;
|
|
6912
6926
|
}
|
|
6913
6927
|
if ($) {
|
|
6914
6928
|
v.preventDefault(), v.stopPropagation(), xt(p);
|
|
@@ -6940,18 +6954,18 @@ function Xc(e) {
|
|
|
6940
6954
|
if (ne && ne.rangeCount > 0) {
|
|
6941
6955
|
const A = ne.getRangeAt(0);
|
|
6942
6956
|
if (p.contains(A.startContainer) && p.contains(A.endContainer) && A.collapsed) {
|
|
6943
|
-
const oe = ((re = ((
|
|
6944
|
-
const
|
|
6945
|
-
if (
|
|
6946
|
-
const $ = (
|
|
6947
|
-
return A.startOffset < $ ? null :
|
|
6957
|
+
const oe = ((re = ((M) => M.nodeType === Node.ELEMENT_NODE ? M : M.parentElement)(A.startContainer)) == null ? void 0 : re.closest("p")) ?? null, fe = (() => {
|
|
6958
|
+
const M = A.startContainer;
|
|
6959
|
+
if (M.nodeType === Node.TEXT_NODE) {
|
|
6960
|
+
const $ = (M.textContent ?? "").length;
|
|
6961
|
+
return A.startOffset < $ ? null : M.nextSibling;
|
|
6948
6962
|
}
|
|
6949
|
-
return
|
|
6963
|
+
return M.nodeType === Node.ELEMENT_NODE ? M.childNodes[A.startOffset] ?? null : null;
|
|
6950
6964
|
})(), I = !!(fe && fe.nodeType === Node.ELEMENT_NODE && ((ue = fe.closest) != null && ue.call(fe, "[data-text-variable]")));
|
|
6951
6965
|
if (oe && I) {
|
|
6952
|
-
const
|
|
6953
|
-
|
|
6954
|
-
const $ =
|
|
6966
|
+
const M = document.createRange();
|
|
6967
|
+
M.selectNodeContents(oe), M.setStart(A.startContainer, A.startOffset);
|
|
6968
|
+
const $ = M.extractContents(), j = document.createElement("p");
|
|
6955
6969
|
j.appendChild($), oe.insertAdjacentElement("afterend", j), xt(p);
|
|
6956
6970
|
const R = document.createRange();
|
|
6957
6971
|
R.selectNodeContents(j), R.collapse(!0), ne.removeAllRanges(), ne.addRange(R), V(), v.stopPropagation();
|
|
@@ -6962,7 +6976,7 @@ function Xc(e) {
|
|
|
6962
6976
|
} catch {
|
|
6963
6977
|
}
|
|
6964
6978
|
document.execCommand("insertParagraph", !1), xt(p), requestAnimationFrame(() => {
|
|
6965
|
-
var
|
|
6979
|
+
var M, $, j, R, de, Ee, Pe, ye, Be, xe;
|
|
6966
6980
|
try {
|
|
6967
6981
|
p.focus({ preventScroll: !0 });
|
|
6968
6982
|
} catch {
|
|
@@ -6970,7 +6984,7 @@ function Xc(e) {
|
|
|
6970
6984
|
const ne = window.getSelection();
|
|
6971
6985
|
try {
|
|
6972
6986
|
if (Q && Q.isConnected) {
|
|
6973
|
-
const ge = ((
|
|
6987
|
+
const ge = ((M = Q.nextElementSibling) == null ? void 0 : M.tagName) === "P" ? Q.nextElementSibling : null;
|
|
6974
6988
|
if (ge && ne) {
|
|
6975
6989
|
try {
|
|
6976
6990
|
if (!Ie && Wn(ge)) {
|
|
@@ -7107,7 +7121,7 @@ function Xc(e) {
|
|
|
7107
7121
|
return;
|
|
7108
7122
|
}
|
|
7109
7123
|
}
|
|
7110
|
-
p.focus({ preventScroll: !0 }),
|
|
7124
|
+
p.focus({ preventScroll: !0 }), $c(p, v.clientX, v.clientY) || xl(p), jc(p), yt(null), requestAnimationFrame(V);
|
|
7111
7125
|
};
|
|
7112
7126
|
return document.addEventListener("selectionchange", ve), p.addEventListener("blur", D), p.addEventListener("input", we), p.addEventListener("paste", K), p.addEventListener("copy", Re), p.addEventListener("keydown", je), p.addEventListener("beforeinput", _t), p.addEventListener("mousedown", pe), p.addEventListener("mouseup", q), p.addEventListener("click", ht), () => {
|
|
7113
7127
|
document.removeEventListener("selectionchange", ve), p.removeEventListener("blur", D), p.removeEventListener("input", we), p.removeEventListener("paste", K), p.removeEventListener("copy", Re), p.removeEventListener("keydown", je), p.removeEventListener("beforeinput", _t), p.removeEventListener("mousedown", pe), p.removeEventListener("mouseup", q), p.removeEventListener("click", ht), p.contentEditable = "false", p.style.cursor = "", s.current = null, f.current != null && (cancelAnimationFrame(f.current), f.current = null);
|
|
@@ -7129,21 +7143,21 @@ function Xc(e) {
|
|
|
7129
7143
|
De && oe && (oe.removeAllRanges(), oe.addRange(De));
|
|
7130
7144
|
} else
|
|
7131
7145
|
Nt(p);
|
|
7132
|
-
const G =
|
|
7146
|
+
const G = Yc(p, C.token), ae = O.getState().document[t], re = ((q = (pe = ae == null ? void 0 : ae.data) == null ? void 0 : pe.props) == null ? void 0 : q.variableDefaults) ?? null, { variableDefaults: ue } = bn(p, re), te = C.defaultValue ?? "";
|
|
7133
7147
|
G && te !== "" && (ue[G] = te);
|
|
7134
7148
|
const Q = Cn(p), Ie = xn(p);
|
|
7135
7149
|
k(Q, Ie, ue), Sn(), Yt();
|
|
7136
7150
|
const ne = Dt(p);
|
|
7137
7151
|
pt(p);
|
|
7138
|
-
const A = ne.length > 0 ?
|
|
7152
|
+
const A = ne.length > 0 ? Mt(p, Math.max(0, ne.length - 1)) : {};
|
|
7139
7153
|
hn({ blockId: t, text: ne, styleSnapshot: A });
|
|
7140
7154
|
return;
|
|
7141
7155
|
} else if (C.kind === "replaceVariable") {
|
|
7142
|
-
const G =
|
|
7156
|
+
const G = Xc(p, C.start, C.end, C.token), ae = O.getState().document[t], re = ((Y = (v = ae == null ? void 0 : ae.data) == null ? void 0 : v.props) == null ? void 0 : Y.variableDefaults) ?? null, { variableDefaults: ue } = bn(p, re), te = C.defaultValue ?? "";
|
|
7143
7157
|
G && te !== "" && (ue[G] = te);
|
|
7144
7158
|
const Q = Cn(p), Ie = xn(p);
|
|
7145
7159
|
k(Q, Ie, ue), Sn(), Yt();
|
|
7146
|
-
const ne = Dt(p), A = ne.length > 0 ?
|
|
7160
|
+
const ne = Dt(p), A = ne.length > 0 ? Mt(p, Math.max(0, ne.length - 1)) : {};
|
|
7147
7161
|
hn({ blockId: t, text: ne, styleSnapshot: A }), yt(null);
|
|
7148
7162
|
return;
|
|
7149
7163
|
} else {
|
|
@@ -7158,26 +7172,26 @@ function Xc(e) {
|
|
|
7158
7172
|
return;
|
|
7159
7173
|
}
|
|
7160
7174
|
const re = window.getSelection();
|
|
7161
|
-
re == null || re.removeAllRanges(), re == null || re.addRange(ae), C.kind === "style" ?
|
|
7175
|
+
re == null || re.removeAllRanges(), re == null || re.addRange(ae), C.kind === "style" ? cs(p, G.start, G.end, {
|
|
7162
7176
|
patch: C.style,
|
|
7163
7177
|
global: e.style ?? null
|
|
7164
|
-
}) :
|
|
7178
|
+
}) : us(p, G.start, G.end, C.href, C.targetBlank);
|
|
7165
7179
|
}
|
|
7166
7180
|
xt(p);
|
|
7167
|
-
const F =
|
|
7181
|
+
const F = O.getState().document[t], X = ((L = (ee = F == null ? void 0 : F.data) == null ? void 0 : ee.props) == null ? void 0 : L.variableDefaults) ?? null, { variableDefaults: V } = bn(p, X), me = Cn(p), ve = xn(p);
|
|
7168
7182
|
k(me, ve, V), Sn(), Yt();
|
|
7169
|
-
const we = pt(p), K = r ? Math.min(r.start, we) : we, Re = r ? Math.min(r.end, we) : we, je = Dt(p), _t = je.length > 0 ?
|
|
7183
|
+
const we = pt(p), K = r ? Math.min(r.start, we) : we, Re = r ? Math.min(r.end, we) : we, je = Dt(p), _t = je.length > 0 ? Mt(p, Math.min(K, je.length - 1)) : {};
|
|
7170
7184
|
hn({ blockId: t, text: je, styleSnapshot: _t });
|
|
7171
7185
|
const ht = Et(p, K, Re);
|
|
7172
7186
|
if (ht && K < Re) {
|
|
7173
7187
|
const G = window.getSelection();
|
|
7174
7188
|
G == null || G.removeAllRanges(), G == null || G.addRange(ht);
|
|
7175
7189
|
}
|
|
7176
|
-
}, [a == null ? void 0 : a.id, r, i, t, k, e.style]), m ? /* @__PURE__ */ o("div", { style: S, children: /* @__PURE__ */ o("div", { ref: c, style: { margin: 0, padding: 0 } }, t) }) : /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
7190
|
+
}, [a == null ? void 0 : a.id, r, i, t, k, e.style]), m ? /* @__PURE__ */ o("div", { style: S, children: /* @__PURE__ */ o("div", { ref: c, style: { margin: 0, padding: 0 } }, t) }) : /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(Yl, { ...e }) });
|
|
7177
7191
|
}
|
|
7178
|
-
function
|
|
7179
|
-
const t = Tt(), n = cn(), r =
|
|
7180
|
-
const d =
|
|
7192
|
+
function Jc(e) {
|
|
7193
|
+
const t = Tt(), n = cn(), r = Me(null), i = Me(null), l = Me(!1), a = n === t, c = en((s) => {
|
|
7194
|
+
const d = O.getState().document[t];
|
|
7181
7195
|
d && d.type === "Heading" && _e({
|
|
7182
7196
|
[t]: {
|
|
7183
7197
|
...d,
|
|
@@ -7223,11 +7237,11 @@ function Gc(e) {
|
|
|
7223
7237
|
};
|
|
7224
7238
|
}
|
|
7225
7239
|
} else !a && i.current && (i.current.contentEditable = "false", i.current.style.cursor = "", i.current = null, l.current = !1);
|
|
7226
|
-
}, [a, t, c]), /* @__PURE__ */ o(se, { ref: r, children: /* @__PURE__ */ o(
|
|
7240
|
+
}, [a, t, c]), /* @__PURE__ */ o(se, { ref: r, children: /* @__PURE__ */ o(zi, { ...e }) });
|
|
7227
7241
|
}
|
|
7228
|
-
function
|
|
7229
|
-
const t = Tt(), n = cn(), r =
|
|
7230
|
-
const d =
|
|
7242
|
+
function Zc(e) {
|
|
7243
|
+
const t = Tt(), n = cn(), r = Me(null), i = Me(null), l = Me(!1), a = n === t, c = en((s) => {
|
|
7244
|
+
const d = O.getState().document[t];
|
|
7231
7245
|
d && d.type === "Button" && _e({
|
|
7232
7246
|
[t]: {
|
|
7233
7247
|
...d,
|
|
@@ -7294,9 +7308,9 @@ function Jc(e) {
|
|
|
7294
7308
|
}
|
|
7295
7309
|
}
|
|
7296
7310
|
} else !a && i.current && (i.current.contentEditable = "false", i.current.style.cursor = "", i.current = null, l.current = !1, r.current && (r.current.contentEditable = "false", r.current.style.cursor = ""));
|
|
7297
|
-
}, [a, t, c]), /* @__PURE__ */ o(se, { ref: r, children: /* @__PURE__ */ o(
|
|
7311
|
+
}, [a, t, c]), /* @__PURE__ */ o(se, { ref: r, children: /* @__PURE__ */ o(Xl, { ...e }) });
|
|
7298
7312
|
}
|
|
7299
|
-
function
|
|
7313
|
+
function Qc() {
|
|
7300
7314
|
return `block-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
7301
7315
|
}
|
|
7302
7316
|
function go(e, t) {
|
|
@@ -7304,7 +7318,7 @@ function go(e, t) {
|
|
|
7304
7318
|
const n = e[t];
|
|
7305
7319
|
if (!n)
|
|
7306
7320
|
return { newDocument: e, newBlockId: t };
|
|
7307
|
-
const r =
|
|
7321
|
+
const r = Qc(), i = JSON.parse(JSON.stringify(n));
|
|
7308
7322
|
let l = { ...e };
|
|
7309
7323
|
if (i.type === "Container" && ((c = (a = i.data) == null ? void 0 : a.props) != null && c.childrenIds)) {
|
|
7310
7324
|
const u = [];
|
|
@@ -7344,7 +7358,7 @@ function pr(e, t) {
|
|
|
7344
7358
|
}
|
|
7345
7359
|
return { containerId: null, columnIndex: null };
|
|
7346
7360
|
}
|
|
7347
|
-
const
|
|
7361
|
+
const eu = {
|
|
7348
7362
|
position: "absolute",
|
|
7349
7363
|
bottom: -12,
|
|
7350
7364
|
left: -50,
|
|
@@ -7353,7 +7367,7 @@ const Qc = {
|
|
|
7353
7367
|
paddingY: 0.5,
|
|
7354
7368
|
zIndex: "fab"
|
|
7355
7369
|
};
|
|
7356
|
-
function
|
|
7370
|
+
function tu({ blockId: e }) {
|
|
7357
7371
|
const t = Qe(), n = pr(t, e), r = mt.useMemo(() => {
|
|
7358
7372
|
var u, g;
|
|
7359
7373
|
if (!n.containerId)
|
|
@@ -7580,7 +7594,7 @@ function eu({ blockId: e }) {
|
|
|
7580
7594
|
}
|
|
7581
7595
|
Rt(d), nt(e);
|
|
7582
7596
|
};
|
|
7583
|
-
return /* @__PURE__ */ o(Co, { sx:
|
|
7597
|
+
return /* @__PURE__ */ o(Co, { sx: eu, onClick: (c) => c.stopPropagation(), children: /* @__PURE__ */ w(Z, { children: [
|
|
7584
7598
|
r.canMoveUp && /* @__PURE__ */ o(Ze, { title: "Move up", placement: "left", arrow: !0, children: /* @__PURE__ */ o($e, { onClick: () => a("up"), sx: { color: "text.primary" }, children: /* @__PURE__ */ o(wi, { fontSize: "small" }) }) }),
|
|
7585
7599
|
r.canMoveDown && /* @__PURE__ */ o(Ze, { title: "Move down", placement: "left", arrow: !0, children: /* @__PURE__ */ o($e, { onClick: () => a("down"), sx: { color: "text.primary" }, children: /* @__PURE__ */ o(Ii, { fontSize: "small" }) }) }),
|
|
7586
7600
|
(r.canMoveUp || r.canMoveDown) && /* @__PURE__ */ o(rn, { sx: { my: 1, mx: 1 } }),
|
|
@@ -7589,10 +7603,10 @@ function eu({ blockId: e }) {
|
|
|
7589
7603
|
] }) });
|
|
7590
7604
|
}
|
|
7591
7605
|
function st({ children: e }) {
|
|
7592
|
-
const t = cn(), [n, r] = z(!1), [i, l] = z(!1), [a, c] = z(!1), [s, d] = z(!1), u = Tt(), g =
|
|
7606
|
+
const t = cn(), [n, r] = z(!1), [i, l] = z(!1), [a, c] = z(!1), [s, d] = z(!1), u = Tt(), g = Me(!1), m = O.getState().document[u], h = (m == null ? void 0 : m.type) === "Container" || (m == null ? void 0 : m.type) === "ColumnsContainer";
|
|
7593
7607
|
let b;
|
|
7594
7608
|
a ? b = "2px dashed rgba(0,121,204, 0.8)" : t === u ? b = "2px solid rgba(0,121,204, 1)" : n && (b = "2px solid rgba(0,121,204, 0.3)");
|
|
7595
|
-
const S = () => t !== u || a ? null : /* @__PURE__ */ o(
|
|
7609
|
+
const S = () => t !== u || a ? null : /* @__PURE__ */ o(tu, { blockId: u }), y = (E) => {
|
|
7596
7610
|
if (!g.current) {
|
|
7597
7611
|
E.preventDefault();
|
|
7598
7612
|
return;
|
|
@@ -7684,7 +7698,7 @@ function st({ children: e }) {
|
|
|
7684
7698
|
borderColor: "primary.main"
|
|
7685
7699
|
}
|
|
7686
7700
|
},
|
|
7687
|
-
children: /* @__PURE__ */ o(
|
|
7701
|
+
children: /* @__PURE__ */ o(Fr, { fontSize: "small" })
|
|
7688
7702
|
}
|
|
7689
7703
|
),
|
|
7690
7704
|
S(),
|
|
@@ -7693,80 +7707,80 @@ function st({ children: e }) {
|
|
|
7693
7707
|
}
|
|
7694
7708
|
);
|
|
7695
7709
|
}
|
|
7696
|
-
const
|
|
7710
|
+
const wl = Ji({
|
|
7697
7711
|
Button: {
|
|
7698
|
-
schema:
|
|
7699
|
-
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(
|
|
7712
|
+
schema: Mr,
|
|
7713
|
+
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(Zc, { ...e }) })
|
|
7700
7714
|
},
|
|
7701
7715
|
Container: {
|
|
7702
|
-
schema:
|
|
7716
|
+
schema: dl,
|
|
7703
7717
|
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(Mc, { ...e }) })
|
|
7704
7718
|
},
|
|
7705
7719
|
ColumnsContainer: {
|
|
7706
7720
|
schema: Xn,
|
|
7707
|
-
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(
|
|
7721
|
+
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(Oc, { ...e }) })
|
|
7708
7722
|
},
|
|
7709
7723
|
Heading: {
|
|
7710
|
-
schema:
|
|
7711
|
-
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(
|
|
7724
|
+
schema: Hr,
|
|
7725
|
+
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(Jc, { ...e }) })
|
|
7712
7726
|
},
|
|
7713
7727
|
Html: {
|
|
7714
|
-
schema:
|
|
7715
|
-
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(
|
|
7728
|
+
schema: Vr,
|
|
7729
|
+
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(Li, { ...e }) })
|
|
7716
7730
|
},
|
|
7717
7731
|
Image: {
|
|
7718
|
-
schema:
|
|
7719
|
-
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(
|
|
7732
|
+
schema: Ur,
|
|
7733
|
+
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(Lc, { ...e }) })
|
|
7720
7734
|
},
|
|
7721
7735
|
Video: {
|
|
7722
|
-
schema:
|
|
7723
|
-
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(
|
|
7736
|
+
schema: gl,
|
|
7737
|
+
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(Wc, { ...e }) })
|
|
7724
7738
|
},
|
|
7725
7739
|
Text: {
|
|
7726
7740
|
schema: Br,
|
|
7727
|
-
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(
|
|
7741
|
+
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(Gc, { ...e }) })
|
|
7728
7742
|
},
|
|
7729
7743
|
EmailLayout: {
|
|
7730
|
-
schema:
|
|
7731
|
-
Component: (e) => /* @__PURE__ */ o(
|
|
7744
|
+
schema: pl,
|
|
7745
|
+
Component: (e) => /* @__PURE__ */ o(zc, { ...e })
|
|
7732
7746
|
},
|
|
7733
7747
|
Spacer: {
|
|
7734
|
-
schema:
|
|
7735
|
-
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(
|
|
7748
|
+
schema: $r,
|
|
7749
|
+
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(ji, { ...e }) })
|
|
7736
7750
|
},
|
|
7737
7751
|
Divider: {
|
|
7738
|
-
schema:
|
|
7739
|
-
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(
|
|
7752
|
+
schema: Wr,
|
|
7753
|
+
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(Pi, { ...e }) })
|
|
7740
7754
|
},
|
|
7741
7755
|
Socials: {
|
|
7742
|
-
schema:
|
|
7743
|
-
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(
|
|
7756
|
+
schema: bl,
|
|
7757
|
+
Component: (e) => /* @__PURE__ */ o(st, { children: /* @__PURE__ */ o(Hc, { ...e }) })
|
|
7744
7758
|
}
|
|
7745
|
-
}),
|
|
7746
|
-
function
|
|
7759
|
+
}), nu = Zi(wl), ou = Qi(wl), ru = J.record(J.string(), ou), Il = ho(null), Tt = () => hr(Il);
|
|
7760
|
+
function kl({ id: e }) {
|
|
7747
7761
|
const n = Qe()[e];
|
|
7748
7762
|
if (!n)
|
|
7749
7763
|
throw new Error("Could not find block");
|
|
7750
|
-
return /* @__PURE__ */ o(
|
|
7764
|
+
return /* @__PURE__ */ o(Il.Provider, { value: e, children: /* @__PURE__ */ o(nu, { ...n }) });
|
|
7751
7765
|
}
|
|
7752
|
-
function
|
|
7766
|
+
function lu() {
|
|
7753
7767
|
const e = ko(), t = () => {
|
|
7754
|
-
|
|
7768
|
+
wa();
|
|
7755
7769
|
};
|
|
7756
|
-
return e ? /* @__PURE__ */ o($e, { onClick: t, children: /* @__PURE__ */ o(
|
|
7757
|
-
}
|
|
7758
|
-
function lu() {
|
|
7759
|
-
return Do() ? /* @__PURE__ */ o(Ti, { fontSize: "small" }) : /* @__PURE__ */ o(_i, { fontSize: "small" });
|
|
7770
|
+
return e ? /* @__PURE__ */ o($e, { onClick: t, children: /* @__PURE__ */ o(oa, { fontSize: "small" }) }) : /* @__PURE__ */ o($e, { onClick: t, children: /* @__PURE__ */ o(na, { fontSize: "small" }) });
|
|
7760
7771
|
}
|
|
7761
7772
|
function iu() {
|
|
7762
|
-
|
|
7763
|
-
return /* @__PURE__ */ o($e, { onClick: wa, children: e });
|
|
7773
|
+
return Do() ? /* @__PURE__ */ o(ra, { fontSize: "small" }) : /* @__PURE__ */ o(la, { fontSize: "small" });
|
|
7764
7774
|
}
|
|
7765
7775
|
function au() {
|
|
7776
|
+
const e = iu();
|
|
7777
|
+
return /* @__PURE__ */ o($e, { onClick: Ia, children: e });
|
|
7778
|
+
}
|
|
7779
|
+
function su() {
|
|
7766
7780
|
const { t: e } = Se(), t = Qe(), n = ct(() => `data:text/plain,${encodeURIComponent(JSON.stringify(t, null, " "))}`, [t]);
|
|
7767
|
-
return /* @__PURE__ */ o(Ze, { title: e("common.downloadJson"), arrow: !0, children: /* @__PURE__ */ o($e, { href: n, download: "emailTemplate.json", children: /* @__PURE__ */ o(
|
|
7781
|
+
return /* @__PURE__ */ o(Ze, { title: e("common.downloadJson"), arrow: !0, children: /* @__PURE__ */ o($e, { href: n, download: "emailTemplate.json", children: /* @__PURE__ */ o(ia, { fontSize: "small" }) }) });
|
|
7768
7782
|
}
|
|
7769
|
-
let ut = null, ro = null, lo = null, En = null,
|
|
7783
|
+
let ut = null, ro = null, lo = null, En = null, cu = !1, io = !1;
|
|
7770
7784
|
async function _o() {
|
|
7771
7785
|
if (!(ut || io) && !(typeof window > "u")) {
|
|
7772
7786
|
io = !0;
|
|
@@ -7777,7 +7791,7 @@ async function _o() {
|
|
|
7777
7791
|
const n = await import("react-syntax-highlighter/dist/esm/languages/hljs/xml");
|
|
7778
7792
|
lo = n.default || n;
|
|
7779
7793
|
const r = await import("react-syntax-highlighter/dist/esm/styles/hljs/github");
|
|
7780
|
-
En = r.default || r, ut != null && ut.registerLanguage && (ro && ut.registerLanguage("json", ro), lo && ut.registerLanguage("html", lo),
|
|
7794
|
+
En = r.default || r, ut != null && ut.registerLanguage && (ro && ut.registerLanguage("json", ro), lo && ut.registerLanguage("html", lo), cu = !0);
|
|
7781
7795
|
} catch {
|
|
7782
7796
|
} finally {
|
|
7783
7797
|
io = !1;
|
|
@@ -7799,7 +7813,7 @@ const fr = (e) => {
|
|
|
7799
7813
|
`);
|
|
7800
7814
|
}
|
|
7801
7815
|
return e;
|
|
7802
|
-
},
|
|
7816
|
+
}, uu = (e) => {
|
|
7803
7817
|
var i, l;
|
|
7804
7818
|
const t = e.split(`
|
|
7805
7819
|
`), n = [], r = [];
|
|
@@ -7830,12 +7844,12 @@ const fr = (e) => {
|
|
|
7830
7844
|
return r.join(`
|
|
7831
7845
|
`);
|
|
7832
7846
|
};
|
|
7833
|
-
function
|
|
7847
|
+
function du(e) {
|
|
7834
7848
|
try {
|
|
7835
7849
|
if (e.includes(`
|
|
7836
7850
|
`) && e.trim().length > 0) {
|
|
7837
7851
|
let a = fr(e);
|
|
7838
|
-
return a =
|
|
7852
|
+
return a = uu(a), a;
|
|
7839
7853
|
}
|
|
7840
7854
|
let t = e.replace(/></g, `>
|
|
7841
7855
|
<`).replace(/\n\s*\n/g, `
|
|
@@ -7858,7 +7872,7 @@ function uu(e) {
|
|
|
7858
7872
|
return e;
|
|
7859
7873
|
}
|
|
7860
7874
|
}
|
|
7861
|
-
function
|
|
7875
|
+
function pu(e) {
|
|
7862
7876
|
try {
|
|
7863
7877
|
const t = JSON.parse(e);
|
|
7864
7878
|
return JSON.stringify(t, null, 2);
|
|
@@ -7866,9 +7880,9 @@ function du(e) {
|
|
|
7866
7880
|
return e;
|
|
7867
7881
|
}
|
|
7868
7882
|
}
|
|
7869
|
-
async function
|
|
7883
|
+
async function fu(e) {
|
|
7870
7884
|
await _o();
|
|
7871
|
-
const t =
|
|
7885
|
+
const t = du(e);
|
|
7872
7886
|
return !ut || !En ? /* @__PURE__ */ o("pre", { style: { margin: 0, padding: 16, whiteSpace: "pre-wrap" }, children: t }) : /* @__PURE__ */ o(
|
|
7873
7887
|
ut,
|
|
7874
7888
|
{
|
|
@@ -7882,9 +7896,9 @@ async function pu(e) {
|
|
|
7882
7896
|
}
|
|
7883
7897
|
);
|
|
7884
7898
|
}
|
|
7885
|
-
async function
|
|
7899
|
+
async function mu(e) {
|
|
7886
7900
|
await _o();
|
|
7887
|
-
const t =
|
|
7901
|
+
const t = pu(e);
|
|
7888
7902
|
return !ut || !En ? /* @__PURE__ */ o("pre", { style: { margin: 0, padding: 16, whiteSpace: "pre-wrap" }, children: t }) : /* @__PURE__ */ o(
|
|
7889
7903
|
ut,
|
|
7890
7904
|
{
|
|
@@ -7898,15 +7912,15 @@ async function fu(e) {
|
|
|
7898
7912
|
}
|
|
7899
7913
|
);
|
|
7900
7914
|
}
|
|
7901
|
-
function
|
|
7915
|
+
function Dl({ type: e, value: t }) {
|
|
7902
7916
|
const [n, r] = z(null);
|
|
7903
7917
|
return Ce(() => {
|
|
7904
7918
|
switch (e) {
|
|
7905
7919
|
case "html":
|
|
7906
|
-
|
|
7920
|
+
fu(t).then(r);
|
|
7907
7921
|
return;
|
|
7908
7922
|
case "json":
|
|
7909
|
-
|
|
7923
|
+
mu(t).then(r);
|
|
7910
7924
|
return;
|
|
7911
7925
|
}
|
|
7912
7926
|
}, [t, e]), n === null ? null : /* @__PURE__ */ o(
|
|
@@ -7920,7 +7934,7 @@ function El({ type: e, value: t }) {
|
|
|
7920
7934
|
}
|
|
7921
7935
|
);
|
|
7922
7936
|
}
|
|
7923
|
-
function
|
|
7937
|
+
function gu() {
|
|
7924
7938
|
const e = Qe(), [t, n] = z("");
|
|
7925
7939
|
return Ce(() => {
|
|
7926
7940
|
try {
|
|
@@ -7929,7 +7943,7 @@ function mu() {
|
|
|
7929
7943
|
} catch {
|
|
7930
7944
|
n("<!-- Error rendering HTML -->");
|
|
7931
7945
|
}
|
|
7932
|
-
}, [e]), /* @__PURE__ */ o(
|
|
7946
|
+
}, [e]), /* @__PURE__ */ o(Dl, { type: "html", value: t });
|
|
7933
7947
|
}
|
|
7934
7948
|
function mr(e) {
|
|
7935
7949
|
let t;
|
|
@@ -7938,10 +7952,10 @@ function mr(e) {
|
|
|
7938
7952
|
} catch {
|
|
7939
7953
|
return { error: "Invalid json" };
|
|
7940
7954
|
}
|
|
7941
|
-
const n =
|
|
7955
|
+
const n = ru.safeParse(t);
|
|
7942
7956
|
return n.success ? n.data.root ? { data: n.data } : { error: 'Missing "root" node' } : { error: "Invalid JSON schema" };
|
|
7943
7957
|
}
|
|
7944
|
-
function
|
|
7958
|
+
function hu({ onClose: e }) {
|
|
7945
7959
|
const { t } = Se(), [n, r] = z(""), [i, l] = z(null), a = (s) => {
|
|
7946
7960
|
const d = s.currentTarget.value;
|
|
7947
7961
|
r(d);
|
|
@@ -7949,7 +7963,7 @@ function gu({ onClose: e }) {
|
|
|
7949
7963
|
l(u ?? null);
|
|
7950
7964
|
};
|
|
7951
7965
|
let c = null;
|
|
7952
|
-
return i && (c = /* @__PURE__ */ o(
|
|
7966
|
+
return i && (c = /* @__PURE__ */ o(Vl, { color: "error", children: i })), /* @__PURE__ */ w(Cr, { open: !0, onClose: e, children: [
|
|
7953
7967
|
/* @__PURE__ */ o(yr, { children: t("common.importJson") }),
|
|
7954
7968
|
/* @__PURE__ */ w(
|
|
7955
7969
|
"form",
|
|
@@ -7978,28 +7992,28 @@ function gu({ onClose: e }) {
|
|
|
7978
7992
|
)
|
|
7979
7993
|
] }),
|
|
7980
7994
|
/* @__PURE__ */ w(Sr, { children: [
|
|
7981
|
-
/* @__PURE__ */ o(
|
|
7982
|
-
/* @__PURE__ */ o(
|
|
7995
|
+
/* @__PURE__ */ o(Oe, { variant: "outlined", color: "primary", type: "button", onClick: e, children: t("common.cancel") }),
|
|
7996
|
+
/* @__PURE__ */ o(Oe, { variant: "contained", type: "submit", disabled: i !== null, children: t("common.import") })
|
|
7983
7997
|
] })
|
|
7984
7998
|
]
|
|
7985
7999
|
}
|
|
7986
8000
|
)
|
|
7987
8001
|
] });
|
|
7988
8002
|
}
|
|
7989
|
-
function
|
|
8003
|
+
function bu() {
|
|
7990
8004
|
const { t: e } = Se(), [t, n] = z(!1);
|
|
7991
8005
|
let r = null;
|
|
7992
|
-
return t && (r = /* @__PURE__ */ o(
|
|
7993
|
-
/* @__PURE__ */ o(Ze, { title: e("common.importJson"), arrow: !0, children: /* @__PURE__ */ o($e, { onClick: () => n(!0), children: /* @__PURE__ */ o(
|
|
8006
|
+
return t && (r = /* @__PURE__ */ o(hu, { onClose: () => n(!1) })), /* @__PURE__ */ w(an, { children: [
|
|
8007
|
+
/* @__PURE__ */ o(Ze, { title: e("common.importJson"), arrow: !0, children: /* @__PURE__ */ o($e, { onClick: () => n(!0), children: /* @__PURE__ */ o(aa, { fontSize: "small" }) }) }),
|
|
7994
8008
|
r
|
|
7995
8009
|
] });
|
|
7996
8010
|
}
|
|
7997
|
-
function
|
|
8011
|
+
function Cu() {
|
|
7998
8012
|
const e = Qe(), t = ct(() => JSON.stringify(e, null, " "), [e]);
|
|
7999
|
-
return /* @__PURE__ */ o(
|
|
8013
|
+
return /* @__PURE__ */ o(Dl, { type: "json", value: t });
|
|
8000
8014
|
}
|
|
8001
|
-
function
|
|
8002
|
-
const { t: e } = Se(), t = Io(), n =
|
|
8015
|
+
function yu() {
|
|
8016
|
+
const { t: e } = Se(), t = Io(), n = Jr();
|
|
8003
8017
|
return /* @__PURE__ */ w(kr, { value: t, onChange: (i, l) => {
|
|
8004
8018
|
switch (l) {
|
|
8005
8019
|
case "json":
|
|
@@ -8016,34 +8030,34 @@ function Cu() {
|
|
|
8016
8030
|
Zt,
|
|
8017
8031
|
{
|
|
8018
8032
|
value: "editor",
|
|
8019
|
-
label: /* @__PURE__ */ o(Ze, { title: e("tabs.edit"), arrow: !0, children: /* @__PURE__ */ o(
|
|
8033
|
+
label: /* @__PURE__ */ o(Ze, { title: e("tabs.edit"), arrow: !0, children: /* @__PURE__ */ o(ua, { fontSize: "small" }) })
|
|
8020
8034
|
}
|
|
8021
8035
|
),
|
|
8022
8036
|
/* @__PURE__ */ o(
|
|
8023
8037
|
Zt,
|
|
8024
8038
|
{
|
|
8025
8039
|
value: "preview",
|
|
8026
|
-
label: /* @__PURE__ */ o(Ze, { title: e("tabs.preview"), arrow: !0, children: /* @__PURE__ */ o(
|
|
8040
|
+
label: /* @__PURE__ */ o(Ze, { title: e("tabs.preview"), arrow: !0, children: /* @__PURE__ */ o(da, { fontSize: "small" }) })
|
|
8027
8041
|
}
|
|
8028
8042
|
),
|
|
8029
8043
|
/* @__PURE__ */ o(
|
|
8030
8044
|
Zt,
|
|
8031
8045
|
{
|
|
8032
8046
|
value: "html",
|
|
8033
|
-
label: /* @__PURE__ */ o(Ze, { title: e("tabs.htmlOutput"), arrow: !0, children: /* @__PURE__ */ o(
|
|
8047
|
+
label: /* @__PURE__ */ o(Ze, { title: e("tabs.htmlOutput"), arrow: !0, children: /* @__PURE__ */ o(sa, { fontSize: "small" }) })
|
|
8034
8048
|
}
|
|
8035
8049
|
),
|
|
8036
8050
|
n && /* @__PURE__ */ o(
|
|
8037
8051
|
Zt,
|
|
8038
8052
|
{
|
|
8039
8053
|
value: "json",
|
|
8040
|
-
label: /* @__PURE__ */ o(Ze, { title: e("tabs.jsonOutput"), arrow: !0, children: /* @__PURE__ */ o(
|
|
8054
|
+
label: /* @__PURE__ */ o(Ze, { title: e("tabs.jsonOutput"), arrow: !0, children: /* @__PURE__ */ o(ca, { fontSize: "small" }) })
|
|
8041
8055
|
}
|
|
8042
8056
|
)
|
|
8043
8057
|
] });
|
|
8044
8058
|
}
|
|
8045
|
-
function
|
|
8046
|
-
const { t: e } = Se(), t =
|
|
8059
|
+
function xu() {
|
|
8060
|
+
const { t: e } = Se(), t = Ta();
|
|
8047
8061
|
return /* @__PURE__ */ o(
|
|
8048
8062
|
ke,
|
|
8049
8063
|
{
|
|
@@ -8064,17 +8078,17 @@ function yu() {
|
|
|
8064
8078
|
}
|
|
8065
8079
|
);
|
|
8066
8080
|
}
|
|
8067
|
-
function xu() {
|
|
8068
|
-
const { t: e } = Se(), t = La();
|
|
8069
|
-
return /* @__PURE__ */ o(Ze, { title: e("common.redoTooltip"), arrow: !0, children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o($e, { onClick: el, disabled: !t, size: "small", children: /* @__PURE__ */ o(Pi, { fontSize: "small" }) }) }) });
|
|
8070
|
-
}
|
|
8071
8081
|
function Su() {
|
|
8072
|
-
const { t: e } = Se(), t =
|
|
8073
|
-
return /* @__PURE__ */ o(Ze, { title: e("common.
|
|
8082
|
+
const { t: e } = Se(), t = Wa();
|
|
8083
|
+
return /* @__PURE__ */ o(Ze, { title: e("common.redoTooltip"), arrow: !0, children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o($e, { onClick: Qr, disabled: !t, size: "small", children: /* @__PURE__ */ o(pa, { fontSize: "small" }) }) }) });
|
|
8074
8084
|
}
|
|
8075
8085
|
function vu() {
|
|
8086
|
+
const { t: e } = Se(), t = La();
|
|
8087
|
+
return /* @__PURE__ */ o(Ze, { title: e("common.undoTooltip"), arrow: !0, children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o($e, { onClick: Zr, disabled: !t, size: "small", children: /* @__PURE__ */ o(fa, { fontSize: "small" }) }) }) });
|
|
8088
|
+
}
|
|
8089
|
+
function wu() {
|
|
8076
8090
|
var g, f, m, h, b, S;
|
|
8077
|
-
const { t: e } = Se(), t = Qe(), n = Io(), r =
|
|
8091
|
+
const { t: e } = Se(), t = Qe(), n = Io(), r = ba(), i = Jr();
|
|
8078
8092
|
mt.useEffect(() => {
|
|
8079
8093
|
!i && n === "json" && po("editor");
|
|
8080
8094
|
}, [i, n]);
|
|
@@ -8098,13 +8112,13 @@ function vu() {
|
|
|
8098
8112
|
}, u = () => {
|
|
8099
8113
|
switch (n) {
|
|
8100
8114
|
case "editor":
|
|
8101
|
-
return /* @__PURE__ */ o(se, { sx: l, children: /* @__PURE__ */ o(
|
|
8115
|
+
return /* @__PURE__ */ o(se, { sx: l, children: /* @__PURE__ */ o(kl, { id: "root" }) });
|
|
8102
8116
|
case "preview":
|
|
8103
|
-
return /* @__PURE__ */ o(se, { sx: l, children: /* @__PURE__ */ o(
|
|
8117
|
+
return /* @__PURE__ */ o(se, { sx: l, children: /* @__PURE__ */ o(jl, { document: t, rootBlockId: "root" }) });
|
|
8104
8118
|
case "html":
|
|
8105
|
-
return /* @__PURE__ */ o(
|
|
8119
|
+
return /* @__PURE__ */ o(gu, {});
|
|
8106
8120
|
case "json":
|
|
8107
|
-
return i ? /* @__PURE__ */ o(
|
|
8121
|
+
return i ? /* @__PURE__ */ o(Cu, {}) : null;
|
|
8108
8122
|
}
|
|
8109
8123
|
};
|
|
8110
8124
|
return /* @__PURE__ */ w(se, { sx: { display: "flex", flexDirection: "column", height: "100%", overflow: "hidden" }, children: [
|
|
@@ -8125,22 +8139,22 @@ function vu() {
|
|
|
8125
8139
|
justifyContent: "space-between",
|
|
8126
8140
|
alignItems: "center",
|
|
8127
8141
|
children: [
|
|
8128
|
-
/* @__PURE__ */ o(
|
|
8129
|
-
/* @__PURE__ */ o(
|
|
8142
|
+
/* @__PURE__ */ o(au, {}),
|
|
8143
|
+
/* @__PURE__ */ o(xu, {}),
|
|
8130
8144
|
/* @__PURE__ */ w(Z, { px: 2, direction: "row", gap: 2, width: "100%", justifyContent: "space-between", alignItems: "center", children: [
|
|
8131
|
-
/* @__PURE__ */ o(Z, { direction: "row", spacing: 2, children: /* @__PURE__ */ o(
|
|
8145
|
+
/* @__PURE__ */ o(Z, { direction: "row", spacing: 2, children: /* @__PURE__ */ o(yu, {}) }),
|
|
8132
8146
|
/* @__PURE__ */ w(Z, { direction: "row", spacing: 2, alignItems: "center", children: [
|
|
8147
|
+
/* @__PURE__ */ o(vu, {}),
|
|
8133
8148
|
/* @__PURE__ */ o(Su, {}),
|
|
8134
|
-
/* @__PURE__ */ o(
|
|
8135
|
-
i && /* @__PURE__ */ o(
|
|
8136
|
-
i && /* @__PURE__ */ o(hu, {}),
|
|
8149
|
+
i && /* @__PURE__ */ o(su, {}),
|
|
8150
|
+
i && /* @__PURE__ */ o(bu, {}),
|
|
8137
8151
|
/* @__PURE__ */ w(bo, { size: "small", value: s, exclusive: !0, onChange: a, children: [
|
|
8138
|
-
/* @__PURE__ */ o(Ze, { title: e("common.desktopView"), arrow: !0, children: /* @__PURE__ */ o(le, { value: "desktop", sx: s === "desktop" ? d : void 0, children: /* @__PURE__ */ o(
|
|
8139
|
-
/* @__PURE__ */ o(Ze, { title: e("common.mobileView"), arrow: !0, children: /* @__PURE__ */ o(le, { value: "mobile", sx: s === "mobile" ? d : void 0, children: /* @__PURE__ */ o(
|
|
8152
|
+
/* @__PURE__ */ o(Ze, { title: e("common.desktopView"), arrow: !0, children: /* @__PURE__ */ o(le, { value: "desktop", sx: s === "desktop" ? d : void 0, children: /* @__PURE__ */ o(Xi, { fontSize: "small" }) }) }),
|
|
8153
|
+
/* @__PURE__ */ o(Ze, { title: e("common.mobileView"), arrow: !0, children: /* @__PURE__ */ o(le, { value: "mobile", sx: s === "mobile" ? d : void 0, children: /* @__PURE__ */ o(Gi, { fontSize: "small" }) }) })
|
|
8140
8154
|
] })
|
|
8141
8155
|
] })
|
|
8142
8156
|
] }),
|
|
8143
|
-
/* @__PURE__ */ o(
|
|
8157
|
+
/* @__PURE__ */ o(lu, {})
|
|
8144
8158
|
]
|
|
8145
8159
|
}
|
|
8146
8160
|
),
|
|
@@ -8154,7 +8168,7 @@ function gr(e, t) {
|
|
|
8154
8168
|
duration: t ? n.duration.enteringScreen : n.duration.leavingScreen
|
|
8155
8169
|
});
|
|
8156
8170
|
}
|
|
8157
|
-
function
|
|
8171
|
+
function Iu() {
|
|
8158
8172
|
const e = ko(), t = Do(), n = gr("margin-left", t), r = gr("margin-right", e);
|
|
8159
8173
|
return Ce(() => {
|
|
8160
8174
|
const i = (l) => {
|
|
@@ -8162,13 +8176,13 @@ function wu() {
|
|
|
8162
8176
|
const a = l.target;
|
|
8163
8177
|
if (a.tagName === "INPUT" || a.tagName === "TEXTAREA" || a.isContentEditable)
|
|
8164
8178
|
return;
|
|
8165
|
-
l.preventDefault(),
|
|
8179
|
+
l.preventDefault(), Zr();
|
|
8166
8180
|
}
|
|
8167
8181
|
if ((l.metaKey || l.ctrlKey) && (l.key === "y" || l.key === "z" && l.shiftKey)) {
|
|
8168
8182
|
const a = l.target;
|
|
8169
8183
|
if (a.tagName === "INPUT" || a.tagName === "TEXTAREA" || a.isContentEditable)
|
|
8170
8184
|
return;
|
|
8171
|
-
l.preventDefault(),
|
|
8185
|
+
l.preventDefault(), Qr();
|
|
8172
8186
|
}
|
|
8173
8187
|
};
|
|
8174
8188
|
return window.addEventListener("keydown", i), () => {
|
|
@@ -8185,7 +8199,7 @@ function wu() {
|
|
|
8185
8199
|
overflow: "hidden"
|
|
8186
8200
|
},
|
|
8187
8201
|
children: [
|
|
8188
|
-
/* @__PURE__ */ o(
|
|
8202
|
+
/* @__PURE__ */ o(xc, {}),
|
|
8189
8203
|
/* @__PURE__ */ o(
|
|
8190
8204
|
Z,
|
|
8191
8205
|
{
|
|
@@ -8198,15 +8212,15 @@ function wu() {
|
|
|
8198
8212
|
overflow: "hidden",
|
|
8199
8213
|
zIndex: 0
|
|
8200
8214
|
},
|
|
8201
|
-
children: /* @__PURE__ */ o(
|
|
8215
|
+
children: /* @__PURE__ */ o(wu, {})
|
|
8202
8216
|
}
|
|
8203
8217
|
),
|
|
8204
|
-
/* @__PURE__ */ o(
|
|
8218
|
+
/* @__PURE__ */ o(pc, {})
|
|
8205
8219
|
]
|
|
8206
8220
|
}
|
|
8207
8221
|
);
|
|
8208
8222
|
}
|
|
8209
|
-
const
|
|
8223
|
+
const ku = Bl(function() {
|
|
8210
8224
|
return /* @__PURE__ */ o(
|
|
8211
8225
|
se,
|
|
8212
8226
|
{
|
|
@@ -8218,10 +8232,10 @@ const Iu = Ml(function() {
|
|
|
8218
8232
|
flexDirection: "column",
|
|
8219
8233
|
overflow: "hidden"
|
|
8220
8234
|
},
|
|
8221
|
-
children: /* @__PURE__ */ o(
|
|
8235
|
+
children: /* @__PURE__ */ o(Iu, {})
|
|
8222
8236
|
}
|
|
8223
8237
|
);
|
|
8224
|
-
}),
|
|
8238
|
+
}), Du = Ol(({
|
|
8225
8239
|
initialDocument: e,
|
|
8226
8240
|
language: t = "en",
|
|
8227
8241
|
imageUploadHandler: n,
|
|
@@ -8238,10 +8252,10 @@ const Iu = Ml(function() {
|
|
|
8238
8252
|
contactAttributes: m,
|
|
8239
8253
|
variables: h
|
|
8240
8254
|
}, b) => {
|
|
8241
|
-
const S =
|
|
8255
|
+
const S = Me(!1);
|
|
8242
8256
|
if (!S.current) {
|
|
8243
8257
|
const y = Xo(e ?? sn);
|
|
8244
|
-
|
|
8258
|
+
ga({
|
|
8245
8259
|
document: to(y, h),
|
|
8246
8260
|
language: t,
|
|
8247
8261
|
showJsonFeatures: s,
|
|
@@ -8256,20 +8270,20 @@ const Iu = Ml(function() {
|
|
|
8256
8270
|
}
|
|
8257
8271
|
}, [e]), Ce(() => {
|
|
8258
8272
|
if (h === void 0 || h.length === 0) return;
|
|
8259
|
-
const y =
|
|
8273
|
+
const y = O.getState().document;
|
|
8260
8274
|
Rt(to(y, h));
|
|
8261
8275
|
}, [h]), Ce(() => {
|
|
8262
|
-
t !== void 0 &&
|
|
8276
|
+
t !== void 0 && Aa(t);
|
|
8263
8277
|
}, [t]), Ce(() => {
|
|
8264
|
-
|
|
8278
|
+
ka(n);
|
|
8265
8279
|
}, [n]), Ce(() => {
|
|
8266
|
-
|
|
8280
|
+
Da(r);
|
|
8267
8281
|
}, [r]), Ce(() => {
|
|
8268
|
-
|
|
8269
|
-
}, [i]),
|
|
8282
|
+
va(i);
|
|
8283
|
+
}, [i]), Ml(b, () => ({
|
|
8270
8284
|
getData: (y) => {
|
|
8271
8285
|
Go();
|
|
8272
|
-
const k =
|
|
8286
|
+
const k = O.getState().document;
|
|
8273
8287
|
try {
|
|
8274
8288
|
const D = yo(k, { rootBlockId: "root" });
|
|
8275
8289
|
y(k, D);
|
|
@@ -8279,32 +8293,32 @@ const Iu = Ml(function() {
|
|
|
8279
8293
|
},
|
|
8280
8294
|
getVariables: (y) => {
|
|
8281
8295
|
Go();
|
|
8282
|
-
const k =
|
|
8283
|
-
y(
|
|
8296
|
+
const k = O.getState().document;
|
|
8297
|
+
y(ys(k));
|
|
8284
8298
|
}
|
|
8285
8299
|
})), Ce(() => {
|
|
8286
|
-
l !== void 0 &&
|
|
8300
|
+
l !== void 0 && _a(l);
|
|
8287
8301
|
}, [l]), Ce(() => {
|
|
8288
|
-
|
|
8302
|
+
Ba(a);
|
|
8289
8303
|
}, [a]), Ce(() => {
|
|
8290
|
-
|
|
8304
|
+
Na(s);
|
|
8291
8305
|
}, [s]), Ce(() => {
|
|
8292
|
-
|
|
8306
|
+
Pa(d);
|
|
8293
8307
|
}, [d]), Ce(() => {
|
|
8294
|
-
|
|
8308
|
+
Oa(g);
|
|
8295
8309
|
}, [g]), Ce(() => {
|
|
8296
8310
|
Ma(f);
|
|
8297
8311
|
}, [f]), Ce(() => {
|
|
8298
|
-
|
|
8299
|
-
}, [m]), /* @__PURE__ */ w(
|
|
8300
|
-
/* @__PURE__ */ o(
|
|
8301
|
-
/* @__PURE__ */ o(
|
|
8312
|
+
ha(m);
|
|
8313
|
+
}, [m]), /* @__PURE__ */ w(Ul, { theme: c || ks, children: [
|
|
8314
|
+
/* @__PURE__ */ o($l, {}),
|
|
8315
|
+
/* @__PURE__ */ o(Ha, { value: u ?? null, children: /* @__PURE__ */ o(ku, {}) })
|
|
8302
8316
|
] });
|
|
8303
8317
|
});
|
|
8304
|
-
|
|
8318
|
+
Du.displayName = "EmailBuilder";
|
|
8305
8319
|
export {
|
|
8306
|
-
|
|
8307
|
-
|
|
8320
|
+
Du as EmailBuilder,
|
|
8321
|
+
Du as default,
|
|
8308
8322
|
Qe as useDocument,
|
|
8309
|
-
|
|
8323
|
+
Ea as useLanguage
|
|
8310
8324
|
};
|