@difizen/libro-core 0.0.2-alpha.0
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/LICENSE +21 -0
- package/README.md +3 -0
- package/es/add-cell/index.d.ts +4 -0
- package/es/add-cell/index.d.ts.map +1 -0
- package/es/add-cell/index.js +3 -0
- package/es/add-cell/index.less +38 -0
- package/es/add-cell/libro-add-cell-module.d.ts +3 -0
- package/es/add-cell/libro-add-cell-module.d.ts.map +1 -0
- package/es/add-cell/libro-add-cell-module.js +4 -0
- package/es/add-cell/libro-add-cell-slot-contribution.d.ts +12 -0
- package/es/add-cell/libro-add-cell-slot-contribution.d.ts.map +1 -0
- package/es/add-cell/libro-add-cell-slot-contribution.js +53 -0
- package/es/add-cell/libro-add-cell-view.d.ts +21 -0
- package/es/add-cell/libro-add-cell-view.d.ts.map +1 -0
- package/es/add-cell/libro-add-cell-view.js +129 -0
- package/es/cell/index.d.ts +10 -0
- package/es/cell/index.d.ts.map +1 -0
- package/es/cell/index.js +9 -0
- package/es/cell/libro-cell-contribution.d.ts +13 -0
- package/es/cell/libro-cell-contribution.d.ts.map +1 -0
- package/es/cell/libro-cell-contribution.js +41 -0
- package/es/cell/libro-cell-model.d.ts +19 -0
- package/es/cell/libro-cell-model.d.ts.map +1 -0
- package/es/cell/libro-cell-model.js +103 -0
- package/es/cell/libro-cell-module.d.ts +10 -0
- package/es/cell/libro-cell-module.d.ts.map +1 -0
- package/es/cell/libro-cell-module.js +30 -0
- package/es/cell/libro-cell-protocol.d.ts +42 -0
- package/es/cell/libro-cell-protocol.d.ts.map +1 -0
- package/es/cell/libro-cell-protocol.js +11 -0
- package/es/cell/libro-cell-service.d.ts +28 -0
- package/es/cell/libro-cell-service.d.ts.map +1 -0
- package/es/cell/libro-cell-service.js +242 -0
- package/es/cell/libro-cell-view.d.ts +65 -0
- package/es/cell/libro-cell-view.d.ts.map +1 -0
- package/es/cell/libro-cell-view.js +191 -0
- package/es/cell/libro-edit-cell-view.d.ts +32 -0
- package/es/cell/libro-edit-cell-view.d.ts.map +1 -0
- package/es/cell/libro-edit-cell-view.js +72 -0
- package/es/cell/libro-executable-cell-model.d.ts +14 -0
- package/es/cell/libro-executable-cell-model.d.ts.map +1 -0
- package/es/cell/libro-executable-cell-model.js +7 -0
- package/es/cell/libro-executable-cell-view.d.ts +27 -0
- package/es/cell/libro-executable-cell-view.d.ts.map +1 -0
- package/es/cell/libro-executable-cell-view.js +66 -0
- package/es/cell/libro-markdown-cell-model.d.ts +9 -0
- package/es/cell/libro-markdown-cell-model.d.ts.map +1 -0
- package/es/cell/libro-markdown-cell-model.js +7 -0
- package/es/collapse-service.d.ts +36 -0
- package/es/collapse-service.d.ts.map +1 -0
- package/es/collapse-service.js +55 -0
- package/es/command/document-commands.d.ts +6 -0
- package/es/command/document-commands.d.ts.map +1 -0
- package/es/command/document-commands.js +13 -0
- package/es/command/index.d.ts +7 -0
- package/es/command/index.d.ts.map +1 -0
- package/es/command/index.js +6 -0
- package/es/command/kernel-command.d.ts +5 -0
- package/es/command/kernel-command.d.ts.map +1 -0
- package/es/command/kernel-command.js +39 -0
- package/es/command/libro-command-contribution.d.ts +14 -0
- package/es/command/libro-command-contribution.d.ts.map +1 -0
- package/es/command/libro-command-contribution.js +1751 -0
- package/es/command/libro-command-register.d.ts +22 -0
- package/es/command/libro-command-register.d.ts.map +1 -0
- package/es/command/libro-command-register.js +105 -0
- package/es/command/module.d.ts +3 -0
- package/es/command/module.d.ts.map +1 -0
- package/es/command/module.js +4 -0
- package/es/command/notebook-commands.d.ts +6 -0
- package/es/command/notebook-commands.d.ts.map +1 -0
- package/es/command/notebook-commands.js +468 -0
- package/es/components/cell-protocol.d.ts +20 -0
- package/es/components/cell-protocol.d.ts.map +1 -0
- package/es/components/cell-protocol.js +4 -0
- package/es/components/dnd-cell-item-render.d.ts +12 -0
- package/es/components/dnd-cell-item-render.d.ts.map +1 -0
- package/es/components/dnd-cell-item-render.js +253 -0
- package/es/components/dnd-component/custom-drag-layer.d.ts +9 -0
- package/es/components/dnd-component/custom-drag-layer.d.ts.map +1 -0
- package/es/components/dnd-component/custom-drag-layer.js +141 -0
- package/es/components/dnd-component/default-dnd-content.d.ts +10 -0
- package/es/components/dnd-component/default-dnd-content.d.ts.map +1 -0
- package/es/components/dnd-component/default-dnd-content.js +257 -0
- package/es/components/dnd-component/dnd-context.d.ts +3 -0
- package/es/components/dnd-component/dnd-context.d.ts.map +1 -0
- package/es/components/dnd-component/dnd-context.js +20 -0
- package/es/components/dnd-component/dnd-list.d.ts +10 -0
- package/es/components/dnd-component/dnd-list.d.ts.map +1 -0
- package/es/components/dnd-component/dnd-list.js +115 -0
- package/es/components/dnd-component/index.d.ts +5 -0
- package/es/components/dnd-component/index.d.ts.map +1 -0
- package/es/components/dnd-component/index.js +4 -0
- package/es/components/index.d.ts +6 -0
- package/es/components/index.d.ts.map +1 -0
- package/es/components/index.js +5 -0
- package/es/components/libro-component.d.ts +5 -0
- package/es/components/libro-component.d.ts.map +1 -0
- package/es/components/libro-component.js +35 -0
- package/es/components/libro-side-toolbar-menu.d.ts +21 -0
- package/es/components/libro-side-toolbar-menu.d.ts.map +1 -0
- package/es/components/libro-side-toolbar-menu.js +58 -0
- package/es/components/libro-view-header.d.ts +3 -0
- package/es/components/libro-view-header.d.ts.map +1 -0
- package/es/components/libro-view-header.js +37 -0
- package/es/configuration/libro-configuration-contribution.d.ts +5 -0
- package/es/configuration/libro-configuration-contribution.d.ts.map +1 -0
- package/es/configuration/libro-configuration-contribution.js +24 -0
- package/es/configuration/libro-configuration.d.ts +10 -0
- package/es/configuration/libro-configuration.d.ts.map +1 -0
- package/es/configuration/libro-configuration.js +81 -0
- package/es/content/index.d.ts +5 -0
- package/es/content/index.d.ts.map +1 -0
- package/es/content/index.js +4 -0
- package/es/content/libro-content-contribution.d.ts +11 -0
- package/es/content/libro-content-contribution.d.ts.map +1 -0
- package/es/content/libro-content-contribution.js +32 -0
- package/es/content/libro-content-module.d.ts +3 -0
- package/es/content/libro-content-module.d.ts.map +1 -0
- package/es/content/libro-content-module.js +5 -0
- package/es/content/libro-content-protocol.d.ts +8 -0
- package/es/content/libro-content-protocol.d.ts.map +1 -0
- package/es/content/libro-content-protocol.js +2 -0
- package/es/content/libro-content-service.d.ts +9 -0
- package/es/content/libro-content-service.d.ts.map +1 -0
- package/es/content/libro-content-service.js +35 -0
- package/es/index.d.ts +20 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +19 -0
- package/es/index.less +682 -0
- package/es/libro-context-key.d.ts +22 -0
- package/es/libro-context-key.d.ts.map +1 -0
- package/es/libro-context-key.js +80 -0
- package/es/libro-keybind-registry.d.ts +5 -0
- package/es/libro-keybind-registry.d.ts.map +1 -0
- package/es/libro-keybind-registry.js +68 -0
- package/es/libro-model.d.ts +129 -0
- package/es/libro-model.d.ts.map +1 -0
- package/es/libro-model.js +803 -0
- package/es/libro-protocol.d.ts +241 -0
- package/es/libro-protocol.d.ts.map +1 -0
- package/es/libro-protocol.js +34 -0
- package/es/libro-service.d.ts +34 -0
- package/es/libro-service.d.ts.map +1 -0
- package/es/libro-service.js +180 -0
- package/es/libro-view-tracker.d.ts +6 -0
- package/es/libro-view-tracker.d.ts.map +1 -0
- package/es/libro-view-tracker.js +13 -0
- package/es/libro-view.d.ts +151 -0
- package/es/libro-view.d.ts.map +1 -0
- package/es/libro-view.js +1963 -0
- package/es/material-from-designer.d.ts +27 -0
- package/es/material-from-designer.d.ts.map +1 -0
- package/es/material-from-designer.js +550 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +55 -0
- package/es/output/index.d.ts +6 -0
- package/es/output/index.d.ts.map +1 -0
- package/es/output/index.js +5 -0
- package/es/output/output-area.d.ts +51 -0
- package/es/output/output-area.d.ts.map +1 -0
- package/es/output/output-area.js +346 -0
- package/es/output/output-contribution.d.ts +11 -0
- package/es/output/output-contribution.d.ts.map +1 -0
- package/es/output/output-contribution.js +31 -0
- package/es/output/output-model.d.ts +27 -0
- package/es/output/output-model.d.ts.map +1 -0
- package/es/output/output-model.js +95 -0
- package/es/output/output-module.d.ts +3 -0
- package/es/output/output-module.d.ts.map +1 -0
- package/es/output/output-module.js +6 -0
- package/es/output/output-protocol.d.ts +130 -0
- package/es/output/output-protocol.d.ts.map +1 -0
- package/es/output/output-protocol.js +18 -0
- package/es/slot/index.d.ts +5 -0
- package/es/slot/index.d.ts.map +1 -0
- package/es/slot/index.js +4 -0
- package/es/slot/libro-slot-manager.d.ts +13 -0
- package/es/slot/libro-slot-manager.d.ts.map +1 -0
- package/es/slot/libro-slot-manager.js +57 -0
- package/es/slot/libro-slot-protocol.d.ts +19 -0
- package/es/slot/libro-slot-protocol.d.ts.map +1 -0
- package/es/slot/libro-slot-protocol.js +5 -0
- package/es/slot/libro-slot-view.d.ts +9 -0
- package/es/slot/libro-slot-view.d.ts.map +1 -0
- package/es/slot/libro-slot-view.js +81 -0
- package/es/slot/module.d.ts +3 -0
- package/es/slot/module.d.ts.map +1 -0
- package/es/slot/module.js +5 -0
- package/es/theme/libro-color-registry.d.ts +6 -0
- package/es/theme/libro-color-registry.d.ts.map +1 -0
- package/es/theme/libro-color-registry.js +494 -0
- package/es/toolbar/change-cell-to-selector.d.ts +5 -0
- package/es/toolbar/change-cell-to-selector.d.ts.map +1 -0
- package/es/toolbar/change-cell-to-selector.js +48 -0
- package/es/toolbar/hide-all-selector.d.ts +5 -0
- package/es/toolbar/hide-all-selector.d.ts.map +1 -0
- package/es/toolbar/hide-all-selector.js +99 -0
- package/es/toolbar/index.d.ts +4 -0
- package/es/toolbar/index.d.ts.map +1 -0
- package/es/toolbar/index.js +3 -0
- package/es/toolbar/index.less +59 -0
- package/es/toolbar/libro-toolbar-protocol.d.ts +4 -0
- package/es/toolbar/libro-toolbar-protocol.d.ts.map +1 -0
- package/es/toolbar/libro-toolbar-protocol.js +1 -0
- package/es/toolbar/libro-toolbar.d.ts +8 -0
- package/es/toolbar/libro-toolbar.d.ts.map +1 -0
- package/es/toolbar/libro-toolbar.js +223 -0
- package/es/toolbar/module.d.ts +3 -0
- package/es/toolbar/module.d.ts.map +1 -0
- package/es/toolbar/module.js +5 -0
- package/es/toolbar/restart-clear-outputs-contribution.d.ts +5 -0
- package/es/toolbar/restart-clear-outputs-contribution.d.ts.map +1 -0
- package/es/toolbar/restart-clear-outputs-contribution.js +23 -0
- package/es/toolbar/restart-clear-outputs-modal.d.ts +6 -0
- package/es/toolbar/restart-clear-outputs-modal.d.ts.map +1 -0
- package/es/toolbar/restart-clear-outputs-modal.js +30 -0
- package/es/toolbar/save-icon.d.ts +3 -0
- package/es/toolbar/save-icon.d.ts.map +1 -0
- package/es/toolbar/save-icon.js +54 -0
- package/es/toolbar/shutdown-contribution.d.ts +5 -0
- package/es/toolbar/shutdown-contribution.d.ts.map +1 -0
- package/es/toolbar/shutdown-contribution.js +23 -0
- package/es/toolbar/shutdown-modal.d.ts +6 -0
- package/es/toolbar/shutdown-modal.d.ts.map +1 -0
- package/es/toolbar/shutdown-modal.js +30 -0
- package/es/toolbar/side-toolar-more-select.d.ts +4 -0
- package/es/toolbar/side-toolar-more-select.d.ts.map +1 -0
- package/es/toolbar/side-toolar-more-select.js +161 -0
- package/es/typings/index.d.ts +1 -0
- package/package.json +70 -0
- package/src/add-cell/index.less +38 -0
- package/src/add-cell/index.ts +3 -0
- package/src/add-cell/libro-add-cell-module.ts +9 -0
- package/src/add-cell/libro-add-cell-slot-contribution.ts +31 -0
- package/src/add-cell/libro-add-cell-view.tsx +101 -0
- package/src/cell/README.md +14 -0
- package/src/cell/index.ts +9 -0
- package/src/cell/libro-cell-contribution.ts +38 -0
- package/src/cell/libro-cell-model.ts +61 -0
- package/src/cell/libro-cell-module.ts +40 -0
- package/src/cell/libro-cell-protocol.ts +53 -0
- package/src/cell/libro-cell-service.ts +157 -0
- package/src/cell/libro-cell-view.tsx +128 -0
- package/src/cell/libro-edit-cell-view.tsx +60 -0
- package/src/cell/libro-executable-cell-model.ts +32 -0
- package/src/cell/libro-executable-cell-view.ts +74 -0
- package/src/cell/libro-markdown-cell-model.ts +20 -0
- package/src/collapse-service.ts +69 -0
- package/src/command/document-commands.ts +18 -0
- package/src/command/index.ts +6 -0
- package/src/command/kernel-command.ts +41 -0
- package/src/command/libro-command-contribution.ts +1339 -0
- package/src/command/libro-command-register.ts +171 -0
- package/src/command/module.ts +9 -0
- package/src/command/notebook-commands.ts +498 -0
- package/src/components/cell-protocol.ts +22 -0
- package/src/components/dnd-cell-item-render.tsx +308 -0
- package/src/components/dnd-component/custom-drag-layer.tsx +145 -0
- package/src/components/dnd-component/default-dnd-content.tsx +275 -0
- package/src/components/dnd-component/dnd-context.tsx +28 -0
- package/src/components/dnd-component/dnd-list.tsx +116 -0
- package/src/components/dnd-component/index.tsx +4 -0
- package/src/components/index.ts +5 -0
- package/src/components/libro-component.tsx +30 -0
- package/src/components/libro-side-toolbar-menu.tsx +82 -0
- package/src/components/libro-view-header.tsx +33 -0
- package/src/configuration/libro-configuration-contribution.ts +29 -0
- package/src/configuration/libro-configuration.ts +88 -0
- package/src/content/index.ts +4 -0
- package/src/content/libro-content-contribution.ts +17 -0
- package/src/content/libro-content-module.ts +9 -0
- package/src/content/libro-content-protocol.ts +8 -0
- package/src/content/libro-content-service.ts +30 -0
- package/src/index.less +682 -0
- package/src/index.tsx +19 -0
- package/src/libro-context-key.ts +80 -0
- package/src/libro-keybind-registry.ts +43 -0
- package/src/libro-model.ts +614 -0
- package/src/libro-protocol.ts +322 -0
- package/src/libro-service.ts +121 -0
- package/src/libro-view-tracker.ts +9 -0
- package/src/libro-view.tsx +1399 -0
- package/src/material-from-designer.tsx +457 -0
- package/src/module.ts +90 -0
- package/src/output/index.ts +5 -0
- package/src/output/output-area.tsx +255 -0
- package/src/output/output-contribution.ts +18 -0
- package/src/output/output-model.tsx +66 -0
- package/src/output/output-module.ts +10 -0
- package/src/output/output-protocol.ts +164 -0
- package/src/slot/index.ts +4 -0
- package/src/slot/libro-slot-manager.ts +37 -0
- package/src/slot/libro-slot-protocol.ts +28 -0
- package/src/slot/libro-slot-view.tsx +51 -0
- package/src/slot/module.ts +9 -0
- package/src/theme/libro-color-registry.ts +371 -0
- package/src/toolbar/change-cell-to-selector.tsx +58 -0
- package/src/toolbar/hide-all-selector.tsx +126 -0
- package/src/toolbar/index.less +59 -0
- package/src/toolbar/index.ts +3 -0
- package/src/toolbar/libro-toolbar-protocol.ts +4 -0
- package/src/toolbar/libro-toolbar.tsx +192 -0
- package/src/toolbar/module.ts +11 -0
- package/src/toolbar/restart-clear-outputs-contribution.tsx +10 -0
- package/src/toolbar/restart-clear-outputs-modal.tsx +37 -0
- package/src/toolbar/save-icon.tsx +47 -0
- package/src/toolbar/shutdown-contribution.tsx +10 -0
- package/src/toolbar/shutdown-modal.tsx +37 -0
- package/src/toolbar/side-toolar-more-select.tsx +172 -0
- package/src/typings/index.d.ts +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Command, CommandHandler, CommandRegistry, KeybindingRegistry } from '@difizen/mana-app';
|
|
2
|
+
import type { CellView, NotebookView } from '../libro-protocol.js';
|
|
3
|
+
import { LibroService } from '../libro-service.js';
|
|
4
|
+
export interface GeneralLibroCommandHandler extends CommandHandler {
|
|
5
|
+
execute: (cell?: CellView, libro?: NotebookView, position?: string, options?: any) => void;
|
|
6
|
+
isVisible?: (cell?: CellView, libro?: NotebookView, position?: string, options?: any) => boolean;
|
|
7
|
+
isEnabled?: (cell?: CellView, libro?: NotebookView, position?: string, options?: any) => boolean;
|
|
8
|
+
isActive?: (cell?: CellView, libro?: NotebookView, position?: string, options?: any) => boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class LibroCommandRegister {
|
|
11
|
+
protected readonly libroService: LibroService;
|
|
12
|
+
constructor(libroService: LibroService);
|
|
13
|
+
registerKeybinds(keybindings: KeybindingRegistry, commands: Record<string, Command & {
|
|
14
|
+
keybind?: string | string[];
|
|
15
|
+
when?: string;
|
|
16
|
+
preventDefault?: boolean;
|
|
17
|
+
stopPropagation?: boolean;
|
|
18
|
+
}>, needActive?: boolean, needFocus?: boolean): void;
|
|
19
|
+
toGeneralCommandArgs: (ctx: LibroCommandRegister, cell?: CellView, libro?: NotebookView, position?: string, options?: any) => [CellView | undefined, NotebookView | undefined, string | undefined, any];
|
|
20
|
+
registerLibroCommand(registry: CommandRegistry, command: Command, handler: GeneralLibroCommandHandler): void;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=libro-command-register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-command-register.d.ts","sourceRoot":"","sources":["../../src/command/libro-command-register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EAEd,eAAe,EACf,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,0BAA2B,SAAQ,cAAc;IAChE,OAAO,EAAE,CACP,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,CACV,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,OAAO,CAAC;IACb,SAAS,CAAC,EAAE,CACV,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,CACT,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,OAAO,CAAC;CACd;AAED,qBACa,oBAAoB;IAC/B,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;gBACZ,YAAY,EAAE,YAAY;IAG5D,gBAAgB,CACd,WAAW,EAAE,kBAAkB,EAC/B,QAAQ,EAAE,MAAM,CACd,MAAM,EACN,OAAO,GAAG;QACR,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CACF,EACD,UAAU,UAAO,EACjB,SAAS,UAAO;IAiClB,oBAAoB,QACb,oBAAoB,SAClB,QAAQ,UACP,YAAY,aACT,MAAM,YACP,GAAG,KACZ,CAAC,QAAQ,GAAG,SAAS,EAAE,YAAY,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,CAAC,CAI1E;IACF,oBAAoB,CAClB,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,0BAA0B;CAiEtC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _dec, _class;
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
7
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
+
import { inject, singleton } from '@difizen/mana-app';
|
|
15
|
+
import { LibroContextKeys } from "../libro-protocol.js";
|
|
16
|
+
import { LibroService } from "../libro-service.js";
|
|
17
|
+
export var LibroCommandRegister = (_dec = singleton(), _dec(_class = /*#__PURE__*/function () {
|
|
18
|
+
function LibroCommandRegister(libroService) {
|
|
19
|
+
_classCallCheck(this, LibroCommandRegister);
|
|
20
|
+
this.libroService = void 0;
|
|
21
|
+
this.toGeneralCommandArgs = function (ctx, cell, libro, position, options) {
|
|
22
|
+
var _libroView$model;
|
|
23
|
+
var libroView = libro || ctx.libroService.active;
|
|
24
|
+
var cellView = cell || (libroView === null || libroView === void 0 ? void 0 : (_libroView$model = libroView.model) === null || _libroView$model === void 0 ? void 0 : _libroView$model.active);
|
|
25
|
+
return [cellView, libroView, position, options];
|
|
26
|
+
};
|
|
27
|
+
this.libroService = libroService;
|
|
28
|
+
}
|
|
29
|
+
LibroCommandRegister = inject(LibroService)(LibroCommandRegister, undefined, 0) || LibroCommandRegister;
|
|
30
|
+
_createClass(LibroCommandRegister, [{
|
|
31
|
+
key: "registerKeybinds",
|
|
32
|
+
value: function registerKeybinds(keybindings, commands) {
|
|
33
|
+
var needActive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
34
|
+
var needFocus = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
35
|
+
var keys = Object.keys(commands);
|
|
36
|
+
var _loop = function _loop() {
|
|
37
|
+
var key = _keys[_i];
|
|
38
|
+
var command = commands[key];
|
|
39
|
+
if (command.keybind) {
|
|
40
|
+
var needFocusStr = needFocus ? LibroContextKeys.focus : '';
|
|
41
|
+
var needActiveStr = needActive ? LibroContextKeys.active : '';
|
|
42
|
+
var when = [needFocusStr, needActiveStr, command.when].filter(Boolean).join(' && ');
|
|
43
|
+
if (command.keybind instanceof Array) {
|
|
44
|
+
command.keybind.forEach(function (keybind) {
|
|
45
|
+
keybindings.registerKeybinding({
|
|
46
|
+
command: command.id,
|
|
47
|
+
keybinding: keybind,
|
|
48
|
+
when: when,
|
|
49
|
+
preventDefault: command.preventDefault,
|
|
50
|
+
stopPropagation: command.stopPropagation
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
keybindings.registerKeybinding({
|
|
55
|
+
command: command.id,
|
|
56
|
+
keybinding: command.keybind,
|
|
57
|
+
when: when,
|
|
58
|
+
preventDefault: command.preventDefault,
|
|
59
|
+
stopPropagation: command.stopPropagation
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
for (var _i = 0, _keys = keys; _i < _keys.length; _i++) {
|
|
65
|
+
_loop();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "registerLibroCommand",
|
|
70
|
+
value: function registerLibroCommand(registry, command, handler) {
|
|
71
|
+
var _this = this;
|
|
72
|
+
var commandHandler = {
|
|
73
|
+
execute: function execute(ctx, cell, libro, position, options) {
|
|
74
|
+
return handler.execute.apply(handler, _toConsumableArray(_this.toGeneralCommandArgs(ctx, cell, libro, position, options)));
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
if (handler.isEnabled) {
|
|
78
|
+
commandHandler.isEnabled = function (ctx, cell, libro, position, options) {
|
|
79
|
+
if (!handler.isEnabled) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
return handler.isEnabled.apply(handler, _toConsumableArray(_this.toGeneralCommandArgs(ctx, cell, libro, position, options)));
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (handler.isVisible) {
|
|
86
|
+
commandHandler.isVisible = function (ctx, cell, libro, position, options) {
|
|
87
|
+
if (!handler.isVisible) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
return handler.isVisible.apply(handler, _toConsumableArray(_this.toGeneralCommandArgs(ctx, cell, libro, position, options)));
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (handler.isActive) {
|
|
94
|
+
commandHandler.isActive = function (ctx, cell, libro, position, options) {
|
|
95
|
+
if (!handler.isActive) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
return handler.isActive.apply(handler, _toConsumableArray(_this.toGeneralCommandArgs(ctx, cell, libro, position, options)));
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
registry.registerCommandWithContext(command, this, commandHandler);
|
|
102
|
+
}
|
|
103
|
+
}]);
|
|
104
|
+
return LibroCommandRegister;
|
|
105
|
+
}()) || _class);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/command/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,eAAO,MAAM,kBAAkB,YAG9B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ManaModule } from '@difizen/mana-app';
|
|
2
|
+
import { LibroCommandContribution } from "./libro-command-contribution.js";
|
|
3
|
+
import { LibroCommandRegister } from "./libro-command-register.js";
|
|
4
|
+
export var LibroCommandModule = ManaModule.create().register(LibroCommandContribution, LibroCommandRegister);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-commands.d.ts","sourceRoot":"","sources":["../../src/command/notebook-commands.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAcjD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,MAAM,EACN,OAAO,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAqdjF,CAAC"}
|
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import { PlusOutlined, PlayCircleOutlined, CopyOutlined, ScissorOutlined, SnippetsOutlined, PauseCircleOutlined, EyeOutlined, EyeInvisibleOutlined,
|
|
2
|
+
// ReloadOutlined,
|
|
3
|
+
PoweroffOutlined } from '@ant-design/icons';
|
|
4
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
5
|
+
import { Undo, Redo, Reload, ClearOutlined, MoveUpOutlined, MoveDownOutlined, DeleteOutlined, MoreOutlined } from "../material-from-designer.js";
|
|
6
|
+
export var NotebookCommands = {
|
|
7
|
+
//#region libro command
|
|
8
|
+
ChangeCellTo: {
|
|
9
|
+
id: 'notebook:change-cell-to'
|
|
10
|
+
},
|
|
11
|
+
Interrupt: {
|
|
12
|
+
id: 'notebook:interrupt',
|
|
13
|
+
label: "Interrupt",
|
|
14
|
+
icon: PauseCircleOutlined
|
|
15
|
+
},
|
|
16
|
+
//#endregion
|
|
17
|
+
|
|
18
|
+
//#region jupyterlab command
|
|
19
|
+
ChangeCellToCode: {
|
|
20
|
+
id: 'notebook:change-cell-to-code',
|
|
21
|
+
label: "Change to Code Cell Type",
|
|
22
|
+
keybind: 'Y',
|
|
23
|
+
when: 'commandMode'
|
|
24
|
+
},
|
|
25
|
+
ChangeCellToHeading1: {
|
|
26
|
+
id: 'notebook:change-cell-to-heading-1',
|
|
27
|
+
label: "Change to Heading 1",
|
|
28
|
+
keybind: '1',
|
|
29
|
+
when: 'commandMode'
|
|
30
|
+
},
|
|
31
|
+
ChangeCellToHeading2: {
|
|
32
|
+
id: 'notebook:change-cell-to-heading-2',
|
|
33
|
+
label: "Change to Heading 1",
|
|
34
|
+
keybind: '2',
|
|
35
|
+
when: 'commandMode'
|
|
36
|
+
},
|
|
37
|
+
ChangeCellToHeading3: {
|
|
38
|
+
id: 'notebook:change-cell-to-heading-3',
|
|
39
|
+
label: "Change to Heading 1",
|
|
40
|
+
keybind: '3',
|
|
41
|
+
when: 'commandMode'
|
|
42
|
+
},
|
|
43
|
+
ChangeCellToHeading4: {
|
|
44
|
+
id: 'notebook:change-cell-to-heading-4',
|
|
45
|
+
label: "Change to Heading 1",
|
|
46
|
+
keybind: '4',
|
|
47
|
+
when: 'commandMode'
|
|
48
|
+
},
|
|
49
|
+
ChangeCellToHeading5: {
|
|
50
|
+
id: 'notebook:change-cell-to-heading-5',
|
|
51
|
+
label: "Change to Heading 1",
|
|
52
|
+
keybind: '5',
|
|
53
|
+
when: 'commandMode'
|
|
54
|
+
},
|
|
55
|
+
ChangeCellToHeading6: {
|
|
56
|
+
id: 'notebook:change-cell-to-heading-6',
|
|
57
|
+
label: "Change to Heading 1",
|
|
58
|
+
keybind: '6',
|
|
59
|
+
when: 'commandMode'
|
|
60
|
+
},
|
|
61
|
+
ChangeCellToMarkdown: {
|
|
62
|
+
id: 'notebook:change-cell-to-markdown',
|
|
63
|
+
label: "Change to Markdown Cell Type",
|
|
64
|
+
keybind: 'M',
|
|
65
|
+
when: 'commandMode'
|
|
66
|
+
},
|
|
67
|
+
ChangeCellToRaw: {
|
|
68
|
+
id: 'notebook:change-cell-to-raw',
|
|
69
|
+
label: "Change to Raw Cell Type",
|
|
70
|
+
keybind: 'R',
|
|
71
|
+
when: 'commandMode'
|
|
72
|
+
},
|
|
73
|
+
ClearAllCellOutput: {
|
|
74
|
+
id: 'notebook:clear-all-cell-outputs',
|
|
75
|
+
label: "Clear Outputs of All Cells",
|
|
76
|
+
icon: ClearOutlined
|
|
77
|
+
},
|
|
78
|
+
ClearCellOutput: {
|
|
79
|
+
id: 'notebook:clear-cell-outputs',
|
|
80
|
+
label: "Clear Cell Output"
|
|
81
|
+
},
|
|
82
|
+
CloseAndShutdown: {
|
|
83
|
+
id: 'notebook:close-and-shutdown',
|
|
84
|
+
label: "Close and Shut Down Notebook",
|
|
85
|
+
icon: PoweroffOutlined
|
|
86
|
+
},
|
|
87
|
+
// TODO: 确定命令含义
|
|
88
|
+
CollapseAllHeadings: {
|
|
89
|
+
id: 'notebook:collapse-all-headings',
|
|
90
|
+
label: "Collapse All Headings",
|
|
91
|
+
keybind: 'ctrlcmd+shift+left'
|
|
92
|
+
},
|
|
93
|
+
CopyCell: {
|
|
94
|
+
id: 'notebook:copy-cell',
|
|
95
|
+
label: "Copy Cells",
|
|
96
|
+
keybind: 'C',
|
|
97
|
+
icon: CopyOutlined,
|
|
98
|
+
when: 'commandMode'
|
|
99
|
+
},
|
|
100
|
+
// TODO: 确定命令含义
|
|
101
|
+
CopyToClipboard: {
|
|
102
|
+
id: 'notebook:copy-to-clipboard',
|
|
103
|
+
label: "Copy Output to Clipboard"
|
|
104
|
+
},
|
|
105
|
+
// TODO: 确定命令含义
|
|
106
|
+
CreateOutputView: {
|
|
107
|
+
id: 'notebook:create-output-view',
|
|
108
|
+
label: "Create New View for Cell Output"
|
|
109
|
+
},
|
|
110
|
+
CutCell: {
|
|
111
|
+
id: 'notebook:cut-cell',
|
|
112
|
+
label: "Cut Cells",
|
|
113
|
+
keybind: 'x',
|
|
114
|
+
icon: ScissorOutlined,
|
|
115
|
+
when: 'commandMode'
|
|
116
|
+
},
|
|
117
|
+
DeleteCell: {
|
|
118
|
+
id: 'notebook:delete-cell',
|
|
119
|
+
label: "Delete Cells",
|
|
120
|
+
icon: DeleteOutlined,
|
|
121
|
+
keybind: 'D D',
|
|
122
|
+
when: 'commandMode'
|
|
123
|
+
},
|
|
124
|
+
DeselectAll: {
|
|
125
|
+
id: 'notebook:deselect-all',
|
|
126
|
+
label: "Deselect All Cells"
|
|
127
|
+
},
|
|
128
|
+
DisableOutputScrolling: {
|
|
129
|
+
id: 'notebook:disable-output-scrolling',
|
|
130
|
+
label: "Disable Scrolling for Outputs"
|
|
131
|
+
},
|
|
132
|
+
DuplicateBelow: {
|
|
133
|
+
id: 'notebook:duplicate-below',
|
|
134
|
+
label: "Duplicate Cells Below"
|
|
135
|
+
},
|
|
136
|
+
EnableOutputScrolling: {
|
|
137
|
+
id: 'notebook:enable-output-scrolling',
|
|
138
|
+
label: "Enable Scrolling for Outputs"
|
|
139
|
+
},
|
|
140
|
+
EnterCommandMode: {
|
|
141
|
+
id: 'notebook:enter-command-mode',
|
|
142
|
+
label: "Enter Command Mode",
|
|
143
|
+
keybind: 'esc'
|
|
144
|
+
},
|
|
145
|
+
EnterEditMode: {
|
|
146
|
+
id: 'notebook:enter-edit-mode',
|
|
147
|
+
label: "Enter Edit Mode",
|
|
148
|
+
keybind: 'enter',
|
|
149
|
+
when: 'commandMode'
|
|
150
|
+
},
|
|
151
|
+
ExpandAllHeadings: {
|
|
152
|
+
id: 'notebook:expand-all-headings',
|
|
153
|
+
label: "Expand All Headings",
|
|
154
|
+
keybind: 'ctrlcmd+shift+right',
|
|
155
|
+
when: 'commandMode'
|
|
156
|
+
},
|
|
157
|
+
ExportToFormat: {
|
|
158
|
+
id: 'notebook:export-to-format',
|
|
159
|
+
label: "Save and Export Notebook to the given format"
|
|
160
|
+
},
|
|
161
|
+
ExtendMarkedCellsAbove: {
|
|
162
|
+
id: 'notebook:extend-marked-cells-above',
|
|
163
|
+
label: "Extend Selection Above",
|
|
164
|
+
keybind: ['shift+up', 'shift+K'],
|
|
165
|
+
when: 'commandMode'
|
|
166
|
+
},
|
|
167
|
+
ExtendMarkedCellsBelow: {
|
|
168
|
+
id: 'notebook:extend-marked-cells-below',
|
|
169
|
+
label: "Extend Selection Below",
|
|
170
|
+
keybind: ['shift+down', 'shift+J'],
|
|
171
|
+
when: 'commandMode'
|
|
172
|
+
},
|
|
173
|
+
//TODO:
|
|
174
|
+
ExtendMarkedCellsBottom: {
|
|
175
|
+
id: 'notebook:extend-marked-cells-bottom',
|
|
176
|
+
label: "Extend Selection to Bottom",
|
|
177
|
+
keybind: 'shift+end',
|
|
178
|
+
when: 'commandMode'
|
|
179
|
+
},
|
|
180
|
+
//TODO:
|
|
181
|
+
ExtendMarkedCellsTop: {
|
|
182
|
+
id: 'notebook:extend-marked-cells-top',
|
|
183
|
+
label: "Extend Selection to Top",
|
|
184
|
+
keybind: 'shift+home',
|
|
185
|
+
when: 'commandMode'
|
|
186
|
+
},
|
|
187
|
+
HideAllCell: {
|
|
188
|
+
id: 'notebook:hide-all-cell'
|
|
189
|
+
},
|
|
190
|
+
HideAllCellCode: {
|
|
191
|
+
id: 'notebook:hide-all-cell-code',
|
|
192
|
+
label: "Collapse All Code"
|
|
193
|
+
},
|
|
194
|
+
HideAllCellOutput: {
|
|
195
|
+
id: 'notebook:hide-all-cell-output',
|
|
196
|
+
label: "Collapse All Outputs"
|
|
197
|
+
},
|
|
198
|
+
HideCellCode: {
|
|
199
|
+
id: 'notebook:hide-cell-code',
|
|
200
|
+
label: "Collapse Selected Code"
|
|
201
|
+
},
|
|
202
|
+
HideOrShowCellCode: {
|
|
203
|
+
id: 'notebook:hide-or-show-cell-code',
|
|
204
|
+
label: "Hide or show Selected Code",
|
|
205
|
+
keybind: "ctrlcmd+'"
|
|
206
|
+
},
|
|
207
|
+
HideCellOutputs: {
|
|
208
|
+
id: 'notebook:hide-cell-outputs',
|
|
209
|
+
label: "Collapse Selected Outputs",
|
|
210
|
+
icon: EyeInvisibleOutlined
|
|
211
|
+
},
|
|
212
|
+
HideOrShowOutputs: {
|
|
213
|
+
id: 'notebook:hide-or-show-outputs',
|
|
214
|
+
label: "Hide or show Selected outputs",
|
|
215
|
+
keybind: 'ctrlcmd+o'
|
|
216
|
+
},
|
|
217
|
+
InsertCellAbove: {
|
|
218
|
+
id: 'notebook:insert-cell-above',
|
|
219
|
+
label: "Insert Cell Above",
|
|
220
|
+
keybind: 'A',
|
|
221
|
+
when: 'commandMode'
|
|
222
|
+
},
|
|
223
|
+
InsertCellBelow: {
|
|
224
|
+
id: 'notebook:insert-cell-below',
|
|
225
|
+
label: "Insert Cell Below",
|
|
226
|
+
keybind: 'B',
|
|
227
|
+
icon: PlusOutlined,
|
|
228
|
+
when: 'commandMode'
|
|
229
|
+
},
|
|
230
|
+
InsertHeadingAbove: {
|
|
231
|
+
id: 'notebook:insert-heading-above',
|
|
232
|
+
label: "Insert Heading Above Current Heading",
|
|
233
|
+
keybind: 'shift+A',
|
|
234
|
+
when: 'commandMode'
|
|
235
|
+
},
|
|
236
|
+
InsertHeadingBelow: {
|
|
237
|
+
id: 'notebook:insert-heading-below',
|
|
238
|
+
label: "Insert Heading Below Current Heading",
|
|
239
|
+
keybind: 'shift+B',
|
|
240
|
+
when: 'commandMode'
|
|
241
|
+
},
|
|
242
|
+
MergeCellAbove: {
|
|
243
|
+
id: 'notebook:merge-cell-above',
|
|
244
|
+
label: "Merge Cell Above",
|
|
245
|
+
keybind: 'ctrlcmd+backspace',
|
|
246
|
+
when: 'commandMode'
|
|
247
|
+
},
|
|
248
|
+
MergeCellBelow: {
|
|
249
|
+
id: 'notebook:merge-cell-below',
|
|
250
|
+
label: "Merge Cell Below",
|
|
251
|
+
keybind: 'ctrlcmd+shift+M',
|
|
252
|
+
when: 'commandMode'
|
|
253
|
+
},
|
|
254
|
+
MergeCells: {
|
|
255
|
+
id: 'notebook:merge-cells',
|
|
256
|
+
label: "Merge Selected Cells",
|
|
257
|
+
keybind: 'shift+M',
|
|
258
|
+
when: 'commandMode'
|
|
259
|
+
},
|
|
260
|
+
MoveCellDown: {
|
|
261
|
+
id: 'notebook:move-cell-down',
|
|
262
|
+
label: "Move Cells Down",
|
|
263
|
+
keybind: 'ctrlcmd+shift+down',
|
|
264
|
+
icon: MoveDownOutlined,
|
|
265
|
+
when: 'commandMode'
|
|
266
|
+
},
|
|
267
|
+
MoveCellUp: {
|
|
268
|
+
id: 'notebook:move-cell-up',
|
|
269
|
+
label: "Move Cells Up",
|
|
270
|
+
keybind: 'ctrlcmd+shift+up',
|
|
271
|
+
icon: MoveUpOutlined,
|
|
272
|
+
when: 'commandMode'
|
|
273
|
+
},
|
|
274
|
+
MoveCursorDown: {
|
|
275
|
+
id: 'notebook:move-cursor-down',
|
|
276
|
+
label: "Select Cell Below",
|
|
277
|
+
keybind: ['down', 'J'],
|
|
278
|
+
when: 'commandMode'
|
|
279
|
+
},
|
|
280
|
+
MoveCursorUp: {
|
|
281
|
+
id: 'notebook:move-cursor-up',
|
|
282
|
+
label: "Select Cell Above",
|
|
283
|
+
keybind: ['up', 'K'],
|
|
284
|
+
when: 'commandMode'
|
|
285
|
+
},
|
|
286
|
+
MoveCursorHeadingAboveOrCollapse: {
|
|
287
|
+
id: 'notebook:move-cursor-heading-above-or-collapse',
|
|
288
|
+
label: "Select Heading Above or Collapse Heading",
|
|
289
|
+
keybind: 'left',
|
|
290
|
+
when: 'commandMode'
|
|
291
|
+
},
|
|
292
|
+
MoveCursorHeadingBelowOrExpand: {
|
|
293
|
+
id: 'notebook:move-cursor-heading-below-or-expand',
|
|
294
|
+
label: "Select Heading Below or Expand Heading",
|
|
295
|
+
keybind: 'right',
|
|
296
|
+
when: 'commandMode'
|
|
297
|
+
},
|
|
298
|
+
PasteAndReplaceCell: {
|
|
299
|
+
id: 'notebook:paste-and-replace-cell',
|
|
300
|
+
label: "Paste Cells and Replace"
|
|
301
|
+
},
|
|
302
|
+
PasteCellAbove: {
|
|
303
|
+
id: 'notebook:paste-cell-above',
|
|
304
|
+
label: "Paste Cells Above"
|
|
305
|
+
},
|
|
306
|
+
PasteCellBelow: {
|
|
307
|
+
id: 'notebook:paste-cell-below',
|
|
308
|
+
label: "Paste Cells Below",
|
|
309
|
+
keybind: 'V',
|
|
310
|
+
icon: SnippetsOutlined,
|
|
311
|
+
when: 'commandMode'
|
|
312
|
+
},
|
|
313
|
+
Redo: {
|
|
314
|
+
id: 'notebook:redo',
|
|
315
|
+
label: "Redo"
|
|
316
|
+
},
|
|
317
|
+
RedoCellAction: {
|
|
318
|
+
id: 'notebook:redo-cell-action',
|
|
319
|
+
label: "Redo Cell Operation",
|
|
320
|
+
icon: Redo,
|
|
321
|
+
keybind: 'shift+Z',
|
|
322
|
+
when: 'commandMode'
|
|
323
|
+
},
|
|
324
|
+
RenderAllMarkdown: {
|
|
325
|
+
id: 'notebook:render-all-markdown',
|
|
326
|
+
label: "Render All Markdown Cells"
|
|
327
|
+
},
|
|
328
|
+
ReplaceSelection: {
|
|
329
|
+
id: 'notebook:replace-selection',
|
|
330
|
+
label: "Replace Selection in Notebook Cell"
|
|
331
|
+
},
|
|
332
|
+
RestartAndRunToSelected: {
|
|
333
|
+
id: 'notebook:restart-and-run-to-selected',
|
|
334
|
+
label: l10n.t('Restart and Run up to Selected Cell…')
|
|
335
|
+
},
|
|
336
|
+
RestartClearOutput: {
|
|
337
|
+
id: 'notebook:restart-clear-output',
|
|
338
|
+
label: l10n.t('Restart and Clear Outputs of All Cells…'),
|
|
339
|
+
icon: Reload
|
|
340
|
+
},
|
|
341
|
+
RestartRunAll: {
|
|
342
|
+
id: 'notebook:restart-run-all',
|
|
343
|
+
label: l10n.t('Restart and Run All Cells…')
|
|
344
|
+
},
|
|
345
|
+
RunAllAbove: {
|
|
346
|
+
id: 'notebook:run-all-above',
|
|
347
|
+
label: "Run All Above Selected Cell"
|
|
348
|
+
},
|
|
349
|
+
RunAllBelow: {
|
|
350
|
+
id: 'notebook:run-all-below',
|
|
351
|
+
label: "Run All Below Selected Cell"
|
|
352
|
+
},
|
|
353
|
+
RunAllCells: {
|
|
354
|
+
id: 'notebook:run-all-cells',
|
|
355
|
+
label: "Run All Cells"
|
|
356
|
+
},
|
|
357
|
+
RunCell: {
|
|
358
|
+
id: 'notebook:run-cell',
|
|
359
|
+
icon: PlayCircleOutlined,
|
|
360
|
+
// label: `Run Selected Cells and Don't Advance`,
|
|
361
|
+
keybind: 'ctrlcmd+enter'
|
|
362
|
+
},
|
|
363
|
+
TopToolbarRunSelect: {
|
|
364
|
+
id: 'notebook:top-toolbar-run-select'
|
|
365
|
+
},
|
|
366
|
+
SideToolbarRunSelect: {
|
|
367
|
+
id: 'notebook:side-toolbar-run-select'
|
|
368
|
+
},
|
|
369
|
+
RunCellAndInsertBelow: {
|
|
370
|
+
id: 'notebook:run-cell-and-insert-below',
|
|
371
|
+
label: "Run Selected Cells and Insert Below",
|
|
372
|
+
keybind: 'alt+enter'
|
|
373
|
+
},
|
|
374
|
+
RunCellAndSelectNext: {
|
|
375
|
+
id: 'notebook:run-cell-and-select-next',
|
|
376
|
+
label: "Run Selected Cells and Select Below",
|
|
377
|
+
keybind: 'shift+enter'
|
|
378
|
+
},
|
|
379
|
+
// TODO: 确认是否保留
|
|
380
|
+
RunInConsole: {
|
|
381
|
+
id: 'notebook:run-in-console',
|
|
382
|
+
label: "Run Selected Text or Current Line in Console"
|
|
383
|
+
},
|
|
384
|
+
// TODO:
|
|
385
|
+
SelectAll: {
|
|
386
|
+
id: 'notebook:select-all',
|
|
387
|
+
label: "Select All Cells",
|
|
388
|
+
keybind: 'ctrlcmd+A',
|
|
389
|
+
when: 'commandMode'
|
|
390
|
+
},
|
|
391
|
+
SelectLastRunCell: {
|
|
392
|
+
id: 'notebook:select-last-run-cell',
|
|
393
|
+
label: "Select current running or last run cell"
|
|
394
|
+
},
|
|
395
|
+
// TODO: 确认命令含义
|
|
396
|
+
SetSideBySideRatio: {
|
|
397
|
+
id: 'notebook:set-side-by-side-ratio',
|
|
398
|
+
label: "Set Side by Side Ratio"
|
|
399
|
+
},
|
|
400
|
+
ShowAllCell: {
|
|
401
|
+
id: 'notebook:show-all-cell',
|
|
402
|
+
label: "Expand All Cell"
|
|
403
|
+
},
|
|
404
|
+
ShowAllCellCode: {
|
|
405
|
+
id: 'notebook:show-all-cell-code',
|
|
406
|
+
label: "Expand All Code"
|
|
407
|
+
},
|
|
408
|
+
ShowAllCellOutputs: {
|
|
409
|
+
id: 'notebook:show-all-cell-outputs',
|
|
410
|
+
label: "Expand All Outputs",
|
|
411
|
+
icon: EyeOutlined
|
|
412
|
+
},
|
|
413
|
+
ShowCellCode: {
|
|
414
|
+
id: 'notebook:show-cell-code',
|
|
415
|
+
label: "Expand Selected Code"
|
|
416
|
+
},
|
|
417
|
+
ShowCellOutputs: {
|
|
418
|
+
id: 'notebook:show-cell-outputs',
|
|
419
|
+
label: "Expand Selected Outputs"
|
|
420
|
+
},
|
|
421
|
+
SplitCellAntCursor: {
|
|
422
|
+
id: 'notebook:split-cell-at-cursor',
|
|
423
|
+
label: "Split Cell",
|
|
424
|
+
keybind: 'ctrlcmd+shift+-'
|
|
425
|
+
},
|
|
426
|
+
ToggleAllCellLineNumbers: {
|
|
427
|
+
id: 'notebook:toggle-all-cell-line-numbers',
|
|
428
|
+
label: "Show Line Numbers",
|
|
429
|
+
keybind: 'shift+L'
|
|
430
|
+
},
|
|
431
|
+
ToggleAutoclosingBrackets: {
|
|
432
|
+
id: 'notebook:toggle-autoclosing-brackets',
|
|
433
|
+
label: "Auto Close Brackets for All Notebook Cell Types"
|
|
434
|
+
},
|
|
435
|
+
ToggleHeadingCollapse: {
|
|
436
|
+
id: 'notebook:toggle-heading-collapse',
|
|
437
|
+
label: "Toggle Collapse Notebook Heading"
|
|
438
|
+
},
|
|
439
|
+
ToggleRenderSideBySideCurrent: {
|
|
440
|
+
id: 'notebook:toggle-render-side-by-side-current',
|
|
441
|
+
label: "Render Side-by-Side",
|
|
442
|
+
keybind: 'shift+R',
|
|
443
|
+
when: 'commandMode'
|
|
444
|
+
},
|
|
445
|
+
Trust: {
|
|
446
|
+
id: 'notebook:trust',
|
|
447
|
+
label: "Trust Notebook"
|
|
448
|
+
},
|
|
449
|
+
Undo: {
|
|
450
|
+
id: 'notebook:undo',
|
|
451
|
+
label: "Undo"
|
|
452
|
+
},
|
|
453
|
+
UndoCellAction: {
|
|
454
|
+
id: 'notebook:undo-cell-action',
|
|
455
|
+
label: "Undo Cell Operation",
|
|
456
|
+
keybind: 'Z',
|
|
457
|
+
icon: Undo,
|
|
458
|
+
when: 'commandMode'
|
|
459
|
+
},
|
|
460
|
+
More: {
|
|
461
|
+
id: 'notebook:more',
|
|
462
|
+
icon: MoreOutlined
|
|
463
|
+
},
|
|
464
|
+
InsertCellBottom: {
|
|
465
|
+
id: 'notebook:insert-cell-bottom'
|
|
466
|
+
}
|
|
467
|
+
//#endregion
|
|
468
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { CellOptions, CellView } from '../libro-protocol.js';
|
|
3
|
+
export type CellExecutionTimeProvider = React.FC<{
|
|
4
|
+
cell: CellView;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const CellExecutionTimeProvider: unique symbol;
|
|
7
|
+
export type CellInputBottonBlankProvider = React.FC<{
|
|
8
|
+
cell: CellView;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const CellInputBottonBlankProvider: unique symbol;
|
|
11
|
+
export type CellOutputVisulizationProvider = React.FC<{
|
|
12
|
+
cell: CellView;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const CellOutputVisulizationProvider: unique symbol;
|
|
15
|
+
export type BetweenCellProvider = React.FC<{
|
|
16
|
+
index: number;
|
|
17
|
+
addCell: (option: CellOptions, position?: number | undefined) => Promise<void>;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const BetweenCellProvider: unique symbol;
|
|
20
|
+
//# sourceMappingURL=cell-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-protocol.d.ts","sourceRoot":"","sources":["../../src/components/cell-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAErE,eAAO,MAAM,yBAAyB,eAAsC,CAAC;AAE7E,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAExE,eAAO,MAAM,4BAA4B,eAAyC,CAAC;AAEnF,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAE1E,eAAO,MAAM,8BAA8B,eAA2C,CAAC;AAEvF,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,EAAE,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF,CAAC,CAAC;AAEH,eAAO,MAAM,mBAAmB,eAAgC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export var CellExecutionTimeProvider = Symbol('CellExecutionTimeProvider');
|
|
2
|
+
export var CellInputBottonBlankProvider = Symbol('CellInputBottonBlankProvider');
|
|
3
|
+
export var CellOutputVisulizationProvider = Symbol('CellOutputVisulizationProvider');
|
|
4
|
+
export var BetweenCellProvider = Symbol('BetweenCellProvider');
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../index.less';
|
|
3
|
+
import type { CellView, DndItemProps } from '../libro-protocol.js';
|
|
4
|
+
import { CellInputBottonBlankProvider, CellExecutionTimeProvider, CellOutputVisulizationProvider } from './cell-protocol.js';
|
|
5
|
+
export declare const CellOutputContent: React.FC<{
|
|
6
|
+
cell: CellView;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const LibroCellExecutionTime: CellExecutionTimeProvider;
|
|
9
|
+
export declare const LibroCellInputBottonBlank: CellInputBottonBlankProvider;
|
|
10
|
+
export declare const LibroCellVisualization: CellOutputVisulizationProvider;
|
|
11
|
+
export declare const DndCellItemRender: React.ForwardRefExoticComponent<DndItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//# sourceMappingURL=dnd-cell-item-render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dnd-cell-item-render.d.ts","sourceRoot":"","sources":["../../src/components/dnd-cell-item-render.tsx"],"names":[],"mappings":"AASA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,eAAe,CAAC;AAavB,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAMnE,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,oBAAoB,CAAC;AA6D5B,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAmC1D,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,yBAIpC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,4BAIvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,8BAIpC,CAAC;AA+DF,eAAO,MAAM,iBAAiB,qFAgG5B,CAAC"}
|