@kontakto/email-template-editor 1.4.0 → 1.5.0
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/index.cjs +1396 -423
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +754 -9
- package/dist/index.d.ts +754 -9
- package/dist/index.js +1304 -335
- package/dist/index.js.map +1 -1
- package/package.json +10 -19
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import DOMPurify from 'dompurify';
|
|
2
2
|
import { marked, Renderer } from 'marked';
|
|
3
|
-
import
|
|
3
|
+
import React72, { createContext, forwardRef, useRef, useEffect, useImperativeHandle, useMemo, useContext, useState, useCallback, Fragment } from 'react';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { renderToStaticMarkup as renderToStaticMarkup$1 } from 'react-dom/server';
|
|
6
6
|
import { createTheme, alpha, lighten, darken } from '@mui/material/styles';
|
|
7
7
|
import { MenuItem, Stack, ThemeProvider, CssBaseline, useTheme, Drawer, Box, Tabs, Tab, Typography, CircularProgress, Divider as Divider$1, ToggleButtonGroup, ToggleButton, Tooltip, Snackbar, Button as Button$1, IconButton, Dialog, DialogTitle, DialogContent, TextField, DialogActions, InputLabel, FormControlLabel, Switch, Menu, Slider, ButtonBase, Paper, Fade } from '@mui/material';
|
|
8
8
|
import { create } from 'zustand';
|
|
9
|
-
import { MonitorOutlined, PhoneIphoneOutlined, EditOutlined, PreviewOutlined, CodeOutlined, SubjectOutlined, DataObjectOutlined, Add, SaveOutlined, LastPageOutlined, AppRegistrationOutlined, ContentCopyOutlined, DeleteOutlined, FirstPageOutlined, MenuOutlined, FileDownloadOutlined, RoundedCornerOutlined, HeightOutlined, VerticalAlignTopOutlined, VerticalAlignCenterOutlined, VerticalAlignBottomOutlined, SpaceBarOutlined,
|
|
9
|
+
import { MonitorOutlined, PhoneIphoneOutlined, EditOutlined, PreviewOutlined, CodeOutlined, SubjectOutlined, DataObjectOutlined, Add, SaveOutlined, LastPageOutlined, AppRegistrationOutlined, ContentCopyOutlined, DeleteOutlined, FirstPageOutlined, MenuOutlined, FileDownloadOutlined, RoundedCornerOutlined, AspectRatioOutlined, HeightOutlined, VerticalAlignTopOutlined, VerticalAlignCenterOutlined, VerticalAlignBottomOutlined, SpaceBarOutlined, AddOutlined, CloseOutlined, AlignVerticalTopOutlined, AlignVerticalBottomOutlined, AlignHorizontalLeftOutlined, AlignHorizontalRightOutlined, FormatAlignLeftOutlined, FormatAlignCenterOutlined, FormatAlignRightOutlined, TextFieldsOutlined, ArrowUpwardOutlined, ArrowDownwardOutlined, HMobiledataOutlined, NotesOutlined, SmartButtonOutlined, ImageOutlined, AccountCircleOutlined, ContactMailOutlined, BusinessOutlined, HorizontalRuleOutlined, Crop32Outlined, HtmlOutlined, ViewColumnOutlined, LibraryAddOutlined } from '@mui/icons-material';
|
|
10
10
|
import { HexColorPicker, HexColorInput } from 'react-colorful';
|
|
11
11
|
import hljs from 'highlight.js';
|
|
12
12
|
import jsonHighlighter from 'highlight.js/lib/languages/json';
|
|
@@ -159,7 +159,7 @@ function renderMarkdownString(str) {
|
|
|
159
159
|
function EmailMarkdown(_a) {
|
|
160
160
|
var _b = _a, { markdown } = _b, props = __objRest(_b, ["markdown"]);
|
|
161
161
|
const data = useMemo(() => renderMarkdownString(markdown), [markdown]);
|
|
162
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ React72.createElement("div", __spreadProps(__spreadValues({}, props), { dangerouslySetInnerHTML: { __html: data } }));
|
|
163
163
|
}
|
|
164
164
|
var FONT_FAMILY_SCHEMA = z.enum([
|
|
165
165
|
"MODERN_SANS",
|
|
@@ -235,9 +235,9 @@ function Text({ style, props }) {
|
|
|
235
235
|
};
|
|
236
236
|
const text = (_f = props == null ? void 0 : props.text) != null ? _f : TextPropsDefaults.text;
|
|
237
237
|
if (props == null ? void 0 : props.markdown) {
|
|
238
|
-
return /* @__PURE__ */
|
|
238
|
+
return /* @__PURE__ */ React72.createElement(EmailMarkdown, { style: wStyle, markdown: text });
|
|
239
239
|
}
|
|
240
|
-
return /* @__PURE__ */
|
|
240
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wStyle }, text);
|
|
241
241
|
}
|
|
242
242
|
var PADDING_SCHEMA2 = z.object({
|
|
243
243
|
top: z.number(),
|
|
@@ -286,7 +286,7 @@ function Avatar({ style, props }) {
|
|
|
286
286
|
textAlign: (_e = style == null ? void 0 : style.textAlign) != null ? _e : void 0,
|
|
287
287
|
padding: getPadding2(style == null ? void 0 : style.padding)
|
|
288
288
|
};
|
|
289
|
-
return /* @__PURE__ */
|
|
289
|
+
return /* @__PURE__ */ React72.createElement("div", { style: sectionStyle }, /* @__PURE__ */ React72.createElement(
|
|
290
290
|
"img",
|
|
291
291
|
{
|
|
292
292
|
alt,
|
|
@@ -434,14 +434,14 @@ function Button({ style, props }) {
|
|
|
434
434
|
padding: `${padding[0]}px ${padding[1]}px`,
|
|
435
435
|
textDecoration: "none"
|
|
436
436
|
};
|
|
437
|
-
return /* @__PURE__ */
|
|
437
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wrapperStyle }, /* @__PURE__ */ React72.createElement("a", { href: url, style: linkStyle, target: "_blank" }, /* @__PURE__ */ React72.createElement(
|
|
438
438
|
"span",
|
|
439
439
|
{
|
|
440
440
|
dangerouslySetInnerHTML: {
|
|
441
441
|
__html: `<!--[if mso]><i style="letter-spacing: ${padding[1]}px;mso-font-width:-100%;mso-text-raise:${textRaise}" hidden> </i><![endif]-->`
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
), /* @__PURE__ */
|
|
444
|
+
), /* @__PURE__ */ React72.createElement("span", null, text), /* @__PURE__ */ React72.createElement(
|
|
445
445
|
"span",
|
|
446
446
|
{
|
|
447
447
|
dangerouslySetInnerHTML: {
|
|
@@ -490,7 +490,7 @@ function ColumnsContainer({ style, columns, props }) {
|
|
|
490
490
|
contentAlignment: (_d = props == null ? void 0 : props.contentAlignment) != null ? _d : ColumnsContainerPropsDefaults.contentAlignment,
|
|
491
491
|
fixedWidths: props == null ? void 0 : props.fixedWidths
|
|
492
492
|
};
|
|
493
|
-
return /* @__PURE__ */
|
|
493
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wStyle }, /* @__PURE__ */ React72.createElement(
|
|
494
494
|
"table",
|
|
495
495
|
{
|
|
496
496
|
align: "center",
|
|
@@ -499,7 +499,7 @@ function ColumnsContainer({ style, columns, props }) {
|
|
|
499
499
|
border: 0,
|
|
500
500
|
style: { tableLayout: "fixed", borderCollapse: "collapse" }
|
|
501
501
|
},
|
|
502
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ React72.createElement("tbody", { style: { width: "100%" } }, /* @__PURE__ */ React72.createElement("tr", { style: { width: "100%" } }, /* @__PURE__ */ React72.createElement(TableCell, { index: 0, props: blockProps, columns }), /* @__PURE__ */ React72.createElement(TableCell, { index: 1, props: blockProps, columns }), /* @__PURE__ */ React72.createElement(TableCell, { index: 2, props: blockProps, columns })))
|
|
503
503
|
));
|
|
504
504
|
}
|
|
505
505
|
function TableCell({ index, props, columns }) {
|
|
@@ -517,7 +517,7 @@ function TableCell({ index, props, columns }) {
|
|
|
517
517
|
width: (_d = (_c = props.fixedWidths) == null ? void 0 : _c[index]) != null ? _d : void 0
|
|
518
518
|
};
|
|
519
519
|
const children = (_e = columns && columns[index]) != null ? _e : null;
|
|
520
|
-
return /* @__PURE__ */
|
|
520
|
+
return /* @__PURE__ */ React72.createElement("td", { style }, children);
|
|
521
521
|
}
|
|
522
522
|
function getPaddingBefore(index, { columnsGap, columnsCount }) {
|
|
523
523
|
if (index === 0) {
|
|
@@ -579,9 +579,9 @@ function Container({ style, children }) {
|
|
|
579
579
|
padding: getPadding5(style == null ? void 0 : style.padding)
|
|
580
580
|
};
|
|
581
581
|
if (!children) {
|
|
582
|
-
return /* @__PURE__ */
|
|
582
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wStyle });
|
|
583
583
|
}
|
|
584
|
-
return /* @__PURE__ */
|
|
584
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wStyle }, children);
|
|
585
585
|
}
|
|
586
586
|
var container_default = Container;
|
|
587
587
|
var COLOR_SCHEMA5 = z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
@@ -615,7 +615,7 @@ function Divider({ style, props }) {
|
|
|
615
615
|
};
|
|
616
616
|
const borderTopWidth = (_b = props == null ? void 0 : props.lineHeight) != null ? _b : DividerPropsDefaults.lineHeight;
|
|
617
617
|
const borderTopColor = (_c = props == null ? void 0 : props.lineColor) != null ? _c : DividerPropsDefaults.lineColor;
|
|
618
|
-
return /* @__PURE__ */
|
|
618
|
+
return /* @__PURE__ */ React72.createElement("div", { style: st }, /* @__PURE__ */ React72.createElement(
|
|
619
619
|
"hr",
|
|
620
620
|
{
|
|
621
621
|
style: {
|
|
@@ -705,11 +705,11 @@ function Heading({ props, style }) {
|
|
|
705
705
|
};
|
|
706
706
|
switch (level) {
|
|
707
707
|
case "h1":
|
|
708
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ React72.createElement("h1", { style: hStyle }, text);
|
|
709
709
|
case "h2":
|
|
710
|
-
return /* @__PURE__ */
|
|
710
|
+
return /* @__PURE__ */ React72.createElement("h2", { style: hStyle }, text);
|
|
711
711
|
case "h3":
|
|
712
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ React72.createElement("h3", { style: hStyle }, text);
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
715
|
function getFontSize(level) {
|
|
@@ -791,9 +791,9 @@ function Html({ style, props }) {
|
|
|
791
791
|
padding: getPadding8(style == null ? void 0 : style.padding)
|
|
792
792
|
};
|
|
793
793
|
if (!children) {
|
|
794
|
-
return /* @__PURE__ */
|
|
794
|
+
return /* @__PURE__ */ React72.createElement("div", { style: cssStyle });
|
|
795
795
|
}
|
|
796
|
-
return /* @__PURE__ */
|
|
796
|
+
return /* @__PURE__ */ React72.createElement("div", { style: cssStyle, dangerouslySetInnerHTML: { __html: children } });
|
|
797
797
|
}
|
|
798
798
|
var html_default = Html;
|
|
799
799
|
var PADDING_SCHEMA9 = z.object({
|
|
@@ -829,7 +829,7 @@ function Image({ style, props }) {
|
|
|
829
829
|
const linkHref = (_c = props == null ? void 0 : props.linkHref) != null ? _c : null;
|
|
830
830
|
const width = (_d = props == null ? void 0 : props.width) != null ? _d : void 0;
|
|
831
831
|
const height = (_e = props == null ? void 0 : props.height) != null ? _e : void 0;
|
|
832
|
-
const imageElement = /* @__PURE__ */
|
|
832
|
+
const imageElement = /* @__PURE__ */ React72.createElement(
|
|
833
833
|
"img",
|
|
834
834
|
{
|
|
835
835
|
alt: (_f = props == null ? void 0 : props.alt) != null ? _f : "",
|
|
@@ -849,11 +849,187 @@ function Image({ style, props }) {
|
|
|
849
849
|
}
|
|
850
850
|
);
|
|
851
851
|
if (!linkHref) {
|
|
852
|
-
return /* @__PURE__ */
|
|
852
|
+
return /* @__PURE__ */ React72.createElement("div", { style: sectionStyle }, imageElement);
|
|
853
853
|
}
|
|
854
|
-
return /* @__PURE__ */
|
|
854
|
+
return /* @__PURE__ */ React72.createElement("div", { style: sectionStyle }, /* @__PURE__ */ React72.createElement("a", { href: linkHref, style: { textDecoration: "none" }, target: "_blank" }, imageElement));
|
|
855
855
|
}
|
|
856
856
|
var image_default = Image;
|
|
857
|
+
var FONT_FAMILY_SCHEMA5 = z.enum([
|
|
858
|
+
"MODERN_SANS",
|
|
859
|
+
"BOOK_SANS",
|
|
860
|
+
"ORGANIC_SANS",
|
|
861
|
+
"GEOMETRIC_SANS",
|
|
862
|
+
"HEAVY_SANS",
|
|
863
|
+
"ROUNDED_SANS",
|
|
864
|
+
"MODERN_SERIF",
|
|
865
|
+
"BOOK_SERIF",
|
|
866
|
+
"MONOSPACE"
|
|
867
|
+
]).nullable().optional();
|
|
868
|
+
function getFontFamily5(fontFamily) {
|
|
869
|
+
switch (fontFamily) {
|
|
870
|
+
case "MODERN_SANS":
|
|
871
|
+
return '"Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif';
|
|
872
|
+
case "BOOK_SANS":
|
|
873
|
+
return 'Optima, Candara, "Noto Sans", source-sans-pro, sans-serif';
|
|
874
|
+
case "ORGANIC_SANS":
|
|
875
|
+
return 'Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif';
|
|
876
|
+
case "GEOMETRIC_SANS":
|
|
877
|
+
return 'Avenir, "Avenir Next LT Pro", Montserrat, Corbel, "URW Gothic", source-sans-pro, sans-serif';
|
|
878
|
+
case "HEAVY_SANS":
|
|
879
|
+
return 'Bahnschrift, "DIN Alternate", "Franklin Gothic Medium", "Nimbus Sans Narrow", sans-serif-condensed, sans-serif';
|
|
880
|
+
case "ROUNDED_SANS":
|
|
881
|
+
return 'ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, Comfortaa, Manjari, "Arial Rounded MT Bold", Calibri, source-sans-pro, sans-serif';
|
|
882
|
+
case "MODERN_SERIF":
|
|
883
|
+
return 'Charter, "Bitstream Charter", "Sitka Text", Cambria, serif';
|
|
884
|
+
case "BOOK_SERIF":
|
|
885
|
+
return '"Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif';
|
|
886
|
+
case "MONOSPACE":
|
|
887
|
+
return '"Nimbus Mono PS", "Courier New", "Cutive Mono", monospace';
|
|
888
|
+
}
|
|
889
|
+
return void 0;
|
|
890
|
+
}
|
|
891
|
+
var COLOR_SCHEMA8 = z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
892
|
+
var PADDING_SCHEMA10 = z.object({
|
|
893
|
+
top: z.number(),
|
|
894
|
+
bottom: z.number(),
|
|
895
|
+
right: z.number(),
|
|
896
|
+
left: z.number()
|
|
897
|
+
}).optional().nullable();
|
|
898
|
+
var getPadding10 = (padding) => padding ? `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px` : void 0;
|
|
899
|
+
var SignaturePropsSchema = z.object({
|
|
900
|
+
style: z.object({
|
|
901
|
+
backgroundColor: COLOR_SCHEMA8,
|
|
902
|
+
fontFamily: FONT_FAMILY_SCHEMA5,
|
|
903
|
+
padding: PADDING_SCHEMA10
|
|
904
|
+
}).optional().nullable(),
|
|
905
|
+
props: z.object({
|
|
906
|
+
greeting: z.string().optional().nullable(),
|
|
907
|
+
name: z.string().optional().nullable(),
|
|
908
|
+
title: z.string().optional().nullable(),
|
|
909
|
+
company: z.string().optional().nullable(),
|
|
910
|
+
address: z.string().optional().nullable(),
|
|
911
|
+
email: z.string().optional().nullable(),
|
|
912
|
+
phone: z.string().optional().nullable(),
|
|
913
|
+
website: z.string().optional().nullable(),
|
|
914
|
+
imageUrl: z.string().optional().nullable(),
|
|
915
|
+
imageSize: z.number().optional().nullable(),
|
|
916
|
+
imageShape: z.enum(["circle", "square", "rounded"]).optional().nullable(),
|
|
917
|
+
layout: z.enum(["horizontal", "vertical"]).optional().nullable(),
|
|
918
|
+
nameColor: COLOR_SCHEMA8,
|
|
919
|
+
textColor: COLOR_SCHEMA8,
|
|
920
|
+
linkColor: COLOR_SCHEMA8
|
|
921
|
+
}).optional().nullable()
|
|
922
|
+
});
|
|
923
|
+
var SignatureProps = SignaturePropsSchema;
|
|
924
|
+
var SignaturePropsDefaults = {
|
|
925
|
+
greeting: "",
|
|
926
|
+
name: "",
|
|
927
|
+
title: "",
|
|
928
|
+
company: "",
|
|
929
|
+
address: "",
|
|
930
|
+
email: "",
|
|
931
|
+
phone: "",
|
|
932
|
+
website: "",
|
|
933
|
+
imageUrl: "",
|
|
934
|
+
imageSize: 64,
|
|
935
|
+
imageShape: "circle",
|
|
936
|
+
layout: "horizontal",
|
|
937
|
+
nameColor: "#262626",
|
|
938
|
+
textColor: "#666666",
|
|
939
|
+
linkColor: "#0079CC"
|
|
940
|
+
};
|
|
941
|
+
function getImageBorderRadius(shape, size) {
|
|
942
|
+
switch (shape) {
|
|
943
|
+
case "circle":
|
|
944
|
+
return size;
|
|
945
|
+
case "rounded":
|
|
946
|
+
return size * 0.125;
|
|
947
|
+
case "square":
|
|
948
|
+
default:
|
|
949
|
+
return void 0;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
function Signature({ style, props }) {
|
|
953
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
954
|
+
const greeting = (_a = props == null ? void 0 : props.greeting) != null ? _a : SignaturePropsDefaults.greeting;
|
|
955
|
+
const name = (_b = props == null ? void 0 : props.name) != null ? _b : SignaturePropsDefaults.name;
|
|
956
|
+
const title = (_c = props == null ? void 0 : props.title) != null ? _c : SignaturePropsDefaults.title;
|
|
957
|
+
const company = (_d = props == null ? void 0 : props.company) != null ? _d : SignaturePropsDefaults.company;
|
|
958
|
+
const address = (_e = props == null ? void 0 : props.address) != null ? _e : SignaturePropsDefaults.address;
|
|
959
|
+
const email = (_f = props == null ? void 0 : props.email) != null ? _f : SignaturePropsDefaults.email;
|
|
960
|
+
const phone = (_g = props == null ? void 0 : props.phone) != null ? _g : SignaturePropsDefaults.phone;
|
|
961
|
+
const website = (_h = props == null ? void 0 : props.website) != null ? _h : SignaturePropsDefaults.website;
|
|
962
|
+
const imageUrl = (_i = props == null ? void 0 : props.imageUrl) != null ? _i : SignaturePropsDefaults.imageUrl;
|
|
963
|
+
const imageSize = (_j = props == null ? void 0 : props.imageSize) != null ? _j : SignaturePropsDefaults.imageSize;
|
|
964
|
+
const imageShape = (_k = props == null ? void 0 : props.imageShape) != null ? _k : SignaturePropsDefaults.imageShape;
|
|
965
|
+
const layout = (_l = props == null ? void 0 : props.layout) != null ? _l : SignaturePropsDefaults.layout;
|
|
966
|
+
const nameColor = (_m = props == null ? void 0 : props.nameColor) != null ? _m : SignaturePropsDefaults.nameColor;
|
|
967
|
+
const textColor = (_n = props == null ? void 0 : props.textColor) != null ? _n : SignaturePropsDefaults.textColor;
|
|
968
|
+
const linkColor = (_o = props == null ? void 0 : props.linkColor) != null ? _o : SignaturePropsDefaults.linkColor;
|
|
969
|
+
const wrapperStyle = {
|
|
970
|
+
backgroundColor: (_p = style == null ? void 0 : style.backgroundColor) != null ? _p : void 0,
|
|
971
|
+
fontFamily: getFontFamily5(style == null ? void 0 : style.fontFamily),
|
|
972
|
+
padding: getPadding10(style == null ? void 0 : style.padding)
|
|
973
|
+
};
|
|
974
|
+
const greetingStyle = {
|
|
975
|
+
fontSize: 14,
|
|
976
|
+
color: textColor,
|
|
977
|
+
margin: 0,
|
|
978
|
+
marginBottom: 8,
|
|
979
|
+
lineHeight: "1.4",
|
|
980
|
+
fontStyle: "italic"
|
|
981
|
+
};
|
|
982
|
+
const nameStyle = {
|
|
983
|
+
fontSize: 16,
|
|
984
|
+
fontWeight: "bold",
|
|
985
|
+
color: nameColor,
|
|
986
|
+
margin: 0,
|
|
987
|
+
lineHeight: "1.4"
|
|
988
|
+
};
|
|
989
|
+
const detailStyle = {
|
|
990
|
+
fontSize: 14,
|
|
991
|
+
color: textColor,
|
|
992
|
+
margin: 0,
|
|
993
|
+
lineHeight: "1.4"
|
|
994
|
+
};
|
|
995
|
+
const linkStyle = {
|
|
996
|
+
fontSize: 14,
|
|
997
|
+
color: linkColor,
|
|
998
|
+
textDecoration: "none"
|
|
999
|
+
};
|
|
1000
|
+
const imageElement = imageUrl ? /* @__PURE__ */ React72.createElement(
|
|
1001
|
+
"img",
|
|
1002
|
+
{
|
|
1003
|
+
src: imageUrl,
|
|
1004
|
+
alt: name || company,
|
|
1005
|
+
width: imageSize,
|
|
1006
|
+
height: imageSize,
|
|
1007
|
+
style: {
|
|
1008
|
+
width: imageSize,
|
|
1009
|
+
height: imageSize,
|
|
1010
|
+
objectFit: "cover",
|
|
1011
|
+
borderRadius: getImageBorderRadius(imageShape, imageSize),
|
|
1012
|
+
display: "block",
|
|
1013
|
+
outline: "none",
|
|
1014
|
+
border: "none"
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
) : null;
|
|
1018
|
+
const contactParts = [];
|
|
1019
|
+
if (email) contactParts.push(/* @__PURE__ */ React72.createElement("a", { key: "email", href: `mailto:${email}`, style: linkStyle }, email));
|
|
1020
|
+
if (phone) contactParts.push(/* @__PURE__ */ React72.createElement("a", { key: "phone", href: `tel:${phone}`, style: linkStyle }, phone));
|
|
1021
|
+
if (website) {
|
|
1022
|
+
const href = website.startsWith("http") ? website : `https://${website}`;
|
|
1023
|
+
contactParts.push(/* @__PURE__ */ React72.createElement("a", { key: "website", href, style: linkStyle, target: "_blank" }, website));
|
|
1024
|
+
}
|
|
1025
|
+
const textContent = /* @__PURE__ */ React72.createElement("div", null, name && /* @__PURE__ */ React72.createElement("p", { style: nameStyle }, name), title && /* @__PURE__ */ React72.createElement("p", { style: detailStyle }, title), company && /* @__PURE__ */ React72.createElement("p", { style: detailStyle }, company), address && /* @__PURE__ */ React72.createElement("p", { style: detailStyle }, address), contactParts.length > 0 && /* @__PURE__ */ React72.createElement("p", { style: __spreadProps(__spreadValues({}, detailStyle), { marginTop: 4 }) }, contactParts.map((part, i) => /* @__PURE__ */ React72.createElement(React72.Fragment, { key: i }, i > 0 && /* @__PURE__ */ React72.createElement("span", { style: detailStyle }, " \xB7 "), part))));
|
|
1026
|
+
const greetingElement = greeting ? /* @__PURE__ */ React72.createElement("p", { style: greetingStyle }, greeting) : null;
|
|
1027
|
+
if (layout === "vertical") {
|
|
1028
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wrapperStyle }, greetingElement, imageElement && /* @__PURE__ */ React72.createElement("div", { style: { marginBottom: 12 } }, imageElement), textContent);
|
|
1029
|
+
}
|
|
1030
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wrapperStyle }, greetingElement, /* @__PURE__ */ React72.createElement("table", { cellPadding: "0", cellSpacing: "0", border: 0, role: "presentation" }, /* @__PURE__ */ React72.createElement("tbody", null, /* @__PURE__ */ React72.createElement("tr", null, imageElement && /* @__PURE__ */ React72.createElement("td", { style: { verticalAlign: "middle", paddingRight: 16 } }, imageElement), /* @__PURE__ */ React72.createElement("td", { style: { verticalAlign: "middle" } }, textContent)))));
|
|
1031
|
+
}
|
|
1032
|
+
var signature_default = Signature;
|
|
857
1033
|
var SpacerPropsSchema = z.object({
|
|
858
1034
|
props: z.object({
|
|
859
1035
|
height: z.number().gte(0).optional().nullish()
|
|
@@ -868,13 +1044,13 @@ function Spacer({ props }) {
|
|
|
868
1044
|
const style = {
|
|
869
1045
|
height: (_a = props == null ? void 0 : props.height) != null ? _a : SpacerPropsDefaults.height
|
|
870
1046
|
};
|
|
871
|
-
return /* @__PURE__ */
|
|
1047
|
+
return /* @__PURE__ */ React72.createElement("div", { style });
|
|
872
1048
|
}
|
|
873
1049
|
var spacer_default = Spacer;
|
|
874
1050
|
function buildBlockComponent(blocks) {
|
|
875
1051
|
return function BlockComponent({ type, data }) {
|
|
876
1052
|
const Component = blocks[type].Component;
|
|
877
|
-
return /* @__PURE__ */
|
|
1053
|
+
return /* @__PURE__ */ React72.createElement(Component, __spreadValues({}, data));
|
|
878
1054
|
};
|
|
879
1055
|
}
|
|
880
1056
|
function buildBlockConfigurationSchema(blocks) {
|
|
@@ -911,9 +1087,9 @@ function ColumnsContainerReader({ style, props }) {
|
|
|
911
1087
|
const _a = props != null ? props : {}, { columns } = _a, restProps = __objRest(_a, ["columns"]);
|
|
912
1088
|
let cols = void 0;
|
|
913
1089
|
if (columns) {
|
|
914
|
-
cols = columns.map((col) => col.childrenIds.map((childId) => /* @__PURE__ */
|
|
1090
|
+
cols = columns.map((col) => col.childrenIds.map((childId) => /* @__PURE__ */ React72.createElement(ReaderBlock, { key: childId, id: childId })));
|
|
915
1091
|
}
|
|
916
|
-
return /* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ React72.createElement(columns_container_default, { props: restProps, columns: cols, style });
|
|
917
1093
|
}
|
|
918
1094
|
var ContainerPropsSchema2 = z.object({
|
|
919
1095
|
style: ContainerPropsSchema.shape.style,
|
|
@@ -924,10 +1100,10 @@ var ContainerPropsSchema2 = z.object({
|
|
|
924
1100
|
function ContainerReader({ style, props }) {
|
|
925
1101
|
var _a;
|
|
926
1102
|
const childrenIds = (_a = props == null ? void 0 : props.childrenIds) != null ? _a : [];
|
|
927
|
-
return /* @__PURE__ */
|
|
1103
|
+
return /* @__PURE__ */ React72.createElement(container_default, { style }, childrenIds.map((childId) => /* @__PURE__ */ React72.createElement(ReaderBlock, { key: childId, id: childId })));
|
|
928
1104
|
}
|
|
929
|
-
var
|
|
930
|
-
var
|
|
1105
|
+
var COLOR_SCHEMA9 = z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
1106
|
+
var FONT_FAMILY_SCHEMA6 = z.enum([
|
|
931
1107
|
"MODERN_SANS",
|
|
932
1108
|
"BOOK_SANS",
|
|
933
1109
|
"ORGANIC_SANS",
|
|
@@ -939,15 +1115,15 @@ var FONT_FAMILY_SCHEMA5 = z.enum([
|
|
|
939
1115
|
"MONOSPACE"
|
|
940
1116
|
]).nullable().optional();
|
|
941
1117
|
var EmailLayoutPropsSchema = z.object({
|
|
942
|
-
backdropColor:
|
|
943
|
-
borderColor:
|
|
1118
|
+
backdropColor: COLOR_SCHEMA9,
|
|
1119
|
+
borderColor: COLOR_SCHEMA9,
|
|
944
1120
|
borderRadius: z.number().optional().nullable(),
|
|
945
|
-
canvasColor:
|
|
946
|
-
textColor:
|
|
947
|
-
fontFamily:
|
|
1121
|
+
canvasColor: COLOR_SCHEMA9,
|
|
1122
|
+
textColor: COLOR_SCHEMA9,
|
|
1123
|
+
fontFamily: FONT_FAMILY_SCHEMA6,
|
|
948
1124
|
childrenIds: z.array(z.string()).optional().nullable()
|
|
949
1125
|
});
|
|
950
|
-
function
|
|
1126
|
+
function getFontFamily6(fontFamily) {
|
|
951
1127
|
const f = fontFamily != null ? fontFamily : "MODERN_SANS";
|
|
952
1128
|
switch (f) {
|
|
953
1129
|
case "MODERN_SANS":
|
|
@@ -979,13 +1155,13 @@ function getBorder2({ borderColor }) {
|
|
|
979
1155
|
function EmailLayoutReader(props) {
|
|
980
1156
|
var _a, _b, _c, _d, _e;
|
|
981
1157
|
const childrenIds = (_a = props.childrenIds) != null ? _a : [];
|
|
982
|
-
return /* @__PURE__ */
|
|
1158
|
+
return /* @__PURE__ */ React72.createElement(
|
|
983
1159
|
"div",
|
|
984
1160
|
{
|
|
985
1161
|
style: {
|
|
986
1162
|
backgroundColor: (_b = props.backdropColor) != null ? _b : "#F5F5F5",
|
|
987
1163
|
color: (_c = props.textColor) != null ? _c : "#262626",
|
|
988
|
-
fontFamily:
|
|
1164
|
+
fontFamily: getFontFamily6(props.fontFamily),
|
|
989
1165
|
fontSize: "16px",
|
|
990
1166
|
fontWeight: "400",
|
|
991
1167
|
letterSpacing: "0.15008px",
|
|
@@ -996,7 +1172,7 @@ function EmailLayoutReader(props) {
|
|
|
996
1172
|
width: "100%"
|
|
997
1173
|
}
|
|
998
1174
|
},
|
|
999
|
-
/* @__PURE__ */
|
|
1175
|
+
/* @__PURE__ */ React72.createElement(
|
|
1000
1176
|
"table",
|
|
1001
1177
|
{
|
|
1002
1178
|
align: "center",
|
|
@@ -1013,7 +1189,7 @@ function EmailLayoutReader(props) {
|
|
|
1013
1189
|
cellPadding: "0",
|
|
1014
1190
|
border: 0
|
|
1015
1191
|
},
|
|
1016
|
-
/* @__PURE__ */
|
|
1192
|
+
/* @__PURE__ */ React72.createElement("tbody", null, /* @__PURE__ */ React72.createElement("tr", { style: { width: "100%" } }, /* @__PURE__ */ React72.createElement("td", null, childrenIds.map((childId) => /* @__PURE__ */ React72.createElement(ReaderBlock, { key: childId, id: childId })))))
|
|
1017
1193
|
)
|
|
1018
1194
|
);
|
|
1019
1195
|
}
|
|
@@ -1025,7 +1201,7 @@ function useReaderDocument() {
|
|
|
1025
1201
|
}
|
|
1026
1202
|
function ReaderBlock({ id }) {
|
|
1027
1203
|
const document2 = useReaderDocument();
|
|
1028
|
-
return document2[id] ? /* @__PURE__ */
|
|
1204
|
+
return document2[id] ? /* @__PURE__ */ React72.createElement(BaseReaderBlock, __spreadValues({}, document2[id])) : null;
|
|
1029
1205
|
}
|
|
1030
1206
|
var READER_DICTIONARY = buildBlockConfigurationDictionary({
|
|
1031
1207
|
ColumnsContainer: {
|
|
@@ -1072,19 +1248,23 @@ var READER_DICTIONARY = buildBlockConfigurationDictionary({
|
|
|
1072
1248
|
Text: {
|
|
1073
1249
|
schema: TextPropsSchema,
|
|
1074
1250
|
Component: Text
|
|
1251
|
+
},
|
|
1252
|
+
Signature: {
|
|
1253
|
+
schema: SignaturePropsSchema,
|
|
1254
|
+
Component: signature_default
|
|
1075
1255
|
}
|
|
1076
1256
|
});
|
|
1077
1257
|
var ReaderBlockSchema = buildBlockConfigurationSchema(READER_DICTIONARY);
|
|
1078
1258
|
var ReaderDocumentSchema = z.record(z.string(), ReaderBlockSchema);
|
|
1079
1259
|
var BaseReaderBlock = buildBlockComponent(READER_DICTIONARY);
|
|
1080
1260
|
function Reader({ document: document2, rootBlockId }) {
|
|
1081
|
-
return /* @__PURE__ */
|
|
1261
|
+
return /* @__PURE__ */ React72.createElement(ReaderContext.Provider, { value: document2 }, /* @__PURE__ */ React72.createElement(ReaderBlock, { id: rootBlockId }));
|
|
1082
1262
|
}
|
|
1083
1263
|
|
|
1084
1264
|
// src/email-builder/renderers/render-to-static-markup.tsx
|
|
1085
1265
|
function renderToStaticMarkup(document2, { rootBlockId }) {
|
|
1086
1266
|
return "<!DOCTYPE html>" + renderToStaticMarkup$1(
|
|
1087
|
-
/* @__PURE__ */
|
|
1267
|
+
/* @__PURE__ */ React72.createElement("html", null, /* @__PURE__ */ React72.createElement("body", null, /* @__PURE__ */ React72.createElement(Reader, { document: document2, rootBlockId })))
|
|
1088
1268
|
);
|
|
1089
1269
|
}
|
|
1090
1270
|
|
|
@@ -1871,7 +2051,7 @@ var EmailEditorProvider = ({
|
|
|
1871
2051
|
registerSaveListener,
|
|
1872
2052
|
setCurrentTemplate
|
|
1873
2053
|
}), [currentTemplateId, currentTemplateName, saveTemplate, loadTemplate, registerSaveListener, setCurrentTemplate]);
|
|
1874
|
-
return /* @__PURE__ */
|
|
2054
|
+
return /* @__PURE__ */ React72.createElement(EmailEditorContext.Provider, { value }, children);
|
|
1875
2055
|
};
|
|
1876
2056
|
var useEmailEditor = () => {
|
|
1877
2057
|
const context = useContext(EmailEditorContext);
|
|
@@ -1881,14 +2061,14 @@ var useEmailEditor = () => {
|
|
|
1881
2061
|
return context;
|
|
1882
2062
|
};
|
|
1883
2063
|
function BaseSidebarPanel({ title, children }) {
|
|
1884
|
-
return /* @__PURE__ */
|
|
2064
|
+
return /* @__PURE__ */ React72.createElement(Box, { p: 2 }, /* @__PURE__ */ React72.createElement(Typography, { variant: "overline", color: "text.secondary", sx: { display: "block", mb: 2 } }, title), /* @__PURE__ */ React72.createElement(Stack, { spacing: 5, mb: 3 }, children));
|
|
1885
2065
|
}
|
|
1886
2066
|
function RadioGroupInput({ label, children, defaultValue, onChange }) {
|
|
1887
2067
|
const [value, setValue] = useState(defaultValue);
|
|
1888
2068
|
useEffect(() => {
|
|
1889
2069
|
setValue(defaultValue);
|
|
1890
2070
|
}, [defaultValue]);
|
|
1891
|
-
return /* @__PURE__ */
|
|
2071
|
+
return /* @__PURE__ */ React72.createElement(Stack, { alignItems: "flex-start" }, /* @__PURE__ */ React72.createElement(InputLabel, { shrink: true }, label), /* @__PURE__ */ React72.createElement(
|
|
1892
2072
|
ToggleButtonGroup,
|
|
1893
2073
|
{
|
|
1894
2074
|
exclusive: true,
|
|
@@ -1908,7 +2088,7 @@ function RadioGroupInput({ label, children, defaultValue, onChange }) {
|
|
|
1908
2088
|
}
|
|
1909
2089
|
function RawSliderInput(_a) {
|
|
1910
2090
|
var _b = _a, { iconLabel, value, setValue, units } = _b, props = __objRest(_b, ["iconLabel", "value", "setValue", "units"]);
|
|
1911
|
-
return /* @__PURE__ */
|
|
2091
|
+
return /* @__PURE__ */ React72.createElement(Stack, { direction: "row", alignItems: "center", spacing: 2, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React72.createElement(Box, { sx: { minWidth: 24, lineHeight: 1, flexShrink: 0 } }, iconLabel), /* @__PURE__ */ React72.createElement(
|
|
1912
2092
|
Slider,
|
|
1913
2093
|
__spreadProps(__spreadValues({}, props), {
|
|
1914
2094
|
value,
|
|
@@ -1919,14 +2099,14 @@ function RawSliderInput(_a) {
|
|
|
1919
2099
|
setValue(value2);
|
|
1920
2100
|
}
|
|
1921
2101
|
})
|
|
1922
|
-
), /* @__PURE__ */
|
|
2102
|
+
), /* @__PURE__ */ React72.createElement(Box, { sx: { minWidth: 32, textAlign: "right", flexShrink: 0 } }, /* @__PURE__ */ React72.createElement(Typography, { variant: "body2", color: "text.secondary", sx: { lineHeight: 1 } }, value, units)));
|
|
1923
2103
|
}
|
|
1924
2104
|
|
|
1925
2105
|
// src/app/inspector-drawer/configuration-panel/input-panels/helpers/inputs/slider-input.tsx
|
|
1926
2106
|
function SliderInput(_a) {
|
|
1927
2107
|
var _b = _a, { label, defaultValue, onChange } = _b, props = __objRest(_b, ["label", "defaultValue", "onChange"]);
|
|
1928
2108
|
const [value, setValue] = useState(defaultValue);
|
|
1929
|
-
return /* @__PURE__ */
|
|
2109
|
+
return /* @__PURE__ */ React72.createElement(Stack, { spacing: 1, alignItems: "flex-start" }, /* @__PURE__ */ React72.createElement(InputLabel, { shrink: true }, label), /* @__PURE__ */ React72.createElement(
|
|
1930
2110
|
RawSliderInput,
|
|
1931
2111
|
__spreadValues({
|
|
1932
2112
|
value,
|
|
@@ -1943,7 +2123,7 @@ function TextInput({ helperText, label, placeholder, rows, InputProps: InputProp
|
|
|
1943
2123
|
useEffect(() => {
|
|
1944
2124
|
setValue(defaultValue);
|
|
1945
2125
|
}, [defaultValue]);
|
|
1946
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ React72.createElement(
|
|
1947
2127
|
TextField,
|
|
1948
2128
|
{
|
|
1949
2129
|
fullWidth: true,
|
|
@@ -1969,7 +2149,7 @@ var TILE_BUTTON = {
|
|
|
1969
2149
|
};
|
|
1970
2150
|
function Swatch({ paletteColors, value, onChange }) {
|
|
1971
2151
|
const renderButton2 = (colorValue) => {
|
|
1972
|
-
return /* @__PURE__ */
|
|
2152
|
+
return /* @__PURE__ */ React72.createElement(
|
|
1973
2153
|
Button$1,
|
|
1974
2154
|
{
|
|
1975
2155
|
key: colorValue,
|
|
@@ -1988,7 +2168,7 @@ function Swatch({ paletteColors, value, onChange }) {
|
|
|
1988
2168
|
}
|
|
1989
2169
|
);
|
|
1990
2170
|
};
|
|
1991
|
-
return /* @__PURE__ */
|
|
2171
|
+
return /* @__PURE__ */ React72.createElement(Box, { width: "100%", sx: { display: "grid", gap: 1, gridTemplateColumns: "1fr 1fr 1fr 1fr 1fr 1fr" } }, paletteColors.map((c) => renderButton2(c)));
|
|
1992
2172
|
}
|
|
1993
2173
|
|
|
1994
2174
|
// src/app/inspector-drawer/configuration-panel/input-panels/helpers/inputs/color-input/picker.tsx
|
|
@@ -2055,7 +2235,7 @@ var SX = {
|
|
|
2055
2235
|
}
|
|
2056
2236
|
};
|
|
2057
2237
|
function Picker({ value, onChange }) {
|
|
2058
|
-
return /* @__PURE__ */
|
|
2238
|
+
return /* @__PURE__ */ React72.createElement(Stack, { spacing: 1, sx: SX }, /* @__PURE__ */ React72.createElement(HexColorPicker, { color: value, onChange }), /* @__PURE__ */ React72.createElement(Swatch, { paletteColors: DEFAULT_PRESET_COLORS, value, onChange }), /* @__PURE__ */ React72.createElement(Box, { pt: 1 }, /* @__PURE__ */ React72.createElement(HexColorInput, { prefixed: true, color: value, onChange })));
|
|
2059
2239
|
}
|
|
2060
2240
|
|
|
2061
2241
|
// src/app/inspector-drawer/configuration-panel/input-panels/helpers/inputs/color-input/base-color-input.tsx
|
|
@@ -2080,7 +2260,7 @@ function ColorInput({ label, defaultValue, onChange, nullable }) {
|
|
|
2080
2260
|
if (typeof value !== "string" || value.trim().length === 0) {
|
|
2081
2261
|
return null;
|
|
2082
2262
|
}
|
|
2083
|
-
return /* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ React72.createElement(
|
|
2084
2264
|
ButtonBase,
|
|
2085
2265
|
{
|
|
2086
2266
|
onClick: () => {
|
|
@@ -2088,16 +2268,16 @@ function ColorInput({ label, defaultValue, onChange, nullable }) {
|
|
|
2088
2268
|
onChange(null);
|
|
2089
2269
|
}
|
|
2090
2270
|
},
|
|
2091
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ React72.createElement(CloseOutlined, { fontSize: "small", sx: { color: "grey.600" } })
|
|
2092
2272
|
);
|
|
2093
2273
|
};
|
|
2094
2274
|
const renderOpenButton = () => {
|
|
2095
2275
|
if (value) {
|
|
2096
|
-
return /* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ React72.createElement(ButtonBase, { onClick: handleClickOpen, sx: __spreadProps(__spreadValues({}, BUTTON_SX), { bgcolor: value }) });
|
|
2097
2277
|
}
|
|
2098
|
-
return /* @__PURE__ */
|
|
2278
|
+
return /* @__PURE__ */ React72.createElement(ButtonBase, { onClick: handleClickOpen, sx: __spreadValues({}, BUTTON_SX) }, /* @__PURE__ */ React72.createElement(AddOutlined, { fontSize: "small" }));
|
|
2099
2279
|
};
|
|
2100
|
-
return /* @__PURE__ */
|
|
2280
|
+
return /* @__PURE__ */ React72.createElement(Stack, { alignItems: "flex-start" }, /* @__PURE__ */ React72.createElement(InputLabel, { sx: { mb: 0.5 } }, label), /* @__PURE__ */ React72.createElement(Stack, { direction: "row", spacing: 1 }, renderOpenButton(), renderResetButton()), /* @__PURE__ */ React72.createElement(
|
|
2101
2281
|
Menu,
|
|
2102
2282
|
{
|
|
2103
2283
|
anchorEl,
|
|
@@ -2107,7 +2287,7 @@ function ColorInput({ label, defaultValue, onChange, nullable }) {
|
|
|
2107
2287
|
sx: { height: "auto", padding: 0 }
|
|
2108
2288
|
}
|
|
2109
2289
|
},
|
|
2110
|
-
/* @__PURE__ */
|
|
2290
|
+
/* @__PURE__ */ React72.createElement(
|
|
2111
2291
|
Picker,
|
|
2112
2292
|
{
|
|
2113
2293
|
value: value || "",
|
|
@@ -2122,10 +2302,10 @@ function ColorInput({ label, defaultValue, onChange, nullable }) {
|
|
|
2122
2302
|
|
|
2123
2303
|
// src/app/inspector-drawer/configuration-panel/input-panels/helpers/inputs/color-input/index.tsx
|
|
2124
2304
|
function ColorInput2(props) {
|
|
2125
|
-
return /* @__PURE__ */
|
|
2305
|
+
return /* @__PURE__ */ React72.createElement(ColorInput, __spreadProps(__spreadValues({}, props), { nullable: false }));
|
|
2126
2306
|
}
|
|
2127
2307
|
function NullableColorInput(props) {
|
|
2128
|
-
return /* @__PURE__ */
|
|
2308
|
+
return /* @__PURE__ */ React72.createElement(ColorInput, __spreadProps(__spreadValues({}, props), { nullable: true }));
|
|
2129
2309
|
}
|
|
2130
2310
|
|
|
2131
2311
|
// src/editor/blocks/helpers/font-family.ts
|
|
@@ -2178,13 +2358,13 @@ var FONT_FAMILIES = [
|
|
|
2178
2358
|
];
|
|
2179
2359
|
|
|
2180
2360
|
// src/app/inspector-drawer/configuration-panel/input-panels/helpers/inputs/font-family.tsx
|
|
2181
|
-
var OPTIONS = FONT_FAMILIES.map((option) => /* @__PURE__ */
|
|
2361
|
+
var OPTIONS = FONT_FAMILIES.map((option) => /* @__PURE__ */ React72.createElement(MenuItem, { key: option.key, value: option.key, sx: { fontFamily: option.value } }, option.label));
|
|
2182
2362
|
function NullableFontFamily({ label, onChange, defaultValue }) {
|
|
2183
2363
|
const [value, setValue] = useState(defaultValue != null ? defaultValue : "inherit");
|
|
2184
2364
|
useEffect(() => {
|
|
2185
2365
|
setValue(defaultValue != null ? defaultValue : "inherit");
|
|
2186
2366
|
}, [defaultValue]);
|
|
2187
|
-
return /* @__PURE__ */
|
|
2367
|
+
return /* @__PURE__ */ React72.createElement(
|
|
2188
2368
|
TextField,
|
|
2189
2369
|
{
|
|
2190
2370
|
select: true,
|
|
@@ -2197,7 +2377,7 @@ function NullableFontFamily({ label, onChange, defaultValue }) {
|
|
|
2197
2377
|
onChange(v === null ? null : v);
|
|
2198
2378
|
}
|
|
2199
2379
|
},
|
|
2200
|
-
/* @__PURE__ */
|
|
2380
|
+
/* @__PURE__ */ React72.createElement(MenuItem, { value: "inherit" }, "Match email settings"),
|
|
2201
2381
|
OPTIONS
|
|
2202
2382
|
);
|
|
2203
2383
|
}
|
|
@@ -2210,10 +2390,10 @@ function FontSizeInput({ label, defaultValue, onChange }) {
|
|
|
2210
2390
|
setValue(value2);
|
|
2211
2391
|
onChange(value2);
|
|
2212
2392
|
};
|
|
2213
|
-
return /* @__PURE__ */
|
|
2393
|
+
return /* @__PURE__ */ React72.createElement(Stack, { spacing: 1, alignItems: "flex-start" }, /* @__PURE__ */ React72.createElement(InputLabel, { shrink: true }, label), /* @__PURE__ */ React72.createElement(
|
|
2214
2394
|
RawSliderInput,
|
|
2215
2395
|
{
|
|
2216
|
-
iconLabel: /* @__PURE__ */
|
|
2396
|
+
iconLabel: /* @__PURE__ */ React72.createElement(TextFieldsOutlined, { sx: { fontSize: 16 } }),
|
|
2217
2397
|
value,
|
|
2218
2398
|
setValue: handleChange,
|
|
2219
2399
|
units: "px",
|
|
@@ -2228,7 +2408,7 @@ function FontWeightInput({ label, defaultValue, onChange }) {
|
|
|
2228
2408
|
useEffect(() => {
|
|
2229
2409
|
setValue(defaultValue);
|
|
2230
2410
|
}, [defaultValue]);
|
|
2231
|
-
return /* @__PURE__ */
|
|
2411
|
+
return /* @__PURE__ */ React72.createElement(
|
|
2232
2412
|
RadioGroupInput,
|
|
2233
2413
|
{
|
|
2234
2414
|
label,
|
|
@@ -2238,8 +2418,8 @@ function FontWeightInput({ label, defaultValue, onChange }) {
|
|
|
2238
2418
|
onChange(fontWeight);
|
|
2239
2419
|
}
|
|
2240
2420
|
},
|
|
2241
|
-
/* @__PURE__ */
|
|
2242
|
-
/* @__PURE__ */
|
|
2421
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "normal" }, "Regular"),
|
|
2422
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "bold" }, "Bold")
|
|
2243
2423
|
);
|
|
2244
2424
|
}
|
|
2245
2425
|
function PaddingInput({ label, defaultValue, onChange }) {
|
|
@@ -2261,10 +2441,10 @@ function PaddingInput({ label, defaultValue, onChange }) {
|
|
|
2261
2441
|
setValue(v);
|
|
2262
2442
|
onChange(v);
|
|
2263
2443
|
}
|
|
2264
|
-
return /* @__PURE__ */
|
|
2444
|
+
return /* @__PURE__ */ React72.createElement(Stack, { spacing: 2, alignItems: "flex-start", pb: 1 }, /* @__PURE__ */ React72.createElement(InputLabel, { shrink: true }, label), /* @__PURE__ */ React72.createElement(
|
|
2265
2445
|
RawSliderInput,
|
|
2266
2446
|
{
|
|
2267
|
-
iconLabel: /* @__PURE__ */
|
|
2447
|
+
iconLabel: /* @__PURE__ */ React72.createElement(AlignVerticalTopOutlined, { sx: { fontSize: 16 } }),
|
|
2268
2448
|
value: value.top,
|
|
2269
2449
|
setValue: (num) => handleChange("top", num),
|
|
2270
2450
|
units: "px",
|
|
@@ -2273,10 +2453,10 @@ function PaddingInput({ label, defaultValue, onChange }) {
|
|
|
2273
2453
|
max: 80,
|
|
2274
2454
|
marks: true
|
|
2275
2455
|
}
|
|
2276
|
-
), /* @__PURE__ */
|
|
2456
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2277
2457
|
RawSliderInput,
|
|
2278
2458
|
{
|
|
2279
|
-
iconLabel: /* @__PURE__ */
|
|
2459
|
+
iconLabel: /* @__PURE__ */ React72.createElement(AlignVerticalBottomOutlined, { sx: { fontSize: 16 } }),
|
|
2280
2460
|
value: value.bottom,
|
|
2281
2461
|
setValue: (num) => handleChange("bottom", num),
|
|
2282
2462
|
units: "px",
|
|
@@ -2285,10 +2465,10 @@ function PaddingInput({ label, defaultValue, onChange }) {
|
|
|
2285
2465
|
max: 80,
|
|
2286
2466
|
marks: true
|
|
2287
2467
|
}
|
|
2288
|
-
), /* @__PURE__ */
|
|
2468
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2289
2469
|
RawSliderInput,
|
|
2290
2470
|
{
|
|
2291
|
-
iconLabel: /* @__PURE__ */
|
|
2471
|
+
iconLabel: /* @__PURE__ */ React72.createElement(AlignHorizontalLeftOutlined, { sx: { fontSize: 16 } }),
|
|
2292
2472
|
value: value.left,
|
|
2293
2473
|
setValue: (num) => handleChange("left", num),
|
|
2294
2474
|
units: "px",
|
|
@@ -2297,10 +2477,10 @@ function PaddingInput({ label, defaultValue, onChange }) {
|
|
|
2297
2477
|
max: 80,
|
|
2298
2478
|
marks: true
|
|
2299
2479
|
}
|
|
2300
|
-
), /* @__PURE__ */
|
|
2480
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2301
2481
|
RawSliderInput,
|
|
2302
2482
|
{
|
|
2303
|
-
iconLabel: /* @__PURE__ */
|
|
2483
|
+
iconLabel: /* @__PURE__ */ React72.createElement(AlignHorizontalRightOutlined, { sx: { fontSize: 16 } }),
|
|
2304
2484
|
value: value.right,
|
|
2305
2485
|
setValue: (num) => handleChange("right", num),
|
|
2306
2486
|
units: "px",
|
|
@@ -2316,7 +2496,7 @@ function TextAlignInput({ label, defaultValue, onChange }) {
|
|
|
2316
2496
|
useEffect(() => {
|
|
2317
2497
|
setValue(defaultValue != null ? defaultValue : "left");
|
|
2318
2498
|
}, [defaultValue]);
|
|
2319
|
-
return /* @__PURE__ */
|
|
2499
|
+
return /* @__PURE__ */ React72.createElement(
|
|
2320
2500
|
RadioGroupInput,
|
|
2321
2501
|
{
|
|
2322
2502
|
label,
|
|
@@ -2326,9 +2506,9 @@ function TextAlignInput({ label, defaultValue, onChange }) {
|
|
|
2326
2506
|
onChange(value2);
|
|
2327
2507
|
}
|
|
2328
2508
|
},
|
|
2329
|
-
/* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2331
|
-
/* @__PURE__ */
|
|
2509
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "left" }, /* @__PURE__ */ React72.createElement(FormatAlignLeftOutlined, { fontSize: "small" })),
|
|
2510
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "center" }, /* @__PURE__ */ React72.createElement(FormatAlignCenterOutlined, { fontSize: "small" })),
|
|
2511
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "right" }, /* @__PURE__ */ React72.createElement(FormatAlignRightOutlined, { fontSize: "small" }))
|
|
2332
2512
|
);
|
|
2333
2513
|
}
|
|
2334
2514
|
|
|
@@ -2341,14 +2521,14 @@ function SingleStylePropertyPanel({ name, value, onChange }) {
|
|
|
2341
2521
|
};
|
|
2342
2522
|
switch (name) {
|
|
2343
2523
|
case "backgroundColor":
|
|
2344
|
-
return /* @__PURE__ */
|
|
2524
|
+
return /* @__PURE__ */ React72.createElement(NullableColorInput, { label: "Background color", defaultValue, onChange: handleChange });
|
|
2345
2525
|
case "borderColor":
|
|
2346
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ React72.createElement(NullableColorInput, { label: "Border color", defaultValue, onChange: handleChange });
|
|
2347
2527
|
case "borderRadius":
|
|
2348
|
-
return /* @__PURE__ */
|
|
2528
|
+
return /* @__PURE__ */ React72.createElement(
|
|
2349
2529
|
SliderInput,
|
|
2350
2530
|
{
|
|
2351
|
-
iconLabel: /* @__PURE__ */
|
|
2531
|
+
iconLabel: /* @__PURE__ */ React72.createElement(RoundedCornerOutlined, null),
|
|
2352
2532
|
units: "px",
|
|
2353
2533
|
step: 4,
|
|
2354
2534
|
marks: true,
|
|
@@ -2360,23 +2540,23 @@ function SingleStylePropertyPanel({ name, value, onChange }) {
|
|
|
2360
2540
|
}
|
|
2361
2541
|
);
|
|
2362
2542
|
case "color":
|
|
2363
|
-
return /* @__PURE__ */
|
|
2543
|
+
return /* @__PURE__ */ React72.createElement(NullableColorInput, { label: "Text color", defaultValue, onChange: handleChange });
|
|
2364
2544
|
case "fontFamily":
|
|
2365
|
-
return /* @__PURE__ */
|
|
2545
|
+
return /* @__PURE__ */ React72.createElement(NullableFontFamily, { label: "Font family", defaultValue, onChange: handleChange });
|
|
2366
2546
|
case "fontSize":
|
|
2367
|
-
return /* @__PURE__ */
|
|
2547
|
+
return /* @__PURE__ */ React72.createElement(FontSizeInput, { label: "Font size", defaultValue, onChange: handleChange });
|
|
2368
2548
|
case "fontWeight":
|
|
2369
|
-
return /* @__PURE__ */
|
|
2549
|
+
return /* @__PURE__ */ React72.createElement(FontWeightInput, { label: "Font weight", defaultValue, onChange: handleChange });
|
|
2370
2550
|
case "textAlign":
|
|
2371
|
-
return /* @__PURE__ */
|
|
2551
|
+
return /* @__PURE__ */ React72.createElement(TextAlignInput, { label: "Alignment", defaultValue, onChange: handleChange });
|
|
2372
2552
|
case "padding":
|
|
2373
|
-
return /* @__PURE__ */
|
|
2553
|
+
return /* @__PURE__ */ React72.createElement(PaddingInput, { label: "Padding", defaultValue, onChange: handleChange });
|
|
2374
2554
|
}
|
|
2375
2555
|
}
|
|
2376
2556
|
|
|
2377
2557
|
// src/app/inspector-drawer/configuration-panel/input-panels/helpers/style-inputs/multi-style-property-panel.tsx
|
|
2378
2558
|
function MultiStylePropertyPanel({ names, value, onChange }) {
|
|
2379
|
-
return /* @__PURE__ */
|
|
2559
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, names.map((name) => /* @__PURE__ */ React72.createElement(SingleStylePropertyPanel, { key: name, name, value: value || {}, onChange })));
|
|
2380
2560
|
}
|
|
2381
2561
|
|
|
2382
2562
|
// src/app/inspector-drawer/configuration-panel/input-panels/avatar-sidebar-panel.tsx
|
|
@@ -2396,11 +2576,11 @@ function AvatarSidebarPanel({ data, setData }) {
|
|
|
2396
2576
|
const imageUrl = (_d = (_c = data.props) == null ? void 0 : _c.imageUrl) != null ? _d : AvatarPropsDefaults.imageUrl;
|
|
2397
2577
|
const alt = (_f = (_e = data.props) == null ? void 0 : _e.alt) != null ? _f : AvatarPropsDefaults.alt;
|
|
2398
2578
|
const shape = (_h = (_g = data.props) == null ? void 0 : _g.shape) != null ? _h : AvatarPropsDefaults.shape;
|
|
2399
|
-
return /* @__PURE__ */
|
|
2579
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Avatar block" }, /* @__PURE__ */ React72.createElement(
|
|
2400
2580
|
SliderInput,
|
|
2401
2581
|
{
|
|
2402
2582
|
label: "Size",
|
|
2403
|
-
iconLabel: /* @__PURE__ */
|
|
2583
|
+
iconLabel: /* @__PURE__ */ React72.createElement(AspectRatioOutlined, { sx: { color: "text.secondary" } }),
|
|
2404
2584
|
units: "px",
|
|
2405
2585
|
step: 3,
|
|
2406
2586
|
min: 32,
|
|
@@ -2410,7 +2590,7 @@ function AvatarSidebarPanel({ data, setData }) {
|
|
|
2410
2590
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { size: size2 }) }));
|
|
2411
2591
|
}
|
|
2412
2592
|
}
|
|
2413
|
-
), /* @__PURE__ */
|
|
2593
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2414
2594
|
RadioGroupInput,
|
|
2415
2595
|
{
|
|
2416
2596
|
label: "Shape",
|
|
@@ -2419,10 +2599,10 @@ function AvatarSidebarPanel({ data, setData }) {
|
|
|
2419
2599
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { shape: shape2 }) }));
|
|
2420
2600
|
}
|
|
2421
2601
|
},
|
|
2422
|
-
/* @__PURE__ */
|
|
2423
|
-
/* @__PURE__ */
|
|
2424
|
-
/* @__PURE__ */
|
|
2425
|
-
), /* @__PURE__ */
|
|
2602
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "circle" }, "Circle"),
|
|
2603
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "square" }, "Square"),
|
|
2604
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "rounded" }, "Rounded")
|
|
2605
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2426
2606
|
TextInput,
|
|
2427
2607
|
{
|
|
2428
2608
|
label: "Image URL",
|
|
@@ -2431,7 +2611,7 @@ function AvatarSidebarPanel({ data, setData }) {
|
|
|
2431
2611
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { imageUrl: imageUrl2 }) }));
|
|
2432
2612
|
}
|
|
2433
2613
|
}
|
|
2434
|
-
), /* @__PURE__ */
|
|
2614
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2435
2615
|
TextInput,
|
|
2436
2616
|
{
|
|
2437
2617
|
label: "Alt text",
|
|
@@ -2440,7 +2620,7 @@ function AvatarSidebarPanel({ data, setData }) {
|
|
|
2440
2620
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { alt: alt2 }) }));
|
|
2441
2621
|
}
|
|
2442
2622
|
}
|
|
2443
|
-
), /* @__PURE__ */
|
|
2623
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2444
2624
|
MultiStylePropertyPanel,
|
|
2445
2625
|
{
|
|
2446
2626
|
names: ["textAlign", "padding"],
|
|
@@ -2468,65 +2648,65 @@ function ButtonSidebarPanel({ data, setData }) {
|
|
|
2468
2648
|
const buttonStyle = (_j = (_i = data.props) == null ? void 0 : _i.buttonStyle) != null ? _j : ButtonPropsDefaults.buttonStyle;
|
|
2469
2649
|
const buttonTextColor = (_l = (_k = data.props) == null ? void 0 : _k.buttonTextColor) != null ? _l : ButtonPropsDefaults.buttonTextColor;
|
|
2470
2650
|
const buttonBackgroundColor = (_n = (_m = data.props) == null ? void 0 : _m.buttonBackgroundColor) != null ? _n : ButtonPropsDefaults.buttonBackgroundColor;
|
|
2471
|
-
return /* @__PURE__ */
|
|
2651
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Button block" }, /* @__PURE__ */ React72.createElement(
|
|
2472
2652
|
TextInput,
|
|
2473
2653
|
{
|
|
2474
2654
|
label: "Text",
|
|
2475
2655
|
defaultValue: text,
|
|
2476
2656
|
onChange: (text2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { text: text2 }) }))
|
|
2477
2657
|
}
|
|
2478
|
-
), /* @__PURE__ */
|
|
2658
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2479
2659
|
TextInput,
|
|
2480
2660
|
{
|
|
2481
2661
|
label: "Url",
|
|
2482
2662
|
defaultValue: url,
|
|
2483
2663
|
onChange: (url2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { url: url2 }) }))
|
|
2484
2664
|
}
|
|
2485
|
-
), /* @__PURE__ */
|
|
2665
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2486
2666
|
RadioGroupInput,
|
|
2487
2667
|
{
|
|
2488
2668
|
label: "Width",
|
|
2489
2669
|
defaultValue: fullWidth ? "FULL_WIDTH" : "AUTO",
|
|
2490
2670
|
onChange: (v) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { fullWidth: v === "FULL_WIDTH" }) }))
|
|
2491
2671
|
},
|
|
2492
|
-
/* @__PURE__ */
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
), /* @__PURE__ */
|
|
2672
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "FULL_WIDTH" }, "Full"),
|
|
2673
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "AUTO" }, "Auto")
|
|
2674
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2495
2675
|
RadioGroupInput,
|
|
2496
2676
|
{
|
|
2497
2677
|
label: "Size",
|
|
2498
2678
|
defaultValue: size,
|
|
2499
2679
|
onChange: (size2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { size: size2 }) }))
|
|
2500
2680
|
},
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */
|
|
2503
|
-
/* @__PURE__ */
|
|
2504
|
-
/* @__PURE__ */
|
|
2505
|
-
), /* @__PURE__ */
|
|
2681
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "x-small" }, "Xs"),
|
|
2682
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "small" }, "Sm"),
|
|
2683
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "medium" }, "Md"),
|
|
2684
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "large" }, "Lg")
|
|
2685
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2506
2686
|
RadioGroupInput,
|
|
2507
2687
|
{
|
|
2508
2688
|
label: "Style",
|
|
2509
2689
|
defaultValue: buttonStyle,
|
|
2510
2690
|
onChange: (buttonStyle2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { buttonStyle: buttonStyle2 }) }))
|
|
2511
2691
|
},
|
|
2512
|
-
/* @__PURE__ */
|
|
2513
|
-
/* @__PURE__ */
|
|
2514
|
-
/* @__PURE__ */
|
|
2515
|
-
), /* @__PURE__ */
|
|
2692
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "rectangle" }, "Rectangle"),
|
|
2693
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "rounded" }, "Rounded"),
|
|
2694
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "pill" }, "Pill")
|
|
2695
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2516
2696
|
ColorInput2,
|
|
2517
2697
|
{
|
|
2518
2698
|
label: "Text color",
|
|
2519
2699
|
defaultValue: buttonTextColor,
|
|
2520
2700
|
onChange: (buttonTextColor2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { buttonTextColor: buttonTextColor2 }) }))
|
|
2521
2701
|
}
|
|
2522
|
-
), /* @__PURE__ */
|
|
2702
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2523
2703
|
ColorInput2,
|
|
2524
2704
|
{
|
|
2525
2705
|
label: "Button color",
|
|
2526
2706
|
defaultValue: buttonBackgroundColor,
|
|
2527
2707
|
onChange: (buttonBackgroundColor2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { buttonBackgroundColor: buttonBackgroundColor2 }) }))
|
|
2528
2708
|
}
|
|
2529
|
-
), /* @__PURE__ */
|
|
2709
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2530
2710
|
MultiStylePropertyPanel,
|
|
2531
2711
|
{
|
|
2532
2712
|
names: ["backgroundColor", "fontFamily", "fontSize", "fontWeight", "textAlign", "padding"],
|
|
@@ -2552,7 +2732,7 @@ function TextDimensionInput({ label, defaultValue, onChange }) {
|
|
|
2552
2732
|
const value = parseInt(ev.target.value);
|
|
2553
2733
|
onChange(isNaN(value) ? null : value);
|
|
2554
2734
|
};
|
|
2555
|
-
return /* @__PURE__ */
|
|
2735
|
+
return /* @__PURE__ */ React72.createElement(
|
|
2556
2736
|
TextField,
|
|
2557
2737
|
{
|
|
2558
2738
|
fullWidth: true,
|
|
@@ -2563,7 +2743,7 @@ function TextDimensionInput({ label, defaultValue, onChange }) {
|
|
|
2563
2743
|
placeholder: "auto",
|
|
2564
2744
|
size: "small",
|
|
2565
2745
|
InputProps: {
|
|
2566
|
-
endAdornment: /* @__PURE__ */
|
|
2746
|
+
endAdornment: /* @__PURE__ */ React72.createElement(Typography, { variant: "body2", color: "text.secondary" }, "px")
|
|
2567
2747
|
}
|
|
2568
2748
|
}
|
|
2569
2749
|
);
|
|
@@ -2585,7 +2765,7 @@ function ColumnWidthsInput({ defaultValue, onChange }) {
|
|
|
2585
2765
|
};
|
|
2586
2766
|
let column3 = null;
|
|
2587
2767
|
{
|
|
2588
|
-
column3 = /* @__PURE__ */
|
|
2768
|
+
column3 = /* @__PURE__ */ React72.createElement(
|
|
2589
2769
|
TextDimensionInput,
|
|
2590
2770
|
{
|
|
2591
2771
|
label: "Column 3",
|
|
@@ -2596,7 +2776,7 @@ function ColumnWidthsInput({ defaultValue, onChange }) {
|
|
|
2596
2776
|
}
|
|
2597
2777
|
);
|
|
2598
2778
|
}
|
|
2599
|
-
return /* @__PURE__ */
|
|
2779
|
+
return /* @__PURE__ */ React72.createElement(Stack, { direction: "row", spacing: 1 }, /* @__PURE__ */ React72.createElement(
|
|
2600
2780
|
TextDimensionInput,
|
|
2601
2781
|
{
|
|
2602
2782
|
label: "Column 1",
|
|
@@ -2605,7 +2785,7 @@ function ColumnWidthsInput({ defaultValue, onChange }) {
|
|
|
2605
2785
|
setIndexValue(0, v);
|
|
2606
2786
|
}
|
|
2607
2787
|
}
|
|
2608
|
-
), /* @__PURE__ */
|
|
2788
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2609
2789
|
TextDimensionInput,
|
|
2610
2790
|
{
|
|
2611
2791
|
label: "Column 2",
|
|
@@ -2630,7 +2810,7 @@ function ColumnsContainerPanel({ data, setData }) {
|
|
|
2630
2810
|
setErrors(res.error);
|
|
2631
2811
|
}
|
|
2632
2812
|
};
|
|
2633
|
-
return /* @__PURE__ */
|
|
2813
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Columns block" }, /* @__PURE__ */ React72.createElement(
|
|
2634
2814
|
RadioGroupInput,
|
|
2635
2815
|
{
|
|
2636
2816
|
label: "Number of columns",
|
|
@@ -2639,9 +2819,9 @@ function ColumnsContainerPanel({ data, setData }) {
|
|
|
2639
2819
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { columnsCount: v === "2" ? 2 : 3 }) }));
|
|
2640
2820
|
}
|
|
2641
2821
|
},
|
|
2642
|
-
/* @__PURE__ */
|
|
2643
|
-
/* @__PURE__ */
|
|
2644
|
-
), /* @__PURE__ */
|
|
2822
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "2" }, "2"),
|
|
2823
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "3" }, "3")
|
|
2824
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2645
2825
|
ColumnWidthsInput,
|
|
2646
2826
|
{
|
|
2647
2827
|
defaultValue: (_b = data.props) == null ? void 0 : _b.fixedWidths,
|
|
@@ -2649,11 +2829,11 @@ function ColumnsContainerPanel({ data, setData }) {
|
|
|
2649
2829
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { fixedWidths }) }));
|
|
2650
2830
|
}
|
|
2651
2831
|
}
|
|
2652
|
-
), /* @__PURE__ */
|
|
2832
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2653
2833
|
SliderInput,
|
|
2654
2834
|
{
|
|
2655
2835
|
label: "Columns gap",
|
|
2656
|
-
iconLabel: /* @__PURE__ */
|
|
2836
|
+
iconLabel: /* @__PURE__ */ React72.createElement(SpaceBarOutlined, { sx: { color: "text.secondary" } }),
|
|
2657
2837
|
units: "px",
|
|
2658
2838
|
step: 4,
|
|
2659
2839
|
marks: true,
|
|
@@ -2662,7 +2842,7 @@ function ColumnsContainerPanel({ data, setData }) {
|
|
|
2662
2842
|
defaultValue: (_d = (_c = data.props) == null ? void 0 : _c.columnsGap) != null ? _d : 0,
|
|
2663
2843
|
onChange: (columnsGap) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { columnsGap }) }))
|
|
2664
2844
|
}
|
|
2665
|
-
), /* @__PURE__ */
|
|
2845
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2666
2846
|
RadioGroupInput,
|
|
2667
2847
|
{
|
|
2668
2848
|
label: "Alignment",
|
|
@@ -2671,10 +2851,10 @@ function ColumnsContainerPanel({ data, setData }) {
|
|
|
2671
2851
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { contentAlignment }) }));
|
|
2672
2852
|
}
|
|
2673
2853
|
},
|
|
2674
|
-
/* @__PURE__ */
|
|
2675
|
-
/* @__PURE__ */
|
|
2676
|
-
/* @__PURE__ */
|
|
2677
|
-
), /* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "top" }, /* @__PURE__ */ React72.createElement(VerticalAlignTopOutlined, { fontSize: "small" })),
|
|
2855
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "middle" }, /* @__PURE__ */ React72.createElement(VerticalAlignCenterOutlined, { fontSize: "small" })),
|
|
2856
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "bottom" }, /* @__PURE__ */ React72.createElement(VerticalAlignBottomOutlined, { fontSize: "small" }))
|
|
2857
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2678
2858
|
MultiStylePropertyPanel,
|
|
2679
2859
|
{
|
|
2680
2860
|
names: ["backgroundColor", "padding"],
|
|
@@ -2703,7 +2883,7 @@ function ContainerSidebarPanel({ data, setData }) {
|
|
|
2703
2883
|
setErrors(res.error);
|
|
2704
2884
|
}
|
|
2705
2885
|
};
|
|
2706
|
-
return /* @__PURE__ */
|
|
2886
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Container block" }, /* @__PURE__ */ React72.createElement(
|
|
2707
2887
|
MultiStylePropertyPanel,
|
|
2708
2888
|
{
|
|
2709
2889
|
names: ["backgroundColor", "borderColor", "borderRadius", "padding"],
|
|
@@ -2726,18 +2906,18 @@ function DividerSidebarPanel({ data, setData }) {
|
|
|
2726
2906
|
};
|
|
2727
2907
|
const lineColor = (_b = (_a = data.props) == null ? void 0 : _a.lineColor) != null ? _b : DividerPropsDefaults.lineColor;
|
|
2728
2908
|
const lineHeight = (_d = (_c = data.props) == null ? void 0 : _c.lineHeight) != null ? _d : DividerPropsDefaults.lineHeight;
|
|
2729
|
-
return /* @__PURE__ */
|
|
2909
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Divider block" }, /* @__PURE__ */ React72.createElement(
|
|
2730
2910
|
ColorInput2,
|
|
2731
2911
|
{
|
|
2732
2912
|
label: "Color",
|
|
2733
2913
|
defaultValue: lineColor,
|
|
2734
2914
|
onChange: (lineColor2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { lineColor: lineColor2 }) }))
|
|
2735
2915
|
}
|
|
2736
|
-
), /* @__PURE__ */
|
|
2916
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2737
2917
|
SliderInput,
|
|
2738
2918
|
{
|
|
2739
2919
|
label: "Height",
|
|
2740
|
-
iconLabel: /* @__PURE__ */
|
|
2920
|
+
iconLabel: /* @__PURE__ */ React72.createElement(HeightOutlined, { sx: { color: "text.secondary" } }),
|
|
2741
2921
|
units: "px",
|
|
2742
2922
|
step: 1,
|
|
2743
2923
|
min: 1,
|
|
@@ -2745,7 +2925,7 @@ function DividerSidebarPanel({ data, setData }) {
|
|
|
2745
2925
|
defaultValue: lineHeight,
|
|
2746
2926
|
onChange: (lineHeight2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { lineHeight: lineHeight2 }) }))
|
|
2747
2927
|
}
|
|
2748
|
-
), /* @__PURE__ */
|
|
2928
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2749
2929
|
MultiStylePropertyPanel,
|
|
2750
2930
|
{
|
|
2751
2931
|
names: ["backgroundColor", "padding"],
|
|
@@ -2754,8 +2934,8 @@ function DividerSidebarPanel({ data, setData }) {
|
|
|
2754
2934
|
}
|
|
2755
2935
|
));
|
|
2756
2936
|
}
|
|
2757
|
-
var
|
|
2758
|
-
var
|
|
2937
|
+
var COLOR_SCHEMA10 = z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
|
|
2938
|
+
var FONT_FAMILY_SCHEMA7 = z.enum([
|
|
2759
2939
|
"MODERN_SANS",
|
|
2760
2940
|
"BOOK_SANS",
|
|
2761
2941
|
"ORGANIC_SANS",
|
|
@@ -2767,12 +2947,12 @@ var FONT_FAMILY_SCHEMA6 = z.enum([
|
|
|
2767
2947
|
"MONOSPACE"
|
|
2768
2948
|
]).nullable().optional();
|
|
2769
2949
|
var EmailLayoutPropsSchema2 = z.object({
|
|
2770
|
-
backdropColor:
|
|
2771
|
-
borderColor:
|
|
2950
|
+
backdropColor: COLOR_SCHEMA10,
|
|
2951
|
+
borderColor: COLOR_SCHEMA10,
|
|
2772
2952
|
borderRadius: z.number().optional().nullable(),
|
|
2773
|
-
canvasColor:
|
|
2774
|
-
textColor:
|
|
2775
|
-
fontFamily:
|
|
2953
|
+
canvasColor: COLOR_SCHEMA10,
|
|
2954
|
+
textColor: COLOR_SCHEMA10,
|
|
2955
|
+
fontFamily: FONT_FAMILY_SCHEMA7,
|
|
2776
2956
|
childrenIds: z.array(z.string()).optional().nullable()
|
|
2777
2957
|
});
|
|
2778
2958
|
var email_layout_props_schema_default = EmailLayoutPropsSchema2;
|
|
@@ -2790,31 +2970,31 @@ function EmailLayoutSidebarFields({ data, setData }) {
|
|
|
2790
2970
|
setErrors(res.error);
|
|
2791
2971
|
}
|
|
2792
2972
|
};
|
|
2793
|
-
return /* @__PURE__ */
|
|
2973
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Global" }, /* @__PURE__ */ React72.createElement(
|
|
2794
2974
|
ColorInput2,
|
|
2795
2975
|
{
|
|
2796
2976
|
label: "Backdrop color",
|
|
2797
2977
|
defaultValue: (_a = data.backdropColor) != null ? _a : "#F5F5F5",
|
|
2798
2978
|
onChange: (backdropColor) => updateData(__spreadProps(__spreadValues({}, data), { backdropColor }))
|
|
2799
2979
|
}
|
|
2800
|
-
), /* @__PURE__ */
|
|
2980
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2801
2981
|
ColorInput2,
|
|
2802
2982
|
{
|
|
2803
2983
|
label: "Canvas color",
|
|
2804
2984
|
defaultValue: (_b = data.canvasColor) != null ? _b : "#FFFFFF",
|
|
2805
2985
|
onChange: (canvasColor) => updateData(__spreadProps(__spreadValues({}, data), { canvasColor }))
|
|
2806
2986
|
}
|
|
2807
|
-
), /* @__PURE__ */
|
|
2987
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2808
2988
|
NullableColorInput,
|
|
2809
2989
|
{
|
|
2810
2990
|
label: "Canvas border color",
|
|
2811
2991
|
defaultValue: (_c = data.borderColor) != null ? _c : null,
|
|
2812
2992
|
onChange: (borderColor) => updateData(__spreadProps(__spreadValues({}, data), { borderColor }))
|
|
2813
2993
|
}
|
|
2814
|
-
), /* @__PURE__ */
|
|
2994
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2815
2995
|
SliderInput,
|
|
2816
2996
|
{
|
|
2817
|
-
iconLabel: /* @__PURE__ */
|
|
2997
|
+
iconLabel: /* @__PURE__ */ React72.createElement(RoundedCornerOutlined, null),
|
|
2818
2998
|
units: "px",
|
|
2819
2999
|
step: 4,
|
|
2820
3000
|
marks: true,
|
|
@@ -2824,14 +3004,14 @@ function EmailLayoutSidebarFields({ data, setData }) {
|
|
|
2824
3004
|
defaultValue: (_d = data.borderRadius) != null ? _d : 0,
|
|
2825
3005
|
onChange: (borderRadius) => updateData(__spreadProps(__spreadValues({}, data), { borderRadius }))
|
|
2826
3006
|
}
|
|
2827
|
-
), /* @__PURE__ */
|
|
3007
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2828
3008
|
NullableFontFamily,
|
|
2829
3009
|
{
|
|
2830
3010
|
label: "Font family",
|
|
2831
3011
|
defaultValue: "MODERN_SANS",
|
|
2832
3012
|
onChange: (fontFamily) => updateData(__spreadProps(__spreadValues({}, data), { fontFamily }))
|
|
2833
3013
|
}
|
|
2834
|
-
), /* @__PURE__ */
|
|
3014
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2835
3015
|
ColorInput2,
|
|
2836
3016
|
{
|
|
2837
3017
|
label: "Text color",
|
|
@@ -2852,7 +3032,7 @@ function HeadingSidebarPanel({ data, setData }) {
|
|
|
2852
3032
|
setErrors(res.error);
|
|
2853
3033
|
}
|
|
2854
3034
|
};
|
|
2855
|
-
return /* @__PURE__ */
|
|
3035
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Heading block" }, /* @__PURE__ */ React72.createElement(
|
|
2856
3036
|
TextInput,
|
|
2857
3037
|
{
|
|
2858
3038
|
label: "Content",
|
|
@@ -2862,7 +3042,7 @@ function HeadingSidebarPanel({ data, setData }) {
|
|
|
2862
3042
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { text }) }));
|
|
2863
3043
|
}
|
|
2864
3044
|
}
|
|
2865
|
-
), /* @__PURE__ */
|
|
3045
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2866
3046
|
RadioGroupInput,
|
|
2867
3047
|
{
|
|
2868
3048
|
label: "Level",
|
|
@@ -2871,10 +3051,10 @@ function HeadingSidebarPanel({ data, setData }) {
|
|
|
2871
3051
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { level }) }));
|
|
2872
3052
|
}
|
|
2873
3053
|
},
|
|
2874
|
-
/* @__PURE__ */
|
|
2875
|
-
/* @__PURE__ */
|
|
2876
|
-
/* @__PURE__ */
|
|
2877
|
-
), /* @__PURE__ */
|
|
3054
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "h1" }, "H1"),
|
|
3055
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "h2" }, "H2"),
|
|
3056
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "h3" }, "H3")
|
|
3057
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2878
3058
|
MultiStylePropertyPanel,
|
|
2879
3059
|
{
|
|
2880
3060
|
names: ["color", "backgroundColor", "fontFamily", "fontWeight", "textAlign", "padding"],
|
|
@@ -2895,7 +3075,7 @@ function HtmlSidebarPanel({ data, setData }) {
|
|
|
2895
3075
|
setErrors(res.error);
|
|
2896
3076
|
}
|
|
2897
3077
|
};
|
|
2898
|
-
return /* @__PURE__ */
|
|
3078
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Html block" }, /* @__PURE__ */ React72.createElement(
|
|
2899
3079
|
TextInput,
|
|
2900
3080
|
{
|
|
2901
3081
|
label: "Content",
|
|
@@ -2903,7 +3083,7 @@ function HtmlSidebarPanel({ data, setData }) {
|
|
|
2903
3083
|
defaultValue: (_b = (_a = data.props) == null ? void 0 : _a.contents) != null ? _b : "",
|
|
2904
3084
|
onChange: (contents) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { contents }) }))
|
|
2905
3085
|
}
|
|
2906
|
-
), /* @__PURE__ */
|
|
3086
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2907
3087
|
MultiStylePropertyPanel,
|
|
2908
3088
|
{
|
|
2909
3089
|
names: ["color", "backgroundColor", "fontFamily", "fontSize", "textAlign", "padding"],
|
|
@@ -2924,7 +3104,7 @@ function ImageSidebarPanel({ data, setData }) {
|
|
|
2924
3104
|
setErrors(res.error);
|
|
2925
3105
|
}
|
|
2926
3106
|
};
|
|
2927
|
-
return /* @__PURE__ */
|
|
3107
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Image block" }, /* @__PURE__ */ React72.createElement(
|
|
2928
3108
|
TextInput,
|
|
2929
3109
|
{
|
|
2930
3110
|
label: "Source URL",
|
|
@@ -2934,14 +3114,14 @@ function ImageSidebarPanel({ data, setData }) {
|
|
|
2934
3114
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { url }) }));
|
|
2935
3115
|
}
|
|
2936
3116
|
}
|
|
2937
|
-
), /* @__PURE__ */
|
|
3117
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2938
3118
|
TextInput,
|
|
2939
3119
|
{
|
|
2940
3120
|
label: "Alt text",
|
|
2941
3121
|
defaultValue: (_d = (_c = data.props) == null ? void 0 : _c.alt) != null ? _d : "",
|
|
2942
3122
|
onChange: (alt) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { alt }) }))
|
|
2943
3123
|
}
|
|
2944
|
-
), /* @__PURE__ */
|
|
3124
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2945
3125
|
TextInput,
|
|
2946
3126
|
{
|
|
2947
3127
|
label: "Click through URL",
|
|
@@ -2951,31 +3131,31 @@ function ImageSidebarPanel({ data, setData }) {
|
|
|
2951
3131
|
updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { linkHref }) }));
|
|
2952
3132
|
}
|
|
2953
3133
|
}
|
|
2954
|
-
), /* @__PURE__ */
|
|
3134
|
+
), /* @__PURE__ */ React72.createElement(Stack, { direction: "row", spacing: 2 }, /* @__PURE__ */ React72.createElement(
|
|
2955
3135
|
TextDimensionInput,
|
|
2956
3136
|
{
|
|
2957
3137
|
label: "Width",
|
|
2958
3138
|
defaultValue: (_g = data.props) == null ? void 0 : _g.width,
|
|
2959
3139
|
onChange: (width) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { width }) }))
|
|
2960
3140
|
}
|
|
2961
|
-
), /* @__PURE__ */
|
|
3141
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2962
3142
|
TextDimensionInput,
|
|
2963
3143
|
{
|
|
2964
3144
|
label: "Height",
|
|
2965
3145
|
defaultValue: (_h = data.props) == null ? void 0 : _h.height,
|
|
2966
3146
|
onChange: (height) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { height }) }))
|
|
2967
3147
|
}
|
|
2968
|
-
)), /* @__PURE__ */
|
|
3148
|
+
)), /* @__PURE__ */ React72.createElement(
|
|
2969
3149
|
RadioGroupInput,
|
|
2970
3150
|
{
|
|
2971
3151
|
label: "Alignment",
|
|
2972
3152
|
defaultValue: (_j = (_i = data.props) == null ? void 0 : _i.contentAlignment) != null ? _j : "middle",
|
|
2973
3153
|
onChange: (contentAlignment) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { contentAlignment }) }))
|
|
2974
3154
|
},
|
|
2975
|
-
/* @__PURE__ */
|
|
2976
|
-
/* @__PURE__ */
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
), /* @__PURE__ */
|
|
3155
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "top" }, /* @__PURE__ */ React72.createElement(VerticalAlignTopOutlined, { fontSize: "small" })),
|
|
3156
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "middle" }, /* @__PURE__ */ React72.createElement(VerticalAlignCenterOutlined, { fontSize: "small" })),
|
|
3157
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "bottom" }, /* @__PURE__ */ React72.createElement(VerticalAlignBottomOutlined, { fontSize: "small" }))
|
|
3158
|
+
), /* @__PURE__ */ React72.createElement(
|
|
2979
3159
|
MultiStylePropertyPanel,
|
|
2980
3160
|
{
|
|
2981
3161
|
names: ["backgroundColor", "textAlign", "padding"],
|
|
@@ -2984,6 +3164,157 @@ function ImageSidebarPanel({ data, setData }) {
|
|
|
2984
3164
|
}
|
|
2985
3165
|
));
|
|
2986
3166
|
}
|
|
3167
|
+
function SignatureSidebarPanel({ data, setData }) {
|
|
3168
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
|
|
3169
|
+
const [, setErrors] = useState(null);
|
|
3170
|
+
const updateData = (d) => {
|
|
3171
|
+
const res = SignaturePropsSchema.safeParse(d);
|
|
3172
|
+
if (res.success) {
|
|
3173
|
+
setData(res.data);
|
|
3174
|
+
setErrors(null);
|
|
3175
|
+
} else {
|
|
3176
|
+
setErrors(res.error);
|
|
3177
|
+
}
|
|
3178
|
+
};
|
|
3179
|
+
const greeting = (_b = (_a = data.props) == null ? void 0 : _a.greeting) != null ? _b : SignaturePropsDefaults.greeting;
|
|
3180
|
+
const name = (_d = (_c = data.props) == null ? void 0 : _c.name) != null ? _d : SignaturePropsDefaults.name;
|
|
3181
|
+
const title = (_f = (_e = data.props) == null ? void 0 : _e.title) != null ? _f : SignaturePropsDefaults.title;
|
|
3182
|
+
const company = (_h = (_g = data.props) == null ? void 0 : _g.company) != null ? _h : SignaturePropsDefaults.company;
|
|
3183
|
+
const address = (_j = (_i = data.props) == null ? void 0 : _i.address) != null ? _j : SignaturePropsDefaults.address;
|
|
3184
|
+
const email = (_l = (_k = data.props) == null ? void 0 : _k.email) != null ? _l : SignaturePropsDefaults.email;
|
|
3185
|
+
const phone = (_n = (_m = data.props) == null ? void 0 : _m.phone) != null ? _n : SignaturePropsDefaults.phone;
|
|
3186
|
+
const website = (_p = (_o = data.props) == null ? void 0 : _o.website) != null ? _p : SignaturePropsDefaults.website;
|
|
3187
|
+
const imageUrl = (_r = (_q = data.props) == null ? void 0 : _q.imageUrl) != null ? _r : SignaturePropsDefaults.imageUrl;
|
|
3188
|
+
const imageSize = (_t = (_s = data.props) == null ? void 0 : _s.imageSize) != null ? _t : SignaturePropsDefaults.imageSize;
|
|
3189
|
+
const imageShape = (_v = (_u = data.props) == null ? void 0 : _u.imageShape) != null ? _v : SignaturePropsDefaults.imageShape;
|
|
3190
|
+
const layout = (_x = (_w = data.props) == null ? void 0 : _w.layout) != null ? _x : SignaturePropsDefaults.layout;
|
|
3191
|
+
const nameColor = (_z = (_y = data.props) == null ? void 0 : _y.nameColor) != null ? _z : SignaturePropsDefaults.nameColor;
|
|
3192
|
+
const textColor = (_B = (_A = data.props) == null ? void 0 : _A.textColor) != null ? _B : SignaturePropsDefaults.textColor;
|
|
3193
|
+
const linkColor = (_D = (_C = data.props) == null ? void 0 : _C.linkColor) != null ? _D : SignaturePropsDefaults.linkColor;
|
|
3194
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Signature block" }, /* @__PURE__ */ React72.createElement(
|
|
3195
|
+
TextInput,
|
|
3196
|
+
{
|
|
3197
|
+
label: "Greeting",
|
|
3198
|
+
defaultValue: greeting,
|
|
3199
|
+
onChange: (greeting2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { greeting: greeting2 }) }))
|
|
3200
|
+
}
|
|
3201
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3202
|
+
TextInput,
|
|
3203
|
+
{
|
|
3204
|
+
label: "Name",
|
|
3205
|
+
defaultValue: name,
|
|
3206
|
+
onChange: (name2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { name: name2 }) }))
|
|
3207
|
+
}
|
|
3208
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3209
|
+
TextInput,
|
|
3210
|
+
{
|
|
3211
|
+
label: "Title",
|
|
3212
|
+
defaultValue: title,
|
|
3213
|
+
onChange: (title2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { title: title2 }) }))
|
|
3214
|
+
}
|
|
3215
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3216
|
+
TextInput,
|
|
3217
|
+
{
|
|
3218
|
+
label: "Company",
|
|
3219
|
+
defaultValue: company,
|
|
3220
|
+
onChange: (company2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { company: company2 }) }))
|
|
3221
|
+
}
|
|
3222
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3223
|
+
TextInput,
|
|
3224
|
+
{
|
|
3225
|
+
label: "Address",
|
|
3226
|
+
defaultValue: address,
|
|
3227
|
+
onChange: (address2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { address: address2 }) }))
|
|
3228
|
+
}
|
|
3229
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3230
|
+
TextInput,
|
|
3231
|
+
{
|
|
3232
|
+
label: "Email",
|
|
3233
|
+
defaultValue: email,
|
|
3234
|
+
onChange: (email2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { email: email2 }) }))
|
|
3235
|
+
}
|
|
3236
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3237
|
+
TextInput,
|
|
3238
|
+
{
|
|
3239
|
+
label: "Phone",
|
|
3240
|
+
defaultValue: phone,
|
|
3241
|
+
onChange: (phone2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { phone: phone2 }) }))
|
|
3242
|
+
}
|
|
3243
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3244
|
+
TextInput,
|
|
3245
|
+
{
|
|
3246
|
+
label: "Website",
|
|
3247
|
+
defaultValue: website,
|
|
3248
|
+
onChange: (website2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { website: website2 }) }))
|
|
3249
|
+
}
|
|
3250
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3251
|
+
TextInput,
|
|
3252
|
+
{
|
|
3253
|
+
label: "Image URL",
|
|
3254
|
+
defaultValue: imageUrl,
|
|
3255
|
+
onChange: (imageUrl2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { imageUrl: imageUrl2 }) }))
|
|
3256
|
+
}
|
|
3257
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3258
|
+
SliderInput,
|
|
3259
|
+
{
|
|
3260
|
+
label: "Image size",
|
|
3261
|
+
iconLabel: /* @__PURE__ */ React72.createElement(AspectRatioOutlined, { sx: { color: "text.secondary" } }),
|
|
3262
|
+
units: "px",
|
|
3263
|
+
step: 4,
|
|
3264
|
+
min: 32,
|
|
3265
|
+
max: 128,
|
|
3266
|
+
defaultValue: imageSize,
|
|
3267
|
+
onChange: (imageSize2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { imageSize: imageSize2 }) }))
|
|
3268
|
+
}
|
|
3269
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3270
|
+
RadioGroupInput,
|
|
3271
|
+
{
|
|
3272
|
+
label: "Image shape",
|
|
3273
|
+
defaultValue: imageShape,
|
|
3274
|
+
onChange: (imageShape2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { imageShape: imageShape2 }) }))
|
|
3275
|
+
},
|
|
3276
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "circle" }, "Circle"),
|
|
3277
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "square" }, "Square"),
|
|
3278
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "rounded" }, "Rounded")
|
|
3279
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3280
|
+
RadioGroupInput,
|
|
3281
|
+
{
|
|
3282
|
+
label: "Layout",
|
|
3283
|
+
defaultValue: layout,
|
|
3284
|
+
onChange: (layout2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { layout: layout2 }) }))
|
|
3285
|
+
},
|
|
3286
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "horizontal" }, "Horizontal"),
|
|
3287
|
+
/* @__PURE__ */ React72.createElement(ToggleButton, { value: "vertical" }, "Vertical")
|
|
3288
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3289
|
+
ColorInput2,
|
|
3290
|
+
{
|
|
3291
|
+
label: "Name color",
|
|
3292
|
+
defaultValue: nameColor,
|
|
3293
|
+
onChange: (nameColor2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { nameColor: nameColor2 }) }))
|
|
3294
|
+
}
|
|
3295
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3296
|
+
ColorInput2,
|
|
3297
|
+
{
|
|
3298
|
+
label: "Text color",
|
|
3299
|
+
defaultValue: textColor,
|
|
3300
|
+
onChange: (textColor2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { textColor: textColor2 }) }))
|
|
3301
|
+
}
|
|
3302
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3303
|
+
ColorInput2,
|
|
3304
|
+
{
|
|
3305
|
+
label: "Link color",
|
|
3306
|
+
defaultValue: linkColor,
|
|
3307
|
+
onChange: (linkColor2) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { linkColor: linkColor2 }) }))
|
|
3308
|
+
}
|
|
3309
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3310
|
+
MultiStylePropertyPanel,
|
|
3311
|
+
{
|
|
3312
|
+
names: ["backgroundColor", "fontFamily", "padding"],
|
|
3313
|
+
value: data.style,
|
|
3314
|
+
onChange: (style) => updateData(__spreadProps(__spreadValues({}, data), { style }))
|
|
3315
|
+
}
|
|
3316
|
+
));
|
|
3317
|
+
}
|
|
2987
3318
|
function SpacerSidebarPanel({ data, setData }) {
|
|
2988
3319
|
var _a, _b;
|
|
2989
3320
|
const [, setErrors] = useState(null);
|
|
@@ -2996,11 +3327,11 @@ function SpacerSidebarPanel({ data, setData }) {
|
|
|
2996
3327
|
setErrors(res.error);
|
|
2997
3328
|
}
|
|
2998
3329
|
};
|
|
2999
|
-
return /* @__PURE__ */
|
|
3330
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Spacer block" }, /* @__PURE__ */ React72.createElement(
|
|
3000
3331
|
SliderInput,
|
|
3001
3332
|
{
|
|
3002
3333
|
label: "Height",
|
|
3003
|
-
iconLabel: /* @__PURE__ */
|
|
3334
|
+
iconLabel: /* @__PURE__ */ React72.createElement(HeightOutlined, { sx: { color: "text.secondary" } }),
|
|
3004
3335
|
units: "px",
|
|
3005
3336
|
step: 4,
|
|
3006
3337
|
min: 4,
|
|
@@ -3015,11 +3346,11 @@ function BooleanInput({ label, defaultValue, onChange }) {
|
|
|
3015
3346
|
useEffect(() => {
|
|
3016
3347
|
setValue(defaultValue);
|
|
3017
3348
|
}, [defaultValue]);
|
|
3018
|
-
return /* @__PURE__ */
|
|
3349
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3019
3350
|
FormControlLabel,
|
|
3020
3351
|
{
|
|
3021
3352
|
label,
|
|
3022
|
-
control: /* @__PURE__ */
|
|
3353
|
+
control: /* @__PURE__ */ React72.createElement(
|
|
3023
3354
|
Switch,
|
|
3024
3355
|
{
|
|
3025
3356
|
checked: value,
|
|
@@ -3046,7 +3377,7 @@ function TextSidebarPanel({ data, setData }) {
|
|
|
3046
3377
|
setErrors(res.error);
|
|
3047
3378
|
}
|
|
3048
3379
|
};
|
|
3049
|
-
return /* @__PURE__ */
|
|
3380
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Text block" }, /* @__PURE__ */ React72.createElement(
|
|
3050
3381
|
TextInput,
|
|
3051
3382
|
{
|
|
3052
3383
|
label: "Content",
|
|
@@ -3054,14 +3385,14 @@ function TextSidebarPanel({ data, setData }) {
|
|
|
3054
3385
|
defaultValue: (_b = (_a = data.props) == null ? void 0 : _a.text) != null ? _b : "",
|
|
3055
3386
|
onChange: (text) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { text }) }))
|
|
3056
3387
|
}
|
|
3057
|
-
), /* @__PURE__ */
|
|
3388
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3058
3389
|
BooleanInput,
|
|
3059
3390
|
{
|
|
3060
3391
|
label: "Markdown",
|
|
3061
3392
|
defaultValue: (_d = (_c = data.props) == null ? void 0 : _c.markdown) != null ? _d : false,
|
|
3062
3393
|
onChange: (markdown) => updateData(__spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { markdown }) }))
|
|
3063
3394
|
}
|
|
3064
|
-
), /* @__PURE__ */
|
|
3395
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3065
3396
|
MultiStylePropertyPanel,
|
|
3066
3397
|
{
|
|
3067
3398
|
names: ["color", "backgroundColor", "fontFamily", "fontSize", "fontWeight", "textAlign", "padding"],
|
|
@@ -3073,7 +3404,7 @@ function TextSidebarPanel({ data, setData }) {
|
|
|
3073
3404
|
|
|
3074
3405
|
// src/app/inspector-drawer/configuration-panel/index.tsx
|
|
3075
3406
|
function renderMessage(val) {
|
|
3076
|
-
return /* @__PURE__ */
|
|
3407
|
+
return /* @__PURE__ */ React72.createElement(Box, { sx: { m: 3, p: 1, border: "1px dashed", borderColor: "divider" } }, /* @__PURE__ */ React72.createElement(Typography, { color: "text.secondary" }, val));
|
|
3077
3408
|
}
|
|
3078
3409
|
function ConfigurationPanel() {
|
|
3079
3410
|
const document2 = useDocument();
|
|
@@ -3089,53 +3420,55 @@ function ConfigurationPanel() {
|
|
|
3089
3420
|
const { data, type } = block;
|
|
3090
3421
|
switch (type) {
|
|
3091
3422
|
case "Avatar":
|
|
3092
|
-
return /* @__PURE__ */
|
|
3423
|
+
return /* @__PURE__ */ React72.createElement(AvatarSidebarPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3093
3424
|
case "Button":
|
|
3094
|
-
return /* @__PURE__ */
|
|
3425
|
+
return /* @__PURE__ */ React72.createElement(ButtonSidebarPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3095
3426
|
case "ColumnsContainer":
|
|
3096
|
-
return /* @__PURE__ */
|
|
3427
|
+
return /* @__PURE__ */ React72.createElement(ColumnsContainerPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3097
3428
|
case "Container":
|
|
3098
|
-
return /* @__PURE__ */
|
|
3429
|
+
return /* @__PURE__ */ React72.createElement(ContainerSidebarPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3099
3430
|
case "Divider":
|
|
3100
|
-
return /* @__PURE__ */
|
|
3431
|
+
return /* @__PURE__ */ React72.createElement(DividerSidebarPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3101
3432
|
case "Heading":
|
|
3102
|
-
return /* @__PURE__ */
|
|
3433
|
+
return /* @__PURE__ */ React72.createElement(HeadingSidebarPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3103
3434
|
case "Html":
|
|
3104
|
-
return /* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ React72.createElement(HtmlSidebarPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3105
3436
|
case "Image":
|
|
3106
|
-
return /* @__PURE__ */
|
|
3437
|
+
return /* @__PURE__ */ React72.createElement(ImageSidebarPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3107
3438
|
case "EmailLayout":
|
|
3108
|
-
return /* @__PURE__ */
|
|
3439
|
+
return /* @__PURE__ */ React72.createElement(EmailLayoutSidebarFields, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3109
3440
|
case "Spacer":
|
|
3110
|
-
return /* @__PURE__ */
|
|
3441
|
+
return /* @__PURE__ */ React72.createElement(SpacerSidebarPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3442
|
+
case "Signature":
|
|
3443
|
+
return /* @__PURE__ */ React72.createElement(SignatureSidebarPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3111
3444
|
case "Text":
|
|
3112
|
-
return /* @__PURE__ */
|
|
3445
|
+
return /* @__PURE__ */ React72.createElement(TextSidebarPanel, { key: selectedBlockId, data, setData: (data2) => setBlock({ type, data: data2 }) });
|
|
3113
3446
|
default:
|
|
3114
|
-
return /* @__PURE__ */
|
|
3447
|
+
return /* @__PURE__ */ React72.createElement("pre", null, JSON.stringify(block, null, " "));
|
|
3115
3448
|
}
|
|
3116
3449
|
}
|
|
3117
3450
|
function StylesPanel() {
|
|
3118
3451
|
const block = useDocument().root;
|
|
3119
3452
|
if (!block) {
|
|
3120
|
-
return /* @__PURE__ */
|
|
3453
|
+
return /* @__PURE__ */ React72.createElement("p", null, "Block not found");
|
|
3121
3454
|
}
|
|
3122
3455
|
const { data, type } = block;
|
|
3123
3456
|
if (type !== "EmailLayout") {
|
|
3124
3457
|
throw new Error('Expected "root" element to be of type EmailLayout');
|
|
3125
3458
|
}
|
|
3126
|
-
return /* @__PURE__ */
|
|
3459
|
+
return /* @__PURE__ */ React72.createElement(EmailLayoutSidebarFields, { key: "root", data, setData: (data2) => setDocument({ root: { type, data: data2 } }) });
|
|
3127
3460
|
}
|
|
3128
3461
|
function TemplateDownloadButton() {
|
|
3129
3462
|
const doc = useDocument();
|
|
3130
3463
|
const href = useMemo(() => {
|
|
3131
3464
|
return `data:text/plain,${encodeURIComponent(JSON.stringify(doc, null, " "))}`;
|
|
3132
3465
|
}, [doc]);
|
|
3133
|
-
return /* @__PURE__ */
|
|
3466
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3134
3467
|
Button$1,
|
|
3135
3468
|
{
|
|
3136
3469
|
variant: "outlined",
|
|
3137
3470
|
color: "primary",
|
|
3138
|
-
startIcon: /* @__PURE__ */
|
|
3471
|
+
startIcon: /* @__PURE__ */ React72.createElement(FileDownloadOutlined, null),
|
|
3139
3472
|
href,
|
|
3140
3473
|
download: "emailTemplate.json",
|
|
3141
3474
|
fullWidth: true
|
|
@@ -3167,9 +3500,9 @@ function TemplatePanel({ deleteTemplate, copyTemplate }) {
|
|
|
3167
3500
|
}
|
|
3168
3501
|
};
|
|
3169
3502
|
if (!currentTemplateId) {
|
|
3170
|
-
return /* @__PURE__ */
|
|
3503
|
+
return /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Template" }, "No template selected");
|
|
3171
3504
|
}
|
|
3172
|
-
return /* @__PURE__ */
|
|
3505
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Template" }, /* @__PURE__ */ React72.createElement(Stack, { spacing: 2 }, !persistenceEnabled && /* @__PURE__ */ React72.createElement(
|
|
3173
3506
|
Typography,
|
|
3174
3507
|
{
|
|
3175
3508
|
variant: "body2",
|
|
@@ -3182,29 +3515,29 @@ function TemplatePanel({ deleteTemplate, copyTemplate }) {
|
|
|
3182
3515
|
}
|
|
3183
3516
|
},
|
|
3184
3517
|
"Save functionality is disabled. To enable saving, provide the necessary callback functions."
|
|
3185
|
-
), persistenceEnabled && /* @__PURE__ */
|
|
3518
|
+
), persistenceEnabled && /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(
|
|
3186
3519
|
Button$1,
|
|
3187
3520
|
{
|
|
3188
3521
|
variant: "outlined",
|
|
3189
3522
|
color: "primary",
|
|
3190
|
-
startIcon: /* @__PURE__ */
|
|
3523
|
+
startIcon: /* @__PURE__ */ React72.createElement(ContentCopyOutlined, null),
|
|
3191
3524
|
onClick: handleCopyToSamples,
|
|
3192
3525
|
fullWidth: true,
|
|
3193
3526
|
disabled: !copyTemplate
|
|
3194
3527
|
},
|
|
3195
3528
|
"Save as Sample Template"
|
|
3196
|
-
), /* @__PURE__ */
|
|
3529
|
+
), /* @__PURE__ */ React72.createElement(
|
|
3197
3530
|
Button$1,
|
|
3198
3531
|
{
|
|
3199
3532
|
variant: "outlined",
|
|
3200
3533
|
color: "error",
|
|
3201
|
-
startIcon: /* @__PURE__ */
|
|
3534
|
+
startIcon: /* @__PURE__ */ React72.createElement(DeleteOutlined, null),
|
|
3202
3535
|
onClick: handleDelete,
|
|
3203
3536
|
fullWidth: true,
|
|
3204
3537
|
disabled: !deleteTemplate
|
|
3205
3538
|
},
|
|
3206
3539
|
"Delete Template"
|
|
3207
|
-
)))), persistenceEnabled && /* @__PURE__ */
|
|
3540
|
+
)))), persistenceEnabled && /* @__PURE__ */ React72.createElement(BaseSidebarPanel, { title: "Export" }, /* @__PURE__ */ React72.createElement(Stack, { spacing: 2 }, /* @__PURE__ */ React72.createElement(TemplateDownloadButton, null))));
|
|
3208
3541
|
}
|
|
3209
3542
|
|
|
3210
3543
|
// src/app/inspector-drawer/index.tsx
|
|
@@ -3221,11 +3554,11 @@ function InspectorDrawer({
|
|
|
3221
3554
|
const renderCurrentSidebarPanel = () => {
|
|
3222
3555
|
switch (selectedSidebarTab) {
|
|
3223
3556
|
case "block-configuration":
|
|
3224
|
-
return /* @__PURE__ */
|
|
3557
|
+
return /* @__PURE__ */ React72.createElement(ConfigurationPanel, null);
|
|
3225
3558
|
case "styles":
|
|
3226
|
-
return /* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ React72.createElement(StylesPanel, null);
|
|
3227
3560
|
case "template-settings":
|
|
3228
|
-
return /* @__PURE__ */
|
|
3561
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3229
3562
|
TemplatePanel,
|
|
3230
3563
|
{
|
|
3231
3564
|
deleteTemplate,
|
|
@@ -3234,7 +3567,7 @@ function InspectorDrawer({
|
|
|
3234
3567
|
);
|
|
3235
3568
|
}
|
|
3236
3569
|
};
|
|
3237
|
-
return /* @__PURE__ */
|
|
3570
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3238
3571
|
Drawer,
|
|
3239
3572
|
{
|
|
3240
3573
|
variant: "persistent",
|
|
@@ -3256,8 +3589,8 @@ function InspectorDrawer({
|
|
|
3256
3589
|
width: inspectorDrawerOpen ? INSPECTOR_DRAWER_WIDTH : 0
|
|
3257
3590
|
}
|
|
3258
3591
|
},
|
|
3259
|
-
/* @__PURE__ */
|
|
3260
|
-
/* @__PURE__ */
|
|
3592
|
+
/* @__PURE__ */ React72.createElement(Box, { sx: { width: INSPECTOR_DRAWER_WIDTH, height: 49, borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React72.createElement(Box, { px: 2 }, /* @__PURE__ */ React72.createElement(Tabs, { value: selectedSidebarTab, onChange: (_, v) => setSidebarTab(v) }, /* @__PURE__ */ React72.createElement(Tab, { value: "styles", label: "Styles" }), /* @__PURE__ */ React72.createElement(Tab, { value: "block-configuration", label: "Inspect" }), /* @__PURE__ */ React72.createElement(Tab, { value: "template-settings", label: "Settings" })))),
|
|
3593
|
+
/* @__PURE__ */ React72.createElement(Box, { sx: { width: INSPECTOR_DRAWER_WIDTH, height: "calc(100% - 49px)", overflow: "auto" } }, renderCurrentSidebarPanel())
|
|
3261
3594
|
);
|
|
3262
3595
|
}
|
|
3263
3596
|
function SidebarButton({
|
|
@@ -3279,7 +3612,7 @@ function SidebarButton({
|
|
|
3279
3612
|
console.error("Error loading template:", error);
|
|
3280
3613
|
}
|
|
3281
3614
|
});
|
|
3282
|
-
return /* @__PURE__ */
|
|
3615
|
+
return /* @__PURE__ */ React72.createElement(Button$1, { size: "small", onClick: handleClick, sx: sx2 }, children);
|
|
3283
3616
|
}
|
|
3284
3617
|
|
|
3285
3618
|
// sample-templates/empty-email-message.ts
|
|
@@ -3368,7 +3701,7 @@ function SamplesDrawer({
|
|
|
3368
3701
|
if (!enabled) {
|
|
3369
3702
|
return null;
|
|
3370
3703
|
}
|
|
3371
|
-
return /* @__PURE__ */
|
|
3704
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(
|
|
3372
3705
|
Drawer,
|
|
3373
3706
|
{
|
|
3374
3707
|
variant: "persistent",
|
|
@@ -3390,7 +3723,7 @@ function SamplesDrawer({
|
|
|
3390
3723
|
width: samplesDrawerOpen ? SAMPLES_DRAWER_WIDTH : 0
|
|
3391
3724
|
}
|
|
3392
3725
|
},
|
|
3393
|
-
/* @__PURE__ */
|
|
3726
|
+
/* @__PURE__ */ React72.createElement(
|
|
3394
3727
|
Stack,
|
|
3395
3728
|
{
|
|
3396
3729
|
spacing: 3,
|
|
@@ -3400,7 +3733,7 @@ function SamplesDrawer({
|
|
|
3400
3733
|
justifyContent: "space-between",
|
|
3401
3734
|
height: "100%"
|
|
3402
3735
|
},
|
|
3403
|
-
/* @__PURE__ */
|
|
3736
|
+
/* @__PURE__ */ React72.createElement(
|
|
3404
3737
|
Stack,
|
|
3405
3738
|
{
|
|
3406
3739
|
spacing: 2,
|
|
@@ -3411,8 +3744,8 @@ function SamplesDrawer({
|
|
|
3411
3744
|
}
|
|
3412
3745
|
}
|
|
3413
3746
|
},
|
|
3414
|
-
/* @__PURE__ */
|
|
3415
|
-
loadTemplates && /* @__PURE__ */
|
|
3747
|
+
/* @__PURE__ */ React72.createElement(Typography, { variant: "h6", component: "h1", sx: { p: 2 } }, "Templates"),
|
|
3748
|
+
loadTemplates && /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(
|
|
3416
3749
|
Typography,
|
|
3417
3750
|
{
|
|
3418
3751
|
variant: "subtitle2",
|
|
@@ -3420,7 +3753,7 @@ function SamplesDrawer({
|
|
|
3420
3753
|
sx: { fontWeight: "bold", mt: 2 }
|
|
3421
3754
|
},
|
|
3422
3755
|
"Your Templates"
|
|
3423
|
-
), loadingTemplates ? /* @__PURE__ */
|
|
3756
|
+
), loadingTemplates ? /* @__PURE__ */ React72.createElement(Stack, { alignItems: "center", width: "100%", py: 1 }, /* @__PURE__ */ React72.createElement(CircularProgress, { size: 24 })) : templates.length > 0 ? /* @__PURE__ */ React72.createElement(Stack, { alignItems: "flex-start", width: "100%" }, templates.map((template) => /* @__PURE__ */ React72.createElement(
|
|
3424
3757
|
Box,
|
|
3425
3758
|
{
|
|
3426
3759
|
key: template.id,
|
|
@@ -3435,7 +3768,7 @@ function SamplesDrawer({
|
|
|
3435
3768
|
}
|
|
3436
3769
|
}
|
|
3437
3770
|
},
|
|
3438
|
-
/* @__PURE__ */
|
|
3771
|
+
/* @__PURE__ */ React72.createElement(
|
|
3439
3772
|
SidebarButton,
|
|
3440
3773
|
{
|
|
3441
3774
|
templateId: template.id,
|
|
@@ -3444,15 +3777,15 @@ function SamplesDrawer({
|
|
|
3444
3777
|
},
|
|
3445
3778
|
template.name
|
|
3446
3779
|
)
|
|
3447
|
-
))) : /* @__PURE__ */
|
|
3780
|
+
))) : /* @__PURE__ */ React72.createElement(
|
|
3448
3781
|
Typography,
|
|
3449
3782
|
{
|
|
3450
3783
|
variant: "body2",
|
|
3451
3784
|
sx: { color: "text.secondary", py: 1 }
|
|
3452
3785
|
},
|
|
3453
3786
|
"No saved templates"
|
|
3454
|
-
), /* @__PURE__ */
|
|
3455
|
-
/* @__PURE__ */
|
|
3787
|
+
), /* @__PURE__ */ React72.createElement(Divider$1, null)),
|
|
3788
|
+
/* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(
|
|
3456
3789
|
Typography,
|
|
3457
3790
|
{
|
|
3458
3791
|
variant: "subtitle2",
|
|
@@ -3460,7 +3793,7 @@ function SamplesDrawer({
|
|
|
3460
3793
|
sx: { fontWeight: "bold", mt: 1 }
|
|
3461
3794
|
},
|
|
3462
3795
|
"Sample Templates"
|
|
3463
|
-
), loadingSamples ? /* @__PURE__ */
|
|
3796
|
+
), loadingSamples ? /* @__PURE__ */ React72.createElement(Stack, { alignItems: "center", width: "100%", py: 1 }, /* @__PURE__ */ React72.createElement(CircularProgress, { size: 24 })) : /* @__PURE__ */ React72.createElement(Stack, { alignItems: "flex-start" }, samples.map((sample) => /* @__PURE__ */ React72.createElement(
|
|
3464
3797
|
SidebarButton,
|
|
3465
3798
|
{
|
|
3466
3799
|
key: sample.id,
|
|
@@ -3485,7 +3818,7 @@ var ICON_SX = {
|
|
|
3485
3818
|
borderColor: "cadet.300"
|
|
3486
3819
|
};
|
|
3487
3820
|
function BlockTypeButton({ label, icon, onClick }) {
|
|
3488
|
-
return /* @__PURE__ */
|
|
3821
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3489
3822
|
Button$1,
|
|
3490
3823
|
{
|
|
3491
3824
|
sx: BUTTON_SX2,
|
|
@@ -3494,14 +3827,14 @@ function BlockTypeButton({ label, icon, onClick }) {
|
|
|
3494
3827
|
onClick();
|
|
3495
3828
|
}
|
|
3496
3829
|
},
|
|
3497
|
-
/* @__PURE__ */
|
|
3498
|
-
/* @__PURE__ */
|
|
3830
|
+
/* @__PURE__ */ React72.createElement(Box, { sx: ICON_SX }, icon),
|
|
3831
|
+
/* @__PURE__ */ React72.createElement(Typography, { variant: "body2" }, label)
|
|
3499
3832
|
);
|
|
3500
3833
|
}
|
|
3501
3834
|
var BUTTONS = [
|
|
3502
3835
|
{
|
|
3503
3836
|
label: "Heading",
|
|
3504
|
-
icon: /* @__PURE__ */
|
|
3837
|
+
icon: /* @__PURE__ */ React72.createElement(HMobiledataOutlined, null),
|
|
3505
3838
|
block: () => ({
|
|
3506
3839
|
type: "Heading",
|
|
3507
3840
|
data: {
|
|
@@ -3514,7 +3847,7 @@ var BUTTONS = [
|
|
|
3514
3847
|
},
|
|
3515
3848
|
{
|
|
3516
3849
|
label: "Text",
|
|
3517
|
-
icon: /* @__PURE__ */
|
|
3850
|
+
icon: /* @__PURE__ */ React72.createElement(NotesOutlined, null),
|
|
3518
3851
|
block: () => ({
|
|
3519
3852
|
type: "Text",
|
|
3520
3853
|
data: {
|
|
@@ -3528,7 +3861,7 @@ var BUTTONS = [
|
|
|
3528
3861
|
},
|
|
3529
3862
|
{
|
|
3530
3863
|
label: "Button",
|
|
3531
|
-
icon: /* @__PURE__ */
|
|
3864
|
+
icon: /* @__PURE__ */ React72.createElement(SmartButtonOutlined, null),
|
|
3532
3865
|
block: () => ({
|
|
3533
3866
|
type: "Button",
|
|
3534
3867
|
data: {
|
|
@@ -3542,7 +3875,7 @@ var BUTTONS = [
|
|
|
3542
3875
|
},
|
|
3543
3876
|
{
|
|
3544
3877
|
label: "Image",
|
|
3545
|
-
icon: /* @__PURE__ */
|
|
3878
|
+
icon: /* @__PURE__ */ React72.createElement(ImageOutlined, null),
|
|
3546
3879
|
block: () => ({
|
|
3547
3880
|
type: "Image",
|
|
3548
3881
|
data: {
|
|
@@ -3558,7 +3891,7 @@ var BUTTONS = [
|
|
|
3558
3891
|
},
|
|
3559
3892
|
{
|
|
3560
3893
|
label: "Avatar",
|
|
3561
|
-
icon: /* @__PURE__ */
|
|
3894
|
+
icon: /* @__PURE__ */ React72.createElement(AccountCircleOutlined, null),
|
|
3562
3895
|
block: () => ({
|
|
3563
3896
|
type: "Avatar",
|
|
3564
3897
|
data: {
|
|
@@ -3570,9 +3903,51 @@ var BUTTONS = [
|
|
|
3570
3903
|
}
|
|
3571
3904
|
})
|
|
3572
3905
|
},
|
|
3906
|
+
{
|
|
3907
|
+
label: "Personal Signature",
|
|
3908
|
+
icon: /* @__PURE__ */ React72.createElement(ContactMailOutlined, null),
|
|
3909
|
+
block: () => ({
|
|
3910
|
+
type: "Signature",
|
|
3911
|
+
data: {
|
|
3912
|
+
props: {
|
|
3913
|
+
greeting: "Best regards,",
|
|
3914
|
+
name: "John Doe",
|
|
3915
|
+
title: "Software Engineer",
|
|
3916
|
+
company: "Acme Inc.",
|
|
3917
|
+
email: "john@example.com",
|
|
3918
|
+
phone: "+1 234 567 890",
|
|
3919
|
+
imageUrl: "https://ui-avatars.com/api/?name=John+Doe&size=128",
|
|
3920
|
+
imageSize: 64,
|
|
3921
|
+
imageShape: "circle",
|
|
3922
|
+
layout: "horizontal"
|
|
3923
|
+
},
|
|
3924
|
+
style: { padding: { top: 16, bottom: 16, left: 24, right: 24 } }
|
|
3925
|
+
}
|
|
3926
|
+
})
|
|
3927
|
+
},
|
|
3928
|
+
{
|
|
3929
|
+
label: "Company Signature",
|
|
3930
|
+
icon: /* @__PURE__ */ React72.createElement(BusinessOutlined, null),
|
|
3931
|
+
block: () => ({
|
|
3932
|
+
type: "Signature",
|
|
3933
|
+
data: {
|
|
3934
|
+
props: {
|
|
3935
|
+
company: "Acme Inc.",
|
|
3936
|
+
address: "123 Main Street, City, Country",
|
|
3937
|
+
email: "support@example.com",
|
|
3938
|
+
website: "www.example.com",
|
|
3939
|
+
imageUrl: "https://placehold.co/128x128/EEE/999?text=Logo",
|
|
3940
|
+
imageSize: 48,
|
|
3941
|
+
imageShape: "rounded",
|
|
3942
|
+
layout: "horizontal"
|
|
3943
|
+
},
|
|
3944
|
+
style: { padding: { top: 16, bottom: 16, left: 24, right: 24 } }
|
|
3945
|
+
}
|
|
3946
|
+
})
|
|
3947
|
+
},
|
|
3573
3948
|
{
|
|
3574
3949
|
label: "Divider",
|
|
3575
|
-
icon: /* @__PURE__ */
|
|
3950
|
+
icon: /* @__PURE__ */ React72.createElement(HorizontalRuleOutlined, null),
|
|
3576
3951
|
block: () => ({
|
|
3577
3952
|
type: "Divider",
|
|
3578
3953
|
data: {
|
|
@@ -3585,7 +3960,7 @@ var BUTTONS = [
|
|
|
3585
3960
|
},
|
|
3586
3961
|
{
|
|
3587
3962
|
label: "Spacer",
|
|
3588
|
-
icon: /* @__PURE__ */
|
|
3963
|
+
icon: /* @__PURE__ */ React72.createElement(Crop32Outlined, null),
|
|
3589
3964
|
block: () => ({
|
|
3590
3965
|
type: "Spacer",
|
|
3591
3966
|
data: {}
|
|
@@ -3593,7 +3968,7 @@ var BUTTONS = [
|
|
|
3593
3968
|
},
|
|
3594
3969
|
{
|
|
3595
3970
|
label: "Html",
|
|
3596
|
-
icon: /* @__PURE__ */
|
|
3971
|
+
icon: /* @__PURE__ */ React72.createElement(HtmlOutlined, null),
|
|
3597
3972
|
block: () => ({
|
|
3598
3973
|
type: "Html",
|
|
3599
3974
|
data: {
|
|
@@ -3608,7 +3983,7 @@ var BUTTONS = [
|
|
|
3608
3983
|
},
|
|
3609
3984
|
{
|
|
3610
3985
|
label: "Columns",
|
|
3611
|
-
icon: /* @__PURE__ */
|
|
3986
|
+
icon: /* @__PURE__ */ React72.createElement(ViewColumnOutlined, null),
|
|
3612
3987
|
block: () => ({
|
|
3613
3988
|
type: "ColumnsContainer",
|
|
3614
3989
|
data: {
|
|
@@ -3623,7 +3998,7 @@ var BUTTONS = [
|
|
|
3623
3998
|
},
|
|
3624
3999
|
{
|
|
3625
4000
|
label: "Container",
|
|
3626
|
-
icon: /* @__PURE__ */
|
|
4001
|
+
icon: /* @__PURE__ */ React72.createElement(LibraryAddOutlined, null),
|
|
3627
4002
|
block: () => ({
|
|
3628
4003
|
type: "Container",
|
|
3629
4004
|
data: {
|
|
@@ -3647,7 +4022,7 @@ function BlocksMenu({ anchorEl, setAnchorEl, onSelect }) {
|
|
|
3647
4022
|
if (anchorEl === null) {
|
|
3648
4023
|
return null;
|
|
3649
4024
|
}
|
|
3650
|
-
return /* @__PURE__ */
|
|
4025
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3651
4026
|
Menu,
|
|
3652
4027
|
{
|
|
3653
4028
|
open: true,
|
|
@@ -3656,7 +4031,7 @@ function BlocksMenu({ anchorEl, setAnchorEl, onSelect }) {
|
|
|
3656
4031
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
3657
4032
|
transformOrigin: { vertical: "top", horizontal: "center" }
|
|
3658
4033
|
},
|
|
3659
|
-
/* @__PURE__ */
|
|
4034
|
+
/* @__PURE__ */ React72.createElement(Box, { sx: { p: 1, display: "grid", gridTemplateColumns: "1fr 1fr 1fr 1fr" } }, BUTTONS.map((k, i) => /* @__PURE__ */ React72.createElement(BlockTypeButton, { key: i, label: k.label, icon: k.icon, onClick: () => onClick(k.block()) })))
|
|
3660
4035
|
);
|
|
3661
4036
|
}
|
|
3662
4037
|
function DividerButton({ buttonElement, onClick }) {
|
|
@@ -3683,7 +4058,7 @@ function DividerButton({ buttonElement, onClick }) {
|
|
|
3683
4058
|
window.removeEventListener("mousemove", listener);
|
|
3684
4059
|
};
|
|
3685
4060
|
}, [buttonElement, setVisible]);
|
|
3686
|
-
return /* @__PURE__ */
|
|
4061
|
+
return /* @__PURE__ */ React72.createElement(Fade, { in: visible }, /* @__PURE__ */ React72.createElement(
|
|
3687
4062
|
IconButton,
|
|
3688
4063
|
{
|
|
3689
4064
|
size: "small",
|
|
@@ -3706,11 +4081,11 @@ function DividerButton({ buttonElement, onClick }) {
|
|
|
3706
4081
|
onClick();
|
|
3707
4082
|
}
|
|
3708
4083
|
},
|
|
3709
|
-
/* @__PURE__ */
|
|
4084
|
+
/* @__PURE__ */ React72.createElement(AddOutlined, { fontSize: "small" })
|
|
3710
4085
|
));
|
|
3711
4086
|
}
|
|
3712
4087
|
function PlaceholderButton({ onClick }) {
|
|
3713
|
-
return /* @__PURE__ */
|
|
4088
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3714
4089
|
ButtonBase,
|
|
3715
4090
|
{
|
|
3716
4091
|
onClick: (ev) => {
|
|
@@ -3726,7 +4101,7 @@ function PlaceholderButton({ onClick }) {
|
|
|
3726
4101
|
bgcolor: "rgba(0,0,0, 0.05)"
|
|
3727
4102
|
}
|
|
3728
4103
|
},
|
|
3729
|
-
/* @__PURE__ */
|
|
4104
|
+
/* @__PURE__ */ React72.createElement(
|
|
3730
4105
|
AddOutlined,
|
|
3731
4106
|
{
|
|
3732
4107
|
sx: {
|
|
@@ -3750,12 +4125,12 @@ function AddBlockButton({ onSelect, placeholder }) {
|
|
|
3750
4125
|
};
|
|
3751
4126
|
const renderButton2 = () => {
|
|
3752
4127
|
if (placeholder) {
|
|
3753
|
-
return /* @__PURE__ */
|
|
4128
|
+
return /* @__PURE__ */ React72.createElement(PlaceholderButton, { onClick: handleButtonClick });
|
|
3754
4129
|
} else {
|
|
3755
|
-
return /* @__PURE__ */
|
|
4130
|
+
return /* @__PURE__ */ React72.createElement(DividerButton, { buttonElement, onClick: handleButtonClick });
|
|
3756
4131
|
}
|
|
3757
4132
|
};
|
|
3758
|
-
return /* @__PURE__ */
|
|
4133
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement("div", { ref: setButtonElement, style: { position: "relative" } }, renderButton2()), /* @__PURE__ */ React72.createElement(BlocksMenu, { anchorEl: menuAnchorEl, setAnchorEl: setMenuAnchorEl, onSelect }));
|
|
3759
4134
|
}
|
|
3760
4135
|
|
|
3761
4136
|
// src/editor/blocks/helpers/editor-children-ids/index.tsx
|
|
@@ -3782,9 +4157,9 @@ function EditorChildrenIds({ childrenIds, onChange }) {
|
|
|
3782
4157
|
});
|
|
3783
4158
|
};
|
|
3784
4159
|
if (!childrenIds || childrenIds.length === 0) {
|
|
3785
|
-
return /* @__PURE__ */
|
|
4160
|
+
return /* @__PURE__ */ React72.createElement(AddBlockButton, { placeholder: true, onSelect: appendBlock });
|
|
3786
4161
|
}
|
|
3787
|
-
return /* @__PURE__ */
|
|
4162
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, childrenIds.map((childId, i) => /* @__PURE__ */ React72.createElement(Fragment, { key: childId }, /* @__PURE__ */ React72.createElement(AddBlockButton, { onSelect: (block) => insertBlock(block, i) }), /* @__PURE__ */ React72.createElement(EditorBlock, { id: childId }))), /* @__PURE__ */ React72.createElement(AddBlockButton, { onSelect: appendBlock }));
|
|
3788
4163
|
}
|
|
3789
4164
|
|
|
3790
4165
|
// src/editor/blocks/columns-container/columns-container-editor.tsx
|
|
@@ -3811,15 +4186,15 @@ function ColumnsContainerEditor({ style, props }) {
|
|
|
3811
4186
|
});
|
|
3812
4187
|
setSelectedBlockId(blockId);
|
|
3813
4188
|
};
|
|
3814
|
-
return /* @__PURE__ */
|
|
4189
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3815
4190
|
columns_container_default,
|
|
3816
4191
|
{
|
|
3817
4192
|
props: restProps,
|
|
3818
4193
|
style,
|
|
3819
4194
|
columns: [
|
|
3820
|
-
/* @__PURE__ */
|
|
3821
|
-
/* @__PURE__ */
|
|
3822
|
-
/* @__PURE__ */
|
|
4195
|
+
/* @__PURE__ */ React72.createElement(EditorChildrenIds, { childrenIds: (_b = columns == null ? void 0 : columns[0]) == null ? void 0 : _b.childrenIds, onChange: (change) => updateColumn(0, change) }),
|
|
4196
|
+
/* @__PURE__ */ React72.createElement(EditorChildrenIds, { childrenIds: (_c = columns == null ? void 0 : columns[1]) == null ? void 0 : _c.childrenIds, onChange: (change) => updateColumn(1, change) }),
|
|
4197
|
+
/* @__PURE__ */ React72.createElement(EditorChildrenIds, { childrenIds: (_d = columns == null ? void 0 : columns[2]) == null ? void 0 : _d.childrenIds, onChange: (change) => updateColumn(2, change) })
|
|
3823
4198
|
]
|
|
3824
4199
|
}
|
|
3825
4200
|
);
|
|
@@ -3829,7 +4204,7 @@ function ContainerEditor({ style, props }) {
|
|
|
3829
4204
|
const childrenIds = (_a = props == null ? void 0 : props.childrenIds) != null ? _a : [];
|
|
3830
4205
|
const document2 = useDocument();
|
|
3831
4206
|
const currentBlockId = useCurrentBlockId();
|
|
3832
|
-
return /* @__PURE__ */
|
|
4207
|
+
return /* @__PURE__ */ React72.createElement(container_default, { style }, /* @__PURE__ */ React72.createElement(
|
|
3833
4208
|
EditorChildrenIds,
|
|
3834
4209
|
{
|
|
3835
4210
|
childrenIds,
|
|
@@ -3848,7 +4223,65 @@ function ContainerEditor({ style, props }) {
|
|
|
3848
4223
|
}
|
|
3849
4224
|
));
|
|
3850
4225
|
}
|
|
3851
|
-
function
|
|
4226
|
+
function generateId2() {
|
|
4227
|
+
return `block-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
|
|
4228
|
+
}
|
|
4229
|
+
function rekeyBlocks(blocks, rootBlockId) {
|
|
4230
|
+
var _a, _b, _c;
|
|
4231
|
+
const idMap = {};
|
|
4232
|
+
for (const oldId of Object.keys(blocks)) {
|
|
4233
|
+
idMap[oldId] = generateId2();
|
|
4234
|
+
}
|
|
4235
|
+
const remapIds = (ids) => ids == null ? void 0 : ids.map((id) => {
|
|
4236
|
+
var _a2;
|
|
4237
|
+
return (_a2 = idMap[id]) != null ? _a2 : id;
|
|
4238
|
+
});
|
|
4239
|
+
const newBlocks = {};
|
|
4240
|
+
for (const [oldId, block] of Object.entries(blocks)) {
|
|
4241
|
+
const b = block;
|
|
4242
|
+
const newId = idMap[oldId];
|
|
4243
|
+
if (b.type === "Container") {
|
|
4244
|
+
newBlocks[newId] = __spreadProps(__spreadValues({}, b), {
|
|
4245
|
+
data: __spreadProps(__spreadValues({}, b.data), {
|
|
4246
|
+
props: __spreadProps(__spreadValues({}, b.data.props), { childrenIds: remapIds((_a = b.data.props) == null ? void 0 : _a.childrenIds) })
|
|
4247
|
+
})
|
|
4248
|
+
});
|
|
4249
|
+
} else if (b.type === "ColumnsContainer") {
|
|
4250
|
+
newBlocks[newId] = __spreadProps(__spreadValues({}, b), {
|
|
4251
|
+
data: __spreadProps(__spreadValues({}, b.data), {
|
|
4252
|
+
props: __spreadProps(__spreadValues({}, b.data.props), {
|
|
4253
|
+
columns: (_c = (_b = b.data.props) == null ? void 0 : _b.columns) == null ? void 0 : _c.map((c) => __spreadProps(__spreadValues({}, c), {
|
|
4254
|
+
childrenIds: remapIds(c.childrenIds)
|
|
4255
|
+
}))
|
|
4256
|
+
})
|
|
4257
|
+
})
|
|
4258
|
+
});
|
|
4259
|
+
} else {
|
|
4260
|
+
newBlocks[newId] = b;
|
|
4261
|
+
}
|
|
4262
|
+
}
|
|
4263
|
+
return { blocks: newBlocks, newRootId: idMap[rootBlockId] };
|
|
4264
|
+
}
|
|
4265
|
+
function collectBlock(blockId, document2) {
|
|
4266
|
+
var _a, _b, _c, _d, _e;
|
|
4267
|
+
const block = document2[blockId];
|
|
4268
|
+
if (!block) return {};
|
|
4269
|
+
const result = { [blockId]: block };
|
|
4270
|
+
if (block.type === "Container") {
|
|
4271
|
+
for (const childId of (_b = (_a = block.data.props) == null ? void 0 : _a.childrenIds) != null ? _b : []) {
|
|
4272
|
+
Object.assign(result, collectBlock(childId, document2));
|
|
4273
|
+
}
|
|
4274
|
+
}
|
|
4275
|
+
if (block.type === "ColumnsContainer") {
|
|
4276
|
+
for (const col of (_d = (_c = block.data.props) == null ? void 0 : _c.columns) != null ? _d : []) {
|
|
4277
|
+
for (const childId of (_e = col.childrenIds) != null ? _e : []) {
|
|
4278
|
+
Object.assign(result, collectBlock(childId, document2));
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
return result;
|
|
4283
|
+
}
|
|
4284
|
+
function getFontFamily7(fontFamily) {
|
|
3852
4285
|
const f = fontFamily != null ? fontFamily : "MODERN_SANS";
|
|
3853
4286
|
switch (f) {
|
|
3854
4287
|
case "MODERN_SANS":
|
|
@@ -3876,7 +4309,93 @@ function EmailLayoutEditor(props) {
|
|
|
3876
4309
|
const childrenIds = (_a = props.childrenIds) != null ? _a : [];
|
|
3877
4310
|
const document2 = useDocument();
|
|
3878
4311
|
const currentBlockId = useCurrentBlockId();
|
|
3879
|
-
|
|
4312
|
+
const selectedBlockId = useSelectedBlockId();
|
|
4313
|
+
const handleDelete = useCallback((e) => {
|
|
4314
|
+
var _a2, _b2, _c2;
|
|
4315
|
+
if (e.key !== "Delete" && e.key !== "Backspace") return;
|
|
4316
|
+
if (!selectedBlockId) return;
|
|
4317
|
+
const target = e.target;
|
|
4318
|
+
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable) {
|
|
4319
|
+
return;
|
|
4320
|
+
}
|
|
4321
|
+
e.preventDefault();
|
|
4322
|
+
const filterChildrenIds = (ids) => ids == null ? void 0 : ids.filter((id) => id !== selectedBlockId);
|
|
4323
|
+
const nDocument = __spreadValues({}, document2);
|
|
4324
|
+
for (const [id, b] of Object.entries(nDocument)) {
|
|
4325
|
+
const block = b;
|
|
4326
|
+
if (id === selectedBlockId) continue;
|
|
4327
|
+
switch (block.type) {
|
|
4328
|
+
case "EmailLayout":
|
|
4329
|
+
nDocument[id] = __spreadProps(__spreadValues({}, block), { data: __spreadProps(__spreadValues({}, block.data), { childrenIds: filterChildrenIds(block.data.childrenIds) }) });
|
|
4330
|
+
break;
|
|
4331
|
+
case "Container":
|
|
4332
|
+
nDocument[id] = __spreadProps(__spreadValues({}, block), { data: __spreadProps(__spreadValues({}, block.data), { props: __spreadProps(__spreadValues({}, block.data.props), { childrenIds: filterChildrenIds((_a2 = block.data.props) == null ? void 0 : _a2.childrenIds) }) }) });
|
|
4333
|
+
break;
|
|
4334
|
+
case "ColumnsContainer":
|
|
4335
|
+
nDocument[id] = __spreadProps(__spreadValues({}, block), { data: __spreadProps(__spreadValues({}, block.data), { props: __spreadProps(__spreadValues({}, block.data.props), { columns: (_c2 = (_b2 = block.data.props) == null ? void 0 : _b2.columns) == null ? void 0 : _c2.map((c) => __spreadProps(__spreadValues({}, c), { childrenIds: filterChildrenIds(c.childrenIds) })) }) }) });
|
|
4336
|
+
break;
|
|
4337
|
+
default:
|
|
4338
|
+
nDocument[id] = block;
|
|
4339
|
+
}
|
|
4340
|
+
}
|
|
4341
|
+
delete nDocument[selectedBlockId];
|
|
4342
|
+
resetDocument(nDocument);
|
|
4343
|
+
}, [selectedBlockId, document2]);
|
|
4344
|
+
const handleCopy = useCallback((e) => {
|
|
4345
|
+
if (!(e.metaKey || e.ctrlKey) || e.key !== "c") return;
|
|
4346
|
+
if (!selectedBlockId) return;
|
|
4347
|
+
const target = e.target;
|
|
4348
|
+
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable) {
|
|
4349
|
+
return;
|
|
4350
|
+
}
|
|
4351
|
+
const blocks = collectBlock(selectedBlockId, document2);
|
|
4352
|
+
if (Object.keys(blocks).length === 0) return;
|
|
4353
|
+
e.preventDefault();
|
|
4354
|
+
const payload = JSON.stringify({ __emailEditorBlocks: true, rootBlockId: selectedBlockId, blocks });
|
|
4355
|
+
navigator.clipboard.writeText(payload);
|
|
4356
|
+
}, [selectedBlockId, document2]);
|
|
4357
|
+
const handlePaste = useCallback((e) => __async(null, null, function* () {
|
|
4358
|
+
var _a2;
|
|
4359
|
+
const target = e.target;
|
|
4360
|
+
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable) {
|
|
4361
|
+
return;
|
|
4362
|
+
}
|
|
4363
|
+
const text = (_a2 = e.clipboardData) == null ? void 0 : _a2.getData("text/plain");
|
|
4364
|
+
if (!text) return;
|
|
4365
|
+
let parsed;
|
|
4366
|
+
try {
|
|
4367
|
+
parsed = JSON.parse(text);
|
|
4368
|
+
} catch (e2) {
|
|
4369
|
+
return;
|
|
4370
|
+
}
|
|
4371
|
+
if (!(parsed == null ? void 0 : parsed.__emailEditorBlocks) || !parsed.rootBlockId || !parsed.blocks) return;
|
|
4372
|
+
e.preventDefault();
|
|
4373
|
+
const { blocks: newBlocks, newRootId } = rekeyBlocks(parsed.blocks, parsed.rootBlockId);
|
|
4374
|
+
const doc = __spreadValues({}, document2);
|
|
4375
|
+
Object.assign(doc, newBlocks);
|
|
4376
|
+
const currentChildrenIds = [...childrenIds || []];
|
|
4377
|
+
const insertIndex = selectedBlockId ? currentChildrenIds.indexOf(selectedBlockId) + 1 : currentChildrenIds.length;
|
|
4378
|
+
currentChildrenIds.splice(insertIndex, 0, newRootId);
|
|
4379
|
+
doc[currentBlockId] = {
|
|
4380
|
+
type: "EmailLayout",
|
|
4381
|
+
data: __spreadProps(__spreadValues({}, document2[currentBlockId].data), {
|
|
4382
|
+
childrenIds: currentChildrenIds
|
|
4383
|
+
})
|
|
4384
|
+
};
|
|
4385
|
+
resetDocument(doc);
|
|
4386
|
+
setSelectedBlockId(newRootId);
|
|
4387
|
+
}), [document2, childrenIds, selectedBlockId, currentBlockId]);
|
|
4388
|
+
useEffect(() => {
|
|
4389
|
+
window.addEventListener("keydown", handleDelete);
|
|
4390
|
+
window.addEventListener("keydown", handleCopy);
|
|
4391
|
+
window.addEventListener("paste", handlePaste);
|
|
4392
|
+
return () => {
|
|
4393
|
+
window.removeEventListener("keydown", handleDelete);
|
|
4394
|
+
window.removeEventListener("keydown", handleCopy);
|
|
4395
|
+
window.removeEventListener("paste", handlePaste);
|
|
4396
|
+
};
|
|
4397
|
+
}, [handleDelete, handleCopy, handlePaste]);
|
|
4398
|
+
return /* @__PURE__ */ React72.createElement(
|
|
3880
4399
|
"div",
|
|
3881
4400
|
{
|
|
3882
4401
|
onClick: () => {
|
|
@@ -3885,7 +4404,7 @@ function EmailLayoutEditor(props) {
|
|
|
3885
4404
|
style: {
|
|
3886
4405
|
backgroundColor: (_b = props.backdropColor) != null ? _b : "#F5F5F5",
|
|
3887
4406
|
color: (_c = props.textColor) != null ? _c : "#262626",
|
|
3888
|
-
fontFamily:
|
|
4407
|
+
fontFamily: getFontFamily7(props.fontFamily),
|
|
3889
4408
|
fontSize: "16px",
|
|
3890
4409
|
fontWeight: "400",
|
|
3891
4410
|
letterSpacing: "0.15008px",
|
|
@@ -3896,7 +4415,7 @@ function EmailLayoutEditor(props) {
|
|
|
3896
4415
|
minHeight: "100%"
|
|
3897
4416
|
}
|
|
3898
4417
|
},
|
|
3899
|
-
/* @__PURE__ */
|
|
4418
|
+
/* @__PURE__ */ React72.createElement(
|
|
3900
4419
|
"table",
|
|
3901
4420
|
{
|
|
3902
4421
|
align: "center",
|
|
@@ -3919,7 +4438,7 @@ function EmailLayoutEditor(props) {
|
|
|
3919
4438
|
cellPadding: "0",
|
|
3920
4439
|
border: 0
|
|
3921
4440
|
},
|
|
3922
|
-
/* @__PURE__ */
|
|
4441
|
+
/* @__PURE__ */ React72.createElement("tbody", null, /* @__PURE__ */ React72.createElement("tr", { style: { width: "100%" } }, /* @__PURE__ */ React72.createElement("td", null, /* @__PURE__ */ React72.createElement(
|
|
3923
4442
|
EditorChildrenIds,
|
|
3924
4443
|
{
|
|
3925
4444
|
childrenIds,
|
|
@@ -3949,6 +4468,33 @@ var sx = {
|
|
|
3949
4468
|
paddingY: 1,
|
|
3950
4469
|
zIndex: "fab"
|
|
3951
4470
|
};
|
|
4471
|
+
function collectBlock2(blockId, document2) {
|
|
4472
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4473
|
+
const block = document2[blockId];
|
|
4474
|
+
if (!block) return {};
|
|
4475
|
+
const result = { [blockId]: block };
|
|
4476
|
+
if (block.type === "Container") {
|
|
4477
|
+
const childrenIds = (_b = (_a = block.data.props) == null ? void 0 : _a.childrenIds) != null ? _b : [];
|
|
4478
|
+
for (const childId of childrenIds) {
|
|
4479
|
+
Object.assign(result, collectBlock2(childId, document2));
|
|
4480
|
+
}
|
|
4481
|
+
}
|
|
4482
|
+
if (block.type === "ColumnsContainer") {
|
|
4483
|
+
const columns = (_d = (_c = block.data.props) == null ? void 0 : _c.columns) != null ? _d : [];
|
|
4484
|
+
for (const col of columns) {
|
|
4485
|
+
for (const childId of (_e = col.childrenIds) != null ? _e : []) {
|
|
4486
|
+
Object.assign(result, collectBlock2(childId, document2));
|
|
4487
|
+
}
|
|
4488
|
+
}
|
|
4489
|
+
}
|
|
4490
|
+
if (block.type === "EmailLayout") {
|
|
4491
|
+
const childrenIds = (_f = block.data.childrenIds) != null ? _f : [];
|
|
4492
|
+
for (const childId of childrenIds) {
|
|
4493
|
+
Object.assign(result, collectBlock2(childId, document2));
|
|
4494
|
+
}
|
|
4495
|
+
}
|
|
4496
|
+
return result;
|
|
4497
|
+
}
|
|
3952
4498
|
function TuneMenu({ blockId }) {
|
|
3953
4499
|
const document2 = useDocument();
|
|
3954
4500
|
const handleDeleteClick = () => {
|
|
@@ -4002,6 +4548,11 @@ function TuneMenu({ blockId }) {
|
|
|
4002
4548
|
delete nDocument[blockId];
|
|
4003
4549
|
resetDocument(nDocument);
|
|
4004
4550
|
};
|
|
4551
|
+
const handleCopyClick = () => {
|
|
4552
|
+
const blocks = collectBlock2(blockId, document2);
|
|
4553
|
+
const payload = JSON.stringify({ __emailEditorBlocks: true, rootBlockId: blockId, blocks });
|
|
4554
|
+
navigator.clipboard.writeText(payload);
|
|
4555
|
+
};
|
|
4005
4556
|
const handleMoveClick = (direction) => {
|
|
4006
4557
|
var _a, _b, _c;
|
|
4007
4558
|
const moveChildrenIds = (ids) => {
|
|
@@ -4063,7 +4614,7 @@ function TuneMenu({ blockId }) {
|
|
|
4063
4614
|
resetDocument(nDocument);
|
|
4064
4615
|
setSelectedBlockId(blockId);
|
|
4065
4616
|
};
|
|
4066
|
-
return /* @__PURE__ */
|
|
4617
|
+
return /* @__PURE__ */ React72.createElement(Paper, { sx, onClick: (ev) => ev.stopPropagation() }, /* @__PURE__ */ React72.createElement(Stack, null, /* @__PURE__ */ React72.createElement(Tooltip, { title: "Move up", placement: "left-start" }, /* @__PURE__ */ React72.createElement(IconButton, { onClick: () => handleMoveClick("up"), sx: { color: "text.primary" } }, /* @__PURE__ */ React72.createElement(ArrowUpwardOutlined, { fontSize: "small" }))), /* @__PURE__ */ React72.createElement(Tooltip, { title: "Move down", placement: "left-start" }, /* @__PURE__ */ React72.createElement(IconButton, { onClick: () => handleMoveClick("down"), sx: { color: "text.primary" } }, /* @__PURE__ */ React72.createElement(ArrowDownwardOutlined, { fontSize: "small" }))), /* @__PURE__ */ React72.createElement(Tooltip, { title: "Copy block", placement: "left-start" }, /* @__PURE__ */ React72.createElement(IconButton, { onClick: handleCopyClick, sx: { color: "text.primary" } }, /* @__PURE__ */ React72.createElement(ContentCopyOutlined, { fontSize: "small" }))), /* @__PURE__ */ React72.createElement(Tooltip, { title: "Delete", placement: "left-start" }, /* @__PURE__ */ React72.createElement(IconButton, { onClick: handleDeleteClick, sx: { color: "text.primary" } }, /* @__PURE__ */ React72.createElement(DeleteOutlined, { fontSize: "small" })))));
|
|
4067
4618
|
}
|
|
4068
4619
|
|
|
4069
4620
|
// src/editor/blocks/helpers/block-wrappers/editor-block-wrapper.tsx
|
|
@@ -4081,9 +4632,9 @@ function EditorBlockWrapper({ children }) {
|
|
|
4081
4632
|
if (selectedBlockId !== blockId) {
|
|
4082
4633
|
return null;
|
|
4083
4634
|
}
|
|
4084
|
-
return /* @__PURE__ */
|
|
4635
|
+
return /* @__PURE__ */ React72.createElement(TuneMenu, { blockId });
|
|
4085
4636
|
};
|
|
4086
|
-
return /* @__PURE__ */
|
|
4637
|
+
return /* @__PURE__ */ React72.createElement(
|
|
4087
4638
|
Box,
|
|
4088
4639
|
{
|
|
4089
4640
|
sx: {
|
|
@@ -4102,14 +4653,131 @@ function EditorBlockWrapper({ children }) {
|
|
|
4102
4653
|
onClick: (ev) => {
|
|
4103
4654
|
setSelectedBlockId(blockId);
|
|
4104
4655
|
ev.stopPropagation();
|
|
4105
|
-
ev.preventDefault();
|
|
4106
4656
|
}
|
|
4107
4657
|
},
|
|
4108
4658
|
renderMenu(),
|
|
4109
4659
|
children
|
|
4110
4660
|
);
|
|
4111
4661
|
}
|
|
4112
|
-
function
|
|
4662
|
+
function getFontFamily8(fontFamily) {
|
|
4663
|
+
switch (fontFamily) {
|
|
4664
|
+
case "MODERN_SANS":
|
|
4665
|
+
return '"Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif';
|
|
4666
|
+
case "BOOK_SANS":
|
|
4667
|
+
return 'Optima, Candara, "Noto Sans", source-sans-pro, sans-serif';
|
|
4668
|
+
case "ORGANIC_SANS":
|
|
4669
|
+
return 'Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif';
|
|
4670
|
+
case "GEOMETRIC_SANS":
|
|
4671
|
+
return 'Avenir, "Avenir Next LT Pro", Montserrat, Corbel, "URW Gothic", source-sans-pro, sans-serif';
|
|
4672
|
+
case "HEAVY_SANS":
|
|
4673
|
+
return 'Bahnschrift, "DIN Alternate", "Franklin Gothic Medium", "Nimbus Sans Narrow", sans-serif-condensed, sans-serif';
|
|
4674
|
+
case "ROUNDED_SANS":
|
|
4675
|
+
return 'ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, Comfortaa, Manjari, "Arial Rounded MT Bold", Calibri, source-sans-pro, sans-serif';
|
|
4676
|
+
case "MODERN_SERIF":
|
|
4677
|
+
return 'Charter, "Bitstream Charter", "Sitka Text", Cambria, serif';
|
|
4678
|
+
case "BOOK_SERIF":
|
|
4679
|
+
return '"Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif';
|
|
4680
|
+
case "MONOSPACE":
|
|
4681
|
+
return '"Nimbus Mono PS", "Courier New", "Cutive Mono", monospace';
|
|
4682
|
+
}
|
|
4683
|
+
return void 0;
|
|
4684
|
+
}
|
|
4685
|
+
var getPadding11 = (padding) => padding ? `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px` : void 0;
|
|
4686
|
+
function getRoundedCorners2(props) {
|
|
4687
|
+
var _a;
|
|
4688
|
+
const buttonStyle = (_a = props == null ? void 0 : props.buttonStyle) != null ? _a : ButtonPropsDefaults.buttonStyle;
|
|
4689
|
+
switch (buttonStyle) {
|
|
4690
|
+
case "rectangle":
|
|
4691
|
+
return void 0;
|
|
4692
|
+
case "pill":
|
|
4693
|
+
return 64;
|
|
4694
|
+
case "rounded":
|
|
4695
|
+
default:
|
|
4696
|
+
return 4;
|
|
4697
|
+
}
|
|
4698
|
+
}
|
|
4699
|
+
function getButtonSizePadding2(props) {
|
|
4700
|
+
var _a;
|
|
4701
|
+
const size = (_a = props == null ? void 0 : props.size) != null ? _a : ButtonPropsDefaults.size;
|
|
4702
|
+
switch (size) {
|
|
4703
|
+
case "x-small":
|
|
4704
|
+
return [4, 8];
|
|
4705
|
+
case "small":
|
|
4706
|
+
return [8, 12];
|
|
4707
|
+
case "large":
|
|
4708
|
+
return [16, 32];
|
|
4709
|
+
case "medium":
|
|
4710
|
+
default:
|
|
4711
|
+
return [12, 20];
|
|
4712
|
+
}
|
|
4713
|
+
}
|
|
4714
|
+
function ButtonEditor({ style, props }) {
|
|
4715
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4716
|
+
const blockId = useCurrentBlockId();
|
|
4717
|
+
const selectedBlockId = useSelectedBlockId();
|
|
4718
|
+
const isSelected = selectedBlockId === blockId;
|
|
4719
|
+
const text = (_a = props == null ? void 0 : props.text) != null ? _a : ButtonPropsDefaults.text;
|
|
4720
|
+
const fullWidth = (_b = props == null ? void 0 : props.fullWidth) != null ? _b : ButtonPropsDefaults.fullWidth;
|
|
4721
|
+
const buttonTextColor = (_c = props == null ? void 0 : props.buttonTextColor) != null ? _c : ButtonPropsDefaults.buttonTextColor;
|
|
4722
|
+
const buttonBackgroundColor = (_d = props == null ? void 0 : props.buttonBackgroundColor) != null ? _d : ButtonPropsDefaults.buttonBackgroundColor;
|
|
4723
|
+
const [localText, setLocalText] = useState(text);
|
|
4724
|
+
useEffect(() => {
|
|
4725
|
+
setLocalText(text);
|
|
4726
|
+
}, [text]);
|
|
4727
|
+
const padding = getButtonSizePadding2(props);
|
|
4728
|
+
const wrapperStyle = {
|
|
4729
|
+
backgroundColor: (_e = style == null ? void 0 : style.backgroundColor) != null ? _e : void 0,
|
|
4730
|
+
textAlign: (_f = style == null ? void 0 : style.textAlign) != null ? _f : void 0,
|
|
4731
|
+
padding: getPadding11(style == null ? void 0 : style.padding)
|
|
4732
|
+
};
|
|
4733
|
+
const linkStyle = {
|
|
4734
|
+
color: buttonTextColor,
|
|
4735
|
+
fontSize: (_g = style == null ? void 0 : style.fontSize) != null ? _g : 16,
|
|
4736
|
+
fontFamily: getFontFamily8(style == null ? void 0 : style.fontFamily),
|
|
4737
|
+
fontWeight: (_h = style == null ? void 0 : style.fontWeight) != null ? _h : "bold",
|
|
4738
|
+
backgroundColor: buttonBackgroundColor,
|
|
4739
|
+
borderRadius: getRoundedCorners2(props),
|
|
4740
|
+
display: fullWidth ? "block" : "inline-block",
|
|
4741
|
+
padding: `${padding[0]}px ${padding[1]}px`,
|
|
4742
|
+
textDecoration: "none"
|
|
4743
|
+
};
|
|
4744
|
+
const handleTextChange = (e) => {
|
|
4745
|
+
const newText = e.target.value;
|
|
4746
|
+
setLocalText(newText);
|
|
4747
|
+
setDocument({
|
|
4748
|
+
[blockId]: {
|
|
4749
|
+
type: "Button",
|
|
4750
|
+
data: {
|
|
4751
|
+
style,
|
|
4752
|
+
props: __spreadProps(__spreadValues({}, props), {
|
|
4753
|
+
text: newText
|
|
4754
|
+
})
|
|
4755
|
+
}
|
|
4756
|
+
}
|
|
4757
|
+
});
|
|
4758
|
+
};
|
|
4759
|
+
if (isSelected) {
|
|
4760
|
+
const inputStyle = __spreadProps(__spreadValues({}, linkStyle), {
|
|
4761
|
+
border: "none",
|
|
4762
|
+
outline: "none",
|
|
4763
|
+
cursor: "text",
|
|
4764
|
+
width: fullWidth ? "100%" : void 0,
|
|
4765
|
+
textAlign: "center"
|
|
4766
|
+
});
|
|
4767
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wrapperStyle }, /* @__PURE__ */ React72.createElement(
|
|
4768
|
+
"input",
|
|
4769
|
+
{
|
|
4770
|
+
type: "text",
|
|
4771
|
+
value: localText,
|
|
4772
|
+
onChange: handleTextChange,
|
|
4773
|
+
style: inputStyle,
|
|
4774
|
+
onClick: (e) => e.stopPropagation()
|
|
4775
|
+
}
|
|
4776
|
+
));
|
|
4777
|
+
}
|
|
4778
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wrapperStyle }, /* @__PURE__ */ React72.createElement("span", { style: linkStyle }, /* @__PURE__ */ React72.createElement("span", null, text)));
|
|
4779
|
+
}
|
|
4780
|
+
function getFontFamily9(fontFamily) {
|
|
4113
4781
|
switch (fontFamily) {
|
|
4114
4782
|
case "MODERN_SANS":
|
|
4115
4783
|
return '"Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif';
|
|
@@ -4136,7 +4804,7 @@ function getFontFamily7(fontFamily) {
|
|
|
4136
4804
|
}
|
|
4137
4805
|
return void 0;
|
|
4138
4806
|
}
|
|
4139
|
-
function
|
|
4807
|
+
function getPadding12(padding) {
|
|
4140
4808
|
if (!padding) return void 0;
|
|
4141
4809
|
if (typeof padding === "object" && !Array.isArray(padding) && "top" in padding && "right" in padding && "bottom" in padding && "left" in padding) {
|
|
4142
4810
|
return `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;
|
|
@@ -4180,11 +4848,11 @@ function HeadingEditor({ style, props }) {
|
|
|
4180
4848
|
const textContent = (_b = props == null ? void 0 : props.text) != null ? _b : HeadingPropsDefaults.text;
|
|
4181
4849
|
const [localText, setLocalText] = useState(textContent);
|
|
4182
4850
|
const rootBlock = document2.root;
|
|
4183
|
-
const rootFontFamily = rootBlock && rootBlock.type === "EmailLayout" ?
|
|
4851
|
+
const rootFontFamily = rootBlock && rootBlock.type === "EmailLayout" ? getFontFamily9(rootBlock.data.fontFamily) : '"Helvetica Neue", Arial, sans-serif';
|
|
4184
4852
|
useEffect(() => {
|
|
4185
4853
|
setLocalText(textContent);
|
|
4186
4854
|
}, [textContent]);
|
|
4187
|
-
const fontFamily =
|
|
4855
|
+
const fontFamily = getFontFamily9(style == null ? void 0 : style.fontFamily) || rootFontFamily;
|
|
4188
4856
|
const hStyle = {
|
|
4189
4857
|
color: (_c = style == null ? void 0 : style.color) != null ? _c : void 0,
|
|
4190
4858
|
backgroundColor: (_d = style == null ? void 0 : style.backgroundColor) != null ? _d : void 0,
|
|
@@ -4193,7 +4861,7 @@ function HeadingEditor({ style, props }) {
|
|
|
4193
4861
|
margin: 0,
|
|
4194
4862
|
fontFamily,
|
|
4195
4863
|
fontSize: getFontSize2(level),
|
|
4196
|
-
padding:
|
|
4864
|
+
padding: getPadding12(style == null ? void 0 : style.padding),
|
|
4197
4865
|
width: "100%",
|
|
4198
4866
|
minHeight: "1em"
|
|
4199
4867
|
};
|
|
@@ -4230,7 +4898,7 @@ function HeadingEditor({ style, props }) {
|
|
|
4230
4898
|
}
|
|
4231
4899
|
};
|
|
4232
4900
|
if (isSelected) {
|
|
4233
|
-
return /* @__PURE__ */
|
|
4901
|
+
return /* @__PURE__ */ React72.createElement(
|
|
4234
4902
|
"textarea",
|
|
4235
4903
|
{
|
|
4236
4904
|
value: localText,
|
|
@@ -4245,14 +4913,310 @@ function HeadingEditor({ style, props }) {
|
|
|
4245
4913
|
}
|
|
4246
4914
|
switch (level) {
|
|
4247
4915
|
case "h1":
|
|
4248
|
-
return /* @__PURE__ */
|
|
4916
|
+
return /* @__PURE__ */ React72.createElement("h1", { style: hStyle }, textContent);
|
|
4249
4917
|
case "h2":
|
|
4250
|
-
return /* @__PURE__ */
|
|
4918
|
+
return /* @__PURE__ */ React72.createElement("h2", { style: hStyle }, textContent);
|
|
4251
4919
|
case "h3":
|
|
4252
|
-
return /* @__PURE__ */
|
|
4920
|
+
return /* @__PURE__ */ React72.createElement("h3", { style: hStyle }, textContent);
|
|
4253
4921
|
}
|
|
4254
4922
|
}
|
|
4255
|
-
function
|
|
4923
|
+
function HtmlEditor({ style, props }) {
|
|
4924
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4925
|
+
const blockId = useCurrentBlockId();
|
|
4926
|
+
const selectedBlockId = useSelectedBlockId();
|
|
4927
|
+
const isSelected = selectedBlockId === blockId;
|
|
4928
|
+
const contents = (_a = props == null ? void 0 : props.contents) != null ? _a : "";
|
|
4929
|
+
const [localContents, setLocalContents] = useState(contents);
|
|
4930
|
+
useEffect(() => {
|
|
4931
|
+
setLocalContents(contents);
|
|
4932
|
+
}, [contents]);
|
|
4933
|
+
const cssStyle = {
|
|
4934
|
+
color: (_b = style == null ? void 0 : style.color) != null ? _b : void 0,
|
|
4935
|
+
backgroundColor: (_c = style == null ? void 0 : style.backgroundColor) != null ? _c : void 0,
|
|
4936
|
+
fontSize: (_d = style == null ? void 0 : style.fontSize) != null ? _d : void 0,
|
|
4937
|
+
textAlign: (_e = style == null ? void 0 : style.textAlign) != null ? _e : void 0,
|
|
4938
|
+
padding: (style == null ? void 0 : style.padding) ? `${style.padding.top}px ${style.padding.right}px ${style.padding.bottom}px ${style.padding.left}px` : void 0
|
|
4939
|
+
};
|
|
4940
|
+
const handleChange = (e) => {
|
|
4941
|
+
const newContents = e.target.value;
|
|
4942
|
+
setLocalContents(newContents);
|
|
4943
|
+
setDocument({
|
|
4944
|
+
[blockId]: {
|
|
4945
|
+
type: "Html",
|
|
4946
|
+
data: {
|
|
4947
|
+
style,
|
|
4948
|
+
props: __spreadProps(__spreadValues({}, props), {
|
|
4949
|
+
contents: newContents
|
|
4950
|
+
})
|
|
4951
|
+
}
|
|
4952
|
+
}
|
|
4953
|
+
});
|
|
4954
|
+
};
|
|
4955
|
+
const adjustTextareaHeight = (element) => {
|
|
4956
|
+
if (element) {
|
|
4957
|
+
element.style.height = "auto";
|
|
4958
|
+
element.style.height = `${element.scrollHeight}px`;
|
|
4959
|
+
}
|
|
4960
|
+
};
|
|
4961
|
+
if (isSelected) {
|
|
4962
|
+
const textareaStyle = __spreadProps(__spreadValues({}, cssStyle), {
|
|
4963
|
+
fontFamily: '"Nimbus Mono PS", "Courier New", monospace',
|
|
4964
|
+
fontSize: 13,
|
|
4965
|
+
color: (_f = cssStyle.color) != null ? _f : "#333",
|
|
4966
|
+
border: "none",
|
|
4967
|
+
outline: "none",
|
|
4968
|
+
resize: "none",
|
|
4969
|
+
overflow: "hidden",
|
|
4970
|
+
width: "100%",
|
|
4971
|
+
display: "block",
|
|
4972
|
+
margin: 0,
|
|
4973
|
+
backgroundColor: "transparent"
|
|
4974
|
+
});
|
|
4975
|
+
return /* @__PURE__ */ React72.createElement("div", { style: cssStyle }, /* @__PURE__ */ React72.createElement(
|
|
4976
|
+
"textarea",
|
|
4977
|
+
{
|
|
4978
|
+
value: localContents,
|
|
4979
|
+
onChange: handleChange,
|
|
4980
|
+
style: textareaStyle,
|
|
4981
|
+
rows: 3,
|
|
4982
|
+
onInput: (e) => adjustTextareaHeight(e.target),
|
|
4983
|
+
ref: (el) => el && adjustTextareaHeight(el),
|
|
4984
|
+
onClick: (e) => e.stopPropagation()
|
|
4985
|
+
}
|
|
4986
|
+
));
|
|
4987
|
+
}
|
|
4988
|
+
if (!contents) {
|
|
4989
|
+
return /* @__PURE__ */ React72.createElement("div", { style: cssStyle });
|
|
4990
|
+
}
|
|
4991
|
+
return /* @__PURE__ */ React72.createElement("div", { style: cssStyle, dangerouslySetInnerHTML: { __html: contents } });
|
|
4992
|
+
}
|
|
4993
|
+
function getImageBorderRadius2(shape, size) {
|
|
4994
|
+
switch (shape) {
|
|
4995
|
+
case "circle":
|
|
4996
|
+
return size;
|
|
4997
|
+
case "rounded":
|
|
4998
|
+
return size * 0.125;
|
|
4999
|
+
case "square":
|
|
5000
|
+
default:
|
|
5001
|
+
return void 0;
|
|
5002
|
+
}
|
|
5003
|
+
}
|
|
5004
|
+
function SignatureEditor({ style, props }) {
|
|
5005
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
5006
|
+
const blockId = useCurrentBlockId();
|
|
5007
|
+
const selectedBlockId = useSelectedBlockId();
|
|
5008
|
+
const isSelected = selectedBlockId === blockId;
|
|
5009
|
+
const greeting = (_a = props == null ? void 0 : props.greeting) != null ? _a : SignaturePropsDefaults.greeting;
|
|
5010
|
+
const name = (_b = props == null ? void 0 : props.name) != null ? _b : SignaturePropsDefaults.name;
|
|
5011
|
+
const title = (_c = props == null ? void 0 : props.title) != null ? _c : SignaturePropsDefaults.title;
|
|
5012
|
+
const company = (_d = props == null ? void 0 : props.company) != null ? _d : SignaturePropsDefaults.company;
|
|
5013
|
+
const address = (_e = props == null ? void 0 : props.address) != null ? _e : SignaturePropsDefaults.address;
|
|
5014
|
+
const email = (_f = props == null ? void 0 : props.email) != null ? _f : SignaturePropsDefaults.email;
|
|
5015
|
+
const phone = (_g = props == null ? void 0 : props.phone) != null ? _g : SignaturePropsDefaults.phone;
|
|
5016
|
+
const website = (_h = props == null ? void 0 : props.website) != null ? _h : SignaturePropsDefaults.website;
|
|
5017
|
+
const imageUrl = (_i = props == null ? void 0 : props.imageUrl) != null ? _i : SignaturePropsDefaults.imageUrl;
|
|
5018
|
+
const imageSize = (_j = props == null ? void 0 : props.imageSize) != null ? _j : SignaturePropsDefaults.imageSize;
|
|
5019
|
+
const imageShape = (_k = props == null ? void 0 : props.imageShape) != null ? _k : SignaturePropsDefaults.imageShape;
|
|
5020
|
+
const layout = (_l = props == null ? void 0 : props.layout) != null ? _l : SignaturePropsDefaults.layout;
|
|
5021
|
+
const nameColor = (_m = props == null ? void 0 : props.nameColor) != null ? _m : SignaturePropsDefaults.nameColor;
|
|
5022
|
+
const textColor = (_n = props == null ? void 0 : props.textColor) != null ? _n : SignaturePropsDefaults.textColor;
|
|
5023
|
+
const linkColor = (_o = props == null ? void 0 : props.linkColor) != null ? _o : SignaturePropsDefaults.linkColor;
|
|
5024
|
+
const [localGreeting, setLocalGreeting] = useState(greeting);
|
|
5025
|
+
const [localName, setLocalName] = useState(name);
|
|
5026
|
+
const [localTitle, setLocalTitle] = useState(title);
|
|
5027
|
+
const [localCompany, setLocalCompany] = useState(company);
|
|
5028
|
+
const [localAddress, setLocalAddress] = useState(address);
|
|
5029
|
+
const [localEmail, setLocalEmail] = useState(email);
|
|
5030
|
+
const [localPhone, setLocalPhone] = useState(phone);
|
|
5031
|
+
const [localWebsite, setLocalWebsite] = useState(website);
|
|
5032
|
+
useEffect(() => {
|
|
5033
|
+
setLocalGreeting(greeting);
|
|
5034
|
+
}, [greeting]);
|
|
5035
|
+
useEffect(() => {
|
|
5036
|
+
setLocalName(name);
|
|
5037
|
+
}, [name]);
|
|
5038
|
+
useEffect(() => {
|
|
5039
|
+
setLocalTitle(title);
|
|
5040
|
+
}, [title]);
|
|
5041
|
+
useEffect(() => {
|
|
5042
|
+
setLocalCompany(company);
|
|
5043
|
+
}, [company]);
|
|
5044
|
+
useEffect(() => {
|
|
5045
|
+
setLocalAddress(address);
|
|
5046
|
+
}, [address]);
|
|
5047
|
+
useEffect(() => {
|
|
5048
|
+
setLocalEmail(email);
|
|
5049
|
+
}, [email]);
|
|
5050
|
+
useEffect(() => {
|
|
5051
|
+
setLocalPhone(phone);
|
|
5052
|
+
}, [phone]);
|
|
5053
|
+
useEffect(() => {
|
|
5054
|
+
setLocalWebsite(website);
|
|
5055
|
+
}, [website]);
|
|
5056
|
+
const updateProps = (updates) => {
|
|
5057
|
+
setDocument({
|
|
5058
|
+
[blockId]: {
|
|
5059
|
+
type: "Signature",
|
|
5060
|
+
data: {
|
|
5061
|
+
style,
|
|
5062
|
+
props: __spreadValues(__spreadValues({}, props), updates)
|
|
5063
|
+
}
|
|
5064
|
+
}
|
|
5065
|
+
});
|
|
5066
|
+
};
|
|
5067
|
+
const greetingStyle = {
|
|
5068
|
+
fontSize: 14,
|
|
5069
|
+
color: textColor,
|
|
5070
|
+
margin: 0,
|
|
5071
|
+
marginBottom: 8,
|
|
5072
|
+
lineHeight: "1.4",
|
|
5073
|
+
fontStyle: "italic"
|
|
5074
|
+
};
|
|
5075
|
+
const nameStyle = {
|
|
5076
|
+
fontSize: 16,
|
|
5077
|
+
fontWeight: "bold",
|
|
5078
|
+
color: nameColor,
|
|
5079
|
+
margin: 0,
|
|
5080
|
+
lineHeight: "1.4"
|
|
5081
|
+
};
|
|
5082
|
+
const detailStyle = {
|
|
5083
|
+
fontSize: 14,
|
|
5084
|
+
color: textColor,
|
|
5085
|
+
margin: 0,
|
|
5086
|
+
lineHeight: "1.4"
|
|
5087
|
+
};
|
|
5088
|
+
const linkStyle = {
|
|
5089
|
+
fontSize: 14,
|
|
5090
|
+
color: linkColor,
|
|
5091
|
+
textDecoration: "none"
|
|
5092
|
+
};
|
|
5093
|
+
const inputBase = {
|
|
5094
|
+
border: "none",
|
|
5095
|
+
outline: "none",
|
|
5096
|
+
backgroundColor: "transparent",
|
|
5097
|
+
width: "100%",
|
|
5098
|
+
padding: 0,
|
|
5099
|
+
margin: 0,
|
|
5100
|
+
fontFamily: "inherit"
|
|
5101
|
+
};
|
|
5102
|
+
const wrapperStyle = {
|
|
5103
|
+
backgroundColor: (_p = style == null ? void 0 : style.backgroundColor) != null ? _p : void 0,
|
|
5104
|
+
padding: (style == null ? void 0 : style.padding) ? `${style.padding.top}px ${style.padding.right}px ${style.padding.bottom}px ${style.padding.left}px` : void 0
|
|
5105
|
+
};
|
|
5106
|
+
const imageElement = imageUrl ? /* @__PURE__ */ React72.createElement(
|
|
5107
|
+
"img",
|
|
5108
|
+
{
|
|
5109
|
+
src: imageUrl,
|
|
5110
|
+
alt: name || company,
|
|
5111
|
+
width: imageSize,
|
|
5112
|
+
height: imageSize,
|
|
5113
|
+
style: {
|
|
5114
|
+
width: imageSize,
|
|
5115
|
+
height: imageSize,
|
|
5116
|
+
objectFit: "cover",
|
|
5117
|
+
borderRadius: getImageBorderRadius2(imageShape, imageSize),
|
|
5118
|
+
display: "block",
|
|
5119
|
+
outline: "none",
|
|
5120
|
+
border: "none"
|
|
5121
|
+
}
|
|
5122
|
+
}
|
|
5123
|
+
) : null;
|
|
5124
|
+
const greetingElement = isSelected ? /* @__PURE__ */ React72.createElement("div", { onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React72.createElement(
|
|
5125
|
+
"input",
|
|
5126
|
+
{
|
|
5127
|
+
value: localGreeting,
|
|
5128
|
+
onChange: (e) => {
|
|
5129
|
+
setLocalGreeting(e.target.value);
|
|
5130
|
+
updateProps({ greeting: e.target.value });
|
|
5131
|
+
},
|
|
5132
|
+
placeholder: "Greeting (e.g. Best regards,)",
|
|
5133
|
+
style: __spreadValues(__spreadValues({}, inputBase), greetingStyle)
|
|
5134
|
+
}
|
|
5135
|
+
)) : greeting ? /* @__PURE__ */ React72.createElement("p", { style: greetingStyle }, greeting) : null;
|
|
5136
|
+
const textContent = isSelected ? /* @__PURE__ */ React72.createElement("div", { onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React72.createElement(
|
|
5137
|
+
"input",
|
|
5138
|
+
{
|
|
5139
|
+
value: localName,
|
|
5140
|
+
onChange: (e) => {
|
|
5141
|
+
setLocalName(e.target.value);
|
|
5142
|
+
updateProps({ name: e.target.value });
|
|
5143
|
+
},
|
|
5144
|
+
placeholder: "Name",
|
|
5145
|
+
style: __spreadValues(__spreadValues({}, inputBase), nameStyle)
|
|
5146
|
+
}
|
|
5147
|
+
), /* @__PURE__ */ React72.createElement(
|
|
5148
|
+
"input",
|
|
5149
|
+
{
|
|
5150
|
+
value: localTitle,
|
|
5151
|
+
onChange: (e) => {
|
|
5152
|
+
setLocalTitle(e.target.value);
|
|
5153
|
+
updateProps({ title: e.target.value });
|
|
5154
|
+
},
|
|
5155
|
+
placeholder: "Title",
|
|
5156
|
+
style: __spreadValues(__spreadValues({}, inputBase), detailStyle)
|
|
5157
|
+
}
|
|
5158
|
+
), /* @__PURE__ */ React72.createElement(
|
|
5159
|
+
"input",
|
|
5160
|
+
{
|
|
5161
|
+
value: localCompany,
|
|
5162
|
+
onChange: (e) => {
|
|
5163
|
+
setLocalCompany(e.target.value);
|
|
5164
|
+
updateProps({ company: e.target.value });
|
|
5165
|
+
},
|
|
5166
|
+
placeholder: "Company",
|
|
5167
|
+
style: __spreadValues(__spreadValues({}, inputBase), detailStyle)
|
|
5168
|
+
}
|
|
5169
|
+
), /* @__PURE__ */ React72.createElement(
|
|
5170
|
+
"input",
|
|
5171
|
+
{
|
|
5172
|
+
value: localAddress,
|
|
5173
|
+
onChange: (e) => {
|
|
5174
|
+
setLocalAddress(e.target.value);
|
|
5175
|
+
updateProps({ address: e.target.value });
|
|
5176
|
+
},
|
|
5177
|
+
placeholder: "Address",
|
|
5178
|
+
style: __spreadValues(__spreadValues({}, inputBase), detailStyle)
|
|
5179
|
+
}
|
|
5180
|
+
), /* @__PURE__ */ React72.createElement(
|
|
5181
|
+
"input",
|
|
5182
|
+
{
|
|
5183
|
+
value: localEmail,
|
|
5184
|
+
onChange: (e) => {
|
|
5185
|
+
setLocalEmail(e.target.value);
|
|
5186
|
+
updateProps({ email: e.target.value });
|
|
5187
|
+
},
|
|
5188
|
+
placeholder: "Email",
|
|
5189
|
+
style: __spreadProps(__spreadValues(__spreadValues({}, inputBase), linkStyle), { marginTop: 4, display: "block" })
|
|
5190
|
+
}
|
|
5191
|
+
), /* @__PURE__ */ React72.createElement(
|
|
5192
|
+
"input",
|
|
5193
|
+
{
|
|
5194
|
+
value: localPhone,
|
|
5195
|
+
onChange: (e) => {
|
|
5196
|
+
setLocalPhone(e.target.value);
|
|
5197
|
+
updateProps({ phone: e.target.value });
|
|
5198
|
+
},
|
|
5199
|
+
placeholder: "Phone",
|
|
5200
|
+
style: __spreadProps(__spreadValues(__spreadValues({}, inputBase), linkStyle), { display: "block" })
|
|
5201
|
+
}
|
|
5202
|
+
), /* @__PURE__ */ React72.createElement(
|
|
5203
|
+
"input",
|
|
5204
|
+
{
|
|
5205
|
+
value: localWebsite,
|
|
5206
|
+
onChange: (e) => {
|
|
5207
|
+
setLocalWebsite(e.target.value);
|
|
5208
|
+
updateProps({ website: e.target.value });
|
|
5209
|
+
},
|
|
5210
|
+
placeholder: "Website",
|
|
5211
|
+
style: __spreadProps(__spreadValues(__spreadValues({}, inputBase), linkStyle), { display: "block" })
|
|
5212
|
+
}
|
|
5213
|
+
)) : /* @__PURE__ */ React72.createElement("div", null, name && /* @__PURE__ */ React72.createElement("p", { style: nameStyle }, name), title && /* @__PURE__ */ React72.createElement("p", { style: detailStyle }, title), company && /* @__PURE__ */ React72.createElement("p", { style: detailStyle }, company), address && /* @__PURE__ */ React72.createElement("p", { style: detailStyle }, address), (email || phone || website) && /* @__PURE__ */ React72.createElement("p", { style: __spreadProps(__spreadValues({}, detailStyle), { marginTop: 4 }) }, email && /* @__PURE__ */ React72.createElement("span", { style: linkStyle }, email), email && (phone || website) && /* @__PURE__ */ React72.createElement("span", { style: detailStyle }, " \xB7 "), phone && /* @__PURE__ */ React72.createElement("span", { style: linkStyle }, phone), phone && website && /* @__PURE__ */ React72.createElement("span", { style: detailStyle }, " \xB7 "), website && /* @__PURE__ */ React72.createElement("span", { style: linkStyle }, website)), !name && !title && !company && !email && !phone && !website && /* @__PURE__ */ React72.createElement("p", { style: detailStyle }, "Click to edit signature"));
|
|
5214
|
+
if (layout === "vertical") {
|
|
5215
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wrapperStyle }, greetingElement, imageElement && /* @__PURE__ */ React72.createElement("div", { style: { marginBottom: 12 } }, imageElement), textContent);
|
|
5216
|
+
}
|
|
5217
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wrapperStyle }, greetingElement, /* @__PURE__ */ React72.createElement("table", { cellPadding: "0", cellSpacing: "0", border: 0, role: "presentation" }, /* @__PURE__ */ React72.createElement("tbody", null, /* @__PURE__ */ React72.createElement("tr", null, imageElement && /* @__PURE__ */ React72.createElement("td", { style: { verticalAlign: "middle", paddingRight: 16 } }, imageElement), /* @__PURE__ */ React72.createElement("td", { style: { verticalAlign: "middle" } }, textContent)))));
|
|
5218
|
+
}
|
|
5219
|
+
function getFontFamily10(fontFamily) {
|
|
4256
5220
|
switch (fontFamily) {
|
|
4257
5221
|
case "MODERN_SANS":
|
|
4258
5222
|
return '"Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif';
|
|
@@ -4279,7 +5243,7 @@ function getFontFamily8(fontFamily) {
|
|
|
4279
5243
|
}
|
|
4280
5244
|
return void 0;
|
|
4281
5245
|
}
|
|
4282
|
-
function
|
|
5246
|
+
function getPadding13(padding) {
|
|
4283
5247
|
if (!padding) return void 0;
|
|
4284
5248
|
if (typeof padding === "object" && !Array.isArray(padding) && "top" in padding && "right" in padding && "bottom" in padding && "left" in padding) {
|
|
4285
5249
|
return `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;
|
|
@@ -4313,11 +5277,11 @@ function TextEditor({ style, props }) {
|
|
|
4313
5277
|
const [localText, setLocalText] = useState(textContent);
|
|
4314
5278
|
const isMarkdown = (_b = props == null ? void 0 : props.markdown) != null ? _b : false;
|
|
4315
5279
|
const rootBlock = document2.root;
|
|
4316
|
-
const rootFontFamily = rootBlock && rootBlock.type === "EmailLayout" ?
|
|
5280
|
+
const rootFontFamily = rootBlock && rootBlock.type === "EmailLayout" ? getFontFamily10(rootBlock.data.fontFamily) : '"Helvetica Neue", Arial, sans-serif';
|
|
4317
5281
|
useEffect(() => {
|
|
4318
5282
|
setLocalText(textContent);
|
|
4319
5283
|
}, [textContent]);
|
|
4320
|
-
const fontFamily =
|
|
5284
|
+
const fontFamily = getFontFamily10(style == null ? void 0 : style.fontFamily) || rootFontFamily;
|
|
4321
5285
|
const wStyle = {
|
|
4322
5286
|
color: (_c = style == null ? void 0 : style.color) != null ? _c : void 0,
|
|
4323
5287
|
backgroundColor: (_d = style == null ? void 0 : style.backgroundColor) != null ? _d : void 0,
|
|
@@ -4325,7 +5289,7 @@ function TextEditor({ style, props }) {
|
|
|
4325
5289
|
fontFamily,
|
|
4326
5290
|
fontWeight: (_f = style == null ? void 0 : style.fontWeight) != null ? _f : void 0,
|
|
4327
5291
|
textAlign: (_g = style == null ? void 0 : style.textAlign) != null ? _g : void 0,
|
|
4328
|
-
padding:
|
|
5292
|
+
padding: getPadding13(style == null ? void 0 : style.padding),
|
|
4329
5293
|
width: "100%",
|
|
4330
5294
|
minHeight: "1em"
|
|
4331
5295
|
};
|
|
@@ -4365,7 +5329,7 @@ function TextEditor({ style, props }) {
|
|
|
4365
5329
|
}
|
|
4366
5330
|
};
|
|
4367
5331
|
if (isSelected && !isMarkdown) {
|
|
4368
|
-
return /* @__PURE__ */
|
|
5332
|
+
return /* @__PURE__ */ React72.createElement(
|
|
4369
5333
|
"textarea",
|
|
4370
5334
|
{
|
|
4371
5335
|
value: localText,
|
|
@@ -4379,36 +5343,36 @@ function TextEditor({ style, props }) {
|
|
|
4379
5343
|
);
|
|
4380
5344
|
}
|
|
4381
5345
|
if (isMarkdown) {
|
|
4382
|
-
return /* @__PURE__ */
|
|
5346
|
+
return /* @__PURE__ */ React72.createElement(EmailMarkdown, { style: wStyle, markdown: textContent });
|
|
4383
5347
|
}
|
|
4384
|
-
return /* @__PURE__ */
|
|
5348
|
+
return /* @__PURE__ */ React72.createElement("div", { style: wStyle }, textContent);
|
|
4385
5349
|
}
|
|
4386
5350
|
|
|
4387
5351
|
// src/editor/core.tsx
|
|
4388
5352
|
var EDITOR_DICTIONARY = buildBlockConfigurationDictionary({
|
|
4389
5353
|
Avatar: {
|
|
4390
5354
|
schema: AvatarPropsSchema,
|
|
4391
|
-
Component: (props) => /* @__PURE__ */
|
|
5355
|
+
Component: (props) => /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(avatar_default, __spreadValues({}, props)))
|
|
4392
5356
|
},
|
|
4393
5357
|
Button: {
|
|
4394
5358
|
schema: ButtonPropsSchema,
|
|
4395
|
-
Component: (props) => /* @__PURE__ */
|
|
5359
|
+
Component: (props) => /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(ButtonEditor, __spreadValues({}, props)))
|
|
4396
5360
|
},
|
|
4397
5361
|
Container: {
|
|
4398
5362
|
schema: container_props_schema_default,
|
|
4399
|
-
Component: (props) => /* @__PURE__ */
|
|
5363
|
+
Component: (props) => /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(ContainerEditor, __spreadValues({}, props)))
|
|
4400
5364
|
},
|
|
4401
5365
|
ColumnsContainer: {
|
|
4402
5366
|
schema: columns_container_props_schema_default2,
|
|
4403
|
-
Component: (props) => /* @__PURE__ */
|
|
5367
|
+
Component: (props) => /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(ColumnsContainerEditor, __spreadValues({}, props)))
|
|
4404
5368
|
},
|
|
4405
5369
|
Heading: {
|
|
4406
5370
|
schema: HeadingPropsSchema,
|
|
4407
|
-
Component: (props) => /* @__PURE__ */
|
|
5371
|
+
Component: (props) => /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(HeadingEditor, __spreadValues({}, props)))
|
|
4408
5372
|
},
|
|
4409
5373
|
Html: {
|
|
4410
5374
|
schema: HtmlPropsSchema,
|
|
4411
|
-
Component: (props) => /* @__PURE__ */
|
|
5375
|
+
Component: (props) => /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(HtmlEditor, __spreadValues({}, props)))
|
|
4412
5376
|
},
|
|
4413
5377
|
Image: {
|
|
4414
5378
|
schema: ImagePropsSchema,
|
|
@@ -4416,27 +5380,32 @@ var EDITOR_DICTIONARY = buildBlockConfigurationDictionary({
|
|
|
4416
5380
|
var _a, _b;
|
|
4417
5381
|
const props = __spreadProps(__spreadValues({}, data), {
|
|
4418
5382
|
props: __spreadProps(__spreadValues({}, data.props), {
|
|
4419
|
-
url: (_b = (_a = data.props) == null ? void 0 : _a.url) != null ? _b : "https://placehold.co/600x400@2x/F8F8F8/CCC?text=Your%20image"
|
|
5383
|
+
url: (_b = (_a = data.props) == null ? void 0 : _a.url) != null ? _b : "https://placehold.co/600x400@2x/F8F8F8/CCC?text=Your%20image",
|
|
5384
|
+
linkHref: null
|
|
4420
5385
|
})
|
|
4421
5386
|
});
|
|
4422
|
-
return /* @__PURE__ */
|
|
5387
|
+
return /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(image_default, __spreadValues({}, props)));
|
|
4423
5388
|
}
|
|
4424
5389
|
},
|
|
4425
5390
|
Text: {
|
|
4426
5391
|
schema: TextPropsSchema,
|
|
4427
|
-
Component: (props) => /* @__PURE__ */
|
|
5392
|
+
Component: (props) => /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(TextEditor, __spreadValues({}, props)))
|
|
4428
5393
|
},
|
|
4429
5394
|
EmailLayout: {
|
|
4430
5395
|
schema: email_layout_props_schema_default,
|
|
4431
|
-
Component: (p) => /* @__PURE__ */
|
|
5396
|
+
Component: (p) => /* @__PURE__ */ React72.createElement(EmailLayoutEditor, __spreadValues({}, p))
|
|
4432
5397
|
},
|
|
4433
5398
|
Spacer: {
|
|
4434
5399
|
schema: SpacerPropsSchema,
|
|
4435
|
-
Component: (props) => /* @__PURE__ */
|
|
5400
|
+
Component: (props) => /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(spacer_default, __spreadValues({}, props)))
|
|
4436
5401
|
},
|
|
4437
5402
|
Divider: {
|
|
4438
5403
|
schema: DividerPropsSchema,
|
|
4439
|
-
Component: (props) => /* @__PURE__ */
|
|
5404
|
+
Component: (props) => /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(divider_default, __spreadValues({}, props)))
|
|
5405
|
+
},
|
|
5406
|
+
Signature: {
|
|
5407
|
+
schema: SignaturePropsSchema,
|
|
5408
|
+
Component: (props) => /* @__PURE__ */ React72.createElement(EditorBlockWrapper, null, /* @__PURE__ */ React72.createElement(SignatureEditor, __spreadValues({}, props)))
|
|
4440
5409
|
}
|
|
4441
5410
|
});
|
|
4442
5411
|
var EditorBlock2 = buildBlockComponent(EDITOR_DICTIONARY);
|
|
@@ -4452,7 +5421,7 @@ function EditorBlock({ id }) {
|
|
|
4452
5421
|
if (!block) {
|
|
4453
5422
|
throw new Error("Could not find block");
|
|
4454
5423
|
}
|
|
4455
|
-
return /* @__PURE__ */
|
|
5424
|
+
return /* @__PURE__ */ React72.createElement(EditorBlockContext.Provider, { value: id }, /* @__PURE__ */ React72.createElement(EditorBlock2, __spreadValues({}, block)));
|
|
4456
5425
|
}
|
|
4457
5426
|
function ToggleInspectorPanelButton() {
|
|
4458
5427
|
const inspectorDrawerOpen = useInspectorDrawerOpen();
|
|
@@ -4460,20 +5429,20 @@ function ToggleInspectorPanelButton() {
|
|
|
4460
5429
|
toggleInspectorDrawerOpen();
|
|
4461
5430
|
};
|
|
4462
5431
|
if (inspectorDrawerOpen) {
|
|
4463
|
-
return /* @__PURE__ */
|
|
5432
|
+
return /* @__PURE__ */ React72.createElement(IconButton, { onClick: handleClick }, /* @__PURE__ */ React72.createElement(LastPageOutlined, { fontSize: "small" }));
|
|
4464
5433
|
}
|
|
4465
|
-
return /* @__PURE__ */
|
|
5434
|
+
return /* @__PURE__ */ React72.createElement(IconButton, { onClick: handleClick }, /* @__PURE__ */ React72.createElement(AppRegistrationOutlined, { fontSize: "small" }));
|
|
4466
5435
|
}
|
|
4467
5436
|
function useIcon() {
|
|
4468
5437
|
const samplesDrawerOpen = useSamplesDrawerOpen();
|
|
4469
5438
|
if (samplesDrawerOpen) {
|
|
4470
|
-
return /* @__PURE__ */
|
|
5439
|
+
return /* @__PURE__ */ React72.createElement(FirstPageOutlined, { fontSize: "small" });
|
|
4471
5440
|
}
|
|
4472
|
-
return /* @__PURE__ */
|
|
5441
|
+
return /* @__PURE__ */ React72.createElement(MenuOutlined, { fontSize: "small" });
|
|
4473
5442
|
}
|
|
4474
5443
|
function ToggleSamplesPanelButton() {
|
|
4475
5444
|
const icon = useIcon();
|
|
4476
|
-
return /* @__PURE__ */
|
|
5445
|
+
return /* @__PURE__ */ React72.createElement(IconButton, { onClick: toggleSamplesDrawerOpen }, icon);
|
|
4477
5446
|
}
|
|
4478
5447
|
function formatHtml(html2, spaces = 2) {
|
|
4479
5448
|
try {
|
|
@@ -4535,7 +5504,7 @@ function HighlightedCodePanel({ type, value }) {
|
|
|
4535
5504
|
if (code === null) {
|
|
4536
5505
|
return null;
|
|
4537
5506
|
}
|
|
4538
|
-
return /* @__PURE__ */
|
|
5507
|
+
return /* @__PURE__ */ React72.createElement(
|
|
4539
5508
|
"pre",
|
|
4540
5509
|
{
|
|
4541
5510
|
style: {
|
|
@@ -4561,17 +5530,17 @@ function HighlightedCodePanel({ type, value }) {
|
|
|
4561
5530
|
function HtmlPanel() {
|
|
4562
5531
|
const document2 = useDocument();
|
|
4563
5532
|
const code = useMemo(() => renderToStaticMarkup(document2, { rootBlockId: "root" }), [document2]);
|
|
4564
|
-
return /* @__PURE__ */
|
|
5533
|
+
return /* @__PURE__ */ React72.createElement(HighlightedCodePanel, { type: "html", value: code });
|
|
4565
5534
|
}
|
|
4566
5535
|
function JsonPanel() {
|
|
4567
5536
|
const document2 = useDocument();
|
|
4568
5537
|
const code = useMemo(() => JSON.stringify(document2, null, " "), [document2]);
|
|
4569
|
-
return /* @__PURE__ */
|
|
5538
|
+
return /* @__PURE__ */ React72.createElement(HighlightedCodePanel, { type: "json", value: code });
|
|
4570
5539
|
}
|
|
4571
5540
|
function TextPanel() {
|
|
4572
5541
|
const document2 = useDocument();
|
|
4573
5542
|
const text = useMemo(() => renderToText(document2, { rootBlockId: "root" }), [document2]);
|
|
4574
|
-
return /* @__PURE__ */
|
|
5543
|
+
return /* @__PURE__ */ React72.createElement(
|
|
4575
5544
|
"pre",
|
|
4576
5545
|
{
|
|
4577
5546
|
style: {
|
|
@@ -4607,35 +5576,35 @@ function MainTabsGroup() {
|
|
|
4607
5576
|
setSelectedMainTab("editor");
|
|
4608
5577
|
}
|
|
4609
5578
|
};
|
|
4610
|
-
return /* @__PURE__ */
|
|
5579
|
+
return /* @__PURE__ */ React72.createElement(Tabs, { value: selectedMainTab, onChange: handleChange }, /* @__PURE__ */ React72.createElement(
|
|
4611
5580
|
Tab,
|
|
4612
5581
|
{
|
|
4613
5582
|
value: "editor",
|
|
4614
|
-
label: /* @__PURE__ */
|
|
5583
|
+
label: /* @__PURE__ */ React72.createElement(Tooltip, { title: "Edit" }, /* @__PURE__ */ React72.createElement(EditOutlined, { fontSize: "small" }))
|
|
4615
5584
|
}
|
|
4616
|
-
), /* @__PURE__ */
|
|
5585
|
+
), /* @__PURE__ */ React72.createElement(
|
|
4617
5586
|
Tab,
|
|
4618
5587
|
{
|
|
4619
5588
|
value: "preview",
|
|
4620
|
-
label: /* @__PURE__ */
|
|
5589
|
+
label: /* @__PURE__ */ React72.createElement(Tooltip, { title: "Preview" }, /* @__PURE__ */ React72.createElement(PreviewOutlined, { fontSize: "small" }))
|
|
4621
5590
|
}
|
|
4622
|
-
), /* @__PURE__ */
|
|
5591
|
+
), /* @__PURE__ */ React72.createElement(
|
|
4623
5592
|
Tab,
|
|
4624
5593
|
{
|
|
4625
5594
|
value: "html",
|
|
4626
|
-
label: /* @__PURE__ */
|
|
5595
|
+
label: /* @__PURE__ */ React72.createElement(Tooltip, { title: "HTML output" }, /* @__PURE__ */ React72.createElement(CodeOutlined, { fontSize: "small" }))
|
|
4627
5596
|
}
|
|
4628
|
-
), /* @__PURE__ */
|
|
5597
|
+
), /* @__PURE__ */ React72.createElement(
|
|
4629
5598
|
Tab,
|
|
4630
5599
|
{
|
|
4631
5600
|
value: "text",
|
|
4632
|
-
label: /* @__PURE__ */
|
|
5601
|
+
label: /* @__PURE__ */ React72.createElement(Tooltip, { title: "Plain text output" }, /* @__PURE__ */ React72.createElement(SubjectOutlined, { fontSize: "small" }))
|
|
4633
5602
|
}
|
|
4634
|
-
), /* @__PURE__ */
|
|
5603
|
+
), /* @__PURE__ */ React72.createElement(
|
|
4635
5604
|
Tab,
|
|
4636
5605
|
{
|
|
4637
5606
|
value: "json",
|
|
4638
|
-
label: /* @__PURE__ */
|
|
5607
|
+
label: /* @__PURE__ */ React72.createElement(Tooltip, { title: "JSON output" }, /* @__PURE__ */ React72.createElement(DataObjectOutlined, { fontSize: "small" }))
|
|
4639
5608
|
}
|
|
4640
5609
|
));
|
|
4641
5610
|
}
|
|
@@ -4657,7 +5626,7 @@ function SnackbarProvider({ children }) {
|
|
|
4657
5626
|
const handleClose = () => {
|
|
4658
5627
|
setMessage(null);
|
|
4659
5628
|
};
|
|
4660
|
-
return /* @__PURE__ */
|
|
5629
|
+
return /* @__PURE__ */ React72.createElement(SnackbarContext.Provider, { value: { showMessage } }, children, /* @__PURE__ */ React72.createElement(
|
|
4661
5630
|
Snackbar,
|
|
4662
5631
|
{
|
|
4663
5632
|
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
@@ -4733,7 +5702,7 @@ function SaveTemplateDialog({
|
|
|
4733
5702
|
setInternalError("");
|
|
4734
5703
|
onClose();
|
|
4735
5704
|
};
|
|
4736
|
-
return /* @__PURE__ */
|
|
5705
|
+
return /* @__PURE__ */ React72.createElement(
|
|
4737
5706
|
Dialog,
|
|
4738
5707
|
{
|
|
4739
5708
|
open,
|
|
@@ -4741,8 +5710,8 @@ function SaveTemplateDialog({
|
|
|
4741
5710
|
maxWidth: "sm",
|
|
4742
5711
|
fullWidth: true
|
|
4743
5712
|
},
|
|
4744
|
-
/* @__PURE__ */
|
|
4745
|
-
/* @__PURE__ */
|
|
5713
|
+
/* @__PURE__ */ React72.createElement(DialogTitle, null, "Save Email Template"),
|
|
5714
|
+
/* @__PURE__ */ React72.createElement(DialogContent, null, /* @__PURE__ */ React72.createElement(Box, { sx: { pt: 1 } }, /* @__PURE__ */ React72.createElement(
|
|
4746
5715
|
TextField,
|
|
4747
5716
|
{
|
|
4748
5717
|
autoFocus: true,
|
|
@@ -4764,7 +5733,7 @@ function SaveTemplateDialog({
|
|
|
4764
5733
|
disabled: isSubmitting
|
|
4765
5734
|
}
|
|
4766
5735
|
))),
|
|
4767
|
-
/* @__PURE__ */
|
|
5736
|
+
/* @__PURE__ */ React72.createElement(DialogActions, null, /* @__PURE__ */ React72.createElement(Button$1, { onClick: handleCancel, disabled: isSubmitting }, "Cancel"), /* @__PURE__ */ React72.createElement(
|
|
4768
5737
|
Button$1,
|
|
4769
5738
|
{
|
|
4770
5739
|
onClick: handleSave,
|
|
@@ -4819,7 +5788,7 @@ function SaveButton({ loadTemplates, saveAs }) {
|
|
|
4819
5788
|
return false;
|
|
4820
5789
|
}
|
|
4821
5790
|
});
|
|
4822
|
-
return /* @__PURE__ */
|
|
5791
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(
|
|
4823
5792
|
IconButton,
|
|
4824
5793
|
{
|
|
4825
5794
|
onClick: handleSave,
|
|
@@ -4830,8 +5799,8 @@ function SaveButton({ loadTemplates, saveAs }) {
|
|
|
4830
5799
|
}
|
|
4831
5800
|
}
|
|
4832
5801
|
},
|
|
4833
|
-
/* @__PURE__ */
|
|
4834
|
-
), /* @__PURE__ */
|
|
5802
|
+
/* @__PURE__ */ React72.createElement(Tooltip, { title: "Save template" }, /* @__PURE__ */ React72.createElement(SaveOutlined, { fontSize: "small" }))
|
|
5803
|
+
), /* @__PURE__ */ React72.createElement(
|
|
4835
5804
|
SaveTemplateDialog,
|
|
4836
5805
|
{
|
|
4837
5806
|
open: saveDialogOpen,
|
|
@@ -4901,7 +5870,7 @@ function NewTemplateButton({ loadTemplates, saveAs }) {
|
|
|
4901
5870
|
}
|
|
4902
5871
|
return false;
|
|
4903
5872
|
});
|
|
4904
|
-
return /* @__PURE__ */
|
|
5873
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(
|
|
4905
5874
|
IconButton,
|
|
4906
5875
|
{
|
|
4907
5876
|
onClick: handleNewTemplate,
|
|
@@ -4912,8 +5881,8 @@ function NewTemplateButton({ loadTemplates, saveAs }) {
|
|
|
4912
5881
|
}
|
|
4913
5882
|
}
|
|
4914
5883
|
},
|
|
4915
|
-
/* @__PURE__ */
|
|
4916
|
-
), /* @__PURE__ */
|
|
5884
|
+
/* @__PURE__ */ React72.createElement(Tooltip, { title: "New template" }, /* @__PURE__ */ React72.createElement(Add, { fontSize: "small" }))
|
|
5885
|
+
), /* @__PURE__ */ React72.createElement(
|
|
4917
5886
|
SaveTemplateDialog,
|
|
4918
5887
|
{
|
|
4919
5888
|
open: saveDialogOpen,
|
|
@@ -4930,7 +5899,7 @@ function NewTemplateButton({ loadTemplates, saveAs }) {
|
|
|
4930
5899
|
}
|
|
4931
5900
|
|
|
4932
5901
|
// src/app/email-canvas/index.tsx
|
|
4933
|
-
function TemplatePanel2({ loadTemplates, saveAs }) {
|
|
5902
|
+
function TemplatePanel2({ loadTemplates, saveAs, samplesDrawerEnabled = true }) {
|
|
4934
5903
|
const document2 = useDocument();
|
|
4935
5904
|
const selectedMainTab = useSelectedMainTab();
|
|
4936
5905
|
const selectedScreenSize = useSelectedScreenSize();
|
|
@@ -4960,19 +5929,19 @@ function TemplatePanel2({ loadTemplates, saveAs }) {
|
|
|
4960
5929
|
const renderMainPanel = () => {
|
|
4961
5930
|
switch (selectedMainTab) {
|
|
4962
5931
|
case "editor":
|
|
4963
|
-
return /* @__PURE__ */
|
|
5932
|
+
return /* @__PURE__ */ React72.createElement(Box, { sx: mainBoxSx }, /* @__PURE__ */ React72.createElement(EditorBlock, { id: "root" }));
|
|
4964
5933
|
case "preview":
|
|
4965
|
-
return /* @__PURE__ */
|
|
5934
|
+
return /* @__PURE__ */ React72.createElement(Box, { sx: mainBoxSx }, /* @__PURE__ */ React72.createElement(Reader, { document: document2, rootBlockId: "root" }));
|
|
4966
5935
|
case "html":
|
|
4967
|
-
return /* @__PURE__ */
|
|
5936
|
+
return /* @__PURE__ */ React72.createElement(HtmlPanel, null);
|
|
4968
5937
|
case "text":
|
|
4969
|
-
return /* @__PURE__ */
|
|
5938
|
+
return /* @__PURE__ */ React72.createElement(TextPanel, null);
|
|
4970
5939
|
case "json":
|
|
4971
|
-
return /* @__PURE__ */
|
|
5940
|
+
return /* @__PURE__ */ React72.createElement(JsonPanel, null);
|
|
4972
5941
|
}
|
|
4973
5942
|
};
|
|
4974
5943
|
const showSaveButtons = persistenceEnabled;
|
|
4975
|
-
return /* @__PURE__ */
|
|
5944
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(
|
|
4976
5945
|
Stack,
|
|
4977
5946
|
{
|
|
4978
5947
|
sx: {
|
|
@@ -4989,10 +5958,10 @@ function TemplatePanel2({ loadTemplates, saveAs }) {
|
|
|
4989
5958
|
justifyContent: "space-between",
|
|
4990
5959
|
alignItems: "center"
|
|
4991
5960
|
},
|
|
4992
|
-
/* @__PURE__ */
|
|
4993
|
-
/* @__PURE__ */
|
|
4994
|
-
/* @__PURE__ */
|
|
4995
|
-
), /* @__PURE__ */
|
|
5961
|
+
samplesDrawerEnabled && /* @__PURE__ */ React72.createElement(ToggleSamplesPanelButton, null),
|
|
5962
|
+
/* @__PURE__ */ React72.createElement(Stack, { px: 2, direction: "row", gap: 2, width: "100%", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React72.createElement(Stack, { direction: "row", spacing: 2 }, /* @__PURE__ */ React72.createElement(MainTabsGroup, null)), /* @__PURE__ */ React72.createElement(Stack, { direction: "row", spacing: 2 }, /* @__PURE__ */ React72.createElement(ToggleButtonGroup, { value: selectedScreenSize, exclusive: true, size: "small", onChange: handleScreenSizeChange }, /* @__PURE__ */ React72.createElement(ToggleButton, { value: "desktop" }, /* @__PURE__ */ React72.createElement(Tooltip, { title: "Desktop view" }, /* @__PURE__ */ React72.createElement(MonitorOutlined, { fontSize: "small" }))), /* @__PURE__ */ React72.createElement(ToggleButton, { value: "mobile" }, /* @__PURE__ */ React72.createElement(Tooltip, { title: "Mobile view" }, /* @__PURE__ */ React72.createElement(PhoneIphoneOutlined, { fontSize: "small" })))), showSaveButtons && /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(NewTemplateButton, { loadTemplates, saveAs }), /* @__PURE__ */ React72.createElement(SaveButton, { loadTemplates, saveAs })))),
|
|
5963
|
+
/* @__PURE__ */ React72.createElement(ToggleInspectorPanelButton, null)
|
|
5964
|
+
), /* @__PURE__ */ React72.createElement(Box, { sx: {
|
|
4996
5965
|
paddingBottom: "50px",
|
|
4997
5966
|
minWidth: 370
|
|
4998
5967
|
} }, renderMainPanel()));
|
|
@@ -5074,7 +6043,7 @@ var EmailEditorInternal = forwardRef((props, ref) => {
|
|
|
5074
6043
|
return getDocument();
|
|
5075
6044
|
}
|
|
5076
6045
|
}));
|
|
5077
|
-
return /* @__PURE__ */
|
|
6046
|
+
return /* @__PURE__ */ React72.createElement(Stack, { position: "relative", id: "drawer-container", sx: { minHeight } }, /* @__PURE__ */ React72.createElement(
|
|
5078
6047
|
InspectorDrawer,
|
|
5079
6048
|
{
|
|
5080
6049
|
enterDuration: drawerEnterDuration,
|
|
@@ -5082,7 +6051,7 @@ var EmailEditorInternal = forwardRef((props, ref) => {
|
|
|
5082
6051
|
deleteTemplate,
|
|
5083
6052
|
copyTemplate
|
|
5084
6053
|
}
|
|
5085
|
-
), /* @__PURE__ */
|
|
6054
|
+
), /* @__PURE__ */ React72.createElement(
|
|
5086
6055
|
SamplesDrawer,
|
|
5087
6056
|
{
|
|
5088
6057
|
enterDuration: drawerEnterDuration,
|
|
@@ -5094,7 +6063,7 @@ var EmailEditorInternal = forwardRef((props, ref) => {
|
|
|
5094
6063
|
currentTemplateId,
|
|
5095
6064
|
deleteTemplate
|
|
5096
6065
|
}
|
|
5097
|
-
), /* @__PURE__ */
|
|
6066
|
+
), /* @__PURE__ */ React72.createElement(
|
|
5098
6067
|
Stack,
|
|
5099
6068
|
{
|
|
5100
6069
|
sx: {
|
|
@@ -5103,7 +6072,7 @@ var EmailEditorInternal = forwardRef((props, ref) => {
|
|
|
5103
6072
|
transition: [marginLeftTransition, marginRightTransition].join(", ")
|
|
5104
6073
|
}
|
|
5105
6074
|
},
|
|
5106
|
-
/* @__PURE__ */
|
|
6075
|
+
/* @__PURE__ */ React72.createElement(TemplatePanel2, { loadTemplates, saveAs, samplesDrawerEnabled })
|
|
5107
6076
|
));
|
|
5108
6077
|
});
|
|
5109
6078
|
var EmailEditor = forwardRef((props, ref) => {
|
|
@@ -5138,7 +6107,7 @@ var EmailEditor = forwardRef((props, ref) => {
|
|
|
5138
6107
|
useEffect(() => {
|
|
5139
6108
|
setPersistenceEnabled(persistenceEnabled);
|
|
5140
6109
|
}, [persistenceEnabled]);
|
|
5141
|
-
return /* @__PURE__ */
|
|
6110
|
+
return /* @__PURE__ */ React72.createElement(ThemeProvider, { theme: theme || theme_default }, /* @__PURE__ */ React72.createElement(CssBaseline, null), /* @__PURE__ */ React72.createElement("div", { style: { height: "100%", overflow: "auto" } }, /* @__PURE__ */ React72.createElement(SnackbarProvider, null, /* @__PURE__ */ React72.createElement(
|
|
5142
6111
|
EmailEditorProvider,
|
|
5143
6112
|
{
|
|
5144
6113
|
initialTemplate: resolvedTemplate,
|
|
@@ -5147,7 +6116,7 @@ var EmailEditor = forwardRef((props, ref) => {
|
|
|
5147
6116
|
onSave,
|
|
5148
6117
|
onChange
|
|
5149
6118
|
},
|
|
5150
|
-
/* @__PURE__ */
|
|
6119
|
+
/* @__PURE__ */ React72.createElement(
|
|
5151
6120
|
EmailEditorInternal,
|
|
5152
6121
|
{
|
|
5153
6122
|
ref,
|
|
@@ -5169,6 +6138,6 @@ var EmailEditor = forwardRef((props, ref) => {
|
|
|
5169
6138
|
EmailEditor.displayName = "EmailEditor";
|
|
5170
6139
|
EmailEditorInternal.displayName = "EmailEditorInternal";
|
|
5171
6140
|
|
|
5172
|
-
export { avatar_default as Avatar, AvatarProps, AvatarPropsDefaults, AvatarPropsSchema, BlockConfiguration, button_default as Button, ButtonProps, ButtonPropsDefaults, ButtonPropsSchema, columns_container_default as ColumnsContainer, ColumnsContainerProps, ColumnsContainerPropsSchema, ColumnsContainerReader, container_default as Container, ContainerProps, ContainerPropsSchema, ContainerReader, divider_default as Divider, DividerProps, DividerPropsDefaults, DividerPropsSchema, DocumentBlocksDictionary, EmailEditor, EmailEditorProvider, EmailLayoutPropsSchema, EmailLayoutReader, EmailMarkdown, heading_default as Heading, HeadingProps, HeadingPropsDefaults, HeadingPropsSchema, html_default as Html, HtmlProps, HtmlPropsSchema, image_default as Image, ImageProps, ImagePropsSchema, Reader, ReaderBlock, ReaderBlockSchema, ReaderDocumentSchema, spacer_default as Spacer, SpacerProps, SpacerPropsDefaults, SpacerPropsSchema, Text, TextProps, TextPropsDefaults, TextPropsSchema, buildBlockComponent, buildBlockConfigurationDictionary, buildBlockConfigurationSchema, htmlToEditorConfig, renderToStaticMarkup, renderToText, theme_default as theme, useEmailEditor };
|
|
6141
|
+
export { avatar_default as Avatar, AvatarProps, AvatarPropsDefaults, AvatarPropsSchema, BlockConfiguration, button_default as Button, ButtonProps, ButtonPropsDefaults, ButtonPropsSchema, columns_container_default as ColumnsContainer, ColumnsContainerProps, ColumnsContainerPropsSchema, ColumnsContainerReader, container_default as Container, ContainerProps, ContainerPropsSchema, ContainerReader, divider_default as Divider, DividerProps, DividerPropsDefaults, DividerPropsSchema, DocumentBlocksDictionary, EmailEditor, EmailEditorProvider, EmailLayoutPropsSchema, EmailLayoutReader, EmailMarkdown, heading_default as Heading, HeadingProps, HeadingPropsDefaults, HeadingPropsSchema, html_default as Html, HtmlProps, HtmlPropsSchema, image_default as Image, ImageProps, ImagePropsSchema, Reader, ReaderBlock, ReaderBlockSchema, ReaderDocumentSchema, signature_default as Signature, SignatureProps, SignaturePropsDefaults, SignaturePropsSchema, spacer_default as Spacer, SpacerProps, SpacerPropsDefaults, SpacerPropsSchema, Text, TextProps, TextPropsDefaults, TextPropsSchema, buildBlockComponent, buildBlockConfigurationDictionary, buildBlockConfigurationSchema, htmlToEditorConfig, renderToStaticMarkup, renderToText, theme_default as theme, useEmailEditor };
|
|
5173
6142
|
//# sourceMappingURL=index.js.map
|
|
5174
6143
|
//# sourceMappingURL=index.js.map
|