@tmagic/editor 1.2.5 → 1.2.7

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.2.5",
2
+ "version": "1.2.7",
3
3
  "name": "@tmagic/editor",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -46,12 +46,12 @@
46
46
  "dependencies": {
47
47
  "@babel/core": "^7.18.0",
48
48
  "@element-plus/icons-vue": "^2.0.9",
49
- "@tmagic/core": "1.2.5",
50
- "@tmagic/design": "1.2.5",
51
- "@tmagic/form": "1.2.5",
52
- "@tmagic/schema": "1.2.5",
53
- "@tmagic/stage": "1.2.5",
54
- "@tmagic/utils": "1.2.5",
49
+ "@tmagic/core": "1.2.7",
50
+ "@tmagic/design": "1.2.7",
51
+ "@tmagic/form": "1.2.7",
52
+ "@tmagic/schema": "1.2.7",
53
+ "@tmagic/stage": "1.2.7",
54
+ "@tmagic/utils": "1.2.7",
55
55
  "buffer": "^6.0.3",
56
56
  "color": "^3.1.3",
57
57
  "events": "^3.3.0",
@@ -63,8 +63,8 @@
63
63
  "vue": "^3.2.37"
64
64
  },
65
65
  "peerDependencies": {
66
- "@tmagic/design": "1.2.5",
67
- "@tmagic/form": "1.2.5",
66
+ "@tmagic/design": "1.2.7",
67
+ "@tmagic/form": "1.2.7",
68
68
  "monaco-editor": "^0.34.0",
69
69
  "vue": "^3.2.37"
70
70
  },
@@ -158,6 +158,9 @@ watch(
158
158
  services?.codeBlockService.refreshAllRelations();
159
159
  refreshCodeList();
160
160
  },
161
+ {
162
+ immediate: true,
163
+ },
161
164
  );
162
165
 
163
166
  watch(
@@ -53,8 +53,7 @@
53
53
  padding: 5px;
54
54
  }
55
55
 
56
- .is-text,
57
- i {
56
+ .is-text > i {
58
57
  color: $--font-color;
59
58
  }
60
59
 
@@ -1,6 +1,6 @@
1
1
  import { computed } from 'vue';
2
2
 
3
- import StageCore, { GuidesType, SortEventData, UpdateEventData } from '@tmagic/stage';
3
+ import StageCore, { GuidesType, RemoveEventData, SortEventData, UpdateEventData } from '@tmagic/stage';
4
4
 
5
5
  import editorService from '../services/editor';
6
6
  import uiService from '../services/ui';
@@ -73,6 +73,14 @@ export const useStage = (stageOptions: StageOptions) => {
73
73
  editorService.sort(ev.src, ev.dist);
74
74
  });
75
75
 
76
+ stage.on('remove', (ev: RemoveEventData) => {
77
+ editorService.remove(
78
+ ev.data.map(({ el }) => ({
79
+ id: el.id,
80
+ })),
81
+ );
82
+ });
83
+
76
84
  stage.on('select-parent', () => {
77
85
  const parent = editorService.get('parent');
78
86
  if (!parent) throw new Error('父节点为空');