@tmagic/editor 1.0.0-beta.1 → 1.0.0-beta.2

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,14 +1,14 @@
1
1
  {
2
- "version": "1.0.0-beta.1",
2
+ "version": "1.0.0-beta.2",
3
3
  "name": "@tmagic/editor",
4
- "main": "dist/magic-editor.umd.js",
5
- "module": "dist/magic-editor.es.js",
4
+ "main": "dist/tmagic-editor.umd.js",
5
+ "module": "dist/tmagic-editor.es.js",
6
6
  "style": "dist/style.css",
7
7
  "types": "dist/types/src/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "import": "./dist/magic-editor.es.js",
11
- "require": "./dist/magic-editor.umd.js"
10
+ "import": "./dist/tmagic-editor.es.js",
11
+ "require": "./dist/tmagic-editor.umd.js"
12
12
  },
13
13
  "./dist/style.css": {
14
14
  "import": "./dist/style.css",
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@element-plus/icons": "0.0.11",
30
- "@tmagic/core": "^1.0.0-beta.1",
31
- "@tmagic/form": "^1.0.0-beta.1",
32
- "@tmagic/schema": "^1.0.0-beta.1",
33
- "@tmagic/stage": "^1.0.0-beta.1",
34
- "@tmagic/utils": "^1.0.0-beta.1",
30
+ "@tmagic/core": "^1.0.0-beta.2",
31
+ "@tmagic/form": "^1.0.0-beta.2",
32
+ "@tmagic/schema": "^1.0.0-beta.2",
33
+ "@tmagic/stage": "^1.0.0-beta.2",
34
+ "@tmagic/utils": "^1.0.0-beta.2",
35
35
  "color": "^3.1.3",
36
36
  "element-plus": "^2.0.2",
37
37
  "events": "^3.3.0",
@@ -289,8 +289,6 @@ class Editor extends BaseService {
289
289
  if (!info.node) throw new Error(`获取不到id为${config.id}的节点`);
290
290
 
291
291
  const node = cloneDeep(toRaw(info.node));
292
- const { parent } = info;
293
- if (!parent) throw new Error('获取不到父级节点');
294
292
 
295
293
  let newConfig = await this.toggleFixedPosition(toRaw(config), node, this.get<MApp>('root'));
296
294
 
@@ -303,6 +301,9 @@ class Editor extends BaseService {
303
301
  return newConfig;
304
302
  }
305
303
 
304
+ const { parent } = info;
305
+ if (!parent) throw new Error('获取不到父级节点');
306
+
306
307
  const parentNodeItems = parent.items;
307
308
  const index = getNodeIndex(newConfig, parent);
308
309