@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.
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.1.
|
|
2
|
+
"version": "1.1.3",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"dist/*",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@babel/core": "^7.18.0",
|
|
47
47
|
"@element-plus/icons-vue": "^2.0.9",
|
|
48
|
-
"@tmagic/core": "1.1.
|
|
49
|
-
"@tmagic/form": "1.1.
|
|
50
|
-
"@tmagic/schema": "1.1.
|
|
51
|
-
"@tmagic/stage": "1.1.
|
|
52
|
-
"@tmagic/utils": "1.1.
|
|
48
|
+
"@tmagic/core": "1.1.3",
|
|
49
|
+
"@tmagic/form": "1.1.3",
|
|
50
|
+
"@tmagic/schema": "1.1.3",
|
|
51
|
+
"@tmagic/stage": "1.1.3",
|
|
52
|
+
"@tmagic/utils": "1.1.3",
|
|
53
53
|
"buffer": "^6.0.3",
|
|
54
54
|
"color": "^3.1.3",
|
|
55
55
|
"element-plus": "^2.2.6",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vue": "^3.2.37"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@tmagic/form": "1.1.
|
|
65
|
+
"@tmagic/form": "1.1.3",
|
|
66
66
|
"element-plus": "^2.2.6",
|
|
67
67
|
"monaco-editor": "^0.34.0",
|
|
68
68
|
"vue": "^3.2.37"
|
package/src/services/editor.ts
CHANGED
|
@@ -629,12 +629,18 @@ class Editor extends BaseService {
|
|
|
629
629
|
const brothers: MNode[] = parent?.items || [];
|
|
630
630
|
const index = brothers.findIndex((item) => `${item.id}` === `${node?.id}`);
|
|
631
631
|
|
|
632
|
+
// 流式布局与绝对定位布局操作的相反的
|
|
633
|
+
const layout = await this.getLayout(parent, node);
|
|
634
|
+
const isRelative = layout === Layout.RELATIVE;
|
|
635
|
+
|
|
636
|
+
brothers.splice(index, 1);
|
|
637
|
+
|
|
632
638
|
if (offset === LayerOffset.TOP) {
|
|
633
|
-
brothers.splice(brothers.length - 1, 0,
|
|
639
|
+
brothers.splice(isRelative ? 0 : brothers.length - 1, 0, node);
|
|
634
640
|
} else if (offset === LayerOffset.BOTTOM) {
|
|
635
|
-
brothers.splice(
|
|
641
|
+
brothers.splice(isRelative ? brothers.length - 1 : 0, 0, node);
|
|
636
642
|
} else {
|
|
637
|
-
brothers.splice(index +
|
|
643
|
+
brothers.splice(index + (isRelative ? -offset : offset), 0, node);
|
|
638
644
|
}
|
|
639
645
|
|
|
640
646
|
const grandparent = this.getParentById(parent.id);
|