easy-email-pro-theme 1.11.0 → 1.12.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/lib/index.js
CHANGED
|
@@ -1386,26 +1386,64 @@ const useElementInteract = () => {
|
|
|
1386
1386
|
},
|
|
1387
1387
|
[editor, setSelectedNodePath]
|
|
1388
1388
|
);
|
|
1389
|
+
const moveUp3 = useCallback$1(
|
|
1390
|
+
(path2) => {
|
|
1391
|
+
try {
|
|
1392
|
+
const previous = Path.previous(path2);
|
|
1393
|
+
if (!Node$1.get(editor, previous))
|
|
1394
|
+
return;
|
|
1395
|
+
Transforms.moveNodes(editor, {
|
|
1396
|
+
at: path2,
|
|
1397
|
+
to: previous
|
|
1398
|
+
});
|
|
1399
|
+
setSelectedNodePath(previous);
|
|
1400
|
+
return previous;
|
|
1401
|
+
} catch (error2) {
|
|
1402
|
+
}
|
|
1403
|
+
},
|
|
1404
|
+
[editor, setSelectedNodePath]
|
|
1405
|
+
);
|
|
1406
|
+
const moveDown3 = useCallback$1(
|
|
1407
|
+
(path2) => {
|
|
1408
|
+
try {
|
|
1409
|
+
const next = Path.next(path2);
|
|
1410
|
+
if (!Node$1.get(editor, next))
|
|
1411
|
+
return;
|
|
1412
|
+
Transforms.moveNodes(editor, {
|
|
1413
|
+
at: path2,
|
|
1414
|
+
to: next
|
|
1415
|
+
});
|
|
1416
|
+
setSelectedNodePath(next);
|
|
1417
|
+
return next;
|
|
1418
|
+
} catch (error2) {
|
|
1419
|
+
}
|
|
1420
|
+
},
|
|
1421
|
+
[editor, setSelectedNodePath]
|
|
1422
|
+
);
|
|
1389
1423
|
const deleteBlock = useCallback$1(
|
|
1390
1424
|
(path2) => {
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1425
|
+
try {
|
|
1426
|
+
const [entry] = Editor.nodes(editor, {
|
|
1427
|
+
match(node, currentPath) {
|
|
1428
|
+
return Path.equals(path2, currentPath);
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
if (entry) {
|
|
1432
|
+
setSelectedNodePath(null);
|
|
1433
|
+
setTimeout(() => {
|
|
1434
|
+
Transforms.delete(editor, {
|
|
1435
|
+
at: path2
|
|
1436
|
+
});
|
|
1437
|
+
}, 0);
|
|
1438
|
+
} else {
|
|
1399
1439
|
Transforms.delete(editor, {
|
|
1400
1440
|
at: path2
|
|
1401
1441
|
});
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
});
|
|
1442
|
+
}
|
|
1443
|
+
setHoverNodePath(null);
|
|
1444
|
+
} catch (error2) {
|
|
1445
|
+
console.log(error2);
|
|
1407
1446
|
}
|
|
1408
|
-
setHoverNodePath(null);
|
|
1409
1447
|
},
|
|
1410
1448
|
[editor, setHoverNodePath, setSelectedNodePath]
|
|
1411
1449
|
);
|
|
@@ -1456,7 +1494,9 @@ const useElementInteract = () => {
|
|
|
1456
1494
|
deleteBlock,
|
|
1457
1495
|
clearCanvas,
|
|
1458
1496
|
isChanged: !isEqual$3(lastSelectedNode.current, selectedNode),
|
|
1459
|
-
resetSelectedNode
|
|
1497
|
+
resetSelectedNode,
|
|
1498
|
+
moveUp: moveUp3,
|
|
1499
|
+
moveDown: moveDown3
|
|
1460
1500
|
};
|
|
1461
1501
|
};
|
|
1462
1502
|
const defaultFontList = [
|
|
@@ -1649,7 +1689,12 @@ const useMinimalistContext = () => {
|
|
|
1649
1689
|
const ElementTools$1 = ({ element, nodeElement, path: path2 }) => {
|
|
1650
1690
|
const editor = useSlate();
|
|
1651
1691
|
const { copyBlock, deleteBlock } = useElementInteract();
|
|
1652
|
-
const {
|
|
1692
|
+
const {
|
|
1693
|
+
universalElementSetting,
|
|
1694
|
+
quantityLimitCheck,
|
|
1695
|
+
ElementTools: ElementTools2,
|
|
1696
|
+
ElementToolsInner
|
|
1697
|
+
} = useEditorProps();
|
|
1653
1698
|
const { open } = useUniversalContent();
|
|
1654
1699
|
const { setSelectedNodePath, universalElementEditing, universalElementPath } = useEditorState();
|
|
1655
1700
|
const { dragHandle: dragHandle2 } = useDragging({
|
|
@@ -1703,7 +1748,14 @@ const ElementTools$1 = ({ element, nodeElement, path: path2 }) => {
|
|
|
1703
1748
|
"data-is-wrapper-category": isWrapperCategory,
|
|
1704
1749
|
"data-is-full-width": isFullWidth
|
|
1705
1750
|
},
|
|
1706
|
-
/* @__PURE__ */ React__default.createElement(
|
|
1751
|
+
ElementTools2 ? /* @__PURE__ */ React__default.createElement(
|
|
1752
|
+
ElementTools2,
|
|
1753
|
+
{
|
|
1754
|
+
element,
|
|
1755
|
+
nodeElement,
|
|
1756
|
+
path: path2
|
|
1757
|
+
}
|
|
1758
|
+
) : /* @__PURE__ */ React__default.createElement(
|
|
1707
1759
|
"div",
|
|
1708
1760
|
{
|
|
1709
1761
|
className: classnames$1(
|
|
@@ -1728,9 +1780,21 @@ const ElementTools$1 = ({ element, nodeElement, path: path2 }) => {
|
|
|
1728
1780
|
),
|
|
1729
1781
|
BlockManager.getBlockTitle(element)
|
|
1730
1782
|
),
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1783
|
+
ElementToolsInner ? /* @__PURE__ */ React__default.createElement(
|
|
1784
|
+
ElementToolsInner,
|
|
1785
|
+
{
|
|
1786
|
+
element,
|
|
1787
|
+
nodeElement,
|
|
1788
|
+
path: path2
|
|
1789
|
+
}
|
|
1790
|
+
) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !isEditingUniversalElement && /* @__PURE__ */ React__default.createElement("div", { className: "element-tools-item", onPointerDown: onCopy }, /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-copy" })), universalElementSetting && !universalElementEditing && !isUniversalElement && /* @__PURE__ */ React__default.createElement(
|
|
1791
|
+
"div",
|
|
1792
|
+
{
|
|
1793
|
+
className: "element-tools-item",
|
|
1794
|
+
onPointerDown: openModal
|
|
1795
|
+
},
|
|
1796
|
+
/* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-collection" })
|
|
1797
|
+
), !isEditingUniversalElement && /* @__PURE__ */ React__default.createElement("div", { className: "element-tools-item", onPointerDown: onDelete }, /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-delete" })))
|
|
1734
1798
|
)
|
|
1735
1799
|
), /* @__PURE__ */ React__default.createElement("div", { className: "element-dragover" }), /* @__PURE__ */ React__default.createElement("style", null, styleText$b));
|
|
1736
1800
|
const isContentElement = NodeUtils.isContentElement(element);
|
|
@@ -18933,7 +18997,7 @@ const DirectionOptions = [
|
|
|
18933
18997
|
{
|
|
18934
18998
|
value: "ltr",
|
|
18935
18999
|
get label() {
|
|
18936
|
-
return t("Left to
|
|
19000
|
+
return t("Left to right");
|
|
18937
19001
|
}
|
|
18938
19002
|
},
|
|
18939
19003
|
{
|
|
@@ -39627,7 +39691,7 @@ const useCreateConfig$1 = (_m) => {
|
|
|
39627
39691
|
});
|
|
39628
39692
|
};
|
|
39629
39693
|
const Layout$1 = ({ children }) => {
|
|
39630
|
-
const { inited } = useEditorContext();
|
|
39694
|
+
const { inited, values: values2 } = useEditorContext();
|
|
39631
39695
|
const {
|
|
39632
39696
|
controller = true,
|
|
39633
39697
|
showSidebar = true,
|
|
@@ -39635,6 +39699,7 @@ const Layout$1 = ({ children }) => {
|
|
|
39635
39699
|
height,
|
|
39636
39700
|
compact
|
|
39637
39701
|
} = useEditorProps();
|
|
39702
|
+
const pageDataWidth = parseInt(values2.content.attributes.width || "600") || 600;
|
|
39638
39703
|
const editor = useSlate();
|
|
39639
39704
|
const getRoot = () => {
|
|
39640
39705
|
try {
|
|
@@ -39683,7 +39748,12 @@ const Layout$1 = ({ children }) => {
|
|
|
39683
39748
|
},
|
|
39684
39749
|
/* @__PURE__ */ React__default.createElement(SharedComponents.BlockSideBar, { height })
|
|
39685
39750
|
),
|
|
39686
|
-
/* @__PURE__ */ React__default.createElement("div", { style: { height, minWidth: 800, flex: 1 } }, /* @__PURE__ */ React__default.createElement(SharedComponents.EditorTabs, null, /* @__PURE__ */ React__default.createElement(EmailEditor, null, /* @__PURE__ */ React__default.createElement("style", { id: "Retro-CSS" }, styleText$c, RetroStyleText
|
|
39751
|
+
/* @__PURE__ */ React__default.createElement("div", { style: { height, minWidth: 800, flex: 1 } }, /* @__PURE__ */ React__default.createElement(SharedComponents.EditorTabs, null, /* @__PURE__ */ React__default.createElement(EmailEditor, null, /* @__PURE__ */ React__default.createElement("style", { id: "Retro-CSS" }, styleText$c, RetroStyleText, `
|
|
39752
|
+
body {
|
|
39753
|
+
--page-width: ${pageDataWidth}px;
|
|
39754
|
+
}
|
|
39755
|
+
|
|
39756
|
+
`), children))),
|
|
39687
39757
|
showSidebar && compact && /* @__PURE__ */ React__default.createElement(
|
|
39688
39758
|
Layout$2.Sider,
|
|
39689
39759
|
{
|
|
@@ -99,6 +99,16 @@ export interface PluginsCustomEditorTypes {
|
|
|
99
99
|
widgetElement?: SectionWidgetElement | ContentWidgetElement;
|
|
100
100
|
emptyPageElement?: PageElement;
|
|
101
101
|
loadingElement?: React.ReactNode;
|
|
102
|
+
ElementToolsInner?: React.FC<{
|
|
103
|
+
element: Element;
|
|
104
|
+
nodeElement: HTMLElement;
|
|
105
|
+
path: Path;
|
|
106
|
+
}>;
|
|
107
|
+
ElementTools?: React.FC<{
|
|
108
|
+
element: Element;
|
|
109
|
+
nodeElement: HTMLElement;
|
|
110
|
+
path: Path;
|
|
111
|
+
}>;
|
|
102
112
|
};
|
|
103
113
|
EmailTemplate: BasicEmailTemplate;
|
|
104
114
|
}
|