easy-email-pro-theme 1.51.1 → 1.51.3
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/lib/index.js
CHANGED
|
@@ -62,8 +62,8 @@ import { NodeUtils, BlockManager, ElementType, EditorCore, t, ElementCategory, c
|
|
|
62
62
|
import { cloneDeep, get, isEqual, set, omit as omit$2, merge as merge$1, debounce as debounce$2, isUndefined as isUndefined$1, uniqueId, isString as isString$1, isFunction as isFunction$4, isNumber as isNumber$1, upperFirst, sum, flatMap } from "lodash";
|
|
63
63
|
import { Editor, Range, Node, Transforms, Path, Text as Text$2, createEditor } from "slate";
|
|
64
64
|
import { nanoid } from "nanoid";
|
|
65
|
-
import { Form, Input, Modal, Collapse, Space, Empty, Card, Grid, Button as Button$2, Drawer, Switch, Typography as Typography$1, Tabs, Radio, Divider as Divider$2, Alert, Popconfirm,
|
|
66
|
-
import { IconPlus, IconDelete, IconEdit, IconLeft, IconCopy, IconUndo, IconRedo, IconMinus, IconEye, IconSubscribeAdd, IconClose, IconCheckCircleFill, IconDragArrow, IconPalette, IconLock, IconUnlock, IconImage, IconQuestionCircle, IconLink, IconCloud, IconDragDotVertical, IconSend, IconDown } from "@arco-design/web-react/icon";
|
|
65
|
+
import { Form, Input, Modal, Collapse, Space, Empty, Card, Grid, Button as Button$2, Drawer, Switch, Typography as Typography$1, Tabs, Radio, Tooltip, Divider as Divider$2, Alert, Popconfirm, Message, PageHeader, Spin, Layout as Layout$2, Popover, Select as Select$1, Slider, InputNumber, Tag, Link as Link$3, List as List$1, Skeleton, Trigger } from "@arco-design/web-react";
|
|
66
|
+
import { IconPlus, IconDelete, IconEdit, IconLeft, IconDownload, IconCopy, IconUndo, IconRedo, IconMinus, IconEye, IconSubscribeAdd, IconClose, IconCheckCircleFill, IconDragArrow, IconPalette, IconLock, IconUnlock, IconImage, IconQuestionCircle, IconLink, IconCloud, IconDragDotVertical, IconSend, IconDown } from "@arco-design/web-react/icon";
|
|
67
67
|
import { unstable_batchedUpdates, createPortal } from "react-dom";
|
|
68
68
|
import mjml from "mjml-browser";
|
|
69
69
|
import { HistoryEditor } from "slate-history";
|
|
@@ -7807,7 +7807,8 @@ const ConfigurationPanel = ({
|
|
|
7807
7807
|
const universalElementPath = useUniversalElementPath();
|
|
7808
7808
|
const standaloneElementPath = useStandaloneElementPath();
|
|
7809
7809
|
const lock = useLockState();
|
|
7810
|
-
const
|
|
7810
|
+
const [generateImageLoading, setGenerateImageLoading] = useState(false);
|
|
7811
|
+
const { quantityLimitCheck, compact, onUpload, showGenerateBlockImage } = useEditorProps();
|
|
7811
7812
|
const { copyBlock, deleteBlock, isChanged, resetSelectedNode } = useElementInteract();
|
|
7812
7813
|
const onCopy = useEventCallback((path2) => {
|
|
7813
7814
|
try {
|
|
@@ -7822,6 +7823,31 @@ const ConfigurationPanel = ({
|
|
|
7822
7823
|
console.error(error2);
|
|
7823
7824
|
}
|
|
7824
7825
|
});
|
|
7826
|
+
const generateImage = useEventCallback(() => __async(void 0, null, function* () {
|
|
7827
|
+
if (!selectedNodePath)
|
|
7828
|
+
return;
|
|
7829
|
+
try {
|
|
7830
|
+
setGenerateImageLoading(true);
|
|
7831
|
+
const element2 = Node.get(editor, selectedNodePath);
|
|
7832
|
+
const html2canvas = (yield import("./html2canvas.esm-858519c4.js")).default;
|
|
7833
|
+
const container2 = ReactEditor.toDOMNode(editor, element2);
|
|
7834
|
+
const blob = yield new Promise((resolve) => {
|
|
7835
|
+
html2canvas(container2, { useCORS: true }).then((canvas) => {
|
|
7836
|
+
return canvas.toBlob(resolve, "png", 0.1);
|
|
7837
|
+
});
|
|
7838
|
+
});
|
|
7839
|
+
if (blob) {
|
|
7840
|
+
const blobUrl = yield onUpload == null ? void 0 : onUpload(blob);
|
|
7841
|
+
if (blobUrl) {
|
|
7842
|
+
window.open(blobUrl, "_blank");
|
|
7843
|
+
}
|
|
7844
|
+
}
|
|
7845
|
+
} catch (error2) {
|
|
7846
|
+
console.error(error2);
|
|
7847
|
+
} finally {
|
|
7848
|
+
setGenerateImageLoading(false);
|
|
7849
|
+
}
|
|
7850
|
+
}));
|
|
7825
7851
|
let element = null;
|
|
7826
7852
|
if (selectedNodePath) {
|
|
7827
7853
|
try {
|
|
@@ -7878,7 +7904,27 @@ const ConfigurationPanel = ({
|
|
|
7878
7904
|
},
|
|
7879
7905
|
BlockManager.getBlockTitle(element)
|
|
7880
7906
|
),
|
|
7881
|
-
|
|
7907
|
+
/* @__PURE__ */ React__default.createElement(Space, null, showGenerateBlockImage && /* @__PURE__ */ React__default.createElement(
|
|
7908
|
+
Tooltip,
|
|
7909
|
+
{
|
|
7910
|
+
content: t("Export block image"),
|
|
7911
|
+
getPopupContainer: () => document.body,
|
|
7912
|
+
triggerProps: {
|
|
7913
|
+
style: {
|
|
7914
|
+
zIndex: 9999
|
|
7915
|
+
}
|
|
7916
|
+
}
|
|
7917
|
+
},
|
|
7918
|
+
/* @__PURE__ */ React__default.createElement(
|
|
7919
|
+
Button$2,
|
|
7920
|
+
{
|
|
7921
|
+
loading: generateImageLoading,
|
|
7922
|
+
size: "small",
|
|
7923
|
+
icon: /* @__PURE__ */ React__default.createElement(IconDownload, null),
|
|
7924
|
+
onClick: generateImage
|
|
7925
|
+
}
|
|
7926
|
+
)
|
|
7927
|
+
), !isSelectedUniversalElement && !isSelectedStandaloneElement && /* @__PURE__ */ React__default.createElement(Space, null, /* @__PURE__ */ React__default.createElement(
|
|
7882
7928
|
Button$2,
|
|
7883
7929
|
{
|
|
7884
7930
|
onClick: () => onCopy(selectedNodePath),
|
|
@@ -7892,7 +7938,7 @@ const ConfigurationPanel = ({
|
|
|
7892
7938
|
size: "small",
|
|
7893
7939
|
icon: /* @__PURE__ */ React__default.createElement(IconDelete, null)
|
|
7894
7940
|
}
|
|
7895
|
-
)),
|
|
7941
|
+
))),
|
|
7896
7942
|
/* @__PURE__ */ React__default.createElement("div", { style: { marginRight: 10 } })
|
|
7897
7943
|
), /* @__PURE__ */ React__default.createElement(Divider$2, { style: { margin: 0 } }), /* @__PURE__ */ React__default.createElement(
|
|
7898
7944
|
SharedComponents.FullHeightOverlayScrollbars,
|
|
@@ -7938,17 +7984,20 @@ const ConfigurationPanel = ({
|
|
|
7938
7984
|
element,
|
|
7939
7985
|
selectedNodePath,
|
|
7940
7986
|
universalElementPath,
|
|
7987
|
+
standaloneElementPath,
|
|
7941
7988
|
universalElementEditing,
|
|
7989
|
+
standaloneElementEditing,
|
|
7942
7990
|
compact,
|
|
7943
7991
|
lock,
|
|
7944
7992
|
onClose,
|
|
7993
|
+
showGenerateBlockImage,
|
|
7994
|
+
generateImageLoading,
|
|
7995
|
+
generateImage,
|
|
7945
7996
|
height,
|
|
7946
7997
|
isChanged,
|
|
7947
7998
|
resetSelectedNode,
|
|
7948
7999
|
onCopy,
|
|
7949
|
-
deleteBlock
|
|
7950
|
-
standaloneElementEditing,
|
|
7951
|
-
standaloneElementPath
|
|
8000
|
+
deleteBlock
|
|
7952
8001
|
]);
|
|
7953
8002
|
};
|
|
7954
8003
|
const index$9 = "";
|
|
@@ -14776,7 +14825,8 @@ const BgColor = () => {
|
|
|
14776
14825
|
{
|
|
14777
14826
|
match: Text$2.isText,
|
|
14778
14827
|
split: true,
|
|
14779
|
-
at: mergeNodeEntry ? mergeNodeEntry[1] : void 0
|
|
14828
|
+
at: mergeNodeEntry ? mergeNodeEntry[1] : void 0,
|
|
14829
|
+
voids: true
|
|
14780
14830
|
}
|
|
14781
14831
|
);
|
|
14782
14832
|
} else {
|
|
@@ -14889,7 +14939,8 @@ const FontColor = () => {
|
|
|
14889
14939
|
{
|
|
14890
14940
|
match: Text$2.isText,
|
|
14891
14941
|
split: true,
|
|
14892
|
-
at: mergeNodeEntry ? mergeNodeEntry[1] : void 0
|
|
14942
|
+
at: mergeNodeEntry ? mergeNodeEntry[1] : void 0,
|
|
14943
|
+
voids: true
|
|
14893
14944
|
}
|
|
14894
14945
|
);
|
|
14895
14946
|
} else {
|
|
@@ -15771,7 +15822,7 @@ const paragraphIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIoAAACKCAY
|
|
|
15771
15822
|
const heading1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIoAAACKCAYAAAB1h9JkAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMASURBVHgB7dwtU9xQAEDR/kM8Ho/H4/F4PB6PwOFBYxn8dl5nakp2ext2m81yzswzfLwym7vJ2zTJjw0EPzYQCIVEKCRCIREKiVBIhEIiFBKhkAiFRCgkQiERColQSIRCIhQSoZAIhUQoJEIhEQqJUEiEQiIUEqGQCIVEKCRCIREKiVBIhEIiFJLFQ3l5edk8PDzMGh8fH1vnfX5+nj0vny0eyt3d3ebs7GzWeHt72zrvzc3N7Hn5bPFQxjt/bNSLi4u0EcfPjZ8fge3aozw+Ps6el8+Oao0yDkPbNuz5+fmvqOYYv7dt3vH1ufN+J0e3mB2Hk6kNOt7tXzFimJr39vZ2w98d5aeeqXf/Pg4JY6/057wWr823CmVqXqE0QhFKIpQ9hjLWV+Pv/NsnsjUSyp5C+fMT265zPGsklC+GMgKZOrlnj/IfHGMoY8P/PsV/f3//62P15eXltzm7K5QYyrbzO0JZ0LGGcnV1NTmEspC1LWaFspC1hzL+nVOzmlDGLv73OYq541Cn8IWykHppwD6GUJrVhDK+tm0xWYc9ynzWKEJJhCKURChCSYQilEQoQkmEIpREKEJJhCKURChCSYQilEQoQkmEIpTEnYIuXEpWc+/x+N/fNc17aje+H1Uo40W/vr6efOHHGN+bswHGLRW7rpgft1v867zjbx2P1tj19IVxpf6pBLN4KGPXP17sqcPCrjE2/K6brMahau6824zvzb2oavzemp+c4IlLE2ObufPt6zC3JA/7IxEKiVBIhEIiFBKhkAiFRCgkQiERColQSIRCIhQSoZAIhWSxUJ6enowDjUMQygmOQxDKCY5DsEYhEQqJUEiEQiIUEqGQCIVEKCRCIXFm9ojH6+vr5lgIRSiJUIS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7ldtUQFFjY9cBCUGAhKLAQFFhG60d5fX0NWI6Dg4OwaIwosBAUWKijwMKIAgtBgYWgwEJQYCEosBAUWAgKLAQFFq71VGxrayvs7OyEGjCiwEJQYOFaDyyMKLAQFFgICiwEBRaCAgtBgYWgwEJQYOFaz5z29vbC5uZmWHWMKLAQFFi41gMLIwosBAUWggILQYGFoMBCUGAhKLAQFFgICiwEBRaCAgtBgYWgwEJQYCEosBAUWAgKLAQFFoICC0GBhaDAQlBgISiwEBRYCAosBAWWf5H+W8ILZAmzAAAAAElFTkSuQmCC";
|
|
15774
|
-
const options$
|
|
15825
|
+
const options$9 = [
|
|
15775
15826
|
{
|
|
15776
15827
|
icon: paragraphIcon,
|
|
15777
15828
|
get content() {
|
|
@@ -15844,7 +15895,7 @@ const TurnInto = () => {
|
|
|
15844
15895
|
style: { minWidth: 95 },
|
|
15845
15896
|
onChange,
|
|
15846
15897
|
renderFormat: (option) => {
|
|
15847
|
-
const matchItem = options$
|
|
15898
|
+
const matchItem = options$9.find((o) => o.value === (option == null ? void 0 : option.value));
|
|
15848
15899
|
return /* @__PURE__ */ React__default.createElement("span", { className: "TurnInto-content" }, matchItem ? matchItem.content : "");
|
|
15849
15900
|
},
|
|
15850
15901
|
triggerProps: {
|
|
@@ -15852,7 +15903,7 @@ const TurnInto = () => {
|
|
|
15852
15903
|
autoAlignPopupMinWidth: true
|
|
15853
15904
|
}
|
|
15854
15905
|
},
|
|
15855
|
-
options$
|
|
15906
|
+
options$9.map((option, index2) => {
|
|
15856
15907
|
return /* @__PURE__ */ React__default.createElement(Select$1.Option, { key: index2, value: option.value }, /* @__PURE__ */ React__default.createElement("div", { className: "TurnInto-item" }, /* @__PURE__ */ React__default.createElement("img", { src: option.icon, alt: "", className: "TurnInto-icon" }), /* @__PURE__ */ React__default.createElement("span", { className: "TurnInto-content" }, option.content)));
|
|
15857
15908
|
})
|
|
15858
15909
|
), /* @__PURE__ */ React__default.createElement("style", null, `.easy-email-pro-turnInto .arco-select-view { border-width: 0px !important; }`));
|
|
@@ -16028,7 +16079,7 @@ const TextAlign$1 = () => {
|
|
|
16028
16079
|
}
|
|
16029
16080
|
));
|
|
16030
16081
|
};
|
|
16031
|
-
const options$
|
|
16082
|
+
const options$8 = ["12px", "14px", "16px", "18px", "24px", "32px", "48px"];
|
|
16032
16083
|
const FontSize$2 = () => {
|
|
16033
16084
|
const [selectRef, setSelectRef] = useState(null);
|
|
16034
16085
|
const { fontSizeList } = useEditorProps();
|
|
@@ -16054,7 +16105,7 @@ const FontSize$2 = () => {
|
|
|
16054
16105
|
setFontSizeValue(fontSizeValue2);
|
|
16055
16106
|
}, [editor, textNode, textNode == null ? void 0 : textNode.fontSize]);
|
|
16056
16107
|
const optionsList = useMemo(() => {
|
|
16057
|
-
const list = [...fontSizeList || options$
|
|
16108
|
+
const list = [...fontSizeList || options$8];
|
|
16058
16109
|
if (fontSizeValue) {
|
|
16059
16110
|
list.push(fontSizeValue);
|
|
16060
16111
|
}
|
|
@@ -16089,7 +16140,8 @@ const FontSize$2 = () => {
|
|
|
16089
16140
|
{
|
|
16090
16141
|
match: Text$2.isText,
|
|
16091
16142
|
split: true,
|
|
16092
|
-
at: mergeNodeEntry ? mergeNodeEntry[1] : void 0
|
|
16143
|
+
at: mergeNodeEntry ? mergeNodeEntry[1] : void 0,
|
|
16144
|
+
voids: true
|
|
16093
16145
|
}
|
|
16094
16146
|
);
|
|
16095
16147
|
} else {
|
|
@@ -16178,7 +16230,8 @@ const FontFamily$2 = () => {
|
|
|
16178
16230
|
{
|
|
16179
16231
|
match: Text$2.isText,
|
|
16180
16232
|
split: true,
|
|
16181
|
-
at: mergeNodeEntry ? mergeNodeEntry[1] : void 0
|
|
16233
|
+
at: mergeNodeEntry ? mergeNodeEntry[1] : void 0,
|
|
16234
|
+
voids: true
|
|
16182
16235
|
}
|
|
16183
16236
|
);
|
|
16184
16237
|
} else {
|
|
@@ -27010,7 +27063,7 @@ function EditPanelList(props) {
|
|
|
27010
27063
|
const [activeId, setActiveId] = useState(null);
|
|
27011
27064
|
const [activeItem, setActiveItem] = useState(null);
|
|
27012
27065
|
const getItemId = useCallback((item2) => {
|
|
27013
|
-
let id = idMap.get(item2);
|
|
27066
|
+
let id = get(item2, "id") || idMap.get(item2);
|
|
27014
27067
|
if (!id) {
|
|
27015
27068
|
id = +(/* @__PURE__ */ new Date()).getTime().toString() + "-" + uniqueId();
|
|
27016
27069
|
idMap.set(item2, id);
|
|
@@ -27579,7 +27632,11 @@ function ImageUploader(props) {
|
|
|
27579
27632
|
position: "relative",
|
|
27580
27633
|
minHeight: 100,
|
|
27581
27634
|
height: props.size === "small" ? 100 : void 0,
|
|
27582
|
-
boxSizing: "border-box"
|
|
27635
|
+
boxSizing: "border-box",
|
|
27636
|
+
backgroundColor: "#fafafa",
|
|
27637
|
+
backgroundImage: image2 ? "linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0), linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0)" : void 0,
|
|
27638
|
+
backgroundSize: "20px 20px",
|
|
27639
|
+
backgroundPosition: "0 0, 10px 10px"
|
|
27583
27640
|
}
|
|
27584
27641
|
},
|
|
27585
27642
|
content
|
|
@@ -28889,7 +28946,7 @@ function TextAndHeadingStyle(props) {
|
|
|
28889
28946
|
[props.name, props.path]
|
|
28890
28947
|
);
|
|
28891
28948
|
}
|
|
28892
|
-
const options$
|
|
28949
|
+
const options$7 = [
|
|
28893
28950
|
{
|
|
28894
28951
|
value: "normal",
|
|
28895
28952
|
get label() {
|
|
@@ -28945,7 +29002,7 @@ function FontWeight(props) {
|
|
|
28945
29002
|
SelectField,
|
|
28946
29003
|
__spreadProps(__spreadValues({
|
|
28947
29004
|
label: t("Font weight"),
|
|
28948
|
-
options: options$
|
|
29005
|
+
options: options$7
|
|
28949
29006
|
}, props), {
|
|
28950
29007
|
formItem: __spreadValues(__spreadValues({}, fontWeightAdapter), props.formItem)
|
|
28951
29008
|
})
|
|
@@ -29223,7 +29280,7 @@ function LineHeight(props) {
|
|
|
29223
29280
|
)));
|
|
29224
29281
|
}, [label, onChangeUnit, props, unit]);
|
|
29225
29282
|
}
|
|
29226
|
-
const options$
|
|
29283
|
+
const options$6 = [
|
|
29227
29284
|
{
|
|
29228
29285
|
value: "left",
|
|
29229
29286
|
label: /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-align-left" })
|
|
@@ -29243,7 +29300,7 @@ function TextAlign(props) {
|
|
|
29243
29300
|
return /* @__PURE__ */ React__default.createElement(
|
|
29244
29301
|
AttributeField.ButtonGroupField,
|
|
29245
29302
|
__spreadProps(__spreadValues({}, props), {
|
|
29246
|
-
options: options$
|
|
29303
|
+
options: options$6,
|
|
29247
29304
|
label
|
|
29248
29305
|
})
|
|
29249
29306
|
);
|
|
@@ -30207,7 +30264,7 @@ const ConditionModal = ({
|
|
|
30207
30264
|
/* @__PURE__ */ React__default.createElement(Form.Item, { field: "condition.enabled", noStyle: true }, /* @__PURE__ */ React__default.createElement(Input, { hidden: true }))
|
|
30208
30265
|
);
|
|
30209
30266
|
};
|
|
30210
|
-
const options$
|
|
30267
|
+
const options$5 = [
|
|
30211
30268
|
{
|
|
30212
30269
|
tootip: "Truthy",
|
|
30213
30270
|
label: "Truthy",
|
|
@@ -30333,7 +30390,7 @@ function ConditionItem({
|
|
|
30333
30390
|
layout: "vertical",
|
|
30334
30391
|
style: {}
|
|
30335
30392
|
},
|
|
30336
|
-
/* @__PURE__ */ React__default.createElement(Select$1, { options: options$
|
|
30393
|
+
/* @__PURE__ */ React__default.createElement(Select$1, { options: options$5 }, options$5.map((item2) => {
|
|
30337
30394
|
return /* @__PURE__ */ React__default.createElement(Select$1.Option, { key: item2.value, value: item2.value }, /* @__PURE__ */ React__default.createElement("div", null, item2.label));
|
|
30338
30395
|
}))
|
|
30339
30396
|
)), !hideRight && /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 8, style: { paddingLeft: 5 } }, /* @__PURE__ */ React__default.createElement(
|
|
@@ -30694,7 +30751,7 @@ function Heading(props) {
|
|
|
30694
30751
|
return /* @__PURE__ */ React__default.createElement(Form.Item, __spreadValues({ label }, props.formItem), /* @__PURE__ */ React__default.createElement(Select$1, { options: options2, value: node.type, onChange }));
|
|
30695
30752
|
}, [label, node.type, onChange, options2, props.formItem]);
|
|
30696
30753
|
}
|
|
30697
|
-
const options$
|
|
30754
|
+
const options$4 = [
|
|
30698
30755
|
{
|
|
30699
30756
|
value: "top",
|
|
30700
30757
|
get label() {
|
|
@@ -30720,7 +30777,7 @@ function VerticalAlign(props) {
|
|
|
30720
30777
|
return /* @__PURE__ */ React__default.createElement(
|
|
30721
30778
|
AttributeField.ButtonGroupField,
|
|
30722
30779
|
__spreadProps(__spreadValues({
|
|
30723
|
-
options: options$
|
|
30780
|
+
options: options$4
|
|
30724
30781
|
}, props), {
|
|
30725
30782
|
label
|
|
30726
30783
|
})
|
|
@@ -31037,7 +31094,7 @@ function RTLDirection(props) {
|
|
|
31037
31094
|
)));
|
|
31038
31095
|
}, [name, path2, rest]);
|
|
31039
31096
|
}
|
|
31040
|
-
const options$
|
|
31097
|
+
const options$3 = [
|
|
31041
31098
|
{
|
|
31042
31099
|
value: "auto",
|
|
31043
31100
|
get label() {
|
|
@@ -31057,7 +31114,7 @@ function TableLayout(props) {
|
|
|
31057
31114
|
return /* @__PURE__ */ React__default.createElement(
|
|
31058
31115
|
AttributeField.ButtonGroupField,
|
|
31059
31116
|
__spreadProps(__spreadValues({}, props), {
|
|
31060
|
-
options: options$
|
|
31117
|
+
options: options$3,
|
|
31061
31118
|
label
|
|
31062
31119
|
})
|
|
31063
31120
|
);
|
|
@@ -31208,6 +31265,116 @@ function BackgroundGradient(props) {
|
|
|
31208
31265
|
t("Create gradient")
|
|
31209
31266
|
)));
|
|
31210
31267
|
}
|
|
31268
|
+
const options$2 = [
|
|
31269
|
+
{
|
|
31270
|
+
value: "left",
|
|
31271
|
+
label: t("Left")
|
|
31272
|
+
},
|
|
31273
|
+
{
|
|
31274
|
+
value: "right",
|
|
31275
|
+
label: t("Right")
|
|
31276
|
+
}
|
|
31277
|
+
];
|
|
31278
|
+
const verticalAlignOptions = [
|
|
31279
|
+
{
|
|
31280
|
+
value: "middle",
|
|
31281
|
+
get label() {
|
|
31282
|
+
return t("Middle");
|
|
31283
|
+
}
|
|
31284
|
+
},
|
|
31285
|
+
{
|
|
31286
|
+
value: "baseline",
|
|
31287
|
+
get label() {
|
|
31288
|
+
return t("Baseline");
|
|
31289
|
+
}
|
|
31290
|
+
}
|
|
31291
|
+
];
|
|
31292
|
+
function ButtonIcon(props) {
|
|
31293
|
+
const { label = t("Icon"), path: path2, name } = props;
|
|
31294
|
+
const { getFieldValue, setFieldValue } = useEditorContext();
|
|
31295
|
+
const editor = useSlateStatic();
|
|
31296
|
+
const isEnabledBorder = getFieldValue(path2, `${name}.icon-enabled`);
|
|
31297
|
+
const handleChangeEnabled = useCallback(
|
|
31298
|
+
(value) => {
|
|
31299
|
+
console.log(value);
|
|
31300
|
+
if (isUndefined$1(isEnabledBorder)) {
|
|
31301
|
+
editor.withoutNormalizing(() => {
|
|
31302
|
+
setFieldValue(
|
|
31303
|
+
path2,
|
|
31304
|
+
`${name}.icon-src`,
|
|
31305
|
+
"https://cdn.shopify.com/s/files/1/0863/8971/9346/files/xmxnt4qg5xuogsoasxrfy_image.png"
|
|
31306
|
+
);
|
|
31307
|
+
setFieldValue(path2, `${name}.icon-position`, "right");
|
|
31308
|
+
setFieldValue(path2, `${name}.icon-vertical-align`, "middle");
|
|
31309
|
+
setFieldValue(path2, `${name}.icon-width`, "12px");
|
|
31310
|
+
setFieldValue(path2, `${name}.icon-height`, "12px");
|
|
31311
|
+
});
|
|
31312
|
+
}
|
|
31313
|
+
},
|
|
31314
|
+
[setFieldValue, path2, name, isEnabledBorder, editor]
|
|
31315
|
+
);
|
|
31316
|
+
return useMemo(() => {
|
|
31317
|
+
return /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(
|
|
31318
|
+
AttributeField.SwitchField,
|
|
31319
|
+
{
|
|
31320
|
+
label,
|
|
31321
|
+
name: `${name}.icon-enabled`,
|
|
31322
|
+
path: path2,
|
|
31323
|
+
onChange: handleChangeEnabled
|
|
31324
|
+
}
|
|
31325
|
+
), /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, isEnabledBorder && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
31326
|
+
AttributeField.ImageUrl,
|
|
31327
|
+
{
|
|
31328
|
+
path: path2,
|
|
31329
|
+
name: props.name + ".icon-src",
|
|
31330
|
+
formItem: { layout: "vertical" }
|
|
31331
|
+
}
|
|
31332
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
31333
|
+
AttributeField.Width,
|
|
31334
|
+
{
|
|
31335
|
+
label: t("Width"),
|
|
31336
|
+
path: path2,
|
|
31337
|
+
suffix: t("px"),
|
|
31338
|
+
name: `${name}.icon-width`,
|
|
31339
|
+
min: 1,
|
|
31340
|
+
required: true,
|
|
31341
|
+
fallbackValue: "12px"
|
|
31342
|
+
}
|
|
31343
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
31344
|
+
AttributeField.Height,
|
|
31345
|
+
{
|
|
31346
|
+
label: t("Height"),
|
|
31347
|
+
path: path2,
|
|
31348
|
+
suffix: t("px"),
|
|
31349
|
+
name: `${name}.icon-height`,
|
|
31350
|
+
min: 1,
|
|
31351
|
+
required: true,
|
|
31352
|
+
fallbackValue: "12px"
|
|
31353
|
+
}
|
|
31354
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
31355
|
+
AttributeField.ButtonGroupField,
|
|
31356
|
+
{
|
|
31357
|
+
path: path2,
|
|
31358
|
+
name: `${name}.icon-position`,
|
|
31359
|
+
options: options$2,
|
|
31360
|
+
label: t("Position")
|
|
31361
|
+
}
|
|
31362
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
31363
|
+
AttributeField.ButtonGroupField,
|
|
31364
|
+
{
|
|
31365
|
+
path: path2,
|
|
31366
|
+
name: `${name}.icon-vertical-align`,
|
|
31367
|
+
options: verticalAlignOptions,
|
|
31368
|
+
label: /* @__PURE__ */ React__default.createElement(Space, null, t("Vertical Align"), " "),
|
|
31369
|
+
formItem: {
|
|
31370
|
+
help: t(
|
|
31371
|
+
"This option is not available in classic Outlook and is always baseline."
|
|
31372
|
+
)
|
|
31373
|
+
}
|
|
31374
|
+
}
|
|
31375
|
+
))));
|
|
31376
|
+
}, [handleChangeEnabled, isEnabledBorder, label, name, path2, props.name]);
|
|
31377
|
+
}
|
|
31211
31378
|
const defaultAttributeFields = {
|
|
31212
31379
|
// Basic Form Field
|
|
31213
31380
|
WatchField,
|
|
@@ -31265,7 +31432,8 @@ const defaultAttributeFields = {
|
|
|
31265
31432
|
WebFonts,
|
|
31266
31433
|
RichTextField,
|
|
31267
31434
|
FieldItem,
|
|
31268
|
-
GradientGeneratorField
|
|
31435
|
+
GradientGeneratorField,
|
|
31436
|
+
ButtonIcon
|
|
31269
31437
|
};
|
|
31270
31438
|
const AttributeField = __spreadValues({}, defaultAttributeFields);
|
|
31271
31439
|
const index$5 = "";
|
|
@@ -31681,12 +31849,13 @@ function AttributesContainer$d({
|
|
|
31681
31849
|
mode
|
|
31682
31850
|
}) {
|
|
31683
31851
|
const { selectedNode } = useSelectedNode();
|
|
31852
|
+
const { enabledButtonIcon } = useEditorProps();
|
|
31684
31853
|
const textPath = useMemo(() => {
|
|
31685
31854
|
return [...nodePath, 0];
|
|
31686
31855
|
}, [nodePath]);
|
|
31687
31856
|
if (!selectedNode)
|
|
31688
31857
|
return null;
|
|
31689
|
-
return /* @__PURE__ */ React__default.createElement(CollapseWrapper$1, { defaultActiveKey: ["0", "1", "2", "3", "4"] }, /* @__PURE__ */ React__default.createElement(Collapse.Item, { name: "3", header: t("Content") }, /* @__PURE__ */ React__default.createElement(
|
|
31858
|
+
return /* @__PURE__ */ React__default.createElement(CollapseWrapper$1, { defaultActiveKey: ["0", "1", "2", "3", "4", "5"] }, /* @__PURE__ */ React__default.createElement(Collapse.Item, { name: "3", header: t("Content") }, /* @__PURE__ */ React__default.createElement(
|
|
31690
31859
|
AttributeField.ButtonContent,
|
|
31691
31860
|
{
|
|
31692
31861
|
path: textPath,
|
|
@@ -31753,6 +31922,13 @@ function AttributesContainer$d({
|
|
|
31753
31922
|
path: nodePath,
|
|
31754
31923
|
name: "border-radius"
|
|
31755
31924
|
}
|
|
31925
|
+
)), enabledButtonIcon && /* @__PURE__ */ React__default.createElement(Collapse.Item, { name: "5", header: t("Icon") }, /* @__PURE__ */ React__default.createElement(
|
|
31926
|
+
ResponsiveField,
|
|
31927
|
+
{
|
|
31928
|
+
component: AttributeField.ButtonIcon,
|
|
31929
|
+
path: nodePath,
|
|
31930
|
+
name: ""
|
|
31931
|
+
}
|
|
31756
31932
|
)), /* @__PURE__ */ React__default.createElement(Collapse.Item, { name: "4", header: t("Block") }, /* @__PURE__ */ React__default.createElement(
|
|
31757
31933
|
ResponsiveField,
|
|
31758
31934
|
{
|
|
@@ -32092,6 +32268,13 @@ function AttributesContainer$9({
|
|
|
32092
32268
|
type: selectedNode.type
|
|
32093
32269
|
}
|
|
32094
32270
|
)), /* @__PURE__ */ React__default.createElement(Collapse.Item, { name: "2", header: t("Block") }, /* @__PURE__ */ React__default.createElement(
|
|
32271
|
+
ResponsiveField,
|
|
32272
|
+
{
|
|
32273
|
+
component: AttributeField.BackgroundColor,
|
|
32274
|
+
path: nodePath,
|
|
32275
|
+
name: "container-background-color"
|
|
32276
|
+
}
|
|
32277
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
32095
32278
|
ResponsiveField,
|
|
32096
32279
|
{
|
|
32097
32280
|
component: AttributeField.TextAlign,
|
|
@@ -32334,6 +32517,13 @@ function AttributesContainer$8({
|
|
|
32334
32517
|
type: selectedNode.type
|
|
32335
32518
|
}
|
|
32336
32519
|
)), /* @__PURE__ */ React__default.createElement(Collapse.Item, { name: "2", header: t("Block") }, /* @__PURE__ */ React__default.createElement(
|
|
32520
|
+
ResponsiveField,
|
|
32521
|
+
{
|
|
32522
|
+
component: AttributeField.BackgroundColor,
|
|
32523
|
+
path: nodePath,
|
|
32524
|
+
name: "container-background-color"
|
|
32525
|
+
}
|
|
32526
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
32337
32527
|
ResponsiveField,
|
|
32338
32528
|
{
|
|
32339
32529
|
component: AttributeField.ButtonGroupField,
|
|
@@ -37,6 +37,7 @@ import { ButtonContent } from "./ButtonContent";
|
|
|
37
37
|
import { RTLDirection } from "./RTLDirection";
|
|
38
38
|
import { TableLayout } from "./TableLayout";
|
|
39
39
|
import { BackgroundGradient } from "./BackgroundGradient";
|
|
40
|
+
import { ButtonIcon } from "./ButtonIcon";
|
|
40
41
|
export declare const defaultAttributeFields: {
|
|
41
42
|
WatchField: (props: import("../../../Form/WatchField").WatchFieldProps) => import("react").JSX.Element;
|
|
42
43
|
SyncChildrenField: (props: import("../../../Form/SyncChildrenField").SyncChildrenFieldProps) => import("react").JSX.Element;
|
|
@@ -127,5 +128,6 @@ export declare const defaultAttributeFields: {
|
|
|
127
128
|
}, "onChange" | "value">) => import("react").JSX.Element;
|
|
128
129
|
FieldItem: typeof FieldItem;
|
|
129
130
|
GradientGeneratorField: (props: import("../../../Form/enhancer").EnhancerProps & Omit<import("../../../Form/GradientGenerator").GradientGeneratorProps, "onChange" | "value">) => import("react").JSX.Element;
|
|
131
|
+
ButtonIcon: typeof ButtonIcon;
|
|
130
132
|
};
|
|
131
133
|
export declare const AttributeField: AttributeFieldsMap;
|
|
@@ -147,6 +147,7 @@ export interface PluginsCustomEditorTypes {
|
|
|
147
147
|
showSidebar?: boolean;
|
|
148
148
|
showLogic?: boolean;
|
|
149
149
|
showLayer?: boolean;
|
|
150
|
+
showGenerateBlockImage?: boolean;
|
|
150
151
|
showTextHTMLMode?: boolean;
|
|
151
152
|
showTextDirectionMode?: boolean;
|
|
152
153
|
showDragMoveIcon?: boolean;
|
|
@@ -154,6 +155,7 @@ export interface PluginsCustomEditorTypes {
|
|
|
154
155
|
enabledHtmlBlockNodeAlign?: boolean;
|
|
155
156
|
enabledPreviewEmailSubjectEdit?: boolean;
|
|
156
157
|
enabledGradientImage?: boolean;
|
|
158
|
+
enabledButtonIcon?: boolean;
|
|
157
159
|
hideSectionBackgroundImage?: boolean;
|
|
158
160
|
layerConfig?: {
|
|
159
161
|
scrollWhenSelect?: boolean;
|