easy-email-pro-theme 1.34.2 → 1.34.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 +27 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -749,7 +749,7 @@ const DraggingProvider = ({
|
|
|
749
749
|
ev.preventDefault();
|
|
750
750
|
const node = ReactEditor.toDOMNode(editor, dropElement);
|
|
751
751
|
const rect = node.getBoundingClientRect();
|
|
752
|
-
const isTop = ev.clientY < rect.y + rect.height /
|
|
752
|
+
const isTop = ev.clientY < rect.y + rect.height / 2;
|
|
753
753
|
root2.querySelectorAll("[data-slate-dragover='true']").forEach((item2) => {
|
|
754
754
|
if (item2 !== node) {
|
|
755
755
|
item2.removeAttribute("data-slate-dragover");
|
|
@@ -802,7 +802,6 @@ const DraggingProvider = ({
|
|
|
802
802
|
if (dropPath && dropElement) {
|
|
803
803
|
ev.preventDefault();
|
|
804
804
|
ev.stopPropagation();
|
|
805
|
-
const dropParent = Editor.parent(editor, dropPath)[0];
|
|
806
805
|
const [dropNodeEntry] = Editor.nodes(editor, {
|
|
807
806
|
at: dropPath,
|
|
808
807
|
match: (node2, path2) => {
|
|
@@ -843,7 +842,7 @@ const DraggingProvider = ({
|
|
|
843
842
|
}
|
|
844
843
|
const node = ReactEditor.toDOMNode(editor, dropElement);
|
|
845
844
|
const rect = node.getBoundingClientRect();
|
|
846
|
-
const isTop = ev.clientY < rect.y + rect.height /
|
|
845
|
+
const isTop = ev.clientY < rect.y + rect.height / 2;
|
|
847
846
|
const isInsert = NodeUtils.isParentCategoryType(
|
|
848
847
|
propsData.element.type,
|
|
849
848
|
dropElement.type
|
|
@@ -858,16 +857,35 @@ const DraggingProvider = ({
|
|
|
858
857
|
to: [...targetPath, 0]
|
|
859
858
|
});
|
|
860
859
|
} else if (isTop) {
|
|
860
|
+
const dropIndex = targetPath.pop();
|
|
861
|
+
const sourceIndex = source[source.length - 1];
|
|
862
|
+
if (Path.equals(Path.parent(dropPath), Path.parent(source))) {
|
|
863
|
+
if (sourceIndex !== dropIndex) {
|
|
864
|
+
if (sourceIndex < dropIndex) {
|
|
865
|
+
targetPath.push(dropIndex - 1);
|
|
866
|
+
} else {
|
|
867
|
+
targetPath.push(dropIndex);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
} else {
|
|
871
|
+
targetPath.push(dropIndex);
|
|
872
|
+
}
|
|
873
|
+
if (Path.equals(source, targetPath)) {
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
861
876
|
editor.moveNode({
|
|
862
877
|
at: [...source],
|
|
863
878
|
to: targetPath
|
|
864
879
|
});
|
|
880
|
+
setTimeout(() => {
|
|
881
|
+
setSelectedNodePath(targetPath);
|
|
882
|
+
}, 0);
|
|
865
883
|
} else {
|
|
866
884
|
const dropIndex = targetPath.pop();
|
|
867
885
|
const sourceIndex = source[source.length - 1];
|
|
868
|
-
if (
|
|
886
|
+
if (Path.equals(Path.parent(dropPath), Path.parent(source))) {
|
|
869
887
|
if (sourceIndex !== dropIndex) {
|
|
870
|
-
if (sourceIndex
|
|
888
|
+
if (sourceIndex < dropIndex) {
|
|
871
889
|
targetPath.push(dropIndex);
|
|
872
890
|
} else {
|
|
873
891
|
targetPath.push(dropIndex + 1);
|
|
@@ -876,6 +894,9 @@ const DraggingProvider = ({
|
|
|
876
894
|
} else {
|
|
877
895
|
targetPath.push(dropIndex + 1);
|
|
878
896
|
}
|
|
897
|
+
if (Path.equals(source, targetPath)) {
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
879
900
|
editor.moveNode({
|
|
880
901
|
at: [...source],
|
|
881
902
|
to: targetPath
|
|
@@ -2031,6 +2052,7 @@ const ElementPlaceholder$1 = ({ element, nodeElement, isSelected, isHover, path:
|
|
|
2031
2052
|
};
|
|
2032
2053
|
const styleText$9 = ".dragover-box {\n color: rgb(255, 255, 255);\n text-align: center;\n position: fixed;\n z-index: 999;\n pointer-events: none;\n}\n\n.dragover-box-inner {\n position: absolute;\n width: 100%;\n display: flex;\n justify-content: center;\n}\n\n[data-dragover-direction=top] .dragover-box-inner {\n top: 0;\n}\n\n[data-dragover-direction=bottom] .dragover-box-inner {\n top: 100%;\n}\n\n[data-dragover-direction=middle].dragover-box {\n border: 2px solid var(--drag-color);\n}\n[data-dragover-direction=middle].dragover-box .dragover-box-inner {\n top: 50%;\n transform: translateY(-50%);\n}\n[data-dragover-direction=middle].dragover-box .dragover-box-inner .dragover-line {\n display: none;\n}\n\n.dragover-text-tooltip {\n position: absolute;\n top: 0;\n background-color: var(--drag-color);\n padding: 3px 10px;\n border-radius: 1px;\n height: 15px;\n line-height: 15px;\n font-size: 14px;\n display: inline-block;\n transform: translateY(-50%);\n z-index: 2;\n}\n\n.dragover-line {\n width: 100%;\n position: absolute;\n top: 0;\n border-radius: 3px;\n background: var(--drag-color);\n height: 4px;\n}";
|
|
2033
2054
|
const ElementDragover$1 = ({ element, nodeElement, path: path2 }) => {
|
|
2055
|
+
useEditorState();
|
|
2034
2056
|
const [visible, setVisible] = useState(true);
|
|
2035
2057
|
const { showInsertTips } = useEditorProps();
|
|
2036
2058
|
const direction = nodeElement.getAttribute(
|