@difizen/libro-lab 0.3.1 → 0.3.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/command/lab-command.d.ts +4 -0
- package/es/command/lab-command.d.ts.map +1 -1
- package/es/command/lab-command.js +4 -0
- package/es/command/lab-menu-contribution.d.ts +3 -2
- package/es/command/lab-menu-contribution.d.ts.map +1 -1
- package/es/command/lab-menu-contribution.js +151 -110
- package/es/config/config.d.ts +2 -0
- package/es/config/config.d.ts.map +1 -1
- package/es/config/config.js +12 -1
- package/es/guide/content-contribution.d.ts +7 -0
- package/es/guide/content-contribution.d.ts.map +1 -0
- package/es/guide/content-contribution.js +74 -0
- package/es/guide/guide-view.d.ts +19 -0
- package/es/guide/guide-view.d.ts.map +1 -0
- package/es/guide/guide-view.js +141 -0
- package/es/guide/index.d.ts +3 -0
- package/es/guide/index.d.ts.map +1 -0
- package/es/guide/index.js +2 -0
- package/es/guide/index.less +8 -0
- package/es/guide/libro_guide_book.json +333 -0
- package/es/guide/libro_guide_book_zh.json +331 -0
- package/es/lab-app.d.ts.map +1 -1
- package/es/lab-app.js +51 -27
- package/es/module.d.ts.map +1 -1
- package/es/module.js +3 -1
- package/package.json +14 -14
- package/src/command/lab-command.ts +4 -0
- package/src/command/lab-menu-contribution.tsx +15 -2
- package/src/config/config.ts +12 -0
- package/src/guide/content-contribution.ts +50 -0
- package/src/guide/guide-view.tsx +77 -0
- package/src/guide/index.less +8 -0
- package/src/guide/index.ts +2 -0
- package/src/guide/libro_guide_book.json +333 -0
- package/src/guide/libro_guide_book_zh.json +331 -0
- package/src/lab-app.ts +10 -2
- package/src/module.tsx +4 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
|
|
2
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6;
|
|
3
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
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
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); }
|
|
@@ -19,10 +19,12 @@ function _applyDecoratedDescriptor(target, property, decorators, descriptor, con
|
|
|
19
19
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
20
20
|
import { LibroJupyterView, LibroService, NotebookCommands } from '@difizen/libro-jupyter';
|
|
21
21
|
import { TerminalCommands, TerminalManager } from '@difizen/libro-terminal';
|
|
22
|
+
import { SlotViewManager } from '@difizen/mana-app';
|
|
22
23
|
import { KeybindingContribution } from '@difizen/mana-app';
|
|
23
24
|
import { Saveable } from '@difizen/mana-app';
|
|
24
25
|
import { CommandContribution, CommandRegistry, inject, MAIN_MENU_BAR, MenuContribution, singleton, ViewManager } from '@difizen/mana-app';
|
|
25
26
|
import { l10n } from '@difizen/mana-l10n';
|
|
27
|
+
import { GuideView } from "../guide/index.js";
|
|
26
28
|
import { LibroLabLayoutSlots } from "../layout/index.js";
|
|
27
29
|
import { LayoutService } from "../layout/layout-service.js";
|
|
28
30
|
import { LabCommands } from "./lab-command.js";
|
|
@@ -38,7 +40,7 @@ export var LabMenus;
|
|
|
38
40
|
})(LabMenus || (LabMenus = {}));
|
|
39
41
|
export var LabMenu = (_dec = singleton({
|
|
40
42
|
contrib: [MenuContribution, CommandContribution, KeybindingContribution]
|
|
41
|
-
}), _dec2 = inject(CommandRegistry), _dec3 = inject(LibroService), _dec4 = inject(LayoutService), _dec5 = inject(TerminalManager), _dec6 = inject(ViewManager), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
43
|
+
}), _dec2 = inject(CommandRegistry), _dec3 = inject(LibroService), _dec4 = inject(LayoutService), _dec5 = inject(TerminalManager), _dec6 = inject(ViewManager), _dec7 = inject(SlotViewManager), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
42
44
|
function LabMenu() {
|
|
43
45
|
_classCallCheck(this, LabMenu);
|
|
44
46
|
_initializerDefineProperty(this, "commandRegistry", _descriptor, this);
|
|
@@ -46,6 +48,7 @@ export var LabMenu = (_dec = singleton({
|
|
|
46
48
|
_initializerDefineProperty(this, "layoutService", _descriptor3, this);
|
|
47
49
|
_initializerDefineProperty(this, "terminalManager", _descriptor4, this);
|
|
48
50
|
_initializerDefineProperty(this, "viewManager", _descriptor5, this);
|
|
51
|
+
_initializerDefineProperty(this, "slotManager", _descriptor6, this);
|
|
49
52
|
}
|
|
50
53
|
_createClass(LabMenu, [{
|
|
51
54
|
key: "registerKeybindings",
|
|
@@ -118,6 +121,15 @@ export var LabMenu = (_dec = singleton({
|
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
123
|
});
|
|
124
|
+
menu.registerMenuAction(LabMenus.HELP, {
|
|
125
|
+
id: LabCommands.Guide.id,
|
|
126
|
+
command: LabCommands.Guide.id,
|
|
127
|
+
label: function label() {
|
|
128
|
+
return /*#__PURE__*/_jsx("div", {
|
|
129
|
+
children: l10n.t(LabCommands.Guide.label)
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
});
|
|
121
133
|
menu.registerMenuAction(LabMenus.FILE, {
|
|
122
134
|
id: LabCommands.Save.id,
|
|
123
135
|
command: LabCommands.Save.id,
|
|
@@ -443,19 +455,19 @@ export var LabMenu = (_dec = singleton({
|
|
|
443
455
|
return execute;
|
|
444
456
|
}()
|
|
445
457
|
});
|
|
446
|
-
commands.registerCommand(LabCommands.
|
|
447
|
-
commands.registerHandler(LabCommands.Save.id, {
|
|
458
|
+
commands.registerCommand(LabCommands.Guide, {
|
|
448
459
|
execute: function () {
|
|
449
460
|
var _execute2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
450
|
-
var
|
|
461
|
+
var view;
|
|
451
462
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
452
463
|
while (1) switch (_context2.prev = _context2.next) {
|
|
453
464
|
case 0:
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
contentActive.save();
|
|
457
|
-
}
|
|
465
|
+
_context2.next = 2;
|
|
466
|
+
return _this.viewManager.getOrCreateView(GuideView);
|
|
458
467
|
case 2:
|
|
468
|
+
view = _context2.sent;
|
|
469
|
+
_this.slotManager.addView(view, LibroLabLayoutSlots.content);
|
|
470
|
+
case 4:
|
|
459
471
|
case "end":
|
|
460
472
|
return _context2.stop();
|
|
461
473
|
}
|
|
@@ -465,29 +477,21 @@ export var LabMenu = (_dec = singleton({
|
|
|
465
477
|
return _execute2.apply(this, arguments);
|
|
466
478
|
}
|
|
467
479
|
return execute;
|
|
468
|
-
}()
|
|
469
|
-
isEnabled: function isEnabled() {
|
|
470
|
-
var _contentActive$contai;
|
|
471
|
-
var contentActive = _this.layoutService.getActiveView(LibroLabLayoutSlots.content);
|
|
472
|
-
if (contentActive && (_contentActive$contai = contentActive.container) !== null && _contentActive$contai !== void 0 && _contentActive$contai.current) {
|
|
473
|
-
var contentHost = contentActive.container.current;
|
|
474
|
-
if (contentHost.contains(document.activeElement)) {
|
|
475
|
-
return true;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
return false;
|
|
479
|
-
}
|
|
480
|
+
}()
|
|
480
481
|
});
|
|
481
|
-
commands.
|
|
482
|
+
commands.registerCommand(LabCommands.Save);
|
|
483
|
+
commands.registerHandler(LabCommands.Save.id, {
|
|
482
484
|
execute: function () {
|
|
483
485
|
var _execute3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
486
|
+
var contentActive;
|
|
484
487
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
485
488
|
while (1) switch (_context3.prev = _context3.next) {
|
|
486
489
|
case 0:
|
|
487
|
-
|
|
488
|
-
|
|
490
|
+
contentActive = _this.layoutService.getActiveView(LibroLabLayoutSlots.content);
|
|
491
|
+
if (contentActive && Saveable.is(contentActive)) {
|
|
492
|
+
contentActive.save();
|
|
489
493
|
}
|
|
490
|
-
case
|
|
494
|
+
case 2:
|
|
491
495
|
case "end":
|
|
492
496
|
return _context3.stop();
|
|
493
497
|
}
|
|
@@ -498,22 +502,26 @@ export var LabMenu = (_dec = singleton({
|
|
|
498
502
|
}
|
|
499
503
|
return execute;
|
|
500
504
|
}(),
|
|
501
|
-
isEnabled: function isEnabled(
|
|
502
|
-
var
|
|
503
|
-
|
|
504
|
-
|
|
505
|
+
isEnabled: function isEnabled() {
|
|
506
|
+
var _contentActive$contai;
|
|
507
|
+
var contentActive = _this.layoutService.getActiveView(LibroLabLayoutSlots.content);
|
|
508
|
+
if (contentActive && (_contentActive$contai = contentActive.container) !== null && _contentActive$contai !== void 0 && _contentActive$contai.current) {
|
|
509
|
+
var contentHost = contentActive.container.current;
|
|
510
|
+
if (contentHost.contains(document.activeElement)) {
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
505
513
|
}
|
|
506
514
|
return false;
|
|
507
515
|
}
|
|
508
516
|
});
|
|
509
|
-
commands.registerCommandWithContext(LabCommands.
|
|
517
|
+
commands.registerCommandWithContext(LabCommands.UndoCellAction, this, {
|
|
510
518
|
execute: function () {
|
|
511
519
|
var _execute4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
512
520
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
513
521
|
while (1) switch (_context4.prev = _context4.next) {
|
|
514
522
|
case 0:
|
|
515
523
|
if (_this.libroService.active) {
|
|
516
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
524
|
+
_this.commandRegistry.executeCommand(NotebookCommands['UndoCellAction'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
517
525
|
}
|
|
518
526
|
case 1:
|
|
519
527
|
case "end":
|
|
@@ -534,14 +542,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
534
542
|
return false;
|
|
535
543
|
}
|
|
536
544
|
});
|
|
537
|
-
commands.registerCommandWithContext(LabCommands.
|
|
545
|
+
commands.registerCommandWithContext(LabCommands.RedoCellAction, this, {
|
|
538
546
|
execute: function () {
|
|
539
547
|
var _execute5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
540
548
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
541
549
|
while (1) switch (_context5.prev = _context5.next) {
|
|
542
550
|
case 0:
|
|
543
551
|
if (_this.libroService.active) {
|
|
544
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
552
|
+
_this.commandRegistry.executeCommand(NotebookCommands['RedoCellAction'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
545
553
|
}
|
|
546
554
|
case 1:
|
|
547
555
|
case "end":
|
|
@@ -562,14 +570,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
562
570
|
return false;
|
|
563
571
|
}
|
|
564
572
|
});
|
|
565
|
-
commands.registerCommandWithContext(LabCommands.
|
|
573
|
+
commands.registerCommandWithContext(LabCommands.CutCell, this, {
|
|
566
574
|
execute: function () {
|
|
567
575
|
var _execute6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
568
576
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
569
577
|
while (1) switch (_context6.prev = _context6.next) {
|
|
570
578
|
case 0:
|
|
571
579
|
if (_this.libroService.active) {
|
|
572
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
580
|
+
_this.commandRegistry.executeCommand(NotebookCommands['CutCell'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
573
581
|
}
|
|
574
582
|
case 1:
|
|
575
583
|
case "end":
|
|
@@ -590,14 +598,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
590
598
|
return false;
|
|
591
599
|
}
|
|
592
600
|
});
|
|
593
|
-
commands.registerCommandWithContext(LabCommands.
|
|
601
|
+
commands.registerCommandWithContext(LabCommands.CopyCell, this, {
|
|
594
602
|
execute: function () {
|
|
595
603
|
var _execute7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
596
604
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
597
605
|
while (1) switch (_context7.prev = _context7.next) {
|
|
598
606
|
case 0:
|
|
599
607
|
if (_this.libroService.active) {
|
|
600
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
608
|
+
_this.commandRegistry.executeCommand(NotebookCommands['CopyCell'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
601
609
|
}
|
|
602
610
|
case 1:
|
|
603
611
|
case "end":
|
|
@@ -618,14 +626,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
618
626
|
return false;
|
|
619
627
|
}
|
|
620
628
|
});
|
|
621
|
-
commands.registerCommandWithContext(LabCommands.
|
|
629
|
+
commands.registerCommandWithContext(LabCommands.DeleteCell, this, {
|
|
622
630
|
execute: function () {
|
|
623
631
|
var _execute8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
624
632
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
625
633
|
while (1) switch (_context8.prev = _context8.next) {
|
|
626
634
|
case 0:
|
|
627
635
|
if (_this.libroService.active) {
|
|
628
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
636
|
+
_this.commandRegistry.executeCommand(NotebookCommands['DeleteCell'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
629
637
|
}
|
|
630
638
|
case 1:
|
|
631
639
|
case "end":
|
|
@@ -646,14 +654,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
646
654
|
return false;
|
|
647
655
|
}
|
|
648
656
|
});
|
|
649
|
-
commands.registerCommandWithContext(LabCommands.
|
|
657
|
+
commands.registerCommandWithContext(LabCommands.PasteCellBelow, this, {
|
|
650
658
|
execute: function () {
|
|
651
659
|
var _execute9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
652
660
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
653
661
|
while (1) switch (_context9.prev = _context9.next) {
|
|
654
662
|
case 0:
|
|
655
663
|
if (_this.libroService.active) {
|
|
656
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
664
|
+
_this.commandRegistry.executeCommand(NotebookCommands['PasteCellBelow'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
657
665
|
}
|
|
658
666
|
case 1:
|
|
659
667
|
case "end":
|
|
@@ -674,14 +682,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
674
682
|
return false;
|
|
675
683
|
}
|
|
676
684
|
});
|
|
677
|
-
commands.registerCommandWithContext(LabCommands.
|
|
685
|
+
commands.registerCommandWithContext(LabCommands.PasteCellAbove, this, {
|
|
678
686
|
execute: function () {
|
|
679
687
|
var _execute10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
680
688
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
681
689
|
while (1) switch (_context10.prev = _context10.next) {
|
|
682
690
|
case 0:
|
|
683
691
|
if (_this.libroService.active) {
|
|
684
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
692
|
+
_this.commandRegistry.executeCommand(NotebookCommands['PasteCellAbove'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
685
693
|
}
|
|
686
694
|
case 1:
|
|
687
695
|
case "end":
|
|
@@ -702,14 +710,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
702
710
|
return false;
|
|
703
711
|
}
|
|
704
712
|
});
|
|
705
|
-
commands.registerCommandWithContext(LabCommands.
|
|
713
|
+
commands.registerCommandWithContext(LabCommands.PasteAndReplaceCell, this, {
|
|
706
714
|
execute: function () {
|
|
707
715
|
var _execute11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
708
716
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
709
717
|
while (1) switch (_context11.prev = _context11.next) {
|
|
710
718
|
case 0:
|
|
711
719
|
if (_this.libroService.active) {
|
|
712
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
720
|
+
_this.commandRegistry.executeCommand(NotebookCommands['PasteAndReplaceCell'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
713
721
|
}
|
|
714
722
|
case 1:
|
|
715
723
|
case "end":
|
|
@@ -730,24 +738,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
730
738
|
return false;
|
|
731
739
|
}
|
|
732
740
|
});
|
|
733
|
-
|
|
734
|
-
// execute: async () => {
|
|
735
|
-
// if (libro)
|
|
736
|
-
// this.commandRegistry.executeCommand(
|
|
737
|
-
// NotebookCommands.DeselectAll.id,
|
|
738
|
-
// libro.activeCell,
|
|
739
|
-
// libro,
|
|
740
|
-
// );
|
|
741
|
-
// },
|
|
742
|
-
// });
|
|
743
|
-
commands.registerCommandWithContext(LabCommands.MoveCellUp, this, {
|
|
741
|
+
commands.registerCommandWithContext(LabCommands.SelectAll, this, {
|
|
744
742
|
execute: function () {
|
|
745
743
|
var _execute12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
746
744
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
747
745
|
while (1) switch (_context12.prev = _context12.next) {
|
|
748
746
|
case 0:
|
|
749
747
|
if (_this.libroService.active) {
|
|
750
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
748
|
+
_this.commandRegistry.executeCommand(NotebookCommands['SelectAll'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
751
749
|
}
|
|
752
750
|
case 1:
|
|
753
751
|
case "end":
|
|
@@ -768,14 +766,24 @@ export var LabMenu = (_dec = singleton({
|
|
|
768
766
|
return false;
|
|
769
767
|
}
|
|
770
768
|
});
|
|
771
|
-
commands.
|
|
769
|
+
// commands.registerCommand(LabCommands.DeselectAll, {
|
|
770
|
+
// execute: async () => {
|
|
771
|
+
// if (libro)
|
|
772
|
+
// this.commandRegistry.executeCommand(
|
|
773
|
+
// NotebookCommands.DeselectAll.id,
|
|
774
|
+
// libro.activeCell,
|
|
775
|
+
// libro,
|
|
776
|
+
// );
|
|
777
|
+
// },
|
|
778
|
+
// });
|
|
779
|
+
commands.registerCommandWithContext(LabCommands.MoveCellUp, this, {
|
|
772
780
|
execute: function () {
|
|
773
781
|
var _execute13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
774
782
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
775
783
|
while (1) switch (_context13.prev = _context13.next) {
|
|
776
784
|
case 0:
|
|
777
785
|
if (_this.libroService.active) {
|
|
778
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
786
|
+
_this.commandRegistry.executeCommand(NotebookCommands['MoveCellUp'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
779
787
|
}
|
|
780
788
|
case 1:
|
|
781
789
|
case "end":
|
|
@@ -796,14 +804,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
796
804
|
return false;
|
|
797
805
|
}
|
|
798
806
|
});
|
|
799
|
-
commands.registerCommandWithContext(LabCommands.
|
|
807
|
+
commands.registerCommandWithContext(LabCommands.MoveCellDown, this, {
|
|
800
808
|
execute: function () {
|
|
801
809
|
var _execute14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
802
810
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
803
811
|
while (1) switch (_context14.prev = _context14.next) {
|
|
804
812
|
case 0:
|
|
805
813
|
if (_this.libroService.active) {
|
|
806
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
814
|
+
_this.commandRegistry.executeCommand(NotebookCommands['MoveCellDown'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
807
815
|
}
|
|
808
816
|
case 1:
|
|
809
817
|
case "end":
|
|
@@ -824,14 +832,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
824
832
|
return false;
|
|
825
833
|
}
|
|
826
834
|
});
|
|
827
|
-
commands.registerCommandWithContext(LabCommands.
|
|
835
|
+
commands.registerCommandWithContext(LabCommands.SplitCellAntCursor, this, {
|
|
828
836
|
execute: function () {
|
|
829
837
|
var _execute15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
830
838
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
831
839
|
while (1) switch (_context15.prev = _context15.next) {
|
|
832
840
|
case 0:
|
|
833
841
|
if (_this.libroService.active) {
|
|
834
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
842
|
+
_this.commandRegistry.executeCommand(NotebookCommands['SplitCellAntCursor'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
835
843
|
}
|
|
836
844
|
case 1:
|
|
837
845
|
case "end":
|
|
@@ -852,14 +860,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
852
860
|
return false;
|
|
853
861
|
}
|
|
854
862
|
});
|
|
855
|
-
commands.registerCommandWithContext(LabCommands.
|
|
863
|
+
commands.registerCommandWithContext(LabCommands.MergeCells, this, {
|
|
856
864
|
execute: function () {
|
|
857
865
|
var _execute16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
858
866
|
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
859
867
|
while (1) switch (_context16.prev = _context16.next) {
|
|
860
868
|
case 0:
|
|
861
869
|
if (_this.libroService.active) {
|
|
862
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
870
|
+
_this.commandRegistry.executeCommand(NotebookCommands['MergeCells'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
863
871
|
}
|
|
864
872
|
case 1:
|
|
865
873
|
case "end":
|
|
@@ -880,14 +888,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
880
888
|
return false;
|
|
881
889
|
}
|
|
882
890
|
});
|
|
883
|
-
commands.registerCommandWithContext(LabCommands.
|
|
891
|
+
commands.registerCommandWithContext(LabCommands.MergeCellAbove, this, {
|
|
884
892
|
execute: function () {
|
|
885
893
|
var _execute17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
886
894
|
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
887
895
|
while (1) switch (_context17.prev = _context17.next) {
|
|
888
896
|
case 0:
|
|
889
897
|
if (_this.libroService.active) {
|
|
890
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
898
|
+
_this.commandRegistry.executeCommand(NotebookCommands['MergeCellAbove'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
891
899
|
}
|
|
892
900
|
case 1:
|
|
893
901
|
case "end":
|
|
@@ -908,14 +916,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
908
916
|
return false;
|
|
909
917
|
}
|
|
910
918
|
});
|
|
911
|
-
commands.registerCommandWithContext(LabCommands.
|
|
919
|
+
commands.registerCommandWithContext(LabCommands.MergeCellBelow, this, {
|
|
912
920
|
execute: function () {
|
|
913
921
|
var _execute18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
914
922
|
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
915
923
|
while (1) switch (_context18.prev = _context18.next) {
|
|
916
924
|
case 0:
|
|
917
925
|
if (_this.libroService.active) {
|
|
918
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
926
|
+
_this.commandRegistry.executeCommand(NotebookCommands['MergeCellBelow'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
919
927
|
}
|
|
920
928
|
case 1:
|
|
921
929
|
case "end":
|
|
@@ -936,14 +944,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
936
944
|
return false;
|
|
937
945
|
}
|
|
938
946
|
});
|
|
939
|
-
commands.registerCommandWithContext(LabCommands.
|
|
947
|
+
commands.registerCommandWithContext(LabCommands.ClearCellOutput, this, {
|
|
940
948
|
execute: function () {
|
|
941
949
|
var _execute19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
942
950
|
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
943
951
|
while (1) switch (_context19.prev = _context19.next) {
|
|
944
952
|
case 0:
|
|
945
953
|
if (_this.libroService.active) {
|
|
946
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
954
|
+
_this.commandRegistry.executeCommand(NotebookCommands['ClearCellOutput'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
947
955
|
}
|
|
948
956
|
case 1:
|
|
949
957
|
case "end":
|
|
@@ -964,14 +972,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
964
972
|
return false;
|
|
965
973
|
}
|
|
966
974
|
});
|
|
967
|
-
commands.registerCommandWithContext(LabCommands.
|
|
975
|
+
commands.registerCommandWithContext(LabCommands.ClearAllCellOutput, this, {
|
|
968
976
|
execute: function () {
|
|
969
977
|
var _execute20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
970
978
|
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
971
979
|
while (1) switch (_context20.prev = _context20.next) {
|
|
972
980
|
case 0:
|
|
973
981
|
if (_this.libroService.active) {
|
|
974
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
982
|
+
_this.commandRegistry.executeCommand(NotebookCommands['ClearAllCellOutput'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
975
983
|
}
|
|
976
984
|
case 1:
|
|
977
985
|
case "end":
|
|
@@ -992,14 +1000,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
992
1000
|
return false;
|
|
993
1001
|
}
|
|
994
1002
|
});
|
|
995
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1003
|
+
commands.registerCommandWithContext(LabCommands.HideOrShowCellCode, this, {
|
|
996
1004
|
execute: function () {
|
|
997
1005
|
var _execute21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
998
1006
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
999
1007
|
while (1) switch (_context21.prev = _context21.next) {
|
|
1000
1008
|
case 0:
|
|
1001
1009
|
if (_this.libroService.active) {
|
|
1002
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
1010
|
+
_this.commandRegistry.executeCommand(NotebookCommands['HideOrShowCellCode'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
1003
1011
|
}
|
|
1004
1012
|
case 1:
|
|
1005
1013
|
case "end":
|
|
@@ -1020,14 +1028,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
1020
1028
|
return false;
|
|
1021
1029
|
}
|
|
1022
1030
|
});
|
|
1023
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1031
|
+
commands.registerCommandWithContext(LabCommands.HideOrShowOutputs, this, {
|
|
1024
1032
|
execute: function () {
|
|
1025
1033
|
var _execute22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
1026
1034
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
1027
1035
|
while (1) switch (_context22.prev = _context22.next) {
|
|
1028
1036
|
case 0:
|
|
1029
1037
|
if (_this.libroService.active) {
|
|
1030
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
1038
|
+
_this.commandRegistry.executeCommand(NotebookCommands['HideOrShowOutputs'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
1031
1039
|
}
|
|
1032
1040
|
case 1:
|
|
1033
1041
|
case "end":
|
|
@@ -1048,14 +1056,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
1048
1056
|
return false;
|
|
1049
1057
|
}
|
|
1050
1058
|
});
|
|
1051
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1059
|
+
commands.registerCommandWithContext(LabCommands.EnableOutputScrolling, this, {
|
|
1052
1060
|
execute: function () {
|
|
1053
1061
|
var _execute23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
1054
1062
|
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
1055
1063
|
while (1) switch (_context23.prev = _context23.next) {
|
|
1056
1064
|
case 0:
|
|
1057
1065
|
if (_this.libroService.active) {
|
|
1058
|
-
_this.commandRegistry.executeCommand(NotebookCommands['
|
|
1066
|
+
_this.commandRegistry.executeCommand(NotebookCommands['EnableOutputScrolling'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
1059
1067
|
}
|
|
1060
1068
|
case 1:
|
|
1061
1069
|
case "end":
|
|
@@ -1076,14 +1084,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
1076
1084
|
return false;
|
|
1077
1085
|
}
|
|
1078
1086
|
});
|
|
1079
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1087
|
+
commands.registerCommandWithContext(LabCommands.DisableOutputScrolling, this, {
|
|
1080
1088
|
execute: function () {
|
|
1081
|
-
var _execute24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(
|
|
1089
|
+
var _execute24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
1082
1090
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
1083
1091
|
while (1) switch (_context24.prev = _context24.next) {
|
|
1084
1092
|
case 0:
|
|
1085
|
-
if (
|
|
1086
|
-
|
|
1093
|
+
if (_this.libroService.active) {
|
|
1094
|
+
_this.commandRegistry.executeCommand(NotebookCommands['DisableOutputScrolling'].id, _this.libroService.active.activeCell, _this.libroService.active);
|
|
1087
1095
|
}
|
|
1088
1096
|
case 1:
|
|
1089
1097
|
case "end":
|
|
@@ -1091,27 +1099,27 @@ export var LabMenu = (_dec = singleton({
|
|
|
1091
1099
|
}
|
|
1092
1100
|
}, _callee24);
|
|
1093
1101
|
}));
|
|
1094
|
-
function execute(
|
|
1102
|
+
function execute() {
|
|
1095
1103
|
return _execute24.apply(this, arguments);
|
|
1096
1104
|
}
|
|
1097
1105
|
return execute;
|
|
1098
1106
|
}(),
|
|
1099
1107
|
isEnabled: function isEnabled(ctx) {
|
|
1100
1108
|
var libro = ctx.libroService.active;
|
|
1101
|
-
if (
|
|
1102
|
-
return
|
|
1109
|
+
if (libro && libro instanceof LibroJupyterView) {
|
|
1110
|
+
return true;
|
|
1103
1111
|
}
|
|
1104
|
-
return
|
|
1112
|
+
return false;
|
|
1105
1113
|
}
|
|
1106
1114
|
});
|
|
1107
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1115
|
+
commands.registerCommandWithContext(LabCommands.RunCell, this, {
|
|
1108
1116
|
execute: function () {
|
|
1109
1117
|
var _execute25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(ctx) {
|
|
1110
1118
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
1111
1119
|
while (1) switch (_context25.prev = _context25.next) {
|
|
1112
1120
|
case 0:
|
|
1113
1121
|
if (ctx.libroService.active) {
|
|
1114
|
-
ctx.commandRegistry.executeCommand(NotebookCommands['
|
|
1122
|
+
ctx.commandRegistry.executeCommand(NotebookCommands['RunCell'].id, ctx.libroService.active.activeCell, ctx.libroService.active);
|
|
1115
1123
|
}
|
|
1116
1124
|
case 1:
|
|
1117
1125
|
case "end":
|
|
@@ -1119,7 +1127,7 @@ export var LabMenu = (_dec = singleton({
|
|
|
1119
1127
|
}
|
|
1120
1128
|
}, _callee25);
|
|
1121
1129
|
}));
|
|
1122
|
-
function execute(
|
|
1130
|
+
function execute(_x) {
|
|
1123
1131
|
return _execute25.apply(this, arguments);
|
|
1124
1132
|
}
|
|
1125
1133
|
return execute;
|
|
@@ -1132,14 +1140,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
1132
1140
|
return libro.model.kernelConnection !== undefined && libro.model.kernelConnecting === false;
|
|
1133
1141
|
}
|
|
1134
1142
|
});
|
|
1135
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1143
|
+
commands.registerCommandWithContext(LabCommands.RunAllAbove, this, {
|
|
1136
1144
|
execute: function () {
|
|
1137
1145
|
var _execute26 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(ctx) {
|
|
1138
1146
|
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
1139
1147
|
while (1) switch (_context26.prev = _context26.next) {
|
|
1140
1148
|
case 0:
|
|
1141
1149
|
if (ctx.libroService.active) {
|
|
1142
|
-
ctx.commandRegistry.executeCommand(NotebookCommands['
|
|
1150
|
+
ctx.commandRegistry.executeCommand(NotebookCommands['RunAllAbove'].id, ctx.libroService.active.activeCell, ctx.libroService.active);
|
|
1143
1151
|
}
|
|
1144
1152
|
case 1:
|
|
1145
1153
|
case "end":
|
|
@@ -1147,7 +1155,7 @@ export var LabMenu = (_dec = singleton({
|
|
|
1147
1155
|
}
|
|
1148
1156
|
}, _callee26);
|
|
1149
1157
|
}));
|
|
1150
|
-
function execute(
|
|
1158
|
+
function execute(_x2) {
|
|
1151
1159
|
return _execute26.apply(this, arguments);
|
|
1152
1160
|
}
|
|
1153
1161
|
return execute;
|
|
@@ -1160,14 +1168,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
1160
1168
|
return libro.model.kernelConnection !== undefined && libro.model.kernelConnecting === false;
|
|
1161
1169
|
}
|
|
1162
1170
|
});
|
|
1163
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1171
|
+
commands.registerCommandWithContext(LabCommands.RunAllBelow, this, {
|
|
1164
1172
|
execute: function () {
|
|
1165
1173
|
var _execute27 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(ctx) {
|
|
1166
1174
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
1167
1175
|
while (1) switch (_context27.prev = _context27.next) {
|
|
1168
1176
|
case 0:
|
|
1169
1177
|
if (ctx.libroService.active) {
|
|
1170
|
-
ctx.commandRegistry.executeCommand(NotebookCommands['
|
|
1178
|
+
ctx.commandRegistry.executeCommand(NotebookCommands['RunAllBelow'].id, ctx.libroService.active.activeCell, ctx.libroService.active);
|
|
1171
1179
|
}
|
|
1172
1180
|
case 1:
|
|
1173
1181
|
case "end":
|
|
@@ -1175,7 +1183,7 @@ export var LabMenu = (_dec = singleton({
|
|
|
1175
1183
|
}
|
|
1176
1184
|
}, _callee27);
|
|
1177
1185
|
}));
|
|
1178
|
-
function execute(
|
|
1186
|
+
function execute(_x3) {
|
|
1179
1187
|
return _execute27.apply(this, arguments);
|
|
1180
1188
|
}
|
|
1181
1189
|
return execute;
|
|
@@ -1188,14 +1196,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
1188
1196
|
return libro.model.kernelConnection !== undefined && libro.model.kernelConnecting === false;
|
|
1189
1197
|
}
|
|
1190
1198
|
});
|
|
1191
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1199
|
+
commands.registerCommandWithContext(LabCommands.RunAllCells, this, {
|
|
1192
1200
|
execute: function () {
|
|
1193
1201
|
var _execute28 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(ctx) {
|
|
1194
1202
|
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
1195
1203
|
while (1) switch (_context28.prev = _context28.next) {
|
|
1196
1204
|
case 0:
|
|
1197
1205
|
if (ctx.libroService.active) {
|
|
1198
|
-
ctx.commandRegistry.executeCommand(NotebookCommands['
|
|
1206
|
+
ctx.commandRegistry.executeCommand(NotebookCommands['RunAllCells'].id, ctx.libroService.active.activeCell, ctx.libroService.active);
|
|
1199
1207
|
}
|
|
1200
1208
|
case 1:
|
|
1201
1209
|
case "end":
|
|
@@ -1203,7 +1211,7 @@ export var LabMenu = (_dec = singleton({
|
|
|
1203
1211
|
}
|
|
1204
1212
|
}, _callee28);
|
|
1205
1213
|
}));
|
|
1206
|
-
function execute(
|
|
1214
|
+
function execute(_x4) {
|
|
1207
1215
|
return _execute28.apply(this, arguments);
|
|
1208
1216
|
}
|
|
1209
1217
|
return execute;
|
|
@@ -1216,14 +1224,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
1216
1224
|
return libro.model.kernelConnection !== undefined && libro.model.kernelConnecting === false;
|
|
1217
1225
|
}
|
|
1218
1226
|
});
|
|
1219
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1227
|
+
commands.registerCommandWithContext(LabCommands.RunCellAndInsertBelow, this, {
|
|
1220
1228
|
execute: function () {
|
|
1221
1229
|
var _execute29 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(ctx) {
|
|
1222
1230
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
1223
1231
|
while (1) switch (_context29.prev = _context29.next) {
|
|
1224
1232
|
case 0:
|
|
1225
1233
|
if (ctx.libroService.active) {
|
|
1226
|
-
ctx.commandRegistry.executeCommand(NotebookCommands['
|
|
1234
|
+
ctx.commandRegistry.executeCommand(NotebookCommands['RunCellAndInsertBelow'].id, ctx.libroService.active.activeCell, ctx.libroService.active);
|
|
1227
1235
|
}
|
|
1228
1236
|
case 1:
|
|
1229
1237
|
case "end":
|
|
@@ -1231,7 +1239,7 @@ export var LabMenu = (_dec = singleton({
|
|
|
1231
1239
|
}
|
|
1232
1240
|
}, _callee29);
|
|
1233
1241
|
}));
|
|
1234
|
-
function execute(
|
|
1242
|
+
function execute(_x5) {
|
|
1235
1243
|
return _execute29.apply(this, arguments);
|
|
1236
1244
|
}
|
|
1237
1245
|
return execute;
|
|
@@ -1244,14 +1252,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
1244
1252
|
return libro.model.kernelConnection !== undefined && libro.model.kernelConnecting === false;
|
|
1245
1253
|
}
|
|
1246
1254
|
});
|
|
1247
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1255
|
+
commands.registerCommandWithContext(LabCommands.RunCellAndSelectNext, this, {
|
|
1248
1256
|
execute: function () {
|
|
1249
1257
|
var _execute30 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(ctx) {
|
|
1250
1258
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
1251
1259
|
while (1) switch (_context30.prev = _context30.next) {
|
|
1252
1260
|
case 0:
|
|
1253
1261
|
if (ctx.libroService.active) {
|
|
1254
|
-
|
|
1262
|
+
ctx.commandRegistry.executeCommand(NotebookCommands['RunCellAndSelectNext'].id, ctx.libroService.active.activeCell, ctx.libroService.active);
|
|
1255
1263
|
}
|
|
1256
1264
|
case 1:
|
|
1257
1265
|
case "end":
|
|
@@ -1259,7 +1267,7 @@ export var LabMenu = (_dec = singleton({
|
|
|
1259
1267
|
}
|
|
1260
1268
|
}, _callee30);
|
|
1261
1269
|
}));
|
|
1262
|
-
function execute(
|
|
1270
|
+
function execute(_x6) {
|
|
1263
1271
|
return _execute30.apply(this, arguments);
|
|
1264
1272
|
}
|
|
1265
1273
|
return execute;
|
|
@@ -1279,7 +1287,7 @@ export var LabMenu = (_dec = singleton({
|
|
|
1279
1287
|
while (1) switch (_context31.prev = _context31.next) {
|
|
1280
1288
|
case 0:
|
|
1281
1289
|
if (ctx.libroService.active) {
|
|
1282
|
-
|
|
1290
|
+
_this.commandRegistry.executeCommand(NotebookCommands['RestartRunAll'].id, ctx.libroService.active.activeCell, ctx.libroService.active);
|
|
1283
1291
|
}
|
|
1284
1292
|
case 1:
|
|
1285
1293
|
case "end":
|
|
@@ -1287,7 +1295,7 @@ export var LabMenu = (_dec = singleton({
|
|
|
1287
1295
|
}
|
|
1288
1296
|
}, _callee31);
|
|
1289
1297
|
}));
|
|
1290
|
-
function execute(
|
|
1298
|
+
function execute(_x7) {
|
|
1291
1299
|
return _execute31.apply(this, arguments);
|
|
1292
1300
|
}
|
|
1293
1301
|
return execute;
|
|
@@ -1300,14 +1308,14 @@ export var LabMenu = (_dec = singleton({
|
|
|
1300
1308
|
return libro.model.kernelConnection !== undefined && libro.model.kernelConnecting === false;
|
|
1301
1309
|
}
|
|
1302
1310
|
});
|
|
1303
|
-
commands.registerCommandWithContext(LabCommands.
|
|
1311
|
+
commands.registerCommandWithContext(LabCommands.RestartRunAll, this, {
|
|
1304
1312
|
execute: function () {
|
|
1305
1313
|
var _execute32 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(ctx) {
|
|
1306
1314
|
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
1307
1315
|
while (1) switch (_context32.prev = _context32.next) {
|
|
1308
1316
|
case 0:
|
|
1309
1317
|
if (ctx.libroService.active) {
|
|
1310
|
-
|
|
1318
|
+
ctx.commandRegistry.executeCommand(NotebookCommands['RestartRunAll'].id, ctx.libroService.active.activeCell, ctx.libroService.active);
|
|
1311
1319
|
}
|
|
1312
1320
|
case 1:
|
|
1313
1321
|
case "end":
|
|
@@ -1315,7 +1323,7 @@ export var LabMenu = (_dec = singleton({
|
|
|
1315
1323
|
}
|
|
1316
1324
|
}, _callee32);
|
|
1317
1325
|
}));
|
|
1318
|
-
function execute(
|
|
1326
|
+
function execute(_x8) {
|
|
1319
1327
|
return _execute32.apply(this, arguments);
|
|
1320
1328
|
}
|
|
1321
1329
|
return execute;
|
|
@@ -1328,6 +1336,34 @@ export var LabMenu = (_dec = singleton({
|
|
|
1328
1336
|
return libro.model.kernelConnection !== undefined && libro.model.kernelConnecting === false;
|
|
1329
1337
|
}
|
|
1330
1338
|
});
|
|
1339
|
+
commands.registerCommandWithContext(LabCommands.RestartAndRunToSelected, this, {
|
|
1340
|
+
execute: function () {
|
|
1341
|
+
var _execute33 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(ctx) {
|
|
1342
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
1343
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1344
|
+
case 0:
|
|
1345
|
+
if (ctx.libroService.active) {
|
|
1346
|
+
_this.commandRegistry.executeCommand(NotebookCommands['RestartAndRunToSelected'].id, ctx.libroService.active.activeCell, ctx.libroService.active);
|
|
1347
|
+
}
|
|
1348
|
+
case 1:
|
|
1349
|
+
case "end":
|
|
1350
|
+
return _context33.stop();
|
|
1351
|
+
}
|
|
1352
|
+
}, _callee33);
|
|
1353
|
+
}));
|
|
1354
|
+
function execute(_x9) {
|
|
1355
|
+
return _execute33.apply(this, arguments);
|
|
1356
|
+
}
|
|
1357
|
+
return execute;
|
|
1358
|
+
}(),
|
|
1359
|
+
isEnabled: function isEnabled(ctx) {
|
|
1360
|
+
var libro = ctx.libroService.active;
|
|
1361
|
+
if (!libro || !(libro instanceof LibroJupyterView)) {
|
|
1362
|
+
return false;
|
|
1363
|
+
}
|
|
1364
|
+
return libro.model.kernelConnection !== undefined && libro.model.kernelConnecting === false;
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1331
1367
|
}
|
|
1332
1368
|
}]);
|
|
1333
1369
|
return LabMenu;
|
|
@@ -1356,4 +1392,9 @@ export var LabMenu = (_dec = singleton({
|
|
|
1356
1392
|
enumerable: true,
|
|
1357
1393
|
writable: true,
|
|
1358
1394
|
initializer: null
|
|
1395
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "slotManager", [_dec7], {
|
|
1396
|
+
configurable: true,
|
|
1397
|
+
enumerable: true,
|
|
1398
|
+
writable: true,
|
|
1399
|
+
initializer: null
|
|
1359
1400
|
})), _class2)) || _class);
|