easy-email-pro-theme 1.7.6 → 1.8.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
|
@@ -1347,6 +1347,7 @@ const useElementInteract = () => {
|
|
|
1347
1347
|
const editor = useSlate();
|
|
1348
1348
|
const { setSelectedNodePath, setHoverNodePath, selectedNodePath } = useEditorState();
|
|
1349
1349
|
const { selectedNode } = useSelectedNode();
|
|
1350
|
+
const { emptyPageElement } = useEditorProps();
|
|
1350
1351
|
const lastSelectedNode = useRef(null);
|
|
1351
1352
|
const lastSelectedNodePath = useRef(null);
|
|
1352
1353
|
if (!isEqual$3(lastSelectedNodePath.current, selectedNodePath)) {
|
|
@@ -1409,17 +1410,24 @@ const useElementInteract = () => {
|
|
|
1409
1410
|
at: [0, pageElement.children.length - index2 - 1]
|
|
1410
1411
|
});
|
|
1411
1412
|
});
|
|
1412
|
-
|
|
1413
|
-
editor
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1413
|
+
if (emptyPageElement) {
|
|
1414
|
+
editor.replaceNode({
|
|
1415
|
+
node: emptyPageElement,
|
|
1416
|
+
path: [0]
|
|
1417
|
+
});
|
|
1418
|
+
} else {
|
|
1419
|
+
Transforms.setNodes(
|
|
1420
|
+
editor,
|
|
1421
|
+
__spreadValues({}, omit$2(newPageElement, ["children"])),
|
|
1422
|
+
{
|
|
1423
|
+
at: [0]
|
|
1424
|
+
}
|
|
1425
|
+
);
|
|
1426
|
+
}
|
|
1419
1427
|
});
|
|
1420
1428
|
setSelectedNodePath(null);
|
|
1421
1429
|
Transforms.deselect(editor);
|
|
1422
|
-
}, [editor, setSelectedNodePath]);
|
|
1430
|
+
}, [editor, emptyPageElement, setSelectedNodePath]);
|
|
1423
1431
|
const resetSelectedNode = useEventCallback(() => {
|
|
1424
1432
|
if (!selectedNodePath || !lastSelectedNode.current)
|
|
1425
1433
|
return;
|