@tmagic/editor 1.1.2 → 1.1.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.
|
@@ -1435,12 +1435,15 @@
|
|
|
1435
1435
|
const node = this.get("node");
|
|
1436
1436
|
const brothers = parent?.items || [];
|
|
1437
1437
|
const index = brothers.findIndex((item) => `${item.id}` === `${node?.id}`);
|
|
1438
|
+
const layout = await this.getLayout(parent, node);
|
|
1439
|
+
const isRelative = layout === Layout.RELATIVE;
|
|
1440
|
+
brothers.splice(index, 1);
|
|
1438
1441
|
if (offset === LayerOffset.TOP) {
|
|
1439
|
-
brothers.splice(brothers.length - 1, 0,
|
|
1442
|
+
brothers.splice(isRelative ? 0 : brothers.length - 1, 0, node);
|
|
1440
1443
|
} else if (offset === LayerOffset.BOTTOM) {
|
|
1441
|
-
brothers.splice(
|
|
1444
|
+
brothers.splice(isRelative ? brothers.length - 1 : 0, 0, node);
|
|
1442
1445
|
} else {
|
|
1443
|
-
brothers.splice(index +
|
|
1446
|
+
brothers.splice(index + (isRelative ? -offset : offset), 0, node);
|
|
1444
1447
|
}
|
|
1445
1448
|
const grandparent = this.getParentById(parent.id);
|
|
1446
1449
|
this.get("stage")?.update({
|