@difizen/libro-lab 0.1.10 → 0.1.12
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/es/command/index.d.ts +5 -0
- package/es/command/index.d.ts.map +1 -0
- package/es/command/index.js +4 -0
- package/es/{menu/menu-command.d.ts → command/lab-command.d.ts} +6 -6
- package/es/command/lab-command.d.ts.map +1 -0
- package/es/{menu/menu-command.js → command/lab-command.js} +9 -5
- package/es/{menu/menu-contribution.d.ts → command/lab-menu-contribution.d.ts} +3 -3
- package/es/command/lab-menu-contribution.d.ts.map +1 -0
- package/es/{menu/menu-contribution.js → command/lab-menu-contribution.js} +242 -241
- package/es/command/menu-bar-view.d.ts.map +1 -0
- package/es/{menu → command}/menu-bar-view.js +2 -2
- package/es/command/module.d.ts.map +1 -0
- package/es/{menu → command}/module.js +2 -2
- package/es/config/config-contribution.js +2 -2
- package/es/editor-viewer/code-editor-open-handler.d.ts.map +1 -1
- package/es/editor-viewer/code-editor-open-handler.js +4 -4
- package/es/editor-viewer/code-editor-viewer.d.ts +1 -0
- package/es/editor-viewer/code-editor-viewer.d.ts.map +1 -1
- package/es/editor-viewer/code-editor-viewer.js +8 -2
- package/es/editor-viewer/index.less +16 -0
- package/es/editor-viewer/libro-default-open-handler.d.ts +11 -0
- package/es/editor-viewer/libro-default-open-handler.d.ts.map +1 -0
- package/es/editor-viewer/libro-default-open-handler.js +97 -0
- package/es/editor-viewer/libro-default-viewer.d.ts +14 -0
- package/es/editor-viewer/libro-default-viewer.d.ts.map +1 -0
- package/es/editor-viewer/libro-default-viewer.js +78 -0
- package/es/editor-viewer/module.d.ts.map +1 -1
- package/es/editor-viewer/module.js +3 -1
- package/es/editor-viewer/protocol.d.ts +2 -0
- package/es/editor-viewer/protocol.d.ts.map +1 -1
- package/es/editor-viewer/protocol.js +3 -1
- package/es/github-link/index.js +2 -2
- package/es/image-viewer/open-handler.js +2 -2
- package/es/image-viewer/viewer.js +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.d.ts.map +1 -1
- package/es/index.js +1 -1
- package/es/index.less +17 -5
- package/es/kernel-manager/index.js +2 -2
- package/es/lab-app.d.ts.map +1 -1
- package/es/lab-app.js +6 -4
- package/es/layout/brand/brand.js +2 -2
- package/es/layout/container.js +2 -2
- package/es/layout/content-bottom-tab-view.js +2 -2
- package/es/layout/footer/current-file-footer-view.js +2 -2
- package/es/layout/footer/footer-view.js +2 -2
- package/es/layout/footer/status-footer-view.js +2 -2
- package/es/layout/layout-service.d.ts +2 -1
- package/es/layout/layout-service.d.ts.map +1 -1
- package/es/layout/layout-service.js +59 -25
- package/es/layout/layout.js +3 -4
- package/es/layout/main.js +2 -2
- package/es/layout/saveable-tab-view.d.ts +4 -1
- package/es/layout/saveable-tab-view.d.ts.map +1 -1
- package/es/layout/saveable-tab-view.js +27 -8
- package/es/layout/side-tab-view.js +2 -2
- package/es/module.d.ts.map +1 -1
- package/es/module.js +1 -1
- package/es/toc/libro-toc-panel-view.js +2 -2
- package/es/welcome/entry-point-view.d.ts.map +1 -1
- package/es/welcome/entry-point-view.js +4 -4
- package/es/welcome/welcome-view.js +2 -2
- package/package.json +8 -8
- package/src/command/index.ts +4 -0
- package/src/{menu/menu-command.ts → command/lab-command.ts} +9 -5
- package/src/{menu/menu-contribution.ts → command/lab-menu-contribution.ts} +228 -230
- package/src/{menu → command}/module.ts +2 -2
- package/src/editor-viewer/code-editor-open-handler.ts +2 -5
- package/src/editor-viewer/code-editor-viewer.tsx +7 -0
- package/src/editor-viewer/index.less +16 -0
- package/src/editor-viewer/libro-default-open-handler.ts +34 -0
- package/src/editor-viewer/libro-default-viewer.tsx +60 -0
- package/src/editor-viewer/module.ts +8 -1
- package/src/editor-viewer/protocol.ts +25 -0
- package/src/index.less +17 -5
- package/src/index.ts +1 -1
- package/src/lab-app.ts +6 -1
- package/src/layout/layout-service.ts +25 -3
- package/src/layout/saveable-tab-view.tsx +22 -1
- package/src/module.tsx +1 -1
- package/src/welcome/entry-point-view.tsx +2 -2
- package/es/menu/index.d.ts +0 -5
- package/es/menu/index.d.ts.map +0 -1
- package/es/menu/index.js +0 -4
- package/es/menu/menu-bar-view.d.ts.map +0 -1
- package/es/menu/menu-command.d.ts.map +0 -1
- package/es/menu/menu-contribution.d.ts.map +0 -1
- package/es/menu/module.d.ts.map +0 -1
- package/src/menu/index.ts +0 -4
- /package/es/{menu → command}/menu-bar-view.d.ts +0 -0
- /package/es/{menu → command}/module.d.ts +0 -0
- /package/src/{menu → command}/menu-bar-view.tsx +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
LibroService,
|
|
5
5
|
NotebookCommands,
|
|
6
6
|
} from '@difizen/libro-jupyter';
|
|
7
|
-
import {
|
|
7
|
+
import { TerminalCommands, TerminalManager } from '@difizen/libro-terminal';
|
|
8
8
|
import type { MenuRegistry } from '@difizen/mana-app';
|
|
9
9
|
import {
|
|
10
10
|
CommandContribution,
|
|
@@ -15,14 +15,12 @@ import {
|
|
|
15
15
|
singleton,
|
|
16
16
|
ViewManager,
|
|
17
17
|
} from '@difizen/mana-app';
|
|
18
|
-
import { v4 } from 'uuid';
|
|
19
18
|
|
|
20
19
|
import { LayoutService } from '../layout/layout-service.js';
|
|
21
|
-
import { LibroLabLayoutSlots } from '../layout/protocol.js';
|
|
22
20
|
|
|
23
|
-
import {
|
|
21
|
+
import { LabCommands } from './lab-command.js';
|
|
24
22
|
|
|
25
|
-
export namespace
|
|
23
|
+
export namespace LabMenus {
|
|
26
24
|
export const FILE = [...MAIN_MENU_BAR, '1_file'];
|
|
27
25
|
export const EDIT = [...MAIN_MENU_BAR, '2_edit'];
|
|
28
26
|
export const VIEW = [...MAIN_MENU_BAR, '3_view'];
|
|
@@ -32,7 +30,7 @@ export namespace HeaderMenus {
|
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
@singleton({ contrib: [MenuContribution, CommandContribution] })
|
|
35
|
-
export class
|
|
33
|
+
export class LabMenu implements MenuContribution, CommandContribution {
|
|
36
34
|
@inject(CommandRegistry) protected commandRegistry: CommandRegistry;
|
|
37
35
|
@inject(LibroService) protected libroService: LibroService;
|
|
38
36
|
@inject(LayoutService) protected layoutService: LayoutService;
|
|
@@ -40,214 +38,214 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
40
38
|
@inject(ViewManager) viewManager: ViewManager;
|
|
41
39
|
|
|
42
40
|
registerMenus(menu: MenuRegistry) {
|
|
43
|
-
menu.registerSubmenu(
|
|
44
|
-
menu.registerSubmenu(
|
|
45
|
-
menu.registerSubmenu(
|
|
46
|
-
menu.registerSubmenu(
|
|
47
|
-
menu.registerSubmenu(
|
|
48
|
-
menu.registerSubmenu(
|
|
49
|
-
menu.registerMenuAction(
|
|
50
|
-
id:
|
|
51
|
-
command:
|
|
52
|
-
label:
|
|
53
|
-
});
|
|
54
|
-
menu.registerMenuAction(
|
|
55
|
-
id:
|
|
56
|
-
command:
|
|
57
|
-
label:
|
|
58
|
-
});
|
|
59
|
-
menu.registerMenuAction(
|
|
60
|
-
id:
|
|
61
|
-
command:
|
|
62
|
-
label:
|
|
63
|
-
});
|
|
64
|
-
menu.registerMenuAction(
|
|
65
|
-
id:
|
|
66
|
-
command:
|
|
67
|
-
label:
|
|
68
|
-
});
|
|
69
|
-
menu.registerMenuAction(
|
|
70
|
-
id:
|
|
71
|
-
command:
|
|
72
|
-
label:
|
|
73
|
-
});
|
|
74
|
-
menu.registerMenuAction(
|
|
75
|
-
id:
|
|
76
|
-
command:
|
|
77
|
-
label:
|
|
78
|
-
});
|
|
79
|
-
menu.registerMenuAction(
|
|
80
|
-
id:
|
|
81
|
-
command:
|
|
82
|
-
label:
|
|
83
|
-
});
|
|
84
|
-
menu.registerMenuAction(
|
|
85
|
-
id:
|
|
86
|
-
command:
|
|
87
|
-
label:
|
|
88
|
-
});
|
|
89
|
-
menu.registerMenuAction(
|
|
90
|
-
id:
|
|
91
|
-
command:
|
|
92
|
-
label:
|
|
93
|
-
});
|
|
94
|
-
menu.registerMenuAction(
|
|
95
|
-
id:
|
|
96
|
-
command:
|
|
97
|
-
label:
|
|
98
|
-
});
|
|
99
|
-
menu.registerMenuAction(
|
|
100
|
-
id:
|
|
101
|
-
command:
|
|
102
|
-
label:
|
|
103
|
-
});
|
|
104
|
-
menu.registerMenuAction(
|
|
105
|
-
id:
|
|
106
|
-
command:
|
|
107
|
-
label:
|
|
108
|
-
});
|
|
109
|
-
menu.registerMenuAction(
|
|
110
|
-
id:
|
|
111
|
-
command:
|
|
112
|
-
label:
|
|
41
|
+
menu.registerSubmenu(LabMenus.FILE, { label: '文件' });
|
|
42
|
+
menu.registerSubmenu(LabMenus.EDIT, { label: '编辑' });
|
|
43
|
+
menu.registerSubmenu(LabMenus.VIEW, { label: '视图' });
|
|
44
|
+
menu.registerSubmenu(LabMenus.RUN, { label: '运行' });
|
|
45
|
+
menu.registerSubmenu(LabMenus.TERMINAL, { label: '终端' });
|
|
46
|
+
menu.registerSubmenu(LabMenus.HELP, { label: '帮助' });
|
|
47
|
+
menu.registerMenuAction(LabMenus.TERMINAL, {
|
|
48
|
+
id: TerminalCommands['OpenTerminal'].id,
|
|
49
|
+
command: TerminalCommands['OpenTerminal'].id,
|
|
50
|
+
label: TerminalCommands['OpenTerminal'].label,
|
|
51
|
+
});
|
|
52
|
+
menu.registerMenuAction(LabMenus.HELP, {
|
|
53
|
+
id: LabCommands.About.id,
|
|
54
|
+
command: LabCommands.About.id,
|
|
55
|
+
label: LabCommands.About.label,
|
|
56
|
+
});
|
|
57
|
+
menu.registerMenuAction(LabMenus.FILE, {
|
|
58
|
+
id: LabCommands.Save.id,
|
|
59
|
+
command: LabCommands.Save.id,
|
|
60
|
+
label: LabCommands.Save.label,
|
|
61
|
+
});
|
|
62
|
+
menu.registerMenuAction(LabMenus.FILE, {
|
|
63
|
+
id: LabCommands.CreateFile.id,
|
|
64
|
+
command: LabCommands.CreateFile.id,
|
|
65
|
+
label: LabCommands.CreateFile.label,
|
|
66
|
+
});
|
|
67
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
68
|
+
id: LabCommands.UndoCellAction.id,
|
|
69
|
+
command: LabCommands.UndoCellAction.id,
|
|
70
|
+
label: LabCommands.UndoCellAction.label,
|
|
71
|
+
});
|
|
72
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
73
|
+
id: LabCommands.RedoCellAction.id,
|
|
74
|
+
command: LabCommands.RedoCellAction.id,
|
|
75
|
+
label: LabCommands.RedoCellAction.label,
|
|
76
|
+
});
|
|
77
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
78
|
+
id: LabCommands.CutCell.id,
|
|
79
|
+
command: LabCommands.CutCell.id,
|
|
80
|
+
label: LabCommands.CutCell.label,
|
|
81
|
+
});
|
|
82
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
83
|
+
id: LabCommands.CopyCell.id,
|
|
84
|
+
command: LabCommands.CopyCell.id,
|
|
85
|
+
label: LabCommands.CopyCell.label,
|
|
86
|
+
});
|
|
87
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
88
|
+
id: LabCommands.PasteCellBelow.id,
|
|
89
|
+
command: LabCommands.PasteCellBelow.id,
|
|
90
|
+
label: LabCommands.PasteCellBelow.label,
|
|
91
|
+
});
|
|
92
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
93
|
+
id: LabCommands.PasteCellAbove.id,
|
|
94
|
+
command: LabCommands.PasteCellAbove.id,
|
|
95
|
+
label: LabCommands.PasteCellAbove.label,
|
|
96
|
+
});
|
|
97
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
98
|
+
id: LabCommands.PasteAndReplaceCell.id,
|
|
99
|
+
command: LabCommands.PasteAndReplaceCell.id,
|
|
100
|
+
label: LabCommands.PasteAndReplaceCell.label,
|
|
101
|
+
});
|
|
102
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
103
|
+
id: LabCommands.DeleteCell.id,
|
|
104
|
+
command: LabCommands.DeleteCell.id,
|
|
105
|
+
label: LabCommands.DeleteCell.label,
|
|
106
|
+
});
|
|
107
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
108
|
+
id: LabCommands.SelectAll.id,
|
|
109
|
+
command: LabCommands.SelectAll.id,
|
|
110
|
+
label: LabCommands.SelectAll.label,
|
|
113
111
|
});
|
|
114
112
|
// menu.registerMenuAction(HeaderMenus.EDIT, {
|
|
115
|
-
// id:
|
|
116
|
-
// command:
|
|
117
|
-
// label:
|
|
113
|
+
// id: LabCommands.DeselectAll.id,
|
|
114
|
+
// command: LabCommands.DeselectAll.id,
|
|
115
|
+
// label: LabCommands.DeselectAll.label,
|
|
118
116
|
// });
|
|
119
|
-
menu.registerMenuAction(
|
|
120
|
-
id:
|
|
121
|
-
command:
|
|
122
|
-
label:
|
|
123
|
-
});
|
|
124
|
-
menu.registerMenuAction(
|
|
125
|
-
id:
|
|
126
|
-
command:
|
|
127
|
-
label:
|
|
128
|
-
});
|
|
129
|
-
menu.registerMenuAction(
|
|
130
|
-
id:
|
|
131
|
-
command:
|
|
132
|
-
label:
|
|
133
|
-
});
|
|
134
|
-
menu.registerMenuAction(
|
|
135
|
-
id:
|
|
136
|
-
command:
|
|
137
|
-
label:
|
|
138
|
-
});
|
|
139
|
-
menu.registerMenuAction(
|
|
140
|
-
id:
|
|
141
|
-
command:
|
|
142
|
-
label:
|
|
143
|
-
});
|
|
144
|
-
menu.registerMenuAction(
|
|
145
|
-
id:
|
|
146
|
-
command:
|
|
147
|
-
label:
|
|
148
|
-
});
|
|
149
|
-
menu.registerMenuAction(
|
|
150
|
-
id:
|
|
151
|
-
command:
|
|
152
|
-
label:
|
|
153
|
-
});
|
|
154
|
-
menu.registerMenuAction(
|
|
155
|
-
id:
|
|
156
|
-
command:
|
|
157
|
-
label:
|
|
158
|
-
});
|
|
159
|
-
menu.registerMenuAction(
|
|
160
|
-
id:
|
|
161
|
-
command:
|
|
162
|
-
label:
|
|
163
|
-
});
|
|
164
|
-
menu.registerMenuAction(
|
|
165
|
-
id:
|
|
166
|
-
command:
|
|
167
|
-
label:
|
|
168
|
-
});
|
|
169
|
-
menu.registerMenuAction(
|
|
170
|
-
id:
|
|
171
|
-
command:
|
|
172
|
-
label:
|
|
173
|
-
});
|
|
174
|
-
menu.registerMenuAction(
|
|
175
|
-
id:
|
|
176
|
-
command:
|
|
177
|
-
label:
|
|
178
|
-
});
|
|
179
|
-
menu.registerMenuAction(
|
|
180
|
-
id:
|
|
181
|
-
command:
|
|
182
|
-
label:
|
|
183
|
-
});
|
|
184
|
-
menu.registerMenuAction(
|
|
185
|
-
id:
|
|
186
|
-
command:
|
|
187
|
-
label:
|
|
188
|
-
});
|
|
189
|
-
menu.registerMenuAction(
|
|
190
|
-
id:
|
|
191
|
-
command:
|
|
192
|
-
label:
|
|
193
|
-
});
|
|
194
|
-
menu.registerMenuAction(
|
|
195
|
-
id:
|
|
196
|
-
command:
|
|
197
|
-
label:
|
|
198
|
-
});
|
|
199
|
-
menu.registerMenuAction(
|
|
200
|
-
id:
|
|
201
|
-
command:
|
|
202
|
-
label:
|
|
203
|
-
});
|
|
204
|
-
menu.registerMenuAction(
|
|
205
|
-
id:
|
|
206
|
-
command:
|
|
207
|
-
label:
|
|
208
|
-
});
|
|
209
|
-
menu.registerMenuAction(
|
|
210
|
-
id:
|
|
211
|
-
command:
|
|
212
|
-
label:
|
|
213
|
-
});
|
|
214
|
-
menu.registerMenuAction(
|
|
215
|
-
id:
|
|
216
|
-
command:
|
|
217
|
-
label:
|
|
117
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
118
|
+
id: LabCommands.MoveCellUp.id,
|
|
119
|
+
command: LabCommands.MoveCellUp.id,
|
|
120
|
+
label: LabCommands.MoveCellUp.label,
|
|
121
|
+
});
|
|
122
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
123
|
+
id: LabCommands.MoveCellDown.id,
|
|
124
|
+
command: LabCommands.MoveCellDown.id,
|
|
125
|
+
label: LabCommands.MoveCellDown.label,
|
|
126
|
+
});
|
|
127
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
128
|
+
id: LabCommands.SplitCellAntCursor.id,
|
|
129
|
+
command: LabCommands.SplitCellAntCursor.id,
|
|
130
|
+
label: LabCommands.SplitCellAntCursor.label,
|
|
131
|
+
});
|
|
132
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
133
|
+
id: LabCommands.MergeCells.id,
|
|
134
|
+
command: LabCommands.MergeCells.id,
|
|
135
|
+
label: LabCommands.MergeCells.label,
|
|
136
|
+
});
|
|
137
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
138
|
+
id: LabCommands.MergeCellAbove.id,
|
|
139
|
+
command: LabCommands.MergeCellAbove.id,
|
|
140
|
+
label: LabCommands.MergeCellAbove.label,
|
|
141
|
+
});
|
|
142
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
143
|
+
id: LabCommands.MergeCellBelow.id,
|
|
144
|
+
command: LabCommands.MergeCellBelow.id,
|
|
145
|
+
label: LabCommands.MergeCellBelow.label,
|
|
146
|
+
});
|
|
147
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
148
|
+
id: LabCommands.ClearCellOutput.id,
|
|
149
|
+
command: LabCommands.ClearCellOutput.id,
|
|
150
|
+
label: LabCommands.ClearCellOutput.label,
|
|
151
|
+
});
|
|
152
|
+
menu.registerMenuAction(LabMenus.EDIT, {
|
|
153
|
+
id: LabCommands.ClearAllCellOutput.id,
|
|
154
|
+
command: LabCommands.ClearAllCellOutput.id,
|
|
155
|
+
label: LabCommands.ClearAllCellOutput.label,
|
|
156
|
+
});
|
|
157
|
+
menu.registerMenuAction(LabMenus.VIEW, {
|
|
158
|
+
id: LabCommands.HideOrShowCellCode.id,
|
|
159
|
+
command: LabCommands.HideOrShowCellCode.id,
|
|
160
|
+
label: LabCommands.HideOrShowCellCode.label,
|
|
161
|
+
});
|
|
162
|
+
menu.registerMenuAction(LabMenus.VIEW, {
|
|
163
|
+
id: LabCommands.HideOrShowOutputs.id,
|
|
164
|
+
command: LabCommands.HideOrShowOutputs.id,
|
|
165
|
+
label: LabCommands.HideOrShowOutputs.label,
|
|
166
|
+
});
|
|
167
|
+
menu.registerMenuAction(LabMenus.VIEW, {
|
|
168
|
+
id: LabCommands.EnableOutputScrolling.id,
|
|
169
|
+
command: LabCommands.EnableOutputScrolling.id,
|
|
170
|
+
label: LabCommands.EnableOutputScrolling.label,
|
|
171
|
+
});
|
|
172
|
+
menu.registerMenuAction(LabMenus.VIEW, {
|
|
173
|
+
id: LabCommands.DisableOutputScrolling.id,
|
|
174
|
+
command: LabCommands.DisableOutputScrolling.id,
|
|
175
|
+
label: LabCommands.DisableOutputScrolling.label,
|
|
176
|
+
});
|
|
177
|
+
menu.registerMenuAction(LabMenus.RUN, {
|
|
178
|
+
id: LabCommands.RunCell.id,
|
|
179
|
+
command: LabCommands.RunCell.id,
|
|
180
|
+
label: LabCommands.RunCell.label,
|
|
181
|
+
});
|
|
182
|
+
menu.registerMenuAction(LabMenus.RUN, {
|
|
183
|
+
id: LabCommands.RunAllAbove.id,
|
|
184
|
+
command: LabCommands.RunAllAbove.id,
|
|
185
|
+
label: LabCommands.RunAllAbove.label,
|
|
186
|
+
});
|
|
187
|
+
menu.registerMenuAction(LabMenus.RUN, {
|
|
188
|
+
id: LabCommands.RunAllBelow.id,
|
|
189
|
+
command: LabCommands.RunAllBelow.id,
|
|
190
|
+
label: LabCommands.RunAllBelow.label,
|
|
191
|
+
});
|
|
192
|
+
menu.registerMenuAction(LabMenus.RUN, {
|
|
193
|
+
id: LabCommands.RunAllCells.id,
|
|
194
|
+
command: LabCommands.RunAllCells.id,
|
|
195
|
+
label: LabCommands.RunAllCells.label,
|
|
196
|
+
});
|
|
197
|
+
menu.registerMenuAction(LabMenus.RUN, {
|
|
198
|
+
id: LabCommands.RunCellAndSelectNext.id,
|
|
199
|
+
command: LabCommands.RunCellAndSelectNext.id,
|
|
200
|
+
label: LabCommands.RunCellAndSelectNext.label,
|
|
201
|
+
});
|
|
202
|
+
menu.registerMenuAction(LabMenus.RUN, {
|
|
203
|
+
id: LabCommands.RunCellAndInsertBelow.id,
|
|
204
|
+
command: LabCommands.RunCellAndInsertBelow.id,
|
|
205
|
+
label: LabCommands.RunCellAndInsertBelow.label,
|
|
206
|
+
});
|
|
207
|
+
menu.registerMenuAction(LabMenus.RUN, {
|
|
208
|
+
id: LabCommands.RestartRunAll.id,
|
|
209
|
+
command: LabCommands.RestartRunAll.id,
|
|
210
|
+
label: LabCommands.RestartRunAll.label,
|
|
211
|
+
});
|
|
212
|
+
menu.registerMenuAction(LabMenus.RUN, {
|
|
213
|
+
id: LabCommands.RestartAndRunToSelected.id,
|
|
214
|
+
command: LabCommands.RestartAndRunToSelected.id,
|
|
215
|
+
label: LabCommands.RestartAndRunToSelected.label,
|
|
218
216
|
});
|
|
219
217
|
}
|
|
220
218
|
registerCommands(commands: CommandRegistry) {
|
|
221
|
-
commands.registerCommand(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
});
|
|
240
|
-
commands.registerCommand(
|
|
219
|
+
// commands.registerCommand(LabCommands.OpenTerminal, {
|
|
220
|
+
// execute: () => {
|
|
221
|
+
// this.viewManager
|
|
222
|
+
// .getOrCreateView<LibroTerminalView>(LibroTerminalView, {
|
|
223
|
+
// id: v4(),
|
|
224
|
+
// })
|
|
225
|
+
// .then((terminalView) => {
|
|
226
|
+
// this.layoutService.setAreaVisible(LibroLabLayoutSlots.contentBottom, true);
|
|
227
|
+
// this.layoutService.addView(terminalView, {
|
|
228
|
+
// slot: LibroLabLayoutSlots.contentBottom,
|
|
229
|
+
// reveal: true,
|
|
230
|
+
// });
|
|
231
|
+
// return;
|
|
232
|
+
// })
|
|
233
|
+
// .catch(() => {
|
|
234
|
+
// //
|
|
235
|
+
// });
|
|
236
|
+
// },
|
|
237
|
+
// });
|
|
238
|
+
commands.registerCommand(LabCommands.About, {
|
|
241
239
|
execute: async () => {
|
|
242
240
|
//TODO: 关于
|
|
243
241
|
},
|
|
244
242
|
});
|
|
245
|
-
commands.registerCommand(
|
|
243
|
+
commands.registerCommand(LabCommands.Save, {
|
|
246
244
|
execute: async () => {
|
|
247
245
|
//TODO: 保存
|
|
248
246
|
},
|
|
249
247
|
});
|
|
250
|
-
commands.registerCommandWithContext(
|
|
248
|
+
commands.registerCommandWithContext(LabCommands.UndoCellAction, this, {
|
|
251
249
|
execute: async () => {
|
|
252
250
|
if (this.libroService.active) {
|
|
253
251
|
this.commandRegistry.executeCommand(
|
|
@@ -265,7 +263,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
265
263
|
return false;
|
|
266
264
|
},
|
|
267
265
|
});
|
|
268
|
-
commands.registerCommandWithContext(
|
|
266
|
+
commands.registerCommandWithContext(LabCommands.RedoCellAction, this, {
|
|
269
267
|
execute: async () => {
|
|
270
268
|
if (this.libroService.active) {
|
|
271
269
|
this.commandRegistry.executeCommand(
|
|
@@ -283,7 +281,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
283
281
|
return false;
|
|
284
282
|
},
|
|
285
283
|
});
|
|
286
|
-
commands.registerCommandWithContext(
|
|
284
|
+
commands.registerCommandWithContext(LabCommands.CutCell, this, {
|
|
287
285
|
execute: async () => {
|
|
288
286
|
if (this.libroService.active) {
|
|
289
287
|
this.commandRegistry.executeCommand(
|
|
@@ -301,7 +299,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
301
299
|
return false;
|
|
302
300
|
},
|
|
303
301
|
});
|
|
304
|
-
commands.registerCommandWithContext(
|
|
302
|
+
commands.registerCommandWithContext(LabCommands.CopyCell, this, {
|
|
305
303
|
execute: async () => {
|
|
306
304
|
if (this.libroService.active) {
|
|
307
305
|
this.commandRegistry.executeCommand(
|
|
@@ -319,7 +317,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
319
317
|
return false;
|
|
320
318
|
},
|
|
321
319
|
});
|
|
322
|
-
commands.registerCommandWithContext(
|
|
320
|
+
commands.registerCommandWithContext(LabCommands.DeleteCell, this, {
|
|
323
321
|
execute: async () => {
|
|
324
322
|
if (this.libroService.active) {
|
|
325
323
|
this.commandRegistry.executeCommand(
|
|
@@ -337,7 +335,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
337
335
|
return false;
|
|
338
336
|
},
|
|
339
337
|
});
|
|
340
|
-
commands.registerCommandWithContext(
|
|
338
|
+
commands.registerCommandWithContext(LabCommands.PasteCellBelow, this, {
|
|
341
339
|
execute: async () => {
|
|
342
340
|
if (this.libroService.active) {
|
|
343
341
|
this.commandRegistry.executeCommand(
|
|
@@ -355,7 +353,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
355
353
|
return false;
|
|
356
354
|
},
|
|
357
355
|
});
|
|
358
|
-
commands.registerCommandWithContext(
|
|
356
|
+
commands.registerCommandWithContext(LabCommands.PasteCellAbove, this, {
|
|
359
357
|
execute: async () => {
|
|
360
358
|
if (this.libroService.active) {
|
|
361
359
|
this.commandRegistry.executeCommand(
|
|
@@ -373,7 +371,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
373
371
|
return false;
|
|
374
372
|
},
|
|
375
373
|
});
|
|
376
|
-
commands.registerCommandWithContext(
|
|
374
|
+
commands.registerCommandWithContext(LabCommands.PasteAndReplaceCell, this, {
|
|
377
375
|
execute: async () => {
|
|
378
376
|
if (this.libroService.active) {
|
|
379
377
|
this.commandRegistry.executeCommand(
|
|
@@ -391,7 +389,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
391
389
|
return false;
|
|
392
390
|
},
|
|
393
391
|
});
|
|
394
|
-
commands.registerCommandWithContext(
|
|
392
|
+
commands.registerCommandWithContext(LabCommands.SelectAll, this, {
|
|
395
393
|
execute: async () => {
|
|
396
394
|
if (this.libroService.active) {
|
|
397
395
|
this.commandRegistry.executeCommand(
|
|
@@ -409,7 +407,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
409
407
|
return false;
|
|
410
408
|
},
|
|
411
409
|
});
|
|
412
|
-
// commands.registerCommand(
|
|
410
|
+
// commands.registerCommand(LabCommands.DeselectAll, {
|
|
413
411
|
// execute: async () => {
|
|
414
412
|
// if (libro)
|
|
415
413
|
// this.commandRegistry.executeCommand(
|
|
@@ -419,7 +417,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
419
417
|
// );
|
|
420
418
|
// },
|
|
421
419
|
// });
|
|
422
|
-
commands.registerCommandWithContext(
|
|
420
|
+
commands.registerCommandWithContext(LabCommands.MoveCellUp, this, {
|
|
423
421
|
execute: async () => {
|
|
424
422
|
if (this.libroService.active) {
|
|
425
423
|
this.commandRegistry.executeCommand(
|
|
@@ -437,7 +435,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
437
435
|
return false;
|
|
438
436
|
},
|
|
439
437
|
});
|
|
440
|
-
commands.registerCommandWithContext(
|
|
438
|
+
commands.registerCommandWithContext(LabCommands.MoveCellDown, this, {
|
|
441
439
|
execute: async () => {
|
|
442
440
|
if (this.libroService.active) {
|
|
443
441
|
this.commandRegistry.executeCommand(
|
|
@@ -455,7 +453,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
455
453
|
return false;
|
|
456
454
|
},
|
|
457
455
|
});
|
|
458
|
-
commands.registerCommandWithContext(
|
|
456
|
+
commands.registerCommandWithContext(LabCommands.SplitCellAntCursor, this, {
|
|
459
457
|
execute: async () => {
|
|
460
458
|
if (this.libroService.active) {
|
|
461
459
|
this.commandRegistry.executeCommand(
|
|
@@ -473,7 +471,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
473
471
|
return false;
|
|
474
472
|
},
|
|
475
473
|
});
|
|
476
|
-
commands.registerCommandWithContext(
|
|
474
|
+
commands.registerCommandWithContext(LabCommands.MergeCells, this, {
|
|
477
475
|
execute: async () => {
|
|
478
476
|
if (this.libroService.active) {
|
|
479
477
|
this.commandRegistry.executeCommand(
|
|
@@ -491,7 +489,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
491
489
|
return false;
|
|
492
490
|
},
|
|
493
491
|
});
|
|
494
|
-
commands.registerCommandWithContext(
|
|
492
|
+
commands.registerCommandWithContext(LabCommands.MergeCellAbove, this, {
|
|
495
493
|
execute: async () => {
|
|
496
494
|
if (this.libroService.active) {
|
|
497
495
|
this.commandRegistry.executeCommand(
|
|
@@ -509,7 +507,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
509
507
|
return false;
|
|
510
508
|
},
|
|
511
509
|
});
|
|
512
|
-
commands.registerCommandWithContext(
|
|
510
|
+
commands.registerCommandWithContext(LabCommands.MergeCellBelow, this, {
|
|
513
511
|
execute: async () => {
|
|
514
512
|
if (this.libroService.active) {
|
|
515
513
|
this.commandRegistry.executeCommand(
|
|
@@ -527,7 +525,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
527
525
|
return false;
|
|
528
526
|
},
|
|
529
527
|
});
|
|
530
|
-
commands.registerCommandWithContext(
|
|
528
|
+
commands.registerCommandWithContext(LabCommands.ClearCellOutput, this, {
|
|
531
529
|
execute: async () => {
|
|
532
530
|
if (this.libroService.active) {
|
|
533
531
|
this.commandRegistry.executeCommand(
|
|
@@ -545,7 +543,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
545
543
|
return false;
|
|
546
544
|
},
|
|
547
545
|
});
|
|
548
|
-
commands.registerCommandWithContext(
|
|
546
|
+
commands.registerCommandWithContext(LabCommands.ClearAllCellOutput, this, {
|
|
549
547
|
execute: async () => {
|
|
550
548
|
if (this.libroService.active) {
|
|
551
549
|
this.commandRegistry.executeCommand(
|
|
@@ -563,7 +561,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
563
561
|
return false;
|
|
564
562
|
},
|
|
565
563
|
});
|
|
566
|
-
commands.registerCommandWithContext(
|
|
564
|
+
commands.registerCommandWithContext(LabCommands.HideOrShowCellCode, this, {
|
|
567
565
|
execute: async () => {
|
|
568
566
|
if (this.libroService.active) {
|
|
569
567
|
this.commandRegistry.executeCommand(
|
|
@@ -581,7 +579,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
581
579
|
return false;
|
|
582
580
|
},
|
|
583
581
|
});
|
|
584
|
-
commands.registerCommandWithContext(
|
|
582
|
+
commands.registerCommandWithContext(LabCommands.HideOrShowOutputs, this, {
|
|
585
583
|
execute: async () => {
|
|
586
584
|
if (this.libroService.active) {
|
|
587
585
|
this.commandRegistry.executeCommand(
|
|
@@ -599,7 +597,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
599
597
|
return false;
|
|
600
598
|
},
|
|
601
599
|
});
|
|
602
|
-
commands.registerCommandWithContext(
|
|
600
|
+
commands.registerCommandWithContext(LabCommands.EnableOutputScrolling, this, {
|
|
603
601
|
execute: async () => {
|
|
604
602
|
if (this.libroService.active) {
|
|
605
603
|
this.commandRegistry.executeCommand(
|
|
@@ -617,7 +615,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
617
615
|
return false;
|
|
618
616
|
},
|
|
619
617
|
});
|
|
620
|
-
commands.registerCommandWithContext(
|
|
618
|
+
commands.registerCommandWithContext(LabCommands.DisableOutputScrolling, this, {
|
|
621
619
|
execute: async () => {
|
|
622
620
|
if (this.libroService.active) {
|
|
623
621
|
this.commandRegistry.executeCommand(
|
|
@@ -635,7 +633,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
635
633
|
return false;
|
|
636
634
|
},
|
|
637
635
|
});
|
|
638
|
-
commands.registerCommandWithContext(
|
|
636
|
+
commands.registerCommandWithContext(LabCommands.RunCell, this, {
|
|
639
637
|
execute: async (ctx) => {
|
|
640
638
|
if (ctx.libroService.active) {
|
|
641
639
|
ctx.commandRegistry.executeCommand(
|
|
@@ -656,7 +654,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
656
654
|
);
|
|
657
655
|
},
|
|
658
656
|
});
|
|
659
|
-
commands.registerCommandWithContext(
|
|
657
|
+
commands.registerCommandWithContext(LabCommands.RunAllAbove, this, {
|
|
660
658
|
execute: async (ctx) => {
|
|
661
659
|
if (ctx.libroService.active) {
|
|
662
660
|
ctx.commandRegistry.executeCommand(
|
|
@@ -677,7 +675,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
677
675
|
);
|
|
678
676
|
},
|
|
679
677
|
});
|
|
680
|
-
commands.registerCommandWithContext(
|
|
678
|
+
commands.registerCommandWithContext(LabCommands.RunAllBelow, this, {
|
|
681
679
|
execute: async (ctx) => {
|
|
682
680
|
if (ctx.libroService.active) {
|
|
683
681
|
ctx.commandRegistry.executeCommand(
|
|
@@ -698,7 +696,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
698
696
|
);
|
|
699
697
|
},
|
|
700
698
|
});
|
|
701
|
-
commands.registerCommandWithContext(
|
|
699
|
+
commands.registerCommandWithContext(LabCommands.RunAllCells, this, {
|
|
702
700
|
execute: async (ctx) => {
|
|
703
701
|
if (ctx.libroService.active) {
|
|
704
702
|
ctx.commandRegistry.executeCommand(
|
|
@@ -719,7 +717,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
719
717
|
);
|
|
720
718
|
},
|
|
721
719
|
});
|
|
722
|
-
commands.registerCommandWithContext(
|
|
720
|
+
commands.registerCommandWithContext(LabCommands.RunCellAndInsertBelow, this, {
|
|
723
721
|
execute: async (ctx) => {
|
|
724
722
|
if (ctx.libroService.active) {
|
|
725
723
|
ctx.commandRegistry.executeCommand(
|
|
@@ -740,7 +738,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
740
738
|
);
|
|
741
739
|
},
|
|
742
740
|
});
|
|
743
|
-
commands.registerCommandWithContext(
|
|
741
|
+
commands.registerCommandWithContext(LabCommands.RunCellAndSelectNext, this, {
|
|
744
742
|
execute: async (ctx) => {
|
|
745
743
|
if (ctx.libroService.active) {
|
|
746
744
|
ctx.commandRegistry.executeCommand(
|
|
@@ -761,7 +759,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
761
759
|
);
|
|
762
760
|
},
|
|
763
761
|
});
|
|
764
|
-
commands.registerCommandWithContext(
|
|
762
|
+
commands.registerCommandWithContext(LabCommands.RestartRunAll, this, {
|
|
765
763
|
execute: async (ctx) => {
|
|
766
764
|
if (ctx.libroService.active) {
|
|
767
765
|
this.commandRegistry.executeCommand(
|
|
@@ -782,7 +780,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
782
780
|
);
|
|
783
781
|
},
|
|
784
782
|
});
|
|
785
|
-
commands.registerCommandWithContext(
|
|
783
|
+
commands.registerCommandWithContext(LabCommands.RestartRunAll, this, {
|
|
786
784
|
execute: async (ctx) => {
|
|
787
785
|
if (ctx.libroService.active) {
|
|
788
786
|
ctx.commandRegistry.executeCommand(
|
|
@@ -803,7 +801,7 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
|
|
|
803
801
|
);
|
|
804
802
|
},
|
|
805
803
|
});
|
|
806
|
-
commands.registerCommandWithContext(
|
|
804
|
+
commands.registerCommandWithContext(LabCommands.RestartAndRunToSelected, this, {
|
|
807
805
|
execute: async (ctx) => {
|
|
808
806
|
if (ctx.libroService.active) {
|
|
809
807
|
this.commandRegistry.executeCommand(
|