@tmagic/editor 1.3.0-alpha.5 → 1.3.0-alpha.6
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 +20 -5
- package/dist/tmagic-editor.js +259 -167
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +259 -166
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +10 -10
- package/src/Editor.vue +2 -0
- package/src/{layouts → components}/Resizer.vue +15 -6
- package/src/components/{Layout.vue → SplitView.vue} +1 -1
- package/src/index.ts +2 -1
- package/src/layouts/Framework.vue +3 -3
- package/src/layouts/sidebar/LayerPanel.vue +32 -15
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +3 -3
- package/src/layouts/workspace/Workspace.vue +3 -132
- package/src/services/keybinding.ts +240 -0
- package/src/theme/resizer.scss +25 -10
- package/src/type.ts +3 -1
- package/types/index.d.ts +2 -1
- package/types/services/keybinding.d.ts +12 -0
- package/types/type.d.ts +3 -1
- /package/types/{layouts → components}/Resizer.vue.d.ts +0 -0
- /package/types/components/{Layout.vue.d.ts → SplitView.vue.d.ts} +0 -0
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
196
|
|
|
197
|
-
const _hoisted_1$
|
|
197
|
+
const _hoisted_1$n = ["src"];
|
|
198
198
|
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
199
199
|
...{
|
|
200
200
|
name: "MEditorIcon"
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
class: "magic-editor-icon"
|
|
219
219
|
}, {
|
|
220
220
|
default: vue.withCtx(() => [
|
|
221
|
-
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$
|
|
221
|
+
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$n)
|
|
222
222
|
]),
|
|
223
223
|
_: 1
|
|
224
224
|
})) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
239
|
|
|
240
|
-
const _hoisted_1$
|
|
240
|
+
const _hoisted_1$m = { class: "m-fields-code-select-col" };
|
|
241
241
|
const _hoisted_2$e = { class: "code-select-container" };
|
|
242
242
|
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
243
243
|
...{
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
};
|
|
332
332
|
return (_ctx, _cache) => {
|
|
333
333
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
334
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
334
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
|
|
335
335
|
vue.createElementVNode("div", _hoisted_2$e, [
|
|
336
336
|
vue.createVNode(_component_m_form_container, {
|
|
337
337
|
class: "select",
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
}
|
|
356
356
|
});
|
|
357
357
|
|
|
358
|
-
const _hoisted_1$
|
|
358
|
+
const _hoisted_1$l = { class: "m-editor-data-source-fields" };
|
|
359
359
|
const _hoisted_2$d = { class: "m-editor-data-source-fields-footer" };
|
|
360
360
|
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
361
361
|
...{
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
}
|
|
504
504
|
];
|
|
505
505
|
return (_ctx, _cache) => {
|
|
506
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
506
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
|
|
507
507
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
508
508
|
data: _ctx.model[_ctx.name],
|
|
509
509
|
columns: filedColumns
|
|
@@ -536,7 +536,7 @@
|
|
|
536
536
|
}
|
|
537
537
|
});
|
|
538
538
|
|
|
539
|
-
const _hoisted_1$
|
|
539
|
+
const _hoisted_1$k = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
540
540
|
const _hoisted_2$c = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
541
541
|
const _hoisted_3$5 = { class: "el-input__inner" };
|
|
542
542
|
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -762,7 +762,7 @@
|
|
|
762
762
|
vue.createVNode(_sfc_main$B, { icon: vue.unref(iconsVue.Coin) }, null, 8, ["icon"])
|
|
763
763
|
]),
|
|
764
764
|
default: vue.withCtx(({ item }) => [
|
|
765
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
765
|
+
vue.createElementVNode("div", _hoisted_1$k, [
|
|
766
766
|
vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
|
|
767
767
|
vue.createElementVNode("span", _hoisted_2$c, vue.toDisplayString(item.value), 1)
|
|
768
768
|
])
|
|
@@ -801,7 +801,7 @@
|
|
|
801
801
|
}
|
|
802
802
|
});
|
|
803
803
|
|
|
804
|
-
const _hoisted_1$
|
|
804
|
+
const _hoisted_1$j = { class: "m-fields-event-select" };
|
|
805
805
|
const _hoisted_2$b = {
|
|
806
806
|
key: 1,
|
|
807
807
|
class: "fullWidth"
|
|
@@ -968,7 +968,7 @@
|
|
|
968
968
|
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
969
969
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
970
970
|
const _component_m_form_panel = vue.resolveComponent("m-form-panel");
|
|
971
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
971
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [
|
|
972
972
|
isOldVersion.value ? (vue.openBlock(), vue.createBlock(_component_m_form_table, {
|
|
973
973
|
key: 0,
|
|
974
974
|
ref: "eventForm",
|
|
@@ -1019,7 +1019,7 @@
|
|
|
1019
1019
|
}
|
|
1020
1020
|
});
|
|
1021
1021
|
|
|
1022
|
-
const _hoisted_1$
|
|
1022
|
+
const _hoisted_1$i = { class: "m-fields-key-value" };
|
|
1023
1023
|
const _hoisted_2$a = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
1024
1024
|
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
1025
1025
|
...{
|
|
@@ -1064,7 +1064,7 @@
|
|
|
1064
1064
|
records.value.splice(index, 1);
|
|
1065
1065
|
};
|
|
1066
1066
|
return (_ctx, _cache) => {
|
|
1067
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1067
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
|
|
1068
1068
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
|
|
1069
1069
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1070
1070
|
class: "m-fields-key-value-item",
|
|
@@ -1370,6 +1370,7 @@
|
|
|
1370
1370
|
emits: ["change"],
|
|
1371
1371
|
setup(__props, { emit }) {
|
|
1372
1372
|
const target = vue.ref();
|
|
1373
|
+
const isDraging = vue.ref(false);
|
|
1373
1374
|
let getso;
|
|
1374
1375
|
vue.onMounted(() => {
|
|
1375
1376
|
if (!target.value)
|
|
@@ -1381,19 +1382,24 @@
|
|
|
1381
1382
|
if (!target.value)
|
|
1382
1383
|
return;
|
|
1383
1384
|
emit("change", e.deltaX);
|
|
1385
|
+
}).on("dragStart", () => {
|
|
1386
|
+
isDraging.value = true;
|
|
1387
|
+
}).on("dragEnd", () => {
|
|
1388
|
+
isDraging.value = false;
|
|
1384
1389
|
});
|
|
1385
1390
|
});
|
|
1386
1391
|
vue.onUnmounted(() => {
|
|
1387
1392
|
getso?.unset();
|
|
1393
|
+
isDraging.value = false;
|
|
1388
1394
|
});
|
|
1389
1395
|
return (_ctx, _cache) => {
|
|
1390
1396
|
return vue.openBlock(), vue.createElementBlock("span", {
|
|
1391
1397
|
ref_key: "target",
|
|
1392
1398
|
ref: target,
|
|
1393
|
-
class: "m-editor-resizer"
|
|
1399
|
+
class: vue.normalizeClass(["m-editor-resizer", { "m-editor-resizer-draging": isDraging.value }])
|
|
1394
1400
|
}, [
|
|
1395
1401
|
vue.renderSlot(_ctx.$slots, "default")
|
|
1396
|
-
],
|
|
1402
|
+
], 2);
|
|
1397
1403
|
};
|
|
1398
1404
|
}
|
|
1399
1405
|
});
|
|
@@ -1402,7 +1408,7 @@
|
|
|
1402
1408
|
...{
|
|
1403
1409
|
name: "MEditorLayout"
|
|
1404
1410
|
},
|
|
1405
|
-
__name: "
|
|
1411
|
+
__name: "SplitView",
|
|
1406
1412
|
props: {
|
|
1407
1413
|
left: {},
|
|
1408
1414
|
right: {},
|
|
@@ -3386,7 +3392,7 @@
|
|
|
3386
3392
|
return stage;
|
|
3387
3393
|
};
|
|
3388
3394
|
|
|
3389
|
-
const _hoisted_1$
|
|
3395
|
+
const _hoisted_1$h = { class: "m-editor-empty-panel" };
|
|
3390
3396
|
const _hoisted_2$9 = { class: "m-editor-empty-content" };
|
|
3391
3397
|
const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
|
|
3392
3398
|
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -3409,7 +3415,7 @@
|
|
|
3409
3415
|
});
|
|
3410
3416
|
};
|
|
3411
3417
|
return (_ctx, _cache) => {
|
|
3412
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3418
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
|
|
3413
3419
|
vue.createElementVNode("div", _hoisted_2$9, [
|
|
3414
3420
|
vue.createElementVNode("div", {
|
|
3415
3421
|
class: "m-editor-empty-button",
|
|
@@ -3426,7 +3432,7 @@
|
|
|
3426
3432
|
}
|
|
3427
3433
|
});
|
|
3428
3434
|
|
|
3429
|
-
const _hoisted_1$
|
|
3435
|
+
const _hoisted_1$g = { class: "m-editor" };
|
|
3430
3436
|
const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
3431
3437
|
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
3432
3438
|
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
@@ -3497,7 +3503,7 @@
|
|
|
3497
3503
|
}
|
|
3498
3504
|
};
|
|
3499
3505
|
return (_ctx, _cache) => {
|
|
3500
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3506
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
|
|
3501
3507
|
vue.renderSlot(_ctx.$slots, "header"),
|
|
3502
3508
|
vue.renderSlot(_ctx.$slots, "nav"),
|
|
3503
3509
|
vue.renderSlot(_ctx.$slots, "content-before"),
|
|
@@ -3552,7 +3558,7 @@
|
|
|
3552
3558
|
}
|
|
3553
3559
|
});
|
|
3554
3560
|
|
|
3555
|
-
const _hoisted_1$
|
|
3561
|
+
const _hoisted_1$f = {
|
|
3556
3562
|
key: 1,
|
|
3557
3563
|
class: "menu-item-text"
|
|
3558
3564
|
};
|
|
@@ -3636,7 +3642,7 @@
|
|
|
3636
3642
|
_ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
|
|
3637
3643
|
key: 0,
|
|
3638
3644
|
direction: _ctx.data.direction || "vertical"
|
|
3639
|
-
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3645
|
+
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, vue.toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
3640
3646
|
_ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3641
3647
|
key: 0,
|
|
3642
3648
|
effect: "dark",
|
|
@@ -3891,7 +3897,7 @@
|
|
|
3891
3897
|
}
|
|
3892
3898
|
});
|
|
3893
3899
|
|
|
3894
|
-
const _hoisted_1$
|
|
3900
|
+
const _hoisted_1$e = { class: "m-editor-props-panel" };
|
|
3895
3901
|
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
3896
3902
|
...{
|
|
3897
3903
|
name: "MEditorPropsPanel"
|
|
@@ -3941,7 +3947,7 @@
|
|
|
3941
3947
|
};
|
|
3942
3948
|
__expose({ submit });
|
|
3943
3949
|
return (_ctx, _cache) => {
|
|
3944
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3950
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
|
|
3945
3951
|
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
3946
3952
|
vue.createVNode(vue.unref(form.MForm), {
|
|
3947
3953
|
ref_key: "configForm",
|
|
@@ -3993,7 +3999,7 @@
|
|
|
3993
3999
|
}
|
|
3994
4000
|
});
|
|
3995
4001
|
|
|
3996
|
-
const _hoisted_1$
|
|
4002
|
+
const _hoisted_1$d = { xmlns: "http://www.w3.org/2000/svg" };
|
|
3997
4003
|
const _hoisted_2$7 = /* @__PURE__ */ vue.createElementVNode("g", {
|
|
3998
4004
|
fill: "#7C878E",
|
|
3999
4005
|
"fill-rule": "evenodd"
|
|
@@ -4014,12 +4020,12 @@
|
|
|
4014
4020
|
__name: "AppManageIcon",
|
|
4015
4021
|
setup(__props) {
|
|
4016
4022
|
return (_ctx, _cache) => {
|
|
4017
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
4023
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$d, _hoisted_3$3);
|
|
4018
4024
|
};
|
|
4019
4025
|
}
|
|
4020
4026
|
});
|
|
4021
4027
|
|
|
4022
|
-
const _hoisted_1$
|
|
4028
|
+
const _hoisted_1$c = {
|
|
4023
4029
|
viewBox: "0 0 32 32",
|
|
4024
4030
|
version: "1.1",
|
|
4025
4031
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4036,12 +4042,12 @@
|
|
|
4036
4042
|
__name: "CodeIcon",
|
|
4037
4043
|
setup(__props) {
|
|
4038
4044
|
return (_ctx, _cache) => {
|
|
4039
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
4045
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$c, _hoisted_4$3);
|
|
4040
4046
|
};
|
|
4041
4047
|
}
|
|
4042
4048
|
});
|
|
4043
4049
|
|
|
4044
|
-
const _hoisted_1$
|
|
4050
|
+
const _hoisted_1$b = {
|
|
4045
4051
|
key: 0,
|
|
4046
4052
|
class: "m-editor-content-bottom"
|
|
4047
4053
|
};
|
|
@@ -4145,7 +4151,7 @@
|
|
|
4145
4151
|
language: _ctx.language,
|
|
4146
4152
|
options: codeOptions.value
|
|
4147
4153
|
}, null, 8, ["init-values", "language", "options"]),
|
|
4148
|
-
_ctx.editable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4154
|
+
_ctx.editable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
4149
4155
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4150
4156
|
type: "primary",
|
|
4151
4157
|
class: "button",
|
|
@@ -4201,7 +4207,7 @@
|
|
|
4201
4207
|
}
|
|
4202
4208
|
});
|
|
4203
4209
|
|
|
4204
|
-
const _hoisted_1$
|
|
4210
|
+
const _hoisted_1$a = { class: "code-name-wrapper" };
|
|
4205
4211
|
const _hoisted_2$4 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "代码块名称", -1);
|
|
4206
4212
|
const _hoisted_3$2 = { class: "code-name-wrapper" };
|
|
4207
4213
|
const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "参数", -1);
|
|
@@ -4327,7 +4333,7 @@
|
|
|
4327
4333
|
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
4328
4334
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCard), { shadow: "never" }, {
|
|
4329
4335
|
header: vue.withCtx(() => [
|
|
4330
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4336
|
+
vue.createElementVNode("div", _hoisted_1$a, [
|
|
4331
4337
|
_hoisted_2$4,
|
|
4332
4338
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
4333
4339
|
class: "code-name-input",
|
|
@@ -4369,7 +4375,7 @@
|
|
|
4369
4375
|
}
|
|
4370
4376
|
});
|
|
4371
4377
|
|
|
4372
|
-
const _hoisted_1$
|
|
4378
|
+
const _hoisted_1$9 = {
|
|
4373
4379
|
key: 0,
|
|
4374
4380
|
class: "m-editor-code-block-editor-panel"
|
|
4375
4381
|
};
|
|
@@ -4437,7 +4443,7 @@
|
|
|
4437
4443
|
class: "code-editor-layout"
|
|
4438
4444
|
}, {
|
|
4439
4445
|
center: vue.withCtx(() => [
|
|
4440
|
-
!vue.unref(lodashEs.isEmpty)(codeConfig.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4446
|
+
!vue.unref(lodashEs.isEmpty)(codeConfig.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
4441
4447
|
vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id: id.value }),
|
|
4442
4448
|
codeConfig.value ? (vue.openBlock(), vue.createBlock(_sfc_main$i, {
|
|
4443
4449
|
key: 0,
|
|
@@ -4462,7 +4468,7 @@
|
|
|
4462
4468
|
}
|
|
4463
4469
|
});
|
|
4464
4470
|
|
|
4465
|
-
const _hoisted_1$
|
|
4471
|
+
const _hoisted_1$8 = { class: "search-wrapper" };
|
|
4466
4472
|
const _hoisted_2$3 = ["id"];
|
|
4467
4473
|
const _hoisted_3$1 = { class: "list-item" };
|
|
4468
4474
|
const _hoisted_4$1 = {
|
|
@@ -4565,7 +4571,7 @@
|
|
|
4565
4571
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-dep-list-panel" }, {
|
|
4566
4572
|
default: vue.withCtx(() => [
|
|
4567
4573
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
4568
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4574
|
+
vue.createElementVNode("div", _hoisted_1$8, [
|
|
4569
4575
|
vue.createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
|
|
4570
4576
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
4571
4577
|
key: 0,
|
|
@@ -4760,7 +4766,7 @@
|
|
|
4760
4766
|
}
|
|
4761
4767
|
});
|
|
4762
4768
|
|
|
4763
|
-
const _hoisted_1$
|
|
4769
|
+
const _hoisted_1$7 = { class: "search-wrapper" };
|
|
4764
4770
|
const _hoisted_2$2 = ["id"];
|
|
4765
4771
|
const _hoisted_3 = { class: "list-item" };
|
|
4766
4772
|
const _hoisted_4 = {
|
|
@@ -4829,7 +4835,7 @@
|
|
|
4829
4835
|
return (_ctx, _cache) => {
|
|
4830
4836
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "data-source-list-panel m-editor-dep-list-panel" }, {
|
|
4831
4837
|
default: vue.withCtx(() => [
|
|
4832
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4838
|
+
vue.createElementVNode("div", _hoisted_1$7, [
|
|
4833
4839
|
vue.createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
|
|
4834
4840
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4835
4841
|
type: "primary",
|
|
@@ -4925,7 +4931,7 @@
|
|
|
4925
4931
|
}
|
|
4926
4932
|
});
|
|
4927
4933
|
|
|
4928
|
-
const _hoisted_1$
|
|
4934
|
+
const _hoisted_1$6 = ["onClick", "onDragstart"];
|
|
4929
4935
|
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
4930
4936
|
...{
|
|
4931
4937
|
name: "MEditorComponentListPanel"
|
|
@@ -5043,7 +5049,7 @@
|
|
|
5043
5049
|
_: 2
|
|
5044
5050
|
}, 1032, ["content"])
|
|
5045
5051
|
])
|
|
5046
|
-
], 40, _hoisted_1$
|
|
5052
|
+
], 40, _hoisted_1$6);
|
|
5047
5053
|
}), 128))
|
|
5048
5054
|
]),
|
|
5049
5055
|
_: 2
|
|
@@ -5282,7 +5288,7 @@
|
|
|
5282
5288
|
}
|
|
5283
5289
|
});
|
|
5284
5290
|
|
|
5285
|
-
const _hoisted_1$
|
|
5291
|
+
const _hoisted_1$5 = ["id", "onMouseenter"];
|
|
5286
5292
|
const throttleTime = 150;
|
|
5287
5293
|
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
5288
5294
|
...{
|
|
@@ -5295,6 +5301,7 @@
|
|
|
5295
5301
|
setup(__props) {
|
|
5296
5302
|
const services = vue.inject("services");
|
|
5297
5303
|
const editorService = services?.editorService;
|
|
5304
|
+
const keybindingService = services?.keybindingService;
|
|
5298
5305
|
const tree = vue.ref();
|
|
5299
5306
|
const menu = vue.ref();
|
|
5300
5307
|
const checkedKeys = vue.ref([]);
|
|
@@ -5428,27 +5435,38 @@
|
|
|
5428
5435
|
const windowBlurHandler = () => {
|
|
5429
5436
|
isCtrlKeyDown.value = false;
|
|
5430
5437
|
};
|
|
5438
|
+
const globalKeyupHandler = () => {
|
|
5439
|
+
if (document.activeElement !== tree.value?.$el) {
|
|
5440
|
+
isCtrlKeyDown.value = false;
|
|
5441
|
+
}
|
|
5442
|
+
};
|
|
5431
5443
|
let keycon;
|
|
5432
5444
|
vue.onMounted(() => {
|
|
5433
5445
|
editorService?.on("remove", editorServiceRemoveHandler);
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5446
|
+
if (tree.value?.$el) {
|
|
5447
|
+
keybindingService?.on("keyup", globalKeyupHandler);
|
|
5448
|
+
keycon = new KeyController(tree.value.$el);
|
|
5449
|
+
const isMac = /mac os x/.test(navigator.userAgent.toLowerCase());
|
|
5450
|
+
const ctrl = isMac ? "meta" : "ctrl";
|
|
5451
|
+
keycon.keydown((e) => {
|
|
5452
|
+
if (e.key !== ctrl) {
|
|
5453
|
+
isCtrlKeyDown.value = false;
|
|
5454
|
+
}
|
|
5455
|
+
}).keydown(ctrl, () => {
|
|
5456
|
+
isCtrlKeyDown.value = true;
|
|
5457
|
+
}).keyup(ctrl, () => {
|
|
5439
5458
|
isCtrlKeyDown.value = false;
|
|
5440
|
-
}
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
}).keyup(ctrl, () => {
|
|
5444
|
-
isCtrlKeyDown.value = false;
|
|
5445
|
-
});
|
|
5459
|
+
});
|
|
5460
|
+
tree.value.$el.addEventListener("blur", windowBlurHandler);
|
|
5461
|
+
}
|
|
5446
5462
|
globalThis.addEventListener("blur", windowBlurHandler);
|
|
5447
5463
|
});
|
|
5448
5464
|
vue.onUnmounted(() => {
|
|
5449
5465
|
keycon.destroy();
|
|
5450
5466
|
editorService?.off("remove", editorServiceRemoveHandler);
|
|
5467
|
+
keybindingService?.off("keyup", globalKeyupHandler);
|
|
5451
5468
|
globalThis.removeEventListener("blur", windowBlurHandler);
|
|
5469
|
+
tree.value?.$el.removeEventListener("blur", windowBlurHandler);
|
|
5452
5470
|
});
|
|
5453
5471
|
const highlightHandler = lodashEs.throttle((data) => {
|
|
5454
5472
|
highlight(data);
|
|
@@ -5493,6 +5511,7 @@
|
|
|
5493
5511
|
ref: tree,
|
|
5494
5512
|
"node-key": "id",
|
|
5495
5513
|
"empty-text": "页面空荡荡的",
|
|
5514
|
+
tabindex: "-1",
|
|
5496
5515
|
draggable: "",
|
|
5497
5516
|
"default-expanded-keys": expandedKeys.value,
|
|
5498
5517
|
"default-checked-keys": checkedKeys.value,
|
|
@@ -5526,7 +5545,7 @@
|
|
|
5526
5545
|
}, () => [
|
|
5527
5546
|
vue.createElementVNode("span", null, vue.toDisplayString(`${data.name} (${data.id})`), 1)
|
|
5528
5547
|
])
|
|
5529
|
-
], 40, _hoisted_1$
|
|
5548
|
+
], 40, _hoisted_1$5)
|
|
5530
5549
|
]),
|
|
5531
5550
|
_: 3
|
|
5532
5551
|
}, 8, ["default-expanded-keys", "default-checked-keys", "current-node-key", "data", "highlight-current", "show-checkbox"])) : vue.createCommentVNode("", true),
|
|
@@ -5544,7 +5563,7 @@
|
|
|
5544
5563
|
}
|
|
5545
5564
|
});
|
|
5546
5565
|
|
|
5547
|
-
const _hoisted_1$
|
|
5566
|
+
const _hoisted_1$4 = {
|
|
5548
5567
|
key: 1,
|
|
5549
5568
|
class: "magic-editor-tab-panel-title"
|
|
5550
5569
|
};
|
|
@@ -5632,7 +5651,7 @@
|
|
|
5632
5651
|
key: 0,
|
|
5633
5652
|
icon: config.icon
|
|
5634
5653
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
5635
|
-
config.text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
5654
|
+
config.text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, vue.toDisplayString(config.text), 1)) : vue.createCommentVNode("", true)
|
|
5636
5655
|
]))
|
|
5637
5656
|
]),
|
|
5638
5657
|
default: vue.withCtx(() => [
|
|
@@ -5719,7 +5738,7 @@
|
|
|
5719
5738
|
}
|
|
5720
5739
|
});
|
|
5721
5740
|
|
|
5722
|
-
const _hoisted_1$
|
|
5741
|
+
const _hoisted_1$3 = {
|
|
5723
5742
|
key: 0,
|
|
5724
5743
|
class: "m-editor-breadcrumb"
|
|
5725
5744
|
};
|
|
@@ -5741,7 +5760,7 @@
|
|
|
5741
5760
|
editorService?.get("stage")?.select(node2.id);
|
|
5742
5761
|
};
|
|
5743
5762
|
return (_ctx, _cache) => {
|
|
5744
|
-
return nodes.value.length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
5763
|
+
return nodes.value.length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
|
|
5745
5764
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(path.value, (item, index) => {
|
|
5746
5765
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
5747
5766
|
key: item.id
|
|
@@ -5764,7 +5783,7 @@
|
|
|
5764
5783
|
}
|
|
5765
5784
|
});
|
|
5766
5785
|
|
|
5767
|
-
const _hoisted_1$
|
|
5786
|
+
const _hoisted_1$2 = {
|
|
5768
5787
|
key: 1,
|
|
5769
5788
|
style: { "width": "21px" }
|
|
5770
5789
|
};
|
|
@@ -5857,7 +5876,7 @@
|
|
|
5857
5876
|
onClick: addPage
|
|
5858
5877
|
}, [
|
|
5859
5878
|
vue.createVNode(_sfc_main$B, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
5860
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
5879
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2)),
|
|
5861
5880
|
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5862
5881
|
key: 2,
|
|
5863
5882
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
@@ -5886,7 +5905,7 @@
|
|
|
5886
5905
|
}
|
|
5887
5906
|
});
|
|
5888
5907
|
|
|
5889
|
-
const _hoisted_1 = ["onClick"];
|
|
5908
|
+
const _hoisted_1$1 = ["onClick"];
|
|
5890
5909
|
const _hoisted_2 = { class: "m-editor-page-bar-title" };
|
|
5891
5910
|
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
5892
5911
|
...{
|
|
@@ -5972,7 +5991,7 @@
|
|
|
5972
5991
|
]),
|
|
5973
5992
|
_: 2
|
|
5974
5993
|
}, 1024)
|
|
5975
|
-
], 10, _hoisted_1);
|
|
5994
|
+
], 10, _hoisted_1$1);
|
|
5976
5995
|
}), 128))
|
|
5977
5996
|
]),
|
|
5978
5997
|
_: 3
|
|
@@ -6625,6 +6644,10 @@
|
|
|
6625
6644
|
}
|
|
6626
6645
|
});
|
|
6627
6646
|
|
|
6647
|
+
const _hoisted_1 = {
|
|
6648
|
+
class: "m-editor-workspace",
|
|
6649
|
+
tabindex: "-1"
|
|
6650
|
+
};
|
|
6628
6651
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
6629
6652
|
...{
|
|
6630
6653
|
name: "MEditorWorkspace"
|
|
@@ -6635,112 +6658,9 @@
|
|
|
6635
6658
|
},
|
|
6636
6659
|
setup(__props) {
|
|
6637
6660
|
const services = vue.inject("services");
|
|
6638
|
-
const workspace = vue.ref();
|
|
6639
|
-
const nodes = vue.computed(() => services?.editorService.get("nodes"));
|
|
6640
6661
|
const page = vue.computed(() => services?.editorService.get("page"));
|
|
6641
|
-
const mouseenterHandler = () => {
|
|
6642
|
-
workspace.value?.focus();
|
|
6643
|
-
};
|
|
6644
|
-
const mouseleaveHandler = () => {
|
|
6645
|
-
workspace.value?.blur();
|
|
6646
|
-
};
|
|
6647
|
-
let keycon;
|
|
6648
|
-
vue.onMounted(() => {
|
|
6649
|
-
workspace.value?.addEventListener("mouseenter", mouseenterHandler);
|
|
6650
|
-
workspace.value?.addEventListener("mouseleave", mouseleaveHandler);
|
|
6651
|
-
keycon = new KeyController(workspace.value);
|
|
6652
|
-
const isMac = /mac os x/.test(navigator.userAgent.toLowerCase());
|
|
6653
|
-
const ctrl = isMac ? "meta" : "ctrl";
|
|
6654
|
-
keycon.keyup("delete", (e) => {
|
|
6655
|
-
e.inputEvent.preventDefault();
|
|
6656
|
-
if (!nodes.value || utils.isPage(nodes.value[0]))
|
|
6657
|
-
return;
|
|
6658
|
-
services?.editorService.remove(nodes.value);
|
|
6659
|
-
}).keyup("backspace", (e) => {
|
|
6660
|
-
e.inputEvent.preventDefault();
|
|
6661
|
-
if (!nodes.value || utils.isPage(nodes.value[0]))
|
|
6662
|
-
return;
|
|
6663
|
-
services?.editorService.remove(nodes.value);
|
|
6664
|
-
}).keydown([ctrl, "c"], (e) => {
|
|
6665
|
-
e.inputEvent.preventDefault();
|
|
6666
|
-
nodes.value && services?.editorService.copy(nodes.value);
|
|
6667
|
-
}).keydown([ctrl, "v"], (e) => {
|
|
6668
|
-
e.inputEvent.preventDefault();
|
|
6669
|
-
nodes.value && services?.editorService.paste({ offsetX: 10, offsetY: 10 });
|
|
6670
|
-
}).keydown([ctrl, "x"], (e) => {
|
|
6671
|
-
e.inputEvent.preventDefault();
|
|
6672
|
-
if (!nodes.value || utils.isPage(nodes.value[0]))
|
|
6673
|
-
return;
|
|
6674
|
-
services?.editorService.copy(nodes.value);
|
|
6675
|
-
services?.editorService.remove(nodes.value);
|
|
6676
|
-
}).keydown([ctrl, "z"], (e) => {
|
|
6677
|
-
e.inputEvent.preventDefault();
|
|
6678
|
-
services?.editorService.undo();
|
|
6679
|
-
}).keydown([ctrl, "shift", "z"], (e) => {
|
|
6680
|
-
e.inputEvent.preventDefault();
|
|
6681
|
-
services?.editorService.redo();
|
|
6682
|
-
}).keydown("up", (e) => {
|
|
6683
|
-
e.inputEvent.preventDefault();
|
|
6684
|
-
services?.editorService.move(0, -1);
|
|
6685
|
-
}).keydown("down", (e) => {
|
|
6686
|
-
e.inputEvent.preventDefault();
|
|
6687
|
-
services?.editorService.move(0, 1);
|
|
6688
|
-
}).keydown("left", (e) => {
|
|
6689
|
-
e.inputEvent.preventDefault();
|
|
6690
|
-
services?.editorService.move(-1, 0);
|
|
6691
|
-
}).keydown("right", (e) => {
|
|
6692
|
-
e.inputEvent.preventDefault();
|
|
6693
|
-
services?.editorService.move(1, 0);
|
|
6694
|
-
}).keydown([ctrl, "up"], (e) => {
|
|
6695
|
-
e.inputEvent.preventDefault();
|
|
6696
|
-
services?.editorService.move(0, -10);
|
|
6697
|
-
}).keydown([ctrl, "down"], (e) => {
|
|
6698
|
-
e.inputEvent.preventDefault();
|
|
6699
|
-
services?.editorService.move(0, 10);
|
|
6700
|
-
}).keydown([ctrl, "left"], (e) => {
|
|
6701
|
-
e.inputEvent.preventDefault();
|
|
6702
|
-
services?.editorService.move(-10, 0);
|
|
6703
|
-
}).keydown([ctrl, "right"], (e) => {
|
|
6704
|
-
e.inputEvent.preventDefault();
|
|
6705
|
-
services?.editorService.move(10, 0);
|
|
6706
|
-
}).keydown("tab", (e) => {
|
|
6707
|
-
e.inputEvent.preventDefault();
|
|
6708
|
-
services?.editorService.selectNextNode();
|
|
6709
|
-
}).keydown([ctrl, "tab"], (e) => {
|
|
6710
|
-
e.inputEvent.preventDefault();
|
|
6711
|
-
services?.editorService.selectNextPage();
|
|
6712
|
-
}).keydown([ctrl, "="], (e) => {
|
|
6713
|
-
e.inputEvent.preventDefault();
|
|
6714
|
-
services?.uiService.zoom(0.1);
|
|
6715
|
-
}).keydown([ctrl, "numpadplus"], (e) => {
|
|
6716
|
-
e.inputEvent.preventDefault();
|
|
6717
|
-
services?.uiService.zoom(0.1);
|
|
6718
|
-
}).keydown([ctrl, "-"], (e) => {
|
|
6719
|
-
e.inputEvent.preventDefault();
|
|
6720
|
-
services?.uiService.zoom(-0.1);
|
|
6721
|
-
}).keydown([ctrl, "numpad-"], (e) => {
|
|
6722
|
-
e.inputEvent.preventDefault();
|
|
6723
|
-
services?.uiService.zoom(-0.1);
|
|
6724
|
-
}).keydown([ctrl, "0"], async (e) => {
|
|
6725
|
-
e.inputEvent.preventDefault();
|
|
6726
|
-
services?.uiService.set("zoom", await services.uiService.calcZoom());
|
|
6727
|
-
}).keydown([ctrl, "1"], (e) => {
|
|
6728
|
-
e.inputEvent.preventDefault();
|
|
6729
|
-
services?.uiService.set("zoom", 1);
|
|
6730
|
-
});
|
|
6731
|
-
});
|
|
6732
|
-
vue.onUnmounted(() => {
|
|
6733
|
-
workspace.value?.removeEventListener("mouseenter", mouseenterHandler);
|
|
6734
|
-
workspace.value?.removeEventListener("mouseleave", mouseleaveHandler);
|
|
6735
|
-
keycon.destroy();
|
|
6736
|
-
});
|
|
6737
6662
|
return (_ctx, _cache) => {
|
|
6738
|
-
return vue.openBlock(), vue.createElementBlock("div",
|
|
6739
|
-
class: "m-editor-workspace",
|
|
6740
|
-
tabindex: "-1",
|
|
6741
|
-
ref_key: "workspace",
|
|
6742
|
-
ref: workspace
|
|
6743
|
-
}, [
|
|
6663
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
6744
6664
|
vue.createVNode(_sfc_main$8),
|
|
6745
6665
|
vue.renderSlot(_ctx.$slots, "stage", {}, () => [
|
|
6746
6666
|
page.value ? (vue.openBlock(), vue.createBlock(_sfc_main$2, {
|
|
@@ -6758,7 +6678,7 @@
|
|
|
6758
6678
|
]),
|
|
6759
6679
|
_: 3
|
|
6760
6680
|
})
|
|
6761
|
-
]
|
|
6681
|
+
]);
|
|
6762
6682
|
};
|
|
6763
6683
|
}
|
|
6764
6684
|
});
|
|
@@ -7482,6 +7402,177 @@
|
|
|
7482
7402
|
}
|
|
7483
7403
|
const eventsService = new Events();
|
|
7484
7404
|
|
|
7405
|
+
class Keybinding extends BaseService {
|
|
7406
|
+
keycon = new KeyController();
|
|
7407
|
+
ctrlKey = /mac os x/.test(navigator.userAgent.toLowerCase()) ? "meta" : "ctrl";
|
|
7408
|
+
constructor() {
|
|
7409
|
+
super();
|
|
7410
|
+
this.keycon.keyup((e) => {
|
|
7411
|
+
this.emit("keyup", e.inputEvent);
|
|
7412
|
+
}).keyup("delete", (e) => {
|
|
7413
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7414
|
+
return;
|
|
7415
|
+
}
|
|
7416
|
+
e.inputEvent.preventDefault();
|
|
7417
|
+
this.removeNode();
|
|
7418
|
+
}).keyup("backspace", (e) => {
|
|
7419
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7420
|
+
return;
|
|
7421
|
+
}
|
|
7422
|
+
e.inputEvent.preventDefault();
|
|
7423
|
+
this.removeNode();
|
|
7424
|
+
}).keydown([this.ctrlKey, "c"], (e) => {
|
|
7425
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7426
|
+
return;
|
|
7427
|
+
}
|
|
7428
|
+
e.inputEvent.preventDefault();
|
|
7429
|
+
const nodes = editorService.get("nodes");
|
|
7430
|
+
nodes && editorService.copy(nodes);
|
|
7431
|
+
}).keydown([this.ctrlKey, "v"], (e) => {
|
|
7432
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7433
|
+
return;
|
|
7434
|
+
}
|
|
7435
|
+
e.inputEvent.preventDefault();
|
|
7436
|
+
const nodes = editorService.get("nodes");
|
|
7437
|
+
nodes && editorService.paste({ offsetX: 10, offsetY: 10 });
|
|
7438
|
+
}).keydown([this.ctrlKey, "x"], (e) => {
|
|
7439
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7440
|
+
return;
|
|
7441
|
+
}
|
|
7442
|
+
e.inputEvent.preventDefault();
|
|
7443
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7444
|
+
return;
|
|
7445
|
+
}
|
|
7446
|
+
const nodes = editorService.get("nodes");
|
|
7447
|
+
if (!nodes || utils.isPage(nodes[0]))
|
|
7448
|
+
return;
|
|
7449
|
+
editorService.copy(nodes);
|
|
7450
|
+
editorService.remove(nodes);
|
|
7451
|
+
}).keydown([this.ctrlKey, "z"], (e) => {
|
|
7452
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7453
|
+
return;
|
|
7454
|
+
}
|
|
7455
|
+
e.inputEvent.preventDefault();
|
|
7456
|
+
editorService.undo();
|
|
7457
|
+
}).keydown([this.ctrlKey, "shift", "z"], (e) => {
|
|
7458
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7459
|
+
return;
|
|
7460
|
+
}
|
|
7461
|
+
e.inputEvent.preventDefault();
|
|
7462
|
+
editorService.redo();
|
|
7463
|
+
}).keydown("up", (e) => {
|
|
7464
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7465
|
+
return;
|
|
7466
|
+
}
|
|
7467
|
+
e.inputEvent.preventDefault();
|
|
7468
|
+
editorService.move(0, -1);
|
|
7469
|
+
}).keydown("down", (e) => {
|
|
7470
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7471
|
+
return;
|
|
7472
|
+
}
|
|
7473
|
+
e.inputEvent.preventDefault();
|
|
7474
|
+
editorService.move(0, 1);
|
|
7475
|
+
}).keydown("left", (e) => {
|
|
7476
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7477
|
+
return;
|
|
7478
|
+
}
|
|
7479
|
+
e.inputEvent.preventDefault();
|
|
7480
|
+
editorService.move(-1, 0);
|
|
7481
|
+
}).keydown("right", (e) => {
|
|
7482
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7483
|
+
return;
|
|
7484
|
+
}
|
|
7485
|
+
e.inputEvent.preventDefault();
|
|
7486
|
+
editorService.move(1, 0);
|
|
7487
|
+
}).keydown([this.ctrlKey, "up"], (e) => {
|
|
7488
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7489
|
+
return;
|
|
7490
|
+
}
|
|
7491
|
+
e.inputEvent.preventDefault();
|
|
7492
|
+
editorService.move(0, -10);
|
|
7493
|
+
}).keydown([this.ctrlKey, "down"], (e) => {
|
|
7494
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7495
|
+
return;
|
|
7496
|
+
}
|
|
7497
|
+
e.inputEvent.preventDefault();
|
|
7498
|
+
editorService.move(0, 10);
|
|
7499
|
+
}).keydown([this.ctrlKey, "left"], (e) => {
|
|
7500
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7501
|
+
return;
|
|
7502
|
+
}
|
|
7503
|
+
e.inputEvent.preventDefault();
|
|
7504
|
+
editorService.move(-10, 0);
|
|
7505
|
+
}).keydown([this.ctrlKey, "right"], (e) => {
|
|
7506
|
+
e.inputEvent.preventDefault();
|
|
7507
|
+
editorService.move(10, 0);
|
|
7508
|
+
}).keydown("tab", (e) => {
|
|
7509
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7510
|
+
return;
|
|
7511
|
+
}
|
|
7512
|
+
e.inputEvent.preventDefault();
|
|
7513
|
+
editorService.selectNextNode();
|
|
7514
|
+
}).keydown([this.ctrlKey, "tab"], (e) => {
|
|
7515
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7516
|
+
return;
|
|
7517
|
+
}
|
|
7518
|
+
e.inputEvent.preventDefault();
|
|
7519
|
+
editorService.selectNextPage();
|
|
7520
|
+
}).keydown([this.ctrlKey, "="], (e) => {
|
|
7521
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7522
|
+
return;
|
|
7523
|
+
}
|
|
7524
|
+
e.inputEvent.preventDefault();
|
|
7525
|
+
uiService.zoom(0.1);
|
|
7526
|
+
}).keydown([this.ctrlKey, "numpadplus"], (e) => {
|
|
7527
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7528
|
+
return;
|
|
7529
|
+
}
|
|
7530
|
+
e.inputEvent.preventDefault();
|
|
7531
|
+
uiService.zoom(0.1);
|
|
7532
|
+
}).keydown([this.ctrlKey, "-"], (e) => {
|
|
7533
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7534
|
+
return;
|
|
7535
|
+
}
|
|
7536
|
+
e.inputEvent.preventDefault();
|
|
7537
|
+
uiService.zoom(-0.1);
|
|
7538
|
+
}).keydown([this.ctrlKey, "numpad-"], (e) => {
|
|
7539
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7540
|
+
return;
|
|
7541
|
+
}
|
|
7542
|
+
e.inputEvent.preventDefault();
|
|
7543
|
+
uiService.zoom(-0.1);
|
|
7544
|
+
}).keydown([this.ctrlKey, "0"], async (e) => {
|
|
7545
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7546
|
+
return;
|
|
7547
|
+
}
|
|
7548
|
+
e.inputEvent.preventDefault();
|
|
7549
|
+
uiService.set("zoom", await uiService.calcZoom());
|
|
7550
|
+
}).keydown([this.ctrlKey, "1"], (e) => {
|
|
7551
|
+
if (this.isDisabledKeyEvent(e.inputEvent.target)) {
|
|
7552
|
+
return;
|
|
7553
|
+
}
|
|
7554
|
+
e.inputEvent.preventDefault();
|
|
7555
|
+
uiService.set("zoom", 1);
|
|
7556
|
+
});
|
|
7557
|
+
}
|
|
7558
|
+
destroy() {
|
|
7559
|
+
this.keycon.destroy();
|
|
7560
|
+
}
|
|
7561
|
+
isDisabledKeyEvent(node) {
|
|
7562
|
+
const el = node;
|
|
7563
|
+
if (!el)
|
|
7564
|
+
return false;
|
|
7565
|
+
return el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.isContentEditable;
|
|
7566
|
+
}
|
|
7567
|
+
removeNode() {
|
|
7568
|
+
const nodes = editorService.get("nodes");
|
|
7569
|
+
if (!nodes || utils.isPage(nodes[0]))
|
|
7570
|
+
return;
|
|
7571
|
+
editorService.remove(nodes);
|
|
7572
|
+
}
|
|
7573
|
+
}
|
|
7574
|
+
const keybindingService = new Keybinding();
|
|
7575
|
+
|
|
7485
7576
|
const editorProps = {
|
|
7486
7577
|
/** 页面初始值 */
|
|
7487
7578
|
modelValue: {
|
|
@@ -7869,7 +7960,8 @@
|
|
|
7869
7960
|
storageService,
|
|
7870
7961
|
codeBlockService,
|
|
7871
7962
|
depService,
|
|
7872
|
-
dataSourceService
|
|
7963
|
+
dataSourceService,
|
|
7964
|
+
keybindingService
|
|
7873
7965
|
};
|
|
7874
7966
|
initServiceEvents(props, emit, services);
|
|
7875
7967
|
initServiceState(props, services);
|
|
@@ -8052,6 +8144,7 @@
|
|
|
8052
8144
|
exports.Layout = Layout;
|
|
8053
8145
|
exports.LayoutContainer = _sfc_main$s;
|
|
8054
8146
|
exports.PropsPanel = _sfc_main$n;
|
|
8147
|
+
exports.SplitView = _sfc_main$s;
|
|
8055
8148
|
exports.TMagicCodeEditor = _sfc_main$u;
|
|
8056
8149
|
exports.TMagicEditor = Editor;
|
|
8057
8150
|
exports.ToolButton = _sfc_main$p;
|