@tmagic/editor 1.2.6 → 1.2.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/dist/style.css +1 -2
- package/dist/tmagic-editor.js +18 -2
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +18 -2
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +9 -9
- package/src/layouts/sidebar/LayerPanel.vue +9 -1
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +3 -0
- package/src/services/editor.ts +1 -1
- package/src/theme/nav-menu.scss +1 -2
- package/src/utils/stage.ts +9 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.2.
|
|
2
|
+
"version": "1.2.8",
|
|
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.
|
|
50
|
-
"@tmagic/design": "1.2.
|
|
51
|
-
"@tmagic/form": "1.2.
|
|
52
|
-
"@tmagic/schema": "1.2.
|
|
53
|
-
"@tmagic/stage": "1.2.
|
|
54
|
-
"@tmagic/utils": "1.2.
|
|
49
|
+
"@tmagic/core": "1.2.8",
|
|
50
|
+
"@tmagic/design": "1.2.8",
|
|
51
|
+
"@tmagic/form": "1.2.8",
|
|
52
|
+
"@tmagic/schema": "1.2.8",
|
|
53
|
+
"@tmagic/stage": "1.2.8",
|
|
54
|
+
"@tmagic/utils": "1.2.8",
|
|
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.
|
|
67
|
-
"@tmagic/form": "1.2.
|
|
66
|
+
"@tmagic/design": "1.2.8",
|
|
67
|
+
"@tmagic/form": "1.2.8",
|
|
68
68
|
"monaco-editor": "^0.34.0",
|
|
69
69
|
"vue": "^3.2.37"
|
|
70
70
|
},
|
|
@@ -221,10 +221,15 @@ watch(nodes, (nodes) => {
|
|
|
221
221
|
) {
|
|
222
222
|
tree.value?.setCheckedKeys([], false);
|
|
223
223
|
|
|
224
|
-
[currentNodeKey.value] = ids;
|
|
225
224
|
checkedKeys.value = ids.filter((id) => id !== page.value?.id);
|
|
226
225
|
expandedKeys.value = union(expandedKeys.value, ids);
|
|
227
226
|
}
|
|
227
|
+
|
|
228
|
+
[currentNodeKey.value] = ids;
|
|
229
|
+
|
|
230
|
+
setTimeout(() => {
|
|
231
|
+
tree.value?.setCurrentKey(currentNodeKey.value);
|
|
232
|
+
});
|
|
228
233
|
});
|
|
229
234
|
|
|
230
235
|
watch(isMultiSelect, (isMultiSelect) => {
|
|
@@ -287,6 +292,9 @@ const toggleClickFlag = () => {
|
|
|
287
292
|
|
|
288
293
|
// 选择节点多选框
|
|
289
294
|
const checkHandler = (data: MNode, { checkedNodes }: any): void => {
|
|
295
|
+
if (!isCtrlKeyDown.value && nodes.value.length < 2) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
290
298
|
if (checkedNodes.length > 0) {
|
|
291
299
|
multiSelect(checkedNodes.map((node: MNode) => node.id));
|
|
292
300
|
} else {
|
package/src/services/editor.ts
CHANGED
package/src/theme/nav-menu.scss
CHANGED
package/src/utils/stage.ts
CHANGED
|
@@ -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('父节点为空');
|