@tmagic/editor 1.3.0-beta.3 → 1.3.0-beta.5
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 +4 -4
- package/dist/tmagic-editor.js +181 -157
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +180 -155
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +10 -10
- package/src/components/Icon.vue +5 -1
- package/src/fields/CodeSelectCol.vue +1 -2
- package/src/fields/DataSourceMethodSelect.vue +0 -3
- package/src/fields/EventSelect.vue +4 -5
- package/src/fields/UISelect.vue +3 -3
- package/src/hooks/use-stage.ts +7 -2
- package/src/layouts/sidebar/ComponentListPanel.vue +4 -3
- package/src/layouts/sidebar/layer/LayerNode.vue +7 -5
- package/src/layouts/sidebar/layer/LayerPanel.vue +4 -2
- package/src/layouts/sidebar/layer/use-keybinding.ts +11 -8
- package/src/layouts/sidebar/layer/use-node-status.ts +9 -5
- package/src/layouts/workspace/viewer/Stage.vue +2 -1
- package/src/theme/event.scss +1 -3
- package/src/theme/framework.scss +0 -2
- package/src/theme/layer-panel.scss +4 -0
- package/src/type.ts +19 -0
- package/src/utils/keybinding-config.ts +31 -26
- package/src/utils/props.ts +1 -0
- package/types/layouts/sidebar/layer/LayerNode.vue.d.ts +1 -1
- package/types/layouts/sidebar/layer/use-keybinding.d.ts +3 -2
- package/types/type.d.ts +18 -0
- package/types/utils/keybinding-config.d.ts +4 -0
|
@@ -1260,6 +1260,7 @@
|
|
|
1260
1260
|
{
|
|
1261
1261
|
name: "events",
|
|
1262
1262
|
src: "component",
|
|
1263
|
+
labelWidth: "100px",
|
|
1263
1264
|
type: "event-select"
|
|
1264
1265
|
}
|
|
1265
1266
|
]
|
|
@@ -1490,6 +1491,7 @@
|
|
|
1490
1491
|
DragType2["LAYER_TREE"] = "layer-tree";
|
|
1491
1492
|
return DragType2;
|
|
1492
1493
|
})(DragType || {});
|
|
1494
|
+
const UI_SELECT_MODE_EVENT_NAME = "ui-select";
|
|
1493
1495
|
|
|
1494
1496
|
const COPY_STORAGE_KEY = "$MagicEditorCopyData";
|
|
1495
1497
|
const getPageList = (app) => {
|
|
@@ -2940,6 +2942,7 @@
|
|
|
2940
2942
|
icon: {}
|
|
2941
2943
|
},
|
|
2942
2944
|
setup(__props) {
|
|
2945
|
+
const isRelativePath = (str) => /^(\.|(\.\.)?\/)/.test(str);
|
|
2943
2946
|
return (_ctx, _cache) => {
|
|
2944
2947
|
return !_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
|
|
2945
2948
|
key: 0,
|
|
@@ -2949,7 +2952,7 @@
|
|
|
2949
2952
|
vue.createVNode(vue.unref(iconsVue.Edit))
|
|
2950
2953
|
]),
|
|
2951
2954
|
_: 1
|
|
2952
|
-
})) : typeof _ctx.icon === "string" && _ctx.icon.startsWith("http") ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
|
|
2955
|
+
})) : typeof _ctx.icon === "string" && (_ctx.icon.startsWith("http") || isRelativePath(_ctx.icon)) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
|
|
2953
2956
|
key: 1,
|
|
2954
2957
|
class: "magic-editor-icon"
|
|
2955
2958
|
}, {
|
|
@@ -3077,9 +3080,7 @@
|
|
|
3077
3080
|
);
|
|
3078
3081
|
const selectConfig = {
|
|
3079
3082
|
type: "select",
|
|
3080
|
-
text: "代码块",
|
|
3081
3083
|
name: props.name,
|
|
3082
|
-
labelWidth: "80px",
|
|
3083
3084
|
options: () => {
|
|
3084
3085
|
if (codeDsl.value) {
|
|
3085
3086
|
return lodashEs.map(codeDsl.value, (value, key) => ({
|
|
@@ -3113,8 +3114,9 @@
|
|
|
3113
3114
|
class: "select",
|
|
3114
3115
|
config: selectConfig,
|
|
3115
3116
|
model: _ctx.model,
|
|
3117
|
+
size: _ctx.size,
|
|
3116
3118
|
onChange: onParamsChangeHandler
|
|
3117
|
-
}, null, 8, ["model"]),
|
|
3119
|
+
}, null, 8, ["model", "size"]),
|
|
3118
3120
|
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$M, {
|
|
3119
3121
|
key: 0,
|
|
3120
3122
|
class: "icon",
|
|
@@ -3933,7 +3935,6 @@
|
|
|
3933
3935
|
if (!paramStatements)
|
|
3934
3936
|
return [];
|
|
3935
3937
|
return paramStatements.map((paramState) => ({
|
|
3936
|
-
labelWidth: "100px",
|
|
3937
3938
|
text: paramState.name,
|
|
3938
3939
|
...paramState
|
|
3939
3940
|
}));
|
|
@@ -3962,9 +3963,7 @@
|
|
|
3962
3963
|
);
|
|
3963
3964
|
const cascaderConfig = vue.computed(() => ({
|
|
3964
3965
|
type: "cascader",
|
|
3965
|
-
text: "数据源方法",
|
|
3966
3966
|
name: props.name,
|
|
3967
|
-
labelWidth: "80px",
|
|
3968
3967
|
options: methodsOptions.value,
|
|
3969
3968
|
onChange: (formState, dataSourceMethod) => {
|
|
3970
3969
|
setParamsConfig(dataSourceMethod, formState);
|
|
@@ -4370,7 +4369,6 @@
|
|
|
4370
4369
|
const defaultActionTypeConfig = {
|
|
4371
4370
|
name: "actionType",
|
|
4372
4371
|
text: "联动类型",
|
|
4373
|
-
labelWidth: "80px",
|
|
4374
4372
|
type: "select",
|
|
4375
4373
|
defaultValue: schema.ActionType.COMP,
|
|
4376
4374
|
options: () => [
|
|
@@ -4399,7 +4397,6 @@
|
|
|
4399
4397
|
const defaultTargetCompConfig = {
|
|
4400
4398
|
name: "to",
|
|
4401
4399
|
text: "联动组件",
|
|
4402
|
-
labelWidth: "80px",
|
|
4403
4400
|
type: "ui-select",
|
|
4404
4401
|
display: (mForm, { model }) => model.actionType === schema.ActionType.COMP
|
|
4405
4402
|
};
|
|
@@ -4409,7 +4406,6 @@
|
|
|
4409
4406
|
const defaultCompActionConfig = {
|
|
4410
4407
|
name: "method",
|
|
4411
4408
|
text: "动作",
|
|
4412
|
-
labelWidth: "80px",
|
|
4413
4409
|
type: "select",
|
|
4414
4410
|
display: (mForm, { model }) => model.actionType === schema.ActionType.COMP,
|
|
4415
4411
|
options: (mForm, { model }) => {
|
|
@@ -4427,7 +4423,7 @@
|
|
|
4427
4423
|
const codeActionConfig = vue.computed(() => {
|
|
4428
4424
|
const defaultCodeActionConfig = {
|
|
4429
4425
|
type: "code-select-col",
|
|
4430
|
-
|
|
4426
|
+
text: "代码块",
|
|
4431
4427
|
name: "codeId",
|
|
4432
4428
|
disabled: () => !codeBlockService?.getEditStatus(),
|
|
4433
4429
|
display: (mForm, { model }) => model.actionType === schema.ActionType.CODE
|
|
@@ -4437,8 +4433,8 @@
|
|
|
4437
4433
|
const dataSourceActionConfig = vue.computed(() => {
|
|
4438
4434
|
const defaultDataSourceActionConfig = {
|
|
4439
4435
|
type: "data-source-method-select",
|
|
4436
|
+
text: "数据源方法",
|
|
4440
4437
|
name: "dataSourceMethod",
|
|
4441
|
-
labelWidth: 0,
|
|
4442
4438
|
display: (mForm, { model }) => model.actionType === schema.ActionType.DATA_SOURCE
|
|
4443
4439
|
};
|
|
4444
4440
|
return { ...defaultDataSourceActionConfig, ...props.config.dataSourceActionConfig };
|
|
@@ -4484,6 +4480,7 @@
|
|
|
4484
4480
|
name: "actions",
|
|
4485
4481
|
expandAll: true,
|
|
4486
4482
|
enableToggleMode: false,
|
|
4483
|
+
titlePrefix: "动作",
|
|
4487
4484
|
items: [
|
|
4488
4485
|
actionTypeConfig.value,
|
|
4489
4486
|
targetCompConfig.value,
|
|
@@ -4553,6 +4550,7 @@
|
|
|
4553
4550
|
size: _ctx.size,
|
|
4554
4551
|
config: actionsConfig.value,
|
|
4555
4552
|
model: cardItem,
|
|
4553
|
+
"label-width": _ctx.config.labelWidth || "100px",
|
|
4556
4554
|
onChange: onChangeHandler
|
|
4557
4555
|
}, {
|
|
4558
4556
|
header: vue.withCtx(() => [
|
|
@@ -4574,7 +4572,7 @@
|
|
|
4574
4572
|
}, null, 8, ["icon", "disabled", "size", "onClick"])
|
|
4575
4573
|
]),
|
|
4576
4574
|
_: 2
|
|
4577
|
-
}, 1032, ["disabled", "size", "config", "model"]);
|
|
4575
|
+
}, 1032, ["disabled", "size", "config", "model", "label-width"]);
|
|
4578
4576
|
}), 128))
|
|
4579
4577
|
]))
|
|
4580
4578
|
]);
|
|
@@ -4715,7 +4713,7 @@
|
|
|
4715
4713
|
return;
|
|
4716
4714
|
services.uiService.set("uiSelectMode", false);
|
|
4717
4715
|
uiSelectMode.value = false;
|
|
4718
|
-
globalThis.document.removeEventListener(
|
|
4716
|
+
globalThis.document.removeEventListener(UI_SELECT_MODE_EVENT_NAME, clickHandler);
|
|
4719
4717
|
};
|
|
4720
4718
|
const clickHandler = ({ detail }) => {
|
|
4721
4719
|
if (detail.id) {
|
|
@@ -4736,7 +4734,7 @@
|
|
|
4736
4734
|
return;
|
|
4737
4735
|
services.uiService.set("uiSelectMode", true);
|
|
4738
4736
|
uiSelectMode.value = true;
|
|
4739
|
-
globalThis.document.addEventListener(
|
|
4737
|
+
globalThis.document.addEventListener(UI_SELECT_MODE_EVENT_NAME, clickHandler);
|
|
4740
4738
|
};
|
|
4741
4739
|
const deleteHandler = () => {
|
|
4742
4740
|
if (props.model) {
|
|
@@ -6894,7 +6892,7 @@
|
|
|
6894
6892
|
if (!nodeStatusMap?.value)
|
|
6895
6893
|
return;
|
|
6896
6894
|
if (uiService?.get("uiSelectMode")) {
|
|
6897
|
-
document.dispatchEvent(new CustomEvent(
|
|
6895
|
+
document.dispatchEvent(new CustomEvent(UI_SELECT_MODE_EVENT_NAME, { detail: props.data }));
|
|
6898
6896
|
return;
|
|
6899
6897
|
}
|
|
6900
6898
|
if (hasChilren.value && !props.isCtrlKeyDown) {
|
|
@@ -6908,7 +6906,10 @@
|
|
|
6908
6906
|
};
|
|
6909
6907
|
const contextmenuHandler = (event) => {
|
|
6910
6908
|
event.preventDefault();
|
|
6911
|
-
|
|
6909
|
+
const nodes = editorService?.get("nodes") || [];
|
|
6910
|
+
if (nodes.length < 2 || !nodes.includes(props.data)) {
|
|
6911
|
+
nodeClickHandler();
|
|
6912
|
+
}
|
|
6912
6913
|
emit("node-contextmenu", event, props.data);
|
|
6913
6914
|
};
|
|
6914
6915
|
const nodeContentmenuHandler = (event, node) => {
|
|
@@ -7013,7 +7014,131 @@
|
|
|
7013
7014
|
}
|
|
7014
7015
|
});
|
|
7015
7016
|
|
|
7016
|
-
|
|
7017
|
+
var KeyBindingContainerKey = /* @__PURE__ */ ((KeyBindingContainerKey2) => {
|
|
7018
|
+
KeyBindingContainerKey2["STAGE"] = "stage";
|
|
7019
|
+
KeyBindingContainerKey2["LAYER_PANEL"] = "layer-panel";
|
|
7020
|
+
return KeyBindingContainerKey2;
|
|
7021
|
+
})(KeyBindingContainerKey || {});
|
|
7022
|
+
const keybindingConfig = [
|
|
7023
|
+
{
|
|
7024
|
+
command: KeyBindingCommand.DELETE_NODE,
|
|
7025
|
+
keybinding: ["delete", "backspace"],
|
|
7026
|
+
when: [
|
|
7027
|
+
["stage" /* STAGE */, "keyup"],
|
|
7028
|
+
["layer-panel" /* LAYER_PANEL */, "keydown"]
|
|
7029
|
+
]
|
|
7030
|
+
},
|
|
7031
|
+
{
|
|
7032
|
+
command: KeyBindingCommand.COPY_NODE,
|
|
7033
|
+
keybinding: "ctrl+c",
|
|
7034
|
+
when: [
|
|
7035
|
+
["stage" /* STAGE */, "keydown"],
|
|
7036
|
+
["layer-panel" /* LAYER_PANEL */, "keydown"]
|
|
7037
|
+
]
|
|
7038
|
+
},
|
|
7039
|
+
{
|
|
7040
|
+
command: KeyBindingCommand.PASTE_NODE,
|
|
7041
|
+
keybinding: "ctrl+v",
|
|
7042
|
+
when: [
|
|
7043
|
+
["stage" /* STAGE */, "keydown"],
|
|
7044
|
+
["layer-panel" /* LAYER_PANEL */, "keydown"]
|
|
7045
|
+
]
|
|
7046
|
+
},
|
|
7047
|
+
{
|
|
7048
|
+
command: KeyBindingCommand.CUT_NODE,
|
|
7049
|
+
keybinding: "ctrl+x",
|
|
7050
|
+
when: [
|
|
7051
|
+
["stage" /* STAGE */, "keydown"],
|
|
7052
|
+
["layer-panel" /* LAYER_PANEL */, "keydown"]
|
|
7053
|
+
]
|
|
7054
|
+
},
|
|
7055
|
+
{
|
|
7056
|
+
command: KeyBindingCommand.UNDO,
|
|
7057
|
+
keybinding: "ctrl+z",
|
|
7058
|
+
when: [
|
|
7059
|
+
["stage" /* STAGE */, "keydown"],
|
|
7060
|
+
["layer-panel" /* LAYER_PANEL */, "keydown"]
|
|
7061
|
+
]
|
|
7062
|
+
},
|
|
7063
|
+
{
|
|
7064
|
+
command: KeyBindingCommand.REDO,
|
|
7065
|
+
keybinding: "ctrl+shift+z",
|
|
7066
|
+
when: [
|
|
7067
|
+
["stage" /* STAGE */, "keydown"],
|
|
7068
|
+
["layer-panel" /* LAYER_PANEL */, "keydown"]
|
|
7069
|
+
]
|
|
7070
|
+
},
|
|
7071
|
+
{
|
|
7072
|
+
command: KeyBindingCommand.MOVE_UP_1,
|
|
7073
|
+
keybinding: "up",
|
|
7074
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7075
|
+
},
|
|
7076
|
+
{
|
|
7077
|
+
command: KeyBindingCommand.MOVE_DOWN_1,
|
|
7078
|
+
keybinding: "down",
|
|
7079
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7080
|
+
},
|
|
7081
|
+
{
|
|
7082
|
+
command: KeyBindingCommand.MOVE_LEFT_1,
|
|
7083
|
+
keybinding: "left",
|
|
7084
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7085
|
+
},
|
|
7086
|
+
{
|
|
7087
|
+
command: KeyBindingCommand.MOVE_RIGHT_1,
|
|
7088
|
+
keybinding: "right",
|
|
7089
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7090
|
+
},
|
|
7091
|
+
{
|
|
7092
|
+
command: KeyBindingCommand.MOVE_UP_10,
|
|
7093
|
+
keybinding: "ctrl+up",
|
|
7094
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7095
|
+
},
|
|
7096
|
+
{
|
|
7097
|
+
command: KeyBindingCommand.MOVE_DOWN_10,
|
|
7098
|
+
keybinding: "ctrl+down",
|
|
7099
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7100
|
+
},
|
|
7101
|
+
{
|
|
7102
|
+
command: KeyBindingCommand.MOVE_LEFT_10,
|
|
7103
|
+
keybinding: "ctrl+left",
|
|
7104
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7105
|
+
},
|
|
7106
|
+
{
|
|
7107
|
+
command: KeyBindingCommand.MOVE_RIGHT_10,
|
|
7108
|
+
keybinding: "ctrl+right",
|
|
7109
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7110
|
+
},
|
|
7111
|
+
{
|
|
7112
|
+
command: KeyBindingCommand.SWITCH_NODE,
|
|
7113
|
+
keybinding: "tab",
|
|
7114
|
+
when: [
|
|
7115
|
+
["stage" /* STAGE */, "keydown"],
|
|
7116
|
+
["layer-panel" /* LAYER_PANEL */, "keydown"]
|
|
7117
|
+
]
|
|
7118
|
+
},
|
|
7119
|
+
{
|
|
7120
|
+
command: KeyBindingCommand.ZOOM_IN,
|
|
7121
|
+
keybinding: ["ctrl+=", "ctrl+numpadplus"],
|
|
7122
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7123
|
+
},
|
|
7124
|
+
{
|
|
7125
|
+
command: KeyBindingCommand.ZOOM_OUT,
|
|
7126
|
+
keybinding: ["ctrl+-", "ctrl+numpad-"],
|
|
7127
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7128
|
+
},
|
|
7129
|
+
{
|
|
7130
|
+
command: KeyBindingCommand.ZOOM_FIT,
|
|
7131
|
+
keybinding: "ctrl+0",
|
|
7132
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7133
|
+
},
|
|
7134
|
+
{
|
|
7135
|
+
command: KeyBindingCommand.ZOOM_RESET,
|
|
7136
|
+
keybinding: "ctrl+1",
|
|
7137
|
+
when: [["stage" /* STAGE */, "keydown"]]
|
|
7138
|
+
}
|
|
7139
|
+
];
|
|
7140
|
+
|
|
7141
|
+
const useKeybinding = (services, contianer) => {
|
|
7017
7142
|
const keybindingService = services?.keybindingService;
|
|
7018
7143
|
const isCtrlKeyDown = vue.ref(false);
|
|
7019
7144
|
const windowBlurHandler = () => {
|
|
@@ -7037,11 +7162,14 @@
|
|
|
7037
7162
|
when: [["global", "keyup"]]
|
|
7038
7163
|
}
|
|
7039
7164
|
]);
|
|
7040
|
-
vue.
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7165
|
+
vue.watchEffect(() => {
|
|
7166
|
+
if (contianer.value) {
|
|
7167
|
+
globalThis.addEventListener("blur", windowBlurHandler);
|
|
7168
|
+
keybindingService?.registeEl(KeyBindingContainerKey.LAYER_PANEL, contianer.value);
|
|
7169
|
+
} else {
|
|
7170
|
+
globalThis.removeEventListener("blur", windowBlurHandler);
|
|
7171
|
+
keybindingService?.unregisteEl(KeyBindingContainerKey.LAYER_PANEL);
|
|
7172
|
+
}
|
|
7045
7173
|
});
|
|
7046
7174
|
return {
|
|
7047
7175
|
isCtrlKeyDown
|
|
@@ -7106,16 +7234,20 @@
|
|
|
7106
7234
|
);
|
|
7107
7235
|
services?.editorService.on("add", (newNodes) => {
|
|
7108
7236
|
newNodes.forEach((node) => {
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7237
|
+
traverseNode(node, (node2) => {
|
|
7238
|
+
nodeStatusMap.value?.set(node2.id, {
|
|
7239
|
+
visible: true,
|
|
7240
|
+
expand: Array.isArray(node2.items),
|
|
7241
|
+
selected: true
|
|
7242
|
+
});
|
|
7113
7243
|
});
|
|
7114
7244
|
});
|
|
7115
7245
|
});
|
|
7116
7246
|
services?.editorService.on("remove", (nodes2) => {
|
|
7117
7247
|
nodes2.forEach((node) => {
|
|
7118
|
-
|
|
7248
|
+
traverseNode(node, (node2) => {
|
|
7249
|
+
nodeStatusMap.value?.delete(node2.id);
|
|
7250
|
+
});
|
|
7119
7251
|
});
|
|
7120
7252
|
});
|
|
7121
7253
|
return {
|
|
@@ -7135,10 +7267,11 @@
|
|
|
7135
7267
|
setup(__props) {
|
|
7136
7268
|
const services = vue.inject("services");
|
|
7137
7269
|
const editorService = services?.editorService;
|
|
7270
|
+
const layerTreeContainer = vue.ref();
|
|
7138
7271
|
const page = vue.computed(() => editorService?.get("page"));
|
|
7139
7272
|
const root = vue.computed(() => editorService?.get("root"));
|
|
7140
7273
|
const { nodeStatusMap } = useNodeStatus(services, page);
|
|
7141
|
-
const { isCtrlKeyDown } = useKeybinding(services);
|
|
7274
|
+
const { isCtrlKeyDown } = useKeybinding(services, layerTreeContainer);
|
|
7142
7275
|
vue.provide("nodeStatusMap", nodeStatusMap);
|
|
7143
7276
|
const { filterText, filterTextChangeHandler } = useFilter(nodeStatusMap, page);
|
|
7144
7277
|
const collapseAllHandler = () => {
|
|
@@ -7165,6 +7298,8 @@
|
|
|
7165
7298
|
vue.createVNode(_sfc_main$t, { onSearch: vue.unref(filterTextChangeHandler) }, null, 8, ["onSearch"]),
|
|
7166
7299
|
vue.createElementVNode("div", {
|
|
7167
7300
|
class: "magic-editor-layer-tree",
|
|
7301
|
+
ref_key: "layerTreeContainer",
|
|
7302
|
+
ref: layerTreeContainer,
|
|
7168
7303
|
tabindex: "-1",
|
|
7169
7304
|
onDragover: _cache[0] || (_cache[0] = //@ts-ignore
|
|
7170
7305
|
(...args) => vue.unref(handleDragOver) && vue.unref(handleDragOver)(...args))
|
|
@@ -7181,7 +7316,7 @@
|
|
|
7181
7316
|
]),
|
|
7182
7317
|
_: 3
|
|
7183
7318
|
}, 8, ["data", "filter-text", "is-ctrl-key-down"])) : vue.createCommentVNode("", true)
|
|
7184
|
-
],
|
|
7319
|
+
], 544),
|
|
7185
7320
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
7186
7321
|
vue.createVNode(_sfc_main$j, {
|
|
7187
7322
|
ref_key: "menu",
|
|
@@ -7302,10 +7437,18 @@
|
|
|
7302
7437
|
onDrag: dragHandler
|
|
7303
7438
|
}, [
|
|
7304
7439
|
vue.renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
|
|
7305
|
-
vue.createVNode(
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7440
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
7441
|
+
placement: "right",
|
|
7442
|
+
disabled: !Boolean(item.desc),
|
|
7443
|
+
content: item.desc
|
|
7444
|
+
}, {
|
|
7445
|
+
default: vue.withCtx(() => [
|
|
7446
|
+
vue.createVNode(_sfc_main$M, {
|
|
7447
|
+
icon: item.icon
|
|
7448
|
+
}, null, 8, ["icon"])
|
|
7449
|
+
]),
|
|
7450
|
+
_: 2
|
|
7451
|
+
}, 1032, ["disabled", "content"]),
|
|
7309
7452
|
vue.createElementVNode("span", {
|
|
7310
7453
|
title: item.text
|
|
7311
7454
|
}, vue.toDisplayString(item.text), 9, _hoisted_2$7)
|
|
@@ -7916,7 +8059,7 @@
|
|
|
7916
8059
|
canSelect: (el, event, stop) => {
|
|
7917
8060
|
const elCanSelect = stageOptions.canSelect(el);
|
|
7918
8061
|
if (uiSelectMode.value && elCanSelect && event.type === "mousedown") {
|
|
7919
|
-
document.dispatchEvent(new CustomEvent(
|
|
8062
|
+
document.dispatchEvent(new CustomEvent(UI_SELECT_MODE_EVENT_NAME, { detail: el }));
|
|
7920
8063
|
return stop();
|
|
7921
8064
|
}
|
|
7922
8065
|
return elCanSelect;
|
|
@@ -8521,7 +8664,7 @@
|
|
|
8521
8664
|
vue.onMounted(() => {
|
|
8522
8665
|
if (stageWrap.value?.container) {
|
|
8523
8666
|
resizeObserver.observe(stageWrap.value.container);
|
|
8524
|
-
services?.keybindingService.registeEl(
|
|
8667
|
+
services?.keybindingService.registeEl(KeyBindingContainerKey.STAGE, stageWrap.value.container);
|
|
8525
8668
|
}
|
|
8526
8669
|
});
|
|
8527
8670
|
vue.onUnmounted(() => {
|
|
@@ -9593,125 +9736,6 @@
|
|
|
9593
9736
|
}
|
|
9594
9737
|
const keybindingService = new Keybinding();
|
|
9595
9738
|
|
|
9596
|
-
const keybindingConfig = [
|
|
9597
|
-
{
|
|
9598
|
-
command: KeyBindingCommand.DELETE_NODE,
|
|
9599
|
-
keybinding: ["delete", "backspace"],
|
|
9600
|
-
when: [
|
|
9601
|
-
["stage", "keyup"],
|
|
9602
|
-
["layer-panel", "keydown"]
|
|
9603
|
-
]
|
|
9604
|
-
},
|
|
9605
|
-
{
|
|
9606
|
-
command: KeyBindingCommand.COPY_NODE,
|
|
9607
|
-
keybinding: "ctrl+c",
|
|
9608
|
-
when: [
|
|
9609
|
-
["stage", "keydown"],
|
|
9610
|
-
["layer-panel", "keydown"]
|
|
9611
|
-
]
|
|
9612
|
-
},
|
|
9613
|
-
{
|
|
9614
|
-
command: KeyBindingCommand.PASTE_NODE,
|
|
9615
|
-
keybinding: "ctrl+v",
|
|
9616
|
-
when: [
|
|
9617
|
-
["stage", "keydown"],
|
|
9618
|
-
["layer-panel", "keydown"]
|
|
9619
|
-
]
|
|
9620
|
-
},
|
|
9621
|
-
{
|
|
9622
|
-
command: KeyBindingCommand.CUT_NODE,
|
|
9623
|
-
keybinding: "ctrl+x",
|
|
9624
|
-
when: [
|
|
9625
|
-
["stage", "keydown"],
|
|
9626
|
-
["layer-panel", "keydown"]
|
|
9627
|
-
]
|
|
9628
|
-
},
|
|
9629
|
-
{
|
|
9630
|
-
command: KeyBindingCommand.UNDO,
|
|
9631
|
-
keybinding: "ctrl+z",
|
|
9632
|
-
when: [
|
|
9633
|
-
["stage", "keydown"],
|
|
9634
|
-
["layer-panel", "keydown"]
|
|
9635
|
-
]
|
|
9636
|
-
},
|
|
9637
|
-
{
|
|
9638
|
-
command: KeyBindingCommand.REDO,
|
|
9639
|
-
keybinding: "ctrl+shift+z",
|
|
9640
|
-
when: [
|
|
9641
|
-
["stage", "keydown"],
|
|
9642
|
-
["layer-panel", "keydown"]
|
|
9643
|
-
]
|
|
9644
|
-
},
|
|
9645
|
-
{
|
|
9646
|
-
command: KeyBindingCommand.MOVE_UP_1,
|
|
9647
|
-
keybinding: "up",
|
|
9648
|
-
when: [["stage", "keydown"]]
|
|
9649
|
-
},
|
|
9650
|
-
{
|
|
9651
|
-
command: KeyBindingCommand.MOVE_DOWN_1,
|
|
9652
|
-
keybinding: "down",
|
|
9653
|
-
when: [["stage", "keydown"]]
|
|
9654
|
-
},
|
|
9655
|
-
{
|
|
9656
|
-
command: KeyBindingCommand.MOVE_LEFT_1,
|
|
9657
|
-
keybinding: "left",
|
|
9658
|
-
when: [["stage", "keydown"]]
|
|
9659
|
-
},
|
|
9660
|
-
{
|
|
9661
|
-
command: KeyBindingCommand.MOVE_RIGHT_1,
|
|
9662
|
-
keybinding: "right",
|
|
9663
|
-
when: [["stage", "keydown"]]
|
|
9664
|
-
},
|
|
9665
|
-
{
|
|
9666
|
-
command: KeyBindingCommand.MOVE_UP_10,
|
|
9667
|
-
keybinding: "ctrl+up",
|
|
9668
|
-
when: [["stage", "keydown"]]
|
|
9669
|
-
},
|
|
9670
|
-
{
|
|
9671
|
-
command: KeyBindingCommand.MOVE_DOWN_10,
|
|
9672
|
-
keybinding: "ctrl+down",
|
|
9673
|
-
when: [["stage", "keydown"]]
|
|
9674
|
-
},
|
|
9675
|
-
{
|
|
9676
|
-
command: KeyBindingCommand.MOVE_LEFT_10,
|
|
9677
|
-
keybinding: "ctrl+left",
|
|
9678
|
-
when: [["stage", "keydown"]]
|
|
9679
|
-
},
|
|
9680
|
-
{
|
|
9681
|
-
command: KeyBindingCommand.MOVE_RIGHT_10,
|
|
9682
|
-
keybinding: "ctrl+right",
|
|
9683
|
-
when: [["stage", "keydown"]]
|
|
9684
|
-
},
|
|
9685
|
-
{
|
|
9686
|
-
command: KeyBindingCommand.SWITCH_NODE,
|
|
9687
|
-
keybinding: "tab",
|
|
9688
|
-
when: [
|
|
9689
|
-
["stage", "keydown"],
|
|
9690
|
-
["layer-panel", "keydown"]
|
|
9691
|
-
]
|
|
9692
|
-
},
|
|
9693
|
-
{
|
|
9694
|
-
command: KeyBindingCommand.ZOOM_IN,
|
|
9695
|
-
keybinding: ["ctrl+=", "ctrl+numpadplus"],
|
|
9696
|
-
when: [["stage", "keydown"]]
|
|
9697
|
-
},
|
|
9698
|
-
{
|
|
9699
|
-
command: KeyBindingCommand.ZOOM_OUT,
|
|
9700
|
-
keybinding: ["ctrl+-", "ctrl+numpad-"],
|
|
9701
|
-
when: [["stage", "keydown"]]
|
|
9702
|
-
},
|
|
9703
|
-
{
|
|
9704
|
-
command: KeyBindingCommand.ZOOM_FIT,
|
|
9705
|
-
keybinding: "ctrl+0",
|
|
9706
|
-
when: [["stage", "keydown"]]
|
|
9707
|
-
},
|
|
9708
|
-
{
|
|
9709
|
-
command: KeyBindingCommand.ZOOM_RESET,
|
|
9710
|
-
keybinding: "ctrl+1",
|
|
9711
|
-
when: [["stage", "keydown"]]
|
|
9712
|
-
}
|
|
9713
|
-
];
|
|
9714
|
-
|
|
9715
9739
|
const defaultEditorProps = {
|
|
9716
9740
|
componentGroupList: () => [],
|
|
9717
9741
|
datasourceList: () => [],
|
|
@@ -10327,6 +10351,7 @@
|
|
|
10327
10351
|
exports.TMagicCodeEditor = _sfc_main$S;
|
|
10328
10352
|
exports.TMagicEditor = _sfc_main;
|
|
10329
10353
|
exports.ToolButton = _sfc_main$w;
|
|
10354
|
+
exports.UI_SELECT_MODE_EVENT_NAME = UI_SELECT_MODE_EVENT_NAME;
|
|
10330
10355
|
exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
|
|
10331
10356
|
exports.advancedTabConfig = advancedTabConfig;
|
|
10332
10357
|
exports.beforePaste = beforePaste;
|