@tmagic/editor 1.0.0-beta.5 → 1.0.0-beta.8

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.5",
2
+ "version": "1.0.0-beta.8",
3
3
  "name": "@tmagic/editor",
4
4
  "sideEffects": false,
5
5
  "main": "dist/tmagic-editor.umd.js",
@@ -28,13 +28,13 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@element-plus/icons": "0.0.11",
31
- "@tmagic/core": "^1.0.0-beta.5",
32
- "@tmagic/form": "^1.0.0-beta.5",
33
- "@tmagic/schema": "^1.0.0-beta.5",
34
- "@tmagic/stage": "^1.0.0-beta.5",
35
- "@tmagic/utils": "^1.0.0-beta.5",
31
+ "@tmagic/core": "^1.0.0-beta.8",
32
+ "@tmagic/form": "^1.0.0-beta.8",
33
+ "@tmagic/schema": "^1.0.0-beta.8",
34
+ "@tmagic/stage": "^1.0.0-beta.8",
35
+ "@tmagic/utils": "^1.0.0-beta.8",
36
36
  "color": "^3.1.3",
37
- "element-plus": "^2.0.2",
37
+ "element-plus": "^2.1.7",
38
38
  "events": "^3.3.0",
39
39
  "lodash-es": "^4.17.21",
40
40
  "monaco-editor": "^0.32.1",
@@ -55,5 +55,6 @@
55
55
  "vite": "^2.3.7",
56
56
  "vite-plugin-dts": "^0.9.6",
57
57
  "vue-tsc": "^0.0.24"
58
- }
58
+ },
59
+ "gitHead": "ff8e32901775ecc145a82f906d6af6119652d61e"
59
60
  }
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <m-form
3
3
  class="m-editor-props-panel"
4
+ popper-class="m-editor-props-panel-popper"
4
5
  ref="configForm"
5
6
  size="small"
6
7
  :init-values="values"
@@ -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);
@@ -291,7 +295,7 @@ class Editor extends BaseService {
291
295
 
292
296
  let newConfig = await this.toggleFixedPosition(toRaw(config), node, this.get<MApp>('root'));
293
297
 
294
- newConfig = mergeWith(node, newConfig, (objValue, srcValue) => {
298
+ newConfig = mergeWith(cloneDeep(node), newConfig, (objValue, srcValue) => {
295
299
  if (Array.isArray(srcValue)) {
296
300
  return srcValue;
297
301
  }
@@ -355,6 +359,8 @@ class Editor extends BaseService {
355
359
  await this.update(parent);
356
360
  await this.select(node);
357
361
 
362
+ this.get<StageCore>('stage')?.update({ config: cloneDeep(node), root: this.get('root') });
363
+
358
364
  this.addModifiedNodeId(parent.id);
359
365
  this.pushHistoryState();
360
366
  }
@@ -14,4 +14,18 @@
14
14
  .el-tabs__item {
15
15
  font-size: 12px;
16
16
  }
17
+
18
+ span,
19
+ a,
20
+ p {
21
+ font-size: 12px;
22
+ }
23
+ }
24
+
25
+ .m-editor-props-panel-popper {
26
+ span,
27
+ a,
28
+ p {
29
+ font-size: 12px;
30
+ }
17
31
  }
@@ -155,11 +155,13 @@ export class ScrollViewer {
155
155
  event.preventDefault();
156
156
  event.stopImmediatePropagation();
157
157
  event.stopPropagation();
158
- } else if (this.keydown) return;
158
+ }
159
159
 
160
- this.keydown = true;
160
+ if (event.code !== Keys.ESCAPE || !this.enter || this.keydown) {
161
+ return;
162
+ }
161
163
 
162
- event.preventDefault();
164
+ this.keydown = true;
163
165
 
164
166
  this.target.style.cursor = 'grab';
165
167
  this.container.addEventListener('mousedown', this.mousedownHandler);