@tmagic/editor 1.0.0-beta.5 → 1.0.0-beta.6
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.0.0-beta.
|
|
2
|
+
"version": "1.0.0-beta.6",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"main": "dist/tmagic-editor.umd.js",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@element-plus/icons": "0.0.11",
|
|
31
|
-
"@tmagic/core": "^1.0.0-beta.
|
|
32
|
-
"@tmagic/form": "^1.0.0-beta.
|
|
33
|
-
"@tmagic/schema": "^1.0.0-beta.
|
|
34
|
-
"@tmagic/stage": "^1.0.0-beta.
|
|
35
|
-
"@tmagic/utils": "^1.0.0-beta.
|
|
31
|
+
"@tmagic/core": "^1.0.0-beta.6",
|
|
32
|
+
"@tmagic/form": "^1.0.0-beta.6",
|
|
33
|
+
"@tmagic/schema": "^1.0.0-beta.6",
|
|
34
|
+
"@tmagic/stage": "^1.0.0-beta.6",
|
|
35
|
+
"@tmagic/utils": "^1.0.0-beta.6",
|
|
36
36
|
"color": "^3.1.3",
|
|
37
37
|
"element-plus": "^2.0.2",
|
|
38
38
|
"events": "^3.3.0",
|
package/src/services/editor.ts
CHANGED
|
@@ -184,6 +184,10 @@ class Editor extends BaseService {
|
|
|
184
184
|
const { node, parent, page } = this.getNodeInfo(id);
|
|
185
185
|
if (!node) throw new Error('获取不到组件信息');
|
|
186
186
|
|
|
187
|
+
if (node.id === this.state.root?.id) {
|
|
188
|
+
throw new Error('不能选根节点');
|
|
189
|
+
}
|
|
190
|
+
|
|
187
191
|
this.set('node', node);
|
|
188
192
|
this.set('page', page || null);
|
|
189
193
|
this.set('parent', parent || null);
|
|
@@ -155,11 +155,13 @@ export class ScrollViewer {
|
|
|
155
155
|
event.preventDefault();
|
|
156
156
|
event.stopImmediatePropagation();
|
|
157
157
|
event.stopPropagation();
|
|
158
|
-
}
|
|
158
|
+
}
|
|
159
159
|
|
|
160
|
-
this.keydown
|
|
160
|
+
if (event.code !== Keys.ESCAPE || !this.enter || this.keydown) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
161
163
|
|
|
162
|
-
|
|
164
|
+
this.keydown = true;
|
|
163
165
|
|
|
164
166
|
this.target.style.cursor = 'grab';
|
|
165
167
|
this.container.addEventListener('mousedown', this.mousedownHandler);
|