@difizen/libro-core 0.1.1 → 0.1.2
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/add-cell/index.less +1 -1
- package/es/add-cell/libro-add-cell-slot-contribution.d.ts +1 -2
- package/es/add-cell/libro-add-cell-slot-contribution.d.ts.map +1 -1
- package/es/add-cell/libro-add-cell-slot-contribution.js +12 -6
- package/es/add-cell/libro-add-cell-view.d.ts +4 -4
- package/es/add-cell/libro-add-cell-view.d.ts.map +1 -1
- package/es/add-cell/libro-add-cell-view.js +4 -6
- package/es/cell/libro-cell-contribution.d.ts +1 -2
- package/es/cell/libro-cell-contribution.d.ts.map +1 -1
- package/es/cell/libro-cell-contribution.js +14 -8
- package/es/cell/libro-cell-model.d.ts +9 -0
- package/es/cell/libro-cell-model.d.ts.map +1 -1
- package/es/cell/libro-cell-model.js +53 -11
- package/es/cell/libro-cell-protocol.d.ts +2 -0
- package/es/cell/libro-cell-protocol.d.ts.map +1 -1
- package/es/cell/libro-cell-view.d.ts +6 -2
- package/es/cell/libro-cell-view.d.ts.map +1 -1
- package/es/cell/libro-cell-view.js +54 -24
- package/es/cell/libro-edit-cell-view.d.ts +6 -12
- package/es/cell/libro-edit-cell-view.d.ts.map +1 -1
- package/es/cell/libro-edit-cell-view.js +9 -4
- package/es/cell/libro-executable-cell-view.d.ts +2 -0
- package/es/cell/libro-executable-cell-view.d.ts.map +1 -1
- package/es/cell/libro-executable-cell-view.js +4 -1
- package/es/collapse-service.d.ts +1 -1
- package/es/collapse-service.d.ts.map +1 -1
- package/es/collapse-service.js +1 -1
- package/es/command/document-commands.d.ts +1 -2
- package/es/command/document-commands.d.ts.map +1 -1
- package/es/command/document-commands.js +3 -2
- package/es/command/kernel-command.d.ts.map +1 -1
- package/es/command/kernel-command.js +3 -0
- package/es/command/libro-command-contribution.d.ts +0 -1
- package/es/command/libro-command-contribution.d.ts.map +1 -1
- package/es/command/libro-command-contribution.js +179 -129
- package/es/command/libro-command-register.d.ts +0 -1
- package/es/command/libro-command-register.d.ts.map +1 -1
- package/es/command/libro-command-register.js +13 -7
- package/es/command/notebook-commands.d.ts.map +1 -1
- package/es/command/notebook-commands.js +17 -4
- package/es/components/cell-protocol.d.ts +5 -5
- package/es/components/cell-protocol.d.ts.map +1 -1
- package/es/components/dnd-cell-item-render.d.ts +6 -2
- package/es/components/dnd-cell-item-render.d.ts.map +1 -1
- package/es/components/dnd-cell-item-render.js +194 -89
- package/es/components/dnd-component/custom-drag-layer.d.ts +1 -1
- package/es/components/dnd-component/custom-drag-layer.d.ts.map +1 -1
- package/es/components/dnd-component/custom-drag-layer.js +3 -4
- package/es/components/dnd-component/default-dnd-content.d.ts +2 -1
- package/es/components/dnd-component/default-dnd-content.d.ts.map +1 -1
- package/es/components/dnd-component/default-dnd-content.js +100 -44
- package/es/components/dnd-component/dnd-context.js +1 -1
- package/es/components/dnd-component/dnd-list.d.ts +9 -5
- package/es/components/dnd-component/dnd-list.d.ts.map +1 -1
- package/es/components/dnd-component/dnd-list.js +93 -26
- package/es/components/dnd-component/index.d.ts +1 -1
- package/es/components/dnd-component/index.d.ts.map +1 -1
- package/es/components/dnd-component/index.js +2 -2
- package/es/components/dnd-component/index.less +8 -0
- package/es/components/dnd-component/overscanIndices-getter.d.ts +22 -0
- package/es/components/dnd-component/overscanIndices-getter.d.ts.map +1 -0
- package/es/components/dnd-component/overscanIndices-getter.js +58 -0
- package/es/components/dnd-component/virtualized-manager.d.ts +19 -0
- package/es/components/dnd-component/virtualized-manager.d.ts.map +1 -0
- package/es/components/dnd-component/virtualized-manager.js +60 -0
- package/es/components/index.d.ts +2 -2
- package/es/components/index.d.ts.map +1 -1
- package/es/components/index.js +2 -2
- package/es/components/libro-virtualized-render.d.ts +15 -0
- package/es/components/libro-virtualized-render.d.ts.map +1 -0
- package/es/components/libro-virtualized-render.js +174 -0
- package/es/content/index.d.ts +1 -0
- package/es/content/index.d.ts.map +1 -1
- package/es/content/index.js +2 -1
- package/es/content/libro-content-contribution.d.ts +2 -2
- package/es/content/libro-content-contribution.d.ts.map +1 -1
- package/es/content/libro-content-contribution.js +2 -3
- package/es/content/libro-content-module.d.ts.map +1 -1
- package/es/content/libro-content-module.js +3 -2
- package/es/content/libro-content-protocol.d.ts +5 -0
- package/es/content/libro-content-protocol.d.ts.map +1 -1
- package/es/content/libro-content-protocol.js +2 -1
- package/es/content/libro-content-service.d.ts +5 -3
- package/es/content/libro-content-service.d.ts.map +1 -1
- package/es/content/libro-content-service.js +36 -8
- package/es/content/libro-save-content-contribution.d.ts +6 -0
- package/es/content/libro-save-content-contribution.d.ts.map +1 -0
- package/es/content/libro-save-content-contribution.js +27 -0
- package/es/formatter/index.d.ts +6 -0
- package/es/formatter/index.d.ts.map +1 -0
- package/es/formatter/index.js +5 -0
- package/es/formatter/libro-formatter-json-contribution.d.ts +18 -0
- package/es/formatter/libro-formatter-json-contribution.d.ts.map +1 -0
- package/es/formatter/libro-formatter-json-contribution.js +41 -0
- package/es/formatter/libro-formatter-manager.d.ts +16 -0
- package/es/formatter/libro-formatter-manager.d.ts.map +1 -0
- package/es/formatter/libro-formatter-manager.js +86 -0
- package/es/formatter/libro-formatter-module.d.ts +3 -0
- package/es/formatter/libro-formatter-module.d.ts.map +1 -0
- package/es/formatter/libro-formatter-module.js +7 -0
- package/es/formatter/libro-formatter-protocol.d.ts +37 -0
- package/es/formatter/libro-formatter-protocol.d.ts.map +1 -0
- package/es/formatter/libro-formatter-protocol.js +18 -0
- package/es/formatter/libro-formatter-string-contribution.d.ts +18 -0
- package/es/formatter/libro-formatter-string-contribution.d.ts.map +1 -0
- package/es/formatter/libro-formatter-string-contribution.js +41 -0
- package/es/formatter/libro-formatter-trans-default-contribution.d.ts +7 -0
- package/es/formatter/libro-formatter-trans-default-contribution.d.ts.map +1 -0
- package/es/formatter/libro-formatter-trans-default-contribution.js +19 -0
- package/es/index.d.ts +5 -1
- package/es/index.d.ts.map +1 -1
- package/es/index.js +6 -2
- package/es/index.less +135 -58
- package/es/libro-context-key.d.ts.map +1 -1
- package/es/libro-model.d.ts +13 -2
- package/es/libro-model.d.ts.map +1 -1
- package/es/libro-model.js +149 -70
- package/es/libro-protocol.d.ts +44 -2
- package/es/libro-protocol.d.ts.map +1 -1
- package/es/libro-protocol.js +16 -3
- package/es/libro-service.d.ts +1 -1
- package/es/libro-service.d.ts.map +1 -1
- package/es/libro-service.js +29 -20
- package/es/{configuration/libro-configuration-contribution.d.ts → libro-setting-contribution.d.ts} +2 -2
- package/es/libro-setting-contribution.d.ts.map +1 -0
- package/es/{configuration/libro-configuration-contribution.js → libro-setting-contribution.js} +8 -9
- package/es/{configuration/libro-configuration.d.ts → libro-setting.d.ts} +3 -2
- package/es/libro-setting.d.ts.map +1 -0
- package/es/{configuration/libro-configuration.js → libro-setting.js} +17 -7
- package/es/libro-view.d.ts +21 -8
- package/es/libro-view.d.ts.map +1 -1
- package/es/libro-view.js +477 -338
- package/es/material-from-designer.d.ts +3 -0
- package/es/material-from-designer.d.ts.map +1 -1
- package/es/material-from-designer.js +112 -1
- package/es/module.d.ts.map +1 -1
- package/es/module.js +20 -5
- package/es/output/output-area.d.ts +3 -4
- package/es/output/output-area.d.ts.map +1 -1
- package/es/output/output-area.js +23 -16
- package/es/output/output-contribution.d.ts +0 -1
- package/es/output/output-contribution.d.ts.map +1 -1
- package/es/output/output-contribution.js +14 -9
- package/es/output/output-model.d.ts +2 -2
- package/es/output/output-model.d.ts.map +1 -1
- package/es/output/output-model.js +2 -2
- package/es/output/output-protocol.d.ts.map +1 -1
- package/es/output/output-protocol.js +0 -2
- package/es/settings/index.d.ts +5 -0
- package/es/settings/index.d.ts.map +1 -0
- package/es/settings/index.js +4 -0
- package/es/settings/index.less +3 -0
- package/es/settings/module.d.ts +3 -0
- package/es/settings/module.d.ts.map +1 -0
- package/es/settings/module.js +4 -0
- package/es/settings/setting-editor/configuration-panel-view.d.ts +13 -0
- package/es/settings/setting-editor/configuration-panel-view.d.ts.map +1 -0
- package/es/settings/setting-editor/configuration-panel-view.js +115 -0
- package/es/settings/setting-editor/configuration-render-contribution.d.ts +6 -0
- package/es/settings/setting-editor/configuration-render-contribution.d.ts.map +1 -0
- package/es/settings/setting-editor/configuration-render-contribution.js +77 -0
- package/es/settings/setting-editor/default-node-render.d.ts +9 -0
- package/es/settings/setting-editor/default-node-render.d.ts.map +1 -0
- package/es/settings/setting-editor/default-node-render.js +79 -0
- package/es/settings/setting-editor/index.d.ts +7 -0
- package/es/settings/setting-editor/index.d.ts.map +1 -0
- package/es/settings/setting-editor/index.js +6 -0
- package/es/settings/setting-editor/index.less +12 -0
- package/es/settings/setting-editor/module.d.ts +3 -0
- package/es/settings/setting-editor/module.d.ts.map +1 -0
- package/es/settings/setting-editor/module.js +7 -0
- package/es/settings/setting-editor/setting-editor-view.d.ts +15 -0
- package/es/settings/setting-editor/setting-editor-view.d.ts.map +1 -0
- package/es/settings/setting-editor/setting-editor-view.js +169 -0
- package/es/settings/setting-editor/setting-tree-service.d.ts +9 -0
- package/es/settings/setting-editor/setting-tree-service.d.ts.map +1 -0
- package/es/settings/setting-editor/setting-tree-service.js +118 -0
- package/es/settings/setting-editor/setting-tree-view.d.ts +19 -0
- package/es/settings/setting-editor/setting-tree-view.d.ts.map +1 -0
- package/es/settings/setting-editor/setting-tree-view.js +88 -0
- package/es/settings/settings-contribution.d.ts +7 -0
- package/es/settings/settings-contribution.d.ts.map +1 -0
- package/es/settings/settings-contribution.js +36 -0
- package/es/settings/settings-modal.d.ts +5 -0
- package/es/settings/settings-modal.d.ts.map +1 -0
- package/es/settings/settings-modal.js +53 -0
- package/es/settings/settings-modal.less +3 -0
- package/es/settings/settings-protocol.d.ts +4 -0
- package/es/settings/settings-protocol.d.ts.map +1 -0
- package/es/settings/settings-protocol.js +5 -0
- package/es/slot/libro-slot-manager.d.ts +2 -2
- package/es/slot/libro-slot-manager.d.ts.map +1 -1
- package/es/slot/libro-slot-manager.js +14 -8
- package/es/slot/libro-slot-view.d.ts +3 -3
- package/es/slot/libro-slot-view.d.ts.map +1 -1
- package/es/slot/libro-slot-view.js +2 -2
- package/es/theme/libro-color-registry.d.ts.map +1 -1
- package/es/theme/libro-color-registry.js +7 -0
- package/es/toolbar/all-outputs-scroll-icon.d.ts +3 -0
- package/es/toolbar/all-outputs-scroll-icon.d.ts.map +1 -0
- package/es/toolbar/all-outputs-scroll-icon.js +10 -0
- package/es/toolbar/libro-toolbar.d.ts +2 -1
- package/es/toolbar/libro-toolbar.d.ts.map +1 -1
- package/es/toolbar/libro-toolbar.js +44 -8
- package/es/toolbar/restart-clear-outputs-modal.d.ts +1 -2
- package/es/toolbar/restart-clear-outputs-modal.d.ts.map +1 -1
- package/es/toolbar/restart-clear-outputs-modal.js +2 -2
- package/es/toolbar/shutdown-modal.d.ts +1 -2
- package/es/toolbar/shutdown-modal.d.ts.map +1 -1
- package/es/toolbar/shutdown-modal.js +2 -2
- package/es/toolbar/side-toolar-more-select.d.ts.map +1 -1
- package/es/toolbar/side-toolar-more-select.js +2 -2
- package/es/virtualized-manager-helper.d.ts +11 -0
- package/es/virtualized-manager-helper.d.ts.map +1 -0
- package/es/virtualized-manager-helper.js +51 -0
- package/es/virtualized-manager.d.ts +19 -0
- package/es/virtualized-manager.d.ts.map +1 -0
- package/es/virtualized-manager.js +61 -0
- package/package.json +9 -6
- package/src/add-cell/index.less +1 -1
- package/src/add-cell/libro-add-cell-slot-contribution.ts +1 -4
- package/src/add-cell/libro-add-cell-view.tsx +13 -6
- package/src/cell/libro-cell-contribution.ts +2 -6
- package/src/cell/libro-cell-model.ts +57 -4
- package/src/cell/libro-cell-protocol.ts +2 -0
- package/src/cell/libro-cell-view.tsx +21 -9
- package/src/cell/libro-edit-cell-view.tsx +10 -9
- package/src/cell/libro-executable-cell-view.ts +6 -1
- package/src/collapse-service.ts +1 -1
- package/src/command/document-commands.ts +3 -5
- package/src/command/kernel-command.ts +3 -0
- package/src/command/libro-command-contribution.ts +107 -91
- package/src/command/libro-command-register.ts +1 -4
- package/src/command/notebook-commands.ts +16 -3
- package/src/components/cell-protocol.ts +5 -5
- package/src/components/dnd-cell-item-render.tsx +239 -92
- package/src/components/dnd-component/custom-drag-layer.tsx +5 -6
- package/src/components/dnd-component/default-dnd-content.tsx +113 -42
- package/src/components/dnd-component/dnd-context.tsx +1 -1
- package/src/components/dnd-component/dnd-list.tsx +135 -43
- package/src/components/dnd-component/index.less +8 -0
- package/src/components/dnd-component/index.tsx +1 -1
- package/src/components/dnd-component/overscanIndices-getter.ts +92 -0
- package/src/components/dnd-component/virtualized-manager.ts +34 -0
- package/src/components/index.ts +2 -2
- package/src/components/libro-virtualized-render.tsx +178 -0
- package/src/content/index.ts +1 -0
- package/src/content/libro-content-contribution.ts +2 -3
- package/src/content/libro-content-module.ts +11 -3
- package/src/content/libro-content-protocol.ts +6 -0
- package/src/content/libro-content-service.ts +26 -8
- package/src/content/libro-save-content-contribution.ts +12 -0
- package/src/formatter/index.ts +5 -0
- package/src/formatter/libro-formatter-json-contribution.ts +42 -0
- package/src/formatter/libro-formatter-manager.ts +85 -0
- package/src/formatter/libro-formatter-module.ts +19 -0
- package/src/formatter/libro-formatter-protocol.ts +63 -0
- package/src/formatter/libro-formatter-string-contribution.ts +41 -0
- package/src/formatter/libro-formatter-trans-default-contribution.ts +15 -0
- package/src/index.less +135 -58
- package/src/index.tsx +6 -1
- package/src/libro-context-key.ts +3 -3
- package/src/libro-model.ts +87 -23
- package/src/libro-protocol.ts +81 -4
- package/src/libro-service.ts +4 -13
- package/src/{configuration/libro-configuration-contribution.ts → libro-setting-contribution.ts} +7 -8
- package/src/{configuration/libro-configuration.ts → libro-setting.ts} +18 -7
- package/src/libro-view.tsx +273 -141
- package/src/material-from-designer.tsx +93 -1
- package/src/module.ts +29 -7
- package/src/output/output-area.tsx +18 -12
- package/src/output/output-contribution.ts +2 -6
- package/src/output/output-model.tsx +3 -3
- package/src/output/output-protocol.ts +0 -1
- package/src/settings/index.less +3 -0
- package/src/settings/index.ts +4 -0
- package/src/settings/module.ts +8 -0
- package/src/settings/setting-editor/configuration-panel-view.tsx +89 -0
- package/src/settings/setting-editor/configuration-render-contribution.ts +81 -0
- package/src/settings/setting-editor/default-node-render.tsx +65 -0
- package/src/settings/setting-editor/index.less +12 -0
- package/src/settings/setting-editor/index.ts +6 -0
- package/src/settings/setting-editor/module.ts +17 -0
- package/src/settings/setting-editor/setting-editor-view.tsx +93 -0
- package/src/settings/setting-editor/setting-tree-service.ts +82 -0
- package/src/settings/setting-editor/setting-tree-view.tsx +95 -0
- package/src/settings/settings-contribution.tsx +24 -0
- package/src/settings/settings-modal.less +3 -0
- package/src/settings/settings-modal.tsx +50 -0
- package/src/settings/settings-protocol.ts +7 -0
- package/src/slot/libro-slot-manager.ts +1 -3
- package/src/slot/libro-slot-view.tsx +2 -5
- package/src/theme/libro-color-registry.ts +6 -0
- package/src/toolbar/all-outputs-scroll-icon.tsx +19 -0
- package/src/toolbar/libro-toolbar.tsx +30 -5
- package/src/toolbar/restart-clear-outputs-modal.tsx +3 -3
- package/src/toolbar/shutdown-modal.tsx +3 -3
- package/src/toolbar/side-toolar-more-select.tsx +2 -1
- package/src/virtualized-manager-helper.ts +29 -0
- package/src/virtualized-manager.ts +34 -0
- package/es/configuration/libro-configuration-contribution.d.ts.map +0 -1
- package/es/configuration/libro-configuration.d.ts.map +0 -1
|
@@ -15,6 +15,7 @@ import type { CellView, NotebookView } from '../libro-protocol.js';
|
|
|
15
15
|
import { LibroToolbarArea } from '../libro-protocol.js';
|
|
16
16
|
import { LibroService } from '../libro-service.js';
|
|
17
17
|
import { LibroView } from '../libro-view.js';
|
|
18
|
+
import { SettingsModal } from '../settings/settings-modal.js';
|
|
18
19
|
import { RestartClearOutputModal } from '../toolbar/restart-clear-outputs-modal.js';
|
|
19
20
|
import { ShutdownModal } from '../toolbar/shutdown-modal.js';
|
|
20
21
|
|
|
@@ -24,29 +25,17 @@ import { NotebookCommands } from './notebook-commands.js';
|
|
|
24
25
|
|
|
25
26
|
@singleton({ contrib: CommandContribution })
|
|
26
27
|
export class LibroCommandContribution implements CommandContribution {
|
|
27
|
-
protected readonly modalService: ModalService;
|
|
28
|
-
protected readonly libroCommand: LibroCommandRegister;
|
|
29
|
-
protected readonly libroService: LibroService;
|
|
30
|
-
protected readonly lirboContextKey: LirboContextKey;
|
|
31
|
-
|
|
32
|
-
constructor(
|
|
33
|
-
@inject(ModalService) modalService: ModalService,
|
|
34
|
-
@inject(LibroCommandRegister) libroCommand: LibroCommandRegister,
|
|
35
|
-
@inject(LibroService) libroService: LibroService,
|
|
36
|
-
@inject(LirboContextKey) lirboContextKey: LirboContextKey,
|
|
37
|
-
) {
|
|
38
|
-
this.libroCommand = libroCommand;
|
|
39
|
-
this.modalService = modalService;
|
|
40
|
-
this.libroService = libroService;
|
|
41
|
-
this.lirboContextKey = lirboContextKey;
|
|
42
|
-
}
|
|
28
|
+
@inject(ModalService) protected readonly modalService: ModalService;
|
|
29
|
+
@inject(LibroCommandRegister) protected readonly libroCommand: LibroCommandRegister;
|
|
30
|
+
@inject(LibroService) protected readonly libroService: LibroService;
|
|
31
|
+
@inject(LirboContextKey) protected readonly lirboContextKey: LirboContextKey;
|
|
43
32
|
|
|
44
33
|
registerCommands(command: CommandRegistry): void {
|
|
45
34
|
this.libroCommand.registerLibroCommand(command, NotebookCommands['EnterEditMode'], {
|
|
46
35
|
execute: async () => {
|
|
47
36
|
this.libroService.active?.enterEditMode();
|
|
48
37
|
},
|
|
49
|
-
isEnabled: (
|
|
38
|
+
isEnabled: (cell, libro) => {
|
|
50
39
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
51
40
|
return false;
|
|
52
41
|
}
|
|
@@ -58,7 +47,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
58
47
|
NotebookCommands['EnterCommandMode'],
|
|
59
48
|
{
|
|
60
49
|
execute: () => {
|
|
61
|
-
this.libroService.active?.enterCommandMode(true);
|
|
50
|
+
return this.libroService.active?.enterCommandMode(true);
|
|
62
51
|
},
|
|
63
52
|
},
|
|
64
53
|
);
|
|
@@ -87,7 +76,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
87
76
|
}
|
|
88
77
|
libro.runCell(cell);
|
|
89
78
|
},
|
|
90
|
-
isEnabled: (
|
|
79
|
+
isEnabled: (cell, libro) => {
|
|
91
80
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
92
81
|
return false;
|
|
93
82
|
}
|
|
@@ -95,7 +84,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
95
84
|
},
|
|
96
85
|
});
|
|
97
86
|
this.libroCommand.registerLibroCommand(command, NotebookCommands['RunAllCells'], {
|
|
98
|
-
execute: async (
|
|
87
|
+
execute: async (cell, libro) => {
|
|
99
88
|
if (!libro || !(libro instanceof LibroView)) {
|
|
100
89
|
return;
|
|
101
90
|
}
|
|
@@ -143,7 +132,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
143
132
|
}
|
|
144
133
|
libro.runCellandSelectNext(cell);
|
|
145
134
|
},
|
|
146
|
-
isEnabled: (
|
|
135
|
+
isEnabled: (cell, libro) => {
|
|
147
136
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
148
137
|
return false;
|
|
149
138
|
}
|
|
@@ -166,7 +155,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
166
155
|
}
|
|
167
156
|
libro.runCellandInsertBelow(cell);
|
|
168
157
|
},
|
|
169
|
-
isEnabled: (
|
|
158
|
+
isEnabled: (cell, libro) => {
|
|
170
159
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
171
160
|
return false;
|
|
172
161
|
}
|
|
@@ -175,16 +164,15 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
175
164
|
},
|
|
176
165
|
);
|
|
177
166
|
this.libroCommand.registerLibroCommand(command, NotebookCommands['Interrupt'], {
|
|
178
|
-
execute: async (
|
|
167
|
+
execute: async (cell, libro) => {
|
|
179
168
|
if (!libro || !(libro instanceof LibroView)) {
|
|
180
169
|
return false;
|
|
181
170
|
}
|
|
182
171
|
if (libro.model.interrupt) {
|
|
183
|
-
libro.model.interrupt();
|
|
172
|
+
return libro.model.interrupt();
|
|
184
173
|
}
|
|
185
|
-
return;
|
|
186
174
|
},
|
|
187
|
-
isEnabled: (
|
|
175
|
+
isEnabled: (cell, libro) => {
|
|
188
176
|
if (!libro || !(libro instanceof LibroView)) {
|
|
189
177
|
return false;
|
|
190
178
|
}
|
|
@@ -196,7 +184,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
196
184
|
) >= 0
|
|
197
185
|
);
|
|
198
186
|
},
|
|
199
|
-
isVisible: (
|
|
187
|
+
isVisible: (cell, libro, path) => {
|
|
200
188
|
if (!libro || !(libro instanceof LibroView)) {
|
|
201
189
|
return false;
|
|
202
190
|
}
|
|
@@ -211,14 +199,13 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
211
199
|
command,
|
|
212
200
|
NotebookCommands['RestartClearOutput'],
|
|
213
201
|
{
|
|
214
|
-
execute: async (
|
|
202
|
+
execute: async (cell, libro) => {
|
|
215
203
|
if (!libro || !(libro instanceof LibroView)) {
|
|
216
204
|
return false;
|
|
217
205
|
}
|
|
218
|
-
this.modalService.openModal(RestartClearOutputModal, libro);
|
|
219
|
-
return;
|
|
206
|
+
return this.modalService.openModal(RestartClearOutputModal, libro);
|
|
220
207
|
},
|
|
221
|
-
isVisible: (
|
|
208
|
+
isVisible: (cell, libro, path) => {
|
|
222
209
|
if (!libro || !(libro instanceof LibroView)) {
|
|
223
210
|
return false;
|
|
224
211
|
}
|
|
@@ -234,12 +221,11 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
234
221
|
command,
|
|
235
222
|
NotebookCommands['CloseAndShutdown'],
|
|
236
223
|
{
|
|
237
|
-
execute: async (
|
|
224
|
+
execute: async (cell, libro) => {
|
|
238
225
|
if (!libro || !(libro instanceof LibroView)) {
|
|
239
226
|
return false;
|
|
240
227
|
}
|
|
241
|
-
this.modalService.openModal(ShutdownModal, libro);
|
|
242
|
-
return;
|
|
228
|
+
return this.modalService.openModal(ShutdownModal, libro);
|
|
243
229
|
},
|
|
244
230
|
isVisible: () => false,
|
|
245
231
|
// isVisible: (cell, libro, path) => {
|
|
@@ -274,13 +260,13 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
274
260
|
}
|
|
275
261
|
},
|
|
276
262
|
// isVisible: () => false,
|
|
277
|
-
isVisible: (
|
|
263
|
+
isVisible: (cell, libro, path) => {
|
|
278
264
|
if (!libro || !(libro instanceof LibroView)) {
|
|
279
265
|
return false;
|
|
280
266
|
}
|
|
281
267
|
return !libro?.model.readOnly && path === LibroToolbarArea.CellRight;
|
|
282
268
|
},
|
|
283
|
-
isEnabled: (
|
|
269
|
+
isEnabled: (cell, libro) => {
|
|
284
270
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
285
271
|
return false;
|
|
286
272
|
}
|
|
@@ -312,7 +298,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
312
298
|
);
|
|
313
299
|
}
|
|
314
300
|
},
|
|
315
|
-
isEnabled: (
|
|
301
|
+
isEnabled: (cell, libro) => {
|
|
316
302
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
317
303
|
return false;
|
|
318
304
|
}
|
|
@@ -385,7 +371,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
385
371
|
}
|
|
386
372
|
libro.mergeCellBelow(cell);
|
|
387
373
|
},
|
|
388
|
-
isEnabled: (
|
|
374
|
+
isEnabled: (cell, libro) => {
|
|
389
375
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
390
376
|
return false;
|
|
391
377
|
}
|
|
@@ -408,7 +394,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
408
394
|
}
|
|
409
395
|
libro.mergeCellAbove(cell);
|
|
410
396
|
},
|
|
411
|
-
isEnabled: (
|
|
397
|
+
isEnabled: (cell, libro) => {
|
|
412
398
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
413
399
|
return false;
|
|
414
400
|
}
|
|
@@ -428,7 +414,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
428
414
|
}
|
|
429
415
|
libro.mergeCells(cell);
|
|
430
416
|
},
|
|
431
|
-
isEnabled: (
|
|
417
|
+
isEnabled: (cell, libro) => {
|
|
432
418
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
433
419
|
return false;
|
|
434
420
|
}
|
|
@@ -447,13 +433,13 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
447
433
|
}
|
|
448
434
|
libro.deleteCell(cell);
|
|
449
435
|
},
|
|
450
|
-
isVisible: (
|
|
436
|
+
isVisible: (cell, libro, path) => {
|
|
451
437
|
if (!libro || !(libro instanceof LibroView)) {
|
|
452
438
|
return false;
|
|
453
439
|
}
|
|
454
440
|
return !libro?.model.readOnly && path === LibroToolbarArea.CellRight;
|
|
455
441
|
},
|
|
456
|
-
isEnabled: (
|
|
442
|
+
isEnabled: (cell, libro) => {
|
|
457
443
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
458
444
|
return false;
|
|
459
445
|
}
|
|
@@ -475,7 +461,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
475
461
|
}
|
|
476
462
|
libro.clearOutputs(cell);
|
|
477
463
|
},
|
|
478
|
-
isEnabled: (
|
|
464
|
+
isEnabled: (cell, libro) => {
|
|
479
465
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
480
466
|
return false;
|
|
481
467
|
}
|
|
@@ -498,13 +484,13 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
498
484
|
}
|
|
499
485
|
libro.clearAllOutputs();
|
|
500
486
|
},
|
|
501
|
-
isVisible: (
|
|
487
|
+
isVisible: (cell, libro, path) => {
|
|
502
488
|
if (!libro || !(libro instanceof LibroView)) {
|
|
503
489
|
return false;
|
|
504
490
|
}
|
|
505
491
|
return !libro?.model.readOnly && path === LibroToolbarArea.HeaderCenter;
|
|
506
492
|
},
|
|
507
|
-
isEnabled: (
|
|
493
|
+
isEnabled: (cell, libro) => {
|
|
508
494
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
509
495
|
return false;
|
|
510
496
|
}
|
|
@@ -524,7 +510,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
524
510
|
}
|
|
525
511
|
libro.moveUpCell(cell);
|
|
526
512
|
},
|
|
527
|
-
isVisible: (
|
|
513
|
+
isVisible: (cell, libro, path) => {
|
|
528
514
|
return path === LibroToolbarArea.CellRight;
|
|
529
515
|
},
|
|
530
516
|
isEnabled: (cell, libro) => {
|
|
@@ -570,7 +556,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
570
556
|
.findIndex((item) => equals(item, cell));
|
|
571
557
|
return cellIndex !== libro.model.getCells().length - 1;
|
|
572
558
|
},
|
|
573
|
-
isVisible: (
|
|
559
|
+
isVisible: (cell, libro, path) => {
|
|
574
560
|
return path === LibroToolbarArea.CellRight;
|
|
575
561
|
},
|
|
576
562
|
});
|
|
@@ -595,7 +581,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
595
581
|
// }
|
|
596
582
|
// return true;
|
|
597
583
|
// },
|
|
598
|
-
isEnabled: (
|
|
584
|
+
isEnabled: (cell, libro) => {
|
|
599
585
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
600
586
|
return false;
|
|
601
587
|
}
|
|
@@ -623,7 +609,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
623
609
|
// }
|
|
624
610
|
// return true;
|
|
625
611
|
// },
|
|
626
|
-
isEnabled: (
|
|
612
|
+
isEnabled: (cell, libro) => {
|
|
627
613
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
628
614
|
return false;
|
|
629
615
|
}
|
|
@@ -645,7 +631,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
645
631
|
}
|
|
646
632
|
libro.pasteCellAbove(cell);
|
|
647
633
|
},
|
|
648
|
-
isEnabled: (
|
|
634
|
+
isEnabled: (cell, libro) => {
|
|
649
635
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
650
636
|
return false;
|
|
651
637
|
}
|
|
@@ -677,11 +663,11 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
677
663
|
// }
|
|
678
664
|
// return true;
|
|
679
665
|
// },
|
|
680
|
-
isEnabled: (
|
|
666
|
+
isEnabled: (cell, libro) => {
|
|
681
667
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
682
668
|
return false;
|
|
683
669
|
}
|
|
684
|
-
return
|
|
670
|
+
return true;
|
|
685
671
|
},
|
|
686
672
|
},
|
|
687
673
|
);
|
|
@@ -697,7 +683,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
697
683
|
}
|
|
698
684
|
libro.hideCellCode(cell);
|
|
699
685
|
},
|
|
700
|
-
isVisible: (
|
|
686
|
+
isVisible: (cell, libro, path) => {
|
|
701
687
|
if (path === LibroToolbarArea.HeaderCenter) {
|
|
702
688
|
return true;
|
|
703
689
|
}
|
|
@@ -736,7 +722,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
736
722
|
}
|
|
737
723
|
libro.hideOutputs(cell);
|
|
738
724
|
},
|
|
739
|
-
isVisible: (cell,
|
|
725
|
+
isVisible: (cell, libro, path) => {
|
|
740
726
|
if (
|
|
741
727
|
cell &&
|
|
742
728
|
cell instanceof LibroCellView &&
|
|
@@ -804,13 +790,13 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
804
790
|
execute: () => {
|
|
805
791
|
//
|
|
806
792
|
},
|
|
807
|
-
isVisible: (
|
|
793
|
+
isVisible: (cell, libro, path) => {
|
|
808
794
|
if (!libro || !(libro instanceof LibroView)) {
|
|
809
795
|
return false;
|
|
810
796
|
}
|
|
811
797
|
return !libro?.model.readOnly && path === LibroToolbarArea.HeaderCenter;
|
|
812
798
|
},
|
|
813
|
-
isEnabled: (
|
|
799
|
+
isEnabled: (cell, libro) => {
|
|
814
800
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
815
801
|
return false;
|
|
816
802
|
}
|
|
@@ -950,12 +936,12 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
950
936
|
},
|
|
951
937
|
);
|
|
952
938
|
command.registerCommand(NotebookCommands['ChangeCellTo'], {
|
|
953
|
-
execute: async (cell, libro,
|
|
939
|
+
execute: async (cell, libro, path, targetType) => {
|
|
954
940
|
if (
|
|
955
941
|
!cell ||
|
|
956
942
|
!libro ||
|
|
957
|
-
!(
|
|
958
|
-
!(
|
|
943
|
+
!(libro instanceof LibroView) ||
|
|
944
|
+
!(cell instanceof LibroCellView)
|
|
959
945
|
) {
|
|
960
946
|
return;
|
|
961
947
|
}
|
|
@@ -964,13 +950,13 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
964
950
|
libro.invertCell(cell, targetType);
|
|
965
951
|
}
|
|
966
952
|
},
|
|
967
|
-
isVisible: (
|
|
953
|
+
isVisible: (cell, libro, path) => {
|
|
968
954
|
if (!libro || !(libro instanceof LibroView)) {
|
|
969
955
|
return false;
|
|
970
956
|
}
|
|
971
957
|
return !libro?.model.readOnly && path === LibroToolbarArea.HeaderCenter;
|
|
972
958
|
},
|
|
973
|
-
isEnabled: (
|
|
959
|
+
isEnabled: (cell, libro) => {
|
|
974
960
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
975
961
|
return false;
|
|
976
962
|
}
|
|
@@ -992,7 +978,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
992
978
|
}
|
|
993
979
|
libro.invertCell(cell, 'code');
|
|
994
980
|
},
|
|
995
|
-
isEnabled: (
|
|
981
|
+
isEnabled: (cell, libro) => {
|
|
996
982
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
997
983
|
return false;
|
|
998
984
|
}
|
|
@@ -1015,7 +1001,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1015
1001
|
}
|
|
1016
1002
|
libro.invertCell(cell, 'markdown');
|
|
1017
1003
|
},
|
|
1018
|
-
isEnabled: (
|
|
1004
|
+
isEnabled: (cell, libro) => {
|
|
1019
1005
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1020
1006
|
return false;
|
|
1021
1007
|
}
|
|
@@ -1057,52 +1043,82 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1057
1043
|
},
|
|
1058
1044
|
},
|
|
1059
1045
|
);
|
|
1046
|
+
this.libroCommand.registerLibroCommand(
|
|
1047
|
+
command,
|
|
1048
|
+
NotebookCommands['EnableOrDisableAllOutputScrolling'],
|
|
1049
|
+
{
|
|
1050
|
+
execute: (cell: CellView | undefined, libro: NotebookView | undefined) => {
|
|
1051
|
+
if (
|
|
1052
|
+
!cell ||
|
|
1053
|
+
!libro ||
|
|
1054
|
+
!(cell instanceof LibroCellView) ||
|
|
1055
|
+
!(libro instanceof LibroView)
|
|
1056
|
+
) {
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
if (libro.outputsScroll) {
|
|
1060
|
+
libro.disableAllOutputScrolling();
|
|
1061
|
+
} else {
|
|
1062
|
+
libro.enableAllOutputScrolling();
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1065
|
+
isVisible: (cell, libro, path) => {
|
|
1066
|
+
if (!libro || !(libro instanceof LibroView)) {
|
|
1067
|
+
return false;
|
|
1068
|
+
}
|
|
1069
|
+
return !libro?.model.readOnly && path === LibroToolbarArea.HeaderCenter;
|
|
1070
|
+
},
|
|
1071
|
+
},
|
|
1072
|
+
);
|
|
1060
1073
|
this.libroCommand.registerLibroCommand(command, DocumentCommands['Save'], {
|
|
1061
|
-
execute: async (
|
|
1074
|
+
execute: async (cell, libro) => {
|
|
1062
1075
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1063
1076
|
return;
|
|
1064
1077
|
}
|
|
1065
1078
|
libro.save();
|
|
1066
1079
|
},
|
|
1067
|
-
isVisible: (
|
|
1080
|
+
isVisible: (cell, libro, path) => {
|
|
1068
1081
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1069
1082
|
return false;
|
|
1070
1083
|
}
|
|
1071
1084
|
return !libro?.model.readOnly && path === LibroToolbarArea.HeaderCenter;
|
|
1072
1085
|
},
|
|
1073
|
-
isEnabled: (
|
|
1086
|
+
isEnabled: (cell, libro) => {
|
|
1074
1087
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1075
1088
|
return false;
|
|
1076
1089
|
}
|
|
1077
1090
|
return true;
|
|
1078
1091
|
},
|
|
1079
1092
|
});
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1093
|
+
this.libroCommand.registerLibroCommand(command, DocumentCommands['OpenSettings'], {
|
|
1094
|
+
execute: async () => {
|
|
1095
|
+
this.modalService.openModal(SettingsModal);
|
|
1096
|
+
},
|
|
1097
|
+
isVisible: (cell, libro, path) => {
|
|
1098
|
+
if (!libro || !(libro instanceof LibroView)) {
|
|
1099
|
+
return false;
|
|
1100
|
+
}
|
|
1101
|
+
return !libro?.model.readOnly && path === LibroToolbarArea.HeaderRight;
|
|
1102
|
+
},
|
|
1103
|
+
});
|
|
1088
1104
|
this.libroCommand.registerLibroCommand(
|
|
1089
1105
|
command,
|
|
1090
1106
|
NotebookCommands['UndoCellAction'],
|
|
1091
1107
|
{
|
|
1092
|
-
execute: async (
|
|
1108
|
+
execute: async (cell, libro) => {
|
|
1093
1109
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1094
1110
|
return;
|
|
1095
1111
|
}
|
|
1096
1112
|
|
|
1097
1113
|
libro.model.undo();
|
|
1098
1114
|
},
|
|
1099
|
-
isVisible: (
|
|
1115
|
+
isVisible: (cell, libro, path) => {
|
|
1100
1116
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1101
1117
|
return false;
|
|
1102
1118
|
}
|
|
1103
1119
|
return !libro?.model.readOnly && path === LibroToolbarArea.HeaderCenter;
|
|
1104
1120
|
},
|
|
1105
|
-
isEnabled: (
|
|
1121
|
+
isEnabled: (cell, libro) => {
|
|
1106
1122
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1107
1123
|
return false;
|
|
1108
1124
|
}
|
|
@@ -1115,19 +1131,19 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1115
1131
|
command,
|
|
1116
1132
|
NotebookCommands['RedoCellAction'],
|
|
1117
1133
|
{
|
|
1118
|
-
execute: async (
|
|
1134
|
+
execute: async (cell, libro) => {
|
|
1119
1135
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1120
1136
|
return;
|
|
1121
1137
|
}
|
|
1122
1138
|
libro.model.redo();
|
|
1123
1139
|
},
|
|
1124
|
-
isVisible: (
|
|
1140
|
+
isVisible: (cell, libro, path) => {
|
|
1125
1141
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1126
1142
|
return false;
|
|
1127
1143
|
}
|
|
1128
1144
|
return !libro?.model.readOnly && path === LibroToolbarArea.HeaderCenter;
|
|
1129
1145
|
},
|
|
1130
|
-
isEnabled: (
|
|
1146
|
+
isEnabled: (cell, libro) => {
|
|
1131
1147
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1132
1148
|
return false;
|
|
1133
1149
|
}
|
|
@@ -1150,7 +1166,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1150
1166
|
}
|
|
1151
1167
|
libro.splitCell(cell);
|
|
1152
1168
|
},
|
|
1153
|
-
isEnabled: (
|
|
1169
|
+
isEnabled: (cell, libro) => {
|
|
1154
1170
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1155
1171
|
return false;
|
|
1156
1172
|
}
|
|
@@ -1165,7 +1181,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1165
1181
|
}
|
|
1166
1182
|
(cell as LibroEditorCellView).redo();
|
|
1167
1183
|
},
|
|
1168
|
-
isEnabled: (
|
|
1184
|
+
isEnabled: (cell, libro) => {
|
|
1169
1185
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1170
1186
|
return false;
|
|
1171
1187
|
}
|
|
@@ -1179,7 +1195,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1179
1195
|
}
|
|
1180
1196
|
(cell as LibroEditorCellView).undo();
|
|
1181
1197
|
},
|
|
1182
|
-
isEnabled: (
|
|
1198
|
+
isEnabled: (cell, libro) => {
|
|
1183
1199
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1184
1200
|
return false;
|
|
1185
1201
|
}
|
|
@@ -1201,7 +1217,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1201
1217
|
}
|
|
1202
1218
|
libro.setMarkdownHeader(cell, 1);
|
|
1203
1219
|
},
|
|
1204
|
-
isEnabled: (
|
|
1220
|
+
isEnabled: (cell, libro) => {
|
|
1205
1221
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1206
1222
|
return false;
|
|
1207
1223
|
}
|
|
@@ -1224,7 +1240,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1224
1240
|
}
|
|
1225
1241
|
libro.setMarkdownHeader(cell, 2);
|
|
1226
1242
|
},
|
|
1227
|
-
isEnabled: (
|
|
1243
|
+
isEnabled: (cell, libro) => {
|
|
1228
1244
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1229
1245
|
return false;
|
|
1230
1246
|
}
|
|
@@ -1247,7 +1263,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1247
1263
|
}
|
|
1248
1264
|
libro.setMarkdownHeader(cell, 3);
|
|
1249
1265
|
},
|
|
1250
|
-
isEnabled: (
|
|
1266
|
+
isEnabled: (cell, libro) => {
|
|
1251
1267
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1252
1268
|
return false;
|
|
1253
1269
|
}
|
|
@@ -1270,7 +1286,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1270
1286
|
}
|
|
1271
1287
|
libro.setMarkdownHeader(cell, 4);
|
|
1272
1288
|
},
|
|
1273
|
-
isEnabled: (
|
|
1289
|
+
isEnabled: (cell, libro) => {
|
|
1274
1290
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1275
1291
|
return false;
|
|
1276
1292
|
}
|
|
@@ -1293,7 +1309,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1293
1309
|
}
|
|
1294
1310
|
libro.setMarkdownHeader(cell, 5);
|
|
1295
1311
|
},
|
|
1296
|
-
isEnabled: (
|
|
1312
|
+
isEnabled: (cell, libro) => {
|
|
1297
1313
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1298
1314
|
return false;
|
|
1299
1315
|
}
|
|
@@ -1316,7 +1332,7 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1316
1332
|
}
|
|
1317
1333
|
libro.setMarkdownHeader(cell, 6);
|
|
1318
1334
|
},
|
|
1319
|
-
isEnabled: (
|
|
1335
|
+
isEnabled: (cell, libro) => {
|
|
1320
1336
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
1321
1337
|
return false;
|
|
1322
1338
|
}
|
|
@@ -1326,12 +1342,12 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
1326
1342
|
);
|
|
1327
1343
|
|
|
1328
1344
|
this.libroCommand.registerLibroCommand(command, NotebookCommands['More'], {
|
|
1329
|
-
execute: async (
|
|
1345
|
+
execute: async (cell, libro) => {
|
|
1330
1346
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1331
1347
|
return;
|
|
1332
1348
|
}
|
|
1333
1349
|
},
|
|
1334
|
-
isVisible: (
|
|
1350
|
+
isVisible: (cell, libro, path) => {
|
|
1335
1351
|
return path === LibroToolbarArea.CellRight;
|
|
1336
1352
|
},
|
|
1337
1353
|
});
|
|
@@ -40,10 +40,7 @@ export interface GeneralLibroCommandHandler extends CommandHandler {
|
|
|
40
40
|
|
|
41
41
|
@singleton()
|
|
42
42
|
export class LibroCommandRegister {
|
|
43
|
-
protected readonly libroService: LibroService;
|
|
44
|
-
constructor(@inject(LibroService) libroService: LibroService) {
|
|
45
|
-
this.libroService = libroService;
|
|
46
|
-
}
|
|
43
|
+
@inject(LibroService) protected readonly libroService: LibroService;
|
|
47
44
|
registerKeybinds(
|
|
48
45
|
keybindings: KeybindingRegistry,
|
|
49
46
|
commands: Record<
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
CopyOutlined,
|
|
5
5
|
ScissorOutlined,
|
|
6
6
|
SnippetsOutlined,
|
|
7
|
-
PauseCircleOutlined,
|
|
8
7
|
EyeOutlined,
|
|
9
8
|
EyeInvisibleOutlined,
|
|
10
9
|
// ReloadOutlined,
|
|
@@ -22,6 +21,7 @@ import {
|
|
|
22
21
|
MoveDownOutlined,
|
|
23
22
|
DeleteOutlined,
|
|
24
23
|
MoreOutlined,
|
|
24
|
+
PauseCircleOutlined,
|
|
25
25
|
} from '../material-from-designer.js';
|
|
26
26
|
|
|
27
27
|
export const NotebookCommands: Record<
|
|
@@ -107,7 +107,7 @@ export const NotebookCommands: Record<
|
|
|
107
107
|
},
|
|
108
108
|
CloseAndShutdown: {
|
|
109
109
|
id: 'notebook:close-and-shutdown',
|
|
110
|
-
label: `Close
|
|
110
|
+
label: `Close Editor and Shut Down Kernel`,
|
|
111
111
|
icon: PoweroffOutlined,
|
|
112
112
|
},
|
|
113
113
|
// TODO: 确定命令含义
|
|
@@ -123,6 +123,16 @@ export const NotebookCommands: Record<
|
|
|
123
123
|
icon: CopyOutlined,
|
|
124
124
|
when: 'commandMode',
|
|
125
125
|
},
|
|
126
|
+
// TODO: 确定命令含义
|
|
127
|
+
CopyToClipboard: {
|
|
128
|
+
id: 'notebook:copy-to-clipboard',
|
|
129
|
+
label: `Copy Output to Clipboard`,
|
|
130
|
+
},
|
|
131
|
+
// TODO: 确定命令含义
|
|
132
|
+
CreateOutputView: {
|
|
133
|
+
id: 'notebook:create-output-view',
|
|
134
|
+
label: `Create New View for Cell Output`,
|
|
135
|
+
},
|
|
126
136
|
CutCell: {
|
|
127
137
|
id: 'notebook:cut-cell',
|
|
128
138
|
label: `Cut Cells`,
|
|
@@ -153,6 +163,10 @@ export const NotebookCommands: Record<
|
|
|
153
163
|
id: 'notebook:enable-output-scrolling',
|
|
154
164
|
label: `Enable Scrolling for Outputs`,
|
|
155
165
|
},
|
|
166
|
+
EnableOrDisableAllOutputScrolling: {
|
|
167
|
+
id: 'notebook:enable-or-disable-all-output-scrolling',
|
|
168
|
+
label: `Enable Or Disable Scrolling for all Outputs`,
|
|
169
|
+
},
|
|
156
170
|
EnterCommandMode: {
|
|
157
171
|
id: 'notebook:enter-command-mode',
|
|
158
172
|
label: `Enter Command Mode`,
|
|
@@ -330,7 +344,6 @@ export const NotebookCommands: Record<
|
|
|
330
344
|
icon: SnippetsOutlined,
|
|
331
345
|
when: 'commandMode',
|
|
332
346
|
},
|
|
333
|
-
// TODO: register keybind
|
|
334
347
|
Redo: {
|
|
335
348
|
id: 'notebook:redo',
|
|
336
349
|
label: `Redo`,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { CellOptions, CellView } from '../libro-protocol.js';
|
|
4
4
|
|
|
5
|
-
export type CellExecutionTimeProvider =
|
|
5
|
+
export type CellExecutionTimeProvider = FC<{ cell: CellView }>;
|
|
6
6
|
|
|
7
7
|
export const CellExecutionTimeProvider = Symbol('CellExecutionTimeProvider');
|
|
8
8
|
|
|
9
|
-
export type CellInputBottonBlankProvider =
|
|
9
|
+
export type CellInputBottonBlankProvider = FC<{ cell: CellView }>;
|
|
10
10
|
|
|
11
11
|
export const CellInputBottonBlankProvider = Symbol('CellInputBottonBlankProvider');
|
|
12
12
|
|
|
13
|
-
export type CellOutputVisulizationProvider =
|
|
13
|
+
export type CellOutputVisulizationProvider = FC<{ cell: CellView }>;
|
|
14
14
|
|
|
15
15
|
export const CellOutputVisulizationProvider = Symbol('CellOutputVisulizationProvider');
|
|
16
16
|
|
|
17
|
-
export type BetweenCellProvider =
|
|
17
|
+
export type BetweenCellProvider = FC<{
|
|
18
18
|
index: number;
|
|
19
19
|
addCell: (option: CellOptions, position?: number | undefined) => Promise<void>;
|
|
20
20
|
}>;
|