@tmagic/editor 1.3.0-alpha.2 → 1.3.0-alpha.21
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 +91 -120
- package/dist/tmagic-editor.js +4609 -3257
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +5708 -4337
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +21 -22
- package/src/Editor.vue +29 -7
- package/src/components/CodeBlockEditor.vue +170 -0
- package/src/components/CodeParams.vue +60 -0
- package/src/components/ContentMenu.vue +30 -11
- package/src/components/Icon.vue +5 -1
- package/src/components/Resizer.vue +45 -0
- package/src/components/ScrollBar.vue +5 -1
- package/src/components/ScrollViewer.vue +5 -1
- package/src/components/SearchInput.vue +4 -0
- package/src/components/{Layout.vue → SplitView.vue} +8 -4
- package/src/components/ToolButton.vue +5 -1
- package/src/editorProps.ts +35 -4
- package/src/fields/Code.vue +28 -20
- package/src/fields/CodeLink.vue +15 -10
- package/src/fields/CodeSelect.vue +19 -10
- package/src/fields/CodeSelectCol.vue +67 -83
- package/src/fields/DataSourceFieldSelect.vue +47 -0
- package/src/fields/DataSourceFields.vue +24 -21
- package/src/fields/DataSourceInput.vue +318 -0
- package/src/fields/DataSourceMethodSelect.vue +136 -0
- package/src/fields/DataSourceMethods.vue +103 -0
- package/src/fields/DataSourceSelect.vue +68 -0
- package/src/fields/EventSelect.vue +62 -22
- package/src/fields/KeyValue.vue +13 -11
- package/src/fields/UISelect.vue +59 -15
- package/src/hooks/index.ts +21 -0
- package/src/hooks/use-code-block-edit.ts +84 -0
- package/src/hooks/use-data-source-method.ts +100 -0
- package/src/{utils/stage.ts → hooks/use-stage.ts} +4 -7
- package/src/icons/AppManageIcon.vue +5 -1
- package/src/icons/CenterIcon.vue +13 -0
- package/src/icons/CodeIcon.vue +5 -3
- package/src/index.ts +24 -3
- package/src/initService.ts +75 -16
- package/src/layouts/AddPageBox.vue +5 -1
- package/src/layouts/CodeEditor.vue +66 -11
- package/src/layouts/Framework.vue +32 -28
- package/src/layouts/NavMenu.vue +5 -1
- package/src/layouts/PropsPanel.vue +14 -4
- package/src/layouts/sidebar/ComponentListPanel.vue +11 -10
- package/src/layouts/sidebar/LayerMenu.vue +13 -25
- package/src/layouts/sidebar/LayerNode.vue +40 -0
- package/src/layouts/sidebar/LayerPanel.vue +71 -28
- package/src/layouts/sidebar/Sidebar.vue +13 -17
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +84 -118
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +63 -0
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +39 -34
- package/src/layouts/sidebar/data-source/DataSourceList.vue +145 -0
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +17 -65
- package/src/layouts/workspace/Breadcrumb.vue +5 -1
- package/src/layouts/workspace/PageBar.vue +5 -1
- package/src/layouts/workspace/PageBarScrollContainer.vue +5 -1
- package/src/layouts/workspace/Stage.vue +30 -8
- package/src/layouts/workspace/ViewerMenu.vue +15 -36
- package/src/layouts/workspace/Workspace.vue +9 -134
- package/src/services/codeBlock.ts +20 -72
- package/src/services/dataSource.ts +17 -2
- package/src/services/dep.ts +23 -20
- package/src/services/editor.ts +3 -3
- package/src/services/keybinding.ts +185 -0
- package/src/services/props.ts +2 -2
- package/src/services/storage.ts +3 -2
- package/src/theme/code-block.scss +5 -117
- package/src/theme/code-editor.scss +27 -2
- package/src/theme/content-menu.scss +1 -1
- package/src/theme/data-source-input.scss +18 -0
- package/src/theme/data-source-methods.scss +13 -0
- package/src/theme/event.scss +15 -12
- package/src/theme/framework.scss +0 -3
- package/src/theme/layer-panel.scss +6 -0
- package/src/theme/layout.scss +4 -0
- package/src/theme/resizer.scss +25 -10
- package/src/theme/stage.scss +4 -0
- package/src/theme/theme.scss +2 -0
- package/src/type.ts +105 -7
- package/src/utils/config.ts +1 -1
- package/src/utils/content-menu.ts +92 -0
- package/src/utils/data-source/formConfigs/base.ts +35 -30
- package/src/utils/data-source/index.ts +75 -6
- package/src/utils/dep.ts +39 -7
- package/src/utils/index.ts +1 -1
- package/src/utils/keybinding-config.ts +120 -0
- package/src/utils/props.ts +298 -155
- package/src/utils/undo-redo.ts +1 -1
- package/types/Editor.vue.d.ts +37 -4
- package/types/components/CodeBlockEditor.vue.d.ts +23 -0
- package/types/components/CodeParams.vue.d.ts +26 -0
- package/types/components/ContentMenu.vue.d.ts +8 -3
- package/types/components/Icon.vue.d.ts +2 -2
- package/types/{layouts → components}/Resizer.vue.d.ts +2 -2
- package/types/components/ScrollBar.vue.d.ts +1 -1
- package/types/components/ScrollViewer.vue.d.ts +8 -5
- package/types/components/SearchInput.vue.d.ts +1 -1
- package/types/components/{Layout.vue.d.ts → SplitView.vue.d.ts} +9 -6
- package/types/components/ToolButton.vue.d.ts +10 -7
- package/types/editorProps.d.ts +23 -4
- package/types/fields/Code.vue.d.ts +23 -18
- package/types/fields/CodeLink.vue.d.ts +13 -22
- package/types/fields/CodeSelect.vue.d.ts +12 -20
- package/types/fields/CodeSelectCol.vue.d.ts +14 -15
- package/types/fields/DataSourceFieldSelect.vue.d.ts +29 -0
- package/types/fields/DataSourceFields.vue.d.ts +13 -21
- package/types/fields/DataSourceInput.vue.d.ts +34 -0
- package/types/fields/DataSourceMethodSelect.vue.d.ts +29 -0
- package/types/fields/DataSourceMethods.vue.d.ts +32 -0
- package/types/fields/DataSourceSelect.vue.d.ts +40 -0
- package/types/fields/EventSelect.vue.d.ts +3 -14
- package/types/fields/KeyValue.vue.d.ts +15 -27
- package/types/fields/UISelect.vue.d.ts +3 -12
- package/types/hooks/index.d.ts +3 -0
- package/types/hooks/use-code-block-edit.d.ts +125 -0
- package/types/hooks/use-data-source-method.d.ts +123 -0
- package/types/icons/AppManageIcon.vue.d.ts +1 -1
- package/types/icons/CenterIcon.vue.d.ts +2 -0
- package/types/icons/CodeIcon.vue.d.ts +1 -1
- package/types/index.d.ts +12 -2
- package/types/initService.d.ts +2 -2
- package/types/layouts/AddPageBox.vue.d.ts +1 -1
- package/types/layouts/CodeEditor.vue.d.ts +18 -10
- package/types/layouts/Framework.vue.d.ts +11 -32
- package/types/layouts/NavMenu.vue.d.ts +7 -4
- package/types/layouts/PropsPanel.vue.d.ts +276 -4
- package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +4 -4
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +2 -2
- package/types/layouts/sidebar/LayerNode.vue.d.ts +16 -0
- package/types/layouts/sidebar/LayerPanel.vue.d.ts +5 -5
- package/types/layouts/sidebar/Sidebar.vue.d.ts +16 -16
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +7 -12
- package/types/layouts/sidebar/code-block/CodeBlockListPanel.vue.d.ts +28 -0
- package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +4 -2
- package/types/layouts/sidebar/data-source/DataSourceList.vue.d.ts +14 -0
- package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +1 -11
- package/types/layouts/workspace/Breadcrumb.vue.d.ts +1 -1
- package/types/layouts/workspace/PageBar.vue.d.ts +5 -5
- package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +2 -2
- package/types/layouts/workspace/Stage.vue.d.ts +2 -2
- package/types/layouts/workspace/ViewerMenu.vue.d.ts +7 -4
- package/types/layouts/workspace/Workspace.vue.d.ts +9 -9
- package/types/services/codeBlock.d.ts +6 -37
- package/types/services/dataSource.d.ts +7 -1
- package/types/services/dep.d.ts +12 -21
- package/types/services/editor.d.ts +1 -1
- package/types/services/keybinding.d.ts +20 -0
- package/types/services/props.d.ts +10 -115
- package/types/type.d.ts +97 -7
- package/types/utils/config.d.ts +1 -1
- package/types/utils/content-menu.d.ts +7 -0
- package/types/utils/data-source/formConfigs/base.d.ts +2 -2
- package/types/utils/data-source/index.d.ts +7 -1
- package/types/utils/dep.d.ts +4 -2
- package/types/utils/index.d.ts +1 -1
- package/types/utils/keybinding-config.d.ts +3 -0
- package/types/utils/props.d.ts +13 -102
- package/src/components/CodeDraftEditor.vue +0 -144
- package/src/components/FunctionEditor.vue +0 -190
- package/src/layouts/Resizer.vue +0 -32
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +0 -96
- package/types/components/CodeDraftEditor.vue.d.ts +0 -58
- package/types/components/FunctionEditor.vue.d.ts +0 -192
- package/types/layouts/sidebar/code-block/CodeBlockEditor.vue.d.ts +0 -25
- /package/types/{utils/stage.d.ts → hooks/use-stage.d.ts} +0 -0
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
import type { FormConfig } from '@tmagic/form';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
3
|
+
import type { DatasourceTypeOption } from '@editor/type';
|
|
4
|
+
|
|
5
|
+
export default function (datasourceTypeList: DatasourceTypeOption[] = []): FormConfig {
|
|
6
|
+
return [
|
|
7
|
+
{
|
|
8
|
+
name: 'id',
|
|
9
|
+
type: 'hidden',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'type',
|
|
13
|
+
text: '类型',
|
|
14
|
+
type: 'select',
|
|
15
|
+
options: [
|
|
16
|
+
{ text: '基础', value: 'base' },
|
|
17
|
+
{ text: 'HTTP', value: 'http' },
|
|
18
|
+
...datasourceTypeList.map((item) => ({ text: item.text, value: item.type })),
|
|
19
|
+
],
|
|
20
|
+
defaultValue: 'base',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'title',
|
|
24
|
+
text: '名称',
|
|
25
|
+
rules: [
|
|
26
|
+
{
|
|
27
|
+
required: true,
|
|
28
|
+
message: '请输入名称',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'description',
|
|
34
|
+
text: '描述',
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { FormConfig } from '@tmagic/form';
|
|
2
|
+
import { DataSchema, DataSourceSchema } from '@tmagic/schema';
|
|
3
|
+
|
|
4
|
+
import { DatasourceTypeOption } from '@editor/type';
|
|
2
5
|
|
|
3
6
|
import BaseFormConfig from './formConfigs/base';
|
|
4
7
|
import HttpFormConfig from './formConfigs/http';
|
|
5
8
|
|
|
6
|
-
const fillConfig = (config: FormConfig): FormConfig => [
|
|
7
|
-
...BaseFormConfig,
|
|
9
|
+
const fillConfig = (config: FormConfig, datasourceTypeList: DatasourceTypeOption[]): FormConfig => [
|
|
10
|
+
...BaseFormConfig(datasourceTypeList),
|
|
8
11
|
...config,
|
|
9
12
|
{
|
|
10
13
|
type: 'panel',
|
|
@@ -17,15 +20,81 @@ const fillConfig = (config: FormConfig): FormConfig => [
|
|
|
17
20
|
},
|
|
18
21
|
],
|
|
19
22
|
},
|
|
23
|
+
{
|
|
24
|
+
type: 'panel',
|
|
25
|
+
title: '方法定义',
|
|
26
|
+
items: [
|
|
27
|
+
{
|
|
28
|
+
name: 'methods',
|
|
29
|
+
type: 'data-source-methods',
|
|
30
|
+
defaultValue: [],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
20
34
|
];
|
|
21
35
|
|
|
22
|
-
export const getFormConfig = (
|
|
36
|
+
export const getFormConfig = (
|
|
37
|
+
type: string,
|
|
38
|
+
datasourceTypeList: DatasourceTypeOption[],
|
|
39
|
+
configs: Record<string, FormConfig>,
|
|
40
|
+
): FormConfig => {
|
|
23
41
|
switch (type) {
|
|
24
42
|
case 'base':
|
|
25
|
-
return fillConfig([]);
|
|
43
|
+
return fillConfig([], datasourceTypeList);
|
|
26
44
|
case 'http':
|
|
27
|
-
return fillConfig(HttpFormConfig);
|
|
45
|
+
return fillConfig(HttpFormConfig, datasourceTypeList);
|
|
28
46
|
default:
|
|
29
|
-
return fillConfig(configs[type] || []);
|
|
47
|
+
return fillConfig(configs[type] || [], datasourceTypeList);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const getDisplayField = (dataSources: DataSourceSchema[], key: string) => {
|
|
52
|
+
const displayState: { value: string; type: 'var' | 'text' }[] = [];
|
|
53
|
+
|
|
54
|
+
// 匹配es6字符串模块
|
|
55
|
+
const matches = key.matchAll(/\$\{([\s\S]+?)\}/g);
|
|
56
|
+
let index = 0;
|
|
57
|
+
for (const match of matches) {
|
|
58
|
+
if (typeof match.index === 'undefined') break;
|
|
59
|
+
|
|
60
|
+
// 字符串常量
|
|
61
|
+
displayState.push({
|
|
62
|
+
type: 'text',
|
|
63
|
+
value: key.substring(index, match.index),
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
let dsText = '';
|
|
67
|
+
let ds: DataSourceSchema | undefined;
|
|
68
|
+
let fields: DataSchema[] | undefined;
|
|
69
|
+
|
|
70
|
+
// 将模块解析成数据源对应的值
|
|
71
|
+
match[1].split('.').forEach((item, index) => {
|
|
72
|
+
if (index === 0) {
|
|
73
|
+
ds = dataSources.find((ds) => ds.id === item);
|
|
74
|
+
dsText += ds?.title || item;
|
|
75
|
+
fields = ds?.fields;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const field = fields?.find((field) => field.name === item);
|
|
80
|
+
fields = field?.fields;
|
|
81
|
+
dsText += `.${field?.title || item}`;
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
displayState.push({
|
|
85
|
+
type: 'var',
|
|
86
|
+
value: dsText,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
index = match.index + match[0].length;
|
|
30
90
|
}
|
|
91
|
+
|
|
92
|
+
if (index < key.length) {
|
|
93
|
+
displayState.push({
|
|
94
|
+
type: 'text',
|
|
95
|
+
value: key.substring(index),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return displayState;
|
|
31
100
|
};
|
package/src/utils/dep.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { isEmpty } from 'lodash-es';
|
|
2
2
|
|
|
3
|
-
import { CodeBlockContent,
|
|
3
|
+
import { CodeBlockContent, HookType, Id } from '@tmagic/schema';
|
|
4
4
|
|
|
5
|
+
import dataSourceService from '@editor/services/dataSource';
|
|
5
6
|
import { Target } from '@editor/services/dep';
|
|
6
|
-
import
|
|
7
|
+
import { DepTargetType, HookData } from '@editor/type';
|
|
7
8
|
|
|
8
9
|
export const createCodeBlockTarget = (id: Id, codeBlock: CodeBlockContent) =>
|
|
9
10
|
new Target({
|
|
10
|
-
type:
|
|
11
|
+
type: DepTargetType.CODE_BLOCK,
|
|
11
12
|
id,
|
|
12
13
|
name: codeBlock.name,
|
|
13
14
|
isTarget: (key: string | number, value: any) => {
|
|
15
|
+
if (id === value) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
if (value?.hookType === HookType.CODE && !isEmpty(value.hookData)) {
|
|
15
20
|
const index = value.hookData.findIndex((item: HookData) => item.codeId === id);
|
|
16
21
|
return Boolean(index > -1);
|
|
@@ -20,10 +25,37 @@ export const createCodeBlockTarget = (id: Id, codeBlock: CodeBlockContent) =>
|
|
|
20
25
|
},
|
|
21
26
|
});
|
|
22
27
|
|
|
23
|
-
export const createDataSourceTarget = (id: Id
|
|
28
|
+
export const createDataSourceTarget = (id: Id) =>
|
|
29
|
+
new Target({
|
|
30
|
+
type: DepTargetType.DATA_SOURCE,
|
|
31
|
+
id,
|
|
32
|
+
isTarget: (key: string | number, value: any) =>
|
|
33
|
+
// 关联数据源对象或者在模板在使用数据源
|
|
34
|
+
(value?.isBindDataSource && value.dataSourceId) || (typeof value === 'string' && value.includes(`${id}`)),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const createDataSourceCondTarget = (id: string) =>
|
|
38
|
+
new Target({
|
|
39
|
+
type: DepTargetType.DATA_SOURCE_COND,
|
|
40
|
+
id,
|
|
41
|
+
isTarget: (key: string | number, value: any) => {
|
|
42
|
+
if (!Array.isArray(value) || value[0] !== id) return false;
|
|
43
|
+
|
|
44
|
+
const ds = dataSourceService.getDataSourceById(id);
|
|
45
|
+
|
|
46
|
+
return Boolean(ds?.fields?.find((field) => field.name === value[1]));
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const createDataSourceMethodTarget = (id: string) =>
|
|
24
51
|
new Target({
|
|
25
|
-
type:
|
|
52
|
+
type: DepTargetType.DATA_SOURCE_METHOD,
|
|
26
53
|
id,
|
|
27
|
-
|
|
28
|
-
|
|
54
|
+
isTarget: (key: string | number, value: any) => {
|
|
55
|
+
if (!Array.isArray(value) || value[0] !== id) return false;
|
|
56
|
+
|
|
57
|
+
const ds = dataSourceService.getDataSourceById(id);
|
|
58
|
+
|
|
59
|
+
return Boolean(ds?.methods?.find((method) => method.name === value[1]));
|
|
60
|
+
},
|
|
29
61
|
});
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { KeyBindingCommand, KeyBindingItem } from '@editor/type';
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
{
|
|
5
|
+
command: KeyBindingCommand.DELETE_NODE,
|
|
6
|
+
keybinding: ['delete', 'backspace'],
|
|
7
|
+
when: [
|
|
8
|
+
['stage', 'keyup'],
|
|
9
|
+
['layer-panel', 'keydown'],
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
command: KeyBindingCommand.COPY_NODE,
|
|
14
|
+
keybinding: 'ctrl+c',
|
|
15
|
+
when: [
|
|
16
|
+
['stage', 'keydown'],
|
|
17
|
+
['layer-panel', 'keydown'],
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
command: KeyBindingCommand.PASTE_NODE,
|
|
22
|
+
keybinding: 'ctrl+v',
|
|
23
|
+
when: [
|
|
24
|
+
['stage', 'keydown'],
|
|
25
|
+
['layer-panel', 'keydown'],
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
command: KeyBindingCommand.CUT_NODE,
|
|
30
|
+
keybinding: 'ctrl+x',
|
|
31
|
+
when: [
|
|
32
|
+
['stage', 'keydown'],
|
|
33
|
+
['layer-panel', 'keydown'],
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
command: KeyBindingCommand.UNDO,
|
|
38
|
+
keybinding: 'ctrl+z',
|
|
39
|
+
when: [
|
|
40
|
+
['stage', 'keydown'],
|
|
41
|
+
['layer-panel', 'keydown'],
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
command: KeyBindingCommand.REDO,
|
|
46
|
+
keybinding: 'ctrl+shift+z',
|
|
47
|
+
when: [
|
|
48
|
+
['stage', 'keydown'],
|
|
49
|
+
['layer-panel', 'keydown'],
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
command: KeyBindingCommand.MOVE_UP_1,
|
|
54
|
+
keybinding: 'up',
|
|
55
|
+
when: [['stage', 'keydown']],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
command: KeyBindingCommand.MOVE_DOWN_1,
|
|
59
|
+
keybinding: 'down',
|
|
60
|
+
when: [['stage', 'keydown']],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
command: KeyBindingCommand.MOVE_LEFT_1,
|
|
64
|
+
keybinding: 'left',
|
|
65
|
+
when: [['stage', 'keydown']],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
command: KeyBindingCommand.MOVE_RIGHT_1,
|
|
69
|
+
keybinding: 'right',
|
|
70
|
+
when: [['stage', 'keydown']],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
command: KeyBindingCommand.MOVE_UP_10,
|
|
74
|
+
keybinding: 'ctrl+up',
|
|
75
|
+
when: [['stage', 'keydown']],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
command: KeyBindingCommand.MOVE_DOWN_10,
|
|
79
|
+
keybinding: 'ctrl+down',
|
|
80
|
+
when: [['stage', 'keydown']],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
command: KeyBindingCommand.MOVE_LEFT_10,
|
|
84
|
+
keybinding: 'ctrl+left',
|
|
85
|
+
when: [['stage', 'keydown']],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
command: KeyBindingCommand.MOVE_RIGHT_10,
|
|
89
|
+
keybinding: 'ctrl+right',
|
|
90
|
+
when: [['stage', 'keydown']],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
command: KeyBindingCommand.SWITCH_NODE,
|
|
94
|
+
keybinding: 'tab',
|
|
95
|
+
when: [
|
|
96
|
+
['stage', 'keydown'],
|
|
97
|
+
['layer-panel', 'keydown'],
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
command: KeyBindingCommand.ZOOM_IN,
|
|
102
|
+
keybinding: ['ctrl+=', 'ctrl+numpadplus'],
|
|
103
|
+
when: [['stage', 'keydown']],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
command: KeyBindingCommand.ZOOM_OUT,
|
|
107
|
+
keybinding: ['ctrl+-', 'ctrl+numpad-'],
|
|
108
|
+
when: [['stage', 'keydown']],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
command: KeyBindingCommand.ZOOM_FIT,
|
|
112
|
+
keybinding: 'ctrl+0',
|
|
113
|
+
when: [['stage', 'keydown']],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
command: KeyBindingCommand.ZOOM_RESET,
|
|
117
|
+
keybinding: 'ctrl+1',
|
|
118
|
+
when: [['stage', 'keydown']],
|
|
119
|
+
},
|
|
120
|
+
] as KeyBindingItem[];
|