@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.
Files changed (92) hide show
  1. package/es/command/index.d.ts +5 -0
  2. package/es/command/index.d.ts.map +1 -0
  3. package/es/command/index.js +4 -0
  4. package/es/{menu/menu-command.d.ts → command/lab-command.d.ts} +6 -6
  5. package/es/command/lab-command.d.ts.map +1 -0
  6. package/es/{menu/menu-command.js → command/lab-command.js} +9 -5
  7. package/es/{menu/menu-contribution.d.ts → command/lab-menu-contribution.d.ts} +3 -3
  8. package/es/command/lab-menu-contribution.d.ts.map +1 -0
  9. package/es/{menu/menu-contribution.js → command/lab-menu-contribution.js} +242 -241
  10. package/es/command/menu-bar-view.d.ts.map +1 -0
  11. package/es/{menu → command}/menu-bar-view.js +2 -2
  12. package/es/command/module.d.ts.map +1 -0
  13. package/es/{menu → command}/module.js +2 -2
  14. package/es/config/config-contribution.js +2 -2
  15. package/es/editor-viewer/code-editor-open-handler.d.ts.map +1 -1
  16. package/es/editor-viewer/code-editor-open-handler.js +4 -4
  17. package/es/editor-viewer/code-editor-viewer.d.ts +1 -0
  18. package/es/editor-viewer/code-editor-viewer.d.ts.map +1 -1
  19. package/es/editor-viewer/code-editor-viewer.js +8 -2
  20. package/es/editor-viewer/index.less +16 -0
  21. package/es/editor-viewer/libro-default-open-handler.d.ts +11 -0
  22. package/es/editor-viewer/libro-default-open-handler.d.ts.map +1 -0
  23. package/es/editor-viewer/libro-default-open-handler.js +97 -0
  24. package/es/editor-viewer/libro-default-viewer.d.ts +14 -0
  25. package/es/editor-viewer/libro-default-viewer.d.ts.map +1 -0
  26. package/es/editor-viewer/libro-default-viewer.js +78 -0
  27. package/es/editor-viewer/module.d.ts.map +1 -1
  28. package/es/editor-viewer/module.js +3 -1
  29. package/es/editor-viewer/protocol.d.ts +2 -0
  30. package/es/editor-viewer/protocol.d.ts.map +1 -1
  31. package/es/editor-viewer/protocol.js +3 -1
  32. package/es/github-link/index.js +2 -2
  33. package/es/image-viewer/open-handler.js +2 -2
  34. package/es/image-viewer/viewer.js +2 -2
  35. package/es/index.d.ts +1 -1
  36. package/es/index.d.ts.map +1 -1
  37. package/es/index.js +1 -1
  38. package/es/index.less +17 -5
  39. package/es/kernel-manager/index.js +2 -2
  40. package/es/lab-app.d.ts.map +1 -1
  41. package/es/lab-app.js +6 -4
  42. package/es/layout/brand/brand.js +2 -2
  43. package/es/layout/container.js +2 -2
  44. package/es/layout/content-bottom-tab-view.js +2 -2
  45. package/es/layout/footer/current-file-footer-view.js +2 -2
  46. package/es/layout/footer/footer-view.js +2 -2
  47. package/es/layout/footer/status-footer-view.js +2 -2
  48. package/es/layout/layout-service.d.ts +2 -1
  49. package/es/layout/layout-service.d.ts.map +1 -1
  50. package/es/layout/layout-service.js +59 -25
  51. package/es/layout/layout.js +3 -4
  52. package/es/layout/main.js +2 -2
  53. package/es/layout/saveable-tab-view.d.ts +4 -1
  54. package/es/layout/saveable-tab-view.d.ts.map +1 -1
  55. package/es/layout/saveable-tab-view.js +27 -8
  56. package/es/layout/side-tab-view.js +2 -2
  57. package/es/module.d.ts.map +1 -1
  58. package/es/module.js +1 -1
  59. package/es/toc/libro-toc-panel-view.js +2 -2
  60. package/es/welcome/entry-point-view.d.ts.map +1 -1
  61. package/es/welcome/entry-point-view.js +4 -4
  62. package/es/welcome/welcome-view.js +2 -2
  63. package/package.json +8 -8
  64. package/src/command/index.ts +4 -0
  65. package/src/{menu/menu-command.ts → command/lab-command.ts} +9 -5
  66. package/src/{menu/menu-contribution.ts → command/lab-menu-contribution.ts} +228 -230
  67. package/src/{menu → command}/module.ts +2 -2
  68. package/src/editor-viewer/code-editor-open-handler.ts +2 -5
  69. package/src/editor-viewer/code-editor-viewer.tsx +7 -0
  70. package/src/editor-viewer/index.less +16 -0
  71. package/src/editor-viewer/libro-default-open-handler.ts +34 -0
  72. package/src/editor-viewer/libro-default-viewer.tsx +60 -0
  73. package/src/editor-viewer/module.ts +8 -1
  74. package/src/editor-viewer/protocol.ts +25 -0
  75. package/src/index.less +17 -5
  76. package/src/index.ts +1 -1
  77. package/src/lab-app.ts +6 -1
  78. package/src/layout/layout-service.ts +25 -3
  79. package/src/layout/saveable-tab-view.tsx +22 -1
  80. package/src/module.tsx +1 -1
  81. package/src/welcome/entry-point-view.tsx +2 -2
  82. package/es/menu/index.d.ts +0 -5
  83. package/es/menu/index.d.ts.map +0 -1
  84. package/es/menu/index.js +0 -4
  85. package/es/menu/menu-bar-view.d.ts.map +0 -1
  86. package/es/menu/menu-command.d.ts.map +0 -1
  87. package/es/menu/menu-contribution.d.ts.map +0 -1
  88. package/es/menu/module.d.ts.map +0 -1
  89. package/src/menu/index.ts +0 -4
  90. /package/es/{menu → command}/menu-bar-view.d.ts +0 -0
  91. /package/es/{menu → command}/module.d.ts +0 -0
  92. /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 { LibroTerminalView, TerminalManager } from '@difizen/libro-terminal';
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 { MenuCommands } from './menu-command.js';
21
+ import { LabCommands } from './lab-command.js';
24
22
 
25
- export namespace HeaderMenus {
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 HeaderMenu implements MenuContribution, CommandContribution {
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(HeaderMenus.FILE, { label: '文件' });
44
- menu.registerSubmenu(HeaderMenus.EDIT, { label: '编辑' });
45
- menu.registerSubmenu(HeaderMenus.VIEW, { label: '视图' });
46
- menu.registerSubmenu(HeaderMenus.RUN, { label: '运行' });
47
- menu.registerSubmenu(HeaderMenus.TERMINAL, { label: '终端' });
48
- menu.registerSubmenu(HeaderMenus.HELP, { label: '帮助' });
49
- menu.registerMenuAction(HeaderMenus.TERMINAL, {
50
- id: MenuCommands.OpenTerminal.id,
51
- command: MenuCommands.OpenTerminal.id,
52
- label: MenuCommands.OpenTerminal.label,
53
- });
54
- menu.registerMenuAction(HeaderMenus.HELP, {
55
- id: MenuCommands.About.id,
56
- command: MenuCommands.About.id,
57
- label: MenuCommands.About.label,
58
- });
59
- menu.registerMenuAction(HeaderMenus.FILE, {
60
- id: MenuCommands.Save.id,
61
- command: MenuCommands.Save.id,
62
- label: MenuCommands.Save.label,
63
- });
64
- menu.registerMenuAction(HeaderMenus.FILE, {
65
- id: MenuCommands.CreateFile.id,
66
- command: MenuCommands.CreateFile.id,
67
- label: MenuCommands.CreateFile.label,
68
- });
69
- menu.registerMenuAction(HeaderMenus.EDIT, {
70
- id: MenuCommands.UndoCellAction.id,
71
- command: MenuCommands.UndoCellAction.id,
72
- label: MenuCommands.UndoCellAction.label,
73
- });
74
- menu.registerMenuAction(HeaderMenus.EDIT, {
75
- id: MenuCommands.RedoCellAction.id,
76
- command: MenuCommands.RedoCellAction.id,
77
- label: MenuCommands.RedoCellAction.label,
78
- });
79
- menu.registerMenuAction(HeaderMenus.EDIT, {
80
- id: MenuCommands.CutCell.id,
81
- command: MenuCommands.CutCell.id,
82
- label: MenuCommands.CutCell.label,
83
- });
84
- menu.registerMenuAction(HeaderMenus.EDIT, {
85
- id: MenuCommands.CopyCell.id,
86
- command: MenuCommands.CopyCell.id,
87
- label: MenuCommands.CopyCell.label,
88
- });
89
- menu.registerMenuAction(HeaderMenus.EDIT, {
90
- id: MenuCommands.PasteCellBelow.id,
91
- command: MenuCommands.PasteCellBelow.id,
92
- label: MenuCommands.PasteCellBelow.label,
93
- });
94
- menu.registerMenuAction(HeaderMenus.EDIT, {
95
- id: MenuCommands.PasteCellAbove.id,
96
- command: MenuCommands.PasteCellAbove.id,
97
- label: MenuCommands.PasteCellAbove.label,
98
- });
99
- menu.registerMenuAction(HeaderMenus.EDIT, {
100
- id: MenuCommands.PasteAndReplaceCell.id,
101
- command: MenuCommands.PasteAndReplaceCell.id,
102
- label: MenuCommands.PasteAndReplaceCell.label,
103
- });
104
- menu.registerMenuAction(HeaderMenus.EDIT, {
105
- id: MenuCommands.DeleteCell.id,
106
- command: MenuCommands.DeleteCell.id,
107
- label: MenuCommands.DeleteCell.label,
108
- });
109
- menu.registerMenuAction(HeaderMenus.EDIT, {
110
- id: MenuCommands.SelectAll.id,
111
- command: MenuCommands.SelectAll.id,
112
- label: MenuCommands.SelectAll.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: MenuCommands.DeselectAll.id,
116
- // command: MenuCommands.DeselectAll.id,
117
- // label: MenuCommands.DeselectAll.label,
113
+ // id: LabCommands.DeselectAll.id,
114
+ // command: LabCommands.DeselectAll.id,
115
+ // label: LabCommands.DeselectAll.label,
118
116
  // });
119
- menu.registerMenuAction(HeaderMenus.EDIT, {
120
- id: MenuCommands.MoveCellUp.id,
121
- command: MenuCommands.MoveCellUp.id,
122
- label: MenuCommands.MoveCellUp.label,
123
- });
124
- menu.registerMenuAction(HeaderMenus.EDIT, {
125
- id: MenuCommands.MoveCellDown.id,
126
- command: MenuCommands.MoveCellDown.id,
127
- label: MenuCommands.MoveCellDown.label,
128
- });
129
- menu.registerMenuAction(HeaderMenus.EDIT, {
130
- id: MenuCommands.SplitCellAntCursor.id,
131
- command: MenuCommands.SplitCellAntCursor.id,
132
- label: MenuCommands.SplitCellAntCursor.label,
133
- });
134
- menu.registerMenuAction(HeaderMenus.EDIT, {
135
- id: MenuCommands.MergeCells.id,
136
- command: MenuCommands.MergeCells.id,
137
- label: MenuCommands.MergeCells.label,
138
- });
139
- menu.registerMenuAction(HeaderMenus.EDIT, {
140
- id: MenuCommands.MergeCellAbove.id,
141
- command: MenuCommands.MergeCellAbove.id,
142
- label: MenuCommands.MergeCellAbove.label,
143
- });
144
- menu.registerMenuAction(HeaderMenus.EDIT, {
145
- id: MenuCommands.MergeCellBelow.id,
146
- command: MenuCommands.MergeCellBelow.id,
147
- label: MenuCommands.MergeCellBelow.label,
148
- });
149
- menu.registerMenuAction(HeaderMenus.EDIT, {
150
- id: MenuCommands.ClearCellOutput.id,
151
- command: MenuCommands.ClearCellOutput.id,
152
- label: MenuCommands.ClearCellOutput.label,
153
- });
154
- menu.registerMenuAction(HeaderMenus.EDIT, {
155
- id: MenuCommands.ClearAllCellOutput.id,
156
- command: MenuCommands.ClearAllCellOutput.id,
157
- label: MenuCommands.ClearAllCellOutput.label,
158
- });
159
- menu.registerMenuAction(HeaderMenus.VIEW, {
160
- id: MenuCommands.HideOrShowCellCode.id,
161
- command: MenuCommands.HideOrShowCellCode.id,
162
- label: MenuCommands.HideOrShowCellCode.label,
163
- });
164
- menu.registerMenuAction(HeaderMenus.VIEW, {
165
- id: MenuCommands.HideOrShowOutputs.id,
166
- command: MenuCommands.HideOrShowOutputs.id,
167
- label: MenuCommands.HideOrShowOutputs.label,
168
- });
169
- menu.registerMenuAction(HeaderMenus.VIEW, {
170
- id: MenuCommands.EnableOutputScrolling.id,
171
- command: MenuCommands.EnableOutputScrolling.id,
172
- label: MenuCommands.EnableOutputScrolling.label,
173
- });
174
- menu.registerMenuAction(HeaderMenus.VIEW, {
175
- id: MenuCommands.DisableOutputScrolling.id,
176
- command: MenuCommands.DisableOutputScrolling.id,
177
- label: MenuCommands.DisableOutputScrolling.label,
178
- });
179
- menu.registerMenuAction(HeaderMenus.RUN, {
180
- id: MenuCommands.RunCell.id,
181
- command: MenuCommands.RunCell.id,
182
- label: MenuCommands.RunCell.label,
183
- });
184
- menu.registerMenuAction(HeaderMenus.RUN, {
185
- id: MenuCommands.RunAllAbove.id,
186
- command: MenuCommands.RunAllAbove.id,
187
- label: MenuCommands.RunAllAbove.label,
188
- });
189
- menu.registerMenuAction(HeaderMenus.RUN, {
190
- id: MenuCommands.RunAllBelow.id,
191
- command: MenuCommands.RunAllBelow.id,
192
- label: MenuCommands.RunAllBelow.label,
193
- });
194
- menu.registerMenuAction(HeaderMenus.RUN, {
195
- id: MenuCommands.RunAllCells.id,
196
- command: MenuCommands.RunAllCells.id,
197
- label: MenuCommands.RunAllCells.label,
198
- });
199
- menu.registerMenuAction(HeaderMenus.RUN, {
200
- id: MenuCommands.RunCellAndSelectNext.id,
201
- command: MenuCommands.RunCellAndSelectNext.id,
202
- label: MenuCommands.RunCellAndSelectNext.label,
203
- });
204
- menu.registerMenuAction(HeaderMenus.RUN, {
205
- id: MenuCommands.RunCellAndInsertBelow.id,
206
- command: MenuCommands.RunCellAndInsertBelow.id,
207
- label: MenuCommands.RunCellAndInsertBelow.label,
208
- });
209
- menu.registerMenuAction(HeaderMenus.RUN, {
210
- id: MenuCommands.RestartRunAll.id,
211
- command: MenuCommands.RestartRunAll.id,
212
- label: MenuCommands.RestartRunAll.label,
213
- });
214
- menu.registerMenuAction(HeaderMenus.RUN, {
215
- id: MenuCommands.RestartAndRunToSelected.id,
216
- command: MenuCommands.RestartAndRunToSelected.id,
217
- label: MenuCommands.RestartAndRunToSelected.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(MenuCommands.OpenTerminal, {
222
- execute: () => {
223
- this.viewManager
224
- .getOrCreateView<LibroTerminalView>(LibroTerminalView, {
225
- id: v4(),
226
- })
227
- .then((terminalView) => {
228
- this.layoutService.setAreaVisible(LibroLabLayoutSlots.contentBottom, true);
229
- this.layoutService.addView(terminalView, {
230
- slot: LibroLabLayoutSlots.contentBottom,
231
- reveal: true,
232
- });
233
- return;
234
- })
235
- .catch(() => {
236
- //
237
- });
238
- },
239
- });
240
- commands.registerCommand(MenuCommands.About, {
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(MenuCommands.Save, {
243
+ commands.registerCommand(LabCommands.Save, {
246
244
  execute: async () => {
247
245
  //TODO: 保存
248
246
  },
249
247
  });
250
- commands.registerCommandWithContext(MenuCommands.UndoCellAction, this, {
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(MenuCommands.RedoCellAction, this, {
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(MenuCommands.CutCell, this, {
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(MenuCommands.CopyCell, this, {
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(MenuCommands.DeleteCell, this, {
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(MenuCommands.PasteCellBelow, this, {
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(MenuCommands.PasteCellAbove, this, {
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(MenuCommands.PasteAndReplaceCell, this, {
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(MenuCommands.SelectAll, this, {
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(MenuCommands.DeselectAll, {
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(MenuCommands.MoveCellUp, this, {
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(MenuCommands.MoveCellDown, this, {
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(MenuCommands.SplitCellAntCursor, this, {
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(MenuCommands.MergeCells, this, {
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(MenuCommands.MergeCellAbove, this, {
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(MenuCommands.MergeCellBelow, this, {
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(MenuCommands.ClearCellOutput, this, {
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(MenuCommands.ClearAllCellOutput, this, {
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(MenuCommands.HideOrShowCellCode, this, {
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(MenuCommands.HideOrShowOutputs, this, {
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(MenuCommands.EnableOutputScrolling, this, {
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(MenuCommands.DisableOutputScrolling, this, {
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(MenuCommands.RunCell, this, {
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(MenuCommands.RunAllAbove, this, {
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(MenuCommands.RunAllBelow, this, {
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(MenuCommands.RunAllCells, this, {
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(MenuCommands.RunCellAndInsertBelow, this, {
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(MenuCommands.RunCellAndSelectNext, this, {
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(MenuCommands.RestartRunAll, this, {
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(MenuCommands.RestartRunAll, this, {
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(MenuCommands.RestartAndRunToSelected, this, {
804
+ commands.registerCommandWithContext(LabCommands.RestartAndRunToSelected, this, {
807
805
  execute: async (ctx) => {
808
806
  if (ctx.libroService.active) {
809
807
  this.commandRegistry.executeCommand(